/* Notanai design system */
:root {
  --bg: #f6f4f0; --bg-2: #efebe4; --panel: #ffffff; --ink: #14161c; --ink-2: #3a3d46; --muted: #5f636c;
  --line: #e6e1d8; --line-2: #d9d2c5;
  --brand: #e2572b; --brand-2: #f08a3e; --brand-soft: #fde9df; --brand-ink: #ffffff;
  --navy: #12151d; --navy-2: #1c2030;
  --ok: #178a52; --ok-soft: #dff4e8; --warn: #b86b05; --warn-soft: #fdf0d8; --bad: #cc2f2f; --bad-soft: #fde4e2;
  --info: #2c5fd6; --info-soft: #e1eafc;
  --chip: #f0ece5;
  --shadow-sm: 0 1px 2px rgba(20, 22, 28, .06);
  --shadow: 0 1px 2px rgba(20, 22, 28, .05), 0 8px 24px -8px rgba(20, 22, 28, .12);
  --shadow-lg: 0 24px 60px -20px rgba(20, 22, 28, .35);
  --radius: 16px; --radius-sm: 10px;
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Noto Sans Gurmukhi", "Noto Sans Devanagari", sans-serif;
  --display: "Fraunces", Georgia, serif;
  font-family: var(--font);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1116; --bg-2: #151821; --panel: #181b24; --ink: #f2f0ec; --ink-2: #cfccc6; --muted: #8f94a0;
    --line: #262a36; --line-2: #333847; --chip: #232734; --brand-soft: #3a2118;
    --ok-soft: #10301f; --warn-soft: #362710; --bad-soft: #3a1617; --info-soft: #172444;
    --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px -8px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1116; --bg-2: #151821; --panel: #181b24; --ink: #f2f0ec; --ink-2: #cfccc6; --muted: #8f94a0;
  --line: #262a36; --line-2: #333847; --chip: #232734; --brand-soft: #3a2118;
  --ok-soft: #10301f; --warn-soft: #362710; --bad-soft: #3a1617; --info-soft: #172444;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px -8px rgba(0,0,0,.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; font-feature-settings: "ss01", "cv11"; }
h1, h2, h3, h4 { letter-spacing: -.02em; line-height: 1.2; }
h2 { font-size: 20px; margin: 28px 0 12px; }
h3 { font-size: 16px; margin: 0 0 10px; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--brand); color: #fff; }

/* ---------- app bar */
header.top { display: flex; align-items: center; gap: 14px; padding: 0 20px; height: 60px; background: var(--navy);
  color: #fff; position: sticky; top: 0; z-index: 20; }
header.top h1 { font-size: 15px; font-weight: 600; margin: 0; color: rgba(255,255,255,.72); padding-left: 14px;
  border-left: 1px solid rgba(255,255,255,.16); }
header.top .sp { flex: 1; }
header.top .muted, header.top .small { color: rgba(255,255,255,.62); }
header.top button { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.14); }
header.top button:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.24); }
header.top a { color: #fff; }
.logo { display: inline-block; flex: none; width: 112px; height: 24px; overflow: hidden; white-space: nowrap; font-size: 0; color: transparent !important;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-2 8 436 94'%3E%3Cdefs%3E%3CradialGradient id='orbSD' cx='.36' cy='.32' r='.75'%3E%3Cstop offset='0' stop-color='%23ffe2c6'/%3E%3Cstop offset='.35' stop-color='%23f59a52'/%3E%3Cstop offset='.8' stop-color='%23e2572b'/%3E%3Cstop offset='1' stop-color='%23b8401d'/%3E%3C/radialGradient%3E%3C/defs%3E%3Cg fill='none' stroke='%23f6efe6' stroke-width='13' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 94V68a22 22 0 0 1 44 0v26'/%3E%3Ccircle cx='100' cy='70' r='24'/%3E%3Cpath d='M148 50h32M160 26v54a14 14 0 0 0 14 14h2'/%3E%3Ccircle cx='226' cy='70' r='24'/%3E%3Cpath d='M250 46v48'/%3E%3Cpath d='M276 94V68a22 22 0 0 1 44 0v26'/%3E%3Ccircle cx='370' cy='70' r='24'/%3E%3Cpath d='M394 46v48'/%3E%3Cpath d='M420 50v44'/%3E%3C/g%3E%3Ccircle cx='420' cy='21' r='12' fill='url(%23orbSD)'/%3E%3C/svg%3E") left center / contain no-repeat; }  /* brand/logo-small-dark.svg; the link text stays for screen readers */
.logo:hover { text-decoration: none; }

main { max-width: 1240px; margin: 0 auto; padding: 24px 20px 64px; }

/* ---------- surfaces */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); }
a.card { color: inherit; transition: transform .15s ease, box-shadow .15s ease, border-color .15s; }
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--line-2); text-decoration: none; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
.sp { flex: 1; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

/* ---------- controls */
button, .btn { font: inherit; font-weight: 600; font-size: 14px; border: 1px solid var(--line-2); background: var(--panel);
  color: var(--ink); padding: 9px 16px; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; gap: 6px; transition: background .12s, border-color .12s, transform .06s, box-shadow .12s;
  text-decoration: none; white-space: nowrap; }
button:hover, .btn:hover { border-color: var(--muted); text-decoration: none; }
button:active { transform: translateY(1px); }
button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent); outline-offset: 1px; }
button.primary, .btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand);
  box-shadow: 0 6px 16px -6px rgba(226, 87, 43, .6); }
