/* In-Sites admin v2 — light, calm, spacious. Same design language as the client
   portal (client.css). Covers the existing admin class vocabulary with light
   values so every page inherits the new look. styles.css remains ONLY for the
   collaborator portal. */
:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-2: #f0f2f6;
  --line: #e7e9ee;
  --text: #1b1e26;
  --muted: #6b7280;
  --soft: #8a90a0;
  --accent: #5b6cff;
  --accent-weak: rgba(91, 108, 255, 0.10);
  --green: #1f9d57;
  --amber: #c97a00;
  --red: #e5484d;
  --shadow: 0 1px 2px rgba(20, 24, 40, 0.04), 0 12px 30px rgba(20, 24, 40, 0.06);
  --brand-grad: linear-gradient(90deg, #ff2d2d, #ff7a00, #ffc400, #6ad000, #00b85a, #16c0e6, #1f3df5, #7a1fe0, #ff1f9c);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 15.5px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Shell ===== */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 13px 26px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--brand-grad);
  opacity: .9;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); flex-shrink: 0; }
.brand-logo { height: 24px; width: auto; display: block; }
.brand .tag-admin {
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; font-weight: 600;
}

.main-nav { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; }
.main-nav > a {
  color: var(--muted); font-weight: 600; font-size: 15px;
  padding: 7px 12px; border-radius: 10px;
}
.main-nav > a:hover { color: var(--text); text-decoration: none; background: var(--panel-2); }
.main-nav > a.on { color: var(--text); background: var(--accent-weak); }
.more-menu { position: relative; }
.more-menu > summary {
  list-style: none; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 15px;
  padding: 7px 12px; border-radius: 10px;
}
.more-menu > summary::-webkit-details-marker { display: none; }
.more-menu > summary:hover { color: var(--text); background: var(--panel-2); }
.more-menu[open] > summary { color: var(--text); background: var(--panel-2); }
.more-drop {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 200px; z-index: 30;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 8px; display: flex; flex-direction: column;
}
.more-drop a { color: var(--text); padding: 9px 12px; border-radius: 9px; font-size: 14px; font-weight: 500; }
.more-drop a:hover { background: var(--panel-2); text-decoration: none; }

.topbar-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.topbar-right > a { color: var(--muted); font-size: 13px; font-weight: 500; }
.who { color: var(--soft); font-size: 13px; }

.container { max-width: 1060px; margin: 0 auto; padding: 30px 28px 70px; }

/* Old railed layout → single calm column (rail itself is retired) */
.layout { display: block; }
.content { max-width: 980px; margin: 0 auto; padding: 30px 24px 70px; }

.footer {
  border-top: 1px solid var(--line);
  color: var(--soft);
  font-size: 12.5px;
  padding: 18px 24px;
  text-align: center;
  background: transparent;
}

/* ===== Type ===== */
h1 { font-size: 27px; letter-spacing: -0.02em; margin: 0 0 14px; }
h2 { font-size: 18px; letter-spacing: -0.01em; margin: 30px 0 12px; color: var(--text); }
h3 { font-size: 16px; margin: 0 0 6px; }
.muted { color: var(--muted); }
.eyebrow { font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: var(--soft); margin: 8px 0 10px; }
.mono { font-family: ui-monospace, "Cascadia Code", monospace; font-size: 12px; }
.mini { font-size: 12px; display: inline-block; margin-top: 4px; }
.back { display: inline-block; margin-bottom: 14px; font-size: 13.5px; color: var(--muted); }

