:root {
  --voice-bg: #f6f8fb;
  --voice-surface: #ffffff;
  --voice-surface-strong: #111827;
  --voice-border: #d8e0ea;
  --voice-border-strong: #aeb9c8;
  --voice-text: #152033;
  --voice-muted: #64748b;
  --voice-primary: #4f46e5;
  --voice-primary-dark: #4338ca;
  --voice-primary-light: #818cf8;
  --voice-primary-soft: #eef2ff;
  --voice-teal: var(--voice-primary);
  --voice-teal-soft: var(--voice-primary-soft);
  --voice-coral: var(--voice-primary);
  --voice-blue: #2563eb;
  --voice-yellow: #fff177;
  --voice-green: #b8f2c8;
  --voice-hl-blue: #b9d8ff;
  --voice-pink: #f8c4df;
  --voice-shadow: 0 18px 48px rgba(17, 24, 39, 0.1);
}

body {
  background: var(--voice-bg);
}

.voice-notes-body .app-shell-topbar {
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
}

.voice-page {
  color: var(--voice-text);
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
}

.voice-app,
.voice-auth {
  width: min(1180px, 100%);
  margin: 0 auto;
}

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

.voice-header h1,
.voice-auth-card h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  letter-spacing: 0;
}

.voice-eyebrow {
  margin: 0 0 6px;
  color: var(--voice-teal);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.voice-sync-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--voice-border);
  border-radius: 999px;
  background: var(--voice-surface);
  color: var(--voice-muted);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.voice-sync-pill.is-online {
  color: var(--voice-primary-dark);
  background: var(--voice-primary-soft);
  border-color: rgba(129, 140, 248, 0.42);
}

.voice-sync-pill.is-error {
  color: #9f1d1d;
  background: #fff0ee;
  border-color: #fecaca;
}

.voice-view {
  display: none;
}

.voice-view.active {
  display: block;
}

.voice-record-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(320px, 1.08fr);
  gap: 18px;
  align-items: start;
}

.voice-recorder,
.voice-card,
.voice-auth-card,
.voice-detail {
  background: var(--voice-surface);
  border: 1px solid var(--voice-border);
  border-radius: 8px;
  box-shadow: var(--voice-shadow);
}

.voice-recorder {
  --voice-level: 0;
  display: grid;
  gap: 20px;
  padding: 28px;
  min-height: 0;
  border-color: rgba(79, 70, 229, 0.2);
  background:
    radial-gradient(circle at 12% 0%, rgba(129, 140, 248, 0.18), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 255, 0.96));
}

.voice-recorder-simple {
  width: min(760px, 100%);
  margin: 0 auto;
}

.voice-recorder-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.voice-recorder-title {
  margin: 0 0 8px;
  color: var(--voice-text);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.voice-recorder-copy {
  margin: 0;
  max-width: 520px;
  color: #4b5563;
  font-size: 0.96rem;
  line-height: 1.5;
}

.voice-time {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 104px;
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid rgba(79, 70, 229, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--voice-text);
  font-size: 1.18rem;
  font-weight: 850;
  letter-spacing: 0;
  box-shadow: 0 10px 28px rgba(79, 70, 229, 0.08);
  font-variant-numeric: tabular-nums;
}

.voice-meter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 72px;
  padding: 12px;
  border: 1px solid rgba(79, 70, 229, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(79, 70, 229, 0.06), rgba(14, 165, 233, 0.05)),
    rgba(255, 255, 255, 0.76);
  overflow: hidden;
}

.voice-meter.level-0 { --voice-level: 0; }
.voice-meter.level-1 { --voice-level: 0.125; }
.voice-meter.level-2 { --voice-level: 0.25; }
.voice-meter.level-3 { --voice-level: 0.375; }
.voice-meter.level-4 { --voice-level: 0.5; }
.voice-meter.level-5 { --voice-level: 0.625; }
.voice-meter.level-6 { --voice-level: 0.75; }
.voice-meter.level-7 { --voice-level: 0.875; }
.voice-meter.level-8 { --voice-level: 1; }

