:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --ink: #15161c;
  --muted: #6b6d78;
  --line: #e4e2dc;
  --accent: #ff5a36;
  --accent-ink: #ffffff;
  --accent-soft: #ffe7e0;
  --ok: #1a7f4b;
  --ok-soft: #e1f4ea;
  --warn: #9a6400;
  --warn-soft: #fdf1d8;
  --err: #b42318;
  --err-soft: #fde4e1;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 20, 30, .04), 0 6px 24px rgba(20, 20, 30, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111217;
    --surface: #1a1b22;
    --ink: #eeeef2;
    --muted: #9a9caa;
    --line: #2c2e38;
    --accent-soft: #3a1f19;
    --ok-soft: #12291d;
    --warn-soft: #2e2410;
    --err-soft: #34171493;
    --shadow: none;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: inherit; text-underline-offset: 3px; }
h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.2; margin: 0 0 .6rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 0 0 .8rem; }
h3 { font-size: 1.02rem; margin: 0 0 .3rem; }
code { background: var(--accent-soft); padding: .1em .35em; border-radius: 6px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.accent { color: var(--accent); }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem clamp(16px, 4vw, 40px); border-bottom: 1px solid var(--line); background: var(--surface);
}
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 750; text-decoration: none; font-size: 1.1rem; }
.logo-mark { width: 30px; height: 30px; color: var(--ink); }
.topbar nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; justify-content: flex-end; }
.topbar nav a { text-decoration: none; color: var(--muted); }
.topbar nav a:hover { color: var(--ink); }
.lang { border: 1px solid var(--line); border-radius: 999px; padding: .05rem .5rem; font-size: .8rem; }

main { flex: 1; width: 100%; margin: 0 auto; padding: clamp(20px, 4vw, 44px) 16px 60px; }
main.narrow { max-width: 760px; }
main.wide { max-width: 1120px; }
.footer { display: flex; gap: 1.2rem; flex-wrap: wrap; justify-content: center; padding: 1.4rem 16px; color: var(--muted); font-size: .88rem; border-top: 1px solid var(--line); }
.footer a { text-decoration: none; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 3vw, 28px); box-shadow: var(--shadow); margin-bottom: 1.2rem; }
.card.highlight { border-color: var(--accent); }
.card.empty { text-align: center; padding: 2.4rem 1.5rem; }
.auth { max-width: 420px; margin: 0 auto; }
.auth-logo { display: flex; justify-content: center; margin-bottom: .4rem; }
.auth-logo .logo-mark { width: 46px; height: 46px; }
.auth h1 { text-align: center; }

label, .label { display: block; font-weight: 600; font-size: .92rem; margin: 0 0 .9rem; }
input, select, textarea {
  display: block; width: 100%; margin-top: .3rem; font: inherit; font-weight: 400; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .75rem;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
input[disabled] { opacity: .7; }
textarea { resize: vertical; }
label.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; }
label.check input { width: auto; margin-top: .3rem; }
.copy { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; }
.hint { color: var(--muted); font-size: .88rem; margin-top: -.3rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 650;
  border-radius: 10px; padding: .62rem 1.05rem; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.06); border-color: var(--accent); }
.btn-danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-block { width: 100%; margin-top: .4rem; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; }
.linklike:hover { color: var(--ink); }
.linklike.danger { color: var(--err); }
form.inline { display: inline; }

.flash { border-radius: 10px; padding: .7rem .9rem; margin: 0 0 1rem; font-size: .95rem; }
.flash-ok { background: var(--ok-soft); color: var(--ok); }
.flash-error { background: var(--err-soft); color: var(--err); }
.flash-info { background: var(--warn-soft); color: var(--warn); }

