:root {
  --bg: #f4eee1;
  --card: #fdfaf1;
  --tx: #2b241c;
  --sec: #8b7e68;
  --ac: #74a028;
  --acd: #5a7f1e;
  --on-ac: #faf5e4;
  --line: #e0d5bf;
  --tbbg: #efe7d5;
  --pill: #3e4432;
  --tbtx: #7a7f68;
  --hdtitle: #3e4432;
  --hdpill: rgba(62, 68, 50, 0.16);
  --island: #ddd7c4;
  --tbon: #3e4432;
  --mic: #f2761b;
  --on-mic: #ffffff;
  --btn: #f2761b;
  --on-btn: #ffffff;
  --btn-soft: rgba(242, 118, 27, 0.14);
  --mic-soft: #f2d9c2;
  --btn-soft-border: #e8b48c;
  --on-btn-soft: #9a4e12;
  --on-btn-soft-sub: #b87a45;
  --danger: #a32d2d;
  --rad: 10px;
  --rad2: 7px;
  --font: Georgia, 'Times New Roman', serif;
}
html[data-theme="dark"] {
  --bg: #0d1117;
  --card: #151c25;
  --tx: #e6edf3;
  --sec: #7d8794;
  --ac: #a7e04b;
  --acd: #a7e04b;
  --on-ac: #1c2a06;
  --line: #242d39;
  --tbbg: #0d1117;
  --pill: #1a222c;
  --tbtx: #7d8794;
  --hdtitle: #e6edf3;
  --hdpill: rgba(230, 237, 243, 0.12);
  --island: #232b34;
  --tbon: #e6edf3;
  --mic: #a7e04b;
  --on-mic: #1c2a06;
  --btn: #a7e04b;
  --on-btn: #1c2a06;
  --btn-soft: rgba(167, 224, 75, 0.16);
  --mic-soft: #4c3a2f;
  --btn-soft-border: #4a5a28;
  --on-btn-soft: #a7e04b;
  --on-btn-soft-sub: #7fa848;
  --danger: #e08585;
  --rad: 14px;
  --rad2: 10px;
  --font: system-ui, -apple-system, sans-serif;
}
html[data-theme="dark"] .key-status { color: var(--danger); }

* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; overflow-x: hidden; overflow-x: clip; max-width: 100vw; overscroll-behavior-x: none; }
.view { overflow-x: hidden; overflow-x: clip; touch-action: pan-y; overscroll-behavior-x: none; }
.chatlog { touch-action: pan-y; overscroll-behavior-x: none; }
body {
  background: var(--bg);
  color: var(--tx);
  font-family: var(--font);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}
button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select { font-family: inherit; font-size: 16px; }
.icon { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.lernie-star {
  display: inline-block; font-family: "Arial Unicode MS", "Noto Sans Symbols 2", "Noto Sans Symbols", Arial, sans-serif;
  font-size: var(--star-size, 1em); font-style: normal; font-weight: 700; line-height: 1;
  text-align: center; vertical-align: middle; transform: none;
}

header.app {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 8px;
}
.header-copy { flex: 1; min-width: 0; }
.header-tools { display: flex; flex-shrink: 0; }
header.app h1 {
  line-height: 48px;
  font-size: 38px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#creditLine {
  display: flex; align-items: center; gap: 22px; margin: -1px 0 10px; padding: 0;
  color: var(--sec); font-size: 13px; line-height: 1; text-align: left;
}
#creditLine[hidden] { display: none; }
.credit-line-metric { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.credit-line-bolt {
  color: #f6b900; font: 900 15px/1 system-ui, sans-serif;
  text-shadow: 0 0 .01px #f6b900;
}
.credit-line-star { --star-size: 17px; color: var(--acd); }
#creditLineAmount, #creditLineStreakDays { color: var(--tx); font: 750 13px/1 var(--font); }
#mascotIcon { width: 64px; height: 64px; margin: -10px 0 -8px 14px; }
.hd-right { display: flex; flex-shrink: 0; align-items: center; gap: 10px; padding: 7px 12px; }
header.app.hidden-more { display: none; }
#modeBtn, #dictHeaderBtn, #settingsBtn { display: flex; padding: 6px; color: var(--sec); }
header.app.olive h1 { color: var(--hdtitle); }
header.app.olive .hd-right { background: var(--hdpill); border-radius: 999px; }
header.app.olive .hd-right button { color: var(--hdtitle); }

main { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.view {
  flex: 1; min-height: 0; overflow-y: auto;
  margin: 0 6px; padding: 4px 10px 24px;
  border-radius: 24px;
}
.view[hidden] { display: none; }
#view-decks { padding-top: 0; }
#view-practice { display: flex; flex-direction: column; overflow: hidden; margin: 0; padding: 0; }
#practicePick, #modePick {
  margin: 0 6px; padding: 4px 10px 24px; overflow-y: auto;
  border-radius: 24px;
}
#practicePick { padding-top: 0; }
#practiceChat { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0 16px; }
.chips.practice-free-chips { margin-top: 0; }
#practiceFree { display: inline-flex; align-items: center; gap: 7px; }
#practiceFree .icon { width: 16px; height: 16px; color: var(--acd); }
.practice-chip-separator { border-top: 1px solid var(--line); margin: 14px 0 4px; }

.list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.row {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--rad); padding: 13px 14px; width: 100%;
}
.row .icon { color: var(--acd); flex-shrink: 0; }
.row.child { margin-left: 26px; width: calc(100% - 26px); }
.row .grow { flex: 1; min-width: 0; }
.row .name { display: block; font-size: 16px; }
.row .meta { display: block; font-size: 12.5px; color: var(--sec); margin-top: 2px; }
.row .due { font-size: 12px; color: var(--acd); font-weight: 600; }
.row .thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }

.deckgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 8px; }
#view-decks .deckgrid { margin-top: 0; }
.tile {
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--rad); overflow: hidden; text-align: left; padding: 0;
  display: flex; flex-direction: column;
}
.deckgrid .tile { border-radius: 16px; }
.tile .cover { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.tile .cover-ph {
  width: 100%; aspect-ratio: 16 / 10; display: flex; align-items: center;
  justify-content: center; color: var(--acd); background: var(--tbbg);
}
.tile .cover-ph .icon { width: 30px; height: 30px; }
.tile .tbody { padding: 9px 11px 11px; display: flex; flex-direction: column; gap: 2px; }
.tile .kicker { font-size: 11px; color: var(--sec); }
.tile .name { font-size: 14.5px; font-weight: 600; line-height: 1.25; }
.tile .meta { font-size: 12px; color: var(--sec); }
.tile .tdue {
  position: absolute; top: 8px; right: 8px; background: var(--ac); color: var(--on-ac);
  font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
}
.deck-cover { position: relative; margin: 4px 0 12px; }
.deck-cover img {
  display: block; width: 100%; max-height: 190px; object-fit: cover;
  border-radius: var(--rad); border: 1px solid var(--line);
}
.deck-cover .regen {
  position: absolute; top: 3px; right: 3px; width: 44px; height: 44px;
  background: radial-gradient(circle, rgba(10, 10, 8, .45) 0 15px, transparent 15.5px); color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.tile.add { border-style: dashed; background: transparent; }
.tile.add .cover-ph { background: transparent; }
.tile .chip {
  position: absolute; width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
  background: rgba(10, 10, 8, .45); color: #fff;
}
.tile .chip.del { top: 8px; left: 8px; background: #c0392b; }
.tile .chip.ordL { top: 50%; transform: translateY(-50%); left: 8px; }
.tile .chip.ordR { top: 50%; transform: translateY(-50%); right: 8px; }
#deckList.editing .tile:not(.add) { animation: wiggle 2.4s infinite ease-in-out; }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(.4deg); } 75% { transform: rotate(-.4deg); } }
.ghost {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px dashed var(--line); border-radius: var(--rad);
  padding: 12px; color: var(--sec); font-size: 14.5px; width: 100%; margin-top: 12px;
}
#deckEditBtn { border: none; }
#deckNameEdit {
  width: 100%; box-sizing: border-box; background: var(--card); border: 1px solid var(--line);
  color: var(--tx); border-radius: var(--rad2); padding: 10px; font-size: 16px; margin: 4px 0 10px;
}
.deck-desc-toggle { display: block; font-size: 13.5px; color: var(--acd); padding: 10px 2px 0; }
.row .chip.del {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  background: #c0392b; color: #fff;
}
#deckCards .row { align-items: flex-start; }
#deckCards .row .icon { margin-top: 7px; }
#deckCards .row .thumb { margin-top: 0; }
#deckCards .row .due { margin-top: 11px; }
#deckCards .row .chip.del { margin-top: 5px; }
.deck-description {
  margin: 8px 0 12px; padding: 10px 12px; border-left: 3px solid var(--ac);
  background: var(--card); color: var(--sec); border-radius: 0 var(--rad2) var(--rad2) 0;
  font-size: 14px; line-height: 1.45; white-space: pre-wrap;
}

.scopebar { display: flex; align-items: center; gap: 6px; color: var(--sec); font-size: 14px; padding: 4px 0 2px; }
.scopebar button { display: flex; align-items: center; gap: 2px; color: var(--acd); font-size: 14px; padding: 4px 0; }
.scopebar .icon { width: 17px; height: 17px; }

.progress { height: 4px; background: var(--line); border-radius: 2px; margin: 10px 0 14px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--ac); border-radius: 2px; transition: width .3s; }
#view-learn { position: relative; }

.study {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--rad);
  min-height: 46vh; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; padding: 22px 18px; text-align: center;
}
.study .cardimg { width: 110px; height: 80px; }
.study .word { font-size: 24px; font-weight: 600; }
.study .divl { width: 46px; border-top: 2px solid var(--ac); }
.study .ans { font-size: 17px; color: var(--sec); white-space: pre-line; }
.study .hint { font-size: 12.5px; color: var(--sec); }

