:root {
  color-scheme: light;
  --paper: #f6f2eb;
  --ink: #292821;
  --muted: #787970;
  --line: #deddd2;
  --wine: #7e3d46;
  --sage: #65796b;
  --white: #fffefa;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}
button,
input,
textarea,
select {
  font: inherit;
}
a {
  color: inherit;
}
button,
a,
input,
textarea,
select {
  outline-offset: 4px;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--wine);
}
.sidebar {
  position: fixed;
  width: 228px;
  inset: 0 auto 0 0;
  padding: 38px 26px;
  background: #eeede4;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  font-size: 23px;
  line-height: 0.93;
  letter-spacing: -1px;
  font-weight: bold;
}
.brandmark {
  display: grid;
  place-items: center;
  border: 1px solid #8d504e;
  border-radius: 50%;
  color: var(--wine);
  width: 51px;
  height: 51px;
  font-family: Georgia, serif;
  font-size: 29px;
  font-weight: normal;
}
.nav-label {
  margin-top: 64px;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--muted);
}
nav {
  display: grid;
  gap: 10px;
  margin-top: 17px;
}
nav a {
  padding: 11px 12px;
  text-decoration: none;
  color: #666960;
  border-radius: 5px;
  font-size: 12px;
}
nav a span {
  font-size: 18px;
  margin-right: 12px;
}
nav a.active {
  color: var(--wine);
  background: #e3e1d6;
}
.sidebar-bottom {
  margin-top: auto;
  font-size: 10px;
  color: var(--sage);
}
.sidebar-bottom p {
  font-family: Georgia, serif;
  font-size: 17px;
  line-height: 1.5;
  color: #868578;
  margin-top: 18px;
}
.small-dot {
  width: 5px;
  height: 5px;
  display: inline-block;
  background: var(--sage);
  border-radius: 50%;
  margin-right: 4px;
}
main {
  margin-left: 228px;
  padding: 30px 48px;
  max-width: 1630px;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9px;
  letter-spacing: 1.8px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 23px;
}
.badge {
  font-size: 10px;
  letter-spacing: 0.3px;
  padding: 5px 11px;
  border: 1px solid #cecec0;
  border-radius: 20px;
  color: var(--sage);
}
.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 53px 10px 45px;
  min-height: 320px;
}
.eyebrow {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--sage);
}
h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: normal;
  line-height: 1.1;
  margin: 0;
}
h1 {
  font-size: clamp(40px, 4.2vw, 65px);
  letter-spacing: -2px;
  margin: 16px 0 18px;
}
h1 em {
  font-weight: normal;
  color: var(--wine);
}
.hero p {
  color: var(--muted);
  font-size: 13px;
}
.text-link {
  font-size: 11px;
  font-weight: bold;
  text-decoration: none;
  display: inline-flex;
  gap: 15px;
  align-items: center;
  margin-top: 10px;
}
.hero-art {
  width: 250px;
  height: 250px;
  position: relative;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.disc {
  border: 1px solid #c3c3b5;
  border-radius: 50%;
  width: 219px;
  height: 219px;
  display: grid;
  place-items: center;
  background: repeating-radial-gradient(
    circle,
    #e9e7dd 0px,
    #e9e7dd 6px,
    #d6d7cb 7px,
    #e9e7dd 8px
  );
  transform: rotate(-20deg);
}
.disc-inner {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #91a38b;
  border: 7px solid #eef0e4;
  color: #f1eee2;
  font-size: 40px;
}
.wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  position: absolute;
  inset: 0;
}
.wave i {
  height: 18px;
  width: 3px;
  background: #e8e5cf;
  border-radius: 5px;
}
.wave i:nth-child(3n) {
  height: 57px;
}
.wave i:nth-child(3n + 1) {
  height: 33px;
}
.wave i:nth-child(5n) {
  height: 88px;
}
.art-caption {
  position: absolute;
  bottom: -5px;
  font-size: 8px;
  letter-spacing: 3px;
  color: var(--muted);
}
.studio-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1.5fr) minmax(250px, 0.8fr);
  gap: 23px;
  align-items: start;
}
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 28px;
}
.section-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 19px;
}
.section-top .quiet,
.section-top .tag {
  margin-left: auto;
}
.step {
  font-size: 10px;
  color: #7f8478;
  border: 1px solid var(--line);
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}
.tag {
  font-size: 9px;
  color: #858777;
}
h2 {
  font-size: 28px;
  letter-spacing: -0.6px;
}
.muted {
  color: var(--muted);
  font-size: 12px;
}
.card > .muted {
  margin: 11px 0 25px;
}
label:not(.check):not(.upload-btn) {
  display: block;
  font-size: 11px;
  font-weight: bold;
  margin: 14px 0 7px;
}
input:not([type="checkbox"]):not([type="file"]),
textarea,
select {
  width: 100%;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 11px 12px;
  font-size: 12px;
  color: var(--ink);
}
input::placeholder,
textarea::placeholder {
  color: #9b9b90;
}
textarea {
  resize: vertical;
}
.recording {
  margin-top: 20px;
  padding: 17px;
  background: #f7f7ef;
  border: 1px dashed #ced0c2;
  border-radius: 6px;
}
.recording-heading {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.recording-heading strong {
  font-size: 12px;
  font-weight: 600;
}
.recording-heading span {
  font-size: 10px;
  color: var(--muted);
}
.recording p {
  font-size: 11px;
  color: var(--muted);
  margin: 8px 0 13px;
}
.upload-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.upload-btn,
.mini-button {
  font-size: 11px;
  background: #fffefa;
  border: 1px solid #cfd0c3;
  padding: 7px 12px;
  border-radius: 4px;
  cursor: pointer;
}
.file-status {
  display: block;
  color: #8a8d7f;
  font-size: 9px;
  margin-top: 11px;
}
.quiet {
  background: transparent;
  border: 0;
  padding: 8px 0;
  color: var(--wine);
  font-size: 11px;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 22px 0;
  font-size: 11px;
  line-height: 1.6;
  color: #707468;
}
.check input {
  accent-color: var(--wine);
  margin: 3px 0 0;
}
.button {
  border: 0;
  border-radius: 5px;
  background: var(--wine);
  color: #fff8ef;
  padding: 12px 17px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.full {
  width: 100%;
}
.fine {
  font-size: 10px;
  line-height: 1.65;
  color: #85867b;
  margin: 10px 0;
}
.setup-note {
  font-size: 11px;
  color: #7a6b59;
  background: #f4efe4;
  padding: 12px;
  border-radius: 5px;
  margin: 17px 0 0;
}
.idea-box {
  background: #f7f6ef;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 24px;
}
.idea-box label {
  margin-top: 0 !important;
}
.idea-box textarea {
  border: 0;
  background: transparent;
  padding: 0;
  min-height: 52px;
  resize: vertical;
  line-height: 1.7;
}
.idea-box > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mini-button {
  background: #ebe9dd;
  color: #525e4e;
}
.title-input {
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 0 !important;
  font-family: Georgia, serif !important;
  font-size: 24px !important;
  padding: 5px 0 13px !important;
}
.story-editor {
  border: 0;
  min-height: 230px;
  padding: 20px 0;
  font-family: Georgia, serif;
  font-size: 16px;
  line-height: 1.85;
  resize: vertical;
}
.editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  color: #919185;
  font-size: 10px;
}
.narration {
  padding-top: 24px;
}
.cost-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-top: 16px;
  color: var(--muted);
}
.cost-row strong {
  color: var(--ink);
}
.narration .button {
  justify-content: center;
  margin-top: 16px;
}
.voice-item {
  border-top: 1px solid var(--line);
  padding: 15px 0;
  margin-top: 14px;
}
.voice-item strong {
  font-size: 13px;
}
.voice-item small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}
.voice-item > div {
  display: flex;
  gap: 20px;
}
audio {
  width: 100%;
  height: 38px;
  margin-top: 12px;
}
.player-box {
  background: #eef2e9;
  border: 1px solid #d0d7c6;
  padding: 19px;
  border-radius: 7px;
  margin-top: 21px;
}
.player-box p {
  font-size: 12px;
  color: var(--sage);
}
.notice {
  background: #f0e3d7;
  border: 1px solid #d6b6a4;
  border-radius: 6px;
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 12px;
}
.notice.error {
  background: #f5e3e1;
  color: #783a38;
}
.library {
  margin-top: 47px;
}
.library-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.library h2 {
  margin-top: 9px;
}
.library-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 23px;
}
.shelf-item {
  border: 1px solid var(--line);
  background: #fdfbf5;
  border-radius: 6px;
  padding: 22px;
}
.shelf-item h3 {
  font-size: 20px;
}
.shelf-item p {
  font-size: 11px;
  color: var(--muted);
}
.shelf-item > div {
  display: flex;
  gap: 20px;
}
.empty {
  padding: 30px;
  border: 1px dashed var(--line);
  grid-column: 1/-1;
  color: var(--muted);
  font-size: 12px;
  border-radius: 6px;
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: #8e9082;
  font-size: 10px;
  padding: 31px 0 8px;
  margin-top: 33px;
  border-top: 1px solid var(--line);
}
footer > a {
  font-size: 9px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
dialog {
  max-width: 460px;
  border: 1px solid var(--line);
  padding: 30px;
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
}
dialog::backdrop {
  background: #25252070;
}
dialog p {
  font-size: 13px;
  color: var(--muted);
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 25px;
  margin-top: 25px;
}
.delete-dialog {
  width: min(480px, calc(100% - 32px));
  max-width: 480px;
  max-height: calc(100dvh - 32px);
  padding: 32px;
  border-radius: 20px;
  box-shadow: 0 24px 80px #29282130;
}
.delete-dialog::backdrop {
  background: #29282180;
  backdrop-filter: blur(4px);
}
.delete-dialog-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 24px;
  border-radius: 50%;
  background: #f3e9e8;
  color: var(--wine);
}
.delete-dialog h2 {
  margin: 10px 0 12px;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -1px;
}
.delete-dialog p {
  font-size: 14px;
  line-height: 1.6;
}
.delete-recording-summary {
  margin: 24px 0 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}
