:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;

  /* Light theme tokens (source of truth) */
  --color-primary: #EA580C;
  --color-primary-dark: #C2410C;
  --color-on-primary: #FFFFFF;
  --color-accent: #2563EB;
  --color-on-accent: #FFFFFF;
  --color-background: #FFF7ED;
  --color-surface: #FFFFFF;
  --color-foreground: #1C1410;
  --color-muted: #FDF4F0;
  --color-muted-foreground: #8A7B6E;
  --color-border: #F3E3D3;
  --color-destructive: #DC2626;
  --color-success: #059669;
  --color-ring: #EA580C;
  --shadow-card: 0 1px 2px rgba(28, 20, 16, 0.04), 0 2px 10px rgba(28, 20, 16, 0.05);
  --shadow-pop: 0 8px 24px rgba(28, 20, 16, 0.10);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 9px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --duration-fast: 150ms;
  --duration-base: 220ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-primary: #FB923C;
    --color-primary-dark: #F97316;
    --color-on-primary: #1C1410;
    --color-accent: #60A5FA;
    --color-on-accent: #0B1220;
    --color-background: #17120D;
    --color-surface: #241C15;
    --color-foreground: #F5EDE4;
    --color-muted: #2A2119;
    --color-muted-foreground: #B8A997;
    --color-border: #3A2E22;
    --color-destructive: #F87171;
    --color-success: #34D399;
    --color-ring: #FB923C;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 14px rgba(0, 0, 0, 0.35);
    --shadow-pop: 0 10px 28px rgba(0, 0, 0, 0.45);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }

body {
  margin: 0;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  background: var(--color-background);
  color: var(--color-foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

a { color: var(--color-accent); }

:focus-visible {
  outline: 2px solid var(--color-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 14px var(--space-4);
  background: color-mix(in srgb, var(--color-background) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--color-border);
}

.topbar__mark {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: var(--color-on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.topbar__mark svg { width: 20px; height: 20px; }

.topbar__title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.topbar__sub {
  font-size: 12.5px;
  color: var(--color-muted-foreground);
  margin-top: 1px;
}

.ai-settings-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.topbar__version {
  margin-left: auto;
  flex: none;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--color-muted-foreground);
  background: var(--color-muted);
  border-radius: 999px;
  padding: 3px 9px;
}

/* ---------- Install banner ---------- */

.install-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 10px var(--space-4);
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-size: 13.5px;
  font-weight: 600;
}

.install-banner[hidden] { display: none; }

.install-banner__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: none;
}

.install-banner .secondary {
  background: color-mix(in srgb, var(--color-on-primary) 20%, transparent);
  color: var(--color-on-primary);
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.install-banner .secondary:hover {
  background: color-mix(in srgb, var(--color-on-primary) 32%, transparent);
}

#btnInstallDismiss {
  min-height: 32px;
  padding: 0 8px;
}

#btnInstallDismiss svg { width: 14px; height: 14px; }

/* ---------- Layout ---------- */

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--space-4) var(--space-4) 72px;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-card);
}

.card__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.card__badge {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 999px;
  background: var(--color-muted);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card__badge svg { width: 15px; height: 15px; }

.card__head h2 {
  font-size: 15px;
  margin: 0;
  font-weight: 700;
  color: var(--color-foreground);
}

/* ---------- Form elements ---------- */

.row {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}

.field {
  flex: 1 1 130px;
  min-width: 100px;
}

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-muted-foreground);
  margin-bottom: 6px;
}

input[type=text],
input[type=number],
input[type=time],
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: inherit;
  background: var(--color-surface);
  color: var(--color-foreground);
  transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}

input[type=text]::placeholder,
textarea::placeholder { color: var(--color-muted-foreground); opacity: 0.85; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--color-primary) 18%, transparent);
}

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%238A7B6E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 7.5 10 12.5 15 7.5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

/* ---------- Voice input ---------- */