.voice-meter span {
  width: 9px;
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--voice-primary-light), var(--voice-primary-dark));
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.24);
  opacity: 0.55;
  transform: scaleY(calc(0.68 + (var(--voice-level, 0) * 1.35)));
  transform-origin: center;
  transition: height 120ms ease, opacity 120ms ease, transform 120ms ease;
}

.voice-meter span:nth-child(2),
.voice-meter span:nth-child(4) {
  height: 26px;
}

.voice-meter span:nth-child(3) {
  height: 38px;
}

.voice-meter.recording span {
  opacity: 1;
  animation: voiceBarPulse 720ms ease-in-out infinite;
}

.voice-meter.recording span:nth-child(2) {
  animation-delay: 70ms;
}

.voice-meter.recording span:nth-child(3) {
  animation-delay: 140ms;
}

.voice-meter.recording span:nth-child(4) {
  animation-delay: 210ms;
}

.voice-meter.recording span:nth-child(5) {
  animation-delay: 280ms;
}

.voice-meter.paused span {
  animation-play-state: paused;
  opacity: 0.42;
}

@keyframes voiceBarPulse {
  0%, 100% { transform: scaleY(calc(0.64 + (var(--voice-level, 0) * 1.15))); }
  50% { transform: scaleY(calc(0.9 + (var(--voice-level, 0) * 1.8))); }
}

.voice-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.48);
}

.voice-confirm-overlay[hidden] {
  display: none;
}

.voice-confirm-dialog {
  width: min(520px, 100%);
  border: 1px solid rgba(216, 224, 234, 0.9);
  border-radius: 16px;
  background: #ffffff;
  padding: 22px;
  color: var(--voice-text);
  box-shadow: 0 24px 54px rgba(15, 23, 42, 0.28);
}

.voice-confirm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.voice-confirm-head h2 {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 850;
  letter-spacing: 0;
}

.voice-confirm-close {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--voice-border);
  border-radius: 8px;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
}

.voice-confirm-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.voice-confirm-dialog p {
  margin: 0 0 20px;
  color: #475569;
  line-height: 1.5;
}

.voice-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.voice-confirm-btn {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid #d8e1ef;
  border-radius: 8px;
  padding: 8px 14px;
  background: #ffffff;
  color: #1f2937;
  font: inherit;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}

.voice-confirm-btn:hover,
.voice-confirm-close:hover {
  transform: translateY(-1px);
  border-color: #a5b4fc;
  background: #eef4ff;
  color: #1e1b4b;
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.14);
}

.voice-confirm-btn.danger {
  border-color: transparent;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(220, 38, 38, 0.2);
}

.voice-confirm-btn.danger:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  box-shadow: 0 12px 24px rgba(185, 28, 28, 0.24);
}

.voice-record-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.voice-record-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  min-width: 196px;
  padding: 0 22px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--voice-primary), var(--voice-primary-dark));
  color: white;
  font: inherit;
  font-weight: 850;
  box-shadow: 0 14px 30px rgba(79, 70, 229, 0.28);
  cursor: pointer;
}

.voice-record-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.voice-record-btn.recording {
  opacity: 0.72;
}

.voice-record-status {
  min-height: 24px;
  color: var(--voice-muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.voice-btn,
.voice-chip,
.voice-tab,
.voice-nav-btn,
.voice-icon-btn {
  font: inherit;
}

.voice-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--voice-border-strong);
  border-radius: 8px;
  background: var(--voice-surface);
  color: var(--voice-text);
  font-weight: 800;
  cursor: pointer;
}

.voice-btn:disabled,
.voice-record-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.voice-btn-primary {
  border-color: var(--voice-primary);
  background: var(--voice-primary);
  color: white;
}

.voice-btn-secondary {
  background: #eef4fb;
}

.voice-btn-small {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.9rem;
}

.voice-full {
  width: 100%;
}

.voice-capture-form,
.voice-settings {
  padding: 18px;
}