.delete-recording-label {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 1.5px;
}
#delete-recording-title {
  margin: 6px 0 0;
  color: var(--ink);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.delete-dialog .delete-download-note {
  font-size: 13px;
}
.delete-download-note a {
  color: var(--wine);
  text-underline-offset: 3px;
}
.delete-download-note a[aria-disabled="true"] {
  opacity: 0.5;
  cursor: wait;
}
.delete-dialog .delete-recording-error {
  padding: 12px;
  border-radius: 8px;
  background: #f3e9e8;
  color: #8b303b;
}
.delete-dialog .dialog-actions {
  gap: 12px;
  margin-top: 28px;
}
.delete-dialog .dialog-actions button {
  min-height: 48px;
  flex: 1;
  justify-content: center;
  border-radius: 8px;
  font-size: 14px;
}
.delete-cancel {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}
.delete-cancel:hover {
  background: var(--paper);
}
.delete-dialog .button:not(:disabled):hover {
  background: #69323a;
}
@media (max-width: 480px) {
  .delete-dialog {
    padding: 24px;
  }
  .delete-dialog h2 {
    font-size: 30px;
  }
  .delete-dialog .dialog-actions {
    gap: 8px;
  }
  .delete-dialog .dialog-actions button {
    padding: 12px 10px;
  }
}
[hidden] {
  display: none !important;
}
@media (min-width: 1550px) {
  main {
    margin-left: auto;
    margin-right: auto;
    padding-left: 276px;
    max-width: 1580px;
  }
  .sidebar {
    width: 228px;
  }
}
@media (max-width: 1100px) {
  .sidebar {
    width: 180px;
    padding: 28px 17px;
  }
  main {
    margin-left: 180px;
    padding: 25px;
  }
  .studio-grid {
    gap: 16px;
    grid-template-columns: minmax(310px, 1.35fr) minmax(240px, 0.85fr);
  }
  .card {
    padding: 21px;
  }
  .hero-art {
    width: 180px;
    transform: scale(0.8);
  }
}
@media (max-width: 900px) {
  .sidebar {
    position: static;
    width: auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 17px 24px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    font-size: 17px;
  }
  .brandmark {
    width: 39px;
    height: 39px;
    font-size: 24px;
  }
  .nav-label,
  .sidebar-bottom {
    display: none;
  }
  nav {
    display: flex;
    margin: 0;
    gap: 4px;
  }
  nav a {
    font-size: 10px;
    padding: 8px;
  }
  nav a span {
    display: none;
  }
  main {
    margin: 0;
    padding: 25px;
  }
  .hero {
    padding-top: 35px;
  }
  .studio-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
  }
  .library-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 680px) {
  main {
    padding: 19px;
  }
  .sidebar {
    padding: 15px 19px;
  }
  nav a {
    font-size: 9px;
  }
  .hero {
    min-height: 0;
    padding: 31px 0;
  }
  .hero-art {
    display: none;
  }
  h1 {
    font-size: 44px;
  }
  .hero p {
    font-size: 12px;
  }
  .studio-grid {
    grid-template-columns: 1fr;
  }
  .card {
    padding: 23px;
  }
  header {
    font-size: 8px;
    letter-spacing: 1px;
    gap: 10px;
  }
  .badge {
    font-size: 8px;
    white-space: nowrap;
  }
  .library-grid {
    grid-template-columns: 1fr;
  }
  .library-heading {
    align-items: flex-start;
    gap: 15px;
  }
  .library-heading > span {
    font-size: 10px;
    text-align: right;
  }
  footer span {
    display: none;
  }
  .story-editor {
    min-height: 300px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

#record-section {
  margin-bottom: 28px;
}
#record-section .upload-actions {
  margin-top: 18px;
}
#save-recording {
  margin-top: 16px;
}
#gallery-section {
  margin: 34px 0 40px;
}
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.gallery-filters [aria-pressed="true"] {
  background: var(--wine);
  color: white;
}
#gallery .tag {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--sage);
}
#gallery .shelf-item > div {
  flex-wrap: wrap;
  gap: 8px 18px;
}
details summary {
  cursor: pointer;
  color: var(--wine);
  font-size: 13px;
  padding: 10px 0;
}

