/* Design tokens, taken from the reference: grey frame, white panel, ink text, hairline borders,
   outline icons, grey count chips, dotted status badges, quiet table headers. */
:root {
  --frame: #F7F7F8;        /* app background + sidebar */
  --panel: #FFFFFF;        /* main panel */
  --ink: #0A0A0B;          /* titles, primary text, primary button */
  --text: #3F3F46;         /* body */
  --muted: #71717A;        /* secondary text */
  --faint: #A1A1AA;        /* placeholders, icons at rest */
  --line: #EDEDF0;         /* hairlines inside the panel */
  --line-strong: #E4E4E7;  /* control borders */
  --hover: #F4F4F5;
  --active: #EEEEF0;       /* selected nav row */
  --chip: #F1F1F3;         /* count chips, kbd */
  --head: #FAFAFA;         /* table header row */
  --green: #12B76A; --green-ink: #067647; --green-bg: #ECFDF3;
  --red: #F04438;   --red-ink: #B42318;   --red-bg: #FEF3F2;
  --amber: #F79009; --amber-ink: #B54708; --amber-bg: #FFFAEB;
  --blue: #2E90FA;  --blue-ink: #175CD3;  --blue-bg: #EFF8FF;
  --violet: #7A5AF8;
  --r-sm: 6px; --r: 10px; --r-lg: 14px; --r-xl: 16px;
  --shadow-xs: 0 1px 2px rgba(10, 10, 11, .05);
  --shadow: 0 1px 2px rgba(10, 10, 11, .04), 0 4px 16px rgba(10, 10, 11, .04);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--frame); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01'; }
h1, h2, h3 { color: var(--ink); margin: 0; line-height: 1.2; }
h1 { font-size: 28px; font-weight: 700; letter-spacing: -.025em; }
h2 { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: 14px; font-weight: 600; }
a { color: var(--ink); text-decoration: none; }
[hidden] { display: none !important; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 13px; } .xs { font-size: 12px; }
.error { color: var(--red-ink); min-height: 18px; margin: 0; font-size: 13px; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 15px; height: 15px; }

/* sign-in */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.signin-card { width: 100%; max-width: 380px; display: grid; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 32px; box-shadow: var(--shadow); }
.signin-card .mark { margin-bottom: 4px; }

/* frame */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.side { padding: 20px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; font-weight: 600; color: var(--ink); font-size: 15px; }
.mark { width: 28px; height: 28px; border-radius: 8px; background: var(--ink); color: #fff; display: grid; place-items: center; }
.mark svg.i { width: 16px; height: 16px; stroke-width: 2; }
.quick { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); background: var(--panel); border-radius: var(--r); padding: 8px 10px; color: var(--muted); box-shadow: var(--shadow-xs); cursor: pointer; font: inherit; width: 100%; }
.quick .lbl { flex: 1; text-align: left; color: var(--text); }
kbd { font: 500 11px var(--font); background: var(--chip); color: var(--muted); border-radius: 5px; padding: 2px 6px; }
.nav-label { font-size: 13px; color: var(--muted); padding: 0 10px; margin: 6px 0 4px; }
nav { display: grid; gap: 1px; }
nav a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--r); color: var(--text); font-weight: 500; }
nav a svg.i { color: var(--muted); }
nav a:hover { background: var(--hover); }
nav a.on { background: var(--active); color: var(--ink); }
nav a.on svg.i { color: var(--ink); }
nav a .count { margin-left: auto; }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--r-sm); background: var(--chip); color: var(--text); font-size: 12px; font-weight: 600; }
.side-foot { margin-top: auto; display: grid; gap: 10px; padding: 12px 10px 0; border-top: 1px solid var(--line-strong); }
.me { display: flex; align-items: center; gap: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 999px; background: linear-gradient(135deg, #C7D2FE, #FBCFE8); color: var(--ink); display: grid; place-items: center; font-weight: 600; font-size: 12px; flex: none; }

.main { margin: 8px 8px 8px 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-xs); min-height: calc(100vh - 16px); display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 56px; display: flex; align-items: center; gap: 8px; padding: 0 24px; border-bottom: 1px solid var(--line); font-size: 15px; flex: none; }
.crumb { color: var(--muted); } .crumb-sep { color: var(--faint); }
.crumb-now { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 500; }
.topbar .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.view { padding: 36px 40px 64px; width: 100%; }

/* page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.title-row { display: flex; align-items: center; gap: 10px; }
.title-row .count { height: 26px; font-size: 13px; }
.subtitle { color: var(--muted); font-size: 15px; margin-top: 8px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.back:hover { color: var(--ink); }

/* tabs (Table / Board / List style) */
.tabs { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: var(--r); color: var(--muted); font-weight: 500; border: 0; background: none; cursor: pointer; font: inherit; font-weight: 500; }
.tab:hover { color: var(--ink); }
.tab.on { background: var(--hover); color: var(--ink); }
.tab .count { height: 20px; min-width: 20px; font-size: 11px; background: var(--panel); border: 1px solid var(--line); }
.tabs .search { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); }
.tabs .search input { border: 0; padding: 6px 0; width: 180px; outline: none; background: none; }

