/* Lunarion Platform · theme layer (2026 refresh). Loaded AFTER app.css and overrides it by order.
   Same brand: black / white / silver, Geist + IBM Plex Mono, colour only for status.
   Calmer surfaces: floating sidebar, slim translucent top bar, 16px cards with hairlines and soft elevation. */

/* ---------- tokens ---------- */
:root {
  --bg: #F6F6F7;
  --bg-2: #EFEFF1;
  --panel: #FFFFFF;
  --panel-2: #FBFBFC;
  --ink: #0C0C0F;
  --ink-2: #55555E;
  --ink-3: #8B8B94;
  --line: #E7E7EB;
  --line-2: #D6D6DC;
  --hover: rgba(12, 12, 15, .045);
  --chip: rgba(12, 12, 15, .06);
  --focus: rgba(12, 12, 15, .55);
  --ring: 0 0 0 2px var(--bg), 0 0 0 4px rgba(12, 12, 15, .28);
  --glow: rgba(12, 12, 15, .055);
  --shadow: 0 1px 0 rgba(12, 12, 15, .02), 0 1px 3px rgba(12, 12, 15, .04), 0 10px 28px -16px rgba(12, 12, 15, .12);
  --shadow-2: 0 1px 0 rgba(12, 12, 15, .02), 0 4px 10px -2px rgba(12, 12, 15, .06), 0 22px 40px -20px rgba(12, 12, 15, .22);
  --shadow-side: 0 1px 2px rgba(12, 12, 15, .04), 0 12px 32px -18px rgba(12, 12, 15, .18);
  --btn-hi: inset 0 1px 0 rgba(255, 255, 255, .14);
  --r: 16px;
  --r-md: 12px;
  --r-sm: 10px;
  --side: 268px;
  --top: 60px;
  --gut: clamp(16px, 2.6vw, 32px);
  --t: 180ms;
  --ease-o: cubic-bezier(.2, .8, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #08080A; --bg-2: #101013; --panel: #0E0E11; --panel-2: #121216;
    --ink: #F4F4F6; --ink-2: #A3A3AB; --ink-3: #6B6B74;
    --line: rgba(255, 255, 255, .075); --line-2: rgba(255, 255, 255, .13);
    --hover: rgba(255, 255, 255, .045); --chip: rgba(255, 255, 255, .075);
    --focus: rgba(255, 255, 255, .6); --ring: 0 0 0 2px var(--bg), 0 0 0 4px rgba(255, 255, 255, .32);
    --glow: rgba(214, 214, 224, .085);
    --shadow: inset 0 1px 0 rgba(255, 255, 255, .035), 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-2: inset 0 1px 0 rgba(255, 255, 255, .06), 0 18px 40px -18px rgba(0, 0, 0, .8);
    --shadow-side: inset 0 1px 0 rgba(255, 255, 255, .045), 0 0 0 1px rgba(0, 0, 0, .3);
    --btn-hi: inset 0 1px 0 rgba(255, 255, 255, .6);
  }
}
:root[data-theme="dark"] {
  --bg: #08080A; --bg-2: #101013; --panel: #0E0E11; --panel-2: #121216;
  --ink: #F4F4F6; --ink-2: #A3A3AB; --ink-3: #6B6B74;
  --line: rgba(255, 255, 255, .075); --line-2: rgba(255, 255, 255, .13);
  --hover: rgba(255, 255, 255, .045); --chip: rgba(255, 255, 255, .075);
  --focus: rgba(255, 255, 255, .6); --ring: 0 0 0 2px var(--bg), 0 0 0 4px rgba(255, 255, 255, .32);
  --glow: rgba(214, 214, 224, .085);
  --shadow: inset 0 1px 0 rgba(255, 255, 255, .035), 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: inset 0 1px 0 rgba(255, 255, 255, .06), 0 18px 40px -18px rgba(0, 0, 0, .8);
  --shadow-side: inset 0 1px 0 rgba(255, 255, 255, .045), 0 0 0 1px rgba(0, 0, 0, .3);
  --btn-hi: inset 0 1px 0 rgba(255, 255, 255, .6);
}