#account {
  padding: 20px 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}
#account p {
  margin: 8px 0;
}
#admin-panel {
  margin-bottom: 24px;
}
#admin-users {
  overflow-wrap: anywhere;
}
.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 30px 18px;
}
.login-page .login-card {
  width: min(100%, 540px);
  margin: 0;
  padding: 36px;
  border: 1px solid #dedbd3;
  border-radius: 16px;
  background: #fffefb;
}
.login-card .brand {
  margin-bottom: 44px;
}
.login-card h1 {
  font-size: clamp(34px, 5vw, 48px);
}
.login-card label {
  display: block;
  margin: 24px 0 10px;
}
.login-card input {
  width: 100%;
  margin-bottom: 16px;
}
.login-card button[type="submit"] {
  width: 100%;
}
#login-message {
  min-height: 1.5em;
}

.transcription-panel {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line, #dedbd3);
}
.transcription-panel h3 {
  margin: 12px 0;
}
.transcription-panel select {
  width: 100%;
  margin: 10px 0 16px;
}
#transcript-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
#transcription-status:empty {
  display: none;
}

.recording-editor {
  margin-top: 24px;
  padding: 28px;
  border: 1px solid #d8c8c2;
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 8px 30px #29282106;
  scroll-margin-top: 24px;
}
.recording-editor-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.recording-editor-heading h3 {
  margin: 6px 0;
  font-size: 30px;
  font-weight: normal;
  line-height: 1.25;
}
.recording-editor-heading p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.editor-close {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--wine);
  font-size: 25px;
}
.recording-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 30px;
  align-items: center;
}
.recording-editor-preview {
  min-width: 0;
  padding: 24px;
  border-radius: 10px;
  background: #f3eee5;
}
.recording-editor-note {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: #e8dbd6;
  color: var(--wine);
  font-family: Georgia, serif;
  font-size: 28px;
}
.recording-editor-preview h4 {
  margin: 9px 0;
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 21px;
  font-weight: normal;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.recording-editor-preview audio {
  display: block;
  width: 100%;
  height: 42px;
  margin: 18px 0 0;
}
.recording-editor-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.recording-editor-label label:not(.check) {
  margin: 0;
  font-size: 13px;
}
#edit-recording-title {
  margin-top: 8px;
  padding: 13px 14px;
  background: #fffefa;
  font-size: 16px;
}
#edit-recording-title:focus-visible {
  outline: 2px solid var(--wine);
  outline-offset: 2px;
}
.recording-editor .editor-error {
  color: #983f3f;
  font-size: 12px;
  line-height: 1.6;
}
.recording-editor-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 22px;
  margin-top: 22px;
  border-top: 1px solid var(--line);
}
.recording-editor-actions button {
  min-height: 44px;
}
@media (max-width: 800px) {
  .recording-editor-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
  .recording-editor {
    padding: 20px;
  }
  .recording-editor-preview {
    padding: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

.story-collection,
.ungrouped-heading {
  grid-column: 1 / -1;
  min-width: 0;
}
.story-collection {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  padding: 24px;
}
.collection-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.collection-heading > div {
  min-width: 0;
}
.collection-heading h3 {
  margin: 5px 0;
  font-size: 25px;
  overflow-wrap: anywhere;
}
.collection-heading p {
  margin: 0;
}
.collection-parts > summary {
  font-size: 12px;
  margin-top: 14px;
}
.collection-parts .library-grid {
  margin-top: 14px;
}
.collection-parts .shelf-item {
  background: #f8f5ef;
}
.part-number {
  display: inline-block;
  margin-inline-start: 10px;
  padding: 3px 7px;
  border-radius: 4px;
  background: #eee2dc;
  color: var(--wine);
  font-size: 11px;
  font-weight: 600;
}
.collection-fields {
  margin-top: 24px;
}
.collection-fields input,
.collection-fields select {
  font-size: 16px;
}
#edit-recording-part {
  max-width: 110px;
}
.ungrouped-heading {
  margin: 12px 0 0;
  font-size: 19px;
}
.collection-player {
  margin-top: 24px;
  padding: 28px;
  border: 1px solid #c9d0c5;
  border-radius: 12px;
  background: #eeeee4;
  scroll-margin-top: 24px;
}
.collection-player h3 {
  font-size: 28px;
  margin: 8px 0;
  overflow-wrap: anywhere;
}
.collection-player audio {
  width: 100%;
  display: block;
  margin: 18px 0;
}
.collection-player-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.collection-tracks {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
  gap: 6px;
}
.collection-tracks button {
  width: 100%;
  padding: 10px 14px;
  text-align: start;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.collection-tracks button[aria-current="true"] {
  border-color: #d5b8b5;
  background: #fffefa;
  color: var(--wine);
}
@media (max-width: 650px) {
  .story-collection,
  .collection-player {
    padding: 18px;
  }
}

/* Voice Memos connection stays alongside the ordinary audio upload controls. */
.shortcut-panel {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid var(--line, #dedbd3);
  border-radius: 14px;
  background: #f6f2eb;
}
.shortcut-panel > summary {
  color: #813c49;
  font-weight: 600;
  cursor: pointer;
  min-height: 32px;
}
.shortcut-panel p,
.shortcut-steps {
  line-height: 1.65;
}
.shortcut-steps {
  padding-left: 24px;
}
.shortcut-steps li {
  padding: 6px 0 12px;
}
.shortcut-steps .upload-btn {
  display: table;
  margin-top: 12px;
  text-decoration: none;
}
.shortcut-panel .button {
  margin-top: 12px;
}
.shortcut-code-panel {
  margin-top: 20px;
}
.shortcut-code-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.shortcut-code-row input {
  min-width: 0;
  flex: 1;
  font-family: ui-monospace, monospace;
}
.shortcut-code-row button {
  white-space: nowrap;
}
.shortcut-error {
  color: #a12626;
}
.shortcut-connections-heading,
.shortcut-connections li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.shortcut-connections {
  list-style: none;
  padding: 0;
}
.shortcut-connections li {
  padding: 14px 0;
  border-top: 1px solid #dedbd3;
}
.shortcut-connections li div {
  min-width: 0;
  overflow-wrap: anywhere;
}
.shortcut-connections .fine {
  margin: 4px 0 0;
}
@media (max-width: 520px) {
  .shortcut-code-row {
    flex-wrap: wrap;
  }
  .shortcut-code-row input {
    flex-basis: 100%;
  }
  .shortcut-panel {
    padding: 14px;
  }
  .shortcut-panel input {
    font-size: 16px;
  }
}

.shortcut-install-help {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
}
.shortcut-install-help input {
  width: 100%;
  min-width: 0;
  font-size: 16px;
}
.shortcut-install-help .upload-btn,
.shortcut-install-page .upload-btn {
  min-height: 44px;
  white-space: normal;
  text-align: center;
}
.shortcut-install-help label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
}
.shortcut-install-help p:last-child:empty {
  display: none;
}
.shortcut-install-page h1 {
  font-size: clamp(32px, 7vw, 54px);
}

/* A focused recording space, with the same paper and wine palette as the gallery. */
.recording-studio {
  margin: 24px 0 18px;
  padding: 28px;
  border: 1px solid #dcd1c9;
  border-radius: 18px;
  background: #f7f1ed;
  overflow: hidden;
}
.recorder-heading,
.recorder-timeline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #736862;
  font-size: 11px;
}
.recorder-heading > div {
  font-weight: bold;
  letter-spacing: 1.5px;
}
.recorder-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: #ab9a90;
}
[data-phase="recording"] .recorder-dot {
  background: #b94350;
  box-shadow: 0 0 0 5px #b9435014;
}
[data-phase="paused"] .recorder-dot {
  background: #b68a3b;
}
.recorder-time {
  display: grid;
  gap: 0;
  text-align: center;
  margin: 25px 0 6px;
}
#recorder-clock {
  font-size: clamp(46px, 8vw, 68px);
  letter-spacing: -2px;
  font-weight: 400;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.recorder-time > span:last-child {
  font-family: Georgia, serif;
  font-size: 16px;
  font-style: italic;
  color: #8d7674;
}
.recorder-wave {
  position: relative;
  height: 164px;
  margin: 18px 0;
  border-top: 1px solid #e6dcd5;
  border-bottom: 1px solid #e6dcd5;
}
#recorder-waveform {
  display: block;
  width: 100%;
  height: 100%;
}
#recorder-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  color: #8b7971;
  font-size: 13px;
  pointer-events: none;
  background: #f7f1eddd;
}
#recorder-placeholder[hidden] {
  display: none;
}
.recorder-capture-actions,
.recorder-transport,
.recorder-save-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.recorder-capture-actions:has(> :not([hidden])) {
  margin-top: 20px;
}
.recorder-primary,
.recorder-secondary,
.recorder-skip {
  min-height: 48px;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid #c8b8ae;
}
.recorder-primary {
  background: var(--wine);
  color: #fffefa;
  border-color: var(--wine);
}
.recorder-primary > span {
  margin-right: 8px;
}
.recorder-secondary {
  background: #fffaf6;
  color: var(--wine);
}
.recorder-skip {
  background: transparent;
  border-color: transparent;
  padding: 10px;
  font-size: 22px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.recorder-skip span {
  font-size: 12px;
  font-weight: 400;
}
.recorder-primary:hover {
  background: #68313a;
}
.recorder-secondary:hover {
  background: #f1e6df;
}
.recorder-message {
  text-align: center;
  margin: 18px auto 8px;
  font-size: 13px;
  max-width: 560px;
  color: #674c4b;
}
.recorder-footnote {
  text-align: center;
  margin: 0 auto;
  font-size: 11px;
  color: #7e736b;
  max-width: 480px;
}
.recorder-input-level {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 24px;
  font-size: 11px;
  color: #736862;
}
.recorder-input-level meter {
  width: 70px;
  height: 10px;
  accent-color: var(--wine);
}
.recorder-seek {
  width: 100%;
  accent-color: var(--wine);
  padding: 0;
  min-height: 36px;
  margin: 0;
  cursor: pointer;
}
.recorder-timeline {
  font-variant-numeric: tabular-nums;
  margin: -6px 0 8px;
}
.recorder-save-actions {
  border-top: 1px solid #e0d5cd;
  margin-top: 22px;
  padding-top: 22px;
}
.recorder-save-actions .quiet,
.recorder-save-actions .text-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.recorder-discard-confirm {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #cba8aa;
  border-radius: 12px;
  text-align: center;
}
.recorder-discard-confirm p {
  margin-top: 0;
}
.recorder-input-level[hidden],
.recorder-discard-confirm[hidden] {
  display: none;
}
@media (max-width: 520px) {
  .recording-studio {
    padding: 20px 14px;
    border-radius: 14px;
  }
  .recorder-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    font-size: 10px;
  }
  .recorder-limit {
    padding-left: 16px;
  }
  .recorder-wave {
    height: 140px;
  }
  .recorder-primary,
  .recorder-secondary {
    padding: 12px 18px;
    font-size: 14px;
  }
  .recorder-save-actions > .recorder-primary {
    width: 100%;
  }
  .recorder-input-level {
    flex-wrap: wrap;
  }
}

