:root {
  --bg: #f6f2ea;
  --ink: #1f1a17;
  --muted: #5a514a;
  --card: #fff9f1;
  --accent: #d4551f;
  --accent-dark: #b64517;
  --border: #e5d8c7;
  --shadow: 0 18px 40px rgba(31, 26, 23, 0.12);
  --radius: 20px;
  --pad: 22px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Helvetica Neue", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top, #fff6e8 0%, var(--bg) 55%, #efe3d2 100%);
  min-height: 100vh;
}

body.overlay-open {
  overflow: hidden;
}

.app {
  max-width: 860px;
  margin: 0 auto;
  padding: 48px 20px 80px;
  display: grid;
  gap: 24px;
}

.page-actions {
  display: flex;
  justify-content: flex-end;
}

.usage-guide-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #eadfd2;
  background: #fff;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 10px 20px rgba(31, 26, 23, 0.08);
}

.usage-guide-btn:hover {
  background: #fffaf4;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(31, 26, 23, 0.16);
}

.hero {
  background: linear-gradient(120deg, #f6d7b8, #f4b08a);
  color: #2c1c12;
  padding: 32px var(--pad);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero h1 {
  font-size: clamp(2.2rem, 3vw, 3.2rem);
  margin: 10px 0;
  letter-spacing: -0.02em;
}

.hero .subhead {
  margin: 0;
  max-width: 600px;
  color: #3d281b;
  font-size: 1.05rem;
}

.eyebrow {
  margin: 0;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  opacity: 0.7;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--pad);
  box-shadow: var(--shadow);
}

.card h2 {
  margin-top: 0;
  font-size: 1.2rem;
}

ol {
  margin: 12px 0 16px 20px;
  padding: 0;
  color: var(--muted);
}

.hint {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.pause-btn {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--ink);
  box-shadow: 0 12px 22px rgba(31, 26, 23, 0.12);
}

.pause-btn:hover:not(:disabled) {
  background: #fffaf4;
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(31, 26, 23, 0.18);
}

.pause-btn.is-paused {
  border-color: rgba(34, 197, 94, 0.5);
  color: #166534;
  background: #f0fdf4;
  box-shadow: 0 12px 22px rgba(34, 197, 94, 0.2);
}

.settings {
  padding: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #fffaf4 0%, #fff7ef 55%, #fff9f1 100%);
  border-color: #ead7c3;
}

.settings-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  padding: 18px 22px;
  background: linear-gradient(120deg, #fff3e4, #fbe4cf);
  border-bottom: 1px solid rgba(229, 216, 199, 0.8);
}

.settings-summary::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(212, 85, 31, 0.15);
  flex: 0 0 auto;
}

.settings-summary::-webkit-details-marker {
  display: none;
}

.settings-summary::marker {
  content: "";
}

.settings-summary:focus {
  outline: 2px solid rgba(212, 85, 31, 0.4);
  outline-offset: -2px;
  border-radius: 16px;
}

.settings-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.settings-meta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.75);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(229, 216, 199, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.settings-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(229, 216, 199, 0.9);
  transition: transform 0.2s ease;
}

.settings[open] .settings-icon {
  transform: rotate(180deg);
}

.settings-state--open {
  display: none;
}

.settings[open] .settings-state--open {
  display: inline;
}

.settings[open] .settings-state--closed {
  display: none;
}

