#card-audio-recorder-host {
  --bg: #edf0f5;
  --overlay: rgba(17, 24, 39, 0.74);
  --surface: #ffffff;
  --surface-muted: #f8f8fb;
  --border: #dfe2eb;
  --border-strong: #cfd4df;
  --text: #171827;
  --muted: #666b7d;
  --faint: #9aa0ae;
  --accent: #5d2ee5;
  --accent-soft: #eee8ff;
  --accent-mid: #7655e8;
  --danger: #ef262c;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

#card-audio-recorder-host,
#card-audio-recorder-host * {
  box-sizing: border-box;
}

#card-audio-recorder-host button,
#card-audio-recorder-host select,
#card-audio-recorder-host input {
  font: inherit;
}

#card-audio-recorder-host button {
  cursor: pointer;
}

#card-audio-recorder-host.page-shell {
  position: fixed;
  inset: 0;
  z-index: 10050;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100dvh;
  margin: 0;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  place-items: center;
  overflow: hidden;
}

#card-audio-recorder-host.page-shell.d-none {
  display: none !important;
}

#card-audio-recorder-host .car-audio-backdrop {
  grid-column: 1;
  grid-row: 1;
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--overlay);
  backdrop-filter: blur(3px);
}

#card-audio-recorder-host .car-audio-dialog {
  grid-column: 1;
  grid-row: 1;
  display: block;
  width: min(1500px, 100%);
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  justify-self: center;
  align-self: center;
  overflow: auto;
  overflow-x: hidden;
  position: relative;
  z-index: 1;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 42px 44px 34px;
}

#card-audio-recorder-host .car-audio-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 28px;
}

#card-audio-recorder-host .title-cluster {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

#card-audio-recorder-host .title-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  flex: 0 0 auto;
}

#card-audio-recorder-host .title-icon svg { width: 42px; height: 42px; fill: currentColor; }

#card-audio-recorder-host .title-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

h1 {
  margin: 0;
  font-size: clamp(1.55rem, 2.1vw, 2.3rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

#card-audio-recorder-host .car-audio-dialog-header p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

#card-audio-recorder-host .icon-button {
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  color: #4f5263;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
}

#card-audio-recorder-host .icon-button:hover { background: #f1f2f7; }
#card-audio-recorder-host .icon-button svg { width: 30px; height: 30px; fill: currentColor; }
#card-audio-recorder-host .close-button svg { width: 34px; height: 34px; }

#card-audio-recorder-host .help-button {
  width: auto;
  height: auto;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

#card-audio-recorder-host .help-button:hover { opacity: 0.85; }

#card-audio-recorder-host .help-button img {
  display: block;
}

#card-audio-recorder-host input[type="range"]:focus-visible,
#card-audio-recorder-host button:focus-visible {
  outline: 3px solid rgba(93, 46, 229, 0.22);
  outline-offset: 2px;
}

#card-audio-recorder-host .record-panel,
#card-audio-recorder-host .editor-card,
#card-audio-recorder-host .record-script-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
}

#card-audio-recorder-host .record-script-block {
  margin-bottom: 20px;
  padding: 22px 28px;
  background: var(--accent-soft);
  border-color: rgba(93, 46, 229, 0.18);
}

#card-audio-recorder-host .record-script-block.is-recording {
  border-color: rgba(93, 46, 229, 0.45);
  box-shadow: 0 0 0 3px rgba(93, 46, 229, 0.12);
}

#card-audio-recorder-host .record-script-label {
  margin: 0 0 10px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

#card-audio-recorder-host .record-script-text {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.02em;
  color: #1a1c24;
  word-break: break-word;
}

#card-audio-recorder-host.car-audio-has-record-script .record-panel {
  margin-top: 0;
}

#card-audio-recorder-host .record-panel {
  min-height: 138px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 36px;
}

#card-audio-recorder-host .record-status {
  display: flex;
  align-items: center;
  gap: 44px;
  flex-shrink: 0;
}

