/* Castor IA · personal assistant demo. Castor's own palette (castorai.ca): near-black with the logo blue, or white. */
:root {
  --bg: #08090C; --panel: #0E1016; --panel-2: #131620; --raise: #191D29; --line: #1C2130; --line-2: #283044;
  --ink: #ECEFF4; --soft: #A3ADBE; --faint: #6E788A;
  --brand: #2B7CEB; --brand-hi: #6AA2F0; --brand-bg: rgba(43, 124, 235, .14); --brand-line: rgba(106, 162, 240, .38);
  --good: #3FBA63; --good-bg: rgba(63, 186, 99, .13); --warn: #E2B27A; --warn-bg: rgba(226, 178, 122, .13);
  --bad: #EE7388; --bad-bg: rgba(238, 115, 136, .13); --mute-bg: rgba(163, 173, 190, .12);
  --s1: #4F8FF0; --s2: #e76624; --s3: #00a888; --s4: #d28e05;
  --shadow: 0 24px 60px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .4);
  --glow: radial-gradient(900px 420px at 18% -8%, rgba(43, 124, 235, .16), transparent 60%);
  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r: 14px; --r-s: 9px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #F3F5F9; --panel: #FFFFFF; --panel-2: #F7F9FC; --raise: #EEF2F7; --line: #E3E8EF; --line-2: #D5DCE6;
  --ink: #0A0D14; --soft: #5A6472; --faint: #8A94A3;
  --brand: #2B7CEB; --brand-hi: #1F64C8; --brand-bg: #E8F1FD; --brand-line: rgba(43, 124, 235, .35);
  --good: #1E7B4F; --good-bg: #DCF5E5; --warn: #8A4708; --warn-bg: #FFF1D6; --bad: #B3262E; --bad-bg: #FFE9EA; --mute-bg: #EDF0F4;
  --s1: #2B7CEB; --s2: #f47230; --s3: #00b894; --s4: #f2a600;
  --shadow: 0 24px 60px rgba(16, 24, 40, .16), 0 2px 8px rgba(16, 24, 40, .06);
  --glow: radial-gradient(900px 420px at 18% -8%, rgba(43, 124, 235, .10), transparent 60%);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 400 14px/1.45 var(--font); font-variant-numeric: tabular-nums;
       -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: left; }
:focus-visible { outline: 2px solid var(--brand-hi); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--brand-bg); }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: -.01em; }
.soft { color: var(--soft); } .faint { color: var(--faint); }

/* ------------------------------------------------------------------ frame */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 22px; padding: 20px 14px 16px;
        border-right: 1px solid var(--line); background: var(--panel); }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px; }
.brand svg { width: 46px; height: 22px; color: var(--brand); }
.brand b { font-weight: 650; font-size: 17px; letter-spacing: -.02em; }
.brand b span { color: var(--faint); font-weight: 500; }
.who { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r-s); background: var(--panel-2); border: 1px solid var(--line); }
.av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 13px; color: #fff;
      background: linear-gradient(135deg, #2B7CEB, #0D3E86); flex: none; }
.who p { font-weight: 550; line-height: 1.2; } .who small { color: var(--faint); font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 10px; border-radius: var(--r-s); color: var(--soft); font-weight: 450; position: relative; }
.nav a:hover { background: var(--raise); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--brand-bg); color: var(--ink); font-weight: 550; }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav a[aria-current="page"] svg { color: var(--brand-hi); }
.nav .n { margin-left: auto; font-size: 12px; font-weight: 600; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center;
          background: var(--brand); color: #fff; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: var(--faint); padding: 0 8px; }
.side-foot .ok { display: flex; align-items: center; gap: 7px; } .side-foot .ok i { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px var(--good-bg); }

.main { min-width: 0; background: var(--glow), var(--bg); background-repeat: no-repeat; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 28px;
       background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.ask-bar { flex: 1; max-width: 560px; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 8px 0 14px; border-radius: 20px;
           background: var(--panel); border: 1px solid var(--line-2); color: var(--faint); cursor: text; }
.ask-bar:hover { border-color: var(--brand-line); }
.ask-bar span { flex: 1; }
.ask-bar .mic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; }
.ask-bar .mic svg { width: 16px; height: 16px; }
.demo-chip { font: 600 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--warn); background: var(--warn-bg);
             padding: 7px 10px; border-radius: 20px; white-space: nowrap; }
