/* Buddy — DTC brand UI (owner, 2026-11-11): brand black, off-white, true white, dark sidebar; black is the accent.
   Status colours (green / amber / red) stay because they carry meaning. No decorative icons. */
@font-face { font-family: 'Inter'; src: url('fonts/inter.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Sora'; src: url('fonts/sora.woff2') format('woff2'); font-weight: 100 800; font-display: swap; }

:root {
  /* brand */
  --brand-black: #0A0A0A; --off-white: #F8F6F2; --true-white: #FFFFFF; --dark-section: #111111; --mid-gray: #6B6B6B;
  /* roles */
  --bg: var(--off-white); --bg-2: var(--dark-section); --surf: var(--true-white); --surf2: #EFEDE8; --surf-hover: #ECEAE5;
  --border: #E5E5E5; --border2: #232323; --text: var(--brand-black); --text2: #2E2E2E; --muted: var(--mid-gray);
  --accent: var(--brand-black); --accent2: #3A3A3A; --accent-hover: #262626; --accent-tint: rgba(10, 10, 10, 0.06);
  --green: #1F7A47; --green-tint: rgba(31, 122, 71, 0.10); --red: #B42318; --red-tint: rgba(180, 35, 24, 0.08);
  --gold: #8A5A12; --gold-tint: rgba(183, 121, 31, 0.12);
  /* dark sidebar */
  --side-text: #D9D9D9; --side-muted: #8C8C8C; --side-hover: #1C1C1C; --side-on: #262626;
  --shadow-sm: 0 1px 2px rgba(10, 10, 10, .05), 0 1px 3px rgba(10, 10, 10, .04);
  --shadow-md: 0 8px 28px rgba(10, 10, 10, .08);
  --ring: 0 0 0 3px rgba(10, 10, 10, 0.12);
  --sans: 'Inter', system-ui, sans-serif; --display: 'Sora', 'Inter', system-ui, sans-serif; --mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 14.5px/1.6 var(--sans); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--ring); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.015em; margin: 0; font-weight: 600; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surf); font-weight: 500; font-size: 14px; transition: background 150ms, border-color 150ms, box-shadow 150ms; white-space: nowrap; }
.btn:hover { background: var(--bg); border-color: #d6cfc3; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--text2); }
.btn.quiet:hover { background: var(--surf-hover); }
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.wide { width: 100%; height: 40px; margin-top: 18px; }
.btn.danger { color: var(--red); }
.btn:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 500; }
.link:hover { text-decoration: underline; }

/* form fields */
.field { display: block; margin-top: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 500; color: var(--text2); margin-bottom: 6px; }
.field input, .field select, .field textarea, input.plain, select.plain, textarea.plain {
  width: 100%; border: 1px solid var(--border); background: var(--surf); border-radius: 10px; padding: 9px 12px; outline: none; transition: border-color 150ms, box-shadow 150ms; }
.field input:focus, .field textarea:focus, .field select:focus, .plain:focus { border-color: var(--accent); box-shadow: var(--ring); }
.hint { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }
.note { margin-top: 14px; font-size: 13.5px; padding: 10px 12px; border-radius: 10px; }
.note.err { background: var(--red-tint); color: var(--red); }
.note.ok { background: var(--green-tint); color: var(--green); }
/* 2026-11-13 audit (C5): plain warnings on approval cards */
.note.warn { background: var(--gold-tint); color: var(--gold); margin: 6px 0 8px; font-weight: 500; white-space: normal; }

/* sign in */
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.auth-box { width: min(380px, 100%); }
.auth-brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600; font-size: 18px; margin-bottom: 36px; }
.auth-brand img { width: 30px; height: 30px; border-radius: 8px; box-shadow: 0 0 0 1px var(--border); }
.auth h1 { font-size: 26px; }
.auth p.muted { margin: 6px 0 4px; }
.auth-links { display: flex; justify-content: space-between; margin-top: 16px; font-size: 13.5px; }

/* shell + sidebar (2026-11-12 redesign): the sidebar is a floating dark panel on the off-white page, with its own
   layers (brand, white New chat button, nav, search, grouped chats, profile card) instead of one flat black block.
   Width is draggable (--side-w, remembered); Ctrl+B collapses it to an icon rail. */
