:root {
  color-scheme: dark;
  --bg: #070708;
  --surface: #101113;
  --surface-2: #17181b;
  --surface-3: #202126;
  --ink: #f3f2ed;
  --muted: #aaa8a0;
  --muted-2: #77756f;
  --line: rgba(255, 255, 255, .1);
  --line-strong: rgba(255, 255, 255, .18);
  --accent: #f3f2ed;
  --accent-ink: #0b0b0c;
  --danger: #ff8d82;
  --warning: #e0bd6a;
  --ok: #8fe3bd;
  --shadow: 0 24px 70px rgba(0, 0, 0, .32);
  --radius: 8px;
}

body[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f5f2;
  --surface: #ffffff;
  --surface-2: #eeeeea;
  --surface-3: #e3e3dc;
  --ink: #151514;
  --muted: #65645f;
  --muted-2: #8c8a84;
  --line: rgba(0, 0, 0, .1);
  --line-strong: rgba(0, 0, 0, .18);
  --accent: #151514;
  --accent-ink: #ffffff;
  --shadow: 0 20px 60px rgba(0, 0, 0, .1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

b,
strong,
button,
h1,
h2,
h3 {
  font-weight: 500;
}

h1,
h2,
h3,
p,
ol {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 18px;
  font-size: 64px;
  line-height: .98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 18px;
}

p,
li {
  color: var(--muted);
  line-height: 1.55;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(18px, 4vw, 42px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
}

.brand,
.top-actions,
.hero-actions,
.toolbar,
.detail-actions,
.connect-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 25px;
}

.brand strong,
.brand small {
  display: block;
  white-space: nowrap;
}

.brand strong {
  font-size: 15px;
  letter-spacing: .08em;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.sidebar button,
.theme-toggle {
  border: 0;
  background: transparent;
  color: var(--muted);
}

.theme-toggle {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.site-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(38px, 7vw, 82px) clamp(18px, 4vw, 42px) 48px;
}

.portal-shell {
  display: grid;
  min-height: calc(100vh - 71px);
  place-items: center;
  padding: 28px clamp(16px, 4vw, 42px);
}

.portal-card {
  display: grid;
  width: min(100%, 560px);
  gap: 22px;
  justify-items: center;
  padding: clamp(26px, 6vw, 48px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.portal-logo {
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: 44px;
}

.portal-card h1 {
  max-width: 100%;
  margin: 0;
  text-align: center;
  overflow-wrap: anywhere;
}

.portal-actions {
  display: grid;
  width: min(100%, 360px);
  gap: 10px;
}

.bot-link {
  display: flex;
  width: min(100%, 360px);
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 14px;
}

.bot-link a {
  color: var(--ink);
}

.portal-footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  text-align: center;
}

.portal-footer button,
.inline-link {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.access-page {
  display: grid;
  min-height: calc(100vh - 71px);
  place-items: center;
  padding: 28px clamp(16px, 4vw, 42px);
}

.document-page {
  display: grid;
  min-height: calc(100vh - 71px);
  place-items: center;
  padding: 28px clamp(16px, 4vw, 42px);
}

.document-card {
  display: grid;
  width: min(100%, 860px);
  gap: 24px;
  padding: clamp(22px, 5vw, 38px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.document-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.document-head h1 {
  margin-bottom: 4px;
  font-size: 40px;
}

.document-head p {
  margin-bottom: 0;
}

.steps-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.steps-list div {
  min-height: 150px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.steps-list span {
  color: var(--muted-2);
  font-size: 12px;
  letter-spacing: .1em;
}

.steps-list p {
  margin: 18px 0 0;
}

.instruction-card {
  width: min(100%, 1040px);
}

.instruction-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.instruction-section {
  display: grid;
  gap: 16px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 92px;
}

.instruction-section:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.instruction-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.instruction-section-head h2 {
  margin: 6px 0 0;
}

.instruction-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.instruction-steps article {
  min-height: 138px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.instruction-steps span,
.instruction-shot span {
  color: var(--muted-2);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.instruction-steps p,
.instruction-note {
  margin-bottom: 0;
}

.instruction-gallery {
  display: grid;
  gap: 14px;
}

.instruction-shot {
  display: grid;
  grid-template-columns: minmax(220px, .62fr) minmax(260px, 1fr);
  gap: 18px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.instruction-shot h3 {
  margin-top: 8px;
  font-size: 22px;
}

.instruction-shot p {
  margin-bottom: 0;
}

.instruction-shot img {
  display: block;
  width: 100%;
  max-height: 680px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #050506;
}

.legal-document section {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.legal-document section:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.access-card {
  display: grid;
  width: min(100%, 760px);
  min-width: 0;
  gap: 24px;
  padding: clamp(22px, 5vw, 38px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.back-button {
  width: max-content;
}

.access-head {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
}

.access-head > div {
  min-width: 0;
}

.access-head h1 {
  margin-bottom: 4px;
  font-size: 38px;
  overflow-wrap: anywhere;
}

.access-head p {
  margin-bottom: 0;
}

.access-body {
  display: grid;
  grid-template-columns: minmax(260px, 280px) minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}

.access-body .qr-image,
.access-body .qr-empty {
  justify-self: center;
}

.access-actions {
  display: grid;
  gap: 10px;
}

.payment-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.payment-strip b,
.payment-strip span {
  display: block;
}

.payment-strip span {
  color: var(--muted);
  font-size: 13px;
}

.pay-card {
  align-content: start;
}

.pay-form {
  padding-top: 4px;
}

.ikev2-access {
  display: grid;
  gap: 14px;
}

.ikev2-card,
.connection-panel,
.ikev2-panel {
  display: grid;
  gap: 14px;
}

.ikev2-panel {
  min-width: 0;
}

.ikev2-card,
.connection-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.ikev2-card h2,
.connection-panel h3 {
  margin-bottom: 4px;
}

.ikev2-traffic-section {
  display: grid;
  min-width: 0;
  gap: 12px;
  margin: 4px 0 8px;
}

.traffic-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.traffic-section-head h2 {
  margin-bottom: 5px;
}

.traffic-section-head p,
.traffic-panel-head p,
.traffic-privacy-note,
.traffic-status-message {
  margin-bottom: 0;
}

.traffic-live-status {
  display: grid;
  flex: 0 0 auto;
  justify-items: end;
  gap: 6px;
  text-align: right;
}

.traffic-live-status small {
  color: var(--muted);
  font-size: 12px;
}

.traffic-status-message {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
}

.traffic-status-message.danger {
  border-color: color-mix(in srgb, var(--danger) 32%, var(--line));
  color: var(--danger);
}

.traffic-stat-grid {
  margin-bottom: 0;
}

.traffic-stat-grid b {
  overflow-wrap: anywhere;
  font-size: clamp(21px, 2.2vw, 30px);
}

.traffic-download-card b,
.traffic-session-metric.download b {
  color: var(--ok);
}

.traffic-upload-card b,
.traffic-session-metric.upload b {
  color: var(--warning);
}

.traffic-chart-panel,
.traffic-sessions-panel {
  overflow: hidden;
}

.traffic-panel-head {
  align-items: flex-start;
}

.traffic-panel-head h2 {
  margin-bottom: 4px;
}

.traffic-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 12px;
}

.traffic-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.traffic-legend i {
  width: 18px;
  height: 3px;
  border-radius: 99px;
  background: currentColor;
}

.traffic-legend .download {
  color: var(--ok);
}

.traffic-legend .upload {
  color: var(--warning);
}

.traffic-chart-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.traffic-chart {
  display: block;
  width: 100%;
  height: auto;
  min-height: 220px;
}

.traffic-chart-grid {
  stroke: var(--line-strong);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.traffic-chart-label {
  fill: var(--muted);
  font-family: inherit;
  font-size: 12px;
}

.traffic-chart-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.traffic-chart-line.download {
  stroke: var(--ok);
}

.traffic-chart-line.upload {
  stroke: var(--warning);
}

.traffic-chart-point.download {
  fill: var(--ok);
}

.traffic-chart-point.upload {
  fill: var(--warning);
}

.traffic-chart-empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.traffic-session-list {
  display: grid;
  gap: 9px;
}

.traffic-session-row {
  display: grid;
  grid-template-columns:
    minmax(190px, 1.35fr)
    minmax(120px, .75fr)
    minmax(120px, .75fr)
    minmax(145px, .85fr)
    auto;
  gap: 14px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.traffic-session-account {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.traffic-session-account div {
  min-width: 0;
}

.traffic-session-account b,
.traffic-session-account span,
.traffic-session-metric span,
.traffic-session-metric b,
.traffic-session-metric small {
  display: block;
}

.traffic-session-account b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.traffic-session-account span,
.traffic-session-metric span,
.traffic-session-metric small {
  color: var(--muted);
  font-size: 12px;
}

.traffic-online-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 14%, transparent);
}

.traffic-session-metric {
  min-width: 0;
}

.traffic-session-metric b {
  margin-top: 4px;
  font-size: 16px;
  white-space: nowrap;
}

.traffic-session-metric small {
  margin-top: 3px;
}

.traffic-session-open {
  min-width: 92px;
}

.traffic-privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 80%, transparent);
  color: var(--muted);
  font-size: 13px;
}

.traffic-privacy-note > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.credential-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.credential-grid article {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.credential-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.credential-grid b {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-size: 16px;
}

.compact-steps {
  margin-bottom: 0;
}

.modal-list {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  padding-left: 20px;
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(330px, .62fr);
  gap: clamp(24px, 5vw, 70px);
  align-items: start;
}

.hero-copy {
  padding-top: 24px;
}

.hero-copy p {
  max-width: 620px;
  margin-bottom: 24px;
  font-size: 18px;
}

.eyebrow,
.panel-index,
.feature-grid span,
.stat-grid span {
  color: var(--muted-2);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.button.soft {
  background: var(--surface-2);
}

.button.ghost {
  background: transparent;
}

.button.full {
  width: 100%;
}

.button:disabled,
.button.disabled {
  opacity: .55;
  pointer-events: none;
}

.request-panel,
.action-panel,
.access-page-preview,
.legal-section,
.feature-grid article,
.panel,
.detail-panel,
.modal-card,
.stat-grid article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.request-panel,
.action-panel,
.access-page-preview,
.feature-grid article,
.panel,
.detail-panel,
.modal-card,
.stat-grid article {
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h2 {
  margin-bottom: 0;
}

.request-form,
.tariff-editor,
.ikev2-admin {
  display: grid;
  gap: 12px;
}

.ikev2-admin {
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 16px;
  padding: 10px 12px;
}

select {
  color-scheme: dark;
}

body[data-theme="light"] select {
  color-scheme: light;
}

textarea {
  min-height: 82px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted-2);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent);
}

.check-row {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: start;
  gap: 10px;
}

.check-row input {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin-top: 2px;
  accent-color: var(--accent);
}

.form-status {
  min-height: 20px;
  margin: 0;
  color: var(--ok);
}

.action-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .9fr) minmax(0, .9fr);
  gap: 14px;
  margin-top: 18px;
}

.action-panel {
  display: grid;
  min-height: 220px;
  align-content: start;
  gap: 12px;
}

.action-panel p {
  margin-bottom: 0;
}

.action-panel .button {
  width: max-content;
}

.account-result {
  display: grid;
  gap: 10px;
}

.muted-line,
.result-card span {
  color: var(--muted);
  font-size: 13px;
}

.result-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.result-card b,
.result-card span {
  display: block;
}

.result-card.warn {
  border-color: color-mix(in srgb, var(--warning) 38%, transparent);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.feature-grid article {
  min-height: 160px;
}

.feature-grid h3 {
  margin-top: 18px;
}

.feature-grid p,
.bot-panel p,
.access-panel p {
  margin-bottom: 0;
}

.workflow-grid {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 14px;
  margin-top: 14px;
}

.bot-panel {
  display: grid;
  align-content: start;
  gap: 14px;
}

.bot-panel .button {
  width: max-content;
}

.access-layout {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.qr-large {
  width: 260px;
  aspect-ratio: 1;
  border: 10px solid #f3f3ef;
  outline: 1px solid var(--line);
  background:
    linear-gradient(90deg, #080808 10px, transparent 10px) 0 0 / 28px 28px,
    linear-gradient(#080808 10px, transparent 10px) 0 0 / 28px 28px,
    #f3f3ef;
}

.qr-image {
  display: block;
  width: 260px;
  max-width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border: 10px solid #f3f3ef;
  border-radius: var(--radius);
  outline: 1px solid var(--line);
  background: #f3f3ef;
}

.qr-empty {
  display: grid;
  width: 260px;
  aspect-ratio: 1;
  place-items: center;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.access-page-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px minmax(260px, .9fr);
  gap: 20px;
  align-items: center;
  margin-top: 14px;
}

.access-copy p,
.install-card p {
  margin-bottom: 14px;
}

.install-card ol {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  padding-left: 20px;
}

.store-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.legal-section {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: 0;
  margin-top: 14px;
  overflow: hidden;
  box-shadow: none;
}

details {
  padding: 16px 18px;
}

details + details {
  border-left: 1px solid var(--line);
}

summary {
  cursor: pointer;
  color: var(--ink);
}

details p,
details li {
  font-size: 13px;
}

details ol {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
  padding-left: 20px;
}

.admin-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: calc(100vh - 71px);
}

.sidebar {
  position: sticky;
  top: 71px;
  height: calc(100vh - 71px);
  padding: 16px;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.sidebar-title {
  margin: 8px 8px 16px;
  color: var(--muted-2);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.sidebar button {
  width: 100%;
  min-height: 40px;
  margin-bottom: 5px;
  padding: 0 12px;
  border-radius: var(--radius);
  text-align: left;
}

.sidebar button.active {
  background: var(--surface-2);
  color: var(--ink);
}

.sidebar button:disabled {
  cursor: default;
  opacity: .45;
}

.admin-content {
  min-width: 0;
  padding: 24px;
}

.admin-login-panel {
  display: grid;
  min-height: calc(100vh - 119px);
  place-items: center;
}

.admin-login-panel[hidden],
#admin-workspace[hidden] {
  display: none;
}

.admin-login-card {
  width: min(100%, 460px);
}

.admin-login-card h1 {
  margin-bottom: 12px;
  font-size: 42px;
}

.admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.admin-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-head h1 {
  margin-bottom: 4px;
  font-size: 32px;
  line-height: 1.1;
}

.admin-head p {
  margin-bottom: 0;
}

.admin-tab {
  display: none;
}

.admin-tab.active {
  display: block;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.stat-grid article {
  min-height: 106px;
}

.stat-grid small {
  color: var(--muted);
}

.stat-grid b {
  display: block;
  margin: 10px 0 4px;
  font-size: 30px;
}

.two-columns,
.split-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.overview-heavy-panel {
  margin-top: 14px;
}

.overview-revenue-panel {
  margin-bottom: 14px;
}

.overview-revenue-panel .panel-head p {
  margin: 5px 0 0;
}

.revenue-list {
  display: grid;
  gap: 9px;
}

.revenue-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(150px, .8fr) minmax(130px, .7fr);
  gap: 14px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.revenue-metric span,
.revenue-metric b {
  display: block;
}

.revenue-metric span {
  color: var(--muted);
  font-size: 12px;
}

.revenue-metric b {
  margin-top: 4px;
}

.revenue-account-settings {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.revenue-account-settings summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 700;
}

.revenue-account-settings summary small,
.revenue-account-settings > p {
  color: var(--muted);
  font-weight: 400;
}

.revenue-account-settings > p {
  margin: 10px 0;
}

.revenue-account-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
}

.revenue-account-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  cursor: pointer;
}

.revenue-account-toggle input {
  width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.revenue-account-info {
  min-width: 0;
}

.revenue-account-info b,
.revenue-account-info small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.revenue-account-info b {
  color: var(--ink);
}

.revenue-account-info small,
.revenue-account-amount {
  color: var(--muted);
}

.revenue-account-amount {
  white-space: nowrap;
}

.overview-heavy-panel .panel-head p {
  margin: 5px 0 0;
}

.split-panel {
  align-items: start;
}

.compact-list,
.account-list,
.table,
.tariff-editor {
  display: grid;
  align-content: start;
  gap: 9px;
}

.accounts-directory {
  display: grid;
  gap: 14px;
}

.accounts-directory .toolbar {
  margin-bottom: 0;
}

.account-profile {
  display: grid;
  width: 100%;
  max-width: 1080px;
  gap: 14px;
  margin: 0 auto;
}

.account-profile[hidden] {
  display: none;
}

.account-profile-back {
  width: max-content;
}

.tariff-list {
  display: grid;
  gap: 9px;
}

.tariff-create {
  display: grid;
  grid-template-columns:
    minmax(90px, .7fr)
    minmax(150px, 1fr)
    minmax(110px, 130px)
    minmax(110px, 130px)
    minmax(90px, 110px)
    auto
    auto;
  gap: 12px;
  align-items: end;
}

.tariff-create .panel-head {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.compact-item,
.account-row,
.table-row,
.tariff-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 13px;
}

.compact-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-account-row {
  width: 100%;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.dashboard-account-row:hover,
.dashboard-account-row:focus-visible {
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--surface-2) 88%, var(--accent));
  transform: translateY(-1px);
}

.compact-main {
  min-width: 0;
}

.compact-main b,
.compact-main span {
  display: block;
}

.compact-main span,
.meta,
.status-text {
  color: var(--muted);
  font-size: 13px;
}

.empty-line,
.muted-line {
  color: var(--muted);
  font-size: 14px;
}

.badge {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.badge.ok {
  border-color: color-mix(in srgb, var(--ok) 34%, transparent);
  color: var(--ok);
}

.badge.warn {
  border-color: color-mix(in srgb, var(--warning) 34%, transparent);
  color: var(--warning);
}

.badge.danger {
  border-color: color-mix(in srgb, var(--danger) 34%, transparent);
  color: var(--danger);
}

.danger-action {
  border-color: color-mix(in srgb, var(--danger) 42%, transparent);
  background: color-mix(in srgb, var(--danger) 14%, var(--surface-2));
  color: var(--danger);
}

.toolbar {
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.toolbar input {
  max-width: 380px;
}

.table-row {
  display: grid;
  grid-template-columns: 1.1fr .9fr .7fr .7fr auto;
  gap: 12px;
  align-items: center;
}

.request-row {
  grid-template-columns: minmax(220px, 1.15fr) minmax(180px, .9fr) auto auto;
}

.account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 24px;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.account-row:hover,
.account-row:focus-visible {
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--surface-2) 88%, var(--accent));
  transform: translateY(-1px);
}

.account-row-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.account-row-main b,
.account-row-main .meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-row-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.account-row-arrow {
  color: var(--muted);
  font-size: 28px;
  line-height: 1;
}

.detail-panel {
  position: sticky;
  top: 88px;
  align-self: start;
}

.account-profile .detail-panel {
  position: static;
  width: 100%;
}

.detail-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.detail-title h2 {
  margin-bottom: 4px;
}

.detail-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.alias-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.alias-form .form-status {
  grid-column: 1 / -1;
}

.wide-field {
  grid-column: 1 / -1;
}

.detail-form textarea {
  min-height: 72px;
}

.link-inline {
  overflow-wrap: anywhere;
}

.admin-empty {
  display: grid;
  gap: 12px;
}

.admin-empty p {
  margin-bottom: 0;
}

.detail-panel h3 {
  margin: 18px 0 10px;
  font-size: 15px;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 0 0 16px;
}

.mini-grid article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
}

.mini-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.mini-grid b {
  display: block;
  margin-top: 6px;
  font-size: 20px;
}

.detail-panel dl {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 8px 12px;
  margin: 0 0 16px;
}

.detail-panel dt {
  color: var(--muted);
}

.detail-panel dd {
  margin: 0;
}

.tariff-row {
  display: grid;
  grid-template-columns:
    minmax(90px, .7fr)
    minmax(150px, 1fr)
    minmax(110px, 130px)
    minmax(90px, 110px)
    auto
    auto
    auto;
  gap: 12px;
  align-items: end;
}

.switch-row {
  min-height: 43px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.switch-row input {
  width: auto;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .68);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  max-height: min(760px, 92vh);
  overflow: auto;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 22px;
}

.qr-modal {
  display: grid;
  gap: 16px;
}

.success-modal {
  display: grid;
  gap: 12px;
}

.success-modal p {
  margin-bottom: 0;
}

.qr-modal .qr-large,
.qr-modal .qr-image,
.qr-modal .qr-empty {
  margin: 0 auto;
}

.link-box {
  overflow-wrap: anywhere;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1040px) {
  .hero-layout,
  .workflow-grid,
  .action-grid,
  .access-page-preview,
  .instruction-shot,
  .legal-section,
  .admin-layout,
  .two-columns,
  .split-panel {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding-top: 0;
  }

  .sidebar {
    position: sticky;
    top: 71px;
    z-index: 10;
    display: flex;
    height: auto;
    gap: 6px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-title {
    display: none;
  }

  .sidebar button {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
  }

  .detail-panel {
    position: static;
  }

  details + details {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .stat-grid,
  .feature-grid,
  .action-grid,
  .instruction-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .traffic-session-row {
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  }

  .traffic-session-account {
    grid-column: 1 / -1;
  }

  .access-page-preview {
    grid-template-columns: 1fr;
  }

  .revenue-row {
    grid-template-columns: 1fr;
  }

  .revenue-account-settings summary {
    display: grid;
  }

  .revenue-account-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: center;
    flex-direction: row;
    gap: 10px;
    padding: 10px 12px;
  }

  .top-actions {
    justify-content: flex-end;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    font-size: 22px;
  }

  .brand strong {
    font-size: 13px;
    letter-spacing: .04em;
  }

  .brand small {
    display: none;
  }

  .theme-toggle {
    width: 38px;
    height: 38px;
  }

  .portal-shell,
  .document-page {
    min-height: auto;
    align-items: start;
    padding: 14px;
  }

  .portal-card {
    gap: 16px;
    justify-items: stretch;
    padding: 18px;
    box-shadow: none;
  }

  .portal-logo {
    width: 58px;
    height: 58px;
    justify-self: center;
    font-size: 34px;
  }

  .portal-actions,
  .bot-link {
    width: 100%;
  }

  .portal-footer {
    flex-wrap: wrap;
    line-height: 1.4;
  }

  .site-shell {
    padding: 26px 14px 34px;
  }

  h1 {
    font-size: 44px;
  }

  .portal-card h1 {
    font-size: 32px;
    line-height: 1.04;
  }

  .hero-actions,
  .connect-actions,
  .detail-actions,
  .toolbar,
  .payment-strip {
    display: grid;
    grid-template-columns: 1fr;
  }

  .payment-strip .button {
    width: 100%;
  }

  .feature-grid,
  .action-grid,
  .steps-list,
  .instruction-nav,
  .instruction-steps,
  .stat-grid,
  .credential-grid,
  .table-row,
  .tariff-create,
  .tariff-row,
  .access-layout,
  .access-body,
  .access-page-preview {
    grid-template-columns: 1fr;
  }

  .access-page {
    min-height: auto;
    align-items: start;
    padding: 12px;
  }

  .access-card {
    gap: 16px;
    padding: 14px;
    box-shadow: none;
  }

  .access-head {
    align-items: flex-start;
  }

  .access-head h1 {
    font-size: 28px;
    line-height: 1.08;
  }

  .access-body {
    gap: 14px;
  }

  .access-actions .button,
  .access-actions button,
  .access-actions a {
    width: 100%;
  }

  .qr-large,
  .qr-image,
  .qr-empty {
    width: 100%;
    max-width: 260px;
  }

  .document-card {
    gap: 18px;
    padding: 16px;
    box-shadow: none;
  }

  .document-head {
    align-items: flex-start;
  }

  .document-head h1 {
    font-size: 30px;
    line-height: 1.08;
  }

  .instruction-section {
    gap: 14px;
    scroll-margin-top: 66px;
  }

  .instruction-section-head {
    display: grid;
  }

  .instruction-steps article {
    min-height: auto;
  }

  .instruction-shot {
    gap: 12px;
    padding: 12px;
  }

  .instruction-shot h3 {
    font-size: 19px;
  }

  .instruction-shot img {
    max-height: none;
  }

  .button {
    min-height: 48px;
    padding: 0 14px;
  }

  .admin-content {
    padding: 16px;
  }

  .admin-head {
    display: grid;
  }

  .admin-head-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-head .button {
    width: 100%;
  }

  .traffic-section-head,
  .traffic-panel-head,
  .ikev2-panel .panel-head {
    display: grid;
  }

  .ikev2-panel .panel-head .button {
    width: 100%;
  }

  .traffic-live-status {
    justify-items: start;
    text-align: left;
  }

  .traffic-legend {
    justify-content: flex-start;
  }

  .traffic-chart {
    width: 680px;
    max-width: none;
  }

  .traffic-session-row {
    grid-template-columns: 1fr;
  }

  .traffic-session-account {
    grid-column: auto;
  }

  .traffic-session-open {
    width: 100%;
  }

  .compact-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .account-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .account-row-badges {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
  }

  .account-row-arrow {
    grid-column: 2;
    grid-row: 1;
  }

  .account-profile-back {
    width: 100%;
  }

  .detail-title {
    display: grid;
  }

  .detail-title > div,
  .detail-title h2,
  .mini-grid article,
  .mini-grid b {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .mini-grid {
    grid-template-columns: 1fr;
  }

  .detail-panel dl {
    grid-template-columns: 1fr;
  }

  .detail-form,
  .alias-form {
    grid-template-columns: 1fr;
  }
}