.primary {
  background: var(--btn); color: var(--on-btn); border-radius: var(--rad2);
  padding: 12px 22px; font-size: 15.5px; font-weight: 600; margin-top: 14px;
}
#view-learn .primary { background: var(--btn-soft); border: 0.5px solid var(--btn-soft-border); color: var(--on-btn-soft); }
html[data-theme="dark"] #view-learn .primary { background: var(--island); border-color: var(--island); color: var(--on-btn-soft); }
.ratings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 14px; }
.ratings button {
  border: 1px solid var(--line); background: var(--card); border-radius: var(--rad2);
  padding: 9px 2px 7px; font-size: 13px;
}
.ratings button .iv { display: block; font-size: 11px; color: var(--sec); margin-top: 2px; }
.ratings button.good { border: 2px solid var(--line); background: var(--card); padding: 8px 1px 6px; }

.empty { text-align: center; color: var(--sec); padding: 60px 20px; font-size: 15.5px; }
.streak-day-card {
  width: min(100%, 390px); margin: 22px auto 4px; padding: 18px 15px 15px;
  border: 1px solid var(--line); border-radius: 18px; background: var(--card);
  box-shadow: 0 12px 34px color-mix(in srgb, var(--tx) 14%, transparent); text-align: center;
}
.streak-day-star { --star-size: 34px; display: block; color: var(--acd); }
.streak-day-card h2 { margin-top: 9px; color: var(--hdtitle); font: 600 24px/1.08 var(--font); }
.streak-day-progress {
  margin-top: 17px; padding: 12px 13px; border: 1px solid var(--line);
  border-radius: 15px; background: var(--bg); text-align: left;
}
.streak-day-progress strong { color: var(--hdtitle); font: 600 15px/1.3 var(--font); }
.streak-day-bar { height: 7px; margin-top: 10px; overflow: hidden; border-radius: 999px; background: var(--line); }
.streak-day-bar i { display: block; height: 100%; border-radius: inherit; background: var(--ac); }
.streak-day-complete { margin-top: 16px; color: var(--acd); font-size: 12px; font-weight: 750; }
.streak-day-toast {
  position: fixed; z-index: 35; top: calc(8px + env(safe-area-inset-top)); right: 10px; left: 10px;
  display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 2px 10px; align-items: center;
  min-height: 44px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--card); color: var(--tx); box-shadow: 0 12px 34px color-mix(in srgb, var(--tx) 18%, transparent);
  text-align: left; animation: streak-toast-in .24s ease-out;
}
.streak-day-toast.is-dismissing {
  opacity: 0; transform: translateY(calc(-100% - 16px)); transition: opacity .18s ease, transform .18s ease;
  animation: none; pointer-events: none;
}
.streak-day-toast .streak-day-star { grid-row: 1 / 3; --star-size: 28px; }
.streak-day-toast strong { color: var(--hdtitle); font: 700 15px/1.2 var(--font); }
.streak-day-toast-copy { color: var(--sec); font-size: 11px; line-height: 1.3; }
.streak-toast-bar { display: block; height: 4px; margin-top: 5px; overflow: hidden; border-radius: 999px; background: var(--line); }
.streak-toast-bar b { display: block; height: 100%; border-radius: inherit; background: var(--ac); }
@keyframes streak-toast-in { from { opacity: 0; translate: 0 calc(-100% - 16px); } }
@media (prefers-reduced-motion: reduce) {
  .streak-day-toast { animation: none; }
  .streak-day-toast.is-dismissing { transition: none; }
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chips button {
  border: 1px solid var(--line); background: var(--card); color: var(--tx);
  border-radius: 999px; padding: 9px 16px; font-size: 14.5px;
}
.chatstatus {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 16px; margin: 6px auto 2px; width: fit-content;
  font-size: 13.5px; color: var(--sec);
}
.chatstatus i {
  width: 9px; height: 9px; border-radius: 50%; background: var(--ac);
  animation: pulse 1.1s infinite;
}
.chatlog {
  flex: 1; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
  padding: 10px 0 14px; border-radius: 24px;
}
.msg { max-width: 84%; padding: 10px 14px; border-radius: var(--rad); font-size: 15px; line-height: 1.5; }
.msg.tutor { background: var(--card); border: 1px solid var(--line); align-self: flex-start; }
.msg.me { background: var(--ac); color: var(--on-ac); align-self: flex-end; }
.chatlog .msg:not(.me) { cursor: pointer; }
.chatlog .msg.is-thinking { cursor: default; }
.chat-typing { display: inline-flex; align-items: center; gap: 4px; min-height: 1.5em; }
.chat-typing i {
  width: 5px; height: 5px; border-radius: 50%; background: var(--sec);
  opacity: .6; animation: chat-typing-bounce 1.2s ease-in-out infinite;
}
.chat-typing i:nth-child(2) { animation-delay: .16s; }
.chat-typing i:nth-child(3) { animation-delay: .32s; }
@keyframes chat-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-3px); }
}
@media (prefers-reduced-motion: reduce) {
  .chat-typing i { opacity: .6; animation: none; transform: none; }
}
.chatnote { align-self: center; color: var(--acd); font-size: 13px; padding: 2px 10px; }
.chatproposal {
  align-self: stretch; margin: 0 10px; padding: 13px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--rad);
}
.chatproposal-head { color: var(--tx); font-size: 14px; font-weight: 650; }
.chatproposal-list { display: grid; gap: 8px; margin-top: 10px; }
.chatproposal-list > div {
  display: grid; gap: 2px; padding-top: 8px; border-top: 1px solid var(--line);
  font-size: 13.5px; line-height: 1.4;
}
.chatproposal-list strong { overflow-wrap: anywhere; }
.chatproposal-list span { color: var(--sec); overflow-wrap: anywhere; white-space: pre-line; }
.chatproposal-actions { display: flex; gap: 8px; margin-top: 12px; }
.chatproposal-actions button { flex: 1; margin: 0; padding: 9px 12px; font-size: 14px; }
.chatproposal-actions .plain { border: 1px solid var(--line); border-radius: var(--rad2); color: var(--sec); }
.chatproposal-actions button:disabled { opacity: .45; cursor: default; }
.deck-kind-row { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.study.card-preview { min-height: 0; margin-top: 10px; padding: 18px 14px; }
.msg.markdown { overflow-wrap: anywhere; }
.msg.markdown p { margin: 0 0 .6em; }
.msg.markdown > p:last-child, .msg.markdown blockquote > p:last-child, .msg.markdown .trans > p:last-child { margin-bottom: 0; }
.msg.markdown h3, .msg.markdown h4, .msg.markdown h5, .msg.markdown h6 {
  margin: .15em 0 .45em; line-height: 1.25; font-size: 1em; font-weight: 700;
}
.msg.markdown h3 { font-size: 1.12em; }
.msg.markdown ul, .msg.markdown ol { margin: .25em 0 .65em; padding-left: 1.35em; }
.msg.markdown li + li { margin-top: .2em; }
.msg.markdown blockquote {
  margin: .25em 0 .65em; padding-left: .75em; border-left: 3px solid var(--line); color: var(--sec);
}
.msg.markdown code {
  padding: .08em .3em; border-radius: 4px; background: var(--tbbg);
  font: .9em/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.msg.markdown pre {
  margin: .3em 0 .7em; padding: .7em .8em; overflow-x: auto;
  border: 1px solid var(--line); border-radius: var(--rad2); background: var(--tbbg);
  white-space: pre; tab-size: 2;
}
.msg.markdown pre code { padding: 0; border-radius: 0; background: none; }
.msg.markdown hr { margin: .65em 0; border: 0; border-top: 1px solid var(--line); }
.msg.markdown a { color: var(--acd); text-decoration: underline; text-underline-offset: 2px; }
.msg .tbtn { display: block; margin-top: 7px; font-size: 12.5px; color: var(--acd); padding: 0; }
.msg .trans { margin-top: 7px; padding-top: 7px; border-top: 1px dashed var(--line); font-size: 14px; color: var(--sec); font-style: italic; }
.inputrow {
  flex-shrink: 0;
  display: flex; flex-direction: column; gap: 8px;
  background: var(--bg); padding: 10px 0 10px;
}
.inputrow input {
  width: 100%; box-sizing: border-box; background: var(--card);
  border: 1px solid var(--line); color: var(--tx);
  border-radius: 999px; padding: 11px 50px 11px 16px; outline: none;
}
.inputwrap { position: relative; }
.inputwrap .send { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; }
.inputwrap .send .icon { width: 19px; height: 19px; }
.roundbtn {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: var(--card); border: 1px solid var(--line); color: var(--acd);
}
.roundbtn .icon { width: 22px; height: 22px; }
.roundbtn.send { background: var(--btn); border-color: var(--btn); color: var(--on-btn); }
#chatForm .roundbtn.send {
  background: var(--card); border-color: var(--line); color: var(--sec);
  opacity: 0; transform: translateY(-50%) scale(.8); pointer-events: none;
  transition: background .15s, border-color .15s, color .15s, opacity .15s, transform .15s;
}
#chatForm .roundbtn.send.vis { opacity: 1; transform: translateY(-50%) scale(1); pointer-events: auto; }
#chatForm .roundbtn.send.ready { background: var(--btn); border-color: var(--btn); color: var(--on-btn); }

#view-more { padding-top: calc(10px + env(safe-area-inset-top)); }
.settings-mascot {
  position: relative;
  z-index: 10;
  height: 60px;
  margin-bottom: -60px;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}
.settings-mascot img {
  width: 72px; height: 72px; object-fit: contain;
  margin-top: -7px;
  flex: 0 0 auto; pointer-events: none;
}
.settings { display: flex; flex-direction: column; gap: 10px; }
.settings-head {
  display: flex; align-items: flex-start;
  min-height: 32px; padding-right: 84px;
}
.settings-head h1 {
  flex: 1; min-width: 0;
  color: var(--hdtitle);
  font-size: 26px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.settings-version {
  min-height: 24px;
  margin-top: -6px;
  color: var(--sec);
  font-size: 12.5px;
  white-space: nowrap;
}
.setcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--rad); padding: 14px; }
.setcard h2 { font-size: 13px; color: var(--sec); font-weight: 600; margin-bottom: 10px; letter-spacing: .3px; }
.setrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 15px; }
.setrow select {
  background: var(--bg); border: 1px solid var(--line); color: var(--tx);
  border-radius: var(--rad2); padding: 8px 10px; max-width: 55%;
}
.tts-mode-row { flex-direction: column; align-items: stretch; gap: 6px; }
.tts-mode-control { display: flex; min-width: 0; width: 100%; align-items: center; gap: 7px; }
.tts-mode-control select { flex: 1 1 auto; min-width: 0; max-width: 100%; }
.tts-mode-row.is-locked select { opacity: .62; }
.tts-premium-lock { position: relative; margin: 0; background: transparent; color: var(--btn); cursor: pointer; white-space: nowrap; }
.tts-premium-lock::before { content: ""; position: absolute; inset: 50% -5px auto; height: 44px; transform: translateY(-50%); }
.tts-premium-lock:focus-visible { outline: 2px solid var(--btn); outline-offset: 3px; }
.factual-premium-row { align-items: flex-start; }
.factual-premium-copy { min-width: 0; }
.factual-premium-copy > span { display: block; }
.factual-premium-copy small { display: block; margin-top: 3px; line-height: 1.35; }
.factual-premium-control { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; }
.factual-premium-row.is-locked { color: var(--sec); }
.factual-premium-row.is-locked .switch { display: none; }
.keyfield { display: flex; gap: 6px; align-items: center; max-width: 62%; }
.keyfield input {
  flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line);
  color: var(--tx); border-radius: var(--rad2); padding: 8px 10px;
}
.keyfield button { color: var(--acd); font-size: 14px; white-space: nowrap; padding: 4px 2px; }
.setrow small { color: var(--sec); }
.switch { position: relative; flex: 0 0 52px; width: 52px; height: 32px; }
.switch input { display: none; }
.switch i {
  position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: .2s;
}
.switch i::after {
  content: ""; position: absolute; width: 26px; height: 26px; border-radius: 50%;
  background: var(--card); top: 3px; left: 3px; transition: .2s;
}
.switch input:checked + i { background: var(--ac); }
.switch input:checked + i::after { transform: translateX(20px); }
.theme-row { cursor: pointer; }
.switch.theme input {
  display: block; position: absolute; width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
}
.switch.theme .theme-track {
  position: absolute; inset: 0; background: var(--line);
  border-radius: 999px; transition: background .2s;
}
.switch.theme i {
  position: absolute; inset: auto; top: 3px; left: 3px;
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: #fff; color: #756f60;
  transition: transform .2s;
}
.switch.theme i::after { content: none; }
.switch.theme .icon { width: 15px; height: 15px; }
.switch.theme .theme-sun { display: none; }
.switch.theme .theme-moon { color: #566171; }
.switch.theme input:checked ~ .theme-track { background: var(--ac); }
.switch.theme input:checked ~ i { transform: translateX(20px); }
.switch.theme input:checked ~ i .theme-sun { display: block; }
.switch.theme input:checked ~ i .theme-moon { display: none; }
.switch.theme input:focus-visible ~ i { outline: 2px solid var(--acd); outline-offset: 2px; }
.auto-img-row > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.auto-img-copy > span { display: block; overflow: hidden; text-overflow: ellipsis; }
.auto-img-copy #autoImgProHint {
  display: block; margin-top: 2px; color: var(--sec); font-size: 10px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
}
.auto-img-row.is-locked { color: var(--sec); opacity: .62; }
.auto-img-row.is-locked .switch { cursor: default; }
@media (max-width: 350px) {
  .auto-img-row > span { font-size: 13px; }
}
.credits-toggle-row {
  margin-top: 5px; padding-top: 12px; border-top: 1px solid var(--line);
}
.credits-card .credits-toggle-row {
  padding-top: 7px; border-top: 0;
}
.credits-settings {
  margin-top: 8px; padding: 12px; border: 1px solid var(--line);
  border-radius: 16px; background: var(--card);
}
.credits-settings-head, .credits-settings-nolimit, .credits-settings-subscription {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.credits-settings-head { font-size: 14.5px; }
.credits-settings-head strong { color: var(--hdtitle); font-size: 17px; }
.credits-settings-balance, .credits-settings-amount { display: flex; flex-direction: column; gap: 2px; }
.credits-settings-balance small { color: var(--sec); font-size: 10.5px; font-weight: 500; }
.credits-settings-amount { align-items: flex-end; }
.credits-settings button { padding: 2px 0; color: var(--acd); font-size: 11.5px; font-weight: 650; }
.credits-settings > .credit-progress { margin-top: 9px; }
.credits-monthly-composition { margin: 6px 0 0; color: var(--sec); font-size: 11px; line-height: 1.3; }
.credits-basis-bonus-line { display: block; margin-top: 5px; color: var(--acd); font-size: 10.5px; line-height: 1.3; }
.credits-settings-nolimit { margin-top: 11px; font-size: 14px; }
.credits-settings-nolimit small { color: var(--acd); }
.credits-settings-nolimit > strong { color: var(--hdtitle); font-size: 17px; }
.credits-settings-subscription {
  margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line);
}
.credits-settings-subscription #creditSettingsPlans { color: var(--btn); font-size: 13.5px; }
#giftTierValue { color: var(--hdtitle); font-size: 12.5px; font-weight: 750; }
#giftDaysLine { display: block; margin-top: 6px; color: var(--acd); font-size: 10.5px; line-height: 1.3; }
.credits-settings .credit-prices-open {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; margin-top: 9px; padding: 10px 0 0; border-top: 1px solid var(--line);
  color: var(--tx); font-size: 13.5px; font-weight: 650; text-align: left;
}
.credit-prices-open span:last-child { color: var(--sec); font-size: 21px; line-height: .8; }
.image-status-overview {
  margin-top: 10px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 16px; background: var(--card);
}
.mem-image-status {
  display: grid; grid-template-columns: minmax(92px, .72fr) minmax(0, 1.28fr);
  gap: 5px 12px; align-items: center; padding: 11px 0;
}
.deck-image-status { border-top: 1px solid var(--line); }
.mem-image-title { position: relative; min-width: 0; padding-right: 28px; }
.deck-image-status .mem-image-title { padding-right: 0; }
.mem-image-status h3 { margin: 0; color: var(--hdtitle); font: 700 13px/1.2 var(--font); }
.mem-image-title button {
  position: absolute; top: 50%; right: -5px; width: 32px; height: 32px;
  transform: translateY(-50%); color: var(--sec); font: 400 14px/1 system-ui, sans-serif;
}
.mem-image-title button:focus-visible { outline: 2px solid var(--btn); outline-offset: -4px; border-radius: 50%; }
.mem-image-box { min-width: 0; padding: 0; }
.mem-image-top {
  display: flex; justify-content: space-between; gap: 8px; font-size: 10.5px; font-weight: 700;
}
.mem-image-top span { min-width: 0; }
.mem-image-top strong { flex: 0 0 auto; color: var(--acd); }
.mem-image-progress { height: 4px; margin-top: 5px; }
.mem-image-reset {
  margin: 4px 0 0; color: var(--sec); font-size: 9px; line-height: 1.3;
}
.mem-image-pro {
  min-width: 0; margin: 0; color: var(--tx); font-size: 10.5px; font-weight: 700; line-height: 1.35;
}
.deck-image-status > .mem-image-reset { grid-column: 2; margin-top: -1px; }
.streak-status {
  width: 100%; box-sizing: border-box; margin-top: 10px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--card);
}
.streak-status button {
  display: block; width: 100%; box-sizing: border-box; min-height: 44px; padding: 13px 12px; text-align: left;
}
.streak-status button:focus-visible { outline: 2px solid var(--btn); outline-offset: 2px; border-radius: 16px; }
.streak-status-head { display: flex; align-items: center; gap: 10px; }
.streak-status-star { --star-size: 24px; flex: 0 0 auto; color: var(--acd); }
.streak-status-title { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 2px; }
.streak-status-title strong { color: var(--hdtitle); font: 700 17px/1.2 var(--font); }
.streak-status-title > span { color: var(--sec); font-size: 11px; }
.streak-status-chevron { flex: 0 0 auto; color: var(--sec); font-size: 23px; line-height: 1; }
.streak-status-progress {
  display: block; margin: 11px 0 0 34px; padding: 10px 11px; border-radius: 12px;
  background: var(--bg); color: var(--tx); font-size: 12px; font-weight: 700; line-height: 1.35;
}
.streak-status-bar {
  display: block; height: 7px; margin-top: 9px; overflow: hidden;
  border-radius: 999px; background: var(--line);
}
.streak-status-bar i {
  display: block; width: 0; height: 100%; border-radius: inherit; background: var(--ac); transition: width .3s ease;
}
.credit-dev-panel {
  margin-top: 10px; padding: 10px; border: 1px dashed var(--line); border-radius: var(--rad2);
  color: var(--sec); font-family: system-ui, -apple-system, sans-serif; font-size: 11.5px;
}
.credit-dev-title {
  margin-bottom: 7px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.credit-dev-row {
  display: grid; grid-template-columns: minmax(0, 1fr);
  gap: 7px; padding: 8px 0; border-top: 1px solid var(--line);
}
.credit-dev-row > span, .credit-dev-row > label { min-width: 0; line-height: 1.25; }
.dev-btnrow {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px; min-width: 0;
}
.dev-btnrow-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dev-btnrow-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dev-btnrow button, .dev-number-row button, .dev-gift-grid > button, .credit-dev-reset {
  min-height: 44px; padding: 6px 7px; border: 1px solid var(--line); border-radius: 6px;
  background: transparent; color: var(--sec); font-size: 11px; line-height: 1.2;
}
.dev-btnrow button { width: 100%; }
#devShowLimitCardsAfterEstimate { grid-column: 1 / -1; }
.dev-btnrow button.is-active {
  background: var(--island); color: var(--tx); border-color: var(--island); font-weight: 700;
}
.dev-number-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; min-width: 0; }
.dev-gift-grid { display: grid; gap: 6px; min-width: 0; }
.dev-number-row input {
  width: 100%; min-width: 0; min-height: 44px; padding: 6px 7px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--card); color: var(--tx); font-size: 13px;
}
.credit-dev-reset { display: block; width: 100%; margin-top: 6px; padding: 7px; }
.credit-progress {
  height: 4px; margin-top: 8px; overflow: hidden;
  border-radius: 999px; background: var(--line);
}
.credit-progress i {
  display: block; width: 0; height: 100%; border-radius: inherit;
  background: var(--ac); transition: width .3s ease;
}
.key-summary { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.key-status { color: #c0603d; font-size: 13px; font-weight: 600; white-space: nowrap; }
.key-status.saved { color: var(--acd); }
.key-toggle { color: var(--acd); font-size: 14px; padding: 4px 0; white-space: nowrap; }
.key-note { color: var(--sec); font-size: 12px; margin: -3px 0 5px; }
.key-editor { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; }
.key-editor .keyfield { max-width: none; width: 100%; }
.key-editor .keyfield input { min-width: 80px; }
.reset-row { justify-content: center; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 14px; }
.reset-row #resetBtn { color: var(--danger); font-size: 15px; }

nav.tabbar {
  position: relative; z-index: 20; isolation: isolate; flex-shrink: 0; overflow: visible;
  display: flex; align-items: flex-end; justify-content: space-around;
  height: 58px; margin: 0 14px max(10px, env(safe-area-inset-bottom));
  margin-top: 8px;
  background: var(--island); border-radius: 999px;
  box-shadow: 0 4px 14px rgba(20, 16, 8, 0.10);
  padding: 6px 12px;
}
nav.tabbar [data-tab] {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; color: var(--tbtx); width: 58px; padding: 2px 0;
}
nav.tabbar [data-tab].on { color: var(--tbon); }
#recBtn {
  position: relative; z-index: 1;
  width: 61px; height: 61px; border-radius: 50%; background: var(--mic); color: var(--on-mic);
  display: flex; align-items: center; justify-content: center;
  margin-top: -28px;
  box-shadow: 0 4px 14px rgba(20, 16, 8, 0.28);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
nav.tabbar.calm #recBtn { background: #cfc9b6; color: #8b8574; box-shadow: none; }
html[data-theme="dark"] nav.tabbar.calm #recBtn {
  background: var(--island);
  border: none;
  color: var(--sec);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
#recBtn .icon { width: 28px; height: 28px; }

.sheetwrap { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; }
.sheetwrap[hidden] { display: none; }
.backdrop { position: absolute; inset: 0; background: rgba(15, 12, 5, .45); }
.sheet {
  position: relative; width: 100%; background: var(--bg);
  border-radius: 22px 22px 0 0; padding: 18px 20px calc(24px + env(safe-area-inset-bottom));
  max-height: 86vh;
  max-height: calc(86dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom)); overflow-y: auto;
  overflow-x: hidden; overflow-x: clip; touch-action: pan-y; overscroll-behavior: contain;
}
.sheetwrap:not(.fullscreen-wrap) {
  padding: 0 10px calc(10px + env(safe-area-inset-bottom));
}
.sheetwrap:not(.fullscreen-wrap) .sheet {
  border-radius: 22px;
  padding-bottom: 24px;
  box-shadow: 0 8px 28px rgba(20, 16, 8, 0.18);
  scrollbar-color: var(--line) transparent;
  scrollbar-width: thin;
}
.sheetwrap:not(.fullscreen-wrap) .sheet::-webkit-scrollbar { width: 5px; }
.sheetwrap:not(.fullscreen-wrap) .sheet::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--line);
}
html[data-theme="dark"] .sheetwrap:not(.fullscreen-wrap) .sheet {
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.55);
}
/* Aufnahme wie vor 76be033: inhaltshohes, unten angedocktes Sheet statt Vollbild. */
#sheetRecord { padding: 0; }
#sheetRecord .sheet {
  border-radius: 22px 22px 0 0;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
  box-shadow: none;
}
.sheet h2 { font-size: 17px; margin-bottom: 4px; }
.sheet .sub { font-size: 13.5px; color: var(--sec); }
.credit-sheet { text-align: center; }
.credit-sheet h2 { color: var(--sec); font-size: 14px; font-weight: 600; letter-spacing: .3px; }
.credit-balance {
  margin-top: 10px; color: var(--hdtitle); font-size: 42px; font-weight: 600; line-height: 1.1;
}
.credit-sheet-bucket {
  max-width: 360px; margin: 14px auto 0; padding: 13px 14px; border: 1px solid var(--line);
  border-radius: 14px; background: var(--bg); text-align: left;
}
.credit-sheet-bucket-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; color: var(--tx); font-size: 14px; }
.credit-sheet-bucket-head strong { color: var(--hdtitle); font-size: 22px; }
.credit-sheet-nolimit .sub { margin-top: 3px; color: var(--acd); font-size: 11px; }
.credit-sheet-progress { max-width: 360px; margin: 16px auto 0; }
.credit-sheet-bucket .credit-sheet-progress { margin-top: 10px; }
.credit-monthly { margin-top: 7px; }
.credit-sheet-bucket .credits-basis-bonus-line { font-size: 11px; }
.credit-sheet-actions { max-width: 480px; margin: 20px auto 0; }
.credit-sheet-secondary { margin-top: 10px; }
.credit-preview-note { margin-top: 16px; }
.streak-milestone-sheet { text-align: center; }
.fullscreen-body.streak-milestone-body {
  display: flex; flex-direction: column; width: min(100%, 560px); margin: 0 auto;
  padding: calc(24px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
}
.streak-milestone-top { position: relative; }
.streak-milestone-kicker {
  margin: 0 0 6px; color: var(--acd); font-size: 10px; font-weight: 850;
  letter-spacing: .1em; text-transform: uppercase;
}
.streak-milestone-top h2 { margin: 0 20px; color: var(--hdtitle); font: 600 28px/1.05 var(--font); }
.streak-milestone-top img { display: block; width: 88px; height: 88px; margin: 9px auto 0; object-fit: contain; }
.streak-milestone-reward {
  margin-top: 7px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 15px; background: var(--card);
}
.streak-milestone-reward b { display: block; color: var(--acd); font: 700 27px/1.08 var(--font); }
.streak-milestone-reward strong { display: block; margin-top: 4px; color: var(--hdtitle); font-size: 12px; }
.streak-confetti { --star-size: 16px; position: absolute; color: var(--ac); font-weight: 900; }
.streak-confetti-one { top: 20px; left: 30px; transform: rotate(22deg); }
.streak-confetti-two { top: 45px; right: 28px; transform: rotate(-18deg); }
.streak-confetti-three { top: 102px; left: 48px; }
.streak-confetti-four { top: 110px; right: 46px; }
.streak-milestone-ladder { margin: 10px 18px 0; padding-left: 10px; text-align: left; }
.streak-milestone-step {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  min-height: 52px; padding: 8px 8px 8px 35px; border-left: 2px solid var(--line);
}
.streak-milestone-step::before {
  position: absolute; left: -11px; display: grid; width: 20px; height: 20px; place-items: center;
  border: 2px solid var(--line); border-radius: 50%; background: var(--bg); color: var(--on-ac); content: "";
}
.streak-milestone-step.is-done { border-left-color: var(--ac); }
.streak-milestone-step.is-done::before { border-color: var(--ac); background: var(--ac); content: "✓"; }
.streak-milestone-step strong { color: var(--hdtitle); font: 600 15px/1.2 var(--font); }
.streak-milestone-step span { color: var(--sec); font-size: 10.5px; }
.streak-milestone-step.is-done span { color: var(--acd); font-weight: 850; }
.streak-milestone-done { width: 100%; min-height: 47px; margin: auto 0 0; font-size: 14px; font-weight: 850; }
.sheet-close {
  display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center;
  border: 0; border-radius: 0; background: transparent; color: var(--sec); font-size: 17px;
}
.memcap-sheet { padding: 16px 14px 18px; background: var(--island); }
.memcap-head, .sheet-head { display: flex; align-items: center; gap: 10px; }
.memcap-head h2, .sheet-head h2 { flex: 1; margin: 0; color: var(--hdtitle); font-size: 17px; }
.memcap-summary, .memcap-empty, .memcap-rule {
  margin: 7px 0 0; color: var(--sec); font-size: 12px; line-height: 1.45;
}
.memcap-summary strong {
  display: block; margin-bottom: 2px; color: var(--acd); font-size: 15px;
}
.memcap-empty { color: var(--tx); font-weight: 700; }
.memcap-empty-action {
  position: relative; display: block; width: fit-content; margin-top: 7px; padding: 0; border: 0; background: transparent;
  color: var(--btn); font: inherit; text-align: left; text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: 2px; cursor: pointer;
}
.memcap-empty-action::before { content: ""; position: absolute; inset: 50% -6px auto; height: 44px; transform: translateY(-50%); }
.memcap-empty-action:focus-visible { outline: 2px solid var(--btn); outline-offset: 3px; border-radius: 4px; }
.memcap-rule { padding-top: 8px; border-top: 1px solid var(--line); }
.memcap-plans {
  position: relative; margin: 0; background: transparent; cursor: pointer;
}
.memcap-plans::before { content: ""; position: absolute; inset: 50% -8px auto; height: 44px; transform: translateY(-50%); }
.memcap-plans:focus-visible { outline: 2px solid var(--acd); outline-offset: 3px; }
.memcap-auto {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-top: 10px; padding: 9px; border-radius: 10px; background: var(--bg);
}
.memcap-auto-copy { min-width: 0; font-size: 12px; font-weight: 700; }
.memcap-lock {
  flex: 0 0 auto; padding: 4px 7px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--sec); font-size: 9px; font-weight: 800;
}
.streak-overview-sheet { padding: 16px 14px 18px; background: var(--island); }
.streak-overview-head { display: flex; align-items: center; gap: 10px; }
.streak-overview-head h2 {
  flex: 1; margin: 0; color: var(--hdtitle); font: 700 21px/1.2 var(--font);
}
.streak-overview-intro {
  margin: 7px 0 0; color: var(--sec); font-size: 12.5px; line-height: 1.45;
}
.streak-overview-ladder { margin: 13px 4px 0 10px; padding-left: 10px; }
.streak-overview-step {
  position: relative; display: grid; min-height: 50px; align-items: center;
  grid-template-columns: 26px minmax(0, 1fr) auto; gap: 8px;
  padding: 7px 7px 7px 0; border-left: 2px solid var(--line);
}
.streak-overview-check {
  display: grid; width: 20px; height: 20px; margin-left: -11px; place-items: center;
  border: 2px solid var(--line); border-radius: 50%; background: var(--island); color: var(--on-ac);
  font: 800 11px/1 system-ui, sans-serif;
}
.streak-overview-step.is-done { border-left-color: var(--ac); }
.streak-overview-step.is-done .streak-overview-check { border-color: var(--ac); background: var(--ac); }
.streak-overview-step.is-done .streak-overview-check::before { content: "✓"; }
.streak-overview-step strong { color: var(--hdtitle); font: 600 15px/1.2 var(--font); }
.streak-overview-step > span:last-child { color: var(--sec); font-size: 11px; }
.streak-overview-step.is-done > span:last-child { color: var(--acd); font-weight: 800; }
.streak-overview-note {
  margin: 12px 0 0; padding: 10px 11px; border-radius: 10px; background: var(--bg);
  color: var(--acd); font-size: 12px; font-weight: 800; line-height: 1.35;
}

