/* AG Player website — flat dark style (see shared/STYLE-FLAT.md) */
:root {
  --bg: #0f1115;
  --surface: #171a20;
  --surface-2: #1f232b;
  --border: #2a2f38;
  --text: #e8eaed;
  --text-2: #9aa0a6;
  --text-3: #6b7280;
  --accent: #1a9fff;
  --accent-hover: #3aaeff;
  --accent-ink: #ffffff;
  --red: #e53935;
  --yellow: #f5c518;
  --green: #43a047;
  --green-text: #5cb860;
  --red-text: #ef6461;
  --radius: 6px;
  --radius-sm: 4px;
  --font: Roboto, "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Roboto Mono", monospace;
  --pad: 24px;
  color-scheme: dark;
}
@media (max-width: 640px) { :root { --pad: 16px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.6 var(--font);
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1 0 auto; }
img, svg { max-width: 100%; }
img { height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3, h4 { font-weight: 600; line-height: 1.25; margin: 0 0 12px; color: var(--text); }
h1 { font-size: 34px; letter-spacing: -0.01em; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }
p { margin: 0 0 14px; }
ul, ol { margin: 0 0 14px; padding-left: 22px; }
li { margin-bottom: 6px; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
code { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1px 5px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }
.muted { color: var(--text-2); }
.small { font-size: 14px; }
.tiny { font-size: 13px; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
@media (max-width: 640px) {
  h1 { font-size: 27px; }
  h2 { font-size: 21px; }
}

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--pad); }
.narrow { max-width: 760px; }
.measure { max-width: 760px; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--accent); color: #fff; padding: 8px 12px; border-radius: var(--radius); z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- header ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.site-header .container { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; font-size: 17px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 32px; height: 32px; display: block; flex: none; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a { color: var(--text-2); padding: 8px 12px; border-radius: var(--radius); font-size: 15px; }
.nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--text); }
.nav .nav-sep { width: 1px; height: 22px; background: var(--border); margin: 0 8px; }
.nav .btn { margin-left: 4px; }
.nav a.btn-primary, .nav a.btn-primary:hover { color: #fff; background: var(--accent); }
.nav a.btn-primary:hover { background: var(--accent-hover); }
.menu-btn { display: none; margin-left: auto; background: transparent; border: 1px solid var(--border); color: var(--text); width: 40px; height: 40px; border-radius: var(--radius); cursor: pointer; }
.menu-btn svg { display: block; margin: auto; }
@media (max-width: 880px) {
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 60px; background: var(--surface); border-bottom: 1px solid var(--border); flex-direction: column; align-items: stretch; padding: 8px var(--pad) 16px; gap: 2px; }
  .nav.open { display: flex; }
  .nav a { padding: 12px; font-size: 16px; }
  .nav .nav-sep { width: auto; height: 1px; margin: 8px 0; }
  .nav .btn { margin: 6px 0 0; }
}

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: var(--radius); font: 600 15px/1 var(--font); border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background-color .1s, border-color .1s; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: #3a404b; background: #252a33; }
.btn-danger { background: transparent; color: var(--red-text); border-color: #5a2a2a; }
.btn-danger:hover { background: #2a1717; }
.btn-ghost { background: transparent; color: var(--text-2); border-color: transparent; }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 14px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 16px; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .6; cursor: default; pointer-events: none; }
.btn svg { flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------- sections ---------- */
.section { padding: 56px 0; border-top: 1px solid var(--border); }
.section:first-child { border-top: 0; }
.section-head { margin-bottom: 28px; max-width: 700px; }
.section-head p { color: var(--text-2); margin: 0; }
.eyebrow { font-size: 13px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 8px; font-weight: 500; }
.page-head { padding: 44px 0 28px; border-bottom: 1px solid var(--border); background: var(--surface); }
.page-head h1 { margin-bottom: 8px; }
.page-head p { color: var(--text-2); margin: 0; max-width: 680px; }
.crumbs { font-size: 14px; color: var(--text-3); margin-bottom: 10px; }
.crumbs a { color: var(--text-2); }
@media (max-width: 640px) { .section { padding: 40px 0; } .page-head { padding: 28px 0 20px; } }

/* ---------- hero ---------- */
.hero { padding: 56px 0 48px; }
.hero-grid { display: grid; grid-template-columns: 5fr 7fr; gap: 48px; align-items: center; }
.hero h1 { font-size: 38px; max-width: 520px; }
.hero .lead { font-size: 18px; color: var(--text-2); max-width: 520px; margin-bottom: 24px; }
.hero .btn-row { margin-bottom: 18px; }
.hero-meta { font-size: 14px; color: var(--text-3); margin: 0; }
.hero-meta > span + span::before { content: "·"; margin: 0 8px; }
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero h1 { font-size: 30px; }
}
@media (max-width: 640px) { .hero { padding: 32px 0; } .hero .lead { font-size: 16px; } }

.shot { margin: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.shot img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.shot figcaption { font-size: 13px; color: var(--text-3); padding: 8px 12px; border-top: 1px solid var(--border); }

/* ---------- notice ---------- */
.notice { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 16px 18px; }
.notice svg { flex: none; color: var(--accent); margin-top: 2px; }
.notice p { margin: 0; }
.notice p + p { margin-top: 6px; }
.notice strong { color: var(--text); }
.notice.warn { border-left-color: var(--yellow); }
.notice.warn svg { color: var(--yellow); }
.notice.error { border-left-color: var(--red); }
.notice.error svg { color: var(--red-text); }
.notice.ok { border-left-color: var(--green); }
.notice.ok svg { color: var(--green-text); }
.draft-banner { background: #211d10; border-bottom: 1px solid #4a4020; color: #e9d894; font-size: 14px; padding: 10px 0; }
.draft-banner strong { color: #f5dc6e; }

/* ---------- features ---------- */
.feature { display: grid; grid-template-columns: 1fr 1.35fr; gap: 48px; align-items: center; padding: 28px 0; }
.feature + .feature { border-top: 1px solid var(--border); }
.feature.flip > :first-child { order: 2; }
.feature h3 { font-size: 20px; }
.feature p { color: var(--text-2); }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { position: relative; padding-left: 26px; margin-bottom: 8px; color: var(--text); }
.checklist li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 11px; height: 6px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.checklist.cross li::before { border: 0; width: 12px; height: 2px; background: var(--text-3); transform: none; top: 12px; }
@media (max-width: 880px) {
  .feature { grid-template-columns: 1fr; gap: 20px; }
  .feature.flip > :first-child { order: 0; }
}

/* ---------- grids / cards ---------- */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 880px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card h3 { margin-bottom: 6px; }
.card p:last-child { margin-bottom: 0; }
.card .muted { font-size: 15px; }
.card-icon { width: 36px; height: 36px; color: var(--text-2); margin-bottom: 14px; }

/* steps */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.steps > li { counter-increment: step; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin: 0; }
.steps > li::before { content: counter(step); display: inline-grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--accent); color: var(--accent); border-radius: var(--radius-sm); font-weight: 600; font-size: 15px; margin-bottom: 14px; }
.steps h3 { font-size: 17px; margin-bottom: 6px; }
.steps p { color: var(--text-2); font-size: 15px; margin: 0; }
@media (max-width: 880px) { .steps { grid-template-columns: 1fr; } }

/* guide (vertical numbered) */
.guide { list-style: none; padding: 0; margin: 0 0 8px; counter-reset: g; }
.guide > li { counter-increment: g; position: relative; padding: 0 0 22px 48px; margin: 0; }
.guide > li::before { content: counter(g); position: absolute; left: 0; top: 0; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius-sm); font-weight: 600; font-size: 14px; color: var(--text); }
.guide > li::after { content: ""; position: absolute; left: 15px; top: 36px; bottom: 6px; width: 1px; background: var(--border); }
.guide > li:last-child::after { display: none; }
.guide h3 { font-size: 17px; margin: 3px 0 6px; }
.guide p { color: var(--text-2); margin-bottom: 10px; }
.path { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; margin: 4px 0 12px; }
.path span { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px 8px; color: var(--text); }
.path i { font-style: normal; color: var(--text-3); }
.diagram { display: block; width: 100%; max-width: 520px; height: auto; margin: 6px 0 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }

/* ---------- pricing ---------- */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 880px) { .plans { grid-template-columns: 1fr; } }
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; }
.plan.featured { border-color: var(--accent); }
.plan-name { font-size: 15px; color: var(--text-2); margin: 0 0 8px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.plan-price { font-size: 32px; font-weight: 600; margin: 0 0 2px; line-height: 1.2; }
.plan-price small { font-size: 15px; color: var(--text-2); font-weight: 400; }
.plan-note { color: var(--text-3); font-size: 14px; margin-bottom: 16px; }
.plan .checklist { margin-bottom: 20px; font-size: 15px; }
.plan .btn { margin-top: auto; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 2px 6px; border-radius: var(--radius-sm); background: var(--accent); color: #fff; line-height: 1.5; }
.tag.outline { background: transparent; border: 1px solid var(--border); color: var(--text-2); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--text-2); font-weight: 500; background: var(--surface); font-size: 14px; }
tr:last-child td { border-bottom: 0; }
td.yes { color: var(--text); }
td .dash { color: var(--text-3); }

/* ---------- faq ---------- */
.faq { border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary { cursor: pointer; list-style: none; padding: 16px 36px 16px 0; font-weight: 500; position: relative; color: var(--text); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 8px; top: 22px; width: 8px; height: 8px; border-right: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2); transform: rotate(45deg); transition: transform .1s; }
.faq details[open] summary::after { transform: rotate(-135deg); top: 26px; }
.faq summary:hover { color: #fff; }
.faq .answer { padding: 0 0 18px; color: var(--text-2); max-width: 760px; }
.faq .answer p:last-child, .faq .answer ul:last-child, .faq .answer ol:last-child { margin-bottom: 0; }
.faq-group { margin-bottom: 36px; }
.faq-group h2 { font-size: 20px; margin-bottom: 8px; }

/* ---------- side nav layout (help / legal) ---------- */
.doc { display: grid; grid-template-columns: 220px 1fr; gap: 48px; padding: 40px 0 64px; }
.doc-nav { position: sticky; top: 84px; align-self: start; font-size: 15px; }
.doc-nav p { font-size: 13px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.doc-nav a { display: block; color: var(--text-2); padding: 6px 10px; border-left: 2px solid var(--border); }
.doc-nav a:hover { color: var(--text); text-decoration: none; border-left-color: var(--text-3); }
.doc-nav a[aria-current="true"] { color: var(--text); border-left-color: var(--accent); }
.doc-body { min-width: 0; max-width: 760px; }
.doc-body h2 { margin-top: 36px; padding-top: 4px; scroll-margin-top: 80px; }
.doc-body h2:first-child { margin-top: 0; }
.doc-body h3 { margin-top: 24px; scroll-margin-top: 80px; }
.doc-body p, .doc-body li { color: #c9ccd1; }
.doc-body .faq summary { color: var(--text); }
@media (max-width: 880px) { .doc { grid-template-columns: 1fr; gap: 24px; padding-top: 24px; } .doc-nav { position: static; } .doc-nav nav { display: flex; flex-wrap: wrap; gap: 6px; } .doc-nav a { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px 10px; font-size: 14px; } }

/* ---------- forms ---------- */
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field > label, .label { font-size: 14px; font-weight: 500; color: var(--text); }
.field .hint { font-size: 13px; color: var(--text-3); }
.field .error-text { font-size: 13px; color: var(--red-text); }
input[type="text"], input[type="url"], input[type="password"], input[type="email"], input[type="search"], select, textarea {
  width: 100%; height: 42px; padding: 0 12px; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); font: 400 16px var(--font);
}
textarea { height: auto; padding: 10px 12px; min-height: 90px; }
input::placeholder { color: var(--text-3); }
input:hover, select:hover, textarea:hover { border-color: #3a404b; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
input[aria-invalid="true"] { border-color: var(--red); }
input.mono-input { font-family: var(--mono); letter-spacing: .04em; font-size: 17px; }
.input-pw { position: relative; }
.input-pw input { padding-right: 70px; }
.input-pw button { position: absolute; right: 4px; top: 4px; height: 34px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .two { grid-template-columns: 1fr; } }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-size: 14px; font-weight: 500; padding: 0; margin-bottom: 8px; }

.choice-list { display: grid; gap: 10px; }
.choice-list.cols-2 { grid-template-columns: 1fr 1fr; }
.choice-list.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 640px) { .choice-list.cols-2, .choice-list.cols-3 { grid-template-columns: 1fr; } }
.choice { position: relative; display: flex; gap: 12px; align-items: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; cursor: pointer; }
.choice:hover { border-color: #3a404b; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice .dot { flex: none; width: 18px; height: 18px; border: 2px solid var(--text-3); border-radius: 50%; margin-top: 2px; }
.choice:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.choice:has(input:checked) .dot { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px var(--surface-2); }
.choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice .c-title { font-weight: 600; display: block; }
.choice .c-sub { font-size: 14px; color: var(--text-2); display: block; }
.choice .c-price { margin-left: auto; font-weight: 600; white-space: nowrap; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.panel-head h2, .panel-head h3 { margin: 0; font-size: 17px; }
.panel-head .btn { margin-left: auto; }
.panel-body { padding: 20px; }
.form-card { max-width: 560px; }

/* text tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs button, .tabs a { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--text-2); font: 500 15px var(--font); padding: 10px 12px; cursor: pointer; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover, .tabs a:hover { color: var(--text); text-decoration: none; }
.tabs [aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }

/* ---------- download ---------- */
.dl-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
@media (max-width: 880px) { .dl-grid { grid-template-columns: 1fr; } }
.code-box { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.code-value { font-family: var(--mono); font-size: 34px; font-weight: 600; letter-spacing: .08em; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 16px; color: var(--text); }
.code-value.is-url { font-size: 28px; letter-spacing: .02em; }
@media (max-width: 420px) { .code-value.is-url { font-size: 22px; } }
.qr { width: 132px; height: 132px; background: #fff; border-radius: var(--radius-sm); padding: 0; flex: none; }
.qr svg { display: block; width: 100%; height: 100%; }
.qr-row { display: flex; gap: 16px; align-items: center; }
.url-line { font-family: var(--mono); font-size: 14px; color: var(--text-2); word-break: break-all; }
.devices td:first-child { font-weight: 500; }

/* ---------- portal ---------- */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; border-radius: var(--radius-sm); padding: 2px 8px; border: 1px solid var(--border); background: var(--surface-2); text-transform: capitalize; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.status.active::before { background: var(--green); }
.status.trial::before { background: var(--accent); }
.status.expired::before, .status.disabled::before { background: var(--red); }
.kv { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; }
.kv > div { padding: 14px 20px; border-right: 1px solid var(--border); min-width: 0; }
.kv > div:last-child { border-right: 0; }
.kv dt { font-size: 13px; color: var(--text-3); margin-bottom: 2px; }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
@media (max-width: 880px) { .kv { grid-template-columns: 1fr 1fr; } .kv > div:nth-child(2) { border-right: 0; } .kv > div:nth-child(-n+2) { border-bottom: 1px solid var(--border); } }
.pl-list { list-style: none; margin: 0; padding: 0; }
.pl-item { display: flex; align-items: center; gap: 16px; padding: 14px 20px; border-top: 1px solid var(--border); }
.pl-item:first-child { border-top: 0; }
.pl-type { flex: none; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 2px 6px; color: var(--text-2); width: 58px; text-align: center; }
.pl-main { min-width: 0; flex: 1; }
.pl-name { font-weight: 500; }
.pl-sub { font-size: 14px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); }
.pl-actions { display: flex; gap: 8px; flex: none; }
.pl-confirm { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 20px; background: #1d1719; border-top: 1px solid #4a2b2b; font-size: 15px; }
.pl-confirm span { flex: 1; min-width: 180px; }
.empty { padding: 28px 20px; color: var(--text-2); text-align: center; }
@media (max-width: 640px) {
  .pl-item { flex-wrap: wrap; gap: 10px; padding: 14px 16px; }
  .pl-main { flex-basis: calc(100% - 80px); }
  .pl-actions { width: 100%; }
  .pl-actions .btn { flex: 1; }
  .panel-head, .panel-body { padding-left: 16px; padding-right: 16px; }
  .kv > div { padding: 12px 16px; }
}

/* toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 18px; font-size: 15px; z-index: 80; max-width: calc(100% - 32px); }
.toast.error { border-color: #5a2a2a; }

/* spinner */
.spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
.skeleton { background: var(--surface-2); border-radius: var(--radius-sm); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }

/* result pages */
.result { max-width: 620px; margin: 0 auto; padding: 56px 0 72px; }
.result-icon { width: 44px; height: 44px; margin-bottom: 18px; }
.result dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; margin: 18px 0 22px; font-size: 15px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.result dt { color: var(--text-3); }
.result dd { margin: 0; overflow-wrap: anywhere; }

/* contact */
.contact-list { display: grid; gap: 12px; }
.contact-item { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; color: var(--text); }
.contact-item:hover { border-color: #3a404b; text-decoration: none; }
.contact-item svg { color: var(--text-2); flex: none; }
.contact-item .ci-label { font-size: 13px; color: var(--text-3); display: block; }
.contact-item .ci-value { font-weight: 500; display: block; overflow-wrap: anywhere; }
.contact-item .ci-go { margin-left: auto; color: var(--text-3); }
.msg-box { font-family: var(--mono); font-size: 14px; white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; color: var(--text); margin: 0 0 12px; }

/* ---------- footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); margin-top: 0; padding: 40px 0 28px; font-size: 15px; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.site-footer h2 { font-size: 13px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; font-weight: 500; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: var(--text-2); }
.site-footer a:hover { color: var(--text); }
.foot-about p { color: var(--text-2); max-width: 340px; font-size: 14px; }
.foot-bottom { border-top: 1px solid var(--border); margin-top: 28px; padding-top: 18px; color: var(--text-3); font-size: 13px; display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap; }
@media (max-width: 880px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-about { grid-column: 1 / -1; } }

.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }

/* ---------- activate ---------- */
.activate-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.activate-grid aside { display: grid; gap: 16px; }
.activate-grid aside .diagram { max-width: 100%; }
@media (max-width: 960px) { .activate-grid { grid-template-columns: 1fr; } }
.step-legend { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.step-no { display: inline-grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius-sm); font-size: 13px; color: var(--text-2); }
.summary-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 18px; }
.total { font-size: 26px; font-weight: 600; line-height: 1.2; }
@media (max-width: 640px) { .summary-row .btn { width: 100%; } }

/* ---------- portal ---------- */
.portal-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.dash { display: grid; gap: 16px; }
.dash > p { margin: 0; }
.panel .d-notice { margin: 4px 20px 20px; }
.panel-head .status { margin-left: 4px; }
.panel-head h2 .muted { font-weight: 400; }
@media (max-width: 640px) { .panel .d-notice { margin: 0 16px 16px; } }
.doc-body.legal { padding: 36px 0 64px; }
.doc-body.legal h2 { font-size: 20px; }
.reset-row { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-top: 1px solid var(--border); }
.reset-row h3 { font-size: 15px; margin: 0 0 2px; }
.reset-row .btn { flex: none; margin-left: auto; }
#reset-result { margin-top: 0; }
@media (max-width: 640px) { .reset-row { flex-wrap: wrap; padding: 14px 16px; } .reset-row .btn { margin-left: 0; } }
.two { align-items: start; }
.dl-card { display: flex; flex-direction: column; }
.dl-card h2 { font-size: 20px; margin-bottom: 6px; }
.dl-card .eyebrow { margin-bottom: 6px; }
.dl-foot { margin-top: auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid var(--border); }
.dl-grid { grid-template-columns: 1fr 1fr; }
@media (max-width: 880px) { .dl-grid { grid-template-columns: 1fr; } }
.kv dd.mono { font-size: 14px; white-space: nowrap; overflow-wrap: normal; }
@media (max-width: 880px) { .dl-grid .dl-card:last-child { order: -1; } }

/* ---------- v2: language menu ---------- */
.lang-menu { position: relative; margin-left: auto; order: 2; }
.site-header .nav { order: 3; margin-left: 12px; }
.lang-menu summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-2); font-size: 14px; font-weight: 500; cursor: pointer; user-select: none; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover, .lang-menu[open] summary { color: var(--text); background: var(--surface-2); }
.lang-list { position: absolute; right: 0; top: calc(100% + 6px); min-width: 170px; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); z-index: 60; }
.lang-list li { margin: 0; }
.lang-list a { display: block; padding: 8px 12px; border-radius: var(--radius-sm); color: var(--text-2); font-size: 15px; }
.lang-list a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.lang-list a[aria-current="true"] { color: var(--text); box-shadow: inset 3px 0 0 var(--accent); background: var(--surface-2); }
@media (max-width: 880px) {
  .site-header .container { gap: 10px; }
  .lang-menu { order: 2; }
  .menu-btn { order: 3; margin-left: 0; }
  .site-header .nav { order: 4; margin-left: 0; }
}

/* ---------- v2: pricing / activate ---------- */
.plans.plans-2 { grid-template-columns: repeat(2, minmax(0, 360px)); }
@media (max-width: 880px) { .plans.plans-2 { grid-template-columns: 1fr; } }
.h-sm { font-size: 20px; }
.h-xs { font-size: 16px; }
.consent { display: grid; gap: 6px; }
.check { position: relative; display: flex; gap: 12px; align-items: flex-start; cursor: pointer; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; font-size: 15px; line-height: 1.45; }
.check:hover { border-color: #3a404b; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box { flex: none; width: 20px; height: 20px; border: 2px solid var(--text-3); border-radius: var(--radius-sm); margin-top: 1px; position: relative; }
.check:has(input:checked) { border-color: var(--accent); }
.check:has(input:checked) .box { background: var(--accent); border-color: var(--accent); }
.check:has(input:checked) .box::after { content: ""; position: absolute; left: 5px; top: 1px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.check:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.check:has(input[aria-invalid="true"]) { border-color: var(--red); }
button.contact-item { width: 100%; font: inherit; text-align: left; cursor: pointer; }
button.contact-item:hover { border-color: #3a404b; }

/* ---------- v2: legal ---------- */
.legal-summary { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin: 0 0 32px; }
.legal-summary .sum-h { font-size: 17px; margin: 0 0 12px; }
.legal-summary .checklist li { color: var(--text); }
.legal-summary .checklist li:last-child { margin-bottom: 0; }
.legal-note, .doc-body.legal > .notice { margin-bottom: 20px; }
.legal-text ol[type="a"] { list-style: lower-alpha; }

/* ---------- v2: portal receipts ---------- */
.panel-head h2 svg { vertical-align: -5px; margin-right: 6px; color: var(--text-2); }
.rc-table-wrap { overflow-x: auto; }
.rc-table { font-size: 15px; }
.rc-table th { background: transparent; }
.rc-table td, .rc-table th { padding: 12px 20px; }
.rc-table .num { text-align: right; white-space: nowrap; }
.rc-table .rc-act { text-align: right; width: 1%; white-space: nowrap; }
.rc-table td.mono { white-space: nowrap; }
.rc-status { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: var(--radius-sm); border: 1px solid var(--border); color: var(--text-2); }
.rc-status.paid { color: var(--green-text); border-color: #2c4a2e; }
.rc-status.refunded, .rc-status.failed { color: var(--red-text); border-color: #5a2a2a; }
@media (max-width: 640px) {
  .rc-table thead { display: none; }
  .rc-table, .rc-table tbody, .rc-table tr, .rc-table td { display: block; width: 100%; }
  .rc-table tr { padding: 12px 16px; border-top: 1px solid var(--border); display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; }
  .rc-table td { padding: 0; border: 0; }
  .rc-table td:nth-child(1) { font-weight: 600; }
  .rc-table td:nth-child(4) { grid-column: 2; grid-row: 1; }
  .rc-table td:nth-child(2), .rc-table td:nth-child(3) { color: var(--text-2); font-size: 14px; }
  .rc-table .rc-act { grid-column: 1 / -1; text-align: left; width: auto; margin-top: 8px; }
  .rc-table .rc-act .btn { width: 100%; }
}

/* ---------- v2: printable receipt ---------- */
.receipt-tools { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 28px 0 16px; }
.receipt { background: #fff; color: #111; border-radius: var(--radius); padding: 40px; margin: 0 0 56px; max-width: 820px; }
.receipt h1, .receipt h2, .receipt strong { color: #111; }
.rc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; border-bottom: 2px solid #111; padding-bottom: 20px; margin-bottom: 24px; }
.rc-brand { display: flex; gap: 12px; align-items: center; }
.rc-brand img { width: 44px; height: 44px; }
.rc-brand div { display: grid; line-height: 1.3; }
.rc-brand span { color: #555; font-size: 14px; }
.rc-title { text-align: right; }
.rc-title h1 { font-size: 26px; margin: 0 0 4px; }
.rc-title p { margin: 0; color: #333; font-size: 16px; }
.rc-parties { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 28px; font-size: 14px; }
.rc-parties h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #555; margin: 0 0 6px; font-weight: 600; }
.rc-parties p { margin: 0; color: #222; line-height: 1.6; overflow-wrap: anywhere; }
.rc-lines { font-size: 15px; margin-bottom: 20px; color: #111; }
.rc-lines th, .rc-lines td { border-bottom: 1px solid #ddd; padding: 10px 0; background: transparent; color: #111; }
.rc-lines thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #555; font-weight: 600; border-bottom: 1px solid #111; }
.rc-lines .num { text-align: right; white-space: nowrap; padding-left: 16px; }
.rc-lines tfoot th, .rc-lines tfoot td { border-bottom: 0; font-size: 17px; }
.rc-lines tfoot th { text-align: right; font-weight: 600; }
.rc-note { font-size: 13px; color: #555; margin: 0 0 6px; }
@media (max-width: 640px) {
  .receipt { padding: 20px; }
  .rc-head { flex-direction: column; }
  .rc-title { text-align: left; }
  .rc-parties { grid-template-columns: 1fr; gap: 14px; }
}
@media print {
  @page { margin: 16mm; }
  html, body { background: #fff !important; color: #000 !important; }
  .site-header, .site-footer, .skip, .draft-banner, .no-print, .chat-launcher, .chat-panel, #toast { display: none !important; }
  .receipt-page .container { max-width: none; padding: 0; }
  .receipt { padding: 0; margin: 0; max-width: none; border-radius: 0; }
  .rc-lines tr, .rc-parties { break-inside: avoid; }
}

/* ---------- v2: live chat ---------- */
.chat-launcher { position: fixed; right: 20px; bottom: 20px; z-index: 70; display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 18px 0 16px; border: 0; border-radius: var(--radius); background: var(--accent); color: #fff; font: 600 15px var(--font); cursor: pointer; }
.chat-launcher:hover { background: var(--accent-hover); }
.chat-launcher:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.chat-launcher.is-open { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.chat-badge { min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
.chat-panel { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.chat-panel[hidden] { display: none !important; }
.chat-panel:not(.is-inline) { position: fixed; right: 20px; bottom: 80px; z-index: 71; width: 380px; height: min(560px, calc(100vh - 110px)); animation: chat-in .12s ease-out; }
@keyframes chat-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.chat-panel.is-inline { height: 560px; }
.chat-head { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.chat-head-text { flex: 1; min-width: 0; }
.chat-head h2 { font-size: 17px; margin: 0 0 2px; }
.chat-sub { margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.45; }
.chat-icon-btn { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: var(--radius); cursor: pointer; }
.chat-icon-btn:hover { border-color: #3a404b; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; overscroll-behavior: contain; }
.chat-log { display: flex; flex-direction: column; gap: 10px; }
.chat-msg { display: flex; flex-direction: column; max-width: 85%; }
.chat-msg.from-visitor { align-self: flex-end; align-items: flex-end; }
.chat-msg.from-admin { align-self: flex-start; align-items: flex-start; }
.chat-bubble { padding: 9px 12px; border-radius: var(--radius); font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.from-visitor .chat-bubble { background: var(--accent); color: #fff; }
.from-admin .chat-bubble { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.is-welcome .chat-bubble { color: var(--text-2); }
.chat-meta { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.is-pending .chat-bubble { opacity: .7; }
.is-failed .chat-meta { color: var(--red-text); }
.chat-system { text-align: center; font-size: 13px; color: var(--text-3); margin: 4px 0 0; }
.chat-start { display: grid; gap: 12px; }
.chat-field { display: grid; gap: 5px; }
.chat-field label { font-size: 14px; font-weight: 500; }
.chat-field input { height: 40px; font-size: 15px; }
.chat-field input.mono-input { font-size: 15px; }
.chat-field textarea { min-height: 84px; font-size: 15px; resize: vertical; }
.chat-hint { font-size: 12px; color: var(--text-3); }
.chat-start-btn { justify-self: start; }
.chat-error { margin: 0 16px 10px; padding: 8px 12px; font-size: 14px; border: 1px solid #5a2a2a; border-left: 3px solid var(--red); border-radius: var(--radius-sm); background: #1d1719; color: var(--text); }
.chat-compose { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--border); background: var(--surface); }
.chat-compose[hidden], .chat-start[hidden] { display: none; }
.chat-compose textarea { flex: 1; min-height: 42px; max-height: 140px; height: 42px; resize: none; padding: 10px 12px; font-size: 15px; line-height: 1.4; }
.chat-send { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: var(--radius); background: var(--accent); color: #fff; cursor: pointer; }
.chat-send:hover { background: var(--accent-hover); }
.chat-tg { white-space: nowrap; }
@media (max-width: 640px) {
  .chat-launcher { right: 12px; bottom: 12px; height: 46px; padding: 0 14px; }
  .chat-panel:not(.is-inline) { left: 8px; right: 8px; bottom: 66px; width: auto; height: calc(100vh - 140px); height: calc(100dvh - 140px); }
  .chat-panel.is-inline { height: 520px; }
  .site-footer { padding-bottom: 84px; }
}
@media (prefers-reduced-motion: reduce) {
  .chat-panel:not(.is-inline) { animation: none; }
  *, *::before, *::after { transition-duration: 0s !important; scroll-behavior: auto !important; }
}

/* ---------- v2: review fixes ---------- */
.consent .error-text { font-size: 13px; color: var(--red-text); }
.hero-meta > span { white-space: nowrap; }
.site-footer { padding-bottom: 88px; }
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus { outline: none; }