/* ---------- base ---------- */
body { font-size: 14.5px; line-height: 1.55; text-rendering: optimizeLegibility; font-feature-settings: "ss01", "cv11"; }
body.app {
  background:
    radial-gradient(1100px 460px at 62% -160px, var(--glow), transparent 70%) no-repeat,
    radial-gradient(700px 300px at 0% -120px, var(--glow), transparent 70%) no-repeat,
    var(--bg);
}
::selection { background: var(--ink); color: var(--panel); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }
.mono { font-size: 10.5px; letter-spacing: .1em; }
.lead { font-size: 15px; line-height: 1.6; }
.ic { width: 18px; height: 18px; }

/* ---------- shell: floating sidebar ---------- */
.app { grid-template-columns: var(--side) minmax(0, 1fr); }
.side {
  top: 12px; height: calc(100vh - 24px); height: calc(100dvh - 24px);
  margin: 12px 0 12px 12px; padding: 16px 10px 10px; gap: 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-side);
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.side .brand { padding: 4px 10px 8px; font-size: 19px; }
.side-nav { gap: 1px; }
.side-k { margin: 18px 10px 6px; font-size: 9.5px; letter-spacing: .14em; color: var(--ink-3); opacity: .85; }
.side-k:first-child { margin-top: 2px; }
.side-a {
  height: 34px; padding: 0 10px; gap: 10px; border-radius: 9px; font-size: 13.5px; letter-spacing: -.005em; color: var(--ink-2);
  transition: background var(--t) var(--ease-o), color var(--t) var(--ease-o);
}
.side-a .ic { width: 18px; height: 18px; opacity: .9; }
.side-a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-a:hover { background: var(--hover); color: var(--ink); }
.side-a.on { background: var(--chip); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); font-weight: 500; }
.side-a.on .ic { opacity: 1; }
.side-foot { gap: 2px; padding: 8px 0 0; border-top: 1px solid var(--line); }
.side-foot form .side-a { color: var(--ink-3); }
.me { padding: 8px; gap: 10px; border-radius: 12px; transition: background var(--t); }
.av {
  width: 32px; height: 32px; border: 0; color: var(--ink); font: 500 11px/1 var(--mono); letter-spacing: .02em;
  background: linear-gradient(145deg, var(--panel) 0%, var(--bg-2) 100%);
  box-shadow: inset 0 0 0 1px var(--line-2), 0 1px 2px rgba(0, 0, 0, .06);
}
.av-sm { width: 28px; height: 28px; font-size: 10px; }
.me-t b { font-size: 13.5px; }
.me-t small { font-size: 11.5px; }

