/* ============================================================
   Wraptalk styles — Table of Contents
   ============================================================
   01 / Tokens & Reset           — design tokens, base body
   02 / Layout & Hero            — shell, hero text, panels, grid
   03 / Media Section            — section / panel / file-card 共通
   04 / File Select Button       — file-action 系
   05 / Waveform                 — canvas, status, status-dots
   06 / Toolbar & Zoom           — media-toolbar, zoom controls
   07 / Preview Controls         — preview button, time, volume, seek
   08 / Setting Card             — setting-card 群
   09 / Form Inputs              — number / select / focus
   10 / Actions & Buttons        — process button, secondary
   11 / Status & Log             — meter, log-box, note
   12 / Responsive               — @media (max-width: 720px)
   ============================================================ */


/* ============================================================
   01 / Tokens & Reset
   ============================================================ */

:root {
  /* Base palette (RGB triplets — share with alpha)
     `--white-rgb` is historically named but in dark mode it represents the
     dominant panel surface RGB, not pure white. Pure white is `--text-light`. */
  --ink-rgb: 241, 245, 249;            /* slate-100 — primary text */
  --accent-rgb: 109, 40, 217;          /* violet-700 — deep purple for buttons */
  --accent-deep-rgb: 167, 139, 250;    /* violet-400 — for text/border accents */
  --white-rgb: 30, 41, 59;             /* slate-800 — panel surface */
  --status-overlay-rgb: 71, 85, 105;   /* slate-600 */
  --shadow-rgb: 0, 0, 0;

  /* Foreground / accent tokens */
  --bg: #0F172A;                       /* slate-900 — body background */
  --ink: rgb(var(--ink-rgb));
  --accent: rgb(var(--accent-rgb));
  --accent-deep: rgb(var(--accent-deep-rgb));
  --accent-soft: #7C3AED;              /* violet-600 — subtle gradient end */
  --muted: #94A3B8;                    /* slate-400 — sub text */

  /* Surfaces (panel + variants) */
  --surface-warm: rgba(var(--white-rgb), 1);
  --surface-warm-alt: #1E293B;         /* slate-800 — cards */
  --surface-peach: #1E293B;
  --surface-peach-hover: #334155;      /* slate-700 — hover */
  --surface-cream: #334155;
  --surface-cream-soft: #1E293B;
  --surface-ring: rgba(var(--white-rgb), 0.96);
  --surface-dark: #020617;             /* slate-950 — log box */

  /* Text on dark / contrast surfaces */
  --text-light: #FFFFFF;
  --text-on-dark: #F9FAFB;

  /* Derived */
  --panel: #1E293B;
  --line: #334155;                     /* slate-700 — border */
  --shadow: 0 24px 60px rgba(var(--shadow-rgb), 0.4);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Avenir Next", "Hiragino Sans", sans-serif;
  background: var(--bg);
}

/* ============================================================
   02 / Layout & Hero
   ============================================================ */

.l--shell {
  width: min(1480px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 56px 24px 72px;
}

.l--hero {
  margin-bottom: 24px;
}

h1 {
  margin: 0;
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
}

.c--lede {
  width: 100%;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.75;
}

.c--lede-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.7;
  opacity: 0.85;
}

.c--lede-details {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.c--lede-details > summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 140ms ease;
}

.c--lede-details > summary:hover {
  color: var(--ink);
}

.c--lede-details > summary::-webkit-details-marker {
  display: none;
}

.c--lede-details > summary::before {
  content: "ⓘ";
  font-size: 0.96rem;
}

.c--lede-details[open] > summary::before {
  content: "ⓘ";
}

.l--panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.l--panel + .l--panel {
  margin-top: 24px;
}

.l--grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

/* ============================================================
   03 / Media Section
   ============================================================ */

.c--media-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  font-size: 0.92rem;
}

.l--section-header {
  display: flex;
  align-items: center;
  gap: 20px;
}

.c--field-heading {
  display: block;
  margin-top: 0;
  margin-bottom: 0;
  color: var(--ink);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

#quality-heading {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

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

.c--media-section small {
  color: var(--muted);
  line-height: 1.5;
}

.c--media-section + .c--media-section {
  margin-top: 36px;
}

.c--media-meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.c--media-meta:empty {
  display: none;
}

.c--media-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 14px;
  min-width: 0;
  margin-top: 14px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.c--media-panel > :not(.c--setting-card) {
  width: 100%;
}

/* ============================================================
   04 / File Select Button
   ============================================================ */

.c--file-action {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  appearance: none;
  border: 1px solid rgba(var(--accent-deep-rgb), 0.3);
  background: var(--surface-peach);
  color: var(--accent-deep);
  font-weight: 800;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.c--file-action:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(var(--accent-deep-rgb), 0.52);
  background: var(--surface-peach-hover);
}

.c--file-action-primary {
  width: min(100%, 336px);
  min-height: 48px;
  justify-content: center;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 0.95rem;
}

.c--file-action-primary.is--empty {
  background: var(--accent);
  border-color: transparent;
  color: var(--text-light);
}

.c--file-action-primary.is--empty:hover:not(:disabled) {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--text-light);
}