.top .sp { flex: 1; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--soft); border: 1px solid var(--line-2); background: var(--panel); }
.icon-btn:hover { color: var(--ink); border-color: var(--brand-line); }
.mob-nav { display: none; }

.page { padding: 28px 28px 64px; max-width: 1360px; margin: 0 auto; }
.page > * + * { margin-top: 18px; }
.eyebrow { font: 500 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--brand-hi); }
.h1 { font-size: 34px; line-height: 1.1; font-weight: 650; letter-spacing: -.035em; margin-top: 10px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; min-width: 0; }
.card h2 { font-size: 15px; font-weight: 600; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.card h2 .more { margin-left: auto; font-size: 12.5px; font-weight: 500; color: var(--brand-hi); }
.finding { color: var(--soft); margin-top: 4px; font-size: 13.5px; }
.finding b { color: var(--ink); font-weight: 600; }
.g2 { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 18px; }
.g2e { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.g3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 19px; font-weight: 550; font-size: 13.5px;
       background: var(--raise); border: 1px solid var(--line-2); white-space: nowrap; }
.btn:hover { border-color: var(--brand-line); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #3D8AF2; }
.btn.small { height: 30px; padding: 0 12px; font-size: 12.5px; }
.btn svg { width: 16px; height: 16px; }

.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 11.5px; font-weight: 550; white-space: nowrap;
        background: var(--mute-bg); color: var(--soft); }
.chip svg { width: 12px; height: 12px; stroke-width: 2.2; }
.chip.brand { background: var(--brand-bg); color: var(--brand-hi); }
.chip.good { background: var(--good-bg); color: var(--good); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }

/* rolling digits */
.roll { display: inline-flex; line-height: 1; }
.roll .d { display: inline-block; height: 1em; overflow: hidden; }
.roll .col { display: flex; flex-direction: column; transform: translateY(0); transition: transform 1.4s cubic-bezier(.2, .9, .1, 1); }
.roll .col span { height: 1em; }
.roll.go .col { transform: translateY(calc(var(--v) * -1em)); }

/* ------------------------------------------------------------------ today */
.hello { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.weather { display: flex; align-items: center; gap: 10px; color: var(--soft); font-size: 13.5px; }
.weather b { color: var(--ink); font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.hero { display: grid; grid-template-columns: minmax(250px, .8fr) minmax(0, 2fr); gap: 0; padding: 0; overflow: hidden; }
.hero-fig { position: relative; overflow: hidden; padding: 26px 28px; border-right: 1px solid var(--line); background: linear-gradient(160deg, var(--brand-bg), transparent 70%); display: flex; flex-direction: column; justify-content: space-between; gap: 18px; }
.hero-fig .wm { position: absolute; right: -40px; bottom: -18px; width: 300px; color: var(--brand); opacity: .09; pointer-events: none; }
.hero-fig .wm svg { width: 100%; height: auto; display: block; }
.hero-fig > :not(.wm) { position: relative; }
.hero-fig .big { font-size: 128px; font-weight: 700; letter-spacing: -.06em; color: var(--ink); }
.hero-fig .lab { font-size: 19px; font-weight: 550; letter-spacing: -.02em; line-height: 1.2; }
.hero-fig .lab small { display: block; margin-top: 6px; color: var(--soft); font-size: 13.5px; font-weight: 400; letter-spacing: 0; }
.needs { display: flex; flex-direction: column; }
.needs li + li { border-top: 1px solid var(--line); }
.need { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 15px 22px; }
.need:hover { background: var(--panel-2); }
.need .ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--raise); color: var(--brand-hi); }
.need .t { font-weight: 550; } .need .m { color: var(--soft); font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.tile .v { font-size: 34px; font-weight: 650; letter-spacing: -.04em; line-height: 1; margin-top: 12px; }
.tile .k { color: var(--soft); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.tile .k svg { color: var(--brand-hi); width: 16px; height: 16px; }
.tile .s { color: var(--faint); font-size: 12.5px; margin-top: 8px; }
.agenda li { display: grid; grid-template-columns: 52px 3px minmax(0, 1fr); gap: 12px; padding: 10px 0; align-items: start; }
.agenda li + li { border-top: 1px solid var(--line); }
.agenda .tm { font: 500 13px/20px var(--mono); color: var(--soft); }
.agenda .bar { width: 3px; height: 100%; min-height: 34px; border-radius: 2px; background: var(--brand); }
.agenda .bar.due { background: var(--warn); }
.agenda .w { font-weight: 550; } .agenda .wh { color: var(--faint); font-size: 12.5px; }
.feed li { display: grid; grid-template-columns: 50px 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 0; }
.feed li + li { border-top: 1px dashed var(--line); }
.feed .tm { font: 500 12.5px var(--mono); color: var(--faint); }
.feed .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--raise); color: var(--soft); }
.feed .ic svg { width: 15px; height: 15px; }
.feed a:hover .w { color: var(--brand-hi); }
.feed .arr { color: var(--faint); }

/* sankey */
.sankey { width: 100%; height: auto; display: block; margin-top: 10px; overflow: visible; }
.sankey .band { opacity: .34; transition: opacity .2s; }
.sankey .band:hover { opacity: .72; }
.sankey .node { rx: 3px; }
.sankey text { font-family: var(--font); fill: var(--ink); font-size: 13px; }
.sankey text.v { fill: var(--soft); font-family: var(--mono); font-size: 12px; }
.sankey .dot { fill: #fff; opacity: .85; }
:root[data-theme="light"] .sankey .dot { fill: var(--ink); opacity: .55; }
.sankey .need-node { fill: var(--brand); }

/* ------------------------------------------------------------------ ask */
.chat { display: grid; grid-template-rows: minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); height: calc(100dvh - 64px - 56px); min-height: 520px; padding: 0; overflow: hidden; }
.msgs { overflow-y: auto; padding: 26px 28px; display: flex; flex-direction: column; gap: 18px; scroll-behavior: smooth; }
.msg { max-width: 760px; display: flex; gap: 12px; }
.msg .who-ic { width: 32px; height: 32px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--brand); color: #fff; }
.msg .who-ic svg { width: 22px; height: 12px; }
.msg .body { min-width: 0; padding-top: 5px; }
.msg.me { align-self: flex-end; }
.msg.me .body { background: var(--brand); color: #fff; padding: 10px 15px; border-radius: 16px 16px 4px 16px; }
.msg .body p + p, .msg .body p + .att, .msg .body .att + p { margin-top: 8px; }
.typing span { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; background: var(--faint); animation: blink 1s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.att { border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; background: var(--panel-2); }
.att .fn { display: flex; align-items: center; gap: 10px; font-weight: 550; }
.att .fn svg { color: var(--brand-hi); }
.att .path { color: var(--faint); font: 12px var(--mono); margin-top: 3px; }
.att dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 10px 0 0; font-size: 13px; }
.att dt { color: var(--soft); } .att dd { margin: 0; font-weight: 550; }
.srcs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.composer { border-top: 1px solid var(--line); padding: 14px 20px 16px; background: var(--panel); }
.sugg { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.sugg button { height: 32px; padding: 0 13px; border-radius: 16px; border: 1px solid var(--line-2); color: var(--soft); font-size: 13px; background: var(--panel-2); }
.sugg button:hover { color: var(--ink); border-color: var(--brand-line); }
.inrow { display: flex; gap: 10px; align-items: center; }
.inrow input { flex: 1; min-width: 0; height: 46px; border-radius: 23px; border: 1px solid var(--line-2); background: var(--panel-2); padding: 0 18px; outline: none; }
.inrow input:focus { border-color: var(--brand-line); }
.round { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--raise); border: 1px solid var(--line-2); flex: none; }
.round.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.round.rec { background: var(--bad); border-color: var(--bad); color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(238, 115, 136, .5); } 100% { box-shadow: 0 0 0 14px rgba(238, 115, 136, 0); } }
.wave { display: flex; align-items: center; gap: 3px; height: 46px; flex: 1; padding: 0 18px; border-radius: 23px; background: var(--panel-2); border: 1px solid var(--bad); }
.wave i { width: 3px; border-radius: 2px; background: var(--bad); animation: wv .9s ease-in-out infinite; }
@keyframes wv { 0%, 100% { height: 6px; } 50% { height: 26px; } }
.minibars { display: flex; align-items: flex-end; gap: 4px; height: 70px; margin-top: 10px; }
.minibars i { flex: 1; background: var(--s1); border-radius: 3px 3px 0 0; min-height: 2px; }
.letter { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.letter div { border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; background: var(--panel-2); font-size: 13px; white-space: pre-line; }
.letter b { display: block; font: 600 11px var(--mono); letter-spacing: .08em; color: var(--brand-hi); margin-bottom: 6px; }

/* ------------------------------------------------------------------ inbox */
.mail { display: grid; grid-template-columns: 210px minmax(0, 1.1fr) minmax(0, 1.3fr); gap: 0; padding: 0; overflow: hidden; min-height: 620px; }
.labels { border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; }
.labels h3, .list h3 { font: 600 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); padding: 6px 10px 10px; }
.labels button { display: flex; align-items: center; gap: 9px; height: 34px; padding: 0 10px; border-radius: 8px; color: var(--soft); font-size: 13.5px; }
.labels button:hover { background: var(--raise); color: var(--ink); }
.labels button.on { background: var(--brand-bg); color: var(--ink); font-weight: 550; }
.labels .sw { width: 9px; height: 9px; border-radius: 3px; background: var(--faint); }
.labels .c { margin-left: auto; font: 500 12px var(--mono); color: var(--faint); }
.list { border-right: 1px solid var(--line); padding: 14px 0; overflow-y: auto; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; padding: 12px 18px; border-left: 3px solid transparent; width: 100%; }
.row:hover { background: var(--panel-2); }
.row.on { background: var(--brand-bg); border-left-color: var(--brand); }
.row .f { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .tm { font: 12px var(--mono); color: var(--faint); }
.row .s { grid-column: 1 / -1; color: var(--soft); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .tags { grid-column: 1 / -1; display: flex; gap: 6px; margin-top: 4px; }
.read { padding: 22px 24px; overflow-y: auto; }
.read h3 { font-size: 19px; letter-spacing: -.02em; }
.read .meta { color: var(--faint); font-size: 12.5px; margin-top: 4px; }
.read .orig { margin-top: 16px; padding: 14px 16px; border-left: 2px solid var(--line-2); color: var(--soft); }
.draft { margin-top: 18px; border: 1px solid var(--brand-line); border-radius: 14px; overflow: hidden; }
.draft .dh { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--brand-bg); font-weight: 600; font-size: 13px; color: var(--brand-hi); }
.draft textarea { width: 100%; min-height: 196px; border: 0; resize: vertical; padding: 14px 16px; background: var(--panel); outline: none; line-height: 1.55; }
.draft .files { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 16px 12px; }
.draft .acts { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); background: var(--panel-2); align-items: center; }
.draft .acts .note { margin-left: auto; color: var(--faint); font-size: 12px; }
.done-box { margin-top: 18px; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; background: var(--good-bg); color: var(--ink); }
.done-box svg { color: var(--good); margin-top: 1px; }

/* ------------------------------------------------------------------ tables */
.tbl { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13.5px; }
.tbl th { text-align: left; font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 8px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:hover td { background: var(--panel-2); }
.tbl .r { text-align: right; } .tbl th.r { text-align: right; }
.tbl .path { font: 12px var(--mono); color: var(--faint); max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl tr.new td { animation: flash 2.4s ease-out; }
@keyframes flash { 0% { background: var(--brand-bg); } 100% { background: transparent; } }
.scroll-x { overflow-x: auto; }

/* ------------------------------------------------------------------ charts */
.chart { width: 100%; display: block; overflow: visible; }
.chart text { font-family: var(--mono); font-size: 11px; fill: var(--faint); }
.chart .grid line { stroke: var(--line); }
.chart .bar { fill: var(--s1); transform-box: fill-box; transform-origin: bottom; }
.chart .bar.dim { fill: var(--line-2); }
.chart .bar:hover { filter: brightness(1.18); }
.grow .bar { animation: rise .9s cubic-bezier(.2, .9, .1, 1) both; }
@keyframes rise { from { transform: scaleY(0); } }
.hbars li { display: grid; grid-template-columns: 150px minmax(0, 1fr) 90px; align-items: center; gap: 12px; padding: 6px 0; }
.hbars .nm { color: var(--soft); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbars .tr { position: relative; height: 12px; }
.hbars .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; background: var(--s1); transform-origin: left; animation: grow .9s cubic-bezier(.2, .9, .1, 1) both; }
.hbars .ghost { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); opacity: .55; border-radius: 1px; }
.hbars .val { text-align: right; font: 500 13px var(--mono); }
@keyframes grow { from { transform: scaleX(0); } }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--soft); margin-top: 8px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--s1); }
.legend i.tick { width: 2px; height: 12px; border-radius: 1px; background: var(--ink); opacity: .55; }