/* ---------- shell: top bar ---------- */
.main { position: relative; }
.top {
  height: var(--top); padding: 0 var(--gut); gap: 14px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.top-t { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.top-crumb { margin: 0; color: var(--ink-3); white-space: nowrap; }
.top-crumb:empty { display: none; }
.top-crumb span::after { content: "/"; margin-left: 10px; opacity: .6; }
.top-h { font-size: 14.5px; font-weight: 500; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-r { gap: 6px; align-items: center; }
.top-search {
  height: 34px; min-width: 260px; padding: 0 6px 0 12px; gap: 8px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(0, 0, 0, .03); font-size: 13px;
  transition: border-color var(--t), box-shadow var(--t), color var(--t);
}
.top-search .ic { width: 16px; height: 16px; }
.top-search:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.top-search kbd { border-radius: 999px; padding: 4px 8px; background: var(--bg-2); border-color: var(--line); font-size: 10px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 999px; border-color: transparent; color: var(--ink-2);
  transition: background var(--t), color var(--t), border-color var(--t);
}
.icon-btn .ic { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--hover); color: var(--ink); border-color: var(--line); }
.page { padding: 28px var(--gut) 72px; gap: 24px; max-width: 1480px; width: 100%; margin-inline: auto; }

/* medium screens: the sidebar collapses to icons */
@media (min-width: 961px) and (max-width: 1239px) {
  .app { --side: 84px; }
  .side { padding: 14px 10px 10px; align-items: stretch; }
  .side .brand { font-size: 0; justify-content: center; padding: 6px 0 10px; }
  .side .brand img { width: 24px; height: 24px; margin: 0; transform: none; }
  .side .brand small { display: none; }
  .side-k { font-size: 0; height: 1px; margin: 10px 12px; background: var(--line); opacity: 1; }
  .side-k:first-child { display: none; }
  .side-a { justify-content: center; padding: 0; height: 38px; }
  .side-a span, .me-t { display: none; }
  .me { justify-content: center; padding: 6px 0; }
}
/* phones and tablets: drawer */
@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { top: 8px; left: 8px; margin: 0; width: min(300px, calc(100vw - 16px)); height: calc(100dvh - 16px); transform: translateX(calc(-100% - 16px)); transition: transform 280ms var(--ease-o); }
  .side.open { transform: none; box-shadow: var(--shadow-2), 0 0 0 100vmax rgba(0, 0, 0, .4); }
  .top { padding: 0 12px; gap: 8px; }
  .top-crumb { display: none; }
  .top-search { min-width: 0; width: 34px; padding: 0; }
  .page { padding: 20px 16px 64px; gap: 20px; }
}

/* ---------- page header ---------- */
.ph { align-items: flex-end; gap: 16px 24px; }
.ph-t { gap: 6px; }
.ph-t > .mono { margin: 0; }
.ph-t h2, .pub-main .ph-t h2, .hp-title { font-weight: 500; font-size: clamp(26px, 2.5vw, 32px); letter-spacing: -.03em; line-height: 1.12; }
.ph-t .lead { font-size: 14.5px; margin-top: 2px; }
.ph-a { gap: 8px; align-items: center; }
.hp-hero .display { font-weight: 300; font-size: clamp(34px, 3.6vw, 48px); letter-spacing: -.04em; }

/* ---------- buttons ---------- */
.btn {
  height: 38px; padding: 0 16px; gap: 8px; border-radius: var(--r-sm); font: 500 13.5px/1 var(--sans); letter-spacing: -.005em;
  background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  transition: background var(--t), border-color var(--t), box-shadow var(--t), transform var(--t) var(--ease-o), opacity var(--t);
}
.btn:hover { background: var(--panel-2); border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { box-shadow: var(--ring); }
.btn-fill { background: var(--fill); color: var(--fill-ink); border-color: var(--fill); box-shadow: var(--btn-hi), 0 1px 2px rgba(0, 0, 0, .12), 0 4px 12px -4px rgba(0, 0, 0, .25); }
.btn-fill:hover { background: var(--fill); border-color: var(--fill); opacity: .88; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--hover); border-color: transparent; }
.btn-danger { background: var(--panel); }
.btn-danger:hover { background: var(--err-bg); border-color: var(--err); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 9px; }
.btn .arrow { transition: transform var(--t) var(--ease-o); }
.btn:hover .arrow { transform: translateX(3px); }
.btn[disabled], .btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- forms ---------- */
.field { gap: 7px; }
.field > span, .int-lab > span { font-size: 10.5px; letter-spacing: .1em; color: var(--ink-2); }
.field input, .field select, .field textarea,
.toolbar input[type=search], .toolbar select, .cl-inline select, .pj-inline select, .pj-in, .pj-url, .pr-stage-row input, .pr-stage-row select,
.au-cond input, .au-cond select, .au-step-h select, .au-date input, .rp-date input, .hp-search input, .hp-cat-row input, .op-sform input, .op-bulk-f select {
  border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--panel);
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
}
.field input, .field select { height: 42px; }
.field input:hover, .field select:hover, .field textarea:hover, .toolbar input[type=search]:hover, .toolbar select:hover { border-color: var(--ink-3); }
.field input:focus, .field select:focus, .field textarea:focus,
.toolbar input:focus, .toolbar select:focus, .pj-in:focus, .pj-inline select:focus, .cl-inline select:focus, .hp-search input:focus, .op-sform input:focus, .rp-date input:focus {
  outline: none; border-color: var(--ink-2); background: var(--panel); box-shadow: 0 0 0 3px var(--hover);
}
.toolbar { gap: 8px; }
.toolbar input[type=search], .toolbar select { height: 34px; font-size: 13.5px; }
input[type=file], .field input[type=file] { border-radius: var(--r-sm); background: var(--panel-2); }
input[type=file]::file-selector-button { border-radius: 8px; }
.check input, .perm-c, .bulk-c input { accent-color: var(--ink); }
.alert { border-radius: var(--r-md); padding: 12px 16px; border: 1px solid transparent; font-size: 13.5px; }
.alert-ok { border-color: color-mix(in srgb, var(--ok) 22%, transparent); }
.alert-err { border-color: color-mix(in srgb, var(--err) 22%, transparent); }

