:root {
  --ink: #12161f;
  --ink-soft: #1d2431;
  --text: #1b2430;
  --muted: #63707f;
  --muted-soft: #8b97a6;
  --line: #e3e8f0;
  --line-strong: #cfd7e3;
  --canvas: #f4f6fa;
  --surface: #ffffff;
  --surface-alt: #f8fafd;
  --brand: #1747c4;
  --brand-dark: #113a9e;
  --brand-soft: #e9f0ff;
  --ok: #0e8b5c;
  --ok-soft: #e6f6ef;
  --info: #1668ca;
  --info-soft: #e8f2fd;
  --warn: #9d6100;
  --warn-soft: #fbf1de;
  --danger: #bf3b2c;
  --danger-soft: #fdece9;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, .06);
  --shadow: 0 1px 2px rgba(17, 24, 39, .05), 0 10px 24px rgba(17, 24, 39, .07);
  --shadow-lg: 0 2px 4px rgba(17, 24, 39, .06), 0 24px 48px rgba(17, 24, 39, .12);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(.22, .68, .35, 1);
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--canvas);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; line-height: 1.3; color: var(--ink); }
p { margin: 0; }
ul, ol, dl { margin: 0; padding: 0; list-style: none; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
code { font-family: var(--mono); font-size: .88em; background: var(--brand-soft); color: var(--brand-dark); padding: 1px 6px; border-radius: 6px; }
img { display: block; max-width: 100%; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 90;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.shell { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; }

.mono { font-family: var(--mono); letter-spacing: -.02em; }

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 66px; position: relative; }

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand__mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--ink); }
.brand__mark svg { display: block; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__text strong { font-size: 16.5px; font-weight: 700; }
.brand__text small { font-size: 11px; color: var(--muted-soft); letter-spacing: .08em; text-transform: uppercase; }

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 40px;
  padding: 0 10px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav-toggle__bar { display: block; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .3s var(--ease), opacity .2s var(--ease); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.primary-nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 20px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: max-height .32s var(--ease), opacity .2s var(--ease), padding .3s var(--ease);
}
.primary-nav.is-open { max-height: 320px; opacity: 1; visibility: visible; padding-block: 10px 16px; }
.primary-nav__link {
  position: relative;
  display: block;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 600;
  font-size: 14.5px;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.primary-nav__link:hover { background: var(--surface-alt); text-decoration: none; color: var(--brand); }
.primary-nav__link.is-active { color: var(--brand); background: var(--brand-soft); }

.page { padding-bottom: 40px; }
main.shell { flex: 1; padding-top: 26px; padding-bottom: 34px; display: block; }

.page-head { margin-bottom: 22px; }
.page-head__eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--brand); margin-bottom: 6px; }
.page-head__title { font-size: clamp(24px, 4.4vw, 34px); }
.page-head__sub { margin-top: 8px; color: var(--muted); max-width: 76ch; font-size: 14.5px; }

.layout { display: grid; gap: 20px; align-items: start; }
.layout__main, .layout__side { display: grid; gap: 20px; align-items: start; min-width: 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; transition: box-shadow .28s var(--ease), transform .28s var(--ease); }
.card:hover { box-shadow: var(--shadow); }
.card--tint { background: var(--surface-alt); }
.card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.card__title { font-size: 17px; }
.card__desc { margin-top: 4px; color: var(--muted); font-size: 13px; }
.card__head-side { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card__body { padding: 20px; display: grid; gap: 18px; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--surface-alt); border: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip--mono { font-family: var(--mono); }
.chip-btn { padding: 5px 11px; border-radius: 999px; background: var(--surface); border: 1px dashed var(--line-strong); color: var(--brand); font-size: 12px; font-family: var(--mono); cursor: pointer; transition: background .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease); }
.chip-btn:hover { background: var(--brand-soft); border-style: solid; transform: translateY(-1px); }

.form { display: grid; gap: 16px; }
.form--inline { grid-template-columns: 1fr; align-items: end; }
.field { display: grid; gap: 6px; min-width: 0; }
.field--grow { flex: 1 1 260px; }
.field__label { font-size: 13.5px; font-weight: 700; color: var(--ink-soft); }
.req { color: var(--danger); font-weight: 700; }
.field__hint { font-size: 12.5px; color: var(--muted); }
.field__error { font-size: 12.5px; color: var(--danger); font-weight: 600; min-height: 0; }
.field__error:not(:empty) { animation: pop-in .28s var(--ease); }

