:root {
  color-scheme: light;
  --bg: #f7f3ee;
  --surface: #fff9f1;
  --surface-strong: #ffffff;
  --ink: #191820;
  --muted: #6f6878;
  --line: #e6d8cb;
  --brand: #e05238;
  --brand-dark: #7a2d9f;
  --cue: #ffe2b8;
  --mine: #ff9500;
  --mine-text: #fbfffc;
  --accent: #0f9b8e;
  --violet: #7a2d9f;
  --sky: #2374ab;
  --sun: #f2b705;
  --rose: #d64078;
  --shadow: 0 18px 40px rgb(64 38 24 / 15%);
  --radius: 8px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 14% 8%, rgb(242 183 5 / 24%), transparent 28%),
    radial-gradient(circle at 86% 0%, rgb(122 45 159 / 20%), transparent 32%),
    linear-gradient(135deg, rgb(224 82 56 / 16%) 0 18%, transparent 18% 100%),
    linear-gradient(225deg, rgb(35 116 171 / 14%) 0 28%, transparent 28% 100%),
    linear-gradient(180deg, #fff9f1 0, #f6f0ea 420px),
    var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.button {
  appearance: none;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff, #fff7ef);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 8px 20px rgb(64 38 24 / 8%);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

button:hover,
.button:hover {
  border-color: rgb(224 82 56 / 55%);
  box-shadow: 0 14px 28px rgb(64 38 24 / 13%);
}

button:active,
.button:active {
  transform: translateY(1px);
}

.app-shell {
  min-height: 100dvh;
  padding: max(16px, env(safe-area-inset-top)) 16px max(96px, env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin: -16px -16px 14px;
  padding: max(14px, env(safe-area-inset-top)) 16px 12px;
  color: #fff;
  background: linear-gradient(135deg, rgb(25 24 32 / 96%), rgb(42 33 55 / 92));
  border-bottom: 1px solid rgb(255 255 255 / 10%);
  backdrop-filter: blur(16px);
}

.top-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.brand {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar .eyebrow {
  color: #ffd37b;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

h2 {
  margin-bottom: 12px;
  font-size: 20px;
  overflow-wrap: anywhere;
}

.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  min-height: 44px;
  place-items: center;
  padding: 0;
  font-size: 22px;
  font-weight: 800;
}

.topbar .icon-button {
  color: #fff;
  background: rgb(255 255 255 / 12%);
  border-color: rgb(255 255 255 / 16%);
}

.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--violet));
  color: #fff;
  font-weight: 800;
}

.quiet {
  background: transparent;
}

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

.library-section {
  margin-top: 24px;
}

.library-section > h2 {
  margin: 0 0 10px;
  padding: 0 2px;
  color: #352c40;
  background: transparent;
  border-radius: 0;
  font-size: 22px;
  box-shadow: none;
}

.library-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 76px;
  gap: 16px;
  align-items: center;
  min-height: 158px;
  margin-bottom: 16px;
  padding: 20px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, #e05238, #7a2d9f 58%, #2374ab);
  border: 1px solid rgb(255 255 255 / 28%);
  border-radius: var(--radius);
  box-shadow: 0 26px 60px rgb(64 38 24 / 22%);
}

.library-hero::after {
  content: "";
  position: absolute;
  right: -34px;
  bottom: -42px;
  width: 180px;
  height: 180px;
  background: rgb(255 255 255 / 10%);
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 50%;
}

.library-hero .eyebrow {
  color: #fff0bf;
}

.library-hero h2 {
  position: relative;
  z-index: 1;
  margin-bottom: 0;
  font-size: 32px;
  line-height: 1.05;
}

.hero-mark {
  position: relative;
  z-index: 1;
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  color: #17151f;
  background: #fff7ea;
  border-radius: 22px;
  font-size: 42px;
  font-weight: 950;
  box-shadow: inset 0 -8px 0 rgb(242 183 5 / 30%), 0 18px 36px rgb(25 24 32 / 24%);
}

.search-field {
  padding: 12px;
  background: rgb(255 255 255 / 70%);
  border: 1px solid rgb(255 255 255 / 74%);
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgb(64 38 24 / 10%);
}

.play-card {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 14px;
  align-items: center;
  width: 100%;
  min-height: 128px;
  padding: 12px;
  text-align: left;
  background: rgb(255 255 255 / 78%);
  border: 1px solid rgb(255 255 255 / 84%);
  box-shadow: 0 12px 30px rgb(42 33 55 / 11%);
  backdrop-filter: blur(18px);
}

.cover {
  display: grid;
  width: 96px;
  height: 104px;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, var(--violet), var(--brand), var(--sun));
  border-radius: var(--radius);
  color: #fff;
  font-size: 34px;
  font-weight: 900;
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play-card h2 {
  margin-bottom: 6px;
  font-size: 20px;
  line-height: 1.12;
}

.play-main {
  min-width: 0;
}

