:root {
  --bg: #ece2cf;            /* tan page background */
  --surface: #f7f0e2;       /* light tan cards and header */
  --text: #1a1a17;          /* near black */
  --muted: #5b5a4c;         /* soft dark olive for secondary text */
  --border: #d8c9ac;        /* darker tan */
  --accent: #2f4a36;        /* forest green */
  --accent-hover: #223829;  /* deeper forest green */
  --accent-soft: #dde3cf;   /* pale sage */
  --danger: #6e4b2a;        /* dark brown */
  --radius: 12px;
  --shadow: 0 1px 2px rgba(60, 45, 20, 0.08), 0 1px 3px rgba(60, 45, 20, 0.1);
  --on-accent: #f7f0e2;     /* tan text on green */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  line-height: 1.5;
}

.hidden { display: none !important; }

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

h1 {
  font-size: 1.5rem;
  margin: 0 0 4px;
}

.muted { color: var(--muted); }
.error { color: var(--danger); min-height: 1.5em; }

/* Header */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 60px;
}

.brand {
  font-weight: 700;
  font-size: 1.15rem;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-name {
  color: var(--muted);
  font-size: 0.9rem;
}

.tabs-row {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs-row::-webkit-scrollbar { display: none; }

.tab {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.95rem;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab:hover { color: var(--text); }

.tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.count {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.75rem;
  padding: 0 7px;
  min-width: 22px;
  text-align: center;
  font-weight: 600;
}

.tab.active .count,
.count.attention {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
}

/* Buttons */

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 14px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.btn:hover { background: var(--bg); }
.btn:disabled { opacity: 0.55; cursor: default; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-link {
  border: none;
  background: none;
  color: var(--muted);
  padding: 8px 4px;
  font-weight: 500;
}

.btn-link:hover { background: none; color: var(--text); }

.btn-danger {
  color: var(--danger);
}

/* Panels */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  margin: 48px auto;
  max-width: 440px;
}

.center { text-align: center; }

.page-head { margin: 28px 0 20px; }
.page-head p { margin: 0; }

/* Question list */

.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 760px;
  padding-bottom: 48px;
}

.card {
  appearance: none;
  text-align: left;
  font: inherit;
  color: inherit;
  width: 100%;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: box-shadow 0.12s ease, border-color 0.12s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card:hover {
  border-color: #c6b28c;
  box-shadow: 0 4px 14px rgba(60, 45, 20, 0.12);
}

.card-question {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.card-meta {
  color: var(--muted);
  font-size: 0.8rem;
}

.card-answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.empty {
  text-align: center;
  padding: 48px 0;
  max-width: 760px;
}

/* Answers */

.answer {
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 12px;
}

.answer .who,
.answer strong {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-bottom: 4px;
}

.answer p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.95rem;
}

.answers {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Question view */

.modal,
.small-modal {
  border: none;
  border-radius: var(--radius);
  padding: 0;
  box-shadow: 0 20px 60px rgba(30, 40, 30, 0.3);
  background: var(--surface);
  color: var(--text);
}

.modal { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
.small-modal { width: min(480px, calc(100vw - 32px)); }

.modal::backdrop,
.small-modal::backdrop { background: rgba(26, 38, 29, 0.55); }

.modal-body,
.small-inner {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-top,
.small-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.modal-top .meta { font-size: 0.85rem; color: var(--muted); }

.small-head h2 { margin: 0; font-size: 1.15rem; }
.small-inner p { margin: 0; }

.modal-question {
  margin: 0;
  font-size: 1.4rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.close-btn {
  appearance: none;
  border: none;
  background: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 0 4px;
}

.note {
  background: var(--accent-soft);
  color: #1f3326;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.9rem;
}

.answer-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-weight: 600;
  font-size: 0.9rem;
}

textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font: inherit;
  font-size: 1rem;
  background: #fbf6ec;
  color: var(--text);
}

textarea.short { min-height: 90px; }

textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: transparent;
}

.error:empty { display: none; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.85rem;
  margin-top: 8px;
}

.modal-footer {
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

/* Toasts */

.toasts {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
  width: max-content;
  max-width: calc(100vw - 32px);
}

.toast {
  background: var(--accent);
  color: var(--on-accent);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  box-shadow: 0 6px 20px rgba(30, 40, 30, 0.25);
}

/* Small screens */

@media (max-width: 720px) {
  .card-answers { grid-template-columns: 1fr; }
  .modal-question { font-size: 1.2rem; }
  .user-name { display: none; }
  .brand { font-size: 1rem; }
  .header-actions { gap: 6px; }
  .header-actions .btn { white-space: nowrap; padding: 7px 10px; }
}
