:root {
  --primary: #3675eb;
  --primary-strong: #2462d4;
  --primary-soft: #edf3ff;
  --purple-soft: #f5f0ff;
  --page: #fafbff;
  --surface: #ffffff;
  --surface-muted: #f7f8fc;
  --text: #1e2536;
  --muted: #7a8499;
  --line: #e5e8f2;
  --success: #16875b;
  --success-soft: #eaf8f2;
  --warning: #c87416;
  --warning-soft: #fff6e9;
  --danger: #c83c4b;
  --danger-soft: #fff0f2;
  --shadow-dark: #d8dde4;
  --shadow-light: #ffffff;
  --raised: 7px 7px 14px var(--shadow-dark), -7px -7px 14px var(--shadow-light);
  --raised-sm: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
  --pressed: inset 5px 5px 10px var(--shadow-dark), inset -5px -5px 10px var(--shadow-light);
  --pressed-sm: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
  --shadow: var(--raised);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--page); }
body {
  min-height: 100%;
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}
button, input, textarea { font: inherit; letter-spacing: 0; }
button { -webkit-tap-highlight-color: transparent; }
svg { display: block; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 70px;
  border-bottom: 1px solid rgba(226, 230, 240, 0.9);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 13px rgba(29, 36, 64, 0.07);
}
.topbar-inner {
  width: min(1180px, calc(100% - 36px));
  height: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: default;
}
.brand img {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  object-fit: contain;
  box-shadow: 0 5px 14px rgba(83, 92, 190, 0.22);
}
.brand-copy { display: grid; min-width: 0; gap: 2px; }
.brand-copy small { color: #707b91; font-size: 10px; font-weight: 800; }
.brand-copy strong { overflow: hidden; font-size: 17px; white-space: nowrap; text-overflow: ellipsis; }
.top-query {
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 15px;
  border: 0;
  border-radius: 11px;
  background: var(--page);
  color: var(--text);
  box-shadow: var(--raised-sm);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}
.top-query svg { width: 18px; height: 18px; }
.top-tutorial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  gap: 9px;
  height: 42px;
  padding: 0 22px;
  border: 1px solid var(--primary-strong);
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(54, 117, 235, .23);
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}
.top-tutorial:hover { background: var(--primary-strong); }
.top-tutorial svg { width: 21px; height: 21px; }
.top-tutorial:focus-visible, .tutorial-head button:focus-visible, .tutorial-play:focus-visible { outline: 3px solid #efb432; outline-offset: 3px; }
html.tutorial-open { overflow: hidden; }
.tutorial-dialog {
  width: min(1120px, calc(100vw - 32px), calc(160dvh - 160px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .32);
}
.tutorial-dialog::backdrop { background: rgba(12, 18, 30, .76); }
.tutorial-dialog[open] { display: block; }
.tutorial-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; padding: 0 18px; }
.tutorial-head h2 { margin: 0; font-size: 17px; font-weight: 800; }
.tutorial-head button { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; padding: 0; border: 0; border-radius: 6px; color: #647084; background: #f0f3f8; cursor: pointer; }
.tutorial-head button:hover { color: var(--danger); background: var(--danger-soft); }
.tutorial-head button svg { width: 20px; height: 20px; }
.tutorial-player { position: relative; width: 100%; aspect-ratio: 8 / 5; background: #111; }
.tutorial-player video { display: block; width: 100%; height: 100%; object-fit: contain; }
.tutorial-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 14px; background: rgba(10, 16, 28, .42); }
.tutorial-overlay[hidden], .tutorial-overlay p[hidden] { display: none; }
.tutorial-play { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-width: 164px; min-height: 58px; padding: 0 24px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 8px; background: var(--primary); color: #fff; box-shadow: 0 6px 25px rgba(0, 0, 0, .25); font-size: 18px; font-weight: 800; cursor: pointer; }
.tutorial-play:hover { background: var(--primary-strong); }
.tutorial-play:disabled { cursor: wait; opacity: .85; }
.tutorial-play svg { width: 23px; height: 23px; fill: currentColor; stroke-width: 1; }
.tutorial-overlay p { margin: 0; color: #fff; font-size: 13px; text-align: center; overflow-wrap: anywhere; }

.app-shell {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 28px 0 54px;
}
.stepper {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(620px, 100%);
  margin: 0 auto 52px;
}
.stepper.hidden { display: none; }
.stepper-line {
  position: absolute;
  top: 16px;
  left: 12.5%;
  right: 12.5%;
  height: 1px;
  background: #dfe3ef;
}
.flow-step {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 9px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: #949caf;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.flow-step:disabled { cursor: default; opacity: 1; }
.step-dot {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--page);
  box-shadow: var(--raised-sm);
  font-size: 11px;
  font-weight: 900;
}
.flow-step.active { color: var(--text); }
.flow-step.active .step-dot { background: var(--page); color: var(--primary); box-shadow: var(--pressed-sm); }
.flow-step.done .step-dot { background: var(--primary); color: #fff; box-shadow: var(--raised-sm); }

.flow-view { display: none; animation: enter 0.2s ease both; }
.flow-view.active { display: block; }
@keyframes enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

.page-heading {
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 18px;
}
.page-heading h1, .tool-heading h1 { margin: 9px 0 4px; font-size: 31px; line-height: 1.18; }
.token-heading-note { color: #53667e; font-size: 17px; font-weight: 720; white-space: nowrap; vertical-align: middle; }
.page-heading p, .tool-heading p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.step-tag {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 10px;
  border-radius: 9px;
  background: var(--page);
  color: var(--primary-strong);
  box-shadow: var(--pressed-sm);
  font-size: 12px;
  font-weight: 900;
}
.heading-symbol {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border: 0;
  border-radius: 50%;
  background: var(--page);
  color: var(--primary);
  box-shadow: var(--shadow);
}
.heading-symbol svg { width: 27px; height: 27px; }
.heading-step-number { color: #3977e8; font-size: 22px; font-weight: 900; }

.stage-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(320px, 1fr);
  gap: 28px;
  align-items: center;
}
.stage-card {
  min-width: 0;
  padding: 26px;
  border: 0;
  border-radius: 16px;
  background: var(--page);
  box-shadow: var(--raised);
}
.stage-card label { display: block; margin-bottom: 9px; color: var(--text); font-size: 14px; font-weight: 850; }
.field-action { position: relative; }
.field-action input, .stage-card > input, .tool-form textarea, .narrow-tool textarea, .session-entry textarea, .dialog-input, .admin-import textarea {
  width: 100%;
  border: 0;
  border-radius: 11px;
  background: var(--page);
  color: var(--text);
  outline: none;
  box-shadow: var(--pressed-sm);
  transition: border-color 0.16s, box-shadow 0.16s;
}
.field-action input, .stage-card > input, .dialog-input { height: 58px; padding: 0 17px; font-size: 16px; }
.stage-card > input, .dialog-input { padding-right: 17px; }
textarea { resize: vertical; }
.tool-form textarea, .narrow-tool textarea, .session-entry textarea, .admin-import textarea { min-height: 132px; padding: 13px 14px; line-height: 1.55; }
.field-action input:focus, .stage-card > input:focus, textarea:focus, .dialog-input:focus { border: 0; background: var(--page); box-shadow: var(--pressed), 0 0 0 2px rgba(53, 110, 232, 0.16); }
.plan-reveal {
  display: grid;
  align-content: center;
  gap: 5px;
  min-height: 106px;
  margin-top: 16px;
  padding: 18px 20px;
  border: 2px solid #edf0f7;
  border-radius: 12px;
  background: #fff;
  box-shadow: inset 0 2px 9px rgba(42, 61, 104, 0.07), 0 5px 15px rgba(40, 47, 83, 0.04);
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}
.plan-reveal.ready, .plan-reveal.loading {
  border-color: #dbe7fb;
  background: #fff;
  box-shadow: inset 0 2px 10px rgba(43, 92, 163, 0.09), 0 5px 15px rgba(40, 47, 83, 0.04);
}
.plan-reveal span { color: #707d91; font-size: 13px; font-weight: 750; }
.plan-reveal strong { font-size: 19px; line-height: 1.25; }
.plan-reveal.ready strong { color: #3279dd; font-size: 24px; }
.plan-reveal.loading strong { display: flex; align-items: center; gap: 9px; color: #3279dd; }
.plan-reveal.loading strong::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 2px solid #d6e5fb;
  border-top-color: #3279dd;
  border-radius: 50%;
  animation: verify-spin 0.72s linear infinite;
}
.plan-reveal small { color: #778398; font-size: 13px; }
@keyframes verify-spin { to { transform: rotate(360deg); } }
.privacy-note { display: flex; align-items: flex-start; gap: 9px; margin: 20px 2px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.privacy-note svg { width: 17px; height: 17px; flex: 0 0 17px; margin-top: 1px; color: var(--primary); }
.primary-button, .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 850;
  cursor: pointer;
}
.primary-button { background: var(--primary); color: #fff; box-shadow: 4px 4px 9px #c4c9d3, -4px -4px 9px #fff; transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease; }
.primary-button:hover { background: var(--primary-strong); transform: translateY(-1px); box-shadow: 5px 5px 11px #bec4cf, -5px -5px 11px #fff; }
.primary-button:active { transform: translateY(0); box-shadow: inset 3px 3px 6px rgba(42, 51, 139, 0.34), inset -3px -3px 6px rgba(255, 255, 255, 0.18); }
.primary-button:disabled { background: #f5f6fa; color: #c5cad5; box-shadow: inset 0 2px 7px rgba(34, 42, 69, 0.06); cursor: not-allowed; }
.secondary-button { border: 0; background: var(--page); color: #3f4960; box-shadow: var(--raised-sm); transition: transform 0.16s ease, box-shadow 0.16s ease; }
.secondary-button:hover { border: 0; background: var(--page); transform: translateY(-1px); box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light); }
.secondary-button:active { transform: translateY(0); box-shadow: var(--pressed-sm); }
.primary-button.is-busy::before, .secondary-button.is-busy::before {
  content: "";
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: verify-spin 0.72s linear infinite;
}
.secondary-button.is-busy::before { border-color: #dce2ed; border-top-color: currentColor; }
.wide-button { width: 100%; }
.button-arrow { font-size: 18px; }
.inline-error { display: none; margin: -7px 0 13px; color: var(--danger); font-size: 13px; line-height: 1.5; }
.inline-error.show { display: block; }

.tool-rail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tool-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 105px;
  padding: 15px;
  border: 1px solid #d9defc;
  border-radius: 8px;
  background: #fafbff;
  color: #334064;
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s, border-color 0.16s, box-shadow 0.16s;
}
.tool-card:hover { transform: translateY(-2px); border-color: #aeb7fa; box-shadow: 0 8px 20px rgba(69, 80, 160, 0.1); }
.tool-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); }
.tool-icon svg { width: 23px; height: 23px; }
.tool-card > span:nth-child(2) { display: grid; gap: 5px; }
.tool-card strong { font-size: 14px; }
.tool-card small { color: #8590a7; font-size: 11px; }
.tool-card b { color: var(--primary); font-size: 18px; }

.single-stage { width: min(900px, 100%); margin: 0 auto; }
.token-layout { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: 24px; align-items: stretch; }
.token-guide-card, .token-entry-card { min-height: 445px; padding: 28px 30px; }
.guide-step { display: grid; grid-template-columns: 50px minmax(0, 1fr) auto; align-items: start; gap: 16px; padding: 20px 4px; border-bottom: 1px solid var(--line); }
.guide-step:first-child { padding-top: 0; }
.guide-step > b { color: #3977e8; font: 850 12px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; }
.guide-step h2 { margin: 0 0 6px; font-size: 17px; }
.guide-step p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.guide-step p.guide-step-emphasis { color: #e8670b; font-weight: 750; }
.token-example-preview { position: relative; display: block; width: min(100%, 440px); margin-top: 13px; padding: 0; overflow: hidden; border: 1px solid #f0aa72; border-radius: 7px; background: #fff7ef; box-shadow: 0 6px 16px rgba(178, 82, 12, 0.09); cursor: zoom-in; }
.token-example-preview img { display: block; width: 100%; height: auto; transition: transform .18s ease, filter .18s ease; }
.token-example-preview > span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 7px; color: #fff; background: rgba(120, 49, 4, 0.68); font-size: 13px; font-weight: 750; opacity: 0; transition: opacity .18s ease; }
.token-example-preview > span svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.token-example-preview:hover img, .token-example-preview:focus-visible img { transform: scale(1.015); filter: saturate(.8); }
.token-example-preview:hover > span, .token-example-preview:focus-visible > span { opacity: 1; }
.token-example-preview:focus-visible { outline: 3px solid rgba(232, 103, 11, .22); outline-offset: 2px; }
.token-example-dialog { width: min(1180px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); margin: auto; padding: 0; overflow: hidden; border: 0; border-radius: 8px; background: #fff; box-shadow: 0 30px 90px rgba(14, 20, 34, .32); }
.token-example-dialog::backdrop { background: rgba(12, 18, 30, .76); backdrop-filter: blur(3px); }
.token-example-dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.token-example-dialog__head > div { min-width: 0; display: grid; gap: 2px; }
.token-example-dialog__head strong { color: var(--ink); font-size: 15px; }
.token-example-dialog__head small { color: var(--muted); font-size: 11px; }
.token-example-dialog__head button { width: 34px; height: 34px; flex: 0 0 34px; padding: 0; border: 0; border-radius: 50%; color: #596675; background: #f0f3f6; font-size: 23px; line-height: 1; cursor: pointer; }
.token-example-dialog__head button:hover { color: #b54800; background: #fff0e5; }
.token-example-dialog > img { display: block; width: 100%; max-height: calc(100dvh - 98px); object-fit: contain; background: #f6f7f9; }
.guide-step-action { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 92px; min-height: 38px; padding: 0 13px; border: 1px solid #cbd9f6; border-radius: 8px; background: #f4f8ff; color: #316ddc; box-shadow: 0 5px 12px rgba(57, 119, 232, 0.1); font-size: 13px; font-weight: 850; white-space: nowrap; cursor: pointer; transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease; }
.guide-step-action svg { width: 16px; height: 16px; }
.guide-step-action:hover { transform: translateY(-1px); border-color: #92b1ef; background: #edf4ff; box-shadow: 0 8px 16px rgba(57, 119, 232, 0.15); }
.guide-step-action:active { transform: translateY(0); box-shadow: none; }
.mini-label { color: var(--primary); font-size: 12px; font-weight: 900; }
.instruction-copy h2, .progress-head h2, .result-panel h2 { margin: 8px 0; font-size: 21px; }
.instruction-copy p, .progress-head p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.session-link { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; background: #f5f8ff; box-shadow: inset 0 2px 6px rgba(46, 76, 132, 0.06); }
.session-link code { min-width: 0; overflow: hidden; color: #566178; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.session-link button, .text-button { margin-left: auto; padding: 0; border: 0; background: transparent; color: var(--primary); font-weight: 850; cursor: pointer; }
.session-link button { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; border-radius: 7px; background: #edf3ff; }
.session-link button svg { width: 18px; height: 18px; }
.token-tip { display: flex; align-items: center; gap: 9px; margin-top: 18px; padding: 11px 13px; border: 1px solid #e5e9f3; border-radius: 9px; background: #fbfcff; color: #7c879c; font-size: 12px; line-height: 1.55; box-shadow: inset 0 2px 7px rgba(44, 60, 96, 0.05); }
.token-tip svg { width: 18px; height: 18px; flex: 0 0 18px; color: #3977e8; }
.token-entry-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.token-entry-head label { margin: 0; color: #53617b; font-size: 15px; }
.token-open-button { min-height: 44px; background: #3977e8; box-shadow: 0 8px 16px rgba(57, 119, 232, 0.23); }
.token-open-button svg, .token-actions button svg { width: 18px; height: 18px; }
.token-entry-help, .token-privacy { margin: 10px 0; color: #8190aa; font-size: 12px; line-height: 1.6; }
.token-entry-card > textarea { width: 100%; min-height: 190px; padding: 15px 16px; resize: vertical; border: 1px solid #dce2ed; border-radius: 9px; background: #fff; color: var(--text); outline: none; box-shadow: inset 0 3px 10px rgba(36, 52, 86, 0.09); font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
.token-entry-card > textarea:focus { border-color: #9db8f2; box-shadow: 0 0 0 4px rgba(57, 119, 232, 0.1), inset 0 3px 10px rgba(36, 52, 86, 0.07); }
.token-actions { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.15fr); gap: 12px; margin-top: 14px; }
.token-actions button { min-width: 0; }
.token-actions .primary-button { grid-column: 1 / -1; grid-row: 1; min-height: 50px; }
.token-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.token-actions button:disabled { background: #f7f8fb; color: #c4cad5; border-color: #f0f1f5; box-shadow: none; cursor: not-allowed; }
.clear-button { border: 1px solid #efcdd1; background: #fff6f7; color: #b85d67; box-shadow: 0 4px 10px rgba(184, 93, 103, 0.08); }
.clear-button:hover { border-color: #e5b5bb; background: #fdeff1; color: #a94f5a; box-shadow: 0 6px 13px rgba(184, 93, 103, 0.12); }
.clear-button:active { background: #fbe9ec; box-shadow: inset 0 2px 5px rgba(169, 79, 90, 0.08); }
button.clear-button:disabled { border-color: #eadcdf; background: #faf7f8; color: #c8a9ad; box-shadow: none; }
.text-button.clear-button { min-height: 30px; padding: 0 10px; border-radius: 7px; }
.token-status-panel { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 68px; margin: 14px 0 0; padding: 11px 13px; border: 1px solid #edf0f5; border-radius: 9px; background: #fbfcff; }
.token-status-panel > div { display: grid; gap: 4px; min-width: 0; }
.token-status-panel strong { color: #48566f; font-size: 12px; }
.token-status-panel b { color: #8490a6; font-size: 11px; font-weight: 500; line-height: 1.5; }
.token-status-panel i { color: #8faef1; font-size: 12px; font-style: normal; font-weight: 800; }
.status-line { display: flex; align-items: center; gap: 8px; min-height: 36px; margin: 10px 0; color: var(--muted); font-size: 12px; }
.status-line span { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #aeb5c4; }
.status-line.ok { color: var(--success); }.status-line.ok span { background: var(--success); }
.status-line.error { color: var(--danger); }.status-line.error span { background: var(--danger); }
.status-line.working { color: var(--warning); }.status-line.working span { background: var(--warning); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }
.back-button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; margin-top: 30px; padding: 0 18px; border: 0; border-radius: 11px; background: var(--page); color: #3f4960; box-shadow: var(--raised-sm); font-size: 15px; font-weight: 850; cursor: pointer; transition: transform 0.16s ease, box-shadow 0.16s ease; }
.back-button:hover { transform: translateY(-1px); box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light); }
.back-button:active { transform: translateY(0); box-shadow: var(--pressed-sm); }

.account-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.account-head > div { display: grid; gap: 5px; min-width: 0; }
.account-head small { color: var(--muted); font-size: 12px; }
.account-head strong { overflow-wrap: anywhere; font-size: 21px; }
.account-head span { color: var(--muted); font-size: 13px; }
.account-badge { flex: 0 0 auto; padding: 6px 10px; border-radius: 999px; background: var(--success-soft); color: var(--success); font-size: 12px; }
.account-badge.bad { background: var(--danger-soft); color: var(--danger); }
.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin: 4px 0 18px; }
.account-grid > div { display: flex; justify-content: space-between; gap: 18px; padding: 14px 0; border-bottom: 1px solid #f0f2f7; }
.account-grid span { color: var(--muted); font-size: 13px; white-space: nowrap; }
.account-grid strong { min-width: 0; font-size: 13px; text-align: right; overflow-wrap: anywhere; }
.notice-box { display: none; margin-bottom: 14px; padding: 11px 12px; border-left: 4px solid var(--warning); border-radius: 8px; background: var(--warning-soft); color: #8a5418; font-size: 13px; line-height: 1.6; }
.notice-box.show { display: block; }
.progress-card { display: none; }
.progress-card.show { display: block; }
.recharge-progress-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.recharge-progress-layout > .stage-card { background: #fff; }
.progress-head { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.progress-head .mini-label { color: var(--muted); }
.progress-head b { color: var(--success); font-size: 64px; line-height: 1.15; }
.progress-head h2 { margin: 6px 0 0; color: #225f49; font-size: 21px; line-height: 1.45; }
.progress-head p { overflow-wrap: anywhere; }
.progress-card.failed .progress-head b, .progress-card.failed .progress-head h2 { color: var(--danger); }
.upgrade-details { transition: color .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease; }
.upgrade-details h2 { margin: 0 0 10px; font-size: 16px; color: #566477; }
.upgrade-details dl { margin: 0; }
.upgrade-details dl > div { padding: 16px 0; border-bottom: 1px solid var(--line); }
.upgrade-details dt { margin-bottom: 7px; color: var(--muted); font-size: 13px; }
.upgrade-details dd { margin: 0; font-size: 17px; font-weight: 750; line-height: 1.5; overflow-wrap: anywhere; }
.upgrade-details.success { border: 1px solid #b9e1cf; background: #f1faf6; box-shadow: 7px 7px 14px #d2dfd9, -7px -7px 14px #fff; }
.upgrade-details.success h2 { color: #126b49; }
.upgrade-details.success dl > div { border-color: #d4ebe1; }
.upgrade-details.success dt { color: #628276; }
.upgrade-details.success dd { color: #174d3a; }
.upgrade-details.success #detailStatus { width: fit-content; border-radius: 7px; padding: 5px 10px; color: #0f8557; background: #dff4e9; font-size: 20px; }
.upgrade-details.success .recharge-safety { color: #17684b; background: #e2f4eb; box-shadow: inset 3px 3px 6px #cde3d8, inset -3px -3px 6px #f7fffb; }
.recharge-safety { margin: 20px 0 0; padding: 14px; border-radius: 10px; background: #f7f9fc; color: #66758b; box-shadow: var(--pressed-sm); font-size: 13px; line-height: 1.75; }
.progress-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 28px; }
.progress-footer .back-button { margin-top: 0; }
.retry-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
[hidden] { display: none !important; }
.recharge-error.show { margin: 16px 0 0; padding: 13px 15px; background: var(--danger-soft); border-left: 3px solid var(--danger); border-radius: 8px; overflow-wrap: anywhere; }
.recharge-confirm-dialog { width: min(580px, 100%); max-height: calc(100dvh - 36px); overflow-y: auto; }
.recharge-confirm-dialog .account-card { margin-top: 20px; }
.recharge-confirm-dialog .account-head strong { font-size: 19px; }
.recharge-confirm-dialog .account-grid { grid-template-columns: 1fr; }
.recharge-confirm-dialog .account-grid > div { padding: 11px 0; }
.force-recharge-option { margin-top: 16px; padding: 13px 14px; border: 1px solid #efd2a9; border-radius: 6px; background: var(--warning-soft); }
.force-recharge-option label { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0; color: var(--text); font-size: 14px; font-weight: 750; cursor: pointer; }
.force-recharge-option input { flex: 0 0 18px; width: 18px; height: 18px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.force-recharge-option small { color: var(--muted); font-size: 12px; font-weight: 500; }
.recharge-confirm-dialog .force-recharge-option p { margin: 8px 0 0; color: #a4510c; font-size: 13px; line-height: 1.65; }
.account-badge.needs-confirmation { color: #a4510c; background: var(--warning-soft); }
.secondary-button:disabled, .back-button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
button:focus-visible { outline: 3px solid #8bacf3; outline-offset: 3px; }
.progress-track { height: 8px; margin: 19px 0 23px; overflow: hidden; border-radius: 999px; background: #eaecf3; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: #2eaf80; transition: width 0.3s ease; }
.progress-card.done .progress-track span { background: var(--success); }
.progress-card.failed .progress-track span { background: var(--danger); }
.progress-track.indeterminate span { width: 35% !important; animation: recharge-progress 1.5s ease-in-out infinite alternate; }
@keyframes recharge-progress { from { transform: translateX(-100%); } to { transform: translateX(285%); } }
.progress-stages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.progress-stage { position: relative; display: grid; justify-items: center; gap: 5px; color: #9aa2b3; text-align: center; }
.progress-stage:not(:last-child)::after { content: ""; position: absolute; top: 8px; left: calc(50% + 10px); right: calc(-50% + 10px); height: 2px; background: #e6e9f1; }
.progress-stage i { position: relative; z-index: 1; width: 17px; height: 17px; border: 4px solid #dfe3ec; border-radius: 50%; background: #fff; }
.progress-stage strong { font-size: 12px; }
.progress-stage span { font-size: 10px; line-height: 1.35; }
.progress-stage.active { color: var(--warning); }.progress-stage.active i { border-color: var(--warning); box-shadow: 0 0 0 4px var(--warning-soft); }
.progress-stage.done { color: var(--success); }.progress-stage.done i { border-color: var(--success); background: var(--success); }.progress-stage.done:not(:last-child)::after { background: #9bd4be; }
.progress-stage.error { color: var(--danger); }.progress-stage.error i { border-color: var(--danger); background: var(--danger); }
.job-summary { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 20px; color: var(--muted); font-size: 11px; }
.job-summary strong { color: #445069; }
.job-timeline summary { color: #6d7b91; cursor: pointer; font-size: 12px; font-weight: 750; }
.job-timeline[open] .progress-stages { margin-top: 16px; }
.failure-info { display: none; grid-template-columns: 76px 1fr; gap: 7px 13px; margin-top: 15px; padding: 12px; border-left: 4px solid var(--danger); border-radius: 8px; background: var(--danger-soft); font-size: 12px; line-height: 1.5; }
.failure-info.show { display: grid; }.failure-info strong { color: var(--danger); }.failure-info span { overflow-wrap: anywhere; }

.tool-heading { margin: 0 0 28px; text-align: left; }
.subscription-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.subscription-heading h1 { margin: 9px 0 5px; font-size: 31px; }
.subscription-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.subscription-symbol { display: grid; place-items: center; width: 76px; height: 76px; flex: 0 0 76px; border: 0; border-radius: 18px; background: var(--page); color: #3977e8; box-shadow: var(--raised); }
.subscription-symbol svg { width: 38px; height: 38px; stroke-width: 1.9; }
.subscription-query-card { padding: 24px; border: 0; box-shadow: var(--raised); }
.subscription-query-card > label { color: #49618b; font-size: 14px; }
.subscription-input-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 20px; align-items: stretch; }
.subscription-input-row textarea { width: 100%; min-height: 120px; padding: 13px 15px; resize: vertical; border: 0; border-radius: 11px; background: var(--page); color: var(--text); outline: none; box-shadow: var(--pressed-sm); font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.subscription-input-row textarea:focus { border: 0; background: var(--page); box-shadow: var(--pressed), 0 0 0 2px rgba(53, 110, 232, 0.16); }
.subscription-query-actions { display: grid; grid-template-rows: 1fr 1fr; gap: 12px; }
.subscription-query-actions button { width: 100%; min-height: 52px; }
.subscription-query-actions svg { width: 18px; height: 18px; }
.subscription-message { display: none; margin-top: 12px; padding: 10px 12px; border-radius: 8px; font-size: 12px; line-height: 1.55; }
.subscription-message.show { display: block; background: #f2f6ff; color: #4868a2; }
.subscription-message.error { display: block; background: var(--danger-soft); color: var(--danger); }
.subscription-result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.subscription-result-grid article { display: grid; align-content: space-between; gap: 22px; min-width: 0; min-height: 105px; padding: 18px; border: 0; border-radius: 12px; background: var(--page); box-shadow: var(--raised-sm); }
.subscription-result-grid span { color: #778ba9; font-size: 13px; font-weight: 800; }
.subscription-result-grid strong { color: #304b76; font-size: 15px; overflow-wrap: anywhere; }
.page-heading-lookup { min-height: 92px; margin-bottom: 22px; }
.page-heading-lookup h1 { margin: 9px 0 4px; font-size: 31px; line-height: 1.18; }
.page-heading-lookup p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.lookup-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--primary);
  background: var(--page);
  box-shadow: var(--raised-sm);
}
.lookup-mark svg { width: 34px; height: 34px; stroke-width: 1.8; }
.lookup-layout { display: grid; grid-template-columns: minmax(280px, 0.86fr) minmax(0, 1.14fr); gap: 28px; align-items: stretch; min-height: 0; }
.batch-form, .batch-results {
  min-width: 0;
  padding: 22px;
  border: 0;
  border-radius: 16px;
  background: var(--page);
  box-shadow: var(--raised);
}
.batch-form label { display: block; margin-bottom: 10px; color: var(--text); font-size: 13px; font-weight: 800; }
.batch-form textarea, .single-query input {
  width: 100%;
  border: 0;
  border-radius: 11px;
  color: var(--text);
  background: var(--page);
  box-shadow: var(--pressed-sm);
  outline: none;
}
.batch-form textarea:focus, .single-query input:focus { border: 0; background: var(--page); box-shadow: var(--pressed), 0 0 0 2px rgba(89, 104, 232, 0.14); }
.batch-form textarea { display: block; min-height: 250px; padding: 16px 18px; resize: vertical; line-height: 1.7; }
.batch-form textarea::placeholder, .single-query input::placeholder { color: #9aabc5; opacity: 1; }
.batch-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; }
.batch-form-foot > span { color: #8798b2; font-size: 12px; }
.batch-form-foot .primary-button { min-height: 43px; margin: 0; }
.batch-form-foot svg { width: 18px; height: 18px; }
.batch-results { min-height: 350px; }
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid #e8eaed; }
.results-head > div { display: grid; gap: 5px; }
.summary-eyebrow { color: var(--muted); font-size: 12px; font-weight: 800; }
.results-head strong { color: var(--text); font-size: 14px; }
.results-head > svg { width: 24px; height: 24px; color: #738fc2; }
.empty-lookup { min-height: 275px; display: grid; place-content: center; justify-items: center; gap: 12px; color: #8fa0b9; text-align: center; }
.empty-lookup > svg { width: 30px; height: 30px; color: #96b0d8; }
.empty-lookup.loading > svg { animation: lookup-spin 0.85s linear infinite; }
@keyframes lookup-spin { to { transform: rotate(360deg); } }
.code-batch-result-list { display: grid; gap: 10px; max-height: 465px; overflow-y: auto; padding: 4px 2px 2px; }
.code-batch-result-row { display: grid; gap: 8px; padding: 13px 14px; border-radius: 10px; background: var(--page); box-shadow: var(--pressed-sm); }
.code-batch-result-head { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; }
.code-batch-result-value { min-width: 0; overflow: auto; color: var(--text); font-size: 12px; line-height: 1.45; white-space: nowrap; }
.result-icon { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; }
.result-icon svg { width: 14px; height: 14px; stroke-width: 2.3; }
.result-icon.available { background: var(--primary); }
.result-icon.used { background: #e8a14c; }
.result-icon.processing { background: #8797b4; }
.result-icon.invalid { background: #d96e7b; }
.result-status { justify-self: end; min-width: 54px; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; text-align: center; }
.result-status.available { color: var(--primary); background: var(--primary-soft); }
.result-status.used { color: #b87526; background: #fff3e3; }
.result-status.processing { color: #647590; background: #edf1f7; }
.result-status.invalid { color: #b75360; background: #fff0f2; }
.code-batch-copy { display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; color: var(--primary); background: var(--page); box-shadow: var(--raised-sm); cursor: pointer; transition: color .16s ease, transform .16s ease, box-shadow .16s ease; }
.code-batch-copy svg { width: 17px; height: 17px; }
.code-batch-copy:hover { color: var(--primary-strong); transform: translateY(-1px); }
.code-batch-copy:active { transform: translateY(0); box-shadow: var(--pressed-sm); }
.code-batch-result-plan { margin-left: 32px; color: var(--muted); font-size: 12px; }
.code-batch-result-meta { display: flex; flex-wrap: wrap; gap: 5px 14px; margin-left: 32px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.result-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 18px; padding: 16px 10px; border: 0; border-radius: 12px; background: var(--page); box-shadow: var(--pressed-sm); }
.result-summary div { display: grid; justify-items: center; gap: 4px; }
.result-summary strong { color: var(--primary-strong); font-size: 20px; }
.result-summary span { color: #8a9ab3; font-size: 10px; }
.lookup-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.lookup-back { min-height: 42px; }
.lookup-back svg { width: 18px; height: 18px; }
.single-query { display: flex; align-items: center; gap: 8px; }
.single-query input { width: min(250px, 46vw); min-height: 42px; padding: 0 13px; }
.text-action { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 0 7px; border: 0; background: transparent; color: var(--primary); font-weight: 800; cursor: pointer; }
.text-action svg { width: 18px; height: 18px; }
.text-action:disabled { color: #aebbe0; cursor: not-allowed; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.label-row label { margin: 0; }
.label-row span { color: var(--muted); font-size: 12px; }
.tool-form textarea { min-height: 250px; }
.tool-form .primary-button, .narrow-tool .primary-button { margin-top: 14px; }
.result-panel { min-height: 390px; }
.result-panel h2 { margin-top: 0; }
.empty-result { display: grid; place-items: center; min-height: 250px; color: #919aab; text-align: center; line-height: 1.8; }
.empty-result small { font-size: 12px; }
.result-list { display: grid; gap: 9px; }
.result-item { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-muted); }
.result-item-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.result-item-head strong { overflow-wrap: anywhere; font-size: 13px; }
.result-badge { padding: 4px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-strong); font-size: 11px; font-weight: 850; white-space: nowrap; }
.result-item p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.narrow-tool { width: min(720px, 100%); margin: 0 auto; }
.tool-result { min-height: 66px; margin-top: 15px; padding: 14px; border: 1px dashed #d9deea; border-radius: 8px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.tool-result:empty { display: none; }
.tool-result.success { border-style: solid; border-color: #c9eadc; background: var(--success-soft); color: var(--success); }
.tool-result.error { border-style: solid; border-color: #f0c7cd; background: var(--danger-soft); color: var(--danger); }
.detail-table { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.detail-cell { padding: 10px; border-radius: 8px; background: #fff; }
.detail-cell span { display: block; color: var(--muted); font-size: 11px; }.detail-cell strong { display: block; margin-top: 4px; color: var(--text); font-size: 13px; overflow-wrap: anywhere; }

.modal { display: none; position: fixed; inset: 0; z-index: 30; align-items: center; justify-content: center; padding: 18px; background: rgba(25, 31, 49, 0.48); }
.modal.show { display: flex; }
.dialog { width: min(430px, 100%); padding: 22px; border-radius: 8px; background: #fff; box-shadow: 0 25px 70px rgba(24, 29, 48, 0.26); }
.dialog-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 900; }
.dialog h2 { margin: 12px 0 7px; font-size: 21px; }
.dialog p { margin: 0; color: var(--muted); line-height: 1.65; overflow-wrap: anywhere; }
.dialog-input { margin-top: 14px; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; max-width: calc(100% - 32px); padding: 11px 15px; border-radius: 8px; background: #20283a; color: #fff; font-size: 13px; opacity: 0; transform: translate(-50%, 18px); transition: 0.2s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.admin-dialog { display: flex; flex-direction: column; width: min(840px, 100%); height: min(88vh, 760px); max-height: min(88vh, 760px); padding: 0; overflow: hidden; }
.admin-head { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.admin-head h2 { margin: 0; }
.close-button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: #f1f3f8; color: #4d5669; font-size: 22px; cursor: pointer; }
.admin-search-row { flex: 0 0 auto; padding: 12px 18px 8px; }
.admin-search { display: flex; align-items: center; gap: 9px; width: min(480px, 100%); height: 38px; padding: 0 10px; border: 1px solid #dce3ef; border-radius: 6px; background: #f8faff; color: var(--muted); }
.admin-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); background: #fff; }
.admin-search > svg { width: 17px; height: 17px; flex: 0 0 17px; }
.admin-search input { width: 100%; min-width: 0; height: 100%; padding: 0; border: 0; border-radius: 0; outline: 0; box-shadow: none; background: transparent; color: var(--text); font-size: 13px; }
.admin-search input::placeholder { color: var(--muted); }
.admin-search input::-webkit-search-cancel-button { display: none; }
.admin-search-clear { display: grid; place-items: center; width: 26px; height: 26px; flex: 0 0 26px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer; }
.admin-search-clear[hidden] { display: none; }
.admin-search-clear:hover { background: var(--primary-soft); color: var(--primary-strong); }
.admin-search-clear svg { width: 15px; height: 15px; }
.admin-tabs { display: flex; flex: 0 0 auto; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.admin-tabs button { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 7px; height: 42px; padding: 0 10px; border: 0; border-bottom: 2px solid transparent; background: #fff; color: var(--muted); font-size: 13px; font-weight: 800; white-space: nowrap; cursor: pointer; }
.admin-tabs button span { width: 36px; flex: 0 0 36px; padding: 2px 5px; overflow: hidden; border-radius: 4px; background: #f1f4f9; font-size: 11px; font-variant-numeric: tabular-nums; text-align: center; text-overflow: ellipsis; }
.admin-tabs button.active { border-bottom-color: var(--primary); color: var(--primary-strong); }
.admin-tabs button.active span { background: var(--primary-soft); }
.admin-tabs button:focus-visible, .admin-search-clear:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.admin-content { flex: 1 1 auto; min-height: 0; overflow: hidden; padding: 14px 18px 12px; }
.admin-pane { display: none; }.admin-pane.active { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.voucher-filters { display: grid; flex: 0 0 auto; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.voucher-filter { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; height: 40px; padding: 0 8px; border: 0; border-bottom: 2px solid transparent; border-radius: 5px; background: var(--voucher-tab-bg); color: var(--voucher-tab-ink); font-size: 13px; font-weight: 800; cursor: pointer; }
.voucher-filter[data-voucher-filter="plus"] { --voucher-tab-bg: #edf4ff; --voucher-tab-hover: #e0ecff; --voucher-tab-active: #d9e8ff; --voucher-tab-count: #ddeafe; --voucher-tab-count-active: #c4dcff; --voucher-tab-ink: #215ba8; --voucher-tab-accent: #287ae0; }
.voucher-filter[data-voucher-filter="pro5"] { --voucher-tab-bg: #f4edff; --voucher-tab-hover: #ebe0fc; --voucher-tab-active: #e6d7fa; --voucher-tab-count: #e9dcfb; --voucher-tab-count-active: #d6bdee; --voucher-tab-ink: #65399a; --voucher-tab-accent: #8554bd; }
.voucher-filter[data-voucher-filter="pro20"] { --voucher-tab-bg: #fff3e6; --voucher-tab-hover: #ffe9d0; --voucher-tab-active: #ffe1bb; --voucher-tab-count: #ffead0; --voucher-tab-count-active: #ffd39d; --voucher-tab-ink: #91500d; --voucher-tab-accent: #b96914; }
.voucher-filter:hover { background: var(--voucher-tab-hover); }
.voucher-filter.active { border-bottom-color: var(--voucher-tab-accent); background: var(--voucher-tab-active); }
.voucher-filter:focus-visible { outline: 2px solid var(--voucher-tab-accent); outline-offset: -3px; }
.voucher-filter-count { min-width: 24px; padding: 2px 5px; border-radius: 4px; background: var(--voucher-tab-count); color: inherit; font-size: 11px; font-variant-numeric: tabular-nums; text-align: center; }
.voucher-filter.active .voucher-filter-count { background: var(--voucher-tab-count-active); }
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; color: var(--muted); font-size: 13px; }
.history-filters { display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.history-filter { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 0 10px; border: 1px solid transparent; border-radius: 6px; background: #f3f6fb; color: #64718a; font-size: 12px; font-weight: 750; cursor: pointer; }
.history-filter:hover { background: var(--primary-soft); color: var(--primary-strong); }
.history-filter.active { border-color: #c6d9ff; background: var(--primary-soft); color: var(--primary-strong); }
.history-filter:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.history-filter-count { min-width: 20px; color: inherit; font-size: 11px; font-variant-numeric: tabular-nums; text-align: center; }
.small { min-height: 34px; padding: 0 12px; font-size: 12px; }
.admin-import { display: none; padding: 10px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-muted); }
.admin-import.show { display: block; }.admin-import textarea { min-height: 90px; }
.admin-import > div { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.admin-list { display: grid; min-height: 0; flex: 1 1 auto; grid-auto-rows: max-content; align-content: start; gap: 8px; overflow-y: auto; padding-right: 4px; scrollbar-gutter: stable; }
.admin-pagination { display: flex; min-height: 46px; flex: 0 0 46px; align-items: flex-end; justify-content: flex-end; padding-top: 10px; --el-color-primary: var(--primary); --el-text-color-primary: var(--text); --el-text-color-regular: var(--muted); --el-border-color: var(--line); --el-fill-color: #f3f6fb; }
.admin-pagination:empty { display: none; }
.admin-pagination .el-pagination { justify-content: flex-end; width: 100%; font-family: inherit; }
.admin-pagination .el-pagination.is-background .btn-next,
.admin-pagination .el-pagination.is-background .btn-prev,
.admin-pagination .el-pagination.is-background .el-pager li { border: 1px solid transparent; border-radius: 6px; font-weight: 750; }
.admin-pagination .el-pagination.is-background .el-pager li.is-active { border-color: var(--primary); box-shadow: 0 3px 10px rgba(32, 112, 231, 0.18); }
.admin-pagination .el-pagination__total,
.admin-pagination .el-pagination__jump { color: var(--muted); }
.admin-pagination .el-pagination__editor.el-input { width: 48px; }
.admin-pagination .el-pagination__sizes .el-select { width: 112px; }
.voucher-row, .history-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fcfcff; }
.history-row.plan-plus { border-color: #d6e4f7; background: #f7faff; }
.history-row.plan-pro5 { border-color: #ddd4f4; background: #faf8ff; }
.history-row.plan-pro20 { border-color: #ecd9aa; background: #fffaf0; }
.voucher-info, .history-info { min-width: 0; }
.voucher-info { flex: 1 1 auto; }
.voucher-code, .history-email { font-size: 14px; font-weight: 850; overflow-wrap: anywhere; }
.history-contact { margin-top: 4px; color: #667085; font-size: 12px; overflow-wrap: anywhere; }
.voucher-time, .history-time { margin-top: 4px; color: #9aa2b3; font-size: 11px; }
.history-card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 8px; margin-top: 6px; }
.history-code-label { color: #7b8497; font-size: 11px; font-weight: 750; }
.history-code { min-width: 0; color: #39445a; font-size: 12px; font-weight: 800; overflow-wrap: anywhere; word-break: break-all; }
.history-plan { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 7px; border: 1px solid #cad9ef; border-radius: 999px; background: #eaf2ff; color: #245f9e; font-size: 10px; font-weight: 850; }
.history-plan.pro5 { border-color: #d5c6f2; background: #f0eaff; color: #6942a6; }
.history-plan.pro20 { border-color: #e6c987; background: #fff0c9; color: #8a5b00; }
.history-order { margin-top: 4px; color: #4c6386; font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.history-reason { margin-top: 4px; color: var(--danger); font-size: 12px; overflow-wrap: anywhere; }
.source-tag { display: inline-flex; margin-left: 6px; padding: 2px 6px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.source-tag.sold-unused { background: #e5f7ec; color: #087443; }
.source-tag.sold-used { background: #fff0df; color: #a84a00; }
.source-tag.sold-manual { background: #e5f7ec; color: #087443; }
.source-tag.used { background: #fff0df; color: #a84a00; }
.source-tag.invalid { background: #fff0f1; color: #b4232d; }
.voucher-actions, .history-actions { display: flex; flex: 0 0 auto; gap: 7px; }
.admin-action { min-height: 34px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #49546a; font-size: 12px; font-weight: 800; cursor: pointer; }
.admin-action.primary { border-color: var(--primary); background: var(--primary); color: #fff; }
.admin-action.danger { width: 34px; padding: 0; border-color: #f0c5ca; background: var(--danger-soft); color: var(--danger); font-size: 19px; }
.voucher-actions { align-items: center; }
.voucher-actions .admin-action { display: inline-flex; align-items: center; justify-content: center; height: 34px; line-height: 1; }
.voucher-actions .admin-action[data-admin-action="mark"] { border-color: #b9dfcd; background: #eaf8f0; color: #1a714f; }
.voucher-actions .admin-action[data-admin-action="mark"]:hover { border-color: #93cbae; background: #d7f0e2; color: #145e42; }
.voucher-actions .admin-action[data-admin-action="mark"]:focus-visible { outline: 2px solid #23805d; outline-offset: 2px; }
.admin-action.voucher-copy { width: 34px; min-width: 34px; height: 34px; flex: 0 0 34px; padding: 0; border-color: #dac9f0; background: #f5efff; color: #7645ac; }
.admin-action.voucher-copy:hover { border-color: #b996df; background: #eadefb; color: #643495; }
.admin-action.voucher-copy:focus-visible { outline: 2px solid #8554bd; outline-offset: 2px; }
.voucher-copy svg { width: 16px; height: 16px; }
.empty-admin { padding: 32px 10px; color: #9aa2b3; text-align: center; font-size: 13px; }

html.manager-embedded, .manager-embedded body { height: 100%; margin: 0; overflow: hidden; background: #fff; }
.manager-embedded .topbar, .manager-embedded .app-shell,
.manager-embedded body > .modal:not(#adminModal), .manager-embedded body > dialog { display: none !important; }
.manager-embedded #adminModal { display: flex; position: static; height: 100%; padding: 0; background: transparent; }
.manager-embedded .admin-dialog { display: flex; flex-direction: column; width: 100%; height: 100%; max-height: none; border-radius: 0; box-shadow: none; }
.manager-embedded .admin-head { min-height: 64px; flex: 0 0 auto; }
.manager-embedded #closeAdminModal { visibility: hidden; }
.manager-embedded .admin-tabs { flex: 0 0 auto; }
.manager-embedded .admin-content { height: auto; min-height: 0; flex: 1; }
.manager-embedded .admin-import { max-height: 40%; flex: 0 0 auto; overflow-y: auto; }

@media (max-width: 760px) {
  .admin-search-row { padding: 10px 12px 8px; }
  .admin-tabs { gap: 8px; padding: 0 12px; }
  .admin-tabs button { gap: 6px; padding: 0 8px; }
  .history-filters { gap: 5px; margin-bottom: 10px; padding-bottom: 10px; }
  .history-filter { flex: 1 1 auto; min-height: 32px; padding: 0 7px; font-size: 11px; }
  .admin-pagination { min-height: 82px; flex-basis: 82px; justify-content: center; }
  .admin-pagination .el-pagination { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px 3px; align-items: center; }
  .admin-pagination .el-pagination__total { grid-row: 1; grid-column: 1 / 3; justify-self: start; margin: 0; font-size: 12px; }
  .admin-pagination .el-pagination__sizes { grid-row: 1; grid-column: 2 / 4; justify-self: end; margin: 0; }
  .admin-pagination .btn-prev { grid-row: 2; grid-column: 1; justify-self: end; margin: 0 !important; }
  .admin-pagination .el-pager { grid-row: 2; grid-column: 2; justify-self: center; }
  .admin-pagination .btn-next { grid-row: 2; grid-column: 3; justify-self: start; margin: 0 !important; }
  .topbar { height: 112px; }
  .topbar-inner { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 58px 44px; gap: 0 12px; }
  .top-tutorial { grid-column: 1 / -1; grid-row: 2; height: 38px; padding: 0 22px; font-size: 14px; }
  .top-query { grid-column: 2; grid-row: 1; }
  .tutorial-head { height: 52px; padding: 0 12px; }
  .tutorial-head h2 { font-size: 15px; }
  .tutorial-play { min-width: 140px; min-height: 48px; padding: 0 18px; font-size: 16px; }
  .topbar-inner, .app-shell { width: calc(100% - 28px); }
  .brand img { width: 38px; height: 38px; flex-basis: 38px; }
  .brand-copy small { display: none; }
  .brand-copy strong { font-size: 15px; }
  .top-query { height: 39px; padding: 0 12px; font-size: 13px; }
  .app-shell { padding-top: 22px; }
  .stepper { margin-bottom: 30px; }
  .stepper.progress-stepper { display: none; }
  .flow-step { font-size: 10px; }
  .step-dot { width: 31px; height: 31px; }
  .stepper-line { top: 15px; }
  .page-heading { min-height: auto; margin-bottom: 17px; }
  .page-heading h1, .tool-heading h1 { font-size: 27px; }
  .token-heading-note { display: block; margin-top: 6px; font-size: 15px; white-space: normal; }
  .page-heading-lookup { align-items: flex-start; }
  .page-heading-lookup h1 { font-size: 27px; }
  .lookup-mark { width: 50px; height: 50px; flex-basis: 50px; }
  .lookup-mark svg { width: 28px; height: 28px; }
  .heading-symbol { width: 48px; height: 48px; flex-basis: 48px; }
  .heading-symbol svg { width: 23px; height: 23px; }
  .stage-layout, .lookup-layout, .token-layout, .recharge-progress-layout { grid-template-columns: 1fr; }
  .recharge-progress-layout { gap: 22px; }
  .progress-head b { font-size: 56px; }
  .progress-head h2 { font-size: 19px; }
  .retry-actions { grid-template-columns: 1fr; }
  .progress-footer { flex-wrap: wrap; }
  .stage-layout { gap: 16px; }
  .stage-card { padding: 18px; }
  .token-guide-card, .token-entry-card { min-height: 0; padding: 18px; }
  .guide-step { grid-template-columns: 38px minmax(0, 1fr); gap: 10px; padding: 15px 0; }
  .guide-step-action { grid-column: 2; justify-self: start; min-width: 90px; }
  .token-example-preview { width: 100%; margin-top: 11px; }
  .token-example-preview > span { opacity: 1; inset: auto 8px 8px auto; min-height: 30px; padding: 0 9px; border-radius: 5px; background: rgba(120, 49, 4, .78); font-size: 11px; }
  .token-example-dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); }
  .token-example-dialog__head { padding: 11px 12px; }
  .token-example-dialog > img { max-height: calc(100dvh - 82px); }
  .token-entry-head { align-items: stretch; flex-direction: column; }
  .token-open-button { width: 100%; }
  .token-entry-card > textarea { min-height: 170px; font-size: 16px; }
  .token-actions { grid-template-columns: 1fr 1fr; }
  .token-actions .primary-button { grid-column: 1 / -1; }
  .tool-rail { gap: 10px; }
  .tool-card { grid-template-columns: 40px minmax(0, 1fr) auto; min-height: 79px; padding: 12px; }
  .tool-icon { width: 40px; height: 40px; }
  .tool-card strong { font-size: 13px; }
  .account-grid { grid-template-columns: 1fr; }
  .account-head { flex-direction: column; }
  .progress-stages { display: grid; grid-template-columns: 1fr; gap: 0; }
  .progress-stage { grid-template-columns: 20px 52px minmax(0, 1fr); justify-items: start; align-items: center; min-height: 40px; text-align: left; }
  .progress-stage:not(:last-child)::after { top: 27px; bottom: -13px; left: 8px; right: auto; width: 2px; height: auto; }
  .progress-stage span { justify-self: end; text-align: right; }
  .result-panel { min-height: 230px; }
  .batch-form, .batch-results { padding: 18px; }
  .batch-form textarea { min-height: 210px; }
  .batch-results { min-height: 285px; }
  .empty-lookup { min-height: 205px; }
  .lookup-footer { align-items: stretch; }
  .single-query { width: 100%; order: -1; }
  .single-query input { width: auto; min-width: 0; flex: 1; }
  .code-batch-result-head { grid-template-columns: 22px minmax(0, 1fr) auto; }
  .code-batch-copy { grid-column: 3; grid-row: 2; justify-self: end; }
  .code-batch-result-plan, .code-batch-result-meta { margin-left: 0; }
  .subscription-heading h1 { font-size: 27px; }
  .subscription-symbol { width: 58px; height: 58px; flex-basis: 58px; border-radius: 14px; }
  .subscription-symbol svg { width: 30px; height: 30px; }
  .subscription-input-row { grid-template-columns: 1fr; gap: 12px; }
  .subscription-query-actions { grid-template-columns: 1fr 1fr; grid-template-rows: none; }
  .subscription-query-actions button { min-height: 46px; }
  .subscription-result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .subscription-result-grid article { min-height: 92px; padding: 14px; }
  .empty-result { min-height: 140px; }
  .detail-table { grid-template-columns: 1fr; }
  .voucher-row, .history-row { align-items: stretch; flex-direction: column; }
  .voucher-actions, .history-actions { width: 100%; }
  .voucher-actions .admin-action, .history-actions .admin-action { flex: 1; }
  .voucher-actions { gap: 6px; }
  .voucher-actions .admin-action { min-width: 0; padding: 0 4px; white-space: nowrap; }
  .voucher-actions .admin-action.voucher-copy { flex: 0 0 34px; padding: 0; }
  .voucher-actions .admin-action.danger { padding: 0; }
  .voucher-actions .admin-action.danger, .history-actions .admin-action.danger { flex: 0 0 34px; }
}

@media (max-width: 410px) {
  .topbar-inner, .app-shell { width: calc(100% - 24px); }
  .top-query span { display: none; }
  .top-query { width: 40px; padding: 0; }
  .flow-step > span:last-child { max-width: 64px; line-height: 1.25; text-align: center; }
  .page-heading-lookup { gap: 14px; }
  .page-heading-lookup p { font-size: 12px; }
  .lookup-mark { width: 44px; height: 44px; flex-basis: 44px; }
  .batch-form-foot { align-items: stretch; flex-direction: column; }
  .batch-form-foot .primary-button { width: 100%; }
  .result-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .single-query { align-items: stretch; flex-direction: column; }
  .text-action { width: 100%; }
  .tool-rail { grid-template-columns: 1fr; }
  .tool-card { min-height: 72px; }
  .dialog-actions { grid-template-columns: 1fr; }
  .subscription-result-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
