:root {
  color-scheme: dark;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  --bg: #070911;
  --panel: #0d101e;
  --inset: #101626;
  --border: #202d46;
  --divider: #171f32;
  --text: #e4ebf7;
  --muted: #92a3be;
  --subtle: #7185a3;
  --cyan: #36c4ef;
  --gradient: linear-gradient(115deg, #20cfe3, #3974ed 57%, #8954f2);
  color: var(--text);
  background: var(--bg);
  scrollbar-color: #3a4f70 #0b0f1b;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { overflow-x: clip; }
body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  margin: 0;
  overflow-x: clip;
  font-size: 14px;
  background-image:
    radial-gradient(ellipse 60% 270px at 8% -40px, #102b3c 0, transparent 100%),
    radial-gradient(ellipse 42% 250px at 94% 0, #17142c 0, transparent 100%),
    radial-gradient(ellipse at 50% 112%, #081725 0, transparent 56%),
    linear-gradient(#1a355138 1px, transparent 1px),
    linear-gradient(90deg, #1a355138 1px, transparent 1px);
  background-size: auto, auto, auto, 36px 36px, 36px 36px;
}
.wrap { width: min(calc(100% - 40px), 1088px); margin-inline: auto; }
h1, h2, h3, p, dl, dd, form { margin: 0; }
h2 { font-size: 16px; font-weight: 650; }
h3 { margin-bottom: 12px; font-size: 13px; }
a { color: var(--cyan); }
button, input, .primary { font: inherit; }
button, .primary, .secondary { cursor: pointer; }
button:disabled { opacity: .42; cursor: default; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.site-header { background: #0e1220ee; border-bottom: 1px solid var(--border); }
.header-inner, .brand, .header-actions, .actions, .form-row, .section-head {
  display: flex;
  align-items: center;
}
.header-inner { min-height: 64px; justify-content: space-between; gap: 14px; }
.brand { gap: 10px; font-size: 18px; letter-spacing: -.035em; font-weight: 750; }
.mark, .entry-icon {
  display: grid;
  place-items: center;
  color: white;
  background: var(--gradient);
  box-shadow: 0 0 25px #30bdf25c;
}
.mark { width: 36px; height: 36px; border-radius: 50%; font-size: 17px; }
.header-actions, .actions { gap: 10px; flex-wrap: wrap; }
.secondary, .primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 13px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--inset);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.primary { min-height: 40px; padding-inline: 16px; border-color: transparent; color: white; font-weight: 650; background: var(--gradient); box-shadow: 0 5px 20px #1da6dc35; }
.secondary:hover, .primary:hover { filter: brightness(1.17); }
.nav-icon { color: var(--cyan); font-weight: 750; }
.info-icon { display: inline-grid; place-items: center; width: 13px; height: 13px; border-radius: 50%; color: #052033; background: var(--cyan); font: bold 10px/1 Inter, sans-serif; }
.service-state { border: 1px solid #173c3f; color: #35d9ad; background: #0f292e; border-radius: 20px; font-size: 12px; padding: 7px 12px; white-space: nowrap; }
.service-state::before, .order-status::before { content: ""; display: inline-block; width: 6px; height: 6px; background: currentColor; border-radius: 50%; margin-right: 6px; vertical-align: 2px; }
.service-state[data-tone="failed"] { color: #fb8b9e; background: #2d1c2a; border-color: #623243; }
main { flex: 1; padding-block: 40px 120px; }
main:has(.card-summary:not([hidden])) { padding-top: 20px; }
.panel, .order-card { border: 1px solid var(--border); border-radius: 18px; background: var(--panel); box-shadow: inset 0 1px #ffffff08, 0 9px 28px #0003; }
.access { overflow: hidden; }
#lookup { padding: 24px; }
#lookup label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.form-row { gap: 12px; }
.input-with-icon { position: relative; flex: 1; min-width: 0; display: block; }
.input-with-icon input { width: 100%; }
input:not([type="checkbox"]) { display: block; min-width: 0; height: 40px; padding: 8px 13px; border: 1px solid var(--border); border-radius: 14px; color: var(--text); background: var(--inset); }
.input-with-icon input:not([type="checkbox"]) { padding-left: 39px; }
input::placeholder { color: var(--subtle); opacity: 1; }
#card, #source-card, #new-card { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 13px; }
.key-icon, .search-icon { position: absolute; z-index: 1; top: 50%; left: 15px; width: 9px; height: 9px; border: 1.5px solid var(--muted); border-radius: 50%; transform: translateY(-65%); pointer-events: none; }
.key-icon::after, .search-icon::after { position: absolute; content: ""; width: 5px; height: 1.5px; background: var(--muted); transform: rotate(45deg); top: 7px; left: 6px; }
.key-icon::after { transform: rotate(-50deg); left: -4px; width: 7px; height: 3px; }
.entry { display: grid; align-content: center; justify-items: center; gap: 21px; min-height: 268px; margin-top: 32px; background: radial-gradient(ellipse 53% 125px at 50% 0%, #102d42 0, transparent 85%), var(--panel); }
.entry-icon { width: 56px; height: 56px; border-radius: 24px; }
.entry h2 { font-size: 19px; }
.lock { position: relative; width: 17px; height: 12px; margin-top: 6px; border-radius: 3px; background: white; }
.lock::before { content: ""; position: absolute; inset: -7px 3px 7px; border: 2px solid white; border-radius: 7px 7px 0 0; }
.card-summary { display: grid; grid-template-columns: minmax(170px, 36%) minmax(0, 1fr); min-height: 94px; border-bottom: 1px solid var(--divider); }
.card-caption, .summary-controls { padding: 18px 24px; }
.card-caption { border-right: 1px solid var(--divider); }
.card-caption > div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 9px; margin-top: 5px; }
#card-mask, #remaining, #total { font-family: "IBM Plex Mono", ui-monospace, monospace; overflow-wrap: anywhere; }
.caption-label, dt { color: var(--subtle); font-size: 12px; }
.summary-controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.summary-controls dd { color: var(--muted); white-space: nowrap; }
#remaining { color: var(--cyan); font-size: 30px; line-height: 1.2; }
.text-button { display: inline-flex; align-items: center; gap: 5px; background: transparent; border: 0; padding: 6px; color: var(--muted); white-space: nowrap; font-size: 12px; border-radius: 6px; }
.text-button:hover:not(:disabled) { color: var(--text); background: #62a5ff12; }
#switch-card { padding-inline: 0; color: var(--cyan); flex-shrink: 0; }
#card-notices > :not([hidden]) { margin: 12px 24px; }
.notice { border: 1px solid var(--border); border-radius: 9px; padding: 9px 12px; font-size: 12px; line-height: 1.5; }
.notice[data-tone="success"], .order-status[data-tone="success"] { color: #35dbab; background: #0e2b2e; border-color: #154341; }
.notice[data-tone="pending"], .order-status[data-tone="pending"], .notice[data-tone="cancelled"], .order-status[data-tone="cancelled"] { color: #f9bd35; background: #302a22; border-color: #574525; }
.notice[data-tone="running"], .order-status[data-tone="running"] { color: #67d5ff; background: #10283c; border-color: #254864; }
.notice[data-tone="failed"], .notice.error, .order-status[data-tone="failed"] { color: #ff8299; background: #301d2c; border-color: #743b50; }
.notice p + p { margin-top: 4px; }
.workspace { display: grid; grid-template-columns: minmax(300px, 439px) minmax(0, 1fr); gap: 24px; align-items: start; margin-top: 32px; }
.start-header { padding: 20px 24px; border-bottom: 1px solid var(--divider); }
.start-header p, .service-option p { color: var(--muted); font-size: 13px; margin-top: 5px; }
.start-content { display: grid; gap: 20px; padding: 24px; }
.plan-list { display: flex; flex-wrap: wrap; gap: 10px; }
.plan-card {
  display: inline-grid;
  gap: 7px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #101525;
  color: var(--text);
  text-align: left;
  transition: border-color .15s, background .15s;
}
.plan-card:hover:not([aria-checked="true"]) { border-color: #344a6e; }
.plan-card[aria-checked="true"] { border-color: var(--cyan); background: #0f283b; }
.plan-card span { color: var(--muted); font-size: 11px; }
.plan-card b { color: var(--cyan); }
.service-options { display: grid; gap: 10px; }
.service-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 68px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #101525;
  color: var(--text);
  text-align: left;
  transition: border-color .15s, background .15s;
}
.service-option:hover:not([aria-disabled="true"]):not([aria-checked="true"]) { border-color: #344a6e; }
.service-option[aria-checked="true"] { border-color: var(--cyan); background: #0f283b; }
.service-option[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.service-copy { min-width: 0; flex: 1; }
.service-option strong { font-size: 13px; }
.service-option p { font-size: 12px; }
.service-dot {
  position: relative;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--subtle);
  border-radius: 50%;
  flex-shrink: 0;
}
.service-option[aria-checked="true"] .service-dot {
  border-color: var(--cyan);
  background: #0d2b3e;
  box-shadow: 0 0 8px #36c4ef66;
}
.service-option[aria-checked="true"] .service-dot::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
}
.price { margin-left: auto; padding: 4px 8px; white-space: nowrap; font-size: 11px; color: var(--muted); background: #0b1425; border-radius: 16px; }
.service-option[aria-checked="true"] .price { color: var(--text); background: #142238; }
.order-cta { width: 100%; }
.field-label { display: block; margin-bottom: 12px; font-size: 13px; font-weight: 700; }
.accounts-textarea {
  display: block;
  width: 100%;
  min-height: 176px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--inset);
  color: var(--text);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.65;
  resize: vertical;
  scrollbar-width: thin;
  scrollbar-color: #4b6082 #162036;
}
.accounts-textarea::placeholder { color: var(--subtle); opacity: 1; }
.accounts-textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px #36c4ef22; }
.accounts-textarea:disabled { opacity: .45; cursor: not-allowed; }
.section-head { justify-content: space-between; min-height: 32px; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.section-head h2 { display: flex; align-items: center; gap: 8px; }
.count { color: var(--cyan); background: #0e2535; border-radius: 12px; padding: 3px 7px; font-size: 11px; }
#search input { height: 32px; width: min(209px, 45vw); padding-left: 32px; font-size: 12px; border-radius: 13px; }
#search .search-icon { left: 12px; }
.empty-state { display: grid; justify-items: center; align-content: center; gap: 8px; min-height: 223px; padding: 24px; text-align: center; font-size: 13px; }
.empty-state p { color: var(--muted); font-size: 12px; }
.empty-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 15px; border: 1px solid var(--border); background: var(--inset); color: var(--muted); margin-bottom: 5px; }
.orders { min-width: 0; }
#order-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 11px; margin: 0; padding: 0; list-style: none; }
.order-card { min-width: 0; padding: 17px 20px; overflow-wrap: anywhere; }
.order-card:has([data-tone="pending"]) { background: #141c30; }
.order-header, .order-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.order-header { justify-content: space-between; }
.order-title { min-width: 0; }
.order-title strong { font-weight: 600; }
.order-id, .order-meta, #page-number { color: var(--muted); font-size: 11px; }
.order-id, .order-status { border-radius: 20px; padding: 2px 7px; }
.order-id { background: #0c1425; font-family: "IBM Plex Mono", ui-monospace, monospace; }
.order-status { flex-shrink: 0; border: 1px solid var(--border); font-size: 11px; color: var(--muted); }
.order-status::before { width: 5px; height: 5px; }
.order-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.cancel-order {
  padding: 5px 12px;
  border: 1px solid #623243;
  border-radius: 14px;
  background: #2d1c2a;
  color: #fb8b9e;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.cancel-order:hover:not(:disabled) { filter: brightness(1.15); }
.order-meta { margin-top: 6px; line-height: 1.6; }
.order-notice { margin-top: 12px; }
.order-billing { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--divider); font-family: "IBM Plex Mono", ui-monospace, monospace; }
.billing-charged { color: #f9bd35; }
.billing-refunded { color: #35dbab; }
.order-cancelled .timeline li { text-decoration: line-through; }
.result-link { display: inline-flex; align-items: center; min-height: 32px; margin-top: 10px; }
.timeline {
  display: flex;
  margin: 16px 0 0;
  padding: 8px 0 12px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #4b6082 #162036;
  list-style: none;
}
.timeline::-webkit-scrollbar { height: 6px; }
.timeline::-webkit-scrollbar-track { background: #162036; border-radius: 999px; }
.timeline::-webkit-scrollbar-thumb { background: #4b6082; border-radius: 999px; }
.timeline::-webkit-scrollbar-thumb:hover { background: #6681ad; }
.timeline li { position: relative; flex: 1 0 78px; padding: 21px 6px 4px; text-align: center; color: var(--subtle); font-size: 11px; line-height: 1.35; white-space: nowrap; }
.timeline li::before, .timeline li::after { content: ""; position: absolute; top: 5px; background: #31425d; }
.timeline li::before { z-index: 1; width: 9px; height: 9px; border-radius: 50%; left: calc(50% - 4px); }
.timeline li::after { top: 9px; left: 50%; width: 100%; height: 1px; }
.timeline li:last-child::after { display: none; }
.timeline li[data-state="done"]::before, .timeline li[data-state="done"]::after { background: #bdcce3; }
.timeline li[data-state="active"] { color: #c4eeff; }
.timeline li[data-state="active"]::before { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.timeline li:is([data-state="failed"], [data-state="error"]) { color: #ff8299; }
.timeline li:is([data-state="failed"], [data-state="error"])::before { background: #ff8299; }
#pagination { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.site-footer { padding: 32px 0; border-top: 1px solid var(--border); text-align: center; color: var(--subtle); font-size: 12px; }
dialog { width: min(calc(100% - 32px), 512px); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 24px; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 20px 80px #0009; scrollbar-width: thin; scrollbar-color: #4b6082 #162036; }
dialog::backdrop { background: #020408a6; }
dialog p { color: var(--muted); margin-top: 12px; line-height: 1.55; }
dialog form > .actions { justify-content: flex-end; margin-top: 18px; }
#source-card, #new-card { width: 100%; margin-top: 8px; }
#redeem-field { margin-top: 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.refresh-icon { display: inline-block; }
.refresh-icon.spinning { animation: spin .75s linear infinite; }
.help-dialog, .quota-dialog, .redeem-dialog { padding: 0; }
.quota-dialog { width: min(calc(100% - 32px), 440px); }
.quota-dialog h2, .redeem-dialog h2 { display: flex; align-items: center; gap: 10px; }
.redeem-body { padding: 20px 24px; display: grid; gap: 16px; }
.redeem-body p { margin-top: 0; font-size: 13px; }
.redeem-body strong { color: var(--text); font-weight: 700; }
.redeem-balance-box { padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--inset); display: grid; gap: 6px; }
.redeem-balance-value { font-family: "IBM Plex Mono", ui-monospace, monospace; color: var(--muted); }
.redeem-balance-value strong { color: var(--cyan); font-size: 22px; }
#redeem-field { margin-top: 0; }
.redeem-field-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.redeem-field-head label { font-size: 13px; font-weight: 700; }
.redeem-count { color: var(--subtle); font-size: 12px; }
.redeem-textarea { min-height: 126px; margin-top: 10px; }
.warn-icon {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #302a22;
  border: 1px solid #574525;
  color: #f9bd35;
  font-size: 13px;
  font-weight: 800;
}
.quota-dialog-body { padding: 20px 24px; }
.quota-dialog-body p { margin-top: 0; }
.quota-dialog-footer { justify-content: flex-end; gap: 10px; }
.help-header, .help-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; }
.help-header { border-bottom: 1px solid var(--divider); }
.help-footer { border-top: 1px solid var(--divider); color: var(--muted); font-size: 12px; }
.help-steps { display: grid; gap: 14px; padding: 20px 24px; margin: 0; list-style: none; counter-reset: steps; }
.help-steps li { display: grid; grid-template-columns: 24px 1fr; align-items: start; gap: 12px; counter-increment: steps; font-size: 13px; line-height: 1.7; }
.help-steps li::before { display: grid; place-items: center; content: counter(steps); height: 23px; border-radius: 50%; color: var(--cyan); background: #102a3d; }
.help-steps span { color: var(--muted); }
.help-steps code { padding: 2px 6px; border-radius: 6px; background: var(--inset); color: var(--text); font: 11px/1.65 "IBM Plex Mono", ui-monospace, monospace; overflow-wrap: anywhere; box-decoration-break: clone; }
.help-actions { display: flex; align-items: center; gap: 8px; }
.help-actions .secondary { min-height: 40px; }
.guide { max-width: 760px; }
.guide article { padding: clamp(20px, 5vw, 40px); }
.guide h1 { font-size: 25px; margin-bottom: 24px; }
.guide section + section { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--divider); }
.guide p { margin-top: 8px; color: var(--muted); line-height: 1.7; }
@media (max-width: 780px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 590px) {
  .wrap { width: calc(100% - 24px); }
  .header-inner { flex-wrap: wrap; min-height: 58px; padding-block: 10px; gap: 10px; }
  .header-actions { gap: 6px; }
  .header-actions .secondary { min-height: 32px; padding: 5px 10px; font-size: 12px; border-radius: 11px; }
  .service-state { padding: 5px 10px; font-size: 11px; }
  .brand { font-size: 16px; }
  .mark { width: 32px; height: 32px; font-size: 15px; }
  main { padding-block: 20px 56px; }
  #lookup, .start-content, .start-header { padding: 16px; }
  .form-row { flex-wrap: wrap; gap: 8px; }
  .form-row .input-with-icon { flex: 1 1 200px; }
  .form-row button { flex-shrink: 0; }
  input:not([type="checkbox"]), #card, #source-card, #new-card, #search input, .accounts-textarea { font-size: 16px; }
  .primary, .secondary { padding-inline: 12px; }
  .card-summary { grid-template-columns: minmax(0, 1fr); }
  .card-caption, .summary-controls { padding: 14px 16px; }
  .card-caption { border-right: 0; border-bottom: 1px solid var(--divider); }
  .summary-controls { flex-wrap: wrap; gap: 12px; }
  .summary-controls .actions { gap: 4px; margin-left: auto; }
  .summary-controls .text-button { min-height: 34px; padding: 6px 8px; }
  #card-notices > :not([hidden]) { margin-inline: 16px; }
  #remaining { font-size: 25px; }
  .accounts-textarea { min-height: 150px; }
  .section-head .actions { width: 100%; justify-content: space-between; }
  #search { flex: 1; min-width: 0; }
  #search input { width: 100%; height: 36px; }
  .service-option { flex-wrap: wrap; gap: 10px; }
  .price { flex-shrink: 0; }
  .order-card { padding: 15px 14px; }
  dialog { padding: 18px; }
  .help-header, .help-footer { padding: 14px 16px; }
  .help-steps { padding: 16px; gap: 12px; }
}
@media (max-width: 420px) {
  .form-row .input-with-icon { flex-basis: 100%; }
  .form-row .primary { flex: 1; }
  .help-footer, #pagination { flex-wrap: wrap; gap: 8px; }
  .help-actions { margin-left: auto; }
}