/* Credit-Vorschau: Abo-Übersicht nach Mockup V5 */
.paywall-sheet { padding: 16px 14px 18px; }
#sheetPaywall .fullscreen-scroll-title, #sheetTopup .topup-title, #sheetCreditPrices .credit-prices-title {
  margin: 0 42px 16px 0; color: var(--hdtitle); font: 700 27px/1.1 var(--font);
  text-align: left; white-space: nowrap;
}
#sheetCreditPrices .credit-prices-title { white-space: normal; }
.credit-prices-sheet .credit-prices-body { padding-top: calc(20px + env(safe-area-inset-top)); }
.credit-prices-intro { margin: -5px 0 18px; color: var(--sec); font-size: 13.5px; line-height: 1.45; }
.credit-prices-section { margin-top: 18px; }
.credit-prices-section h3 {
  margin: 0 0 7px; color: var(--hdtitle); font: 700 16px/1.2 var(--font);
}
.credit-prices-list {
  overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--card);
}
.credit-price-row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(112px, .85fr); gap: 14px;
  align-items: start; padding: 11px 12px; border-bottom: 1px solid var(--line);
  font-size: 13px; line-height: 1.35;
}
.credit-price-row:last-child { border-bottom: 0; }
.credit-price-row span { min-width: 0; }
.credit-price-row strong { color: var(--hdtitle); font-size: 12px; font-weight: 750; text-align: right; }
@media (max-width: 350px) {
  .credit-price-row { grid-template-columns: minmax(0, 1fr) minmax(96px, .78fr); gap: 9px; padding: 10px; }
}
.paywall-eyebrow {
  margin: 0 0 5px; color: var(--acd); font-size: 11px; font-weight: 800;
  letter-spacing: .09em; text-transform: uppercase;
}
.paywall-switch {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px;
  margin: 10px 0 12px; padding: 3px; border-radius: 999px; background: var(--island);
}
.paywall-switch button {
  padding: 8px; border-radius: 999px; color: var(--sec); font-size: 11.5px; font-weight: 800; text-align: center;
}
.paywall-switch button.is-active {
  background: var(--card); color: var(--tx); box-shadow: 0 3px 10px rgba(43, 36, 28, .12);
}
html[data-theme="dark"] .paywall-switch button.is-active { box-shadow: 0 3px 10px rgba(0, 0, 0, .3); }
.paywall-price-table { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; }
.paywall-price-row {
  display: grid; grid-template-columns: max-content minmax(0, 1fr) auto; align-items: center;
  gap: 7px; width: 100%; padding: 11px 10px; border-bottom: 1px solid var(--line);
  border-radius: 0; background: var(--bg); text-align: left;
}
.paywall-price-row:last-child { border-bottom: 0; }
.paywall-price-row.is-selected { background: var(--btn-soft); box-shadow: inset 4px 0 0 var(--btn); }
.paywall-price-row strong { color: var(--tx); font-size: 15px; font-weight: 600; }
.paywall-price-row > span { min-width: 0; color: var(--sec); font-size: 10.5px; line-height: 1.35; }
.paywall-price-row > span > span { display: block; }
.paywall-price-row small {
  display: block; margin-top: 2px; color: var(--sec);
  font-size: 9.5px; line-height: 1.3; white-space: nowrap;
}
.paywall-price-row b { color: var(--tx); font-size: 16px; text-align: right; white-space: nowrap; }
#paywallPlanFree { grid-template-columns: max-content minmax(0, 1fr); }
.paywall-alt { margin: 7px 2px 0; color: var(--sec); font-size: 11.5px; line-height: 1.4; }
.paywall-plan {
  margin-top: 10px; padding: 12px; border: 2px solid var(--btn);
  border-radius: 14px; background: var(--card); box-shadow: 0 8px 22px var(--btn-soft);
}
.paywall-badge {
  display: inline-flex; margin-bottom: 7px; padding: 4px 8px; border-radius: 999px;
  background: var(--btn); color: var(--on-btn); font-size: 10.5px; font-weight: 800;
}
html[data-theme="dark"] .paywall-badge { background: var(--mic); color: var(--on-mic); }
.paywall-usecase { margin: 0; color: var(--tx); font-size: 12px; line-height: 1.4; }
.paywall-bonus {
  margin: 7px 0 0; padding-left: 9px; border-left: 3px solid var(--ac);
  color: var(--sec); font-size: 11px; line-height: 1.4;
}
.paywall-primary { display: block; width: 100%; margin-top: 11px; padding: 12px 10px; font-size: 14px; font-weight: 800; }
.paywall-renewal { margin: 8px 0 0; color: var(--sec); font-size: 10.5px; line-height: 1.42; }
.paywall-examples {
  margin-top: 11px; padding: 11px 12px; border-radius: 12px; background: var(--island);
}
.paywall-examples strong { display: block; margin-bottom: 5px; color: var(--tx); font-size: 11.5px; }
.paywall-examples p { margin: 0; color: var(--sec); font-size: 10.5px; line-height: 1.5; }
.paywall-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px 16px; padding: 13px 4px 0; }
.paywall-footer button { color: var(--sec); font-size: 10.5px; text-decoration: underline; text-underline-offset: 2px; }
.paywall-footer button:first-child { color: var(--tx); font-weight: 800; }