.input, .select {
  width: 100%;
  padding: 11px 13px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
  appearance: none;
  min-width: 0;
}
.input--mono { font-family: var(--mono); }
.input::placeholder { color: var(--muted-soft); }
.input:hover, .select:hover { border-color: var(--muted-soft); }
.input:focus, .select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(23, 71, 196, .16); }
.input.has-error, .select.has-error { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(191, 59, 44, .12); }
.input:disabled, .select:disabled { background: var(--surface-alt); color: var(--muted-soft); cursor: not-allowed; }

.select-wrap { position: relative; }
.select { padding-right: 38px; cursor: pointer; }
.select-wrap__arrow { position: absolute; top: 50%; right: 14px; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg); pointer-events: none; transition: border-color .2s var(--ease); }
.select-wrap:hover .select-wrap__arrow { border-color: var(--brand); }
.select-wrap--sm .select { padding-block: 9px; font-size: 13.5px; }

.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; opacity: 0; }

.form__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.form__actions--end { align-self: end; }
.form__status { font-size: 13px; color: var(--muted); flex: 1 1 100%; }

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  font-size: 14.5px;
  font-weight: 700;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: var(--surface-alt);
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
  transition: transform .18s var(--ease), background .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease), color .2s var(--ease);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.99); }
.btn--primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--brand-dark); }
.btn--ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink-soft); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.btn--quiet { background: transparent; border-color: transparent; color: var(--muted); }
.btn--quiet:hover { color: var(--ink); background: var(--surface-alt); }
.btn--danger { background: var(--danger-soft); border-color: #f2cdc6; color: var(--danger); }
.btn--danger:hover { background: #fbdfda; }
.btn--sm { padding: 8px 14px; font-size: 13.5px; border-radius: 10px; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn__spinner { display: none; width: 15px; height: 15px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn.is-loading { pointer-events: none; }
.btn.is-loading .btn__spinner { display: block; }

.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }

.notice-list { display: grid; gap: 11px; }
.notice-list li { position: relative; padding-left: 22px; font-size: 13.5px; color: var(--muted); }
.notice-list li::before { content: ""; position: absolute; left: 0; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); opacity: .55; }
.notice-list strong { color: var(--ink-soft); }

.steps { display: grid; gap: 14px; }
.step { display: flex; gap: 12px; align-items: flex-start; }
.step__num { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); font-size: 12.5px; font-weight: 700; font-family: var(--mono); }
.step__body { display: grid; gap: 2px; }
.step__body strong { font-size: 14px; color: var(--ink-soft); }
.step__body small { font-size: 12.5px; color: var(--muted); }
.steps--plain .step__num { background: var(--surface-alt); border: 1px solid var(--line); color: var(--muted); }

.taglist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tag { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--surface-alt); border: 1px solid var(--line); border-radius: var(--radius); font-size: 13.5px; font-weight: 600; color: var(--ink-soft); transition: transform .2s var(--ease), border-color .2s var(--ease); }
.tag:hover { transform: translateY(-2px); border-color: var(--brand); }
.tag__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); flex: none; }
.tag small { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--muted-soft); }

