/* DefenceTender theme. WhatsApp-style greens: teal accent, light-green outgoing bubbles,
   white incoming bubbles, warm chat wallpaper. Light and dark follow WhatsApp Web. */
:root {
  --background: #ffffff;
  --foreground: #111b21;
  --card: #ffffff;
  --muted: #f0f2f5;
  --muted-foreground: #667781;
  --sidebar: #ffffff;
  --sidebar-accent: #f0f2f5;
  --border: #e9edef;
  --input: #e9edef;
  --primary: #008069;
  --primary-foreground: #ffffff;
  --ring: #00a884;
  --accent: #00a884;
  --good: #1daa61;
  --warn: #b58105;
  --bad: #ea0038;
  --bar: #00a884;
  --outgoing: #d9fdd3;
  --outgoing-fg: #111b21;
  --incoming: #ffffff;
  --chat-bg: #efeae2;
  --header: #f0f2f5;
  --composer: #ffffff;
  --unread: #25d366;
  --chip-on: #d9fdd3;
  --chip-on-fg: #008069;
  --bubble-meta: #667781;
  --link: #027eb5;
  --sep: #ffffff;
  --radius: 12px;
  --list-w: clamp(280px, 27vw, 420px);
  --right-w: 440px;
  --font: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --wallpaper: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' fill='none'%3E%3Cg stroke='%230b141a' stroke-opacity='.055' stroke-width='1.2'%3E%3Ccircle cx='28' cy='36' r='9'/%3E%3Ccircle cx='150' cy='70' r='16'/%3E%3Ccircle cx='78' cy='168' r='7'/%3E%3Cpath d='M96 24h18M188 150v18M40 120l12 12M170 28l-10 10'/%3E%3C/g%3E%3C/svg%3E");
  color-scheme: light;
}
html.dark {
  --background: #0b141a;
  --foreground: #e9edef;
  --card: #202c33;
  --muted: #202c33;
  --muted-foreground: #8696a0;
  --sidebar: #111b21;
  --sidebar-accent: #2a3942;
  --border: #222d34;
  --input: #2a3942;
  --primary: #00a884;
  --primary-foreground: #111b21;
  --ring: #00a884;
  --accent: #00a884;
  --good: #25d366;
  --warn: #f0c14b;
  --bad: #f15c6d;
  --bar: #00a884;
  --outgoing: #005c4b;
  --outgoing-fg: #e9edef;
  --incoming: #202c33;
  --chat-bg: #0b141a;
  --header: #202c33;
  --composer: #2a3942;
  --unread: #00a884;
  --chip-on: #005c4b;
  --chip-on-fg: #e9edef;
  --bubble-meta: rgb(233 237 239 / .65);
  --link: #53bdeb;
  --sep: #182229;
  --wallpaper: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' fill='none'%3E%3Cg stroke='%23ffffff' stroke-opacity='.04' stroke-width='1.2'%3E%3Ccircle cx='28' cy='36' r='9'/%3E%3Ccircle cx='150' cy='70' r='16'/%3E%3Ccircle cx='78' cy='168' r='7'/%3E%3Cpath d='M96 24h18M188 150v18M40 120l12 12M170 28l-10 10'/%3E%3C/g%3E%3C/svg%3E");
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 14px/1.45 var(--font); background: var(--background); color: var(--foreground); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 13px; }
.muted { color: var(--muted-foreground); }
.small { font-size: 12px; }
.icon { width: 16px; height: 16px; flex: none; }
.icon-inline { width: 13px; height: 13px; vertical-align: -2px; }
html:not(.dark) .only-dark, html.dark .only-light { display: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; font-weight: 500; white-space: nowrap; background: none; }
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:not(:disabled):hover { opacity: .88; }
.btn-outline { border-color: var(--border); background: var(--background); }
.btn-outline:not(:disabled):hover { background: var(--muted); }
.btn-ghost { color: var(--muted-foreground); }
.btn-ghost:hover { background: var(--muted); color: var(--foreground); }
.btn-sm { height: 28px; padding: 0 12px; font-size: 12.5px; }
.btn-block { width: 100%; justify-content: center; height: 38px; }
.icon-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: 0; background: none; color: var(--muted-foreground); cursor: pointer; }
.icon-btn:hover, .icon-btn.active { background: var(--sidebar-accent); color: var(--foreground); text-decoration: none; }
.icon-btn:disabled { opacity: .4; cursor: default; }
.pill { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--border); font-size: 11.5px; font-weight: 500; }
.pill .icon { width: 12px; height: 12px; }
.pill-muted { color: var(--muted-foreground); background: var(--muted); border-color: transparent; }
.pill-warn { color: var(--warn); border-color: currentColor; }

