/* MirrorPartners: one stylesheet for the public site, the member app and the admin panel. */

:root {
  /* Purple + white. Surfaces are white on a faintly lavender page. */
  --bg: #f7f6fb;
  --bg-2: #f1eff8;
  --surface: #ffffff;
  --surface-2: #f6f4fd;
  --surface-3: #ece8f8;
  --border: #e7e3f2;
  --border-strong: #d6d0ea;
  --text: #15102a;
  --text-2: #3d3657;
  --muted: #6c6587;
  --faint: #9a94b3;
  --accent: #7c3aed;
  --accent-2: #6d28d9;
  --accent-3: #a78bfa;
  --accent-ink: #ffffff;
  --accent-soft: rgba(124, 58, 237, .09);
  --accent-line: rgba(124, 58, 237, .32);
  --chart-1: #7c3aed;
  --ink: #120c24;
  --ink-2: #1d1538;
  --success: #12a150;
  --success-soft: rgba(18, 161, 80, .1);
  --danger: #dc2f45;
  --danger-soft: rgba(220, 47, 69, .09);
  --warn: #c27a06;
  --warn-soft: rgba(230, 160, 20, .13);
  --info: #2f6fdb;
  --info-soft: rgba(47, 111, 219, .09);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(21, 16, 42, .04), 0 8px 24px -8px rgba(21, 16, 42, .1);
  --shadow-lg: 0 2px 4px rgba(21, 16, 42, .04), 0 24px 48px -16px rgba(60, 30, 140, .22);
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/static/fonts/geist-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/static/fonts/geist-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
img, svg, video, iframe { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); font-size: .9em; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-lg { width: 22px; height: 22px; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; }
.stack > * + * { margin-top: 1rem; }
.stack-sm > * + * { margin-top: .5rem; }
.row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.grid { display: grid; gap: 1rem; }
.grid-2 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.spacer { flex: 1; }
/* Grid items may shrink below their content (long unbroken titles ellipsize instead of widening the page). */
.grid > *, .grid-2 > *, .grid-3 > *, .setup-layout > *, .split > * { min-width: 0; }
.list, .thread, .steps, .money-flow, .feature-list, .chat-preview, .setup-side, .admin-nav { grid-template-columns: minmax(0, 1fr); }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 40px; padding: .5rem 1rem;
  border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface-2); color: var(--text);
  font: inherit; font-weight: 550; line-height: 1.2; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #57e6a8; border-color: #57e6a8; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: transparent; border-color: rgba(242, 100, 109, .45); color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { min-height: 32px; padding: .3rem .7rem; font-size: .875rem; border-radius: 8px; }