.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.page-head h1 { margin: 0; }
.crumbs { margin: 0 0 .6rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
h2.section { margin-top: 2rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.account-card { display: flex; align-items: center; gap: .9rem; text-decoration: none; margin: 0; position: relative; }
.account-card:hover { border-color: var(--ink); }
.account-card .pill { position: absolute; top: 12px; right: 12px; }
.account-head { display: flex; align-items: center; gap: .9rem; }
.avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar-fallback { display: inline-flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); font-weight: 750; font-size: 1.3rem; }
.meta-line { font-size: .86rem; color: var(--muted); margin-top: .2rem; }

.pill { display: inline-block; font-size: .78rem; font-weight: 650; border-radius: 999px; padding: .12rem .6rem; background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.pill-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill-error { background: var(--err-soft); color: var(--err); border-color: transparent; }
.kw, .tag { display: inline-block; font-size: .8rem; font-weight: 650; background: var(--accent-soft); color: var(--accent); border-radius: 6px; padding: .05rem .45rem; margin: 0 .25rem .2rem 0; }
.tag { background: var(--bg); color: var(--muted); }

.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: block; overflow-x: auto; }
.table thead, .table tbody { display: table; width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--line); font-size: .93rem; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table tr:last-child td { border-bottom: 0; }

.events { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.events li { display: flex; gap: .7rem; flex-wrap: wrap; padding: .6rem .9rem; border-bottom: 1px solid var(--line); font-size: .92rem; }
.events li:last-child { border-bottom: 0; }
.events time { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 8.5rem; }
.events .ev-error { color: var(--err); }
.events .ev-warn { color: var(--warn); }

.form-grid fieldset { border: 0; border-top: 1px solid var(--line); margin: 0 0 1.2rem; padding: 1.1rem 0 0; }
.form-grid fieldset:first-of-type { border-top: 0; padding-top: 0; }
.form-grid legend { font-weight: 750; font-size: 1.02rem; padding: 0; margin-bottom: .7rem; }
.row2 { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; }
.form-actions { display: flex; gap: .8rem; justify-content: flex-end; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .5rem; margin: .4rem 0 1rem; }
.media { position: relative; margin: 0; aspect-ratio: 9 / 13; border-radius: 10px; overflow: hidden; border: 2px solid transparent; background: var(--bg); cursor: pointer; }
.media input { position: absolute; top: 6px; left: 6px; width: 18px; height: 18px; margin: 0; z-index: 2; accent-color: var(--accent); }
.media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media:has(input:checked), .media.on { border-color: var(--accent); }
.media-cap { position: absolute; left: 0; right: 0; bottom: 0; font-size: .68rem; font-weight: 500; color: #fff; padding: .9rem .35rem .3rem; background: linear-gradient(transparent, rgba(0,0,0,.7)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-ph { display: flex; height: 100%; align-items: center; justify-content: center; font-size: .75rem; color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .8rem; margin-bottom: 1.2rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; }
.stat b { display: block; font-size: 1.6rem; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .85rem; }

.pick-list { display: grid; gap: .6rem; margin: 1rem 0 1.2rem; }
.pick { display: flex; align-items: center; gap: .8rem; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: 12px; margin: 0; font-weight: 400; cursor: pointer; }
.pick input { width: auto; margin: 0; }
.pick.disabled { opacity: .55; cursor: not-allowed; }

details.danger-zone { margin-top: 2rem; border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; background: var(--surface); }
details.danger-zone summary { cursor: pointer; color: var(--err); font-weight: 650; }

.prose { max-width: 720px; }
.prose li { margin-bottom: .5rem; }

/* Landing */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(24px, 5vw, 64px); align-items: center; padding: 1rem 0 3rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; font-weight: 700; color: var(--accent); margin: 0 0 .7rem; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.3rem); letter-spacing: -.025em; line-height: 1.08; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 36em; }
.cta-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.4rem; }
.phone { background: var(--surface); border: 1px solid var(--line); border-radius: 30px; padding: 14px; box-shadow: var(--shadow); max-width: 340px; justify-self: center; width: 100%; }
.phone-post { position: relative; border-radius: 18px; overflow: hidden; }
.ph-img { aspect-ratio: 4 / 3; background: linear-gradient(135deg, #ff5a36, #ffb547 55%, #6f5bff); }
.bubble { position: absolute; left: 10px; background: rgba(255,255,255,.94); color: #15161c; font-size: .82rem; padding: .3rem .6rem; border-radius: 10px; }
.bubble b { margin-right: .3rem; }
.bubble.c1 { bottom: 46px; }
.bubble.c2 { bottom: 12px; }
.phone-dm { padding: 14px 4px 4px; display: grid; gap: .6rem; }
.dm { background: var(--bg); border-radius: 16px 16px 16px 4px; padding: .6rem .75rem; font-size: .88rem; }
.dm-btn { display: block; text-align: center; margin-top: .5rem; padding: .4rem; background: var(--surface); border-radius: 10px; font-weight: 650; color: var(--accent); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1rem 0 2.5rem; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; }
.num { display: inline-flex; width: 30px; height: 30px; border-radius: 50%; align-items: center; justify-content: center; background: var(--ink); color: var(--bg); font-weight: 750; margin-bottom: .7rem; }
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.4rem 2.4rem; padding: 1rem 0; }
.features p, .step p { color: var(--muted); margin: 0; }

@media (max-width: 760px) {
  .hero, .steps, .features { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; }
  .topbar nav { gap: .7rem; font-size: .92rem; }
  .events time { min-width: 0; }
}