.settings-content {
  padding: 18px 22px 22px;
  background: linear-gradient(180deg, #fff9f1 0%, #fff7ed 100%);
  display: grid;
  gap: 12px;
}

.setting-item {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 8px 16px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #f0dfcc;
  background: #fff;
  box-shadow: 0 8px 18px rgba(31, 26, 23, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.setting-item:focus-within {
  border-color: rgba(212, 85, 31, 0.45);
  box-shadow: 0 12px 26px rgba(31, 26, 23, 0.12);
  transform: translateY(-1px);
}

.settings .toggle {
  display: contents;
}

.settings .toggle input[type="checkbox"] {
  width: 46px;
  height: 26px;
  margin: 0;
  border-radius: 999px;
  border: 1px solid #e2cdb7;
  background: linear-gradient(180deg, #f6eee4, #efe2d3);
  position: relative;
  appearance: none;
  cursor: pointer;
  box-shadow: inset 0 2px 4px rgba(31, 26, 23, 0.12);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.settings .toggle input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 10px rgba(31, 26, 23, 0.2);
  transition: transform 0.2s ease;
}

.settings .toggle input[type="checkbox"]:checked {
  background: linear-gradient(120deg, #f97316, #d4551f);
  border-color: #d4551f;
  box-shadow: inset 0 2px 6px rgba(31, 26, 23, 0.2);
}

.settings .toggle input[type="checkbox"]:checked::after {
  transform: translateX(20px);
}

.settings .toggle input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(212, 85, 31, 0.2);
}

.settings .toggle span {
  font-weight: 600;
  letter-spacing: -0.01em;
}

.settings .hint {
  grid-column: 2;
  margin: 0;
  font-size: 0.9rem;
}

.api-key-input {
  grid-column: 2;
  margin: 4px 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px dashed #e4cdb7;
  background: #fff7ef;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.api-key-input .field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: 10px;
}

.api-key-input .field-label:first-child {
  margin-top: 0;
}

.api-key-input input,
.api-key-input select,
.api-key-input textarea {
  display: block;
  width: 100%;
  max-width: 400px;
  padding: 10px 14px;
  border: 1px solid #ead7c3;
  border-radius: 8px;
  font-size: 0.95rem;
  background: #fffdf9;
  font-family: inherit;
}

.api-key-input textarea {
  max-width: 100%;
  resize: vertical;
  min-height: 100px;
}

.api-key-input input:focus,
.api-key-input select:focus,
.api-key-input textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(212, 85, 31, 0.1);
}

.api-key-input input.missing-key,
.api-key-input input.missing-key:focus {
  border-color: #dc2626;
  background: #fef2f2;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.api-key-input input.missing-key::placeholder {
  color: #dc2626;
}

.inline-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--ink);
}

.inline-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.inline-toggle label {
  cursor: pointer;
}

.api-key-input .translation-warning {
  margin-top: 8px;
  font-size: 0.85rem;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  padding: 8px 10px;
  border-radius: 8px;
}

.transcription-notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.transcription-notes-grid > .card {
  display: flex;
  flex-direction: column;
  min-height: 380px;
  align-items: stretch;
}

.transcription {
  background: #f0fdf4;
  border-color: #bbf7d0;
  position: relative;
}

.transcription-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.transcription-header h2 {
  margin: 0;
}

.transcription-language {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: #166534;
  opacity: 0.85;
}

.copy-btn {
  background: transparent;
  border: 1px solid #bbf7d0 !important;
  color: #166534;
  padding: 6px 12px !important;
  border-radius: 8px !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s ease, transform 0.2s ease;
  box-shadow: none !important;
  flex-shrink: 0;
}

.copy-btn:hover {
  background: #dcfce7;
  transform: translateY(-1px);
}

.copy-btn .material-symbols-rounded {
  font-size: 1.1rem;
}

.copy-btn-label {
  font-family: inherit;
}

.transcription h2 {
  color: #166534;
}

.transcription-text {
  flex: 1;
  min-height: 220px;
  max-height: 420px;
  overflow-y: auto;
  padding: 16px;
  background: #fff;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--ink);
  white-space: pre-wrap;
}

.notes {
  background: #fefce8;
  border-color: #fde68a;
  position: relative;
}

.notes-header {
  margin-bottom: 12px;
}

.notes-header h2 {
  margin: 0 0 4px;
  color: #92400e;
}

.notes-hint {
  margin: 0;
  font-size: 0.9rem;
  color: #92400e;
  opacity: 0.85;
}

.notes-text {
  flex: 1;
  width: 100%;
  max-width: 100%;
  display: block;
  min-height: 220px;
  max-height: 420px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #fde68a;
  background: #fff;
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--ink);
  resize: none;
}

.translation {
  background: #fff7ed;
  border-color: #fed7aa;
  position: relative;
}

.translation-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.translation-header h2 {
  margin: 0;
  color: #92400e;
}

.translation-target {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: #92400e;
  opacity: 0.85;
}

.translation-text {
  min-height: 120px;
  max-height: 300px;
  overflow-y: auto;
  padding: 16px;
  background: #fff;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--ink);
  white-space: pre-wrap;
}