/* Credit-Vorschau: Willkommensgeschenk nach Designreferenz E */
.trial-entry-wrap { z-index: 70; }
.trial-entry-content {
  flex: 1 1 auto; min-height: 0;
  padding: calc(18px + env(safe-area-inset-top)) 20px 22px;
  overflow-x: hidden; overflow-x: clip; overflow-y: auto;
  overscroll-behavior: contain; touch-action: pan-y;
  font-family: system-ui, -apple-system, sans-serif;
}
.trial-entry-corners {
  display: flex; align-items: baseline; justify-content: space-between;
  width: min(100%, 560px); margin: 0 auto 28px;
}
.trial-entry-corners strong { color: var(--hdtitle); font: 600 22px/1 var(--font); }
.trial-entry-corners span { color: var(--sec); font-size: 11px; font-weight: 750; }
.trial-entry-copy { width: min(100%, 480px); margin: 0 auto; text-align: center; }
.trial-entry-mascot {
  display: block; width: 136px; height: 136px; margin: 0 auto 24px;
  object-fit: contain;
}
.trial-entry-eyebrow {
  margin-bottom: 12px; color: var(--acd);
  font: 850 10px/1.2 system-ui, -apple-system, sans-serif;
  letter-spacing: .1em; text-transform: uppercase;
}
html[data-theme="dark"] .trial-entry-eyebrow { color: var(--sec); }
.trial-entry-sheet h2 {
  margin: 0; color: var(--hdtitle);
  font: 600 clamp(29px, 8vw, 36px)/1.08 var(--font); letter-spacing: -.02em;
}
.trial-entry-gift {
  display: flex; align-items: center; gap: 13px; margin-top: 30px; padding: 16px 15px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--card); text-align: left;
}
.trial-entry-gift-icon {
  display: grid; width: 48px; height: 48px; flex: 0 0 auto; place-items: center;
  border-radius: 50%; background: var(--ac); color: var(--on-ac);
}
.trial-entry-gift-icon > span { --star-size: 32px; }
.trial-entry-gift > span:last-child { min-width: 0; }
.trial-entry-gift strong { display: block; color: var(--hdtitle); font: 700 17px/1.25 var(--font); }
.trial-entry-gift small { display: block; margin-top: 5px; color: var(--sec); font-size: 11px; line-height: 1.4; }
.trial-entry-features {
  display: grid; gap: 16px; margin-top: 30px; padding: 0; list-style: none; text-align: left;
}
.trial-entry-features li {
  position: relative; padding-left: 26px; color: var(--tx);
  font-size: 13px; line-height: 1.42;
}
.trial-entry-features li::before {
  position: absolute; top: 0; left: 0; color: var(--acd);
  content: "✓"; font-weight: 900;
}
.trial-entry-terms { margin-top: 30px; color: var(--sec); font-size: 11px; line-height: 1.5; }
.trial-entry-actions {
  flex: 0 0 auto; padding: 12px 20px calc(14px + env(safe-area-inset-bottom)); background: var(--bg);
}
.trial-entry-action-inner { width: min(100%, 480px); margin: 0 auto; }
.trial-entry-actions .primary {
  display: block; width: 100%; min-height: 50px; margin: 0; padding: 12px 15px;
  border-radius: 12px; font: 850 14px/1.3 system-ui, -apple-system, sans-serif;
}
#giftHasAccount {
  display: block; width: 100%; min-height: 44px; margin-top: 8px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--sec);
  font: 700 12.5px/1.3 system-ui, -apple-system, sans-serif;
}
.trial-entry-actions button:focus-visible { outline: 2px solid var(--btn); outline-offset: 2px; }