/* search glass in toolbar fields (mask, no extra markup) */
.toolbar input[type=search] {
  padding-left: 34px; background: var(--panel) no-repeat 12px 50% / 15px 15px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238B8B94' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
}

/* chips and tabs: segmented, pill-shaped */
.chips { gap: 4px; padding: 3px; border-radius: 11px; background: var(--chip); }
.chip { height: 28px; padding: 0 12px; border: 0; border-radius: 8px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); transition: background var(--t), color var(--t), box-shadow var(--t); }
.chip:hover { background: transparent; color: var(--ink); border: 0; }
.chip.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08), inset 0 0 0 1px var(--line); }
.pr-kinds .chip, .pr-kinds { background: none; }
.pr-kinds .chip { border: 1px solid var(--line-2); }
.tabs { gap: 2px; border-bottom: 1px solid var(--line); }
.tab { padding: 10px 12px; font-size: 13.5px; font-weight: 500; color: var(--ink-3); border-bottom-width: 2px; transition: color var(--t), border-color var(--t); }
.tab:hover { color: var(--ink); border-bottom-color: var(--line-2); }
.tab.on { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- surfaces ---------- */
.card { border-radius: var(--r); border-color: var(--line); background: var(--panel); box-shadow: var(--shadow); }
a.card, .db-kpi, .pj-card, .tile, .fl-folder, .fl-gcard { transition: border-color var(--t), box-shadow 240ms var(--ease-o), transform 240ms var(--ease-o); }
a.card:hover, .db-kpi:hover, .pj-card:hover, .tile:hover, .fl-folder:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.card-h { min-height: 56px; padding: 12px 24px; gap: 12px; border-bottom-color: var(--line); flex-wrap: wrap; }
.card-h h3 { font-size: 14.5px; font-weight: 500; letter-spacing: -.012em; }
.card-b { padding: 24px; gap: 16px; }
.split, .grid2 { gap: 20px; }
.kv { grid-template-columns: 140px 1fr; gap: 12px 16px; font-size: 13.5px; }
.kv dt { font-size: 10px; letter-spacing: .1em; }
.tile { border-radius: var(--r); }

/* stats */
.stats { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.stat { padding: 20px 22px; gap: 8px; }
.stat-v { font-weight: 500; font-size: 28px; letter-spacing: -.035em; line-height: 1.1; font-feature-settings: "tnum"; }

@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px 16px; gap: 6px; }
  .stat .mono { font-size: 9.5px; letter-spacing: .08em; }
  .stat-v { font-size: 20px; }
}

