:root {
  color-scheme: light;
  --bg: #F6F7F9;
  --surface: #FFFFFF;
  --surface-2: #EEF0F3;
  --surface-3: #E3E6EC;
  --ink: #101218;
  --ink-2: #4F5562;
  --ink-3: #7B8290;
  --line: rgba(16, 18, 24, 0.09);
  --line-strong: rgba(16, 18, 24, 0.16);
  --pill-bg: #121418;
  --pill-ink: #F1F2F4;
  --pill-muted: #A2A7B1;
  --lime: #C2F23D;
  --lime-text: #3F6B00;
  --lime-line: #76A800;
  --cyan: #5CE1E6;
  --amber: #B86E00;
  --red: #C82E33;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.68;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

a {
  color: var(--lime-text);
  text-underline-offset: 4px;
  transition: color 0.16s ease;
}

a:hover { color: var(--ink); }

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

button, .button {
  border: 0;
  border-radius: 10px;
  background: var(--ink);
  color: #FFFFFF;
  padding: 11px 20px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 650;
  transition: background 0.16s ease, box-shadow 0.16s ease, transform 0.14s ease;
}

button:hover:not(:disabled), .button:hover:not([aria-disabled="true"]) {
  background: #232733;
  color: #FFFFFF;
  box-shadow: 0 6px 18px rgba(16, 18, 24, 0.12);
}

button:disabled, .button[aria-disabled="true"] {
  background: var(--surface-3);
  color: var(--ink-3);
  cursor: default;
  pointer-events: none;
  box-shadow: none;
}

.secondary {
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.secondary:hover:not(:disabled), .button.secondary:hover:not([aria-disabled="true"]) {
  background: var(--surface-2);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(16, 18, 24, 0.24);
}

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

header, main, footer {
  max-width: 1060px;
  margin-inline: auto;
  padding: 22px 24px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  vertical-align: middle;
  border-radius: 8px;
}

.mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--ink);
  color: var(--lime);
  border-radius: 10px;
  margin-right: 10px;
}

nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

nav a {
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink-2);
}

nav a:hover { color: var(--ink); }

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lime-text);
  font-weight: 700;
}

h1 {
  font-size: clamp(30px, 4.4vw, 44px);
  line-height: 1.18;
  letter-spacing: -0.03em;
  margin: 12px 0 18px;
  color: var(--ink);
  font-weight: 750;
}

h2 {
  font-size: 21px;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-weight: 680;
}

h3 {
  font-size: 17px;
  margin: 0 0 8px;
  color: var(--ink);
  font-weight: 650;
}

p { margin: 12px 0; }

.lead {
  font-size: 17px;
  color: var(--ink-2);
  max-width: 540px;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.muted, small { color: var(--ink-2); }

.notice {
  padding: 14px 18px;
  background: rgba(194, 242, 61, 0.14);
  border: 1px solid rgba(118, 168, 0, 0.24);
  border-radius: 12px;
  font-size: 14px;
  color: var(--ink-2);
}

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

.card, .panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(16, 18, 24, 0.035);
}

.card { padding: 24px; }
.card p { font-size: 15px; color: var(--ink-2); }
.section { padding: 28px 0; }
.step { font-size: 13px; font-weight: 700; color: var(--lime-text); margin-bottom: 10px; }
.price { font-size: 32px; font-weight: 750; line-height: 1.3; color: var(--ink); }
.price small { font-size: 14px; font-weight: 400; color: var(--ink-2); }

.narrow {
  max-width: 730px;
  animation: accountIn 0.35s ease both;
}

.panel {
  margin: 14px 0 24px;
  padding: 24px;
}

.narrow h1, .narrow h2 { overflow-wrap: anywhere; }
.narrow p, .narrow li { overflow-wrap: break-word; }

.field {
  display: block;
  margin: 16px 0;
}

.field span {
  display: block;
  margin-bottom: 6px;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--ink-2);
}

input:not([type="checkbox"]), textarea, .field select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

input:not([type="checkbox"]):focus, textarea:focus, .field select:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(194, 242, 61, 0.38);
  outline: none;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.row input { flex: 1; min-width: 120px; }

.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--ink-2);
  margin: 18px 0;
}

.consent input {
  margin-top: 5px;
  accent-color: var(--ink);
}

[hidden] { display: none !important; }

.status {
  font-size: 14px;
  font-weight: 500;
  white-space: pre-line;
  color: var(--ink);
}

.status:empty { display: none; }
.error { color: var(--red); }