@media (max-height: 700px) {
  #sheetTrialEntry .trial-entry-content { padding-top: calc(10px + env(safe-area-inset-top)); padding-bottom: 12px; }
  #sheetTrialEntry .trial-entry-corners { margin-bottom: 12px; }
  #sheetTrialEntry .trial-entry-mascot { width: 104px; height: 104px; margin-bottom: 12px; }
  #sheetTrialEntry .trial-entry-eyebrow { margin-bottom: 8px; }
  #sheetTrialEntry .trial-entry-gift { margin-top: 16px; padding-top: 12px; padding-bottom: 12px; }
  #sheetTrialEntry .trial-entry-gift-icon { width: 44px; height: 44px; }
  #sheetTrialEntry .trial-entry-gift-icon > span { --star-size: 29px; }
  #sheetTrialEntry .trial-entry-features { gap: 10px; margin-top: 16px; }
  #sheetTrialEntry .trial-entry-terms { margin-top: 14px; }
}

/* Credit-Vorschau: Nachkauf; Erklärblock nach Mockup V5 */
.topup-title { margin-bottom: 16px; }
.topup-intro {
  margin: 12px 0 0; padding: 16px 15px; border-radius: 16px;
  background: var(--card); text-align: center;
}
.topup-infinity {
  display: grid; width: 42px; height: 42px; margin: 0 auto 8px; place-items: center;
  border-radius: 50%; background: color-mix(in srgb, var(--ac) 14%, transparent);
  color: var(--acd); font: 700 25px/1 var(--font);
}
.topup-intro strong { display: block; color: var(--hdtitle); font: 700 20px/1.2 var(--font); }
.topup-intro p { margin: 5px 0 0; color: var(--sec); font-size: 11.5px; line-height: 1.4; text-align: center; }
.topup-current { display: flex; justify-content: center; gap: 7px; margin: 8px auto 0; color: var(--sec); font-size: 12px; }
.topup-current strong { color: var(--acd); font-size: 13px; }
.topup-list { display: grid; gap: 6px; margin-top: 8px; }
.topup-listitem {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 12px; align-items: center; width: 100%; padding: 10px 13px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--card); text-align: left;
}
.topup-listitem.is-picked { border-color: var(--btn-soft-border); box-shadow: inset 3px 0 0 var(--btn); }
.topup-listitem strong { color: var(--hdtitle); font-size: 20px; font-weight: 700; }
.topup-listitem span { grid-column: 1; color: var(--sec); font-size: 11.5px; }
.topup-listitem b { grid-area: 1 / 2 / 3 / 3; font-size: 17px; white-space: nowrap; }
.topup-listitem em {
  position: absolute; top: -8px; right: 12px; padding: 3px 7px; border-radius: 99px;
  background: var(--island); color: var(--acd); font-size: 9.5px; font-style: normal; font-weight: 800;
}
.topup-buy { display: block; width: 100%; min-height: 52px; margin: 7px 0 0; padding: 12px 10px; font-size: 14px; font-weight: 850; }
.topup-facts {
  display: grid; gap: 6px; margin: 7px 0 0; padding: 7px 10px;
  border-radius: 12px; background: var(--card); color: var(--sec); font-size: 11.5px; line-height: 1.35;
}
.topup-facts > span { display: flex; gap: 7px; align-items: flex-start; }
.topup-facts i { color: var(--acd); font-style: normal; font-weight: 800; }
.topup-honest {
  margin-top: 7px; padding: 6px 9px; border-left: 3px solid var(--line);
  color: var(--sec); font-size: 11px; line-height: 1.32;
}
.topup-cancel { display: block; margin: 7px auto 0; color: var(--sec); font-size: 13px; text-align: center; }