.voice-field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.voice-field label {
  color: var(--voice-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.voice-field input,
.voice-field textarea,
.voice-field select,
.voice-detail-title {
  width: 100%;
  border: 1px solid var(--voice-border);
  border-radius: 8px;
  background: #fbfdff;
  color: var(--voice-text);
  font: inherit;
  font-weight: 600;
  padding: 12px;
}

.voice-field textarea {
  resize: vertical;
}

.voice-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 4px 0 14px;
  color: var(--voice-text);
  font-weight: 700;
}

.voice-toggle-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.voice-library-head {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.voice-search {
  margin-bottom: 0;
}

.voice-library-actions {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.voice-chip {
  flex: 0 0 auto;
  min-height: 36px;
  border: 1px solid var(--voice-border);
  border-radius: 999px;
  background: var(--voice-surface);
  color: var(--voice-muted);
  padding: 0 14px;
  font-weight: 800;
  cursor: pointer;
}

.voice-chip.active {
  background: var(--voice-surface-strong);
  border-color: var(--voice-surface-strong);
  color: white;
}

.voice-note-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.voice-note-item {
  display: grid;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--voice-border);
  border-radius: 8px;
  background: var(--voice-surface);
  color: var(--voice-text);
  padding: 14px;
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.06);
}

.voice-note-open {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.voice-note-item.active {
  outline: 3px solid rgba(79, 70, 229, 0.16);
  border-color: var(--voice-primary);
}

.voice-note-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.voice-note-title {
  font-size: 1rem;
  font-weight: 800;
  word-break: break-word;
}

.voice-note-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef4fb;
  color: var(--voice-muted);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.voice-note-status.synced {
  background: var(--voice-primary-soft);
  color: var(--voice-primary-dark);
}

.voice-note-status.error {
  background: #fff0ee;
  color: #b42318;
}

.voice-note-meta,
.voice-detail-meta {
  color: var(--voice-muted);
  font-size: 0.86rem;
  font-weight: 650;
}

.voice-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.voice-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef4fb;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 800;
}

.voice-detail-empty {
  display: grid;
  place-items: center;
  min-height: 320px;
  border: 1px dashed var(--voice-border-strong);
  border-radius: 8px;
  color: var(--voice-muted);
  font-weight: 800;
}

.voice-detail {
  overflow: hidden;
}

.voice-back-btn {
  display: none;
  align-items: center;
  gap: 6px;
  margin: 12px 14px 0;
  min-height: 40px;
  border: 1px solid var(--voice-border);
  border-radius: 8px;
  background: var(--voice-surface);
  color: var(--voice-primary-dark);
  font-weight: 850;
  cursor: pointer;
}

.voice-back-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.voice-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--voice-border);
}

.voice-detail-head > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}

.voice-detail-title {
  border-color: transparent;
  background: transparent;
  padding: 4px 0;
  font-size: 1.25rem;
  font-weight: 850;
}

.voice-detail-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.voice-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--voice-border);
  border-radius: 8px;
  background: var(--voice-surface);
  color: var(--voice-text);
  cursor: pointer;
}

.voice-mini-action,
.voice-note-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--voice-border);
  border-radius: 8px;
  background: #fbfdff;
  color: var(--voice-text);
  font-size: 0.8rem;
  font-weight: 850;
  cursor: pointer;
}

.voice-mini-action {
  padding: 0 10px;
}

.voice-mini-action.danger,
.voice-note-action.danger {
  color: #991b1b;
  border-color: #fecaca;
  background: #fff1f2;
}

.voice-note-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.voice-note-action {
  min-height: 32px;
  padding: 0 9px;
}

.voice-icon-btn.active {
  background: #fff7cc;
  border-color: #facc15;
}

.voice-icon-btn svg,
.voice-nav-btn svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

.voice-audio {
  display: block;
  width: calc(100% - 28px);
  margin: 14px;
}

.voice-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 0 14px 14px;
}

.voice-tab {
  min-height: 42px;
  border: 1px solid var(--voice-border);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--voice-muted);
  font-weight: 850;
  cursor: pointer;
}

.voice-tab.active {
  background: var(--voice-surface-strong);
  color: white;
  border-color: var(--voice-surface-strong);
}

.voice-detail-pane {
  display: none;
  padding: 0 14px 18px;
}