#card-audio-recorder-host .record-status-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

#card-audio-recorder-host .mic-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}

#card-audio-recorder-host .mic-picker-label {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#card-audio-recorder-host .mic-settings-btn {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#card-audio-recorder-host .mic-settings-btn:hover:not(:disabled) {
  background: var(--surface-muted);
}

#card-audio-recorder-host .mic-settings-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

#card-audio-recorder-host .mic-settings-btn img {
  display: block;
  width: 20px;
  height: 20px;
}

#card-audio-recorder-host .mic-menu {
  position: fixed;
  z-index: 10061;
  min-width: min(320px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: min(280px, 50vh);
  overflow: auto;
  margin: 0;
  padding: 8px;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
}

#card-audio-recorder-host .mic-menu-option {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.98rem;
  text-align: left;
  cursor: pointer;
}

#card-audio-recorder-host .mic-menu-option:hover {
  background: var(--surface-muted);
}

#card-audio-recorder-host .mic-menu-option[aria-selected="true"] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

#card-audio-recorder-host .record-button {
  width: 88px;
  height: 88px;
  min-width: 88px;
  min-height: 88px;
  max-width: 88px;
  max-height: 88px;
  flex: 0 0 88px;
  aspect-ratio: 1;
  padding: 0;
  box-sizing: border-box;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: #fff;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.08);
  display: grid;
  place-items: center;
  align-self: center;
}

#card-audio-recorder-host .record-button span {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  aspect-ratio: 1;
  display: block;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 8px rgba(239, 38, 44, 0.07);
  transition: border-radius 0.15s ease, width 0.15s ease, height 0.15s ease;
}

#card-audio-recorder-host .record-button.is-recording span {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  box-shadow: 0 0 0 8px rgba(239, 38, 44, 0.12);
}

#card-audio-recorder-host .record-button:disabled span {
  opacity: 0.45;
}

#card-audio-recorder-host .record-button {
  position: relative;
}

#card-audio-recorder-host .record-button.is-starting span {
  opacity: 0.35;
}

#card-audio-recorder-host .record-button.is-starting::after {
  content: '';
  position: absolute;
  width: 52px;
  height: 52px;
  border: 3px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: car-audio-saving-spin 0.8s linear infinite;
}

#card-audio-recorder-host .record-button.is-starting:disabled {
  cursor: wait;
}

#card-audio-recorder-host .timer {
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: 0.025em;
  line-height: 1;
}

#card-audio-recorder-host .status-line {
  margin-top: 12px;
  color: var(--muted);
  font-size: 1.08rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

#card-audio-recorder-host .status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #75798b;
}

#card-audio-recorder-host .status-dot.is-recording {
  background: var(--danger);
  animation: pulse-dot 1s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

#card-audio-recorder-host .error-banner {
  margin: 0 0 20px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: #fff4f4;
  border: 1px solid #f5c2c4;
  color: #9b1c1f;
  line-height: 1.45;
}

#card-audio-recorder-host .field-hint {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

select:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  background: var(--surface-muted);
}

#card-audio-recorder-host .record-actions {
  border-left: 1px solid var(--border);
  min-width: 230px;
  display: flex;
  justify-content: center;
}

#card-audio-recorder-host .toolbar-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  min-width: 140px;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 8px 12px;
}

#card-audio-recorder-host .toolbar-button:hover:not(:disabled) { color: var(--text); }
#card-audio-recorder-host .toolbar-button:disabled { opacity: 0.45; cursor: not-allowed; }
#card-audio-recorder-host .toolbar-button svg { width: 36px; height: 36px; fill: currentColor; }

#card-audio-recorder-host .editor-card { border-top-left-radius: 0; border-top-right-radius: 0; }

#card-audio-recorder-host .time-summary {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  padding: 26px 32px 16px;
}