.translation-text .translation-block {
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 10px;
  white-space: pre-wrap;
}

.translation-text .translation-block:last-child {
  margin-bottom: 0;
}

.translation-text .translation-block--confirmed {
  background: #fff;
  border: 1px solid #f3e8d7;
}

.translation-text .translation-block--draft {
  background: #fef9c3;
  border: 1px solid #fde68a;
}

.summary {
  background: #eff6ff;
  border-color: #bfdbfe;
  position: relative;
}

.summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.summary-header h2 {
  margin: 0;
}

.summary h2 {
  color: #1e40af;
}

.summary .copy-btn {
  border-color: #bfdbfe;
  color: #1e40af;
}

.summary .copy-btn:hover {
  background: #dbeafe;
}

.translation .copy-btn {
  border-color: #fed7aa;
  color: #92400e;
}

.translation .copy-btn:hover {
  background: #ffedd5;
}

.transcription .copy-btn,
.summary .copy-btn,
.translation .copy-btn {
  position: absolute;
  top: var(--pad);
  right: var(--pad);
}

.summary-text {
  min-height: 120px;
  max-height: 500px;
  overflow-y: auto;
  padding: 16px;
  background: #fff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink);
}

.summary-text h1 {
  font-size: 1.4rem;
  margin-top: 0;
  margin-bottom: 0.8em;
  color: #1e40af;
  border-bottom: 2px solid #bfdbfe;
  padding-bottom: 0.3em;
}

.summary-text h2 {
  font-size: 1.2rem;
  margin-top: 1.2em;
  margin-bottom: 0.5em;
  color: #1e40af;
}

.summary-text h3 {
  font-size: 1.05rem;
  margin-top: 1em;
  margin-bottom: 0.4em;
  color: #2563eb;
}

.summary-text p {
  margin: 0.6em 0;
}

.summary-text blockquote {
  margin: 0.8em 0;
  padding: 0.6em 1em;
  border-left: 4px solid #93c5fd;
  background: #f8fafc;
  color: #334155;
  border-radius: 8px;
}

.summary-text ul,
.summary-text ol {
  margin: 0.5em 0;
  padding-left: 1.5em;
}

.summary-text ul ul,
.summary-text ol ol,
.summary-text ul ol,
.summary-text ol ul {
  margin: 0.3em 0;
}

.summary-text li {
  margin: 0.3em 0;
}

.summary-text strong {
  color: #1e3a8a;
}

.summary-text code {
  background: #e0e7ff;
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

.summary-text table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
}

.summary-text th,
.summary-text td {
  border: 1px solid #bfdbfe;
  padding: 8px 12px;
  text-align: left;
}

.summary-text th {
  background: #eff6ff;
  font-weight: 600;
}

.summary-text .needs-confirm {
  background: #fef3c7;
  color: #92400e;
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

.summary-text .to-continue {
  background: #dbeafe;
  color: #1e40af;
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

.summary-text hr {
  border: none;
  border-top: 2px solid #bfdbfe;
  margin: 1.5em 0;
}

button,
.download {
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 12px 20px;
  border-radius: 999px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
  box-shadow: none;
}

.primary {
  background: #8b5cf6;
  color: #fff;
  box-shadow: 0 14px 30px rgba(139, 92, 246, 0.35);
}

.primary:hover:not(:disabled) {
  background: #7c3aed;
  transform: translateY(-2px);
}

.primary.requesting {
  background: #06b6d4;
  box-shadow: 0 14px 30px rgba(6, 182, 212, 0.35);
}

.primary.requesting:hover:not(:disabled) {
  background: #0891b2;
}

.primary.recording {
  background: #ef4444;
  box-shadow: 0 14px 30px rgba(239, 68, 68, 0.35);
}

.primary.recording:hover:not(:disabled) {
  background: #dc2626;
}

.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink);
}

.ghost:hover:not(:disabled) {
  box-shadow: 0 10px 20px rgba(31, 26, 23, 0.12);
  transform: translateY(-1px);
}

.status {
  display: grid;
  gap: 6px;
  padding: 12px 4px 0;
  color: var(--muted);
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
  color: var(--ink);
}

.timer {
  font-variant-numeric: tabular-nums;
  background: #1f1a17;
  color: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.95rem;
}

