/* =========================================================================
   myMangas – App-Oberfläche (/app). Tokens kommen aus app.css.
   Mobil zuerst; ab 900px Drawer links statt unterer Leiste.
   ========================================================================= */

.mm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mm-icon { flex-shrink: 0; }

.mm-app { min-height: 100vh; display: flex; }
.mm-app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mm-content { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 8px 16px calc(110px + env(safe-area-inset-bottom)); }

/* Abstand oben (#78): iOS verwischt den Bereich unter der Statusleiste – Bedienelemente darunter */
:root { --mm-top-safe: calc(env(safe-area-inset-top) + 12px); }
.mm-topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: var(--mm-top-safe) 16px 8px; background: var(--paper); border-bottom: 2px solid var(--tone); }
.mm-topbar-brand span { font-size: 1.25rem; }
.mm-topbar-actions { display: flex; align-items: center; gap: .5rem; }
.mm-offline { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem; border: 2px solid var(--ink); border-radius: 999px; background: var(--missing); color: var(--on-missing); font-weight: 700; font-size: .8rem; }

.mm-iconbtn { width: 44px; height: 44px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--ink); border-radius: 22px; background: var(--panel); color: var(--ink); cursor: pointer; text-decoration: none; }
.mm-iconbtn.active { background: var(--ink); color: var(--paper); }
.mm-iconbtn-spacer { width: 44px; flex-shrink: 0; }

/* ---------- Untere Navigation ---------- */
.mm-bottomnav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; padding: 0 8px env(safe-area-inset-bottom); background: var(--panel); border-top: var(--border); }
.mm-bottomnav > a, .mm-bottomnav > button { height: 62px; border: 0; background: transparent; font-family: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 700; }
.mm-bottomnav > a.active, .mm-bottomnav > button.active { color: var(--accent); }
.mm-bottomnav-scan { display: flex; justify-content: center; }
.mm-bottomnav-scan a { width: 66px; height: 66px; margin-bottom: 10px; border: 3px solid var(--ink); border-radius: 50%; box-shadow: var(--shadow-sm); background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; }
.mm-bottomnav-scan a.active { transform: translate(2px, 2px); box-shadow: none; }