.btn-lg { min-height: 48px; padding: .7rem 1.4rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn[disabled] { opacity: .3; cursor: default; background: transparent; }
form.inline { display: inline; }

/* ---- forms ---- */
.field { display: block; }
.field + .field { margin-top: 1rem; }
.field > label, .label { display: block; font-weight: 550; font-size: .9rem; margin-bottom: .35rem; color: var(--text-2); }
.hint { font-size: .83rem; color: var(--muted); margin-top: .3rem; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number],
input[type=month], input[type=search], select, textarea {
  width: 100%; min-height: 42px; padding: .55rem .75rem;
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 10px;
  font: inherit;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
textarea.tall { min-height: 220px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=file] { color: var(--muted); font: inherit; max-width: 100%; }
.check { display: flex; gap: .6rem; align-items: flex-start; cursor: pointer; font-size: .92rem; color: var(--text-2); }
.check input { width: 18px; height: 18px; margin-top: .15rem; accent-color: var(--accent); flex: none; }
.form-actions { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; margin-top: 1.5rem; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem 1.2rem; margin: 0 0 1.25rem; }
legend { padding: 0 .4rem; font-weight: 650; color: var(--text); }
.fields-2 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.fields-2 .field + .field { margin-top: 0; }

/* ---- cards, notices, badges ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.card-tight { padding: 1rem; }
.card h2, .card h3 { margin-top: 0; }
.card-link { display: block; color: inherit; transition: border-color .15s, transform .15s; }
.card-link:hover { border-color: var(--border-strong); text-decoration: none; }
.card-link.row { display: flex; flex-wrap: nowrap; }

.notice { display: flex; gap: .65rem; align-items: flex-start; padding: .8rem 1rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: .92rem; }
.notice .icon { margin-top: .15rem; }
.notice p:last-child { margin-bottom: 0; }
.notice-ok { border-color: var(--accent-line); background: var(--accent-soft); }
.notice-ok .icon { color: var(--accent); }
.notice-error { border-color: rgba(242, 100, 109, .4); background: var(--danger-soft); }
.notice-error .icon { color: var(--danger); }
.notice-warn { border-color: rgba(240, 180, 67, .4); background: var(--warn-soft); }
.notice-warn .icon { color: var(--warn); }
.notice-info { border-color: rgba(108, 182, 255, .35); background: var(--info-soft); }
.notice-info .icon { color: var(--info); }
.notice ul { margin: 0; padding-left: 1.1rem; }

.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge-green { background: var(--accent-soft); color: var(--accent); }
.badge-amber { background: var(--warn-soft); color: var(--warn); }
.badge-red { background: var(--danger-soft); color: var(--danger); }
.badge-blue { background: var(--info-soft); color: var(--info); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: .72rem; font-weight: 700; line-height: 1; }

.progress { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s; }

.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty .icon { width: 28px; height: 28px; margin: 0 auto .75rem; color: var(--faint); }

.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-3); color: var(--text-2); font-size: .78rem; font-weight: 700; flex: none; letter-spacing: .02em; }
.avatar-staff { background: var(--accent-soft); color: var(--accent); }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: .7rem .9rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; background: var(--bg-2); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table a.rowlink { color: var(--text); font-weight: 550; }

/* ---- markdown content ---- */
.prose { color: var(--text-2); }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose h1, .prose h2, .prose h3 { color: var(--text); margin-top: 1.2em; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1em; }
.prose li + li { margin-top: .25rem; }
.prose code { font-family: var(--mono); font-size: .88em; background: var(--surface-3); padding: .1em .35em; border-radius: 5px; }
.prose pre { background: var(--bg-2); padding: .8rem; border-radius: 8px; overflow-x: auto; }
.prose blockquote { margin: 0 0 1em; padding-left: 1rem; border-left: 3px solid var(--border-strong); color: var(--muted); }
.prose table { border-collapse: collapse; margin-bottom: 1em; }
.prose th, .prose td { border: 1px solid var(--border); padding: .35rem .6rem; }
.prose strong { color: var(--text); }

/* ---- language switch ---- */
.lang-switch { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; }
.lang-switch a { padding: .15rem .45rem; border-radius: 6px; font-size: .75rem; font-weight: 650; color: var(--muted); letter-spacing: .03em; }
.lang-switch a:hover { color: var(--text); text-decoration: none; }
.lang-switch a.active { background: var(--surface-3); color: var(--text); }

/* ================================================================ public site */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(11, 15, 20, .85); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(35, 48, 64, .6); }
.site-header .container { display: flex; align-items: center; gap: 1rem; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand svg { width: 30px; height: 30px; }
.site-header nav { margin-left: auto; display: flex; align-items: center; gap: .5rem; }

.hero { padding: 72px 0 56px; }
.hero .container { display: grid; gap: 48px; grid-template-columns: 1.05fr .95fr; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: .5rem; font-size: .82rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: .3rem .75rem; border-radius: 999px; margin-bottom: 1.25rem; }
.hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); line-height: 1.07; letter-spacing: -.025em; margin-bottom: 1.1rem; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lead { font-size: 1.12rem; color: var(--text-2); max-width: 34rem; margin-bottom: 1.75rem; }
.code-form { display: flex; gap: .5rem; max-width: 30rem; }
.code-form input { min-height: 48px; font-family: var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.code-form input::placeholder { font-family: var(--font); letter-spacing: 0; text-transform: none; }
.hero .sub-cta { margin-top: .9rem; font-size: .9rem; color: var(--muted); }

.hero-visual { position: relative; }
.mirror-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.mirror-card + .mirror-card { margin-top: 0; }
.mirror-card .label-row { display: flex; align-items: center; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-bottom: .4rem; }
.mirror-card .who { display: inline-flex; align-items: center; gap: .45rem; color: var(--text-2); font-weight: 600; }
.mirror-card svg.chart { width: 100%; height: auto; }
.mirror-link { display: flex; align-items: center; justify-content: center; gap: .5rem; height: 44px; font-size: .8rem; color: var(--muted); position: relative; }
.mirror-link::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 1px dashed var(--border-strong); }
.mirror-link span { position: relative; background: var(--bg); padding: .1rem .6rem; border: 1px solid var(--border); border-radius: 999px; display: inline-flex; gap: .35rem; align-items: center; }
.mirror-link .icon { width: 14px; height: 14px; color: var(--accent); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 600; stroke-dashoffset: 600; animation: draw 2.2s ease-out .2s forwards; }
.chart .line.copy { animation-delay: .7s; opacity: .75; }
.chart .area { opacity: 0; animation: fade .8s ease-out 1.6s forwards; }
.chart .area.copy { animation-delay: 2.1s; }
.chart .grid line { stroke: var(--border); stroke-width: 1; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .chart .line, .chart .area { animation: none; stroke-dashoffset: 0; opacity: 1; }
  .chart .line.copy { opacity: .75; }
}

.section { padding: 64px 0; }
.section-alt { background: var(--bg-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 40rem; margin-bottom: 2rem; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.02em; }
.section-head p { color: var(--muted); font-size: 1.02rem; margin: 0; }
.steps3 { display: grid; gap: 1rem; grid-template-columns: repeat(3, 1fr); counter-reset: s; }
.steps3 .card { position: relative; }
.steps3 .num { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-weight: 700; margin-bottom: .9rem; }
.steps3 h3 { margin-bottom: .35rem; }
.steps3 p { color: var(--muted); margin: 0; font-size: .94rem; }

.split { display: grid; gap: 40px; grid-template-columns: 1fr 1fr; align-items: center; }
.big-zero { font-size: clamp(3.5rem, 9vw, 6rem); font-weight: 750; letter-spacing: -.04em; line-height: 1; color: var(--accent); }
.big-zero small { font-size: .3em; color: var(--muted); font-weight: 600; letter-spacing: 0; display: block; margin-top: .6rem; }
.money-flow { display: grid; gap: .6rem; }
.money-flow .flow { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.money-flow .flow .icon { color: var(--accent); }
.money-flow .flow b { font-weight: 600; }
.money-flow .flow span { color: var(--muted); font-size: .9rem; display: block; }

.chat-preview { display: grid; gap: .6rem; padding: 1.1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.chat-preview .bubble { display: flex; gap: .6rem; align-items: center; }
.chat-preview .bubble i { display: block; height: 10px; border-radius: 5px; background: var(--surface-3); }
.chat-preview .bubble .lines { flex: 1; display: grid; gap: 6px; padding: .7rem .8rem; background: var(--bg-2); border-radius: 12px; }
.chat-preview .bubble.me { flex-direction: row-reverse; }
.chat-preview .bubble.me .lines { background: var(--accent-soft); }
.chat-preview .bubble.me i { background: var(--accent-line); }
.chat-preview .head { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .85rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); margin-bottom: .2rem; }
.chat-preview .head .icon { width: 16px; height: 16px; }
.feature-list { list-style: none; padding: 0; margin: 1.25rem 0 0; display: grid; gap: .7rem; }
.feature-list li { display: flex; gap: .7rem; align-items: flex-start; color: var(--text-2); }
.feature-list .icon { color: var(--accent); margin-top: .2rem; }

.risk-band { border: 1px solid rgba(240, 180, 67, .3); background: var(--warn-soft); border-radius: var(--radius); padding: 1.1rem 1.25rem; display: flex; gap: .85rem; align-items: flex-start; }
.risk-band .icon { color: var(--warn); margin-top: .15rem; }
.risk-band p { margin: 0; color: var(--text-2); font-size: .94rem; }

.site-footer { border-top: 1px solid var(--border); padding: 28px 0 40px; color: var(--muted); font-size: .88rem; }
.site-footer .container { display: flex; gap: 1rem 2rem; flex-wrap: wrap; align-items: center; }
.site-footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.site-footer .disclaimer { flex-basis: 100%; font-size: .8rem; color: var(--faint); margin: 0; }

.auth-wrap { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 40px 16px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 1.5rem; }
.auth-card .card { padding: 1.5rem; }

.legal { padding: 48px 0 64px; }
.legal h1 { font-size: 2rem; }
.legal h2 { font-size: 1.15rem; margin-top: 2rem; }
.legal p, .legal li { color: var(--text-2); }

/* ================================================================ member app */
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(11, 15, 20, .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar .container { display: flex; align-items: center; gap: 1.25rem; height: 60px; }
.topnav { display: flex; gap: .25rem; }
.topnav a { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .75rem; border-radius: 8px; color: var(--muted); font-weight: 550; font-size: .93rem; position: relative; }
.topnav a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.topnav a.active { color: var(--text); background: var(--surface-2); }
.topnav .dot { position: absolute; top: 7px; right: 6px; width: 7px; height: 7px; }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; border-radius: 50%; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; padding: .4rem; box-shadow: var(--shadow); z-index: 40; }
.menu-panel .who { padding: .55rem .7rem .65rem; border-bottom: 1px solid var(--border); margin-bottom: .3rem; }
.menu-panel .who b { display: block; font-weight: 600; }
.menu-panel .who span { font-size: .82rem; color: var(--muted); word-break: break-all; }
.menu-panel a, .menu-panel button { display: flex; width: 100%; align-items: center; gap: .6rem; padding: .55rem .7rem; border-radius: 8px; color: var(--text-2); background: none; border: 0; font: inherit; font-size: .92rem; cursor: pointer; text-align: left; }
.menu-panel a:hover, .menu-panel button:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }

.tabbar { display: none; }
.app-main { padding: 28px 0 64px; }
.page-head { margin-bottom: 1.5rem; }
.page-head h1 { margin-bottom: .25rem; }
.page-head p { color: var(--muted); margin: 0; }
.back-link { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .9rem; margin-bottom: .75rem; }
.back-link:hover { color: var(--text); text-decoration: none; }
.back-link .icon { width: 16px; height: 16px; }

.setup-card { display: flex; flex-direction: column; gap: .75rem; height: 100%; }
.setup-card .top { display: flex; justify-content: space-between; gap: .5rem; align-items: flex-start; }
.setup-card h3 { margin: 0; font-size: 1.1rem; }
.setup-card .meta { display: flex; flex-wrap: wrap; gap: .4rem; }
.setup-card .tagline { color: var(--muted); margin: 0; font-size: .93rem; }
.setup-card .foot { margin-top: auto; display: flex; align-items: center; gap: .75rem; }
.setup-card .foot .progress { flex: 1; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin: 0; }
/* Each cell draws its top/left divider and is pulled 1px up-left, so the dividers
   on the outer edge slide under the container's own border and empty cells stay plain. */
.facts div { padding: .85rem 1rem; border-left: 1px solid var(--border); border-top: 1px solid var(--border); margin: -1px 0 0 -1px; }
.facts dt { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; margin-bottom: .2rem; }
.facts dd { margin: 0; font-weight: 550; color: var(--text); }

.setup-layout { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
.setup-side { position: sticky; top: 80px; display: grid; gap: 1rem; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); scroll-margin-top: 80px; }
.step.is-done { border-color: var(--accent-line); }
.step.is-next { border-color: var(--border-strong); box-shadow: 0 0 0 1px var(--border-strong); }
.step > details > summary { list-style: none; display: flex; align-items: center; gap: .85rem; padding: 1rem 1.1rem; cursor: pointer; }
.step > details > summary::-webkit-details-marker { display: none; }
.step-num { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--border-strong); color: var(--muted); font-weight: 650; font-size: .85rem; flex: none; }
.step-num.done, .step.is-done .step-num { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.step-title { font-weight: 600; flex: 1; min-width: 0; }
.step .chev { color: var(--faint); transition: transform .2s; }
.step details[open] .chev { transform: rotate(180deg); }
.step-body { padding: 0 1.1rem 1.1rem 3.75rem; display: grid; gap: 1rem; }
.step-body img { border-radius: 10px; border: 1px solid var(--border); }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.step-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

.list { display: grid; }
.list-item { display: flex; align-items: center; gap: .85rem; padding: .85rem 0; border-bottom: 1px solid var(--border); color: inherit; }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover { text-decoration: none; }
a.list-item:hover .li-title { color: var(--accent); }
.li-main { flex: 1; min-width: 0; }
.li-title { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-sub { font-size: .85rem; color: var(--muted); }

.thread { display: grid; gap: 1rem; }
.post { display: flex; gap: .8rem; }
.post-body { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .8rem 1rem; }
.post.staff .post-body { border-color: var(--accent-line); }
.post-meta { font-size: .82rem; color: var(--muted); margin-bottom: .3rem; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.post-meta b { color: var(--text); font-weight: 600; }
.post-text { white-space: pre-wrap; word-wrap: break-word; color: var(--text-2); }

/* ---- community chat ---- */
.app-main:has(.chat-layout) { padding-bottom: 20px; }
.chat-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 1rem; height: calc(100vh - 60px - 48px); height: calc(100dvh - 60px - 48px); min-height: 420px; }
.channel-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem; overflow-y: auto; }
.channel-list h4 { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: .6rem .5rem .4rem; }
.channel-list a { display: flex; align-items: center; gap: .55rem; padding: .5rem .6rem; border-radius: 8px; color: var(--muted); font-weight: 550; font-size: .93rem; }
.channel-list a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.channel-list a.active { background: var(--surface-3); color: var(--text); }
.channel-list a .icon { width: 16px; height: 16px; }
.channel-list a .dot { margin-left: auto; }
.chat-main { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-height: 0; }
.chat-head { display: flex; align-items: center; gap: .75rem; padding: .8rem 1rem; border-bottom: 1px solid var(--border); }
.chat-head h1 { font-size: 1.05rem; margin: 0; display: flex; align-items: center; gap: .4rem; }
.chat-head p { margin: 0; font-size: .85rem; color: var(--muted); }
.chat-head .online { margin-left: auto; font-size: .82rem; color: var(--muted); display: inline-flex; gap: .4rem; align-items: center; white-space: nowrap; }
.chat-head .channel-switch { display: none; }
.pinned { border-bottom: 1px solid var(--border); padding: .5rem 1rem; background: var(--bg-2); font-size: .88rem; }
.pinned summary { cursor: pointer; color: var(--muted); display: flex; gap: .4rem; align-items: center; }
.pinned .icon { width: 15px; height: 15px; }
.pinned-item { padding: .4rem 0; color: var(--text-2); white-space: pre-wrap; word-wrap: break-word; }
.pinned-item b { color: var(--text); }
.chat-log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .15rem; min-height: 0; }
.chat-log .load-more { align-self: center; margin-bottom: .75rem; }
.day-sep { align-self: center; font-size: .75rem; color: var(--faint); margin: .9rem 0 .5rem; text-transform: uppercase; letter-spacing: .06em; }
.msg { display: flex; gap: .7rem; padding: .3rem .4rem; border-radius: 8px; position: relative; }
.msg:hover { background: var(--bg-2); }
.msg.grouped { padding-top: 0; }
.msg.grouped .avatar { visibility: hidden; height: 0; }
.msg-main { flex: 1; min-width: 0; }
.msg-meta { display: flex; gap: .5rem; align-items: baseline; font-size: .8rem; color: var(--faint); }
.msg-meta b { color: var(--text); font-size: .92rem; font-weight: 600; }
.msg-meta .badge { font-size: .68rem; padding: 0 .4rem; }
.msg-text { white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; color: var(--text-2); }
.msg-text a { word-break: break-all; }
.msg.deleted .msg-text { color: var(--faint); font-style: italic; }
.msg.pending { opacity: .55; }
.msg-tools { position: absolute; top: -10px; right: 8px; display: none; gap: 2px; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 8px; padding: 2px; }
.msg:hover .msg-tools, .msg:focus-within .msg-tools { display: flex; }
.msg-tools button { width: 28px; height: 28px; }
.msg-tools .icon { width: 15px; height: 15px; }
.msg .pin-mark { color: var(--warn); }
.composer { border-top: 1px solid var(--border); padding: .75rem; display: flex; gap: .5rem; align-items: flex-end; }
.composer textarea { min-height: 44px; max-height: 180px; resize: none; padding: .65rem .8rem; }
.composer .btn { height: 44px; }
.composer-note { border-top: 1px solid var(--border); padding: .9rem 1rem; color: var(--muted); font-size: .9rem; display: flex; gap: .5rem; align-items: center; }
.conn-state { font-size: .8rem; color: var(--warn); padding: .35rem 1rem; border-top: 1px solid var(--border); display: none; }
.conn-state.show { display: block; }

/* ================================================================ admin */
.admin-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.admin-side { background: var(--bg-2); border-right: 1px solid var(--border); padding: 1rem .75rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.admin-side .brand { padding: .25rem .5rem 1rem; }
.admin-side .brand small { display: block; font-size: .72rem; color: var(--accent); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.admin-nav { display: grid; gap: 2px; }
.admin-nav a { display: flex; align-items: center; gap: .65rem; padding: .55rem .7rem; border-radius: 8px; color: var(--muted); font-weight: 550; font-size: .93rem; }
.admin-nav a:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.admin-nav a.active { background: var(--surface-2); color: var(--text); }
.admin-nav a .count { margin-left: auto; }
.admin-nav .sep { height: 1px; background: var(--border); margin: .6rem .5rem; }
.admin-side .bottom { margin-top: auto; padding-top: 1rem; }
.admin-main { padding: 28px 32px 64px; min-width: 0; }
.admin-main .page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.kpis { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); margin-bottom: 1.5rem; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; }
.kpi .k-label { font-size: .8rem; color: var(--muted); font-weight: 550; }
.kpi .k-value { font-size: 1.65rem; font-weight: 700; letter-spacing: -.02em; margin-top: .2rem; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: .8rem; color: var(--faint); }
.kpi.alert .k-value { color: var(--warn); }

.bars { display: flex; align-items: flex-end; gap: 2px; height: 150px; padding-top: 1.4rem; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; position: relative; cursor: default; }
.bars .bar .fill { width: 100%; max-width: 30px; background: var(--chart-1); border-radius: 4px 4px 0 0; min-height: 2px; }
.bars .bar .fill.zero { background: var(--surface-3); }
.bars .bar:hover .fill { background: var(--accent); }
.bars .bar .val { position: absolute; top: -1.3rem; font-size: .72rem; color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bars .bar[data-tip]:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); background: var(--surface-3); border: 1px solid var(--border-strong); color: var(--text); font-size: .75rem; padding: .25rem .5rem; border-radius: 6px; white-space: nowrap; z-index: 2; pointer-events: none; }
.bars .bar:hover .val { visibility: hidden; }
.bar-axis { display: flex; gap: 2px; border-top: 1px solid var(--border); padding-top: .35rem; }
.bar-axis span { flex: 1; min-width: 0; text-align: center; font-size: .68rem; color: var(--faint); white-space: nowrap; overflow: visible; }
.hbar { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; min-width: 60px; }
.hbar span { display: block; height: 100%; background: var(--chart-1); border-radius: 4px; }

.step-admin { display: flex; gap: .85rem; align-items: flex-start; padding: .9rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.step-admin + .step-admin { margin-top: .6rem; }
.step-admin .step-num { margin-top: .1rem; }
.step-admin .info { flex: 1; min-width: 0; }
.step-admin .info b { display: block; }
.step-admin .tags { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .35rem; }
.step-admin .tools { display: flex; gap: .2rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; overflow-x: auto; }
.tabs a { padding: .6rem .9rem; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }
.danger-zone { border: 1px solid rgba(242, 100, 109, .35); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-top: 2rem; }
.danger-zone h3 { color: var(--danger); }
.copy-field { display: flex; gap: .5rem; }
.copy-field input { font-family: var(--mono); font-size: .88rem; }
.secret-once { border: 1px dashed var(--accent-line); background: var(--accent-soft); border-radius: 10px; padding: 1rem; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filters input, .filters select { width: auto; min-width: 160px; min-height: 38px; }
.preview-img { max-width: 260px; border-radius: 8px; border: 1px solid var(--border); margin-bottom: .5rem; }

/* ================================================================ responsive */
@media (max-width: 960px) {
  .hero .container, .split { grid-template-columns: minmax(0, 1fr); }
  .hero { padding: 40px 0 32px; }
  .hero-visual { max-width: 520px; }
  .setup-layout { grid-template-columns: minmax(0, 1fr); }
  .setup-side { position: static; }
  .admin-layout { grid-template-columns: minmax(0, 1fr); }
  .admin-side { position: sticky; top: 0; height: auto; z-index: 30; flex-direction: row; align-items: center; padding: .5rem 16px; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--border); gap: .5rem; }
  .admin-side .brand { padding: 0 .5rem 0 0; flex: none; }
  .admin-side .brand small, .admin-side .brand .brand-name { display: none; }
  .admin-nav { display: flex; gap: 2px; }
  .admin-nav a { white-space: nowrap; padding: .45rem .6rem; }
  .admin-nav .sep { display: none; }
  .admin-side .bottom { margin: 0; padding: 0; flex: none; }
  .admin-main { padding: 20px 16px 48px; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .steps3 { grid-template-columns: minmax(0, 1fr); }
  .kpi { padding: .8rem .9rem; }
  .kpi .k-value { font-size: 1.4rem; }
  .section { padding: 44px 0; }
  .code-form { flex-direction: column; }
  .site-header nav .btn-ghost { display: none; }
  .topnav { display: none; }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: rgba(15, 20, 26, .96); backdrop-filter: blur(10px);
    border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .5rem 0 .45rem; color: var(--muted); font-size: .7rem; font-weight: 600; position: relative; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a.active { color: var(--accent); }
  .tabbar .dot { position: absolute; top: 6px; left: calc(50% + 8px); width: 7px; height: 7px; }
  .app-main { padding: 20px 0 96px; }
  .step-body { padding: 0 1rem 1rem; }
  .app-main:has(.chat-layout) { padding: 10px 0 calc(66px + env(safe-area-inset-bottom)); }
  .chat-layout { grid-template-columns: minmax(0, 1fr); min-height: 320px; height: calc(100vh - 60px - 10px - 76px - env(safe-area-inset-bottom)); height: calc(100dvh - 60px - 10px - 76px - env(safe-area-inset-bottom)); }
  .channel-list { display: none; }
  .chat-head .channel-switch { display: block; width: auto; min-height: 34px; padding: .25rem .5rem; max-width: 50%; }
  .chat-head h1, .chat-head p { display: none; }
  .msg-tools { display: flex; position: static; background: none; border: 0; padding: 0; margin-left: auto; }
  .msg:not(:hover):not(:focus-within) .msg-tools { opacity: .6; }
  .admin-main .page-head { align-items: flex-start; }
}
