/* Engage console — used from a phone or a second laptop, never the projector. */
:root {
  --bg: #f5f6f8; --card: #fff; --fg: #1d2327; --muted: #5f6b73; --line: #d7dce1;
  --accent: #0b7a5a; --accent-fg: #fff; --open: #0b7a5a; --closed: #6b7280; --warn: #b45309; --err: #b42318;
  --right: #e6f4ee;
  --tamil: "Anjal InaiMathi New", "Tamil Sangam MN", "Noto Sans Tamil", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11161b; --card: #1a2128; --fg: #e6edf3; --muted: #9aa7b2; --line: #2f3943;
    --accent: #3fb68b; --accent-fg: #06231a; --open: #3fb68b; --closed: #8b949e; --warn: #e3b341; --err: #ff7b72;
    --right: #173a2e;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.5 system-ui, -apple-system, sans-serif; }
.tamil, textarea, input { font-family: var(--tamil); }

.top { position: sticky; top: 0; z-index: 5; background: var(--card); border-bottom: 1px solid var(--line); padding: 10px 16px; }
.brand { font-weight: 700; }
.event { font-weight: 400; color: var(--muted); }
.sections { display: flex; gap: 14px; margin-top: 6px; overflow-x: auto; }
.sections a { color: var(--muted); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; white-space: nowrap; }
.sections a.on { color: var(--fg); border-color: var(--accent); }

main { max-width: 760px; margin: 0 auto; padding: 16px; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
h1 { font-size: 20px; margin: 0; }
.note { color: var(--muted); font-size: 14px; margin: 6px 0 14px; }

.list { display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.card.hidden { opacity: .6; }
#messages .q { font-size: 16px; margin: 6px 0 0; white-space: pre-wrap; }
.card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.num { font-weight: 700; }
.chip { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.chip.open { background: var(--open); color: var(--accent-fg); border-color: var(--open); }
.chip.closed { color: var(--closed); }
.chip.hidden { color: var(--warn); border-color: var(--warn); }
.answered { margin-left: auto; font-size: 13px; color: var(--muted); }
.q { font-family: var(--tamil); font-size: 17px; margin: 8px 0; }
.opts-view { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); overflow-wrap: anywhere; gap: 6px; font-family: var(--tamil); }
.opts-view div { padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line); }
.opts-view .right { background: var(--right); border-color: var(--accent); font-weight: 600; }
.typed { font-family: var(--tamil); font-size: 14px; }
.typed b { font-family: system-ui, sans-serif; }
.card-actions { display: flex; gap: 8px; margin-top: 10px; }
.btn.icon { min-width: 44px; padding: 9px 0; }

.btn { font: 600 15px system-ui, sans-serif; border: 1px solid var(--line); background: var(--card); color: var(--fg);
       border-radius: 8px; padding: 9px 14px; cursor: pointer; }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: default; }

.editor { width: min(640px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 12px; padding: 0;
          background: var(--card); color: var(--fg); }
.editor::backdrop { background: rgba(0, 0, 0, .45); }
.editor form { padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.editor h2 { margin: 0 0 6px; font-size: 18px; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 14px; }
input, textarea { font-size: 16px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); width: 100%; }
input[name="number"] { width: 6em; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin: 6px 0 0; }
legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
.opts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.opts label { flex-direction: row; align-items: center; gap: 8px; }
details { margin: 4px 0; }
summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.label { font-weight: 600; font-size: 14px; }
.choice { display: flex; gap: 8px; margin-top: 4px; }
.choice label { flex-direction: row; align-items: center; gap: 6px; font-weight: 400; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; cursor: pointer; }
.choice input { width: auto; }
.err { color: var(--err); font-size: 13px; font-weight: 400; min-height: 0; }
.err:empty { display: none; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); max-width: calc(100vw - 32px); z-index: 20;
         background: var(--fg); color: var(--bg); padding: 10px 14px; border-radius: 8px; font-size: 14px; }
.toast.warn { background: var(--warn); color: #fff; }
.gate { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: var(--bg); padding: 16px; }
.gate form { display: flex; flex-direction: column; gap: 10px; width: min(340px, 100%); }
.gate input { text-align: center; letter-spacing: .3em; font-size: 22px; }
[hidden] { display: none !important; }

/* Unanswered: a count in the tab; handled messages fade back. */
.badge { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 2px; border-radius: 99px;
         background: var(--warn); color: var(--bg); font-size: 12px; font-weight: 700; text-align: center; }
.followup textarea { margin-top: 10px; }
.followup.replied, .followup.dismissed { opacity: .65; }
.followup .err { margin: 8px 0 0; }
.followup .q, .followup .typed { white-space: pre-wrap; }

/* Gifts: the address list to paste into the coupon in Order Admin. */
.btn.on { border-color: var(--accent); color: var(--accent); }
#gift-emails { margin-top: 10px; font-family: ui-monospace, Menlo, monospace; font-size: 14px; }