/* ---------- „Mehr“-Menü (mobil, von unten) ---------- */
.mm-sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .45); }
.mm-sheet { position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; max-height: 85vh; overflow-y: auto; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); background: var(--panel); border-top: var(--border); border-radius: 14px 14px 0 0; box-shadow: 0 -4px 0 var(--ink); animation: mm-sheet-in .18s ease-out; outline: none; }
@keyframes mm-sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .mm-sheet { animation: none; } }
.mm-sheet-nav { display: flex; flex-direction: column; gap: 4px; }
.mm-sheet-nav a { display: flex; align-items: center; gap: .75rem; min-height: 48px; padding: 0 12px; border: 2px solid transparent; border-radius: var(--radius); color: var(--ink); text-decoration: none; font-weight: 700; }
.mm-sheet-nav a.active { background: var(--ink); color: var(--paper); }
.mm-content .mm-sheet-title, .mm-sheet-title { margin: 1rem 12px .4rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.mm-sheet-links, .mm-drawer-help p { display: flex; flex-wrap: wrap; gap: .35rem 1rem; margin: 0 12px; font-size: .9rem; }
.mm-sheet-links a, .mm-drawer-help a { color: var(--indigo); font-weight: 700; }
@media (min-width: 900px) { .mm-sheet, .mm-sheet-backdrop { display: none; } }

/* ---------- Drawer (Desktop) ---------- */
.mm-drawer { display: none; }

@media (min-width: 900px) {
    .mm-bottomnav, .mm-topbar-brand { display: none; }
    .mm-content { padding-bottom: 48px; padding-left: 32px; padding-right: 32px; }
    .mm-topbar { justify-content: flex-end; border-bottom: 0; background: transparent; position: static; }
    .mm-drawer { position: sticky; top: 0; height: 100vh; width: 250px; flex-shrink: 0; display: flex; flex-direction: column; gap: 1.25rem; padding: 20px 14px; background: var(--panel); border-right: var(--border); }
    .mm-drawer .mm-brand { padding: 0 8px; }
    .mm-drawer-nav { display: flex; flex-direction: column; gap: 4px; }
    .mm-drawer-nav a { display: flex; align-items: center; gap: .65rem; min-height: 44px; padding: 0 12px; border: 2px solid transparent; border-radius: var(--radius); color: var(--ink); text-decoration: none; font-weight: 700; }
    .mm-drawer-nav a.active { background: var(--ink); color: var(--paper); }
    .mm-drawer-scan { width: 100%; }
    .mm-drawer-help { padding: 0 8px; font-size: .8rem; }
    .mm-drawer-help strong { display: block; margin-bottom: .3rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
    .mm-drawer-help p { margin: 0; font-size: .85rem; gap: .25rem .75rem; }
    .mm-drawer-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: 0 8px; font-size: .8rem; color: var(--muted); overflow: hidden; }
    .mm-drawer-foot span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

.mm-version { border: 0; background: transparent; color: var(--indigo); font: 700 .8rem var(--font-body); cursor: pointer; text-decoration: underline; padding: 0; }

/* ---------- Hauptaktion einer Seite (#39): am Handy über der unteren Leiste, am Desktop unter der Kopfzeile ---------- */
.mm-page-action { display: flex; justify-content: flex-end; margin: -.25rem 0 1rem; }
@media (max-width: 899px) {
    .mm-page-action { position: fixed; z-index: 29; left: 0; right: 0; bottom: calc(78px + env(safe-area-inset-bottom)); margin: 0; padding: 10px 16px; background: var(--paper); border-top: var(--border); }
    .mm-page-action > .btn { width: 100%; }
    .mm-content:has(.mm-page-action) { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
    body:has(.mm-page-action) .mud-snackbar-location-bottom-center { bottom: calc(150px + env(safe-area-inset-bottom)) !important; }
    body:has(.mm-page-action) .mm-update { bottom: calc(150px + env(safe-area-inset-bottom)); }
}
/* Ohne :has() (iOS < 15.4, Firefox < 121): immer Platz für die Aktionsleiste lassen */
@supports not selector(:has(a)) {
    @media (max-width: 899px) { .mm-content { padding-bottom: calc(150px + env(safe-area-inset-bottom)); } }
}

/* ---------- Seitenkopf & Abschnitte ---------- */
.mm-page-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin: .5rem 0 1rem; }
.mm-page-head h1 { margin: 0; font-size: 1.6rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.mm-section-head { display: flex; justify-content: space-between; align-items: baseline; }
.mm-content h2 { font-size: 1.15rem; margin: 0 0 .6rem; }
.mm-content .mm-h3 { font-size: 1.05rem; }
.mm-stack { display: flex; flex-direction: column; gap: 1.4rem; }
.mm-narrow-col { max-width: 640px; display: flex; flex-direction: column; gap: 1rem; }
.mm-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; }
.mm-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.mm-actions-split { max-width: 640px; }
.mm-actions-split > * { flex: 1 1 140px; }
.mm-small-strong { font-size: .875rem; }

/* ---------- Begrüßung & Kennzahlen ---------- */
.mm-greeting { display: block; margin-bottom: .5rem; padding: 1rem 1.15rem; box-shadow: var(--shadow); }
.mm-greeting strong { font-family: var(--font-head); font-size: 1.35rem; }
.mm-greeting p { margin: .35rem 0 0; }
.mm-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin: .75rem 0; max-width: 640px; }
.mm-stat { display: flex; flex-direction: column; padding: .55rem .75rem; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--panel); color: var(--ink); text-decoration: none; }
.mm-stat strong { font-family: var(--font-head); font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.mm-stat span { font-size: .78rem; color: var(--muted); }
.mm-stat-missing { background: var(--missing); color: var(--on-missing); }
.mm-stat-owned { background: var(--owned); color: var(--on-owned); }
.mm-stat-missing span, .mm-stat-owned span { color: inherit; }
.mm-alert-link { display: flex; align-items: center; gap: .5rem; text-decoration: none; color: #1B1B1F; font-weight: 700; }

/* ---------- Cover ---------- */
.mm-cover {
    --cover-color: var(--indigo);
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    border: 2px solid var(--ink);
    border-radius: 4px;
    box-shadow: var(--shadow-sm);
    background-color: var(--cover-color);
    background-image: radial-gradient(rgba(255, 255, 255, .25) 1.2px, transparent 1.2px);
    background-size: 6px 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-family: var(--font-head);
    font-weight: 800;
    font-size: clamp(1.4rem, 5vw, 2.6rem);
}
.mm-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }
.mm-cover-missing { border-style: dashed; background-color: var(--paper); background-image: radial-gradient(var(--tone) 1.2px, transparent 1.2px); color: var(--ink); box-shadow: none; }
.mm-cover-missing img { opacity: .55; filter: grayscale(.6); }
.mm-cover-xs { width: 34px; font-size: .9rem; box-shadow: none; border-width: 1.5px; }
.mm-cover-sm { width: 64px; font-size: 1.6rem; }
.mm-cover-lg { width: 110px; font-size: 2.6rem; box-shadow: var(--shadow); }
.mm-badge { position: absolute; z-index: 1; right: -8px; top: -9px; padding: 1px 7px; border: 2px solid var(--ink); border-radius: 10px; background: var(--accent); color: var(--on-accent); font: 700 .72rem var(--font-body); font-variant-numeric: tabular-nums; }
.mm-badge-owned { background: var(--owned); color: var(--on-owned); }

/* ---------- Serien-Raster ---------- */
.mm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 18px 14px; }
@media (min-width: 900px) { .mm-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 24px 20px; } }
.mm-series-card { display: flex; flex-direction: column; gap: 6px; color: var(--ink); text-decoration: none; min-width: 0; }
.mm-series-title { font-weight: 700; font-size: .9rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-hscroll { display: grid; grid-auto-flow: column; grid-auto-columns: 96px; gap: 14px; overflow-x: auto; padding: 10px 6px 8px 2px; scroll-snap-type: x mandatory; }
.mm-hscroll > * { scroll-snap-align: start; }
.mm-add-tile { aspect-ratio: 2 / 3; border: 2px dashed var(--ink); border-radius: 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem; color: var(--ink); text-decoration: none; font-weight: 700; font-size: .85rem; }

.mm-progress { height: 8px; border: 1.5px solid var(--ink); border-radius: 5px; background: var(--panel); overflow: hidden; }
.mm-progress-lg { height: 11px; }
.mm-progress > div { height: 100%; }
.mm-bar-owned { background: var(--owned); }
.mm-bar-missing { background: var(--missing); }
.mm-bar-accent { background: var(--accent); }

/* ---------- Suche & Filter ---------- */
.mm-toolbar { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1.25rem; }
.mm-search { display: flex; align-items: center; gap: .5rem; height: 46px; padding: 0 14px; border: var(--border); border-radius: 23px; background: var(--panel); max-width: 520px; }
.mm-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--ink); font: 400 1rem var(--font-body); }
/* Suchfeld (#33): eigener Leeren-Knopf statt des Browser-Kreuzes */
.mm-search input::-webkit-search-cancel-button { display: none; }
.mm-search:focus-within { outline: 2px solid var(--indigo); outline-offset: 2px; }
.mm-search-clear { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-right: -6px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.mm-search-clear:hover, .mm-search-clear:focus-visible { background: var(--tone); color: var(--ink); }
button.mm-chip { cursor: pointer; color: var(--ink); font-family: var(--font-body); min-height: 36px; }
.mm-chip.active { background: var(--ink); color: var(--paper); }

/* ---------- Serien-Detail ---------- */
.mm-series-layout { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.mm-series-info { flex: 1 1 300px; display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.mm-series-volumes { flex: 999 1 420px; min-width: 0; display: flex; flex-direction: column; gap: .9rem; }
.mm-series-meta { display: flex; gap: 1rem; }
.mm-series-facts { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .35rem; }
.mm-series-facts .mm-progress { margin-top: auto; }

.mm-next { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .75rem 1rem; border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow); background-color: var(--accent); color: var(--on-accent); }
.mm-next > div { display: flex; flex-direction: column; }
.mm-next span { font-size: .78rem; font-weight: 700; letter-spacing: .06em; }
.mm-next strong { font-family: var(--font-head); font-size: 1.9rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.mm-next .mm-next-more { text-align: right; letter-spacing: 0; font-weight: 500; }
.mm-next-done { background: var(--owned); color: var(--on-owned); font-family: var(--font-head); font-weight: 800; font-size: 1.2rem; }

.mm-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.mm-tab { flex: 1 1 80px; min-height: 38px; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--panel); color: var(--ink); font: 700 .85rem var(--font-body); font-variant-numeric: tabular-nums; cursor: pointer; }
.mm-tab.active { background: var(--ink); color: var(--paper); }

.mm-volumes { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 8px; }
.mm-vol { height: 42px; display: flex; align-items: center; justify-content: center; border: 2px solid var(--ink); border-radius: 5px; font: 800 .9rem var(--font-head); font-variant-numeric: tabular-nums; cursor: pointer; text-decoration: none; position: relative; }
.mm-vol-owned { background: var(--owned); color: var(--on-owned); }
.mm-vol-owned.read::after { content: ""; position: absolute; right: 3px; top: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--on-owned); }
.mm-vol-gap { background: var(--missing); color: var(--on-missing); }
.mm-vol-next { background: var(--missing); color: var(--on-missing); border: 3px solid var(--accent); }
.mm-vol-notowned { background: transparent; color: var(--muted); border: 1.5px dashed var(--muted); }
/* Angekündigt (#25): gestrichelt wie „noch nicht“, mit Termin darunter */
.mm-vol-announced { background: transparent; color: var(--indigo); border: 1.5px dashed var(--indigo); flex-direction: column; line-height: 1; gap: 2px; }
.mm-vol-date { font: 700 .64rem var(--font-body); letter-spacing: -.03em; }
.mm-vol-add { background: var(--panel); color: var(--ink); border-style: dashed; }
/* Ansicht umschalten (#34) */
.mm-toolbar .mm-view-toggle { margin-left: auto; flex: none; }
.mm-view-row { display: flex; justify-content: flex-end; margin: -.25rem 0 .5rem; }
.mm-vol-sym { font-size: .7rem; margin-right: 1px; opacity: .9; }
.mm-volumes-covers { grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (min-width: 900px) { .mm-volumes-covers { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); } }
.mm-volumes-covers .mm-vol { height: auto; aspect-ratio: 2 / 3; padding: 0; overflow: hidden; align-items: flex-end; justify-content: flex-start; background: var(--panel); }
.mm-volumes-covers .mm-cover-text { font-size: clamp(1rem, 7vw, 2rem); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
@media (min-width: 900px) { .mm-volumes-covers .mm-cover-text { font-size: 1.8rem; } }
.mm-volumes-covers .mm-vol > .mm-cover { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; box-shadow: none; border-radius: 0; }
.mm-volumes-covers .mm-vol-sym, .mm-volumes-covers .mm-vol-num { position: relative; z-index: 1; }
.mm-volumes-covers .mm-vol-sym { margin: 0 0 4px 4px; padding: 1px 4px; border-radius: 4px 0 0 4px; background: var(--ink); color: var(--paper); font-size: .72rem; }
.mm-volumes-covers .mm-vol-num { margin: 0 0 4px; padding: 1px 5px; border-radius: 4px; background: var(--ink); color: var(--paper); font-size: .78rem; }
.mm-volumes-covers .mm-vol-sym + .mm-vol-num { border-radius: 0 4px 4px 0; }
.mm-volumes-covers .mm-vol-gap, .mm-volumes-covers .mm-vol-next { outline: 3px solid var(--missing); outline-offset: -3px; }
.mm-volumes-covers .mm-vol-next { outline-color: var(--accent); }
.mm-volumes-covers .mm-vol-owned { outline: 3px solid var(--owned); outline-offset: -3px; }
.mm-volumes-covers .mm-vol.lent::after, .mm-volumes-covers .mm-vol.read::after { z-index: 2; }
.mm-series-list .mm-list-main .mm-small + .mm-small { margin-top: 1px; }
.mm-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .78rem; color: var(--muted); }
.mm-legend span { display: inline-flex; align-items: center; gap: 5px; }
.mm-legend i { width: 13px; height: 13px; border-radius: 3px; display: inline-block; }

/* ---------- Scannen ---------- */
.mm-segmented { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; max-width: 640px; border: var(--border); border-radius: 8px; overflow: hidden; background: var(--panel); margin-bottom: 1rem; }
.mm-segmented button { min-height: 42px; border: 0; border-left: var(--border); background: transparent; color: var(--ink); font: 700 .95rem var(--font-body); cursor: pointer; }
.mm-segmented button:first-child { border-left: 0; }
.mm-segmented button.active { background: var(--ink); color: var(--paper); }

.mm-camera { position: relative; height: 240px; max-width: 640px; border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow); background: #0E0E12; overflow: hidden; display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; }
.mm-camera-compact { height: 160px; }
.mm-camera video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mm-camera-frame { position: relative; width: min(260px, 75%); height: 46%; border: 3px solid var(--accent); border-radius: 8px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .28); display: flex; align-items: center; justify-content: center; }
.mm-camera-frame span { width: 88%; height: 3px; background: var(--accent); box-shadow: 0 0 12px var(--accent); animation: mm-scanline 1.6s ease-in-out infinite alternate; }
@keyframes mm-scanline { from { transform: translateY(-14px); } to { transform: translateY(14px); } }
.mm-camera-hint { position: absolute; bottom: 8px; left: 0; right: 0; margin: 0; text-align: center; font-size: .82rem; color: #E8E4DC; }
.mm-camera-error { position: relative; display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 1rem; text-align: center; color: #E8E4DC; }
.mm-camera-torch { position: absolute; top: 8px; right: 8px; }
.mm-camera[hidden] { display: none !important; }
/* Scan-Modi (#31): am Handy flache Kamera (höchstens ein Drittel der Höhe), Erklärsatz, Preis je Band, Summe */
@media (max-width: 600px) { .mm-scan-flat .mm-camera { height: min(160px, 33vh); } }
.mm-mode-hint { margin: .4rem 0 .6rem; }
.mm-camera-toggle { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem 0; margin-bottom: .3rem; }
.mm-price-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .4rem; padding-left: 2.2rem; }
.mm-price-row label { font-size: .85rem; font-weight: 600; }
.mm-price-input { width: 6.5rem; padding: .3rem .5rem; }
.mm-price-hint { flex-basis: 100%; }
.mm-purchase-total { margin: 0 0 .5rem; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
/* Mehrere fotografieren (#36) */
.mm-batch-shoot h2 { font-size: 1.15rem; margin-bottom: .1rem; }
.mm-batch-controls { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin: .9rem 0; }
.mm-shutter { width: 72px; height: 72px; border-radius: 50%; border: 4px solid var(--ink); background: var(--panel); display: grid; place-items: center; cursor: pointer; flex: none; }
.mm-shutter span { width: 52px; height: 52px; border-radius: 50%; background: var(--accent); }
.mm-shutter:active span { transform: scale(.92); }
.mm-shutter:disabled { opacity: .5; }
.mm-batch-saved { display: flex; align-items: center; gap: .6rem; font-weight: 700; color: var(--owned); }
.mm-batch-saved img { width: 44px; height: 60px; object-fit: cover; border-radius: 4px; border: 2px solid var(--ink); }
.mm-batch-select .mm-check { width: 100%; }
.mm-batch-hint { color: var(--accent); }
.mm-camera-ask small { font-size: .78rem; opacity: .85; max-width: 32rem; }
.mm-camera-badge { position: absolute; top: 8px; left: 8px; padding: 2px 9px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: .75rem; font-weight: 700; }

.mm-isbn { display: flex; gap: .5rem; max-width: 640px; margin-bottom: 1rem; }
.mm-isbn-field { flex: 1; min-width: 0; display: flex; align-items: center; gap: .5rem; height: 46px; padding: 0 12px; border: 2px dashed var(--accent); border-radius: var(--radius); background: var(--panel); color: var(--muted); }
.mm-isbn-field input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--ink); font: 400 1rem var(--font-body); }

