/* ============================================================================
   LEO — styles. Base + tokens, then per-theme component systems.
   ink   : restrained dark, hairlines, no boxes
   paper : white, dense, icon rail, bordered rows with chips (Mission Control)
   cloud : soft light, labeled icon nav, tick meters, colored series (ShipNova)
   ========================================================================== */

:root {
  --bg: #0F0F10; --rail-bg: #0F0F10; --topbar-bg: rgba(15,15,16,.9);
  --surface: #151517; --surface-2: #1B1B1E; --line: #222225; --line-2: #2D2D31;
  --text: #ECECEA; --text-2: #A3A39E; --text-3: #6A6A64;
  --red: #E5484D; --good: #A3A39E; --accent: #ECECEA;
  --card-bg: transparent; --card-border: transparent; --card-px: 0px; --card-py: 0px; --radius: 0px; --shadow: none;
  --btn-primary-bg: #ECECEA; --btn-primary-fg: #0F0F10;
  --chart-ink: #C6C6C1; --chart-grid: #1C1C1F; --chart-axis: #6A6A64; --spark: #8A8A85; --dim: #5A5A5E; --tick-bg: #26262A;
  --s1: #ECECEA; --s2: #8A8A85; --s3: #333337; --s4: #5A5A5E;
  --g-cannabis: #ECECEA; --g-hardware: #A3A39E; --g-legal: #6A6A64; --g-holdings: #45454A;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Helvetica, Arial, sans-serif; --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --rail: 196px; --topbar-h: 46px;
}
[data-theme="paper"] {
  --bg: #F7F7F8; --rail-bg: #FFFFFF; --topbar-bg: #FFFFFF;
  --surface: #F3F3F4; --surface-2: #ECECEE; --line: #E6E6E8; --line-2: #D9D9DC;
  --text: #16171A; --text-2: #5B5D66; --text-3: #8A8C96;
  --red: #E5484D; --good: #22A06B; --accent: #16171A;
  --card-bg: #FFFFFF; --card-border: #E6E6E8; --radius: 10px; --shadow: 0 1px 2px rgba(16,17,20,.04);
  --btn-primary-bg: #16171A; --btn-primary-fg: #FFFFFF;
  --chart-ink: #16171A; --chart-grid: #ECECEE; --chart-axis: #9A9CA6; --spark: #7A7C86; --dim: #D0D1D6; --tick-bg: #ECECE8;
  --s1: #22A06B; --s2: #F59E0B; --s3: #3B82F6; --s4: #8B5CF6;
  --g-cannabis: #22A06B; --g-hardware: #3B82F6; --g-legal: #8B5CF6; --g-holdings: #F59E0B;
  --rail: 60px; --topbar-h: 58px;
}
[data-theme="cloud"] {
  --bg: #F3F3F1; --rail-bg: #FAFAF9; --topbar-bg: #FAFAF9;
  --surface: #F6F6F4; --surface-2: #EFEFEC; --line: #E7E7E4; --line-2: #D8D8D4;
  --text: #17181C; --text-2: #5C5F68; --text-3: #8B8E98;
  --red: #E5484D; --good: #2FB57C; --accent: #F5651B;
  --card-bg: #FFFFFF; --card-border: #E7E7E4; --radius: 14px; --shadow: 0 1px 2px rgba(20,22,30,.03);
  --btn-primary-bg: #17181C; --btn-primary-fg: #FFFFFF;
  --chart-ink: #7C6CF6; --chart-grid: #ECECEA; --chart-axis: #9A9DA6; --spark: #7C6CF6; --dim: #D6D6D2; --tick-bg: #E9EBF0;
  --s1: #F5651B; --s2: #7C6CF6; --s3: #2FB57C; --s4: #4F7DF3;
  --g-cannabis: #2FB57C; --g-hardware: #4F7DF3; --g-legal: #7C6CF6; --g-holdings: #F5651B;
  --rail: 232px; --topbar-h: 56px;
}

/* ------------------------------------------------------------------ base -- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 13px/1.5 var(--sans); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
h1, h2, h3, p, dl, dd { margin: 0; }
::selection { background: rgba(120,120,140,.25); }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; }
svg.ico { width: 15px; height: 15px; flex: none; }
.dim { color: var(--text-3); } .red { color: var(--red); } .good { color: var(--good); } .small { font-size: 11.5px; }
.sep { color: var(--text-3); opacity: .55; margin: 0 6px; }
.num { text-align: right; } th.num { text-align: right; }
.empty { padding: 36px 0; color: var(--text-3); font-size: 13px; }
.fade { animation: fade .22s ease-out; } @keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.lnk { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }

.app { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; }
.rail { background: var(--rail-bg); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; height: var(--topbar-h); display: flex; align-items: center; gap: 14px; padding: 0 28px; border-bottom: 1px solid var(--line); background: var(--topbar-bg); backdrop-filter: blur(10px); font-size: 12.5px; color: var(--text-3); }
.page { padding: 30px 32px 80px; max-width: 1400px; }
.sec { margin-top: 36px; }
.cols { display: grid; grid-template-columns: minmax(0,3fr) minmax(0,2fr); gap: 32px; }
.cols.even { grid-template-columns: 1fr 1fr; }
.themes { display: inline-flex; gap: 2px; border: 1px solid var(--line-2); border-radius: 999px; padding: 2px; background: var(--card-bg); }
.themes button { font-size: 11.5px; padding: 3px 10px; border-radius: 999px; color: var(--text-3); }
.themes button:hover { color: var(--text-2); }
.themes button.on { background: var(--text); color: var(--bg); font-weight: 500; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 5px 11px; border: 1px solid var(--line-2); border-radius: 6px; color: var(--text-2); line-height: 1.5; white-space: nowrap; background: var(--card-bg); }
.btn:hover { color: var(--text); border-color: var(--text-3); }
.btn.primary { background: var(--btn-primary-bg); color: var(--btn-primary-fg); border-color: var(--btn-primary-bg); font-weight: 500; }
.btn.primary:hover { opacity: .9; }
.btn.text { border: 0; padding: 0; color: var(--text-3); background: none; }
.btn.text:hover { color: var(--text); }
.btn.pillb { border-radius: 999px; padding: 6px 13px; }
.btn.sm { padding: 3px 9px; font-size: 12px; }
.btn .ico { width: 13px; height: 13px; }
.ib { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line-2); border-radius: 7px; color: var(--text-2); background: var(--card-bg); }
.ib:hover { color: var(--text); border-color: var(--text-3); }
.ib.sq { border-radius: 8px; }

/* tables */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 500; font-size: 11.5px; color: var(--text-3); padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 13px; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--surface); }
.tbl .sub { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.tbl .last { padding-right: 0; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 7px 16px; font-size: 13px; }
.kv dt { color: var(--text-3); font-size: 12px; }
.watch { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: var(--text-2); }
.watch span::before { content: '— '; color: var(--text-3); }
.bar { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--text-2); } .bar i.red { background: var(--red); }

/* shared light primitives */
.ticks { display: flex; gap: 2px; align-items: stretch; }
.ticks i { flex: 1; border-radius: 1.5px; min-width: 0; }
.av { display: inline-grid; place-items: center; border-radius: 50%; font-size: 11px; font-weight: 600; letter-spacing: .02em; flex: none; }
.av.g { background: var(--surface); color: var(--text-3); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--text-2); background: var(--card-bg); white-space: nowrap; }
.chip .ico { width: 12px; height: 12px; color: var(--text-3); }
.chip.on { border-color: var(--text); color: var(--text); font-weight: 500; }
.chip.soft { border-color: transparent; background: var(--surface-2); border-radius: 999px; }
.chip.soft.on { background: var(--text); color: var(--bg); }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 500; padding: 1px 8px 1px 6px; border-radius: 999px; white-space: nowrap; }
.pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.green { background: #E6F6EE; color: #1B7F4F; } .pill.amber { background: #FEF3DC; color: #A86A00; } .pill.red { background: #FDE8E9; color: #C4303A; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.legend .lg i { width: 9px; height: 9px; border-radius: 2px; }
.d.up { color: var(--good); font-weight: 500; } .d.down { color: var(--red); font-weight: 500; }
.ecell { display: inline-flex; align-items: center; gap: 10px; }
.ecell .ticks { width: 90px; }
.ecell b { font-weight: 500; display: block; } .ecell small { display: block; font-size: 11.5px; color: var(--text-3); }
.chart { width: 100%; }

/* drawer */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .16s; }
.scrim.on { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 94vw); background: var(--rail-bg); border-left: 1px solid var(--line-2); z-index: 41; transform: translateX(100%); transition: transform .22s cubic-bezier(.3,.7,0,1); display: flex; flex-direction: column; }
.drawer.on { transform: none; }
.drawer-head { display: flex; align-items: center; padding: 14px 26px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--text-3); }
.drawer-head .x { margin-left: auto; font-size: 18px; color: var(--text-3); line-height: 1; } .drawer-head .x:hover { color: var(--text); }
.drawer-body { padding: 26px; overflow-y: auto; flex: 1; }
.drawer-body h2 { font-size: 17px; font-weight: 600; line-height: 1.35; margin: 10px 0 10px; }
.drawer-body p { color: var(--text-2); font-size: 13.5px; line-height: 1.6; margin-bottom: 20px; }
.drawer-foot { padding: 14px 26px; border-top: 1px solid var(--line); display: flex; gap: 8px; }
.drawer-foot .sp { margin-left: auto; }