/* Author-created tags stay readable and touch-friendly in both languages. */
.tag-editor {
  margin: 20px 0;
  min-width: 0;
}
.tag-entry {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tag-entry input {
  flex: 1;
  min-width: 0;
  margin: 0;
}
.tag-entry button {
  flex: 0 0 auto;
  min-height: 44px;
}
.story-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 12px 0;
  list-style: none;
}
.story-tags:empty {
  display: none;
}
.story-tags li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 6px 12px;
  border-radius: 20px;
  background: #f4eded;
  color: var(--wine);
  font-size: 13px;
}
.story-tags bdi {
  overflow-wrap: anywhere;
}
.story-tags button {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  margin: -6px -10px -6px 0;
  border: 0;
  background: transparent;
  color: var(--wine);
  font-size: 22px;
  cursor: pointer;
}
.tag-editor .story-tags li {
  min-height: 44px;
  padding-block: 0;
}
.tag-filter {
  max-width: 360px;
  margin: 20px 0;
}
.tag-filter label {
  display: block;
  margin-bottom: 8px;
}
.tag-filter select {
  width: 100%;
}

.listener-page {
  padding: 30px 18px max(30px, env(safe-area-inset-bottom));
}
.listener-card {
  width: min(100%, 800px);
  margin: 0 auto;
  padding: clamp(22px, 5vw, 50px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--white);
}
.listener-card .brand {
  margin-bottom: 24px;
}
.listener-back {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 30px;
}
.listener-card h1 {
  font-size: clamp(30px, 6vw, 48px);
  overflow-wrap: anywhere;
}
.listener-card h2 {
  font-size: 25px;
  overflow-wrap: anywhere;
}
.listener-card audio,
.listener-card textarea {
  width: 100%;
}
.comments-list p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.sharing-panel {
  padding: 20px;
  margin-top: 26px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
}
.share-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.share-link-row input {
  flex: 1;
  min-width: 140px;
  width: 100%;
}
#share-link-panel {
  margin-top: 20px;
}
.comments-section {
  border-top: 1px solid var(--line);
  margin-top: 30px;
  padding-top: 24px;
}
.comments-heading,
.comment-footer,
.comment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.comments-list {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}
.comments-list li {
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
.comment-meta time {
  color: var(--muted);
  font-size: 12px;
}
.comment-meta strong {
  overflow-wrap: anywhere;
}
.comment-footer {
  margin-top: 10px;
}
.listener-card button {
  min-height: 44px;
}
#listen-notice:empty {
  display: none;
}
.public-recording {
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.public-recording-badge {
  display: block;
  color: var(--wine);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

/* Shared-recording playback uses the recorder's warm, touch-friendly controls. */
.story-player {
  --playback-progress: 0%;
  margin: 26px 0;
  padding: 24px 28px;
  border: 1px solid #dcd1c9;
  border-radius: 20px;
  background: #f7f1ed;
}
.player-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.player-heading .eyebrow {
  margin: 0;
  font-size: 10px;
  line-height: 1.6;
}
.player-speed {
  display: flex;
  align-items: center;
  gap: 8px;
}
.player-speed label {
  font-size: 12px;
  color: #736862;
}
.player-speed select {
  width: auto;
  min-height: 44px;
  margin: 0;
  padding: 8px 10px;
  background: #fffaf6;
  border-radius: 12px;
  font-size: 14px;
  color: var(--wine);
}
.player-status {
  min-height: 24px;
  margin: 24px 0 6px;
  color: #736862;
  text-align: center;
  font-size: 13px;
}
.player-status.player-error {
  color: var(--wine);
}
.player-clock {
  text-align: center;
  font-size: clamp(40px, 8vw, 64px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -2px;
  font-variant-numeric: tabular-nums;
}
.player-total {
  font-size: 20px;
  color: #736862;
  letter-spacing: 0;
  white-space: nowrap;
}
.player-timeline {
  margin: 22px 0;
}
.player-timeline input[type="range"] {
  display: block;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  accent-color: var(--wine);
  appearance: none;
  -webkit-appearance: none;
}
.player-timeline input::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 8px;
  background: linear-gradient(
    to right,
    var(--wine) var(--playback-progress),
    #ded1c9 var(--playback-progress)
  );
}
.player-timeline input::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--wine);
  border: 3px solid #fffaf6;
  box-shadow: 0 1px 4px #42292530;
}
.player-timeline input::-moz-range-track {
  height: 8px;
  border-radius: 8px;
  background: #ded1c9;
}
.player-timeline input::-moz-range-progress {
  height: 8px;
  border-radius: 8px;
  background: var(--wine);
}
.player-timeline input::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--wine);
  border: 3px solid #fffaf6;
}
.player-timeline-labels {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  color: #736862;
  font-variant-numeric: tabular-nums;
}
.player-transport {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1fr);
  align-items: center;
  max-width: 360px;
  margin-inline: auto;
  gap: 16px;
}
.listener-card .player-play {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 60px;
  min-width: 0;
  padding: 16px 22px;
  border: 1px solid var(--wine);
  border-radius: 999px;
  background: var(--wine);
  color: #fffaf6;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.player-play > [aria-hidden] {
  font-size: 19px;
}
.player-skip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--wine);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.player-skip svg {
  width: 30px;
  height: 30px;
  overflow: visible;
}
.player-skip path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.player-skip text {
  fill: currentColor;
  font: 11px sans-serif;
  text-anchor: middle;
}
.story-player button:disabled,
.story-player input:disabled {
  cursor: default;
  opacity: 0.45;
}
.story-player :is(button, select, input):focus-visible {
  outline: 3px solid var(--wine);
  outline-offset: 4px;
}
.player-hint {
  margin: 20px 0 0;
  font-size: 11px;
  text-align: center;
  color: #736862;
}
@media (max-width: 520px) {
  .story-player {
    padding: 20px 14px;
    margin-inline: -8px;
  }
  .player-heading {
    gap: 8px;
  }
  .player-heading .eyebrow {
    max-width: 130px;
  }
  .player-transport {
    gap: 10px;
  }
  .listener-card .player-play {
    min-width: 0;
    padding-inline: 16px;
  }
  .player-total {
    font-size: 17px;
  }
}

