/* رصين — web design system. Brand: ink #2B4162, deep #15233A, paper #F6F7F9, gold #B98A3E (decoration only). */

@font-face { font-family: 'Plex'; src: url('/assets/fonts/IBMPlexSansArabic-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Plex'; src: url('/assets/fonts/IBMPlexSansArabic-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Plex'; src: url('/assets/fonts/IBMPlexSansArabic-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Plex'; src: url('/assets/fonts/IBMPlexSansArabic-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Cairo'; src: url('/assets/fonts/Cairo-Variable.ttf') format('truetype'); font-weight: 200 1000; font-display: swap; }

:root {
  --ink: #2B4162; --deep: #15233A; --paper: #F6F7F9; --gold: #B98A3E; --gold-light: #E0B867;
  --bg: #F6F7F9; --surface: #FFFFFF; --surface-2: #F9FAFB; --sunken: #EDF0F4;
  --text: #15233A; --text-2: #5A6678; --text-3: #687284; --line: #D9DEE6; --line-soft: #E6EAF0;
  --accent: #2B4162; --accent-ink: #FFFFFF; --accent-soft: rgba(43, 65, 98, .09);
  --positive: #2F7D5B; --positive-soft: rgba(47, 125, 91, .11);
  --negative: #B3402F; --negative-soft: rgba(179, 64, 47, .1);
  --amber: #A86C12; --amber-soft: rgba(168, 108, 18, .12);
  --shadow: 0 1px 2px rgba(21, 35, 58, .05), 0 8px 24px rgba(21, 35, 58, .06);
  --shadow-lg: 0 24px 64px rgba(21, 35, 58, .18);
  --r-panel: 18px; --r-control: 12px;
  --font: 'Plex', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  --display: 'Cairo', 'Plex', system-ui, sans-serif;
  --sidebar: 268px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1828; --surface: #15233A; --surface-2: #1B2B45; --sunken: #0B1422;
    --text: #EEF1F5; --text-2: #9AA6B8; --text-3: #8390A5; --line: #2A3A55; --line-soft: #22314A;
    --accent: #E0B867; --accent-ink: #15233A; --accent-soft: rgba(224, 184, 103, .12);
    --positive: #4FB386; --positive-soft: rgba(79, 179, 134, .14); --negative: #E5806E; --negative-soft: rgba(229, 128, 110, .14);
    --amber: #E6B054; --amber-soft: rgba(230, 176, 84, .14);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .28); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1828; --surface: #15233A; --surface-2: #1B2B45; --sunken: #0B1422;
  --text: #EEF1F5; --text-2: #9AA6B8; --text-3: #8390A5; --line: #2A3A55; --line-soft: #22314A;
  --accent: #E0B867; --accent-ink: #15233A; --accent-soft: rgba(224, 184, 103, .12);
  --positive: #4FB386; --positive-soft: rgba(79, 179, 134, .14); --negative: #E5806E; --negative-soft: rgba(229, 128, 110, .14);
  --amber: #E6B054; --amber-soft: rgba(230, 176, 84, .14);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .28); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.7 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; }
svg { display: inline-block; vertical-align: -0.18em; flex: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; display: inline-block; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; font: 800 28px var(--display); color: var(--ink); }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-brand { position: relative; overflow: hidden; background: var(--deep) url('/assets/img/pattern-deep.svg') repeat; background-size: 320px; color: var(--paper);
  display: flex; flex-direction: column; justify-content: space-between; padding: 48px 56px; }
.auth-brand::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 30% 40%, rgba(21, 35, 58, .2), rgba(21, 35, 58, .92) 75%); }
.auth-brand > * { position: relative; z-index: 1; }
.auth-brand .lockup { width: min(340px, 80%); }
.auth-brand h1 { font: 900 clamp(34px, 4vw, 52px)/1.25 var(--display); margin: 0 0 14px; }
.auth-brand h1 em { font-style: normal; color: var(--gold-light); }
.auth-brand p { color: #C3CBD8; max-width: 460px; margin: 0; font-size: 16px; }
.auth-points { display: grid; gap: 14px; margin-top: 32px; }
.auth-points div { display: flex; gap: 12px; align-items: flex-start; color: #DCE2EA; }
.auth-points svg { flex: none; color: var(--gold-light); margin-top: 4px; }
.auth-foot { color: #8C98AB; font-size: 13px; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: min(420px, 100%); }
.auth-card .mark { width: 56px; margin-bottom: 18px; }
.auth-card h2 { font: 800 30px/1.3 var(--display); margin: 0 0 6px; }
.auth-card .lead { color: var(--text-2); margin: 0 0 26px; }
.auth-card form { display: grid; gap: 16px; }
.auth-note { margin-top: 22px; font-size: 13px; color: var(--text-3); text-align: center; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--deep); color: #C9D1DD; display: flex; flex-direction: column; padding: 22px 14px 16px; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; color: var(--paper); }
.sidebar .brand img { width: 40px; }
.sidebar .brand b { font: 900 24px/1 var(--display); display: block; }
.sidebar .brand small { color: #8C98AB; font-size: 11px; }
.nav-group { margin: 6px 0 14px; }
.nav-group > span { display: block; padding: 0 12px 6px; font-size: 11px; letter-spacing: .02em; color: #6F7C91; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 11px; color: #C9D1DD; font-weight: 500; text-decoration: none; position: relative; }
.nav a:hover { background: rgba(246, 247, 249, .06); color: #fff; }
.nav a.active { background: rgba(224, 184, 103, .12); color: #fff; }
.nav a.active::before { content: ''; position: absolute; inset-inline-start: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--gold-light); }
.nav a svg { width: 19px; height: 19px; opacity: .9; }
.nav .badge { margin-inline-start: auto; background: var(--gold-light); color: var(--deep); font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 999px; line-height: 18px; }
.sidebar .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: rgba(246, 247, 249, .05); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-light); color: var(--deep); font-weight: 700; flex: none; }
.sidebar .me .who { min-width: 0; flex: 1; }
.sidebar .me b { display: block; color: #fff; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .me small { color: #8C98AB; font-size: 12px; }
.sidebar .me button { background: none; border: 0; color: #8C98AB; cursor: pointer; padding: 6px; border-radius: 8px; }
.sidebar .me button:hover { color: #fff; background: rgba(255, 255, 255, .08); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 14px 32px; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line-soft); }
.topbar .menu-btn { display: none; }
.topbar .search { flex: 1; max-width: 520px; }
.topbar .spacer { flex: 1; }
.content { padding: 28px 32px 64px; width: 100%; max-width: 1320px; margin: 0 auto; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font: 800 30px/1.3 var(--display); margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.crumbs { font-size: 13px; color: var(--text-3); margin-bottom: 6px; }
.crumbs a { color: var(--text-2); }

/* ---------- Panels & grid ---------- */
.panel { background: var(--surface); border-radius: var(--r-panel); box-shadow: var(--shadow); padding: 22px; min-width: 0; }
.panel + .panel { margin-top: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h2, .panel-head h3 { margin: 0; font: 700 18px/1.4 var(--display); display: flex; align-items: center; gap: 10px; }
.panel-head h2 svg, .panel-head h3 svg { color: var(--gold); }
.panel-head p { margin: 2px 0 0; color: var(--text-2); font-size: 13px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-side { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.stack { display: grid; gap: 18px; align-content: start; }

/* Hero band */
.hero { position: relative; overflow: hidden; border-radius: 22px; background: var(--deep) url('/assets/img/pattern-deep.svg') repeat; background-size: 260px; color: var(--paper); padding: 28px 30px; margin-bottom: 20px; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(21, 35, 58, .55), rgba(21, 35, 58, .95) 70%); }
.hero > * { position: relative; z-index: 1; }
.hero h1 { font: 800 30px/1.3 var(--display); margin: 0; }
.hero .date { color: #AEB8C7; margin-top: 4px; }
.hero .ask { margin-top: 18px; display: flex; gap: 10px; max-width: 720px; }
.hero .ask input { flex: 1; background: #fff; color: #15233A; border: 0; border-radius: 999px; padding: 13px 20px; }
.hero .quick { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.hero .mark { position: absolute; inset-inline-end: 30px; top: 26px; width: 74px; opacity: .95; }

/* Metric tiles */
.metric { display: flex; align-items: center; gap: 14px; }
.metric .icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.metric .icon.gold { background: rgba(185, 138, 62, .13); color: var(--gold); }
.metric .icon.red { background: var(--negative-soft); color: var(--negative); }
.metric .icon.green { background: var(--positive-soft); color: var(--positive); }
.metric b { font: 800 28px/1 var(--display); display: block; }
.metric span { color: var(--text-2); font-size: 13px; }

/* ---------- Controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 999px; padding: 9px 18px; font-weight: 600; cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: transform .12s ease, background .15s ease; background: var(--sunken); color: var(--text); }
.btn:hover { background: var(--line-soft); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-gold { background: var(--gold-light); color: var(--deep); }
.btn-gold:hover { background: #d7ab55; }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-ghost-light { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .22); }
.btn-ghost-light:hover { background: rgba(255, 255, 255, .16); }
.btn-danger { background: var(--negative-soft); color: var(--negative); }
.btn-danger:hover { background: var(--negative); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-icon { padding: 8px; border-radius: 10px; }
.btn-block { width: 100%; }

.field { display: grid; gap: 6px; }
.field > label { font-weight: 600; font-size: 14px; }
.field .hint { font-size: 12px; color: var(--text-3); }
.input, .select, .textarea { width: 100%; background: var(--sunken); border: 1px solid transparent; border-radius: var(--r-control); padding: 11px 14px; transition: border-color .15s, background .15s; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.textarea { min-height: 110px; resize: vertical; line-height: 1.8; }
.input[dir="ltr"] { text-align: left; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.search-box { position: relative; }
.search-box svg { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); width: 18px; height: 18px; pointer-events: none; }
.search-box .input { padding-inline-start: 42px; background: var(--surface); border-color: var(--line-soft); }
.form-error { background: var(--negative-soft); color: var(--negative); padding: 10px 14px; border-radius: 12px; font-size: 14px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }

/* Chips, badges, tabs */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 14px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text-2); }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--sunken); color: var(--text-2); white-space: nowrap; }
.badge.green { background: var(--positive-soft); color: var(--positive); }
.badge.red { background: var(--negative-soft); color: var(--negative); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.blue { background: var(--accent-soft); color: var(--accent); }
.badge svg { width: 13px; height: 13px; }
.tabs { display: flex; gap: 4px; background: var(--sunken); padding: 4px; border-radius: 14px; overflow-x: auto; margin-bottom: 18px; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: 8px 16px; border-radius: 11px; cursor: pointer; font-weight: 600; color: var(--text-2); white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tabs button svg { width: 16px; height: 16px; }

/* Tables & lists */
.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: start; font-size: 12px; font-weight: 600; color: var(--text-3); padding: 10px 12px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.table td { padding: 13px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--surface-2); }
.table .title { font-weight: 600; }
.list { display: grid; }
.row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 600; }
.row .sub { color: var(--text-2); font-size: 13px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { text-align: center; padding: 42px 16px; color: var(--text-2); }
.empty svg { width: 44px; height: 44px; margin: 0 auto 12px; color: var(--gold); opacity: .8; }
.empty b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }
.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px 16px; }
.kv dt { color: var(--text-2); font-size: 14px; }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.prose { line-height: 1.95; overflow-wrap: anywhere; }
.prose h2, .prose h3, .prose h4 { font-family: var(--display); margin: 1.2em 0 .4em; line-height: 1.4; }
.prose p { margin: 0 0 .8em; }
.prose ul, .prose ol { padding-inline-start: 22px; margin: 0 0 .8em; }
.prose blockquote { margin: .6em 0; padding: 8px 14px; border-inline-start: 3px solid var(--gold); background: var(--surface-2); border-radius: 8px; }
.cite { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; margin: 0 2px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--positive-soft); color: var(--positive); cursor: pointer; border: 0; line-height: 22px; vertical-align: 1px; }
.cite.bad { background: var(--negative-soft); color: var(--negative); }

/* Agenda */
.due { min-width: 64px; text-align: center; border-radius: 12px; padding: 6px 4px; background: var(--sunken); }
.due b { display: block; font: 800 20px/1.1 var(--display); }
.due span { font-size: 11px; color: var(--text-2); }
.due.today { background: var(--amber-soft); } .due.today b { color: var(--amber); }
.due.overdue { background: var(--negative-soft); } .due.overdue b { color: var(--negative); }
.tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); background: none; cursor: pointer; flex: none; display: grid; place-items: center; color: transparent; padding: 0; }
.tick:hover { border-color: var(--positive); }
.tick.done { background: var(--positive); border-color: var(--positive); color: #fff; }
.tick svg { width: 13px; height: 13px; }
.done-text { text-decoration: line-through; color: var(--text-3); }

/* Ring */
.ring { --p: 0; --c: var(--positive); width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--sunken) 0); flex: none; }
.ring::before { content: ''; grid-area: 1 / 1; width: 96px; height: 96px; border-radius: 50%; background: var(--surface); }
.ring b { grid-area: 1 / 1; font: 800 26px var(--display); z-index: 1; }
.meter { height: 8px; border-radius: 99px; background: var(--sunken); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }

/* Chat */
.chat { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 18px; min-height: calc(100vh - 170px); }
.chat-list { display: flex; flex-direction: column; gap: 4px; }
.chat-list button { text-align: start; border: 0; background: none; padding: 10px 12px; border-radius: 12px; cursor: pointer; }
.chat-list button:hover { background: var(--surface-2); }
.chat-list button.active { background: var(--accent-soft); }
.chat-main { display: flex; flex-direction: column; min-height: 0; }
.messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; padding: 6px 2px 18px; }
.msg { max-width: 860px; }
.msg.user { align-self: flex-start; background: var(--accent); color: var(--accent-ink); padding: 12px 18px; border-radius: 18px 18px 4px 18px; max-width: 70%; white-space: pre-wrap; }
.msg.assistant { background: var(--surface); box-shadow: var(--shadow); padding: 18px 22px; border-radius: 18px; }
.msg .verify { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-soft); display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.composer { display: flex; gap: 10px; align-items: flex-end; background: var(--surface); border-radius: 18px; padding: 10px; box-shadow: var(--shadow); }
.composer textarea { flex: 1; border: 0; background: none; resize: none; min-height: 44px; max-height: 200px; padding: 10px; outline: none; line-height: 1.7; }
.thinking { display: flex; align-items: center; gap: 10px; color: var(--text-2); }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); animation: blink 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-inline-end-color: transparent; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Modal & toast */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(11, 20, 34, .55); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; animation: fade .15s ease; }
.modal { background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg); width: min(640px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; padding: 26px; animation: rise .18s ease; }
.modal.wide { width: min(900px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h3 { margin: 0; font: 800 21px/1.3 var(--display); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } }
.toasts { position: fixed; bottom: 22px; inset-inline-start: 22px; z-index: 200; display: grid; gap: 10px; }
.toast { background: var(--deep); color: #fff; padding: 12px 18px; border-radius: 14px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: center; max-width: 420px; animation: rise .2s ease; }
.toast.error { background: var(--negative); }
.toast svg { width: 18px; height: 18px; flex: none; }
.secret { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; direction: ltr; text-align: left; background: var(--sunken); padding: 12px 14px; border-radius: 12px; overflow-wrap: anywhere; user-select: all; }
pre.code { direction: ltr; text-align: left; background: var(--deep); color: #E6EAF0; padding: 14px 16px; border-radius: 12px; overflow-x: auto; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; margin: 8px 0 0; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--amber-soft); color: var(--text); }
.notice svg { color: var(--amber); flex: none; margin-top: 3px; }
.notice.info { background: var(--accent-soft); } .notice.info svg { color: var(--accent); }
.notice.ok { background: var(--positive-soft); } .notice.ok svg { color: var(--positive); }
.footer-note { text-align: center; color: var(--text-3); font-size: 12px; margin-top: 30px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-side, .grid-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 32px 24px; min-height: 280px; }
  .auth-points { display: none; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--sidebar); z-index: 60; transform: translateX(100%); transition: transform .22s ease; }
  .shell.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .shell.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(11, 20, 34, .45); z-index: 50; }
  .topbar { padding: 12px 16px; }
  .topbar .menu-btn { display: inline-flex; }
  .content { padding: 20px 16px 48px; }
  .chat { grid-template-columns: 1fr; }
  .chat-side { display: none; }
}
@media (max-width: 640px) {
  .grid-2, .grid-4, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .page-head h1, .hero h1 { font-size: 24px; }
  .hero .mark { display: none; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 10px; }
  .msg.user { max-width: 90%; }
}
@media print {
  .sidebar, .topbar, .no-print, .toasts { display: none !important; }
  .shell { display: block; }
  .panel { box-shadow: none; border: 1px solid #ddd; }
}

/* The ink mark disappears on dark surfaces; swap in the paper version. */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .auth-card .mark { content: url('/assets/img/mark-white.svg'); } }
:root[data-theme="dark"] .auth-card .mark { content: url('/assets/img/mark-white.svg'); }