.textarea-wrap { position: relative; }

.textarea-wrap textarea { padding-right: 52px; }

.mic-btn {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 38px;
  height: 38px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  background: var(--color-muted);
  color: var(--color-primary);
  box-shadow: none;
}

.mic-btn svg { width: 18px; height: 18px; }

.mic-btn:hover { background: var(--color-border); }

.mic-btn.is-listening {
  background: var(--color-destructive);
  color: #FFFFFF;
  animation: mic-pulse 1.4s ease-in-out infinite;
}

.mic-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-destructive) 45%, transparent); }
  50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--color-destructive) 0%, transparent); }
}

button.secondary-cta {
  background: var(--color-muted);
  color: var(--color-primary);
}

button.secondary-cta:hover { background: var(--color-border); }

/* ---------- Buttons ---------- */

button {
  border: none;
  border-radius: var(--radius-sm);
  min-height: 46px;
  padding: 0 18px;
  font-size: 15px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  background: var(--color-primary);
  color: var(--color-on-primary);
  transition: background-color var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  touch-action: manipulation;
}

button:hover { background: var(--color-primary-dark); }
button:active { transform: scale(0.97); }

button.secondary {
  background: var(--color-muted);
  color: var(--color-foreground);
  min-height: 38px;
  padding: 0 14px;
  font-size: 13.5px;
  font-weight: 600;
}

button.secondary:hover { background: var(--color-border); }
.default-pick-btn { min-height:28px; padding:0 7px; margin-top:5px; font-size:11px; color:var(--color-primary); background:transparent; border:1px solid var(--color-border); border-radius:7px; }
.default-pick-btn:hover { background:var(--color-muted); }

/* 音色、语速、背景音乐统一使用可收藏的网页选择面板 */
.compact-select-button { display:block; width:100%; min-height:44px; padding:9px 12px; text-align:left; font-size:16px; border:1.5px solid var(--color-border); border-radius:var(--radius-sm); background:var(--color-surface); color:var(--color-foreground); overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.compact-select-panel { position:fixed; inset:0; z-index:300; display:none; align-items:center; justify-content:center; padding:16px; background:rgba(0,0,0,.38); }
.compact-select-panel.is-open { display:flex; }
.compact-select-sheet { width:min(520px,100%); max-height:70vh; overflow:auto; background:var(--color-surface); border-radius:14px; padding:10px; box-shadow:var(--shadow-pop); }
.compact-select-title { font-size:14px; font-weight:700; padding:7px 9px; color:var(--color-muted-foreground); }
.compact-select-options { display:flex; flex-direction:column; gap:3px; }
.compact-select-option-line { display:flex; gap:4px; align-items:center; }
.compact-select-option-line > button:first-child { flex:1; min-width:0; justify-content:flex-start; }
.compact-select-options button { border:0; border-radius:8px; background:transparent; color:var(--color-foreground); text-align:left; padding:9px 10px; font-size:13px; min-height:38px; }
.compact-select-options button.is-selected { background:var(--color-muted); color:var(--color-primary); font-weight:700; }
.compact-select-star { flex:none; width:38px; padding:0 !important; justify-content:center; color:#e6a700 !important; font-size:19px !important; background:var(--color-muted) !important; }
.compact-select-delete { flex:none; color:var(--color-destructive) !important; background:var(--color-muted) !important; padding:6px 8px !important; font-size:11px !important; }

button.block { width: 100%; }

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, currentColor 30%, transparent);
  border-top-color: currentColor;
  animation: spin 0.7s linear infinite;
  flex: none;
  display: none;
}

button.is-loading .spinner { display: inline-block; }
button.is-loading .btn-label::after { content: ""; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Switch (toggle) ---------- */

.switch-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  padding: var(--space-2) 6px;
  margin: 0 -6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--duration-fast) var(--ease-out);
}

.switch-row:active { background: var(--color-muted); }