/* Private profile settings, shared with public recording bylines. */
#account #account-name {
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
}
#account #account-email {
  color: var(--muted);
  font-size: 11px;
}
#account button {
  display: block;
}
.profile-dialog {
  width: min(480px, calc(100% - 32px));
  max-width: 480px;
  max-height: calc(100dvh - 32px);
  padding: 32px;
  border-radius: 20px;
  box-shadow: 0 24px 80px #29282130;
}
.profile-dialog::backdrop {
  background: #29282180;
  backdrop-filter: blur(4px);
}
.profile-dialog h2 {
  margin: 10px 0 14px;
  font-size: 34px;
  letter-spacing: -1px;
  line-height: 1.2;
}
.profile-dialog p {
  font-size: 14px;
  line-height: 1.6;
}
.profile-dialog label {
  display: block;
  margin: 24px 0 8px;
  font-weight: 600;
}
.profile-dialog input {
  width: 100%;
  font-size: 16px;
}
.profile-dialog .profile-help {
  font-size: 12px;
}
.profile-preview {
  padding: 18px;
  margin: 24px 0 18px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 12px;
  overflow-wrap: anywhere;
}
.profile-preview p {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 18px;
}
#profile-error {
  padding: 12px;
  border-radius: 8px;
  background: #f3e9e8;
  color: #8b303b;
}
.profile-dialog .dialog-actions {
  gap: 12px;
}
.profile-dialog .dialog-actions button {
  min-height: 48px;
  border-radius: 8px;
  font-size: 14px;
  justify-content: center;
  flex: 1;
}
.profile-cancel {
  border: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
}
.profile-cancel:hover {
  background: var(--paper);
}
.profile-settings-link {
  display: inline-block;
  margin: 0 0 16px;
}
@media (max-width: 480px) {
  .profile-dialog {
    padding: 24px;
  }
  .profile-dialog h2 {
    font-size: 30px;
  }
  .profile-dialog .dialog-actions {
    gap: 8px;
  }
  .profile-dialog .dialog-actions button {
    padding: 12px 10px;
  }
}