/* ===== messenger shell: chat list + conversation, details drawer ===== */
.shell { display: grid; grid-template-columns: minmax(0, var(--list-w)) minmax(0, 1fr); height: 100vh; height: 100dvh; overflow: hidden; background: var(--sidebar); }
.left { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--sidebar); border-right: 1px solid var(--border); position: relative; }
.list-head, .chat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 60px; min-height: 60px; padding: 0 10px 0 14px; background: var(--header); border-bottom: 1px solid var(--border); flex: none; }
.list-head-actions, .chat-head-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.list-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.list-title-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.list-title-text strong { font-size: 16px; font-weight: 600; }
.list-title-text .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-title .avatar-user { width: 40px; height: 40px; font-size: 14px; background: var(--accent); color: #fff; border: 0; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; font-size: 14px; }
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--primary); color: #fff; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; }
.list-search { padding: 8px 12px 6px; background: var(--sidebar); flex: none; }
.list-head-phone { display: none; }
.list-app { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.list-foot { flex: none; margin: 0; padding: 8px 14px 10px; border-top: 1px solid var(--border); }
.login-version { text-align: center; margin-top: 16px; }
.search-pill { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 8px; background: var(--header); }
.search-pill .icon { color: var(--muted-foreground); }
.search-pill input[type="search"] { flex: 1; border: 0; height: 34px; padding: 0; background: transparent; border-radius: 0; outline: 0; }
.search-pill input[type="search"]:focus { border: 0; }
.avatar { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 999px; font-size: 10.5px; font-weight: 700; color: #fff; }
.avatar-bot { --bot-h: 285; background: radial-gradient(circle at 30% 25%, oklch(0.82 0.13 var(--bot-h)), oklch(0.58 0.2 var(--bot-h)) 70%); text-shadow: 0 1px 1px rgb(0 0 0 / .2); }
.avatar-xs { width: 18px; height: 18px; font-size: 7.5px; }
.run-bot { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; }
.avatar-lg { width: 40px; height: 40px; font-size: 12.5px; }
.avatar-user { background: var(--muted); color: var(--muted-foreground); border: 1px solid var(--border); width: 26px; height: 26px; font-size: 10px; }
.left-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.threads-empty { padding: 12px 16px; margin: 0; }
.threads { display: flex; flex-direction: column; gap: 0; padding: 0; margin: 0; }
.thread { display: flex; gap: 14px; align-items: center; padding: 10px 16px; min-height: 72px; width: 100%; border-radius: 0; border-bottom: 1px solid var(--border); background: transparent; }
.thread:hover { background: var(--sidebar-accent); text-decoration: none; }
.thread.active { background: var(--sidebar-accent); box-shadow: none; }
.thread .avatar { width: 48px; height: 48px; font-size: 19.2px; color: #fff; }
.thread-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.thread-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.thread-top strong { font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-top time { font-size: 12px; color: var(--muted-foreground); flex: none; }
.thread.unread .thread-top time { color: var(--unread); }
.thread-bot { display: flex; align-items: center; gap: 8px; min-width: 0; }
.thread-preview { color: var(--muted-foreground); font-size: 14px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.thread.unread .thread-preview { font-weight: 500; color: var(--foreground); }
.tick { flex: none; color: var(--muted-foreground); }
.unread-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--unread); color: #fff; font-size: 12px; font-weight: 700; line-height: 1; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.workspace-menu { position: fixed; top: 64px; left: 12px; width: min(320px, calc(100vw - 24px)); max-height: min(70vh, 560px); overflow: auto; z-index: 50; background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 40px rgb(0 0 0 / .18); padding: 8px; }
.thread.is-hidden { display: none !important; }
.workspace-label { margin: 4px 8px 6px; font-size: 12px; font-weight: 600; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: .04em; }
.nav-group summary { list-style: none; display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 8px; cursor: pointer; color: var(--muted-foreground); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; user-select: none; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary:hover { color: var(--foreground); }
.nav-group .chev { width: 13px; height: 13px; transition: transform .15s; }
.nav-group[open] .chev { transform: rotate(90deg); }
.nav-group ul { list-style: none; margin: 0 0 6px; padding: 0; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 6px 8px 6px 12px; border-radius: 8px; color: var(--foreground); }
.nav-item .icon { color: var(--muted-foreground); }
.nav-item:hover { background: var(--sidebar-accent); text-decoration: none; }
.nav-item.active { background: var(--sidebar-accent); font-weight: 600; }
.nav-item.active .icon { color: var(--foreground); }
.nav-item.soon { color: var(--muted-foreground); }
.nav-item em { margin-left: auto; font-style: normal; font-size: 10.5px; color: var(--muted-foreground); opacity: .8; }
.list-head form { margin: 0; }

/* MIDDLE: the open chat */
.middle { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--chat-bg); }
.chat-title { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.chat-title .avatar { width: 40px; height: 40px; font-size: 14px; }
.chat-id { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.chat-id strong { font-size: 16px; font-weight: 500; }
.chat-status { color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-status.waiting, .chat-status.running { color: var(--accent); }
.transcript { flex: 1; min-height: 0; overflow-y: auto; scroll-behavior: smooth; background-color: var(--chat-bg); background-image: var(--wallpaper); }
.transcript-inner { margin: 0; padding: 16px 6% 8px; display: flex; flex-direction: column; gap: 3px; }
.sep { align-self: center; color: var(--muted-foreground); font-size: 12.5px; padding: 6px 12px; margin: 8px 0; background: var(--sep); border-radius: 8px; box-shadow: 0 1px 0.5px rgb(11 20 26 / .13); }
.msg-user, .msg-out { display: flex; flex-direction: column; align-items: flex-end; }
.msg-bot, .msg-in { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; max-width: min(92%, 680px); }
.bubble-out, .bubble-in { position: relative; display: flow-root; max-width: min(78vw, 560px); padding: 6px 8px 5px 9px; border-radius: 8px; box-shadow: 0 1px 0.5px rgb(11 20 26 / .13); line-height: 1.4; overflow-wrap: anywhere; }
.bubble-out { background: var(--outgoing); color: var(--outgoing-fg); border-bottom-right-radius: 2px; }
.bubble-in { background: var(--incoming); color: var(--foreground); border-top-left-radius: 2px; }
.bubble-text { white-space: pre-wrap; }
.bubble-meta { float: right; margin: 6px 0 -2px 12px; font-size: 11px; line-height: 1; color: var(--bubble-meta); }
.bubble-meta-solo { float: none; margin: 0 0 2px; }
.bubble-in a, .gen-card a { color: var(--link); }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; color: var(--muted-foreground); font-size: 12.5px; }
.steps li { display: flex; align-items: center; gap: 8px; }
.steps .icon { width: 14px; height: 14px; }
.thinking { color: var(--muted-foreground); font-size: 12.5px; }
.thinking summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
.thinking summary::-webkit-details-marker { display: none; }
.thinking summary .icon { width: 14px; height: 14px; flex: none; }
.thinking summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thinking-body { margin: 6px 0 2px 6px; padding-left: 14px; border-left: 1px solid var(--border); white-space: pre-wrap; line-height: 1.55; max-height: 240px; overflow: auto; }
.answer { line-height: 1.6; overflow-wrap: anywhere; }
.answer strong { font-weight: 650; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--muted); font-size: 12px; font-weight: 500; }
.chip .icon { width: 13px; height: 13px; color: var(--good); }
.gen-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); overflow: hidden; box-shadow: 0 1px 2px rgb(0 0 0 / .04); }
.gen-card-title { padding: 10px 14px 6px; font-weight: 600; }
.gen-card table { width: 100%; border-collapse: collapse; }
.gen-card td { padding: 7px 14px; border-top: 1px solid var(--border); vertical-align: top; }
.gen-card td:first-child { font-weight: 500; }
.gen-card td.num { text-align: right; white-space: nowrap; font-weight: 600; }
.gen-card-foot { padding: 7px 14px; border-top: 1px solid var(--border); background: var(--muted); color: var(--muted-foreground); font-size: 12px; }
.tone-good { color: var(--good); } .tone-warn { color: var(--warn); } .tone-bad { color: var(--bad); } .tone-muted { color: var(--muted-foreground); }
.approval { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); padding: 12px 14px; max-width: 460px; box-shadow: 0 1px 3px rgb(0 0 0 / .05); }
.approval-eyebrow { display: flex; align-items: center; gap: 6px; color: var(--accent); font-size: 11.5px; font-weight: 600; }
.approval-eyebrow .icon { width: 14px; height: 14px; }
.approval-title { font-weight: 600; margin-top: 4px; }
.approval-detail { color: var(--muted-foreground); font-size: 12.5px; margin-top: 2px; }
.approval-actions { display: flex; gap: 8px; margin-top: 10px; }
.approval-outcome { margin-top: 8px; font-size: 12.5px; font-weight: 500; }
.approval-pending { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.msg-in .gen-card, .msg-in .approval { width: min(100%, 520px); }
.composer-wrap { flex: none; max-width: none; width: 100%; margin: 0; padding: 6px 12px 10px; background: var(--header); }
.composer { display: flex; align-items: flex-end; gap: 6px; border: 0; border-radius: 24px; background: var(--composer); padding: 6px 6px 6px 4px; box-shadow: none; }
.composer:focus-within { outline: 0; }
.composer textarea { flex: 1; border: 0; outline: 0; resize: none; background: none; padding: 8px 4px; max-height: 160px; line-height: 1.45; }
.icon-btn.round { border-radius: 999px; }
.send { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; border: 0; background: var(--accent); color: #fff; cursor: pointer; flex: none; }
.send:disabled { opacity: .4; }
.send .icon { width: 18px; height: 18px; }
.composer-hint { font-size: 11.5px; text-align: center; padding-top: 4px; }
.working { display: none; align-items: center; gap: 8px; color: var(--muted-foreground); font-size: 12.5px; padding: 0 6px 8px; }
.htmx-request.working, .htmx-request .working { display: flex; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 6px; height: 6px; border-radius: 99px; background: var(--muted-foreground); animation: pulse 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }

/* RIGHT: details drawer (WhatsApp contact-info panel) */
.drawer-backdrop { display: none; position: fixed; inset: 0; z-index: 35; border: 0; padding: 0; margin: 0; background: rgb(11 20 26 / .45); cursor: pointer; }
.shell.right-open .drawer-backdrop { display: block; }
.right { position: fixed; top: 0; right: 0; bottom: 0; width: min(var(--right-w), 100vw); z-index: 40; display: flex; flex-direction: column; min-height: 0; background: var(--background); border-left: 1px solid var(--border); box-shadow: -8px 0 32px rgb(0 0 0 / .16); transform: translateX(104%); transition: transform .22s ease; }
.shell.right-open .right { transform: none; }
.right-head { display: flex; align-items: center; justify-content: space-between; height: 60px; padding: 0 10px 0 16px; border-bottom: 1px solid var(--border); background: var(--header); flex: none; }
.right-title { display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; }
.right-title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.right-tabs { display: flex; gap: 2px; }
.right-body { flex: 1; min-height: 0; overflow-y: auto; }
.view { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.panel { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; background: var(--card); }
.panel h3 { margin-bottom: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 14px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.kpi { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; background: var(--card); }
.kpi-label { color: var(--muted-foreground); font-size: 11.5px; }
.kpi-value { font-size: 20px; font-weight: 650; letter-spacing: -0.02em; }
.kpi-sub { color: var(--muted-foreground); font-size: 11.5px; }
.kpi-sub a { text-decoration: underline; text-underline-offset: 2px; }
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.rows .row:first-child { border-top: 0; }
.row-main { min-width: 0; display: flex; flex-direction: column; }
.row-sub { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-side { display: flex; align-items: center; gap: 8px; flex: none; }
.tender-link { font-weight: 500; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.countdown { font-size: 12px; white-space: nowrap; }
.status { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--muted); color: var(--muted-foreground); white-space: nowrap; }
.status-analysed, .status-drafting, .status-pending-feedback { background: color-mix(in oklch, var(--foreground) 10%, transparent); color: var(--foreground); }
.status-submitted { background: var(--primary); color: var(--primary-foreground); }
.status-won { background: color-mix(in oklch, var(--good) 18%, transparent); color: var(--good); }
.status-lost, .status-archived { color: var(--muted-foreground); }
.fit { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; border: 1px solid var(--border); font-size: 11px; font-weight: 700; }
.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.bars li { display: grid; grid-template-columns: 110px 1fr 54px; align-items: center; gap: 10px; }
.bar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 8px; border-radius: 99px; background: var(--muted); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 99px; background: var(--bar); }
.bar-value { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.bar-note { grid-column: 2 / 4; font-size: 11px; margin-top: -4px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 10px; padding: 6px 0; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 3px; top: 18px; bottom: -6px; width: 1px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.tl-dot { width: 7px; height: 7px; margin-top: 6px; border-radius: 99px; background: var(--muted-foreground); flex: none; }
.tl-body { display: flex; flex-direction: column; min-width: 0; }
.tl-text { overflow-wrap: anywhere; }
.tl-meta { font-size: 11.5px; }
.tl-meta a { text-decoration: underline; text-underline-offset: 2px; }
.empty { color: var(--muted-foreground); margin: 4px 0; }
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 48px 24px; border-radius: var(--radius);
  background-image: radial-gradient(color-mix(in oklch, var(--muted-foreground) 25%, transparent) 1px, transparent 1px); background-size: 14px 14px; }
.empty-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--card); border: 1px solid var(--border); }
.flash { margin: 0; padding: 8px 12px; border-radius: 10px; font-size: 12.5px; border: 1px solid var(--border); }
.flash-good { color: var(--good); border-color: color-mix(in oklch, var(--good) 35%, transparent); background: color-mix(in oklch, var(--good) 7%, transparent); }
.flash-warn { color: var(--warn); border-color: color-mix(in oklch, var(--warn) 35%, transparent); background: color-mix(in oklch, var(--warn) 7%, transparent); }
.flash-bad { color: var(--bad); border-color: color-mix(in oklch, var(--bad) 35%, transparent); background: color-mix(in oklch, var(--bad) 7%, transparent); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.toolbar form { margin: 0; }
select, input[type=text], input[type=search], input[type=email], input[type=password] { height: 32px; border: 1px solid var(--input); border-radius: 8px; background: var(--background); padding: 0 10px; outline: 0; }
select:focus, input:focus { border-color: var(--ring); }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: 220px; gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--sidebar); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 120px; }
.col header { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 4px; }
.bcard { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; }
.bcard-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 2px; }
.more { text-align: center; margin: 2px 0; }
.triage-card { border: 1px solid var(--border); border-radius: 16px; padding: 16px; background: var(--card); display: flex; flex-direction: column; gap: 10px; box-shadow: 0 2px 8px rgb(0 0 0 / .05); }
.triage-card h2 { font-size: 16px; line-height: 1.35; }
.triage-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.facts { display: grid; grid-template-columns: 90px 1fr; gap: 6px 12px; margin: 0; }
.facts dt { color: var(--muted-foreground); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.desc { margin: 0; color: var(--muted-foreground); white-space: pre-line; }
.triage-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.triage-actions .reason { flex: 1 1 100%; }
.tender-head h2 { font-size: 17px; line-height: 1.35; margin-top: 8px; }
.search-form { display: flex; align-items: center; gap: 8px; border: 1px solid var(--input); border-radius: 999px; padding: 0 14px; margin: 0; }
.search-form input { border: 0; flex: 1; height: 38px; padding: 0; background: none; }
.live { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.live-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); font-weight: 600; }
.live-head .btn { margin-left: auto; }
.live-dot { width: 8px; height: 8px; border-radius: 99px; background: #e5484d; box-shadow: 0 0 0 3px color-mix(in srgb, #e5484d 25%, transparent); }
.live-dot.off { background: var(--muted-foreground); box-shadow: none; }
.live-head .pill { margin-left: auto; }
.live-url { padding: 4px 12px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-bottom: 1px solid var(--border); }
.live-screen img { display: block; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.live-screen { display: flex; align-items: center; background: var(--muted, #f4f4f5); }
.live-note, .live-policy { padding: 6px 12px; font-size: 12.5px; margin: 0; }
.live-note:empty { display: none; }
.live-steps { margin: 0; padding: 6px 12px 10px 32px; font-size: 12.5px; border-top: 1px solid var(--border); }
.live-steps li { margin: 2px 0; overflow-wrap: anywhere; }
.live-screen { aspect-ratio: 16 / 10; border-radius: 0; justify-content: center; }

/* Cmd+K (openbot command-menu) */
.cmdk { border: 1px solid var(--border); border-radius: 16px; padding: 0; width: min(576px, 92vw); margin-top: 12svh; background: var(--card); color: var(--foreground); box-shadow: 0 20px 60px rgb(0 0 0 / .25); }
.cmdk::backdrop { background: rgb(0 0 0 / .3); }
.cmdk-input { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; border-bottom: 1px solid var(--border); }
.cmdk-input input { flex: 1; border: 0; height: 46px; padding: 0; background: none; }
kbd { font: 11px var(--font); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border); color: var(--muted-foreground); }
.cmdk-results { max-height: 50vh; overflow-y: auto; padding: 6px; }
.cmdk-group { padding: 8px 10px 4px; font-size: 11px; color: var(--muted-foreground); font-weight: 600; }
.cmdk-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; }
.cmdk-item:hover, .cmdk-item.selected { background: var(--muted); text-decoration: none; }
.cmdk-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-empty { padding: 16px; text-align: center; }

/* Narrow widths (under 768px): the list is the home screen, then a full-screen chat. */
.only-narrow { display: none; }
@media (max-width: 767px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .shell:not(.chat-open) .middle { display: none; }
  .shell.chat-open .left { display: none; }
  .only-narrow { display: inline-grid; }
  .list-head-desk { display: none; }
  .list-head-phone { display: flex; }
  .list-search { display: none; }
  .left.search-open .list-search { display: block; }
  .shell:not(.chat-open) .thread.active { background: transparent; }
  .transcript-inner { padding-left: 12px; padding-right: 16px; }
  .right { width: 100%; }
  .bubble-out, .bubble-in { max-width: 88%; }
  .workspace-menu { left: auto; right: 12px; }
}

/* landing + login */
.landing { max-width: 1040px; margin: 0 auto; padding: 0 24px 48px; }
.landing-nav { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.landing-nav nav { display: flex; align-items: center; gap: 18px; }
.hero { padding: 56px 0 36px; }
.hero h1 { font-size: clamp(36px, 6vw, 60px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 700; }
.lead { font-size: 16px; color: var(--muted-foreground); max-width: 560px; margin-top: 18px; }
.install-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.card { border: 1px solid var(--border); border-radius: 16px; padding: 18px; background: var(--card); }
.card h2 { font-size: 15px; margin-bottom: 8px; }
.code { background: var(--muted); border-radius: 10px; padding: 10px 12px; overflow-x: auto; font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; }
.landing-foot { margin-top: 36px; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--chat-bg); }
.login-card { width: min(380px, 100%); display: flex; flex-direction: column; gap: 12px; padding: 24px; }
.login-card h1 { font-size: 20px; margin-top: 8px; }
.login-card label { display: flex; flex-direction: column; gap: 4px; font-weight: 500; }
.login-card input { height: 38px; }

/* streaming (M2) */
.working.on { display: flex; padding: 2px 0 0; }
.answer.streaming::after { content: ""; display: inline-block; width: 7px; height: 13px; margin-left: 2px; vertical-align: -2px; background: var(--muted-foreground); opacity: .6; animation: pulse 1s infinite; }
.thread-preview.running { display: flex; align-items: center; gap: 6px; }
.thread-preview.running .dots i { width: 4px; height: 4px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; background: var(--primary); color: var(--primary-foreground); padding: 8px 16px; border-radius: 999px; font-size: 12.5px; box-shadow: 0 8px 24px rgb(0 0 0 / .2); }

/* M3 generative UI: KPI tiles, bar charts, table headers, stop control */
.gen-card thead th { padding: 7px 14px 5px; text-align: left; font-weight: 500; font-size: 11.5px; color: var(--muted-foreground); border-top: 1px solid var(--border); }
.gen-card thead th.num { text-align: right; }
.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); border-top: 1px solid var(--border); }
.gen-metrics:not(:has(.gen-card-title)) .metrics { border-top: 0; }
.metric { padding: 10px 14px; border-right: 1px solid var(--border); }
.metric:last-child { border-right: 0; }
.metric-label { font-size: 11.5px; color: var(--muted-foreground); }
.metric-value { font-size: 18px; font-weight: 650; letter-spacing: -.01em; margin-top: 2px; }
.metric-hint { font-size: 11.5px; color: var(--muted-foreground); margin-top: 2px; }
.bars { padding: 6px 14px 12px; display: grid; gap: 6px; border-top: 1px solid var(--border); }
.bar-row { display: grid; grid-template-columns: minmax(80px, 34%) 1fr auto; align-items: center; gap: 10px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { width: 100%; height: 10px; display: block; }
.bar-track { fill: var(--muted); }
.bar-fill { fill: var(--foreground); opacity: .82; }
.bar-value { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.answer ul, .answer ol { margin: 4px 0 4px 18px; padding: 0; }
.answer li { margin: 2px 0; }
.answer code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--muted); padding: 1px 4px; border-radius: 4px; }
.working .stop { margin-left: 6px; border: 1px solid var(--border); }
.btn-xs { height: 22px; padding: 0 8px; font-size: 11.5px; border-radius: 999px; }
.stopped { display: flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 0 6px 8px; }

/* M4: approvals, activity trail */
.approval-why { color: var(--muted-foreground); font-size: 12px; margin-top: 6px; }
.approval-actions { flex-wrap: wrap; }
.approval-choice { color: var(--foreground); }
.approval-refused, .approval-failed { border-color: color-mix(in oklch, var(--bad) 35%, var(--border)); }
.filter-chips { margin-bottom: 10px; }
.filter-chips .chip { border: 0; cursor: pointer; color: var(--muted-foreground); background: transparent; }
.filter-chips .chip.active { background: var(--muted); color: var(--foreground); }
.timeline li.tl-bot::before { left: 9px; top: 24px; }
.tl-bot .tl-dot { width: 19px; height: 19px; margin-top: 0; display: grid; place-items: center; background: var(--muted); color: var(--muted-foreground); }
.tl-bot .tl-dot .icon { width: 12px; height: 12px; }
.tl-bot .tl-dot.tone-good { color: var(--good); } .tl-bot .tl-dot.tone-warn { color: var(--warn); } .tl-bot .tl-dot.tone-bad { color: var(--bad); }
.timeline li.tl-crm .tl-dot { margin-left: 6px; margin-right: 6px; }
.tl-detail { font-size: 12px; overflow-wrap: anywhere; }
.approvals-page { display: flex; flex-direction: column; gap: 12px; }
.approvals-page code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted-foreground); overflow-wrap: anywhere; }
.kv { list-style: none; margin: 0 0 8px; padding: 0; }
.kv li { display: grid; grid-template-columns: 150px 1fr; align-items: baseline; gap: 2px 10px; padding: 4px 0; }
.kv li > span:first-child { color: var(--muted-foreground); }
.kv li > span.small { grid-column: 2; }

/* line and donut charts (monochrome) */
.gen-line .gen-card-title, .gen-pie .gen-card-title { display: flex; justify-content: space-between; gap: 8px; }
svg.line { display: block; width: 100%; height: 120px; margin-top: 6px; overflow: visible; }
.line-base { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.line-area { fill: var(--foreground); fill-opacity: .06; }
.line-stroke { fill: none; stroke: var(--foreground); stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; }
.line-ticks { display: flex; justify-content: space-between; font-size: 11px; margin-top: 4px; }
.pie-wrap { display: flex; align-items: center; gap: 16px; margin-top: 6px; }
svg.pie { width: 120px; height: 120px; flex: none; }
svg.pie path { fill: var(--foreground); stroke: var(--card); stroke-width: .8; }
.pie-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 12.5px; min-width: 0; }
.pie-legend li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pie-legend i { width: 9px; height: 9px; border-radius: 3px; background: var(--foreground); flex: none; }
.pie-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Google SSO button on /login (web/views/google.templ) */
.btn-google { display: flex; align-items: center; justify-content: center; gap: 10px; height: 40px; border: 1px solid color-mix(in oklab, var(--muted-foreground, #71717a) 60%, transparent); background: var(--background, transparent); color: var(--foreground, inherit); font-weight: 600; text-decoration: none; }
.btn-google:hover { background: color-mix(in oklab, currentColor 6%, transparent); }
.login-or { text-align: center; margin: 4px 0; }

/* M5: Memory, Skills, Bots */
.memory-search input { width: 100%; margin-bottom: 10px; }
.filter-chips a.chip { text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.seg { display: inline-flex; gap: 2px; padding: 2px; border-radius: 999px; background: var(--muted); margin-bottom: 8px; }
.seg a { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; color: var(--muted-foreground); text-decoration: none; }
.seg a .icon { width: 14px; height: 14px; }
.seg a.active { background: var(--background); color: var(--foreground); box-shadow: 0 1px 2px rgb(0 0 0 / .06); }
.memory-add { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 12px; }
.memory-add textarea, .memory-edit textarea { width: 100%; border: 1px solid var(--input); border-radius: 8px; background: var(--background); padding: 7px 10px; resize: vertical; line-height: 1.45; }
.memory-add-row { display: flex; gap: 8px; justify-content: space-between; }
.memory-row { align-items: flex-start; }
.memory-row.off .memory-content { color: var(--muted-foreground); text-decoration: line-through; text-decoration-color: var(--border); }
.memory-content { line-height: 1.5; overflow-wrap: anywhere; }
.memory-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 2px; }
.memory-meta .icon { width: 13px; height: 13px; }
.memory-edit summary { cursor: pointer; list-style: none; width: fit-content; margin-top: 2px; }
.memory-edit summary::-webkit-details-marker { display: none; }
.memory-edit form { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; align-items: flex-start; }
.row-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.skill-group { display: flex; align-items: center; gap: 8px; }
.skill-group .icon { width: 15px; height: 15px; }
.skill-link { text-decoration: none; color: inherit; }
.skill-link:hover strong { text-decoration: underline; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.skill-who { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.skill-who .chip { display: inline-flex; align-items: center; gap: 5px; }
.skill-body { font-size: 13px; }
.skill-body h1, .skill-body h2, .skill-body h3 { font-size: 13.5px; margin: 12px 0 4px; }
.bot-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.bot-card { display: flex; gap: 10px; align-items: flex-start; text-decoration: none; color: inherit; height: 100%; }
.bot-card:hover { background: var(--muted); }
.bot-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.bot-head .row-main { flex: 1; }
.bot-rows { margin-top: 12px; }
.bot-page .panel h3 { margin: 0 0 6px; font-size: 13px; }
.composer-wrap { position: relative; }
.mention-menu { position: absolute; left: 12px; right: 12px; bottom: calc(100% - 18px); z-index: 20; list-style: none; margin: 0; padding: 4px; max-height: 260px; overflow: auto;
  background: var(--popover, var(--card)); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgb(0 0 0 / .12); }
.mention-menu li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 12.5px; white-space: nowrap; overflow: hidden; }
.mention-menu li span { overflow: hidden; text-overflow: ellipsis; }
.mention-menu li.selected, .mention-menu li:hover { background: var(--muted); }

/* Routines (M9) */
.vault-flags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.form-error { color: var(--warn); font-size: 13px; margin: 6px 0; }
.form-notice { color: var(--muted-foreground); font-size: 13px; margin: 6px 0; }
.card-panel { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin: 0 0 14px; }
.card-panel summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; }
.routine-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.routine-form label { display: flex; flex-direction: column; gap: 4px; }
.routine-form .wide { grid-column: 1 / -1; }
.routine-form input, .routine-form select, .routine-form textarea { font: inherit; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--background); color: var(--foreground); }
.routine-row.routine-off { opacity: .7; }
.routine-instruction { margin: 4px 0 0; }
.routine-runs { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.routine-runs li { display: flex; gap: 8px; align-items: baseline; }
.run-status { font-weight: 600; font-size: 11.5px; }
.run-failed, .run-waiting { color: var(--warn); }
.routine-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.msg-routine { flex-direction: column; align-items: flex-end; }
.routine-label { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 3px; }

/* Suggestion cards and follow-up chips (core/suggest, docs/ACTION_CATALOGUE.md). Follow-ups show under the
   last Bot message only; a needs-approval chip carries a lock and only fills the composer. */
.followups { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.msg-bot:has(~ .msg) .followups { display: none; }
.followup { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card); color: var(--chip-on-fg); font: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.08); }
.followup:hover { background: var(--chip-on); }
.followup .icon { width: 15px; height: 15px; }
.followup-approval { color: var(--foreground); }
.followup .followup-lock { width: 12px; height: 12px; color: var(--muted-foreground); }
.starters:empty { display: none; }
.starters { padding: 4px 0 8px; }
.starters-head { padding: 0 2px 6px; }
.starter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.starter-card { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; row-gap: 2px; text-align: left;
  padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); color: var(--foreground);
  font: inherit; cursor: pointer; box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.08); }
.starter-card:hover { border-color: var(--ring); }
.starter-card .starter-icon { grid-row: 1 / span 2; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--chip-on); color: var(--chip-on-fg); }
.starter-card .starter-icon .icon { width: 17px; height: 17px; }
.starter-card strong { font-size: 13.5px; font-weight: 600; }
.starter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
@media (max-width: 767px) { .starter-grid { grid-template-columns: 1fr 1fr; } .starter-card .muted { display: none; } }

/* Web parity (docs/WEB_PARITY.md): Needs-you badge, signed-out messenger with sign-in at the top of the
   left pane, shortcuts dialog. */
.needs-you { position: relative; text-decoration: none; }
.needs-you.has-needs { color: var(--accent); }
.needs-count { position: absolute; top: -2px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
[data-notify-toggle].active { color: var(--accent); }
.brand-avatar { background: var(--accent) !important; color: #fff !important; }
.signin-top { flex: none; display: flex; flex-direction: column; gap: 10px; padding: 14px; border-bottom: 1px solid var(--border); background: var(--sidebar); }
.signin-top .signin-title { margin: 0; display: flex; flex-direction: column; gap: 2px; }
.signin-top label { display: flex; flex-direction: column; gap: 4px; font-weight: 500; font-size: 13px; }
.signin-top input { height: 36px; }
.signin-top .btn-primary { gap: 6px; }
.signin-top .flash { margin: 0; }
.signedout-bots { list-style: none; margin: 0; padding: 0; }
.signedout-bots .thread { cursor: default; }
.shell-signed-out .workspace-label { padding: 10px 14px 2px; }
.composer-disabled { opacity: .7; }
.composer-disabled textarea { cursor: not-allowed; }
.shortcuts { border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; background: var(--background); color: var(--foreground); min-width: min(360px, 92vw); }
.shortcuts::backdrop { background: rgb(0 0 0 / .35); }
.shortcuts dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 8px 0 16px; font-size: 13px; }
.shortcuts dt { white-space: nowrap; }
.shortcuts dd { margin: 0; color: var(--muted-foreground); }
.shortcuts kbd { font: 600 11px/1 ui-monospace, monospace; padding: 2px 5px; border: 1px solid var(--border); border-radius: 4px; background: var(--muted); }
.icon-btn[hidden], .needs-count[hidden] { display: none; }

/* Tender documents panel */
.docs-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.docs-head h3 { margin: 0; }
.docs-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.docs-list { list-style: none; margin: 8px 0 0; padding: 0; }
.docs-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 8px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.docs-list li:last-child { border-bottom: 0; }
.docs-list a, .docs-list li > span:first-child { display: inline-flex; align-items: center; gap: 6px; color: var(--link); word-break: break-word; min-width: 0; }
.docs-list svg { flex: none; width: 16px; height: 16px; }
.docs-purpose { flex-basis: 100%; padding-left: 22px; }
.docs-fetching { display: flex; align-items: center; gap: 8px; }
.spinner { width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; display: inline-block; animation: tb-spin .8s linear infinite; flex: none; }
@keyframes tb-spin { to { transform: rotate(360deg); } }
@media (max-width: 760px) {
  .docs-actions { width: 100%; }
  .docs-actions .btn { flex: 1; justify-content: center; }
}

/* Bid writer panel (tender page) */
.bidwriter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 8px; }
.bidwriter-btn { justify-content: flex-start; gap: 8px; height: auto; min-height: 36px; padding: 8px 10px; text-align: left; white-space: normal; }
@media (max-width: 767px) { .bidwriter-grid { grid-template-columns: 1fr 1fr; } }

/* Wide desktop (1200px and up): three panes side by side (list, chat, details), no overlay. */
@media (min-width: 1200px) {
  .shell.right-open { grid-template-columns: minmax(0, var(--list-w)) minmax(0, 1fr) minmax(0, var(--right-w)); }
  .shell.right-open .drawer-backdrop { display: none; }
  .shell.right-open > .left { grid-column: 1; grid-row: 1; }
  .shell.right-open > .middle { grid-column: 2; grid-row: 1; }
  .shell.right-open .right { grid-column: 3; grid-row: 1; position: relative; inset: auto; width: auto; height: 100%; z-index: auto; box-shadow: none; transform: none; transition: none; }
}

/* Evidence library */
.evidence-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 8px; }
.evidence-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.evidence-list .small { flex-basis: 100%; }

/* Desktop app: Update button next to the version label (added by the app when a newer release exists). */
.list-foot .app-update { margin-left: 4px; vertical-align: baseline; }