/* filter chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.chip { position: relative; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 12px 0 12px; height: 36px; color: var(--text); background: var(--panel); font-weight: 500; }
.chip svg.i { color: var(--muted); }
.chip select { appearance: none; border: 0; background: transparent; font: inherit; font-weight: 500; color: var(--ink); padding: 0 18px 0 0; cursor: pointer; outline: none; width: auto; }
.chip .chev { position: absolute; right: 10px; pointer-events: none; color: var(--muted); }
.chip.set { border-color: var(--ink); }
.add-filter { color: var(--muted); display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: var(--r); padding: 0 14px; height: 36px; font: inherit; font-weight: 600; cursor: pointer; background: var(--panel); color: var(--ink); box-shadow: var(--shadow-xs); white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #26262B; }
.btn.ok { color: var(--green-ink); }
.btn.bad { color: var(--red-ink); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--ink); cursor: pointer; font: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.link:hover { text-decoration-color: var(--ink); }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); font-size: 13px; font-weight: 500; color: var(--text); background: var(--panel); white-space: nowrap; }
.badge i { width: 6px; height: 6px; border-radius: 999px; background: var(--faint); }
.badge.green i { background: var(--green); } .badge.red i { background: var(--red); } .badge.amber i { background: var(--amber); }
.badge.blue i { background: var(--blue); } .badge.violet i { background: var(--violet); } .badge.ink i { background: var(--ink); }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--r-sm); background: var(--chip); color: var(--text); font-size: 12px; font-weight: 500; white-space: nowrap; }

/* forms */
label { display: grid; gap: 6px; font-weight: 500; color: var(--ink); font-size: 13px; }
input, select, textarea { font: inherit; border: 1px solid var(--line-strong); border-radius: var(--r); padding: 8px 12px; background: var(--panel); color: var(--ink); width: 100%; box-shadow: var(--shadow-xs); }
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: 3px solid #EDEDF3; border-color: #A1A1AA; }
.check-row { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--text); font-size: 14px; }
.check-row input { width: 16px; height: 16px; box-shadow: none; accent-color: var(--ink); }