.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; padding: 0; overflow: hidden; }
.kpi { padding: 22px 24px; } .kpi + .kpi { border-left: 1px solid var(--line); }
.kpi .k { color: var(--soft); font-size: 13px; } .kpi .v { font-size: 44px; font-weight: 650; letter-spacing: -.045em; line-height: 1; margin-top: 12px; }
.kpi .s { color: var(--faint); font-size: 12.5px; margin-top: 10px; }
.kpi.hl .v { color: var(--brand-hi); }
.alert { display: flex; gap: 14px; align-items: center; padding: 16px 20px; border-radius: var(--r); border: 1px solid var(--brand-line); background: var(--brand-bg); }
.alert .ic { width: 40px; height: 40px; border-radius: 11px; background: var(--brand); color: #fff; display: grid; place-items: center; flex: none; }
.alert p { flex: 1; } .alert b { font-weight: 600; }
.strip { position: relative; height: 92px; margin-top: 18px; }
.strip .axis { position: absolute; left: 0; right: 0; top: 46px; height: 2px; background: var(--line-2); border-radius: 1px; }
.strip .pin { position: absolute; top: 46px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--s1); border: 2px solid var(--panel); }
.strip .pin.big { background: var(--warn); }
.strip .lab { position: absolute; font: 11px var(--mono); color: var(--faint); transform: translateX(-50%); white-space: nowrap; }
.strip .lab.t1 { top: 0; } .strip .lab.b1 { top: 64px; }
.bill-list li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 0; }
.bill-list li + li { border-top: 1px solid var(--line); }
.bill-list .dt { font: 500 12.5px var(--mono); color: var(--soft); }
.bill-list .nm b { font-weight: 550; display: block; } .bill-list .nm small { color: var(--faint); font-size: 12px; }
.bill-list .amt { font: 500 13.5px var(--mono); text-align: right; white-space: nowrap; }
.bill-list .amt .btn { font-family: var(--font); }
.bill-list .soon .dt { color: var(--warn); }