.mm-content .mm-result { max-width: 640px; margin-bottom: .9rem; }
.mm-result-head { display: flex; align-items: center; gap: .6rem; }
.mm-result-unknown { background: var(--ink); color: var(--paper); }
.mm-result-unknown-body { flex-direction: column; align-items: flex-start; }
.mm-result-unknown-body .mm-bubble { margin: .25rem 0 .75rem; background: var(--paper); }
.mm-pop { animation: mm-pop .28s ease-out; }
@keyframes mm-pop { from { transform: scale(.94); opacity: .4; } to { transform: none; opacity: 1; } }

.mm-purchase-setup { padding: 1.25rem; max-width: 640px; }
.mm-purchase-setup h2 { margin-top: 0; }
.mm-purchase-strip { display: flex; align-items: center; gap: .75rem; padding: .7rem .9rem; max-width: 640px; margin-bottom: .5rem; }
.mm-purchase-strip > div { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.mm-sticky-actions { position: sticky; bottom: calc(96px + env(safe-area-inset-bottom)); max-width: 640px; padding-top: .75rem; }
@media (min-width: 900px) { .mm-sticky-actions { bottom: 16px; } }

/* ---------- Listen ---------- */
.mm-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-width: 760px; }
.mm-list-item { display: flex; align-items: center; gap: .75rem; padding: .5rem .75rem; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--panel); color: var(--ink); text-decoration: none; }
.mm-list-item.undone { opacity: .45; }
.mm-list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; color: var(--ink); text-decoration: none; }
.mm-list-main strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-list-group { margin-top: .75rem; font-family: var(--font-head); font-weight: 800; }
.mm-num { font-family: var(--font-head); font-weight: 800; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.mm-queue { max-width: 640px; }
.mm-dot { width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; font-weight: 800; }
.mm-dot-added { background: var(--owned); color: var(--on-owned); }
.mm-dot-alreadyowned { background: var(--paper); }
.mm-dot-unknown, .mm-dot-invalid { background: var(--missing); color: var(--on-missing); }
.mm-dot-waiting, .mm-dot-undone { background: var(--panel); color: var(--muted); border-style: dashed; }

/* ---------- Formular-Ergänzungen ---------- */
.mm-autocomplete { position: relative; }
.mm-suggest { position: absolute; z-index: 10; top: 100%; left: 0; right: 0; margin: 4px 0 0; padding: 4px; list-style: none; border: var(--border); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); max-height: 260px; overflow-y: auto; }
.mm-suggest button { width: 100%; padding: .55rem .6rem; border: 0; border-radius: 4px; background: transparent; color: var(--ink); text-align: left; font: 400 .95rem var(--font-body); cursor: pointer; display: flex; flex-direction: column; }
.mm-suggest button:hover, .mm-suggest button:focus { background: var(--tone); }
button.btn-link { border: 0; background: none; padding: 0; color: var(--indigo); font: inherit; cursor: pointer; text-decoration: underline; min-height: 0; }
textarea.form-control { min-height: 72px; resize: vertical; }