.meta {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.role-line {
  margin: 0 0 6px;
  color: #191820;
  font-size: 15px;
  font-weight: 850;
}

.card-chevron {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #7a7180;
  background: rgb(25 24 32 / 6%);
  border-radius: 50%;
  font-size: 20px;
  font-weight: 900;
}

.status-dot {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  margin-bottom: 6px;
  padding: 3px 8px;
  color: var(--violet);
  background: rgb(122 45 159 / 10%);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.status-dot.current {
  color: #6b3100;
  background: linear-gradient(135deg, #ffe2b8, #ffd2d2);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 18px;
}

.pill {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgb(255 255 255 / 72%);
}

.pill.active {
  border-color: rgb(224 82 56 / 55%);
  background: linear-gradient(135deg, #ffe2b8, #ffd8ea);
  font-weight: 800;
}

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

.progress {
  height: 8px;
  overflow: hidden;
  background: rgb(23 23 22 / 12%);
  border-radius: 999px;
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--violet), var(--accent));
  border-radius: inherit;
}

.script {
  display: grid;
  gap: 14px;
}

.line {
  position: relative;
  padding: 13px 14px;
  border: 1px solid rgb(255 255 255 / 72%);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 88%);
  box-shadow: 0 10px 24px rgb(64 38 24 / 10%);
  text-align: left;
}

.line.mine {
  background: linear-gradient(135deg, var(--ios-orange), var(--ios-pink));
  color: var(--mine-text);
  border-color: rgb(255 255 255 / 12%);
}

.line.accent {
  background: linear-gradient(135deg, var(--rose), var(--violet));
  border-color: var(--accent);
}

.speaker {
  display: block;
  margin-bottom: 6px;
  color: inherit;
  font-size: 13px;
  font-weight: 900;
  opacity: 0.76;
}

.text {
  margin: 0;
  white-space: pre-wrap;
  font-size: var(--text-size, 19px);
  line-height: 1.48;
  transition: filter 900ms ease, opacity 900ms ease, text-shadow 900ms ease;
}

.learn-hidden .line.mine .text {
  filter: blur(9px);
  opacity: .46;
  text-shadow: 0 0 18px rgb(255 255 255 / 70%);
  user-select: none;
}

.line.revealed .text {
  color: inherit;
  filter: none;
  opacity: 1;
  text-shadow: none;
  user-select: auto;
}

.learn-hidden .line.mine.revealed .text {
  filter: none;
  opacity: 1;
  text-shadow: none;
  user-select: auto;
}

.line.revealed .text::after {
  content: "";
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  gap: 10px;
  padding: 10px 12px max(10px, env(safe-area-inset-bottom));
  margin: 0 10px max(8px, env(safe-area-inset-bottom));
  padding: 8px;
  background: rgb(25 24 32 / 86%);
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 22px;
  box-shadow: 0 18px 48px rgb(25 24 32 / 28%);
  backdrop-filter: blur(16px);
}

.bottom-nav button {
  border-color: rgb(255 255 255 / 18%);
}

.toggle-learn {
  background: linear-gradient(135deg, var(--brand), var(--violet));
  color: #fff;
  font-weight: 900;
}

.toggle-learn.off {
  background: #fff;
  color: var(--ink);
}

.panel {
  padding: 16px;
  background: rgb(255 249 241 / 86%);
  border: 1px solid rgb(255 255 255 / 74%);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.form-grid {
  display: grid;
  gap: 12px;
}

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

.editor-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  background:
    linear-gradient(135deg, rgb(255 226 184 / 90%), rgb(255 216 234 / 78)),
    rgb(255 249 241 / 86%);
}

.editor-card {
  position: relative;
  overflow: hidden;
}

.editor-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--brand), var(--sun), var(--accent), var(--violet));
}

.panel-title,
.line-board-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.panel-title {
  justify-content: flex-start;
}

.panel-title h2,
.line-board-head h2 {
  margin-bottom: 0;
}

.panel-icon {
  color: var(--brand);
  font-size: 18px;
}

.panel-icon.warm {
  color: var(--sun);
}

.editor-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.line-board {
  margin-top: 2px;
}

.edit-hint {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  margin-top: 10px;
  padding: 3px 8px;
  color: rgb(25 24 32 / 72%);
  background: rgb(255 255 255 / 62%);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.line.mine .edit-hint,
.line.accent .edit-hint {
  color: #fff;
  background: rgb(255 255 255 / 18%);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 11px;
  color: var(--ink);
  background: rgb(255 255 255 / 88%);
  border: 1px solid #e8d7c6;
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 70%);
}

textarea {
  min-height: 150px;
  resize: vertical;
}

.actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.empty {
  padding: 24px 16px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.toast {
  position: fixed;
  right: max(12px, calc((100vw - 430px) / 2 + 12px));
  bottom: max(14px, env(safe-area-inset-bottom));
  left: max(12px, calc((100vw - 430px) / 2 + 12px));
  z-index: 80;
  overflow: hidden;
  padding: 13px 14px 15px;
  color: #fff;
  background: linear-gradient(135deg, var(--ios-orange), var(--ios-pink));
  border-radius: 18px;
  box-shadow: 0 18px 46px rgb(0 0 0 / 32%);
  animation: toastIn 260ms cubic-bezier(.2, .8, .2, 1) both;
  font-size: 14px;
  font-weight: 780;
}

.toast::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgb(255 255 255 / 78%);
  transform-origin: left;
  animation: toastBar 4000ms linear both;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  align-items: end;
  padding: 14px;
  background: rgb(25 24 32 / 52%);
  backdrop-filter: blur(10px);
}

