:root {
  color-scheme: light;
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --text: #17202a;
  --muted: #66727f;
  --line: #d9e0e6;
  --blue: #1769e0;
  --blue-dark: #0f52b7;
  --green: #16845b;
  --yellow: #8b6300;
  --red: #c63e45;
  --shadow: 0 12px 30px rgba(26, 43, 57, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.55; }
button, input, textarea { font: inherit; letter-spacing: 0; }
button, .button-link { min-height: 44px; border-radius: 6px; cursor: pointer; font-weight: 700; }
button:disabled { cursor: not-allowed; opacity: .58; }
a { color: inherit; }

.site-header {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  min-height: 68px; padding: 10px max(20px, calc((100vw - 1180px) / 2)); background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line); backdrop-filter: blur(12px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 6px; background: var(--blue); color: white; }
.status-cluster { display: flex; gap: 12px; align-items: center; font-size: 14px; }
.status-dot::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: var(--yellow); }
.status-dot.open::before { background: var(--green); }
.status-dot.rest::before { background: var(--red); }
.muted { color: var(--muted); }

.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 46px 0 80px; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.intro h1 { margin: 4px 0 8px; font-size: clamp(30px, 5vw, 48px); line-height: 1.15; }
.intro p { max-width: 760px; margin: 0; color: var(--muted); }
.eyebrow { color: var(--blue) !important; font-weight: 800; }

.tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 5px; margin-bottom: 22px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.tab { border: 0; background: transparent; color: var(--muted); }
.tab.active { background: var(--text); color: white; }
.panel { display: none; }
.panel.active { display: block; }

.step-list { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 18px; border-bottom: 2px solid var(--line); }
.step { padding: 12px 8px; color: var(--muted); font-size: 14px; text-align: center; }
.step.current { color: var(--blue); border-bottom: 3px solid var(--blue); margin-bottom: -2px; font-weight: 800; }
.step.done { color: var(--green); }

.surface { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.form-block { padding: 26px; margin-bottom: 18px; }
.narrow { max-width: 720px; margin-inline: auto; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.section-heading > div { display: flex; align-items: center; gap: 12px; }
.section-heading h2, .form-block h2 { margin: 0; font-size: 21px; }
.number { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 6px; background: #e9f1ff; color: var(--blue); font-weight: 900; }
.badge { display: inline-flex; align-items: center; min-height: 30px; padding: 3px 10px; border-radius: 99px; background: #e6f5ee; color: var(--green); font-size: 13px; font-weight: 800; }

label { display: block; margin: 14px 0 7px; font-weight: 700; }
input, textarea { width: 100%; border: 1px solid #cbd4dc; border-radius: 6px; background: var(--surface); color: var(--text); padding: 12px 14px; outline: 0; }
input:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23,105,224,.13); }
textarea { resize: vertical; }
.inline-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.actions, .dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.primary, .secondary, .danger { border: 1px solid transparent; padding: 10px 18px; }
.primary { background: var(--blue); color: white; }
.primary:hover { background: var(--blue-dark); }
.secondary { border-color: #c6ced6; background: var(--surface); color: var(--text); }
.danger { background: var(--red); color: white; }
.wide { width: 100%; margin-top: 18px; }
.button-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; white-space: nowrap; }
.check-line { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; }
.check-line input { width: 18px; height: 18px; margin-top: 3px; }
.message { min-height: 24px; margin: 12px 0 0; color: var(--muted); }
.message.error { color: var(--red); }
.message.success { color: var(--green); }
.notice { padding: 12px 14px; border-left: 3px solid var(--blue); background: #edf4ff; color: #33465b; }
.notice.warning { border-color: #d4a000; background: #fff8dc; color: #6b5400; }
.hidden { display: none !important; }

.account-preview { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); }
.account-preview span, .result-grid span { color: var(--muted); }
.result-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.result-grid > div { display: flex; flex-direction: column; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); }
.result-grid strong { overflow-wrap: anywhere; }
.result-list { display: grid; gap: 10px; }
.result-item { display: grid; grid-template-columns: minmax(180px, 1fr) 150px 2fr; gap: 12px; align-items: center; padding: 15px 18px; }
.result-item span { overflow-wrap: anywhere; }
.secret-result { margin-top: 18px; padding: 18px; border: 1px solid #9dcbb8; border-radius: 6px; background: #eef9f4; }
.secret-result strong { display: block; margin-top: 8px; font-size: 22px; overflow-wrap: anywhere; }

.guide-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.guide-item { padding: 22px; }
.guide-item > span { color: var(--blue); font-weight: 900; }
.guide-item h2 { margin: 10px 0 5px; font-size: 19px; }
.guide-item p { margin: 0; color: var(--muted); }
.plain-list { padding-left: 22px; }
.plain-list li { margin: 7px 0; }

.billing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.billing-card { padding: 15px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); }
.billing-card h3 { margin: 0 0 10px; font-size: 16px; }
.billing-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 0; }
.billing-card dt { color: var(--muted); }
.billing-card dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.invoice-list { grid-column: 1 / -1; }
.invoice-row { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }

dialog { width: min(520px, calc(100% - 28px)); border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); box-shadow: 0 22px 70px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(15, 24, 32, .66); }
dialog form { padding: 12px; }
.dialog-account { display: block; padding: 16px; border-radius: 6px; background: var(--surface-2); font-size: 20px; overflow-wrap: anywhere; }
.dialog-actions { justify-content: flex-end; }

@media (prefers-color-scheme: dark) {
  :root { color-scheme: dark; --bg: #0d1116; --surface: #151b21; --surface-2: #1c232b; --text: #edf2f6; --muted: #9aa7b3; --line: #303a43; --blue: #4b95ff; --blue-dark: #2e78df; --green: #4ac18f; --yellow: #d8aa39; --red: #ff7278; --shadow: none; }
  .site-header { background: rgba(21,27,33,.96); }
  .number { background: #1d3556; }
  .badge { background: #16382c; }
  .notice { background: #172b43; color: #bed4ee; }
  .notice.warning { background: #322a12; color: #e8ce81; }
  .secret-result { background: #143127; }
}

@media (max-width: 780px) {
  .site-header { align-items: flex-start; gap: 10px; padding-inline: 16px; }
  .status-cluster { flex-direction: column; align-items: flex-end; gap: 0; }
  .shell { width: min(100% - 22px, 680px); padding-top: 26px; }
  .intro { align-items: flex-start; flex-direction: column; }
  .tabs { display: flex; overflow-x: auto; scrollbar-width: none; }
  .tab { min-width: 108px; padding-inline: 12px; }
  .step-list { grid-template-columns: repeat(4, minmax(105px, 1fr)); overflow-x: auto; }
  .form-block { padding: 18px; }
  .inline-form { grid-template-columns: 1fr; }
  .account-preview, .result-grid, .billing-grid { grid-template-columns: 1fr; }
  .account-preview { gap: 4px; }
  .account-preview strong { margin-bottom: 10px; }
  .guide-grid { grid-template-columns: repeat(2, 1fr); }
  .result-item { grid-template-columns: 1fr; }
  .invoice-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .brand > span:last-child { display: none; }
  .intro h1 { font-size: 32px; }
  .guide-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; }
  .result-grid { grid-template-columns: 1fr; }
}