/* ---------- Dialoge (MudBlazor) im Panel-Stil ---------- */
.mm-dialog-head { display: flex; gap: .9rem; align-items: center; margin-bottom: .75rem; }
.mm-dialog-head > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mud-dialog.mud-dialog { border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow); background: var(--panel); color: var(--ink); }
.mud-dialog .mud-dialog-title { font-family: var(--font-head); font-weight: 800; }
.mud-dialog .mud-dialog-actions { gap: .5rem; flex-wrap: wrap; }
@media (max-width: 600px) { .mud-dialog-container { padding-top: var(--mm-top-safe); } }

/* Foto-Sheet (#78): bildschirmfüllend, Kopfzeile mit Band, Knöpfe fest unten, Zuschneide-Fläche ohne Seiten-Gesten */
.mm-photo-sheet { position: fixed; inset: 0; z-index: 2100; display: flex; flex-direction: column; height: 100vh; height: 100dvh; background: var(--paper); overscroll-behavior: contain; }
.mm-photo-sheet-head { display: flex; align-items: center; gap: .5rem; padding: var(--mm-top-safe) 16px 10px; background: var(--panel); border-bottom: var(--border); }
.mm-photo-sheet-head h2 { flex: 1; min-width: 0; margin: 0; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; outline: none; }
.mm-photo-sheet-body { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 12px 16px 0; overflow: auto; overscroll-behavior: contain; }
.mm-photo-sheet-body .mm-capture { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: .6rem; }
.mm-photo-sheet-body .mm-corner-stage, .mm-photo-sheet-body .mm-crop { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.mm-photo-sheet-body .mm-corner-stage img, .mm-photo-sheet-body .mm-crop img { max-width: 100%; max-height: 100%; object-fit: contain; }
.mm-photo-sheet-body .mm-capture-actions { position: sticky; bottom: 0; margin: 0 -16px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--panel); border-top: var(--border); flex-wrap: wrap; }
.mm-photo-sheet-body .mm-cover-preview { max-height: 38vh; }
.mm-corner-stage, .mm-crop, .mm-corner-stage *, .mm-crop * { touch-action: none; }
.mm-photo-sheet-confirm { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .45); }
.mm-photo-sheet-confirm .mm-panel { max-width: 360px; width: 100%; padding: 1rem; }
/* Meldungen über dem Foto-Sheet (#78, z-index 2100) */
[class*="mud-snackbar-location"] { z-index: 2300 !important; }
.mud-snackbar.mud-snackbar { border: 2px solid var(--ink); font-family: var(--font-body); font-weight: 700; }
.mm-changelog section { margin-bottom: 1rem; }
.mm-changelog h3 { margin: 0; display: flex; align-items: center; gap: .5rem; }
.mm-changelog ul { margin: .25rem 0 0; padding-left: 1.2rem; }

