/* SleepMind Web — calming night theme, mobile-first */
:root {
  --bg-0: #070b1c;
  --bg-1: #0d1430;
  --bg-2: #141d44;
  --ink: #eaeefb;
  --muted: #9aa3c7;
  --accent: #b9a3ff;
  --accent-2: #8ec5ff;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-brd: rgba(255, 255, 255, 0.12);
  --ok: #8be0b0;
  --radius: 20px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 50% -10%, #1b2350 0%, transparent 60%),
    radial-gradient(900px 500px at 90% 10%, #2a1f4d 0%, transparent 55%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 100%);
  background-attachment: fixed;
  letter-spacing: 0.2px;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Topbar */
.topbar {
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
  backdrop-filter: blur(12px);
  background: rgba(7, 11, 28, 0.5);
  border-bottom: 1px solid var(--glass-brd);
  position: sticky; top: 0; z-index: 20;
}
.topbar-title { font-weight: 600; font-size: 16px; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 语言切换控件已随语言层一起移除（English-only，界面只有一种语言） */
.icon-btn {
  background: none; border: none; color: var(--ink);
  font-size: 22px; width: 40px; height: 40px; border-radius: 12px; cursor: pointer;
}
.icon-btn:active { background: var(--glass); }

/* Screens */
#screens { flex: 1; position: relative; }
.screen {
  position: absolute; inset: 0;
  padding: 22px 20px calc(20px + var(--safe-b));
  overflow-y: auto;
  opacity: 0; transform: translateY(8px);
  pointer-events: none; transition: opacity .35s ease, transform .35s ease;
}
.screen.active { opacity: 1; transform: none; pointer-events: auto; }
.screen-inner { max-width: 440px; margin: 0 auto; }
.screen-inner.center { text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 70vh; }
.hidden { display: none !important; }

h2 { font-size: 24px; font-weight: 650; margin: 6px 0 12px; line-height: 1.25; }
.hint { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.muted { color: var(--muted); font-size: 13px; }

/* Splash */
.splash { min-height: 86vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; }
.brand { font-size: 42px; font-weight: 700; margin: 18px 0 0; letter-spacing: 1px;
  background: linear-gradient(180deg, #fff, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tagline { color: var(--ink); font-size: 17px; margin: 0; }
.sub { color: var(--muted); margin: 0 0 26px; }
.moon { width: 92px; height: 92px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #cdd6ff 40%, #8ea0e0 70%, #5b6bb0);
  box-shadow: 0 0 60px rgba(150, 170, 255, 0.55), inset -10px -8px 22px rgba(40, 50, 90, 0.6);
  animation: float 6s ease-in-out infinite; }
.moon.small { width: 56px; height: 56px; }
@keyframes float { 0%,100%{ transform: translateY(0); } 50%{ transform: translateY(-10px); } }

/* Buttons */
.btn {
  border: none; border-radius: 16px; padding: 15px 20px; font-size: 16px; font-weight: 600;
  cursor: pointer; width: 100%; transition: transform .12s ease, opacity .2s ease, background .2s ease;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: linear-gradient(180deg, var(--accent), #8f74f0); color: #160d2e; box-shadow: 0 10px 30px rgba(140, 116, 240, 0.35); }
.btn.primary:disabled { opacity: .4; box-shadow: none; }
.btn.ghost { background: var(--glass); color: var(--ink); border: 1px solid var(--glass-brd); }
.btn.big { padding: 17px 22px; font-size: 17px; margin-top: 10px; }
.btn.full { width: 100%; margin-top: 10px; }
.link-btn { background: none; border: none; color: var(--accent-2); font-size: 14px; margin-top: 14px; cursor: pointer; text-decoration: underline; }

/* Step dots */
.step-dots { display: flex; gap: 7px; margin-bottom: 18px; }
.step-dots span { width: 26px; height: 5px; border-radius: 3px; background: var(--glass-brd); }
.step-dots span.on { background: var(--accent); }

/* Options */
.options { display: flex; flex-direction: column; gap: 12px; margin-bottom: 22px; }
.opt {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 16px; border-radius: 16px; background: var(--glass);
  border: 1px solid var(--glass-brd); cursor: pointer; font-size: 16px;
  transition: border-color .15s ease, background .15s ease;
}
.opt:active { transform: scale(.99); }
.opt.selected { border-color: var(--accent); background: rgba(185, 163, 255, 0.14); }
.opt .tick { margin-left: auto; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--muted); display: grid; place-items: center; font-size: 13px; color: transparent; }
.opt.selected .tick { border-color: var(--accent); background: var(--accent); color: #160d2e; }

.text-input {
  width: 100%; border-radius: 16px; background: var(--glass); border: 1px solid var(--glass-brd);
  color: var(--ink); padding: 14px; font-size: 16px; font-family: inherit; resize: vertical; margin-bottom: 22px;
}
.text-input::placeholder { color: var(--muted); }

/* Home */
.home .greeting, #greeting { font-size: 28px; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0 22px; }
.quick {
  padding: 18px 14px; border-radius: 18px; background: var(--glass); border: 1px solid var(--glass-brd);
  text-align: left; font-size: 15px; cursor: pointer; color: var(--ink); min-height: 78px;
  display: flex; flex-direction: column; gap: 6px;
}
.quick .emoji { font-size: 22px; }
.quick:active { transform: scale(.98); }

.rec-card {
  border-radius: 22px; padding: 20px; background: linear-gradient(160deg, rgba(185,163,255,.18), rgba(142,197,255,.10));
  border: 1px solid var(--glass-brd); margin-bottom: 18px;
}
.rec-label { color: var(--accent); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; }
.rec-title { font-size: 22px; font-weight: 650; margin: 6px 0; }
.rec-meta { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.disclaimer-mini { color: var(--muted); font-size: 12px; text-align: center; margin-top: 6px; line-height: 1.5; }

/* Generating */
.spinner { width: 54px; height: 54px; border-radius: 50%; border: 4px solid var(--glass-brd); border-top-color: var(--accent); animation: spin 1s linear infinite; margin-bottom: 22px; }
@keyframes spin { to { transform: rotate(360deg); } }
.gen-steps { list-style: none; padding: 0; margin: 16px 0 0; text-align: left; color: var(--muted); }
.gen-steps li { padding: 8px 0 8px 28px; position: relative; transition: color .3s; }
.gen-steps li::before { content: ""; position: absolute; left: 0; top: 12px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--glass-brd); }
.gen-steps li.done { color: var(--ink); }
.gen-steps li.done::before { background: var(--ok); border-color: var(--ok); }
.gen-steps li.active::before { border-color: var(--accent); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{ box-shadow: 0 0 0 0 rgba(185,163,255,.5);} 50%{ box-shadow: 0 0 0 6px rgba(185,163,255,0);} }

/* Player */
.player { text-align: center; }
.player-title { font-size: 22px; font-weight: 650; margin-top: 4px; }
.player-meta { color: var(--muted); font-size: 13px; margin: 4px 0 18px; }
.player-orb {
  width: 200px; height: 200px; margin: 8px auto 22px; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, rgba(185,163,255,.30), rgba(20,29,68,.2) 70%);
  border: 1px solid var(--glass-brd);
  display: grid; place-items: center; box-shadow: 0 0 50px rgba(140,116,240,.25);
  transition: transform .3s ease, box-shadow .3s ease;
}
.player-orb.playing { animation: breathe 8s ease-in-out infinite; box-shadow: 0 0 80px rgba(140,116,240,.45); }
@keyframes breathe { 0%,100%{ transform: scale(1);} 50%{ transform: scale(1.06);} }
.play-btn { width: 74px; height: 74px; border-radius: 50%; border: none; background: linear-gradient(180deg,#fff,#d7d0ff); color: #2a1d5e; font-size: 26px; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.play-btn:active { transform: scale(.96); }
.play-btn.paused::after { content: ""; }

.progress { height: 6px; border-radius: 4px; background: var(--glass-brd); overflow: hidden; margin-bottom: 8px; }
.progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .25s linear; }
.time-row { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-bottom: 16px; }
.seek-row { display: flex; gap: 12px; justify-content: center; margin-bottom: 18px; }
.pill { background: var(--glass); border: 1px solid var(--glass-brd); color: var(--ink); border-radius: 999px; padding: 10px 18px; font-size: 14px; cursor: pointer; }
.pill:active { transform: scale(.97); }
.timer-row { margin-bottom: 12px; }
.timer-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.timer-options { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; }
.chip { background: var(--glass); border: 1px solid var(--glass-brd); color: var(--ink); border-radius: 999px; padding: 8px 14px; font-size: 13px; cursor: pointer; }
.chip.active { background: var(--accent); color: #160d2e; border-color: var(--accent); }
.timer-status { margin-top: 10px; text-align: center; font-size: 13px; color: var(--muted); min-height: 18px; }
.timer-status.counting { color: var(--accent); }
/* 背景音乐正在出声时提示语点亮（与睡眠定时的 counting 用不同色，避免两行状态混淆） */
.timer-status.playing { color: var(--accent-2); }
/* 音乐区后面紧跟睡眠定时，两者都是「标签 + chips + 状态行」的长相，
   多留一点间距才不会把音乐的状态行读成睡眠定时的说明 */
#musicRow { margin-bottom: 22px; }
/* 播放器里的背景音乐 chip 是纯文字按钮，行高由 .chip 统一控制 */
.transcript { text-align: left; background: var(--glass); border: 1px solid var(--glass-brd); border-radius: 16px; padding: 16px; font-size: 14px; line-height: 1.7; color: var(--ink); max-height: 240px; overflow-y: auto; margin-top: 8px; }
.transcript h4 { color: var(--accent); margin: 12px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; }
.transcript h4:first-child { margin-top: 0; }

/* Feedback */
#optFeedback { width: 100%; }

/* History */
.history-list { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.history-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--glass); border: 1px solid var(--glass-brd); }
.history-item .h-date { color: var(--muted); font-size: 12px; width: 46px; }
.history-item .h-main { flex: 1; }
.history-item .h-title { font-size: 15px; font-weight: 600; }
.history-item .h-meta { color: var(--muted); font-size: 12px; }
.history-empty { color: var(--muted); text-align: center; padding: 40px 0; }

/* Profile */
.card { background: var(--glass); border: 1px solid var(--glass-brd); border-radius: 18px; padding: 6px 16px; margin-bottom: 16px; }
.card-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--glass-brd); font-size: 15px; }
.card-row:last-child { border-bottom: none; }
.card-row.sub { color: var(--muted); font-size: 13px; padding-top: 4px; }
.toggle-row { border-bottom: 1px solid var(--glass-brd); }
.switch { position: relative; width: 46px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: var(--glass-brd); border-radius: 999px; transition: .2s; }
.slider::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.link-row { display: block; width: 100%; text-align: left; background: none; border: none; border-bottom: 1px solid var(--glass-brd); color: var(--ink); padding: 15px 0; font-size: 15px; cursor: pointer; }
.link-row:last-child { border-bottom: none; }

/* 可点击的偏好行（睡眠目标 / 偏好音色 / 单次时长）：
   本来只是展示用的 div，改成 button 后需要显式复位按钮的默认样式，
   否则会带上浏览器默认的灰底、居中与系统字体。 */
.card-row.tappable {
  width: 100%; background: none; color: var(--ink); font-family: inherit;
  border: none; border-bottom: 1px solid var(--glass-brd);
  font-size: 15px; text-align: left; cursor: pointer;
}
.card-row.tappable:last-child { border-bottom: none; }
.card-row.tappable:active { opacity: .7; }
.row-value { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; max-width: 60%; }
.row-value .muted { text-align: right; }
.chev { color: var(--muted); font-size: 20px; line-height: 1; }
.card-hint { color: var(--muted); font-size: 12px; margin: -8px 0 4px 4px; }
.link-btn.left { text-align: left; padding: 0; }

/* 免费说明（已移除订阅/付费墙） */
.free-note { color: var(--accent-2); font-size: 13px; margin: 14px 0 0; }

/* 文稿 */
.transcript p { margin: 0 0 8px; }
.transcript h4 { margin-top: 14px; }

/* Legal */
.legal .seg { display: flex; gap: 6px; background: var(--glass); border: 1px solid var(--glass-brd); border-radius: 14px; padding: 4px; margin-bottom: 16px; }
.seg-btn { flex: 1; background: none; border: none; color: var(--muted); padding: 10px; border-radius: 10px; font-size: 14px; cursor: pointer; }
.seg-btn.active { background: var(--accent); color: #160d2e; font-weight: 600; }
.legal-body { font-size: 14px; line-height: 1.7; color: var(--ink); }
.legal-body h3 { color: var(--accent); font-size: 15px; margin: 16px 0 6px; }
.legal-body p { color: var(--muted); margin: 0 0 10px; }

/* Crisis */
.crisis .crisis-icon { font-size: 44px; color: var(--ok); margin-bottom: 8px; }
.crisis p { color: var(--muted); max-width: 320px; line-height: 1.6; }
.crisis a.btn { text-decoration: none; margin: 8px 0; }
.crisis a { color: var(--accent-2); }
.crisis-block { display: flex; flex-direction: column; align-items: center; }

/* Bottom nav */
.bottomnav {
  display: flex; height: calc(64px + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(7,11,28,.7); backdrop-filter: blur(12px); border-top: 1px solid var(--glass-brd);
  position: sticky; bottom: 0; z-index: 20;
}
.nav-btn { flex: 1 1 0; min-width: 0; background: none; border: none; color: var(--muted); font-size: 12px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 8px 2px; }
/* 只给图标放大字号：写成 .nav-btn span 会把文字标签也撑到 20px（四个导航项在 320 宽下就装不下了） */
.nav-btn .nav-ico { font-size: 20px; line-height: 1; }
.nav-btn .nav-label { font-size: 11px; line-height: 1.25; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-btn.active { color: var(--accent); }

/* Bottom sheet：重新设置睡眠偏好
   fixed 定位覆盖全屏；#app 只有 overflow:hidden，不会裁掉 fixed 元素。 */
.sheet { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; justify-content: flex-end; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(4, 7, 20, .62); backdrop-filter: blur(4px); }
.sheet-panel {
  position: relative; width: 100%; max-width: 480px; margin: 0 auto;
  background: linear-gradient(180deg, #18213f, #0c1230);
  border: 1px solid var(--glass-brd); border-bottom: none;
  border-radius: 22px 22px 0 0;
  padding: 16px 18px calc(20px + var(--safe-b));
  max-height: 82vh; overflow-y: auto;
  animation: sheetUp .26s ease;
}
@keyframes sheetUp { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.sheet-head h3 { margin: 0; font-size: 17px; font-weight: 650; }
.sheet-panel .options { margin-bottom: 2px; }

@media (min-width: 520px) {
  .screen { padding-left: 28px; padding-right: 28px; }
}

/* Desktop browser layout. The mobile rules above remain the narrow-screen UI. */
@media (min-width: 768px) {
  body {
    min-height: 100vh;
    padding: 0;
    background:
      radial-gradient(900px 600px at 0 0, rgba(105, 83, 180, .28), transparent 70%),
      radial-gradient(700px 520px at 100% 100%, rgba(71, 129, 173, .18), transparent 70%),
      #070b1c;
  }

  #app {
    width: 100%;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    min-height: 640px;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: linear-gradient(145deg, rgba(19, 27, 58, .97), rgba(8, 14, 35, .98));
    box-shadow: none;
  }

  .topbar {
    height: 74px;
    padding: 0 40px;
    background: rgba(12, 19, 43, .72);
  }
  .topbar-title { font-size: 18px; }
  #screens { min-height: 0; }
  .screen { padding: 42px clamp(32px, 5vw, 76px) 52px; }
  .screen-inner { max-width: 960px; }
  .screen-inner.center { min-height: 100%; }
  h2 { font-size: 32px; }
  .hint { font-size: 15px; }

  .splash {
    min-height: 100%;
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(230px, .7fr);
    grid-template-rows: repeat(5, auto);
    align-content: center;
    align-items: center;
    gap: 10px 40px;
    text-align: left;
  }
  .splash .moon {
    grid-column: 2;
    grid-row: 1 / 6;
    width: min(24vw, 250px);
    height: min(24vw, 250px);
    justify-self: center;
  }
  .splash .brand,
  .splash .tagline,
  .splash .sub,
  .splash .btn,
  .splash .free-note { grid-column: 1; }
  .splash .brand { grid-row: 1; font-size: clamp(48px, 6vw, 76px); margin: 0; }
  .splash .tagline { grid-row: 2; font-size: 22px; }
  .splash .sub { grid-row: 3; max-width: 430px; margin: 0 0 16px; line-height: 1.6; }
  .splash .btn { grid-row: 4; width: fit-content; min-width: 230px; margin: 0; }
  .splash .free-note { grid-row: 5; margin-top: 8px; }

  .options.multi {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .options.single { max-width: 760px; }
  .opt { min-height: 62px; padding: 18px 20px; }
  .screen-inner > .btn { width: fit-content; min-width: 230px; }
  .quick-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .quick { min-height: 112px; padding: 20px 18px; }
  .rec-card { max-width: 760px; padding: 28px; }
  .rec-card .btn { width: fit-content; min-width: 190px; }

  .player-title { font-size: 30px; }
  .player-meta { font-size: 14px; }
  .player-orb { width: 230px; height: 230px; }
  .play-btn { width: 86px; height: 86px; }
  .progress { height: 8px; }
  .timer-options { gap: 10px; }
  .chip { padding: 10px 17px; }
  .card { background: rgba(255, 255, 255, .045); }

  .sheet { justify-content: center; align-items: center; padding: 24px; }
  .sheet-panel {
    width: min(560px, 100%);
    max-width: 560px;
    margin: 0;
    border: 1px solid var(--glass-brd);
    border-radius: 22px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .45);
  }
}

@media (min-width: 960px) {
  #app:has(> .bottomnav:not(.hidden)) {
    display: grid;
    grid-template-columns: 228px minmax(0, 1fr);
    grid-template-rows: 74px minmax(0, 1fr);
  }
  #app:has(> .bottomnav:not(.hidden)) > .topbar { grid-column: 2; grid-row: 1; }
  #app:has(> .bottomnav:not(.hidden)) > #screens { grid-column: 2; grid-row: 2; }
  #app:has(> .bottomnav:not(.hidden)) > .bottomnav {
    grid-column: 1;
    grid-row: 1 / 3;
    position: static;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: auto;
    min-height: 0;
    padding: 30px 16px;
    border-top: 0;
    border-right: 1px solid var(--glass-brd);
    background: rgba(7, 12, 30, .55);
    backdrop-filter: none;
  }
  .bottomnav::before {
    content: '☾  SleepMind';
    display: block;
    padding: 4px 12px 34px;
    color: var(--ink);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: .2px;
  }
  .bottomnav::after {
    content: 'A quieter place for the night';
    display: block;
    margin-top: auto;
    padding: 20px 12px 0;
    border-top: 1px solid var(--glass-brd);
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
  }
  .nav-btn {
    flex: 0 0 auto;
    flex-direction: row;
    justify-content: flex-start;
    gap: 14px;
    width: 100%;
    min-height: 52px;
    margin-bottom: 6px;
    padding: 10px 14px;
    border-radius: 12px;
    text-align: left;
    font-size: 15px;
  }
  .nav-btn .nav-ico { width: 23px; font-size: 21px; text-align: center; }
  .nav-btn .nav-label { font-size: 14px; }
  .nav-btn.active { background: rgba(185, 163, 255, .15); color: #dacdff; }
  .topbar { border-bottom-color: rgba(255, 255, 255, .08); }
}

@media (min-width: 1180px) {
  .screen { padding: 46px clamp(38px, 5vw, 76px) 56px; }
  [data-screen="home"] .screen-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
    gap: 8px 28px;
    align-content: start;
    max-width: 1080px;
  }
  [data-screen="home"] h2,
  [data-screen="home"] .hint,
  [data-screen="home"] .disclaimer-mini { grid-column: 1 / -1; }
  [data-screen="home"] .quick-grid {
    grid-column: 1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 8px 0 0;
  }
  [data-screen="home"] .rec-card {
    grid-column: 2;
    max-width: none;
    min-height: 248px;
    margin: 8px 0 0;
  }

  [data-screen="player"] .screen-inner {
    display: grid;
    grid-template-columns: minmax(0, .95fr) minmax(320px, 1.05fr);
    grid-template-areas:
      'title title'
      'meta meta'
      'orb music'
      'progress music'
      'time music'
      'seek timer'
      'transcript transcript'
      'text text';
    gap: 6px 28px;
    align-items: start;
    max-width: 1100px;
    text-align: left;
  }
  .player-title { grid-area: title; }
  .player-meta { grid-area: meta; margin-bottom: 20px; }
  .player-orb { grid-area: orb; justify-self: center; margin: 0 auto 12px; }
  .player .progress { grid-area: progress; width: 100%; }
  .player .time-row { grid-area: time; width: 100%; }
  .player .seek-row { grid-area: seek; justify-content: flex-start; }
  #musicRow { grid-area: music; }
  .player .timer-row:not(#musicRow) { grid-area: timer; }
  #btnTranscript { grid-area: transcript; justify-self: start; }
  #transcriptBox { grid-area: text; }
  .player .timer-row {
    min-width: 0;
    margin: 0;
    padding: 22px 24px;
    border: 1px solid var(--glass-brd);
    border-radius: 18px;
    background: rgba(255, 255, 255, .045);
  }
  .player .timer-label { display: block; font-size: 13px; text-align: left; }
  .player .timer-options { justify-content: flex-start; margin-top: 14px; }
  .player .timer-status { text-align: left; }

  [data-screen="profile"] .screen-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
    grid-template-areas:
      'title title'
      'prefs account'
      'prefs links'
      'hint links'
      'redo links';
    gap: 14px 28px;
    align-content: start;
    align-items: start;
    max-width: 1080px;
  }
  [data-screen="profile"] h2 { grid-area: title; }
  [data-screen="profile"] .card:nth-of-type(1) { grid-area: prefs; }
  [data-screen="profile"] .card:nth-of-type(2) { grid-area: account; }
  [data-screen="profile"] .card:nth-of-type(3) { grid-area: links; }
  [data-screen="profile"] .card-hint { grid-area: hint; margin: 0 0 0 4px; }
  [data-screen="profile"] .link-btn { grid-area: redo; justify-self: start; margin-top: 0; }
  [data-screen="profile"] .card { margin-bottom: 0; padding: 8px 20px; }
}

@media (hover: hover) and (min-width: 768px) {
  .nav-btn:hover:not(.active), .quick:hover, .opt:hover, .card-row.tappable:hover {
    background: rgba(185, 163, 255, .1);
  }
  .btn:hover, .pill:hover, .chip:hover { filter: brightness(1.1); }
}