.l--heading-action {
  display: flex;
  justify-content: flex-start;
  margin-top: 0;
  flex-shrink: 0;
}

/* ============================================================
   05 / Waveform
   ============================================================ */

.c--waveform-shell {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  margin-top: 0;
  padding: 10px 12px 6px;
  border-radius: 12px;
  background: var(--surface-warm-alt);
  border: 1px solid rgba(var(--ink-rgb), 0.12);
  overflow: hidden;
}

.c--waveform-scroll {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-gutter: stable;
  padding-bottom: 4px;
}

.c--waveform-canvas {
  display: block;
  height: 88px;
  cursor: default;
}

/* ============================================================
   06 / Toolbar & Zoom
   ============================================================ */

.l--media-toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.l--media-toolbar > .l--preview-controls {
  justify-self: start;
}

.l--media-toolbar > .l--volume-inline {
  justify-self: center;
}

.l--zoom-toolbar {
  display: flex;
  justify-self: end;
}

.c--zoom-control {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.l--zoom-buttons {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.c--zoom-button {
  appearance: none;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(var(--ink-rgb), 0.2);
  border-radius: 10px;
  background: rgba(var(--white-rgb), 0.96);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.c--zoom-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(var(--accent-deep-rgb), 0.42);
  background: var(--surface-cream);
}

.c--zoom-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.c--zoom-value {
  min-width: 3.3em;
  text-align: center;
  color: var(--ink);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.l--zoom-presets {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.c--zoom-preset {
  appearance: none;
  min-width: 48px;
  height: 32px;
  padding: 0 10px;
  text-align: center;
  border: 1px solid rgba(var(--ink-rgb), 0.2);
  border-radius: 10px;
  background: rgba(var(--white-rgb), 0.96);
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.c--zoom-preset:hover {
  border-color: rgba(var(--accent-deep-rgb), 0.42);
  background: var(--surface-cream);
}

.c--zoom-preset.is--active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--white);
}

.l--jump-buttons {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
}

.c--jump-button {
  appearance: none;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(var(--ink-rgb), 0.2);
  border-radius: 10px;
  background: rgba(var(--white-rgb), 0.96);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.c--jump-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(var(--accent-deep-rgb), 0.42);
  background: var(--surface-cream);
}

.c--jump-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.c--jump-trim-start::before,
.c--jump-trim-end::before,
.c--jump-fade-start::before {
  content: "";
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.c--jump-trim-start::before {
  background: rgb(251, 191, 36);
}

.c--jump-trim-end::before {
  background: rgb(244, 63, 94);
}

.c--jump-fade-start::before {
  background: rgb(74, 222, 128);
}

.c--waveform-status {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  border-radius: 10px;
  background: rgba(var(--status-overlay-rgb), 0.82);
  color: var(--text-on-dark);
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 24px rgba(var(--ink-rgb), 0.18);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.c--waveform-status.is--visible {
  opacity: 1;
}

.c--waveform-status-dots {
  display: inline-flex;
  gap: 0.08em;
  margin-left: 0.08em;
}

.c--waveform-status-dot {
  opacity: 0;
  animation: waveform-dot 1.2s ease-in-out infinite;
}

.c--waveform-status-dot:nth-child(2) {
  animation-delay: 0.18s;
}

.c--waveform-status-dot:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes waveform-dot {
  0%, 20%, 100% {
    opacity: 0;
  }

  50% {
    opacity: 1;
  }
}

/* ============================================================
   07 / Preview Controls
   ============================================================ */

.l--preview-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 32px;
}

.l--preview-button-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.l--volume-inline {
  display: flex;
  align-items: center;
  gap: 12px;
}

.l--volume-inline label {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--muted);
}

.c--media-section .l--volume-inline input[type="number"] {
  width: 72px;
  max-width: 72px;
  text-align: right;
}

.l--input-suffix {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.c--input-suffix {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--muted);
}

.l--label-with-info {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.c--info-button {
  appearance: none;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 140ms ease, background 140ms ease;
}

.c--info-button:hover {
  color: var(--ink);
  background: rgba(var(--ink-rgb), 0.08);
}

.c--modal-body p {
  margin: 0 0 12px;
  line-height: 1.6;
}

.c--modal-body p:last-child {
  margin-bottom: 0;
}

.c--modal-body ul {
  margin: 0 0 12px;
  padding-left: 1.5em;
  line-height: 1.7;
}

.c--modal-body li {
  margin-bottom: 4px;
}

.c--preview-button {
  appearance: none;
  border: 1px solid rgba(var(--ink-rgb), 0.2);
  background: rgba(var(--white-rgb), 0.95);
  color: var(--ink);
  border-radius: 10px;
  min-width: 120px;
  min-height: 36px;
  padding: 0 14px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.c--preview-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(var(--accent-deep-rgb), 0.42);
  background: var(--surface-cream);
  color: var(--ink);
}

.c--preview-button.is--playing {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-soft) 100%);
  border-color: transparent;
  color: var(--text-light);
}

.c--preview-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.c--preview-button-ghost {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  justify-content: center;
  background: rgba(var(--white-rgb), 0.9);
}

.l--preview-scrubber {
  display: block;
  margin-top: 0;
}

.c--preview-seek {
  display: none;
  width: 100%;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
}

.c--preview-seek:focus,
.c--preview-seek:focus-visible {
  outline: none;
  box-shadow: none;
}

.c--preview-seek::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 8px;
  background: rgba(var(--ink-rgb), 0.18);
}

.c--preview-seek::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -6px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--surface-ring);
}

