:root {
  --bg: #0F0F12;
  --card: #1A1A1F;
  --elevated: #222229;
  --border: #2A2A31;
  --text: #EDEDEF;
  --text-2: #9A9AA3;
  --text-3: #63636C;
  --accent: #5DCAA5;
  --wrong: #E24B4A;
  --right: #5DCAA5;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overscroll-behavior: none; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
.hidden { display: none !important; }

#app { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.view { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ---------- Library shelf ---------- */
#view-shelf { padding: calc(var(--safe-top) + 24px) 20px 20px; overflow-y: auto; }
.shelf-title { font-size: 28px; font-weight: 700; margin-bottom: 4px; }
.shelf-sub { color: var(--text-2); font-size: 14px; margin-bottom: 24px; }
.subject-card {
  width: 100%; text-align: left; background: var(--card); border: 1px solid var(--border);
  border-radius: 18px; padding: 20px; margin-bottom: 14px; display: flex; align-items: center; gap: 16px;
  transition: transform .12s ease;
}
.subject-card:active { transform: scale(.98); }
.subject-icon {
  width: 54px; height: 54px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  font-size: 28px; flex-shrink: 0;
}
.subject-name { font-size: 17px; font-weight: 600; }
.subject-tagline { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.due-badge {
  margin-left: auto; background: var(--accent); color: #08281C; font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; flex-shrink: 0;
}
.shelf-footer { margin-top: 20px; display: flex; justify-content: center; }
.ghost-btn { color: var(--text-3); font-size: 13px; padding: 10px 16px; display: flex; align-items: center; gap: 6px; }

/* ---------- Subject header + nav ---------- */
#subject-header {
  padding: calc(var(--safe-top) + 14px) 20px 12px; display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
#subject-header .back-btn { font-size: 22px; color: var(--text-2); padding: 4px; }
#subject-header .subject-title { font-size: 17px; font-weight: 600; flex: 1; }
#subject-header .continue-chip {
  font-size: 12px; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px;
  padding: 5px 12px; display: flex; align-items: center; gap: 5px;
}
.tab-pane { flex: 1; overflow-y: auto; overflow-x: hidden; }
#bottom-nav {
  display: flex; border-top: 1px solid var(--border); background: var(--bg);
  padding-bottom: var(--safe-bottom); flex-shrink: 0;
}
.nav-btn { flex: 1; padding: 10px 0 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--text-3); }
.nav-btn i { font-size: 22px; }
.nav-btn span { font-size: 10px; font-weight: 600; }
.nav-btn.active { color: var(--accent); }

/* ---------- Topics tab ---------- */
#tab-topics { padding: 16px 16px 24px; }
.topic-block { background: var(--card); border: 1px solid var(--border); border-radius: 16px; margin-bottom: 12px; overflow: hidden; }
.topic-head { width: 100%; display: flex; align-items: center; gap: 14px; padding: 16px; text-align: left; }
.topic-cover {
  width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
}
.topic-name { font-size: 15px; font-weight: 600; flex: 1; }
.topic-meta { font-size: 12px; color: var(--text-2); margin-top: 3px; display: flex; align-items: center; gap: 8px; }
.strength-bar { width: 54px; height: 4px; border-radius: 2px; background: var(--elevated); overflow: hidden; display: inline-block; }
.strength-fill { height: 100%; border-radius: 2px; }
.topic-chevron { color: var(--text-3); font-size: 18px; transition: transform .2s ease; }
.topic-block.open .topic-chevron { transform: rotate(180deg); }
.topic-cases { border-top: 1px solid var(--border); }
.case-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.case-row:last-child { border-bottom: none; }
.case-cover-sm {
  width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.case-row-name { font-size: 13.5px; font-weight: 500; line-height: 1.3; }
.case-row-meta { font-size: 11.5px; color: var(--text-2); margin-top: 2px; }
.case-dots { margin-left: auto; font-size: 10px; letter-spacing: 2px; flex-shrink: 0; }
.empty-note { padding: 14px 16px; color: var(--text-3); font-size: 12.5px; border-top: 1px solid var(--border); }

/* ---------- Case page ---------- */
#view-case { overflow-y: auto; }
.case-hero { padding: calc(var(--safe-top) + 14px) 20px 0; }
.case-back { font-size: 22px; color: var(--text-2); padding: 4px; margin-bottom: 8px; display: inline-block; }
.case-cover-lg {
  width: 100%; aspect-ratio: 1.9; border-radius: 20px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; margin-bottom: 18px; position: relative; overflow: hidden;
}
.case-cover-lg i { font-size: 64px; }
.case-cover-lg .cover-court { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; opacity: .75; }
.draft-badge {
  position: absolute; top: 12px; right: 12px; background: rgba(0,0,0,.45); color: #F5C518;
  font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
}
.case-title { font-size: 20px; font-weight: 700; line-height: 1.25; padding: 0 20px; }
.case-sub { font-size: 13px; color: var(--text-2); padding: 4px 20px 0; }
.case-actions { display: flex; gap: 12px; padding: 18px 20px; }
.play-btn {
  flex: 1; background: var(--accent); color: #08281C; font-weight: 700; font-size: 15px;
  border-radius: 999px; padding: 15px; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .12s ease;
}
.play-btn:active { transform: scale(.97); }
.quiz-case-btn {
  flex: 1; border: 1px solid var(--border); color: var(--text); font-weight: 600; font-size: 15px;
  border-radius: 999px; padding: 15px; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.case-section { padding: 6px 20px 14px; }
.case-section h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--text-3); margin-bottom: 8px; }
.case-section p { font-size: 14.5px; line-height: 1.55; color: var(--text); }
.ntk-item { display: flex; gap: 10px; margin-bottom: 10px; font-size: 13.5px; line-height: 1.5; color: var(--text); }
.ntk-item i { color: var(--accent); font-size: 16px; margin-top: 2px; flex-shrink: 0; }
.ntk-label { color: var(--text-2); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }

.precedent-list { display: flex; flex-direction: column; gap: 11px; }
.precedent-item { display: flex; gap: 11px; font-size: 14px; line-height: 1.55; color: var(--text); }
.prec-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-top: 7px; }

/* ---------- Reader (ebook) ---------- */
#view-reader { background: var(--bg); }
.reader-bar {
  display: flex; align-items: center; gap: 6px; padding: calc(var(--safe-top) + 10px) 12px 10px;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.reader-bar button { font-size: 21px; color: var(--text-2); padding: 6px 8px; }
.rd-title { flex: 1; font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-progress { height: 2px; background: var(--elevated); flex-shrink: 0; }
.reader-progress-fill { height: 100%; width: 0%; transition: width .1s linear; }
.reader-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.reader-body {
  max-width: 40rem; margin: 0 auto; padding: 22px 22px calc(var(--safe-bottom) + 70px);
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  line-height: 1.75; color: #DCDCE0;
}
.reader-head { margin-bottom: 34px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.rd-case-name { font-size: 1.35em; font-weight: 700; line-height: 1.3; color: var(--text); }
.rd-case-meta { font-size: .8em; color: var(--text-3); margin-top: 6px; font-family: -apple-system, "Segoe UI", sans-serif; }
.rd-chapter { margin-bottom: 40px; scroll-margin-top: 12px; }
.rd-chap-num {
  font-size: .7em; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase;
  font-family: -apple-system, "Segoe UI", sans-serif; margin-bottom: 6px;
}
.rd-chap-title { font-size: 1.25em; font-weight: 700; line-height: 1.3; color: var(--text); margin-bottom: 16px; }
.rd-prose p { margin-bottom: 1.05em; }
.rd-prose p:last-child { margin-bottom: 0; }
.rd-end {
  text-align: center; color: var(--text-3); font-size: .8em; margin-top: 50px; padding-top: 22px;
  border-top: 1px solid var(--border); font-family: -apple-system, "Segoe UI", sans-serif; line-height: 1.8;
}
.rd-end span { color: var(--text-3); opacity: .7; }
.quiz-row { padding-top: 0; }

/* ---------- Sectioned case summary ---------- */
.sec-block { background: var(--card); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 8px; overflow: hidden; }
.sec-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 13px 14px; text-align: left; }
.sec-num {
  width: 22px; height: 22px; border-radius: 7px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.sec-title { flex: 1; font-size: 14px; font-weight: 600; line-height: 1.35; }
.sec-time { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.sec-chevron { color: var(--text-3); font-size: 17px; transition: transform .2s ease; flex-shrink: 0; }
.sec-block.open .sec-chevron { transform: rotate(180deg); }
.sec-body { padding: 2px 14px 14px; border-top: 1px solid var(--border); }
.sec-bullets { display: flex; flex-direction: column; gap: 11px; margin-top: 12px; }
.sec-bullet { display: flex; gap: 11px; font-size: 13.5px; line-height: 1.55; }
.sec-jump {
  margin-top: 14px; width: 100%; border: 1px solid; border-radius: 999px; padding: 11px;
  font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 7px;
}

.audio-loading { margin: 26px 0 4px; }
.audio-loading-bar { height: 5px; border-radius: 3px; background: var(--elevated); overflow: hidden; }
.audio-loading-fill { height: 100%; width: 0%; border-radius: 3px; transition: width .15s linear; }
.audio-loading-text { font-size: 11.5px; color: var(--text-3); margin-top: 8px; text-align: center; }

/* ---------- Player chapters ---------- */
.player-chapter { text-align: center; font-size: 12.5px; color: var(--accent); font-weight: 600; margin-top: 8px; min-height: 18px; }
.chapter-heading { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--text-3); margin: 26px 0 8px; }
.chapter-list { display: flex; flex-direction: column; }
.chapter-row {
  display: flex; gap: 12px; align-items: baseline; padding: 11px 4px; text-align: left;
  border-bottom: 1px solid var(--border); font-size: 13.5px; color: var(--text-2);
}
.chapter-row:last-child { border-bottom: none; }
.chap-time { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; min-width: 38px; flex-shrink: 0; }
.chap-title { flex: 1; line-height: 1.4; }
.chapter-row.current { color: var(--accent); font-weight: 600; }
.chapter-row.current .chap-time { color: var(--accent); }

/* ---------- Full summary ---------- */
.full-summary { padding-bottom: 28px; }
.sum-block { background: var(--card); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 8px; overflow: hidden; }
.sum-head {
  width: 100%; display: flex; align-items: flex-start; gap: 10px; padding: 14px;
  text-align: left; font-size: 14px; font-weight: 600; line-height: 1.4;
}
.sum-head > span:not(.issue-num) { flex: 1; }
.sum-head .ti-chevron-down { color: var(--text-3); font-size: 17px; transition: transform .2s ease; flex-shrink: 0; margin-top: 2px; }
.sum-block.open .ti-chevron-down { transform: rotate(180deg); }
.issue-num {
  width: 22px; height: 22px; border-radius: 7px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0; margin-top: 1px;
}
.sum-body { padding: 0 14px 14px; border-top: 1px solid var(--border); }
.sum-body p { font-size: 14px; line-height: 1.65; color: var(--text); margin-top: 12px; }
.sum-row { margin-top: 14px; }
.sum-row-label {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px;
  color: var(--text-3); display: flex; align-items: center; gap: 6px;
}
.sum-row-label i { font-size: 14px; }
.sum-row-text p { margin-top: 6px; }
.expand-all {
  width: 100%; margin-top: 6px; padding: 12px; border: 1px solid var(--border); border-radius: 14px;
  color: var(--text-2); font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px;
}

/* ---------- Player ---------- */
#view-player { padding: calc(var(--safe-top) + 14px) 24px calc(var(--safe-bottom) + 24px); overflow-y: auto; }
.player-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.player-top button { font-size: 24px; color: var(--text-2); padding: 4px; }
.player-cover {
  width: min(78vw, 340px); aspect-ratio: 1; border-radius: 24px; margin: 8px auto 26px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
}
.player-cover i { font-size: 110px; }
.player-title { font-size: 19px; font-weight: 700; text-align: center; line-height: 1.3; }
.player-sub { font-size: 13px; color: var(--text-2); text-align: center; margin-top: 4px; }
.scrub-wrap { margin: 26px 0 4px; }
.scrub { width: 100%; appearance: none; height: 5px; border-radius: 3px; background: var(--elevated); outline: none; }
.scrub::-webkit-slider-thumb { appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--text); }
.scrub-times { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-3); margin-top: 6px; }
.player-controls { display: flex; align-items: center; justify-content: center; gap: 34px; margin-top: 18px; }
.player-controls .skip { font-size: 32px; color: var(--text-2); }
.player-controls .pp {
  width: 74px; height: 74px; border-radius: 50%; background: var(--text); color: var(--bg);
  font-size: 34px; display: flex; align-items: center; justify-content: center; transition: transform .12s ease;
}
.player-controls .pp:active { transform: scale(.94); }
.player-extra { display: flex; justify-content: center; gap: 20px; margin-top: 22px; }
.speed-btn { font-size: 13px; font-weight: 700; color: var(--text-2); border: 1px solid var(--border); border-radius: 999px; padding: 7px 14px; }
.tts-note { text-align: center; color: var(--text-3); font-size: 11.5px; margin-top: 18px; line-height: 1.5; }
.subtitle-box {
  margin-top: 20px; min-height: 66px; text-align: center; font-size: 15px; line-height: 1.55;
  color: var(--text); padding: 0 6px;
}
.subtitle-box .sub-prev, .subtitle-box .sub-next { color: var(--text-3); font-size: 12.5px; }
.subtitle-box .sub-now { margin: 6px 0; }

/* ---------- FYP ---------- */
#tab-fyp { scroll-snap-type: y mandatory; position: relative; background: #000; }
.fyp-card {
  position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always;
  display: flex; flex-direction: column; overflow: hidden; padding: calc(var(--safe-top) + 18px) 20px 26px;
}
.fyp-bg { position: absolute; inset: 0; overflow: hidden; background: #0A0A0D; }
.fyp-layer { position: absolute; width: 130%; height: 130%; filter: blur(18px); }
.fyp-layer.l1 { top: -25%; left: -20%; animation: drift1 26s ease-in-out infinite alternate; }
.fyp-layer.l2 { bottom: -30%; right: -25%; animation: drift2 34s ease-in-out infinite alternate; }
.fyp-layer.l3 { top: 10%; right: -30%; animation: drift3 44s ease-in-out infinite alternate; }
@keyframes drift1 { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(9%, 7%, 0) scale(1.25); } }
@keyframes drift2 { from { transform: translate3d(0,0,0) scale(1.15); } to { transform: translate3d(-11%, -6%, 0) scale(1); } }
@keyframes drift3 { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(-7%, 10%, 0) scale(1.3); } }
.fyp-glyph {
  position: absolute; top: 50%; left: 50%; font-size: 46vh; opacity: .13;
  transform: translate(-50%, -50%); animation: kenburns 30s ease-in-out infinite alternate;
}
@keyframes kenburns {
  from { transform: translate(-54%, -48%) scale(1) rotate(-4deg); }
  to { transform: translate(-46%, -52%) scale(1.22) rotate(4deg); }
}
.fyp-grain {
  position: absolute; inset: -50%; opacity: .05; pointer-events: none;
  background-image: repeating-conic-gradient(#fff 0% 25%, #000 0% 50%);
  background-size: 3px 3px; animation: grain 1.1s steps(3) infinite;
}
@keyframes grain { 0% { transform: translate(0,0); } 33% { transform: translate(-2px,1px); } 66% { transform: translate(1px,-2px); } 100% { transform: translate(0,0); } }
.fyp-vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 35%, rgba(0,0,0,.75) 100%); }
.fyp-card > *:not(.fyp-bg) { position: relative; z-index: 2; }