.order, .entry {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.order:last-child, .entry:last-child { border-bottom: 0; }
.order .row { justify-content: space-between; }
.order small { display: block; overflow-wrap: anywhere; }
.order button, .order .button { padding: 8px 14px; font-size: 13.5px; }

.balance {
  font-size: 36px;
  line-height: 1.25;
  font-weight: 750;
  margin: 10px 0;
  color: var(--ink);
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.allowance-meter {
  margin: 4px 0 14px;
}

.allowance-meter-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.allowance-meter-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.allowance-meter-track {
  height: 8px;
  width: 100%;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.allowance-meter-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--lime-line);
  transition: width 0.28s ease;
}

.allowance-meter-track[data-tone="moderate"] .allowance-meter-fill {
  background: var(--ink);
}

.allowance-meter-track[data-tone="low"] .allowance-meter-fill {
  background: var(--amber);
}

.panel-subtle {
  background: var(--bg);
  border-color: var(--line);
  box-shadow: none;
}

.call-history-fold > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.call-history-fold > summary::-webkit-details-marker { display: none; }

.call-history-title {
  font-size: 17px;
  font-weight: 640;
  color: var(--ink-2);
}

.call-history-hint {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
}

.call-history-fold[open] > summary {
  margin-bottom: 10px;
}

.call-history-fold[open] .call-history-title {
  color: var(--ink);
}

.legal { padding-top: 28px; }
.legal h1 { font-size: 34px; letter-spacing: -0.025em; color: var(--ink); }
.legal h2 { font-size: 20px; margin-top: 28px; color: var(--ink); }
.legal p, .legal li { color: var(--ink-2); }
.legal ol { padding-left: 24px; }
.legal .notice { font-size: 13.5px; }

footer {
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-3);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 36px;
  flex-wrap: wrap;
}

footer a {
  margin-right: 16px;
  color: var(--ink-2);
  text-decoration: none;
}

footer a:hover { color: var(--ink); text-decoration: underline; }

dialog {
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  max-width: 440px;
  width: calc(100% - 32px);
  padding: 24px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(16, 18, 24, 0.18);
}

dialog::backdrop {
  background: rgba(16, 18, 24, 0.44);
  backdrop-filter: blur(4px);
}

.payment-qr {
  display: block;
  width: 256px;
  max-width: 100%;
  height: auto;
  margin: 18px auto;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
}

.checkout-amount {
  font-size: 24px;
  font-weight: 750;
  color: var(--ink);
}

#payment-order { font-size: 12px; overflow-wrap: anywhere; }

/* Account purchase choices keep immediate credits separate from next-period renewal. */
#packages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px;
}

#packages .plan-heading {
  grid-column: 1 / -1;
  margin: 12px 0 0;
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--ink);
}

#packages button { white-space: normal; min-height: 52px; }
#purchase { scroll-margin-top: 24px; }
#payment-result { border-color: var(--lime-line); background: rgba(194, 242, 61, 0.08); }
#account-release { display: block; }

/* Shared language control; inserted by i18n.js on every public page. */
.language-picker {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.language-picker select {
  max-width: 12rem;
  padding: 0.48rem 0.72rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
}

.language-picker select:hover {
  border-color: rgba(16, 18, 24, 0.28);
  color: var(--ink);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Currency values remain readable at six-decimal ledger precision on small screens. */
.usage-call {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.usage-call:last-child { border-bottom: 0; }

.usage-call-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.usage-call small { display: block; overflow-wrap: anywhere; }
.usage-call details { margin-top: 8px; font-size: 13px; }
.usage-call summary { cursor: pointer; color: var(--lime-text); font-weight: 600; }
.entry { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* Public availability status */
.service-status {
  margin: 18px 0;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink-3);
  border-radius: 12px;
  font-size: 14px;
  color: var(--ink-2);
}

.service-status[data-state="ready"] {
  border-left-color: var(--lime-line);
  background: rgba(194, 242, 61, 0.1);
  color: var(--ink);
}

.service-status[data-state="unverified"],
.service-status[data-state="paused"] {
  background: rgba(245, 165, 36, 0.1);
  border-left-color: var(--amber);
  color: var(--ink);
}

.service-status p { margin: 4px 0; overflow-wrap: anywhere; }
.service-status button { min-height: 40px; margin-top: 8px; }

.help-download small { display: block; margin-top: 8px; }
.help-steps { padding-left: 22px; }
.help-steps li { padding: 10px 0 18px; }
.help-steps h2 { font-size: 20px; margin: 0 0 8px; }
.help-steps p { margin: 0; color: var(--ink-2); }

.help-links {
  display: flex;
  gap: 10px 22px;
  flex-wrap: wrap;
}

.help-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 550;
}

.help-page { animation: none; }

/* Keep account entry compact enough to reach the form in the first viewport. */
.account-page main.narrow { padding-block: 1rem 3rem; }
.account-page h1 { font-size: clamp(1.7rem, 4vw, 2.2rem); margin: 0.25rem 0 0.9rem; }
.account-page .service-status { padding: 0.8rem 1rem; }
.account-page .service-status p { margin: 0.25rem 0; line-height: 1.45; }
.account-page .service-status button { margin-top: 0.35rem; padding: 0.5rem 0.9rem; }
.account-page #login-panel h2 { margin-top: 0; }
.account-page #login-panel .muted { font-size: 0.9rem; line-height: 1.5; margin: 0.55rem 0; }

@keyframes accountIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .narrow { animation: none; }
}

@media (max-width: 700px) {
  header, main, footer { padding: 16px 18px; }
  header { flex-wrap: wrap; gap: 10px; }
  header .brand { flex: 1; font-size: 17px; gap: 7px; white-space: normal; }
  header .brand img { width: 28px; height: 28px; }
  header nav { flex: none; }
  header .language-picker { flex-basis: 100%; justify-content: flex-end; margin-left: 0; }
  .grid { grid-template-columns: 1fr; }
  .panel { padding: 18px; }
  .narrow h1 { font-size: 28px; }
  .legal h1 { font-size: 27px; }
  .balance { font-size: 30px; }
}