#card-audio-recorder-host .time-summary div:nth-child(2) { text-align: center; }
#card-audio-recorder-host .time-summary div:nth-child(3) { text-align: right; }
#card-audio-recorder-host .time-summary strong { display: block; font-size: 1.25rem; font-weight: 600; }
#card-audio-recorder-host .time-summary span { display: block; margin-top: 3px; color: var(--accent); font-weight: 650; }
#card-audio-recorder-host .time-summary div:nth-child(2) span { color: var(--muted); }

#card-audio-recorder-host .timeline-block {
  padding: 0 28px 20px;
  min-width: 0;
}

#card-audio-recorder-host .timeline-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

#card-audio-recorder-host .timeline-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding-top: 28px;
}

#card-audio-recorder-host .timeline-main {
  flex: 1;
  min-width: 0;
}

#card-audio-recorder-host .volume-control {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 120px;
}

#card-audio-recorder-host .volume-control .volume {
  flex: 1;
  min-width: 0;
  width: auto;
}

#card-audio-recorder-host .waveform {
  position: relative;
  margin: 0;
  height: 112px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fbfbfd;
  cursor: crosshair;
  touch-action: none;
}

#card-audio-recorder-host .waveform.is-empty .waveform-empty {
  display: grid;
}

#card-audio-recorder-host .waveform:not(.is-empty) .waveform-empty,
#card-audio-recorder-host .waveform.is-live-recording .waveform-empty {
  display: none !important;
}

#card-audio-recorder-host .waveform.is-empty #waveform-canvas {
  display: none !important;
}

#card-audio-recorder-host .waveform.is-live-recording #waveform-canvas {
  display: none !important;
}

#card-audio-recorder-host .waveform.is-live-recording {
  cursor: default;
  height: 156px;
  min-height: 156px;
  background: linear-gradient(180deg, #faf9ff 0%, #f3f0ff 100%);
}

#card-audio-recorder-host .waveform.is-live-recording.has-voice {
  background: linear-gradient(180deg, #f8f6ff 0%, #ede8ff 100%);
}

#card-audio-recorder-host .record-feedback {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px 12px;
  box-sizing: border-box;
  z-index: 4;
  pointer-events: none;
  overflow: visible;
  --record-level: 0;
}

#card-audio-recorder-host .record-feedback[hidden] {
  display: none !important;
}

#card-audio-recorder-host .waveform.is-live-recording .record-feedback:not([hidden]) {
  display: flex;
}

#card-audio-recorder-host .record-feedback-core {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

#card-audio-recorder-host .record-pulse {
  position: relative;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  overflow: visible;
}

#card-audio-recorder-host .record-pulse-ring {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 2px solid rgba(93, 46, 229, 0.35);
  animation: record-ring-pulse 2s ease-out infinite;
  pointer-events: none;
}

#card-audio-recorder-host .record-pulse-ring:nth-child(2) {
  animation-delay: 0.65s;
}

#card-audio-recorder-host .record-pulse-icon {
  position: relative;
  z-index: 1;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 calc(3px + var(--record-level) * 10px) rgba(93, 46, 229, 0.18);
  transform: scale(calc(1 + var(--record-level) * 0.1));
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out;
}

#card-audio-recorder-host .record-pulse-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

#card-audio-recorder-host .has-voice .record-pulse-icon {
  background: #e8deff;
  color: #4820d2;
}

#card-audio-recorder-host .record-feedback-title {
  margin: 0;
  font-weight: 650;
  font-size: 0.98rem;
  line-height: 1.2;
  color: var(--text);
}

#card-audio-recorder-host .record-feedback-hint {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.25;
  color: var(--muted);
  transition: color 0.15s ease;
}

#card-audio-recorder-host .record-feedback-hint.is-active {
  color: var(--accent);
  font-weight: 600;
}

#card-audio-recorder-host .record-level-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  width: min(100%, 320px);
  height: 32px;
  flex-shrink: 0;
  padding: 0 8px;
}