.voice-detail-pane.active {
  display: block;
}

.voice-transcript {
  min-height: 260px;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  line-height: 1.65;
  color: var(--voice-text);
}

.voice-highlight-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  margin-bottom: 14px;
  border: 1px solid var(--voice-border);
  border-radius: 8px;
  background: #fbfdff;
}

.voice-hl-btn {
  width: 34px;
  height: 34px;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
}

.voice-hl-btn.active {
  border-color: #6d5dfc;
  box-shadow: 0 0 0 3px rgba(109, 93, 252, 0.18);
}

.voice-hl-yellow,
.voice-mark-yellow {
  background: var(--voice-yellow);
}

.voice-hl-green,
.voice-mark-green {
  background: var(--voice-green);
}

.voice-hl-blue,
.voice-mark-blue {
  background: var(--voice-hl-blue);
}

.voice-hl-pink,
.voice-mark-pink {
  background: var(--voice-pink);
}

.voice-notes-surface {
  min-height: 360px;
  line-height: 1.7;
  color: #1f2937;
  overflow-wrap: anywhere;
}

.voice-notes-surface h1,
.voice-notes-surface h2,
.voice-notes-surface h3 {
  letter-spacing: 0;
}

.voice-notes-surface mark {
  border-radius: 3px;
  padding: 0.05em 0.08em;
}

.voice-study-tools-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  margin-bottom: 12px;
  color: var(--voice-muted);
  font-weight: 850;
}

.voice-flashcards,
.voice-questions {
  display: grid;
  gap: 12px;
}

.voice-flashcard,
.voice-question {
  border: 1px solid var(--voice-border);
  border-radius: 8px;
  background: #fbfdff;
  padding: 14px;
}

.voice-flashcard {
  min-height: 160px;
  cursor: pointer;
}

.voice-flashcard-front {
  color: var(--voice-text);
  font-size: 1.08rem;
  font-weight: 850;
}

.voice-flashcard-back {
  display: none;
  margin-top: 12px;
  color: #334155;
  line-height: 1.55;
}

.voice-flashcard.flipped .voice-flashcard-back {
  display: block;
}

.voice-option {
  display: block;
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--voice-border);
  border-radius: 8px;
  background: white;
  padding: 10px 12px;
  text-align: left;
  color: var(--voice-text);
  cursor: pointer;
}

.voice-option.correct {
  border-color: #22c55e;
  background: #ecfdf5;
}

.voice-option.incorrect {
  border-color: #ef4444;
  background: #fff1f2;
}

.voice-question-explanation {
  margin-top: 10px;
  color: var(--voice-muted);
  line-height: 1.5;
}

.voice-storage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--voice-border);
}

.voice-storage-row strong,
.voice-storage-row span {
  display: block;
}

.voice-storage-row span {
  color: var(--voice-muted);
  font-size: 0.9rem;
}