.c--preview-seek::-moz-range-track {
  height: 6px;
  border: 0;
  border-radius: 8px;
  background: rgba(var(--ink-rgb), 0.18);
}

.c--preview-seek::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--surface-ring);
}

.c--preview-time {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

/* ============================================================
   08 / Setting Card
   ============================================================ */

.c--setting-card {
  display: flex;
  flex-direction: column;
  width: min(100%, 360px);
  overflow: hidden;
  border: 1px solid rgba(var(--ink-rgb), 0.12);
  border-radius: 12px;
  background: var(--surface-warm-alt);
}

.c--setting-card-header {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 14px 18px 12px;
  border-bottom: 1px solid rgba(var(--ink-rgb), 0.08);
  background: var(--surface-warm-alt);
}

.c--setting-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.15;
}

/* Color swatch indicator for cards tied to a waveform handle */
.c--setting-card[aria-labelledby$="-fade-label"] .c--setting-card-title::before,
.c--setting-card[aria-labelledby="intro-pad-label"] .c--setting-card-title::before,
.c--setting-card[aria-labelledby="outro-overlap-label"] .c--setting-card-title::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.c--setting-card[aria-labelledby$="-fade-label"] .c--setting-card-title::before {
  background: rgb(34, 197, 94);
}

.c--setting-card[aria-labelledby="intro-pad-label"] .c--setting-card-title::before {
  background: rgb(251, 191, 36);
}

.c--setting-card[aria-labelledby="outro-overlap-label"] .c--setting-card-title::before {
  background: rgb(244, 63, 94);
}

/* Sub-label swatches in 使用範囲 card (start = yellow, end = red) */
.c--setting-card[aria-labelledby="talk-trim-label"] .c--setting-field-label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.c--setting-card[aria-labelledby="talk-trim-label"] .c--setting-field-label::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.c--setting-card[aria-labelledby="talk-trim-label"] .l--inline-setting:first-child .c--setting-field-label::before {
  background: rgb(251, 191, 36);
}

.c--setting-card[aria-labelledby="talk-trim-label"] .l--inline-setting:last-child .c--setting-field-label::before {
  background: rgb(244, 63, 94);
}

.c--setting-card-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
}

.c--setting-card-body > p {
  margin: 0;
}

.l--setting-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 336px));
  gap: 12px;
  align-items: start;
}

.l--inline-setting {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 4px;
}

.c--setting-field-label {
  flex-basis: 100%;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

/* ============================================================
   09 / Form Inputs
   ============================================================ */

.c--media-section input:not([type="range"]),
.c--media-section select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid rgba(var(--ink-rgb), 0.28);
  border-radius: 10px;
  background: rgba(var(--white-rgb), 0.98);
  font: inherit;
  color: var(--ink);
}

.c--setting-card > input,
.c--setting-card > select,
.l--inline-setting > input,
.l--inline-setting > select {
  width: min(100%, 192px);
  max-width: 192px;
}

.c--setting-card input[type="number"] {
  width: min(100%, 120px);
  max-width: 120px;
}

.c--radio-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.c--radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid rgba(var(--ink-rgb), 0.18);
  background: rgba(var(--white-rgb), 0.6);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  transition: background 140ms ease, border-color 140ms ease;
}

.c--radio:hover {
  background: var(--surface-cream);
  border-color: rgba(var(--accent-deep-rgb), 0.32);
}

.c--radio input[type="radio"] {
  margin: 0;
  accent-color: var(--accent);
}

.c--radio:has(input[type="radio"]:checked) {
  background: rgba(var(--accent-rgb), 0.1);
  border-color: rgba(var(--accent-deep-rgb), 0.45);
  color: var(--accent-deep);
}

