.study-shell { --teal:#1b2c33; --secondary:#687581; --muted:#8996a2; --green:#209957; --red:#d95358; --orange:#f47920;
  min-height:calc(100dvh - 108px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); color:var(--teal);
  overflow-wrap:anywhere; display:flex; flex-direction:column; margin:auto; max-width:736px; }
.study-shell button,.clip-dialog button {font:inherit;cursor:pointer;}
.study-shell button:disabled,.clip-dialog button:disabled {opacity:.45;cursor:default;}
.study-progress,.study-phonetic,.study-actions,.clip-controls,.clip-meta,.clip-attach,.clip-dialog header {display:flex;align-items:center;}
.study-progress {gap:12px;height:32px;padding:0;flex:none;}
.study-close,.clip-close {border:0;background:transparent;color:var(--secondary,#687581);font-size:24px!important;line-height:1;min-height:34px;min-width:30px;padding:2px;}
.study-progress progress {flex:1;min-width:40px;height:7px;border-radius:8px;border:0;overflow:hidden;appearance:none;background:#eceae7;accent-color:var(--orange);}
.study-progress progress::-webkit-progress-bar {background:#eceae7;border-radius:8px;}
.study-progress progress::-webkit-progress-value {background:var(--orange);border-radius:8px;}
.study-progress progress::-moz-progress-bar {background:var(--orange);border-radius:8px;}
.study-progress b,.study-progress time {font-size:13px;color:var(--secondary);font-weight:600;}
.study-progress time {background:white;border:1px solid #e4e6e8;border-radius:20px;padding:4px 9px;}
.study-deck {font-size:11px;letter-spacing:1.4px;color:var(--muted);margin:3px 0;text-align:center;font-weight:600;}
.study-stack {position:relative;isolation:isolate;width:calc(100% - 12px);align-self:center;margin:auto;max-width:660px;}
.study-stack::before,.study-stack::after {position:absolute;inset:0;background:#fff;border:1px solid #eee;border-radius:22px;content:'';box-shadow:0 8px 20px #1b2c3314;pointer-events:none;}
.study-stack::before {transform:rotate(-2deg) scale(.93);opacity:.5;}
.study-stack::after {transform:rotate(-1deg) scale(.97);opacity:.75;}
[data-depth="1"] .study-stack::before,[data-depth="1"] .study-stack::after,[data-depth="2"] .study-stack::before {display:none;}
.study-prompt {z-index:1;position:relative;display:flex;flex-direction:column;align-items:center;gap:13px;text-align:center;
  background:white;border:1px solid #f0f0f0;padding:22px;border-radius:22px;box-shadow:0 8px 20px #1b2c331f;
  touch-action:pan-y;user-select:none;transition:transform .26s cubic-bezier(.2,.75,.25,1);}
.study-prompt.dragging {transition:none;cursor:grabbing;}
.study-prompt.leaving {transition:transform .25s ease-out;pointer-events:none;}
.study-shell:has(.study-prompt) {overflow-x:clip;}
.study-pill {background:#fff0e4;color:#bc5910;padding:4px 10px;font-size:11px;line-height:1.25;border-radius:14px;font-weight:600;}
.study-prompt h2,.study-question h2 {font-size:31px;line-height:1.15;font-weight:600;margin:0;}
.study-phonetic {justify-content:center;gap:9px;color:var(--secondary);font-size:14px;min-height:30px;}
.study-speaker {padding:6px;display:inline-grid;place-items:center;border:0;border-radius:100%;background:#fff0e4;color:var(--orange);width:30px;height:30px;}
.study-speaker svg {width:16px;height:16px;}
.study-prompt hr {border:0;border-top:1px solid #e8e9e8;width:100%;margin:2px 0;}
.study-meaning {color:var(--orange);font-size:21px;}
.study-example {font-size:13px;line-height:1.5;color:#414d56;}
.study-example small {display:block;font-size:12px;color:var(--muted);margin-top:4px;}
/* SwiftUI reserves two example lines even when both strings are empty. */
.study-example {min-height:34px;}
.audio-message:empty {display:none;}
@media (min-height:700px) { .study-stack {top:22px;} }
.study-video {display:flex;align-items:center;gap:8px;background:var(--teal);color:white;width:100%;text-align:left;border:0;border-radius:11px;padding:11px 14px;font-size:13px!important;font-weight:600!important;}
.study-video svg {width:16px;height:16px;} .study-video span {margin-left:auto;opacity:.75;}
.swipe-badge {position:absolute;top:14px;padding:6px 13px;color:#fff;font-size:12px;font-weight:700;border-radius:8px;pointer-events:none;}
.swipe-badge:empty {display:none;}
.swipe-badge.know {right:8px;background:#34b76a;transform:rotate(8deg);}
.swipe-badge.again {left:8px;background:var(--red);transform:rotate(-8deg);}
.study-shell footer {padding:0 6px 30px;text-align:center;}
.study-shell footer p,.clip-hint {font-size:12px;color:var(--muted,#8996a2);margin:0 0 8px;}
.study-actions {gap:14px;}
.study-actions button {flex:1;min-height:46px;border:1.5px solid;border-radius:14px;font-size:14px;font-weight:650;background:white;}
.study-actions .study-known {color:#21844a;border-color:#4bbd75;}
.study-actions .study-again {color:var(--red);border-color:#f5a9ac;}
.study-empty {margin:auto;text-align:center;padding:24px;}
.study-empty>span {margin:auto;display:grid;place-items:center;width:104px;aspect-ratio:1;border-radius:50%;background:#fff0e4;font-size:48px;}
.study-empty h2 {font-size:21px;margin:16px 0 8px;}
.study-empty p {max-width:275px;color:var(--secondary);font-size:14px;line-height:1.45;margin:0 auto 18px;}
.study-empty button {padding:13px 40px;}
.study-result {display:flex;flex-direction:column;text-align:center;flex:1;}
.study-result>.study-close {align-self:flex-end;}
.study-result header small {color:var(--secondary);font-size:13px;}
.study-result h2 {margin:2px 0;font-size:22px;}
.study-ring {width:120px;height:120px;padding:12px;margin:24px auto 0;border-radius:50%;background:conic-gradient(#44ba77 var(--score),#eef0ef 0);}
.study-ring>div {height:100%;width:100%;display:grid;align-content:center;background:white;border-radius:50%;}
.study-ring strong {font-size:30px;line-height:1.1;}
.study-ring small,.study-result dd {font-size:11px;color:var(--muted);}
.study-streak {margin:14px auto 0;border-radius:16px;background:#eafaf0;color:#208546;font-size:13px;font-weight:600;padding:6px 12px;}
.study-result dl {display:flex;gap:10px;margin:22px 0;}
.study-result dl div {flex:1;padding:14px 0;border-radius:14px;background:white;box-shadow:0 2px 8px #1b2c3310;}
.study-result dt {font-size:22px;font-weight:650;} .study-result dl div:first-child dt {color:#248c52;} .study-result dl div:nth-child(2) dt {color:var(--red);}
.study-result dd {margin:2px 0 0;} .study-result>.primary {margin:auto 0 30px;}
.study-result ul {list-style:none;text-align:left;padding:0;margin:0 0 12px;}
.study-result li {display:grid;font-size:14px;background:white;padding:12px;border-bottom:1px solid #eee;}
.study-result li small {color:var(--secondary);}
.study-result>.secondary {margin:0 0 10px;}
.study-question {display:grid;gap:11px;margin-top:14px;}
.study-question article,.listen-reveal {background:white;border-radius:16px;text-align:center;padding:22px 18px;box-shadow:0 2px 8px #d6d6d64d;}
.study-question article>small {font-size:11px;letter-spacing:1.4px;color:var(--muted);}
.study-question h2 {font-size:28px;margin:9px 0;}
.study-choice {text-align:left;display:flex;justify-content:space-between;border:1px solid #e1e5e7;border-radius:13px;background:white;color:var(--teal);padding:15px 16px;font-size:16px!important;font-weight:600!important;}
.study-choice:disabled {opacity:1!important;}
.study-choice.correct {border-color:#41b56e;background:#f3fcf6;} .study-choice.correct b {color:#2f9e59;}
.study-choice.wrong {border-color:#d95458;background:#fef2f2;} .study-choice.wrong b {color:#d95458;}
.study-question p {text-align:center;margin:3px;font-size:13px;font-weight:600;}
.mode-listening {--orange:#9256c6;} .mode-listening .study-deck {color:var(--orange);}
.study-listen {display:flex;flex-direction:column;align-items:center;gap:18px;margin:auto 6px;width:calc(100% - 12px);}
.study-listen p {color:var(--secondary);font-size:14px;margin:0;}
.listen-play {width:120px;height:120px;border-radius:50%;border:0;color:white;background:var(--orange);font-size:44px!important;box-shadow:0 8px 18px #9056c653;}
.listen-wave {height:34px;display:flex;align-items:center;gap:4px;}
.listen-wave i {width:3px;border-radius:4px;background:#cdb4e8;} .listen-wave.active i:nth-child(-n+6){background:#9256c6;}
.listen-controls {display:flex;gap:16px;}
.listen-controls button {border:1px solid #e3e5e7;background:white;border-radius:100px;padding:7px 14px;font-size:13px;color:var(--secondary);}
.listen-reveal {width:100%;display:grid;gap:7px;border:0;color:var(--muted);font-size:11px!important;}
.listen-reveal strong {font-size:24px;color:var(--teal);} .listen-reveal b {font-size:18px;color:#f47920;} .listen-reveal span {letter-spacing:5px;color:#bdc5cd;}
.audio-message {font-size:12px;color:var(--secondary);}
dialog.clip-dialog {--teal:#1b2c33;--muted:#8996a2;--line:#e1e5e7;position:fixed;box-sizing:border-box;inset:auto 0 0;margin:0 auto;
  width:min(100%,650px);max-width:100%;height:min(94dvh,910px);max-height:94dvh;overflow:auto;padding:0;
  border:0;border-radius:18px 18px 0 0;background:#f8f9fa;color:var(--teal);}
.clip-dialog::backdrop {background:#15263160;}
.clip-dialog header {position:sticky;top:0;z-index:1;gap:10px;background:white;border-bottom:1px solid var(--line);padding:10px 16px;text-align:left;}
.clip-dialog header h2 {font-size:17px;margin:0;} .clip-dialog small {font-size:11px;color:var(--muted);}
.clip-dialog .clip-origin {margin-left:auto;font-weight:600;}
.clip-body {padding:16px 16px max(24px,env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:10px;}
.clip-player {display:grid;place-items:center;width:100%;aspect-ratio:16/10;border-radius:8px;background:#1b2c33;color:white;overflow:hidden;text-align:center;font-size:13px;box-shadow:0 6px 12px #1b2c3338;}
.clip-player iframe,.clip-player video {width:100%;height:100%;border:0;}
.clip-player.pinned {outline:2px solid #44ba77;}
.clip-meta {justify-content:space-between;gap:10px;}
.clip-meta b,.clip-body>p b {font-size:13px;line-height:1.4;}
.clip-meta small {display:block;} .clip-meta>span {flex:none;font-size:12px;border:1px solid var(--line);background:white;border-radius:20px;padding:5px 10px;}
.clip-controls {gap:8px;}
.clip-dialog button:not(.primary):not(.clip-close):not([data-up]) {border:1px solid var(--line);background:white;border-radius:8px;color:#596671;min-height:44px;padding:0 14px;}
.clip-controls button:not(.primary) {min-width:54px;} .clip-controls .primary,.clip-controls [data-replace] {flex:1;}
.clip-dialog .primary {background:#f47920;color:white;border:0;border-radius:8px;font-weight:650;min-height:44px;}
.clip-dialog [data-remove] {color:#bc383e!important;}
.clip-hint {text-align:center;margin:0;font-size:11px;}
.clip-up,.clip-attached-label {font-size:11px;letter-spacing:1.2px;text-transform:uppercase;margin:8px 0 0;}
.clip-attached-label {color:#21844a;}
.clip-upcoming {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;}
.clip-upcoming button {position:relative;overflow:hidden;aspect-ratio:16/11;border:0;border-radius:8px;padding:0;background:#263940;color:white;}
.clip-upcoming img {height:100%;width:100%;object-fit:cover;}
.clip-upcoming span {position:absolute;inset:0;display:grid;place-items:center;}
.clip-upcoming small {position:absolute;bottom:4px;right:4px;color:white;background:#0009;border-radius:4px;padding:2px;}
.clip-attach {gap:9px;background:white;padding:13px;border-radius:14px;font-size:13px;box-shadow:0 2px 9px #1b2c330c;}
.clip-attach span {color:#f47920;background:#fff0e4;padding:8px 11px;border-radius:8px;} .clip-attach button {margin-left:auto;padding:3px 12px;}
.clip-body>a,.clip-body summary {font-size:12px;color:#62717a;}
.clip-body details {padding:7px 0;} .clip-body summary {cursor:pointer;}
.clip-body form {display:grid;gap:8px;margin-top:8px;} .clip-body form label {display:grid;gap:4px;font-size:13px;}
.clip-body [role=alert]:empty {display:none;}
@media (max-height:620px) { .study-stack,.study-listen {margin:12px auto;} .study-shell footer {padding-bottom:8px;} }
@media (prefers-reduced-motion:reduce) { .study-prompt {transition:none;} }
