:root {
  --bg: #f6f6f4;
  --surface: #ffffff;
  --sunken: #f0f0ed;
  --ink: #17181c;
  --ink-2: #3d4048;
  --muted: #6b6f78;
  --line: #e3e3df;
  --line-2: #d4d4cf;
  --accent: #3a53d4;
  --accent-ink: #ffffff;
  --accent-soft: #e9ecfb;
  --brand: #472b30;
  --ok: #1f7a4a;
  --ok-soft: #e3f3ea;
  --warn: #9a5b07;
  --warn-soft: #f8edd9;
  --bad: #a3372b;
  --bad-soft: #f8e4e1;
  --shadow: 0 1px 2px rgba(20, 20, 30, .05), 0 4px 16px rgba(20, 20, 30, .04);
  --radius: 10px;
  --sans: "Inter", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111215; --surface: #18191d; --sunken: #1f2025; --ink: #ececee; --ink-2: #c7c8cd;
    --muted: #9497a0; --line: #2a2c32; --line-2: #363841; --accent: #7d8ff0; --accent-ink: #0d0f1a;
    --accent-soft: #232a4d; --ok: #5cc48d; --ok-soft: #173225; --warn: #e2a64a; --warn-soft: #3a2c14;
    --bad: #ef8a7d; --bad-soft: #3d1f1b; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111215; --surface: #18191d; --sunken: #1f2025; --ink: #ececee; --ink-2: #c7c8cd;
  --muted: #9497a0; --line: #2a2c32; --line-2: #363841; --accent: #7d8ff0; --accent-ink: #0d0f1a;
  --accent-soft: #232a4d; --ok: #5cc48d; --ok-soft: #173225; --warn: #e2a64a; --warn-soft: #3a2c14;
  --bad: #ef8a7d; --bad-soft: #3d1f1b; --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 26px; font-weight: 650; }
h2 { font-size: 17px; font-weight: 620; }
h3 { font-size: 14.5px; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .02em; }
.hidden { display: none !important; }

/* ---------- buttons, inputs, chips ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: var(--surface);
  border-radius: 8px; padding: 7px 13px; font-weight: 550; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--sunken); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { opacity: .88; }
.btn.accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--sunken); }
.btn:disabled { opacity: .5; cursor: default; }
.input { width: 100%; border: 1px solid var(--line-2); background: var(--surface); border-radius: 8px; padding: 9px 12px; outline: none; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { resize: vertical; min-height: 84px; }
label.field { display: grid; gap: 6px; font-weight: 550; font-size: 13px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 550;
  background: var(--sunken); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chip.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 32px 28px; box-shadow: var(--shadow); }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; font-weight: 650; font-size: 15px; }
.login-brand img { height: 30px; }
.login h1 { font-size: 22px; margin-bottom: 6px; }
.login form { display: grid; gap: 14px; margin-top: 22px; }
.code-input { font: 600 26px/1 var(--mono); letter-spacing: .5em; text-align: center; padding: 14px 8px 14px 20px; }
.login .error { color: var(--bad); font-size: 13px; }
.login .note { font-size: 12.5px; color: var(--muted); margin-top: 18px; line-height: 1.5; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-weight: 550; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; padding: 16px 12px; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; align-items: center; gap: 9px; padding: 4px 8px 16px; font-weight: 650; }
.side-brand img { height: 24px; }
.side-brand span.t { font-size: 12px; color: var(--muted); font-weight: 500; }
.ws-card { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 18px; }
.avatar { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; font-weight: 650; font-size: 12px; flex: none;
  background: var(--brand); color: #f0e7d3; }
.avatar.round { border-radius: 50%; }
.ws-card .n { font-weight: 600; font-size: 13.5px; line-height: 1.2; }
.ws-card .s { font-size: 12px; color: var(--muted); }
.nav-h { font-size: 11.5px; color: var(--muted); font-weight: 550; padding: 10px 10px 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; text-decoration: none; color: var(--ink-2); font-weight: 500; }
.nav a:hover { background: var(--sunken); }
.nav a.on { background: var(--sunken); color: var(--ink); font-weight: 600; }
.nav svg { width: 16px; height: 16px; flex: none; opacity: .8; }
.nav .count { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 12px 8px 0; font-size: 12.5px; }
.side-foot .who { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { min-width: 0; }
.top { display: flex; align-items: center; gap: 12px; padding: 12px 28px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.crumbs { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; min-width: 0; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs b { color: var(--ink); font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none; }
.page { padding: 28px 28px 64px; max-width: 1160px; }

.sample-bar { display: flex; gap: 12px; align-items: center; background: var(--accent-soft); color: var(--ink-2); border-radius: var(--radius);
  padding: 11px 14px; margin-bottom: 24px; font-size: 13.5px; }
.sample-bar svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.sample-bar .btn { margin-left: auto; }

.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.head p { margin-top: 6px; }
.section { margin-top: 34px; }
.section > h2 { margin-bottom: 12px; display: flex; align-items: baseline; gap: 10px; }
.section > h2 .muted { font-size: 13px; font-weight: 450; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 16px 18px; }

/* ---------- overview ---------- */
.brief { list-style: none; margin: 0; padding: 0; }
.brief li { padding: 14px 18px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 22px 1fr; gap: 10px; }
.brief li:first-child { border-top: 0; }
.brief .n { font: 600 12px/22px var(--mono); color: var(--muted); }
.brief .h { font-weight: 560; font-size: 15px; line-height: 1.45; }
.brief .d { color: var(--ink-2); margin-top: 4px; }
.brief .t { margin-top: 8px; }

.steps3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.step3 { padding: 18px; display: flex; flex-direction: column; gap: 10px; text-decoration: none; transition: border-color .15s; }
a.step3:hover { border-color: var(--accent); }
.step3 .num { font: 600 12px var(--mono); color: var(--accent); }
.step3 h3 { font-size: 15.5px; line-height: 1.4; }
.step3 p { color: var(--ink-2); font-size: 13.5px; }
.step3 .foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; padding-top: 6px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { padding: 16px 18px; }
.stat .v { font-size: 28px; font-weight: 650; letter-spacing: -0.02em; }
.stat .l { font-weight: 560; margin-top: 2px; }
.stat .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.lastweek li { display: flex; gap: 12px; align-items: baseline; padding: 11px 18px; border-top: 1px solid var(--line); }
.lastweek li:first-child { border-top: 0; }
.lastweek ul { list-style: none; margin: 0; padding: 0; }

.ws-table { width: 100%; border-collapse: collapse; }
.ws-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 550; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.ws-table td { padding: 13px 18px; border-top: 1px solid var(--line); vertical-align: top; }
.ws-table tr:first-child td { border-top: 0; }
.ws-table ul { margin: 0; padding-left: 16px; color: var(--ink-2); }
.bar { height: 6px; background: var(--sunken); border-radius: 3px; overflow: hidden; margin-top: 6px; width: 120px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

/* ---------- findings grid ---------- */
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .input { max-width: 340px; }
.toolbar select.input { width: auto; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.wf { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; text-decoration: none; transition: border-color .15s; }
.wf:hover { border-color: var(--ink-2); }
.wf h3 { font-size: 15px; line-height: 1.4; }
.wf .roles { display: flex; gap: 5px; flex-wrap: wrap; }
.wf .kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.kv .k { font-size: 12px; color: var(--muted); }
.kv .v { font-weight: 600; }
.apps { display: flex; gap: 5px; }
.app-ico { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font: 700 10.5px var(--sans); color: #fff; flex: none; }

/* ---------- finding detail ---------- */
.meta { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; color: var(--ink-2); font-size: 13.5px; margin-top: 10px; }
.meta b { font-weight: 650; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 22px 0 18px; }
.tabs button { background: none; border: 0; padding: 9px 12px; font-weight: 550; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--ink); }
.wt { display: grid; grid-template-columns: 1.25fr 1fr; overflow: hidden; }
.wt .frame-col { padding: 16px; border-right: 1px solid var(--line); background: var(--sunken); }
.wt .frame-col svg { width: 100%; height: auto; display: block; border-radius: 6px; box-shadow: 0 2px 10px rgba(0,0,0,.12); cursor: zoom-in; }
.frame-cap { font-size: 12px; color: var(--muted); margin-top: 10px; line-height: 1.5; }
.wt .text-col { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.step-of { font: 12px var(--mono); color: var(--muted); }
.wt h2 { font-size: 18px; line-height: 1.35; }
.decision { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; background: var(--sunken); }
.decision .q { font-weight: 600; margin-bottom: 10px; }
.decision .yn { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; font-size: 13px; }
.decision .yn .l { font-size: 11.5px; color: var(--muted); font-weight: 550; margin-bottom: 2px; }
.expected .l { font-size: 12px; color: var(--muted); font-weight: 550; }
.wt-nav { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; }
.step-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.step-list li button { width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center; cursor: pointer; }
.step-list li button.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.step-list .i { font: 600 12px var(--mono); color: var(--muted); }
.build { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.build .card h3 { font-size: 12.5px; color: var(--muted); font-weight: 550; margin-bottom: 6px; }
.build .wide { grid-column: 1 / -1; }

.lightbox { position: fixed; inset: 0; background: rgba(8, 8, 12, .78); display: grid; place-items: center; z-index: 50; padding: 24px; cursor: zoom-out; }
.lightbox svg { width: min(1100px, 100%); height: auto; border-radius: 8px; }
.wt .frame-col .shot { position: relative; cursor: zoom-in; }
.wt .frame-col .shot img { width: 100%; height: auto; display: block; border-radius: 6px; box-shadow: 0 2px 10px rgba(0,0,0,.12); background: #e9ebef; }
.shot-tag { position: absolute; left: 8px; bottom: 8px; font-size: 11px; font-weight: 600; letter-spacing: .02em; color: #fff; background: rgba(15, 18, 28, .72); padding: 3px 8px; border-radius: 5px; pointer-events: none; }
.lightbox .shot { position: relative; width: min(1400px, 100%); }
.lightbox .shot img { width: 100%; height: auto; display: block; border-radius: 8px; }
.lightbox .shot-tag { left: 12px; bottom: 12px; font-size: 12px; }

/* ---------- people ---------- */
.people-group { margin-top: 26px; }
.people-group h2 { margin-bottom: 10px; font-size: 15px; }
.person { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.person .top-row { display: flex; gap: 10px; align-items: center; }
.person .avatar { background: var(--sunken); color: var(--ink-2); border: 1px solid var(--line); }
.person .nm { font-weight: 600; line-height: 1.2; }
.person .rl { font-size: 12.5px; color: var(--muted); }
.person ul { margin: 0; padding-left: 16px; color: var(--ink-2); font-size: 13.5px; }
.person .wait { font-size: 12.5px; color: var(--warn); }

/* ---------- lists ---------- */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: baseline; }
.rows li:first-child { border-top: 0; }
.rows .grow { flex: 1; min-width: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.fu { list-style: none; padding: 0; margin: 8px 0 0; font-size: 13.5px; }
.fu li { display: flex; gap: 8px; padding: 3px 0; border: 0; }
.check { width: 15px; height: 15px; border-radius: 4px; border: 1.5px solid var(--line-2); flex: none; margin-top: 3px; display: grid; place-items: center; }
.check.on { background: var(--ok); border-color: var(--ok); }
.check.on::after { content: ""; width: 7px; height: 4px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }

/* ---------- ask ---------- */
.ask-box { display: flex; gap: 10px; }
.ask-box .input { font-size: 15px; padding: 12px 14px; }
.suggest { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.suggest button { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 13px; }
.suggest button:hover { border-color: var(--accent); }
.answer { margin-top: 20px; padding: 18px 20px; }
.answer .q { font-weight: 600; margin-bottom: 8px; }
.answer .a { font-size: 15px; line-height: 1.6; }

/* ---------- forms / admin ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 550; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.table td { padding: 11px 16px; border-top: 1px solid var(--line); }
.table tr:first-child td { border-top: 0; }
.form-row { display: grid; grid-template-columns: 1fr 160px auto; gap: 10px; align-items: start; }
.msg { font-size: 13px; margin-top: 8px; }
.msg.err { color: var(--bad); }
.msg.ok { color: var(--ok); }
.toggle-row { display: flex; gap: 14px; align-items: flex-start; padding: 14px 18px; border-top: 1px solid var(--line); }
.toggle-row:first-child { border-top: 0; }
.toggle-row .grow { flex: 1; }
.sw { width: 36px; height: 20px; border-radius: 10px; background: var(--line-2); position: relative; flex: none; margin-top: 2px; }
.sw.on { background: var(--ok); }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.sw.on::after { left: 18px; }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { display: grid; grid-template-columns: 110px 1fr; gap: 14px; padding: 12px 18px; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; }
.timeline .when { font: 600 12px/22px var(--mono); color: var(--accent); }

.pilot { display: grid; grid-template-columns: 1fr 360px; gap: 18px; align-items: start; }
.plan { padding: 20px; position: sticky; top: 76px; }
.plan .price { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; }
.plan ul { padding-left: 18px; margin: 12px 0 16px; color: var(--ink-2); }
.plan li { margin: 4px 0; }
.pilot form { display: grid; gap: 16px; padding: 20px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.done-box { padding: 22px; border-color: var(--ok); }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .grid3, .steps3 { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .pilot { grid-template-columns: 1fr; }
  .plan { position: static; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 30; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .shell.nav-open .side { transform: none; }
  .menu-btn { display: inline-flex; }
  .top { padding: 10px 16px; }
  .top .right .chip { display: none; }
  .page { padding: 20px 16px 56px; }
  .grid3, .steps3, .stats, .two, .build, .grid2 { grid-template-columns: 1fr; }
  .wt { grid-template-columns: 1fr; }
  .wt .frame-col { border-right: 0; border-bottom: 1px solid var(--line); }
  .form-row { grid-template-columns: 1fr; }
  .ws-table th:nth-child(3), .ws-table td:nth-child(3) { display: none; }
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
  .table .hide-sm { display: none; }
  h1 { font-size: 22px; }
}

/* team join */
.join h2 { margin-bottom: 6px; }
.copy-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 12px; }
.affix { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); }
.affix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.affix > span { padding-left: 12px; color: var(--muted, #6b6f78); }
.affix .input { border: 0; box-shadow: none; padding-left: 4px; }
@media (max-width: 820px) { .copy-row { grid-template-columns: 1fr; } }
