/* ===== Tokens ===== */
:root {
  --bg: #f6f1e7;
  --surface: #fffdf8;
  --surface-2: #f1eadc;
  --ink: #2a211a;
  --muted: #6c5f52;
  --border: #e2d6c3;
  --accent: #8a2c2c;
  --accent-hover: #722222;
  --accent-soft: #f3e1dc;
  --on-accent: #fff;
  --star: #c98a12;
  --star-off: #d9cdb9;
  --wood: #8a603c;
  --wood-dark: #5d3e23;
  --good: #2f6b4f;
  --good-soft: #dcebe2;
  --danger: #a3261f;
  --info-soft: #e1e8f3;
  --info: #334f7d;
  --grid: #e8dfcf;
  --shadow: 0 1px 2px rgb(60 40 20 / .08), 0 4px 14px rgb(60 40 20 / .07);
  --radius: 10px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1613;
    --surface: #24201b;
    --surface-2: #2d2822;
    --ink: #efe6d9;
    --muted: #a99a88;
    --border: #3b342c;
    --accent: #e0806f;
    --accent-hover: #ec9585;
    --accent-soft: #3d2623;
    --on-accent: #1a1613;
    --star: #e8b24a;
    --star-off: #4a4238;
    --wood: #5c3f27;
    --wood-dark: #3b2716;
    --good: #7fc4a0;
    --good-soft: #213a2e;
    --danger: #f0877e;
    --info-soft: #232e40;
    --info: #9db8e4;
    --grid: #342e27;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 4px 14px rgb(0 0 0 / .25);
    color-scheme: dark;
  }
}