.voice-bottom-nav {
  position: fixed;
  z-index: 30;
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  max-width: 680px;
  margin: 0 auto;
  padding: 8px;
  border: 1px solid rgba(216, 224, 234, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 50px rgba(17, 24, 39, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.voice-nav-btn {
  display: grid;
  place-items: center;
  gap: 4px;
  width: 100%;
  min-width: 0;
  min-height: 62px;
  padding: 7px 2px 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--voice-muted);
  font-size: 0.74rem;
  font-weight: 850;
  line-height: 1.15;
  text-decoration: none;
  cursor: pointer;
  overflow: visible;
}

.voice-nav-btn svg {
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
  overflow: visible;
}

.voice-nav-btn span {
  max-width: 100%;
  white-space: nowrap;
}

.voice-nav-btn.active {
  background: linear-gradient(135deg, var(--voice-primary), var(--voice-primary-dark));
  color: white;
}

.voice-auth-card {
  padding: 24px;
}

.voice-auth-card p:not(.voice-eyebrow) {
  color: var(--voice-muted);
  line-height: 1.55;
}

.voice-advanced-settings {
  margin-bottom: 14px;
  border: 1px solid var(--voice-border);
  border-radius: 8px;
  background: #fbfdff;
  padding: 12px;
}

.voice-advanced-settings summary {
  cursor: pointer;
  color: var(--voice-text);
  font-weight: 850;
}

.voice-advanced-settings .voice-field {
  margin-top: 12px;
  margin-bottom: 0;
}

.voice-toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: calc(104px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(20px);
  max-width: min(440px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #111827;
  color: white;
  font-weight: 750;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.voice-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.voice-toast.error {
  background: #991b1b;
}

@media (min-width: 1025px) {
  .voice-bottom-nav {
    position: sticky;
    top: 72px;
    bottom: auto;
    margin-bottom: 18px;
  }
}

@media (max-width: 760px) {
  .voice-notes-body .app-shell-topbar {
    flex-wrap: nowrap;
    gap: 8px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }

  .voice-notes-body .app-shell-menu-btn {
    min-width: 44px;
    padding: 8px;
  }

  .voice-notes-body .app-shell-menu-btn span {
    display: none;
  }

  .voice-notes-body .app-shell-title {
    min-width: 0;
    font-size: 1rem;
  }

  .voice-notes-body .app-shell-account-btn {
    max-width: 142px;
    min-height: 42px;
  }

  .voice-notes-body #shell-account-name {
    max-width: 74px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .voice-page {
    padding-left: 12px;
    padding-right: 12px;
  }

  .voice-header {
    align-items: flex-start;
    margin-bottom: 14px;
  }

  .voice-header h1 {
    font-size: 2.05rem;
  }

  .voice-eyebrow {
    font-size: 0.72rem;
  }

  .voice-sync-pill {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.8rem;
  }

  .voice-record-layout {
    grid-template-columns: 1fr;
  }

  .voice-recorder {
    padding: 22px 16px;
  }

  .voice-recorder-head {
    flex-direction: column;
  }

  .voice-time {
    min-width: 100%;
    min-height: 48px;
  }

  .voice-record-actions {
    align-items: stretch;
  }

  .voice-record-actions .voice-btn,
  .voice-record-btn {
    width: 100%;
  }

  #voice-import-btn {
    width: 100%;
  }

  .voice-record-actions .voice-btn {
    flex: 1 1 calc(50% - 6px);
    width: auto;
  }

  .voice-record-btn {
    min-width: 0;
  }

  .voice-tabs {
    display: flex;
    overflow-x: auto;
  }

  .voice-tab {
    flex: 0 0 auto;
    min-width: 128px;
  }

  .voice-note-list {
    grid-template-columns: 1fr;
  }

  .voice-detail-head,
  .voice-storage-row {
    align-items: flex-start;
  }

  .voice-detail-actions {
    justify-content: flex-start;
  }

  .voice-back-btn {
    display: inline-flex;
  }

  .voice-detail-head {
    padding-top: 10px;
  }

  .voice-detail-title {
    font-size: 1.15rem;
  }
}

/* Voice Notes mobile-first redesign */
:root {
  --voice-bg: #f8fafc;
  --voice-surface: #ffffff;
  --voice-border: #e5e7eb;
  --voice-border-strong: #d1d5db;
  --voice-text: #111827;
  --voice-muted: #6b7280;
  --voice-primary: #4f46e5;
  --voice-primary-dark: #4338ca;
  --voice-primary-soft: #eef2ff;
  --voice-green: #d1fae5;
  --voice-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 14px 30px rgba(15, 23, 42, 0.06);
}

.voice-page {
  padding-top: 18px;
}

.voice-app,
.voice-auth {
  max-width: 980px;
}

.voice-header {
  margin-bottom: 14px;
}

.voice-header h1,
.voice-auth-card h1 {
  color: #111827;
  letter-spacing: 0;
}

.voice-eyebrow {
  color: #4f46e5;
  letter-spacing: 0.08em;
}

.voice-sync-pill {
  border-radius: 999px;
  border-color: #e5e7eb;
  background: #ffffff;
}

.voice-sync-pill.is-online {
  color: #4f46e5;
  border-color: rgba(79, 70, 229, 0.18);
  background: #eef2ff;
}

.voice-recorder,
.voice-card,
.voice-auth-card,
.voice-detail {
  border-radius: 8px;
  border-color: #e5e7eb;
  background: #ffffff;
  box-shadow: var(--voice-shadow);
}

.voice-recorder {
  padding: 24px;
  background: #ffffff;
}

.voice-recorder-simple {
  width: min(720px, 100%);
}

.voice-time {
  border-color: rgba(79, 70, 229, 0.18);
  background: #eef2ff;
  color: #3730a3;
  box-shadow: none;
}

.voice-meter {
  border-radius: 8px;
  border-color: #e5e7eb;
  background: #f8fafc;
}

.voice-meter span {
  background: linear-gradient(180deg, #818cf8, #4f46e5);
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.2);
}

.voice-record-btn,
.voice-btn-primary {
  border-radius: 8px;
  background: #4f46e5;
  box-shadow: 0 12px 24px rgba(79, 70, 229, 0.18);
}

.voice-record-btn:hover:not(:disabled),
.voice-btn-primary:hover {
  background: #4338ca;
}

.voice-btn,
.voice-chip,
.voice-mini-action,
.voice-icon-btn,
.voice-back-btn,
.voice-hl-btn {
  border-radius: 8px;
}

.voice-btn,
.voice-chip,
.voice-mini-action,
.voice-icon-btn {
  border-color: #d1d5db;
  background: #ffffff;
  color: #374151;
}

.voice-btn:hover:not(:disabled),
.voice-chip:hover,
.voice-mini-action:hover,
.voice-icon-btn:hover {
  border-color: #cbd5e1;
  background: #f9fafb;
}

.voice-chip.active,
.voice-nav-btn.active {
  background: #d1fae5;
  color: #14532d;
  box-shadow: 0 0 0 1px rgba(134, 239, 172, 0.24);
}

.voice-note-item,
.voice-note-card,
.voice-library-head,
.voice-field input,
.voice-field select,
.voice-field textarea,
.voice-notes-surface,
.voice-transcript,
.voice-audio,
.voice-highlight-toolbar {
  border-radius: 8px;
}

.voice-field input,
.voice-field select,
.voice-field textarea {
  border-color: #d1d5db;
  background: #ffffff;
}

.voice-field input:focus,
.voice-field select:focus,
.voice-field textarea:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.voice-bottom-nav {
  border-radius: 8px;
  border-color: rgba(229, 231, 235, 0.96);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.16);
}

.voice-nav-btn {
  border-radius: 8px;
}

.voice-view {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 220ms var(--motion-ease, ease),
    transform 220ms var(--motion-ease, ease);
}

.voice-view.active {
  opacity: 1;
  transform: translateY(0);
}

.voice-advanced-settings {
  border-radius: 8px;
  border-color: #e5e7eb;
  background: #f8fafc;
  overflow: hidden;
}

.voice-advanced-settings summary {
  list-style: none;
}

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

.voice-advanced-settings .voice-field {
  opacity: 0;
  transform: translateY(-6px);
  transition:
    opacity 220ms var(--motion-ease, ease),
    transform 220ms var(--motion-ease, ease);
}

.voice-advanced-settings[open] .voice-field {
  opacity: 1;
  transform: translateY(0);
}

.voice-detail,
.voice-auth-card {
  animation: voicePanelIn 220ms var(--motion-ease, ease);
}

@keyframes voicePanelIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 1025px) {
  .voice-page {
    padding-bottom: 32px;
  }

  .voice-bottom-nav {
    width: min(680px, 100%);
    position: sticky;
    top: 78px;
  }

  .voice-recorder-simple {
    margin-top: 6px;
  }
}

@media (max-width: 760px) {
  .voice-page {
    padding-top: 14px;
    padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px));
  }

  .voice-header h1 {
    font-size: 2.25rem;
  }

  .voice-recorder {
    padding: 18px;
  }

  .voice-bottom-nav {
    left: max(10px, env(safe-area-inset-left, 0px));
    right: max(10px, env(safe-area-inset-right, 0px));
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
    padding: 7px;
  }

  .voice-nav-btn {
    min-height: 58px;
  }
}