/* ---------- Update- und Installationshinweis ---------- */
.mm-update { position: fixed; z-index: 1400; right: 16px; left: 16px; bottom: calc(96px + env(safe-area-inset-bottom)); max-width: 420px; margin-left: auto; overflow: hidden; }
@media (min-width: 900px) { .mm-update { bottom: 24px; } }
.mm-update-head { display: flex; align-items: center; gap: .5rem; padding: .7rem 1rem; background-color: var(--indigo); color: var(--on-indigo); }
.mm-update ul { margin: .6rem 0; padding: 0 1rem 0 2.2rem; font-size: .9rem; }
.mm-update-actions { display: flex; gap: .5rem; justify-content: flex-end; padding: 0 1rem .9rem; }
.mm-updating { position: fixed; inset: 0; z-index: 99999; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; background: var(--paper); font-weight: 700; }
.mm-updating img { animation: mm-bob 1.2s ease-in-out infinite; }

.mm-install { display: flex; align-items: center; gap: .75rem; max-width: 640px; padding: .6rem .75rem; border: 2px dashed var(--indigo); border-radius: var(--radius); background: var(--panel); }
.mm-install > span { flex: 1; font-size: .9rem; }
.mm-install-icon { color: var(--indigo); }
.mm-install-btn { background: var(--indigo); color: var(--on-indigo); min-height: 36px; border-width: 2px; }
.mm-install .mm-iconbtn { width: 34px; height: 34px; border-width: 0; background: transparent; }