/* ===== Basis ===== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
}
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .4em; font-weight: 600; }
h1 { font-size: clamp(1.7rem, 3vw, 2.2rem); }
h2 { font-size: 1.3rem; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.error { color: var(--danger); }
.warn { background: var(--accent-soft); padding: .5em .75em; border-radius: 8px; }
.pad { padding: 2rem 0; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; gap: .6rem; align-items: center; }
.row.wrap { flex-wrap: wrap; margin-top: .8rem; }
.row.between { justify-content: space-between; }
.row.center { justify-content: center; flex-wrap: wrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ===== Kopfzeile ===== */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .6rem clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--ink); font: 600 1.25rem var(--serif); }
.brand:hover { color: var(--ink); }
.nav { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.nav a:not(.btn) {
  text-decoration: none; color: var(--muted); padding: .4rem .7rem; border-radius: 8px; font-weight: 500;
}
.nav a:not(.btn):hover { color: var(--ink); background: var(--surface-2); }
.nav a.active:not(.btn) { color: var(--ink); background: var(--surface-2); }
.nav-add { margin-left: .4rem; }

main { padding: 1.5rem clamp(16px, 4vw, 40px) 4rem; max-width: 1240px; margin: 0 auto; outline: none; }
.page.narrow { max-width: 760px; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.page-head p { margin: 0; }
.section-title { margin: 2rem 0 .5rem; }
.section-title h2 { margin: 0; }

/* ===== Buttons & Formulare ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35em;
  padding: .5rem 1rem; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink); font: 500 .95rem var(--sans);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--surface-2); color: var(--ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-danger { color: var(--danger); background: transparent; }
.btn-danger:hover { background: var(--accent-soft); color: var(--danger); }
.btn-sm { padding: .3rem .65rem; font-size: .85rem; }
.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline; }

input, select, textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: .5rem .7rem; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
textarea { resize: vertical; line-height: 1.5; }
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: 1rem; min-width: 0; }
.field .row input { flex: 1; }
.label { font-size: .85rem; font-weight: 600; color: var(--muted); }
.field-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.field-row > .field { flex: 1 1 140px; }
.field-row > .field.grow { flex: 2 1 220px; }
.check { display: flex; align-items: center; gap: .5rem; cursor: pointer; }
.check input { width: auto; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.2rem; box-shadow: var(--shadow); margin-bottom: 1rem;
}
.card-title { font-size: 1.05rem; margin-bottom: .8rem; }

/* Tabs & Segmente */
.tabs { display: flex; gap: .25rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tab {
  border: 1px solid transparent; background: none; color: var(--muted); font: 500 .92rem var(--sans);
  padding: .4rem .8rem; border-radius: 999px; cursor: pointer;
}
.tab:hover { color: var(--ink); background: var(--surface-2); }
.tab.active { color: var(--ink); background: var(--surface); border-color: var(--border); box-shadow: var(--shadow); }
.tab .count { font-size: .78em; color: var(--muted); margin-left: .15em; }

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: .45rem .75rem; cursor: pointer; color: var(--muted); font: 500 .92rem var(--sans); }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.active { background: var(--accent); color: var(--on-accent); }
.seg-wide { display: flex; flex-wrap: wrap; }
.seg-wide button { flex: 1 1 auto; }

.toolbar { display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap; align-items: flex-start; }
.toolbar .tabs { margin-bottom: .5rem; }
.toolbar-right { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar-right input { width: 260px; max-width: 100%; }
.toolbar-right select { width: auto; }

/* Badges & Chips */
.badge { font-size: .75rem; font-weight: 600; padding: .15rem .5rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge-read { background: var(--good-soft); color: var(--good); }
.badge-reading { background: var(--accent-soft); color: var(--accent); }
.badge-wishlist { background: var(--info-soft); color: var(--info); }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin: .4rem 0; }
.chip { font-size: .8rem; padding: .15rem .6rem; border-radius: 999px; background: var(--surface-2); color: var(--ink); border: 1px solid var(--border); }
.chip-sm { font-size: .72rem; padding: .05rem .45rem; margin-right: .25rem; }
.chip-plus { background: var(--good-soft); border-color: transparent; color: var(--good); }
.chip-minus { background: var(--accent-soft); border-color: transparent; color: var(--danger); text-decoration: line-through; text-decoration-thickness: 1px; }
.chip-author { font-style: italic; }
.chip-author::before { content: "✎ "; font-style: normal; }

/* Sterne */
.stars { display: inline-flex; gap: 1px; color: var(--star-off); line-height: 1; }
.star.on { color: var(--star); }
.stars.sm { font-size: .85rem; }
.stars.lg { font-size: 2rem; }
.stars-input .star { background: none; border: 0; padding: 0 2px; cursor: pointer; color: var(--star-off); font-size: inherit; line-height: 1; transition: transform .1s; }
.stars-input .star.on { color: var(--star); }
.stars-input:hover .star { color: var(--star); }
.stars-input .star:hover ~ .star { color: var(--star-off); }
.stars-input .star:hover { transform: scale(1.15); }

/* ===== Cover ===== */
.cover {
  position: relative; aspect-ratio: 2 / 3; width: 100%; overflow: hidden;
  border-radius: 2px 5px 5px 2px; background: var(--surface-2);
  box-shadow: inset 3px 0 4px -2px rgb(0 0 0 / .25), 0 2px 6px rgb(0 0 0 / .18);
}
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-fallback {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between;
  padding: 12% 10% 10% 14%; color: #fff8ee;
  background:
    linear-gradient(90deg, rgb(0 0 0 / .28) 0 6%, rgb(255 255 255 / .08) 6% 7.5%, transparent 7.5%),
    linear-gradient(160deg, hsl(var(--hue) 42% 38%), hsl(calc(var(--hue) + 25) 48% 24%));
}
.cf-title {
  font: 600 clamp(.72rem, 1.4vw, .95rem)/1.2 var(--serif); overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical;
  border-top: 1px solid rgb(255 248 238 / .45); border-bottom: 1px solid rgb(255 248 238 / .45); padding: .4em 0;
}
.cf-author { font-size: clamp(.6rem, 1.1vw, .75rem); opacity: .85; text-transform: uppercase; letter-spacing: .04em; }
.cover-xs { width: 38px; flex: none; }
.cover-xs .cf-title, .cover-xs .cf-author, .cover-sm .cf-author { display: none; }
.cover-xs .cover-fallback { padding: 0; }
.cover-sm { width: 56px; flex: none; }
.cover-sm .cf-title { font-size: .5rem; -webkit-line-clamp: 4; }
.cover-md { width: 110px; flex: none; }
.cover-lg { width: 100%; max-width: 260px; }
.cover-lg .cf-title { font-size: 1.3rem; }
.cover-lg .cf-author { font-size: .85rem; }

/* ===== Regal ===== */
.shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  column-gap: 0; row-gap: 1.75rem;
}
.book { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; min-width: 0; }
.book:hover { color: var(--ink); }
.book-slot {
  position: relative; padding: 18px 12px 0;
  border-bottom: 12px solid var(--wood);
  box-shadow: 0 8px 8px -6px rgb(40 25 10 / .35);
  background: linear-gradient(to bottom, transparent 70%, rgb(80 50 20 / .06));
}
.book-slot::after { /* Kante des Regalbretts */
  content: ""; position: absolute; left: 0; right: 0; bottom: -12px; height: 3px; background: rgb(255 255 255 / .12);
}
.book .cover { transition: transform .2s ease, box-shadow .2s; transform-origin: bottom center; }
.book:hover .cover, .book:focus-visible .cover { transform: translateY(-8px) rotate(-1.5deg); box-shadow: 0 10px 18px rgb(0 0 0 / .25); }
.book-meta { display: flex; flex-direction: column; padding: .55rem 12px 0; gap: .1rem; }
.book-title { font-weight: 600; font-size: .9rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book-author { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ribbon {
  position: absolute; top: 18px; right: 20px; background: var(--accent); color: var(--on-accent);
  font-size: .65rem; font-weight: 700; padding: 6px 4px 10px; writing-mode: vertical-rl;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 88%, 0 100%);
}
.lent {
  position: absolute; left: 16px; bottom: 6px; max-width: calc(100% - 32px);
  font-size: .68rem; font-weight: 600; background: var(--info-soft); color: var(--info);
  padding: .05rem .4rem; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.book-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.list-row {
  display: grid; grid-template-columns: 38px 1fr auto 90px 170px; gap: 1rem; align-items: center;
  padding: .6rem 1rem; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--surface-2); color: var(--ink); }
.list-main { display: flex; flex-direction: column; min-width: 0; }
.list-main > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-extra { font-size: .8rem; text-align: right; }

/* Leerer Zustand */
.empty { text-align: center; max-width: 560px; margin: 3rem auto; }
.empty-shelf { display: flex; justify-content: center; align-items: flex-end; gap: 6px; height: 90px; margin-bottom: 1.5rem; border-bottom: 10px solid var(--wood); width: 200px; margin-inline: auto; }
.empty-shelf span { width: 22px; border-radius: 2px; background: var(--accent); height: 70%; }
.empty-shelf span:nth-child(2) { background: var(--good); height: 90%; }
.empty-shelf span:nth-child(3) { background: var(--star); height: 60%; }
.empty-shelf span:nth-child(4) { background: var(--info); height: 80%; transform: rotate(10deg); transform-origin: bottom left; }

/* ===== Detail ===== */
.back { display: inline-block; margin-bottom: 1rem; text-decoration: none; }
.detail-grid { display: grid; grid-template-columns: minmax(180px, 260px) 1fr; gap: 2.5rem; align-items: start; }
.detail-cover { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 1rem; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: .25rem .8rem; margin: 0; font-size: .88rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.author { font-size: 1.1rem; color: var(--muted); margin: 0 0 1.5rem; }
.detail-main .section-title { font-size: 1.1rem; margin-top: 1.5rem; }
.detail-cover > .btn { align-self: flex-start; }
.cover-dialog {
  width: min(760px, calc(100vw - 32px)); max-height: 85vh; padding: 1.2rem;
  background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.cover-dialog::backdrop { background: rgb(0 0 0 / .5); }
.cover-dialog h2 { margin: 0; }
.cover-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: .8rem; }
.cover-option { display: flex; flex-direction: column; gap: .25rem; padding: 4px; background: none; border: 2px solid transparent; border-radius: 8px; cursor: pointer; color: var(--muted); font: .75rem var(--sans); }
.cover-option img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px; box-shadow: 0 2px 6px rgb(0 0 0 / .2); }
.cover-option:hover, .cover-option:focus-visible { border-color: var(--border); }
.cover-option.active { border-color: var(--accent); }
.edit-meta { margin: .5rem 0 1.5rem; }
.edit-meta summary { cursor: pointer; color: var(--muted); font-weight: 500; margin-bottom: 1rem; }

/* ===== Hinzufügen ===== */
.preview { display: flex; gap: 1.2rem; align-items: flex-start; }
.preview h2 { margin-bottom: .1rem; }
.preview .author { margin-bottom: .3rem; font-size: 1rem; }
.results { display: flex; flex-direction: column; gap: .5rem; }
.result { display: flex; gap: 1rem; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem .8rem; }
.result .grow { display: flex; flex-direction: column; }
.result-actions { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
.scanner { position: relative; margin-top: 1rem; border-radius: var(--radius); overflow: hidden; background: #000; }
.scanner video { width: 100%; display: block; max-height: 50vh; object-fit: cover; }
.scanner .scan-line { position: absolute; left: 10%; right: 10%; top: 50%; height: 2px; background: #ff4d4d; box-shadow: 0 0 10px #ff4d4d; animation: scan 1.6s ease-in-out infinite alternate; }
.scanner .btn { position: absolute; bottom: .75rem; left: 50%; transform: translateX(-50%); }
@keyframes scan { from { transform: translateY(-40px); } to { transform: translateY(40px); } }
.loading::before { content: ""; display: inline-block; width: .9em; height: .9em; margin-right: .5em; vertical-align: -.1em; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Statistik ===== */
.year-select { display: flex; gap: .5rem; align-items: center; color: var(--muted); font-weight: 500; }
.year-select select { width: auto; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .2rem; }
.tile-label { font-size: .85rem; color: var(--muted); font-weight: 600; }
.tile-value { font: 600 2.2rem/1.1 var(--serif); }
.tile-value small { font-size: 1.1rem; color: var(--muted); }
.tile-sub { font-size: .82rem; color: var(--muted); }
.progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: .3rem 0; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; margin-top: 1rem; }
.grid-2 .card { margin: 0; }

.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--sans); }
.chart .bar { fill: var(--accent); }
.chart .hit:hover .bar { fill: var(--accent-hover); }
.chart .hit:hover rect { fill: var(--surface-2); }

.hbars { display: flex; flex-direction: column; gap: .45rem; }
.hbar { display: grid; grid-template-columns: minmax(90px, 38%) 1fr 2.2em; gap: .7rem; align-items: center; font-size: .88rem; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 12px; }
.hbar-fill { display: block; height: 100%; min-width: 3px; background: var(--accent); border-radius: 0 4px 4px 0; }
.hbar:hover .hbar-fill { background: var(--accent-hover); }
.hbar-value { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }

.tooltip {
  position: fixed; z-index: 50; pointer-events: none; transform: translate(-50%, calc(-100% - 12px));
  background: var(--ink); color: var(--bg); font-size: .82rem; font-weight: 500;
  padding: .3rem .6rem; border-radius: 6px; white-space: nowrap; box-shadow: var(--shadow);
}

.mini-books { display: flex; gap: 1rem; flex-wrap: wrap; }
.mini-book { display: flex; gap: .8rem; align-items: center; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem 1rem .6rem .6rem; max-width: 360px; }
.mini-book:hover { color: var(--ink); background: var(--surface-2); }

.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--border); margin-left: 5.5rem; }
.timeline li { position: relative; padding: .5rem 0 .5rem 1.2rem; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 1.2rem; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); }
.tl-date { position: absolute; left: -6rem; top: 1rem; width: 5.2rem; text-align: right; font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-book { display: flex; gap: .9rem; text-decoration: none; color: var(--ink); padding: .5rem; border-radius: 8px; }
.tl-book:hover { background: var(--surface); color: var(--ink); }
.tl-main { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.tl-main q { font-family: var(--serif); font-style: italic; color: var(--muted); }

/* ===== Empfehlungen ===== */
.taste-row { display: flex; gap: 1rem; align-items: baseline; }
.taste-row .label { width: 6.5rem; flex: none; }
.rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 1rem; margin-top: .8rem; }
.rec {
  display: flex; gap: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); transition: opacity .3s;
}
a.rec:hover { background: var(--surface-2); color: var(--ink); }
.rec.done { opacity: .6; }
.rec-body { display: flex; flex-direction: column; gap: .2rem; min-width: 0; flex: 1; }
.rec-title { font-family: var(--serif); font-size: 1.05rem; line-height: 1.25; }
.reason { font-size: .85rem; margin: .4rem 0; }
.rec-actions { display: flex; gap: .35rem; flex-wrap: wrap; margin: .3rem 0; }

/* ===== Toast ===== */
.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 150%);
  background: var(--ink); color: var(--bg); padding: .6rem 1.1rem; border-radius: 999px;
  font-weight: 500; box-shadow: var(--shadow); transition: transform .25s ease, opacity .25s; z-index: 100; max-width: calc(100vw - 32px);
  opacity: 0; pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ===== Konto ===== */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0 0 .8rem; }
.kv dt { color: var(--muted); font-size: .9rem; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.form-msg { min-height: 1.5em; margin: .6rem 0 0; }
.form-msg:empty { display: none; }
button:disabled { opacity: .6; cursor: wait; }

/* ===== Mobil ===== */
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: .4rem; padding-block: .5rem; }
  .nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; }
  .nav-add { margin-left: auto; }
  .detail-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .detail-cover { position: static; flex-direction: row; align-items: flex-start; }
  .detail-cover .cover-lg { width: 130px; }
  .shelf { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .book-slot { padding: 14px 8px 0; }
  .book-meta { padding-inline: 8px; }
  .toolbar-right, .toolbar-right input { width: 100%; }
  .toolbar-right input { flex: 1 1 100%; }
  .list-row { grid-template-columns: 38px 1fr auto; }
  .list-rating, .list-extra { display: none; }
  .preview { flex-direction: column; }
  .result { flex-wrap: wrap; }
  .result-actions { width: 100%; justify-content: flex-start; }
  .rec-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .timeline { margin-left: 0; }
  .tl-date { position: static; display: block; text-align: left; width: auto; padding-left: .5rem; }
  .taste-row { flex-direction: column; gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