.legend { display: grid; gap: 14px; }
.legend__item { display: grid; gap: 6px; padding-bottom: 12px; border-bottom: 1px dashed var(--line); }
.legend__item:last-child { border-bottom: 0; padding-bottom: 0; }
.legend__item p { font-size: 13px; color: var(--muted); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--muted { background: var(--surface-alt); color: var(--muted); border-color: var(--line); }
.badge--info { background: var(--info-soft); color: var(--info); border-color: #cfe4fa; }
.badge--ok { background: var(--ok-soft); color: var(--ok); border-color: #c7ecdb; }
.badge--danger { background: var(--danger-soft); color: var(--danger); border-color: #f4d1ca; }
.badge--is-pulsing::before { animation: pulse 1.1s var(--ease) infinite; }

.alert { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 14px 16px; border-radius: var(--radius); font-size: 13.5px; border: 1px solid var(--line); background: var(--surface-alt); color: var(--ink-soft); }
.alert--info { background: var(--info-soft); border-color: #d3e6fa; color: #124f96; }
.alert--ok { background: var(--ok-soft); border-color: #c9eddc; color: #0b6a46; }
.alert--warn { background: var(--warn-soft); border-color: #f0dcb4; color: #7c4d02; }
.alert--danger { background: var(--danger-soft); border-color: #f4d1ca; color: #9b2e22; }
.alert__icon { width: 20px; height: 20px; border: 1.6px solid currentColor; border-radius: 50%; position: relative; opacity: .7; }
.alert__icon::after { content: "i"; position: absolute; inset: 0; display: grid; place-items: center; font-family: Georgia, "Times New Roman", serif; font-style: italic; font-weight: 700; font-size: 12.5px; line-height: 1; color: currentColor; opacity: 1; }

.result { display: grid; gap: 18px; animation: fade-up .4s var(--ease); }
.result__banner { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: var(--radius); background: var(--ok-soft); border: 1px solid #c9eddc; }
.result__icon { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--ok); position: relative; }
.result__icon::after { content: ""; position: absolute; left: 11px; top: 8px; width: 9px; height: 15px; border-right: 2.5px solid #fff; border-bottom: 2.5px solid #fff; transform: rotate(40deg); }
.result__title { font-size: 16px; color: #0b6a46; }
.result__text { margin-top: 4px; font-size: 13.5px; color: #10603f; }
.result__actions { display: flex; gap: 10px; flex-wrap: wrap; }

.kv { display: grid; gap: 10px; }
.kv--grid { grid-template-columns: 1fr; gap: 12px; }
.kv__row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 14px; background: var(--surface-alt); border: 1px solid var(--line); border-radius: var(--radius); }
.kv__k { font-size: 12.5px; color: var(--muted); font-weight: 600; flex: none; }
.kv__v { font-size: 13.5px; color: var(--ink); font-weight: 600; text-align: right; word-break: break-all; min-width: 0; }
.kv__v .mono { font-size: 13px; }
.kv--compact .kv__row { padding: 8px 12px; }

.copy-btn { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--brand); font-size: 12px; font-weight: 700; cursor: pointer; transition: background .2s var(--ease), border-color .2s var(--ease); }
.copy-btn:hover { background: var(--brand-soft); border-color: var(--brand); }
.copy-btn.is-copied { color: var(--ok); border-color: var(--ok); background: var(--ok-soft); }

.empty { display: grid; gap: 6px; justify-items: center; text-align: center; padding: 34px 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-alt); }
.empty__icon { width: 42px; height: 42px; border-radius: 50%; background: var(--line); margin-bottom: 6px; animation: pulse-soft 2.4s var(--ease) infinite; }
.empty__title { font-size: 15px; font-weight: 700; color: var(--ink-soft); }
.empty__text { font-size: 13px; color: var(--muted); max-width: 44ch; }

.skeleton-stack { display: grid; gap: 12px; }
.skeleton { display: block; height: 14px; border-radius: 8px; background: var(--line); animation: pulse-soft 1.4s var(--ease) infinite; }
.skeleton--line { height: 40px; }
.skeleton--short { width: 55%; }

.pkg-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pkg { position: relative; display: grid; gap: 2px; padding: 18px 16px; text-align: left; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); cursor: pointer; transition: transform .22s var(--ease), border-color .22s var(--ease), box-shadow .22s var(--ease), background .22s var(--ease); }
.pkg:hover { transform: translateY(-3px); border-color: var(--brand); box-shadow: var(--shadow); }
.pkg__quota { font-size: 26px; font-weight: 800; color: var(--ink); font-family: var(--mono); letter-spacing: -.03em; }
.pkg__unit { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .1em; }
.pkg__price { margin-top: 8px; font-size: 16px; font-weight: 700; color: var(--brand); }
.pkg__rate { font-size: 11.5px; color: var(--muted-soft); }
.pkg__check { position: absolute; top: 12px; right: 12px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface-alt); transition: background .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease); }
.pkg.is-active { background: var(--brand); border-color: var(--brand); box-shadow: 0 12px 28px rgba(23, 71, 196, .26); }
.pkg.is-active .pkg__quota, .pkg.is-active .pkg__price { color: #fff; }
.pkg.is-active .pkg__unit, .pkg.is-active .pkg__rate { color: rgba(255, 255, 255, .82); }
.pkg.is-active .pkg__check { background: #fff; border-color: #fff; }
.pkg.is-active .pkg__check::after { content: ""; position: absolute; left: 6px; top: 3px; width: 5px; height: 10px; border-right: 2px solid var(--brand); border-bottom: 2px solid var(--brand); transform: rotate(40deg); }
.pkg.is-entering { animation: pop-in .3s var(--ease); }

.pay { display: grid; gap: 22px; }
.qr { display: grid; gap: 12px; justify-items: center; margin: 0; }
.qr__frame { position: relative; width: min(280px, 78vw); aspect-ratio: 1 / 1; padding: 12px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.qr__img { width: 100%; height: 100%; object-fit: contain; border-radius: var(--radius-sm); transition: opacity .35s var(--ease), transform .35s var(--ease); }
.qr__img.is-loading { opacity: 0; transform: scale(.98); }
.qr__img.is-error { filter: grayscale(1); opacity: .25; }
.qr__skeleton { position: absolute; inset: 12px; border-radius: var(--radius-sm); background: var(--line); animation: pulse-soft 1.4s var(--ease) infinite; }
.qr__skeleton.is-hidden { display: none; }
.qr__caption { font-size: 13px; font-weight: 600; color: var(--ink-soft); text-align: center; }
.qr__hint { font-size: 12.5px; color: var(--muted); text-align: center; max-width: 34ch; }
.qr__hint a { word-break: break-all; }

.pay__side { display: grid; gap: 16px; }
.pay__actions { display: flex; gap: 10px; flex-wrap: wrap; }

.paybar { display: grid; gap: 8px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-alt); }
.paybar__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.paybar__label { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); letter-spacing: .04em; }
.paybar__count { font-family: var(--mono); font-size: 13px; color: var(--brand); font-weight: 700; }
.paybar__track { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.paybar__fill { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--brand); transition: width 1s linear, background .3s var(--ease); }
.paybar__text { font-size: 12.5px; color: var(--muted); }
.paybar.is-ready .paybar__fill { background: var(--ok); }
.paybar.is-ready .paybar__text { color: var(--ok); font-weight: 600; }
.paybar.is-idle .paybar__fill { background: var(--muted-soft); }

.keybox { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px; border: 1px solid var(--brand); border-radius: var(--radius); background: var(--brand-soft); }
.keybox__label { font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--brand-dark); text-transform: uppercase; }
.keybox__value { flex: 1 1 180px; font-family: var(--mono); font-size: 18px; font-weight: 800; color: var(--brand-dark); letter-spacing: .02em; word-break: break-all; }

.quick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.quick__label { font-size: 12.5px; color: var(--muted); }

.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
.table thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-alt); text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table tbody td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--ink-soft); word-break: break-word; }
.table tbody tr { transition: background .2s var(--ease); }
.table tbody tr:hover { background: var(--surface-alt); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.is-entering { animation: row-in .34s var(--ease); }
.table tbody tr.is-saving { opacity: .55; }
.table .cell-strong { font-weight: 700; color: var(--ink); }
.table .cell-link { display: block; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table .cell-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.table--plain { min-width: 0; }
.table--wide { min-width: 1120px; }
.table--wide td { white-space: nowrap; }
.table--wide .cell-actions { flex-wrap: nowrap; }
.table--wide th:first-child, .table--wide td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--line); }
.table--wide thead th:first-child { background: var(--surface-alt); z-index: 2; }
.table--wide tbody tr:hover td:first-child { background: var(--surface-alt); }
.table--plain th, .table--plain td { padding: 9px 12px; }
.table .cell-stack { display: grid; gap: 4px; }
.th-action { width: 132px; }
.row-select { min-width: 130px; padding: 7px 30px 7px 10px; font-size: 13px; border-radius: 9px; background-image: none; }
.row-select-wrap { position: relative; display: inline-block; }
.row-select-wrap::after { content: ""; position: absolute; right: 11px; top: 50%; width: 6px; height: 6px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg); pointer-events: none; }

@media (max-width: 767px) {
  .table-wrap { border-color: var(--line); }
  .table-wrap .table { min-width: 0; }
  .table-wrap .table thead { display: none; }
  .table-wrap .table, .table-wrap .table tbody, .table-wrap .table tr, .table-wrap .table td { display: block; width: 100%; }
  .table-wrap .table tr { padding: 6px 0; border-bottom: 1px solid var(--line); }
  .table-wrap .table tbody tr:last-child { border-bottom: 0; }
  .table-wrap .table td { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 14px; border: 0; white-space: normal; }
  .table-wrap .table--wide { min-width: 0; }
  .table-wrap .table th:first-child, .table-wrap .table td:first-child { position: static; box-shadow: none; }
  .table-wrap .table td::before { content: attr(data-label); font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); flex: none; }
  .table-wrap .table .cell-link { max-width: none; white-space: normal; text-align: right; }
  .table-wrap .table .cell-actions { justify-content: flex-end; }
  .table-wrap .table .row-select { width: 100%; }
}