/* ---------- Leer- und Ladezustände ---------- */
.mm-empty { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 2.5rem 0; text-align: center; }
.mm-empty .mm-bubble { max-width: 460px; }
.mm-loading { display: flex; align-items: center; justify-content: center; gap: .75rem; padding: 2rem 0; color: var(--muted); font-weight: 700; }
.mm-loading img { animation: mm-bob 1.2s ease-in-out infinite; }

/* Titelsuche im Prüfmodus */
.mm-hits { max-width: 640px; margin-top: .75rem; }
.mm-hit .mm-cover-xs { flex: none; }
.mm-hit-next { flex: none; display: flex; flex-direction: column; align-items: flex-end; font: 800 1.35rem/1 var(--font-head); color: var(--accent); font-variant-numeric: tabular-nums; }
.mm-hit-next small { font: 500 .7rem var(--font-body); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.mm-hit-done { color: var(--owned); }
.mm-hit-empty { max-width: 460px; margin: .5rem auto; }

/* Katalogsuche (DNB) */
.mm-section-title { font: 800 1rem var(--font-head); margin: 1.25rem 0 .25rem; max-width: 640px; }
.mm-catalog-button { display: inline-flex; align-items: center; gap: .4rem; margin: .75rem 0; max-width: 100%; white-space: normal; text-align: left; }
.mm-hit-empty .mm-catalog-button { margin: .5rem 0 0; }
.mm-candidate { flex-wrap: wrap; }
.mm-candidate-actions { display: flex; align-items: center; gap: .4rem; margin-left: auto; }
.mm-candidate-actions .btn { min-height: 38px; padding: 0 .8rem; }
.mm-candidate-actions .mm-iconbtn { width: 38px; height: 38px; }
.mm-wished { display: inline-flex; width: 38px; height: 38px; align-items: center; justify-content: center; color: var(--accent); }
.mm-wished svg { fill: currentColor; }
@media (max-width: 480px) { .mm-candidate-actions { width: 100%; justify-content: flex-end; } }

/* Serien-Detail: mehrere Bände auf einmal */
.mm-range { margin: 1rem 0; padding: .75rem 1rem; border: 2px dashed var(--ink); border-radius: var(--radius); background: var(--panel); }
.mm-range summary { cursor: pointer; font-weight: 700; }
.mm-range-form { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin: .75rem 0 .25rem; }
.mm-range-form label { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; }
.mm-range-form input { width: 5.5rem; }
.mm-range .mm-small { margin: .25rem 0 0; }

/* Admin: Katalog-Import */
.mm-import-list { width: 100%; font: 400 .9rem/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; margin: .5rem 0; }
.mm-import-log { margin-top: .75rem; max-height: 60vh; overflow: auto; }

/* Eigene Cover: Einreichen (Band-Dialog) und Freigabe (Admin) */
.mm-cover-submit { margin: .75rem 0; padding: .6rem .8rem; border: 2px dashed var(--ink); border-radius: var(--radius); }
.mm-cover-submit summary { cursor: pointer; font-weight: 700; }
.mm-cover-submit .btn-primary { margin-top: .5rem; }
.mm-cover-submit-row { display: flex; align-items: center; gap: .75rem; margin: .5rem 0; }
.mm-cover-preview { width: 72px; aspect-ratio: 2 / 3; object-fit: cover; border: 2px solid var(--ink); border-radius: 4px; }
.mm-review-list { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.mm-review-head { display: flex; flex-direction: column; gap: .15rem; margin-bottom: .5rem; }
.mm-review-head a { color: var(--ink); }
.mm-review-images { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.mm-review-images figure { margin: 0; text-align: center; }
.mm-review-images img, .mm-review-none { width: 100%; aspect-ratio: 2 / 3; object-fit: contain; background: var(--paper); border: 2px solid var(--ink); border-radius: 4px; }
.mm-review-none { display: flex; align-items: center; justify-content: center; color: var(--muted); }
.mm-review-images figcaption { font-size: .8rem; color: var(--muted); margin-top: .25rem; }

/* Cover fotografieren & zuschneiden */
.mm-capture { display: flex; flex-direction: column; gap: .6rem; }
.mm-capture-prompt { margin: 0; font-weight: 700; }
.mm-capture-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.mm-capture-actions .btn { display: inline-flex; align-items: center; gap: .35rem; }
.mm-crop { max-height: 60vh; background: var(--ink); border-radius: var(--radius); overflow: hidden; }
.mm-crop img { display: block; max-width: 100%; }
.mm-capture-confirm { display: flex; gap: .9rem; align-items: flex-start; }
.mm-capture-confirm .mm-cover-preview { width: 96px; flex: none; }
.mm-capture-thanks { margin: 0; color: var(--owned); font-weight: 700; }
.mm-capture.compact .mm-capture-prompt { font-size: .95rem; }
.mm-cover-help { border: 2.5px solid var(--ink); border-radius: var(--radius); background: var(--panel); padding: .9rem 1rem; box-shadow: 4px 4px 0 var(--ink); margin: 1rem 0; }
.mm-cover-help h2 { font: 800 1.05rem var(--font-head); margin: 0 0 .35rem; }
/* Meine Beiträge (#22) */
.mm-badges { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.mm-badge-item { display: flex; gap: .75rem; align-items: flex-start; padding: .6rem .8rem; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--panel); }
.mm-badge-item.open { border-style: dashed; opacity: .7; }
.mm-badge-icon { font-size: 1.4rem; line-height: 1; color: var(--accent); flex: none; width: 1.6rem; text-align: center; }
.mm-badge-item.open .mm-badge-icon { color: var(--muted); }
.mm-coverage { margin-top: .4rem; }
.mm-coverage .mm-progress { height: 6px; }
.mm-bar-cover { height: 100%; background: var(--indigo); }
.mm-coverage-own { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .6rem 0; }
/* Unterstützen (#37) */
.mm-support-card { position: relative; padding-right: 3rem; }
.mm-support-close { position: absolute; top: 2px; right: 2px; width: 44px; height: 44px; border: 0; background: none; color: var(--ink); font-size: 1.6rem; line-height: 1; cursor: pointer; border-radius: var(--radius); }
.mm-support-close:hover { background: var(--tone); }
.mm-changelog-support { margin-top: 1rem; color: var(--muted); }
.mm-changelog-support a { color: inherit; text-decoration: underline; }
.mm-help-stats { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: .25rem 0 .75rem; font-size: .9rem; color: var(--muted); }
.mm-help-stats strong { color: var(--ink); font-size: 1.1rem; }
.mm-help-item { flex-direction: column; align-items: stretch; }
.mm-help-item-head { display: flex; align-items: center; gap: .75rem; }
.mm-help-teaser { display: flex; align-items: center; gap: .9rem; color: var(--ink); text-decoration: none; }
.mm-help-teaser > span { display: flex; flex-direction: column; gap: .15rem; }
.mm-help-teaser svg { flex: none; color: var(--accent); }
/* Nutzer helfen Nutzern (#4) */
.mm-help-card { margin: 0; }
.mm-help-card h2 { display: flex; align-items: center; gap: .5rem; }
.mm-help-card h2 svg { color: var(--accent); flex: none; }
.mm-help-card p { margin: 0 0 .7rem; }
.mm-community-new h2 { margin-bottom: .1rem; }
.mm-community-new > .mm-small { margin: 0; }
.mm-my-contribution { font-weight: 600; }

/* Cover entzerren: Ecken verschieben */
.mm-corner-stage { position: relative; align-self: center; max-width: 100%; line-height: 0; background: var(--ink); border-radius: var(--radius); }
.mm-corner-stage img { display: block; max-width: 100%; max-height: 65vh; border-radius: var(--radius); }
.mm-corners { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.mm-corners polygon { fill: rgba(214, 40, 57, .18); stroke: #D62839; stroke-width: 0.6%; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.mm-corners circle { fill: #fff; stroke: #D62839; stroke-width: 3; vector-effect: non-scaling-stroke; }

/* Serie + Bandnummer: Nummer nie abschneiden */
.mm-volume-label { display: flex; align-items: baseline; gap: .4rem; min-width: 0; white-space: normal !important; overflow: visible !important; }
.mm-volume-label-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-volume-no { flex: none; padding: 0 .4rem; border: 2px solid var(--ink); border-radius: 6px; background: var(--paper); font: 800 .9rem var(--font-head); font-variant-numeric: tabular-nums; }
.mm-review-volume { display: flex; align-items: center; gap: .6rem; }
.mm-review-volume .mm-volume-no { font-size: 1.3rem; padding: .1rem .55rem; background: var(--accent); color: #fff; border-color: var(--ink); }
.mm-corners circle.active { fill: #D62839; stroke: #fff; }
.mm-loupe { position: fixed; z-index: 2200; width: 120px; height: 120px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px #D62839, 0 4px 14px rgba(0,0,0,.45); pointer-events: none; }

/* Zustimmung zu neuen Nutzungsbedingungen (TermsGate) */
.mm-terms-gate { position: fixed; inset: 0; z-index: 1500; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(27,27,31,.6); }
.mm-terms-gate .mm-card { max-width: 480px; width: 100%; max-height: 100%; overflow: auto; }

/* Am Handy über der unteren Leiste, sonst verdeckt der Scan-Knopf den Text */
@media (max-width: 899px) { .mud-snackbar-location-bottom-center { bottom: calc(84px + env(safe-area-inset-bottom)) !important; } }

/* Link in Fehlermeldungen („Anmelden“, „Kontakt“ – #40) */
.mm-snackbar-link { color: inherit; font-weight: 800; text-decoration: underline; }

/* ---------- Verleihen (#17) ---------- */
.mm-vol.lent { position: relative; }
.mm-vol.lent::after { content: ""; position: absolute; top: 3px; right: 3px; width: 9px; height: 9px; border-radius: 50%; background: var(--indigo); border: 1.5px solid var(--panel); }
.mm-vol.overdue::after { background: var(--accent); }
.mm-volumes.selecting .mm-vol:disabled { opacity: .35; cursor: not-allowed; }
.mm-vol.selected { outline: 3px solid var(--accent); outline-offset: 2px; }
.mm-select-start { margin: 0 0 .5rem; padding-left: 0; }
.mm-select-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .75rem; padding: .5rem .75rem; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--panel); }
.mm-select-bar > span { flex: 1 1 100%; font-size: .9rem; }
.mm-lent-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin: .75rem 0; padding: .5rem .75rem; border: 2px dashed var(--indigo); border-radius: var(--radius); }
.mm-lent-box.overdue { border-color: var(--accent); }
.mm-lent-box > span { display: inline-flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.mm-overdue { color: var(--accent); font-weight: 800; }
.mm-overdue-item { border-color: var(--accent); }
.mm-lent-note { display: inline-flex; align-items: center; gap: .3rem; color: var(--indigo); font-weight: 700; }
.mm-loan-tabs { margin-bottom: 1rem; max-width: 420px; }
.mm-contact-edit { display: flex; flex-wrap: wrap; gap: .5rem; width: 100%; }
.mm-contact-edit .form-control { flex: 1 1 140px; }