/* ---------- tables ---------- */
.tbl { font-size: 13.5px; }
.tbl th {
  height: 40px; padding: 0 16px; font-size: 10px; letter-spacing: .1em; color: var(--ink-3);
  background: color-mix(in srgb, var(--panel-2) 92%, transparent); border-bottom: 1px solid var(--line);
}
.tbl td { height: 52px; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.tbl tbody tr { transition: background 120ms; }
.tbl tbody tr:hover { background: color-mix(in srgb, var(--hover) 80%, transparent); }
.tbl a.row-link { font-weight: 500; letter-spacing: -.005em; white-space: nowrap; }
.tbl a.row-link:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.tbl td small.dim { font-size: 12px; }
.card > .tbl-wrap:last-child .tbl tr:last-child td:first-child { border-bottom-left-radius: var(--r); }
/* sticky header where the table does not need its own horizontal scroll */
@media (min-width: 1240px) {
  .card > .tbl-wrap { overflow: visible; }
  .card > .tbl-wrap .tbl th { position: sticky; top: var(--top); z-index: 2; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
}
.pager { padding: 12px 20px; }

/* ---------- badges ---------- */
.badge {
  height: 22px; padding: 0 9px 0 8px; gap: 6px; border-radius: 999px; font-size: 10px; letter-spacing: .07em;
  background: var(--panel); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2);
}
.badge::before { width: 6px; height: 6px; background: var(--ink-3); }
.badge-ok, .badge-warn, .badge-err { background: var(--panel); color: var(--ink); }
.badge-ok::before { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.badge-warn::before { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }
.badge-err::before { background: var(--err); box-shadow: 0 0 0 3px var(--err-bg); }
.badge-ink { background: var(--chip); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink-3); }
.badge-ink::before { background: var(--ink); }

/* ---------- empty states ---------- */
.empty { padding: 56px 24px; gap: 10px; }
.empty img { width: 56px; opacity: 1; filter: drop-shadow(0 8px 24px var(--glow)); margin-bottom: 6px; }
.empty h3 { font-weight: 500; font-size: 18px; letter-spacing: -.02em; }
.empty p { margin: 0; max-width: 48ch; font-size: 14px; }

/* ---------- kanban ---------- */
.kanban { gap: 12px; grid-auto-columns: minmax(248px, 1fr); }
.kcol { background: color-mix(in srgb, var(--bg-2) 70%, transparent); border: 1px solid var(--line); border-radius: var(--r); padding: 8px; gap: 8px; }
.kcol-h { padding: 6px 8px 4px; }
.kcard { padding: 14px; gap: 8px; border-radius: var(--r-md); border-color: var(--line); box-shadow: var(--shadow); transition: border-color var(--t), box-shadow var(--t), transform var(--t) var(--ease-o); }
.kcard:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.kcol.over { outline: 1.5px dashed var(--ink-3); outline-offset: -5px; }

/* ---------- timeline ---------- */
.timeline { gap: 0; }
.timeline li { position: relative; grid-template-columns: 14px 1fr; gap: 12px; padding-bottom: 16px; font-size: 13.5px; }
.timeline li::before { width: 9px; height: 9px; margin: 6px 0 0 2px; background: var(--panel); box-shadow: inset 0 0 0 1.5px var(--ink-3); position: relative; z-index: 1; }
.timeline li:not(:last-child)::after { content: ""; position: absolute; left: 6px; top: 18px; bottom: 0; width: 1px; background: var(--line-2); }
.timeline li:last-child { padding-bottom: 0; }
.timeline small { font-size: 12px; margin-top: 2px; }

/* progress */
.pbar, .bar { height: 5px; background: var(--chip); }
.pbar::-webkit-progress-bar { background: var(--chip); }
.pbar::-webkit-progress-value { background: var(--ink); }

/* modal */
dialog.modal { border-radius: 18px; border-color: var(--line-2); box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 40px 100px -20px rgba(0, 0, 0, .45); }
dialog.modal[open] { animation: th-pop 220ms var(--ease-o); }
dialog.modal::backdrop { background: rgba(8, 8, 10, .42); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal-h { padding: 18px 24px; }
.modal-h h3 { font-weight: 500; font-size: 16px; }
.modal-b { padding: 24px; }
@keyframes th-pop { from { opacity: 0; transform: translateY(6px) scale(.985); } to { opacity: 1; transform: none; } }

/* messages */
.msg { border-radius: 14px; }

/* ---------- dashboard ---------- */
.hello { gap: 10px; padding: 8px 0 4px; }
.hello > .mono { margin: 0; }
.hello .display { font-weight: 200; font-size: clamp(40px, 4.4vw, 60px); letter-spacing: -.05em; line-height: 1; }
.hello .lead { color: var(--ink-2); }
.db-kpis { grid-template-columns: repeat(auto-fit, minmax(min(100%, 188px), 1fr)); }
.db-kpi { display: grid; grid-template-rows: auto 1fr auto; gap: 14px; padding: 18px 20px 16px; min-height: 156px; color: inherit; }
.db-kpi:hover { transform: translateY(-2px); }
.db-kpi-h { display: flex; align-items: center; gap: 10px; min-width: 0; }
.db-kpi-h .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-kpi-i, .db-group-i, .db-tile-i { flex: none; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--chip); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.db-kpi-i .ic, .db-tile-i .ic { width: 16px; height: 16px; }
.db-kpi-v { align-self: end; gap: 0; }
.db-kpi .stat-v { font-size: 32px; font-weight: 500; letter-spacing: -.04em; }
.db-kpi .stat-v.db-kpi-multi { font-size: 22px; }
.db-kpi-f { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; min-height: 28px; }
.db-kpi-s { font-size: 12.5px; color: var(--ink-3); }
.db-spark { flex: none; width: 92px; height: 28px; overflow: visible; }
.db-spark-l { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; opacity: .85; }
.db-spark-a { fill: var(--ink); opacity: .06; }
.db-spark-d { fill: var(--panel); stroke: var(--ink); stroke-width: 1.5; }
.db-kpi-bar { width: 92px; flex: none; margin-bottom: 8px; }

.db-grid { grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; }
@media (max-width: 1240px) { .db-grid { grid-template-columns: minmax(0, 1fr) 320px; } }
@media (max-width: 1100px) { .db-grid { grid-template-columns: minmax(0, 1fr); } }
.db-main, .db-side { gap: 20px; }
.db-count { padding: 4px 9px; border-radius: 999px; background: var(--chip); color: var(--ink-2); }
.db-group { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.db-group-h { padding: 16px 24px 6px; }
.db-group-h p { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; color: var(--ink); }
.db-group-h p .dim { font-weight: 400; }
.db-group-i { width: 26px; height: 26px; border-radius: 8px; }
.db-group-i .ic { width: 14px; height: 14px; }
.db-list { padding: 0; }
.db-list-pad { padding: 6px 0; }
.db-row { min-height: 52px; padding: 8px 24px; gap: 12px; justify-content: flex-start; transition: background 120ms; }
.db-row:hover { background: var(--hover); }
.db-row-t { flex: 1; }
.db-row-t b { font-size: 13.5px; }
.db-row-t small { font-size: 12px; }
.db-dot { flex: none; width: 7px; height: 7px; margin-left: 9px; margin-right: 10px; border-radius: 50%; background: var(--ink-3); opacity: .7; }
.db-dot.badge-err { background: var(--err); box-shadow: 0 0 0 3px var(--err-bg); opacity: 1; }
.db-dot.badge-warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); opacity: 1; }
.db-dot.badge-ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); opacity: 1; }
.db-dot.badge-ink { background: var(--ink); opacity: 1; box-shadow: 0 0 0 3px var(--chip); }
.db-empty { padding: 48px 24px; }
.db-none { padding: 18px 24px; font-size: 13.5px; }
.db-more { font-size: 10px; }