#card-audio-recorder-host .record-level-bars span {
  flex: 1;
  max-width: 10px;
  min-height: 10%;
  height: 12%;
  border-radius: 6px 6px 3px 3px;
  background: #d5d9e4;
  opacity: 0.65;
  transition: height 0.07s ease-out, background 0.1s ease, opacity 0.1s ease;
}

#card-audio-recorder-host .record-level-bars span.is-lit {
  background: linear-gradient(180deg, #9b7cf0 0%, var(--accent) 100%);
  opacity: 1;
}

#card-audio-recorder-host .has-voice .record-level-bars span.is-lit {
  background: linear-gradient(180deg, #7d5ae8 0%, #4820d2 100%);
}

@keyframes record-ring-pulse {
  0% {
    transform: scale(0.9);
    opacity: 0.75;
  }
  100% {
    transform: scale(1.12);
    opacity: 0;
  }
}

#card-audio-recorder-host .record-button.is-recording.has-voice span {
  animation: record-btn-voice 1.2s ease-in-out infinite;
}

@keyframes record-btn-voice {
  0%, 100% { box-shadow: 0 0 0 8px rgba(239, 38, 44, 0.1); }
  50% { box-shadow: 0 0 0 14px rgba(239, 38, 44, 0.22); }
}

#card-audio-recorder-host .waveform.can-seek {
  cursor: pointer;
}

#card-audio-recorder-host .waveform.can-seek.is-selecting {
  cursor: crosshair;
}

#card-audio-recorder-host .waveform:focus-visible {
  outline: 3px solid rgba(93, 46, 229, 0.22);
  outline-offset: 2px;
}

#card-audio-recorder-host .waveform-empty {
  position: absolute;
  inset: 0;
  margin: 0;
  display: grid;
  place-items: center;
  color: var(--faint);
  font-size: 1rem;
  pointer-events: none;
  user-select: none;
}

#waveform-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#card-audio-recorder-host .selection {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(93, 46, 229, 0.1);
  border-left: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  pointer-events: none;
  z-index: 2;
}

#card-audio-recorder-host .selection::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(93, 46, 229, 0.04);
  pointer-events: none;
}

#card-audio-recorder-host .selection .trim-handle {
  position: absolute;
  top: auto;
  bottom: 5px;
  width: 16px;
  height: 22px;
  margin: 0;
  padding: 0;
  transform: none;
  border: 2px solid var(--accent);
  background: #fff;
  color: var(--accent);
  line-height: 1;
  display: grid;
  place-items: center;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(93, 46, 229, 0.2);
  pointer-events: auto;
  cursor: ew-resize;
  z-index: 3;
}

#card-audio-recorder-host .selection .trim-handle::after {
  content: "";
  position: absolute;
  inset: -12px -10px -6px;
}

#card-audio-recorder-host .trim-handle.left {
  left: 6px;
  border-radius: 4px;
}

#card-audio-recorder-host .trim-handle.right {
  right: 6px;
  left: auto;
  border-radius: 4px;
}

#card-audio-recorder-host .selection .trim-handle span {
  display: block;
  width: 4px;
  height: 10px;
  border-left: 2px solid currentColor;
  border-right: 2px solid currentColor;
  font-size: 0;
  line-height: 0;
}

#card-audio-recorder-host .trim-handle:hover {
  background: var(--accent-soft);
}

#card-audio-recorder-host .trim-handle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#card-audio-recorder-host .ticks {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  padding: 10px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

#card-audio-recorder-host .ticks span:nth-child(2), .ticks span:nth-child(3) { text-align: center; }
#card-audio-recorder-host .ticks span:nth-child(4) { text-align: right; }

#card-audio-recorder-host .edit-toolbar {
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr 0.9fr 1.7fr;
  align-items: stretch;
}

