/* Secretary PWA — MathMate brand (values from ignite/business-plan-2026-08/brand.css) */
@font-face { font-family: 'League Spartan'; src: url('fonts/LeagueSpartan.ttf'); font-weight: 100 900; }
@font-face { font-family: 'Open Sans'; src: url('fonts/OpenSans-400.ttf'); font-weight: 400; }
@font-face { font-family: 'Open Sans'; src: url('fonts/OpenSans-700.ttf'); font-weight: 700; }

:root {
  --orange: #FD3A05;
  --lime: #A3E635;
  --lime-dark: #65A30D;
  --ink: #111111;
  --muted: #555555;
  --bg: #ffffff;
  --card: #FAFAF7;
  --line: #e5e5e0;
  --amber: #f59e0b;
  --red: #dc2626;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Open Sans', system-ui, sans-serif;
  color: var(--ink); background: var(--bg);
  min-height: 100dvh;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}

/* top bar */
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  border-bottom: 3px solid var(--lime);
  position: sticky; top: 0; background: var(--bg); z-index: 5;
}
.topbar .logo { width: 30px; height: 30px; border-radius: 7px; }
.topbar h1 {
  font-family: 'League Spartan', sans-serif; font-weight: 800;
  font-size: 22px; margin: 0; letter-spacing: -0.5px; flex: 1;
}
.dot { color: var(--orange); }
.mode-pill {
  font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px;
  background: var(--lime); color: var(--ink); text-transform: capitalize;
}
.mode-pill.quiet { background: #eee; color: var(--muted); }

main { padding: 16px; max-width: 560px; margin: 0 auto; }
.tab { display: none; }
.tab.active { display: block; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px);} to { opacity: 1; transform: none; } }

.eyebrow {
  font-family: 'League Spartan', sans-serif; font-weight: 800; color: var(--lime-dark);
  letter-spacing: 2px; text-transform: uppercase; font-size: 13px; margin: 18px 0 10px;
}
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 13px; line-height: 1.5; }
.err { color: var(--red); font-size: 13px; min-height: 1em; }

/* status loops */
.loop-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px; margin-bottom: 10px;
}
.light { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.light.green { background: var(--lime-dark); box-shadow: 0 0 0 4px rgba(101,163,13,.18); }
.light.amber { background: var(--amber); box-shadow: 0 0 0 4px rgba(245,158,11,.18); }
.light.red   { background: var(--red);   box-shadow: 0 0 0 4px rgba(220,38,38,.18); }
.loop-name { font-weight: 700; text-transform: capitalize; }
.loop-age { margin-left: auto; color: var(--muted); font-size: 13px; }

/* mode switcher */
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-btn {
  font-family: 'League Spartan', sans-serif; font-weight: 700; font-size: 16px;
  padding: 16px 8px; border-radius: 14px; border: 2px solid var(--line);
  background: var(--card); color: var(--ink); cursor: pointer;
}
.mode-btn.current { background: var(--lime); border-color: var(--lime); }
.mode-btn:active { transform: scale(.97); }

/* queue cards */
.qcard {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; margin-bottom: 12px;
}
.qcard.state-approved { border-left: 5px solid var(--lime-dark); }
.qcard.state-parked { opacity: .6; }
.qcard.state-pending { border-left: 5px solid var(--orange); }
.qcard h3 { margin: 0 0 4px; font-size: 15.5px; font-weight: 700; }
.qcard .qmeta { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.qcard .qprev { font-size: 13.5px; color: var(--muted); line-height: 1.45; margin-bottom: 12px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row { display: flex; gap: 10px; }

/* buttons */
.btn {
  font-family: 'League Spartan', sans-serif; font-weight: 700; font-size: 15px;
  border: none; border-radius: 999px; padding: 12px 20px; cursor: pointer; color: var(--ink);
}
.btn:active { transform: scale(.97); }
.btn-lime { background: var(--lime); }
.btn-orange { background: var(--orange); color: #fff; }
.btn-ghost { background: transparent; border: 2px solid var(--line); }
.btn-big { width: 100%; padding: 16px; font-size: 18px; margin-top: 12px; }
.btn[disabled] { opacity: .5; }

/* feed */
.digest {
  background: #F5FBE8; border-radius: 14px; padding: 14px; margin-top: 16px;
  font-size: 13.5px; line-height: 1.5; white-space: pre-wrap;
}
.feed-row { display: flex; gap: 10px; padding: 11px 2px; border-bottom: 1px dotted var(--line); font-size: 13.5px; }
.feed-when { color: var(--muted); flex-shrink: 0; width: 62px; }
.feed-msg { line-height: 1.4; overflow-wrap: anywhere; }

/* command */
textarea {
  width: 100%; font-family: 'Open Sans', sans-serif; font-size: 16px;
  border: 2px solid var(--line); border-radius: 14px; padding: 14px; resize: vertical;
  background: var(--card); color: var(--ink);
}
textarea:focus { outline: none; border-color: var(--lime); }

/* bottom tab bar */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  display: flex; background: var(--bg); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button {
  flex: 1; background: none; border: none; padding: 10px 0 12px;
  font-family: 'League Spartan', sans-serif; font-weight: 700; font-size: 13px;
  color: var(--muted); cursor: pointer; position: relative;
}
.tabbar button .ic { display: block; font-size: 17px; margin-bottom: 2px; }
.tabbar button.active { color: var(--ink); }
.tabbar button.active .ic { color: var(--orange); }
.badge {
  position: absolute; top: 4px; right: 24%;
  background: var(--orange); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 999px; min-width: 18px; height: 18px; line-height: 18px;
}

/* overlays (token gate + detail) */
.gate {
  position: fixed; inset: 0; z-index: 20; background: rgba(17,17,17,.5);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.gate[hidden] { display: none; }
.gate-card {
  background: var(--bg); border-radius: 18px; padding: 24px; width: 100%; max-width: 420px;
  text-align: center;
}
.gate-card h2 { font-family: 'League Spartan', sans-serif; font-weight: 800; margin: 8px 0; }
.logo-big { width: 64px; border-radius: 14px; }
.gate-card input {
  width: 100%; font-size: 16px; padding: 13px; border: 2px solid var(--line);
  border-radius: 12px; margin-top: 8px;
}
.detail-card { text-align: left; max-height: 82dvh; display: flex; flex-direction: column; }
.detail-card h2 { font-size: 17px; }
.detail-card pre {
  flex: 1; overflow: auto; background: var(--card); border-radius: 12px; padding: 12px;
  font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5;
}

.voice-card{margin-bottom:10px}
.test-btn{margin:6px 0;padding:10px 16px;border:1.5px solid var(--ink,#111);background:transparent;border-radius:999px;font:inherit;font-weight:700;cursor:pointer}
.test-btn:active{transform:scale(.98)}
.hint.good{color:#2e7d32;font-weight:700}
.hint.bad{color:#c62828;font-weight:700}