/* Credit-Vorschau: Kostenvoranschlag nach Mockup 06, V1 */
.estimate-sheet { padding: 20px; }
.sheet-grip { width: 34px; height: 4px; margin: -8px auto 16px; border-radius: 999px; background: var(--line); }
.estimate-balance {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px;
  border-radius: 999px; background: color-mix(in srgb, var(--ac) 13%, transparent);
  color: var(--acd); font-size: 12px; font-weight: 700;
}
.estimate-balance::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ac); }
.estimate-total { display: flex; align-items: baseline; gap: 7px; margin: 16px 0 4px; color: var(--hdtitle); }
.estimate-total strong { font-size: 42px; font-weight: 700; line-height: 1; }
.estimate-total span { color: var(--sec); font-size: 13px; font-weight: 700; }
.estimate-sheet h2 { margin: 0; color: var(--hdtitle); font-size: 23px; line-height: 1.14; }
.estimate-line { margin: 9px 0 0; color: var(--tx); font-size: 13.5px; line-height: 1.45; }
.estimate-note { margin: 9px 0 0; color: var(--sec); font-size: 11.5px; line-height: 1.42; }
.estimate-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 16px; }
.estimate-actions button {
  width: 100%; min-height: 46px; margin: 0; border-radius: 10px;
  font-size: 14px; font-weight: 700;
}
.estimate-actions .secondary {
  border: 1px solid var(--btn-soft-border); background: var(--btn-soft); color: var(--on-btn-soft);
}

