:root {
  --green: #125a3c;
  --green-dark: #0c3f2a;
  --bg: #f6f5f2;
  --card-bg: #ffffff;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --border: #e2e0da;
  --danger: #b3261e;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: 2rem;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--green);
  color: white;
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-header h1 {
  font-size: 1.25rem;
  margin: 0;
}

main {
  max-width: 480px;
  margin: 0 auto;
  padding: 1rem;
}

.card {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 1.1rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.card h2 {
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
}

.optional-tag {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-left: 0.4rem;
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 0.9rem;
}

.thumbnails {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}

.thumbnails:empty {
  margin-bottom: 0;
}

.thumbnail {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumbnail button {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  line-height: 1;
  font-size: 0.85rem;
  cursor: pointer;
}

.camera-btn,
.record-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.camera-btn {
  background: var(--green);
  color: white;
}

.camera-btn:active {
  background: var(--green-dark);
}

.record-btn {
  background: var(--danger);
  color: white;
  flex: 1;
}

.record-btn.recording {
  background: #7a1a15;
}

.record-btn:disabled {
  opacity: 0.5;
}

.text-btn {
  background: none;
  border: none;
  color: white;
  font-size: 0.9rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0.25rem;
}

.field {
  margin-bottom: 0.9rem;
}

.field:last-child {
  margin-bottom: 0;
}

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--muted);
}

.field-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.field-row input,
.field-row textarea {
  flex: 1;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
}

.field-row textarea {
  resize: vertical;
}

.record-row {
  margin-bottom: 0.9rem;
  align-items: center;
}

.copy-btn {
  flex-shrink: 0;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--green);
  background: white;
  color: var(--green);
  font-weight: 600;
  cursor: pointer;
  min-width: 4.2rem;
}

.copy-btn.copied {
  background: var(--green);
  color: white;
}

.status {
  display: block;
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 0.7rem;
}

.status.error {
  color: var(--danger);
}