button.primary:hover, .btn.primary:hover { background: #cf4a20; border-color: #cf4a20; }
button.ok { background: var(--ok); color: #fff; border-color: var(--ok); }
button.ok:hover { background: #127444; }
button.bad { background: var(--bad); color: #fff; border-color: var(--bad); }
button.bad:hover { background: #b12626; }
button.ghost { background: transparent; border-color: transparent; }
button.big, .btn.big { padding: 13px 22px; font-size: 16px; }
button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
input, select, textarea { font: inherit; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--ink); width: 100%; transition: border-color .12s; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
/* a long option (Admin > System's voice AI location) shrinks to the phone instead of widening the page; not in tables */
div.row > select, div.row > input { max-width: 100%; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--brand); padding: 0; }
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
textarea.mono { font-size: 12.5px; line-height: 1.45; }

/* ---------- tables */
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700;
  background: var(--bg-2); position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td, table tr:hover td { background: color-mix(in srgb, var(--bg-2) 55%, transparent); }
.scroll { overflow-x: auto; }
.card.scroll { padding: 0; }
.card.scroll > h3, .card.scroll > p { padding: 16px 20px 0; }
.card.scroll table { margin-top: 8px; }

/* ---------- chips & banners */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: var(--chip);
  font-size: 11.5px; font-weight: 700; letter-spacing: .01em; color: var(--ink-2); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.info { background: var(--info-soft); color: var(--info); }
.chip.brand { background: var(--brand-soft); color: var(--brand); }
.chip.net i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.chip.net.ok i { box-shadow: 0 0 0 0 currentColor; animation: net-pulse 2s ease-out infinite; }
@keyframes net-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); } 100% { box-shadow: 0 0 0 7px transparent; } }
@media (prefers-reduced-motion: reduce) { .chip.net.ok i { animation: none; } }
.net-banner { background: var(--bad); color: #fff; padding: 10px 16px; text-align: center; font-size: 14px; position: sticky; top: 0; z-index: 50; }
.demo-banner { background: repeating-linear-gradient(-45deg, #1d1f27, #1d1f27 14px, #22252f 14px, #22252f 28px);
  color: #ffc99c; padding: 7px 16px; text-align: center; font-weight: 600; font-size: 12.5px; letter-spacing: .02em; }
.demo-banner::before { content: "● "; color: var(--brand-2); }

/* ---------- tabs */
.tabs { display: flex; gap: 4px; margin-bottom: 22px; overflow-x: auto; background: var(--panel); padding: 5px;
  border: 1px solid var(--line); border-radius: 999px; width: fit-content; max-width: 100%; box-shadow: var(--shadow-sm); }
.tabs button { border: none; background: none; padding: 8px 16px; font-weight: 600; color: var(--muted); }
.tabs button:hover { color: var(--ink); background: var(--bg-2); }
.tabs button.on { background: var(--navy); color: #fff; }
@media (prefers-color-scheme: dark) { .tabs button.on { background: var(--brand); } }

/* ---------- misc */
.hidden { display: none !important; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff;
  padding: 12px 18px; border-radius: 12px; z-index: 100; max-width: 90vw; box-shadow: var(--shadow-lg); font-weight: 500;
  animation: rise .2s ease-out; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } }
.kpi { font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.mono { font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace; font-size: 13px; font-variant-numeric: tabular-nums; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); }
dialog { border: 1px solid var(--line); border-radius: 20px; background: var(--panel); color: var(--ink); padding: 24px;
  box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(10, 12, 18, .55); backdrop-filter: blur(3px); }
details summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
.section-title { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.section-title h3 { margin: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-soft); }

@media (max-width: 640px) {
  /* the bar's chips and buttons don't shrink, so on a phone they wrap onto a second row instead of widening the page */
  header.top { padding: 8px 16px; gap: 6px 10px; flex-wrap: wrap; height: auto; min-height: 60px; }
  header.top h1, header.top #who:not(:has(a)) { display: none; }  /* demo.html's #who holds its only log-out link */
  main { padding: 16px 16px 48px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .card { padding: 16px; }
}

/* ---- charts (reference palette: categorical slots 1-2; dark steps chosen for the dark surface) */
.viz { --s1: #2a78d6; --s2: #eb6834; --grid: var(--line); --axis: var(--muted); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .viz { --s1: #3987e5; --s2: #d95926; } }
:root[data-theme="dark"] .viz { --s1: #3987e5; --s2: #d95926; }
.viz svg { width: 100%; height: auto; display: block; overflow: visible; }
.viz .hd { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.viz .hd b { font-size: 14px; } .viz .hd .sub { color: var(--muted); font-size: 12px; }
.viz .lg { display: flex; gap: 12px; font-size: 12px; color: var(--ink-2); margin-left: auto; }
.viz .lg i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.viz text { fill: var(--axis); font-size: 10px; font-family: inherit; }
.viz .col:hover .hit { fill: var(--line); opacity: .5; }
.viz-tip { position: fixed; z-index: 60; pointer-events: none; background: var(--panel); color: var(--ink); border: 1px solid var(--line-2);
  border-radius: 10px; padding: 8px 10px; font-size: 12px; line-height: 1.5; box-shadow: 0 10px 30px -12px rgba(0,0,0,.35); display: none; }
.kpi-hero { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 800px) { .kpi-hero { grid-template-columns: 1fr 1fr; } }
.kpi-hero .card { padding: 14px 16px; } .kpi-hero .v { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.kpi-hero .d { font-size: 12px; color: var(--muted); } .kpi-hero .d b.good { color: var(--ok); } .kpi-hero .d b.bad { color: var(--bad); }

.ok-note { background: var(--ok-soft); color: var(--ok); border-radius: 10px; padding: 10px 14px; }

/* ---------- password helper (web/password.js): checklist, strength word, match feedback, suggested passphrase */
.pwx { display: grid; gap: 10px; margin-top: 2px; }
.pwx-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13.5px; }
.pwx-rows li { display: flex; gap: 8px; align-items: baseline; color: var(--muted); }
.pwx-rows .ic { width: 16px; text-align: center; font-weight: 800; flex: none; }
.pwx-rows li[data-s="ok"] { color: var(--ok); } .pwx-rows li[data-s="warn"] { color: var(--warn); } .pwx-rows li[data-s="bad"] { color: var(--bad); }
.pwx-meter { display: flex; align-items: center; gap: 10px; min-height: 22px; }
.pwx-meter .bar { display: flex; gap: 4px; } .pwx-meter .bar i { width: 34px; height: 6px; border-radius: 99px; background: var(--line-2); }
.pwx-meter .bar i.on.l1 { background: var(--bad); } .pwx-meter .bar i.on.l2 { background: var(--warn); }
.pwx-meter .bar i.on.l3, .pwx-meter .bar i.on.l4 { background: var(--ok); }
.pwx-meter .word { font-weight: 700; font-size: 13.5px; }
.pwx-note { margin: 0; font-size: 12px; color: var(--muted); }
.pwx-match { margin: 0; min-height: 18px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.pwx-match[data-s="ok"] { color: var(--ok); } .pwx-match[data-s="warn"] { color: var(--warn); }
.pwx-live { margin: 0; font-size: 12.5px; color: var(--muted); min-height: 16px; }
.pwx .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pwx button { min-height: 44px; padding: 10px 16px; }
.pwx-suggest, .pwx-toggle { width: 100%; justify-content: center; }
.pwx-card { border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 14px; display: grid; gap: 12px; background: var(--bg-2); }
.pwx-phrase { font-size: 20px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; user-select: all; letter-spacing: .01em; }
.pwx-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.pwx-saved { display: flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 600; margin: 0; color: var(--ink); }
.pw input { padding-right: 84px; }