.fyp-progress { position: absolute; top: 0; left: 0; right: 0; height: 3px; background: rgba(255,255,255,.12); z-index: 3; }
.fyp-progress-fill { height: 100%; width: 0%; transition: width .2s linear; }
.fyp-top { display: flex; }
.fyp-badge { font-size: 11.5px; font-weight: 700; padding: 6px 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px; }
.fyp-caption {
  margin: auto 0; text-align: center; font-size: 30px; font-weight: 800; line-height: 1.25;
  letter-spacing: -.4px; text-shadow: 0 3px 22px rgba(0,0,0,.85);
}
.fyp-caption span { color: rgba(255,255,255,.32); transition: color .14s ease; }
.fyp-caption span.lit { color: #fff; }
.fyp-caption.pop { animation: capPop .32s cubic-bezier(.2,1.4,.4,1); }
@keyframes capPop { from { transform: scale(.94); opacity: .4; } to { transform: scale(1); opacity: 1; } }
.fyp-foot { text-align: center; }
.fyp-case-name { font-size: 14px; font-weight: 700; }
.fyp-case-meta { font-size: 11.5px; color: var(--text-2); margin-top: 3px; }
.fyp-pause-hint {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 68px; color: rgba(255,255,255,.85); z-index: 4; pointer-events: none;
}
.fyp-q { font-size: 21px; font-weight: 700; line-height: 1.35; margin: 26px 0 auto; text-shadow: 0 2px 18px rgba(0,0,0,.8); }
.fyp-opts { display: flex; flex-direction: column; gap: 9px; margin-bottom: 14px; }
.fyp-opt {
  text-align: left; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.14);
  border-radius: 15px; padding: 15px; font-size: 14.5px; line-height: 1.4; color: #fff;
  backdrop-filter: blur(8px); transition: transform .1s ease;
}
.fyp-opt:active { transform: scale(.98); }
.fyp-explain {
  font-size: 13px; line-height: 1.55; color: rgba(255,255,255,.85); margin-bottom: 14px;
  background: rgba(0,0,0,.45); border-radius: 14px; padding: 13px; max-height: 34vh; overflow-y: auto;
}
.fyp-gate {
  position: absolute; inset: 0; z-index: 20; background: rgba(0,0,0,.72); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; text-align: center;
}
.fyp-gate i { font-size: 60px; color: var(--accent); }
.gate-text { font-size: 19px; font-weight: 700; margin-top: 14px; }
.gate-sub { font-size: 13px; color: var(--text-2); margin-top: 4px; }