/* quick actions as icon tiles */
.db-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 16px; }
.db-tile {
  position: relative; display: grid; align-content: space-between; gap: 18px; min-height: 96px; padding: 14px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--panel-2); text-decoration: none; color: var(--ink);
  transition: border-color var(--t), background var(--t), box-shadow var(--t), transform var(--t) var(--ease-o);
}
.db-tile:hover { border-color: var(--line-2); background: var(--panel); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.db-tile-t { font-size: 13px; font-weight: 500; line-height: 1.3; letter-spacing: -.005em; padding-right: 14px; }
.db-tile .arrow { position: absolute; top: 14px; right: 14px; color: var(--ink-3); font-size: 13px; transition: transform var(--t) var(--ease-o), color var(--t); }
.db-tile:hover .arrow { color: var(--ink); transform: translateX(2px); }
.db-tile-p { background: var(--fill); color: var(--fill-ink); border-color: var(--fill); box-shadow: var(--btn-hi), 0 8px 20px -10px rgba(0, 0, 0, .45); }
.db-tile-p:hover { background: var(--fill); border-color: var(--fill); opacity: .92; }
.db-tile-p .db-tile-i { background: color-mix(in srgb, var(--fill-ink) 14%, transparent); color: var(--fill-ink); box-shadow: none; }
.db-tile-p .arrow, .db-tile-p:hover .arrow { color: var(--fill-ink); }
.db-tiles .db-tile:last-child:nth-child(odd) { grid-column: 1 / -1; min-height: 0; grid-template-columns: auto 1fr; align-items: center; gap: 12px; }

/* agenda rows */
.db-agenda .db-row { align-items: center; }
.db-when { flex: none; min-width: 92px; padding: 5px 8px; border-radius: 8px; background: var(--chip); color: var(--ink); font-size: 10px; text-align: center; white-space: nowrap; }

/* activity feed with avatars */
.db-feed { list-style: none; margin: 0; padding: 14px 24px 18px; display: grid; }
.db-feed li { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding-bottom: 16px; font-size: 13.5px; }
.db-feed li:last-child { padding-bottom: 0; }
.db-feed li:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 32px; bottom: 4px; width: 1px; background: var(--line); }
.db-feed-w { font-weight: 500; text-decoration: none; }
a.db-feed-w:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.db-feed small { display: block; color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.db-feed .dim { overflow-wrap: anywhere; }

/* client project cards */
.db-sec { gap: 12px; }
.pj-cards { gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.pj-card { gap: 14px; padding: 20px 22px; }
.pj-card-h { justify-content: space-between; align-items: center; }
.pj-card-pc { color: var(--ink); font-size: 11px; }
.pj-card-t { font-weight: 500; font-size: 18px; letter-spacing: -.02em; }
.pj-todo { border-color: var(--line); }

@media (max-width: 560px) {
  .db-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .db-kpi { min-height: 0; padding: 14px; gap: 10px; }
  .db-kpi .mono { font-size: 9.5px; letter-spacing: .08em; }
  .db-kpi-i { display: none; }
  .db-kpi .stat-v { font-size: 22px; }
  .db-kpi .stat-v.db-kpi-multi { font-size: 18px; }
  .db-kpi-f { flex-direction: column; align-items: stretch; gap: 8px; }
  .db-spark, .db-kpi-bar { width: 100%; }
  .db-row { display: grid; grid-template-columns: auto minmax(0, 1fr); padding: 10px 16px; row-gap: 6px; }
  .db-row > .badge { grid-column: 2; justify-self: start; }
  .db-agenda .db-row { grid-template-columns: minmax(0, 1fr); }
  .db-when { justify-self: start; min-width: 0; }
  .db-group-h, .db-feed, .db-none { padding-left: 16px; padding-right: 16px; }
  .card-h { padding: 12px 16px; }
  .db-tiles { padding: 12px; }
}

/* ---------- module touches through shared classes ---------- */
.kv dd { font-size: 13.5px; }
.pj-step { padding: 12px 0; }
.fl-node.on { background: var(--chip); box-shadow: inset 0 0 0 1px var(--line); }
.ib-unread { box-shadow: inset 2px 0 0 var(--ink); }
.op-sitem { border-radius: 9px; }
dialog.op-sdlg { border-radius: 18px; }

/* ---------- sign-in ---------- */
body.auth { background: radial-gradient(900px 420px at 80% -140px, var(--glow), transparent 70%) no-repeat, var(--bg); }
.auth-art { margin: 12px; border-radius: 20px; min-height: calc(100vh - 24px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
.auth-art::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(600px 400px at 75% 25%, rgba(220, 220, 230, .09), transparent 70%); }
.auth-box { padding: 32px; border-radius: 20px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-2); }
.box-h { font-weight: 500; font-size: 26px; letter-spacing: -.03em; }
.box-lead { font-size: 14.5px; }
.auth-box .btn-fill { height: 42px; }
@media (max-width: 860px) {
  .auth-art { min-height: 240px; margin: 8px; }
  .auth-box { padding: 24px 20px; }
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) {
  a.card:hover, .db-kpi:hover, .pj-card:hover, .tile:hover, .kcard:hover, .db-tile:hover, .fl-folder:hover { transform: none; }
  dialog.modal[open] { animation: none; }
}

/* client space: my team */
.mt-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; align-items: start; }
.nw-lead { margin: 6px 0 0; font-size: 14.5px; }
@media (max-width: 1080px) { .mt-grid { grid-template-columns: 1fr; } }
.im-history { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.im-history select { height: 34px; }
.im-history small { flex-basis: 100%; }

/* inbox: received vs sent, reply form, signatures */
.ib-dir { display: inline-block; margin-right: 8px; padding: 2px 8px; border-radius: 999px; font: 500 10.5px/1.5 var(--mono); letter-spacing: .06em; text-transform: uppercase; vertical-align: 1px; }
.ib-dir-in { background: var(--panel-2); color: var(--ink); border: 1px solid var(--line-2); }
.ib-dir-out { background: var(--ink); color: var(--bg); }
.ib-client { font-size: 11px; }
.ib-thread { display: grid; gap: 14px; }
.ib-msg { max-width: 86%; border-radius: 14px; }
.ib-msg.ib-in { justify-self: start; background: var(--panel); }
.ib-msg.ib-out { justify-self: end; background: var(--panel-2); border-color: var(--ink-3); }
.ib-msg-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ib-body { white-space: pre-line; line-height: 1.6; }
.ib-reply { display: grid; gap: 10px; }
.ib-reply-h { display: flex; gap: 10px; align-items: baseline; }
.ib-reply textarea { width: 100%; min-height: 200px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); font: inherit; line-height: 1.6; resize: vertical; }
.ib-ai { display: flex; gap: 8px; }
.ib-ai input { flex: 1; min-width: 0; height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); font: inherit; }
.ib-ai-status { min-height: 1em; }
.ib-fmt { display: flex; gap: 6px; flex-wrap: wrap; }
.ib-fmt .btn { height: 30px; padding: 0 10px; }
.ib-reply-f { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ib-sig { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.ib-sig select { height: 34px; }
.sg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 20px; align-items: start; }
.sg-body { display: grid; gap: 12px; }
.sg-prev { width: 100%; height: 260px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.sg-code { font-size: 12px; }
@media (max-width: 700px) { .ib-msg { max-width: 100%; } .ib-ai { flex-direction: column; } .sg-grid { grid-template-columns: 1fr; } }
