/* Ijraa 5.0 "Command Center" design system. Navy for structure, action blue for actions, gold for the brand only. */
:root {
  --navy: #0b2545; --navy-2: #13315c; --navy-3: #1e3f6e; --blue: #1d4f91; --blue-2: #2563a8; --blue-soft: #eaf1fb; --blue-mid: #6b93c9;
  --gold: #a78342; --gold-soft: #f5ecdb; --gold-ink: #6e531f; --gold-light: #d9bf8c;
  --ink: #0f1b2d; --ink-2: #4a5a72; --line: #dde4ee; --line-2: #c9d3e2; --bg: #f4f6f9; --card: #ffffff; --soft: #f7f9fc;
  --ok: #2f5535; --ok-bg: #e6f2e7; --ok-line: #cfe3d1; --warn: #7a4f0e; --warn-bg: #fbf0d9; --warn-line: #f0dcb4; --bad: #8f1f1f; --bad-bg: #fbe4e4; --bad-line: #f1c9c9; --bad-dot: #b42318;
  --radius: 16px; --radius-s: 10px; --shadow: 0 18px 40px rgba(11, 37, 69, .16);
  --font: 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.5; }
a { color: var(--blue); } a:hover { color: var(--navy); }
h1, h2, h3 { margin: 0; line-height: 1.25; } h1 { font-size: 30px; } h2 { font-size: 20px; } h3 { font-size: 16px; }
p { margin: 0; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue-2); outline-offset: 2px; }
[hidden] { display: none !important; }
bdi { unicode-bidi: isolate; }
svg.i { width: 20px; height: 20px; flex: none; vertical-align: middle; }
.handled svg.i, .check svg.i { width: 18px; height: 18px; }
.skip { position: absolute; inset-inline-start: 12px; top: -48px; z-index: 50; padding: 10px 14px; border-radius: 8px; background: var(--navy); color: #fff; }
.skip:focus { top: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-2); font-size: 14px; }
.small { font-size: 13px; }
.notice { font-size: 13px; color: var(--ink-2); }
.mono, code { font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace; font-size: 13px; }
code { background: var(--soft); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }

/* ---------- header ---------- */
.top { background: var(--navy); color: #fff; padding: 12px 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; position: relative; z-index: 5; }
.brand, .logo { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand:hover, .logo:hover { color: #fff; }
.brand svg, .logo .mark { width: 32px; height: 32px; flex: none; }
.brand b, .logo b { font-size: 18px; } .brand b span, .logo b span { color: var(--gold-light); font-weight: 600; margin-inline-start: 4px; }
.logo .name { display: flex; flex-direction: column; line-height: 1.15; } .logo small { font-size: 12px; color: #b8c6dc; }
.badge-demo { font-size: 12px; color: #d9e2ef; border: 1px solid #3d5a85; border-radius: 999px; padding: 4px 10px; }
.nav { display: flex; flex-wrap: wrap; gap: 2px; order: 10; flex-basis: 100%; margin: 2px -12px -4px; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, .08); }
.nav a { color: #c9d6ea; text-decoration: none; padding: 9px 12px; border-radius: 8px; font-size: 14px; }
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.nav a.on { background: var(--navy-2); color: #fff; font-weight: 600; }
.grow { flex: 1; }
.top .tbtn, .top button, .top a.btn { font-size: 14px; color: #fff; background: transparent; border: 1px solid #3d5a85; border-radius: 8px; padding: 8px 12px; min-height: 40px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.top .tbtn:hover, .top button:hover, .top a.btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.top button[aria-pressed="true"] { background: var(--navy-2); }
.whoami { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.av { width: 34px; height: 34px; border-radius: 50%; background: var(--blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; }
.acting-bar { background: var(--gold-soft); color: var(--gold-ink); padding: 10px 28px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: 14px; }

/* ---------- layout ---------- */
.wrap { max-width: 1376px; margin: 0 auto; padding: 26px 28px 56px; }
.page { display: flex; flex-direction: column; gap: 22px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.spacer { flex: 1; }
.cols { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; }
.cols > .main { flex: 999 1 560px; min-width: 0; }
.cols > .side { flex: 1 1 330px; min-width: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.grid.wide { grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 20px; }
.card, .panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card.dashed { border-style: dashed; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; }
.page-head > div { flex: 1 1 420px; } .page-head p { color: var(--ink-2); margin-top: 6px; }
.section-title { font-size: 20px; font-weight: 700; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; font-weight: 600; border-radius: var(--radius-s); padding: 9px 16px; border: 1px solid var(--blue); background: var(--blue); color: #fff; min-height: 44px; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--navy-3); color: #fff; }
.btn.ghost { background: #fff; color: var(--blue); } .btn.ghost:hover { background: var(--blue-soft); color: var(--navy); }
.btn.ok { background: var(--ok); border-color: var(--ok); } .btn.bad { background: #fff; color: #9b2c2c; border-color: #9b2c2c; }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 10px; background: var(--blue-soft); color: var(--blue); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--warn-bg); color: var(--warn); } .pill.bad { background: var(--bad-bg); color: var(--bad); } .pill.gold { background: var(--gold-soft); color: var(--gold-ink); }
.pill.act { cursor: pointer; border: 1px solid var(--line-2); background: var(--soft); color: var(--ink); font-weight: 500; padding: 6px 12px; }
.chip { font-size: 14px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); border-radius: 999px; padding: 7px 14px; min-height: 40px; cursor: pointer; }
.chip:hover { border-color: var(--blue); } .chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.sugg { display: flex; flex-wrap: wrap; gap: 8px; }
.sugg button { font-size: 14px; border: 1px solid var(--line-2); background: var(--soft); color: var(--ink); border-radius: 999px; padding: 7px 14px; min-height: 40px; cursor: pointer; text-align: start; }
.sugg button:hover { border-color: var(--blue); background: var(--blue-soft); }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea { border: 1px solid var(--line-2); border-radius: var(--radius-s); padding: 10px 12px; min-height: 44px; background: #fff; }
textarea { width: 100%; min-height: 80px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius-s); overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 9px 16px; min-height: 42px; cursor: pointer; }
.seg button.on { background: var(--navy); color: #fff; }

/* ---------- lists, items, tables ---------- */
.item { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; }
.item .body { flex: 1 1 240px; min-width: 0; } .item .t { font-weight: 600; } .item .d { font-size: 14px; color: var(--ink-2); }
.item.bad { border-color: var(--bad-line); background: #fdf4f4; } .item.warn { border-color: var(--warn-line); background: #fdf8ee; } .item.ok { border-color: var(--ok-line); background: #f2f8f2; }
.ico { width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--blue-soft); color: var(--blue); flex: none; }
.ico svg { width: 20px; height: 20px; } .item.bad .ico { background: #f6dede; color: #9b2c2c; } .item.warn .ico { background: #f6e8cb; color: #8a5a12; } .item.ok .ico { background: #dcecdd; color: var(--ok); }
.handled { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ok); }
.tbl { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: start; font-size: 12px; color: var(--ink-2); font-weight: 600; padding: 9px 12px; border-bottom: 1px solid var(--line); }
td { padding: 11px 12px; border-bottom: 1px solid #eef2f7; vertical-align: top; }
.alert { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; font-size: 14px; }
.alert.expired, .alert.due { border-color: var(--bad-line); background: #fdf4f4; } .alert.soon { background: var(--soft); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpis > div { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--ink-2); }
.kpis > div b { font-size: 26px; color: var(--navy); }

/* ---------- home ---------- */
.hero { background: linear-gradient(180deg, var(--navy) 0, var(--navy) 62%, var(--bg) 62%); padding: 26px 28px 0; }
.hero .in { max-width: 1376px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.hero .date { color: var(--gold-light); font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.hero h1 { color: #fff; font-size: 32px; }
.askbox { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.askline { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.askline input { flex: 999 1 380px; min-width: 0; font-size: 17px; padding: 14px 16px; min-height: 54px; }
.icon-btn { width: 54px; height: 54px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; color: var(--blue); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; text-decoration: none; }
.icon-btn svg { width: 22px; height: 22px; } .icon-btn.rec { background: var(--bad-dot); color: #fff; border-color: var(--bad-dot); }
.askline .btn { min-height: 54px; padding: 0 24px; font-size: 16px; }
.forecast .big { font-size: 38px; font-weight: 700; color: var(--navy); }
.stackbar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: #e6ebf2; }
.legend { display: flex; flex-direction: column; gap: 7px; font-size: 14px; }
.legend div { display: flex; justify-content: space-between; gap: 10px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 8px; }
.tip { display: flex; gap: 10px; align-items: flex-start; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; font-size: 14px; }
.tip .grow { flex: 1; }
.rings { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.ringcard { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; gap: 14px; align-items: center; }
.ringcard .who { font-weight: 700; } .ringcard a, .ringcard button.link { font-size: 14px; font-weight: 600; }
button.link { background: none; border: 0; padding: 0; color: var(--blue); cursor: pointer; text-align: start; min-height: 0; font-weight: 600; }
button.link:hover { text-decoration: underline; }

/* ---------- year timeline ---------- */
.tl { overflow-x: auto; }
.tl-grid { min-width: 920px; display: grid; grid-template-columns: 150px repeat(12, minmax(0, 1fr)); row-gap: 10px; align-items: center; font-size: 13px; }
.tl-grid .mon { color: var(--ink-2); } .tl-grid .mon.now { color: var(--navy); font-weight: 700; }
.lane { grid-column: span 12; position: relative; height: 34px; background: var(--bg); border-radius: 8px; }
.ev { position: absolute; top: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; white-space: nowrap; background: var(--blue); color: #fff; border: 0; cursor: pointer; }
.ev.blk { background: var(--bad-dot); font-weight: 600; } .ev.auto { background: #fff; color: var(--ok); border: 2px solid #3d6b43; padding: 1px 9px; } .ev.far { background: #e6ebf2; color: var(--ink-2); }
.ev.trip { background: var(--gold); height: 24px; padding: 0; min-width: 6px; cursor: default; }
.lane .triplabel { position: absolute; top: 8px; font-size: 12px; font-weight: 600; color: var(--gold-ink); white-space: nowrap; }
.dotkey { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-inline-end: 6px; vertical-align: middle; }
.mrow { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid #eef2f7; font-size: 14px; }
.mrow .body { flex: 1 1 260px; }

/* ---------- conversation ---------- */
.chatpage { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; }
.chatpage .thread { flex: 999 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.chatpage .ctx { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.log { display: flex; flex-direction: column; gap: 12px; min-height: 240px; }
.msg { max-width: 78%; padding: 12px 15px; font-size: 15px; white-space: pre-line; position: relative; }
.msg.user { align-self: flex-end; background: var(--blue); color: #fff; border-radius: 16px 16px 4px 16px; }
.msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 16px 16px 16px 4px; }
[dir=rtl] .msg.user { border-radius: 16px 16px 16px 4px; } [dir=rtl] .msg.bot { border-radius: 16px 16px 4px 16px; }
.msg .meta { display: block; font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.msg .speak { background: none; border: 0; cursor: pointer; color: var(--ink-2); margin-inline-start: 6px; padding: 2px; vertical-align: middle; }
.msg .speak svg { width: 16px; height: 16px; vertical-align: middle; }
.log > div:not(.msg) { align-self: stretch; max-width: 100%; }
.composer { position: sticky; bottom: 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; box-shadow: 0 -6px 18px rgba(11, 37, 69, .06); }
.composer input#input { flex: 999 1 260px; min-width: 0; font-size: 16px; }
.composer .icon-btn { width: 46px; height: 46px; }
.plan { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 15px; display: flex; flex-direction: column; gap: 10px; }
.plan.sim { border-style: dashed; }
.plan .title { font-weight: 700; font-size: 16px; }
.step { display: flex; gap: 12px; align-items: flex-start; padding: 9px 0; border-top: 1px solid #eef2f7; font-size: 14px; }
.step .n { width: 24px; height: 24px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: none; }
.step.no .n { background: var(--bad-bg); color: var(--bad); } .step > div { flex: 1; min-width: 0; } .step .fee { font-weight: 700; white-space: nowrap; }
.why { color: var(--bad); font-size: 13px; }
.ext { background: var(--soft); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.code { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.code input { font-family: 'IBM Plex Mono', monospace; font-size: 22px; letter-spacing: .3em; width: 9.5em; text-align: center; }
.res { display: flex; flex-direction: column; gap: 8px; } .res > div { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; }
.digest { background: var(--soft); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.clarify button { background: #fff; border-color: var(--blue); color: var(--blue); font-weight: 600; }

/* ---------- plan map ---------- */
.pmap { display: flex; flex-wrap: wrap; align-items: stretch; row-gap: 10px; }
.pnode { flex: 1 1 190px; min-width: 0; border: 1px solid var(--line-2); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 5px; }
.pnode.main { border: 2px solid var(--blue); background: #f3f7fd; padding: 13px; } .pnode.no { border-color: var(--bad-line); background: #fdf4f4; }
.pnode .k { font-size: 12px; font-weight: 600; color: var(--blue); text-transform: uppercase; letter-spacing: .04em; } .pnode .fee { font-weight: 700; margin-top: auto; }
.parrow { display: flex; align-items: center; padding: 0 8px; color: #9fb0c8; } [dir=rtl] .parrow svg { transform: scaleX(-1); }
.checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-radius: 10px; font-size: 14px; background: #f2f8f2; } .check.no { background: #fdf4f4; }
.check svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.receipt .r { border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; font-size: 14px; }
.receipt .r .k { font-size: 12px; font-weight: 700; margin-bottom: 4px; }

/* ---------- wallet, documents ---------- */
.docs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.doc { border-radius: 16px; padding: 18px; color: #fff; background: var(--navy); display: flex; flex-direction: column; gap: 8px; min-height: 170px; text-align: start; }
.doc:not(.lost):nth-child(4n+2) { background: var(--navy-2); } .doc:not(.lost):nth-child(4n+3) { background: var(--blue); } .doc:not(.lost):nth-child(4n+4) { background: #2b3f5c; }
.doc.lost { background: #5b2525; }
.doc .k { font-size: 12px; color: #b8c6dc; text-transform: uppercase; letter-spacing: .04em; } .doc .num { font-size: 18px; font-weight: 700; }
.doc .codeline { font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: var(--gold-light); }
.doc a { color: #fff; font-size: 13px; font-weight: 600; } .doc .acts { display: flex; flex-wrap: wrap; gap: 14px; margin-top: auto; align-items: center; }
.doc button { background: rgba(255, 255, 255, .12); color: #fff; border: 1px solid rgba(255, 255, 255, .3); border-radius: 8px; padding: 7px 11px; cursor: pointer; font-size: 13px; font-weight: 600; }
.bars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: end; height: 170px; }
.bars > div { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; text-align: center; font-size: 13px; }
.bars .b { width: 100%; border-radius: 8px 8px 0 0; background: var(--blue); min-height: 4px; }
.idcard { background: var(--navy); color: #fff; border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 8px; } .idcard a { color: var(--gold-light); } .idcard .idname { font-size: 18px; font-weight: 700; } .idcard code { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: #fff; }

/* ---------- requests ---------- */
.req { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 13px 6px; border: 0; border-top: 1px solid #eef2f7; cursor: pointer; background: none; width: 100%; text-align: start; }
.req:first-child { border-top: 0; } .req.on { background: var(--blue-soft); border-radius: 10px; } .req .body { flex: 1 1 260px; }
.tline { display: flex; flex-direction: column; gap: 14px; font-size: 14px; }
.tline > div { display: flex; gap: 12px; } .tline .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--blue); margin-top: 5px; flex: none; } .tline .dot.ok { background: #3d6b43; } .tline .dot.bad { background: var(--bad-dot); }
.quote { background: var(--soft); border-radius: 12px; padding: 11px 14px; font-size: 14px; }

/* ---------- start page ---------- */
.start-hero { background: var(--navy); color: #fff; padding: 52px 28px; }
.start-hero .in { max-width: 1376px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 36px; align-items: center; }
.start-hero .lead { flex: 999 1 520px; display: flex; flex-direction: column; gap: 16px; }
.start-hero h1 { font-size: 44px; line-height: 1.15; } .start-hero p { color: #c9d6ea; font-size: 18px; max-width: 640px; }
.start-hero .eyebrow { color: var(--gold-light); font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.demo-chat { flex: 1 1 340px; background: var(--navy-2); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.demo-chat .u { background: #fff; color: var(--ink); border-radius: 12px 12px 12px 4px; padding: 11px 14px; align-self: flex-start; max-width: 92%; }
.demo-chat .a { background: var(--blue); border-radius: 12px 12px 4px 12px; padding: 11px 14px; align-self: flex-end; max-width: 92%; }
.personas { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.persona { text-align: start; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; }
.tile { text-align: start; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; min-height: 44px; }
.tile:hover, .tile.on { border-color: var(--blue); background: #f3f7fd; }
.persona:hover { border-color: var(--blue); box-shadow: 0 6px 18px rgba(11, 37, 69, .08); } .persona .av { width: 46px; height: 46px; background: var(--blue-soft); color: var(--blue); }
.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.how > div { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--ink-2); } .how b { color: var(--ink); font-size: 15px; }

/* ---------- officer console ---------- */
.officer-top { background: #13202f; }
.queue { display: flex; flex-direction: column; gap: 10px; }
.q { text-align: start; width: 100%; background: #fff; border: 1px solid #d8dfe9; border-radius: 12px; padding: 11px 13px; display: flex; flex-direction: column; gap: 5px; cursor: pointer; }
.q.on { border: 2px solid var(--blue); padding: 10px 12px; background: #f3f7fd; } .q .score { font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: var(--ink-2); }
.queue-why { font-size: 13px; color: var(--ink-2); }
.brief { background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 13px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.draft { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; white-space: pre-line; font-size: 14px; }
.pattern { background: #fdf8ee; border: 1px solid var(--warn-line); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.sliders { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.narrow { max-width: 760px; margin: 0 auto; }

/* ---------- phone: bottom tab bar ---------- */
.tabbar { display: none; }
.more-menu { display: none; }
@media (max-width: 900px) {
  .top { padding: 10px 14px; gap: 10px; }
  .top .nav, .top .hide-s, .badge-demo { display: none; }
  .wrap { padding: 16px 14px 100px; }
  .hero { padding: 18px 14px 0; } .hero h1 { font-size: 23px; } .askline input { font-size: 16px; }
  h1 { font-size: 24px; } .start-hero h1 { font-size: 32px; } .start-hero { padding: 32px 14px; }
  .msg { max-width: 92%; }
  .tabbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; bottom: 0; inset-inline: 0; background: #fff; border-top: 1px solid var(--line); padding: 6px 4px calc(10px + env(safe-area-inset-bottom)); z-index: 20; }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11.5px; color: var(--ink-2); text-decoration: none; min-height: 48px; justify-content: center; background: none; border: 0; cursor: pointer; }
  .tabbar a.on, .tabbar button.on { color: var(--blue); font-weight: 600; } .tabbar svg { width: 22px; height: 22px; }
  .composer { bottom: 76px; }
  .more-menu:not([hidden]) { position: fixed; inset-inline: 10px; bottom: 78px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 10px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; z-index: 21; }
  .more-menu a { padding: 12px; border-radius: 10px; text-decoration: none; color: var(--ink); background: var(--soft); font-size: 14px; }
}

/* ---------- easy view: larger, calmer, essentials only ---------- */
html.easy body { font-size: 18px; } html.easy .muted, html.easy td, html.easy .item .d { font-size: 16px; color: #2b3a50; }
html.easy .btn, html.easy .chip { min-height: 52px; font-size: 17px; } html.easy .optional { display: none !important; }
html.easy .card, html.easy .panel { border-width: 2px; }

/* ---------- print: verification page ---------- */
.print-only { display: none; }
@media print {
  .top, .no-print, .tabbar, .skip, .composer { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .card, .panel { box-shadow: none !important; border: 1px solid #999 !important; }
  .print-only { display: block; font-size: 12px; margin-top: 12px; } a { color: #000; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }

/* 6.0 fix path */
.fixes { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line, #dde4ee); border-radius: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--card, #fff); }
.fixes > b { font-size: 14px; }
.fix { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; }
.fix .grow { flex: 1 1 220px; min-width: 0; }

/* 7.0: what you qualify for, who can see the record, crisis banner, crisis form */
.ent { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.ent:first-of-type { border-top: 0; }
.ent .ico { flex: 0 0 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; background: var(--soft); color: var(--ink); }
.ent.refund .ico, .ent.relief .ico { background: var(--ok-bg); color: var(--ok); }
.ent.right .ico { background: var(--warn-bg); color: var(--warn); }
.ent .body { flex: 1; min-width: 0; } .ent .t { font-weight: 600; } .ent .d { font-size: 14px; color: var(--ink-2); }
.share-row { display: flex; flex-direction: column; gap: 4px; padding: 10px 0; border-top: 1px solid var(--line); align-items: flex-start; }
.share-row:first-of-type { border-top: 0; }
.crisis-banner { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.grid2 label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.grid2 input, .grid2 select { font: inherit; padding: 9px 10px; border: 1px solid var(--line-2); border-radius: 10px; min-height: 42px; background: var(--card); color: var(--ink); }
.row.done { opacity: .6; }
@media (max-width: 640px) { .ent { flex-wrap: wrap; } }

/* 8.0 */
.precedent { border: 1px solid var(--warn-line); background: var(--warn-bg); color: var(--ink); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.precedent.need { outline: 3px solid var(--bad-dot); }
.precedent textarea { font: inherit; width: 100%; border: 1px solid var(--line-2); border-radius: 8px; padding: 8px; }
.stepper { display: flex; flex-direction: column; gap: 12px; }
.stepper .count { font-size: 15px; color: var(--ink-2); }
html.easy .plan .step-hidden { display: none !important; }
html.easy .msg.bot { font-size: 20px; line-height: 1.6; }
.rlog { white-space: pre-wrap; max-height: 460px; overflow: auto; background: var(--soft); border: 1px solid var(--line); padding: 12px; border-radius: 10px; margin: 0; }

/* 9.0 */
.stars { display: flex; gap: 2px; } .star { font-size: 24px; background: none; border: 0; color: #c9a227; cursor: pointer; min-width: 40px; min-height: 40px; }
.star:disabled { opacity: .5; } .item.rate input { width: 100%; margin-top: 6px; font: inherit; border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 8px; }
.phone .btn.big { font-size: 22px; min-height: 88px; border-radius: 20px; } .phone .btn.big.rec { background: var(--bad-dot); border-color: var(--bad-dot); }
.phone .log { max-height: 50vh; overflow: auto; } .phone input { flex: 1; font: inherit; padding: 10px; border: 1px solid var(--line-2); border-radius: 10px; min-height: 44px; }
.msgs .msg { max-width: 90%; }

/* ---------- design audit 2026-11-19 ---------- */
/* Officer console on phones: its tabs stay reachable as a scrollable strip (the citizen app has a bottom tab bar instead). */
@media (max-width: 900px) {
  .top.officer-top .nav { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 4px -14px -6px; padding: 6px 10px 2px; }
  .top.officer-top .nav::-webkit-scrollbar { display: none; }
  .top.officer-top .nav a { white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; }
  /* Chat on phones: the box stays above the tab bar; the context panel (also on Home) is left out. */
  #chatctx { display: none; }
  a.brand, a.logo { min-height: 44px; display: inline-flex; align-items: center; }
  label:has(> input[type=checkbox]) { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; }
  /* Tap targets: at least 40-44 px on phones. */
  .btn, .btn.sm, .pill.act, .chip, .sugg button, .doc button, .acts button, .tip .btn { min-height: 44px; }
  button.link, a.small, .small > a, .card > a, .row > a:not(.btn) { display: inline-flex; align-items: center; min-height: 40px; }
  button.link { min-width: 44px; justify-content: center; }
  .speak { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
  input[type=checkbox], input[type=radio] { width: 22px; height: 22px; }
  .tabbar a, .tabbar button { font-size: 12.5px; }
  /* The 12-month timeline is unreadable at phone width: the month-by-month list carries the same items. */
  .tl, .tl-legend, .tl-home { display: none !important; }
}
/* Wide tables (4+ columns) become stacked rows on phones, each cell labelled with its column. */
@media (max-width: 640px) {
  table.stack-sm, table.stack-sm tbody, table.stack-sm tr, table.stack-sm td { display: block; width: 100%; }
  table.stack-sm tr:first-child:has(th) { display: none; }
  table.stack-sm tr { border-top: 1px solid var(--line); padding: 10px 0; }
  table.stack-sm td { border: 0; padding: 3px 0; }
  table.stack-sm td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; color: var(--ink-2); font-weight: 600; }
  table.stack-sm td:first-child { font-weight: 600; }
}
.sr-h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.datehint { font-size: 12.5px; color: var(--ink-2); }
details.fyi { margin-top: 6px; } details.fyi > summary { cursor: pointer; font-weight: 600; padding: 10px 0; min-height: 40px; color: var(--ink-2); }
