/* Procurement workspace — one visual language for conversations and logistics. */
:root, :root[data-theme="light"] {
  color-scheme:light;
  --bg:#f3f5f7; --panel:#fff; --panel-2:#f8fafb; --line:#dfe5e9; --line-2:#edf0f3;
  --text:#172b36; --muted:#617380; --faint:#72828d;
  --accent:#087f75; --accent-ink:#fff; --accent-soft:#e6f4f0; --soft:var(--accent-soft);
  --warn:#99600a; --warn-soft:#fff3d9; --danger:#ba404b; --danger-soft:#fff0f1;
  --ok:#187459; --ok-soft:#e7f5ee; --green:var(--ok); --red:var(--danger); --amber:var(--warn);
  --info:#426aaf; --info-soft:#edf2ff; --bubble-in:var(--panel); --bubble-out:#e3f2ed; --bubble-draft:#fff6e3;
  --radius:14px; --shadow:0 2px 5px #182e3c04; --space:24px;
  --font:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"PingFang SC","Microsoft YaHei",sans-serif;
}
:root[data-theme="dark"] {
  color-scheme:dark; --bg:#101b22; --panel:#182731; --panel-2:#1d2f3b; --line:#334753; --line-2:#293c47;
  --text:#e7eff2; --muted:#adbdc6; --faint:#98aab6; --accent:#68d5ba; --accent-ink:#102d25;
  --accent-soft:#203f39; --warn:#f1c16f; --warn-soft:#403521; --danger:#ff9aa5; --danger-soft:#442d35;
  --ok:#77d5af; --ok-soft:#203c32; --info:#a3beff; --info-soft:#29374c;
  --bubble-out:#24473e; --bubble-draft:#403521; --shadow:none;
}
* { box-sizing:border-box; }
body { margin:0; font:14px/1.55 var(--font); background:var(--bg); color:var(--text); -webkit-font-smoothing:antialiased; }
button,input,select,textarea { font:inherit; color:inherit; }
button,a { -webkit-tap-highlight-color:transparent; touch-action:manipulation; }
button { cursor:pointer; }
button:disabled { cursor:not-allowed; opacity:.5; }
a { color:var(--accent); }
:focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
[hidden] { display:none!important; }
.icon { width:20px; height:20px; flex:none; vertical-align:middle; }
.app { display:grid; grid-template-columns:248px minmax(0,1fr); height:100dvh; }
.rail { padding:28px 16px 20px; background:#142e39; border:0; color:#c4d4db; gap:6px; }
.brand { display:flex; gap:12px; align-items:center; padding:0 12px 30px; font-size:17px; letter-spacing:-.4px; color:#f2f8fa; }
.brand-mark { display:grid; place-items:center; width:38px; height:38px; border-radius:12px; background:#28b398; color:#10362f; }
.brand small { display:block; font-size:10px; letter-spacing:1.4px; color:#a1bac4; text-transform:uppercase; font-weight:500; margin-top:2px; }
.search-btn { display:flex; align-items:center; gap:10px; border:1px solid #38505b; background:#203b46; color:#c5d5dd; padding:10px 12px; border-radius:9px; min-height:42px; margin-bottom:14px; }
.search-btn .kbd { margin-left:auto; border-color:#4c626d; color:#c5d5dd; background:transparent; font-size:10px; }
.nav-label { padding:20px 14px 9px; text-transform:uppercase; letter-spacing:1.6px; font-size:10px; font-weight:600; color:#8faab6; }
.nav a { min-height:45px; padding:11px 14px; margin:3px 0; color:#c0d1d9; font-size:13px; border-radius:9px; }
.nav-name { display:flex; gap:12px; align-items:center; }
.nav a:hover { background:#213e4b; color:#fff; }
.nav a.active { background:#285349; color:#a4efd4; box-shadow:inset 3px 0 #62d7b5; }
.nav .badge { background:#b3e4d4; color:#183b32; }
.badge { height:22px; min-width:22px; border-radius:7px; font-size:11px; }
.rail-foot { border-top:1px solid #35505c; gap:14px; padding-top:20px; }
.status-line { padding:0 10px; font-size:11px; color:#bbced7; }
.kill { background:#203b46; color:#e9f3f5; border:1px solid #3e5864; padding:13px 11px; margin:0 3px; border-radius:11px; }
.kill .t { font-size:11px; } .kill .s { font-size:10px; color:#b6cad3; margin-top:4px; }
.kill.stopped { background:#482d35; border-color:#80525d; }
.kill.stopped .t { color:#ffc1c8; }
.rail-links { padding:0 9px; font-size:11px; }
.rail-links a { color:#b6cbd5; }
.workspace { display:flex; flex-direction:column; min-width:0; min-height:0; }
.topbar { min-height:76px; padding:16px clamp(24px,3vw,64px); background:var(--panel); border-bottom:1px solid var(--line); display:flex; align-items:center; gap:16px; }
.breadcrumb { display:flex; align-items:center; gap:13px; font-size:12px; color:var(--muted); }
.breadcrumb strong { font-weight:600; color:var(--text); }
.topbar .top-search { margin-left:auto; }
.topbar-date { font-size:12px; color:var(--muted); }
.avatar { width:34px; height:34px; border:1px solid var(--line); border-radius:50%; background:var(--accent-soft); color:var(--accent); display:grid; place-items:center; font-weight:650; font-size:12px; }
main { min-height:0; min-width:0; flex:1; overflow:auto; }
.page, .live-shell .main { width:100%; max-width:1760px; margin:0 auto; padding:38px clamp(24px,3vw,64px) 64px; }
:root[data-width="wide"] .page,:root[data-width="wide"] .live-shell .main { max-width:2600px; }
h1 { font-size:30px; letter-spacing:-1.1px; line-height:1.2; font-weight:650; margin:0; }
h2 { font-size:16px; line-height:1.4; text-transform:none; letter-spacing:-.25px; color:var(--text); font-weight:650; margin:0 0 18px; }
h3 { font-size:15px; letter-spacing:-.2px; }
.page-head,.live-shell .head { margin-bottom:30px; gap:20px; }
.page-head .sub,.live-shell .head p { font-size:13px; line-height:1.7; color:var(--muted); margin-top:9px; max-width:720px; }
.eyebrow { text-transform:uppercase; letter-spacing:1.8px; font-size:10px; color:var(--accent); font-weight:700; margin-bottom:10px; }
.btn,.live-shell button:not(.quiet):not(.link),.button-link { min-height:40px; padding:9px 15px; border:1px solid var(--line); background:var(--panel); color:var(--text); border-radius:9px; font-size:12px; font-weight:550; display:inline-flex; justify-content:center; align-items:center; gap:8px; }
.btn:hover,.live-shell button:hover { border-color:var(--accent); background:var(--panel-2); }
.btn.primary,.live-shell button.primary { background:var(--accent); color:var(--accent-ink); border-color:var(--accent); box-shadow:0 3px 5px #087f7510; }
.btn.danger { color:var(--danger); }
.btn.ghost { background:transparent; border-color:transparent; color:var(--muted); }
.btn.sm { min-height:32px; padding:5px 10px; font-size:11px; }
.card,.stat { border:1px solid var(--line); border-radius:var(--radius); background:var(--panel); box-shadow:var(--shadow); }
.card-pad,.live-shell .pad { padding:24px; }
input[type=text],input[type=number],input[type=password],input[type=datetime-local],input[type=date],select,textarea,.live-shell input { min-height:42px; padding:10px 12px; border:1px solid var(--line); background:var(--panel); color:var(--text); border-radius:9px; }
input:focus,textarea:focus,select:focus { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); outline:0; }
label.f,.live-shell .form label { font-size:12px; color:var(--muted); gap:8px; }
label.f>.hint { font-size:11px; font-weight:400; line-height:1.6; color:var(--muted); }
.pill { font-size:11px; padding:4px 9px; border-radius:6px; }
.stats,.live-shell .stats { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:14px; margin:0 0 30px; }
.stat { position:relative; padding:22px; text-align:left; color:var(--text); font:inherit; }
.stat .n,.live-shell .stat .number { font-size:32px; line-height:1.1; letter-spacing:-1px; font-weight:600; margin:0 0 14px; font-variant-numeric:tabular-nums; }
.stat .l { font-size:12px; color:var(--muted); max-width:175px; }
.stat.hot { border-top:1px solid var(--line); }
.stat.hot::after,.stat.bad::after { content:''; position:absolute; right:18px; top:22px; width:7px; height:7px; border-radius:50%; background:var(--warn); }
.stat.bad::after { background:var(--danger); }
.dashboard-grid { display:grid; grid-template-columns:minmax(0,1.8fr) minmax(290px,1fr); gap:28px; align-items:start; }
.dashboard-grid>*,.dashboard-side { min-width:0; }
.section { margin-bottom:28px; scroll-margin-top:24px; }
.section h2 { display:flex; align-items:center; gap:9px; }
.overview-note { display:flex; align-items:center; gap:16px; padding:21px 24px; margin-bottom:30px; background:var(--accent-soft); border:1px solid color-mix(in srgb,var(--accent) 15%,var(--line)); border-radius:12px; }
.overview-note>.icon { width:26px; height:26px; color:var(--accent); }
.overview-note strong { font-size:14px; }
.overview-note p { margin:3px 0 0; font-size:12px; color:var(--muted); }
.empty { background:var(--panel); border:1px solid var(--line); padding:28px; border-radius:var(--radius); color:var(--muted); }
.empty-state { display:flex; align-items:flex-start; gap:15px; text-align:left; min-height:120px; }
.empty-symbol { background:var(--accent-soft); color:var(--accent); width:42px; height:42px; display:grid; place-items:center; border-radius:12px; flex:none; }
.empty-state strong { display:block; color:var(--text); font-size:13px; font-weight:600; margin:1px 0 6px; }
.empty-state p { margin:0; font-size:12px; line-height:1.7; max-width:470px; }
.draft-card .head { padding:17px 22px; background:var(--panel); }
.draft-card .body { grid-template-columns:1fr; }
.ctx,.proposal { padding:20px 22px; gap:11px; }
.ctx { border:0; border-bottom:1px solid var(--line-2); }
.proposal .ru { font-size:14px; line-height:1.75; }
.proposal .cnline { padding:12px; }
.actions { padding:14px 22px; }
.list-item { padding:17px 20px; }
.card:has(>table.t) { overflow-x:auto; }
table.t th,.live-shell th { padding:14px 20px; background:var(--panel-2); color:var(--muted); font-size:10px; letter-spacing:.6px; text-transform:uppercase; white-space:nowrap; }
table.t td,.live-shell td { padding:18px 20px; font-size:13px; border-color:var(--line-2); }
table.t tr:hover td,.live-shell tbody tr:hover td { background:var(--panel-2); }
.chats { height:100%; grid-template-columns:320px minmax(0,1fr) 300px; }
.chats .conv { height:100%; min-height:0; }
.chat-list .search { padding:22px 16px 16px; }
.ci { padding:18px 16px; margin:4px 8px; border:0; border-radius:10px; }
.ci.active { box-shadow:inset 3px 0 var(--accent); }
.ci .prev { font-size:12px; }
.conv-head { padding:19px 24px; }
.msgs { padding:28px clamp(24px,4vw,100px); background:var(--bg); gap:12px; }
.bubble { max-width:min(680px,80%); padding:12px 16px; border-radius:14px; line-height:1.7; }
.composer { padding:20px 24px; }
.composer textarea { min-height:78px; }
.side { padding:24px 20px; }
.board { gap:16px; }
.col { flex-basis:285px; padding:14px; background:color-mix(in srgb,var(--line) 45%,var(--bg)); border:0; border-radius:12px; }
.col-head { padding:3px 3px 12px; color:var(--text); }
.deal-card { padding:18px; gap:11px; border-radius:10px; margin-bottom:12px; }
.supplier-directory { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,320px),1fr)); gap:20px; }
.supplier-card { padding:24px; display:flex; flex-direction:column; gap:20px; }
.supplier-card-head { display:flex; align-items:center; gap:14px; }
.supplier-avatar { width:46px; height:46px; border-radius:13px; background:var(--accent-soft); color:var(--accent); display:grid; place-items:center; font-size:18px; font-weight:650; flex:none; }
.supplier-meta { display:flex; align-items:center; gap:8px; font-size:12px; color:var(--muted); flex-wrap:wrap; }
.supplier-products { color:var(--muted); font-size:13px; min-height:40px; overflow-wrap:anywhere; }
.supplier-chat { padding:13px 0; border-top:1px solid var(--line-2); }
.supplier-card>.row { margin-top:auto; }
.settings-layout { display:grid; grid-template-columns:220px minmax(0,1fr); gap:32px; align-items:start; }
.settings-nav { position:sticky; top:24px; display:grid; gap:5px; }
.settings-nav a { padding:12px 16px; border-radius:8px; font-size:13px; color:var(--muted); }
.settings-nav a:hover { background:var(--accent-soft); color:var(--accent); }
.settings-content { max-width:1100px; min-width:0; }
.settings-section { scroll-margin:24px; margin-bottom:24px; padding:28px; }
.settings-section>p { color:var(--muted); font-size:13px; margin:0 0 24px; }
.setting-row { display:flex; align-items:center; justify-content:space-between; gap:28px; padding:20px 0; border-top:1px solid var(--line-2); }
.setting-row strong { font-size:13px; font-weight:600; }
.setting-row p { font-size:12px; color:var(--muted); margin:5px 0 0; max-width:500px; }
.setting-row select { width:210px; flex:none; }
.settings-value { color:var(--text); font-weight:600; font-size:13px; text-align:right; }
.mode-guide { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:18px 0; }
.mode-guide>div { background:var(--panel-2); border:1px solid var(--line); border-radius:10px; padding:18px; }
.mode-guide p { color:var(--muted); font-size:12px; line-height:1.7; }
.overlay,.palette { background:#0d243c66; backdrop-filter:blur(5px); }
.modal { border-radius:18px; box-shadow:0 24px 90px #071e3b33; }
.modal .card-pad { padding:28px; gap:20px; }
.palette .box { border-radius:16px; } .palette .it { min-height:44px; }
.skip-link { position:fixed; top:8px; left:8px; transform:translateY(-160%); z-index:100; background:var(--panel); padding:12px; }
.skip-link:focus { transform:translateY(0); }
.login { display:grid; grid-template-columns:1.1fr 1fr; padding:0; min-height:100dvh; background:var(--panel); }
.login-story { align-self:stretch; background:#142e39; color:#f1f8fa; padding:clamp(36px,6vw,110px); display:flex; flex-direction:column; justify-content:center; overflow:hidden; }
.login-story .brand { padding:0; margin-bottom:70px; }
.login-story h2 { font-size:clamp(32px,3vw,52px); letter-spacing:-2px; line-height:1.15; color:#f1f8fa; max-width:580px; font-weight:550; }
.login-story p { color:#b5cbd4; max-width:440px; font-size:15px; line-height:1.8; }
.login-flow { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-top:44px; }
.login-flow span { border:1px solid #41616c; border-radius:12px; padding:16px 18px; color:#b9e6d6; font-size:12px; }
.login .login-form { width:min(440px,100%); margin:auto; padding:40px; border:0; box-shadow:none; background:transparent; }
.login-form .eyebrow { margin-bottom:14px; }
.login-form h1 { font-size:30px; }
.login-form .btn { margin-top:12px; min-height:46px; }
.drop-zone { display:flex; flex-direction:column; align-items:center; gap:8px; text-align:center; padding:28px 18px; background:var(--panel-2); border:1.5px dashed var(--line); border-radius:12px; }
.drop-zone.over { border-color:var(--accent); background:var(--accent-soft); }
.drop-symbol { color:var(--accent); font-size:24px; }
.drop-zone small { color:var(--muted); }
.drop-zone input[type=file] { max-width:100%; font-size:11px; }
.drop-zone input::file-selector-button { background:var(--panel); color:var(--accent); border:1px solid var(--line); border-radius:7px; padding:8px 12px; cursor:pointer; }
/* Logistics uses the same surfaces, proportions and appearance preferences. */
.live-shell .layout { min-height:100dvh; display:block; }
.live-shell .rail,.live-shell .top { display:none; }
.live-shell .main { padding-top:38px; }
.live-shell .stats { grid-template-columns:repeat(4,minmax(0,1fr)); }
.live-shell .stat .number { margin:12px 0; }
.live-shell .tabs { display:flex; gap:8px; padding:5px; background:var(--line-2); border:1px solid var(--line); border-radius:11px; margin-bottom:26px; width:fit-content; max-width:100%; }
.live-shell .tabs button { background:transparent!important; min-height:36px; border:0!important; border-radius:7px!important; padding:8px 14px!important; box-shadow:none!important; color:var(--muted); white-space:nowrap; }
.live-shell .tabs button.active { background:var(--panel)!important; color:var(--accent); box-shadow:0 1px 4px #172b3610!important; }
.live-shell .tabs span { background:var(--line-2); color:var(--muted); }
.live-shell .action-card,.live-shell .notice { background:var(--accent-soft); border-color:var(--line); padding:24px; }
.live-shell .action-card p,.live-shell .notice p { color:var(--muted); }
.live-shell .action-card h2 { font-size:20px; }
.live-shell .grid { grid-template-columns:minmax(0,1fr) 320px; gap:24px; }
.live-shell .card,.live-shell .file,.live-shell .box,.live-shell .modal-head,.live-shell .modal-foot,.live-shell .batch-row,.live-shell .draft-table,.live-shell .reconcile { background:var(--panel); border-color:var(--line); }
.live-shell .modal { background:var(--bg); }
.live-shell .file-icon { background:var(--panel-2); color:var(--accent); }
.live-shell .pill.green { color:var(--ok); background:var(--ok-soft); }
.live-shell .pill.amber,.live-shell .warning { color:var(--warn); background:var(--warn-soft); }
.live-shell .pill.red,.live-shell .error-banner { color:var(--danger); background:var(--danger-soft); }
.live-shell .pill.gray { color:var(--muted); background:var(--line-2); }
.live-shell .quiet,.live-shell .link { color:var(--accent); background:transparent; }
.live-shell .progress { background:var(--line); }
.live-shell .route-track span { min-width:100px; }
.live-shell .files { grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); }
:root[data-density="compact"] { --space:16px; }
:root[data-density="compact"] .stat,:root[data-density="compact"] .card-pad,:root[data-density="compact"] .pad { padding:16px; }
:root[data-density="compact"] table.t td,:root[data-density="compact"] .live-shell td { padding-top:11px; padding-bottom:11px; }
:root[data-density="compact"] .ci { padding-top:12px; padding-bottom:12px; }
:root[data-density="compact"] .list-item { padding:12px 16px; }
@media(min-width:2000px) { .app { grid-template-columns:280px minmax(0,1fr); } .rail { padding:32px 24px; } .chats { grid-template-columns:380px minmax(0,1fr) 360px; } .msgs { padding-inline:max(40px,calc((100% - 1050px)/2)); } .col { flex-basis:320px; } }
@media(min-width:2400px) { .draft-card .body { grid-template-columns:minmax(0,1fr) minmax(0,1.3fr); } .ctx { border-right:1px solid var(--line-2); border-bottom:0; } }
@media(max-width:1350px) { .dashboard-grid { grid-template-columns:1fr; } .dashboard-side { display:grid; grid-template-columns:1fr 1fr; gap:24px; } .chats { grid-template-columns:290px minmax(0,1fr); } .side { display:none; } .chats.show-side .side { display:flex; position:fixed; top:76px; bottom:0; right:0; width:320px; z-index:30; box-shadow:-10px 0 40px #10232d20; } .stats { gap:10px; } .stat { padding:18px; } }
@media(max-width:1100px) { .app { grid-template-columns:216px minmax(0,1fr); } .rail { padding:24px 10px; } .brand { font-size:15px; } .page,.live-shell .main { padding:28px 24px 48px; } .stats { grid-template-columns:repeat(3,minmax(0,1fr)); } .settings-layout { grid-template-columns:1fr; gap:18px; } .settings-nav { position:static; display:flex; overflow:auto; white-space:nowrap; } .live-shell .grid { grid-template-columns:1fr; } }
@media(max-width:820px) {
 .app { grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr) auto; } .rail { display:none; }
 .topbar { min-height:58px; padding:10px 16px; gap:8px; } .breadcrumb>span,.topbar-date,.avatar,.search-label { display:none; }
 .page,.live-shell .main { padding:26px 16px 40px; } h1 { font-size:26px; } .page-head { margin-bottom:24px; }
 .mobile-bar { display:flex; position:relative; padding:8px 6px calc(8px + env(safe-area-inset-bottom)); gap:5px; background:var(--panel); }
 .mobile-bar a { display:flex; flex:none; flex-direction:column; align-items:center; gap:5px; position:relative; min-width:66px; padding:6px; font-size:10px; color:var(--muted); border-radius:8px; }
 .mobile-bar a.active { background:var(--accent-soft); color:var(--accent); }
 .mobile-bar .badge { position:absolute; right:1px; top:0; }
 .stats,.live-shell .stats { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; } .stat { padding:17px; } .stat .n { font-size:27px; margin-bottom:8px; }
 .stats .stat:last-child:nth-child(odd) { grid-column:1/-1; } .stat .l { max-width:none; }
 .dashboard-side { display:block; } .overview-note { padding:18px; align-items:flex-start; flex-wrap:wrap; } .overview-note>.spacer { display:none; }
 .overview-note .btn { margin-left:42px; } .ctx,.proposal,.draft-card .head,.actions { padding:16px; } .actions .btn { flex-grow:1; }
 .chats,.chats .conv,.chats .chat-list { height:100%; min-height:0; } .chats { grid-template-columns:minmax(0,1fr); }
 .chats.show-side .side { top:58px; bottom:78px; max-width:100%; }
 .msgs { padding:20px 16px; } .conv-head,.composer { padding:16px; } .bubble { max-width:90%; }
 .mode-guide { grid-template-columns:1fr; } .settings-section { padding:20px; } .setting-row { align-items:flex-start; flex-wrap:wrap; gap:14px; }
 .setting-row select { width:100%; } .settings-nav a { padding:10px; } .settings-value { text-align:left; }
 .login { grid-template-columns:1fr; } .login-story { padding:28px; } .login-story .brand { margin-bottom:28px; } .login-story h2 { font-size:30px; letter-spacing:-1px; margin-bottom:8px; }
 .login-story p,.login-flow { display:none; } .login .login-form { padding:32px 24px; margin:0 auto; }
 .live-shell .tabs { width:100%; } .live-shell .tabs button { padding:8px 10px!important; font-size:11px; }
 .live-shell .modal-foot { flex-wrap:wrap; } .live-shell .modal-foot button { flex-grow:1; }
 .topbar .btn { min-height:34px; padding:6px 9px; } .modal .card-pad { padding:22px; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { transition:none!important; scroll-behavior:auto!important; } }
@media print { .live-shell .modal { box-shadow:none; background:#fff; } }
.live-shell button.primary:not(.quiet):not(.link) { background:var(--accent); color:var(--accent-ink); border-color:var(--accent); }
.live-shell button.primary:not(.quiet):not(.link):hover { filter:brightness(1.08); }
.mobile-more { display:flex; flex:none; flex-direction:column; align-items:center; justify-content:center; gap:5px; min-width:60px; border:0; background:transparent; color:var(--muted); font-size:10px; border-radius:8px; }
.mobile-more.active { background:var(--accent-soft); color:var(--accent); }
.mobile-menu-links { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.mobile-menu-links a { display:flex; align-items:center; gap:12px; padding:15px 12px; border:1px solid var(--line); border-radius:9px; font-size:12px; color:var(--text); }
.mobile-menu-links a[aria-current] { background:var(--accent-soft); color:var(--accent); }
@media(max-width:820px) { .mobile-bar { justify-content:space-around; } .mobile-bar a { min-width:54px; } .dashboard-side .list-item { flex-wrap:wrap; } .dashboard-side .list-item>div { flex-basis:65%!important; } }
#sidebtn { display:none; }
@media(max-width:1350px) { #sidebtn { display:inline-flex; } }
@media(max-width:820px) {
 .page>.stats { grid-template-columns:none; grid-auto-flow:column; grid-auto-columns:148px; overflow-x:auto; padding-bottom:8px; margin-bottom:22px; scroll-snap-type:x proximity; }
 .page>.stats .stat { scroll-snap-align:start; }
 .page>.stats .stat:last-child:nth-child(odd) { grid-column:auto; }
 .overview-note { display:none; }
 .conv-head { gap:8px; padding:12px 16px; }
 .conv-head .spacer { flex-basis:100%; height:0; }
 .conv-head #sidebtn { margin-left:auto; }
}
.task-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,340px),1fr)); gap:18px; }
.task-card { padding:22px; display:flex; flex-direction:column; gap:16px; }
.task-overdue { border-top:3px solid var(--danger); padding-top:20px; }
.task-due { font-size:11px; color:var(--muted); }
.task-due.late { color:var(--danger); }
.task-instruction { font-size:14px; line-height:1.75; overflow-wrap:anywhere; }
.task-result { padding:14px; border-radius:9px; background:var(--accent-soft); color:var(--text); font-size:12px; }
.task-result strong { display:block; margin-bottom:6px; }
.task-card-actions { margin-top:auto; padding-top:16px; border-top:1px solid var(--line-2); display:flex; justify-content:space-between; align-items:center; gap:12px; }
.task-card-actions select { width:auto; max-width:70%; font-size:12px; }
a.deal-card { color:var(--text); }
.field-span2 { grid-column:span 2; }
.grid2>*,.grid3>* { min-width:0; }
.close-side { display:none; }
.live-shell .modal { border-color:var(--line); }
@media(max-width:1350px) { .close-side { display:inline-flex; align-self:flex-end; } }
@media(max-width:820px) { .field-span2 { grid-column:auto; } }

/* Deal workspace: scan first, edit a single record on demand. */
.deal-workspace { max-width:1600px; padding-top:24px; }
.deal-workspace [hidden] { display:none !important; }
.deal-back { display:inline-block; font-size:12px; color:var(--muted); margin-bottom:18px; }
.deal-heading { display:flex; align-items:center; justify-content:space-between; gap:24px; margin-bottom:24px; }
.deal-heading>div:first-child { min-width:0; }
.deal-heading h1 { font-size:25px; line-height:1.3; letter-spacing:-.7px; overflow-wrap:anywhere; }
.deal-supplier { font-size:12px; color:var(--accent); margin-bottom:7px; font-weight:600; }
.deal-supplier span { color:var(--muted); font-weight:400; }
.deal-summary { display:grid; grid-template-columns:1fr 1.5fr 1fr; border:1px solid var(--line); border-radius:12px; background:var(--panel); margin-bottom:16px; }
.deal-summary>div { padding:16px 22px; min-width:0; display:flex; flex-direction:column; align-items:flex-start; gap:5px; }
.deal-summary>div+div { border-left:1px solid var(--line); }
.deal-summary small { font-size:11px; color:var(--muted); }
.deal-summary strong { font-size:19px; font-weight:600; letter-spacing:-.3px; font-variant-numeric:tabular-nums; }
.deal-summary span { font-size:11px; color:var(--muted); }
.deal-summary select { padding:0 20px 0 0; min-height:28px; border:0; border-radius:3px; background-color:transparent; width:auto; max-width:100%; font-size:14px; font-weight:550; }
.deal-attention { border:1px solid color-mix(in srgb,var(--warn) 25%,var(--line)); background:var(--warn-soft); border-radius:9px; margin-bottom:12px; font-size:12px; }
.deal-attention>summary { padding:12px 16px; display:flex; align-items:center; gap:10px; cursor:pointer; list-style:none; }
.deal-attention-dot { width:6px; height:6px; background:var(--warn); border-radius:50%; flex:none; }
.deal-attention b { color:var(--warn); white-space:nowrap; font-weight:600; }
.deal-attention-preview { white-space:nowrap; text-overflow:ellipsis; overflow:hidden; color:var(--muted); }
.deal-attention-open { margin-left:auto; color:var(--warn); flex:none; }
.deal-attention>div { padding:0 18px 16px; }
.deal-attention ul { padding-left:18px; margin:0 0 12px; line-height:1.65; }
.deal-attention li+li { margin-top:7px; }
.deal-tabs { display:flex; gap:26px; border-bottom:1px solid var(--line); margin:8px 0 22px; }
.deal-tabs button { border:0; border-bottom:2px solid transparent; background:none; padding:14px 0 12px; color:var(--muted); font-size:13px; font-weight:550; cursor:pointer; }
.deal-tabs button[aria-selected=true] { border-bottom-color:var(--accent); color:var(--accent); }
.deal-tabs button:focus-visible,.deal-item-name:focus-visible,.deal-text-button:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.deal-columns { display:grid; grid-template-columns:minmax(0,1fr) 290px; align-items:start; gap:20px; }
.deal-columns>* { min-width:0; }
.deal-section-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:16px 18px; }
.deal-section-head h2 { font-size:14px; margin:0; display:flex; align-items:center; gap:8px; }
.deal-count { font-size:11px; font-weight:500; color:var(--muted); background:var(--panel-2); border:1px solid var(--line); padding:1px 6px; border-radius:5px; }
.deal-product-search { padding:0 18px 12px; }
.deal-product-search input { min-height:34px; font-size:12px; padding:7px 10px; background:var(--panel-2); }
.deal-products { overflow:hidden; }
.deal-items { width:100%; table-layout:auto; border-collapse:collapse; }
.deal-items th { color:var(--muted); background:var(--panel-2); border-block:1px solid var(--line-2); font-size:10px; font-weight:550; padding:9px 12px; text-align:left; white-space:nowrap; }
.deal-items td { border-bottom:1px solid var(--line-2); padding:12px; font-size:13px; vertical-align:middle; }
.deal-items th:first-child,.deal-items td:first-child { padding-left:18px; width:100%; }
.deal-items th:last-child,.deal-items td:last-child { padding-right:14px; padding-left:0; }
.deal-items tr:last-child td { border-bottom:0; }
.deal-items tbody tr:hover { background:var(--panel-2); }
.deal-items .numeric { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.deal-items td.numeric { min-width:75px; }
.deal-items small { display:block; font-size:10px; margin-top:3px; color:var(--muted); }
.deal-item-name { display:block; border:0; padding:0; background:none; text-align:left; font:inherit; color:var(--text); font-weight:550; line-height:1.4; cursor:pointer; }
.deal-item-name:hover { color:var(--accent); }
.deal-item-meta { display:flex; gap:7px; align-items:center; flex-wrap:wrap; color:var(--muted); font-size:10px; margin-top:4px; overflow-wrap:anywhere; }
.deal-variant { border:1px solid var(--line); border-radius:4px; padding:0 5px; color:var(--text); background:var(--panel-2); }
.deal-evidence { white-space:nowrap; font-size:10px; color:var(--muted); }
.deal-evidence::before { content:''; display:inline-block; width:5px; height:5px; border-radius:50%; background:var(--faint); margin-right:5px; vertical-align:middle; }
.deal-evidence.verified { color:var(--ok); }.deal-evidence.verified::before { background:var(--ok); }
.deal-evidence.uncertain,.deal-warning { color:var(--warn) !important; }.deal-evidence.uncertain::before { background:var(--warn); }
.deal-edit-icon { border:0; background:transparent; border-radius:6px; color:var(--muted); width:30px; height:32px; cursor:pointer; font-size:16px; }
.deal-edit-icon:hover { background:var(--accent-soft); color:var(--accent); }
.deal-text-button { border:0; padding:0; background:none; color:var(--accent); font-size:12px; cursor:pointer; white-space:nowrap; }
.deal-table-foot { font-size:11px; line-height:1.5; padding:12px 18px; border-top:1px solid var(--line-2); color:var(--muted); }
.deal-empty { margin:0; padding:18px; color:var(--muted); font-size:12px; line-height:1.6; }
.deal-empty span { font-size:11px; }
.deal-side { display:flex; flex-direction:column; gap:16px; }
.deal-facts { margin:0; padding:0 18px 16px; display:flex; flex-direction:column; gap:14px; }
.deal-facts dt { font-size:10px; color:var(--muted); margin-bottom:4px; }
.deal-facts dd { margin:0; font-size:12px; line-height:1.55; overflow-wrap:anywhere; }
.deal-disclosure { font-size:12px; line-height:1.6; }
.deal-disclosure>summary { cursor:pointer; color:var(--muted); }
.deal-side-card>.deal-disclosure { padding:12px 18px; border-top:1px solid var(--line-2); }
.deal-costs { margin:0; padding:0 18px 6px; list-style:none; }
.deal-costs li { border-top:1px solid var(--line-2); }
.deal-costs button { width:100%; text-align:left; display:flex; align-items:start; justify-content:space-between; gap:12px; background:none; padding:12px 0; border:0; cursor:pointer; font-size:12px; line-height:1.5; }
.deal-costs strong { font-size:12px; font-weight:550; white-space:nowrap; font-variant-numeric:tabular-nums; }
.deal-costs small { display:block; color:var(--muted); font-size:10px; }
.deal-side-note { font-size:11px; color:var(--muted); line-height:1.7; padding:0 4px; }
.deal-add-question { margin-top:16px; }
.deal-agent-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:20px; align-items:start; }
.deal-mandate { background:var(--panel); border:1px solid var(--line); border-radius:12px; overflow:hidden; }
.deal-mandate>summary { display:flex; justify-content:space-between; gap:12px; cursor:pointer; padding:18px; font-size:13px; font-weight:600; }
.deal-mandate>.card { border:0; box-shadow:none; border-top:1px solid var(--line); border-radius:0; }
.deal-mandate h2 { display:none; }
.deal-history-entry { border-top:1px solid var(--line-2); font-size:12px; }
.deal-history-entry>summary { display:flex; gap:12px; align-items:center; padding:14px 18px; cursor:pointer; list-style:none; }
.deal-history-entry>summary:hover { background:var(--panel-2); }
.deal-history-entry strong { display:block; font-weight:550; font-size:13px; }
.deal-history-entry small { display:block; color:var(--muted); font-size:11px; margin-top:4px; }
.deal-history-entry time { font-size:11px; color:var(--muted); margin-left:auto; white-space:nowrap; }
.deal-history-mark { width:26px; height:26px; border:1px solid var(--line); background:var(--panel-2); display:grid; place-items:center; border-radius:50%; font-size:10px; flex:none; color:var(--muted); }
.deal-history-diff { padding:0 18px 18px 56px; display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.deal-history-diff>div { padding:12px; background:var(--panel-2); border-radius:7px; overflow-wrap:anywhere; }
.deal-history-diff p { line-height:1.7; margin:6px 0 0; }
.deal-history-diff>p { grid-column:1/-1; }
.deal-source-list { margin-top:18px; padding:18px; font-size:13px; }
.deal-source-list summary { cursor:pointer; }
.deal-source { margin-top:14px; padding-top:14px; border-top:1px solid var(--line); font-size:12px; line-height:1.7; overflow-wrap:anywhere; }
.deal-editor { width:min(580px,100%); }
.deal-editor .card-pad { gap:16px; padding:24px; }
.deal-editor .grid2 { gap:16px; }
.deal-editor label.f { gap:5px; }
.deal-mobile-status { display:none; }
@media(max-width:1200px) {
 .deal-columns { grid-template-columns:minmax(0,1fr) 250px; gap:16px; }
 .deal-check-col { display:none; }
 .deal-mobile-status { display:block; margin-top:5px; }
}
@media(max-width:980px) {
 .deal-columns { grid-template-columns:minmax(0,1fr); }
 .deal-side { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
 .deal-side-note { grid-column:1/-1; }
 .deal-agent-grid { grid-template-columns:1fr; }
}
@media(max-width:620px) {
 .deal-workspace { padding:18px 14px 40px; }
 .deal-heading { align-items:flex-start; flex-wrap:wrap; gap:12px; margin-bottom:18px; }
 .deal-heading h1 { font-size:22px; }
 .deal-heading .row { gap:6px; }
 .deal-summary { grid-template-columns:1fr 1fr; }
 .deal-summary>div { padding:12px 14px; }
 .deal-summary>div:nth-child(2) { grid-column:1/-1; grid-row:2; border-left:0; border-top:1px solid var(--line); }
 .deal-summary>div:nth-child(3) { grid-column:2; grid-row:1; }
 .deal-summary strong { font-size:18px; }
 .deal-attention-preview { display:none; }
 .deal-tabs { gap:24px; margin-bottom:16px; }
 .deal-items td { padding:10px 8px; font-size:12px; }
 .deal-items th { padding:8px; font-size:9px; }
 .deal-items th:first-child,.deal-items td:first-child { padding-left:12px; }
 .deal-items th:last-child,.deal-items td:last-child { padding-right:6px; }
 .deal-items td.numeric { min-width:60px; }
 .deal-item-meta { font-size:9px; }
 .deal-side { display:flex; }
 .deal-history-entry time { font-size:10px; }
 .deal-history-entry>summary { gap:8px; padding:12px; }
 .deal-history-diff { padding:0 12px 12px; grid-template-columns:1fr; }
 .deal-history-mark { display:none; }
}

.deal-workspace .sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

.deal-board { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); overflow:visible; }
.deal-board>.col { width:auto; min-width:0; }
.deal-brief { margin-bottom:16px; }
.deal-brief .deal-section-head { padding-bottom:0; }
.deal-brief-body { padding:10px 18px 16px; font-size:13px; line-height:1.6; }
.deal-brief-body p { margin:0 0 8px; }
.deal-brief-body>div:not(.deal-brief-meta) { margin-top:4px; }
.deal-brief-meta { display:flex; flex-wrap:wrap; gap:6px 20px; font-size:11px; margin-top:10px; }
@media(max-width:1100px) { .deal-board { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:620px) { .deal-board { grid-template-columns:minmax(0,1fr); } }