/* table */
.table { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 14px; padding: 0 16px; height: 48px; background: var(--head); border-bottom: 1px solid var(--line); white-space: nowrap; }
th + th, td + td { border-left: 1px solid var(--line); }
th .th { display: inline-flex; align-items: center; gap: 8px; }
td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--text); }
tr:last-child td { border-bottom: 0; }
td.name b { color: var(--ink); font-weight: 500; }
tr.click { cursor: pointer; } tr.click:hover td { background: #FCFCFD; }
.cell-flex { display: flex; align-items: center; gap: 12px; }
.logo-dot { width: 32px; height: 32px; border-radius: 999px; display: grid; place-items: center; font-weight: 600; font-size: 12px; color: var(--ink); flex: none; }
.score { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

/* cards & lists */
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.card { overflow-wrap: anywhere; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.card-head .right { margin-left: auto; }
.card-sub { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.item { padding: 14px 0; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.item:last-child { border-bottom: 0; padding-bottom: 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row .grow { flex: 1; }
.msg { white-space: pre-wrap; background: var(--frame); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; font-size: 13px; color: var(--text); }
.empty { color: var(--muted); padding: 10px 0 2px; font-size: 14px; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 10px 16px; margin: 8px 0 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; color: var(--ink); word-break: break-word; }
.stat { display: grid; gap: 6px; }
.stat .lbl { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.stat .num { font-size: 28px; font-weight: 700; color: var(--ink); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r); margin-bottom: 24px; font-weight: 500; border: 1px solid #FEDF89; background: var(--amber-bg); color: var(--amber-ink); font-size: 13px; }
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.18); z-index: 10; font-weight: 500; }
.preview-frame { width: 100%; aspect-ratio: 16 / 10; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--frame); }
.preview-frame iframe { width: 200%; height: 200%; transform: scale(.5); transform-origin: 0 0; border: 0; pointer-events: none; }

@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; padding: 12px 16px; }
  nav { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .side-foot, .nav-label, .quick { display: none; }
  .main { margin: 0 8px 8px; }
  .view { padding: 24px 16px 48px; }
  .cols-2, .cols-3, .cols-4, .split { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
}

.tags { display: flex; gap: 6px; flex-wrap: nowrap; }
.title-row h1 { display: flex; align-items: center; gap: 12px; }

.card, .split > *, .grid > * { min-width: 0; }
.kv dd { min-width: 0; overflow-wrap: anywhere; }
.owner { padding: 8px 0; border-bottom: 1px dashed var(--line); display: grid; gap: 2px; }
.owner:first-child { padding-top: 0; }
@media (max-width: 1180px) { .split { grid-template-columns: 1fr; } }

/* Today */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { display: grid; gap: 6px; text-align: left; font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; min-width: 0; }
.kpi:not(:disabled) { cursor: pointer; }
.kpi:not(:disabled):hover { border-color: var(--line-strong); background: var(--head); }
.kpi-top { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 500; }
.kpi b { color: var(--ink); font-size: 30px; line-height: 1.1; font-weight: 600; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.kpi.hot .kpi-top svg { color: var(--green-ink); }
.kpi-sub { color: var(--muted); font-size: 12px; }
.today { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.today > aside { position: sticky; top: 16px; }
.today .card { scroll-margin-top: 16px; }
.today .card-head { margin-bottom: 2px; }
.list { display: grid; }
.li { padding: 12px 0; border-top: 1px solid var(--line); }
.list .li:first-child { border-top: 0; padding-top: 6px; }
.list .li:last-child { padding-bottom: 0; }
.li.stack { display: grid; gap: 10px; }
.biz { display: grid; min-width: 0; line-height: 1.35; }
.biz b { color: var(--ink); font-weight: 500; }
.biz span { color: var(--muted); font-size: 12px; }
.biz:hover b { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.reply { display: grid; gap: 4px; color: inherit; }
.reply b { color: var(--ink); font-weight: 500; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.views { display: grid; justify-items: end; color: var(--ink); font-weight: 600; font-size: 15px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.views small { color: var(--muted); font-size: 11px; font-weight: 400; }
.clear { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r-lg); background: var(--green-bg); color: var(--green-ink); font-size: 13px; }
.clear b { font-weight: 600; }
.m-biz { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.m-biz > .row { padding: 10px 14px; background: var(--head); }
.m-row { display: grid; grid-template-columns: 124px minmax(0, 1fr) 76px auto; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); }
.m-row .tag { justify-self: start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.m-main { min-width: 0; }
.m-title { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-size: 13px; font-weight: 500; max-width: 100%; }
.m-title svg { color: var(--faint); flex: none; }
.m-title:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.m-acts { display: flex; gap: 6px; }
@media (max-width: 1180px) { .today { grid-template-columns: minmax(0, 1fr); } .today > aside { position: static; } .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .m-row { grid-template-columns: minmax(0, 1fr) auto; } .m-main { grid-column: 1 / -1; grid-row: 2; } .m-acts { grid-column: 1 / -1; } .m-acts .btn { flex: 1; } }

