/* Tender assistant — design tokens, light and dark */
:root {
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #f6f6fa;
  --bg-grad: radial-gradient(1200px 500px at 10% -10%, #e9e7ff 0%, transparent 60%), radial-gradient(900px 400px at 100% 0%, #e3f3ff 0%, transparent 55%);
  --surface: #ffffff;
  --surface-2: #f9f9fc;
  --surface-3: #f1f1f7;
  --line: #e6e6ef;
  --line-strong: #d6d6e3;
  --text: #17172b;
  --text-2: #4b4b63;
  --muted: #7a7a92;
  --accent: #5b4fe0;
  --accent-2: #7c6ff7;
  --accent-soft: #eeecff;
  --accent-text: #4335c9;
  --green: #138a4f; --green-soft: #ddf6e8;
  --amber: #a85f00; --amber-soft: #fff1d6;
  --red: #cc2b3b; --red-soft: #ffe3e6;
  --blue: #1f6fd1; --blue-soft: #e1eeff;
  --grey-soft: #ececf3;
  --shadow-sm: 0 1px 2px rgba(23, 23, 43, .06);
  --shadow: 0 1px 2px rgba(23, 23, 43, .05), 0 6px 20px -8px rgba(23, 23, 43, .12);
  --shadow-lg: 0 20px 50px -12px rgba(23, 23, 43, .28);
  --radius: 14px;
  --radius-sm: 9px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0e0e16;
  --bg-grad: radial-gradient(1200px 500px at 10% -10%, #1d1a3d 0%, transparent 60%), radial-gradient(900px 400px at 100% 0%, #10243a 0%, transparent 55%);
  --surface: #171723;
  --surface-2: #1c1c2a;
  --surface-3: #242436;
  --line: #2a2a3d;
  --line-strong: #37374f;
  --text: #ececf6;
  --text-2: #b9b9cf;
  --muted: #8a8aa3;
  --accent: #8b80ff;
  --accent-2: #a69dff;
  --accent-soft: #26234a;
  --accent-text: #b8b1ff;
  --green: #45d18a; --green-soft: #12301f;
  --amber: #f5b74a; --amber-soft: #36280f;
  --red: #ff6b7a; --red-soft: #3b1820;
  --blue: #6cb0ff; --blue-soft: #132841;
  --grey-soft: #26263a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px -10px rgba(0, 0, 0, .6);
  --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text);
  background: var(--bg-grad), var(--bg); background-attachment: fixed;
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01";
  transition: background-color .25s, color .25s;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
.num { font-variant-numeric: tabular-nums; }
.grow { flex: 1; }
[hidden] { display: none !important; }
mark { background: var(--amber-soft); color: inherit; border-radius: 3px; padding: 0 1px; }
::selection { background: var(--accent-soft); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  padding: 10px 24px; background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; color: var(--text); font-size: 15px; }
.brand:hover { text-decoration: none; }
.logo {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--accent), #2fb5ff); box-shadow: 0 4px 12px -4px var(--accent);
}
.logo svg { width: 17px; height: 17px; }
.topbar .grow { flex: 1; }
.search {
  position: relative; flex: 0 1 420px; display: flex; align-items: center;
}
.search svg { position: absolute; left: 11px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; padding: 8px 44px 8px 34px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); font: inherit; outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--surface); }
.kbd {
  font: 600 11px/1 var(--font); color: var(--muted); border: 1px solid var(--line-strong); border-bottom-width: 2px;
  border-radius: 5px; padding: 3px 6px; background: var(--surface);
}
.search .kbd { position: absolute; right: 9px; }