/* ======================================================================= INK */
[data-theme="ink"] .rail { padding: 22px 0 18px; }
.wordmark { padding: 0 22px 26px; font-size: 12px; font-weight: 600; letter-spacing: .18em; }
.wordmark small { display: block; font-weight: 400; letter-spacing: 0; color: var(--text-3); font-size: 11.5px; margin-top: 2px; }
.nav { display: flex; flex-direction: column; padding: 0 12px; }
.nav-h { padding: 18px 10px 5px; font-size: 11px; color: var(--text-3); }
.nav a { display: flex; align-items: center; gap: 9px; padding: 5px 10px; color: var(--text-2); font-size: 13px; border-left: 1px solid transparent; margin-left: -1px; }
.nav a:hover { color: var(--text); }
.nav a.on { color: var(--text); font-weight: 500; border-left-color: var(--text); }
.nav a .n { margin-left: auto; font-size: 11.5px; color: var(--text-3); } .nav a .n.red { color: var(--red); }
.rail-foot { margin-top: auto; padding: 0 22px; font-size: 11.5px; color: var(--text-3); line-height: 1.7; }
[data-theme="ink"] .topbar { padding: 0 40px; }
[data-theme="ink"] .topbar b { color: var(--text-2); font-weight: 500; }
[data-theme="ink"] .topbar .right { margin-left: auto; display: flex; align-items: center; gap: 18px; }
[data-theme="ink"] .page { padding: 34px 40px 80px; max-width: 1360px; }
[data-theme="ink"] .cols { gap: 48px; }
.eyebrow { font-size: 12px; color: var(--text-3); margin-bottom: 8px; }
[data-theme="ink"] h1 { font-size: 21px; font-weight: 600; letter-spacing: -.01em; line-height: 1.25; }
[data-theme="ink"] .lede { font-size: 13.5px; color: var(--text-2); margin-top: 6px; max-width: 720px; }
.head { display: flex; align-items: flex-end; gap: 20px; margin-bottom: 30px; }
.head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
[data-theme="ink"] .sec { margin-top: 44px; }
.sec-h { display: flex; align-items: baseline; gap: 12px; padding-bottom: 9px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.sec-h h2 { font-size: 13px; font-weight: 600; } .sec-h .m { color: var(--text-3); font-size: 12px; } .sec-h .r { margin-left: auto; font-size: 12px; color: var(--text-3); } .sec-h .r:hover { color: var(--text); }
.card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius); }
.card.pad { padding: 12px 0 8px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); }
.stat { padding: 4px 24px 6px 0; }
.stat + .stat { border-left: 1px solid var(--line); padding-left: 24px; }
.stat .l { font-size: 12px; color: var(--text-2); } .stat .v { font-size: 27px; font-weight: 500; letter-spacing: -.02em; margin-top: 6px; line-height: 1.15; }
.stat .m { font-size: 12px; color: var(--text-3); margin-top: 5px; } .stat .m b { color: var(--text-2); font-weight: 500; } .stat .g { margin-top: 12px; }
.item { display: grid; grid-template-columns: 10px minmax(0,1fr) auto; gap: 0 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; } .item.click { cursor: pointer; } .item.click:hover .t { color: #fff; }
.mk { width: 6px; height: 6px; border-radius: 50%; margin-top: 7px; background: var(--line-2); } .mk.s1 { background: var(--red); } .mk.s2 { background: var(--text-2); } .mk.s3 { background: transparent; border: 1px solid var(--line-2); }
.item .t { font-size: 13.5px; font-weight: 500; line-height: 1.4; } .item .d { font-size: 12.5px; color: var(--text-2); margin-top: 3px; line-height: 1.5; max-width: 66ch; }
.item .meta { font-size: 11.5px; color: var(--text-3); margin-top: 6px; }
.item .rt { text-align: right; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.item .rt .money { font-size: 13.5px; color: var(--text); display: block; } .item .rt .due { display: block; margin-top: 2px; } .item .rt .due.hot { color: var(--red); } .item .rt .act { display: inline-block; margin-top: 8px; }
.item .rt .strong { color: var(--text-2); }
.item.done .t { color: var(--text-3); text-decoration: line-through; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.tile { background: var(--bg); padding: 16px 18px 14px; display: block; } .tile:hover { background: var(--surface); }
.tile .top { display: flex; align-items: flex-start; gap: 10px; } .tile .top > div:first-child { min-width: 0; }
.tile .name { font-size: 14px; font-weight: 500; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .sub { font-size: 11.5px; color: var(--text-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .spark { margin-left: auto; margin-top: 2px; }
.tile .cash { font-size: 21px; font-weight: 500; letter-spacing: -.02em; margin-top: 12px; line-height: 1.1; } .tile .cash small { font-size: 12px; font-weight: 400; color: var(--text-3); margin-left: 6px; }
.tile .foot { display: flex; font-size: 11.5px; color: var(--text-3); margin-top: 12px; } .tile .foot .r { margin-left: auto; }
.mini { display: flex; gap: 28px; margin-top: 12px; } .mini div { font-size: 12px; color: var(--text-3); } .mini b { display: block; color: var(--text); font-weight: 500; font-size: 14px; margin-top: 1px; }
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.tab { padding: 0 0 9px; font-size: 13px; color: var(--text-3); border-bottom: 1.5px solid transparent; margin-bottom: -1px; } .tab.on { color: var(--text); border-bottom-color: var(--text); } .tab .n { margin-left: 5px; font-size: 11px; color: var(--text-3); }
.filters { display: flex; gap: 18px; font-size: 12.5px; flex-wrap: wrap; } .filters button { color: var(--text-3); } .filters button.on { color: var(--text); font-weight: 500; } .filters .n { color: var(--text-3); margin-left: 4px; font-size: 11.5px; }
.note { font-size: 12.5px; color: var(--text-2); line-height: 1.55; padding: 10px 12px; background: var(--surface); border-radius: 6px; } .note b { color: var(--text); font-weight: 500; } .note.red b { color: var(--red); }

/* ===================================================================== PAPER */
[data-theme="paper"] .rail { align-items: center; padding: 12px 0; }
.p-logo { width: 34px; height: 34px; border-radius: 9px; background: #16171A; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; margin-bottom: 14px; }
.p-nav { display: flex; flex-direction: column; gap: 4px; }
.p-nav a { position: relative; width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: var(--text-3); }
.p-nav a:hover { color: var(--text); background: var(--surface); }
.p-nav a.on { color: var(--text); background: var(--surface-2); }
.p-nav a .ico { width: 16px; height: 16px; }
.p-nav a .dot { position: absolute; top: 7px; right: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--red); border: 1.5px solid #fff; }
.p-rail-foot { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--text-3); }
.p-avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg,#F5A0C4,#7C6CF6); color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 600; }
[data-theme="paper"] .topbar { padding: 0 20px; gap: 18px; }
.p-title { display: flex; flex-direction: column; line-height: 1.2; min-width: 180px; }
.p-title b { color: var(--text); font-size: 14px; font-weight: 600; } .p-title span { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.p-search { flex: 1; max-width: 480px; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 6px 0 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text-3); }
.p-search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; font-size: 12.5px; } .p-search input::placeholder { color: var(--text-3); }
.p-search.sm { height: 30px; max-width: 260px; }
.p-scope { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; padding: 3px 8px; border-radius: 6px; background: #fff; border: 1px solid var(--line); color: var(--text-2); white-space: nowrap; }
.p-scope .ico { width: 12px; height: 12px; }
.p-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
[data-theme="paper"] .page { padding: 22px 22px 80px; }
.p-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.p-head > div:first-child { display: flex; align-items: center; gap: 12px; }
.p-head h1 { font-size: 16px; font-weight: 600; } .p-head .lede { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.p-head .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.pcard { background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.pcard.list { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.pcard.table { padding: 4px 14px; }
.pcard.pad { padding: 14px 16px; }
.p-stats { display: grid; gap: 12px; }
.pstat { padding: 12px 14px 12px; }
.ps-h { display: flex; align-items: center; gap: 9px; color: var(--text-2); }
.ps-h .l { font-size: 13px; font-weight: 500; color: var(--text); } .ps-h .kb { margin-left: auto; color: var(--text-3); }
.ps-v { font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin-top: 12px; line-height: 1.1; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ps-v .cap { font-size: 12.5px; font-weight: 400; color: var(--text-3); letter-spacing: 0; }
.ps-f { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3); }
.ps-f .ticks { width: 76px; flex: none; } .ps-f .ft { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .ps-f .d { margin-right: 6px; }
.p-sech { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px; }
.p-sech h2 { font-size: 13.5px; font-weight: 600; } .p-sech .m { font-size: 12px; color: var(--text-3); }
.p-sech .r { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; font-size: 12px; color: var(--text-2); } .p-sech .r .ico { width: 12px; height: 12px; }
.prow { border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.prow.x { border-color: var(--line-2); box-shadow: 0 2px 10px -6px rgba(0,0,0,.15); }
.prow-main { display: grid; grid-template-columns: 22px minmax(0,1fr) auto auto; gap: 12px; align-items: center; padding: 10px 10px 10px 12px; }
.prow-main.click { cursor: pointer; }
.p-ic { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; }
.p-ic .ico { width: 16px; height: 16px; }
.p-ic.crit { color: var(--red); } .p-ic.today { color: #B7791F; } .p-ic.ok { color: #22A06B; } .p-ic.rev { color: var(--text-3); }
.prow-body { min-width: 0; }
.prow-title { font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 8px; min-width: 0; }
.prow-title .tt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow-money { font-weight: 600; color: var(--text); }
.prow-detail { font-size: 12px; color: var(--text-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 62ch; }
.prow-body .chips { margin-top: 7px; }
.prow-metrics { display: grid; grid-template-columns: repeat(2, minmax(88px, auto)); gap: 4px 18px; padding: 0 6px 0 14px; border-left: 1px solid var(--line); }
.pm { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.pm .ico { width: 12px; height: 12px; color: var(--text-3); } .pm b { font-weight: 500; color: var(--text); } .pm span { color: var(--text-3); font-size: 11.5px; }
.pm.hot b { color: var(--red); }
.prow-acts { display: flex; gap: 6px; }
.prow.done .prow-title { color: var(--text-3); text-decoration: line-through; }
.prow-x { display: grid; grid-template-columns: 300px minmax(0,1fr); gap: 20px; padding: 4px 14px 14px 46px; border-top: 1px dashed var(--line); margin: 0 10px; align-items: start; padding-top: 12px; }
.p-insight { background: #F6F3FF; border: 1px solid #E5DEFB; border-radius: 9px; padding: 10px 12px; }
.pi-t { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: #6B4FE0; } .pi-t .ico { width: 13px; height: 13px; }
.pi-tag { margin-left: auto; font-size: 10.5px; font-weight: 500; color: #8B76E6; background: #EDE8FF; padding: 1px 7px; border-radius: 999px; }
.pi-b { font-size: 12.5px; color: var(--text-2); line-height: 1.5; margin-top: 6px; }
.pi-a { display: flex; gap: 6px; margin-top: 10px; }
.stepper { display: flex; align-items: flex-start; padding-top: 4px; }
.step { position: relative; flex: 1; min-width: 0; }
.step .sc { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 1.5px solid var(--line-2); color: var(--text-3); position: relative; z-index: 1; }
.step .sc .ico { width: 13px; height: 13px; }
.step.ok .sc { border-color: #22A06B; color: #22A06B; background: #E6F6EE; }
.step .sl { position: absolute; top: 11px; left: 26px; right: 4px; border-top: 1.5px dotted var(--line-2); }
.step.ok .sl { border-top-color: #22A06B; }
.sl-l { font-size: 11px; color: var(--text-3); margin-top: 6px; } .sl-v { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 8px; }
.pc-h { display: flex; align-items: center; gap: 10px; padding: 12px 14px 8px; }
.pc-h h3 { font-size: 13.5px; font-weight: 600; } .pc-h .m { display: block; font-size: 12px; color: var(--text-3); } .pc-h .chip { margin-left: auto; } .pc-h .kb { margin-left: auto; color: var(--text-3); }
.pcard .legend { padding: 0 14px 6px; } .pcard .chart { padding: 0 8px; }
.pc-strip { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); margin-top: 6px; }
.pc-strip div { padding: 10px 14px; font-size: 11.5px; color: var(--text-3); border-left: 1px solid var(--line); } .pc-strip div:first-child { border-left: 0; }
.pc-strip b { display: block; font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 1px; }
.p-tiles { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.ptile { display: block; padding: 12px 14px; }
.ptile:hover { border-color: var(--line-2); }
.pt-h { display: flex; align-items: center; gap: 10px; } .pt-h > div { min-width: 0; }
.pt-h .n { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .pt-h .s { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-h .ar { margin-left: auto; color: var(--text-3); }
.pt-v { display: flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin-top: 12px; }
.pt-v span { font-size: 11.5px; font-weight: 400; color: var(--text-3); } .pt-v svg { margin-left: auto; }
.pt-f { display: flex; align-items: center; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--text-3); } .pt-f .r { margin-left: auto; }
.pseg { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border-radius: 8px; }
.pseg a, .pseg button { padding: 4px 11px; border-radius: 6px; font-size: 12.5px; color: var(--text-2); }
.pseg .on { background: #fff; color: var(--text); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.pseg .n { margin-left: 5px; font-size: 11px; color: var(--text-3); }
.p-toolbar { display: flex; align-items: center; gap: 16px; }
.p-strip { flex: 1; } .p-strip .ticks { margin-bottom: 6px; } .p-strip .legend { font-size: 11.5px; }
.pnote { display: flex; gap: 10px; font-size: 12.5px; color: var(--text-2); line-height: 1.55; padding: 10px 12px; background: var(--surface); border-radius: 8px; border: 1px solid var(--line); margin-bottom: 14px; }
.pnote .ico { flex: none; margin-top: 2px; color: var(--text-3); } .pnote.red { background: #FDF1F2; border-color: #F8D2D5; } .pnote.red .ico { color: var(--red); } .pnote b { font-weight: 600; color: var(--text); }
[data-theme="paper"] .drawer-body h2 { font-size: 16px; }

/* ===================================================================== CLOUD */
[data-theme="cloud"] .rail { padding: 16px 12px; }
.c-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; }
.c-mark { width: 32px; height: 32px; border-radius: 9px; background: #17181C; color: #fff; display: grid; place-items: center; }
.c-mark .ico { width: 16px; height: 16px; }
.c-brand b { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.c-collapse { margin-left: auto; width: 22px; height: 22px; border: 1px solid var(--line-2); border-radius: 6px; display: grid; place-items: center; color: var(--text-3); background: #fff; }
.c-collapse .ico { width: 11px; height: 11px; }
.c-nav-h { font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 0 10px 8px; }
.c-nav { display: flex; flex-direction: column; gap: 2px; }
.c-nav a { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text-2); font-size: 13.5px; }
.c-nav a:hover { background: var(--surface); color: var(--text); }
.c-nav a.on { background: #EFEFED; color: var(--text); font-weight: 500; }
.c-nav a.on::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #17181C; }
.c-nav a .ico { width: 16px; height: 16px; color: var(--text-2); } .c-nav a.on .ico { color: var(--text); }
.c-nav a em { margin-left: auto; font-style: normal; font-size: 11.5px; color: var(--text-3); } .c-nav a em.red { color: var(--red); font-weight: 600; }
.c-nav-sep { height: 1px; background: var(--line); margin: 14px 4px; }
[data-theme="cloud"] .topbar { padding: 0 24px; }
.c-crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); }
.c-crumbs .ico { width: 14px; height: 14px; } .c-crumbs b { color: var(--text); font-weight: 500; }
.c-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
[data-theme="cloud"] .page { padding: 24px 24px 80px; }
.c-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.c-head-l { display: flex; align-items: center; gap: 12px; }
.c-tico { width: 36px; height: 36px; border-radius: 9px; background: #17181C; color: #fff; display: grid; place-items: center; flex: none; }
.c-tico .ico { width: 17px; height: 17px; }
.c-head h1 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; } .c-head .lede { font-size: 12.5px; color: var(--text-3); margin-top: 1px; }
.c-head .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.ccard { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.ccard.list { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.ccard.table { padding: 4px 16px; }
.ccard.pad { padding: 16px 18px; }
.c-stats { display: grid; padding: 4px 0; }
.cstat { padding: 14px 18px; border-left: 1px solid var(--line); }
.cstat:first-child { border-left: 0; }
.cs-h { display: flex; align-items: center; gap: 8px; } .cs-h .l { font-size: 13px; color: var(--text-2); } .cs-h .kb { margin-left: auto; color: var(--text-3); }
.cs-h .ico { width: 16px; height: 16px; }
.cs-v { font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin-top: 8px; line-height: 1.1; }
.cs-g { margin-top: 12px; } .cs-m { font-size: 12px; color: var(--text-3); margin-top: 10px; }
.c-sech { display: flex; align-items: flex-end; gap: 10px; margin: 0 0 12px; }
.c-sech h2 { font-size: 15px; font-weight: 600; } .c-sech .m { display: block; font-size: 12px; color: var(--text-3); margin-top: 1px; }
.c-sech .r { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; font-size: 12.5px; color: var(--text-2); padding: 4px 10px; border: 1px solid var(--line-2); border-radius: 999px; background: #fff; }
.c-sech .r .ico { width: 12px; height: 12px; }
.c-h3 { font-size: 15px; font-weight: 600; } .c-sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.ccard .legend { margin: 12px 0 6px; }
.crow { display: grid; grid-template-columns: 36px minmax(0,1fr) auto 14px; gap: 12px; align-items: center; padding: 12px 12px 12px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.crow.click { cursor: pointer; } .crow.click:hover { border-color: var(--line-2); background: #FCFCFB; }
.cr-t { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cr-d { font-size: 12.5px; color: var(--text-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70ch; }
.cr-m { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.cr-bar { position: relative; height: 5px; background: var(--surface-2); border-radius: 3px; margin-top: 10px; overflow: visible; }
.cr-bar i { display: block; height: 100%; border-radius: 3px; }
.cr-bar .ring { position: absolute; left: -2px; top: -4px; width: 13px; height: 13px; border-radius: 50%; background: #fff; border: 2px solid; }
.cr-r { text-align: right; font-size: 12px; color: var(--text-3); display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.cr-r b { font-size: 13.5px; color: var(--text); font-weight: 600; }
.crow .ch { color: var(--text-3); }
.crow.done .cr-t { color: var(--text-3); text-decoration: line-through; }
.c-tiles { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.ctile { display: block; padding: 14px 16px; }
.ctile:hover { border-color: var(--line-2); }
.ct-h { display: flex; align-items: center; gap: 10px; } .ct-h > div { min-width: 0; }
.ct-h .n { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .ct-h .s { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-h .kb { margin-left: auto; color: var(--text-3); }
.ct-v { font-size: 24px; font-weight: 600; letter-spacing: -.02em; margin: 12px 0 10px; }
.ct-f { display: flex; align-items: center; gap: 4px; margin-top: 10px; font-size: 12px; } .ct-f .r { margin-left: auto; color: var(--text-3); }
.cseg { display: inline-flex; gap: 4px; padding: 3px; background: #fff; border: 1px solid var(--line); border-radius: 999px; }
.cseg a, .cseg button { padding: 4px 12px; border-radius: 999px; font-size: 12.5px; color: var(--text-2); }
.cseg .on { background: #17181C; color: #fff; font-weight: 500; }
.cseg .n { margin-left: 5px; font-size: 11px; opacity: .7; }
.c-toolbar { margin-bottom: 14px; }
.cnote { display: flex; gap: 10px; font-size: 12.5px; color: var(--text-2); line-height: 1.55; padding: 10px 12px; background: var(--surface); border-radius: 10px; margin-bottom: 14px; }
.cnote .ico { flex: none; margin-top: 2px; color: var(--text-3); } .cnote.red { background: #FDF1F2; } .cnote.red .ico { color: var(--red); } .cnote.insight { background: #F3F0FF; } .cnote.insight .ico { color: #7C6CF6; } .cnote b { font-weight: 600; color: var(--text); }
[data-theme="cloud"] .drawer-body h2 { font-size: 16px; }

/* ------------------------------------------------------------ responsive -- */
@media (max-width: 1200px) {
  .stats, .p-stats, .c-stats { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
  .stat:nth-child(3) { border-left: 0; padding-left: 0; } .stat:nth-child(n+3) { margin-top: 20px; }
  .cstat:nth-child(3) { border-left: 0; }
  .cols, .cols.even { grid-template-columns: 1fr; gap: 32px; }
  .tiles, .p-tiles, .c-tiles { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .prow-metrics { display: none; }
}
/* ------------------------------------------------------------- mobile ----- */
#mbar { display: none; }
@media (max-width: 800px) {
  .app { grid-template-columns: 1fr; }
  .rail { display: none; }
  body:not(.wall-mode) { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }

  /* bottom tab bar */
  body:not(.wall-mode) #mbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--rail-bg); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  }
  #mbar a, #mbar button {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 4px 0 2px; color: var(--text-3); font-size: 10px; line-height: 1; border-radius: 8px;
  }
  #mbar .ico { width: 19px; height: 19px; }
  #mbar .on { color: var(--text); font-weight: 600; }
  #mbar em {
    position: absolute; top: 0; left: calc(50% + 4px); font-style: normal;
    background: var(--red); color: #fff; font-size: 9px; font-weight: 600;
    padding: 1px 4.5px; border-radius: 999px; line-height: 1.3;
  }

  /* More sheet */
  .msheet-h { font-size: 11px; color: var(--text-3); padding: 14px 2px 4px; }
  .msheet-item { display: flex; align-items: center; gap: 12px; padding: 11px 2px; font-size: 14.5px; border-bottom: 1px solid var(--line); }
  .msheet-item:last-child { border-bottom: 0; }
  .msheet-item .ico { width: 17px; height: 17px; color: var(--text-3); }
  .msheet-item em { margin-left: auto; font-style: normal; font-size: 12px; color: var(--text-3); }
  .msheet-item em.red { color: var(--red); font-weight: 600; }

  /* layout compaction */
  .page { padding: 18px 16px 40px !important; max-width: none; }
  .topbar { padding: 0 16px !important; height: 44px; }
  .topbar .right span:first-child, .topbar .themes, .p-search, .p-actions .btn:not(.primary), .c-right > .dim { display: none; }
  h1, .c-head h1, .p-head h1 { font-size: 17px; }
  .lede { font-size: 12.5px; }
  .head, .p-head, .c-head { flex-wrap: wrap; margin-bottom: 20px; }
  .head .right, .p-head .right, .c-head .right { margin-left: 0; }
  .sec { margin-top: 30px !important; }
  .stats, .p-stats, .c-stats { grid-template-columns: 1fr 1fr !important; gap: 10px; }
  .stat { border-left: 0 !important; padding-left: 0 !important; }
  [data-theme="ink"] .stats { gap: 16px 20px; }
  .stat .v, .ps-v, .cs-v { font-size: 20px; }
  .cstat { border-left: 0; padding: 12px 14px; }
  .tiles, .p-tiles, .c-tiles { grid-template-columns: 1fr; }
  .cols, .cols.even { grid-template-columns: minmax(0,1fr); gap: 26px; }
  .tabs, .pseg, .cseg, .filters { overflow-x: auto; max-width: 100%; flex-wrap: nowrap; scrollbar-width: none; padding-bottom: 2px; }
  .tabs::-webkit-scrollbar, .pseg::-webkit-scrollbar, .cseg::-webkit-scrollbar, .filters::-webkit-scrollbar { display: none; }
  .tabs .tab, .pseg a, .pseg button, .cseg a, .cseg button, .filters button { flex: none; white-space: nowrap; }
  .chips { max-width: 100%; }

  /* rows: give right side room, hide secondary chrome */
  .prow-main { grid-template-columns: 20px minmax(0,1fr) auto; }
  .prow-acts { display: none; }
  .prow-x { grid-template-columns: 1fr; padding-left: 14px; }
  .stepper { display: none; }
  .crow { grid-template-columns: 30px minmax(0,1fr) auto; }
  .crow .ch { display: none; }
  .crow .av { width: 30px !important; height: 30px !important; }
  .item .d, .prow-detail, .cr-d { max-width: none; }

  /* tables scroll inside their card, never the page */
  .card.table, .pcard.table, .ccard.table, .scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .card.table .tbl, .pcard.table .tbl, .ccard.table .tbl { min-width: 560px; }
  .tbl th, .tbl td { white-space: nowrap; }
  .tbl td { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }

  /* drawer becomes a full sheet */
  .drawer { width: 100vw; border-left: 0; }
  .drawer-body { padding: 20px 18px; }
  .drawer-foot { flex-wrap: wrap; }

  /* wall on a phone: single column, natural height */
  .wall { height: auto; overflow: visible; font-size: 12px; padding: 14px 14px 20px; }
  .wall-grid { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-rows: auto; }
  .wall-stats { display: none; }

  .gmail-bar { flex-direction: column; align-items: flex-start; }
  .gmail-bar .sp { display: none; }
  .gsetup-inline { width: 100%; }
  .gsetup-row { flex-direction: column; }
  .mini { flex-wrap: wrap; gap: 14px 22px; }
  .pc-strip { grid-template-columns: repeat(2, 1fr); }
  .pc-strip div:nth-child(3) { border-left: 0; }
}

/* ---------------------------------------------------------------- wall ---- */
/* Everything inside .wall is em-based; the root em scales with viewport height so 12 cards fit any screen. */
body.wall-mode .app { grid-template-columns: 1fr; }
body.wall-mode .rail, body.wall-mode .topbar { display: none; }

/* -- Access gate (full-screen sign-in over the cockpit backdrop) -------- */
#cockpit-bg { position: fixed; inset: 0; z-index: 0; display: none !important; pointer-events: none; }
body.gated #cockpit-bg { display: block !important; }
.gate {
  /* force a light palette so the white login reads in any app theme */
  --bg: #fff; --text: #141414; --text-2: #5B5D66; --text-3: #8A8C96;
  --line: #E6E6E8; --line-2: #D9D9DC; --card-bg: #fff; --card-border: #E6E6E8;
  --btn-primary-bg: #141414; --btn-primary-fg: #fff; --radius: 12px; --shadow: 0 1px 2px rgba(16,17,20,.05);
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: transparent;
}
.gate-card { position: relative; width: 100%; max-width: 400px; text-align: center; }
.gate-brand { font-size: 30px; font-weight: 700; letter-spacing: .34em; color: var(--text); text-indent: .34em; text-shadow: 0 0 16px rgba(255,255,255,.95), 0 0 34px rgba(255,255,255,.8); }
.gate-sub { margin: 7px 0 26px; color: var(--text-2); font-size: 12.5px; letter-spacing: .02em; text-shadow: 0 0 12px #fff, 0 0 24px rgba(255,255,255,.9); }
.gate .pcard, .gate .card { background: #fff; border: 1px solid #E6E6E8; border-radius: 12px; box-shadow: 0 10px 30px -14px rgba(16,17,20,.22); }
.gate .pcard.pad, .gate .card.pad { padding: 16px 16px 14px; }
.gate .gmail-bar { flex-direction: column; align-items: stretch; gap: 12px; text-align: left; }
.gate .gmail-bar .sp { display: none; }
.gate .gmail-bar .gsetup-inline { width: 100% !important; box-sizing: border-box; }
.gate .gmail-bar .btn { justify-content: center; width: 100%; }
.gate-load { display: flex; gap: 8px; align-items: center; justify-content: center; color: var(--text-2); padding: 18px; text-shadow: 0 0 12px #fff; }
body.gated #agentfab, body.gated #mbar, body.gated .rail, body.gated .topbar, body.gated .agentcol { display: none !important; }
.wall { height: 100vh; display: flex; flex-direction: column; padding: 1.2em 1.6em 1.3em; font-size: clamp(9px, 1.22vh, 13.5px); overflow: hidden; }
.wall-h { display: flex; align-items: center; gap: 2.8em; padding-bottom: .9em; margin-bottom: .9em; border-bottom: 1px solid var(--line); }
.wall-brand { font-size: 1em; font-weight: 600; letter-spacing: .18em; }
.wall-brand span { display: block; letter-spacing: 0; font-weight: 400; color: var(--text-3); font-size: .92em; margin-top: .1em; }
.wall-stats { display: flex; gap: 2.8em; }
.wall-stats div span { display: block; font-size: .88em; color: var(--text-3); }
.wall-stats div b { font-size: 1.55em; font-weight: 500; letter-spacing: -.02em; }
.wall-stats i { font-style: normal; font-size: .62em; font-weight: 400; }
.wall-h > .btn { margin-left: auto; font-size: .92em; }
.wall-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); grid-template-rows: repeat(3, minmax(0,1fr)); gap: .75em; }
.wcard { display: flex; flex-direction: column; background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius); padding: .85em 1.05em .75em; min-height: 0; overflow: hidden; box-shadow: var(--shadow); }
[data-theme="ink"] .wcard, :root:not([data-theme]) .wcard { background: var(--surface); }
.wcard:hover { border-color: var(--line-2); }
.wc-top { display: flex; align-items: flex-start; gap: .7em; }
.wc-top > div:first-child { min-width: 0; }
.wc-name { font-size: 1.08em; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-sub { font-size: .86em; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-badge { margin-left: auto; font-size: .86em; color: var(--text-2); border: 1px solid var(--line-2); border-radius: 1em; padding: .05em .6em; flex: none; }
.wc-badge.red { color: var(--red); border-color: var(--red); }
.wc-cash { display: flex; align-items: flex-end; gap: .9em; margin-top: .55em; }
.wc-cash span { display: block; font-size: .84em; color: var(--text-3); }
.wc-cash b { display: block; font-size: 1.7em; font-weight: 500; letter-spacing: -.02em; line-height: 1.1; margin-top: .05em; }
.wc-cash i { font-style: normal; font-size: .84em; color: var(--text-3); }
.wc-cash svg { margin-left: auto; margin-bottom: .3em; width: 6.5em; height: 1.9em; }
.wc-rows { margin-top: .5em; flex: 1; min-height: 0; overflow: hidden; }
.wr { display: flex; justify-content: space-between; gap: .9em; padding: .26em 0; border-top: 1px solid var(--line); font-size: .92em; }
.wr span { color: var(--text-3); white-space: nowrap; }
.wr b { font-weight: 500; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wr b i { font-style: normal; color: var(--text-3); font-weight: 400; margin-left: .3em; }
.wr b.red { color: var(--red); }
.wr b.good { color: var(--good); }
.wr b.dim { color: var(--text-3); font-weight: 400; }
.wr b.strong { color: var(--text); }
.wc-foot { display: flex; align-items: flex-start; gap: .6em; margin-top: .5em; padding-top: .55em; border-top: 1px solid var(--line); font-size: .88em; color: var(--text-2); line-height: 1.35; }
.wc-foot .mk { margin-top: .4em; flex: none; width: .5em; height: .5em; }
.wc-foot span:last-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
@media (max-width: 1100px) and (min-width: 801px) { .wall { height: auto; overflow: visible; font-size: 12px; } .wall-grid { grid-template-columns: repeat(2, minmax(0,1fr)); grid-template-rows: none; grid-auto-rows: auto; } .wall-stats { display: none; } }

/* --------------------------------------------------------- gmail connect -- */
.gmail-bar { display: flex; align-items: center; gap: 8px; font-size: 13px; flex-wrap: wrap; }
.gmail-bar .sp { margin-left: auto; }
.gmail-bar b { font-weight: 600; }
.livedot { width: 8px; height: 8px; border-radius: 50%; background: #2FB57C; box-shadow: 0 0 0 3px rgba(47,181,124,.18); flex: none; }
.livedot.amber { background: #E5A93F; box-shadow: 0 0 0 3px rgba(229,169,63,.18); animation: lp 1.2s ease-in-out infinite; }
@keyframes lp { 50% { opacity: .4; } }
.gmail-setup { font-size: 13px; line-height: 1.6; }
.gmail-setup b { font-weight: 600; }
.gmail-setup code { font-family: var(--mono); font-size: 11.5px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.gsetup-row { display: flex; gap: 8px; margin: 10px 0 6px; }
.gsetup-row input { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12px; padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--card-bg); color: var(--text); outline: none; }
.gsetup-row input:focus { border-color: var(--text-3); }
[data-theme="ink"] .gmail-bar, :root:not([data-theme]) .gmail-bar { padding: 10px 0; }
.gsetup-inline { width: 190px; font-family: var(--mono); font-size: 12px; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--card-bg); color: var(--text); outline: none; }
.gsetup-inline:focus { border-color: var(--text-3); }

/* entity strip on Today + attachment chips */
.estrip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 14px; margin-bottom: 18px; scrollbar-width: none; }
.estrip::-webkit-scrollbar { display: none; }
.echip { display: inline-flex; align-items: center; gap: 8px; flex: none; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card-bg); font-size: 12.5px; }
[data-theme="ink"] .echip, :root:not([data-theme]) .echip { background: var(--surface); }
.echip:hover { border-color: var(--line-2); }
.echip b { font-weight: 550; }
.echip span { color: var(--text-3); font-size: 12px; }
.edot { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); flex: none; }
.edot.red-bg { background: var(--red); }
.edot.warn-bg { background: #E5A93F; }
.att-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.att-row .chip { cursor: pointer; }
.att-row .chip:hover { border-color: var(--text-3); }

/* entity picker (topbar) + attachment preview */
.entmenu-wrap { position: relative; display: inline-flex; }
.entpick { border-radius: 999px; padding: 5px 12px; font-size: 12.5px; gap: 6px; cursor: pointer; }
.entpick .ico { width: 13px; height: 13px; }
.entmenu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; min-width: 250px;
  background: var(--rail-bg); border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: 0 12px 40px -12px rgba(0,0,0,.45); padding: 6px; display: none; max-height: 70vh; overflow-y: auto;
}
.entmenu.on { display: block; }
.entmenu-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.entmenu-item:hover { background: var(--surface); }
.entmenu-item.on { background: var(--surface-2); font-weight: 600; }
.entmenu-item em { margin-left: auto; font-style: normal; color: var(--text-3); font-size: 12px; }
.entmenu-item .ico { width: 14px; height: 14px; color: var(--text-3); }
.echip.on { border-color: var(--text); }
[data-theme="cloud"] .echip.on, [data-theme="paper"] .echip.on { background: var(--text); color: var(--bg); }
[data-theme="cloud"] .echip.on b, [data-theme="paper"] .echip.on b, [data-theme="cloud"] .echip.on span, [data-theme="paper"] .echip.on span { color: inherit; }
.echip { cursor: pointer; }

.attprev { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.6); display: none; align-items: center; justify-content: center; padding: 4vh 4vw; }
.attprev.on { display: flex; }
.attprev-panel { width: min(980px, 100%); height: 100%; background: var(--rail-bg); border: 1px solid var(--line-2); border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; }
.attprev-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.attprev-head .sp { margin-left: auto; }
.attprev-body { flex: 1; min-height: 0; background: var(--surface); display: flex; align-items: center; justify-content: center; }
.attprev-body iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.attprev-body img { max-width: 100%; max-height: 100%; object-fit: contain; }
@media (max-width: 800px) { .attprev { padding: 0; } .attprev-panel { border-radius: 0; } .entmenu { right: -40px; } }
.mailbody { margin: 4px 0 14px; }
.mailframe { width: 100%; height: 320px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

/* ------------------------------------------------- mobile Today, calmer --- */
.msummary {
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr));
  border: 1px solid var(--line); border-radius: var(--radius, 10px);
  background: var(--card-bg); overflow: hidden;
}
[data-theme="ink"] .msummary, :root:not([data-theme]) .msummary { background: var(--surface); border-radius: 10px; }
.msum { padding: 10px 4px 11px; text-align: center; border-left: 1px solid var(--line); min-width: 0; }
.msum:first-child { border-left: 0; }
.msum span { display: block; font-size: 10.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
.msum b { display: block; font-size: 15.5px; font-weight: 600; letter-spacing: -.01em; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
.msum b.red { color: var(--red); }

@media (max-width: 800px) {
  /* Today: fewer moving parts */
  .head .right { display: none; }                      /* bottom bar covers the queue */
  .estrip { padding-bottom: 10px; margin-bottom: 14px; gap: 6px; }
  .echip { padding: 6px 11px; }
  .echip span { display: none; }                       /* names only, no cash values */
  .echip .edot { width: 5px; height: 5px; }
  h1 { line-height: 1.3; }

  /* feed rows: title + one detail line; meta collapses to a single truncated line, no buttons */
  .item .meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .item .rt .act { display: none; }
  .item .rt .money { font-size: 12.5px; }
  .item .d { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .item .t { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .crow .cr-r .btn, .prow .btn.act { display: none; }
}

/* ---- wall: responsive overrides (must be LAST so they beat the base grid) - */
.wall-stats b { white-space: nowrap; }
.wall-stats i { white-space: nowrap; }
.wcard.wc-empty { opacity: .62; }
@media (min-width: 801px) and (max-width: 1280px) {
  .wall { height: auto; overflow: visible; font-size: 12.5px; }
  .wall-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); grid-template-rows: none; grid-auto-rows: auto; }
}
@media (max-width: 800px) {
  .wall { height: auto; overflow: visible; font-size: 13px; padding: 14px 14px calc(74px + env(safe-area-inset-bottom, 0px)); }
  .wall-grid { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-rows: auto; gap: 10px; }
  .wall-stats { display: none; }
  .wall-h { flex-wrap: wrap; gap: 10px; }
  .wcard.wc-empty { padding-bottom: 4px; }
  .wcard.wc-empty .wc-foot { display: none; }
}

/* plaid api-key form */
.plaid-form { display: grid; gap: 10px; margin-top: 12px; max-width: 460px; }
.plaid-form label { display: block; font-size: 12px; color: var(--text-3); }
.plaid-form input, .plaid-form select {
  display: block; width: 100%; margin-top: 4px; padding: 7px 10px;
  border: 1px solid var(--line-2); border-radius: 7px; background: var(--card-bg); color: var(--text);
  font: 13px var(--mono); outline: none;
}
.plaid-form select { font-family: var(--sans); }
.plaid-form input:focus, .plaid-form select:focus { border-color: var(--text-3); }
.plaid-form-actions { display: flex; gap: 8px; margin-top: 2px; }

/* ---- Sources v2 (by-entity) ---- */
.edot.good-bg { background: var(--good); }
.syschips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.syschip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-3); padding: 1px 8px 1px 6px; border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; }
.syschip::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--line-2); }
.syschip.good-bg::before { background: var(--good); }
.syschip.red-bg::before { background: var(--red); }
.syschip.warn-bg::before { background: #E5A93F; }
.srcrow .srcico { width: 14px; height: 14px; color: var(--text-3); margin-right: 7px; vertical-align: -2px; }
.mk.s3-live { background: var(--good); }
.src-ent-head { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.src-ent-head .btn { margin-left: auto; }
.rt .ico { width: 13px; height: 13px; color: var(--text-3); margin-left: 4px; vertical-align: -2px; }

/* entity multi-select menu */
.entpick.active { border-color: var(--accent); color: var(--text); font-weight: 500; }
.entmenu-item { width: 100%; text-align: left; background: none; cursor: pointer; }
.entmenu-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entcheck { width: 16px; height: 16px; border: 1px solid var(--line-2); border-radius: 4px; display: inline-grid; place-items: center; flex: none; }
.entcheck.on { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.entcheck .ico { width: 11px; height: 11px; }
.entmenu-go { margin-left: 2px; color: var(--text-3); display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; flex: none; opacity: 0; }
.entmenu-item:hover .entmenu-go { opacity: 1; }
.entmenu-go:hover { background: var(--surface-2); color: var(--text); }
.entmenu-go .ico { width: 13px; height: 13px; }
.entmenu-clear { justify-content: center; color: var(--text-3); font-size: 12.5px; border-top: 1px solid var(--line); margin-top: 4px; border-radius: 0; }
.entmenu-clear:hover { color: var(--text); }
/* grouped entity picker */
.entmenu-item + .entmenu-group, .entmenu-group + .entmenu-group { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); }
.entmenu-cat { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px 5px; border-radius: 8px; text-align: left; cursor: pointer; }
.entmenu-cat:hover { background: var(--surface); }
.entmenu-cat b { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); }
.entmenu-cat em { margin-left: auto; font-style: normal; font-size: 11.5px; color: var(--text-3); }
.ecat-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.entmenu-group .entmenu-item { padding-left: 18px; }
.entcheck.some { background: var(--accent); border-color: var(--accent); }
.entcheck.some i { width: 8px; height: 2px; border-radius: 1px; background: var(--bg); }
.entmenu-edit { color: var(--text-3); font-size: 12.5px; border-top: 1px solid var(--line); margin-top: 4px; border-radius: 0; }
.entmenu-edit:hover { color: var(--text); }
.entmenu-clear + .entmenu-edit { margin-top: 0; }
body:has(#drawer.on) #agentfab { display: none; }   /* the Ask LEO button would sit over drawer content */
/* category editor (drawer) */
.cat-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.cat-row { display: flex; align-items: center; gap: 8px; }
.cat-name { flex: 1; min-width: 0; height: 34px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--card-bg); color: var(--text); font: inherit; font-size: 13px; }
.cat-name:focus { outline: none; border-color: var(--text-3); }
.cat-ib { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; color: var(--text-3); flex: none; }
.cat-ib:hover:not([disabled]) { background: var(--surface); color: var(--text); }
.cat-ib[disabled] { opacity: .3; cursor: default; }
.cat-ib .ico { width: 14px; height: 14px; }
.cat-sub { margin: 22px 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.cat-ents { display: flex; flex-direction: column; }
.cat-ent { display: flex; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.cat-ent span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-ent select { height: 30px; max-width: 55%; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--card-bg); color: var(--text); font: inherit; font-size: 12.5px; }

/* ---- Ask LEO agent sidebar (inline column) ---- */
.agent-fab { position: fixed; right: 20px; bottom: 20px; z-index: 45; width: 52px; height: 52px; border-radius: 50%; background: var(--btn-primary-bg); color: var(--btn-primary-fg); display: grid; place-items: center; box-shadow: 0 8px 28px -8px rgba(0,0,0,.4); }
.agent-fab .ico { width: 22px; height: 22px; }
.agent-fab:hover { transform: translateY(-1px); }
/* inline: becomes a real third grid column that pushes content */
body.agent-open .app { grid-template-columns: var(--rail) minmax(0,1fr) 400px; }
.agentcol { display: none; }
body.agent-open .agentcol { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; background: var(--rail-bg); border-left: 1px solid var(--line); min-width: 0; }
.agent-head { display: flex; align-items: center; gap: 9px; padding: 0 16px; height: var(--topbar-h); border-bottom: 1px solid var(--line); font-size: 14px; flex: none; }
.agent-head b { font-weight: 600; } .agent-head .ico { width: 16px; height: 16px; color: var(--accent); } .agent-head .sp { flex: 1; }
.agent-head .btn.text { margin-left: auto; } .agent-x { margin-left: 10px; font-size: 20px; line-height: 1; color: var(--text-3); } .agent-x:hover { color: var(--text); }
.agent-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.amsg { font-size: 13.5px; line-height: 1.55; padding: 10px 13px; border-radius: 14px; max-width: 88%; white-space: pre-wrap; }
.amsg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.amsg.assistant { align-self: flex-start; background: var(--surface-2); color: var(--text); border-bottom-left-radius: 4px; }
.amsg.err { align-self: flex-start; background: var(--surface-2); color: var(--red); }
.amsg-act { display: block; margin-top: 6px; font-size: 11px; color: var(--text-3); }
.amsg.thinking { display: flex; gap: 4px; align-items: center; }
.amsg.thinking span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: ath 1s infinite; }
.amsg.thinking span:nth-child(2) { animation-delay: .15s; } .amsg.thinking span:nth-child(3) { animation-delay: .3s; }
@keyframes ath { 0%,60%,100% { opacity: .3; } 30% { opacity: 1; } }
.asuggest { display: flex; flex-direction: column; gap: 8px; }
.achip { text-align: left; font-size: 13px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px; color: var(--text-2); background: var(--card-bg); }
.achip:hover { border-color: var(--text-3); color: var(--text); }
.agent-input { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); flex: none; }
.agent-input input { flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--card-bg); color: var(--text); font: 13.5px var(--sans); outline: none; }
.agent-input input:focus { border-color: var(--text-3); }
/* narrow screens: overlay instead of a column */
@media (max-width: 1000px) {
  body.agent-open .app { grid-template-columns: var(--rail) 1fr; }
  body.agent-open .agentcol { position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 100vw); z-index: 46; box-shadow: -16px 0 48px -8px rgba(0,0,0,.5); }
  .agent-fab { bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }
}

/* ================= Home (AIR-style editorial) ================= */
.page.home { max-width: 1280px; }
.home-hero { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 0; border: 1px solid var(--card-border, var(--line)); border-radius: 16px; overflow: hidden; background: var(--card-bg); box-shadow: var(--shadow); }
[data-theme="ink"] .home-hero, :root:not([data-theme]) .home-hero { background: var(--surface); }
.hero-main { padding: 26px 28px; min-width: 0; }
.hero-greet { display: flex; align-items: center; gap: 14px; }
.hero-av { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 15px; flex: none; }
.hero-greet h1 { font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.hero-sub { font-size: 13px; color: var(--text-2); margin-top: 3px; }
.hero-ask { display: flex; align-items: center; gap: 10px; margin: 20px 0 16px; padding: 4px 4px 4px 14px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--card-bg); }
[data-theme="ink"] .hero-ask, :root:not([data-theme]) .hero-ask { background: var(--bg); }
.hero-ask > span .ico { width: 16px; height: 16px; color: var(--text-3); }
.hero-ask input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font: 14px var(--sans); color: var(--text); padding: 8px 0; }
.hero-ask-go { width: 34px; height: 34px; border-radius: 50%; background: var(--btn-primary-bg); color: var(--btn-primary-fg); display: grid; place-items: center; flex: none; }
.hero-ask-go .ico { width: 15px; height: 15px; }
.hero-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.htile { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 12px 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--card-bg); }
[data-theme="ink"] .htile, :root:not([data-theme]) .htile { background: var(--bg); }
.htile:hover { border-color: var(--line-2); }
.htile-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 5px; flex: none; background: var(--line-2); }
.htile-dot.s1 { background: var(--red); } .htile-dot.s2 { background: #E5A93F; }
.htile-t { font-size: 13px; font-weight: 500; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.htile-s { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.hero-side { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 380px; }
.hkpi { padding: 15px 20px; border-bottom: 1px solid var(--line); flex: 1; display: flex; flex-direction: column; justify-content: center; }
.hkpi:last-child { border-bottom: 0; }
.hkpi span { font-size: 11.5px; color: var(--text-3); }
.hkpi b { font-size: 21px; font-weight: 600; letter-spacing: -.02em; margin-top: 2px; }
.hkpi b.red { color: var(--red); }

.home-band { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; margin-top: 14px; }
.hcard { border: 1px solid var(--card-border, var(--line)); border-radius: 14px; background: var(--card-bg); box-shadow: var(--shadow); padding: 14px 16px; display: flex; flex-direction: column; }
.hcard-h { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); margin-bottom: 10px; }
.hcard-h .ico { width: 14px; height: 14px; color: var(--accent); }
.hcard-h .dim { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 400; }
.hrow { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--line); }
.hrow:first-of-type { border-top: 0; }
.hrow.click { cursor: pointer; } .hrow.click:hover .hrow-t { color: var(--accent); }
.hav { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); color: var(--text-2); display: grid; place-items: center; font-size: 10.5px; font-weight: 600; flex: none; }
.hbullet { width: 7px; height: 7px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--line-2); }
.hbullet.s1 { background: var(--red); } .hbullet.s2 { background: #E5A93F; } .hbullet.s3 { background: var(--good); }
.hrow-b { min-width: 0; }
.hrow-t { font-size: 13px; font-weight: 500; line-height: 1.35; }
.hrow-s { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.hcard-f { margin-top: auto; padding-top: 10px; font-size: 12px; color: var(--text-2); display: inline-flex; align-items: center; gap: 3px; }
.hcard-f .ico { width: 12px; height: 12px; }
.hempty { font-size: 12.5px; color: var(--text-3); padding: 8px 0 14px; }
.hcard-next { background: var(--surface); }
.hnext-t { font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.hnext-d { font-size: 12.5px; color: var(--text-2); margin-top: 6px; line-height: 1.5; }
.hnext-a { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.hnext-ask { margin-top: 14px; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--accent); }
.hnext-ask .ico { width: 13px; height: 13px; }
.accent { color: var(--accent); }

@media (max-width: 1000px) { .home-hero { grid-template-columns: 1fr; } .hero-side { flex-direction: row; border-left: 0; border-top: 1px solid var(--line); } .hkpi { border-bottom: 0; border-right: 1px solid var(--line); } .home-band { grid-template-columns: 1fr; } }

/* home hero top row + photo stack */
.hero-top { display: flex; align-items: flex-start; gap: 16px; }
.hero-top .hero-greet { flex: 1; min-width: 0; }
.photo-stack { display: flex; align-items: center; flex: none; padding-right: 4px; position: relative; }
.pshot { position: relative; flex: none; width: 108px; height: 78px; padding: 0; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--surface-2) center / cover no-repeat; box-shadow: 0 10px 22px -10px rgba(0,0,0,.42), 0 1px 3px rgba(0,0,0,.08); transition: transform .18s ease; }
.pshot + .pshot { margin-left: -34px; }
.pshot.d2 { transform: rotate(-5deg); z-index: 1; }
.pshot.d1 { transform: rotate(-1deg); z-index: 2; }
.pshot.d0 { transform: rotate(3deg); z-index: 3; }
.pshot:hover { transform: rotate(0deg) translateY(-3px); z-index: 4; }
.pnote { display: flex; align-items: flex-start; text-align: left; padding: 9px 10px; color: #3a3524; font-size: 11px; line-height: 1.35; }
.pnote span { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; word-break: break-word; }
.pwait { display: grid; place-items: center; background: linear-gradient(110deg, var(--surface-2) 30%, var(--surface) 50%, var(--surface-2) 70%) 0 0 / 200% 100%; animation: pshim 1.2s linear infinite; }
@keyframes pshim { to { background-position: -200% 0; } }
.pspin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--text-2); animation: pspin .8s linear infinite; }
@keyframes pspin { to { transform: rotate(360deg); } }
.padd-wrap { position: relative; flex: none; margin-left: 12px; }
.padd { width: 40px; height: 40px; border-radius: 50%; border: 1.5px dashed var(--line-2); color: var(--text-3); display: grid; place-items: center; }
.padd:hover { border-color: var(--text-3); color: var(--text); }
.padd .ico { width: 16px; height: 16px; }
.padd-empty { width: auto; height: 36px; border-radius: 999px; padding: 0 14px 0 11px; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; white-space: nowrap; }
.pin-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 184px; padding: 5px; display: flex; flex-direction: column;
  background: var(--card-bg); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 14px 34px -14px rgba(0,0,0,.3); }
[data-theme="ink"] .pin-menu, :root:not([data-theme]) .pin-menu { background: var(--surface-2); }
.pin-menu button { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 7px; text-align: left; font-size: 13px; color: var(--text); }
.pin-menu button:hover { background: var(--surface); }
.pin-menu .ico { width: 15px; height: 15px; color: var(--text-3); }
.pin-err { position: absolute; top: calc(100% + 8px); right: 0; font-size: 11.5px; color: var(--red); white-space: nowrap; }
/* note editor · photo viewer · all-pins gallery (drawer) */
.note-area { display: block; width: 100%; box-sizing: border-box; min-height: 170px; padding: 14px; border: 0; border-radius: 10px; outline: none; resize: vertical;
  font: inherit; font-size: 14px; line-height: 1.5; color: #3a3524; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.note-swatches { display: flex; gap: 9px; margin-top: 12px; }
.nswatch { width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.nswatch.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text); }
.pin-full { display: block; width: 100%; height: auto; border-radius: 10px; }
.pin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.pgrid { width: 100%; aspect-ratio: 4 / 3; padding: 0; border: 0; border-radius: 10px; cursor: pointer; background: var(--surface-2) center / cover no-repeat; box-shadow: 0 4px 12px -6px rgba(0,0,0,.3); }
.pgrid.pnote { padding: 10px; }
@media (max-width: 620px) { .hero-top { flex-direction: column; } .photo-stack { align-self: flex-start; } }

/* denser entity cards */
.home-ents { display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 12px; margin-top: 4px; }
.hent { display: block; border: 1px solid var(--card-border, var(--line)); border-radius: 12px; background: var(--card-bg); box-shadow: var(--shadow); padding: 15px 16px; }
[data-theme="ink"] .hent, :root:not([data-theme]) .hent { background: var(--surface); }
.hent:hover { border-color: var(--line-2); }
.hent-h { display: flex; align-items: flex-start; gap: 10px; }
.hent-hd { min-width: 0; flex: 1; }
.hent-h .pill { padding: 1px 8px 1px 6px; flex: none; }
.hent-n { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.hent-sub { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.hent-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin-top: 12px; }
.hm { display: flex; flex-direction: column; gap: 1px; }
.hm span { font-size: 10.5px; color: var(--text-3); }
.hm b { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.hm b.red { color: var(--red); }
.hent-f { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); }
.pips { display: inline-flex; gap: 3px; }
.pip { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); }
.pip.good-bg { background: var(--good); } .pip.red-bg { background: var(--red); } .pip.warn-bg { background: #E5A93F; }
.hent-f .small { margin-left: auto; }

/* home toolbar dropdown */
.home-toolbar { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.home-switch { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); border-radius: 999px; padding: 5px 10px 5px 12px; font-size: 12.5px; color: var(--text-2); background: var(--card-bg); position: relative; }
.home-switch .ico { width: 13px; height: 13px; color: var(--text-3); }
.home-switch select { border: 0; background: none; outline: none; font: 12.5px var(--sans); color: var(--text); -webkit-appearance: none; appearance: none; padding-right: 2px; cursor: pointer; }

/* desktop 'Feed' home option: keep the clean feed readable, not full-bleed */
@media (min-width: 801px) {
  .msummary { max-width: 720px; }
}

/* ---- rail collapse ---- */
.rail-toggle { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; color: var(--text-3); margin-right: 10px; flex: none; }
.rail-toggle:hover { color: var(--text); background: var(--surface-2); }
.rail-toggle .ico { width: 18px; height: 18px; }
body.rail-collapsed .app { grid-template-columns: 0 1fr; }
body.rail-collapsed .rail { display: none; }
body.rail-collapsed.agent-open .app { grid-template-columns: 0 minmax(0,1fr) 400px; }
@media (max-width: 800px) { .rail-toggle { display: none; } }

/* ---- hover cards (inbox + signals) : rich preview ---- */
.hrow { position: relative; }
.hovercard { position: absolute; left: calc(100% + 10px); top: -8px; width: 340px; z-index: 40; background: var(--rail-bg); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 20px 50px -16px rgba(0,0,0,.45); padding: 15px 16px; display: none; }
.hrow:hover .hovercard { display: block; }
.hc-head { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.hc-av { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; }
.hc-hd { min-width: 0; }
.hc-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-meta { font-size: 11.5px; color: var(--text-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-subj { font-size: 13.5px; font-weight: 600; line-height: 1.4; }
.hc-ask { font-size: 12.5px; color: var(--text-2); margin-top: 8px; line-height: 1.5; display: flex; gap: 6px; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; }
.hc-ask .ico { width: 13px; height: 13px; color: var(--accent); flex: none; margin-top: 2px; }
.hc-body { font-size: 12.5px; color: var(--text-2); line-height: 1.55; margin-top: 10px; max-height: 200px; overflow: hidden; }
@media (max-width: 1100px) { .hovercard { left: auto; right: 0; top: calc(100% - 4px); width: 320px; } }

/* ---- day schedule (hero right, calendar style) ---- */
.dsched2 { display: flex; flex-direction: column; height: 100%; padding: 16px 16px 18px; overflow-y: auto; }
.ds2-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.ds2-head > b { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.ds2-nav { display: flex; align-items: center; gap: 7px; border: 1px solid var(--line-2); border-radius: 10px; padding: 4px 7px; }
.ds2-nav > .ico { width: 14px; height: 14px; color: var(--text-3); }
.ds2-nav i { width: 1px; height: 15px; background: var(--line-2); display: inline-block; }
.ds2-nav > span { font-size: 12px; }
.ds2-navb { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: var(--text-3); }
.ds2-navb.on { background: var(--accent); color: #fff; }
.ds2-navb .ico { width: 12px; height: 12px; }
.ds2-grid { position: relative; display: grid; grid-template-columns: 38px 1fr; }
.ds2-h { height: 42px; }
.ds2-h b { font-size: 13px; font-weight: 600; color: var(--text-2); display: block; line-height: 1; }
.ds2-h span { font-size: 10px; color: var(--text-3); }
.ds2-lane { position: relative; border-left: 1px solid var(--line); background: repeating-linear-gradient(var(--line) 0 1px, transparent 1px 42px); }
.ds2-ev { position: absolute; left: 8px; right: 6px; height: 36px; border-radius: 9px; padding: 8px 10px; background: var(--ec, #6C6CF6); color: #fff; box-shadow: inset 4px 0 0 rgba(255,255,255,.55); display: flex; align-items: center; justify-content: space-between; gap: 6px; overflow: hidden; }
.ds2-ev b { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds2-ev .ico { width: 13px; height: 13px; opacity: .85; flex: none; }
.ds2-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); z-index: 3; }
.ds2-now::before { content: ''; position: absolute; left: -3px; top: -3px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.ds2-empty { position: absolute; top: 42%; left: 0; right: 0; text-align: center; color: var(--text-3); font-size: 11.5px; }
.ds2-uph { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin: 18px 0 6px; }
.ds2-up { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.ds2-up:first-of-type { border-top: 0; }
.ds2-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.ds2-up-t { flex: 1; min-width: 0; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds2-up-d { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
/* (legacy ds- styles below, unused) */
/* ---- day schedule (hero right) ---- */
/* ---- day schedule (hero right) ---- */
.dsched { display: flex; flex-direction: column; height: 100%; padding: 14px 16px; }
.ds-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.ds-head b { font-size: 13px; font-weight: 600; }
.ds-head .pill { margin-left: auto; }
.ds-any { margin-bottom: 12px; }
.ds-any-h { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); margin-bottom: 6px; }
.ds-chip { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 6px; color: var(--text); line-height: 1.3; }
.ds-chip span { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); flex: none; }
.ds-chip.s1 span { background: var(--red); } .ds-chip.s2 span { background: #E5A93F; } .ds-chip.s3 span { background: var(--good); }
.ds-chip:hover { border-color: var(--line-2); }
.ds-grid { position: relative; display: grid; grid-template-columns: 34px 1fr; flex: 1; min-height: 0; overflow-y: auto; border-top: 1px solid var(--line); padding-top: 2px; }
.ds-h { height: 34px; font-size: 10px; color: var(--text-3); }
.ds-lane { position: relative; border-left: 1px solid var(--line); background: repeating-linear-gradient(var(--line) 0 1px, transparent 1px 34px); }
.ds-ev { position: absolute; left: 6px; right: 6px; min-height: 30px; border-radius: 7px; padding: 4px 8px; background: var(--surface-2); border-left: 3px solid var(--accent); overflow: hidden; }
.ds-ev.s1 { border-left-color: var(--red); } .ds-ev.s2 { border-left-color: #E5A93F; }
.ds-ev b { font-size: 11.5px; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-ev span { font-size: 10px; color: var(--text-3); }
.ds-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); z-index: 2; }
.ds-now::before { content: ''; position: absolute; left: -3px; top: -2px; width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.ds-empty { position: absolute; top: 46%; left: 0; right: 0; text-align: center; color: var(--text-3); font-size: 11.5px; }

/* horizontal KPI strip under hero tiles */
.hero-kpis { display: grid; grid-template-columns: repeat(4, 1fr);
 gap: 0; margin-top: 18px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.hero-kpis .hstat { padding: 12px 16px; border-left: 1px solid var(--line); }
.hero-kpis .hstat:first-child { border-left: 0; }
.hstat span { display: block; font-size: 11.5px; color: var(--text-3); }
.hstat b { display: block; font-size: 20px; font-weight: 600; letter-spacing: -.02em; margin-top: 3px; }
.hstat b.red { color: var(--red); }
.hero-kpis.c5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 720px) { .hero-kpis, .hero-kpis.c5 { grid-template-columns: repeat(2, 1fr); } .hero-kpis .hstat:nth-child(odd) { border-left: 0; } .hero-kpis .hstat:nth-child(n+3) { border-top: 1px solid var(--line); } }

/* dismissible hero tiles */
.htile { position: relative; }
.htile-b { min-width: 0; flex: 1; }
.htile-x { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: var(--text-3); opacity: 0; transition: opacity .12s; }
.htile:hover .htile-x { opacity: 1; }
.htile-x:hover { background: var(--surface-2); color: var(--text); }
.htile-x .ico { width: 12px; height: 12px; }
