:root {
  --surface: var(--color-panel);
  --surface-2: var(--color-bg-subtle);
  --warn: var(--color-accent);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
code, .voice-mono { font-family: var(--mono); font-size: 0.86em; }
code { background: var(--surface-2); padding: 0.08em 0.3em; border-radius: 4px; }
a { color: var(--accent); }

.voice-topbar {
  display: flex; align-items: center; gap: 18px; justify-content: space-between;
  padding: 22px max(20px, calc((100% - 1120px)/2)); border-bottom: 1px solid var(--line); background: var(--surface);
  flex-wrap: wrap;
}
.voice-back { text-decoration: none; font-size: 13px; border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px; color: var(--ink); background: var(--surface-2); }
.voice-topbar h1 { font: 500 clamp(24px,3vw,34px)/1.35 var(--font-serif); margin: 0; }
.voice-sub { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.voice-identity { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.voice-identity select { min-width: 180px; }
.voice-badge {
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-2); font-size: 12px; color: var(--muted);
}
.voice-badge-ok { color: var(--ok); border-color: var(--ok); }

.voice-main { padding: 20px 28px 48px; max-width: 1180px; margin: 0 auto; }
.voice-loading { color: var(--muted); padding: 28px 0; }
.voice-error {
  border: 1px solid var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--surface));
  color: var(--danger); border-radius: var(--radius-base); padding: 12px 14px; margin-bottom: 14px;
}
.voice-messages { display: grid; gap: 8px; margin-bottom: 14px; }
.voice-message {
  border: 1px solid var(--line); border-left-width: 4px; background: var(--surface);
  border-radius: 8px; padding: 9px 12px; font-size: 13px;
}
.voice-message-code {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  margin-right: 8px; text-transform: uppercase;
}
.voice-message-warning { border-left-color: var(--warn); }
.voice-message-info { border-left-color: var(--accent); }

.voice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.voice-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-base);
  padding: 12px 14px;
}
.voice-card-emphasis { border-color: var(--accent); background: var(--color-accent-soft); }
.voice-card-label { color: var(--muted); font-size: 12px; }
.voice-card-value { font: 500 clamp(22px,3vw,32px)/1.35 var(--font-serif); margin: 4px 0; }
.voice-card-hint { color: var(--muted); font-size: 11px; }

.voice-meter { margin: 14px 0 20px; }
.voice-meter-track {
  height: 10px; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--line); overflow: hidden;
}
.voice-meter-fill { height: 100%; width: 0; background: var(--accent); transition: width 240ms ease; }
.voice-meter-warn { background: var(--warn); }
.voice-meter-danger { background: var(--danger); }
.voice-meter-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-top: 5px; }

.voice-two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px,100%), 1fr)); gap: 14px; }
.voice-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-base);
  padding: 14px 16px; margin: 14px 0;
}
.voice-panel h2 { font-size: 15px; margin: 0 0 10px; }
.voice-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.voice-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
.voice-dl dt { color: var(--muted); font-size: 12px; }
.voice-dl dd { margin: 0; font-size: 13px; }
.voice-hint { color: var(--muted); font-size: 12px; margin: 10px 0 0; }
.voice-supplement {
  margin-top: 10px; border: 1px dashed var(--warn); color: var(--warn);
  border-radius: 8px; padding: 10px 12px; font-size: 13px;
}

.voice-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.voice-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.voice-table th, .voice-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.voice-table th { background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 600; }
.voice-table tr:last-child td { border-bottom: 0; }
.voice-empty { color: var(--muted); text-align: center; padding: 16px; }
.voice-toggle { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.voice-toggle input { accent-color: var(--accent); }
.voice-inline { color: var(--muted); font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.voice-inline select { width: auto; }
.voice-hold {
  border: 1px solid var(--warn); background: color-mix(in srgb, var(--warn) 8%, var(--surface));
  color: var(--warn); border-radius: 8px; padding: 10px 12px; font-size: 13px;
}
.voice-footer {
  display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
  color: var(--muted); font-size: 11px; border-top: 1px solid var(--line); padding: 14px;
}
input, select {
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink); font: inherit;
}
@media (max-width: 720px) {
  .voice-topbar, .voice-main { padding-left: 14px; padding-right: 14px; }
}

body[data-account-pending] > :not(#studio-access, iframe) { display: none !important; }
#studio-access { margin: 3rem auto; padding: 0 1rem; font-size: 1rem; }
#studio-access[hidden], #studio-access [hidden] { display: none !important; }

.voice-back, .voice-section-retry, .voice-identity select, .voice-inline select { min-height: 44px; }
.voice-back { display: inline-flex; align-items: center; border-radius: var(--radius-base); }
.voice-error, .voice-section-error { color: var(--color-danger); }
.voice-error { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.voice-section-error { margin-block: 12px; }
.voice-section-retry { font: inherit; padding-inline: 14px; }
.voice-panel { min-width: 0; }
.voice-table-wrap:focus-visible { outline: 2px solid var(--color-focus); }
.voice-mono { overflow-wrap: anywhere; }
.voice-main { padding-top: clamp(22px,4vw,48px); }
@media (max-width: 720px) {
  .voice-identity { flex-basis: 100%; }
  .voice-identity select { width: auto; max-width: 100%; }
  .voice-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .voice-card-emphasis { grid-column: 1 / -1; }
}

.voice-footer a { display: inline-flex; align-items: center; min-height: 44px; color: var(--color-text-muted); }
