@font-face { font-family: 'Vazirmatn'; src: url('../fonts/Vazirmatn-var.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --navy: #0b2447; --navy-2: #123a6f; --teal: #0f766e; --teal-2: #14b8a6; --teal-soft: #e6f6f4;
  --bg: #f4f7fb; --surface: #ffffff; --text: #0f172a; --muted: #5b6b80; --border: #e2e8f0; --border-2: #cbd5e1;
  --danger: #be123c; --danger-soft: #ffe4ea; --warn: #b45309; --warn-soft: #fef3c7; --ok: #15803d; --ok-soft: #dcfce7; --info: #1d4ed8; --info-soft: #dbeafe;
  --radius: 14px; --radius-sm: 10px; --shadow: 0 1px 2px #0b244714, 0 8px 24px #0b24470f; --shadow-lg: 0 18px 50px #0b244729;
  --header-h: 64px; --bottom-h: 64px; --gutter: 16px; --max: 1180px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: 'Vazirmatn', Tahoma, system-ui, sans-serif; background: var(--bg); color: var(--text); line-height: 1.8; font-size: 15px; -webkit-tap-highlight-color: transparent; }
a { color: var(--navy-2); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.5; margin: 0 0 .5em; color: var(--navy); font-weight: 700; }
h1 { font-size: clamp(24px, 4vw, 38px); } h2 { font-size: clamp(19px, 2.6vw, 25px); } h3 { font-size: 17px; } h4 { font-size: 15px; }
p { margin: 0 0 .8em; } ul { padding-inline-start: 1.2em; margin: 0 0 .8em; }
.ic { flex: none; vertical-align: middle; }
:focus-visible { outline: 3px solid #14b8a6aa; outline-offset: 2px; border-radius: 6px; }
button { font-family: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); } .small { font-size: 13px; } .tiny { font-size: 12px; } .center { text-align: center; } .bold { font-weight: 700; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; } td.ltr, th.ltr { display: table-cell; text-align: start; } .num { font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 12px; align-items: center; } .row.wrap { flex-wrap: wrap; } .between { justify-content: space-between; } .grow { flex: 1; min-width: 0; }
.col { display: flex; flex-direction: column; gap: 12px; }
.gap-sm { gap: 6px; } .gap-lg { gap: 20px; } .mt { margin-top: 16px; } .mt-lg { margin-top: 28px; } .mb { margin-bottom: 16px; } .hide { display: none !important; }

/* layout */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.header { position: sticky; top: 0; z-index: 40; background: #fffffff2; backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); height: var(--header-h); }
.header .in { max-width: var(--max); margin: 0 auto; height: 100%; padding: 0 var(--gutter); display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--navy); font-size: 18px; text-decoration: none !important; }
.brand .logo { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--navy), var(--teal)); color: #fff; display: grid; place-items: center; }
.nav { display: flex; gap: 4px; margin-inline-start: 12px; }
.nav a { padding: 8px 12px; border-radius: 10px; color: var(--text); font-weight: 500; text-decoration: none; }
.nav a:hover { background: var(--bg); } .nav a.active { background: var(--teal-soft); color: var(--teal); font-weight: 700; }
.header .actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.stars .ic.off { fill: none; color: #cbd5e1; }
@media (max-width: 720px) { .hide-m { display: none; } }
.icon-btn { position: relative; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--border); background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--navy); }
.icon-btn:hover { background: var(--bg); }
.dot { position: absolute; top: 4px; inset-inline-start: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; display: grid; place-items: center; line-height: 1; }
.main { flex: 1; width: 100%; max-width: var(--max); margin: 0 auto; padding: 24px var(--gutter) 48px; }
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
.grid > *, .shell > *, .row > .grow { min-width: 0; }
.row.between { flex-wrap: wrap; }
.main, .content { overflow-wrap: break-word; }
.nw { white-space: nowrap; }
.side { position: sticky; top: calc(var(--header-h) + 16px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; }
.side a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 500; }
.side a:hover { background: var(--bg); } .side a.active { background: var(--navy); color: #fff; }
.side .sep { height: 1px; background: var(--border); margin: 8px 6px; }
.side .badge-n { margin-inline-start: auto; background: var(--danger); color: #fff; border-radius: 10px; font-size: 11px; padding: 0 7px; }
.bottom { display: none; }
.footer { border-top: 1px solid var(--border); background: #fff; padding: 28px var(--gutter) 84px; color: var(--muted); font-size: 13px; }
.footer .in { max-width: var(--max); margin: 0 auto; display: grid; gap: 8px; }

/* components */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; } .card.link { transition: .15s; cursor: pointer; text-decoration: none !important; color: inherit; display: block; }
.card.link:hover { border-color: var(--teal-2); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card h3 { margin-bottom: 6px; }
.grid { display: grid; gap: 16px; } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; background: var(--teal); color: #fff; font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none !important; transition: .15s; white-space: nowrap; }
.btn:hover { filter: brightness(1.07); } .btn:active { transform: scale(.98); } .btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.navy { background: var(--navy); } .btn.sec { background: #fff; color: var(--navy); border-color: var(--border-2); } .btn.ghost { background: transparent; color: var(--navy); }
.btn.danger { background: var(--danger); } .btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; } .btn.lg { min-height: 52px; padding: 0 26px; font-size: 16px; } .btn.block { width: 100%; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--bg); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: #bbf7d0; } .badge.warn { background: var(--warn-soft); color: var(--warn); border-color: #fde68a; }
.badge.danger { background: var(--danger-soft); color: var(--danger); border-color: #fecdd3; } .badge.info { background: var(--info-soft); color: var(--info); border-color: #bfdbfe; } .badge.teal { background: var(--teal-soft); color: var(--teal); border-color: #99f6e4; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border-2); background: #fff; color: var(--navy); font-size: 14px; cursor: pointer; text-decoration: none !important; transition: .12s; }
.chip:hover { border-color: var(--teal); background: var(--teal-soft); } .chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; } .field label { font-weight: 600; font-size: 14px; color: var(--navy); }
.input, select.input, textarea.input { width: 100%; min-height: 46px; padding: 9px 14px; border: 1px solid var(--border-2); border-radius: 12px; background: #fff; font: inherit; color: var(--text); }
textarea.input { min-height: 110px; resize: vertical; line-height: 1.9; } .input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px #14b8a633; }
.input.err { border-color: var(--danger); } .err-msg { color: var(--danger); font-size: 13px; } .hint { color: var(--muted); font-size: 12.5px; }
.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; font-size: 14px; border: 1px solid; margin-bottom: 14px; align-items: flex-start; }
.alert.info { background: var(--info-soft); border-color: #bfdbfe; color: #1e3a8a; } .alert.warn { background: var(--warn-soft); border-color: #fde68a; color: #78350f; }
.alert.danger { background: var(--danger-soft); border-color: #fecdd3; color: #881337; } .alert.ok { background: var(--ok-soft); border-color: #bbf7d0; color: #14532d; }
.progress { height: 8px; border-radius: 8px; background: #e8eef5; overflow: hidden; } .progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--teal-2)); border-radius: 8px; transition: width .4s; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs button, .tabs a { padding: 10px 16px; background: none; border: 0; border-bottom: 3px solid transparent; font-weight: 600; cursor: pointer; color: var(--muted); white-space: nowrap; text-decoration: none; }
.tabs .on { color: var(--teal); border-bottom-color: var(--teal); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 14px; } th { background: #f8fafc; text-align: start; padding: 10px 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
td { padding: 10px 12px; border-top: 1px solid var(--border); vertical-align: top; } tr:hover td { background: #fbfdff; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: 14px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); } .empty .ic { width: 44px; height: 44px; color: var(--border-2); margin-bottom: 8px; }
.card.stat, .stat { display: flex; flex-direction: column; gap: 6px; } .stat b { font-size: 26px; line-height: 1.25; color: var(--navy); } .stat span { color: var(--muted); font-size: 13px; }
.icon-circle { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); flex: none; }
.skeleton { background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 50%, #eef2f7 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 10px; min-height: 18px; } @keyframes sk { to { background-position: -200% 0; } }
.spinner { width: 22px; height: 22px; border: 3px solid #cbd5e1; border-top-color: var(--teal); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; } @keyframes spin { to { transform: rotate(360deg); } }
.page-head { display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; flex-wrap: wrap; margin-bottom: 20px; } .page-head h1 { font-size: 24px; margin: 0; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; } .crumbs a { color: var(--muted); }

/* modal & toast */
.overlay { position: fixed; inset: 0; background: #0b24478c; z-index: 80; display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { background: #fff; border-radius: 18px; max-width: 560px; width: 100%; max-height: 92vh; overflow: auto; padding: 22px; box-shadow: var(--shadow-lg); } .modal.wide { max-width: 820px; }
.modal h3 { font-size: 19px; } .modal .foot { display: flex; gap: 10px; justify-content: flex-start; margin-top: 18px; flex-wrap: wrap; }
.toasts { position: fixed; bottom: 22px; inset-inline-start: 22px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 44px); }
.toast { background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); animation: up .2s; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.toast.err { background: var(--danger); } .toast.ok { background: var(--teal); }
@keyframes fade { from { opacity: 0; } } @keyframes up { from { transform: translateY(10px); opacity: 0; } }

/* hero */
.hero { background: radial-gradient(1200px 400px at 85% -10%, #14b8a633, transparent), linear-gradient(135deg, var(--navy), #123a6f 60%, #0f5e63); color: #fff; border-radius: 24px; padding: clamp(24px, 5vw, 56px); display: grid; grid-template-columns: 1.15fr .85fr; gap: 28px; align-items: center; overflow: hidden; position: relative; }
.hero h1 { color: #fff; margin-bottom: 14px; } .hero p { color: #d6e4f5; font-size: 16.5px; max-width: 54ch; }
.hero .search { display: flex; gap: 8px; background: #fff; border-radius: 16px; padding: 6px; margin-top: 18px; box-shadow: var(--shadow-lg); }
.hero .search input { border: 0; flex: 1; padding: 0 12px; font: inherit; min-width: 0; background: transparent; color: var(--text); } .hero .search input:focus { outline: none; }
.hero .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; } .hero .chip { background: #ffffff1c; color: #fff; border-color: #ffffff40; font-size: 13px; } .hero .chip:hover { background: #ffffff33; }
.trust-row { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 18px; color: #bcd3ee; font-size: 13px; } .trust-row span { display: inline-flex; gap: 6px; align-items: center; }
.hero-card { background: #ffffff14; border: 1px solid #ffffff2e; border-radius: 20px; padding: 18px; backdrop-filter: blur(6px); }
.mini-step { display: flex; gap: 10px; align-items: center; padding: 8px 0; font-size: 14px; } .mini-step .n { width: 26px; height: 26px; border-radius: 50%; background: #ffffff26; display: grid; place-items: center; font-size: 12px; }
.mini-step.done .n { background: var(--teal-2); color: #04302c; } .mini-step.cur .n { background: #fff; color: var(--navy); font-weight: 700; }
.section { margin-top: 44px; } .section-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 16px; gap: 10px; flex-wrap: wrap; }

/* stepper */
.stepper { display: flex; gap: 0; counter-reset: s; overflow-x: auto; padding: 6px 2px 12px; scrollbar-width: thin; }
.step { flex: 1; min-width: 118px; position: relative; text-align: center; padding: 0 6px; cursor: pointer; background: none; border: 0; font: inherit; color: var(--muted); }
.step .dotn { width: 34px; height: 34px; margin: 0 auto 6px; border-radius: 50%; display: grid; place-items: center; background: #e8eef5; color: var(--muted); font-weight: 700; position: relative; z-index: 1; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border-2); }
.step::before { content: ''; position: absolute; top: 17px; inset-inline-start: -50%; width: 100%; height: 3px; background: #e2e8f0; } .step:first-child::before { display: none; }
.step.done .dotn { background: var(--teal); color: #fff; box-shadow: 0 0 0 1px var(--teal); } .step.done::before, .step.cur::before { background: var(--teal); }
.step.cur .dotn { background: var(--navy); color: #fff; box-shadow: 0 0 0 4px #0b244722; } .step.cur { color: var(--navy); font-weight: 700; } .step.sel .dotn { outline: 3px solid #14b8a688; }
.step .t { font-size: 12.5px; line-height: 1.5; display: block; }
.task { display: flex; gap: 12px; padding: 12px 8px; border-bottom: 1px solid var(--border); align-items: flex-start; }
.task:last-child { border-bottom: 0; } .task .cb { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--border-2); background: #fff; cursor: pointer; display: grid; place-items: center; flex: none; color: #fff; margin-top: 2px; }
.task.done .cb { background: var(--teal); border-color: var(--teal); } .task.done .tt { color: var(--muted); text-decoration: line-through; }
.timeline { position: relative; padding-inline-start: 22px; } .timeline::before { content: ''; position: absolute; inset-inline-start: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding: 0 0 18px; } .tl-item::before { content: ''; position: absolute; inset-inline-start: -22px; top: 7px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--navy-2); }
.tl-item.platform::before { border-color: var(--teal); } .tl-item.lawyer::before { border-color: #7c3aed; } .tl-item.self::before { border-color: var(--border-2); } .tl-item.official::before { border-color: var(--ok); }

/* chat */
.chatbox { display: flex; flex-direction: column; height: min(70vh, 640px); background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.chat-head { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; background: #fbfdff; }
.msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: #f7f9fc; scroll-behavior: smooth; }
.bubble { max-width: min(86%, 560px); padding: 10px 14px; border-radius: 16px; line-height: 1.85; font-size: 14.5px; word-break: break-word; white-space: pre-wrap; }
.bubble.me { align-self: flex-start; background: var(--navy); color: #fff; border-end-start-radius: 4px; }
.bubble.them { align-self: flex-end; background: #fff; border: 1px solid var(--border); border-end-end-radius: 4px; }
.bubble.sys { align-self: center; background: #eef2f7; color: var(--muted); font-size: 12.5px; padding: 6px 12px; border-radius: 999px; max-width: 92%; text-align: center; }
.bubble .time { display: block; font-size: 11px; opacity: .65; margin-top: 4px; }
.bot-msg { align-self: flex-end; max-width: min(92%, 640px); background: #fff; border: 1px solid var(--border); border-radius: 16px; border-end-end-radius: 4px; padding: 14px 16px; box-shadow: var(--shadow); }
.bot-msg .q { color: var(--teal); font-size: 12.5px; font-weight: 700; margin-bottom: 4px; display: flex; gap: 6px; align-items: center; }
.bot-msg .refs { font-size: 12.5px; color: var(--muted); border-top: 1px dashed var(--border-2); margin-top: 10px; padding-top: 8px; }
.bot-msg .unk { font-size: 13px; background: var(--warn-soft); color: #78350f; border-radius: 10px; padding: 8px 10px; margin-top: 10px; }
.composer { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); background: #fff; }
.composer textarea { flex: 1; resize: none; min-height: 44px; max-height: 120px; padding: 10px 14px; border: 1px solid var(--border-2); border-radius: 14px; font: inherit; }
.composer textarea:focus { outline: none; border-color: var(--teal); }
.fab { position: fixed; bottom: 22px; inset-inline-end: 22px; z-index: 50; height: 56px; padding: 0 20px; border-radius: 28px; border: 0; background: linear-gradient(135deg, var(--teal), var(--navy)); color: #fff; font-weight: 700; display: flex; gap: 8px; align-items: center; cursor: pointer; box-shadow: var(--shadow-lg); font-size: 15px; }
.widget { position: fixed; bottom: 90px; inset-inline-end: 22px; z-index: 60; width: min(400px, calc(100vw - 24px)); }
.widget .chatbox { height: min(70vh, 560px); box-shadow: var(--shadow-lg); }
.typing i { display: inline-block; width: 6px; height: 6px; background: var(--muted); border-radius: 50%; margin: 0 2px; animation: bl 1s infinite; } .typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; } @keyframes bl { 50% { opacity: .2; } }
.callbar { display: flex; gap: 12px; align-items: center; padding: 12px 16px; background: #0b2447; color: #fff; }
.callbar.live { background: linear-gradient(90deg, #0f766e, #0b2447); }
.call-btn { width: 46px; height: 46px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; background: #ffffff26; color: #fff; } .call-btn.end { background: var(--danger); } .call-btn.go { background: #16a34a; }

/* misc */
.lawyer-card { display: flex; gap: 14px; } .avatar { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 22px; flex: none; background: linear-gradient(135deg, var(--navy), var(--teal)); }
.stars { color: #f59e0b; display: inline-flex; gap: 1px; } .stars .ic { fill: currentColor; }
.price-tag { font-weight: 800; color: var(--navy); font-size: 17px; } .price-tag small { font-weight: 500; color: var(--muted); }
.contract { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 20px; line-height: 2.1; } .contract h2 { text-align: center; font-size: 19px; } .contract .meta { text-align: center; color: var(--muted); font-size: 12.5px; }
.contract h3 { font-size: 14.5px; margin: 14px 0 2px; } .contract .locked { opacity: .7; filter: blur(.3px); } .contract .locked p { background: repeating-linear-gradient(45deg, #f1f5f9, #f1f5f9 8px, #e8eef5 8px, #e8eef5 16px); border-radius: 8px; padding: 6px 10px; color: var(--muted); }
.contract .warn { background: var(--warn-soft); border: 1px solid #fde68a; border-radius: 10px; padding: 8px 12px; font-size: 13px; } .contract .sign { display: flex; justify-content: space-around; margin-top: 40px; color: var(--muted); }
.switch { position: relative; width: 46px; height: 26px; flex: none; } .switch input { opacity: 0; width: 100%; height: 100%; position: absolute; inset: 0; margin: 0; cursor: pointer; z-index: 2; }
.switch i { position: absolute; inset: 0; border-radius: 14px; background: #cbd5e1; transition: .2s; } .switch i::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px #0003; }
.switch input:checked + i { background: var(--teal); } .switch input:checked + i::after { inset-inline-start: 23px; }
.status-pill-flow { display: flex; gap: 6px; flex-wrap: wrap; }
.legal-note { font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 10px; margin-top: 14px; }
.qa-row { display: flex; gap: 10px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--border); text-decoration: none !important; color: var(--text); } .qa-row:hover { color: var(--teal); }
.auth-wrap { max-width: 460px; margin: 20px auto; }
.pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .pick label { border: 2px solid var(--border); border-radius: 14px; padding: 12px; cursor: pointer; text-align: center; font-weight: 600; } .pick input { display: none; } .pick input:checked + span { color: var(--teal); } .pick label:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }
.type-card { display: flex; gap: 12px; align-items: flex-start; } .type-card .icon-circle { background: var(--c, var(--teal-soft)); color: #fff; }

@media (max-width: 1180px) { .shell .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .shell .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; } .g4 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(2, 1fr); }
  .shell { grid-template-columns: 1fr; } .side { display: none; } .nav { display: none; }
}
@media (max-width: 720px) {
  :root { --gutter: 14px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; } .main { padding-bottom: calc(var(--bottom-h) + 32px); }
  .bottom { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; bottom: 0; inset-inline: 0; height: var(--bottom-h); background: #fff; border-top: 1px solid var(--border); z-index: 45; padding-bottom: env(safe-area-inset-bottom); }
  .bottom a { display: flex; flex-direction: column; gap: 2px; align-items: center; justify-content: center; font-size: 11.5px; color: var(--muted); text-decoration: none; position: relative; }
  .bottom a.active { color: var(--teal); font-weight: 700; }
  .fab { bottom: calc(var(--bottom-h) + 14px); height: 50px; padding: 0 16px; } .widget { bottom: calc(var(--bottom-h) + 72px); inset-inline: 12px; width: auto; }
  .kv { grid-template-columns: 1fr; gap: 0; } .kv dd { margin-bottom: 8px; } .page-head h1 { font-size: 20px; }
  .toasts { bottom: calc(var(--bottom-h) + 12px); inset-inline: 14px; }
  .brand span.t { display: none; } .hero .search { flex-direction: column; } .hero .search .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print { .header, .bottom, .side, .fab, .footer, .no-print { display: none !important; } body { background: #fff; } }

/* two-column detail layouts: main + aside, stacked on narrower viewports */
.split { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.kv { grid-template-columns: 110px minmax(0, 1fr); }
@media (max-width: 1180px) { .shell .split { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) { .split { grid-template-columns: minmax(0, 1fr); } }
.badge:empty { display: none; }

/* ============ chat-first home (ChatGPT-style) ============ */
.app.is-chat { height: 100vh; height: 100dvh; }
.chat-main { flex: 1; min-height: 0; display: flex; width: 100%; background: linear-gradient(#fff, var(--bg)); }
.chat-content { flex: 1; display: flex; min-width: 0; min-height: 0; }
.chat-content > #chatroot { flex: 1; display: flex; min-height: 0; min-width: 0; }
.chat-page { flex: 1; display: flex; flex-direction: column; width: 100%; max-width: 860px; margin: 0 auto; min-height: 0; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 22px var(--gutter) 8px; scroll-behavior: smooth; overscroll-behavior: contain; }
.chat-empty { text-align: center; padding: clamp(10px, 6vh, 56px) 0 8px; }
.chat-empty h1 { font-size: clamp(22px, 3.4vw, 32px); margin: 14px 0 6px; }
.chat-logo { width: 58px; height: 58px; border-radius: 18px; margin: 0 auto; background: linear-gradient(135deg, var(--navy), var(--teal)); color: #fff; display: grid; place-items: center; box-shadow: var(--shadow-lg); }
.sg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 24px auto 0; max-width: 700px; text-align: start; }
.sg { display: flex; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--border); background: #fff; border-radius: 16px; cursor: pointer; font: inherit; color: var(--text); text-align: start; transition: .15s; }
.sg:hover { border-color: var(--teal-2); box-shadow: var(--shadow); transform: translateY(-1px); }
.sg b { display: block; color: var(--navy); font-size: 14.5px; } .sg > span:last-child > span { display: block; color: var(--muted); font-size: 12.5px; }
.ic-box { width: 40px; height: 40px; border-radius: 12px; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; flex: none; }
.chat-thread { padding-bottom: 12px; }
.m { display: flex; gap: 10px; margin: 0 0 18px; align-items: flex-start; }
.m.user { justify-content: flex-start; } .m.user .bub { background: #e6edf7; color: var(--navy); padding: 10px 16px; border-radius: 20px; border-start-start-radius: 6px; max-width: min(82%, 560px); line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
.m.bot .av { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; background: linear-gradient(135deg, var(--navy), var(--teal)); color: #fff; margin-top: 2px; }
.m.bot .body { flex: 1; min-width: 0; line-height: 2; }
.m.bot .ans { margin: 0 0 4px; white-space: pre-wrap; } .m.bot .q { color: var(--teal); font-size: 12.5px; font-weight: 700; display: flex; gap: 6px; align-items: center; margin-bottom: 2px; }
.m.bot .refs { font-size: 12.5px; color: var(--muted); border-top: 1px dashed var(--border-2); margin-top: 10px; padding-top: 8px; line-height: 1.9; }
.m.bot .unk { font-size: 13px; background: var(--warn-soft); color: #78350f; border-radius: 10px; padding: 8px 10px; margin-top: 8px; line-height: 1.9; }
.m.ad { display: block; margin: 0 0 18px 0; padding-inline-start: 44px; }
.nav-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; margin-top: 12px; }
.nav-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: #fff; color: var(--text); text-decoration: none !important; transition: .15s; }
.nav-card:hover { border-color: var(--teal-2); box-shadow: var(--shadow); } .nav-card .nc-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.6; } .nav-card .nc-t b { color: var(--navy); font-size: 14.5px; } .nav-card .nc-t span { color: var(--muted); font-size: 12.5px; }
.chat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; } .chat-chips .chip { font-size: 13px; text-align: start; }
.chat-dock { padding: 8px var(--gutter) 10px; }
.chat-input { display: flex; align-items: flex-end; gap: 8px; background: #fff; border: 1px solid var(--border-2); border-radius: 26px; padding: 6px 8px 6px 8px; box-shadow: var(--shadow); transition: .15s; }
.chat-input:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px #14b8a633, var(--shadow); }
.chat-input textarea { flex: 1; border: 0; background: transparent; resize: none; font: inherit; padding: 9px 12px; min-height: 44px; max-height: 140px; line-height: 1.8; color: var(--text); } .chat-input textarea:focus { outline: none; }
.chat-input .send { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--teal); color: #fff; cursor: pointer; display: grid; place-items: center; flex: none; } .chat-input .send:hover { filter: brightness(1.08); }
.chat-foot { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 11.5px; color: var(--muted); padding: 6px 10px 0; }
.linkbtn { background: none; border: 0; color: var(--navy-2); cursor: pointer; font: inherit; font-size: 12px; text-decoration: underline; }
.chat-page:has(.chat-empty:not(.hide)) [data-clear] { visibility: hidden; }
.chat-page.compact .chat-empty { padding-top: 0; } .chat-page.compact .chat-empty h1 { font-size: 17px; } .chat-page.compact .chat-empty p, .chat-page.compact .chat-logo { display: none; }
.chat-page.compact .sg-grid { grid-template-columns: 1fr; margin-top: 10px; gap: 6px; } .chat-page.compact .sg { padding: 8px 10px; } .chat-page.compact .sg > span:last-child > span { display: none; }
.widget { height: min(72vh, 600px); background: var(--bg); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-lg); display: flex; }
.widget > .chat-page { max-width: none; }

/* ============ ad slots (labelled, separate from answers) ============ */
.ad-slot { margin: 12px 0; position: relative; } .ad-slot:empty { display: none; }
.ad-banner { min-height: 62px; } .ad-rect { min-height: 150px; margin: 12px 4px 4px; } .ad-native { min-height: 78px; }
.grid > .ad-slot { grid-column: 1 / -1; margin: 4px 0; }
.ad-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #fff; border: 1px dashed var(--border-2); border-radius: 14px; position: relative; }
.ad-card.tone-navy { background: linear-gradient(135deg, #0b2447, #123a6f); color: #fff; border: 0; } .ad-card.tone-navy .ad-txt span { color: #c7d7ee; } .ad-card.tone-navy b { color: #fff; }
.ad-rect .ad-card { flex-direction: column; text-align: center; padding: 18px 12px; }
.ad-label { position: absolute; top: -9px; inset-inline-start: 12px; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 0 8px; font-size: 11px; color: var(--muted); line-height: 17px; }
.ad-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; flex: none; }
.ad-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.6; font-size: 13px; } .ad-txt b { color: var(--navy); font-size: 14px; } .ad-txt span { color: var(--muted); }
.ad-card iframe { width: 100%; height: 90px; border: 0; } .ad-card.embed { padding: 8px; display: block; }
.ad-slot.native-ad { min-height: 56px; border: 1px dashed var(--border-2); border-radius: 12px; }

@media (max-width: 720px) {
  .chat-main { padding-bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom)); }
  .sg-grid { grid-template-columns: 1fr 1fr; gap: 8px; } .sg { flex-direction: column; align-items: flex-start; padding: 12px; gap: 8px; } .sg b { font-size: 13.5px; } .sg > span:last-child > span { font-size: 11.5px; }
  .m.ad { padding-inline-start: 0; } .chat-foot span { font-size: 10.5px; }
}
.side .ad-slot { margin: 10px 2px 2px; } .side .ad-rect { min-height: 140px; } .side .ad-card { padding: 12px 8px; } .side .ad-card .btn { width: 100%; }
.chat-head { flex-wrap: wrap; } .chat-head .grow { flex: 1 1 130px; }