/* scan modal */
.veil { position: fixed; inset: 0; z-index: 60; background: rgba(4, 6, 10, .66); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(860px, 100%); background: var(--panel); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.modal .mh { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); font-weight: 600; }
.scan { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; padding: 24px; }
.paper { align-self: start; position: relative; background: #FBFAF6; color: #222; font: 12px/1.5 var(--mono); padding: 20px 18px 26px; border-radius: 4px; transform: rotate(-1.6deg);
         box-shadow: 0 12px 30px rgba(0, 0, 0, .35); overflow: hidden; }
.paper .ctr { text-align: center; } .paper hr { border: 0; border-top: 1px dashed #999; margin: 8px 0; }
.paper .ln { display: flex; justify-content: space-between; gap: 10px; }
.paper .beam { position: absolute; left: 0; right: 0; height: 46px; top: -50px; background: linear-gradient(to bottom, transparent, rgba(43, 124, 235, .35), transparent);
               border-bottom: 2px solid #2B7CEB; animation: beam 1.6s ease-in-out 2; }
@keyframes beam { 0% { top: -50px; } 100% { top: 100%; } }
.fields { display: grid; gap: 8px; align-content: start; }
.field { display: grid; grid-template-columns: 110px minmax(0, 1fr) 20px; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; background: var(--panel-2);
         border: 1px solid var(--line); opacity: .35; transition: opacity .3s, border-color .3s; }
.field.on { opacity: 1; border-color: var(--brand-line); }
.field .k { color: var(--soft); font-size: 12.5px; } .field .v { font-weight: 600; }
.field .ok { color: var(--good); visibility: hidden; } .field.on .ok { visibility: visible; }
.filed { margin-top: 6px; padding: 12px 14px; border-radius: 10px; background: var(--good-bg); display: flex; gap: 10px; align-items: flex-start; opacity: 0; transition: opacity .4s; }
.filed.on { opacity: 1; } .filed svg { color: var(--good); } .filed .p { font: 12px var(--mono); color: var(--soft); margin-top: 2px; word-break: break-all; }

/* ------------------------------------------------------------------ documents */
.search { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line-2); }
.search input { flex: 1; border: 0; outline: none; background: none; font-size: 15px; }
.search svg { color: var(--faint); }
.results li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 4px; }
.results li + li { border-top: 1px solid var(--line); }
.results .ic { width: 34px; height: 34px; border-radius: 9px; background: var(--raise); display: grid; place-items: center; color: var(--brand-hi); }
.results .p { font: 12px var(--mono); color: var(--faint); }
.results mark { background: var(--brand-bg); color: var(--brand-hi); border-radius: 3px; padding: 0 2px; }
.src li { display: grid; grid-template-columns: 120px minmax(0, 1fr) 96px; gap: 12px; align-items: center; padding: 8px 0; }
.src .tr { height: 10px; border-radius: 5px; background: var(--raise); overflow: hidden; }
.src .tr i { display: block; height: 100%; border-radius: 5px; background: var(--s3); transform-origin: left; animation: grow 1.1s cubic-bezier(.2, .9, .1, 1) both; }
.src .tr i.prog { background: repeating-linear-gradient(-45deg, var(--s1) 0 6px, color-mix(in srgb, var(--s1) 70%, transparent) 6px 12px); background-size: 17px 17px; animation: grow 1.1s cubic-bezier(.2, .9, .1, 1) both, march 1s linear infinite; }
@keyframes march { to { background-position: 17px 0; } }
.src .n { text-align: right; font: 500 12.5px var(--mono); color: var(--soft); }
.ren li { display: grid; grid-template-columns: minmax(0, .8fr) 22px minmax(0, 1.4fr); gap: 10px; align-items: center; padding: 10px 0; }
.ren li + li { border-top: 1px solid var(--line); }
.ren .was { font: 12.5px var(--mono); color: var(--faint); text-decoration: line-through; text-decoration-color: var(--line-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ren .now b { display: block; font-weight: 550; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ren .now small { font: 12px var(--mono); color: var(--brand-hi); }
.ren .arr { color: var(--brand-hi); }
.tree { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.fold { padding: 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); position: relative; overflow: hidden; }
.fold .fn { display: flex; align-items: center; gap: 8px; font-weight: 600; } .fold .fn svg { color: var(--brand-hi); }
.fold .sb { color: var(--faint); font-size: 12px; margin-top: 4px; }
.fold .ct { font: 600 22px var(--font); letter-spacing: -.03em; margin-top: 10px; }
.fold .meter { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--brand); transform-origin: left; animation: grow 1.1s cubic-bezier(.2, .9, .1, 1) both; }

/* ------------------------------------------------------------------ research */
.rs { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; }
.files button { display: block; width: 100%; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); margin-bottom: 10px; }
.files button.on { border-color: var(--brand-line); background: var(--brand-bg); }
.files b { display: block; font-weight: 600; } .files small { color: var(--faint); font-size: 12px; }
.stack { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; margin-top: 14px; }
.stack i { display: block; height: 100%; }
.claims li { display: grid; grid-template-columns: minmax(0, 1fr) 140px; gap: 6px 18px; padding: 14px 0; align-items: start; }
.claims li + li { border-top: 1px solid var(--line); }
.claims .c { font-weight: 600; font-size: 14.5px; } .claims .why { grid-column: 1; color: var(--soft); font-size: 13px; }
.claims .vd { grid-row: 1 / 3; grid-column: 2; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.claims .fa { font: 12px var(--mono); color: var(--faint); }
.slist li { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 12px; padding: 9px 0; align-items: center; font-size: 13.5px; }
.slist li + li { border-top: 1px solid var(--line); }
.slist .dt { font: 12px var(--mono); color: var(--faint); }

/* ------------------------------------------------------------------ calendar */
.lanes { position: relative; margin-top: 14px; }
.lane { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; height: 46px; border-top: 1px solid var(--line); }
.lane .ln { color: var(--soft); font-size: 13px; }
.lane .tk { position: relative; height: 100%; }
.lane .ev { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; transform: translate(-50%, -50%); border: 2px solid var(--panel); cursor: default; }
.lane .ev:hover { transform: translate(-50%, -50%) scale(1.3); }
.months { display: grid; grid-template-columns: 110px minmax(0, 1fr); }
.months .mk { position: relative; height: 22px; }
.months .mk span { position: absolute; font: 11px var(--mono); color: var(--faint); transform: translateX(-2px); text-transform: uppercase; letter-spacing: .06em; }
.nowline { position: absolute; top: 22px; bottom: 0; width: 2px; background: var(--brand); }
.nowline::after { content: "Today"; position: absolute; top: -20px; left: 4px; font: 600 11px var(--mono); color: var(--brand-hi); }
.dl li { display: grid; grid-template-columns: 96px 10px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; }
.dl li + li { border-top: 1px solid var(--line); }
.dl .dt { font: 12.5px var(--mono); color: var(--soft); }
.dl .sw { width: 10px; height: 10px; border-radius: 50%; }

/* ------------------------------------------------------------------ settings */
.set li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; }
.set li + li { border-top: 1px solid var(--line); }
.set .ic { width: 40px; height: 40px; border-radius: 11px; background: var(--raise); display: grid; place-items: center; color: var(--brand-hi); }
.set b { font-weight: 550; display: block; } .set small { color: var(--faint); font-size: 12.5px; }
.sw-t { width: 40px; height: 22px; border-radius: 11px; background: var(--line-2); position: relative; flex: none; }
.sw-t::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; }
.sw-t.on { background: var(--brand); } .sw-t.on::after { transform: translateX(18px); }
.opt-card { border: 1.5px dashed var(--brand-line); background: transparent; }
.seg { display: inline-flex; padding: 3px; border-radius: 18px; background: var(--raise); border: 1px solid var(--line-2); }
.seg button { height: 28px; padding: 0 12px; border-radius: 14px; font-size: 12.5px; color: var(--soft); }
.seg button.on { background: var(--panel); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }

/* tooltip + toast */
#tip { position: fixed; z-index: 80; pointer-events: none; background: var(--ink); color: var(--bg); font-size: 12.5px; padding: 7px 10px; border-radius: 8px; max-width: 260px;
       opacity: 0; transition: opacity .12s; white-space: pre-line; line-height: 1.4; }
#tip.on { opacity: 1; }
#toast { position: fixed; z-index: 90; left: 50%; bottom: 26px; transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 12px;
         font-weight: 550; font-size: 13.5px; opacity: 0; transition: .25s; box-shadow: var(--shadow); display: flex; gap: 8px; align-items: center; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

.screen-in > * { animation: up .5s cubic-bezier(.2, .9, .1, 1) both; }
.screen-in > *:nth-child(2) { animation-delay: .05s; } .screen-in > *:nth-child(3) { animation-delay: .1s; } .screen-in > *:nth-child(4) { animation-delay: .15s; } .screen-in > *:nth-child(5) { animation-delay: .2s; }
@keyframes up { from { opacity: 0; transform: translateY(10px); } }

/* ------------------------------------------------------------------ smaller screens */
@media (max-width: 1180px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mail { grid-template-columns: 180px minmax(0, 1fr); } .mail .read { grid-column: 1 / -1; border-top: 1px solid var(--line); }
  .tree { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .top { padding: 0 16px; gap: 10px; }
  .mob-nav { display: flex; position: sticky; top: 64px; z-index: 19; gap: 6px; overflow-x: auto; padding: 10px 16px; background: color-mix(in srgb, var(--bg) 90%, transparent);
             backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .mob-nav a { flex: none; display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 17px; color: var(--soft); border: 1px solid var(--line-2); font-size: 13px; }
  .mob-nav a[aria-current="page"] { background: var(--brand); border-color: var(--brand); color: #fff; }
  .mob-nav svg { width: 15px; height: 15px; }
  .page { padding: 20px 16px 48px; }
  .g2, .g2e, .g3, .rs { grid-template-columns: minmax(0, 1fr); }
  .hero { grid-template-columns: minmax(0, 1fr); } .hero-fig { border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; align-items: flex-end; }
  .hero-fig .wm { position: absolute; right: -40px; bottom: -18px; width: 300px; color: var(--brand); opacity: .09; pointer-events: none; }
.hero-fig .wm svg { width: 100%; height: auto; display: block; }
.hero-fig > :not(.wm) { position: relative; }
.hero-fig .big { font-size: 96px; }
  .chat { height: calc(100dvh - 64px - 55px - 40px); }
  .scan { grid-template-columns: minmax(0, 1fr); } .paper { max-width: 300px; margin: 0 auto; }
}
@media (max-width: 640px) {
  .brand-top { display: none; }
  .ask-bar span { font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .demo-chip { display: none; }
  .h1 { font-size: 27px; }
  .hero-fig { flex-direction: column; align-items: flex-start; } .hero-fig .wm { position: absolute; right: -40px; bottom: -18px; width: 300px; color: var(--brand); opacity: .09; pointer-events: none; }
.hero-fig .wm svg { width: 100%; height: auto; display: block; }
.hero-fig > :not(.wm) { position: relative; }
.hero-fig .big { font-size: 84px; }
  .need { padding: 13px 16px; grid-template-columns: 36px minmax(0, 1fr); } .need .go { display: none; }
  .tiles { gap: 12px; } .tile .v { font-size: 28px; }
  .kpis { grid-template-columns: minmax(0, 1fr); } .kpi + .kpi { border-left: 0; border-top: 1px solid var(--line); } .kpi .v { font-size: 38px; }
  .mail { grid-template-columns: minmax(0, 1fr); } .labels { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .labels h3 { display: none; } .labels button { flex: none; } .list { border-right: 0; max-height: 420px; }
  .hbars li { grid-template-columns: 110px minmax(0, 1fr) 76px; }
  .tree { grid-template-columns: minmax(0, 1fr); }
  .ren li { grid-template-columns: minmax(0, 1fr); gap: 2px; } .ren .arr { display: none; }
  .src li { grid-template-columns: 96px minmax(0, 1fr) 80px; }
  .claims li { grid-template-columns: minmax(0, 1fr); } .claims .vd { grid-row: auto; grid-column: 1; flex-direction: row; align-items: center; }
  .lane, .months { grid-template-columns: 92px minmax(0, 1fr); } .lane .ln { font-size: 12px; }
  .dl li { grid-template-columns: 70px 10px minmax(0, 1fr); row-gap: 2px; } .dl li > :last-child { grid-column: 3; }
  .alert { flex-wrap: wrap; } .alert .ic { display: none; }
  .letter { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 16px; }
  .feed li { grid-template-columns: 44px 28px minmax(0, 1fr); } .feed .arr { display: none; }
  .tile .k { display: block; } .tile .k svg { display: none; }
  .sugg { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -20px 12px; padding: 0 20px; } .sugg button { flex: none; }
  .composer { padding: 12px 14px 14px; } .msgs { padding: 18px 16px; }
  .msg .who-ic { width: 28px; height: 28px; }
  .tbl .hide-s { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .sankey .dot { display: none; }
}