.shell { --side-w: 272px; display: grid; grid-template-columns: var(--side-w) 1fr; height: 100%; background: var(--bg); }
.shell.collapsed { grid-template-columns: 64px 1fr; }
.shell.resizing { cursor: col-resize; user-select: none; }
.shell:not(.resizing) { transition: grid-template-columns 180ms ease; }
.side { position: relative; display: flex; flex-direction: column; min-height: 0; overflow-x: hidden; overflow-y: auto; color: var(--side-text); border-right: 1px solid #1F1F1F;
  background: radial-gradient(130% 55% at 0% 0%, #1E1E1E 0%, var(--dark-section) 60%), var(--dark-section);
  box-shadow: 1px 0 0 rgba(255, 255, 255, .03) inset; }
.side-top { padding: 14px 12px 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 2px 14px 4px; color: var(--true-white); }
.brand img { width: 30px; height: 30px; border-radius: 9px; flex: none; box-shadow: 0 0 0 1px rgba(255, 255, 255, .12); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text b { font-family: var(--display); font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.brand-text small { font-size: 11.5px; color: var(--side-muted); white-space: nowrap; }
.ico-btn { border: 0; background: none; width: 32px; height: 32px; border-radius: 9px; display: inline-grid; place-items: center; color: var(--muted); flex: none; }
.ico-btn:hover { background: var(--surf-hover); color: var(--text); }
.ico-btn svg, .nav-item svg, .cbtn svg, .menu svg, .new-chat svg, .search svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.side .ico-btn { color: var(--side-muted); }
.side .ico-btn:hover { background: rgba(255, 255, 255, .08); color: var(--true-white); }
.brand .collapse { margin-left: auto; }
.new-chat { width: 100%; height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border: 0; border-radius: 12px;
  background: var(--true-white); color: var(--brand-black); font-weight: 600; font-size: 13.5px; white-space: nowrap;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 4px 14px rgba(0, 0, 0, .35); transition: transform 120ms, background 150ms; }
.new-chat:hover { background: #EDEBE6; }
.new-chat:active { transform: translateY(1px); }
.new-chat svg { stroke-width: 2; }
.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 11px; border: 0; background: none; text-align: left; padding: 0 10px; border-radius: 10px;
  font-size: 13.5px; color: var(--side-text); white-space: nowrap; height: 36px; transition: background 120ms, color 120ms; }
.nav-item svg { flex: none; color: var(--side-muted); }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: var(--true-white); }
.nav-item.on { background: rgba(255, 255, 255, .10); color: var(--true-white); }
.nav-item:hover svg, .nav-item.on svg { color: var(--true-white); }
.search { display: flex; align-items: center; gap: 8px; height: 36px; margin: 10px 0 2px; padding: 0 10px; border-radius: 10px;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .07); color: var(--side-muted); transition: border-color 150ms, background 150ms; }
.search:focus-within { border-color: rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .08); }
.search svg { width: 16px; height: 16px; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: none; color: var(--true-white); font-size: 13px; }
.search input::placeholder { color: var(--side-muted); }
.search input:focus-visible { box-shadow: none; }
.convs { flex: 1 1 auto; overflow: auto; padding: 2px 8px 10px; min-height: 190px; mask-image: linear-gradient(transparent 0, #000 10px, #000 calc(100% - 14px), transparent); }
.conv-group { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; color: var(--side-muted); text-transform: uppercase;
  letter-spacing: .08em; padding: 16px 10px 6px; }
.conv-group .n { font-size: 10.5px; letter-spacing: 0; padding: 0 6px; border-radius: 99px; background: #C98A1E; color: var(--brand-black); line-height: 17px; }
.conv { position: relative; display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: none; height: 34px; padding: 0 6px 0 10px;
  border-radius: 10px; font-size: 13.5px; color: var(--side-text); transition: background 120ms, color 120ms; }
.conv .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv:hover { background: rgba(255, 255, 255, .06); color: var(--true-white); }
.conv.on { background: rgba(255, 255, 255, .11); color: var(--true-white); }
.conv.on::before { content: ""; position: absolute; left: -8px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--true-white); }
.conv .dot { flex: none; width: 7px; height: 7px; border-radius: 50%; }
.conv .tag { flex: none; font-size: 10.5px; font-weight: 600; padding: 1px 6px; border-radius: 6px; background: rgba(201, 138, 30, .18); color: #E7B45A; }
.conv .more { flex: none; width: 26px; height: 26px; padding: 0; border: 0; background: none; border-radius: 7px; display: grid; place-items: center; color: var(--side-muted); opacity: 0; }
.conv .more svg { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.conv:hover .more, .conv.on .more, .conv .more.open { opacity: 1; }
.conv .more:hover, .conv .more.open { background: rgba(255, 255, 255, .12); color: var(--true-white); }
.conv input.rename { flex: 1; min-width: 0; height: 26px; border: 1px solid rgba(255, 255, 255, .3); border-radius: 7px; background: #0A0A0A; color: #fff; padding: 0 8px; font-size: 13px; outline: none; }
.conv-empty { padding: 18px 12px; color: var(--side-muted); font-size: 12.5px; line-height: 1.5; }
.dot.run { background: var(--true-white); animation: pulse 1.2s ease-in-out infinite; }
.dot.wait { background: #E0A23A; box-shadow: 0 0 0 3px rgba(224, 162, 58, .2); }
@keyframes pulse { 50% { opacity: .35; } }
.side-bottom { padding: 8px; margin-top: auto; }
.me { display: flex; align-items: center; gap: 2px; padding: 6px; border-radius: 14px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .07); }
.me-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 2px 4px; border-radius: 10px; text-align: left; color: inherit; }
.me-main:hover .me-text span:first-child { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255, 255, 255, .35); }
.avatar { width: 32px; height: 32px; border-radius: 10px; background: var(--true-white); color: var(--brand-black); font-weight: 700; font-size: 12px;
  display: grid; place-items: center; flex: none; letter-spacing: .02em; }
.me-text { display: flex; flex-direction: column; min-width: 0; font-size: 13px; line-height: 1.3; }
.me-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-text span:first-child { font-weight: 600; color: var(--true-white); }
.me-text .muted { font-size: 11.5px; color: var(--side-muted); }
.side :focus-visible { box-shadow: 0 0 0 2px rgba(255, 255, 255, .4); }
.convs::-webkit-scrollbar { width: 8px; }
.convs::-webkit-scrollbar-thumb { background: #2A2A2A; border-radius: 8px; }
.resizer { position: absolute; top: 0; bottom: 0; right: 0; width: 8px; cursor: col-resize; z-index: 3; }
.resizer::after { content: ""; position: absolute; top: 0; bottom: 0; right: 2px; width: 2px; border-radius: 2px; background: transparent; transition: background 150ms; }
.resizer:hover::after, .resizing .resizer::after { background: rgba(255, 255, 255, .35); }
/* collapsed: an icon rail */
.collapsed .lbl, .collapsed .convs, .collapsed .resizer { display: none !important; }
.collapsed .side-top { padding: 14px 10px 4px; }
.collapsed .brand { flex-direction: column; gap: 12px; padding: 2px 0 14px; }
.collapsed .brand .collapse { margin: 0; }
.collapsed .brand .collapse svg { transform: scaleX(-1); }
.collapsed .new-chat { width: 44px; height: 44px; padding: 0; justify-content: center; margin: 0 auto; }
.collapsed .nav-item { justify-content: center; padding: 0; width: 44px; margin: 0 auto; }
.collapsed .me { justify-content: center; background: none; border-color: transparent; }
.collapsed .me-main { flex: none; padding: 0; }
.main { overflow: auto; min-height: 0; position: relative; }

/* conversation */
.chat { display: flex; flex-direction: column; min-height: 100%; }
.thread { width: min(780px, 100% - 48px); margin: 0 auto; padding: 32px 0 20px; flex: 1; }
.chat-title { font-family: var(--display); font-size: 15px; font-weight: 600; color: var(--text2); padding-bottom: 14px; margin-bottom: 8px; border-bottom: 1px solid var(--border); display: flex; gap: 10px; align-items: center; }
.chat-title .right { margin-left: auto; display: flex; gap: 6px; }
.msg-me { margin: 22px 0 6px auto; max-width: 85%; width: fit-content; background: var(--surf2); border-radius: 14px; padding: 10px 14px; white-space: pre-wrap; }
.msg-me .attached { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.from { font-size: 12px; color: var(--muted); text-align: right; margin-top: 18px; }
.activity { margin: 16px 0 6px; font-size: 13px; color: var(--muted); }
.activity summary { cursor: pointer; list-style: none; display: inline-flex; gap: 6px; align-items: center; }
.activity summary::-webkit-details-marker { display: none; }
.activity summary::after { content: "›"; transition: transform 150ms; display: inline-block; }
.activity[open] summary::after { transform: rotate(90deg); }
.working { display: inline-flex; align-items: center; gap: 8px; }
.working .dots span { display: inline-block; width: 5px; height: 5px; margin-right: 3px; border-radius: 50%; background: var(--accent2); animation: pulse 1.2s infinite; }
.working .dots span:nth-child(2) { animation-delay: .2s; } .working .dots span:nth-child(3) { animation-delay: .4s; }
.steps { margin: 10px 0 4px; border-left: 2px solid var(--border); padding-left: 14px; }
.step { padding: 5px 0; }
.step .label { color: var(--text2); }
.step .res { color: var(--muted); font-size: 12.5px; white-space: pre-wrap; word-break: break-word; }
.step.fail .label { color: var(--red); }
.step .state { font-size: 11.5px; color: var(--muted); margin-left: 6px; }
.plan { margin: 6px 0 10px; padding: 0; list-style: none; font-size: 13px; }
.plan li { padding: 1px 0; color: var(--text2); }
.plan li.done { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--border); }
.plan li.doing { color: var(--accent); }
.answer { margin: 10px 0 8px; line-height: 1.7; }
.answer p { margin: 0 0 10px; } .answer p:last-child { margin-bottom: 0; }
.answer ul, .answer ol { margin: 4px 0 10px; padding-left: 22px; }
.answer h4 { font-family: var(--display); font-size: 14.5px; margin: 14px 0 6px; }
.answer code { font: 13px var(--mono); background: var(--surf2); padding: 1px 5px; border-radius: 5px; }
.answer.bad { color: var(--red); }
.status-line { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.files { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.file { border: 1px solid var(--border); background: var(--surf); border-radius: 10px; padding: 7px 12px; font-size: 13px; text-align: left; transition: border-color 150ms; }
.file:hover { border-color: var(--accent); }
.file small { display: block; color: var(--muted); font-size: 11.5px; }
img.pic { max-width: 100%; max-height: 380px; border-radius: 10px; border: 1px solid var(--border); display: block; margin: 10px 0; background: var(--surf2); }
.tbl-wrap { overflow: auto; max-height: 320px; border: 1px solid var(--border); border-radius: 10px; margin: 8px 0; background: var(--surf); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 600; color: var(--text2); background: var(--bg); padding: 7px 10px; border-bottom: 1px solid var(--border); position: sticky; top: 0; }
.tbl td { padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
pre.out { white-space: pre-wrap; background: var(--surf2); border-radius: 10px; padding: 10px 12px; font: 12.5px/1.55 var(--mono); max-height: 300px; overflow: auto; margin: 8px 0; }
.ask-box { border: 1px solid var(--border2); background: var(--surf); border-radius: 14px; padding: 16px; margin: 14px 0; box-shadow: var(--shadow-sm); }
.ask-box h3 { font-size: 14.5px; margin-bottom: 4px; }
.ask-box p { margin: 0 0 10px; color: var(--text2); font-size: 13.5px; }
.ask-box .row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.ask-box .kv { display: grid; grid-template-columns: 70px 1fr; gap: 4px 10px; font-size: 13.5px; margin-bottom: 8px; }
.ask-box .kv span:nth-child(odd) { color: var(--muted); }
.ask-box .field { margin-top: 10px; }

/* composer (bottom), Claude-style: attachments as cards, + menu, connectors menu, round send arrow */
.composer-wrap { position: sticky; bottom: 0; background: linear-gradient(rgba(248, 246, 242, 0), var(--bg) 22px); padding: 14px 0 22px; z-index: 5; }
.composer { width: min(780px, 100% - 48px); margin: 0 auto; border: 1px solid var(--border); background: var(--surf); border-radius: 20px;
  box-shadow: var(--shadow-md); padding: 12px 12px 10px; position: relative; transition: border-color 150ms, box-shadow 150ms; }
.composer.drop { border-color: var(--accent); box-shadow: var(--ring); }
.composer:focus-within { border-color: #d6cfc3; box-shadow: var(--shadow-md), 0 0 0 1px #d6cfc3; }
.composer textarea:focus, .composer textarea:focus-visible { box-shadow: none; outline: none; }
.composer textarea { width: 100%; border: 0; outline: none; resize: none; min-height: 28px; max-height: 240px; padding: 4px 6px; background: transparent; line-height: 1.55; font-size: 15px; }
.composer .bar { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.composer .bar .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.cbtn { height: 32px; min-width: 32px; padding: 0 8px; border: 1px solid var(--border); background: var(--surf); border-radius: 10px; color: var(--text2);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; transition: background 150ms, border-color 150ms; }
.cbtn:hover, .cbtn.open { background: var(--bg); border-color: #d6cfc3; color: var(--text); }
.cbtn .count { font-size: 12px; color: var(--muted); }
.send { width: 34px; height: 34px; border-radius: 10px; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; transition: background 150ms, opacity 150ms; }
.send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.send:hover { background: var(--accent-hover); }
.send:disabled { background: #d9d2c6; cursor: default; }
.send.stop svg { fill: currentColor; stroke: none; }
.skill-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--accent); background: var(--accent-tint);
  border-radius: 8px; padding: 3px 6px 3px 9px; margin: 0 0 8px 2px; }
.skill-chip button { border: 0; background: none; color: inherit; padding: 0 2px; font-size: 14px; line-height: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.chips:empty { display: none; }
.fcard { position: relative; width: 168px; border: 1px solid var(--border); border-radius: 12px; padding: 9px 30px 9px 10px; background: var(--bg);
  display: flex; gap: 10px; align-items: center; }
.fcard .ext { width: 34px; height: 34px; border-radius: 8px; background: var(--surf2); color: var(--text2); font: 600 10px/34px var(--sans);
  text-align: center; text-transform: uppercase; flex: none; letter-spacing: .03em; }
.fcard .ext.xlsx, .fcard .ext.xls, .fcard .ext.csv { background: rgba(47, 122, 77, .12); color: var(--green); }
.fcard .ext.pdf { background: var(--red-tint); color: var(--red); }
.fcard .ext.docx, .fcard .ext.doc { background: rgba(60, 90, 150, .10); color: #3c5a96; }
.fcard .meta { min-width: 0; font-size: 12.5px; line-height: 1.3; }
.fcard .meta b { font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fcard .meta span { color: var(--muted); font-size: 11.5px; }
.fcard .x { position: absolute; top: 5px; right: 5px; width: 20px; height: 20px; border-radius: 6px; border: 0; background: none; color: var(--muted); font-size: 15px; line-height: 1; }
.fcard .x:hover { background: var(--surf-hover); color: var(--text); }
.fcard.busy { opacity: .7; }
.fcard.busy .meta span::after { content: ""; display: inline-block; width: 22px; height: 2px; margin-left: 6px; vertical-align: middle; background: var(--accent2); animation: pulse 1s infinite; }

/* popover menus (composer + / connectors) */
.menu { position: absolute; bottom: calc(100% + 8px); min-width: 260px; max-width: 340px; max-height: 360px; overflow: auto; background: var(--surf);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 12px 40px rgba(40, 32, 24, .14); padding: 6px; z-index: 20; }
.menu .mi { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 9px; font-size: 13.5px; color: var(--text); }
.menu .mi:hover { background: var(--bg); }
.menu .mi svg { color: var(--muted); }
.menu .mi .sub { margin-left: auto; color: var(--muted); font-size: 12px; }
.menu .mh { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 8px 10px 4px; }
.menu .sep { height: 1px; background: var(--border); margin: 5px 4px; }
.menu .mrow { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px; font-size: 13.5px; }
.menu .mrow:hover { background: var(--bg); }
.menu .mrow .grow { flex: 1; min-width: 0; }
.menu .mrow small { display: block; color: var(--muted); font-size: 11.5px; }
.menu .empty { color: var(--muted); font-size: 13px; padding: 8px 10px; }

/* Tools page: tabs, connector + skill cards (Claude-style) */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 22px 0 22px; }
.tabs button { border: 0; background: none; padding: 9px 12px; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar input { flex: 1; max-width: 340px; }
.toolbar .right { margin-left: auto; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.card { border: 1px solid var(--border); background: var(--surf); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px;
  transition: border-color 150ms, box-shadow 150ms; min-width: 0; }
.card:hover { border-color: #d6cfc3; box-shadow: var(--shadow-sm); }
.card.dim { background: var(--bg); }
.card .top { display: flex; gap: 12px; align-items: flex-start; }
.mono { width: 38px; height: 38px; border-radius: 10px; background: var(--surf2); color: var(--text2); font: 600 13px/38px var(--display); text-align: center; flex: none; }
.card .title { flex: 1; min-width: 0; }
.card .title b { font-weight: 600; font-size: 14.5px; display: block; }
.card .desc { color: var(--text2); font-size: 13px; line-height: 1.5; }
.card .foot { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.card .foot .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text2); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #c9c1b4; }
.pill.connected::before { background: var(--green); }
.pill.setup::before { background: #c98a1e; }
.pill.unavailable::before, .pill.not_allowed::before { background: #c9c1b4; }
.pill.off::before { background: #c9c1b4; }
.card .note { font-size: 12px; color: var(--muted); margin: 0; padding: 0; }
.sub-h { font-family: var(--display); font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 28px 0 10px; }
.sub-h:first-child { margin-top: 0; }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(26, 25, 23, .32); display: grid; place-items: center; z-index: 40; padding: 24px; animation: fade 120ms ease-out; }
.modal { width: min(620px, 100%); max-height: calc(100vh - 48px); overflow: auto; background: var(--surf); border-radius: 16px; box-shadow: 0 20px 60px rgba(40, 32, 24, .25); padding: 22px 24px; }
.modal h2 { font-size: 18px; margin-bottom: 4px; }
.modal .lead { color: var(--muted); margin: 0 0 6px; font-size: 13.5px; }
.modal .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
@keyframes fade { from { opacity: 0; } }

/* empty state */
.welcome { width: min(780px, 100% - 48px); margin: 0 auto; padding: 14vh 0 8px; }
.welcome h1 { font-size: 30px; margin-bottom: 6px; }
.welcome p { color: var(--muted); margin: 0 0 26px; }
.suggest { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.suggest button { text-align: left; border: 1px solid var(--border); background: var(--surf); border-radius: 12px; padding: 12px 14px; font-size: 13.5px; color: var(--text2); transition: border-color 150ms, color 150ms; }
.suggest button:hover { border-color: var(--accent); color: var(--text); }

/* pages */
.page { width: min(900px, 100% - 48px); margin: 0 auto; padding: 36px 0 60px; }
.page > h1 { font-size: 24px; }
.page > p.lead { color: var(--muted); margin: 6px 0 26px; }
.section { margin-top: 30px; }
.section h2 { font-size: 15.5px; margin-bottom: 4px; }
.section > p { color: var(--muted); margin: 0 0 12px; font-size: 13.5px; }
.rows { border: 1px solid var(--border); border-radius: 12px; background: var(--surf); }
.rows > div { display: flex; gap: 12px; align-items: center; padding: 11px 14px; border-top: 1px solid var(--border); }
.rows > div:first-child { border-top: 0; }
.rows .grow { flex: 1; min-width: 0; }
.rows .grow b { font-weight: 500; display: block; }
.rows .grow span { font-size: 12.5px; color: var(--muted); }
.rows .empty { color: var(--muted); font-size: 13.5px; }
.inline-form { display: flex; gap: 8px; margin-top: 10px; }
.inline-form input { flex: 1; }
details.more > summary { cursor: pointer; color: var(--accent); font-weight: 500; list-style: none; margin-top: 10px; font-size: 13.5px; }
.badge { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--surf2); color: var(--text2); }
.badge.warn { background: var(--gold-tint); color: var(--gold); }
.badge.off { background: var(--red-tint); color: var(--red); }
.switch { position: relative; width: 36px; height: 20px; display: inline-block; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #d9d2c6; border-radius: 99px; transition: 150ms; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: 150ms; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(16px); }
.switch input:disabled + span { opacity: .45; cursor: default; }
.code-big { font: 600 26px/1.2 var(--mono); letter-spacing: .16em; background: var(--surf2); border-radius: 10px; padding: 12px; text-align: center; margin: 8px 0; }

/* toasts */
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: var(--text); color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow-md); max-width: 360px; font-size: 13.5px; animation: up 150ms ease-out; }
.toast.err { background: var(--red); }
@keyframes up { from { transform: translateY(6px); opacity: 0; } }
@media (max-width: 900px) { .shell:not(.collapsed) { grid-template-columns: 220px 1fr; } .suggest { grid-template-columns: 1fr; } .cards { grid-template-columns: 1fr; } }

/* main area details */
h1, h2, h3 { letter-spacing: -0.02em; }
.link { color: var(--brand-black); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #BDBDBD; }
.link:hover { text-decoration-color: var(--brand-black); }
.btn { border-radius: 10px; }
.btn.primary { box-shadow: 0 1px 2px rgba(10, 10, 10, .2); }
.msg-me { background: var(--true-white); border: 1px solid var(--border); }
.composer { border-color: #E0E0E0; }
.composer:focus-within { border-color: #CFCFCF; box-shadow: var(--shadow-md), 0 0 0 1px #CFCFCF; }
.send:disabled { background: #D6D6D6; }
.suggest button:hover, .file:hover, .card:hover { border-color: #BDBDBD; }
.tabs button.on { border-bottom-color: var(--brand-black); }
.skill-chip { color: var(--brand-black); background: #EDEBE6; }
.pill.setup::before { background: #C98A1E; }
.mono { background: var(--brand-black); color: var(--true-white); }
.card.dim .mono { background: #E3E1DC; color: var(--mid-gray); }
.working .dots span { background: var(--brand-black); }

/* main column polish: sticky chat header, calmer suggestion cards */
.chat-title { position: sticky; top: 0; z-index: 4; background: rgba(248, 246, 242, .94); backdrop-filter: blur(8px);
  margin: -32px -12px 8px; padding: 18px 12px 14px; }
.welcome h1 { font-size: 34px; letter-spacing: -0.03em; }
.suggest button { box-shadow: var(--shadow-sm); transition: border-color 150ms, color 150ms, transform 150ms, box-shadow 150ms; }
.suggest button:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
/* result files: Open + Download */
.fresult { display: flex; align-items: center; gap: 12px; width: min(460px, 100%); padding: 10px 10px 10px 12px; border: 1px solid var(--border);
  border-radius: 14px; background: var(--true-white); box-shadow: var(--shadow-sm); }
.fresult .ext { width: 40px; height: 40px; border-radius: 10px; background: var(--surf2); color: var(--text2); font: 700 10.5px/40px var(--sans);
  text-align: center; text-transform: uppercase; flex: none; letter-spacing: .03em; }
.fresult .ext.xlsx, .fresult .ext.xls, .fresult .ext.csv { background: rgba(47, 122, 77, .12); color: var(--green); }
.fresult .ext.pdf { background: var(--red-tint); color: var(--red); }
.fresult .ext.zip { background: var(--brand-black); color: #fff; }
.fresult .meta { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.35; }
.fresult .meta b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fresult .meta span { font-size: 12px; color: var(--muted); }
.fresult .fstate.ok { color: var(--green); }
.fresult .fstate.busy::after { content: ""; display: inline-block; width: 26px; height: 2px; margin-left: 8px; vertical-align: middle; background: var(--brand-black); animation: pulse 1s infinite; }
.fresult .acts { display: flex; gap: 6px; flex: none; }
.fresult .btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.welcome + .composer-wrap { background: none; }  /* the fade is only for a scrolling thread */

/* chat menu (sidebar ⋯), shared with popovers */
.menu.conv-menu { position: fixed; bottom: auto; min-width: 200px; }
.menu .mi.danger { color: var(--red); }
.menu .mi.danger svg { color: var(--red); }

/* approval pop-up: slides in at the top right; stays until the person acts or dismisses it */
.ask-pop { position: fixed; top: 18px; right: 18px; width: min(400px, calc(100vw - 36px)); z-index: 60; background: var(--true-white);
  border-radius: 18px; border: 1px solid var(--border); box-shadow: 0 24px 60px rgba(10, 10, 10, .22), 0 2px 8px rgba(10, 10, 10, .08);
  overflow: hidden; animation: popin 260ms cubic-bezier(.2, .9, .3, 1.2); }
.ask-pop .bar { height: 4px; background: linear-gradient(90deg, var(--brand-black), #6B6B6B, var(--brand-black)); background-size: 200% 100%; animation: sweep 2.4s linear infinite; }
.ask-pop .in { padding: 16px 18px 16px; }
.ask-pop .kicker { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--mid-gray); }
.ask-pop .kicker .dot { width: 8px; height: 8px; border-radius: 50%; background: #E0A23A; box-shadow: 0 0 0 4px rgba(224, 162, 58, .2); animation: pulse 1.2s infinite; }
.ask-pop .kicker .x { margin-left: auto; border: 0; background: none; color: var(--mid-gray); font-size: 18px; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.ask-pop .kicker .x:hover { background: var(--surf2); color: var(--text); }
.ask-pop h3 { font-size: 16px; margin: 8px 0 2px; }
.ask-pop .chat { min-height: 0; display: block; font-size: 12.5px; color: var(--mid-gray); margin-bottom: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ask-pop .what { font-size: 13.5px; color: var(--text2); background: var(--off-white); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; max-height: 180px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.ask-pop .what .mono-line { font: 12.5px var(--mono); }
.ask-pop .row { display: flex; gap: 8px; margin-top: 14px; align-items: center; }
.ask-pop .row .grow { flex: 1; }
.ask-pop .more-n { font-size: 12px; color: var(--mid-gray); margin-top: 10px; }
.ask-pop kbd { font: 11px var(--mono); padding: 1px 5px; border-radius: 5px; border: 1px solid var(--border); background: var(--off-white); color: var(--mid-gray); }
.ask-box.done { border-color: var(--border); box-shadow: none; background: var(--off-white); }
.ask-box.done h3 { color: var(--green); }
.ask-box.flash { animation: flash 1.6s ease-out 1; }
@keyframes popin { from { transform: translateY(-12px) scale(.97); opacity: 0; } }
@keyframes sweep { to { background-position: -200% 0; } }
@keyframes flash { 0% { box-shadow: 0 0 0 0 rgba(10, 10, 10, .45); } 100% { box-shadow: 0 0 0 14px rgba(10, 10, 10, 0); } }

/* short windows (1366x768 laptops at 125-150% zoom): the chat list must still get room (2026-11-12: Rahman saw no
   chat history; the top of the sidebar ate the whole height) */
@media (max-height: 720px) {
  .side-top { padding: 10px 10px 2px; }
  .brand { padding-bottom: 8px; }
  .brand img { width: 26px; height: 26px; }
  .brand-text small { display: none; }
  .new-chat { height: 34px; }
  .nav { margin-top: 6px; gap: 0; }
  .nav-item { height: 30px; font-size: 13px; }
  .search { height: 32px; margin-top: 6px; }
  .conv-group { padding: 10px 10px 4px; }
  .conv { height: 30px; font-size: 13px; }
  .side-bottom { padding: 6px; }
  .me { padding: 4px; }
  .avatar { width: 28px; height: 28px; }
}
@media (max-height: 520px) { .convs { min-height: 150px; } }

/* Scheduled page (2026-11-12) */
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sec-head h2 { margin-bottom: 4px; }
.btn.small svg { width: 15px; height: 15px; margin-right: 4px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; vertical-align: -3px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.day-picks { display: flex; gap: 6px; flex-wrap: wrap; }
.day-pick input { position: absolute; opacity: 0; pointer-events: none; }
.day-pick span { display: inline-block; min-width: 46px; text-align: center; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; cursor: pointer; background: var(--surf); }
.day-pick input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.day-pick input:focus-visible + span { box-shadow: var(--ring); }
.small-note { font-size: 12.5px; margin: 8px 0 0; }

/* Chat background (owner, 2026-11-13: "too plain ... mild wooden background"): light oak with a soft grain, behind the
   chat only. Owner, same day: no lines. So: no plank lines; the grain tile is seamless (stitchTiles) so no tile
   edges. It stays still: the page itself never scrolls in a chat (layout below). */
.main.chat-bg {
  --wood: #F3EADB;
  background-color: var(--wood);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='640' height='640'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.0035 0.11' numOctaves='3' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.44 0 0 0 0 0.29 0 0 0 0 0.15 0 0 0 0.12 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}
.main.chat-bg .msg-me { box-shadow: var(--shadow-sm); }

/* Chat layout (2026-11-13, owner: "the page background should always be static, only the chat area and the sidebar
   contents should be scrollable", no side-scrolling, no ugly scrollbars). The page never scrolls: fixed title bar,
   the conversation scrolls in its own area (edges fade softly), fixed message box. */
.main { overflow-x: hidden; }
.main:has(> .chat-fixed) { overflow: hidden; }
.chat-fixed { height: 100%; min-height: 0; display: flex; flex-direction: column; }
.chat-head { flex: none; width: min(780px, 100% - 48px); margin: 0 auto; padding: 18px 0 6px; }
.chat-fixed .chat-title { position: static; margin: 0; padding: 0; border: 0; background: none; backdrop-filter: none; }
.chat-title .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-scroll { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; scrollbar-gutter: stable both-edges;
  -webkit-mask-image: linear-gradient(transparent 0, #000 18px, #000 calc(100% - 18px), transparent);
  mask-image: linear-gradient(transparent 0, #000 18px, #000 calc(100% - 18px), transparent); }
.chat-fixed .thread { padding-top: 14px; }
.chat-fixed .composer-wrap { position: static; flex: none; background: none; padding: 6px 0 22px; }

/* Slim scrollbars everywhere in the main area (thumb only, no arrows, no track); the sidebar keeps its dark one */
.main ::-webkit-scrollbar, .main::-webkit-scrollbar { width: 10px; height: 10px; }
.main ::-webkit-scrollbar-button, .main::-webkit-scrollbar-button { display: none; }
.main ::-webkit-scrollbar-track, .main::-webkit-scrollbar-track { background: transparent; }
.main ::-webkit-scrollbar-thumb, .main::-webkit-scrollbar-thumb { background: rgba(70, 50, 30, .16); border-radius: 10px;
  border: 3px solid transparent; background-clip: content-box; }
.main ::-webkit-scrollbar-thumb:hover, .main::-webkit-scrollbar-thumb:hover { background-color: rgba(70, 50, 30, .32); }
.main ::-webkit-scrollbar-corner, .main::-webkit-scrollbar-corner { background: transparent; }