.toolbar { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-alt); position: relative; }
.toolbar__group { display: grid; gap: 6px; min-width: 150px; flex: 1 1 160px; }
.toolbar__group--grow { flex: 2 1 240px; }
.toolbar__actions { display: flex; gap: 10px; align-items: center; }
.toolbar .field__error { flex: 1 1 100%; }

.pagination { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; padding-top: 4px; }
.page-btn { min-width: 38px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-soft); font-size: 13px; font-weight: 600; cursor: pointer; transition: border-color .2s var(--ease), color .2s var(--ease), background .2s var(--ease); }
.page-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.page-btn.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.page-btn:disabled { opacity: .45; cursor: not-allowed; }
.pagination__info { font-size: 12.5px; color: var(--muted); margin-left: 6px; }

.tabs { display: grid; gap: 18px; }
.tabs__bar { position: relative; display: flex; gap: 4px; padding: 5px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow-sm); overflow-x: auto; scrollbar-width: none; }
.tabs__bar::-webkit-scrollbar { display: none; }
.tab { position: relative; z-index: 1; flex: 1 1 auto; padding: 10px 22px; border: 0; background: transparent; border-radius: 999px; font-size: 14px; font-weight: 700; color: var(--muted); cursor: pointer; white-space: nowrap; transition: color .24s var(--ease); }
.tab:hover { color: var(--ink-soft); }
.tab.is-active { color: #fff; }
.tabs__indicator { position: absolute; top: 5px; left: 5px; height: calc(100% - 10px); min-width: 96px; border-radius: 999px; background: var(--brand); transition: transform .3s var(--ease), width .3s var(--ease); }
.tab-panel { display: grid; gap: 20px; animation: fade-up .34s var(--ease); }
.tab-panel[hidden] { display: none; }

.stats { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 20px; }
.stat { padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); transition: transform .24s var(--ease), box-shadow .24s var(--ease); }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat__label { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-soft); }
.stat__value { font-size: 28px; font-weight: 800; color: var(--ink); font-family: var(--mono); margin-top: 4px; letter-spacing: -.02em; }
.stat__hint { font-size: 12px; color: var(--muted); }

