:root {
  color-scheme: dark;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #0e1019;
  color: #f3f4ff;
  --muted: #a9afc6;
  --line: #2a2e42;
  --accent: #aeb3ff;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; min-height: 100vh; background: radial-gradient(ellipse at 48% 0, #1b1e33 0, transparent 66%), #0e1019; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid #aeb3ff; outline-offset: 4px; }
[hidden] { display: none !important; }
svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.bar { background: #121421; border-bottom: 1px solid #282b3e; }
.bar-inner, .shell { width: min(100% - clamp(40px, 7.1vw, 124px), 1520px); margin-inline: auto; }
.bar-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.brand { display: flex; align-items: center; gap: 13px; text-decoration: none; color: inherit; font-size: 20px; font-weight: 700; line-height: 1.12; }
.brand-mark { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: linear-gradient(145deg, #8f94ff, #5653d4); color: white; box-shadow: 0 4px 20px #6264ff44; }
.brand-mark svg { width: 25px; height: 25px; }
.brand-en { display: block; margin-top: 5px; font-size: 10px; letter-spacing: .2em; color: var(--muted); }
.bar-actions { display: flex; align-items: center; gap: 12px; }
.shell { padding-bottom: 38px; }
.intro { display: flex; justify-content: space-between; align-items: end; padding: 35px 0 25px; }
h1 { font-size: clamp(36px, 4vw, 55px); line-height: 1.17; letter-spacing: -.045em; margin: 0 0 11px; font-weight: 730; }
.number-card { position: relative; isolation: isolate; overflow: hidden; min-height: 225px; border: 1px solid #6b70ca; border-radius: 22px; color: #f8f9ff; background: radial-gradient(ellipse at 83% -16%, #6265c9, transparent 72%), linear-gradient(115deg, #20224f, #313479 70%, #33387b); box-shadow: 0 18px 44px #08091465; }
.number-inner { position: relative; padding: 28px 34px; }
.number-top, .number-foot { display: flex; align-items: center; gap: 10px; }
.number-top { color: #dde0ff; }
.number-top h2 { font-weight: 600; font-size: 16px; margin: 0; }
.number-top svg { width: 21px; height: 21px; }
.number { margin: 10px 0 16px; font-size: clamp(35px, 5.2vw, 69px); font-weight: 650; line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -.036em; }
.number-foot { gap: 17px; }
.signal-art { position: absolute; z-index: -1; inset: 0 0 0 auto; width: 58%; height: 100%; stroke: none; }
.provider { display: inline-flex; align-items: center; gap: 9px; color: #e0e2ff; font-size: 13px; letter-spacing: .09em; }
.provider > span:first-child, .status-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: #adb7ff; box-shadow: 0 0 0 4px #b4baff24; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; min-height: 44px; padding: 8px 14px; font-size: 15px; font-weight: 650; white-space: nowrap; transition: background .15s; }
.button svg { width: 18px; height: 18px; }
.button.quiet { background: transparent; color: #c1c4d9; }
.button.quiet:hover, .button.quiet[aria-pressed="true"] { background: #292c45; color: #dedfff; }
.button.number-copy { border-color: #c9ceff6b; background: #ffffff13; color: #f4f5ff; }
.button.number-copy:hover:not(:disabled) { background: #ffffff28; }
.inbox { margin-top: 22px; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: #181b2a; box-shadow: 0 14px 36px #07081040; }
.inbox-top { padding: 20px 26px 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.inbox-heading, .inbox-actions, .auto-control { display: flex; align-items: center; }
.inbox-heading { gap: 12px; }
.inbox-actions { gap: 22px; }
.small-icon { display: grid; place-items: center; width: 41px; height: 41px; border-radius: 11px; color: #c2c6ff; background: #2a2d50; }
.inbox-heading h2 { font-size: 22px; margin: 0; line-height: 1.2; }
.count { min-width: 25px; padding: 4px 7px; border-radius: 20px; text-align: center; color: #cbd0ff; background: #2d3150; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.auto-control { gap: 10px; }
.auto-control label { display: block; white-space: nowrap; font-weight: 650; font-size: 13px; }
.auto-control span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.auto-control input { appearance: none; cursor: pointer; flex: 0 0 42px; height: 24px; margin: 0; border: 1px solid #4b506d; border-radius: 24px; background: #353951; position: relative; }
.auto-control input::before { content: ""; position: absolute; left: 2px; top: 2px; width: 18px; height: 18px; background: #f0f0ff; border-radius: 50%; transition: transform .15s; }
.auto-control input:checked { background: #666cde; border-color: #777cf0; }
.auto-control input:checked::before { transform: translateX(18px); }
.auto-control input:disabled { opacity: .5; cursor: default; }
.primary { min-width: 133px; padding-inline: 17px; color: #1d2040; background: #b0b8ff; box-shadow: 0 3px 18px #8290ff31; }
.primary:hover:not(:disabled) { background: #c9ceff; }
.primary.busy svg { animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.notice { display: flex; align-items: center; gap: 10px; margin: 0 26px; min-height: 40px; padding: 8px 14px; border: 1px solid #343956; border-radius: 9px; background: #24283e; color: #c2c7e3; font-size: 14px; line-height: 1.45; }
.notice[data-tone="warning"] { background: #302825; border-color: #594334; color: #f4cba5; }
.notice[data-tone="warning"] .status-dot { background: #e7ad75; box-shadow: 0 0 0 3px #e7ad7525; }
.notice[data-tone="demo"] { background: #282a4b; border-color: #424672; color: #d1d4ff; }
.inbox-content { min-height: 225px; }
.empty { min-height: 225px; padding: 24px 16px; display: grid; align-content: center; justify-items: center; text-align: center; }
.empty-mark { width: 62px; height: 62px; display: grid; place-items: center; border: 1px solid #42496c; border-radius: 19px; background: linear-gradient(140deg, #333957, #262944); color: #b4beff; }
.empty-mark svg { width: 29px; height: 29px; }
.empty h3 { margin: 13px 0 6px; font-size: 20px; font-weight: 650; }
.empty p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.inbox-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap; border-top: 1px solid var(--line); padding: 13px 26px; background: #151827; color: var(--muted); font-size: 13px; }
.inbox-foot span { display: inline-flex; align-items: center; gap: 6px; }
.inbox-foot svg { width: 16px; height: 16px; }
.inbox-foot time { color: #d6d9ee; font-variant-numeric: tabular-nums; }
.messages { margin: 0; padding: 18px 26px 24px; list-style: none; display: grid; gap: 12px; }
.message { padding: 17px 20px; border: 1px solid #353954; border-radius: 13px; background: #222638; }
.message-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.message-head strong { font-size: 16px; overflow-wrap: anywhere; }
.message-head time { font-size: 13px; color: var(--muted); text-align: end; }
.message p { font-size: 16px; margin: 10px 0 0; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-code { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid #454a71; border-radius: 10px; background: #2b3051; padding: 8px 10px 8px 15px; margin-top: 14px; }
.message-code code { font-size: clamp(25px, 3vw, 34px); letter-spacing: .1em; color: #d3d7ff; font-weight: 700; }
.message-code button { background: #3b416b; border-color: #515a8a; color: #e2e6ff; }
.message-code button:hover { background: #4b5488; }
.toast { position: fixed; z-index: 2; inset: auto auto 20px 50%; transform: translateX(-50%); max-width: calc(100% - 32px); width: max-content; padding: 11px 16px; border-radius: 10px; border: 1px solid #666ca0; background: #373e68; color: #fff; box-shadow: 0 6px 24px #0008; font-size: 14px; }
@media (max-width: 720px) {
  .bar-inner, .shell { width: calc(100% - 36px); }
  .bar-inner { min-height: 64px; }
  .brand { gap: 8px; font-size: 17px; }
  .brand-mark { width: 37px; height: 37px; }
  .intro { padding-block: 26px 20px; }
  .number-card { min-height: 0; border-radius: 16px; }
  .number-inner { padding: 21px 20px; }
  .signal-art { width: 53%; opacity: .57; }
  .inbox { margin-top: 17px; border-radius: 16px; }
  .inbox-top { flex-wrap: wrap; padding: 14px 16px; }
  .inbox-heading h2 { font-size: 18px; }
  .inbox-actions { gap: 13px; }
  .notice { margin-inline: 16px; }
  .inbox-foot, .messages { padding-inline: 16px; }
}
@media (max-width: 480px) {
  .bar-inner, .shell { width: calc(100% - 28px); }
  .bar-actions { gap: 2px; }
  .bar-actions .button { padding-inline: 7px; font-size: 13px; }
  .inbox-actions { width: 100%; justify-content: space-between; }
  .message { padding: 13px; }
  .message-code button { font-size: 13px; min-height: 36px; padding-inline: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.button { text-decoration: none; }
.secondary { color: #d5d9ff; background: #282d47; border-color: #414767; }
.secondary:hover:not(:disabled) { background: #373e62; }
.redeem-card { display: grid; grid-template-columns: 1fr minmax(350px, 1fr); align-items: center; gap: 28px; padding: 37px; margin-bottom: 20px; border: 1px solid #51578b; border-radius: 22px; background: radial-gradient(ellipse at 100% 0, #33396c, transparent 76%), #20243b; }
.redeem-card h2 { font-size: clamp(23px, 3vw, 36px); margin: 0 0 9px; }
.admin-panel p, .admin-dialog p { color: var(--muted); margin: 0; line-height: 1.6; }
.redeem-form label, .admin-panel label, .admin-dialog label { display: block; font-size: 14px; font-weight: 650; margin-bottom: 7px; }
.input-row { display: flex; align-items: center; gap: 9px; }
.input-row input { min-width: 0; flex: 1; }
input:not([type=checkbox]), textarea, select { font: inherit; color: #f3f4ff; border: 1px solid #434866; background: #131625; border-radius: 9px; padding: 10px 12px; min-height: 43px; }
input::placeholder, textarea::placeholder { color: #939ab6; }
textarea, .admin-panel label > input { display: block; width: 100%; }
textarea { resize: vertical; line-height: 1.5; }
textarea:focus-visible, select:focus-visible { outline: 3px solid #aeb3ff; outline-offset: 3px; }
.form-feedback { color: #eac6a1 !important; min-height: 1.3em; font-size: 13px; margin: 8px 0 0 !important; }
.form-feedback ul { margin: 6px 0 0; max-height: 132px; overflow: auto; padding-left: 18px; }
.number-meta { display: flex; align-items: center; gap: 12px; margin-top: 16px; font-size: 14px; color: #e5e5ff; }
.number-meta .button { min-height: 36px; font-size: 13px; background: #232650bb; border-color: #a4a6e960; }
.number-meta .button:hover:not(:disabled) { background: #464c85; }
.admin-shell { max-width: 1450px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 22px; }
.metric { min-height: 112px; display: grid; align-content: center; gap: 7px; padding: 17px 20px; border: 1px solid #393f62; border-radius: 15px; background: linear-gradient(145deg, #272c4b, #1c2035); }
.metric span { color: #c5cbea; font-size: 13px; }
.metric strong { font-size: 32px; font-variant-numeric: tabular-nums; }
.admin-tabs { display: flex; gap: 8px; padding-bottom: 13px; }
.admin-tabs .button { background: #202438; color: #c9cde3; }
.admin-tabs [aria-pressed=true] { color: #ecedff; border-color: #777fc0; background: #353c68; }
.admin-forms { display: grid; grid-template-columns: 1.4fr 1fr; gap: 15px; margin-bottom: 15px; align-items: start; }
.admin-panel { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #181b2a; min-width: 0; }
.admin-panel h2, .admin-dialog h2 { font-size: 20px; margin: 0 0 7px; }
.admin-panel p, .admin-dialog p { font-size: 14px; margin-bottom: 15px; }
.admin-panel .check-row { display: flex; align-items: center; gap: 7px; margin: 11px 0; font-size: 13px; color: #d2d6ec; }
.check-row input { accent-color: #aeb3ff; }
.code-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 9px; }
.code-fields input, .code-fields select, .admin-dialog input { margin-top: 7px; min-width: 0; }
.generated textarea { margin-bottom: 9px; font-family: Consolas, monospace; letter-spacing: .05em; }
.list-panel { padding: 0; overflow: hidden; }
.list-top { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; padding: 17px 20px; }
.list-top p { margin: 0; }
.filter-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-form input { width: min(220px, 100%); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: start; }
th, td { padding: 13px 17px; border-top: 1px solid var(--line); font-size: 14px; text-align: start; }
th { background: #202338; color: #c4c8df; font-weight: 650; white-space: nowrap; }
td { overflow-wrap: anywhere; }
td small { display: block; color: var(--muted); margin-top: 3px; white-space: nowrap; }
.row-actions { white-space: nowrap; }
.row-button { min-height: 32px; font-size: 12px; padding: 5px 8px; margin-right: 4px; }
.tabular { font-variant-numeric: tabular-nums; white-space: nowrap; }
.status-chip { display: inline-block; white-space: nowrap; background: #282d46; color: #cdd3ef; padding: 4px 8px; border-radius: 8px; font-size: 12px; }
.status-chip[data-status=available], .status-chip[data-status=complete] { background: #203f3d; color: #b9efe0; }
.status-chip[data-status=assigned], .status-chip[data-status=cooling] { background: #3f3429; color: #f4d0a9; }
.status-chip[data-status=exhausted], .status-chip[data-status=revoked] { background: #453141; color: #f4c4db; }
.table-empty { text-align: center; padding: 35px 12px; color: var(--muted); }
.list-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 13px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.pagination, .dialog-actions { display: flex; gap: 8px; }
.admin-dialog { color: #f3f4ff; width: min(450px, calc(100% - 30px)); border: 1px solid #515784; border-radius: 16px; background: #1e2237; padding: 23px; }
.admin-dialog::backdrop { background: #080a13bc; }
.admin-dialog input { width: 100%; }
.dialog-actions { justify-content: end; margin-top: 14px; }
.visually-hidden { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }
@media (max-width: 850px) { .redeem-card, .admin-forms { grid-template-columns: 1fr; } .redeem-card { padding: 24px; } }
@media (max-width: 540px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .metric { min-height: 88px; padding: 11px 14px; }
  .metric strong { font-size: 26px; }
  .redeem-card, .admin-panel:not(.list-panel) { padding: 17px; }
  .input-row { flex-wrap: wrap; }
  .redeem-form .input-row > * { flex: 1 1 100%; }
  .intro { align-items: start; flex-direction: column; gap: 12px; }
  .number-meta { align-items: start; flex-direction: column; }
  .code-fields { grid-template-columns: 1fr 1fr; }
  .code-fields label:last-child { grid-column: 1 / -1; }
}
.form-feedback:empty { display: none; }

.login-shell { display: grid; justify-items: center; padding-top: clamp(40px, 10vh, 110px); }
.login-panel { width: min(100%, 420px); padding: 28px; }
.login-panel h1 { font-size: 28px; margin-bottom: 23px; }
.login-panel input { width: 100%; }
.login-panel .button { width: 100%; margin-top: 16px; }

/* Customer console */
.bench { background: #0a1220; color: #f3f6fb; --muted: #91a7c0; --line: #263347; }
.bench .shell { width: min(calc(100% - clamp(34px, 9vw, 172px)), 1590px); }
.bench-header { display: flex; justify-content: space-between; align-items: center; gap: 24px; min-height: 193px; padding: 30px 0 36px; }
.bench-header h1 { font-size: clamp(36px, 4.8vw, 66px); margin: 0; letter-spacing: -.055em; }
.bench-tools { display: flex; align-items: center; gap: 13px; }
.quota { display: grid; gap: 6px; min-width: 124px; padding: 17px 21px; border-radius: 19px; border: 1px solid #263142; background: #101927; }
.quota svg { color: #ffc07b; }
.quota span { font-size: 13px; color: var(--muted); }
.quota strong { font-size: 23px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bench-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: stretch; gap: 26px; }
.bench-panel { min-width: 0; margin: 0; border: 1px solid #273446; border-radius: 27px; background: #111a29; box-shadow: none; }
.redeem-panel { padding: 28px 30px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 27px; min-height: 41px; }
.panel-title h2, .bench .inbox-heading h2 { font-size: 24px; margin: 0; letter-spacing: -.02em; }
.bench .redeem-form { display: block; border: 1px solid #202d3f; border-radius: 18px; padding: 20px; background: #0d1523; }
.bench label { color: #b5c6db; font-size: 14px; font-weight: 550; }
.bench .redeem-form label { margin-bottom: 11px; }
.bench .input-row { gap: 11px; flex-wrap: nowrap; }
.key-field { position: relative; flex: 1 1 0; min-width: 0; }
.key-field svg { position: absolute; top: 50%; transform: translateY(-50%); left: 14px; color: #839ab5; pointer-events: none; }
.bench .key-field input { width: 100%; height: 51px; padding-left: 43px; border-color: #4a3b2c; background: #111b2b; }
.bench input::placeholder { color: #839ab5; }
.bench button:focus-visible, .bench input:focus-visible, .bench a:focus-visible { outline-color: #f6b777; }
.bench .primary { min-width: 0; color: #20150e; background: #efb778; box-shadow: none; }
.bench .primary:hover:not(:disabled) { background: #ffca91; }
.bench .primary:disabled { opacity: 1; background: #202b3b; color: #8da0b7; }
.bench .input-row .button { height: 51px; }
.bench .take-button { min-height: 56px; width: 100%; margin-top: 22px; font-size: 16px; }
.bench .form-feedback[data-tone=success] { color: #9ddcc6 !important; }
.bench .secondary { background: #19283b; border-color: #344761; color: #d7e5f5; }
.bench .secondary:hover:not(:disabled) { background: #23354c; }
.bench-number { margin-top: 21px; padding: 19px; border: 1px solid #64513e; border-radius: 16px; background: #1d2533; }
.bench-number .number-top { color: #f0c390; }
.bench-number h3 { margin: 0; font-size: 14px; }
.bench-number .number { margin: 13px 0; font-size: clamp(25px, 3.5vw, 48px); }
.bench-number #swap-status { color: var(--muted); margin: 10px 0 0; font-size: 13px; }
.bench .inbox { display: flex; flex-direction: column; background: #101e30; }
.bench .inbox-top { min-height: 96px; padding: 23px 25px; align-items: center; flex-wrap: wrap; }
.bench .inbox-heading { gap: 9px; }
.bench .inbox-actions { gap: 13px; }
.bench .inbox-actions .button { padding-inline: 11px; }
.bench .count { background: #24344c; color: #c8d6e8; }
.bench .inbox-content { flex: 1; display: flex; flex-direction: column; margin: 0 24px 24px; min-height: 300px; border-radius: 19px; border: 1px dashed #283a50; background: #0e1a2a; overflow: hidden; }
.bench .notice { margin: 0 24px 13px; }
.bench .empty { flex: 1; padding: 22px; }
.bench .empty-mark { color: #819ab5; border: 0; background: #19283b; width: 65px; height: 65px; }
.bench .empty h3 { color: #a8bed7; font-size: 16px; font-weight: 550; }
.bench .inbox-foot { background: #101e30; }
.bench .messages { padding: 12px; }
.bench .message { background: #17253a; border-color: #2b3e57; }
.bench .message-code { background: #1b2c42; border-color: #344761; }
.bench .message-code code { color: #ffd29e; }
@media (max-width: 940px) { .bench-layout { grid-template-columns: 1fr; gap: 18px; } .bench-header { min-height: 140px; } }
@media (max-width: 530px) {
  .bench-header { min-height: 116px; padding: 22px 0; gap: 8px; }
  .bench-header h1 { font-size: clamp(23px, 6.3vw, 36px); }
  .bench-tools { gap: 3px; }
  .bench-tools .quiet { font-size: 12px; padding-inline: 5px; }
  .quota { min-width: 77px; padding: 10px 9px; border-radius: 12px; gap: 3px; }
  .quota svg { display: none; }
  .quota span { font-size: 11px; }
  .quota strong { font-size: 16px; }
  .redeem-panel, .bench .inbox-top { padding: 17px; }
  .bench-panel { border-radius: 17px; }
  .panel-title { margin-bottom: 13px; min-height: 34px; }
  .panel-title h2, .bench .inbox-heading h2 { font-size: 20px; }
  .bench .redeem-form { padding: 12px; }
  .bench .input-row { gap: 7px; }
  .bench .input-row .button { font-size: 13px; padding-inline: 9px; }
  .bench .redeem-form .input-row .key-field { flex: 1 1 0; }
  .bench .redeem-form .input-row .button { flex: 0 0 auto; }
  .key-field svg { left: 10px; width: 16px; }
  .bench .key-field input { padding-left: 33px; }
  .bench .inbox-content { margin: 0 15px 15px; min-height: 211px; }
  .bench .notice { margin-inline: 15px; }
}

.list-title-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.list-title-actions h2 { margin: 0; }
.list-title-actions button { min-height: 36px; }
.dialog-fields { border: 0; padding: 0; margin: 0; min-width: 0; }
.dialog-fields label { margin: 10px 0 5px; }
.dialog-fields input, .dialog-fields select { width: 100%; margin: 0; }
.row-button { margin-bottom: 3px; }
