/* ===== App shell ===== */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: calc(100vh / var(--z)); }
.side { position: sticky; top: 0; height: calc(100vh / var(--z)); background: radial-gradient(120% 60% at 0% 0%, #1d3a8a 0%, transparent 60%), var(--side); color: var(--side-ink); display: flex; flex-direction: column; padding: 18px 14px; gap: 14px; overflow-y: auto; z-index: 40; }
.side .logo { color: #fff; padding: 4px 8px 10px; }
.ws { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); }
.ws b { color: #fff; font-size: 13.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws small { font-size: 11.5px; color: var(--side-ink); }
.ws > div { min-width: 0; flex: 1; }
.nav-group { display: grid; gap: 2px; }
.nav-label { font-size: 11px; font-weight: 700; color: rgba(201, 192, 242, .55); padding: 8px 10px 4px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 0 10px; height: 40px; border-radius: 11px; color: var(--side-ink); font-weight: 500; font-size: 14px; position: relative; transition: background .15s, color .15s; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.on { background: linear-gradient(90deg, rgba(74, 114, 245, .45), rgba(74, 114, 245, .12)); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.nav a.on::before { content: ''; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav a .lock, .nav a .count { margin-left: auto; }
.nav a .lock { color: var(--accent); opacity: .85; }
.nav a .count { font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; display: grid; place-items: center; background: var(--accent); color: #2a1206; }
.side-promo { margin-top: auto; padding: 16px; border-radius: 18px; position: relative; overflow: hidden; background: linear-gradient(150deg, #4a72f5, #16328f); color: #fff; }
.side-promo::after { content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; border: 18px solid rgba(255, 255, 255, .08); }
.side-promo b { display: block; font-size: 14.5px; margin: 8px 0 4px; }
.side-promo p { font-size: 12.5px; opacity: .8; margin-bottom: 12px; }
.side-promo .crown { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(217, 120, 63, .25); color: #f6b48a; }
.me-chip { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; border-radius: 16px; color: #fff; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); min-width: 0; }
.me-chip .av { flex: none; box-shadow: 0 0 0 2px rgba(255,255,255,.12); }
.me-chip > div { min-width: 0; flex: 1; display: grid; gap: 1px; }
.me-chip b, .me-chip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-chip b { font-size: 13px; line-height: 1.25; }
.me-chip small { font-size: 11.5px; line-height: 1.3; color: var(--side-ink); opacity: .85; }
.me-chip .btn { flex: none; width: 34px; height: 34px; min-height: 34px; padding: 0; border-radius: 10px; color: var(--side-ink); background: transparent; border: 1px solid rgba(255,255,255,.1); }
.me-chip .btn:hover { color: #fff; background: rgba(209, 67, 91, .18); border-color: rgba(209, 67, 91, .4); }
.av { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; flex: none; }
.av.sm { width: 28px; height: 28px; border-radius: 9px; font-size: 11px; }
.av.lg { width: 56px; height: 56px; border-radius: 18px; font-size: 19px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 14px 28px; background: var(--topbar); backdrop-filter: blur(14px); border-bottom: 1px solid transparent; }
.top.scrolled { border-bottom-color: var(--hair); }
.top .menu-btn { display: none; }
.search-btn { flex: 1; max-width: 440px; display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 14px; border-radius: 13px; background: var(--surface); border: 1px solid var(--hair); color: var(--muted); cursor: pointer; box-shadow: var(--sh); }
.search-btn kbd { margin-left: auto; font: 600 11px var(--sans); padding: 2px 7px; border-radius: 6px; background: var(--soft); border: 1px solid var(--hair); }
.top .spacer { flex: 1; }
.timer-chip { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 8px 0 14px; border-radius: 13px; background: var(--ink); color: var(--on-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.timer-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.timer-chip button { width: 28px; height: 28px; border-radius: 8px; border: 0; background: color-mix(in srgb, var(--on-ink) 14%, transparent); color: var(--on-ink); display: grid; place-items: center; cursor: pointer; }
.icon-btn { position: relative; width: 42px; height: 42px; border-radius: 13px; border: 1px solid var(--hair); background: var(--surface); display: grid; place-items: center; cursor: pointer; box-shadow: var(--sh); color: var(--ink-2); }
.icon-btn .badge { position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--bad); border: 2px solid var(--surface); }
.view { padding: 8px 28px 48px; display: grid; gap: 22px; align-content: start; animation: viewIn .3s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } }
.spacer { flex: 1; }

/* page head */
.ph { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.ph h1 { font-size: 28px; font-weight: 800; letter-spacing: -.025em; }
.ph p { color: var(--muted); margin-top: 4px; }
.ph .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== Dashboard ===== */
.hero { position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 28px 30px; color: #fff; background: radial-gradient(90% 120% at 100% 0%, rgba(217, 120, 63, .35), transparent 50%), radial-gradient(70% 90% at 0% 100%, rgba(74, 114, 245, .7), transparent 60%), linear-gradient(135deg, #13224f, #0b1533); box-shadow: var(--sh-lift); display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; }
.hero::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 28px 28px; mask-image: linear-gradient(90deg, transparent, #000 60%); pointer-events: none; }
.hero > * { position: relative; }
.hero .date { font-size: 13px; color: rgba(255,255,255,.7); display: flex; gap: 8px; align-items: center; }
.hero h1 { font-family: var(--display); font-weight: 600; font-size: 34px; margin: 8px 0 6px; letter-spacing: -.02em; }
.hero p { color: rgba(255,255,255,.75); }
.hero .cta { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.hero .btn-glass { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(8px); }
.hero .btn-glass:hover { background: rgba(255,255,255,.2); }
.hero-side { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: center; }
.glass { background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.14); border-radius: 18px; padding: 14px 16px; backdrop-filter: blur(10px); }
.glass .k { font-size: 12px; color: rgba(255,255,255,.65); display: flex; align-items: center; gap: 6px; }
.glass .v { font-size: 26px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.glass.gold .v { color: #f6b48a; }

.plan-strip { display: flex; align-items: center; gap: 18px; padding: 12px 16px 12px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--hair); box-shadow: var(--sh); flex-wrap: wrap; }
.plan-strip .meters { display: flex; gap: 22px; flex: 1; flex-wrap: wrap; min-width: 0; }
.meter { min-width: 120px; flex: 1; max-width: 220px; }
.meter .row { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.meter .row b { color: var(--ink); font-variant-numeric: tabular-nums; }
.bar { height: 7px; border-radius: 99px; background: var(--soft); overflow: hidden; border: 1px solid var(--hair); }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand-hi), var(--brand)); }
.bar.full i { background: linear-gradient(90deg, #f0bd5a, var(--warn)); }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.tile { padding: 18px; display: grid; gap: 12px; position: relative; overflow: hidden; transition: transform .2s, box-shadow .2s; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--sh-lift); }
.tile .t-head { display: flex; align-items: center; gap: 10px; }
.tile .t-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.t-ico.p { background: var(--tint); color: var(--brand); } .t-ico.g { background: var(--accent-tint); color: var(--accent-ink); } .t-ico.b { background: var(--ok-tint); color: var(--ok); } .t-ico.r { background: var(--bad-tint); color: var(--bad); } .t-ico.d { background: var(--ink); color: #fff; }
.tile .t-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.tile .t-val { font-size: 30px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.tile .t-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.spark { width: 90px; height: 30px; }
.spark path.l { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spark path.a { fill: url(#sg); opacity: .35; }

.cols { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; align-items: start; }
.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.panel { padding: 20px; display: grid; gap: 14px; align-content: start; min-width: 0; }
.panel-h { display: flex; align-items: center; gap: 10px; }
.panel-h h3 { font-size: 16px; font-weight: 700; }
.panel-h .more { margin-left: auto; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }

.hear-list { display: grid; gap: 10px; }
.hear { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; padding: 10px; border-radius: 14px; border: 1px solid var(--hair); transition: border-color .15s, background .15s; cursor: pointer; }
.hear:hover { border-color: var(--line); background: var(--soft); }
.dchip { width: 56px; height: 60px; border-radius: 14px; display: grid; place-items: center; align-content: center; background: var(--tint); color: var(--brand-ink); }
.dchip b { font-size: 20px; line-height: 1; font-weight: 800; }
.dchip small { font-size: 11px; font-weight: 700; text-transform: uppercase; }
.dchip.today { background: linear-gradient(160deg, var(--brand-hi), var(--brand-ink)); color: #fff; }
.hear .t { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hear .s { font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.hear .s span { display: inline-flex; gap: 4px; align-items: center; }
.hear > div { min-width: 0; }

.chart { width: 100%; height: 220px; }
.chart text { font: 600 11px var(--sans); fill: var(--muted); }
.chart .grid { stroke: var(--hair); }
.chart .b1 { fill: url(#bg1); } .chart .b2 { fill: var(--accent); opacity: .9; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.donut-wrap { display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: center; }
.donut { width: 150px; height: 150px; }
.donut text { font: 800 26px var(--sans); fill: var(--ink); }
.donut text.s { font: 600 11px var(--sans); fill: var(--muted); }
.stage-list { display: grid; gap: 7px; font-size: 13px; }
.stage-list div { display: flex; align-items: center; gap: 8px; }
.stage-list i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.stage-list b { margin-left: auto; font-variant-numeric: tabular-nums; }

.task-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--hair); }
.task-row:last-child { border-bottom: 0; }
.task-row > div { min-width: 0; flex: 1; }
.task-row .t { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row.done .t { text-decoration: line-through; color: var(--muted); }
.task-row small { color: var(--muted); font-size: 12px; }
.tick { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; flex: none; color: transparent; padding: 0; }
.tick:hover { border-color: var(--brand); }
.tick.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.tick .ico { width: 14px; height: 14px; stroke-width: 2.6; }
.prio { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.prio.high { background: var(--bad); } .prio.medium { background: var(--accent); } .prio.low { background: var(--line); }

.feed { display: grid; gap: 0; }
.feed-item { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 9px 0; position: relative; font-size: 13px; }
.feed-item::before { content: ''; position: absolute; left: 13.5px; top: 36px; bottom: -4px; width: 1px; background: var(--hair); }
.feed-item:last-child::before { display: none; }
.feed-item .fi { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--soft); color: var(--brand); border: 1px solid var(--hair); }
.feed-item .fi .ico { width: 14px; height: 14px; }
.feed-item small { color: var(--muted); display: block; font-size: 11.5px; }

.lim-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--warn-tint); }
.lim-row b { font-size: 13.5px; } .lim-row small { color: var(--warn); font-weight: 700; margin-left: auto; white-space: nowrap; }

/* ===== Tables / lists ===== */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar .input { max-width: 300px; height: 40px; min-height: 40px; }
.search-in { position: relative; flex: 1; max-width: 320px; }
.search-in .ico { position: absolute; left: 12px; top: 11px; color: var(--muted); }
.search-in .input { padding-left: 38px; max-width: none; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 34px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--hair); background: var(--surface); font-weight: 600; font-size: 13px; color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.chip b { font-size: 11px; opacity: .7; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--hair); white-space: nowrap; background: var(--soft); }
.tbl th:first-child { border-top-left-radius: 12px; } .tbl th:last-child { border-top-right-radius: 12px; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { cursor: pointer; transition: background .12s; }
.tbl tbody tr:hover { background: var(--tint-2); }
.tbl .who { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.tbl .who b { display: block; font-weight: 700; }
.tbl .who small { color: var(--muted); font-size: 12px; }
.tbl .r { text-align: right; }

/* client cards */
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.ccard { padding: 18px; display: grid; gap: 14px; cursor: pointer; transition: transform .2s, box-shadow .2s; }
.ccard:hover { transform: translateY(-2px); box-shadow: var(--sh-lift); }
.ccard .top-r { display: flex; gap: 12px; align-items: center; }
.ccard .top-r > div { min-width: 0; }
.ccard b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccard small { color: var(--muted); font-size: 12.5px; }
.ccard .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ccard .stats div { padding: 10px; border-radius: 12px; background: var(--soft); }
.ccard .stats span { font-size: 11.5px; color: var(--muted); display: block; }
.ccard .stats strong { font-size: 16px; font-variant-numeric: tabular-nums; }

/* kanban */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 14px; }
/* Matters board: fits the page, no scrollbar. Empty stages fold into slim rails and open up while you drag. */
.kboard { display: flex; align-items: stretch; gap: 12px; }
.kboard .lane { flex: 1 1 0; min-width: 0; transition: flex-basis .25s ease, background .15s, border-color .15s; }
.kboard .lane.folded { flex: 0 0 48px; padding: 12px 0; justify-items: center; cursor: default; }
.kboard .lane.folded .lane-h { writing-mode: vertical-rl; padding: 2px 0; gap: 10px; color: var(--muted); font-weight: 600; }
.kboard .lane.folded .lane-h span { margin: 0; order: -1; writing-mode: horizontal-tb; }
.kboard .lane.folded .lane-h i { order: -2; }
.kboard.is-dragging .lane.folded { flex: 1 1 0; padding: 12px; justify-items: stretch; border-style: dashed; }
.kboard.is-dragging .lane.folded .lane-h { writing-mode: horizontal-tb; }
.kboard.is-dragging .lane.folded .lane-h span { order: 0; margin-left: auto; }
.lane-h em { font-style: normal; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kboard .kcard b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kboard .kcard .meta > span:not(.pill):not(.av):not(.prio) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
@media (max-width: 1024px) {
  /* Phones and tablets: swipe between stages, snapping one lane at a time, with no visible scrollbar */
  .kboard { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 4px; scroll-padding: 0 16px; }
  .kboard::-webkit-scrollbar { display: none; }
  .kboard .lane, .kboard .lane.folded, .kboard.is-dragging .lane.folded { flex: 0 0 min(78vw, 300px); scroll-snap-align: start; padding: 12px; justify-items: stretch; }
  .kboard .lane.folded .lane-h { writing-mode: horizontal-tb; }
  .kboard .lane.folded .lane-h span { order: 0; margin-left: auto; }
}
.lane { background: var(--lane); border: 1px solid var(--hair); border-radius: 18px; padding: 12px; display: grid; gap: 10px; align-content: start; min-height: 200px; }
.lane.drop { background: var(--tint); border-color: var(--brand); }
.lane-h { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13.5px; padding: 2px 4px 4px; }
.lane-h i { width: 9px; height: 9px; border-radius: 3px; }
.lane-h span { margin-left: auto; font-size: 12px; color: var(--muted); }
.kcard { padding: 14px; display: grid; gap: 10px; cursor: grab; background: var(--surface); border: 1px solid var(--hair); border-radius: 14px; box-shadow: var(--sh); }
.kcard:active { cursor: grabbing; }
.kcard.dragging { opacity: .5; }
.kcard b { font-size: 14px; line-height: 1.3; }
.kcard .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }

/* stage tracker */
.track { display: flex; gap: 4px; }
.track i { flex: 1; height: 6px; border-radius: 99px; background: var(--hair); }
.track i.on { background: linear-gradient(90deg, var(--brand-hi), var(--brand)); }
.track i.cur { background: var(--accent); }

/* ===== Case detail ===== */
.case-hero { padding: 24px; display: grid; gap: 18px; background: linear-gradient(180deg, var(--surface), var(--surface)), var(--surface); position: relative; overflow: hidden; }
.case-hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(74, 114, 245,.14), transparent 70%); }
.case-hero h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.case-hero .sub { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-top: 6px; }
.case-hero .sub span { display: inline-flex; gap: 5px; align-items: center; }
.kv { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.kv div { padding: 12px 14px; border-radius: 14px; background: var(--soft); border: 1px solid var(--hair); min-width: 0; }
.kv span { font-size: 11.5px; color: var(--muted); display: block; font-weight: 600; }
.kv b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.stepper { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.stepper button { border: 0; background: none; padding: 0; cursor: pointer; text-align: left; font: 600 11.5px var(--sans); color: var(--muted); display: grid; gap: 6px; }
.stepper button i { height: 6px; border-radius: 99px; background: var(--hair); display: block; }
.stepper button.done i { background: var(--brand); } .stepper button.cur i { background: var(--accent); } .stepper button.cur { color: var(--ink); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--hair); overflow-x: auto; }
.tabs button { height: 42px; padding: 0 14px; border: 0; background: none; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; display: inline-flex; gap: 7px; align-items: center; white-space: nowrap; }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }
.tabs button b { font-size: 11px; padding: 1px 7px; border-radius: 99px; background: var(--soft); color: var(--muted); }
.timeline { display: grid; gap: 0; }
.tl { display: grid; grid-template-columns: 22px 1fr; gap: 14px; padding-bottom: 18px; position: relative; }
.tl::before { content: ''; position: absolute; left: 10px; top: 22px; bottom: 0; width: 2px; background: var(--hair); }
.tl:last-child::before { display: none; }
.tl .dot { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--tint); background: var(--brand); margin-top: 2px; }
.tl .dot.done { background: var(--ok); border-color: var(--ok-tint); } .tl .dot.adjourned { background: var(--accent); border-color: var(--accent-tint); }
.tl .box { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--hair); background: var(--surface); display: grid; gap: 4px; }
.tl .box .h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.note { padding: 14px; border-radius: 14px; background: var(--note-bg); border: 1px solid var(--note-line); display: grid; gap: 8px; white-space: pre-wrap; }
.note.pinned { background: var(--accent-tint); }
.note small { color: var(--muted); }
.doc { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; border: 1px solid var(--hair); background: var(--surface); }
.doc .ext { width: 42px; height: 48px; border-radius: 10px; display: grid; place-items: center; font: 800 10px var(--sans); color: #fff; text-transform: uppercase; flex: none; }
.doc > div { min-width: 0; flex: 1; }
.doc b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.doc small { color: var(--muted); font-size: 12px; }
.dropzone { border: 2px dashed var(--line); border-radius: 18px; padding: 26px; display: grid; place-items: center; gap: 8px; text-align: center; color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--tint-2); color: var(--brand-ink); }
.dropzone .ico { width: 30px; height: 30px; color: var(--brand); }

/* ===== Calendar ===== */
.cal { padding: 0; overflow: hidden; }
.cal-h { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--soft); border-bottom: 1px solid var(--hair); }
.cal-h div { padding: 10px; font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; }
.cal-g { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-d { min-height: 116px; border-right: 1px solid var(--hair); border-bottom: 1px solid var(--hair); padding: 8px; display: grid; gap: 4px; align-content: start; min-width: 0; }
.cal-d:nth-child(7n) { border-right: 0; }
.cal-d .n { font-size: 12.5px; font-weight: 700; color: var(--ink-2); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; }
.cal-d.out { background: var(--soft); } .cal-d.out .n { color: var(--line); }
.cal-d.today .n { background: var(--brand); color: #fff; }
.ev { font-size: 11.5px; font-weight: 600; padding: 3px 7px; border-radius: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; border-left: 3px solid; }
.ev.hearing { background: var(--tint); color: var(--brand-ink); border-color: var(--brand); }
.ev.task { background: var(--ok-tint); color: var(--ok-ink); border-color: var(--ok); }
.ev.limitation { background: var(--bad-tint); color: var(--bad); border-color: var(--bad); }
.ev.done { opacity: .5; text-decoration: line-through; }
.agenda { display: grid; gap: 10px; }

/* ===== Invoices ===== */
.inv-paper { padding: 40px; background: var(--paper); max-width: 820px; width: 100%; margin: 0 auto; display: grid; gap: 28px; }
.inv-paper .ih { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.inv-paper h2 { font-family: var(--display); font-size: 32px; }
.inv-paper .tbl tbody tr { cursor: default; }
.inv-paper .tot { margin-left: auto; width: min(300px, 100%); display: grid; gap: 8px; }
.inv-paper .tot div { display: flex; justify-content: space-between; }
.inv-paper .tot .g { font-size: 20px; font-weight: 800; padding-top: 10px; border-top: 2px solid var(--ink); }
.status-dot { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12.5px; }
.status-dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.s-draft { color: var(--muted); } .s-sent { color: var(--ok); } .s-paid { color: var(--brand); } .s-void { color: var(--bad); } .s-overdue { color: var(--warn); }
.line-items { display: grid; gap: 8px; }
.line-item { display: grid; grid-template-columns: 1fr 70px 100px 34px; gap: 8px; }
.te-pick { display: grid; gap: 6px; max-height: 220px; overflow: auto; padding: 4px; border: 1px solid var(--hair); border-radius: 12px; }
.te-pick label { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 10px; font-size: 13px; cursor: pointer; }
.te-pick label:hover { background: var(--soft); }
.te-pick label span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== Empty / locked / upgrade ===== */
.empty { padding: 48px 20px; display: grid; place-items: center; text-align: center; gap: 10px; }
.empty .e-ico { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--tint); color: var(--brand); margin-bottom: 6px; }
.empty .e-ico .ico { width: 28px; height: 28px; }
.empty h3 { font-size: 18px; } .empty p { color: var(--muted); max-width: 340px; margin-bottom: 8px; }
.locked { display: grid; grid-template-columns: 1fr 1.05fr; overflow: hidden; padding: 0; min-height: 420px; }
.locked .l { padding: 40px; display: grid; gap: 14px; align-content: center; }
.locked h2 { font-size: 30px; font-weight: 800; letter-spacing: -.025em; }
.ticks { display: grid; gap: 10px; margin: 6px 0; padding: 0; list-style: none; }
.ticks li { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.ticks li .ico { width: 20px; height: 20px; padding: 3px; border-radius: 50%; background: var(--tint); color: var(--brand); stroke-width: 2.6; }
.locked .r { position: relative; background: radial-gradient(80% 80% at 80% 20%, rgba(217, 120, 63,.45), transparent 60%), linear-gradient(140deg, #4a72f5, #13224f); display: grid; place-items: center; padding: 30px; overflow: hidden; }
.locked .r::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.14) 1px, transparent 1px); background-size: 18px 18px; }
.tilt { position: relative; width: min(340px, 100%); transform: perspective(900px) rotateY(-12deg) rotateX(6deg); padding: 18px; border-radius: 20px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); backdrop-filter: blur(12px); box-shadow: 0 30px 60px rgba(0,0,0,.3); color: #fff; display: grid; gap: 10px; }
.tilt .row { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; background: rgba(255,255,255,.12); font-size: 13px; }
.tilt .row .av { width: 28px; height: 28px; border-radius: 9px; font-size: 11px; }
.modal-ico { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--tint); color: var(--brand); margin-bottom: 14px; }
.modal-ico.gold { background: linear-gradient(140deg, #f6b48a, var(--accent)); color: #2a1206; }
.modal-ico.bad { background: var(--bad-tint); color: var(--bad); }
.modal h3 { font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.modal p.muted { margin-top: 6px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }
.adds { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.adds div { padding: 12px; border-radius: 14px; background: var(--soft); border: 1px solid var(--hair); display: flex; gap: 10px; align-items: center; font-weight: 600; font-size: 13px; }
.adds .ico { color: var(--brand); }

/* ===== Plan page ===== */
.plan-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 16px; align-items: stretch; }
.cur-plan { padding: 24px; display: grid; gap: 18px; align-content: start; }
.cur-plan .name { display: flex; align-items: center; gap: 12px; }
.cur-plan .name h2 { font-size: 26px; font-weight: 800; }
.usage-list { display: grid; gap: 16px; }
.usage-list .meter { max-width: none; }
.up-card { padding: 26px; border-radius: var(--r-lg); color: #fff; background: radial-gradient(80% 70% at 100% 0%, rgba(217, 120, 63,.4), transparent 55%), linear-gradient(150deg, #16328f, #0b1533); box-shadow: var(--sh-lift); display: grid; gap: 16px; position: relative; overflow: hidden; }
.up-card::after { content: ''; position: absolute; right: -50px; bottom: -50px; width: 200px; height: 200px; border-radius: 50%; border: 30px solid rgba(255,255,255,.05); }
.up-card > * { position: relative; z-index: 1; }
.up-card .price { font-size: 44px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.up-card .price small { font-size: 15px; font-weight: 500; opacity: .7; }
.up-card .seg { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); }
.up-card .seg button { color: rgba(255,255,255,.7); }
.up-card .seg button.on { background: #fff; color: #0f1730; }
.up-card .ticks li .ico { background: rgba(255,255,255,.14); color: #f6b48a; }
.up-card .save { color: #f6b48a; font-weight: 700; font-size: 12px; }
.plans-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.pcard { padding: 22px; display: grid; gap: 12px; align-content: start; position: relative; }
.pcard.cur { outline: 2px solid var(--brand); }
.pcard h4 { font-size: 17px; } .pcard .pp { font-size: 30px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pcard .pp small { font-size: 13px; color: var(--muted); font-weight: 500; }
.pcard .ticks li { font-size: 13px; }
.pay-mock { display: grid; gap: 14px; }
.pay-mock .card-vis { padding: 18px; border-radius: 16px; color: #fff; background: linear-gradient(135deg, #13224f, #2450e0); display: grid; gap: 18px; }

/* ===== Onboarding ===== */
.opt-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.opt { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; font-weight: 600; transition: border-color .15s, background .15s, transform .12s; }
.opt:hover { border-color: var(--brand-hi); }
.opt.on { border-color: var(--brand); background: var(--tint-2); box-shadow: 0 0 0 4px rgba(36, 80, 224,.1); }
.opt .oi { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--soft); color: var(--brand); flex: none; }
.opt.on .oi { background: var(--brand); color: #fff; }
.opt small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.tagpick { display: flex; flex-wrap: wrap; gap: 8px; }
.tagpick button { height: 38px; padding: 0 14px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 600; font-size: 13px; cursor: pointer; }
.tagpick button.on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.preview { position: relative; width: min(400px, 100%); display: grid; gap: 12px; }
.preview .glass { color: #fff; }
.preview .pv-h { display: flex; align-items: center; gap: 12px; }
.preview .pv-h b { font-size: 17px; display: block; }
.preview .pv-h small { color: rgba(255,255,255,.65); }
.preview .tagrow { display: flex; flex-wrap: wrap; gap: 6px; }
.preview .tagrow span { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: rgba(255,255,255,.14); }
.float { animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px); } }

/* ===== Command palette & notifications ===== */
.cmd { width: min(620px, 100%); padding: 0; align-self: start; margin-top: calc(10vh / var(--z)); overflow: hidden; }
.cmd-in { display: flex; gap: 12px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--hair); }
.cmd-in input { border: 0; outline: none; flex: 1; font-size: 16px; background: none; }
.cmd-res { max-height: calc(56vh / var(--z)); overflow: auto; padding: 8px; }
.cmd-res h5 { margin: 8px 12px 4px; font-size: 11.5px; color: var(--muted); }
.cmd-res a { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; color: var(--ink); }
.cmd-res a.sel, .cmd-res a:hover { background: var(--tint); }
.cmd-res a small { margin-left: auto; color: var(--muted); }
.notif { position: absolute; right: 0; top: 52px; width: 360px; max-width: calc(100vw - 32px); padding: 8px; z-index: 50; display: grid; gap: 2px; max-height: calc(70vh / var(--z)); overflow: auto; }
.notif a { display: flex; gap: 12px; padding: 10px; border-radius: 12px; color: var(--ink); align-items: center; }
.notif a:hover { background: var(--soft); }
.notif a > div { min-width: 0; }
.notif a b { font-size: 13px; display: block; } .notif a small { color: var(--muted); font-size: 12px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif .ni { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.rel { position: relative; }

.settings-grid { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
.snav { display: grid; gap: 4px; position: sticky; top: 90px; }
.snav button { display: flex; gap: 10px; align-items: center; height: 40px; padding: 0 12px; border: 0; background: none; border-radius: 11px; font-weight: 600; color: var(--ink-2); cursor: pointer; text-align: left; }
.snav button.on { background: var(--surface); color: var(--brand); box-shadow: var(--sh); }
.sess { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; border: 1px solid var(--hair); }
.sess > div { flex: 1; min-width: 0; } .sess small { color: var(--muted); display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.danger-zone { border-color: var(--bad-tint); }
.skeleton { background: linear-gradient(90deg, var(--soft), #e9edf6, var(--soft)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 14px; min-height: 120px; }
@keyframes sk { to { background-position: -200% 0; } }
.mob-scrim { display: none; }
.confirm { text-align: left; }

/* ===== Responsive ===== */
@media (max-width: 1200px) { .tiles { grid-template-columns: repeat(2, 1fr); } .kv { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 1024px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-100%); transition: transform .25s; }
  .side.open { transform: none; box-shadow: var(--sh-lift); }
  .mob-scrim.open { display: block; position: fixed; inset: 0; background: rgba(9, 14, 34,.4); z-index: 35; }
  .top .menu-btn { display: grid; }
  .cols, .plan-grid, .hero, .locked { grid-template-columns: 1fr; }
  .cols-3, .plans-row { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; } .snav { position: static; display: flex; overflow-x: auto; }
  .snav button { white-space: nowrap; }
}
@media (max-width: 640px) {
  .top { padding: 12px 16px; gap: 8px; } .view { padding: 4px 16px 40px; gap: 16px; }
  .search-btn kbd, .search-btn span { display: none; } .search-btn { flex: 0 0 42px; width: 42px; padding: 0; justify-content: center; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; } .tile { padding: 14px; } .tile .t-val { font-size: 24px; } .spark { display: none; }
  .hero { padding: 22px; } .hero h1 { font-size: 27px; }
  .hero-side { grid-template-columns: 1fr 1fr; } .glass .v { font-size: 21px; }
  .ph h1 { font-size: 24px; } .ph .actions { margin-left: 0; width: 100%; }
  .kv { grid-template-columns: 1fr 1fr; } .stepper { grid-template-columns: repeat(7, minmax(0, 1fr)); } .stepper button { font-size: 0; }
  .cal-d { min-height: 64px; padding: 4px; } .ev { font-size: 0; padding: 0; height: 6px; border-left-width: 0; } .cal-h div { font-size: 11px; padding: 8px 2px; }
  .donut-wrap { grid-template-columns: 1fr; justify-items: center; } .stage-list { width: 100%; }
  .locked .l { padding: 26px; } .locked h2 { font-size: 24px; }
  .adds { grid-template-columns: 1fr; } .opt-grid { grid-template-columns: 1fr; }
  .inv-paper { padding: 22px; } .line-item { grid-template-columns: 1fr 56px 80px 34px; }
  .timer-chip span.lbl { display: none; }
  .plan-strip .meters { gap: 14px; } .meter { min-width: 100px; }
  .tbl .hide-m { display: none; }
}
@media print {
  .side, .top, .no-print, .toasts { display: none !important; }
  .shell { display: block; } .view { padding: 0; } body { background: #fff; } .inv-paper { box-shadow: none; border: 0; }
}
/* small helpers */
.muted-w { color: rgba(255,255,255,.72); }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.tile-ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; }
.view-inner { display: grid; gap: 16px; min-width: 0; }
.up-card h2.display { font-size: 32px; }
.up-card [data-big] { font-size: 28px; }
.grid-note { display: grid; gap: 10px; }
button.doc { cursor: pointer; text-align: left; font: inherit; }
a.doc { color: var(--ink); }
.app-loading { min-height: calc(100vh / var(--z)); display: grid; place-items: center; }
.app-loading .logo-mark { width: 52px; height: 52px; border-radius: 16px; animation: float 1.6s ease-in-out infinite; }
@media (max-width: 640px) { .hide-s { display: none; } }
.pill.clip { max-width: 180px; overflow: hidden; text-overflow: ellipsis; display: inline-block; line-height: 26px; }
@media (max-width: 640px) { .hear .pill.clip { display: none; } }
/* compact sidebar on shorter screens so the user chip stays visible */
@media (max-height: 960px), (min-width: 1680px) and (max-height: 1075px), (min-width: 1900px) and (max-height: 1200px), (min-width: 2200px) and (max-height: 1344px), (min-width: 2500px) and (max-height: 1536px), (min-width: 3200px) and (max-height: 1920px) {
  .side { gap: 10px; padding: 14px 12px; }
  .nav a { height: 36px; }
  .nav-label { padding: 6px 10px 2px; }
  .side { gap: 8px; }
  .nav a { height: 34px; }
  .nav-label { padding: 5px 10px 1px; }
  .side .logo { padding: 2px 8px 6px; }
  .ws { padding: 8px 10px; }
  /* upgrade card becomes one slim row */
  .side-promo { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 7px 7px 14px; border-radius: 14px; }
  .side-promo::after { display: none; }
  .side-promo p, .side-promo .crown { display: none; }
  .side-promo b { margin: 0; font-size: 13.5px; }
  .side-promo .btn-block { width: auto; min-height: 32px; padding: 0 14px; }
  .me-chip { padding: 6px 6px 6px 8px; }
}
/* the sidebar never shows a scrollbar; on very short screens it can still be scrolled with the wheel or trackpad */
.side { scrollbar-width: none; overscroll-behavior: contain; }
.side::-webkit-scrollbar { display: none; }
/* platform owner link */
.nav a .plat-dot { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: #f6b48a; box-shadow: 0 0 0 3px rgba(246, 180, 138, .18); }
.case-hero .sub a { display: inline-flex; gap: 5px; align-items: center; }
.up-card .price small, .pcard .pp small { letter-spacing: 0; margin-left: 4px; }
.pcard { justify-items: start; }
.pcard .btn { width: 100%; margin-top: auto; }
.card-vis .price { font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.meter .row span { white-space: nowrap; } .meter .row b { white-space: nowrap; }
@media (max-width: 640px) {
  .plan-strip { flex-direction: column; align-items: stretch; gap: 14px; }
  .plan-strip .meters { display: grid; grid-template-columns: 1fr; gap: 12px; }
  .plan-strip .meter { max-width: none; }
  .plan-strip > .pill { align-self: flex-start; }
  .plan-strip > .btn { width: 100%; }
}
.plan-grid > *, .cols > *, .hero > * { min-width: 0; } .cur-plan .name { flex-wrap: wrap; } .up-card .toolbar { flex-wrap: wrap; } .up-card .price { font-size: clamp(32px, 9vw, 44px); }
.side > * { flex-shrink: 0; }
.g-chip { display: inline-flex; gap: 8px; align-items: center; padding: 6px 12px; border-radius: 99px; background: var(--soft); border: 1px solid var(--hair); font-weight: 600; font-size: 13px; }

/* ===== Dark theme (app only: html.app). Follows the device unless the user picks light/dark. ===== */
@media (prefers-color-scheme: dark) {
  html.app:not([data-theme="light"]) {
    --bg: #0a1020; --surface: #111a30; --raised: #16203a; --soft: #152039; --hair: #1f2b47; --line: #2c3a5c;
    --ink: #e8edf8; --ink-2: #c3cbe0; --muted: #8d97b4; --on-ink: #0a1020;
    --brand: #4a72f5; --brand-hi: #6a8cff; --brand-ink: #b3c4ff; --tint: #172a5e; --tint-2: #121e3f; --tint-hover: #1f3672;
    --accent-ink: #f6b48a; --accent-tint: #3a2215; --ok: #b39af5; --ok-tint: #261c47; --ok-ink: #cdb9ff;
    --warn: #f2aa45; --warn-tint: #3a2a10; --bad: #ff6b81; --bad-tint: #3e1622; --grey: #1c2641;
    --note-bg: #1f1812; --note-line: #3d2b1d; --topbar: rgba(10, 16, 32, .82); --lane: rgba(17, 26, 48, .6); --paper: #111a30;
    --sh: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25); --sh-lift: 0 2px 6px rgba(0, 0, 0, .35), 0 18px 48px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
html.app[data-theme="dark"] {
  --bg: #0a1020; --surface: #111a30; --raised: #16203a; --soft: #152039; --hair: #1f2b47; --line: #2c3a5c;
  --ink: #e8edf8; --ink-2: #c3cbe0; --muted: #8d97b4; --on-ink: #0a1020;
  --brand: #4a72f5; --brand-hi: #6a8cff; --brand-ink: #b3c4ff; --tint: #172a5e; --tint-2: #121e3f; --tint-hover: #1f3672;
  --accent-ink: #f6b48a; --accent-tint: #3a2215; --ok: #b39af5; --ok-tint: #261c47; --ok-ink: #cdb9ff;
  --warn: #f2aa45; --warn-tint: #3a2a10; --bad: #ff6b81; --bad-tint: #3e1622; --grey: #1c2641;
  --note-bg: #1f1812; --note-line: #3d2b1d; --topbar: rgba(10, 16, 32, .82); --lane: rgba(17, 26, 48, .6); --paper: #111a30;
  --sh: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25); --sh-lift: 0 2px 6px rgba(0, 0, 0, .35), 0 18px 48px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
.donut .trk { stroke: var(--hair); }
.skeleton { background: linear-gradient(90deg, var(--soft), var(--hair), var(--soft)); background-size: 200% 100%; }

/* payments on invoices */
.s-partial { color: var(--accent); }
.inv-paper .tot .bal { font-weight: 800; color: var(--accent-ink); }
.pay-list { display: grid; gap: 6px; padding-top: 12px; border-top: 1px dashed var(--line); }
.pay-row { display: grid; grid-template-columns: 18px auto 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; }
.pay-row .ico { color: var(--ok); }
.t-ico.d { background: var(--ink); color: var(--on-ink); }

/* drafts */
.drafts { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.tpl-list { display: grid; gap: 8px; }
.tpl { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 16px; border: 1px solid var(--hair); background: var(--surface); text-align: left; cursor: pointer; font: inherit; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.tpl:hover { border-color: var(--line); }
.tpl.on { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent); }
.tpl b { display: block; font-size: 14px; } .tpl small { color: var(--muted); font-size: 12px; }
.tpl-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--tint); color: var(--brand); flex: none; }
.tpl.on .tpl-ico { background: var(--brand); color: #fff; }
.draft-pane .toolbar { align-items: flex-end; }
.field.grow { flex: 1; min-width: 200px; }
.row-btns.end { margin-left: auto; }
.doc-paper { min-height: 520px; font: 15px/1.7 Georgia, 'Times New Roman', serif; padding: 28px 32px; background: var(--paper); white-space: pre-wrap; }
@media (max-width: 1024px) { .drafts { grid-template-columns: 1fr; } .tpl-list { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }
@media (max-width: 640px) { .doc-paper { padding: 16px; font-size: 14px; min-height: 420px; } }
/* shortcuts */
.kbd-list { display: grid; gap: 8px; margin-top: 16px; }
.kbd-list div { display: flex; gap: 12px; align-items: center; }
.kbd-list kbd { min-width: 96px; font: 700 12px var(--sans); padding: 5px 8px; border-radius: 8px; background: var(--soft); border: 1px solid var(--line); text-align: center; }
.small-note { font-size: 12.5px; margin-top: 10px; }

/* ===== Redesign v2: clients, documents, team, settings, conflict, ageing ===== */
.sum-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.sum { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--hair); box-shadow: var(--sh); }
.sum .t-ico { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.sum b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.sum small { color: var(--muted); font-size: 12.5px; }
.sum.hot { background: linear-gradient(135deg, var(--surface), var(--accent-tint)); }
.cgrid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.ccard2 { padding: 18px; display: grid; gap: 14px; cursor: pointer; transition: transform .2s, box-shadow .2s, border-color .2s; }
.ccard2:hover { transform: translateY(-2px); box-shadow: var(--sh-lift); border-color: var(--line); }
.ccard2:hover .cc-go { background: var(--brand); color: #fff; }
.cc-top { display: flex; gap: 14px; align-items: center; }
.cc-name { min-width: 0; flex: 1; } .cc-name b { display: block; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .cc-name small { color: var(--muted); font-size: 12.5px; }
.cc-contact { display: grid; gap: 6px; padding: 12px; border-radius: 14px; background: var(--soft); font-size: 13px; color: var(--ink-2); min-height: 62px; align-content: center; }
.cc-contact span { display: flex; gap: 8px; align-items: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-contact .ico { color: var(--muted); }
.cc-foot { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cc-go { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--soft); color: var(--ink-2); transition: background .2s, color .2s; }
.hero-empty { padding: 48px 24px; display: grid; justify-items: center; text-align: center; gap: 12px; background: radial-gradient(60% 80% at 50% 0%, var(--tint), transparent 70%), var(--surface); }
.hero-empty h2 { font-family: var(--display); font-size: 28px; } .hero-empty p { max-width: 420px; }
.he-art { display: flex; margin-bottom: 8px; } .he-art .av { border: 3px solid var(--surface); margin-left: -12px; box-shadow: var(--sh); } .he-art .av:first-child { margin-left: 0; }
.he-art.docs { gap: 10px; } .he-art.docs .fbadge:nth-child(1) { transform: rotate(-8deg); } .he-art.docs .fbadge:nth-child(3) { transform: rotate(8deg); }
.storage { padding: 20px 24px; display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.st-ring .donut { width: 120px; height: 120px; } .st-ring .donut text { font-size: 24px; }
.st-copy { flex: 1; min-width: 240px; display: grid; gap: 10px; } .st-copy h3 { font-size: 22px; } .st-copy h3 .muted { font-size: 15px; font-weight: 500; }
.st-kinds { display: flex; gap: 8px; flex-wrap: wrap; }
.st-k { display: inline-flex; gap: 8px; align-items: center; height: 34px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--hair); background: var(--soft); font: 600 13px var(--sans); color: var(--ink-2); cursor: pointer; }
.st-k.on { border-color: var(--brand); background: var(--tint); color: var(--brand-ink); }
.st-k i { width: 9px; height: 9px; border-radius: 3px; } .st-k b { color: var(--muted); }
.doc-group { display: grid; gap: 10px; }
.dg-h { display: flex; gap: 10px; align-items: center; } .dg-h .t-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; } .dg-h a { color: var(--ink); }
.ftiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.ftile { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--hair); box-shadow: var(--sh); transition: border-color .15s; }
.ftile:hover { border-color: var(--line); }
.ft-meta { min-width: 0; flex: 1; } .ft-meta b { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ft-meta small { color: var(--muted); font-size: 12px; }
.fbadge { width: 44px; height: 52px; border-radius: 10px; color: #fff; display: grid; place-items: center; align-content: center; gap: 1px; flex: none; position: relative; box-shadow: inset 0 -14px 0 rgba(0,0,0,.12); }
.fbadge .ico { width: 18px; height: 18px; } .fbadge em { font: 800 9px var(--sans); font-style: normal; text-transform: uppercase; letter-spacing: .04em; }
.seat-hero { padding: 22px 24px; display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.seat-big { font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1; margin: 6px 0 4px; } .seat-big small { font-size: 18px; color: var(--muted); font-weight: 600; }
.seat-dots { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; min-width: 200px; }
.seat-dots i { width: 34px; height: 34px; border-radius: 11px; border: 2px dashed var(--line); }
.seat-dots i.on { border: 0; background: linear-gradient(145deg, var(--brand-hi), var(--brand-ink)); box-shadow: 0 4px 10px color-mix(in srgb, var(--brand) 30%, transparent); }
.seat-dots i.pend { border: 2px solid var(--brand); background: var(--tint); }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.mcard { padding: 18px; display: grid; gap: 12px; align-content: start; }
.mc-top { display: flex; justify-content: space-between; align-items: flex-start; }
.mc-id b { display: block; font-size: 15.5px; } .mc-id small { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.mc-foot { display: flex; gap: 8px; align-items: center; }
.select.sm { min-height: 34px; height: 34px; padding: 4px 10px; width: auto; border-radius: 10px; font-size: 13px; text-transform: capitalize; }
.mcard .pill { text-transform: capitalize; }
.mcard.pending { border-style: dashed; background: var(--soft); box-shadow: none; }
.av.inv { background: var(--tint); color: var(--brand); }
.mcard.add { border: 2px dashed var(--line); border-radius: var(--r); background: transparent; display: grid; place-items: center; align-content: center; gap: 6px; min-height: 190px; cursor: pointer; color: var(--muted); font: inherit; transition: border-color .15s, color .15s, background .15s; }
.mcard.add:hover { border-color: var(--brand); color: var(--brand); background: var(--tint-2); } .mcard.add b { color: var(--ink); }
.roles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.role { padding: 16px; border-radius: 16px; background: var(--soft); border: 1px solid var(--hair); display: grid; gap: 6px; align-content: start; }
.role .t-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 4px; }
.role .ticks { margin-top: 6px; gap: 6px; } .role .ticks li { font-size: 13px; }
.firm-form { display: grid; gap: 16px; }
.firm-cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.firm-main { display: grid; gap: 16px; min-width: 0; }
.firm-main .panel-h .t-ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; }
.firm-side { position: sticky; top: calc(84px / var(--z)); }
.inv-pv { padding: 20px; display: grid; gap: 16px; }
.ipv-head { display: flex; gap: 12px; } .ipv-head b { display: block; font-size: 16px; } .ipv-head small { display: block; color: var(--muted); font-size: 12px; white-space: pre-wrap; }
.ipv-rows { display: grid; gap: 8px; padding: 12px 0; border-block: 1px dashed var(--line); }
.ipv-rows div { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; } .ipv-rows span { color: var(--muted); } .ipv-rows b { overflow-wrap: anywhere; text-align: right; }
.ipv-inv { display: flex; justify-content: space-between; align-items: baseline; } .ipv-inv .display { font-size: 24px; }
.seg.wide { display: flex; } .seg.wide label { flex: 1; height: 34px; border-radius: 9px; display: grid; place-items: center; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg.wide label.on { background: var(--ink); color: var(--on-ink); } .seg.wide input { position: absolute; opacity: 0; pointer-events: none; }
.tagin { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; min-height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: text; }
.tagin:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 12%, transparent); }
.tg { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 4px 0 10px; border-radius: 9px; background: var(--tint); color: var(--brand-ink); font-weight: 600; font-size: 13px; }
.tg button { width: 22px; height: 22px; border: 0; border-radius: 6px; background: transparent; color: inherit; display: grid; place-items: center; cursor: pointer; } .tg button:hover { background: color-mix(in srgb, var(--brand) 18%, transparent); }
.tg-in { flex: 1; min-width: 160px; border: 0; outline: none; background: transparent; padding: 4px 6px; }
.savebar { position: sticky; bottom: 16px; z-index: 20; display: flex; gap: 10px; align-items: center; padding: 10px 12px 10px 18px; border-radius: 16px; background: var(--ink); color: var(--on-ink); box-shadow: var(--sh-lift); animation: tIn .2s ease; }
.savebar .btn-ghost { background: transparent; color: var(--on-ink); border-color: color-mix(in srgb, var(--on-ink) 30%, transparent); }
.cf-hero { position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 32px; color: #fff; display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: center; background: radial-gradient(80% 100% at 100% 0%, rgba(217, 120, 63, .35), transparent 55%), linear-gradient(140deg, #13224f, #0b1533); box-shadow: var(--sh-lift); }
.cf-hero::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px); background-size: 20px 20px; mask-image: linear-gradient(90deg, transparent, #000); pointer-events: none; }
.cf-hero > * { position: relative; min-width: 0; }
.cf-copy { display: grid; gap: 14px; } .cf-copy h2 { font-family: var(--display); font-size: 30px; line-height: 1.15; }
.cf-search { display: flex; gap: 10px; align-items: center; padding: 8px 8px 8px 16px; border-radius: 16px; background: #fff; color: #0f1730; box-shadow: 0 12px 30px rgba(0,0,0,.25); }
.cf-search .ico { color: #6b7591; } .cf-search input { flex: 1; min-width: 0; border: 0; outline: none; font-size: 16px; background: transparent; color: #0f1730; height: 42px; }
.cf-recent { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; } .cf-recent small { color: rgba(255,255,255,.6); margin-right: 4px; }
.cf-chip { height: 30px; padding: 0 12px; border-radius: 99px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: #fff; font: 600 12.5px var(--sans); cursor: pointer; } .cf-chip:hover { background: rgba(255,255,255,.16); }
.cf-legend { display: grid; gap: 10px; } .cf-legend .glass { display: flex; gap: 12px; align-items: center; font-size: 13.5px; } .cf-legend .pill { min-width: 76px; justify-content: center; }
.cf-clear { padding: 24px; display: flex; gap: 18px; align-items: center; } .cf-ok { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--ok-tint); color: var(--ok); flex: none; }
.dchip.risk { background: var(--bad-tint); color: var(--bad); }
.aging { gap: 12px; } .ag-bar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--soft); gap: 2px; } .ag-bar i { display: block; height: 100%; }
.ag-legend { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; } .ag-legend div { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); } .ag-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; } .ag-legend b { margin-left: auto; color: var(--ink); }
@media (max-width: 1200px) { .roles { grid-template-columns: 1fr 1fr; } .firm-cols { grid-template-columns: 1fr; } .firm-side { position: static; order: -1; } }
@media (max-width: 1024px) { .cf-hero { grid-template-columns: 1fr; } .sum-strip { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .roles, .ag-legend { grid-template-columns: 1fr; } .cf-hero { padding: 22px; } .cf-copy h2 { font-size: 23px; } .cf-search .btn { padding: 0 12px; } .seat-dots i { width: 26px; height: 26px; border-radius: 8px; } .storage { padding: 18px; } .cgrid2, .ftiles { grid-template-columns: 1fr; } .sum b { font-size: 18px; } }
.ccard2, .mcard, .role { grid-template-columns: minmax(0, 1fr); } .cc-contact span { min-width: 0; } .cc-contact span:not(.muted) { display: block; } .cc-contact span .ico { display: inline-block; vertical-align: -3px; margin-right: 8px; }


/* ===== Setup popup (CAFlow style) and the "all set" screen ===== */
.su-scrim { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 20px; background: rgba(9, 14, 34, .55); backdrop-filter: blur(6px); animation: suFade .2s ease; }
@keyframes suFade { from { opacity: 0; } }
.su { width: min(720px, 100%); max-height: calc(100dvh - 40px); display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--hair); border-radius: 24px; box-shadow: 0 30px 80px rgba(9, 14, 34, .35); animation: suPop .26s cubic-bezier(.2, .9, .3, 1.1); }
@keyframes suPop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.su-h { padding: 26px 32px 20px; text-align: center; border-bottom: 1px solid var(--hair); background: radial-gradient(120% 140% at 50% -40%, rgba(36, 80, 224, .14), transparent 60%); display: grid; justify-items: center; gap: 4px; }
.su-eyebrow { font-size: 12px; font-weight: 700; color: var(--brand); letter-spacing: .01em; }
.su-h h2 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.su-h p { color: var(--muted); font-size: 14px; max-width: 480px; }
.su-steps { list-style: none; display: flex; justify-content: center; align-items: center; margin: 16px 0 0; padding: 0; flex-wrap: wrap; row-gap: 8px; }
.su-steps li { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.su-steps li em { font-style: normal; }
.su-steps li + li::before { content: ''; width: 36px; height: 2px; margin: 0 10px; border-radius: 2px; background: var(--line); }
.su-steps li.done::before, .su-steps li.on::before { background: var(--brand); }
.su-steps li > span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); font-size: 12px; font-weight: 700; flex: none; }
.su-steps li > span .ico { width: 13px; height: 13px; stroke-width: 2.8; }
.su-steps li.on { color: var(--ink); } .su-steps li.on > span { border-color: var(--brand); color: var(--brand); }
.su-steps li.done > span { background: var(--brand); border-color: var(--brand); color: #fff; }
.su-body { padding: 22px 32px 24px; overflow-y: auto; overscroll-behavior: contain; display: grid; gap: 16px; align-content: start; }
.su-body h3 { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.su-lead { color: var(--muted); font-size: 14px; margin-top: -8px; }
.su-f { display: flex; align-items: center; gap: 10px; padding: 14px 32px; border-top: 1px solid var(--hair); background: var(--surface); }
.su-f .spacer { flex: 1; }
.btn-link { background: none; border: 0; color: var(--muted); font-weight: 600; padding: 0 8px; }
.btn-link:hover { color: var(--ink); }

/* "all set" screen */
.su-ok { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(140deg, var(--brand-hi), var(--brand)); box-shadow: 0 0 0 8px rgba(36, 80, 224, .14); margin-bottom: 8px; }
.su-ok .ico { width: 24px; height: 24px; stroke-width: 2.6; }
.su-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; border-radius: 16px; overflow: hidden; background: var(--hair); border: 1px solid var(--hair); }
.su-sum > div { padding: 12px 14px; background: var(--surface); display: grid; gap: 2px; min-width: 0; }
.su-sum small { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.su-sum b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.su-k { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: -6px; }
.plan-pair { display: grid; grid-template-columns: 1fr 1.15fr; gap: 12px; }
.pp { padding: 18px; border-radius: 18px; border: 1px solid var(--hair); background: var(--soft); display: grid; gap: 10px; align-content: start; }
.pp-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pp-h b { font-size: 16px; font-weight: 800; }
.pp-h .pill { height: 24px; font-size: 11.5px; }
.pp-price { font-size: 30px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.pp-price small { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.pp-note { font-size: 12.5px; color: var(--muted); margin-top: -4px; }
.pp-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; font-size: 13.5px; font-weight: 500; }
.pp-list li { display: flex; gap: 9px; align-items: center; }
.pp-list .ico { width: 15px; height: 15px; color: var(--brand); flex: none; }
.pp.rec { color: #fff; border-color: transparent; background: radial-gradient(80% 90% at 100% 0%, rgba(217, 120, 63, .35), transparent 60%), linear-gradient(150deg, #1d3aa3, #0b1533); box-shadow: 0 14px 34px rgba(22, 50, 143, .3); }
.pp.rec .pp-price small, .pp.rec .pp-note { color: rgba(255, 255, 255, .7); }
.pp.rec .pp-list .ico { color: #f6b48a; }

/* reminder strip while setup is unfinished */
.setup-strip { display: flex; align-items: center; gap: 14px; margin: 6px 28px 6px; padding: 12px 14px 12px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--hair); box-shadow: var(--sh); }
.setup-strip > div { flex: 1; min-width: 0; display: grid; }
.setup-strip b { font-size: 14px; } .setup-strip small { color: var(--muted); font-size: 12.5px; }
.ss-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--tint); color: var(--brand); flex: none; }

@media (max-width: 640px) {
  .su-scrim { place-items: end stretch; padding: 0; }
  .su { width: 100%; max-height: 92dvh; border-radius: 22px 22px 0 0; border-bottom: 0; animation: suUp .28s cubic-bezier(.2, .9, .3, 1); }
  @keyframes suUp { from { transform: translateY(40px); opacity: 0; } }
  .su-h { padding: 20px 20px 16px; } .su-h h2 { font-size: 21px; }
  .su-steps li:not(.on) em { display: none; } .su-steps li + li::before { width: 18px; margin: 0 6px; }
  .su-body { padding: 18px 20px; }
  .su-f { padding: 12px 20px calc(14px + env(safe-area-inset-bottom)); }
  .su-f .su-skip { display: none; }
  .su-sum { grid-template-columns: 1fr 1fr; }
  .plan-pair { grid-template-columns: 1fr; }
  .setup-strip { margin: 4px 16px; } .setup-strip small { display: none; }
}

/* ===== Platform owner dashboard ===== */
.plat-hero { background: radial-gradient(90% 120% at 100% 0%, rgba(217, 120, 63, .38), transparent 50%), radial-gradient(70% 90% at 0% 100%, rgba(123, 79, 214, .55), transparent 60%), linear-gradient(135deg, #1b1f55, #0b1533); }
.plat-hero .glass .v.plat-mrr { font-size: 22px; line-height: 1.2; }
.plat-status { margin-top: 14px; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 10px; border-radius: 99px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.08); color: #fff; font-weight: 600; font-size: 13px; cursor: pointer; }
.plat-status:hover { background: rgba(255,255,255,.14); }
.plat-status span { opacity: .65; font-weight: 500; }
.plat-status i { width: 8px; height: 8px; border-radius: 50%; background: #8aa6fa; box-shadow: 0 0 0 4px rgba(138, 166, 250, .22); }
.plat-status.warn i { background: #f6b48a; box-shadow: 0 0 0 4px rgba(246, 180, 138, .22); }
.plat-status.attention i { background: #ff7a90; box-shadow: 0 0 0 4px rgba(255, 122, 144, .25); }
.plat-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--hair); width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.plat-tabs::-webkit-scrollbar { display: none; }
.plat-tabs button { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border: 0; border-radius: 10px; background: none; color: var(--muted); font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.plat-tabs button:hover { color: var(--ink); }
.plat-tabs button.on { background: var(--ink); color: var(--on-ink); }
.plat-body { display: grid; gap: 16px; min-width: 0; }
.plat-bars { display: grid; grid-template-columns: repeat(30, 1fr); gap: 4px; align-items: end; height: 150px; padding-top: 6px; }
.plat-bars span { height: 100%; display: flex; align-items: flex-end; }
.plat-bars i { width: 100%; border-radius: 4px 4px 2px 2px; background: linear-gradient(var(--brand-hi), var(--brand)); min-height: 4px; }
.plat-bars i.z { background: var(--hair); }
.plat-axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: -6px; }
.plat-mix { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--hair); gap: 2px; }
.plat-mix i { display: block; height: 100%; min-width: 6px; }
.plat-legend { display: grid; gap: 8px; }
.plat-legend > div { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; }
.plat-legend i { width: 10px; height: 10px; border-radius: 3px; }
.plat-legend b { margin-left: auto; font-variant-numeric: tabular-nums; }
.plat-rev { display: grid; gap: 2px; padding: 14px 16px; border-radius: 14px; background: var(--soft); border: 1px solid var(--hair); }
.plat-rev small { color: var(--muted); font-size: 12px; }
.plat-rev b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.plat-list { display: grid; gap: 6px; }
.plat-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--hair); background: var(--surface); text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.plat-row:not(.static):hover { border-color: var(--brand-hi); background: var(--tint-2); }
.plat-row.static { cursor: default; }
.plat-row > div { flex: 1; min-width: 0; display: grid; }
.plat-row b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plat-row small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plat-row .pill { flex: none; }
.pill.sm { height: 20px; padding: 0 7px; font-size: 10.5px; vertical-align: 1px; }
.plat-checks { display: grid; gap: 8px; }
.plat-check { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--soft); border: 1px solid var(--hair); }
.plat-check > span { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--tint); color: var(--brand); }
.plat-check.warn > span { background: var(--warn-tint); color: var(--warn); }
.plat-check.bad > span { background: var(--bad-tint); color: var(--bad); }
.plat-check b { display: block; font-size: 13.5px; } .plat-check small { color: var(--muted); font-size: 12.5px; }
.plat-banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--hair); background: var(--surface); }
.plat-banner > .ico { width: 30px; height: 30px; padding: 7px; border-radius: 10px; flex: none; background: var(--tint); color: var(--brand); }
.plat-banner.warn > .ico { background: var(--warn-tint); color: var(--warn); }
.plat-banner.bad > .ico { background: var(--bad-tint); color: var(--bad); }
.plat-banner > div { flex: 1; min-width: 0; display: grid; }
.plat-banner b { font-size: 14px; } .plat-banner small { color: var(--muted); font-size: 12.5px; }
.plat-meter { height: 6px; border-radius: 99px; background: var(--hair); overflow: hidden; }
.plat-meter i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.plat-meter i.bad { background: var(--bad); }
.plat-errs { display: grid; gap: 8px; }
.plat-errs > div { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--bad-tint); }
.plat-errs code { font-size: 12.5px; font-weight: 700; color: var(--bad); }
.plat-errs small { color: var(--ink-2); font-size: 12px; overflow-wrap: anywhere; }
.plat-tbl tbody tr[data-firm] { cursor: pointer; }
.plat-tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.plat-plan { display: flex; gap: 6px; flex-wrap: wrap; }
.plat-act { text-align: right; white-space: nowrap; }
.plat-act .btn + .btn { margin-left: 6px; }
.plat-firmlink { padding: 0; color: var(--brand); font-weight: 600; cursor: pointer; }
.plat-count { font-size: 13px; }
/* firm drawer */
.plat-sheet { width: min(600px, 100vw); }
.plat-sh .who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.plat-sh .who > div { min-width: 0; } .plat-sh h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plat-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; border-radius: 16px; overflow: hidden; background: var(--hair); border: 1px solid var(--hair); }
.plat-stats > div { padding: 12px 14px; background: var(--surface); display: grid; gap: 2px; min-width: 0; }
.plat-stats small { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.plat-stats b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plat-sec { display: grid; gap: 10px; padding-top: 4px; }
.plat-sec-h { display: flex; align-items: center; gap: 8px; }
.plat-sec-h h4 { font-size: 14px; font-weight: 800; }
.plat-sec-h .btn { margin-left: auto; }
.plat-dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 14px; margin: 0; }
.plat-dl > div { min-width: 0; } .plat-dl .wide { grid-column: 1 / -1; }
.plat-dl dt { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.plat-dl dd { margin: 2px 0 0; font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.plat-plan-form { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 10px; align-items: end; }
.plat-plan-form .btn { height: 42px; }
.plat-verify .l p { max-width: 46ch; }
.empty.paused .e-ico { background: var(--bad-tint); color: var(--bad); }
.empty.paused p { max-width: 380px; }
@media (max-width: 1024px) { .plat-plan-form { grid-template-columns: 1fr 1fr; } .plat-plan-form .btn { grid-column: 1 / -1; } }
@media (max-width: 640px) {
  .plat-stats, .plat-dl { grid-template-columns: 1fr 1fr; }
  .plat-bars { height: 110px; gap: 2px; }
  .plat-tabs { width: 100%; }
  .plat-tabs button { padding: 0 11px; }
  .plat-tabs button span { display: none; } .plat-tabs button.on span { display: inline; }
  .plat-row .pill:not(:last-child) { display: none; }
}
/* small laptop screens: drop the upgrade row (the dashboard plan strip still offers it) */
@media (max-height: 820px) { .side-promo { display: none; } .nav a { height: 32px; } .nav-label { padding-top: 3px; } }

/* account chip title line (replaces the long email; email is in the tooltip) */
.me-chip .me-title { display: flex; align-items: center; gap: 5px; }
.me-chip .me-title.plat { color: #f6b48a; opacity: 1; font-weight: 600; }
.me-chip .me-title .ico { width: 12px; height: 12px; flex: none; }

/* ===== Platform page shell (own page, like CAFlow's /admin) ===== */
.side-plat { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 12px; font-weight: 600; font-size: 13.5px; color: #f6b48a; background: rgba(246, 180, 138, .08); border: 1px solid rgba(246, 180, 138, .2); transition: background .15s; }
.side-plat:hover { background: rgba(246, 180, 138, .15); color: #ffd2b4; }
.side-plat span { flex: 1; } .side-plat .ico.sm { opacity: .7; }
.pshell .side .logo small { color: #f6b48a; opacity: .9; }
.psys { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); color: #fff; }
.psys:hover { background: rgba(255, 255, 255, .1); }
.psys i { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; flex: none; background: #8aa6fa; box-shadow: 0 0 0 4px rgba(138, 166, 250, .2); }
.psys.warn i { background: #f6b48a; box-shadow: 0 0 0 4px rgba(246, 180, 138, .2); }
.psys.attention i { background: #ff7a90; box-shadow: 0 0 0 4px rgba(255, 122, 144, .22); }
.psys span { display: grid; min-width: 0; } .psys b { font-size: 13px; } .psys small { font-size: 11.5px; color: var(--side-ink); }
.nav a .pcount { margin-left: auto; font-style: normal; font-size: 11.5px; font-weight: 700; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 99px; display: grid; place-items: center; background: rgba(255, 255, 255, .08); color: var(--side-ink); }
.nav a .pdot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: #f6b48a; }
.nav a .pdot.attention { background: #ff7a90; }
.pmix-s { display: grid; gap: 8px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .07); }
.pmix-s .nav-label { padding: 0; }
.pmix-s .plat-mix { height: 8px; background: rgba(255, 255, 255, .08); }
.pmix-s small { font-size: 11.5px; color: var(--side-ink); }
.pback { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 11px; color: var(--side-ink); font-weight: 600; font-size: 13px; border: 1px solid rgba(255, 255, 255, .1); }
.pback:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.pcrumb { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.pcrumb b { color: var(--ink); } .pcrumb .ico { opacity: .6; }
.plat-solo { max-width: 1080px; margin: 0 auto; padding-top: 48px; }
.plat-status { text-decoration: none; }
@media (max-height: 900px) { .pmix-s { display: none; } }
/* top bar: three zones so the centred search can never run into the buttons */
.top-l, .top-r { display: flex; align-items: center; gap: 12px; min-width: 0; }
.top-r { justify-content: flex-end; }
@media (min-width: 1280px) {
  .top:has(.top-r) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 540px) minmax(max-content, 1fr); gap: 20px; }
  .top .search-btn { max-width: none; width: 100%; }
}
@media (max-width: 1279px) { .top-r { margin-left: auto; gap: 8px; } .timer-chip .lbl { display: none; } .top .search-btn { flex: 1 1 auto; min-width: 0; } }
.timer-chip .lbl { max-width: 150px; }

/* ===== Layout polish: sidebar pins its top and bottom; only the menu scrolls ===== */
.side { overflow: hidden; }
.side-nav { flex: 1 1 auto !important; min-height: 0; overflow-y: auto; scrollbar-width: none; display: flex; flex-direction: column; gap: 10px; margin: 0 -4px; padding: 0 4px; }
.side-nav::-webkit-scrollbar { display: none; }
.side-nav.fade { mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); }
.side-promo { margin-top: 0; }
/* more breathing room on wide screens */
@media (min-width: 1280px) {
  .top { padding: 16px 36px; }
  .view { padding: 14px 36px 60px; gap: 24px; }
  .setup-strip { margin-left: 36px; margin-right: 36px; }
}

/* ===== Firm drawer (platform) ===== */
.sheet.fd { width: min(620px, 100vw); background: var(--bg); }
.fd-head { position: relative; overflow: hidden; padding: 18px 26px 22px; color: #fff; background: radial-gradient(90% 140% at 100% 0%, rgba(217, 120, 63, .32), transparent 55%), radial-gradient(70% 120% at 0% 100%, rgba(123, 79, 214, .45), transparent 60%), linear-gradient(135deg, #1b1f55, #0b1533); display: grid; gap: 16px; }
.fd-head::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 26px 26px; mask-image: linear-gradient(90deg, transparent, #000 70%); pointer-events: none; }
.fd-head > * { position: relative; }
.fd-top { display: flex; align-items: center; justify-content: space-between; }
.fd-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: rgba(255,255,255,.65); }
.fd-x, .fd-ghost { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: rgba(255,255,255,.8); cursor: pointer; flex: none; }
.fd-x:hover, .fd-ghost:hover { background: rgba(255,255,255,.14); color: #fff; }
.fd-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.fd-id .av { width: 52px; height: 52px; border-radius: 16px; font-size: 17px; box-shadow: 0 0 0 3px rgba(255,255,255,.12); }
.fd-id > div { flex: 1; min-width: 0; }
.fd-id h3 { font-family: var(--display); font-weight: 600; font-size: 24px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-id p { font-size: 13px; color: rgba(255,255,255,.7); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.fd-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.fd-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 99px; font-size: 12px; font-weight: 600; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: rgba(255,255,255,.85); }
.fd-chip.practice { background: rgba(74, 114, 245, .28); border-color: rgba(138, 166, 250, .4); color: #fff; }
.fd-chip.firm { background: rgba(217, 120, 63, .25); border-color: rgba(246, 180, 138, .4); color: #ffd2b4; }
.fd-chip.bad { background: rgba(209, 67, 91, .25); border-color: rgba(255, 122, 144, .4); color: #ffc2cc; }
.fd-chip.ok i { width: 7px; height: 7px; border-radius: 50%; background: #8aa6fa; box-shadow: 0 0 0 3px rgba(138, 166, 250, .25); }
.fd-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 22px 26px 28px; display: grid; gap: 22px; align-content: start; }
.fd-alert { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; border-radius: 14px; background: var(--bad-tint); color: var(--bad); }
.fd-alert > div { flex: 1; display: grid; } .fd-alert b { font-size: 13.5px; } .fd-alert small { color: var(--ink-2); font-size: 12px; }
.fd-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.fd-kpis > div { padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--hair); display: grid; gap: 4px; min-width: 0; }
.fd-kpis .t-ico { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 6px; }
.fd-kpis b { font-size: 19px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-kpis small { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.fd-sec { display: grid; gap: 12px; padding: 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--hair); }
.fd-sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.fd-sec-h h4 { font-size: 14.5px; font-weight: 800; }
.fd-sec-h small { font-size: 12px; color: var(--muted); font-weight: 600; }
.fd-planform { display: grid; gap: 12px; }
.fd-plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fd-plan { position: relative; display: grid; gap: 2px; justify-items: start; text-align: left; padding: 12px 12px 12px 38px; border-radius: 14px; border: 1.5px solid var(--hair); background: var(--soft); cursor: pointer; transition: border-color .15s, background .15s; }
.fd-plan:hover { border-color: var(--brand-hi); }
.fd-plan b { font-size: 14px; } .fd-plan small { font-size: 11.5px; color: var(--muted); }
.fd-plan em { position: absolute; top: 10px; right: 10px; font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--muted); }
.fd-radio { position: absolute; left: 12px; top: 14px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); }
.fd-plan.on { border-color: var(--brand); background: var(--tint-2); box-shadow: 0 0 0 4px rgba(36, 80, 224, .1); }
.fd-plan.on .fd-radio { border-color: var(--brand); box-shadow: inset 0 0 0 3px var(--surface); background: var(--brand); }
.fd-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fd-date { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.fd-date .input { width: 160px; min-height: 38px; height: 38px; padding: 6px 10px; }
.fd-save { justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--hair); }
.fd-save small { font-size: 12px; }
.fd-dl { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--hair); }
.fd-dl > div { display: grid; gap: 2px; padding: 10px 12px; border-bottom: 1px solid var(--hair); min-width: 0; }
.fd-dl > div:nth-child(odd) { border-right: 1px solid var(--hair); }
.fd-dl > div:nth-last-child(-n+2) { border-bottom: 0; }
.fd-dl dt { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.fd-dl dd { margin: 0; font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.fd-people { display: grid; gap: 2px; }
.fd-person { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--hair); }
.fd-person:last-child { border-bottom: 0; }
.fd-person > div { flex: 1; min-width: 0; display: grid; }
.fd-person b { font-size: 13.5px; } .fd-person small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-person .fd-meta { font-size: 11.5px; opacity: .8; }
.fd-role { font-size: 11.5px; font-weight: 700; text-transform: capitalize; padding: 3px 9px; border-radius: 99px; background: var(--soft); border: 1px solid var(--hair); color: var(--ink-2); }
.fd-person .fd-ghost { border-color: var(--hair); background: var(--surface); color: var(--muted); width: 32px; height: 32px; }
.fd-person .fd-ghost:hover { color: var(--bad); border-color: var(--bad); background: var(--bad-tint); }
.fd-feed { display: grid; gap: 0; }
.fd-feed > div { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--hair); font-size: 13px; }
.fd-feed > div:last-child { border-bottom: 0; }
.fd-feed span { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--tint); color: var(--brand); }
.fd-feed p { min-width: 0; } .fd-feed em { font-style: normal; color: var(--muted); }
.fd-feed small { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.fd-foot { display: flex; align-items: center; gap: 10px; padding: 14px 26px; border-top: 1px solid var(--hair); background: var(--surface); }
.fd-foot .muted { font-size: 12.5px; }
.fd-danger { color: var(--bad); }
.fd-danger:hover { border-color: var(--bad) !important; background: var(--bad-tint) !important; color: var(--bad) !important; }
@media (max-width: 640px) {
  .fd-head, .fd-body { padding-left: 18px; padding-right: 18px; }
  .fd-kpis { grid-template-columns: 1fr 1fr; }
  .fd-plans { grid-template-columns: 1fr; }
  .fd-date { margin-left: 0; }
  .fd-dl { grid-template-columns: 1fr; } .fd-dl > div:nth-child(odd) { border-right: 0; } .fd-dl > div:nth-last-child(2) { border-bottom: 1px solid var(--hair); }
  .fd-feed > div { grid-template-columns: 28px 1fr; } .fd-feed small { grid-column: 2; }
}

/* ===== Plan & billing ===== */
.bill-ph .actions { align-items: center; }
.bill-ph .seg button { display: inline-flex; align-items: center; gap: 6px; }
.bill-cur { display: grid; grid-template-columns: minmax(220px, auto) 1fr auto; gap: 28px; align-items: center; padding: 20px 24px; }
.bc-id { display: flex; gap: 14px; align-items: center; min-width: 0; }
.bc-id .tile-ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.bc-id h2 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin-top: 2px; }
.bc-id small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 3px; max-width: 34ch; }
.bc-meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 22px; min-width: 0; }
.bc-meters .meter { max-width: none; }
.bill-plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: stretch; }
.bp { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 26px; border-radius: 24px; background: var(--surface); border: 1px solid var(--hair); box-shadow: var(--sh); }
.bp-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bp-h b { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.bp-badge { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 99px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.bp-badge.cur { background: var(--ink); color: var(--on-ink); }
.bp-badge.rec { background: var(--accent-tint); color: var(--accent-ink); }
.bp-tag { color: var(--muted); font-size: 13.5px; margin-top: -6px; }
.bp-price { display: flex; align-items: baseline; gap: 4px; margin-top: 8px; }
.bp-price b { font-size: 42px; font-weight: 800; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.bp-price small { color: var(--muted); font-size: 14px; }
.bp-note { color: var(--muted); font-size: 12.5px; min-height: 19px; }
.bp-note em { font-style: normal; font-weight: 700; color: var(--accent-ink); }
.bp .btn-block { margin-top: 6px; min-height: 46px; border-radius: 13px; }
.bp-div { margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--hair); font-size: 12px; font-weight: 700; color: var(--muted); }
.bp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; font-size: 13.5px; font-weight: 500; }
.bp-list li { display: flex; gap: 10px; align-items: center; }
.bp-list .ico { width: 16px; height: 16px; color: var(--brand); flex: none; }
.bp.cur { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(36, 80, 224, .08), var(--sh); }
.bp.pop { color: #fff; border-color: transparent; background: radial-gradient(80% 60% at 100% 0%, rgba(217, 120, 63, .35), transparent 60%), linear-gradient(155deg, #1d3aa3, #0b1533); box-shadow: 0 24px 60px rgba(22, 50, 143, .32); }
.bp.pop .bp-tag, .bp.pop .bp-note, .bp.pop .bp-price small, .bp.pop .bp-div { color: rgba(255, 255, 255, .68); }
.bp.pop .bp-note em { color: #f6b48a; }
.bp.pop .bp-div { border-color: rgba(255, 255, 255, .12); }
.bp.pop .bp-list .ico { color: #f6b48a; }
.bp.pop .bp-badge.rec { background: rgba(246, 180, 138, .18); color: #f6b48a; }
.bp.pop .bp-badge.cur { background: #fff; color: #0f1730; }
.bp.pop .btn-ghost { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: #fff; }
.bill-trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.bill-trust > div { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--hair); }
.bill-trust .ico { width: 34px; height: 34px; padding: 8px; border-radius: 11px; background: var(--tint); color: var(--brand); flex: none; }
.bill-trust span { display: grid; gap: 2px; } .bill-trust b { font-size: 13.5px; } .bill-trust small { font-size: 12.5px; color: var(--muted); }
@media (max-width: 1100px) { .bill-cur { grid-template-columns: 1fr; gap: 18px; } .bc-act { justify-self: start; } }
@media (max-width: 900px) { .bill-plans, .bill-trust { grid-template-columns: 1fr; } .bill-plans { max-width: 520px; } }

/* ===== Timer ===== */
.timer-chip { padding: 0 6px 0 4px; gap: 4px; }
.timer-chip .tc-main { display: inline-flex; align-items: center; gap: 8px; width: auto; height: 32px; padding: 0 10px; background: none; font: inherit; font-weight: 600; }
.timer-chip .tc-main:hover { background: color-mix(in srgb, var(--on-ink) 10%, transparent); }
.timer-chip .lbl { opacity: .65; font-weight: 500; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer-chip.paused .dot { animation: none; background: var(--muted); }
.timer-chip.paused { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.timer-chip.paused button { color: var(--ink); background: var(--soft); }
.act-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.act-chips .chip { height: 30px; font-size: 12.5px; }
.tp { display: grid; gap: 14px; }
.tp-h { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.tp-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: blink 1.2s infinite; } .tp-dot.paused { animation: none; background: var(--muted); }
.tp-link { font-weight: 600; display: inline-flex; align-items: center; gap: 4px; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-clock { font-size: 56px; font-weight: 800; letter-spacing: -.03em; line-height: 1; text-align: center; padding: 10px 0 2px; }
.tp-bill { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: -6px; }
.tp-acts { flex-wrap: wrap; }
.btn-glass { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: #fff; }
.btn-glass:hover { background: rgba(255,255,255,.18); }
.hero .cta { display: flex; gap: 10px; flex-wrap: wrap; }
.t-round { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 12px; color: rgba(255,255,255,.6); }
@media (max-width: 640px) { .timer-chip .tc-main { padding: 0 6px; } .tp-clock { font-size: 44px; } }

/* ===== Write with AI (composer) ===== */
.modal.ai-modal { width: min(760px, 100%); padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.ai { display: flex; flex-direction: column; min-height: 0; max-height: calc(100dvh - 40px); }
.ai-h { display: flex; align-items: center; gap: 12px; padding: 20px 24px 16px; border-bottom: 1px solid var(--hair); background: radial-gradient(120% 160% at 0% 0%, rgba(123, 79, 214, .14), transparent 55%); }
.ai-h > div:nth-child(2) { flex: 1; min-width: 0; } .ai-h h3 { font-size: 17px; font-weight: 800; } .ai-h small { color: var(--muted); font-size: 12.5px; }
.ai-badge { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none; color: #fff; background: linear-gradient(140deg, #7b4fd6, #2450e0); box-shadow: 0 8px 20px rgba(91, 79, 214, .35); }
.ai-tasks { display: flex; gap: 6px; padding: 14px 24px 0; overflow-x: auto; scrollbar-width: none; }
.ai-tasks::-webkit-scrollbar { display: none; }
.ai-tasks button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--hair); background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; }
.ai-tasks button.on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.ai-in { padding: 14px 24px 0; display: grid; gap: 10px; }
.ai-in .textarea { min-height: 104px; font-size: 14.5px; }
.ai-ideas { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-ideas .chip { height: 30px; font-size: 12.5px; font-weight: 500; }
.ai-opts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 24px; }
.ai-matter { display: flex; align-items: center; gap: 8px; color: var(--muted); } .ai-matter .select { min-height: 36px; height: 36px; padding: 0 10px; max-width: 260px; }
.ai-use { font-size: 13px; }
.ai-opts .seg button { height: 30px; padding: 0 10px; font-size: 12.5px; }
.ai-wait { display: flex; align-items: center; gap: 14px; margin: 0 24px 14px; padding: 18px; border-radius: 16px; background: var(--soft); border: 1px dashed var(--line); }
.ai-wait b { display: block; font-size: 14px; } .ai-wait small { color: var(--muted); }
.ai-spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--tint); border-top-color: var(--brand); animation: aispin .8s linear infinite; flex: none; }
@keyframes aispin { to { transform: rotate(360deg); } }
.ai-out { margin: 0 24px 14px; display: grid; gap: 8px; min-height: 0; }
.ai-out-h { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; font-weight: 700; color: var(--brand); }
.ai-out-h span { display: inline-flex; gap: 6px; align-items: center; } .ai-out-h small { color: var(--muted); font-weight: 500; }
.ai-out .textarea { min-height: 220px; max-height: 42vh; }
.ai-f { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 24px; border-top: 1px solid var(--hair); background: var(--soft); margin-top: auto; }
.ai-f > small { flex: 1 1 260px; display: flex; gap: 6px; align-items: flex-start; font-size: 12px; }
.ai-f > small .ico { flex: none; margin-top: 2px; }
.ai-acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ai-off { padding: 32px; display: grid; justify-items: center; text-align: center; gap: 10px; }
.ai-off .ai-badge { width: 56px; height: 56px; border-radius: 18px; }
.btn-ai { border-color: rgba(123, 79, 214, .35); }
.btn-ai .ico { color: #7b4fd6; }
html.app[data-theme="dark"] .btn-ai .ico { color: #b39af5; }
.btn-ai-solid { background: linear-gradient(140deg, #7b4fd6, #2450e0); }
@media (max-width: 640px) {
  .ai-h, .ai-in, .ai-opts, .ai-f { padding-left: 16px; padding-right: 16px; } .ai-tasks { padding-left: 16px; padding-right: 16px; }
  .ai-out, .ai-wait { margin-left: 16px; margin-right: 16px; }
  .ai-acts { width: 100%; } .ai-acts .btn { flex: 1; }
}

/* ===== Platform: AI connectors ===== */
.ai-top { display: flex; align-items: center; gap: 24px; padding: 18px 22px; flex-wrap: wrap; }
.ai-top-l { display: flex; align-items: center; gap: 14px; flex: 1 1 340px; min-width: 0; }
.ai-top-l b { display: block; font-size: 15px; } .ai-top-l small { color: var(--muted); font-size: 12.5px; }
.ai-limits { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-limits span { display: grid; padding: 6px 12px; border-radius: 12px; background: var(--soft); border: 1px solid var(--hair); }
.ai-limits small { font-size: 11px; color: var(--muted); font-weight: 600; } .ai-limits b { font-size: 14px; font-variant-numeric: tabular-nums; }
.ai-limits em { font-style: normal; font-size: 12px; color: var(--muted); }
.tgl { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; }
.tgl input { position: absolute; opacity: 0; width: 0; height: 0; }
.tgl span { width: 44px; height: 26px; border-radius: 99px; background: var(--line); position: relative; transition: background .2s; }
.tgl span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.tgl input:checked + span { background: var(--brand); } .tgl input:checked + span::after { transform: translateX(18px); }
.tgl input:focus-visible + span { outline: 3px solid rgba(36, 80, 224, .45); outline-offset: 2px; }
.ai-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.ai-card { padding: 20px; display: grid; gap: 14px; transition: border-color .2s, box-shadow .2s; }
.ai-card.def { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(36, 80, 224, .08), var(--sh); }
.ai-card header { display: flex; align-items: center; gap: 12px; }
.ai-card header > div { flex: 1; min-width: 0; } .ai-card h3 { font-size: 16px; font-weight: 800; } .ai-card header small { color: var(--muted); font-size: 12px; }
.ai-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.ai-mark.anthropic { background: var(--accent-tint); color: var(--accent-ink); }
.ai-mark.openai { background: var(--ink); color: var(--on-ink); }
.ai-mark.gemini { background: var(--tint); color: var(--brand); }
.ai-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 2px; }
.ai-test { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; font-size: 12.5px; background: var(--tint); color: var(--brand-ink); }
.ai-test.bad { background: var(--bad-tint); color: var(--bad); }
.ai-test span { flex: 1; min-width: 0; } .ai-test small { color: var(--muted); white-space: nowrap; }
.ai-card footer { display: flex; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--hair); }
.ai-card .btn-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--brand); cursor: pointer; text-decoration: none; }
.ai-def { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--accent-ink); }
.ai-uses { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ai-uses > div { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; background: var(--soft); border: 1px solid var(--hair); }
.ai-uses .ico { width: 32px; height: 32px; padding: 7px; border-radius: 10px; background: var(--tint); color: var(--brand); flex: none; }
.ai-uses span { display: grid; gap: 2px; } .ai-uses b { font-size: 13.5px; } .ai-uses small { font-size: 12.5px; color: var(--muted); }
.ai-privacy { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; } .ai-privacy .ico { flex: none; margin-top: 2px; }
@media (max-width: 1100px) { .ai-cards, .ai-uses { grid-template-columns: 1fr; } }

/* ===== Daily diary ===== */
.dy-bar { display: flex; align-items: center; gap: 24px; padding: 16px 20px; flex-wrap: wrap; }
.dy-nav { display: flex; align-items: center; gap: 10px; }
.dy-date { display: grid; min-width: 220px; } .dy-date b { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.dy-quick { display: flex; align-items: center; gap: 6px; }
.dy-pick { width: 160px; min-height: 34px; height: 34px; padding: 4px 10px; }
.dy-stats { display: flex; gap: 8px; margin-left: auto; }
.dy-stats > div { display: grid; text-align: center; min-width: 76px; padding: 8px 12px; border-radius: 12px; background: var(--soft); border: 1px solid var(--hair); }
.dy-stats b { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; } .dy-stats small { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.dy-stats .warn { background: var(--warn-tint); border-color: transparent; } .dy-stats .warn b, .dy-stats .warn small { color: var(--warn); }
.dy-courts { display: grid; gap: 16px; }
.dy-court { padding: 6px 0; overflow: hidden; }
.dy-court header { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--hair); }
.dy-court header .t-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; }
.dy-court h3 { font-size: 15.5px; font-weight: 800; flex: 1; }
.dy-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--hair); }
.dy-row:last-child { border-bottom: 0; }
.dy-time { display: grid; } .dy-time b { font-size: 16px; } .dy-time small { font-size: 12px; color: var(--muted); }
.dy-main { display: grid; gap: 2px; min-width: 0; } .dy-main a { color: var(--ink); } .dy-main a:hover b { color: var(--brand); }
.dy-main b { font-size: 14.5px; } .dy-main small { font-size: 12.5px; color: var(--muted); }
.dy-purpose { justify-self: start; margin-top: 4px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 8px; background: var(--accent-tint); color: var(--accent-ink); }
.dy-out { display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; color: var(--ink-2); margin-top: 4px; } .dy-out .ico { color: var(--brand); margin-top: 2px; flex: none; }
.dy-row.done .dy-time b, .dy-row.adjourned .dy-time b { color: var(--muted); }
.print-only { display: none; }
@media (max-width: 760px) {
  .dy-stats { margin-left: 0; width: 100%; } .dy-stats > div { flex: 1; min-width: 0; }
  .dy-row { grid-template-columns: 64px minmax(0, 1fr); } .dy-act { grid-column: 2; }
  .dy-date { min-width: 0; }
}
@media print {
  .side, .top, .setup-strip, .ph .actions, .dy-quick, .dy-nav .btn, .dy-act, .toasts { display: none !important; }
  .shell { display: block; } .view { padding: 0; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none !important; border: 1px solid #ccc !important; background: #fff !important; }
  .print-only { display: block; margin-top: 16px; font-size: 12px; color: #555; }
  .dy-row { break-inside: avoid; }
}

/* ===== Record outcome ===== */
.modal.oc-modal { width: min(620px, 100%); padding: 0; overflow: hidden; }
.oc-h { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--hair); }
.oc-h .t-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.oc-h > div { flex: 1; min-width: 0; } .oc-h h3 { font-size: 17px; font-weight: 800; } .oc-h small { color: var(--muted); font-size: 12.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-body { padding: 18px 22px; display: grid; gap: 14px; max-height: 62vh; overflow-y: auto; }
.oc-kinds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.oc-kinds button { display: grid; justify-items: center; gap: 6px; padding: 12px 8px; border-radius: 14px; border: 1.5px solid var(--hair); background: var(--soft); color: var(--ink-2); font-weight: 600; font-size: 12.5px; cursor: pointer; text-align: center; }
.oc-kinds button .ico { width: 20px; height: 20px; color: var(--muted); }
.oc-kinds button.on { border-color: var(--brand); background: var(--tint-2); color: var(--ink); box-shadow: 0 0 0 4px rgba(36, 80, 224, .1); } .oc-kinds button.on .ico { color: var(--brand); }
.oc-next { display: grid; gap: 10px; padding: 14px; border-radius: 16px; background: var(--soft); border: 1px solid var(--hair); }
.oc-next-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; } .oc-next-h b { font-size: 13.5px; }
.oc-next-h .chip { height: 28px; font-size: 12px; }
.oc-f { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--hair); background: var(--soft); }
.oc-done { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 26px 22px 0; }
.oc-ok { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(140deg, var(--brand-hi), var(--brand)); box-shadow: 0 0 0 8px rgba(36, 80, 224, .14); margin-bottom: 6px; }
.oc-msg { width: 100%; text-align: left; display: grid; gap: 6px; margin-top: 10px; }
.oc-msg-h { display: flex; gap: 6px; align-items: center; font-size: 12.5px; font-weight: 700; color: var(--brand); }
.oc-f2 { width: calc(100% + 44px); margin: 14px -22px 0; align-items: center; }
@media (max-width: 560px) { .oc-kinds { grid-template-columns: 1fr 1fr; } .oc-f2 { flex-wrap: wrap; } .oc-f2 .btn { flex: 1; } }

/* ===== Limitation & tools ===== */
.tl-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; align-items: start; }
.tl-card { padding: 22px; display: grid; gap: 14px; }
.tl-h { display: flex; align-items: center; gap: 12px; } .tl-h .t-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.tl-h h3 { font-size: 16.5px; font-weight: 800; } .tl-h small { color: var(--muted); font-size: 12.5px; }
.tl-result { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 18px; color: #fff; background: radial-gradient(90% 120% at 100% 0%, rgba(217, 120, 63, .3), transparent 55%), linear-gradient(140deg, #1d3aa3, #0b1533); }
.tl-result > div:first-child { flex: 1; min-width: 0; display: grid; gap: 2px; }
.tl-result small { font-size: 12px; color: rgba(255,255,255,.65); font-weight: 600; }
.tl-result b { font-family: var(--display); font-weight: 600; font-size: 24px; letter-spacing: -.01em; }
.tl-result span { font-size: 12.5px; color: rgba(255,255,255,.7); }
.tl-left { display: grid; text-align: center; padding: 10px 16px; border-radius: 14px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); min-width: 96px; }
.tl-left b { font-family: var(--sans); font-size: 28px; font-weight: 800; }
.tl-result.soon { background: radial-gradient(90% 120% at 100% 0%, rgba(255, 255, 255, .12), transparent 55%), linear-gradient(140deg, #c26a2f, #7a3610); }
.tl-result.past { background: linear-gradient(140deg, #8f2337, #4b0f1c); }
.tl-warn { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; padding: 10px 12px; border-radius: 12px; background: var(--warn-tint); color: var(--warn); } .tl-warn .ico { flex: none; margin-top: 2px; }
.tl-save { display: flex; gap: 10px; } .tl-save .select { flex: 1; min-width: 0; }
.tl-note { font-size: 12px; }
.tl-seg { justify-self: start; }
.tl-money { display: grid; grid-template-columns: 1.2fr 1.2fr 1fr; gap: 1px; border-radius: 16px; overflow: hidden; background: var(--hair); border: 1px solid var(--hair); }
.tl-money > div { display: grid; gap: 2px; padding: 14px 16px; background: var(--surface); }
.tl-money small { font-size: 11.5px; color: var(--muted); font-weight: 600; } .tl-money b { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
@media (max-width: 1100px) { .tl-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .tl-result { flex-direction: column; align-items: stretch; } .tl-money { grid-template-columns: 1fr; } .tl-save { flex-direction: column; } }

.tl-card .field, .oc-body .field { align-content: start; }