.admin-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 22px; }
.admin-top__actions { display: flex; gap: 10px; flex-wrap: wrap; }

.gate { display: grid; gap: 22px; align-items: start; }
.gate__panel { padding: 26px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); display: grid; gap: 20px; }
.gate__head { display: grid; gap: 6px; justify-items: start; }
.gate__icon { width: 46px; height: 46px; border-radius: 14px; background: var(--ink); position: relative; margin-bottom: 6px; }
.gate__icon::after { content: ""; position: absolute; left: 14px; top: 14px; width: 18px; height: 18px; border: 2.5px solid #fff; border-radius: 50%; }
.gate__title { font-size: 22px; }
.gate__sub { font-size: 13.5px; color: var(--muted); }
.gate__foot { display: flex; gap: 16px; flex-wrap: wrap; padding-top: 4px; border-top: 1px solid var(--line); }
.gate__link { font-size: 13px; font-weight: 600; }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: auto; }
.site-footer__inner { display: grid; gap: 8px; padding: 22px 20px 26px; }
.site-footer__meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted-soft); font-family: var(--mono); }
.site-footer__note { font-size: 12.5px; color: var(--muted); max-width: 90ch; }

.toast-stack { position: fixed; top: 78px; right: 16px; left: 16px; display: grid; gap: 10px; z-index: 60; pointer-events: none; justify-items: end; }
.toast { pointer-events: auto; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; width: min(420px, 100%); padding: 13px 15px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--radius); box-shadow: var(--shadow-lg); transform: translateX(16px); opacity: 0; transition: transform .32s var(--ease), opacity .32s var(--ease); }
.toast.is-in { transform: none; opacity: 1; }
.toast__text { font-size: 13.5px; color: var(--ink-soft); }
.toast__close { border: 0; background: transparent; color: var(--muted-soft); font-size: 18px; line-height: 1; cursor: pointer; padding: 2px 4px; border-radius: 6px; }
.toast__close:hover { color: var(--ink); background: var(--surface-alt); }
.toast--ok { border-left-color: var(--ok); }
.toast--err { border-left-color: var(--danger); }
.toast--warn { border-left-color: var(--warn); }
.toast__mark { width: 22px; height: 22px; border-radius: 50%; background: var(--brand-soft); position: relative; flex: none; }
.toast--ok .toast__mark { background: var(--ok-soft); }
.toast--err .toast__mark { background: var(--danger-soft); }
.toast--warn .toast__mark { background: var(--warn-soft); }
.toast__mark::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--brand); }
.toast--ok .toast__mark::after { background: var(--ok); }
.toast--err .toast__mark::after { background: var(--danger); }
.toast--warn .toast__mark::after { background: var(--warn); }