.l--inline-setting input[type="number"] {
  width: 100px;
  max-width: 100px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}


.c--media-section input:not([type="range"]):focus,
.c--media-section select:focus {
  outline: 2px solid rgba(var(--accent-deep-rgb), 0.22);
  outline-offset: 2px;
  border-color: rgba(var(--accent-deep-rgb), 0.5);
}

/* ============================================================
   10 / Actions & Buttons
   ============================================================ */

.l--actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
}

.l--actions--sticky {
  position: sticky;
  bottom: 16px;
  z-index: 50;
  margin-top: 32px;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 14px;
}

/* ============================================================
   13 / Modal
   ============================================================ */

.c--modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.c--modal.is--open {
  display: flex;
}

.c--modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.c--modal-window {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface-warm-alt);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.c--modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 20px;
  border-bottom: 1px solid var(--line);
}

.c--modal-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.c--modal-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 2.25rem;
  line-height: 1;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 140ms ease;
}

.c--modal-close:hover {
  background: var(--surface-peach-hover);
}

.c--modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.c--modal-body .l--actions {
  margin-top: 0;
}

.l--actions .c--button {
  flex: 0 0 280px;
  max-width: 100%;
}

.c--button {
  appearance: none;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--text-light);
  padding: 14px 22px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, opacity 140ms ease;
}

.c--button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--accent-soft);
  color: var(--text-light);
}

.c--button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.c--button-secondary {
  background: var(--surface-warm-alt);
  color: var(--ink);
  border: 1px solid rgba(var(--ink-rgb), 0.22);
}

.c--button-secondary:hover:not(:disabled) {
  background: var(--surface-peach-hover);
  color: var(--ink);
}

/* ============================================================
   11 / Status & Log
   ============================================================ */

.c--status {
  display: none;
  margin-top: 8px;
}

.c--status.is--visible {
  display: block;
}

.c--mix-preview {
  display: none;
  margin-top: 16px;
  padding: 14px 18px;
  border: 1px solid rgba(var(--ink-rgb), 0.12);
  border-radius: 12px;
  background: var(--surface-warm-alt);
}

.c--mix-preview.is--visible {
  display: block;
}

.c--mix-preview-clip {
  display: none;
}

.c--mix-preview-clip.is--visible {
  display: block;
}

.c--mix-preview-clip + .c--mix-preview-clip {
  margin-top: 14px;
}

.c--mix-preview-label {
  margin: 0 0 8px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--muted);
}

.c--mix-preview audio {
  display: block;
  width: 100%;
}

.c--meter {
  overflow: hidden;
  height: 10px;
  border-radius: 8px;
  background: rgba(var(--ink-rgb), 0.16);
}

.c--meter-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  transition: width 120ms linear;
}

.l--status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 0;
}

#statusText {
  margin: 0;
  font-weight: 700;
}

.c--log-toggle {
  appearance: none;
  margin: 0;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color 140ms ease;
}

.c--log-toggle:hover {
  color: var(--ink);
  text-decoration: underline;
}

.c--log-box {
  min-height: 180px;
  max-height: 300px;
  overflow: auto;
  margin: 10px 0 0;
  padding: 16px;
  border-radius: 12px;
  background: var(--surface-dark);
  color: var(--text-on-dark);
  font-family: "SFMono-Regular", "Menlo", monospace;
  font-size: 0.8rem;
  line-height: 1.55;
}

.c--log-box.is--hidden {
  display: none;
}

.c--ellipsis {
  display: inline-block;
}

.c--ellipsis > span {
  display: inline-block;
  opacity: 0.2;
  animation: ellipsis-pulse 1.2s infinite;
}

.c--ellipsis > span:nth-child(2) { animation-delay: 0.18s; }
.c--ellipsis > span:nth-child(3) { animation-delay: 0.36s; }

@keyframes ellipsis-pulse {
  0%, 80%, 100% { opacity: 0.2; }
  40% { opacity: 1; }
}

.c--footer {
  margin: 0 auto 32px;
  padding: 16px 24px;
  max-width: 880px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

.c--footer-copy {
  margin: 0;
}

.c--footer-link {
  color: var(--muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 140ms ease;
}

.c--footer-link:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ============================================================
   12 / Responsive
   ============================================================ */

@media (max-width: 720px) {
  .l--shell {
    width: min(100vw - 20px, 960px);
    padding: 28px 16px 72px;
  }

  .l--panel {
    padding: 0;
    border-radius: 0;
  }

  .l--actions {
    flex-direction: column;
  }

  .l--media-toolbar {
    grid-template-columns: 1fr;
  }

  .l--section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .l--zoom-toolbar,
  .l--preview-controls,
  .l--volume-inline {
    justify-content: center;
    justify-self: center;
  }

  .l--setting-columns {
    grid-template-columns: 1fr;
  }
}
