/* Terrynn web UI. Tokens follow the design canvas (design/README.md). */
:root {
  --bg: #F7F4EC; --side: #F1ECE0; --surface: #FDFBF6; --surface-2: #F6F2E8; --chat: #FBF9F3; --seg: #EFE9DB; --seg-2: #E6DFCF;
  --ink: #1A1B1E; --soft: #3C3D41; --soft-2: #4E4A42; --muted: #6B665C;
  --line: #E3DCCB; --line-2: #EEE8DA; --line-3: #D6CDB8;
  --gold: #A9781F; --gold-text: #7E5613; --gold-soft: #F3E7C9; --gold-wash: #F6EDD6; --gold-line: #E4CF9E; --gold-bright: #D9B45E;
  --bad: #B3261E; --bad-text: #9A2019; --bad-soft: #F8E3E0;
  --warn: #C0561B; --warn-text: #8F3E10; --warn-soft: #F9E4D6;
  --mod: #9A7B12; --mod-text: #6E570C;
  --ok: #2F6B47; --ok-dot: #3FA05A; --ok-soft: #E1EEE5;
  --dark: #131417; --dark-2: #1B1C20; --dark-3: #1F2025; --dark-line: #2C2D33; --dark-text: #ECE7DA; --dark-muted: #A29C8C;
  --sans: Inter, system-ui, sans-serif; --head: Sora, Inter, sans-serif; --mono: 'IBM Plex Mono', ui-monospace, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 var(--sans); color: var(--ink); background: var(--bg); overflow: hidden; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--gold-text); } a:hover { color: #5C3E0C; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); }
.eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Shell: sidebar | handle | main | handle | right */
.shell { height: 100vh; display: grid; grid-template-rows: 100%; position: relative; }
.shell.dragging { user-select: none; }
.splitter { cursor: col-resize; display: flex; justify-content: center; touch-action: none; background: transparent; }
.splitter::after { content: ""; width: 2px; height: 100%; background: var(--line); }
.splitter:hover, .splitter.active { background: var(--gold-soft); }
.hsplit { flex: none; height: 12px; cursor: row-resize; display: grid; place-items: center; touch-action: none; }
.hsplit::after { content: ""; width: 44px; height: 4px; border-radius: 2px; background: var(--line-3); }
.hsplit:hover::after, .hsplit.active::after { background: var(--gold); }

/* Sidebar */
.side { grid-column: 1; display: flex; flex-direction: column; gap: 12px; padding: 18px 14px 14px; background: var(--side); min-width: 0; min-height: 0; overflow: hidden; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; min-height: 34px; }
.brand img { height: 26px; width: auto; }
.icon-btn { width: 34px; height: 34px; flex: none; border: 0; border-radius: 8px; background: transparent; color: var(--soft); display: grid; place-items: center; }
.icon-btn:hover { background: rgba(255, 255, 255, 0.6); }
.tabs3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; padding: 3px; border-radius: 11px; background: var(--seg-2); }
.tabs3 button { min-height: 36px; padding: 0 4px; border: 0; border-radius: 8px; background: transparent; color: var(--soft-2); font-size: 12px; font-weight: 500; display: flex; align-items: center; justify-content: center; gap: 4px; }
.tabs3 button[aria-selected="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(78, 62, 24, 0.18); }
.count { font-family: var(--mono); font-size: 10px; background: var(--ink); color: var(--bg); border-radius: 8px; padding: 0 5px; }
.side-body { flex-grow: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; margin: 0 -4px; padding: 0 4px; }
.side-label { padding: 4px 6px; }
.btn-primary { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; border: 0; border-radius: 11px; background: var(--ink); color: var(--bg); font-family: var(--head); font-weight: 600; font-size: 13px; }
.btn-search { width: 42px; height: 42px; flex: none; border-radius: 11px; display: grid; place-items: center; border: 1px solid #DDD5C2; background: var(--surface); color: var(--soft); }
.btn-search[aria-expanded="true"] { border-color: var(--gold); background: var(--gold-soft); color: var(--ink); }
.field { width: 100%; height: 38px; padding: 0 12px; border: 1px solid #DDD5C2; border-radius: 10px; background: var(--surface); font-size: 13px; }
.field:focus { border-color: var(--gold-bright); outline: none; }
.chat-row { display: flex; align-items: center; border-radius: 10px; border: 1px solid transparent; }
.chat-row.current, .chat-row.editing { background: var(--surface); border-color: var(--line); }
.chat-row .open { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; min-width: 0; padding: 9px 4px 9px 10px; border: 0; background: transparent; text-align: left; color: var(--ink); }
.chat-row .open .t { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row.current .open .t { font-weight: 600; }
.chat-row .open .d { font-size: 12px; color: var(--muted); }
.chat-row .ren { opacity: 0; width: 32px; height: 32px; margin-right: 4px; transition: opacity .15s; }
.chat-row:hover .ren, .chat-row .ren:focus-visible { opacity: 1; }
.chat-row input { flex-grow: 1; min-width: 0; height: 36px; margin: 4px 0 4px 4px; padding: 0 8px; border: 1px solid var(--gold); border-radius: 8px; background: #fff; font-size: 13px; font-weight: 600; outline: none; }
.chat-row .save { width: 32px; height: 32px; margin: 0 4px; border: 0; border-radius: 8px; background: var(--ink); color: var(--bg); display: grid; place-items: center; }
.prop-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border-radius: 12px; border: 1px solid transparent; background: transparent; text-align: left; }
.prop-row[aria-pressed="true"] { background: var(--surface); border-color: var(--gold-bright); }
.prop-row .n { font-family: var(--head); font-weight: 600; font-size: 13px; display: block; }
.prop-row .s { font-size: 12px; color: var(--muted); display: block; }
.thumb { width: 38px; height: 38px; border-radius: 9px; overflow: hidden; flex: none; display: block; }
.tag { flex: none; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 9px; }
.tone-bad { background: var(--bad-soft); color: var(--bad-text); } .tone-ok { background: var(--ok-soft); color: var(--ok); }
.tone-info { background: var(--gold-soft); color: var(--gold-text); } .tone-warn { background: var(--warn-soft); color: var(--warn-text); }
.scope-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid transparent; background: transparent; font-size: 13px; font-weight: 500; text-align: left; }
.scope-row[aria-pressed="true"] { background: var(--surface); border-color: var(--gold-bright); font-weight: 600; }
.views { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 24px -14px rgba(78, 62, 24, 0.35); overflow: hidden; flex: none; }
.views-head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 8px; border-bottom: 1px solid var(--line-2); }
.views-head .thumb { width: 36px; height: 36px; }
.views-head .name { font-family: var(--head); font-weight: 600; font-size: 14px; }
.views-list { display: flex; flex-direction: column; gap: 1px; padding: 6px; }
.view-btn { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; color: var(--soft); font-size: 13px; font-weight: 500; text-align: left; }
.view-btn .l { flex-grow: 1; } .view-btn .m { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.view-btn[aria-pressed="true"] { background: var(--gold-soft); color: var(--ink); font-weight: 600; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px 6px 0; border-top: 1px solid var(--line); flex: none; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #EBCB7C, #AE7C24); display: grid; place-items: center; font-family: var(--head); font-weight: 700; flex: none; }
.me .who { display: flex; flex-direction: column; min-width: 0; flex-grow: 1; }
.me .who b { font-weight: 600; } .me .who span { font-size: 12px; color: var(--muted); }

/* Middle */
.mid { grid-column: 3; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--chat); }
.mid-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 14px 22px; border-bottom: 1px solid var(--line); flex: none; }
.mid-head .title { display: flex; flex-direction: column; flex-grow: 1; min-width: 0; }
.mid-head h1 { margin: 0; font-family: var(--head); font-weight: 600; font-size: 18px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toggle { display: flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 11px; border-radius: 10px; font-size: 13px; border: 1px solid var(--line-3); background: var(--surface); color: var(--soft-2); font-weight: 500; flex: none; }
.toggle[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--bg); font-weight: 600; }
.open-side { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }

.thread { flex-grow: 1; min-height: 0; overflow-y: auto; padding: 18px 22px 8px; display: flex; flex-direction: column; gap: 16px; }
.divider { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.divider::before, .divider::after { content: ""; flex-grow: 1; height: 1px; background: var(--line); }
.msg-user { align-self: flex-end; max-width: min(520px, 85%); background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 14px 14px 4px 14px; white-space: pre-wrap; }
.msg-agent { display: flex; gap: 10px; }
.msg-agent > img { width: 28px; height: 28px; object-fit: contain; flex: none; }
.msg-agent .body { display: flex; flex-direction: column; gap: 10px; min-width: 0; flex-grow: 1; }
.msg-agent p { margin: 0; }
.findings { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.findings li { display: flex; gap: 10px; align-items: flex-start; }
.pin { width: 20px; height: 20px; flex: none; border-radius: 50%; color: #fff; font-family: var(--mono); font-size: 11px; font-weight: 600; display: grid; place-items: center; }
.sev-high { background: var(--bad); } .sev-elevated { background: var(--ok); } .sev-moderate { background: #9A5A0C; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-family: var(--mono); font-size: 11px; padding: 3px 8px; border-radius: 6px; background: var(--seg); color: var(--soft); }
.approval { border: 1px solid var(--gold-line); background: var(--surface); border-radius: 14px; overflow: hidden; }
.approval header { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--gold-wash); border-bottom: 1px solid #EBDDB8; }
.approval header b { flex-grow: 1; font-weight: 600; }
.approval dl { margin: 0; padding: 12px 14px; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 6px 14px; font-size: 13px; }
.approval dt { color: var(--muted); } .approval dd { margin: 0; }
.approval .acts { display: flex; gap: 8px; padding: 0 14px 14px; }
.approval .result { margin: 0; padding: 0 14px 14px; font-weight: 500; }
.btn { min-height: 44px; padding: 0 18px; border-radius: 10px; font-size: 14px; border: 1px solid var(--line-3); background: var(--surface); color: var(--ink); font-weight: 500; }
.btn.dark { border: 0; background: var(--ink); color: var(--bg); font-weight: 600; }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: 13px; }
.btn.link { border: 0; background: transparent; color: var(--gold-text); }
.ok-text { color: var(--ok); } .bad-text { color: var(--bad-text); }
.composer-wrap { padding: 8px 22px 18px; flex: none; }
.suggest { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.suggest button { min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--soft); font-size: 13px; }
.composer { display: flex; flex-direction: column; gap: 8px; background: #fff; border: 1px solid var(--line-3); border-radius: 16px; padding: 10px 10px 8px 14px; box-shadow: 0 12px 30px -18px rgba(78, 62, 24, 0.35); }
.composer textarea { border: 0; outline: none; resize: none; background: transparent; font-size: 14px; }
.composer .bar { display: flex; align-items: center; gap: 8px; }
.composer .hint { font-size: 12px; color: var(--muted); flex-grow: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg { display: flex; flex: none; padding: 3px; border-radius: 9px; background: var(--seg); }
.seg button { min-height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 500; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(78, 62, 24, 0.18); }
.attach { width: 38px; height: 38px; border: 0; border-radius: 10px; background: #F3EEE2; color: var(--soft); display: grid; place-items: center; }
.send { width: 38px; height: 38px; border: 0; border-radius: 10px; background: linear-gradient(135deg, #EBCB7C, #AE7C24); color: var(--ink); display: grid; place-items: center; }
.send:disabled { opacity: 0.5; cursor: default; }
.typing { font-size: 13px; color: var(--muted); }

/* Approvals mode */
.appr { flex-grow: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; padding: 14px 22px 18px; }
.status-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; flex: none; }
.status-tabs button { min-height: 44px; padding: 0 10px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; white-space: nowrap; }
.status-tabs button[aria-selected="true"] { border-bottom-color: var(--gold); color: var(--ink); font-weight: 600; }
.req-list { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 0; margin: 0; padding: 0; list-style: none; }
.req { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.req .t { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.req .t b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.req .meta { display: flex; align-items: center; gap: 8px; justify-self: end; }
.req .why { font-size: 13px; color: var(--soft); min-width: 0; }
.req .why strong { color: var(--ink); font-weight: 600; }
.req .acts { display: flex; gap: 6px; justify-self: end; align-items: center; }
.reach { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 10px; }
.reach-contractor { background: var(--bad-soft); color: var(--bad-text); } .reach-insurer { background: var(--gold-wash); color: var(--gold-text); } .reach-terrynn { background: var(--ok-soft); color: var(--ok); }
.rules { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.rules > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.rules > div:last-child { border-bottom: 0; }
.empty { margin: 0; padding: 28px 16px; text-align: center; color: var(--muted); }
.foot-note { margin: auto 0 0; font-size: 13px; color: var(--muted); }

/* Right column */
.right { grid-column: 5; display: flex; flex-direction: column; padding: 14px; background: var(--side); min-width: 0; min-height: 0; }
.twin { display: flex; flex-direction: column; background: var(--dark); color: var(--dark-text); border-radius: 16px; overflow: hidden; min-height: 0; }
.twin.full { position: fixed; inset: 0; z-index: 2000; border-radius: 0; }
.twin-head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-bottom: 1px solid #26272C; }
.twin-head h2 { margin: 0; font-family: var(--head); font-weight: 600; font-size: 14px; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; }
.twin-head .sync { font-family: var(--mono); font-size: 11px; color: var(--dark-muted); flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live { width: 8px; height: 8px; border-radius: 50%; background: #5FB36A; flex: none; animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(95,179,106,.7); } 70% { box-shadow: 0 0 0 7px rgba(95,179,106,0); } 100% { box-shadow: 0 0 0 0 rgba(95,179,106,0); } }
@media (prefers-reduced-motion: reduce) { .live { animation: none; } }
.layers { display: flex; flex: 0 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; gap: 2px; padding: 3px; border-radius: 9px; background: var(--dark-3); }
.layers button { flex: none; min-height: 28px; padding: 0 9px; border: 0; border-radius: 7px; background: transparent; color: #CFC8B6; font-size: 12px; font-weight: 500; }
.layers button[aria-pressed="true"] { background: var(--gold-bright); color: var(--dark); font-weight: 600; }
.dark-btn { width: 34px; height: 34px; flex: none; border: 1px solid #3A3B42; border-radius: 9px; background: var(--dark-3); color: var(--dark-text); display: grid; place-items: center; }
.viewport { position: relative; flex-grow: 1; min-height: 0; background: radial-gradient(ellipse at 50% 45%, #1D1E23 0%, var(--dark) 70%); }
.viewport svg.scene { width: 100%; height: 100%; display: block; }
.viewport .cap { position: absolute; left: 14px; top: 12px; font-family: var(--mono); font-size: 11px; color: var(--gold-bright); }
.viewport .src { position: absolute; right: 14px; bottom: 14px; text-align: right; font-family: var(--mono); font-size: 11px; color: var(--dark-muted); line-height: 1.5; }
.viewport .ctl { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 6px; }
.viewport .ctl button { width: 34px; height: 34px; border: 1px solid var(--dark-line); border-radius: 9px; background: var(--dark-2); color: var(--dark-text); display: grid; place-items: center; }

.panel { flex-grow: 1; min-height: 0; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.panel-tabs { display: flex; gap: 2px; padding: 0 10px; border-bottom: 1px solid var(--line); flex: none; overflow-x: auto; }
.panel-tabs button { min-height: 44px; padding: 0 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; white-space: nowrap; }
.panel-tabs button[aria-selected="true"] { border-bottom-color: var(--gold); color: var(--ink); font-weight: 600; }
.panel-body { flex-grow: 1; min-height: 0; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.tile { padding: 10px 12px; border-radius: 12px; background: var(--bg); }
.tile .k { font-size: 12px; color: var(--muted); display: block; }
.mon-top { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 10px; }
.mon-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.gauge-tile { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.gauge-tile .k { align-self: flex-start; }
.risk { display: grid; grid-template-columns: 74px minmax(0, 1fr) 62px; gap: 8px; align-items: center; font-size: 12px; margin-top: 7px; }
.risk .bar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; }
.risk .bar span { height: 8px; background: var(--seg-2); }
.risk .bar span:first-child { border-radius: 2px 0 0 2px; } .risk .bar span:last-child { border-radius: 0 2px 2px 0; }
.events { margin: 0; padding: 0; list-style: none; font-size: 13px; }
.events li { display: grid; grid-template-columns: 44px 10px minmax(0, 1fr); gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.events li:last-child { border-bottom: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot-bad { background: var(--bad); } .dot-ok { background: var(--ok-dot); } .dot-gold { background: var(--gold); } .dot-muted { background: #9AA39D; }
.kv { margin: 0; display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.note { padding: 12px; border-radius: 12px; background: var(--gold-wash); color: #5C3E0C; font-size: 13px; }
.rowlist > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.rowlist > div:last-child { border-bottom: 0; }
.rowlist .d { color: var(--muted); }
.st { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; align-self: start; }
.st-booked, .st-done, .st-processed { background: var(--ok-soft); color: var(--ok); }
.st-suggested, .st-scheduled { background: var(--gold-wash); color: var(--gold-text); }
.st-monitoring, .st-baseline { background: var(--seg); color: var(--soft); }
.cap-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.cap-row:last-child { border-bottom: 0; }
.cap-row .ph { display: block; width: 44px; height: 32px; border-radius: 6px; overflow: hidden; }
.cap-row .ph.empty { border: 1px dashed #C9BFA6; }

/* Sign in */
.signin { height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.signin .art { display: flex; align-items: center; justify-content: center; padding: 48px; background: var(--side); }
.signin .art img { width: 100%; max-width: 700px; height: auto; }
.signin .form { display: flex; flex-direction: column; justify-content: space-between; padding: 56px clamp(24px, 6vw, 80px); }
.signin h1 { margin: 0; font-family: var(--head); font-weight: 600; font-size: clamp(32px, 4vw, 44px); line-height: 1.08; letter-spacing: -0.02em; }
.signin h1 em { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 500; font-size: 1.18em; color: var(--gold-text); }
.signin .cta { display: flex; align-items: center; justify-content: center; min-height: 52px; border-radius: 12px; background: var(--ink); color: var(--bg); font-family: var(--head); font-weight: 600; font-size: 15px; text-decoration: none; }
.signin .cta:hover { color: var(--bg); }
@media (max-width: 860px) { .signin { grid-template-columns: 1fr; } .signin .art { display: none; } }

/* Uploads and demo sign-in */
.upload { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px dashed #C9BFA6; border-radius: 10px; }
.upload:hover { border-color: var(--gold); }
.signin form { display: flex; flex-direction: column; gap: 10px; }
.signin form input { height: 48px; padding: 0 14px; border: 1px solid var(--line-3); border-radius: 12px; background: var(--surface); font-size: 15px; }
.signin form input:focus { border-color: var(--gold); outline: none; }
.signin .cta[disabled] { opacity: .6; }
.signin .err { margin: 0; color: var(--bad-text); font-size: 13px; }

/* Satellite vs twin */
.compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.compare .pane { position: relative; height: 200px; border-radius: 10px; overflow: hidden; background: var(--seg-2); }
.compare .tag-over { position: absolute; left: 8px; top: 8px; z-index: 500; font-family: var(--mono); font-size: 10px; padding: 2px 6px; border-radius: 5px; background: rgba(19, 20, 23, 0.8); color: var(--dark-text); pointer-events: none; }
.leaflet-container { font: 11px var(--sans); }
.leaflet-control-attribution { font-size: 9px; }

/* Agent icon: idle breathes, thinking sparkles and sweeps, arrived flashes once */
.agent { position: relative; display: inline-block; flex: none; }
.agent-body { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.agent-halo { position: absolute; inset: -30% -40%; border-radius: 50%; background: radial-gradient(ellipse, rgba(201, 154, 62, .45), transparent 65%); opacity: 0; pointer-events: none; }
.agent-sweep { position: absolute; inset: 0; opacity: 0; pointer-events: none; background: linear-gradient(105deg, transparent 0%, transparent 14%, rgba(255,255,255,.85) 20%, #fff 25%, rgba(255,255,255,.85) 30%, transparent 36%, transparent 64%, rgba(255,255,255,.85) 70%, #fff 75%, rgba(255,255,255,.85) 80%, transparent 86%, transparent 100%); background-size: 200% 100%; -webkit-mask: url(/assets/agent.png) center/contain no-repeat; mask: url(/assets/agent.png) center/contain no-repeat; mix-blend-mode: screen; }
.agent-idle .agent-body { animation: agent-hover 3.6s ease-in-out infinite; transform-origin: 60% 60%; }
.agent-thinking .agent-body { animation: agent-breathe 2.6s ease-in-out infinite, agent-ember 2.6s ease-in-out infinite; }
.agent-thinking .agent-halo { animation: agent-glow 2.6s ease-in-out infinite; }
.agent-thinking .agent-sweep { opacity: 1; animation: agent-sweep 2.6s linear infinite; }
.agent-arrived .agent-halo { animation: agent-flash-halo 1.4s ease-out 1 both; }
.agent-arrived .agent-sweep { animation: agent-flash-sweep 1.1s ease-in-out 1 both; }
.agent-arrived .agent-body { animation: agent-flash-body 1.4s ease-out 1 both; }
.spark { position: absolute; width: var(--s); height: var(--s); margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2); pointer-events: none; opacity: 0;
  background: radial-gradient(circle, #ffffff 0%, #fff7dc 32%, rgba(255, 224, 150, 0) 68%);
  clip-path: polygon(50% 0%, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0% 50%, 42% 42%);
  filter: drop-shadow(0 0 2px rgba(255, 247, 205, 1)) drop-shadow(0 0 5px rgba(255, 218, 135, .9)) drop-shadow(0 0 9px rgba(255, 198, 105, .55));
  animation: agent-twinkle 3s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes agent-hover { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-2px) rotate(-2deg); } }
@keyframes agent-breathe { 0%, 100% { transform: translateY(0) scale(.97); } 50% { transform: translateY(-1px) scale(1.03); } }
@keyframes agent-ember { 0%, 100% { filter: saturate(.8) brightness(.95); } 50% { filter: saturate(1.3) brightness(1.08) sepia(.2); } }
@keyframes agent-glow { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
@keyframes agent-sweep { 0% { background-position: 200% 0; } 100% { background-position: 0% 0; } }
@keyframes agent-twinkle { 0%, 100% { opacity: 0; transform: scale(.3) rotate(0deg); } 50% { opacity: 1; transform: scale(1) rotate(90deg); } }
@keyframes agent-flash-halo { 0% { opacity: 0; transform: scale(.6); } 25% { opacity: 1; transform: scale(1.15); } 100% { opacity: 0; transform: scale(1.4); } }
@keyframes agent-flash-sweep { 0% { opacity: 1; background-position: 200% 0; } 100% { opacity: 1; background-position: 0% 0; } }
@keyframes agent-flash-body { 0% { filter: brightness(1.6) saturate(1.3); transform: scale(1.12); } 60% { filter: brightness(1.15) saturate(1.1); } 100% { filter: none; transform: scale(1); } }
.typing { background: linear-gradient(105deg, var(--muted) 0%, var(--muted) 38%, var(--ink) 50%, var(--muted) 62%, var(--muted) 100%); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: agent-textsweep 2.6s linear infinite; }
@keyframes agent-textsweep { 0% { background-position: 220% 0; } 100% { background-position: -20% 0; } }
@media (prefers-reduced-motion: reduce) { .agent *, .spark, .typing { animation: none !important; } .agent-sweep, .agent-halo { display: none; } .typing { color: var(--muted); background: none; } }
.draft { margin: 0; color: var(--soft); white-space: pre-wrap; animation: agent-shimmer 1.6s ease-in-out infinite; }
@keyframes agent-shimmer { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .draft { animation: none; opacity: .8; } }
