/* ---------- Schriften (lokal, SIL Open Font License) ---------- */
@font-face { font-family: 'Nunito'; src: url(fonts/nunito-latin-400-normal.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Nunito'; src: url(fonts/nunito-latin-700-normal.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Nunito'; src: url(fonts/nunito-latin-400-italic.woff2) format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Nunito'; src: url(fonts/nunito-latin-700-italic.woff2) format('woff2'); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: 'Fredoka'; src: url(fonts/fredoka-latin-400-normal.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Fredoka'; src: url(fonts/fredoka-latin-600-normal.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Patrick Hand'; src: url(fonts/patrick-hand-latin-400-normal.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Caveat'; src: url(fonts/caveat-latin-400-normal.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Caveat'; src: url(fonts/caveat-latin-700-normal.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Bangers'; src: url(fonts/bangers-latin-400-normal.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Lora'; src: url(fonts/lora-latin-400-normal.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Lora'; src: url(fonts/lora-latin-700-normal.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Lora'; src: url(fonts/lora-latin-400-italic.woff2) format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Lora'; src: url(fonts/lora-latin-700-italic.woff2) format('woff2'); font-weight: 700; font-style: italic; font-display: swap; }

/* ---------- Farben ---------- */
:root {
  --primary: #6d28d9;      /* Knöpfe (Kontrast zu Weiß 7:1) */
  --primary-soft: #ede9fe;
  --primary-line: #c4b5fd;
  --ink: #1f1530;           /* Text */
  --muted: #5b5170;         /* Nebentext (Kontrast > 6:1) */
  --bg: #f5f3ff;
  --surface: #ffffff;
  --desk: #e7e2f3;          /* Fläche um die Seite */
  --line: #e2dcef;
  --danger: #be123c;
  --pink: #ff6f91;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(31, 21, 48, .12);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { font-family: 'Nunito', system-ui, sans-serif; color: var(--ink); background: var(--bg); overscroll-behavior: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .35; cursor: default; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
[hidden] { display: none !important; }

.ic { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.splash { position: fixed; inset: 0; display: grid; place-content: center; text-align: center; font: 700 28px 'Fredoka', sans-serif; color: var(--primary); }

/* ---------- Knöpfe ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 999px; border: 2px solid var(--primary-line); background: var(--surface); font-weight: 700; color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 15px; }
.btn.big { width: 100%; min-height: 56px; font-size: 18px; margin-top: 18px; }
.iconbtn { display: inline-grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 50%; background: transparent; color: var(--ink); flex: none; }
.iconbtn.sm { width: 44px; height: 44px; }
.iconbtn.warn { color: var(--danger); }
.iconbtn.light { color: #fff; }
.iconbtn:active { background: var(--primary-soft); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; margin-top: 16px; }

/* ---------- Bildschirme ---------- */
.screen { position: fixed; inset: 0; background: var(--bg); }

/* Bücherregal */
.library { overflow-y: auto; padding-bottom: 40px; }
.lib-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; position: sticky; top: 0; background: var(--bg); z-index: 2; }
.lib-head .logo { width: 52px; height: 52px; }
.lib-head h1 { font: 700 28px 'Fredoka', sans-serif; color: var(--primary); margin: 0; }
.grow { flex: 1; }
.banner { display: flex; align-items: center; gap: 10px; margin: 0 16px 6px; padding: 10px 14px; background: #fef3c7; border-radius: var(--radius); color: #713f12; font-size: 15px; flex-wrap: wrap; }
.banner span { flex: 1; min-width: 180px; }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 22px 18px; padding: 12px 16px; align-items: end; }
.bookcard { display: flex; flex-direction: column; gap: 6px; min-width: 0; background: none; border: 0; padding: 0; text-align: left; }
.bookcard .cover { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 4px 12px 12px 4px; overflow: hidden; background: #fff; box-shadow: var(--shadow), inset 6px 0 0 rgba(0, 0, 0, .08); }
.bookcard .cover::after { content: ''; position: absolute; inset: 0 auto 0 0; width: 8px; background: linear-gradient(to right, rgba(0, 0, 0, .18), transparent); }
.bookcard .cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bookcard.new .cover { aspect-ratio: 3/4; display: grid; place-items: center; background: var(--primary-soft); border: 3px dashed var(--primary-line); box-shadow: none; color: var(--primary); border-radius: 12px; }
.bookcard.new .cover::after { display: none; }
.bookcard.new .cover .ic { width: 48px; height: 48px; }
.bookcard.new .bt { color: var(--primary); }
.bt-row { display: flex; align-items: center; gap: 2px; min-width: 0; }
.bt { font-weight: 700; font-size: 16px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.bs { font-size: 13px; color: var(--muted); margin-top: -8px; }
.empty-hint { text-align: center; color: var(--muted); font-size: 18px; padding: 0 20px; }

/* Neues Buch */
.lbl { display: block; font-weight: 700; margin: 12px 0 6px; font-size: 15px; }
.field { display: block; width: 100%; min-height: 50px; margin-top: 6px; padding: 0 14px; border: 2px solid var(--line); border-radius: 12px; font-size: 18px; background: #fff; font-weight: 400; }
.field:focus { border-color: var(--primary); outline: none; }
.formats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.fmt input { position: absolute; opacity: 0; }
.fmt-box { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; height: 112px; padding: 10px 4px; border: 2px solid var(--line); border-radius: 12px; font-size: 14px; font-weight: 700; background: #fff; }
.fmt input:checked + .fmt-box { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.fmt input:focus-visible + .fmt-box { outline: 3px solid var(--primary); }
.fmt-shape { height: 56px; max-width: 70px; background: #fff; border: 2px solid var(--ink); border-radius: 3px; }
.fmt-shape.landscape { height: auto; width: 64px; }
.fmt-shape.comic { background: linear-gradient(var(--ink), var(--ink)) 50% 0/2px 100% no-repeat, linear-gradient(var(--ink), var(--ink)) 0 50%/100% 2px no-repeat, #fff; }

/* ---------- Editor ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  grid-template-areas: "top" "stage" "strip" "panel" "tool"; background: var(--desk); }
@media (min-aspect-ratio: 1/1) and (min-width: 700px) {
  .editor { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "top top" "stage panel" "strip panel" "tool tool"; }
  .editor .panel { width: 300px; max-height: none !important; border-top: 0 !important; border-left: 1px solid var(--line); }
}
.topbar { grid-area: top; display: flex; align-items: center; gap: 2px; padding: 4px 6px; background: var(--surface); border-bottom: 1px solid var(--line); padding-top: max(4px, env(safe-area-inset-top)); }
.title-inp { flex: 1; min-width: 60px; height: 44px; border: 2px solid transparent; border-radius: 10px; background: transparent; font-weight: 700; font-size: 17px; padding: 0 8px; text-overflow: ellipsis; }
.title-inp:focus { border-color: var(--primary-line); outline: none; background: #fff; }
.pillbtn { display: inline-flex; align-items: center; gap: 4px; height: 44px; padding: 0 10px; border-radius: 22px; border: 0; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 15px; flex: none; }
.done-edit { display: none; min-height: 42px; }
.editor.editing .done-edit { display: inline-flex; }
.editor.editing .topbar .iconbtn:not([data-a=exit]), .editor.editing .pillbtn,
.editor.editing .toolbar, .editor.editing .panel, .editor.editing .strip, .editor.editing .nav { display: none !important; }

.stage { grid-area: stage; position: relative; display: grid; place-items: center; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.pagewrap { position: relative; box-shadow: 0 4px 18px rgba(31, 21, 48, .22); background: #fff; }
.page { position: absolute; left: 0; top: 0; transform-origin: 0 0; overflow: hidden; }
.page .bgimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.item { position: absolute; transform-origin: 50% 50%; }
.item .shape { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.item .bgfill { position: absolute; inset: 0; border-radius: 12px; }
.tx { position: absolute; display: flex; flex-direction: column; overflow: hidden; }
.tx.v-middle { justify-content: center; }
.ti { white-space: pre-wrap; overflow-wrap: break-word; outline: none; min-height: 1.25em; -webkit-user-select: text; user-select: text; }
.ti:empty::before { content: attr(data-ph); color: #8b84a0; }
.editing-item .tx { overflow: visible; }
.item.empty { outline: calc(2px * var(--inv, 1)) dashed var(--primary-line); }
.t-image img { display: block; width: 100%; height: 100%; box-sizing: border-box; pointer-events: none; }
.t-sticker span { display: block; width: 100%; text-align: center; white-space: nowrap; font-family: sans-serif; }
.t-ink svg { display: block; width: 100%; height: 100%; overflow: visible; }
.audiobtn { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; color: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .25); }
.audiobtn .ic { width: 55%; height: 55%; stroke-width: 2.2; }
.selbox { position: absolute; pointer-events: none; outline: calc(2px * var(--inv)) solid var(--primary); outline-offset: calc(3px * var(--inv)); z-index: 5; }
.hd { position: absolute; pointer-events: auto; width: calc(26px * var(--inv)); height: calc(26px * var(--inv)); background: #fff; border: calc(3px * var(--inv)) solid var(--primary); border-radius: 50%; transform: translate(-50%, -50%); touch-action: none; }
.hd::after { content: ''; position: absolute; inset: calc(-12px * var(--inv)); } /* größere Tippfläche */
.h-se { left: 100%; top: 100%; }
.h-e { left: 100%; top: 50%; border-radius: 6px; }
.h-s { left: 50%; top: 100%; border-radius: 6px; }
.h-rot { left: 50%; top: calc(-40px * var(--inv)); background: var(--primary); }
.h-rot::before { content: ''; position: absolute; left: 50%; top: 100%; width: calc(2px * var(--inv)); height: calc(14px * var(--inv)); background: var(--primary); transform: translateX(-50%); }
.guide { position: absolute; background: #ec4899; z-index: 4; pointer-events: none; }
.guide.gv { left: 50%; top: 0; bottom: 0; width: calc(2px * var(--inv)); }
.guide.gh { top: 50%; left: 0; right: 0; height: calc(2px * var(--inv)); }
.live { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 6; }
.nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .85); color: var(--primary); display: grid; place-items: center; box-shadow: var(--shadow); z-index: 3; }
.nav.prev { left: 4px; } .nav.next { right: 4px; }

.toolbar { grid-area: tool; display: flex; gap: 2px; padding: 4px 6px; padding-bottom: max(4px, env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; justify-content: safe center; }
.tool { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 64px; min-height: 58px; padding: 4px 6px; border: 0; border-radius: 12px; background: transparent; font-size: 13px; font-weight: 700; color: var(--ink); flex: none; }
.tool:active, .tool.on { background: var(--primary-soft); color: var(--primary); }
.tool.accent { background: var(--primary); color: #fff; }
.tool.warn { color: var(--danger); }
.tb-gap { flex: 1; min-width: 12px; }

.panel { grid-area: panel; background: var(--surface); border-top: 1px solid var(--line); overflow-y: auto; padding: 4px 14px 14px; max-height: 40vh; }
.panel-head { display: flex; align-items: center; justify-content: space-between; min-height: 44px; position: sticky; top: -4px; background: var(--surface); z-index: 1; }
.psec h3 { font-size: 14px; color: var(--muted); margin: 12px 0 6px; font-weight: 700; }
.hint { font-size: 14px; color: var(--muted); margin: 10px 0; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.sw { position: relative; width: 38px; height: 38px; border-radius: 50%; border: 2px solid rgba(31, 21, 48, .18); padding: 0; flex: none; }
.sw.on { outline: 3px solid var(--primary); outline-offset: 2px; }
.sw.none { background: linear-gradient(135deg, #fff 45%, var(--danger) 45%, var(--danger) 55%, #fff 55%); }
.sw.custom { background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); overflow: hidden; }
.sw.custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; min-height: 42px; padding: 0 14px; border-radius: 21px; border: 2px solid var(--line); background: #fff; font-size: 16px; }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip .ic { width: 20px; height: 20px; }
.slider { display: grid; grid-template-columns: 100px 1fr 52px; align-items: center; gap: 8px; min-height: 48px; margin-top: 6px; font-size: 14px; font-weight: 700; color: var(--muted); }
.slider input { width: 100%; accent-color: var(--primary); height: 32px; }
.slider output { text-align: right; color: var(--ink); }

.strip { grid-area: strip; display: flex; align-items: center; gap: 8px; padding: 8px; background: #f8f6fd; border-top: 1px solid var(--line); }
.strip-list { flex: 1; display: flex; gap: 10px; overflow-x: auto; align-items: center; padding: 3px; scrollbar-width: thin; }
.strip-ctl { display: flex; flex-wrap: wrap; gap: 2px; width: 92px; flex: none; }
.thumb { position: relative; flex: none; padding: 0; border: 0; border-radius: 6px; overflow: hidden; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
.thumb.on { outline: 3px solid var(--primary); outline-offset: 2px; }
.thumb .page { pointer-events: none; }
.tn { position: absolute; right: 3px; bottom: 3px; z-index: 2; background: rgba(31, 21, 48, .7); color: #fff; font-size: 12px; font-weight: 700; border-radius: 8px; padding: 0 6px; }
.thumb.add { width: 70px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 700; box-shadow: none; border: 2px dashed var(--primary-line); }

/* ---------- Blätter (von unten) ---------- */
.sheet-bd { position: fixed; inset: 0; background: rgba(20, 10, 40, 0); display: flex; align-items: flex-end; justify-content: center; z-index: 50; transition: background .2s; }
.sheet-bd.open { background: rgba(20, 10, 40, .45); }
.sheet-bd:not(.open) { pointer-events: none; }
.sheet { width: min(560px, 100%); max-height: 88%; display: flex; flex-direction: column; background: var(--surface); border-radius: 22px 22px 0 0; transform: translateY(100%); transition: transform .22s ease-out; box-shadow: 0 -4px 24px rgba(0, 0, 0, .2); }
.sheet.wide { width: min(860px, 100%); }
.sheet-bd.open .sheet { transform: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 0 20px; }
.sheet-head h2 { margin: 0; font-size: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-body { overflow-y: auto; padding: 6px 20px max(20px, env(safe-area-inset-bottom)); }
.lead { font-size: 17px; line-height: 1.45; margin: 6px 0 12px; }
.menu { display: flex; flex-direction: column; }
.menu button { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 8px 6px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; font-size: 17px; }
.menu button:last-child { border-bottom: 0; }
.menu button .ic { color: var(--primary); }
.menu button.warn, .menu button.warn .ic { color: var(--danger); }
.menu small { display: block; color: var(--muted); font-size: 14px; }
.bigchoices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 4px 0 8px; }
.bigchoice { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 10px; border: 2px solid var(--line); border-radius: 18px; background: #fff; font-size: 17px; text-align: center; }
.bigchoice .ic { width: 44px; height: 44px; color: var(--primary); }
.bigchoice small { color: var(--muted); font-size: 14px; }
.sh3 { font-size: 15px; color: var(--muted); margin: 14px 0 8px; }
.shapegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.shapebtn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border: 2px solid var(--line); border-radius: 14px; background: #fff; font-size: 13px; font-weight: 700; }
.shapebtn svg { width: 54px; height: 54px; overflow: visible; }
.tabs { margin-bottom: 10px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.tabs .chip { flex: none; }
.emojigrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 4px; }
.emoji { height: 56px; border: 0; border-radius: 12px; background: none; font-size: 34px; line-height: 1; }
.emoji:active { background: var(--primary-soft); }
.layouts { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }
.layout { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 4px; border: 2px solid var(--line); border-radius: 14px; background: #fff; font-size: 14px; font-weight: 700; }
.layout .lp { position: relative; display: block; overflow: hidden; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); background: #fff; }
.layout .page { pointer-events: none; }

/* Ton aufnehmen */
.rec-main { display: flex; align-items: center; justify-content: center; gap: 22px; padding: 10px 0 16px; }
.recbtn { width: 84px; height: 84px; border-radius: 50%; border: 5px solid var(--danger); background: #fff; display: grid; place-items: center; }
.recbtn .dot { width: 46px; height: 46px; border-radius: 50%; background: var(--danger); transition: all .15s; }
.recbtn.on .dot { width: 32px; height: 32px; border-radius: 6px; }
.recbtn.on { animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(190, 18, 60, .15); } }
.rec-time { font: 700 32px 'Fredoka', sans-serif; min-width: 90px; }
.rec audio { width: 100%; }

/* Hinweise */
.toast { position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); max-width: calc(100% - 32px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 16px; opacity: 0; transition: all .25s; z-index: 100; text-align: center; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.busy { position: fixed; inset: 0; background: rgba(20, 10, 40, .45); display: grid; place-items: center; z-index: 90; }
.busy-box { background: #fff; border-radius: 18px; padding: 24px 28px; text-align: center; font-size: 17px; max-width: 80%; }
.spinner { width: 44px; height: 44px; margin: 0 auto 8px; border-radius: 50%; border: 5px solid var(--primary-soft); border-top-color: var(--primary); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.about { text-align: center; font-size: 16px; line-height: 1.5; }
.about .small { font-size: 13px; color: var(--muted); }

/* ---------- Lesemodus ---------- */
.reader { background: #1b1230; z-index: 40; }
.r-stage { position: absolute; inset: 56px 0 36px; display: grid; place-items: center; overflow: hidden; touch-action: pan-y; }
.r-wrap { position: relative; }
.r-wrap .page { box-shadow: 0 6px 30px rgba(0, 0, 0, .5); }
.r-wrap .t-audio { cursor: pointer; }
.r-wrap .t-audio .audiobtn { animation: wiggle 2.4s infinite; }
@keyframes wiggle { 0%, 90%, 100% { rotate: 0deg; } 94% { rotate: -8deg; } 97% { rotate: 8deg; } }
.r-bar { position: absolute; top: 0; left: 0; right: 0; height: 56px; display: flex; align-items: center; gap: 4px; padding: 0 6px; color: #fff; }
.r-title { flex: 1; font-weight: 700; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader.speaking [data-a=speak] { background: var(--primary); }
.r-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 80px; border: 0; border-radius: 14px; background: rgba(27, 18, 48, .6); color: #fff; display: grid; place-items: center; z-index: 2; }
.r-nav.prev { left: 6px; } .r-nav.next { right: 6px; }
.r-count { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; color: #d6cdf0; font-size: 15px; }
.in-next { animation: inNext .4s ease-out; } .out-next { animation: outNext .4s ease-in forwards; }
.in-prev { animation: inPrev .4s ease-out; } .out-prev { animation: outPrev .4s ease-in forwards; }
@keyframes inNext { from { translate: 140px 0; opacity: 0; } }
@keyframes outNext { to { translate: -140px 0; opacity: 0; } }
@keyframes inPrev { from { translate: -140px 0; opacity: 0; } }
@keyframes outPrev { to { translate: 140px 0; opacity: 0; } }

@media (max-width: 420px) {
  .formats { grid-template-columns: repeat(2, 1fr); }
  .tool { min-width: 56px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