.modal-sheet {
  width: min(100%, 680px);
  max-height: min(86dvh, 760px);
  margin: 0 auto;
  overflow: auto;
  padding: 16px;
  background:
    linear-gradient(180deg, #fffdf8, #fff3e6),
    var(--surface-strong);
  border: 1px solid rgb(255 255 255 / 76%);
  border-radius: var(--radius);
  box-shadow: 0 28px 80px rgb(25 24 32 / 32%);
}

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

.modal-head h2 {
  margin-bottom: 0;
}

.settings-sheet {
  padding: 12px;
}

.settings-list {
  display: grid;
  gap: 8px;
}

.settings-row {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 66px;
  padding: 10px;
  text-align: left;
  background: rgb(255 255 255 / 74%);
  border: 1px solid rgb(255 255 255 / 80%);
  box-shadow: none;
}

.settings-row.static {
  grid-template-columns: 42px 1fr auto;
}

.settings-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--violet));
  border-radius: 12px;
  font-size: 20px;
  font-weight: 900;
}

.settings-row strong,
.settings-row small {
  display: block;
}

.settings-row strong {
  color: #191820;
  font-size: 16px;
}

.settings-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.stepper {
  display: flex;
  gap: 6px;
}

.stepper button {
  width: 44px;
  min-height: 38px;
  padding: 0;
  font-weight: 900;
}

@media (min-width: 760px) {
  .app-shell {
    max-width: 880px;
    margin: 0 auto;
    padding-right: 24px;
    padding-left: 24px;
  }

  .topbar {
    margin-right: -24px;
    margin-left: -24px;
    padding-right: 24px;
    padding-left: 24px;
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .editor-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .editor-hero,
  .line-board {
    grid-column: 1 / -1;
  }

  .modal-backdrop {
    align-items: center;
  }

  .bottom-nav {
    right: calc((100vw - 880px) / 2 + 24px);
    left: calc((100vw - 880px) / 2 + 24px);
    bottom: 16px;
    border-radius: 22px;
  }
}

/* iOS app redesign layer */
:root {
  --ios-bg: #f2f2f7;
  --ios-card: rgb(255 255 255 / 82%);
  --ios-card-solid: #ffffff;
  --ios-label: #111114;
  --ios-secondary: #6e6e73;
  --ios-tertiary: #aeaeb2;
  --ios-separator: rgb(60 60 67 / 13%);
  --ios-blue: #007aff;
  --ios-indigo: #5856d6;
  --ios-orange: #ff9500;
  --ios-pink: #ff2d55;
  --ios-green: #34c759;
  --ios-radius-lg: 22px;
  --ios-radius-md: 16px;
  --ios-shadow: 0 18px 45px rgb(0 0 0 / 10%);
}

html {
  background: var(--ios-bg);
}

body {
  background:
    linear-gradient(180deg, #f8f8fb 0, var(--ios-bg) 42%),
    var(--ios-bg);
  color: var(--ios-label);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", sans-serif;
  overscroll-behavior-y: none;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

button,
.button {
  border: 0;
  border-radius: var(--ios-radius-md);
  background: var(--ios-card-solid);
  box-shadow: none;
  transition: transform 180ms cubic-bezier(.2, .8, .2, 1), opacity 180ms ease, background 180ms ease;
}

button:hover,
.button:hover {
  border-color: transparent;
  box-shadow: none;
}

button:active,
.button:active,
.play-card:active,
.settings-row:active {
  transform: scale(.975);
  opacity: .78;
}

.app-shell {
  width: min(100%, 430px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 16px max(112px, env(safe-area-inset-bottom));
  animation: appEnter 260ms ease both;
}

.topbar {
  position: sticky;
  top: 0;
  margin: -14px -16px 18px;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  color: var(--ios-label);
  background: rgb(242 242 247 / 78%);
  border-bottom: 1px solid var(--ios-separator);
  backdrop-filter: blur(24px) saturate(1.6);
}

.topbar .eyebrow {
  color: var(--ios-secondary);
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
}

h1 {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0;
}

.view-reader h1,
.view-editor h1 {
  font-size: 22px;
  font-weight: 760;
}

h2 {
  color: var(--ios-label);
  font-weight: 760;
}

.icon-button,
.topbar .icon-button {
  width: 42px;
  height: 42px;
  min-height: 42px;
  color: var(--ios-blue);
  background: rgb(118 118 128 / 12%);
  border: 0;
  border-radius: 50%;
  font-size: 20px;
}

.library-hero {
  grid-template-columns: 1fr 72px;
  min-height: 148px;
  margin-bottom: 14px;
  padding: 20px;
  background:
    linear-gradient(135deg, rgb(0 122 255 / 96%), rgb(88 86 214 / 94) 54%, rgb(255 45 85 / 88)),
    #1c1c1e;
  border: 0;
  border-radius: 28px;
  box-shadow: var(--ios-shadow);
}

.library-hero::after {
  right: -42px;
  bottom: -52px;
  width: 170px;
  height: 170px;
  background: rgb(255 255 255 / 12%);
}

.library-hero .eyebrow {
  color: rgb(255 255 255 / 72%);
  text-transform: none;
}

.library-hero h2 {
  color: #fff;
  font-size: 31px;
  font-weight: 830;
  letter-spacing: 0;
}

.hero-mark {
  width: 72px;
  height: 72px;
  color: var(--ios-blue);
  background: rgb(255 255 255 / 92%);
  border-radius: 21px;
  box-shadow: inset 0 -5px 0 rgb(0 122 255 / 10), 0 16px 34px rgb(0 0 0 / 18%);
}

.search-field {
  gap: 8px;
  padding: 0;
  color: transparent;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.search-field input {
  min-height: 44px;
  padding: 0 14px;
  color: var(--ios-label);
  background: rgb(118 118 128 / 12%);
  border: 0;
  border-radius: 14px;
  box-shadow: none;
  font-size: 17px;
}

.library-section {
  margin-top: 26px;
}

.library-section > h2 {
  margin: 0 0 10px 2px;
  color: var(--ios-label);
  font-size: 22px;
  font-weight: 800;
}

.grid {
  gap: 10px;
}

.play-card {
  grid-template-columns: 82px 1fr 28px;
  min-height: 112px;
  padding: 10px;
  background: var(--ios-card);
  border: 1px solid rgb(255 255 255 / 70%);
  border-radius: var(--ios-radius-lg);
  box-shadow: 0 10px 28px rgb(0 0 0 / 7%);
  backdrop-filter: blur(18px) saturate(1.35);
}

.cover {
  width: 82px;
  height: 92px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--ios-blue), var(--ios-indigo));
  box-shadow: inset 0 -10px 18px rgb(0 0 0 / 12%);
}

.play-card h2 {
  margin-bottom: 5px;
  font-size: 18px;
  font-weight: 760;
}

.game-section {
  padding-bottom: 20px;
}

.quiz-card {
  display: grid;
  grid-template-columns: 58px 1fr 28px;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 92px;
  padding: 12px;
  color: var(--ios-label);
  text-align: left;
  background:
    linear-gradient(135deg, rgb(255 138 61 / 20%), rgb(255 79 135 / 16%)),
    var(--ios-card);
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: var(--ios-radius-lg);
  box-shadow: 0 14px 36px rgb(0 0 0 / 18%);
  backdrop-filter: blur(18px) saturate(1.35);
}

.quiz-card strong,
.quiz-card small {
  display: block;
}

.quiz-card strong {
  font-size: 18px;
  font-weight: 800;
}

.quiz-card small {
  margin-top: 3px;
  color: var(--ios-secondary);
  font-size: 13px;
  line-height: 1.25;
}

.quiz-orb {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--ios-orange), var(--ios-pink));
  border-radius: 18px;
  font-size: 28px;
  font-weight: 900;
  box-shadow: inset 0 -10px 18px rgb(0 0 0 / 12%);
}

.quiz-screen {
  display: grid;
  gap: 12px;
}

.quiz-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  min-height: 154px;
  padding: 18px;
  color: #fff;
  background:
    linear-gradient(135deg, rgb(255 138 61 / 95%), rgb(255 79 135 / 92) 58%, rgb(139 92 246 / 88)),
    #1c1c24;
  border-radius: 28px;
  box-shadow: 0 18px 45px rgb(0 0 0 / 24%);
}