/* Credit-Vorschau: Aktion abgelehnt als eigenständiger Vollbild-Ablauf */
.denied-title { margin: 0 42px 20px 0; color: var(--hdtitle); font-size: 18px; line-height: 1.15; }
.denied-body { width: min(100%, 560px); margin: 0 auto; }
.denied-eyebrow {
  margin: 0 0 7px; color: var(--sec); font-size: 12px; font-weight: 700;
  letter-spacing: .055em; text-transform: uppercase;
}
.denied-copy { margin: 8px 0 0; color: var(--sec); font-size: 13.5px; line-height: 1.45; }
.denied-balance {
  margin: 18px 0 0; padding: 18px 16px 15px; border: 1px solid var(--line);
  border-radius: 18px; background: var(--card); text-align: center;
}
.denied-balance .denied-eyebrow { margin-bottom: 0; }
.denied-balance-number { margin-top: 6px; color: var(--hdtitle); font-size: 48px; font-weight: 700; line-height: 1; }
.denied-balance-label { margin-top: 3px; color: var(--sec); font-size: 13px; }
.denied-balance-rule { height: 1px; margin: 14px 0 12px; background: var(--line); }
.denied-needed { display: flex; justify-content: space-between; gap: 12px; color: var(--sec); font-size: 13px; }
.denied-needed strong { color: var(--hdtitle); }
.denied-reset {
  display: flex; gap: 10px; margin: 12px 0; padding: 10px 11px; border-radius: 10px;
  background: color-mix(in srgb, var(--ac) 12%, transparent); color: var(--acd);
  font-size: 12px; line-height: 1.4;
}
.denied-reset b { font-size: 16px; line-height: 1.1; }
.denied-free {
  padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card);
}
.denied-free > strong { display: block; color: var(--tx); font-size: 12.5px; }
.denied-free ul {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px;
  margin: 8px 0 0; padding: 0; color: var(--sec); font-size: 11.5px; list-style: none;
}
.denied-free li::before { content: "✓"; margin-right: 5px; color: var(--acd); font-weight: 800; }
.denied-actions { display: grid; gap: 9px; margin-top: 13px; }
.denied-actions button {
  width: 100%; min-height: 46px; margin: 0; border-radius: 10px;
  font-size: 14px; font-weight: 700;
}
.denied-actions .secondary {
  border: 1px solid var(--btn-soft-border); background: var(--btn-soft); color: var(--on-btn-soft);
}
.denied-prices { margin: 10px 0 0; color: var(--sec); font-size: 11.5px; line-height: 1.4; text-align: center; }