select, .btn, .icon-btn { font: inherit; }
.select {
  appearance: none; padding: 7px 30px 7px 11px; border-radius: 10px; border: 1px solid var(--line); color: var(--text);
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a7a92' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  cursor: pointer; outline: none;
}
.select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 10px; border: 1px solid transparent;
  background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: transform .12s, box-shadow .15s, background .15s, opacity .15s; box-shadow: 0 4px 14px -6px var(--accent);
}
.btn:hover { background: var(--accent-2); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: var(--surface); color: var(--text-2); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn.ghost:hover { border-color: var(--line-strong); color: var(--text); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: progress; transform: none; }
.btn svg { width: 15px; height: 15px; }
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text-2); cursor: pointer; transition: all .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.icon-btn svg { width: 17px; height: 17px; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

main { max-width: 1440px; margin: 0 auto; padding: 22px 24px 60px; }

/* ---------- stats ---------- */
.hero { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.hero h1 { font-size: 26px; letter-spacing: -.025em; margin: 0; }
.hero p { margin: 4px 0 0; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
@media (max-width: 1000px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat {
  position: relative; text-align: left; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); cursor: pointer; overflow: hidden; color: var(--text); font: inherit;
  transition: transform .15s, box-shadow .2s, border-color .2s;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.stat .label { color: var(--muted); font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 28px; font-weight: 700; letter-spacing: -.03em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .hint { font-size: 12px; color: var(--muted); }
.stat .dot { width: 8px; height: 8px; border-radius: 50%; }
.stat .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; opacity: .9; }

/* ---------- filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--surface-3); border: 1px solid var(--line); }
.seg button {
  border: 0; background: transparent; color: var(--text-2); font: 500 13px var(--font); padding: 6px 11px; border-radius: 8px; cursor: pointer;
  display: inline-flex; gap: 6px; align-items: center; transition: background .15s, color .15s, box-shadow .15s;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg .c { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); cursor: pointer; user-select: none; font-size: 13px; }
.toggle input { display: none; }
.toggle .sw { width: 32px; height: 18px; border-radius: 10px; background: var(--line-strong); position: relative; transition: background .2s; }
.toggle .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: var(--shadow-sm); }
.toggle input:checked + .sw { background: var(--accent); }
.toggle input:checked + .sw::after { transform: translateX(14px); }
.filters .grow { flex: 1; }
.count { color: var(--muted); font-size: 13px; }

/* ---------- pills & badges ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill.fit { background: var(--green-soft); color: var(--green); }
.pill.partner { background: var(--amber-soft); color: var(--amber); }
.pill.dropped { background: var(--red-soft); color: var(--red); }
.pill.unknown { background: var(--grey-soft); color: var(--muted); }
.pill.cat { background: var(--blue-soft); color: var(--blue); }
.pill.cat::before { display: none; }
.due { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 9px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; background: var(--green-soft); color: var(--green); }
.due svg { width: 13px; height: 13px; }
.due.warn { background: var(--amber-soft); color: var(--amber); }
.due.hot { background: var(--red-soft); color: var(--red); }
.due.hot svg { animation: pulse 1.4s ease-in-out infinite; }
.due.closed, .due.none { background: var(--grey-soft); color: var(--muted); }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- cards ---------- */
.group-h { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px; color: var(--text-2); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.group-h:first-child { margin-top: 0; }
.group-h .line { flex: 1; height: 1px; background: var(--line); }
.group-h .c { color: var(--muted); font-weight: 500; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 12px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 13px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); color: var(--text);
  transition: transform .18s cubic-bezier(.2, .8, .2, 1), box-shadow .2s, border-color .2s; animation: rise .35s both;
}
.card:hover, .card.sel { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-strong); text-decoration: none; }
.card.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.card .top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.card .top .grow { flex: 1; }
.card h3 { margin: 0; font-size: 14.5px; line-height: 1.35; font-weight: 600; letter-spacing: -.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .id { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.card .note { font-size: 12.5px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 4px; }
.card .money { font-size: 12.5px; color: var(--text-2); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; text-align: right; }
.card .marks { display: flex; gap: 6px; color: var(--muted); font-size: 12px; }
.card .marks span { display: inline-flex; align-items: center; gap: 3px; }
.card .marks svg { width: 13px; height: 13px; }
.card.closed { opacity: .6; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* table view */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); cursor: pointer; white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { cursor: pointer; transition: background .12s; }
.tbl tbody tr:hover, .tbl tbody tr.sel { background: var(--surface-2); }
.tbl .t { font-weight: 600; }
.tbl .sub { color: var(--muted); font-size: 12px; }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; opacity: .5; }
.skeleton { height: 128px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- detail ---------- */
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.crumbs a { color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.crumbs svg { width: 14px; height: 14px; }
.bidhead {
  position: relative; padding: 20px 22px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  margin-bottom: 16px; overflow: hidden; animation: rise .35s both;
}
.bidhead::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--accent), #2fb5ff, #45d18a); }
.bidhead .row { display: flex; gap: 20px; align-items: flex-start; }
.bidhead .main { flex: 1; min-width: 0; }
.bidhead h1 { font-size: 21px; letter-spacing: -.02em; margin: 6px 0 4px; line-height: 1.3; }
.bidhead .chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.bidhead .status { color: var(--text-2); margin: 10px 0 0; font-size: 13.5px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-top: 14px; }
.fact { padding: 10px 12px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.fact .k { font-size: 11.5px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.fact .v { font-weight: 600; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 13.5px; }
.countdown { text-align: center; min-width: 150px; padding: 12px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.countdown .big { font-size: 30px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.countdown .small { font-size: 12px; color: var(--muted); }
.countdown.hot .big { color: var(--red); }
.countdown.warn .big { color: var(--amber); }
.countdown.ok .big { color: var(--green); }
.actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

.grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1050px) { .grid { grid-template-columns: 1fr; } .countdown { display: none; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; animation: rise .4s .05s both; }
.panel-h { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.panel-h h2 { margin: 0; font-size: 15px; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.panel-h h2 svg { width: 17px; height: 17px; color: var(--accent); }
.panel-h .grow { flex: 1; }
.panel-b { padding: 14px 16px; overflow-y: auto; }
.sticky-panel { position: sticky; top: 70px; max-height: calc(100vh - 86px); }
.meta { color: var(--muted); font-size: 12px; }

/* progress */
.progress { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: 12.5px; color: var(--text-2); }
.progress .track { flex: 1; height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.progress .fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #45d18a); border-radius: 4px; transition: width .35s cubic-bezier(.2, .8, .2, 1); }

/* checklist sections */
.sec { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; background: var(--surface); overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.sec[open] { box-shadow: var(--shadow-sm); }
.sec.done { border-color: color-mix(in srgb, var(--green) 40%, var(--line)); }
.sec.top3 { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: linear-gradient(180deg, var(--accent-soft), var(--surface) 60px); }
.sec > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; user-select: none; font-weight: 600; }
.sec > summary::-webkit-details-marker { display: none; }
.sec > summary .chev { width: 16px; height: 16px; color: var(--muted); transition: transform .2s; flex: none; }
.sec[open] > summary .chev { transform: rotate(90deg); }
.sec > summary .ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.sec > summary .ico svg { width: 15px; height: 15px; }
.sec > summary .t { flex: 1; }
.sec .chip { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-variant-numeric: tabular-nums; }
.sec.done .chip { background: var(--green-soft); color: var(--green); }
.sec .chip.na { background: var(--grey-soft); }
.sec .body { padding: 2px 14px 12px 14px; }
.sec .body ul, .sec .body ol { list-style: none; padding: 0; margin: 0; }
.sec .body li { display: flex; gap: 10px; padding: 7px 4px; border-radius: 8px; transition: background .15s; }
.sec .body li:hover { background: var(--surface-2); }
.sec .body li.ticked .txt { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.tick { appearance: none; flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 6px; border: 1.5px solid var(--line-strong); background: var(--surface); cursor: pointer; display: grid; place-items: center; transition: all .15s; }
.tick:checked { background: var(--green); border-color: var(--green); }
.tick:checked::after { content: ""; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.sec .body li .txt { flex: 1; min-width: 0; }
.sec .body p { margin: 4px 0; }

/* markdown */
.md { color: var(--text); }
.md p { margin: 6px 0; }
.md ul, .md ol { padding-left: 20px; margin: 6px 0; }
.md li { margin: 3px 0; }
.md h1, .md h2, .md h3 { font-size: 14px; margin: 14px 0 6px; }
.md code { background: var(--surface-3); padding: 1px 5px; border-radius: 5px; font-size: 12.5px; }
.md blockquote { margin: 8px 0; padding: 6px 12px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 8px 8px 0; color: var(--text-2); }
.md table { border-collapse: collapse; font-size: 13px; margin: 8px 0; }
.md td, .md th { border: 1px solid var(--line); padding: 4px 8px; }
.md strong { font-weight: 650; }
a.cite {
  display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; margin: 0 1px 0 2px; border-radius: 5px;
  font-size: 10.5px; font-weight: 700; line-height: 1; vertical-align: 2px; background: var(--accent-soft); color: var(--accent-text);
  text-decoration: none; cursor: pointer; transition: transform .12s, background .12s, color .12s;
}
a.cite:hover { background: var(--accent); color: #fff; transform: translateY(-1px); text-decoration: none; }
a.cite.ours { background: var(--amber-soft); color: var(--amber); }
.sources { margin-top: 10px; }
.sources summary { cursor: pointer; font-size: 12px; color: var(--muted); font-weight: 600; list-style: none; display: inline-flex; gap: 6px; align-items: center; }
.sources summary::-webkit-details-marker { display: none; }
.src-list { display: grid; gap: 6px; margin-top: 8px; }
.src { display: flex; gap: 9px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; color: var(--text); }
.src:hover { border-color: var(--accent); text-decoration: none; }
.src .n { flex: none; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-size: 11px; font-weight: 700; }
.src.ours .n { background: var(--amber-soft); color: var(--amber); }
.src .f { font-weight: 600; font-size: 12.5px; }
.src .q { font-size: 12px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* streaming status */
.live { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--line-strong); color: var(--text-2); font-size: 13px; margin-bottom: 10px; }
.live .orb { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: orb 1.6s infinite; flex: none; }
@keyframes orb { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.live .elapsed { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.thought { font-size: 12px; color: var(--muted); font-style: italic; margin: -4px 0 10px; padding: 0 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cursor::after { content: "▍"; color: var(--accent); animation: pulse 1s steps(2) infinite; margin-left: 1px; }

/* chat */
.chat-panel { height: calc(100vh - 86px); }
.chat { flex: 1; overflow-y: auto; padding: 16px; scroll-behavior: smooth; }
.msg { display: flex; gap: 10px; margin-bottom: 16px; animation: rise .3s both; }
.msg .av { flex: none; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.msg.bot .av { background: linear-gradient(135deg, var(--accent), #2fb5ff); color: #fff; }
.msg.bot .av svg { width: 15px; height: 15px; }
.msg.me { flex-direction: row-reverse; }
.msg.me .av { background: var(--surface-3); color: var(--text-2); }
.bubble { max-width: 88%; min-width: 0; }
.msg.me .bubble { background: var(--accent); color: #fff; padding: 9px 13px; border-radius: 14px 14px 4px 14px; white-space: pre-wrap; box-shadow: 0 6px 18px -10px var(--accent); }
.msg.bot .bubble { background: var(--surface-2); border: 1px solid var(--line); padding: 10px 14px; border-radius: 4px 14px 14px 14px; }
.bubble .foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--muted); font-size: 11.5px; }
.bubble .foot button { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 2px 4px; border-radius: 5px; font: inherit; display: inline-flex; gap: 4px; align-items: center; }
.bubble .foot button:hover { color: var(--text); background: var(--surface-3); }
.bubble .foot svg { width: 13px; height: 13px; }
.welcome { text-align: center; padding: 26px 16px 8px; color: var(--muted); }
.welcome .big { width: 48px; height: 48px; margin: 0 auto 10px; border-radius: 15px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), #2fb5ff); color: #fff; box-shadow: 0 10px 24px -10px var(--accent); }
.welcome .big svg { width: 24px; height: 24px; }
.welcome h3 { color: var(--text); margin: 0 0 4px; font-size: 15px; }
.suggest { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 16px 10px; }
.suggest button {
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 5px 11px; font: 500 12.5px var(--font);
  cursor: pointer; transition: all .15s;
}
.suggest button:hover { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.composer { margin: 0 12px 12px; display: flex; align-items: flex-end; gap: 8px; padding: 8px 8px 8px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); transition: border-color .15s, box-shadow .15s; }
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--surface); }
.composer textarea { flex: 1; border: 0; outline: none; resize: none; background: transparent; color: var(--text); font: inherit; max-height: 160px; min-height: 22px; padding: 6px 0; }
.composer .btn { padding: 8px 12px; }
.composer-hint { padding: 0 16px 10px; font-size: 11.5px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- drawer (PDF viewer) ---------- */
.scrim { position: fixed; inset: 0; background: rgba(10, 10, 20, .35); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 40; backdrop-filter: blur(2px); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 92vw); z-index: 50; display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg);
  transform: translateX(102%); transition: transform .32s cubic-bezier(.2, .8, .2, 1);
}
body.drawer-open .drawer { transform: none; }
body.drawer-open .scrim { opacity: 1; pointer-events: auto; }
.drawer-h { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.drawer-h .t { flex: 1; min-width: 0; }
.drawer-h .t b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-quote { padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--accent-soft); font-size: 12.5px; color: var(--text-2); max-height: 110px; overflow-y: auto; white-space: pre-wrap; }
.drawer-quote:empty { display: none; }
.drawer iframe { flex: 1; width: 100%; border: 0; background: #fff; }
.filelist { padding: 10px; overflow-y: auto; display: grid; gap: 6px; }
.filelist a { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); color: var(--text); background: var(--surface-2); }
.filelist a:hover { border-color: var(--accent); text-decoration: none; }
.filelist .ext { font-size: 10px; font-weight: 800; padding: 3px 6px; border-radius: 5px; background: var(--red-soft); color: var(--red); text-transform: uppercase; }
.filelist .ext.md, .filelist .ext.txt { background: var(--accent-soft); color: var(--accent-text); }
.filelist .ext.docx { background: var(--blue-soft); color: var(--blue); }
.filelist .ext.xlsx, .filelist .ext.csv { background: var(--green-soft); color: var(--green); }
.filelist .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- toast & help ---------- */
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 60; }
.toast { padding: 10px 16px; border-radius: 12px; background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); font-size: 13px; animation: rise .25s both; }
.toast.err { background: var(--red); color: #fff; }
.help { position: fixed; inset: 0; display: none; place-items: center; z-index: 70; background: rgba(10, 10, 20, .4); backdrop-filter: blur(3px); }
.help.on { display: grid; }
.help .box { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; width: 340px; box-shadow: var(--shadow-lg); animation: rise .2s both; }
.help h3 { margin: 0 0 10px; font-size: 15px; }
.help .row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--text-2); }
.help .row:last-child { border: 0; }
.warn-box { padding: 8px 12px; border-radius: 10px; background: var(--amber-soft); color: var(--amber); font-size: 12.5px; margin-bottom: 10px; }
.err-box { padding: 8px 12px; border-radius: 10px; background: var(--red-soft); color: var(--red); font-size: 13px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 700px) {
  .topbar { padding: 10px 14px; flex-wrap: wrap; }
  .search { order: 5; flex-basis: 100%; }
  main { padding: 16px 14px 40px; }
  .chat-panel { height: 80vh; }
  .sticky-panel { position: static; max-height: none; }
}
.sources summary svg { width: 13px; height: 13px; }
.sources summary:hover { color: var(--text); }

/* README summary card */
.readme { margin-bottom: 16px; }
.readme .panel-h h2 .meta { font-weight: 500; margin-left: 4px; }
.readme .panel-b { position: relative; padding: 16px 22px 18px; transition: max-height .35s cubic-bezier(.2, .8, .2, 1); }
.readme.long:not(.open) .panel-b { max-height: 280px; overflow: hidden; }
.readme.long:not(.open) .panel-b::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 90px; pointer-events: none;
  background: linear-gradient(180deg, transparent, var(--surface));
}
.readme.long:not(.open) .panel-b { cursor: pointer; }
.md.doc { font-size: 14px; line-height: 1.65; }
.md.doc > p, .md.doc > ul, .md.doc > ol { max-width: 980px; }
.md.doc h2 { column-span: all; font-size: 15px; margin: 18px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); color: var(--text); letter-spacing: -.01em; }
.md.doc h2:first-child { margin-top: 0; }
.md.doc h3 { font-size: 14px; margin: 14px 0 6px; color: var(--accent-text); }
.md.doc p { margin: 6px 0; }
.md.doc > p:first-child, .md.doc blockquote { column-span: all; }
.md.doc ul, .md.doc ol { padding-left: 20px; }
.md.doc li::marker { color: var(--accent); }
.md.doc blockquote { border-left-color: var(--green); background: var(--green-soft); color: var(--text); }
.md.doc blockquote p { margin: 0; }
.md.doc a { font-weight: 500; }
.md.doc a[data-doc]::before { content: "📄 "; font-size: 12px; }
.md.doc code { word-break: break-all; }
.tbl-wrap { column-span: all; overflow-x: auto; margin: 10px 0; border: 1px solid var(--line); border-radius: 12px; }
.md.doc table { width: 100%; margin: 0; border-collapse: collapse; font-size: 13px; }
.md.doc th { background: var(--surface-2); text-align: left; font-weight: 600; color: var(--text-2); }
.md.doc th, .md.doc td { border: 0; border-bottom: 1px solid var(--line); padding: 7px 10px; vertical-align: top; }
.md.doc tr:last-child td { border-bottom: 0; }
.md.doc tbody tr:hover td { background: var(--surface-2); }

/* ---------- Scout (search bot) ---------- */
.scout-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.scout-svg .s-eyes { transform-origin: 29px 30px; animation: blink 5s infinite; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
.scout-face { display: inline-block; flex: none; }
.scout-face.xs { width: 26px; height: 26px; }
.scout-face.lg { width: 44px; height: 44px; }
#scout-face-sm { width: 34px; height: 34px; }
.scout-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 45; width: 64px; height: 64px; border-radius: 22px; border: 0; cursor: pointer;
  display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), #2fb5ff);
  box-shadow: 0 14px 30px -10px var(--accent), 0 2px 6px rgba(0, 0, 0, .15); transition: transform .2s cubic-bezier(.2, .8, .2, 1);
  animation: bob 3.2s ease-in-out infinite;
}
.scout-fab:hover { transform: translateY(-3px) rotate(-4deg) scale(1.04); animation-play-state: paused; }
@keyframes bob { 50% { transform: translateY(-5px); } }
.scout-tip {
  position: absolute; right: 74px; bottom: 14px; white-space: nowrap; background: var(--surface); color: var(--text); border: 1px solid var(--line);
  padding: 8px 12px; border-radius: 12px 12px 4px 12px; font: 600 13px var(--font); box-shadow: var(--shadow); opacity: 0; transform: translateX(8px);
  transition: opacity .3s, transform .3s; pointer-events: none;
}
.scout-tip.on { opacity: 1; transform: none; }
body.scout-open .scout-fab { transform: scale(.9); animation: none; }
.scout {
  position: fixed; right: 22px; bottom: 98px; z-index: 46; width: min(400px, calc(100vw - 32px)); height: min(600px, calc(100vh - 130px));
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(16px) scale(.97); transform-origin: bottom right; pointer-events: none;
  transition: opacity .22s, transform .28s cubic-bezier(.2, .8, .2, 1); overflow: hidden;
}
body.scout-open .scout { opacity: 1; transform: none; pointer-events: auto; }
.scout-h { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, var(--accent-soft), transparent); }
.scout-h b { display: block; font-size: 14.5px; }
.scout-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }
.s-msg { display: flex; gap: 8px; align-items: flex-start; animation: rise .25s both; }
.s-msg.me { justify-content: flex-end; }
.s-msg .s-b { max-width: 88%; padding: 9px 12px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; }
.s-msg.bot .s-b { background: var(--surface-2); border: 1px solid var(--line); border-top-left-radius: 4px; }
.s-msg.me .s-b { background: var(--accent); color: #fff; border-top-right-radius: 4px; }
.s-chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 7px 0; }
.chip { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); white-space: nowrap; }
.s-top { display: grid; gap: 5px; margin-top: 6px; }
.s-top a { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-size: 12.5px; line-height: 1.3; }
.s-top a:hover { border-color: var(--accent); text-decoration: none; }
.s-top .due { padding: 2px 7px; font-size: 11px; }
.s-ask { margin-top: 8px; }
.s-b .md { font-size: 13.5px; }
.s-b .md ul { padding-left: 18px; }
a.bidref { font-weight: 600; background: var(--accent-soft); padding: 0 5px; border-radius: 5px; white-space: nowrap; }
.scout-sugg { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.scout-sugg button { border: 1px solid var(--line); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 4px 10px; font: 500 12px var(--font); cursor: pointer; transition: all .15s; }
.scout-sugg button:hover { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.scout-in { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.scout-in input { flex: 1; border: 1px solid var(--line); border-radius: 11px; padding: 9px 12px; background: var(--surface-2); color: var(--text); font: inherit; outline: none; }
.scout-in input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--surface); }
.scout.thinking #scout-face-sm .s-glass, .scout.thinking .s-msg:last-child .s-glass { animation: sweep 1s ease-in-out infinite; transform-origin: 49px 46px; }
@keyframes sweep { 0%, 100% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(-5px, -3px) rotate(-12deg); } 75% { transform: translate(3px, -5px) rotate(10deg); } }
.botbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 14px; margin-bottom: 14px; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-soft), var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); animation: rise .3s both;
}
body.bot-on #cat, body.bot-on #fit { opacity: .45; }
/* ---------- clusters ---------- */
:root { --cl-s: 85%; --cl-l: 94%; --cl-ts: 55%; --cl-tl: 32%; }
:root[data-theme="dark"] { --cl-s: 35%; --cl-l: 20%; --cl-ts: 75%; --cl-tl: 75%; }
.pill.clu { background: hsl(var(--h) var(--cl-s) var(--cl-l)); color: hsl(var(--h) var(--cl-ts) var(--cl-tl)); max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.pill.clu::before { display: none; }
.cl-wrap { position: relative; }
.cl-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 6px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface-3); color: var(--text-2); font: 500 13px var(--font); cursor: pointer; transition: all .15s; max-width: 280px;
}
.cl-btn:hover { color: var(--text); border-color: var(--line-strong); }
.cl-btn.on { background: var(--accent-soft); color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.cl-btn svg { width: 13px; height: 13px; }
.cl-btn .x { margin-left: 2px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; line-height: 1; }
.cl-btn .x:hover { background: var(--accent); color: #fff; }
.cl-dots { display: inline-flex; }
.cl-dots i { font-style: normal; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font-size: 13px; background: hsl(var(--h) var(--cl-s) var(--cl-l)); border: 2px solid var(--surface-3); margin-left: -8px; }
.cl-dots i:first-child { margin-left: 0; }
.cl-pop {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 35; width: min(720px, calc(100vw - 40px)); background: var(--surface);
  border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(-6px) scale(.98);
  transform-origin: top left; transition: opacity .16s, transform .2s cubic-bezier(.2, .8, .2, 1); display: flex; flex-direction: column; max-height: min(560px, 70vh);
}
.cl-pop.in { opacity: 1; transform: none; }
.cl-pop-h { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.cl-search { position: relative; flex: 1; display: flex; align-items: center; }
.cl-search svg { position: absolute; left: 10px; width: 15px; height: 15px; color: var(--muted); }
.cl-search input { width: 100%; padding: 8px 10px 8px 32px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; outline: none; }
.cl-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.cl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 8px; padding: 12px 14px; overflow-y: auto; }
.cl-card {
  position: relative; display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 10px 11px; border-radius: 13px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; transition: transform .12s, border-color .15s, background .15s, box-shadow .15s;
}
.cl-card:hover { transform: translateY(-2px); border-color: hsl(var(--h) 60% 60%); box-shadow: var(--shadow-sm); }
.cl-card.on { background: hsl(var(--h) var(--cl-s) var(--cl-l)); border-color: hsl(var(--h) 60% 55%); box-shadow: 0 0 0 2px hsl(var(--h) 60% 60% / .35); }
.cl-ico { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; background: hsl(var(--h) var(--cl-s) var(--cl-l)); }
.cl-card.on .cl-ico { background: var(--surface); }
.cl-txt { flex: 1; min-width: 0; }
.cl-txt b { display: block; font-size: 13px; line-height: 1.3; font-weight: 600; }
.cl-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 3px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cl-meta .hot { color: var(--red); font-weight: 600; }
.cl-check { position: absolute; top: 8px; right: 8px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: hsl(var(--h) 60% 45%); color: #fff; opacity: 0; transform: scale(.6); transition: all .15s; }
.cl-check svg { width: 11px; height: 11px; stroke-width: 3; }
.cl-card.on .cl-check { opacity: 1; transform: none; }
.cl-pop-f { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
body.bot-on .cl-btn { opacity: .45; }
/* collapsible group headers */
button.group-h { width: 100%; border: 0; background: transparent; font: inherit; cursor: pointer; padding: 0; text-align: left; }
button.group-h .chev { width: 15px; height: 15px; transition: transform .2s; transform: rotate(90deg); flex: none; }
button.group-h.shut .chev { transform: none; }
button.group-h:hover { color: var(--text); }
.group-h.cl { text-transform: none; letter-spacing: -.01em; font-size: 15px; color: var(--text); gap: 10px; }
.group-h.cl .cl-ico { width: 30px; height: 30px; font-size: 16px; }
.group-h .due { text-transform: none; letter-spacing: 0; }

/* ---------- calmer cards ---------- */
.fitdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--muted); box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 0%, transparent); }
.fitdot.fit { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.fitdot.partner { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.fitdot.dropped { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.fitdot.unknown { background: var(--line-strong); box-shadow: 0 0 0 3px var(--grey-soft); }
.seg .fitdot { width: 7px; height: 7px; box-shadow: none; }
.cl-mini { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-size: 12px; background: hsl(var(--h) var(--cl-s) var(--cl-l)); }
.cat-mini { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.card .top { gap: 8px; min-height: 22px; }
.card .org { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: -6px; }
.card h3 { font-size: 14.5px; }
.card .foot { align-items: flex-end; }
.card .money { flex: none; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; text-align: right; }
.card .money b { font-size: 14px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.card .money small { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.card .money i { font-size: 11.5px; color: var(--muted); font-style: normal; }
/* compact density: one line per bid */
.cards.compact { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 8px; }
.card.compact { flex-direction: row; align-items: center; gap: 12px; padding: 9px 12px; }
.card.compact .top { min-height: 0; flex: none; }
.card.compact .top .grow, .card.compact .marks { display: none; }
.card.compact h3 { flex: 1; -webkit-line-clamp: 1; font-size: 13.5px; font-weight: 600; }
.card.compact .foot { padding: 0; margin: 0; flex: none; gap: 10px; align-items: center; }
.card.compact .foot .grow { display: none; }
.card.compact .money { min-width: 64px; }
.card.compact:hover { transform: translateY(-1px); }
/* table money columns */
.tbl th.r, .tbl td.r { text-align: right; white-space: nowrap; }
.tbl .est { margin-left: 5px; font-size: 10.5px; font-weight: 600; color: var(--amber); background: var(--amber-soft); padding: 1px 5px; border-radius: 5px; }
.soon-dot { font-size: 12px; font-weight: 600; color: var(--red); text-transform: none; letter-spacing: 0; display: inline-flex; align-items: center; gap: 5px; }
.soon-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
/* value & EMD popover */
.money-pop { width: min(640px, calc(100vw - 40px)); }
.mo-body { padding: 14px; display: grid; gap: 14px; }
.mo-row { display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: start; }
.mo-k { font-weight: 700; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding-top: 7px; }
.mo-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mo-chips button { border: 1px solid var(--line); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 6px 12px; font: 500 13px var(--font); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; transition: all .15s; }
.mo-chips button:hover { border-color: var(--accent); color: var(--accent-text); }
.mo-chips button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.mo-chips .c { font-size: 11px; opacity: .7; font-variant-numeric: tabular-nums; }
.money-btn { padding-left: 12px; }

/* ---------- one-row filter toolbar ---------- */
.filters { flex-wrap: nowrap; }
@media (max-width: 1100px) { .filters { flex-wrap: wrap; } }
.fl-wrap { position: relative; }
.fl-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text-2); font: 600 13px var(--font); cursor: pointer; transition: all .15s; box-shadow: var(--shadow-sm);
}
.fl-btn svg { width: 15px; height: 15px; }
.fl-btn:hover { color: var(--text); border-color: var(--line-strong); }
.fl-btn.on { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--accent-text); }
.fl-n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; display: grid; place-items: center; }
.fl-pop { width: min(600px, calc(100vw - 32px)); max-height: none; overflow: visible; }
.fl-pop > .fl-sec, .fl-pop > .mo-body { padding: 0 16px; }
.fl-pop > .fl-sec:first-child { padding-top: 16px; }
.fl-pop .mo-body { padding-top: 14px; padding-bottom: 0; gap: 14px; }
.fl-sec { display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: center; margin-bottom: 0; }
.fl-pop > .fl-sec + .fl-sec, .fl-pop > .mo-body + .fl-sec { margin-top: 14px; }
.fl-pop > .cl-pop-f { margin-top: 16px; }
.fl-pop .cl-wrap .cl-pop { z-index: 40; }
.mo-chips .fitdot { width: 7px; height: 7px; box-shadow: none; }
.active-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; min-width: 0; }
.a-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 11px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 500 12.5px var(--font); animation: rise .2s both; transition: all .15s;
}
.a-chip[style*="--h"] { background: hsl(var(--h) var(--cl-s) var(--cl-l)); border-color: transparent; }
.a-chip .x { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); font-size: 14px; }
.a-chip:hover .x { background: var(--text); color: var(--bg); }
.a-clear { border: 0; background: none; color: var(--muted); font: 500 12.5px var(--font); cursor: pointer; padding: 0 4px; }
.a-clear:hover { color: var(--text); text-decoration: underline; }
.seg.icons button { padding: 6px 9px; }
.seg.icons svg { width: 16px; height: 16px; display: block; }
.count { white-space: nowrap; }
body.bot-on .fl-btn, body.bot-on .active-chips { opacity: .45; }

/* ---------- shortlist notes panel ---------- */
.notes-ui { display: grid; gap: 12px; }
.n-hero { padding: 14px; border-radius: 14px; background: linear-gradient(135deg, var(--accent-soft), var(--surface) 70%); border: 1px solid var(--line); }
.n-top { display: flex; align-items: center; gap: 8px; }
.n-verdict { margin: 10px 0 0; font-size: 13.5px; color: var(--text); line-height: 1.5; }
.n-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.n-stat { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 9px 11px; display: grid; gap: 1px; }
.n-stat .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.n-stat b { font-size: 18px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.n-stat .s { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.n-stat.hot b { color: var(--red); } .n-stat.warn b { color: var(--amber); } .n-stat.ok b { color: var(--green); }
.n-summary { font-size: 13.5px; line-height: 1.6; padding: 2px 4px; color: var(--text-2); }
.n-summary p { margin: 0; }
b.hl { font-weight: 650; color: var(--text); background: color-mix(in srgb, var(--amber-soft) 80%, transparent); padding: 0 3px; border-radius: 4px; white-space: nowrap; }
.nsec { border: 1px solid var(--line); border-radius: 13px; background: var(--surface); overflow: hidden; }
.nsec > summary { list-style: none; display: flex; align-items: center; gap: 9px; padding: 11px 13px; cursor: pointer; user-select: none; }
.nsec > summary::-webkit-details-marker { display: none; }
.nsec > summary .chev { width: 15px; height: 15px; color: var(--muted); transition: transform .2s; }
.nsec[open] > summary .chev { transform: rotate(90deg); }
.nsec > summary b { flex: 1; font-size: 14px; }
.n-ico { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); font-size: 14px; }
.nsec .chip { font-variant-numeric: tabular-nums; }
.nbody { padding: 0 13px 12px; }
.glist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.glist li { display: flex; gap: 10px; padding: 7px 6px; border-radius: 9px; font-size: 13.5px; line-height: 1.5; transition: background .12s; }
.glist li:hover { background: var(--surface-2); }
.glist .gi { flex: none; width: 22px; text-align: center; }
dl.kv { display: grid; grid-template-columns: 150px 1fr; gap: 0; margin: 0; font-size: 13px; }
dl.kv dt, dl.kv dd { padding: 8px 6px; border-bottom: 1px solid var(--line); margin: 0; }
dl.kv dt { color: var(--text-2); font-weight: 600; }
dl.kv dt small { display: block; font-weight: 500; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
dl.kv dd { color: var(--text); line-height: 1.5; }
dl.kv dt:last-of-type, dl.kv dd:last-of-type { border-bottom: 0; }

/* work type + source tags */
.work-tag { font-size: 11px; font-weight: 700; letter-spacing: .02em; padding: 2px 8px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); }
.work-tag.w-software { background: var(--blue-soft); color: var(--blue); }
.work-tag.w-gis { background: var(--green-soft); color: var(--green); }
.work-tag.w-scanning { background: var(--accent-soft); color: var(--accent-text); }
.work-tag.w-consulting { background: var(--amber-soft); color: var(--amber); }
.work-tag.w-staffing { background: var(--grey-soft); color: var(--text-2); }
.work-tag.w-systems { background: var(--red-soft); color: var(--red); }
.src-tag { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.pill.src { background: var(--surface-3); color: var(--text-2); }
.pill.src::before { display: none; }

/* ---------- home: clusters ---------- */
.crumbs .chev.back { transform: rotate(180deg); }
.week { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); padding: 14px 16px; margin-bottom: 22px; animation: rise .3s both; }
.week-h { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.dot-live { width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 var(--red); animation: orb 1.8s infinite; }
.week-row { display: grid; grid-auto-flow: column; grid-auto-columns: 250px; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
.wk { scroll-snap-align: start; display: flex; flex-direction: column; gap: 6px; padding: 11px 12px; border-radius: 13px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); transition: transform .15s, border-color .15s, box-shadow .15s; }
.wk:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow); text-decoration: none; }
.wk .due { align-self: flex-start; }
.wk-org { font-size: 11.5px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-org i { font-style: normal; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-size: 11px; background: hsl(var(--h) var(--cl-s) var(--cl-l)); flex: none; }
.wk b { font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wk-foot { display: flex; align-items: center; gap: 6px; margin-top: auto; font-size: 12.5px; font-weight: 700; }
.home-h { display: flex; align-items: baseline; gap: 12px; margin: 0 0 12px; flex-wrap: wrap; }
.home-h h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.cl-home { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.ch-card {
  position: relative; display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 18px; overflow: hidden; color: var(--text);
  background: linear-gradient(160deg, hsl(var(--h) var(--cl-s) var(--cl-l)) 0%, var(--surface) 55%); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); transition: transform .18s cubic-bezier(.2, .8, .2, 1), box-shadow .2s, border-color .2s; animation: rise .35s both;
}
.ch-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: hsl(var(--h) 55% 60%); text-decoration: none; }
.ch-top { display: flex; gap: 12px; align-items: flex-start; }
.ch-ico { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; background: var(--surface); box-shadow: var(--shadow-sm); }
.ch-t b { display: block; font-size: 15.5px; letter-spacing: -.01em; line-height: 1.3; }
.ch-t span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12.5px; color: var(--text-2); margin-top: 3px; line-height: 1.45; }
.ch-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ch-stats > div { background: color-mix(in srgb, var(--surface) 85%, transparent); border: 1px solid var(--line); border-radius: 11px; padding: 8px 10px; display: grid; }
.ch-stats b { font-size: 19px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ch-stats span { font-size: 11px; color: var(--muted); }
.ch-stats .hot b { color: var(--red); }
.ch-bar { display: flex; height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.ch-bar i { display: block; height: 100%; }
.ch-bar .f { background: var(--green); } .ch-bar .p { background: var(--amber); }
.ch-foot { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.ch-foot .fitdot { width: 7px; height: 7px; box-shadow: none; vertical-align: 1px; }
.ch-size { position: absolute; left: 0; top: 0; height: 3px; background: hsl(var(--h) 60% 55%); }
.ch-stats b { white-space: nowrap; font-size: 17px; }
.seg button { white-space: nowrap; }
.filters { flex-wrap: wrap; row-gap: 10px; }

/* ---------- notes: business + technical boxes ---------- */
body.drawer-wide .drawer { width: min(1240px, 96vw); }
.notes-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 1000px) { .notes-two { grid-template-columns: 1fr; } }
.nbox { display: grid; gap: 12px; padding: 12px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface-2); }
.nbox.biz { --tone: var(--accent); }
.nbox.tech { --tone: #0ea5a4; }
.nbox-h { display: flex; align-items: center; gap: 10px; padding: 2px 2px 0; }
.nbox-k { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: var(--tone); padding: 3px 9px; border-radius: 7px; }
.nbox-h b { font-size: 14px; }
.nbox .n-hero { background: linear-gradient(135deg, color-mix(in srgb, var(--tone) 14%, var(--surface)), var(--surface) 70%); }
.nbox .n-ico { background: color-mix(in srgb, var(--tone) 14%, var(--surface)); }
.tech-hero .n-verdict { margin-top: 0; }
.md.doc.tight { font-size: 13.5px; }
.md.doc.tight ol, .md.doc.tight ul { padding-left: 20px; margin: 4px 0; }
.md.doc.tight table { font-size: 12.5px; }
.md.doc.tight td, .md.doc.tight th { border: 1px solid var(--line); padding: 5px 7px; }

/* ---------- reject ---------- */
.card-act { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 7px; height: 22px; min-width: 22px; padding: 0 6px; font: 600 11px var(--font); cursor: pointer; opacity: 0; transition: opacity .15s, color .15s, border-color .15s; }
.card:hover .card-act, .card-act.undo { opacity: 1; }
.card-act:hover { color: var(--red); border-color: var(--red); }
.card-act.undo { color: var(--accent-text); }
.card.compact .card-act { display: none; }
.btn.ghost.danger:hover { color: var(--red); border-color: var(--red); }
.rj-scrim { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(10, 10, 20, .4); backdrop-filter: blur(3px); opacity: 0; transition: opacity .18s; }
.rj-scrim.in { opacity: 1; }
.rj { width: min(520px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 16px; display: grid; gap: 10px; transform: translateY(8px); transition: transform .2s; }
.rj-scrim.in .rj { transform: none; }
.rj-h { display: flex; align-items: center; justify-content: space-between; }
.rj-h b { font-size: 16px; }
.rj-t { margin: -4px 0 0; }
.rj-k { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.rj textarea { width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 9px 11px; background: var(--surface-2); color: var(--text); font: inherit; resize: vertical; outline: none; }
.rj textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.rj-alt { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text-2); }
.rj-f { display: flex; justify-content: flex-end; gap: 8px; }
.rj .rj-go { background: var(--red); box-shadow: 0 4px 14px -6px var(--red); }

/* ---------- users ---------- */
.me-wrap { position: relative; }
.me-btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px 0 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 600 13px var(--font); cursor: pointer; }
.me-btn.unset { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 45%, var(--line)); }
.me-btn.pulse { animation: mepulse 1.6s ease-in-out 3; }
@keyframes mepulse { 50% { box-shadow: 0 0 0 6px var(--amber-soft); } }
.av-s { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--accent), #2fb5ff); flex: none; }
.av-s.q { background: var(--amber); }
.me-pop { right: 0; left: auto !important; width: 260px; top: calc(100% + 8px); opacity: 1; transform: none; }
.me-list { display: grid; padding: 6px; }
.me-list button { display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.me-list button:hover, .me-list button.on { background: var(--surface-2); }
.me-list button span:nth-child(2) { flex: 1; display: grid; }
.me-list small { color: var(--muted); font-size: 11.5px; }
.me-list svg { width: 15px; height: 15px; color: var(--accent); }
.um { width: min(640px, calc(100vw - 32px)); }
.um-list { display: grid; gap: 8px; }
.um-row { display: flex; align-items: center; gap: 10px; }
.um-name { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; background: var(--surface-2); color: var(--text); font: inherit; outline: none; }
.um-name:focus { border-color: var(--accent); }
.um-role { display: inline-flex; gap: 5px; align-items: center; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.um-del { width: 30px; height: 30px; }

/* ---------- approvals ---------- */
.ap-strip { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.ap-strip:empty { display: none; }
.ap-chip { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px 0 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font: 600 12.5px var(--font); cursor: pointer; }
.ap-chip .ap-k { font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); }
.ap-chip.approved { color: var(--green); border-color: color-mix(in srgb, var(--green) 40%, var(--line)); }
.ap-chip.approved .ap-k { background: var(--green-soft); color: var(--green); }
.ap-chip.rejected { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.ap-chip.rejected .ap-k { background: var(--red-soft); color: var(--red); }
.ap-overall { font-size: 12px; font-weight: 600; color: var(--muted); }
.ap-overall.approved { color: var(--green); }
.ap-overall.rejected { color: var(--red); }
.ap { border: 1px solid var(--line); border-radius: 13px; background: var(--surface); padding: 10px 12px; display: grid; gap: 6px; }
.ap.ap-approved { border-color: color-mix(in srgb, var(--green) 45%, var(--line)); background: linear-gradient(135deg, var(--green-soft), var(--surface) 60%); }
.ap.ap-rejected { border-color: color-mix(in srgb, var(--red) 45%, var(--line)); background: linear-gradient(135deg, var(--red-soft), var(--surface) 60%); }
.ap-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ap-pill { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); }
.ap-pill.approved { background: var(--green); color: #fff; }
.ap-pill.rejected { background: var(--red); color: #fff; }
.ap-by { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.ap-by .av-s { width: 22px; height: 22px; font-size: 10px; }
.ap-c { margin: 0; font-size: 13px; color: var(--text-2); font-style: italic; }
.ap-form { display: grid; gap: 8px; }
.ap-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--surface-2); color: var(--text); font: inherit; resize: vertical; outline: none; }
.btn.danger-fill { background: var(--red); box-shadow: 0 4px 14px -6px var(--red); }
.ap-mini { display: inline-flex; gap: 2px; }
.ap-mini i { font-style: normal; font-size: 10px; font-weight: 800; width: 17px; height: 17px; border-radius: 5px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); }
.ap-mini i.approved { background: var(--green); color: #fff; }
.ap-mini i.rejected { background: var(--red); color: #fff; }

/* ---------- portal link + missing documents ---------- */
.portal-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.portal-row .meta { max-width: 560px; }
.docs-warn { margin-top: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--amber) 45%, var(--line)); background: linear-gradient(135deg, var(--amber-soft), var(--surface) 70%); }
.dw-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dw-h b { color: var(--amber); }
.docs-warn p { margin: 6px 0 10px; font-size: 13px; color: var(--text-2); }
.dw-a { display: flex; gap: 8px; flex-wrap: wrap; }
.docs-chip { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--amber-soft); color: var(--amber); white-space: nowrap; }
.card-act.portal { opacity: 1; color: var(--accent-text); }
.card.compact .docs-chip { display: none; }
/* citation chips inside the notes drawer (which reuses the .filelist container) */
.filelist .notes-two a.cite, .notes-inline .notes-two a.cite { display: inline-grid; place-items: center; gap: 0; min-width: 17px; height: 17px; padding: 0 4px; margin: 0 1px 0 2px; border: 0; border-radius: 5px; background: var(--accent-soft); color: var(--accent-text); vertical-align: 2px; }
.filelist .notes-two a.cite:hover, .notes-inline .notes-two a.cite:hover { background: var(--accent); color: #fff; }

/* ---------- captcha downloads ---------- */
.cq-live { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.cq-how { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 18px; margin-bottom: 14px; font-size: 13.5px; color: var(--text-2); }
.cq-how ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.cq-refresh { padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); margin-bottom: 14px; font-size: 13.5px; }
.cq-group { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; margin-bottom: 12px; overflow: hidden; }
.cq-group.complete { opacity: .65; }
.cq-gh { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cq-row { display: grid; grid-template-columns: 18px 110px 12px 1fr auto auto; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line); transition: background .15s; }
.cq-row:last-child { border-bottom: 0; }
.cq-row.on { background: var(--accent-soft); }
.cq-row.done .cq-t { color: var(--muted); text-decoration: line-through; }
.cq-st { color: var(--accent-text); font-weight: 800; }
.cq-row.done .cq-st { color: var(--green); }
.cq-t { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; }
.cq-id { font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .cq-row { grid-template-columns: 18px 1fr auto; } .cq-row .due, .cq-row .fitdot, .cq-row .cq-id { display: none; } }
.cq-tt { display: grid; min-width: 0; }
.cq-org { font-size: 11.5px; color: var(--accent-text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* notes drawer: compact collapsed cards */
.nsec.card-sec { border-radius: 13px; transition: box-shadow .15s, border-color .15s, transform .15s; }
.nsec.card-sec:not([open]):hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.nsec.card-sec > summary { align-items: center; padding: 10px 12px; }
.nsec.card-sec > summary .n-head { flex: 1; min-width: 0; display: grid; gap: 1px; }
.nsec.card-sec > summary .n-head b { font-size: 13.5px; }
.n-gist { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 400; }
.nsec.card-sec[open] .n-gist { display: none; }
.nsec.card-sec > summary .chev { order: 9; }
.nbox { gap: 8px; }
.nbox .n-verdict { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* global sign-off filter */
.so-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font: 500 12.5px var(--font); cursor: pointer; white-space: nowrap; }
.so-btn .so-k { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.so-btn.on { border-color: color-mix(in srgb, var(--green) 50%, var(--line)); background: var(--green-soft); color: var(--green); }
.so-btn .x { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; }
.so-btn .x:hover { background: var(--green); color: #fff; }
.so-pop { right: 0; left: auto !important; width: min(520px, 92vw); top: calc(100% + 8px); opacity: 1; transform: none; }

/* Global "Docs ready only" toggle */
.docs-btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px 0 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font: 600 12.5px var(--font); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.docs-btn:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.docs-btn .dr-box { width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--muted); display: inline-grid; place-items: center; font-size: 11px; line-height: 1; }
.docs-btn.on { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: var(--accent-soft, color-mix(in srgb, var(--accent) 12%, var(--surface))); color: var(--accent); }
.docs-btn.on .dr-box { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (max-width: 1100px) { .docs-btn { font-size: 0; gap: 0; padding: 0 9px; } .docs-btn::after { content: "Docs"; font-size: 12px; margin-left: 6px; } }

/* ---------- stars (per user) and tags (shared), from marks.js ---------- */
:root { --star: #e3a008; --star-soft: #fff4d1; }
:root[data-theme="dark"] { --star: #f7c948; --star-soft: #3a2f10; }
.mk { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; min-width: 0; }
.mk-star {
  flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 7px;
  background: transparent; color: var(--muted); cursor: pointer; transition: color .15s, background .15s, transform .15s;
}
.mk-star svg { width: 16px; height: 16px; fill: none; stroke: currentColor; transition: fill .15s, transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.mk-star:hover { color: var(--star); background: var(--star-soft); }
.mk-star.on { color: var(--star); }
.mk-star.on svg { fill: currentColor; animation: mk-pop .35s cubic-bezier(.3, 1.6, .5, 1); }
.mk-star:focus-visible, .mk-add:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@keyframes mk-pop { 0% { transform: scale(.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
/* text variant (detail page) looks like a ghost button */
.mk-v-big .mk-star, .mk-v-bigfull .mk-star {
  width: auto; height: auto; gap: 6px; display: inline-flex; padding: 5px 10px; border-radius: 8px; font: 600 12.5px var(--font);
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-sm);
}
.mk-v-big .mk-star:hover, .mk-v-bigfull .mk-star:hover { border-color: var(--star); color: var(--text); background: var(--surface); }
.mk-v-big .mk-star svg, .mk-v-bigfull .mk-star svg { width: 15px; height: 15px; }
.mk-v-big .mk-star.on, .mk-v-bigfull .mk-star.on { background: var(--star-soft); border-color: color-mix(in srgb, var(--star) 55%, transparent); color: var(--text); }
.mk-v-big .mk-star.on svg, .mk-v-bigfull .mk-star.on svg { color: var(--star); }
/* tag chips */
.mk-tag {
  display: inline-flex; align-items: center; gap: 2px; height: 20px; padding: 0 3px 0 8px; border-radius: 999px; max-width: 160px;
  background: var(--accent-soft); color: var(--accent-text); font: 600 11px/1 var(--font); white-space: nowrap; cursor: pointer; transition: filter .15s;
}
.mk-tag::before { content: "#"; opacity: .55; margin-right: 1px; }
.mk-tag:hover { filter: brightness(.96); }
.mk-tag button { width: 15px; height: 15px; border: 0; padding: 0; border-radius: 50%; background: transparent; color: inherit; opacity: .45; font: 600 12px/1 var(--font); cursor: pointer; display: grid; place-items: center; }
.mk-tag button:hover { opacity: 1; background: var(--accent); color: #fff; }
.mk-add {
  display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 7px 0 5px; border-radius: 999px; border: 1px dashed var(--line-strong);
  background: transparent; color: var(--muted); font: 600 11px/1 var(--font); cursor: pointer; transition: all .15s;
}
.mk-add svg { width: 11px; height: 11px; }
.mk-add:hover { color: var(--accent-text); border-color: var(--accent); border-style: solid; background: var(--accent-soft); }
.mk-hash { opacity: .55; margin-right: 1px; }
/* in list cards: unstarred star and "+ tag" appear on hover; an empty tag row floats in the footer gap */
.card .mk-star:not(.on) { opacity: 0; }
.card:hover .mk-star, .card.sel .mk-star, .card .mk-star:focus-visible { opacity: 1; }
.card > .mk-v-tags { margin-top: -3px; }
.card .mk-add { opacity: 0; }
.card:hover .mk-add, .card.sel .mk-add, .card .mk-add:focus-visible { opacity: 1; }
.card > .mk-v-tags:not(:has(.mk-tag)) { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); margin: 0; }
.card.compact .mk-star { order: -1; }
.tbl .mk-th, .tbl .mk-td { width: 34px; padding-left: 8px; padding-right: 0; }
.tbl .mk-td .mk-star:not(.on) { opacity: .35; }
.tbl tr:hover .mk-star { opacity: 1; }
.tbl td > .mk-v-tags { margin-top: 5px; }
.tbl .mk-add { opacity: 0; }
.tbl tr:hover .mk-add, .tbl tr.sel .mk-add { opacity: 1; }
.tbl td > .mk-v-tags:not(:has(.mk-tag)) { margin-top: 0; height: 0; overflow: visible; }
@media (hover: none) { .card .mk-star:not(.on), .card .mk-add, .tbl .mk-add { opacity: 1; } }
/* detail header */
.bidhead .mk-line { margin: 2px 0 4px; }
.bidhead .mk-line .mk-add { height: 22px; }
/* toolbar toggle */
.star-btn svg { fill: none; stroke: currentColor; }
.star-btn.on { border-color: color-mix(in srgb, var(--star) 60%, var(--line)); color: var(--text); background: var(--star-soft); }
.star-btn.on svg { fill: var(--star); stroke: var(--star); }
.star-btn .fl-n { background: var(--star); color: #1b1400; }
#tag-chips .mk-hash { margin-right: 0; }
/* tag picker popover */
.mk-pop {
  position: fixed; z-index: 90; width: 280px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(-4px) scale(.98); transform-origin: top left; transition: opacity .14s, transform .18s cubic-bezier(.2, .8, .2, 1); overflow: hidden;
}
.mk-pop.in { opacity: 1; transform: none; }
.mk-pop-h { display: flex; align-items: baseline; gap: 8px; padding: 11px 13px 6px; font-size: 12.5px; }
.mk-pop-for { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mk-pop-in { display: flex; align-items: center; gap: 4px; margin: 0 10px; padding: 0 10px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-weight: 600; }
.mk-pop-in:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.mk-pop-in input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: 500 13px var(--font); }
.mk-pop-cur { display: flex; flex-wrap: wrap; gap: 5px; padding: 9px 12px 0; }
.mk-pop-list { display: flex; flex-direction: column; padding: 6px; max-height: 220px; overflow-y: auto; }
.mk-opt { display: flex; align-items: center; gap: 6px; width: 100%; padding: 7px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: 500 13px var(--font); text-align: left; cursor: pointer; }
.mk-opt span:first-child { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-opt .n { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.mk-opt svg { width: 13px; height: 13px; color: var(--accent-text); }
.mk-opt.new b { color: var(--accent-text); font-weight: 600; }
.mk-opt.hi, .mk-opt:hover { background: var(--surface-3); }
.mk-empty { padding: 8px; color: var(--muted); font-size: 12px; }
.mk-pop-f { padding: 8px 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.mk-pop-f kbd { font: 600 10.5px var(--font); padding: 1px 5px; border-radius: 5px; border: 1px solid var(--line); background: var(--surface-2); }
.mk-toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 95; padding: 10px 16px; border-radius: 12px; background: var(--text, #17172b); color: var(--bg, #fff); font: 13px var(--font, system-ui); box-shadow: 0 20px 50px -12px rgba(0, 0, 0, .3); }
.mk-toast.err { background: var(--red, #cc2b3b); color: #fff; }
/* Starred page */
.st-tags { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; }
.st-empty { padding: 18px; margin-bottom: 26px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); font-size: 13px; text-align: center; }
#starred .cards { margin-bottom: 28px; }
#starred .card.missing { opacity: .7; }
#starred .st-chg { margin: 8px 0 2px; padding: 6px 10px; border-radius: 8px; background: var(--amber-soft); color: var(--amber); font-size: 12px; line-height: 1.4; }
#starred .st-chg .t { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#starred .st-chg.bad { background: var(--red-soft, rgba(204, 43, 59, .1)); color: var(--red, #cc2b3b); }
#starred .st-chg .more { opacity: .75; }
#starred .st-card .top { flex-wrap: nowrap; min-width: 0; }
#starred .st-card .top .meta, #starred .st-card .top .src-tag { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Business & technical notes shown inline at the top of the bid page */
.notes-inline { margin: 0 0 16px; }
.grid.one { grid-template-columns: minmax(0, 1fr); }