/* ===== Cards & layout pieces ===== */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.card h2 { margin-top: 0; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 18px; }
.cols .card { margin-bottom: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-head h2 { margin: 26px 0 12px; }
.head-actions { display: flex; gap: 8px; }
.rule { border: none; border-top: 1px solid var(--line); margin: 14px 0; }

.note {
  margin-top: 22px;
  padding: 13px 16px;
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  font-size: 13.5px;
}
.alert {
  background: rgba(229, 72, 77, 0.07);
  border: 1px solid rgba(229, 72, 77, 0.35);
  color: var(--red);
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 14px;
}
code {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 12.5px;
}

/* ===== Stats ===== */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 18px; display: flex; flex-direction: column; gap: 3px; box-shadow: var(--shadow);
}
.stat-num { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.stat-label { font-size: 11.5px; color: var(--soft); text-transform: uppercase; letter-spacing: .05em; }

/* ===== Tables ===== */
.table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
.table th, .table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.table th { color: var(--soft); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
.table tr:last-child td { border-bottom: none; }

/* ===== Tags & badges ===== */
.tag {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid transparent;
  color: var(--soft);
  text-transform: capitalize;
}
.tag-active, .tag-in_progress, .tag-live, .tag-agree-signed { color: var(--green); background: rgba(31,157,87,.10); }
.tag-review, .tag-quoted, .tag-building, .tag-agree-verbal { color: var(--amber); background: rgba(201,122,0,.10); }
.tag-archived, .tag-dormant, .tag-paused, .tag-retired, .tag-kind-upkeep { color: var(--soft); }
.tag-concept, .tag-agree-drafted, .tag-kind-build { color: var(--accent); background: var(--accent-weak); }
.tag-in_scope { color: var(--green); background: rgba(31,157,87,.10); }
.tag-out_of_scope { color: var(--amber); background: rgba(201,122,0,.10); }
.tag.bad { color: var(--red); background: rgba(229,72,77,.08); }
.pri-high { color: var(--red); }
.pri-medium { color: var(--amber); }
.pri-low { color: var(--soft); }
.badge { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; background: var(--panel); }
.badge.you { color: var(--accent); border-color: rgba(91,108,255,.35); }
.badge.cowork { color: var(--green); border-color: rgba(31,157,87,.35); }
.cat {
  display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--accent); background: var(--accent-weak);
  border-radius: 999px; padding: 2px 9px; white-space: nowrap;
}
.popia-badge { font-size: 10px; font-weight: 700; letter-spacing: .04em; color: var(--amber); border: 1px solid rgba(201,122,0,.45); border-radius: 999px; padding: 1px 6px; }
.popia-banner { margin: 14px 0; padding: 12px 16px; background: rgba(201,122,0,.07); border: 1px solid rgba(201,122,0,.35); border-radius: 12px; font-size: 13.5px; }

/* ===== Buttons & forms ===== */
.btn {
  cursor: pointer; border-radius: 11px; border: 1px solid var(--line);
  padding: 9px 15px; font-size: 14px; font-weight: 600;
  background: var(--panel); color: var(--text);
  transition: border-color .15s, background .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:hover { border-color: var(--accent); text-decoration: none; }
a.btn { display: inline-block; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; padding: 6px 12px; }
.inline { display: inline; margin: 0; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }

.form { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.form input, .form select, .form textarea {
  background: #fcfcfd; border: 1px solid var(--line); border-radius: 11px;
  padding: 10px 13px; color: var(--text); font: inherit;
}
.form textarea { resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--accent); }
.form fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.form legend { color: var(--soft); font-size: 13px; padding: 0 6px; }
.form .choice { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
.form .addon { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; color: var(--text); }
.form .addon input { width: 90px; padding: 6px 8px; }
.form .choice.tier { flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.form .choice.tier:last-child { border-bottom: none; }
.tier-head { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.tier-desc { color: var(--muted); font-size: 13px; padding-left: 24px; }

.form-inline { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.form-inline input, .form-inline select {
  background: #fcfcfd; border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; color: var(--text); font: inherit;
}
.form-inline input { flex: 1 1 160px; }
.form-inline input[type="number"] { max-width: 100px; flex: 0 1 auto; }
.form-inline .chk { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; color: var(--muted); }
.form-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.form-row input, .form-row select {
  background: #fcfcfd; border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; color: var(--text); font: inherit;
}
.form-row input[type="text"], .form-row input:not([type]) { flex: 1; min-width: 160px; }
.form-row input[type="number"] { max-width: 110px; }
.form-row select { flex: 1 1 220px; min-width: 0; max-width: 100%; }
.status-form { display: flex; gap: 6px; align-items: center; margin: 0; }
.status-form select { background: #fcfcfd; border: 1px solid var(--line); border-radius: 8px; padding: 4px 7px; color: var(--text); font-size: 13px; }
.dump-row { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.dump-row select { flex: 1; min-width: 170px; }
.sup-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.sup-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sup-row select { flex: 1 1 240px; background: #fcfcfd; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; color: var(--text); }
.sup-row .js-sup-qty { width: 84px; background: #fcfcfd; border: 1px solid var(--line); border-radius: 10px; padding: 8px; color: var(--text); }
.sup-detail { flex: 1 1 100%; font-size: 12px; }
.sup-inputs { display: flex; gap: 6px; }
.sup-inputs input { width: 70px; background: #fcfcfd; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; color: var(--text); }
.quote-head, .quote-row { display: grid; grid-template-columns: 1fr 70px 70px 70px; gap: 8px; align-items: center; }
.quote-head { color: var(--soft); font-size: 12px; margin-bottom: 4px; }
.quote-row { margin-bottom: 8px; }
.quote-row select, .quote-row input { background: #fcfcfd; border: 1px solid var(--line); border-radius: 8px; padding: 8px; color: var(--text); }
.edit-body {
  width: 100%; background: #fcfcfd; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; color: var(--text); font: 13px/1.6 ui-monospace, "Cascadia Code", monospace;
  resize: vertical; min-height: 320px;
}
.edit-body:focus { outline: none; border-color: var(--accent); }
.check-label { flex-direction: row !important; align-items: center; gap: 8px !important; color: var(--text) !important; }
.check-label input { width: auto; }
.link-box {
  display: block; width: 100%; margin-top: 10px;
  background: #fcfcfd; border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 11px; color: var(--text); font: 12px/1.4 ui-monospace, monospace;
}

/* ===== Auth ===== */
.auth-wrap { max-width: 400px; margin: 9vh auto 0; text-align: center; }
.auth-logo { width: 210px; max-width: 70%; height: auto; margin: 0 auto 26px; display: block; }
.auth-card { position: relative; overflow: hidden; text-align: left; }
.auth-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--brand-grad); }
.auth-card h1 { margin-bottom: 2px; }

/* ===== Lists, checklists, feeds ===== */
.list { margin: 0; padding-left: 18px; }
.list li { margin: 6px 0; }
ul { padding-left: 18px; }
li { margin: 3px 0; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 7px 16px; margin: 0; }
dl.kv dt { color: var(--soft); font-size: 13px; }
dl.kv dd { margin: 0; }

.check { display: inline; margin: 0; }
.checkbox {
  width: 19px; height: 19px; padding: 0; cursor: pointer; vertical-align: middle;
  border: 2px solid #d4d8e0; border-radius: 6px; background: #fff; position: relative;
}
.checkbox:hover { border-color: var(--green); }
.checkbox.on { background: var(--green); border-color: var(--green); }
.checkbox.on::after {
  content: "✓"; color: #fff; font-size: 12px; font-weight: 700;
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
}
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.checklist li:last-child { border-bottom: none; }
.check-title { flex: 1; }
tr.done .check-title, .checklist li.done .check-title a { text-decoration: line-through; color: var(--soft); }
.todo-row { display: flex; align-items: center; gap: 10px; }
.todo-row .check-title { flex: 1; min-width: 0; }
.todo-row .task-where { flex-shrink: 0; font-size: 12px; }
.prio-form { margin: 0; flex-shrink: 0; }
.prio-select {
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  font-size: 11px; padding: 2px 7px; cursor: pointer; font-weight: 600; color: var(--soft);
}
.prio-select.pri-high { color: var(--red); border-color: rgba(229,72,77,.4); }
.prio-select.pri-medium { color: var(--amber); border-color: rgba(201,122,0,.4); }
.prio-select.pri-low { color: var(--soft); }
.prio-select.pri-suitie-live { color: var(--green); border-color: rgba(31,157,87,.4); }
.prio-select.pri-suitie-building { color: var(--amber); border-color: rgba(201,122,0,.4); }
.prio-select.pri-suitie-concept { color: var(--accent); border-color: rgba(91,108,255,.4); }
.prio-select.pri-suitie-paused, .prio-select.pri-suitie-retired { color: var(--soft); }
.client-groups .client-group { border-bottom: 1px solid var(--line); }
.client-groups .client-group:last-child { border-bottom: none; }
.client-group > summary { cursor: pointer; padding: 10px 0; font-weight: 600; }
.client-group > summary:hover { color: var(--accent); }
.client-group .checklist { padding-bottom: 8px; }
.note-list { list-style: none; margin: 8px 0; padding: 0; }
.note-list li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.note-list li:last-child { border-bottom: none; }
.thread-admin { list-style: none; margin: 0 0 12px; padding: 0; }
.thread-admin li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.thread-admin li:last-child { border-bottom: none; }
.thread-admin li.from-client { border-left: 3px solid var(--accent); padding-left: 10px; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.feed li:last-child { border-bottom: none; }
.feed-msg { flex: 1; }
.feed-when { font-size: 12px; white-space: nowrap; color: var(--soft); }

.agenda { list-style: none; margin: 0; padding: 0; }
.agenda li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.agenda li:last-child { border-bottom: none; }
.agenda-date { font-variant-numeric: tabular-nums; color: var(--soft); width: 92px; flex-shrink: 0; }
.agenda-title { flex: 1; }
.kind-project { color: var(--accent); }
.kind-invoice { color: var(--amber); }
.kind-meeting { color: var(--green); }
.kind-task { color: var(--soft); }

/* ===== Needs / legacy pulse cards ===== */
.needs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.need-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; color: var(--text); box-shadow: var(--shadow);
}
a.need-card:hover { text-decoration: none; border-color: var(--accent); }
.need-card .need-num { font-size: 26px; font-weight: 700; }
.need-card .need-label { font-size: 12px; color: var(--soft); }
.need-card.warn { border-color: rgba(201,122,0,.45); }
.need-card.warn .need-num { color: var(--amber); }
.need-card.bad { border-color: rgba(229,72,77,.45); }
.need-card.bad .need-num { color: var(--red); }

/* ===== Drafts / approvals ===== */
.draft-body { white-space: pre-wrap; font: 14px/1.65 ui-sans-serif, system-ui, sans-serif; color: var(--text); margin: 0; }
.approve-list { list-style: none; margin: 0; padding: 0; }
.approve-item { border-bottom: 1px solid var(--line); }
.approve-item:last-child { border-bottom: none; }
.approve-item details { padding: 4px 0; }
.approve-item summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 11px 4px; cursor: pointer; list-style: none; }
.approve-item summary::-webkit-details-marker { display: none; }
.approve-item summary::before { content: "▸"; color: var(--soft); font-size: 12px; transition: transform .15s ease; flex-shrink: 0; }
.approve-item details[open] summary::before { transform: rotate(90deg); }
.approve-subject { flex: 1; font-weight: 600; min-width: 140px; }
.approve-body { margin: 4px 0 12px 22px; padding: 13px 15px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; max-height: 320px; overflow-y: auto; }
.approve-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 12px 22px; }
.approve-actions form { margin: 0; }

/* ===== Mail ===== */
.mail-list { list-style: none; margin: 0; padding: 0; }
.mail-item { padding: 13px 0; border-bottom: 1px solid var(--line); }
.mail-item:last-child { border-bottom: none; }
.mail-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.mail-from { font-weight: 600; }
.mail-item.unread .mail-from::before { content: "● "; color: var(--accent); }
.mail-date { color: var(--soft); font-size: 12px; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.mail-subject { margin: 2px 0; }
.mail-preview { font-size: 13px; }
.mail-reply-form { margin: 8px 0 0; }
.mail-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.mail-actions form, form.inline { display: inline; margin: 0; }

/* ===== Chat (per-task + Shadow panel) ===== */
#task-chat { margin-top: 6px; }
.chat-log { display: flex; flex-direction: column; gap: 10px; max-height: 440px; overflow-y: auto; margin-bottom: 12px; }
.chat-log:empty { display: none; }
.chat-msg { padding: 10px 14px; border-radius: 14px; max-width: 84%; white-space: pre-wrap; word-wrap: break-word; line-height: 1.55; font-size: 14.5px; }
.chat-user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 5px; }
.chat-assistant { align-self: flex-start; background: var(--panel-2); color: var(--text); border-bottom-left-radius: 5px; }
.chat-pending { color: var(--muted); font-style: italic; }
.chat-error { border: 1px solid var(--red); color: var(--red); background: transparent; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; }
.chat-input { flex: 1; background: #fcfcfd; border: 1px solid var(--line); border-radius: 12px; padding: 10px 13px; color: var(--text); font: inherit; resize: vertical; min-height: 46px; }
.chat-input:focus { outline: none; border-color: var(--accent); }

/* ===== Brief (markdown-lite) ===== */
.brief h3 { font-size: 15px; margin: 16px 0 6px; color: var(--text); text-transform: none; letter-spacing: 0; }
.brief h3:first-child, .brief h4:first-child { margin-top: 0; }
.brief h4 { font-size: 12px; margin: 16px 0 6px; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; }
.brief p { margin: 6px 0; }
.brief ul { margin: 6px 0 10px; padding-left: 20px; }
.brief li { margin: 4px 0; }
.brief-when { margin-top: 12px; font-size: 12px; }

/* ===== Smart plan ===== */
.smart-plan .plan-routing { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; flex-wrap: wrap; }
.smart-plan .plan-action { margin: 8px 0; }
.smart-plan .plan-detail { margin: 8px 0 0; }
.smart-plan h3 { font-size: 12.5px; margin: 18px 0 8px; color: var(--soft); text-transform: uppercase; letter-spacing: .05em; }
.scope-cell { white-space: nowrap; }
.mini-toggle { background: transparent; border: 1px solid var(--line); color: var(--soft); border-radius: 7px; font-size: 11px; padding: 2px 7px; margin-left: 6px; cursor: pointer; }
.mini-toggle:hover { border-color: var(--accent); color: var(--text); }
.narrow-num input[type="number"] { max-width: 70px; padding: 4px 6px; }
.partner-edit { display: inline-flex; gap: 4px; align-items: center; margin: 0 0 4px; }
.partner-edit input[type="number"] { max-width: 56px; padding: 4px 6px; background: #fcfcfd; border: 1px solid var(--line); border-radius: 6px; color: var(--text); font: inherit; }
.partner-edit select { padding: 4px 6px; background: #fcfcfd; border: 1px solid var(--line); border-radius: 6px; color: var(--text); font: inherit; font-size: 12px; }
.row-muted { opacity: .55; }
.add-block { margin-top: 16px; }
.add-block > summary { cursor: pointer; color: var(--accent); font-size: 14px; padding: 6px 0; }
.add-block > summary:hover { text-decoration: underline; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; }

/* ===== Suities ===== */
.suitie-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 18px; }
.suitie-card { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; color: var(--text); box-shadow: var(--shadow); }
.suitie-card:hover { border-color: var(--accent); text-decoration: none; }
.suitie-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.suitie-name { font-weight: 700; font-size: 16px; }
.suitie-industry { margin: 2px 0 0; font-size: 12px; }
.suitie-summary { margin: 8px 0 0; font-size: 13px; }
.suitie-card-meta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; font-size: 12px; color: var(--soft); }

/* ===== CoWork thread (legacy) ===== */
.cowork-thread { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.cowork-msg { display: flex; flex-direction: column; align-items: flex-end; }
.cowork-bubble { background: var(--accent); color: #fff; border-radius: 14px; border-bottom-right-radius: 5px; padding: 10px 13px; max-width: 82%; white-space: pre-wrap; word-wrap: break-word; line-height: 1.5; font-size: 14px; }
.cowork-meta { font-size: 12px; margin-top: 4px; color: var(--soft); }

/* ===== Shadow workspace (Today hero) ===== */
.shadow-work { position: relative; overflow: hidden; padding: 24px 26px; margin-bottom: 22px; }
.shadow-work::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--brand-grad); }
.sw-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.sw-controls { display: flex; align-items: center; gap: 8px; }
.sw-controls select {
  background: #fcfcfd; border: 1px solid var(--line); border-radius: 11px;
  padding: 8px 12px; color: var(--text); font: inherit; font-weight: 600; max-width: 260px;
}
.sw-controls select:focus { outline: none; border-color: var(--accent); }
.sw-log { max-height: 52vh; overflow-y: auto; margin-bottom: 12px; }
.sw-log .chat-msg { max-width: 88%; font-size: 15px; }
.sw-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.sw-chip {
  background: var(--panel-2); border: 1px solid transparent; color: var(--muted);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.sw-chip:hover { color: var(--text); border-color: var(--accent); background: var(--accent-weak); }
.sw-form { display: flex; gap: 10px; align-items: flex-end; }
.sw-send { display: flex; flex-direction: column; gap: 8px; }
.sw-send .dump-file-btn { text-align: center; }
.sw-form textarea {
  flex: 1; background: #fcfcfd; border: 1px solid var(--line); border-radius: 14px;
  padding: 13px 16px; color: var(--text); font: inherit; font-size: 15.5px; resize: vertical; min-height: 76px;
}
.sw-form textarea:focus { outline: none; border-color: var(--accent); }
.sw-form .btn { padding: 13px 22px; font-size: 15px; }
.sw-hint { font-size: 12.5px; margin: 10px 0 0; }
.sw-docs { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 13px; align-items: center; }

/* Markdown-lite inside chat bubbles */
.chat-msg .cmsg-p { margin: 0 0 8px; }
.chat-msg .cmsg-p:last-child { margin-bottom: 0; }
.chat-msg .cmsg-h { font-weight: 700; margin: 10px 0 6px; }
.chat-msg .cmsg-h:first-child { margin-top: 0; }
.chat-msg .cmsg-ul { margin: 4px 0 8px; padding-left: 20px; }
.chat-msg .cmsg-ul li { margin: 3px 0; }
.chat-user .cmsg-p, .chat-user strong { color: #fff; }

/* ===== Today top grid (brief | CoWork space) ===== */
.container-wide { max-width: 1520px; }
.top-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 8px; }
.top-col { margin-bottom: 0; }
.brief-scroll { margin-top: 10px; max-height: 480px; overflow-y: auto; padding-right: 6px; }
.cowork-space { position: relative; overflow: hidden; }
.cowork-space::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--brand-grad); }
.scard-sm { padding: 12px 14px; margin-bottom: 8px; box-shadow: none; background: var(--bg); }
.scard-sm .scard-title { font-size: 14.5px; }
.scard-sm .scard-sub { font-size: 12.5px; }
.scard-sm .btn { padding: 6px 11px; font-size: 13px; }
.dump-file-btn { cursor: pointer; flex: 0 0 auto; }
.cw-busy { margin-top: 10px; }
.cw-busy > summary { cursor: pointer; color: var(--soft); font-size: 13.5px; list-style: none; }
.cw-busy > summary::-webkit-details-marker { display: none; }
.cw-busy > summary:hover { color: var(--text); }
@media (max-width: 900px) { .top-grid { grid-template-columns: 1fr; } }

/* ===== Today stream ===== */
.today-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.today-head h1 { margin: 0; font-size: 30px; }
.today-date { color: var(--soft); font-size: 14px; }
.today-sub { color: var(--muted); font-size: 16.5px; margin: 2px 0 24px; }
.quick-add { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 16px 0 4px; font-size: 13.5px; }
.quick-add a { color: var(--soft); font-weight: 500; }
.quick-add a:hover { color: var(--accent); }

.stream-section { margin: 26px 0 6px; }
.stream-section > h2 { display: flex; align-items: center; gap: 9px; margin: 0 0 12px; font-size: 16.5px; }
.stream-count { font-size: 12px; font-weight: 700; color: var(--soft); background: var(--panel-2); border-radius: 999px; padding: 2px 9px; }
.scard {
  display: flex; align-items: center; gap: 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px 18px; box-shadow: var(--shadow); margin-bottom: 10px;
}
.scard.urgent { border-left: 4px solid var(--red); }
.scard-body { flex: 1; min-width: 0; }
.scard-title { font-weight: 650; font-size: 15.5px; line-height: 1.4; }
.scard-title a { color: var(--text); }
.scard-sub { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.scard-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.scard-actions form { margin: 0; }
.stream-empty { text-align: center; padding: 56px 24px; }
.stream-empty .glow { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; background: var(--brand-grad); opacity: .18; }
.digest { margin-top: 30px; }
.digest > summary { cursor: pointer; color: var(--soft); font-size: 14px; padding: 6px 0; list-style: none; }
.digest > summary::-webkit-details-marker { display: none; }
.digest > summary:hover { color: var(--text); }

/* ===== Shadow slide-over panel ===== */
.shadow-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--text); color: #fff; border: 1px solid var(--text);
  border-radius: 999px; padding: 7px 16px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.shadow-btn:hover { filter: brightness(1.15); }
.shadow-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); z-index: 50;
  background: var(--panel); border-left: 1px solid var(--line);
  box-shadow: -18px 0 50px rgba(20,24,40,.12);
  display: none; flex-direction: column;
}
.shadow-panel.open { display: flex; }
.shadow-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.shadow-panel-head h2 { margin: 0; font-size: 17px; }
.shadow-close { background: transparent; border: 1px solid var(--line); border-radius: 9px; width: 30px; height: 30px; cursor: pointer; color: var(--soft); font-size: 16px; line-height: 1; }
.shadow-close:hover { border-color: var(--red); color: var(--red); }
.shadow-log { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.shadow-hint { color: var(--soft); font-size: 13.5px; }
.shadow-form { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: flex-end; }
.shadow-form textarea { flex: 1; background: #fcfcfd; border: 1px solid var(--line); border-radius: 12px; padding: 10px 13px; color: var(--text); font: inherit; resize: vertical; min-height: 44px; max-height: 160px; }
.shadow-form textarea:focus { outline: none; border-color: var(--accent); }

/* ===== Responsive ===== */
@media (max-width: 760px) {
  .topbar { padding: 11px 14px; gap: 12px; flex-wrap: wrap; }
  .main-nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .container, .content { padding: 20px 14px 56px; }
  h1 { font-size: 23px; }
  .scard { flex-direction: column; align-items: stretch; gap: 10px; }
  .scard-actions { justify-content: flex-start; }
  .cols { grid-template-columns: 1fr; }
}