.details {
  font-size: 0.95rem;
}

.upload-progress {
  display: grid;
  gap: 6px;
  margin-top: 4px;
}

.upload-progress-text {
  font-size: 0.9rem;
  color: var(--muted);
}

.upload-progress-bar {
  height: 8px;
  border-radius: 999px;
  background: #f1e7ff;
  border: 1px solid var(--border);
  overflow: hidden;
}

.upload-progress-bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #8b5cf6, #06b6d4);
  transition: width 0.2s ease;
}

.waveform {
  width: 100%;
  height: 160px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff3e6;
}

.output {
  display: grid;
  gap: 12px;
}

.output-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

.output audio {
  flex: 1;
  min-width: 0;
}

.output .download {
  flex: 0 0 20%;
  padding: 12px 20px;
  justify-content: center;
}

.download {
  display: inline-flex;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  padding: 6px 10px;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  box-shadow: 0 8px 16px rgba(31, 26, 23, 0.1);
}

.download.small {
  padding: 6px 10px;
  font-size: 0.9rem;
}

.download:hover {
  transform: translateY(-1px);
  background: #fffaf4;
  box-shadow: 0 12px 24px rgba(31, 26, 23, 0.16);
}

.download.disabled {
  pointer-events: none;
  opacity: 0.5;
}

.takes-list {
  display: grid;
  gap: 16px;
}

.takes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.takes-header h2 {
  margin: 0;
  flex: 1;
}

.takes-columns {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.takes-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.takes-meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.95rem;
}

.takes-pagination {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}

.takes-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #eadfd2;
  background: #fff;
  box-shadow: 0 10px 20px rgba(31, 26, 23, 0.08);
  font-variant-numeric: tabular-nums;
}

.takes-pagination-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 6px 8px;
  border-radius: 14px;
  border: 1px solid #eadfd2;
  background: #fff;
  box-shadow: 0 10px 20px rgba(31, 26, 23, 0.08);
}

.takes-pagination-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 14px;
  border: 1px solid #eadfd2;
  background: #fff;
  box-shadow: 0 10px 20px rgba(31, 26, 23, 0.08);
  font-weight: 600;
  color: #6b625c;
  margin-left: auto;
}

.takes-page-label,
.takes-page-of,
.takes-page-total {
  white-space: nowrap;
}

.takes-page-total {
  font-variant-numeric: tabular-nums;
}