/* Two direct starting points; the text editor comes before the recording tools. */
.story-start-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 22px;
}
.story-start-actions .button {
  text-decoration: none;
}
.story-start-actions .text-link {
  margin-top: 0;
}
.studio-grid {
  margin-bottom: 28px;
}
.story-card,
.voice-card {
  min-width: 0;
  scroll-margin-top: 20px;
}
.story-card .section-top > .eyebrow {
  line-height: 1.6;
}
.story-card .story-editor {
  font-size: 16px;
  padding: 16px;
  min-height: 280px;
}
.reading-time-panel {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f6ef;
}
.reading-time-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  font-size: 12px;
  color: var(--muted);
}
#reading-time {
  display: block;
  margin-top: 8px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
#reading-time-range {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
#reading-time-note {
  margin-bottom: 0;
}
.story-card .idea-box {
  margin-top: 24px;
  margin-bottom: 0;
}
.story-card .idea-box summary {
  cursor: pointer;
  color: var(--wine);
  font-size: 12px;
}
.story-card .idea-box[open] summary {
  margin-bottom: 18px;
}
.field-error {
  color: var(--wine);
  font-size: 12px;
  line-height: 1.6;
}
#story[aria-invalid="true"] {
  border-color: var(--wine);
}
@media (max-width: 680px) {
  .story-start-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .story-start-actions .button {
    justify-content: center;
  }
  .story-card .section-top {
    flex-wrap: wrap;
  }
}