.switch {
  position: relative;
  flex: none;
  width: 42px;
  height: 26px;
}

.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.switch .track {
  position: absolute;
  inset: 0;
  background: var(--color-border);
  border-radius: 999px;
  transition: background-color var(--duration-base) var(--ease-out);
}

.switch .thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform var(--duration-base) var(--ease-out);
}

.switch input:checked + .track { background: var(--color-primary); }
.switch input:checked + .track + .thumb { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--color-ring); outline-offset: 2px; }

.switch-label {
  flex: 1;
  font-size: 14px;
  cursor: pointer;
}

.switch-label .title { font-weight: 600; display: block; }
.switch-label .desc { font-size: 12.5px; color: var(--color-muted-foreground); display: block; margin-top: 2px; }

.inline-num {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding-left: 54px;
}

.inline-num input[type=number] { width: 76px; min-height: 38px; text-align: center; }
.inline-num span { font-size: 13.5px; color: var(--color-muted-foreground); }

.time-window {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding-left: 54px;
}

.time-window input[type=time] { width: 118px; min-height: 38px; }
.time-window span { font-size: 13px; color: var(--color-muted-foreground); }

.sub-panel {
  border-top: 1px dashed var(--color-border);
  margin-top: var(--space-1);
  padding-top: var(--space-2);
}

/* ---------- Upload ---------- */

.upload {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  border: 1.5px dashed var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  color: var(--color-muted-foreground);
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease-out);
}

.upload:hover { border-color: var(--color-primary); }
.upload svg { flex: none; width: 17px; height: 17px; color: var(--color-primary); }
.upload input[type=file] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* ---------- Status / helper text ---------- */

.hint {
  font-size: 12px;
  color: var(--color-muted-foreground);
  margin-top: var(--space-2);
}

.char-count {
  font-size: 12px;
  color: var(--color-muted-foreground);
  text-align: right;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

.char-count.is-near-limit { color: var(--color-destructive); font-weight: 600; }

.status {
  font-size: 13px;
  min-height: 18px;
  margin-top: var(--space-3);
  display: flex;
  align-items: center;
  gap: 6px;
}

.status[data-tone="error"] { color: var(--color-destructive); }
.status[data-tone="success"] { color: var(--color-success); }
.status[data-tone="busy"] { color: var(--color-muted-foreground); }

/* ---------- Player ---------- */

.player-box { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 18px; align-items: center; }
.player-box .transport, .player-box .hint, .player-box .player-actions { grid-column: 1 / -1; }
.player-box .switch-row { min-height: 38px; padding: 5px 6px; background: color-mix(in srgb, var(--color-muted) 55%, transparent); }
.player-box .inline-num { margin-top: 0; padding-left: 0; }
.player-box .sub-panel { grid-column: 1 / -1; }
.player-box .time-window { grid-column:1 / -1; display:grid; grid-template-columns:minmax(0, 1fr) auto minmax(0, 1fr); width:100%; padding:0; margin:0; gap:10px; }
.player-box .time-window input[type=time] { width:100%; }
.player-box .download-link { background: var(--color-muted); border-radius: var(--radius-sm); padding: 8px 12px; }
.player-box .inline-num, .player-box .time-window { margin-top: 4px; }
.player-box .sub-panel { padding-top: 6px; }

audio { display: none; }

.transport {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.play-btn {
  flex: none;
  width: 42px;
  height: 26px;
  min-height: 0;
  padding: 0;
  border-radius: 999px;
  box-shadow: 0 4px 10px color-mix(in srgb, var(--color-primary) 22%, transparent);
}

.play-btn svg { width: 14px; height: 14px; }

.seek-wrap { flex: 1; min-width: 0; }

#seek {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  min-height: 28px;
  background: transparent;
  padding: 0;
  border: none;
  cursor: pointer;
}

#seek::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: var(--color-border);
}

#seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 2px solid var(--color-surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  margin-top: -6px;
}