#card-audio-recorder-host .edit-button {
  border: 0;
  border-right: 1px solid var(--border);
  background: #fff;
  padding: 22px 28px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 18px;
  text-align: left;
}

#card-audio-recorder-host .edit-button:hover:not(:disabled) { background: var(--surface-muted); }
#card-audio-recorder-host .edit-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
#card-audio-recorder-host .edit-button svg { width: 36px; height: 36px; fill: currentColor; color: var(--accent); flex: 0 0 auto; }
#card-audio-recorder-host #cut-btn .cut-icon-img {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: block;
  object-fit: contain;
  /* Tint black silhouette PNG to toolbar accent (--accent: #5d2ee5). */
  filter: brightness(0) saturate(100%) invert(37%) sepia(93%) saturate(2878%) hue-rotate(242deg) brightness(95%) contrast(97%);
}
#card-audio-recorder-host #undo-btn .undo-icon-img {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: block;
  object-fit: contain;
}
#card-audio-recorder-host .edit-button strong { display: block; font-size: 1.07rem; }
#card-audio-recorder-host .edit-button small { display: block; margin-top: 4px; color: var(--muted); font-size: 0.95rem; }

#card-audio-recorder-host .toolbar-hint {
  margin: 0;
  padding: 22px 28px;
  color: var(--muted);
  line-height: 1.45;
  align-self: center;
}

#card-audio-recorder-host .play-button {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--accent);
  display: grid;
  place-items: center;
  position: relative;
}

#card-audio-recorder-host .play-button:hover:not(:disabled) { background: var(--accent-soft); }
#card-audio-recorder-host .play-button:disabled { opacity: 0.45; cursor: not-allowed; }
#card-audio-recorder-host .play-button svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
  grid-area: 1 / 1;
}

#card-audio-recorder-host .play-button .icon-pause {
  display: none;
  margin-left: -2px;
}

#card-audio-recorder-host .play-button.is-playing .icon-play {
  display: none;
}

#card-audio-recorder-host .play-button.is-playing .icon-pause {
  display: block;
}

#card-audio-recorder-host .primary-button:disabled,
#card-audio-recorder-host .secondary-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

#card-audio-recorder-host .play-time {
  display: flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

#card-audio-recorder-host .play-time strong { font-size: 0.95rem; font-weight: 600; }
#card-audio-recorder-host .play-time span { color: var(--muted); font-size: 0.9rem; }
#card-audio-recorder-host .play-time em { color: var(--accent); font-style: normal; font-size: 0.95rem; font-weight: 550; }

#card-audio-recorder-host .volume-control .volume-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

input[type="range"] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  accent-color: var(--accent);
}

#card-audio-recorder-host .car-audio-dialog-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-top: 28px;
}

#card-audio-recorder-host .car-audio-saving-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  text-align: center;
  padding: 2rem;
}

#card-audio-recorder-host .car-audio-saving-overlay[hidden] {
  display: none !important;
}

#card-audio-recorder-host .car-audio-saving-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: car-audio-saving-spin 0.8s linear infinite;
}

#card-audio-recorder-host .car-audio-saving-overlay p {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

#card-audio-recorder-host.car-audio-is-saving .car-audio-dialog {
  pointer-events: none;
}

@keyframes car-audio-saving-spin {
  to { transform: rotate(360deg); }
}

#card-audio-recorder-host .secondary-button,
#card-audio-recorder-host .primary-button {
  min-height: 60px;
  border-radius: var(--radius-sm);
  padding: 0 38px;
  font-weight: 700;
  font-size: 1.05rem;
}

#card-audio-recorder-host .secondary-button {
  min-width: 170px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text);
}
#card-audio-recorder-host .secondary-button:hover { background: var(--surface-muted); }

#card-audio-recorder-host .primary-button {
  min-width: 300px;
  border: 0;
  background: linear-gradient(135deg, var(--accent), #4820d2);
  color: #fff;
  box-shadow: 0 12px 26px rgba(93, 46, 229, 0.24);
}
#card-audio-recorder-host .primary-button:hover { filter: brightness(1.04); }