/* Keep narration status beside the action, including on narrow phone screens. */
.narration-progress {
  margin: 18px 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}
.narration-progress-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.narration-progress-parts {
  color: var(--wine);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.narration-progress h3 {
  margin: 16px 0 6px;
  font-size: 24px;
}
.narration-progress p {
  font-size: 12px;
  line-height: 1.6;
}
#narration-progress-title {
  color: var(--muted);
  overflow-wrap: anywhere;
  margin: 0 0 18px;
}
.narration-progress progress {
  display: block;
  width: 100%;
  height: 8px;
  margin: 18px 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  appearance: none;
  accent-color: var(--wine);
  background: var(--line);
}
.narration-progress progress::-webkit-progress-bar {
  background: var(--line);
  border-radius: 8px;
}
.narration-progress progress::-webkit-progress-value {
  background: var(--wine);
  border-radius: 8px;
}
.narration-progress progress::-moz-progress-bar {
  background: var(--wine);
  border-radius: 8px;
}
.narration-progress-times {
  display: grid;
  grid-template-columns: minmax(70px, 1fr) minmax(0, 2fr);
  gap: 20px;
}
.narration-progress-times span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 5px;
}
.narration-progress-times strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}
.narration-progress[data-state="completed"] {
  border-color: #b7c8b8;
  background: #f1f5ee;
}
.narration-progress[data-state="failed"] {
  border-color: #d6b6a4;
  background: #f5e3e1;
}
@media (max-width: 480px) {
  .narration-progress {
    padding: 17px;
  }
  .narration-progress h3 {
    font-size: 22px;
  }
  .narration-progress-times {
    gap: 12px;
  }
}