.quiz-hero .eyebrow {
  color: rgb(255 255 255 / 72%);
}

.quiz-hero h2 {
  margin: 2px 0 0;
  color: #fff;
  font-size: 64px;
  line-height: .9;
}

.quiz-hero p {
  margin: 4px 0 0;
  color: rgb(255 255 255 / 82%);
  font-weight: 700;
}

.quiz-lives {
  display: grid;
  grid-template-columns: repeat(3, 28px);
  gap: 5px;
  padding: 8px;
  background: rgb(0 0 0 / 18%);
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 18px;
}

.quiz-lives small {
  grid-column: 1 / -1;
  color: rgb(255 255 255 / 70%);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.quiz-lives span {
  display: grid;
  width: 28px;
  height: 26px;
  place-items: center;
  color: rgb(255 255 255 / 28%);
  background: rgb(255 255 255 / 12%);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 900;
}

.quiz-lives span.alive {
  color: #fff;
  background: rgb(255 255 255 / 24%);
}

.quiz-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.quiz-panel h2 {
  margin: -4px 0 0;
  font-size: 28px;
  line-height: 1.08;
}

.quiz-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.quiz-options button {
  min-height: 64px;
  color: var(--ios-label);
  background: rgb(255 255 255 / 10%);
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 18px;
  font-size: 22px;
  font-weight: 850;
}

.quiz-options button.correct {
  color: #fff;
  background: linear-gradient(135deg, #34c759, #28d0b4);
}

.quiz-options button.wrong {
  color: #fff;
  background: linear-gradient(135deg, #ff453a, #ff2d55);
}

.quiz-choice-grid {
  display: grid;
  gap: 8px;
}

.quiz-choice-grid button {
  min-height: 48px;
  padding: 10px 12px;
  color: var(--ios-label);
  text-align: left;
  background: rgb(255 255 255 / 9%);
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 15px;
  font-size: 14px;
  font-weight: 740;
}

.quiz-choice-grid button.selected {
  color: #fff;
  background: linear-gradient(135deg, rgb(255 138 61 / 86%), rgb(255 79 135 / 82%));
  border-color: transparent;
}

.quiz-choice-grid button.correct {
  color: #fff;
  background: linear-gradient(135deg, #34c759, #28d0b4);
}

.quiz-choice-grid button.wrong {
  color: #fff;
  background: linear-gradient(135deg, #ff453a, #ff2d55);
}

.quiz-slots {
  display: grid;
  gap: 8px;
}

.quiz-slots span {
  min-height: 42px;
  border: 1px dashed rgb(255 255 255 / 18%);
  border-radius: 14px;
  background: rgb(255 255 255 / 6%);
}

.quiz-slots span.filled {
  display: grid;
  align-items: center;
  padding: 9px 11px;
  color: #fff;
  background: linear-gradient(135deg, rgb(52 199 89 / 94%), rgb(40 208 180 / 90%));
  border: 0;
  font-size: 14px;
  font-weight: 760;
}

.quiz-input {
  display: grid;
  gap: 7px;
}

.quiz-input > span {
  display: grid;
  grid-template-columns: 1fr 58px;
  gap: 8px;
}

.quiz-input button {
  min-height: 42px;
  padding: 0;
}

.quiz-suggestions {
  display: grid;
  gap: 6px;
}

.quiz-suggestions button {
  min-height: 42px;
  padding: 9px 11px;
  color: var(--ios-label);
  text-align: left;
  background: rgb(255 255 255 / 9%);
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 13px;
  font-size: 14px;
  font-weight: 700;
}

.quiz-count {
  margin: -2px 0 0;
  color: var(--ios-secondary);
  font-size: 13px;
  font-weight: 700;
}

.quiz-result {
  display: grid;
  gap: 3px;
  padding: 12px;
  border-radius: 16px;
}

.quiz-result.correct {
  color: #d8fff7;
  background: rgb(40 208 180 / 14%);
}

.quiz-result.wrong {
  color: #ffe0e6;
  background: rgb(255 79 135 / 14%);
}

.quiz-result strong,
.quiz-result small {
  display: block;
}

.quiz-result small {
  color: inherit;
  opacity: .76;
}

.quiz-next {
  min-height: 50px;
}

.role-line {
  color: var(--ios-label);
  font-size: 15px;
  font-weight: 650;
}

.meta {
  color: var(--ios-secondary);
  font-size: 13px;
  line-height: 1.25;
}

.card-chevron {
  color: var(--ios-tertiary);
  background: transparent;
  font-size: 28px;
  font-weight: 400;
}

.reader-head {
  position: sticky;
  top: 72px;
  z-index: 8;
  margin: 0 -16px 14px;
  padding: 0 16px 12px;
  background: linear-gradient(180deg, rgb(242 242 247 / 94%), rgb(242 242 247 / 76));
  backdrop-filter: blur(18px);
}

.reader-head h2 {
  margin-bottom: 0;
  font-size: 24px;
}

.pill-row {
  flex-wrap: nowrap;
  margin: 8px -16px 0;
  padding: 0 16px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.pill-row::-webkit-scrollbar {
  display: none;
}

.pill {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 13px;
  color: var(--ios-blue);
  background: rgb(0 122 255 / 10);
  border: 0;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 650;
}

.pill.active {
  color: #fff;
  background: var(--ios-blue);
}

.progress {
  height: 5px;
  background: rgb(60 60 67 / 12%);
}

.progress span {
  background: var(--ios-blue);
}

.script {
  gap: 10px;
}

.line {
  padding: 14px;
  background: var(--ios-card-solid);
  border: 0;
  border-radius: 18px;
  box-shadow: 0 7px 18px rgb(0 0 0 / 5%);
  animation: cardIn 220ms ease both;
}

.line.mine {
  background: linear-gradient(135deg, var(--ios-orange), var(--ios-pink));
}

.line.accent {
  background: linear-gradient(135deg, var(--ios-pink), var(--ios-indigo));
}

.speaker {
  font-size: 12px;
  font-weight: 750;
  opacity: .65;
}

.text {
  font-size: var(--text-size, 19px);
  line-height: 1.44;
}

.bottom-nav {
  right: max(10px, calc((100vw - 430px) / 2 + 10px));
  left: max(10px, calc((100vw - 430px) / 2 + 10px));
  grid-template-columns: 52px 1fr 52px;
  gap: 8px;
  margin: 0 0 max(8px, env(safe-area-inset-bottom));
  padding: 8px;
  background: rgb(28 28 30 / 82%);
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 24px;
  box-shadow: 0 18px 52px rgb(0 0 0 / 24%);
  backdrop-filter: blur(24px) saturate(1.6);
}

.bottom-nav .icon-button {
  color: #fff;
  background: rgb(255 255 255 / 12%);
}

.toggle-learn {
  min-height: 52px;
  background: var(--ios-blue);
  border-radius: 18px;
  font-size: 16px;
}

.toggle-learn.off {
  background: rgb(255 255 255 / 90%);
  color: var(--ios-label);
}

.panel,
.editor-hero,
.modal-sheet {
  background: var(--ios-card);
  border: 1px solid rgb(255 255 255 / 75%);
  border-radius: var(--ios-radius-lg);
  box-shadow: 0 12px 34px rgb(0 0 0 / 8%);
  backdrop-filter: blur(20px) saturate(1.35);
}

.editor-layout {
  gap: 12px;
}

.editor-hero {
  background: linear-gradient(135deg, rgb(255 255 255 / 88%), rgb(239 245 255 / 88));
}

.editor-card::before {
  display: none;
}

label {
  color: var(--ios-secondary);
  font-size: 13px;
}

input,
select,
textarea {
  min-height: 46px;
  padding: 11px 12px;
  background: rgb(118 118 128 / 10);
  border: 0;
  border-radius: 14px;
  box-shadow: none;
  font-size: 16px;
}

.cover-upload input[type="file"] {
  padding: 10px;
  background: rgb(0 122 255 / 10);
  color: var(--ios-blue);
}

.cover-editor-preview {
  display: grid;
  width: 118px;
  height: 132px;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, var(--ios-blue), var(--ios-indigo));
  border-radius: 24px;
  font-size: 42px;
  font-weight: 850;
  box-shadow: 0 12px 28px rgb(0 0 0 / 12%);
}

.cover-editor-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-backdrop {
  padding: 10px;
  background: rgb(0 0 0 / 28%);
  animation: fadeIn 180ms ease both;
}

.modal-sheet {
  width: min(100%, 410px);
  max-height: min(88dvh, 760px);
  padding: 14px;
  border-radius: 28px 28px 24px 24px;
  animation: sheetUp 260ms cubic-bezier(.2, .8, .2, 1) both;
}

.modal-head {
  margin-bottom: 12px;
}

.modal-head h2 {
  font-size: 22px;
}

.settings-list {
  gap: 1px;
  overflow: hidden;
  background: var(--ios-separator);
  border-radius: 18px;
}

.settings-row {
  min-height: 64px;
  padding: 11px 12px;
  background: rgb(255 255 255 / 88);
  border: 0;
  border-radius: 0;
}

.quiz-settings-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.quiz-setting-group {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: rgb(255 255 255 / 8%);
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 18px;
}

.quiz-setting-group strong,
.quiz-setting-group small {
  display: block;
}

.quiz-setting-group strong {
  color: var(--ios-label);
  font-size: 15px;
}

.quiz-setting-group small {
  color: var(--ios-secondary);
  font-size: 12px;
  line-height: 1.3;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  background: rgb(120 120 128 / 20%);
  border-radius: 14px;
}

.segmented-control button {
  min-height: 38px;
  padding: 7px 8px;
  color: var(--ios-secondary);
  background: transparent;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 800;
}

.segmented-control button.active {
  color: var(--ios-label);
  background: rgb(255 255 255 / 16%);
}

.settings-icon {
  background: var(--ios-blue);
  border-radius: 11px;
}

.sync-row.is-syncing .settings-icon {
  animation: syncSpin 900ms linear infinite;
}

.stepper button {
  color: var(--ios-blue);
  background: rgb(0 122 255 / 10);
}

@media (hover: hover) {
  .play-card:hover,
  .settings-row:hover,
  .line:hover {
    transform: translateY(-1px);
  }
}

@media (max-width: 430px) {
  .app-shell {
    width: 100%;
  }

  .library-hero {
    min-height: 142px;
  }

  .play-card {
    grid-template-columns: 78px 1fr 24px;
    min-height: 108px;
  }

  .cover {
    width: 78px;
    height: 88px;
  }
}

@media (min-width: 760px) {
  .app-shell {
    max-width: 430px;
    padding-right: 16px;
    padding-left: 16px;
  }

  .topbar {
    margin-right: -16px;
    margin-left: -16px;
    padding-right: 16px;
    padding-left: 16px;
  }

  .grid,
  .editor-layout {
    grid-template-columns: 1fr;
  }
}

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

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sheetUp {
  from {
    opacity: 0;
    transform: translateY(28px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastBar {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

@keyframes syncSpin {
  to {
    transform: rotate(360deg);
  }
}

/* dark refinement pass */
:root {
  color-scheme: dark;
  --ios-bg: #0b0b10;
  --ios-card: rgb(29 29 36 / 78%);
  --ios-card-solid: #1c1c24;
  --ios-label: #f7f7fb;
  --ios-secondary: #a7a5b3;
  --ios-tertiary: #777483;
  --ios-separator: rgb(255 255 255 / 10%);
  --ios-blue: #ff8a3d;
  --ios-indigo: #8b5cf6;
  --ios-orange: #ff8a3d;
  --ios-pink: #ff4f87;
  --ios-green: #28d0b4;
  --ios-shadow: 0 18px 45px rgb(0 0 0 / 34%);
}

html {
  background: var(--ios-bg);
}

body {
  background:
    radial-gradient(circle at 20% 0%, rgb(255 138 61 / 22%), transparent 28%),
    radial-gradient(circle at 86% 12%, rgb(139 92 246 / 20%), transparent 34%),
    linear-gradient(180deg, #15141d 0, var(--ios-bg) 48%),
    var(--ios-bg);
  color: var(--ios-label);
}

button,
.button {
  background: rgb(255 255 255 / 8%);
}

.app-shell {
  padding-bottom: max(34px, env(safe-area-inset-bottom));
  animation: fadeIn 220ms ease both;
}

.topbar {
  color: var(--ios-label);
  background: rgb(11 11 16 / 72%);
  border-bottom-color: var(--ios-separator);
}

.topbar .eyebrow {
  display: none;
}

.icon-button,
.topbar .icon-button {
  width: 50px;
  height: 50px;
  min-height: 50px;
  color: var(--ios-label);
  background: rgb(255 255 255 / 10%);
  font-size: 28px;
}

.library-hero {
  background:
    linear-gradient(135deg, rgb(255 138 61 / 94%), rgb(139 92 246 / 92) 54%, rgb(40 208 180 / 78)),
    #1c1c1e;
}

.hero-mark {
  color: #16131f;
  background: rgb(255 247 234 / 94%);
}

.search-field input,
input,
select,
textarea {
  min-height: 42px;
  padding: 9px 11px;
  color: var(--ios-label);
  background: rgb(255 255 255 / 8%);
  border: 1px solid rgb(255 255 255 / 7%);
  border-radius: 12px;
  font-size: 15px;
}

.play-card {
  background: linear-gradient(180deg, rgb(255 255 255 / 10%), rgb(255 255 255 / 6%));
  border-color: rgb(255 255 255 / 12%);
  box-shadow: 0 14px 36px rgb(0 0 0 / 18%);
}

.cover,
.cover-editor-preview {
  background: linear-gradient(135deg, var(--ios-orange), var(--ios-indigo));
}

.reader-head {
  position: static;
  z-index: auto;
  background: transparent;
  backdrop-filter: none;
}

.pill {
  color: var(--ios-orange);
  background: rgb(255 138 61 / 13%);
}

.pill.active {
  color: #fff;
  background: linear-gradient(135deg, var(--ios-orange), var(--ios-pink));
}

.progress span {
  background: linear-gradient(90deg, var(--ios-orange), var(--ios-pink), var(--ios-green));
}

.line {
  background: rgb(255 255 255 / 9%);
  box-shadow: 0 10px 28px rgb(0 0 0 / 18%);
}

.bottom-nav {
  display: none;
}

.panel,
.editor-hero,
.modal-sheet {
  background: var(--ios-card);
  border-color: rgb(255 255 255 / 12%);
  box-shadow: 0 18px 45px rgb(0 0 0 / 22%);
}

.editor-hero {
  background: linear-gradient(135deg, rgb(255 138 61 / 18%), rgb(139 92 246 / 16));
}

.cover-upload input[type="file"] {
  background: rgb(255 138 61 / 12%);
  color: var(--ios-orange);
}

.modal-backdrop {
  position: fixed;
  background: rgb(0 0 0 / 54%);
}

.modal-sheet {
  background: rgb(29 29 36 / 96%);
}

.settings-list {
  background: var(--ios-separator);
}

.settings-row {
  color: var(--ios-label);
  background: rgb(34 34 43 / 96%);
}

.settings-icon {
  background: linear-gradient(135deg, var(--ios-orange), var(--ios-pink));
}

.settings-row strong {
  color: var(--ios-label);
}

.stepper button {
  color: var(--ios-label);
  background: rgb(255 255 255 / 10);
  font-size: 22px;
  font-weight: 800;
}

.library-hero h2 {
  font-size: 26px;
  line-height: 1.05;
}

.hero-mark svg {
  width: 46px;
  height: 46px;
}

.actions button,
.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--ios-orange), var(--ios-pink));
  border: 0;
}

.actions button:not(.primary) {
  color: var(--ios-label);
  background: rgb(255 255 255 / 12%);
}

.stepper button {
  color: var(--ios-orange);
  background: rgb(255 138 61 / 16%);
}

.toggle-row {
  grid-template-columns: 42px 1fr auto;
}

.switch {
  position: relative;
  width: 52px;
  height: 32px;
  background: rgb(120 120 128 / 32%);
  border-radius: 999px;
  transition: background 180ms ease;
}

.switch span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 3px 8px rgb(0 0 0 / 24%);
  transition: transform 180ms cubic-bezier(.2, .8, .2, 1);
}

.toggle-row.is-on .switch {
  background: linear-gradient(135deg, var(--ios-orange), var(--ios-pink));
}

.toggle-row.is-on .switch span {
  transform: translateX(20px);
}

.stage-direction {
  font-size: .9em;
  font-style: italic;
  opacity: .72;
}

.cover-edit-row {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 12px;
  align-items: center;
}

.cover-edit-actions {
  display: grid;
  gap: 8px;
  align-content: center;
}

.cover-edit-actions input,
.cover-edit-actions button {
  width: 100%;
  min-width: 0;
  display: block;
}

.editor-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 3px;
  background: rgb(255 255 255 / 8%);
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 16px;
}

.editor-tabs button {
  min-height: 38px;
  color: var(--ios-secondary);
  background: transparent;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 750;
}

.editor-tabs button.active {
  color: var(--ios-label);
  background: rgb(255 255 255 / 14%);
}

.editor-actions {
  margin-top: 2px;
}

.editor-actions button {
  min-height: 44px;
}

.modal-sheet textarea[data-field="line-text"] {
  min-height: 230px;
  line-height: 1.45;
}

.checkbox-toggle {
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 9px 11px;
  color: var(--ios-label);
  background: rgb(255 255 255 / 8%);
  border: 1px solid rgb(255 255 255 / 7%);
  border-radius: 12px;
}

.checkbox-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkbox-toggle .switch {
  width: 50px;
  height: 30px;
}

.checkbox-toggle .switch span {
  width: 24px;
  height: 24px;
}

.checkbox-toggle input:checked + .switch {
  background: linear-gradient(135deg, var(--ios-orange), var(--ios-pink));
}

.checkbox-toggle input:checked + .switch span {
  transform: translateX(20px);
}

.cover-upload > button,
button[data-action="remove-cover"] {
  color: var(--ios-orange);
  background: rgb(255 138 61 / 12%);
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid rgb(255 138 61 / 18%);
  border-radius: 12px;
}

.modal-backdrop,
.modal-sheet {
  overflow-x: hidden;
  overscroll-behavior-x: contain;
  touch-action: pan-y;
}

.theme-light {
  color-scheme: light;
  --ios-bg: #f3f1ec;
  --ios-card: rgb(255 255 255 / 84%);
  --ios-card-solid: #ffffff;
  --ios-label: #17151d;
  --ios-secondary: #696471;
  --ios-tertiary: #9b96a2;
  --ios-separator: rgb(60 60 67 / 13%);
  --ios-shadow: 0 16px 38px rgb(76 51 32 / 12%);
}

body:has(.theme-light) {
  background:
    radial-gradient(circle at 20% 0%, rgb(255 138 61 / 20%), transparent 30%),
    radial-gradient(circle at 86% 10%, rgb(139 92 246 / 16%), transparent 34%),
    linear-gradient(180deg, #fff8ee 0, #f3f1ec 48%),
    #f3f1ec;
}

.theme-light .topbar {
  color: var(--ios-label);
  background: rgb(243 241 236 / 76%);
  border-bottom-color: var(--ios-separator);
}

.theme-light .icon-button,
.theme-light .topbar .icon-button {
  color: var(--ios-label);
  background: rgb(60 60 67 / 10%);
}

.theme-light .play-card,
.theme-light .quiz-card,
.theme-light .panel,
.theme-light .editor-hero,
.theme-light .modal-sheet {
  background: var(--ios-card);
  border-color: rgb(255 255 255 / 80%);
  box-shadow: var(--ios-shadow);
}

.theme-light h1,
.theme-light h2,
.theme-light .play-card h2,
.theme-light .role-line,
.theme-light .line,
.theme-light .modal-head h2,
.theme-light .panel-title h2,
.theme-light .line-board-head h2 {
  color: var(--ios-label);
}

.theme-light .meta,
.theme-light label,
.theme-light .settings-row small,
.theme-light .speaker,
.theme-light .library-section > h2 {
  color: var(--ios-secondary);
}

.theme-light .line {
  background: rgb(255 255 255 / 86%);
  box-shadow: 0 8px 24px rgb(76 51 32 / 10%);
}

.theme-light .quiz-card {
  background:
    linear-gradient(135deg, rgb(255 138 61 / 16%), rgb(255 79 135 / 12%)),
    rgb(255 255 255 / 86%);
}

.theme-light .quiz-options button {
  color: var(--ios-label);
  background: rgb(60 60 67 / 8%);
  border-color: rgb(60 60 67 / 8%);
}

.theme-light .quiz-slots span {
  background: rgb(60 60 67 / 6%);
  border-color: rgb(60 60 67 / 18%);
}

.theme-light .quiz-suggestions button {
  color: var(--ios-label);
  background: rgb(60 60 67 / 7%);
  border-color: rgb(60 60 67 / 9%);
}

.theme-light .quiz-choice-grid button {
  color: var(--ios-label);
  background: rgb(60 60 67 / 7%);
  border-color: rgb(60 60 67 / 9%);
}

.theme-light .quiz-options button.correct,
.theme-light .quiz-options button.wrong,
.theme-light .quiz-choice-grid button.selected,
.theme-light .quiz-choice-grid button.correct,
.theme-light .quiz-choice-grid button.wrong {
  color: #fff;
}

.theme-light .quiz-result.correct {
  color: #126354;
  background: rgb(52 199 89 / 14%);
}

.theme-light .quiz-result.wrong {
  color: #9f1739;
  background: rgb(255 45 85 / 12%);
}

.theme-light .line.mine {
  color: #fff;
  background: linear-gradient(135deg, var(--ios-orange), var(--ios-pink));
}

.theme-light .line.accent {
  color: #fff;
  background: linear-gradient(135deg, var(--ios-pink), var(--ios-indigo));
}

.theme-light .editor-tabs {
  background: rgb(60 60 67 / 8%);
  border-color: rgb(60 60 67 / 9%);
}

.theme-light .editor-tabs button {
  color: var(--ios-secondary);
}

.theme-light .editor-tabs button.active {
  color: var(--ios-label);
  background: rgb(255 255 255 / 85%);
}

.theme-light .quiz-setting-group {
  background: rgb(255 255 255 / 74%);
  border-color: rgb(60 60 67 / 10%);
}

.theme-light .segmented-control {
  background: rgb(60 60 67 / 8%);
}

.theme-light .segmented-control button.active {
  background: rgb(255 255 255 / 92%);
  box-shadow: 0 3px 9px rgb(76 51 32 / 10%);
}

.theme-light .settings-row {
  color: var(--ios-label);
  background: rgb(255 255 255 / 94%);
}

.theme-light input,
.theme-light select,
.theme-light textarea,
.theme-light .search-field input,
.theme-light .checkbox-toggle {
  color: var(--ios-label);
  background: rgb(60 60 67 / 8%);
  border-color: rgb(60 60 67 / 9%);
}

.line-board .line:not(.mine):not(.accent),
.line-board .line:not(.mine):not(.accent) .text,
.line-board .line:not(.mine):not(.accent) .speaker {
  color: var(--ios-label);
}

.theme-light .line-board .line:not(.mine):not(.accent),
.theme-light .line-board .line:not(.mine):not(.accent) .text,
.theme-light .line-board .line:not(.mine):not(.accent) .speaker {
  color: var(--ios-label);
}

.theme-light .modal-backdrop {
  background: rgb(0 0 0 / 24%);
}

.theme-light .library-hero h2,
.theme-light .library-hero .eyebrow {
  color: #fff;
}

.theme-light .line.mine .speaker,
.theme-light .line.mine .text,
.theme-light .line.accent .speaker,
.theme-light .line.accent .text,
.theme-light .line-board .line.mine .speaker,
.theme-light .line-board .line.mine .text {
  color: #fff;
}

.line-board-head {
  position: sticky;
  top: 72px;
  z-index: 12;
  margin: -16px -16px 10px;
  padding: 14px 16px 12px;
  background: rgb(29 29 36 / 92%);
  border-bottom: 1px solid rgb(255 255 255 / 8%);
  backdrop-filter: blur(18px) saturate(1.25);
}

.theme-light .line-board-head {
  background: rgb(255 255 255 / 92%);
  border-bottom-color: rgb(60 60 67 / 10%);
}

/* iOS zooms focused form fields below 16px. */
input,
select,
textarea,
.search-field input {
  font-size: 16px;
}