@media (max-width: 374px) {
  .paywall-price-row { padding-right: 8px; padding-left: 8px; }
  .paywall-price-row b { font-size: 14px; }
}
.recstage { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 22px 0 8px; }
.recbig {
  width: 86px; height: 86px; border-radius: 50%; background: var(--mic); color: var(--on-mic);
  display: flex; align-items: center; justify-content: center;
}
.recbig .icon { width: 38px; height: 38px; }
.recbig.live { animation: pulse 1.2s infinite; }
.phase[data-phase="rec"].is-waiting .recbig.live { animation: none; opacity: .55; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.07); } }
.bars { display: flex; gap: 5px; align-items: flex-end; height: 34px; }
.bars i { width: 6px; background: var(--mic); border-radius: 3px; animation: bar 1s infinite ease-in-out; }
.bars i:nth-child(1) { height: 40%; animation-delay: 0s; }
.bars i:nth-child(2) { height: 90%; animation-delay: .15s; }
.bars i:nth-child(3) { height: 60%; animation-delay: .3s; }
.bars i:nth-child(4) { height: 100%; animation-delay: .45s; }
.bars i:nth-child(5) { height: 50%; animation-delay: .6s; }
.phase[data-phase="rec"].is-waiting .bars i { height: 2px; opacity: .35; animation: none; }
@keyframes bar { 0%,100% { transform: scaleY(.5); } 50% { transform: scaleY(1); } }
.transcript {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--rad);
  padding: 12px 14px; font-size: 14.5px; color: var(--sec); font-style: italic; margin: 12px 0;
}
.proposal { display: flex; flex-direction: column; gap: 8px; }
.proposal .row { padding: 10px 12px; }
.proposal-edit-hint { margin: 5px 0 2px; }
.proposal-card-row { position: relative; margin-top: 8px; }
.proposal-card-open {
  width: 100%; min-width: 0; padding: 12px 56px 12px 13px; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--rad2);
}
.proposal-card-open:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; }
.proposal-card-side { display: block; color: var(--sec); font-size: 11.5px; margin-bottom: 3px; }
.proposal-card-text {
  display: block; color: var(--tx); font-size: 15px; line-height: 1.45;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.proposal-card-answer { display: block; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.proposal-card-delete {
  position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%;
  background: var(--tbbg); color: var(--sec); border: 1px solid var(--line); font-size: 15px;
}
.proposal-card-delete:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; }
.proposal-card-wrap { z-index: 50; align-items: stretch; }
.proposal-card-sheet {
  height: 100%; max-height: none; border-radius: 0;
  padding-top: calc(16px + env(safe-area-inset-top));
  display: flex; flex-direction: column; overflow: hidden;
}
.proposal-card-fields { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 2px 10px; }
.proposal-card-sheet textarea {
  width: 100%; min-height: 132px; resize: none; overflow-y: hidden; padding: 13px;
  border: 1px solid var(--line); border-radius: var(--rad2);
  background: var(--card); color: var(--tx); font: 17px/1.5 var(--font);
}
.proposal-card-sheet textarea.answer { min-height: 240px; }
.proposal-card-buttons { flex-shrink: 0; }

/* Eigenständige Aufgaben: fester Kopf, scrollender Inhalt und volle Safe-Area-Höhe. */
.sheetwrap.fullscreen-wrap {
  align-items: stretch;
  padding: 0 !important;
}
.fullscreen-wrap .sheet.fullscreen-sheet {
  height: 100%;
  height: 100dvh;
  max-height: none;
  padding: 0 !important;
  border-radius: 0 !important;
  background: var(--bg);
  box-shadow: none !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.fullscreen-head {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  min-height: calc(52px + env(safe-area-inset-top));
  margin: 0;
  padding: calc(10px + env(safe-area-inset-top)) 20px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.fullscreen-head h2 {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: var(--hdtitle);
}
.fullscreen-head .sheet-close {
  position: static;
  top: auto;
  right: auto;
}
.fullscreen-floating-close {
  position: absolute;
  z-index: 2;
  top: calc(10px + env(safe-area-inset-top));
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
}
.fullscreen-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 16px 20px calc(24px + env(safe-area-inset-bottom));
  overflow-x: hidden;
  overflow-x: clip;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.paywall-sheet .fullscreen-body {
  padding-right: 16px;
  padding-left: 16px;
}
.paywall-sheet .paywall-body, .topup-sheet .topup-body, .denied-sheet .denied-body { padding-top: calc(20px + env(safe-area-inset-top)); }
.proposal-card-sheet .fullscreen-body { display: block; }
.proposal-card-sheet .proposal-card-fields { overflow: visible; padding-right: 2px; padding-left: 2px; }
.lbl { font-size: 12.5px; color: var(--sec); margin: 10px 0 4px; }
.sheet label.lbl { display: block; }
.sheet select, .sheet input[type="text"], .sheet textarea.cardfield {
  width: 100%; background: var(--card); border: 1px solid var(--line); color: var(--tx);
  border-radius: var(--rad2); padding: 10px; font-size: 16px; box-sizing: border-box;
}
.sheet textarea.cardfield { font-family: inherit; resize: vertical; min-height: 72px; }
.dict-lang-wrap { position: relative; display: inline-block; max-width: 100%; margin-top: 2px; }
.dict-lang-chip {
  display: flex; align-items: center; gap: 7px; max-width: 100%;
  padding: 7px 11px; border-radius: 999px; background: var(--hdpill);
  color: var(--hdtitle); font-size: 13.5px; font-weight: 600;
}
.dict-lang-chip span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dict-lang-chevron { font-size: 12px; line-height: 1; }
.sheet .dict-lang-wrap select {
  position: absolute; inset: 0; width: 100%; height: 100%;
  padding: 0; border: 0; opacity: 0; cursor: pointer;
}
#sheetDict .dict-lang-input { margin-top: 6px; }
.dict-inputwrap { margin-top: 12px; }
#sheetDict .dict-inputwrap input {
  border-radius: 999px; padding: 11px 50px 11px 16px; outline: none;
}
.dict-inputwrap .send:disabled, .dict-inputwrap .send.busy { opacity: .55; cursor: default; }
.dict-result { margin-top: 14px; }
.dict-result-row { display: flex; align-items: center; gap: 12px; padding: 4px 0; }
.dict-result-copy { flex: 1; min-width: 0; }
.dict-result-front { font-size: 20px; font-weight: 600; overflow-wrap: anywhere; }
.dict-result-back { margin-top: 3px; color: var(--sec); overflow-wrap: anywhere; }
.dict-result-actions { display: flex; gap: 7px; flex-shrink: 0; }
.dict-result-actions .roundbtn { width: 40px; height: 40px; }
.dict-speak { background: transparent; }
.dict-add { background: var(--btn); border-color: var(--btn); color: var(--on-btn); }
.dict-verb-hint {
  display: inline-flex; margin-top: 9px; padding: 5px 9px;
  border-radius: 999px; background: var(--hdpill); color: var(--hdtitle);
  font-size: 12px; line-height: 1.3;
}
.dict-verb-hint[hidden] { display: none; }
.dict-save-area { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.dict-save-area .lbl { margin-top: 0; }
.dict-save-area .primary { width: 100%; margin-top: 10px; }
.card-answer-tools { margin-top: 10px; }
.card-answer-generate {
  margin-top: 0; border-style: solid; border-color: var(--ac); color: var(--acd);
}
.card-answer-generate:disabled { opacity: .45; cursor: default; }
.card-answer-status { margin-top: 7px; line-height: 1.4; }
.card-answer-status.error { color: #c05b35; }
.card-answer-status.success { color: var(--acd); }
.rowe { display: flex; gap: 6px; margin-top: 6px; }
.rowe input { flex: 1; min-width: 0; }
.rowe button { color: var(--sec); font-size: 16px; padding: 0 6px; }
.delrow {
  display: flex; align-items: center; gap: 8px; margin-top: 6px;
  border: 1px solid rgba(192, 74, 45, .55); color: #c05b35;
  border-radius: var(--rad2); padding: 10px 12px; font-size: 14.5px;
}
.delrow button { margin-left: auto; color: var(--sec); font-size: 16px; }
.renrow {
  display: flex; align-items: center; gap: 8px; margin-top: 6px;
  border: 1px solid var(--line); color: var(--acd);
  border-radius: var(--rad2); padding: 10px 12px; font-size: 14.5px;
}
.renrow button { margin-left: auto; color: var(--sec); font-size: 16px; }
.cardimg-real { max-width: 72%; max-height: 150px; border-radius: 12px; }
.study { position: relative; }
.study .study-speak { position: absolute; top: 8px; right: 8px; background: none; border: 0; padding: 6px; color: var(--sec); cursor: pointer; }
.study .study-speak .icon { width: 21px; height: 21px; }
.cardtools { display: flex; gap: 18px; margin-top: 2px; width: 100%; }
.imggen { font-size: 12.5px; color: var(--acd); }
.imggen .icon { width: 16px; height: 16px; vertical-align: -3px; }
.cardtools .imggen { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 1 1 0; min-width: 0; text-align: center; }
.cardtools .imggen .icon { vertical-align: 0; }
#imgGenBtn { position: relative; }
.mem-image-badge {
  position: absolute; top: 0; right: 0; z-index: 1;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; max-width: calc(100% - 62px); height: 15px; padding: 0 3px;
  overflow: hidden; border: 1px solid var(--line); border-radius: 999px; background: var(--island); color: var(--sec);
  font-family: system-ui, -apple-system, sans-serif; font-size: 9px; font-weight: 800;
  line-height: 1; white-space: nowrap; text-overflow: clip; opacity: .92; pointer-events: none;
}
.mnemo {
  display: flex; align-items: flex-start; gap: 7px; margin-top: 6px;
  font-size: 13.5px; font-style: italic; color: var(--sec);
  max-width: 92%; text-align: left;
}
.mnemo .icon { width: 17px; height: 17px; flex-shrink: 0; color: var(--acd); }
.mnemo-edit { margin-top: 4px; }
#recBtn.live { animation: pulse 1.2s infinite; }
.sheetbtns { display: flex; gap: 10px; margin-top: 16px; }
.sheetbtns .primary { flex: 1; margin: 0; }
.sheetbtns .plain {
  flex: 1; border: 1px solid var(--line); border-radius: var(--rad2);
  padding: 12px; font-size: 15px; color: var(--sec);
}

.newdeck-sheet { max-height: 92vh; }
.newdeck-options { margin-top: 14px; }
.newdeck-options .row { min-height: 68px; }
.newdeck-options .row:disabled { opacity: .58; cursor: default; }
.newdeck-options .soon {
  flex-shrink: 0; padding: 4px 8px; border-radius: 999px;
  background: var(--tbbg); color: var(--sec); font-size: 11.5px;
}
.sheet textarea.newdeck-description {
  width: 100%; resize: vertical; min-height: 96px; padding: 10px;
  border: 1px solid var(--line); border-radius: var(--rad2);
  background: var(--card); color: var(--tx); font: 16px/1.4 var(--font);
}
.newdeck-help { margin-top: 7px; line-height: 1.4; }
.newdeck-key-hint, .newdeck-error { color: #c05b35 !important; margin-top: 8px; font-size: 13.5px; }
.newdeck-generate { border-style: solid; border-color: var(--ac); color: var(--acd); }
.newdeck-generate:disabled { opacity: .45; cursor: default; }
.newdeck-status { margin-top: 9px; color: var(--acd) !important; }
.newdeck-preview-meta { margin-top: 14px; line-height: 1.4; }

.pdf-sheet { max-height: 92vh; }
.pdf-key-hint, .pdf-error { color: #c05b35 !important; margin-top: 8px; }
.pdf-picker {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  width: 100%; min-height: 118px; margin-top: 14px; padding: 16px;
  border: 1.5px dashed var(--ac); border-radius: var(--rad); color: var(--acd);
  background: var(--card); font-size: 16px; font-weight: 600;
}
.pdf-picker .icon { width: 34px; height: 34px; }
.pdf-picker small { color: var(--sec); font-size: 12px; font-weight: 400; }
.pdf-selected {
  display: flex; flex-direction: column; gap: 2px; margin-top: 9px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--rad2); background: var(--card);
}
.pdf-selected strong { overflow-wrap: anywhere; font-size: 14.5px; }
.photo-selected-list {
  display: flex; flex-direction: column; gap: 2px; max-height: 112px; overflow-y: auto;
  color: var(--sec); font-size: 12.5px;
}
.photo-selected-list span { overflow-wrap: anywhere; }
.pdf-options { display: grid; grid-template-columns: 1fr; gap: 2px; margin-top: 8px; }
.pdf-options label { display: block; }
.pdf-options select { width: 100%; }
.photo-options { gap: 6px; }
.pdf-privacy { margin-top: 12px; line-height: 1.45; }
.sheetbtns .primary:disabled { opacity: .45; cursor: default; }
.pdf-steps { list-style: none; padding: 8px 0 0; display: flex; flex-direction: column; gap: 9px; }
.pdf-steps li {
  position: relative; padding: 10px 12px 10px 38px; border: 1px solid var(--line);
  border-radius: var(--rad2); background: var(--card); color: var(--sec); font-size: 14px;
}
.pdf-steps li::before {
  content: ""; position: absolute; left: 14px; top: 50%; width: 10px; height: 10px;
  margin-top: -5px; border: 2px solid var(--line); border-radius: 50%;
}
.pdf-steps li.active { color: var(--tx); border-color: var(--ac); }
.pdf-steps li.active::before { border-color: var(--ac); border-top-color: transparent; animation: pdfspin .8s linear infinite; }
.pdf-steps li.done { color: var(--acd); }
.pdf-steps li.done::before { content: "✓"; width: auto; height: auto; margin-top: -9px; border: 0; font-weight: 700; }
@keyframes pdfspin { to { transform: rotate(360deg); } }
.pdf-spinner { display: flex; justify-content: center; gap: 7px; padding: 24px 0 8px; }
.pdf-spinner i { width: 9px; height: 9px; border-radius: 50%; background: var(--ac); animation: pdfdot 1.1s infinite ease-in-out; }
.pdf-spinner i:nth-child(2) { animation-delay: .16s; }
.pdf-spinner i:nth-child(3) { animation-delay: .32s; }
@keyframes pdfdot { 0%, 80%, 100% { transform: scale(.6); opacity: .45; } 40% { transform: scale(1); opacity: 1; } }
.pdf-excluded {
  margin-top: 12px; padding: 10px 12px; border-left: 3px solid var(--ac);
  background: var(--card); color: var(--sec); font-size: 13px; line-height: 1.45;
}
.pdf-card-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.pdf-card {
  position: relative; padding: 12px; border: 1px solid var(--line);
  border-radius: var(--rad); background: var(--card);
}
.pdf-card-head { display: flex; align-items: center; justify-content: space-between; color: var(--sec); font-size: 12.5px; }
.pdf-card-head button { color: #c05b35; padding: 2px 4px; font-size: 14px; }
.pdf-card textarea {
  width: 100%; resize: vertical; min-height: 58px; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: var(--rad2); background: var(--bg);
  color: var(--tx); font: 15px/1.35 var(--font);
}
.pdf-card textarea.answer { min-height: 76px; }

#imgViewer {
  position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.82);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
#imgViewer img { max-width: 100%; max-height: 100%; border-radius: 14px; }
#cardEditThumb { cursor: pointer; }

#toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(20px); background: var(--tx); color: var(--bg);
  padding: 10px 18px; border-radius: 999px; font-size: 14px; opacity: 0;
  transition: .25s; pointer-events: none; z-index: 60; max-width: 86vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#limitBar {
  position: fixed; left: 50%; bottom: calc(82px + env(safe-area-inset-bottom)); z-index: 55;
  width: min(calc(100vw - 24px), 560px); padding: 14px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--card); color: var(--tx); box-shadow: 0 8px 22px rgba(36, 27, 15, .12);
  opacity: 0; transform: translateX(-50%) translateY(14px); transition: opacity .22s ease, transform .22s ease;
}
#limitBar.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#limitBar p { margin: 0; font-size: 13px; line-height: 1.45; }
.limit-bar-actions { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 9px; }
.limit-bar-actions button {
  display: inline-flex; align-items: center; min-height: 44px; margin: -14px 0; padding: 0; border: 0; background: transparent; color: var(--on-btn-soft);
  font-size: 12px; font-weight: 750; text-decoration: underline; text-underline-offset: 3px;
}
html[data-theme="dark"] #limitBar { box-shadow: 0 9px 24px rgba(0, 0, 0, .34); }
.credit-float {
  position: fixed; z-index: 80; color: var(--btn); pointer-events: none;
  font-size: 15px; font-weight: 600; line-height: 1;
  transform: translate(-50%, -50%);
  animation: credit-float-up .9s ease-out forwards;
}
@keyframes credit-float-up {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  65% { opacity: .9; }
  100% { opacity: 0; transform: translate(-50%, calc(-50% - 48px)) scale(1.12); }
}