#card-audio-recorder-host .primary-button.is-busy {
  cursor: wait;
  filter: brightness(0.96);
  opacity: 0.92;
  pointer-events: none;
}

#card-audio-recorder-host .help-anchor {
  position: relative;
  flex: 0 0 auto;
}

#card-audio-recorder-host .help-popover {
  position: fixed;
  top: 0;
  left: 0;
  width: min(340px, calc(100vw - 24px));
  margin: 0;
  padding: 16px 18px;
  background: #171827;
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(0,0,0,0.28);
  z-index: 10060;
}
#card-audio-recorder-host .help-popover p,
#card-audio-recorder-host .help-popover ol {
  margin: 8px 0 0;
  padding-left: 1.2rem;
  color: #d7d9e2;
  line-height: 1.45;
}

#card-audio-recorder-host .help-popover li + li { margin-top: 4px; }

body.dialog-closed .page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: #fff;
}

@media (min-width: 961px) {
  #card-audio-recorder-host.page-shell {
    padding: max(32px, env(safe-area-inset-top, 0px)) max(32px, env(safe-area-inset-right, 0px)) max(32px, env(safe-area-inset-bottom, 0px)) max(32px, env(safe-area-inset-left, 0px));
  }
}

@media (max-width: 960px) {
  #card-audio-recorder-host.page-shell {
    padding: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  }
  #card-audio-recorder-host .car-audio-dialog { width: 100%; max-width: 100%; padding: 28px 22px; }
  #card-audio-recorder-host .timeline-block { padding: 0 12px 16px; }

  #card-audio-recorder-host .timeline-row {
    flex-direction: column;
    gap: 12px;
  }

  #card-audio-recorder-host .timeline-main { order: 1; width: 100%; }

  #card-audio-recorder-host .timeline-controls {
    order: 2;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    padding-top: 0;
    width: 100%;
    gap: 12px 16px;
  }

  #card-audio-recorder-host .volume-control { max-width: 140px; }

  #card-audio-recorder-host .waveform { height: 100px; }
  #card-audio-recorder-host .waveform.is-live-recording {
    height: 152px;
    min-height: 152px;
  }
  #card-audio-recorder-host .time-summary { padding: 20px 16px 12px; }
  #card-audio-recorder-host .record-panel { align-items: stretch; flex-direction: column; }
  #card-audio-recorder-host .record-status {
    justify-content: center;
    align-items: center;
    gap: 20px;
    width: 100%;
  }
  #card-audio-recorder-host .record-button {
    width: 88px;
    height: 88px;
    min-width: 88px;
    min-height: 88px;
    max-width: 88px;
    max-height: 88px;
    flex: 0 0 88px;
  }
  #card-audio-recorder-host .record-actions { border-left: 0; border-top: 1px solid var(--border); padding-top: 16px; }
  #card-audio-recorder-host .edit-toolbar { grid-template-columns: 1fr; }
  #card-audio-recorder-host .edit-button { border-right: 0; border-bottom: 1px solid var(--border); }
  #card-audio-recorder-host .volume-control .volume-icon,
  #card-audio-recorder-host .volume-control .volume {
    display: none;
  }
  #card-audio-recorder-host .car-audio-dialog-footer { flex-direction: column-reverse; align-items: stretch; }
  #card-audio-recorder-host .primary-button, .secondary-button { width: 100%; min-width: 0; }
}

@media (max-width: 480px) {
  #card-audio-recorder-host .timeline-block { padding: 0 8px 14px; }
  #card-audio-recorder-host .waveform { height: 92px; }
  #card-audio-recorder-host .waveform.is-live-recording {
    height: 148px;
    min-height: 148px;
  }
  #card-audio-recorder-host .waveform-empty { font-size: 0.95rem; padding: 0 12px; text-align: center; }
}