/* ---------- Quiz tab ---------- */
#tab-quiz { display: flex; flex-direction: column; }
.quiz-wrap { flex: 1; display: flex; flex-direction: column; padding: 16px 18px calc(var(--safe-bottom) + 14px); }
.quiz-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.quiz-progress { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.quiz-icons { display: flex; gap: 14px; }
.quiz-icons button { font-size: 20px; color: var(--text-3); padding: 4px; }
.quiz-icons button.on { color: var(--accent); }
.quiz-q { font-size: 18px; font-weight: 600; line-height: 1.45; margin: 18px 0; }
.quiz-options { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.quiz-opt { padding: 16px 14px; font-size: 14.5px; border-radius: 16px; }
.opt-letter { font-weight: 700; color: var(--text-3); margin-right: 8px; }
.explain-card { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 20px; margin: 14px 0; }
.explain-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.explain-body { font-size: 14.5px; line-height: 1.6; color: var(--text); }
.big-next {
  background: var(--text); color: var(--bg); font-weight: 700; font-size: 15px; border-radius: 999px;
  padding: 16px; margin-top: auto; transition: transform .12s ease;
}
.big-next:active { transform: scale(.97); }
.quiz-summary { text-align: center; margin: auto 0; }
.quiz-summary .big-num { font-size: 56px; font-weight: 800; }
.quiz-summary .sum-label { color: var(--text-2); font-size: 14px; margin-top: 4px; }
.sum-stats { display: flex; justify-content: center; gap: 26px; margin-top: 26px; }
.sum-stat { text-align: center; }
.sum-stat .v { font-size: 22px; font-weight: 700; }
.sum-stat .k { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.quiz-start-hint { color: var(--text-3); text-align: center; font-size: 13px; margin: auto 24px; line-height: 1.6; }

/* ---------- Sheet ---------- */
#sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 40; }
#sheet {
  position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-radius: 22px 22px 0 0;
  padding: 22px 20px calc(var(--safe-bottom) + 22px); z-index: 41; border-top: 1px solid var(--border);
}
#sheet h3 { font-size: 16px; margin-bottom: 16px; }
.sheet-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 4px; font-size: 15px; text-align: left; border-bottom: 1px solid var(--border); }
.sheet-row:last-child { border-bottom: none; }
.sheet-row i { font-size: 20px; color: var(--text-2); }
.sheet-row.selected { color: var(--accent); }
.sheet-row.selected i { color: var(--accent); }

.toast {
  position: fixed; bottom: calc(var(--safe-bottom) + 86px); left: 50%; transform: translateX(-50%);
  background: var(--elevated); border: 1px solid var(--border); color: var(--text); font-size: 13px;
  padding: 10px 18px; border-radius: 999px; z-index: 60; white-space: nowrap;
}