.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(18, 22, 31, .48); opacity: 0; transition: opacity .26s var(--ease); }
.modal__panel { position: relative; width: min(520px, 100%); background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); transform: translateY(12px) scale(.98); opacity: 0; transition: transform .28s var(--ease), opacity .28s var(--ease); max-height: 86vh; overflow: auto; }
.modal.is-open .modal__backdrop { opacity: 1; }
.modal.is-open .modal__panel { transform: none; opacity: 1; }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal__head h2 { font-size: 17px; }
.modal__body { padding: 20px; display: grid; gap: 14px; font-size: 14px; color: var(--ink-soft); }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.modal__image { display: grid; justify-items: center; gap: 12px; }
.modal__image img { width: min(320px, 80vw); border: 1px solid var(--line); border-radius: var(--radius); }

.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); font-size: 18px; cursor: pointer; transition: color .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease); }
.icon-btn:hover { color: var(--ink); border-color: var(--line-strong); background: var(--surface-alt); }

.noscript { margin: 16px 0; padding: 14px 16px; border: 1px solid #f0dcb4; background: var(--warn-soft); color: #7c4d02; border-radius: var(--radius); font-size: 13.5px; }

@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop-in { 0% { opacity: 0; transform: scale(.94); } 100% { opacity: 1; transform: scale(1); } }
@keyframes row-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.6); opacity: .35; } 100% { transform: scale(1); opacity: 1; } }
@keyframes pulse-soft { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

@media (min-width: 640px) {
  .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kv--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pkg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form--inline { grid-template-columns: minmax(0, 1fr) auto; }
  .pay { grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); align-items: start; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .toast-stack { left: auto; }
}

@media (min-width: 900px) {
  body { font-size: 15.5px; }
  .site-header__inner { min-height: 72px; }
  .nav-toggle { display: none; }
  .primary-nav { position: static; display: flex; flex-direction: row; align-items: center; gap: 4px; max-height: none; opacity: 1; visibility: visible; overflow: visible; padding: 0; background: transparent; border: 0; box-shadow: none; }
  .primary-nav__link { padding: 9px 14px; }
  .primary-nav__link.is-active { background: transparent; color: var(--brand); }
  .primary-nav__link.is-active::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--brand); }
  .layout { grid-template-columns: minmax(0, 1fr) 340px; }
  .gate { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pkg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1200px) {
  .layout { grid-template-columns: minmax(0, 1fr) 380px; }
}

@media (max-width: 899px) {
  .stats { gap: 12px; }
  .admin-top { margin-bottom: 18px; }
}

@media (max-width: 639px) {
  .shell { padding: 0 16px; }
  .card__head { flex-direction: column; align-items: flex-start; }
  .pkg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pkg__quota { font-size: 22px; }
  .stat__value { font-size: 24px; }
  .table-wrap { border: 0; }
  .btn { padding: 11px 16px; }
  .toast-stack { top: 70px; right: 12px; left: 12px; justify-items: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-header, .site-footer, .toast-stack, .modal, .tabs__bar, .toolbar__actions, .btn { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; break-inside: avoid; }
}
