/* AAROORA - black, white, one restrained cyan accent. Fonts are self-hosted. */
@font-face { font-family: "Google Sans Flex"; src: url("/fonts/google-sans-flex.woff2") format("woff2"); font-weight: 100 1000; font-display: swap; }
@font-face { font-family: "Google Sans Code"; src: url("/fonts/google-sans-code.woff2") format("woff2"); font-weight: 300 800; font-display: swap; }
@font-face { font-family: "Noto Sans Tamil"; src: url("/fonts/noto-sans-tamil-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Noto Sans Tamil"; src: url("/fonts/noto-sans-tamil-600.woff2") format("woff2"); font-weight: 500 700; font-display: swap; }

:root {
  --bg: #000000;
  --panel: #050505;
  --input: #0a0a0a;
  --line: #262626;
  --line-soft: #1a1a1a;
  --line-strong: #333333;
  --text: #ffffff;
  --text-2: #e6e6e6;
  --muted: #a8a8a8;
  --dim: #8c8c8c;
  --accent: #5eeaff;
  --alert: #ffb020;
  --danger: #ff6b6b;
  --sans: "Google Sans Flex", "Noto Sans Tamil", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Google Sans Flex", "Noto Sans Tamil", system-ui, sans-serif;
  --mono: "Google Sans Code", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --tamil: "Noto Sans Tamil", var(--sans);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 15px; }
body { min-height: 100vh; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--text); }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- type helpers ---------- */
.mono { font-family: var(--mono); }
.label { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; color: var(--dim); text-transform: uppercase; }
.label.accent { color: var(--accent); }
.label.alert { color: var(--alert); }
.display { font-family: var(--display); }
.tamil { font-family: var(--tamil); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }

/* ---------- buttons ---------- */
.btn { height: 44px; padding: 0 16px; background: transparent; border: 1px solid var(--line-strong); color: var(--text);
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--text); color: #000; border-color: var(--text); }
.btn.primary:hover { background: #d9d9d9; }
.btn.small { height: 32px; padding: 0 10px; font-size: 10px; }
.btn.accent { border-color: var(--accent); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.icon-btn { width: 44px; height: 44px; padding: 0; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 18px; }
.login .brand { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.login .brand span { font-family: var(--display); font-weight: 600; font-size: 30px; letter-spacing: .14em; }
.field { display: flex; flex-direction: column; gap: 8px; }
.input { height: 48px; background: var(--input); border: 1px solid var(--line-strong); color: var(--text); padding: 0 14px; outline: none; width: 100%; }
.input:focus { border-color: var(--accent); }
textarea.input { height: auto; padding: 12px 14px; resize: vertical; }
select.input { appearance: none; }
.error { color: var(--danger); font-size: 13px; min-height: 18px; }

/* ---------- shell ---------- */
.topbar { flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 5; }
.brand-sm { display: flex; align-items: center; gap: 10px; }
.brand-sm span { font-family: var(--display); font-weight: 600; font-size: 18px; letter-spacing: .14em; }
.nav { display: flex; flex-wrap: wrap; gap: 2px; }
.nav a { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; color: var(--dim); text-decoration: none; padding: 10px 10px; border-bottom: 1px solid transparent; }
.nav a:hover { color: var(--text); }
.nav a.on { color: var(--text); border-bottom-color: var(--accent); }
.nav .count { color: var(--alert); margin-left: 4px; }
.right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.seg { display: flex; flex-wrap: wrap; border: 1px solid var(--line-strong); }
.seg button { height: 34px; padding: 0 12px; border: 0; background: transparent; color: var(--muted); font-family: var(--mono); font-size: 10px; letter-spacing: .12em; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--text); color: #000; }
.clock { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.alert-btn { border-color: var(--alert); color: var(--alert); height: 34px; }

main.view { }

/* ---------- home ---------- */
.home { display: flex; flex-wrap: wrap; gap: 1px; background: var(--line); }
.home > * { background: var(--bg); }
.rail { flex: 1 1 260px; max-width: 320px; padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.officer-list { list-style: none; margin: 0; padding: 0; }
.officer-list li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: #4a4a4a; }
.dot.active { background: var(--accent); } .dot.alert { background: var(--alert); } .dot.info { background: var(--text); }
.officer-list .name { font-size: 14px; font-weight: 500; }
.officer-list .ta { font-family: var(--tamil); font-size: 12px; color: var(--dim); margin-left: 4px; font-weight: 400; }
.officer-list .st { font-family: var(--mono); font-size: 10px; color: var(--dim); letter-spacing: .06em; }
.officer-list .st.alert { color: var(--alert); }
.card { border: 1px solid var(--line-strong); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card.accent { border-color: var(--accent); }
.card.alertc { border-color: var(--alert); }
.card h3 { margin: 0; font-family: var(--display); font-weight: 500; font-size: 18px; line-height: 1.3; }

.mapwrap { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; min-height: 520px; }
.maptools { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 32px; padding: 0 10px; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; background: transparent; border: 1px solid var(--line-strong); color: var(--dim); cursor: pointer; }
.chip[aria-pressed="true"] { border-color: var(--accent); color: var(--text); }
.chip.na { border-style: dashed; }
.map { position: relative; flex: 1; min-height: 440px; }
.map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.map .pt { cursor: pointer; }
.legend { position: absolute; left: 12px; bottom: 12px; background: rgba(0,0,0,.88); border: 1px solid var(--line); padding: 10px 12px; display: flex; flex-direction: column; gap: 5px; font-family: var(--mono); font-size: 10px; color: var(--muted); }
.popup { position: absolute; top: 12px; left: 12px; width: 300px; max-width: calc(100% - 24px); background: rgba(0,0,0,.92); border: 1px solid var(--accent); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.popup.alertc { border-color: var(--alert); }
.empty { padding: 20px; color: var(--muted); font-size: 14px; }
.map .empty { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; background: rgba(0,0,0,.85); border: 1px dashed var(--line-strong); }

.convo { flex: 1 1 360px; max-width: 460px; display: flex; flex-direction: column; min-height: 520px; }
.convo-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 16px; max-height: calc(100vh - 260px); }
.msg-owner { align-self: flex-end; max-width: 85%; border: 1px solid var(--line-strong); padding: 10px 13px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
.msg-ai { display: flex; flex-direction: column; gap: 7px; max-width: 94%; }
.msg-ai .body { font-size: 14px; line-height: 1.6; color: var(--text-2); white-space: pre-wrap; }
.msg-sys { font-family: var(--mono); font-size: 11px; color: var(--danger); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font-family: var(--mono); font-size: 10px; letter-spacing: .06em; border: 1px solid var(--line-strong); padding: 3px 7px; color: var(--muted); background: transparent; }
.badge.ok { border-color: var(--text); color: var(--text); }
.badge.warn { border-color: var(--alert); color: var(--alert); }
.badge.link { color: var(--accent); cursor: pointer; }
.sources { display: flex; flex-direction: column; gap: 6px; border-left: 1px solid var(--line-strong); padding-left: 10px; }
.sources div { font-size: 12px; color: var(--muted); line-height: 1.45; }
.composer { display: flex; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line-soft); }
.composer .input { flex: 1; min-width: 0; }
.mic { width: 48px; height: 48px; border: 1px solid var(--text); background: transparent; color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center; flex: none; }
.mic.live { background: var(--text); color: #000; }
.mic:disabled { border-color: var(--line-strong); color: var(--dim); cursor: not-allowed; }
.partial { padding: 0 18px 10px; font-size: 13px; color: var(--muted); min-height: 0; }

.priorities { display: flex; flex-wrap: wrap; gap: 1px; background: var(--line); border-top: 1px solid var(--line); }
.priorities > * { background: var(--bg); flex: 1 1 260px; padding: 14px 20px; display: flex; align-items: center; gap: 12px; }
.priorities input[type=checkbox] { width: 20px; height: 20px; accent-color: #fff; flex: none; }
.priorities .main { display: flex; flex-direction: column; gap: 4px; }

/* ---------- generic page ---------- */
.page { max-width: 1100px; margin: 0 auto; padding: 40px 24px 80px; display: flex; flex-direction: column; gap: 32px; }
.page h1 { margin: 0; font-family: var(--display); font-weight: 500; font-size: 30px; letter-spacing: .02em; }
.page h2 { margin: 0; font-family: var(--display); font-weight: 500; font-size: 20px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.cells { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.cells > * { background: var(--bg); padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list li { padding: 12px 0; border-bottom: 1px solid var(--line-soft); display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; }
.list li .main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.unread { border-left: 2px solid var(--accent); padding-left: 10px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line-soft); }
th { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; color: var(--dim); font-weight: 400; }

/* ---------- council ---------- */
.council-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.timer { font-family: var(--mono); font-size: 40px; }
.timer small { font-size: 15px; color: var(--dim); }
.bar { display: flex; gap: 3px; height: 8px; }
.bar > div { background: #1f1f1f; position: relative; }
.bar .fill { position: absolute; inset: 0 auto 0 0; background: var(--accent); }
.council-body { display: flex; flex-wrap: wrap; gap: 1px; background: var(--line); min-height: calc(100vh - 230px); }
.council-body > * { background: var(--bg); padding: 20px; }
.agenda { flex: 1 1 250px; max-width: 320px; }
.agenda li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.speaker { flex: 999 1 480px; min-width: 0; padding: 28px 32px !important; display: flex; flex-direction: column; gap: 24px; }
.speaker .who { font-family: var(--display); font-size: 42px; font-weight: 600; }
.decisions { flex: 1 1 280px; max-width: 360px; display: flex; flex-direction: column; gap: 16px; }

/* ---------- focus ---------- */
.focus { max-width: 760px; margin: 0 auto; padding: 48px 24px 80px; display: flex; flex-direction: column; gap: 36px; }
.focus h1 { margin: 0; font-family: var(--display); font-weight: 500; font-size: clamp(30px, 5vw, 48px); line-height: 1.1; }
.big-time { font-family: var(--mono); font-size: clamp(56px, 10vw, 96px); line-height: 1; }
.progress { height: 4px; background: #1f1f1f; } .progress div { height: 100%; background: var(--accent); }
.actions4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.actions4 .btn { height: 52px; }

/* ---------- learn ---------- */
.flash { border: 1px solid var(--line-strong); padding: 32px; min-height: 220px; display: flex; flex-direction: column; gap: 18px; justify-content: center; }
.flash .q { font-family: var(--display); font-size: 24px; line-height: 1.35; }
.flash .a { font-size: 17px; line-height: 1.55; color: var(--text-2); border-top: 1px solid var(--line); padding-top: 16px; }

/* ---------- toast ---------- */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #000; border: 1px solid var(--accent); padding: 12px 16px; font-size: 13px; z-index: 20; max-width: calc(100% - 32px); }

@media (max-width: 700px) {
  .topbar { padding: 10px 12px; }
  .rail, .convo, .agenda, .decisions { max-width: none; }
  .convo { order: -1; }           /* on a phone the conversation comes first */
  .mapwrap { min-height: 420px; }
  .legend { display: none; }
  .msgs { max-height: none; }
  .speaker { padding: 20px !important; }
  .speaker .who { font-size: 32px; }
}

/* ---------- full-screen shell (desktop) ---------- */
.shell { display: flex; flex-direction: column; min-height: 100vh; }
.home-wrap { display: flex; flex-direction: column; }
.welcome { display: flex; flex-direction: column; gap: 12px; padding: 8px 0; }
.welcome-title { font-family: var(--display); font-size: 26px; font-weight: 500; }
.starters { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.starter { text-align: left; background: transparent; border: 1px solid var(--line-strong); color: var(--text-2); padding: 10px 12px; font-size: 13px; cursor: pointer; }
.starter:hover { border-color: var(--accent); color: var(--text); }
.feed { position: absolute; right: 12px; top: 12px; width: 290px; max-width: calc(100% - 24px); max-height: 46%; overflow-y: auto;
  background: rgba(0,0,0,.86); border: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.feed-item { all: unset; cursor: pointer; display: flex; flex-direction: column; gap: 3px; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.feed-item:hover .feed-title, .feed-item:focus-visible .feed-title { color: var(--text); }
.feed-item:focus-visible { outline: 1px solid var(--accent); }
.feed-title { font-size: 12.5px; line-height: 1.4; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.popup { max-height: calc(100% - 24px); overflow-y: auto; width: 340px; }
.popup-list { display: flex; flex-direction: column; }
.popup-item { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line-soft); font-size: 13px; line-height: 1.45; }

@media (min-width: 1000px) {
  .shell { height: 100vh; }
  .shell > main.view { flex: 1; min-height: 0; overflow-y: auto; }
  .home-wrap { height: 100%; }
  .home { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(240px, 280px) minmax(0, 1fr) minmax(340px, 420px); }
  .rail { max-width: none; overflow-y: auto; }
  .mapwrap, .convo { min-height: 0; max-width: none; }
  .map { min-height: 0; }
  .msgs { max-height: none; min-height: 0; }
  .priorities { flex: none; }
}
.zoom { display: flex; gap: 6px; }
.zoom .chip[aria-pressed="true"] { border-color: var(--text); color: var(--text); }