.takes-page-select {
  min-width: 72px;
  padding: 6px 28px 6px 12px;
  border-radius: 12px;
  border: 1px solid #e6e0d8;
  background-color: #fff;
  color: #4a3f37;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #6b625c 50%),
    linear-gradient(135deg, #6b625c 50%, transparent 50%),
    linear-gradient(to right, #e6e0d8, #e6e0d8);
  background-position:
    calc(100% - 16px) 50%,
    calc(100% - 11px) 50%,
    calc(100% - 30px) 50%;
  background-size: 6px 6px, 6px 6px, 1px 65%;
  background-repeat: no-repeat;
}

.takes-page-select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.pagination-btn,
.pagination-page {
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid #e6e0d8;
  background: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  color: #6b625c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(31, 26, 23, 0.08);
  font-variant-numeric: tabular-nums;
}

.pagination-arrow {
  font-size: 1.1rem;
  padding: 0;
}

.pagination-page.is-active {
  background: #3b6df6;
  border-color: #3b6df6;
  color: #fff;
  box-shadow: 0 8px 18px rgba(59, 109, 246, 0.35);
}

.pagination-page:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.pagination-page.is-active:disabled {
  opacity: 1;
  cursor: default;
  box-shadow: 0 8px 18px rgba(59, 109, 246, 0.35);
}

.pagination-ellipsis {
  font-weight: 600;
  color: #9b928a;
  padding: 0 4px;
}

.pagination-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

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

.takes-actions .ghost {
  padding: 8px 14px;
  font-size: 0.9rem;
  background: #fff1e6;
  border: 1px solid rgba(212, 85, 31, 0.45);
  color: #8a3a12;
  box-shadow: 0 10px 20px rgba(212, 85, 31, 0.18);
}

.takes-actions .ghost:hover:not(:disabled) {
  background: #ffe3d1;
  border-color: rgba(212, 85, 31, 0.65);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(212, 85, 31, 0.22);
}

.download-all {
  background: #1f1a17;
  color: #fff;
  padding: 10px 16px;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.download-all:hover:not(:disabled) {
  background: #2c2622;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(31, 26, 23, 0.2);
}

.download-all.disabled {
  pointer-events: none;
  opacity: 0.5;
}

.takes-empty {
  color: var(--muted);
  font-size: 0.95rem;
}

.take {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: #fff7ed;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.take-duration {
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  background: rgba(31, 26, 23, 0.06);
  border: 1px solid rgba(31, 26, 23, 0.12);
  padding: 6px 10px;
  border-radius: 999px;
  line-height: 1;
}

.take-created {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  font-size: 0.85rem;
  color: #6b4a33;
  font-variant-numeric: tabular-nums;
  background: #fffaf4;
  border: 1px dashed #ead7c3;
  padding: 6px 10px;
  border-radius: 999px;
}

.take-title {
  font-weight: 650;
  color: var(--ink);
  flex: 1 1 auto;
  min-width: 0;
}

.take audio {
  width: 100%;
}

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

.take-actions-left {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

.take-actions .take-delete {
  margin-left: auto;
}

.take-actions .download {
  white-space: nowrap;
}

.take-actions .take-view {
  border: 1px solid #e5d8c7;
  background: #fff;
  color: var(--ink);
  font-size: 0.9rem;
  padding: 8px 10px;
  border-radius: 12px;
}

.take-actions .take-view:hover:not(:disabled) {
  box-shadow: 0 10px 20px rgba(31, 26, 23, 0.12);
  transform: translateY(-1px);
}

.take-actions .take-view.generate-report {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #3730a3;
}

.take-actions .take-view.generate-report:hover:not(:disabled) {
  box-shadow: 0 10px 20px rgba(67, 56, 202, 0.18);
}

.take-delete {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  padding: 6px 10px;
  font-size: 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.take-delete:hover {
  background: #fee2e2;
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(185, 28, 28, 0.15);
}

.material-symbols-rounded {
  font-size: 1.2em;
  font-weight: 400;
}

.primary .material-symbols-rounded {
  color: #fff;
}

.button-status {
  display: inline-block;
  font-size: 0.85rem;
  opacity: 0.9;
  font-weight: 500;
}

.viewer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}

.viewer-overlay.is-open {
  display: flex;
}

.viewer-card {
  width: min(1100px, 100%);
  max-height: 100%;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1100;
}

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

.modal-card {
  width: min(820px, 100%);
  max-height: 100%;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #f1e1cd;
  background: #fffaf4;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.modal-body {
  padding: 18px 20px 12px;
  display: grid;
  gap: 8px;
}

.modal-body .field-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.modal-body textarea {
  width: 100%;
  min-height: 180px;
  border-radius: 12px;
  border: 1px solid #ead7c3;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.6;
  resize: vertical;
}

.usage-guide-body {
  gap: 12px;
}

.usage-guide-list {
  margin: 0 0 4px 20px;
  color: var(--muted);
  line-height: 1.7;
}

.modal-actions {
  padding: 12px 20px 18px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid #f1e1cd;
  background: #fffaf4;
}

.viewer-header h3 {
  margin: 0;
  font-size: 1.15rem;
  flex: 1;
  min-width: 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.viewer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.viewer-actions .viewer-tool {
  background: #fff;
  border: 1px solid #d1d5db;
  color: #374151;
  padding: 8px 14px !important;
  border-radius: 999px !important;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 8px 18px rgba(55, 65, 81, 0.12);
}

.viewer-actions .viewer-tool:hover:not(:disabled) {
  background: #f3f4f6;
  border-color: #9ca3af;
  transform: translateY(-1px);
}

.viewer-actions .viewer-tool:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.viewer-actions .viewer-correct {
  background: #fef3c7;
  border-color: #fbbf24;
  color: #92400e;
}

.viewer-actions .viewer-correct:hover:not(:disabled) {
  background: #fde68a;
  border-color: #f59e0b;
}

.viewer-actions .viewer-save {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.viewer-actions .viewer-save:hover:not(:disabled) {
  background: #bbf7d0;
  border-color: #4ade80;
}

.viewer-actions .copy-btn {
  background: transparent;
  border: 1px solid #d1d5db !important;
  color: #374151;
  padding: 8px 14px !important;
  border-radius: 999px !important;
  font-size: 0.9rem;
}

.viewer-actions .copy-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af !important;
}

.viewer-actions .viewer-regenerate {
  background: #fff1e6;
  border: 1px solid rgba(212, 85, 31, 0.45);
  color: #8a3a12;
  padding: 8px 14px !important;
  border-radius: 999px !important;
  font-size: 0.9rem;
  box-shadow: 0 10px 20px rgba(212, 85, 31, 0.18);
}

.viewer-actions .viewer-regenerate:hover:not(:disabled) {
  background: #ffe3d1;
  border-color: rgba(212, 85, 31, 0.65);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(212, 85, 31, 0.22);
}

.viewer-actions .viewer-regenerate:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.viewer-close {
  background: #1f1a17;
  color: #fff;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.9rem;
}

.viewer-body {
  padding: 20px;
  margin-bottom: 8px;
  overflow: auto;
  flex: 1;
  border-radius: 0 0 20px 20px;
}

.viewer-video {
  width: 100%;
  height: auto;
  max-height: calc(100vh - 180px);
  background: #000;
  border-radius: 12px;
}

.viewer-transcript {
  white-space: pre-wrap;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--ink);
}

.viewer-summary {
  border: none;
  padding: 0;
  background: transparent;
  max-height: none;
}

.viewer-transcript-editor {
  display: grid;
  gap: 14px;
}

.viewer-transcript-tools {
  display: none;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #f3d2b8;
  background: #fff7ed;
}

.viewer-transcript-tools.is-open {
  display: grid;
}

.viewer-transcript-tools label {
  font-weight: 600;
  color: #92400e;
}

.viewer-transcript-tools textarea {
  width: 100%;
  min-height: 110px;
  border-radius: 12px;
  border: 1px solid #f3d2b8;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
}

.viewer-transcript-tool-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.viewer-transcript-tool-actions .viewer-tool-apply {
  background: #f59e0b;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
}

.viewer-transcript-tool-actions .viewer-tool-cancel {
  background: transparent;
  border: 1px solid #f3d2b8;
  color: #92400e;
  border-radius: 999px;
  padding: 8px 16px;
}

.viewer-transcript-status {
  font-size: 0.9rem;
  color: #6b4a33;
  background: #fffaf4;
  border: 1px dashed #f1e1cd;
  padding: 8px 12px;
  border-radius: 12px;
}

.viewer-transcript-log {
  border: 1px dashed #ead7c3;
  background: #fffaf4;
  padding: 12px;
  border-radius: 12px;
}

.viewer-transcript-log-title {
  font-weight: 600;
  color: #5c2c12;
  margin-bottom: 6px;
}

.viewer-transcript-log-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

@media (max-width: 600px) {
  .hero {
    padding: 28px 18px;
  }

  .controls {
    flex-direction: column;
  }

  button,
  .download {
    width: 100%;
  }

  .usage-guide-btn {
    width: auto;
  }

  .copy-btn {
    width: auto;
  }

  .output-controls {
    flex-direction: column;
  }

  .output audio {
    flex: none;
  }

  .output .download {
    flex: none;
    width: 100%;
    padding: 12px 20px;
  }

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

  .takes-actions {
    width: 100%;
  }

  .takes-actions button {
    width: 100%;
  }

  .download-all {
    width: 100%;
  }

  .takes-meta,
  .takes-pagination {
    flex-wrap: wrap;
  }

  .takes-pagination-left,
  .takes-pagination-right {
    width: 100%;
    justify-content: flex-start;
  }

  .takes-pagination-right {
    margin-left: 0;
  }

  .takes-page-select {
    width: 100%;
    min-width: 0;
  }

  .take {
    width: 100%;
  }

  .take-actions {
    width: 100%;
  }

  .take-actions-left {
    width: 100%;
  }

  .take-actions .take-delete {
    margin-left: 0;
  }

  .take-actions .download,
  .take-delete {
    width: 100%;
    padding: 12px 20px;
  }

  .take-actions .take-view {
    width: 100%;
    padding: 12px 20px;
  }
}