#seek::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: var(--color-border);
}

#seek::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 2px solid var(--color-surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.time-row {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--color-muted-foreground);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

.player-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.download-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--color-accent);
  text-decoration: none;
  padding: 8px 4px;
}

.download-link svg { width: 16px; height: 16px; }

/* ---------- History ---------- */

.history-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 11px 0;
  border-bottom: 1px solid var(--color-border);
}

.history-item:last-child { border-bottom: none; }

.history-main { flex: 1; min-width: 0; overflow: hidden; }
.history-text {
  display: block;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
  color: var(--color-foreground);
}

.history-meta { font-size: 11px; color: var(--color-muted-foreground); display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.history-empty {
  font-size: 13.5px;
  color: var(--color-muted-foreground);
  text-align: center;
  padding: var(--space-4) 0;
}

/* ---------- Responsive ---------- */

@media (min-width: 640px) {
  .wrap { padding-top: var(--space-5); }
  .card { padding: var(--space-5); }
}

/* ---------- Modal & Voice Recording ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.modal-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-pop);
  padding: var(--space-4);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-2);
}

.modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-foreground);
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--color-muted-foreground);
  min-height: 32px;
  padding: 0 8px;
}

.close-btn:hover {
  color: var(--color-foreground);
  background: var(--color-muted);
}

.record-box {
  background: var(--color-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
}

.record-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.record-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-destructive);
  margin-right: 4px;
  transition: transform var(--duration-fast);
}

.record-dot.is-pulsing {
  animation: rec-pulse 1s infinite alternate;
}

@keyframes rec-pulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 1; box-shadow: 0 0 8px var(--color-destructive); }
}

.custom-voices-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.custom-voice-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13.5px;
}

.custom-voice-name {
  font-weight: 600;
  color: var(--color-foreground);
}

.custom-voice-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.btn-icon-xs {
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

@media (max-width: 639px) {
  .compact-select-button { display:block; width:100%; min-height:38px; padding:7px 9px; text-align:left; font-size:14px; border:1.5px solid var(--color-border); border-radius:9px; background:var(--color-surface); color:var(--color-foreground); overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
  .compact-select-panel { position:fixed; inset:0; z-index:300; display:none; align-items:flex-end; background:rgba(0,0,0,.35); }
  .compact-select-panel.is-open { display:flex; }
  .compact-select-panel > div { width:100%; max-height:55vh; overflow:auto; background:var(--color-surface); border-radius:14px 14px 0 0; padding:8px; box-shadow:0 -8px 24px rgba(0,0,0,.18); }
  .compact-select-title { font-size:13px; font-weight:700; padding:6px 8px; color:var(--color-muted-foreground); }
  .compact-select-options { display:flex; flex-direction:column; gap:3px; }
  .compact-select-option-line { display:flex; gap:4px; align-items:center; }
  .compact-select-option-line > button:first-child { flex:1; }
  .compact-select-delete { flex:none !important; color:var(--color-destructive) !important; background:var(--color-muted) !important; padding:6px 8px !important; font-size:11px !important; }
  .compact-select-options button { border:0; border-radius:8px; background:transparent; color:var(--color-foreground); text-align:left; padding:9px 10px; font-size:13px; min-height:36px; }
  .compact-select-options button.is-selected { background:var(--color-muted); color:var(--color-primary); font-weight:700; }
  body { font-size: 14px; line-height: 1.4; }
  .topbar { padding: 9px 10px; gap: 8px; }
  .topbar__mark { width: 30px; height: 30px; }
  .topbar__mark svg { width: 17px; height: 17px; }
  .topbar__title { font-size: 15px; }
  .topbar__sub { font-size: 11px; }
  .topbar__version { font-size: 10px; padding: 2px 6px; }
  .wrap { padding: 8px 8px 40px; }
  .card { padding: 10px; margin-bottom: 8px; border-radius: 12px; }
  .card__head { gap: 8px; margin-bottom: 9px; }
  .card__head h2 { font-size: 15px; }
  .card__badge { width: 22px; height: 22px; }
  .row { gap: 8px; margin-bottom: 8px; }
  .field label { font-size: 11px; margin-bottom: 4px; }
  input[type=text], input[type=number], input[type=time], select, textarea { min-height: 38px; padding: 7px 9px; font-size: 14px; }
  .textarea-wrap textarea { min-height: 112px; }
  .btn, button, .block { min-height: 40px; }
  .secondary-cta { min-height: 40px; }
  .status { margin-top: 4px; }
  .player-box { display:grid; grid-template-columns:1fr 1fr; gap:6px; align-items:stretch; }
  .player-box .transport, .player-box .hint, .player-box .player-actions, .player-box .sub-panel { grid-column:1 / -1; }
  .player-box .switch-row { width:100%; min-height:48px; margin:0; padding:7px 8px; gap:7px; border:1px solid var(--color-border); border-radius:10px; background:var(--color-muted); }
  .player-box .switch-label { font-size:12px; line-height:1.25; }
  .player-box .switch-label .desc { font-size:10px; }
  .player-box .inline-num { grid-column:1 / -1; padding-left:0; margin:0; justify-content:center; }
  .player-box .time-window { grid-column:1 / -1; display:flex; padding-left:0; margin:0; justify-content:center; }
  .player-box .hint { font-size:10px; line-height:1.35; margin:0; }
  .player-box .player-actions { margin-top:0; }
  .player-box .download-link { width:100%; justify-content:center; min-height:36px; }
  .transport { gap: 8px; }
  .play-btn { width: 42px; height: 26px; }
  .play-btn svg { width: 14px; height: 14px; }
  .switch-row { min-height: 34px; padding: 3px 4px; gap: 8px; }
  .switch-label { font-size: 13px; }
  .switch-label .desc { font-size: 10px; margin-top: 0; }
  .switch { width: 36px; height: 22px; }
  .switch .thumb { width: 16px; height: 16px; top: 3px; left: 3px; }
  .switch input:checked + .track + .thumb { transform: translateX(14px); }
  .inline-num, .time-window { margin-top: 3px; padding-left: 44px; gap: 5px; }
  .time-window input[type=time] { width: 92px; min-height: 34px; }
  .inline-num input[type=number] { width: 60px; min-height: 34px; }
  .download-link { padding: 4px; font-size: 12px; }
  .history-item { padding: 7px 0; gap: 5px; align-items:center; }
  .history-main { min-width:0; flex:1; }
  .history-text { display:block; font-size:12px; line-height:1.3; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .history-meta { display:block; font-size:10px; color:var(--color-muted-foreground); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .history-item button { min-height:30px; padding:3px 6px; font-size:11px; }
  .modal-overlay { padding: 6px; align-items: flex-end; }
  .modal-card { max-height: 84vh; padding: 12px; border-radius: 14px 14px 0 0; font-size: 13px; }
  .modal-card * { font-size: inherit; }
  .modal-header h3 { font-size: 14px !important; }
  .modal-card .hint, .modal-card label { font-size: 11px !important; line-height: 1.45; }
  .modal-card input, .modal-card textarea, .modal-card select { font-size: 13px !important; min-height: 36px; padding: 7px 9px; }
  .modal-card .record-box { padding: 8px; }
  .modal-card .record-box button { font-size: 12px !important; min-height: 38px; }
  .modal-card .upload { min-height: 44px; padding: 8px; font-size: 12px !important; }
  .modal-card .block { min-height: 42px; font-size: 14px !important; }
  .modal-card .status { font-size: 12px !important; }
  .custom-voice-item { font-size: 11px !important; padding: 6px 8px; }
  .custom-voice-actions { gap: 3px; }
  .custom-voice-actions button { font-size: 10px !important; padding: 0 5px; min-height: 26px; }
}

