/* Datacense Assist — an analyst's desk. Light theme, committed. */
:root {
  --canvas: #F6F7FB; --surface: #FFFFFF; --surface-2: #F1F3F9; --line: #E3E6F0; --line-2: #D3D7E4;
  --ink: #1A1D2E; --ink-2: #3E4257; --muted: #6B7088; --faint: #9AA0B5;
  --navy: #1B1F4B; --navy-2: #262B5E; --rail-ink: #C9CDE6;
  --accent: #1A9BD7; --accent-2: #157FB0; --accent-soft: #E4F3FB;
  --good: #1E8E5A; --good-soft: #E1F4EA; --warn: #B7791F; --warn-soft: #FBF0D9; --bad: #C93B3B; --bad-soft: #FBE3E3;
  --r: 12px; --r-lg: 18px;
  --shadow: 0 1px 2px rgba(27,31,75,.06), 0 10px 30px -12px rgba(27,31,75,.12);
  --ui: "Geist", "Segoe UI", system-ui, -apple-system, sans-serif;
  --display: "Geist", "Segoe UI", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(.2,.7,.2,1);
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 14.5px/1.5 var(--ui); -webkit-font-smoothing: antialiased; letter-spacing: -.005em; }
h1,h2,h3 { margin: 0; }
p { margin: 0; }
code { font-family: var(--mono); font-size: .86em; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
kbd { font-family: var(--mono); font-size: 11px; background: var(--surface-2); border: 1px solid var(--line-2); border-bottom-width: 2px; padding: 0 5px; border-radius: 5px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .mono { font-family: var(--mono); font-size: 12.5px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-2); }
.display { font-family: var(--display); font-weight: 600; font-size: clamp(28px, 3vw, 38px); line-height: 1.15; letter-spacing: -.03em; text-wrap: balance; color: var(--ink); }
.display em { font-style: normal; color: var(--accent-2); }
.h2 { font-size: 24px; font-weight: 600; letter-spacing: -.025em; line-height: 1.2; }
.h3 { font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 10px; }
.sub { color: var(--muted); margin-top: 4px; max-width: 62ch; }
.lede { color: var(--muted); max-width: 56ch; margin: 12px auto 0; font-size: 15px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 76px 1fr; min-height: 100vh; transition: grid-template-columns .25s var(--ease); }
.app.expanded { grid-template-columns: 236px 1fr; }
.rail { background: var(--navy); color: var(--rail-ink); display: flex; flex-direction: column; align-items: stretch; padding: 14px 10px 12px; position: sticky; top: 0; height: 100vh; overflow: hidden; }
.rail-top { display: flex; align-items: center; gap: 12px; height: 40px; margin: 0 0 18px; padding-left: 8px; }
.logo { width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--accent); color: #fff; display: grid; place-items: center; text-decoration: none; font: 700 20px var(--ui); letter-spacing: -.02em; }
.rail-brand { display: none; color: #fff; font: 600 16px var(--ui); white-space: nowrap; letter-spacing: -.01em; }
.rail-brand em { font-style: normal; font-weight: 500; color: #9AD8F5; }
.expanded .rail-brand { display: inline; animation: fade .3s; }
.rail-nav { position: relative; display: flex; flex-direction: column; gap: 4px; width: 100%; }
.rail-pill { position: absolute; left: 0; top: 0; width: 100%; height: 56px; border-radius: 12px; background: rgba(255,255,255,.12); transition: transform .28s var(--ease), height .25s var(--ease); pointer-events: none; }
.rail-btn { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 56px; border: 0; background: transparent; color: var(--rail-ink); font: 600 10.5px/1 var(--ui); letter-spacing: .02em; border-radius: 12px; cursor: pointer; transition: color .15s; padding: 0; }
.rail-btn svg { width: 22px; height: 22px; flex: none; }
.rail-btn:hover, .rail-btn.active { color: #fff; }
.expanded .rail-btn { flex-direction: row; justify-content: flex-start; gap: 12px; height: 44px; padding: 0 14px; font-size: 14px; font-weight: 500; letter-spacing: 0; }
.expanded .rail-pill { height: 44px; }
.rail-dot { position: absolute; top: 9px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); border: 2px solid var(--navy); }
.expanded .rail-dot { top: 50%; transform: translateY(-50%); right: 14px; }
.rail-dot.ok { background: #3FD08A; } .rail-dot.warn { background: #F2B544; }
.rail-foot { margin-top: auto; width: 100%; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.rail-file { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 10px; color: var(--rail-ink); text-align: center; line-height: 1.25; width: 100%; }
.rail-file span { max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.expanded .rail-file { flex-direction: row; gap: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.06); font-size: 12.5px; text-align: left; }
.expanded .rail-file span { max-width: none; flex: 1; }
.rail-file .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; } .rail-file.ok .dot { background: #3FD08A; }
.rail-toggle { width: 36px; height: 36px; border-radius: 10px; border: 1px solid rgba(255,255,255,.14); background: transparent; color: var(--rail-ink); display: grid; place-items: center; cursor: pointer; transition: background .15s, transform .25s var(--ease); align-self: center; }
.rail-toggle:hover { background: rgba(255,255,255,.1); color: #fff; }
.rail-toggle svg { width: 18px; height: 18px; transition: transform .25s var(--ease); }
.expanded .rail-toggle { align-self: flex-end; } .expanded .rail-toggle svg { transform: rotate(180deg); }

.stage { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 28px; border-bottom: 1px solid var(--line); background: rgba(246,247,251,.85); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; }
.crumb { display: flex; gap: 8px; align-items: baseline; font-weight: 600; }
.crumb-app { color: var(--muted); font-weight: 500; } .crumb-sep { color: var(--faint); }
.status-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.status { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 500; color: var(--ink-2); }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.status.ok .dot { background: var(--good); } .status.warn .dot { background: var(--warn); } .status.bad .dot { background: var(--bad); }

.view { display: none; flex: 1; min-height: 0; }
.view.active { display: flex; animation: rise .22s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; font: 600 14px/1 var(--ui); text-decoration: none; transition: transform .12s var(--ease), background .15s, border-color .15s, box-shadow .15s; white-space: nowrap; }
.btn svg { width: 16px; height: 16px; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--navy); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.1) inset; }
.btn.primary:hover { background: var(--navy-2); }
.btn.quiet { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn.quiet:hover { border-color: var(--faint); background: var(--surface-2); }
.btn.danger { background: transparent; border-color: #EFC4C4; color: var(--bad); } .btn.danger:hover { background: var(--bad-soft); }
.btn.small { padding: 8px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; transition: .15s; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }
.link { background: none; border: 0; padding: 0; color: var(--accent-2); font: 500 13px var(--ui); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .actions.left { justify-content: flex-start; margin-top: 12px; }
.chip { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font: 600 11px/1.4 var(--mono); background: var(--surface-2); color: var(--muted); letter-spacing: .02em; vertical-align: middle; margin-left: 8px; }
.chip.ok { background: var(--good-soft); color: var(--good); } .chip.warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- Ask ---------- */
#view-ask { flex-direction: column; }
.chat-col { flex: 1; display: flex; flex-direction: column; min-height: 0; width: min(880px, 100%); margin: 0 auto; padding: 0 20px; }
.thread { flex: 1; overflow-y: auto; padding: 28px 0 12px; display: flex; flex-direction: column; gap: 18px; scroll-behavior: smooth; }
.empty { margin: auto 0; text-align: center; padding: 40px 0; }
.empty .eyebrow { margin-bottom: 14px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 26px auto 0; max-width: 720px; text-align: left; }
.tile { display: flex; gap: 12px; align-items: center; padding: 13px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); cursor: pointer; font: 500 14px/1.35 var(--ui); color: var(--ink); text-align: left; transition: transform .16s var(--ease), border-color .16s, box-shadow .16s; animation: rise .35s var(--ease) both; }
.tile:nth-child(2) { animation-delay: .05s } .tile:nth-child(3) { animation-delay: .1s } .tile:nth-child(4) { animation-delay: .15s } .tile:nth-child(5) { animation-delay: .2s } .tile:nth-child(6) { animation-delay: .25s }
.tile:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow); }
.tile .ico { width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-2); display: grid; place-items: center; flex: none; }
.tile .ico svg { width: 18px; height: 18px; }

.msg { display: flex; gap: 12px; max-width: 100%; animation: rise .24s var(--ease); }
.msg.user { justify-content: flex-end; }
.avatar { width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center; font: 700 13px var(--ui); background: var(--navy); color: #fff; margin-top: 2px; }
.bubble { max-width: 78%; padding: 12px 16px; border-radius: 16px; font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
.msg.user .bubble { background: var(--navy); color: #fff; border-bottom-right-radius: 6px; }
.msg.bot .bubble { background: var(--surface); border: 1px solid var(--line); border-top-left-radius: 6px; max-width: 100%; }
.msg.bot .bubble.error { background: var(--bad-soft); border-color: #F1C6C2; color: #6B120E; }
.bubble p + p { margin-top: 8px; } .bubble ul, .bubble ol { margin: 6px 0 4px; padding-left: 20px; } .bubble li { margin: 2px 0; }
.bubble table { border-collapse: collapse; width: 100%; margin: 8px 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.bubble th, .bubble td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.bubble th { color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.bubble tr:last-child td { border-bottom: 0; } .table-wrap { overflow-x: auto; }
.bot-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; max-width: 78%; }
.attach { display: flex; flex-wrap: wrap; gap: 8px; }
.attach img { width: 360px; max-width: 100%; border-radius: 12px; border: 1px solid var(--line); cursor: zoom-in; background: #fff; animation: pop .3s var(--ease); }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.attach .file { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 10px; background: var(--good-soft); color: var(--good); font-weight: 600; text-decoration: none; font-size: 14px; }
.attach .file svg { width: 16px; height: 16px; }
.prov { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font: 12px var(--mono); color: var(--muted); }
.prov b { color: var(--ink-2); font-weight: 500; }
.prov .p { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); }
.typing { display: inline-flex; gap: 5px; padding: 14px 16px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s } .typing i:nth-child(3) { animation-delay: .4s }
@keyframes blink { 0%,80%,100% { opacity: .25 } 40% { opacity: 1 } }

.composer-wrap { padding: 8px 0 16px; }
.banner { margin-bottom: 10px; padding: 9px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-2); font-size: 13px; font-weight: 500; }
.composer { display: flex; align-items: flex-end; gap: 6px; padding: 6px 6px 6px 8px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
.composer textarea { flex: 1; resize: none; border: 0; background: transparent; font: 15px/1.45 var(--ui); color: var(--ink); padding: 10px 6px; max-height: 180px; outline: none; }
.composer .icon-btn { align-self: center; }
.send { width: 42px; height: 42px; border-radius: 12px; border: 0; background: var(--navy); color: #fff; display: grid; place-items: center; cursor: pointer; transition: background .15s, transform .12s; }
.send svg { width: 19px; height: 19px; } .send:hover { background: var(--accent-2); } .send:disabled { opacity: .5; }
.composer-hint { display: flex; justify-content: space-between; align-items: center; padding: 8px 6px 0; font-size: 12px; color: var(--faint); }

/* ---------- pages ---------- */
.page { width: min(1240px, 100%); margin: 0 auto; padding: 28px 28px 40px; flex: 1; }
.page.narrow { max-width: 760px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.wb-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.side-col { display: flex; flex-direction: column; gap: 14px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tab { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font: 600 13px var(--ui); color: var(--ink-2); cursor: pointer; display: inline-flex; gap: 7px; align-items: center; transition: .15s; }
.tab:hover { border-color: var(--faint); } .tab.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.tab .n { font-family: var(--mono); font-size: 11px; opacity: .75; }
.tab .role { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; opacity: .7; }
.table-tools { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.table-tools input { flex: 1; max-width: 320px; font: 14px var(--ui); padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); }
.table-tools input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.table-wrap { overflow: auto; max-height: 62vh; border: 1px solid var(--line); border-radius: 12px; }
.table-wrap table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13.5px; }
.table-wrap th { position: sticky; top: 0; background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-wrap td { padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; color: var(--ink-2); }
.table-wrap td.num { text-align: right; font-family: var(--mono); font-size: 12.5px; color: var(--ink); font-variant-numeric: tabular-nums; }
.table-wrap tr:hover td { background: #F8F9FD; }
.skeleton { height: 220px; border-radius: 10px; background: linear-gradient(90deg, var(--surface-2) 25%, #E9ECF4 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { 0% { background-position: 100% 0 } 100% { background-position: 0 0 } }
.cols { display: flex; flex-wrap: wrap; gap: 6px; }
.col { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 8px; background: var(--surface-2); font: 12.5px var(--ui); color: var(--ink-2); }
.col i { font: 600 10px var(--mono); width: 16px; height: 16px; border-radius: 4px; display: grid; place-items: center; }
.col i.n { background: #DDEFFA; color: var(--accent-2); } .col i.d { background: #EFE6FA; color: #6D3FC2; } .col i.t { background: #E9EBF2; color: var(--muted); }
.drop { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; border: 1.5px dashed var(--line-2); cursor: pointer; transition: .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop-ico { width: 26px; height: 26px; color: var(--accent-2); }
.uploads { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.uploads li { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.uploads .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uploads .when { color: var(--faint); font-family: var(--mono); font-size: 11.5px; flex: none; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface-2); cursor: zoom-in; border: 1px solid var(--line); transition: transform .16s var(--ease), box-shadow .16s; }
.thumb:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 8px; font: 11px var(--mono); color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.55)); }
.thumb .x { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(26,29,46,.75); color: #fff; cursor: pointer; display: none; }
.thumb:hover .x { display: block; }

/* ---------- WhatsApp stepper ---------- */
.stepper { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.step { display: grid; grid-template-columns: 40px 1fr; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.step-marker { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; color: var(--muted); font: 600 14px var(--mono); position: relative; }
.step-marker .tick-ico { display: none; width: 20px; height: 20px; color: #fff; }
.step.done .step-marker { background: var(--good); border-color: var(--good); }
.step.done .step-marker .num { display: none; } .step.done .step-marker .tick-ico { display: block; }
.step.done .tick { stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw .5s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.step.current .step-marker { border-color: var(--accent); color: var(--accent-2); box-shadow: 0 0 0 4px var(--accent-soft); }
.step-title { font-weight: 600; font-size: 16px; margin-bottom: 8px; display: flex; align-items: center; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field select, .field input { font: 14px var(--ui); padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); }
.field select:focus, .field input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.field input:disabled { background: var(--surface-2); color: var(--faint); }
.qr-panel { margin-top: 14px; padding: 16px; border-radius: 14px; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.qr-panel img, .qr-panel canvas { width: 232px !important; height: 232px !important; image-rendering: pixelated; border-radius: 8px; background: #fff; padding: 8px; }
.qr-panel .installing { width: 232px; height: 232px; display: grid; place-items: center; text-align: center; color: var(--muted); }
.alert { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); color: #6B4508; font-size: 13px; }

/* ---------- modal / toast ---------- */
.modal { position: fixed; inset: 0; background: rgba(27,31,75,.5); display: grid; place-items: center; z-index: 50; padding: 20px; animation: fade .18s; }
@keyframes fade { from { opacity: 0 } }
.modal-card { background: var(--surface); border-radius: var(--r-lg); width: min(960px, 100%); max-height: 88vh; display: flex; flex-direction: column; box-shadow: var(--shadow); animation: pop .22s var(--ease); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-body { overflow: auto; padding: 14px 18px 18px; }
pre.log { font: 12.5px/1.5 var(--mono); white-space: pre-wrap; word-break: break-word; background: var(--surface-2); padding: 14px; border-radius: 10px; margin: 0; max-height: 60vh; overflow: auto; }
.lightbox img { max-width: 92vw; max-height: 90vh; border-radius: 14px; box-shadow: var(--shadow); }
.toast { position: fixed; right: 24px; bottom: 24px; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px; z-index: 60; box-shadow: var(--shadow); max-width: 420px; animation: slide .25s var(--ease); }
@keyframes slide { from { opacity: 0; transform: translateY(8px); } }
.toast.bad { background: var(--bad); } .toast.good { background: var(--good); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: fixed; bottom: 0; left: 0; right: 0; top: auto; height: 64px; flex-direction: row; padding: 0 8px; z-index: 20; }
  .rail-top, .rail-foot { display: none; }
  .app.expanded { grid-template-columns: 1fr; } .expanded .rail-btn { flex-direction: column; height: 56px; padding: 0; font-size: 10.5px; }
  .rail-nav { flex-direction: row; justify-content: space-around; padding: 0; }
  .rail-pill { display: none; }
  .rail-btn { height: 56px; width: 70px; }
  .stage { padding-bottom: 72px; }
  .topbar { padding: 10px 14px; gap: 10px; } .status.mono, .crumb-app, .crumb-sep { display: none; }
  .status-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } .status { white-space: nowrap; flex: none; }
  .wb-grid { grid-template-columns: 1fr; } .field-row { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr; } .bubble, .bot-col { max-width: 92%; }
  .page { padding: 18px 14px 30px; } .chat-col { padding: 0 12px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- login ---------- */
.login-body { display: grid; place-items: center; min-height: 100vh; background: var(--navy); }
.login-card { background: var(--surface); padding: 34px; border-radius: 20px; box-shadow: var(--shadow); width: min(400px, 92vw); display: flex; flex-direction: column; gap: 10px; }
.login-card .wordmark { font: 700 26px var(--ui); letter-spacing: -.03em; color: var(--navy); }
.login-card .wordmark em { font-style: normal; color: var(--accent); }
.login-card label { font-weight: 600; font-size: 13px; color: var(--muted); margin-top: 10px; }
.login-card input { font: 15px var(--ui); padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line-2); }
.login-card .error { color: var(--bad); font-size: 13px; min-height: 18px; }
