/* MiruRead — Édition. Presentation layer; existing view and reader contracts stay intact. */
:root {
    --bg: #181917;
    --bg-soft: #1e1f1c;
    --bg-deep: #121310;
    --bg-reader: #10110f;
    --surface: #232420;
    --surface-solid: #232420;
    --surface-soft: #292a25;
    --surface-light: #30312b;
    --surface-hover: #33342e;
    --surface-active: #393b32;
    --surface-overlay: rgba(24, 25, 23, .96);
    --surface-glass: rgba(35, 36, 32, .96);
    --text: #f0eee6;
    --text-soft: #c2c1b5;
    --text-muted: #a1a294;
    --text-faint: #878a7b;
    --text-inverse: #181917;
    --accent: #c4896c;
    --accent-hover: #d79e80;
    --accent-active: #b3785c;
    --accent-light: #dfac8f;
    --accent-dark: #79513e;
    --accent-rgb: 196, 137, 108;
    --accent-blue-rgb: 150, 163, 139;
    --accent-gradient: linear-gradient(120deg, #bc8063, #c99173);
    --accent-gradient-hover: linear-gradient(120deg, #ce9275, #d6a183);
    --accent-gradient-wide: var(--accent-gradient);
    --accent-gradient-muted: rgba(196, 137, 108, .12);
    --accent-border: rgba(196, 137, 108, .32);
    --border-accent: var(--accent-border);
    --purple: #c4896c;
    --purple-light: #dfac8f;
    --indigo: #ad987c;
    --blue: #97aaa4;
    --success: #a7b99a;
    --success-soft: rgba(167, 185, 154, .12);
    --success-border: rgba(167, 185, 154, .3);
    --heart: #d3947d;
    --border: rgba(234, 232, 215, .12);
    --border-soft: rgba(234, 232, 215, .07);
    --border-strong: rgba(234, 232, 215, .23);
    --sidebar-width: 224px;
    --content-padding: clamp(24px, 2.6vw, 64px);
    --section-gap: 44px;
    --radius-xs: 5px;
    --radius-sm: 7px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 18px;
    --shadow-purple: 0 12px 30px #0003;
    --accent-glow: 0 8px 24px #0002;
    --paper: #e8e4d8;
    --paper-ink: #282c25;
    --editorial-font: Georgia, "Times New Roman", serif;
}

body { background: var(--bg); }
body::before, .ambient-orb, .spotlight, .page-particles, .noise { display: none; }
.app-shell, .main-content, .container { max-width: none; }
.skip-link { position: fixed; top: -100px; left: 24px; z-index: var(--z-toast); padding: 12px 20px; background: var(--paper); color: var(--paper-ink); }
.skip-link:focus { top: 12px; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline-color: var(--accent-light); }

/* A legible desktop navigation, with all original destinations. */
.sidebar { align-items: stretch; padding: 30px 18px 24px; background: #151612; box-shadow: none; backdrop-filter: none; }
.brand-mark { display: flex; width: 100%; height: 48px; gap: 10px; padding: 0 9px; border: 0; background: transparent; box-shadow: none; overflow: visible; border-radius: 6px; }
.brand-mark:hover { background: transparent; transform: none; }
.brand-logo-img { width: 36px; height: 36px; border-radius: 8px; }
.brand-wordmark { font-size: 22px; font-weight: 740; letter-spacing: -1px; }
.brand-wordmark span { color: var(--accent-light); }
.sidebar-caption { padding: 36px 12px 12px; color: var(--text-muted); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; }
.sidebar-nav { justify-content: flex-start; gap: 5px; }
.nav-item { justify-content: flex-start; gap: 13px; height: 46px; padding: 0 12px; border-radius: 7px; color: var(--text-soft); }
.nav-item svg { width: 18px; height: 18px; stroke-width: 1.6; }
.sidebar .nav-tooltip { position: static; display: inline; padding: 0; border: 0; background: none; box-shadow: none; opacity: 1; visibility: visible; transform: none; color: inherit; font-size: 12px; font-weight: 500; }
.nav-item:hover { transform: none; background: #ffffff07; }
.nav-item.active { background: #e8e4d811; border-color: #e8e4d815; color: var(--paper); }
.nav-item.active::before { left: -19px; width: 2px; background: var(--accent); }
.sidebar-note { margin: 24px 10px; padding-top: 22px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 11px; line-height: 1.8; }
.sidebar-note strong { display: block; color: var(--text-soft); font-family: var(--editorial-font); font-size: 19px; font-weight: 400; }
.profile-button { align-self: flex-start; margin-left: 10px; width: 40px; height: 40px; border-radius: 50%; background: #464b3d; box-shadow: none; border-color: #ffffff20; }
.profile-button span { border-radius: 50%; background: #2c3026; }
.top-header { min-height: 92px; margin-bottom: 0; border-bottom: 1px solid var(--border); background: var(--bg); backdrop-filter: none; }
.welcome-small { font-size: 11px; color: var(--text-muted); }
.welcome-text strong { font-size: 14px; font-weight: 550; }
.search-box { max-width: 460px; background: #22231f; border-radius: 7px; box-shadow: none; }
.search-box input { font-size: 12px; background: var(--surface-solid); border-radius: 7px; }
.search-box input:focus { background: var(--surface-soft); }
.search-shortcut { border-radius: 4px; background: #30312b; color: var(--text-soft); }
.header-action, .icon-btn { border-radius: 7px; background: var(--surface-solid); box-shadow: none; }
.edition-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 32px 0 26px; }
.edition-eyebrow { display: block; color: var(--text-muted); text-transform: uppercase; letter-spacing: .17em; font-size: 10px; font-weight: 600; }
.edition-heading h2 { margin-top: 6px; font: 400 clamp(28px, 3vw, 44px)/1.1 var(--editorial-font); letter-spacing: -.045em; }
.edition-date { color: var(--text-muted); font-size: 12px; text-align: right; }

/* An ivory feature spread: the cover remains the real, interactive 3D book. */
.hero { min-height: 450px; grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr); background: var(--paper); color: var(--paper-ink); border: 0; border-radius: 12px; box-shadow: none; }
.hero::before { display: none; }
.hero::after { z-index: -1; inset: 0 0 0 57%; background: repeating-linear-gradient(90deg, transparent 0, transparent 83px, #282c2509 83px, #282c2509 84px); }
.hero-content { max-width: none; padding: clamp(28px, 4vw, 65px); }
.hero-kicker { padding: 0; border: 0; border-radius: 0; background: transparent; color: #75503c; font-size: 10px; letter-spacing: .15em; margin-bottom: 23px; }
.hero-kicker::before { width: 20px; height: 1px; border-radius: 0; background: #75503c; animation: none; }
.hero h1 { max-width: 100%; color: var(--paper-ink); font: 400 clamp(38px, 4.5vw, 80px)/.98 var(--editorial-font); letter-spacing: -.055em; overflow-wrap: anywhere; }
.hero h1 span { display: inline; padding: 0; background: none; color: inherit; -webkit-text-fill-color: currentColor; }
.hero-description { max-width: 520px; margin-top: 24px; color: #5c6055; font-size: 13px; line-height: 1.8; }
.hero-meta { gap: 0; margin-top: 25px; }
.hero-meta span { padding: 0 12px; border: 0; border-right: 1px solid #282c2530; border-radius: 0; background: none; color: #555b4e; font-size: 11px; }
.hero-meta span:first-child { padding-left: 0; }
.hero-meta span:last-child { border-right: 0; }
.hero-actions { margin-top: 28px; gap: 10px; }
.primary-button, .play-btn, .login-btn, .catalog-download-btn { border-radius: 7px; box-shadow: none; background: var(--accent); color: #1d201a; text-shadow: none; }
.primary-button:hover, .play-btn:hover, .login-btn:hover, .catalog-download-btn:hover { background: var(--accent-hover); box-shadow: 0 7px 18px #0002; }
.hero .primary-button { background: #30372b; color: #f2efe3; font-size: 12px; min-height: 46px; padding: 13px 20px; }
.hero .primary-button:hover { background: #434c3c; }
.hero .secondary-button { border: 1px solid #282c2535; background: transparent; color: #3d4436; font-size: 12px; border-radius: 7px; }
.hero #hero-fav-btn.selected { color: #714932; background: #c4896c20; }
.hero :focus-visible { outline-color: #79513e; }
.hero-visual { min-height: 450px; padding: 42px 32px 62px; }
.hero-visual::before { content: ""; position: absolute; bottom: 31px; left: 14%; width: 72%; height: 55px; background: #c5c2b5; border: 1px solid #b9b7aa; border-radius: 50%; transform: rotateX(62deg); box-shadow: 0 18px 26px #252c2525; }
.hero-visual::after { content: "UNE PAGE APRÈS L’AUTRE"; position: absolute; bottom: 22px; color: #6a6d60; font-size: 8px; letter-spacing: .25em; }
.floating-ring { display: none; }
.book-scene { width: clamp(170px, 16vw, 235px); animation: none; }
.book-scene::after { background: #20261bb3; animation: none; }
.book-cover { border-radius: 3px 8px 8px 3px; background: #4e5945; box-shadow: -18px 24px 30px #1c211b38, inset 3px 0 5px #ffffff20; }
.book-cover::before { background: linear-gradient(110deg, #ffffff20, transparent 25%, transparent 75%, #00000008); }
.book-spine { background: linear-gradient(90deg, #343a30, #6e765c); }
.book-back { background: #343a30; }
.book-pages { border-radius: 2px 5px 5px 2px; background: repeating-linear-gradient(0deg, #c4c0ac 0, #c4c0ac 1px, #f1eddd 1px, #f1eddd 3px); }
.book-info small { color: #ece6d1; }
.book-info h2 { font-family: var(--editorial-font); font-weight: 400; letter-spacing: -.025em; }
.edition-jumps { display: flex; align-items: stretch; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.edition-jumps button { display: flex; align-items: center; gap: 12px; flex: 1; padding: 19px 0; background: none; cursor: pointer; color: var(--text-soft); text-align: left; font-size: 12px; }
.edition-jumps button + button { border-left: 1px solid var(--border); padding-left: 24px; }
.edition-jumps button:hover { color: var(--accent-light); }
.edition-jumps span { color: var(--text-muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.edition-jumps b { margin-left: auto; margin-right: 24px; font-size: 17px; font-weight: 400; }

/* Shelves and reading cards use tighter geometry and quiet, physical shadows. */
.content-section { margin-top: var(--section-gap); }
.section-header { margin-bottom: 20px; align-items: end; }
.section-heading small { color: var(--text-muted); font-size: 9px; letter-spacing: .16em; }
.section-heading h2 { font-family: var(--editorial-font); font-size: clamp(24px, 2vw, 33px); font-weight: 400; letter-spacing: -.035em; }
.section-link { color: var(--text-soft); font-size: 11px; }
.section-link:hover { color: var(--accent-light); }
.manga-grid, #series-grid { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 24px 20px; }
.manga-card-inner, .card-inner { border-radius: 4px 9px 9px 4px; border-color: #ffffff18; box-shadow: 3px 4px 0 #aaa58e40, 6px 7px 0 #080a0766, 0 15px 24px #0003; }
.manga-card:hover .manga-card-inner, .card:hover .card-inner { border-color: #dedac34d; box-shadow: 4px 5px 0 #aaa58e50, 0 22px 30px #0005; }
.manga-card-inner::after, .card-inner::after { content: ""; position: absolute; inset: 0 auto 0 4px; width: 4px; background: linear-gradient(90deg, #0003, #ffffff15); pointer-events: none; z-index: var(--z-card-overlay); }
.manga-shine { display: none; }
.manga-overlay, .card-overlay { padding: 55px 13px 14px; background: linear-gradient(0deg, #11140ffa, #11140fb3 40%, transparent 90%); }
.manga-overlay h3, .card-overlay h3 { font-size: 13px; font-weight: 600; }
.manga-status, .card-overlay .status { color: #c9ceb7; }
.manga-badge { border-radius: 4px; }
.continue-grid { gap: 14px; }
.continue-card { min-height: 135px; padding: 16px; border-radius: 9px; background: var(--surface-solid); box-shadow: none; }
.continue-card::before { display: none; }
.continue-card:hover { background: var(--surface-soft); border-color: var(--border-strong); box-shadow: 0 8px 20px #0002; }
.continue-cover { border-radius: 3px 6px 6px 3px; box-shadow: 3px 3px 0 #e8e4d826; }
.continue-info small { color: var(--text-muted); }
.progress-fill, .storage-bar-fill { background: #b1b89c; }
.library-toolbar { padding: 14px; background: var(--surface-solid); border: 1px solid var(--border); border-radius: 9px; gap: 12px; }
.search-bar, .sort-select, .mode-select, .action-select { border-radius: 6px; background: var(--bg-soft); box-shadow: none; }
.search-bar:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-subtle); }
.density-switch { display: flex; align-items: center; padding: 3px; border: 1px solid var(--border); border-radius: 6px; flex: 0 0 auto; }
.density-switch button { display: grid; place-items: center; width: 38px; min-height: 36px; padding: 7px; border-radius: 4px; background: transparent; color: var(--text-muted); cursor: pointer; }
.density-switch button[aria-pressed="true"] { color: var(--text); background: #e8e4d815; }
.density-switch svg { width: 19px; height: 19px; }
body[data-shelf-density="compact"] #series-grid { grid-template-columns: repeat(auto-fill, minmax(125px, 1fr)); gap: 22px 16px; }

/* Activity, discovery, series detail and management use the same materials. */
.activity-panel, .stat-card, .chart-subcard, .queue-item, .storage-disk-card, .storage-series-item, .catalog-card { background: var(--surface-solid); border-color: var(--border); border-radius: 10px; box-shadow: none; }
.activity-panel::before, .stat-card::before, .stat-card::after { display: none; }
.stat-icon { background: #b1b89c14; color: #c0c8aa; border-radius: 8px; }
.stat-value { font-weight: 500; letter-spacing: -.05em; }
.chart-layout-switch, .chart-view-btn { border-radius: 5px; }
.chart-view-btn.active { background: #ffffff12; color: var(--text); }
/* Matte chart labels follow the same warm materials as the activity cards. */
.chart-tooltip,
.chart-tooltip.theme-indigo,
.chart-tooltip.theme-emerald {
    --tooltip-ink: var(--accent-light);
    background: var(--surface-light);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    padding: 8px 12px;
    gap: 4px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.chart-tooltip.theme-emerald { --tooltip-ink: #b1c2a2; }
.chart-tooltip::after,
.chart-tooltip.theme-emerald::after {
    width: 8px;
    height: 8px;
    bottom: -5px;
    border: 0;
    border-right: 1px solid var(--border-strong);
    border-bottom: 1px solid var(--border-strong);
    background: var(--surface-light);
    transform: translateX(-50%) rotate(45deg);
}
.chart-tooltip.pos-bottom::after,
.chart-tooltip.theme-emerald.pos-bottom::after {
    top: -5px;
    bottom: auto;
    border: 0;
    border-right: 1px solid var(--border-strong);
    border-bottom: 1px solid var(--border-strong);
    transform: translateX(-50%) rotate(225deg);
}
.chart-tooltip .chart-tooltip-day {
    color: var(--text-soft);
    font-size: 10px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: .025em;
}
.chart-tooltip .chart-tooltip-val { gap: 5px; margin-top: 0; line-height: 1.15; }
.chart-tooltip.theme-indigo .chart-tooltip-val .val-number,
.chart-tooltip.theme-emerald .chart-tooltip-val .val-number {
    color: var(--tooltip-ink);
    font-size: 17px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.025em;
    text-shadow: none;
}
.chart-tooltip .chart-tooltip-val .val-unit {
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 400;
}
.activity-subcard, .activity-subcard.subcard-comparison { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px; backdrop-filter: none; }
.activity-subcard:hover, .activity-subcard.subcard-comparison:hover { border-color: var(--border-strong); box-shadow: none; transform: none; }
.subcard-badge { color: var(--accent-light); }
.subcard-badge .badge-dot { background: var(--accent); box-shadow: none; }
.subcard-hero-num { font-weight: 500; }
.subcard-hero-num.num-emerald, .subcard-hero-unit.unit-emerald { color: #b1c2a2; text-shadow: none; }
.subcard-mode-pills { background: var(--bg); border-radius: 5px; }
.mode-pill { border-radius: 4px; min-height: 28px; }
.mode-pill.active { background: #b1c2a21c; color: #b1c2a2; box-shadow: none; }
.mode-pill .dot-emerald, .mode-pill .dot-cyan { background: #b1c2a2; box-shadow: none; }
.stats-chart-svg #stats-line-gradient stop, .stats-chart-svg #stats-area-gradient stop { stop-color: #c99173; }
.stats-chart-svg #chart-grad-emerald stop, .stats-chart-svg #chart-area-emerald stop { stop-color: #a7b99a; }
.stats-chart-line, .stats-chart-line-emerald { filter: none; stroke-width: 3; }
.stats-chart-points circle.chart-dot { stroke: #c99173; fill: var(--bg-soft); filter: none; }
.stats-chart-points-emerald circle.chart-dot { stroke: #a7b99a; fill: var(--bg-soft); filter: none; }
.stats-chart-points circle.chart-dot:hover, .stats-chart-points circle.chart-dot.is-active, .chart-point-item:focus circle.chart-dot { fill: var(--paper); filter: none; }
.stats-chart-labels text { fill: var(--text-muted); }
.nav-bar { background: var(--bg); backdrop-filter: none; }
.page-intro { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding: 15px 0 32px; }
.page-intro h1 { margin-top: 9px; font: 400 clamp(30px, 3.5vw, 52px)/1.1 var(--editorial-font); letter-spacing: -.045em; }
.page-intro p { max-width: 360px; color: var(--text-muted); font-size: 12px; line-height: 1.8; }
.catalog-results-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.catalog-card { padding: 15px; }
.catalog-card:hover { background: var(--surface-soft); border-color: var(--border-strong); box-shadow: 0 8px 20px #0002; }
.catalog-card-cover { border-radius: 3px 6px 6px 3px; box-shadow: 3px 3px 0 #e8e4d833; }
.catalog-source-choice { display: grid; gap: 5px; margin-top: 12px; color: var(--text-muted); font-size: 10px; }
.catalog-source-choice select { width: 100%; min-width: 0; min-height: 40px; padding: 8px; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--bg-soft); color: var(--text); font-size: 11px; }
.queue-source { color: var(--text-muted); font-size: 11px; }
.queue-details { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.queue-details summary { color: var(--text-soft); font-size: 12px; cursor: pointer; min-height: 32px; }
.queue-counts { color: var(--text-muted); font-size: 11px; margin: 5px 0 10px; }
.queue-event-log { max-height: 260px; overflow: auto; padding: 12px; border-radius: 5px; background: var(--bg-deep); color: var(--text-soft); white-space: pre-wrap; overflow-wrap: anywhere; font: 11px/1.8 ui-monospace, monospace; }
.catalog-empty, .queue-empty, .storage-empty { margin-top: 24px; padding: 60px 20px; border: 1px dashed var(--border-strong); border-radius: 10px; color: var(--text-soft); }
.series-detail-header { background: var(--surface-solid); border-radius: 12px; border-color: var(--border); }
.series-hero-backdrop { opacity: .12; filter: grayscale(.7) blur(24px); }
.series-detail-title { font-family: var(--editorial-font); font-weight: 400; letter-spacing: -.04em; }
.series-poster-wrapper { perspective: 1000px; }
.series-cover-poster { border-radius: 3px 8px 8px 3px; transform: rotateY(-9deg); box-shadow: 5px 5px 0 #ccc6ad66, 12px 18px 30px #0005; }
.series-action-bar .play-btn { background: var(--accent); color: #20241c; box-shadow: none; }
.chapter-list-item { border-radius: 6px; background: var(--surface-solid); }
.chapter-list-item:hover { transform: none; background: var(--surface-soft); border-color: var(--border-strong); }
.chapter-play-icon { border-radius: 50%; background: #e8e4d811; color: var(--text-soft); }
.chapter-list-item.in-progress { border-left: 3px solid var(--accent); }
.storage-series-list { gap: 12px; }
.storage-log, .queue-log { background: var(--bg-deep); border-radius: 5px; }
.storage-update-btn { color: var(--accent-light); border-radius: 6px; }
.storage-update-btn:hover { color: var(--text); box-shadow: none; }
.custom-modal-box, .modal-panel, .profile-stats-box, .bookmarks-modal-box, .suwayomi-modal-box { background: var(--surface-solid); border-radius: 12px; border-color: var(--border-strong); box-shadow: 0 30px 100px #0008; }
.custom-modal-overlay, .modal-overlay { backdrop-filter: blur(5px); }
.action-btn, .secondary-button, .chapter-toolbar-btn { border-radius: 6px; }
.toast-container .toast, .toast-item { background: #30332a; border-color: var(--border-strong); border-radius: 8px; }
.reader-nav, .reader-bottom-bar { background: rgba(24, 25, 23, .97); border-color: var(--border); }
.nav-btn, .reader-action-btn { border-radius: 6px; }

/* Profiles and sign-in form a quiet opening spread. */
.profiles-wrapper { background: var(--bg); }
.profiles-wrapper::before, .profiles-wrapper::after, .login-wrapper::before { display: none; }
.profiles-wrapper .main-logo { width: 64px; height: 64px; margin-bottom: 28px; border-radius: 15px; }
.profiles-wrapper h1 { font: 400 clamp(38px, 5vw, 68px)/1.1 var(--editorial-font); letter-spacing: -.04em; }
.profiles-subtitle { color: var(--text-muted); margin: 14px 0 36px; font-size: 13px; }
.profile-avatar { border-radius: 14px; box-shadow: 4px 5px 0 #e8e4d814, 0 15px 30px #0003; }
.profile-card:hover .profile-avatar { border-color: var(--paper); box-shadow: 5px 7px 0 #e8e4d828; }
.profile-name { color: var(--text-soft); font-size: 13px; }
body.edition-login { display: grid; grid-template-columns: 1fr 1fr; min-height: 100dvh; overflow: auto; padding: 0; align-items: stretch; }
.login-editorial { position: relative; display: flex; flex-direction: column; justify-content: center; padding: clamp(32px, 6vw, 120px); background: var(--paper); color: var(--paper-ink); overflow: hidden; }
.login-editorial > .edition-eyebrow { color: #646958; }
.login-editorial h2 { position: relative; z-index: 1; margin: 24px 0; font: 400 clamp(45px, 5.5vw, 90px)/1.02 var(--editorial-font); letter-spacing: -.06em; }
.login-editorial h2 em { color: #8c5e43; font-weight: 400; }
.login-editorial p { max-width: 360px; color: #5c6253; font-size: 14px; line-height: 1.8; }
.login-volumes { display: flex; gap: 18px; margin-top: 65px; perspective: 1000px; align-items: end; }
.login-volumes span { display: flex; justify-content: space-between; align-items: start; flex-direction: column; width: 100px; height: 140px; padding: 12px; background: #49523e; color: #e9e5d6; font: 22px var(--editorial-font); border-radius: 2px 5px 5px 2px; border-left: 4px solid #0002; transform: rotateY(-22deg) rotateZ(-5deg); box-shadow: 5px 4px 0 #c4c0aa, 14px 20px 25px #0002; }
.login-volumes span:nth-child(2) { height: 168px; background: #ab765a; transform: rotateY(-22deg) rotateZ(3deg); }
.login-volumes span:nth-child(3) { height: 150px; background: #747968; }
.login-volumes small { font: 8px "Inter", sans-serif; letter-spacing: .15em; }
.edition-login .login-wrapper { width: 100%; max-width: none; display: grid; place-items: center; padding: 48px 32px; }
.edition-login .login-card { width: 100%; max-width: 390px; padding: 0; border: 0; background: none; box-shadow: none; }
.login-header { text-align: left; margin-bottom: 35px; }
.login-logo { width: 48px; height: 48px; margin: 0 0 26px; border-radius: 12px; box-shadow: none; }
.login-header h1 { font: 400 38px var(--editorial-font); letter-spacing: -.04em; }
.login-header p { color: var(--text-muted); font-size: 12px; margin-top: 12px; }
.input-group input { background: var(--surface-solid); border-color: var(--border-strong); border-radius: 6px; }
.input-group input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-subtle); }
.login-btn { margin-top: 8px; }

@media (min-width: 1800px) {
    .hero { min-height: 530px; }
    .hero-visual { min-height: 530px; }
    .book-scene { width: 270px; }
    .manga-grid, #series-grid { grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); }
    body[data-shelf-density="compact"] #series-grid { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); }
}
@media (min-width: 769px) and (max-width: 1150px) {
    :root { --sidebar-width: 78px; --content-padding: 24px; }
    .sidebar { padding: 24px 10px; align-items: center; }
    .sidebar .nav-tooltip, .brand-wordmark, .sidebar-caption, .sidebar-note { display: none; }
    .brand-mark { justify-content: center; padding: 0; }
    .sidebar-nav { padding-top: 35px; }
    .nav-item { justify-content: center; }
    .nav-item.active::before { left: -11px; }
    .profile-button { margin-left: 8px; }
    .hero-content { padding: 32px; }
    .hero h1 { font-size: 48px; }
    .hero-visual { padding: 35px 24px 55px; }
    .edition-jumps button { font-size: 11px; gap: 7px; }
}
@media (max-width: 768px) {
    :root { --sidebar-width: 0px; --content-padding: 18px; --section-gap: 32px; }
    body { background: var(--bg); padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
    .app-shell { padding-left: 0; }
    .main-content { padding: 0 18px 30px; }
    .container { padding: 18px 18px calc(90px + env(safe-area-inset-bottom, 0px)); }
    .sidebar { inset: auto 0 0; width: 100%; height: calc(68px + env(safe-area-inset-bottom, 0px)); padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); flex-direction: row; align-items: center; border-radius: 0; border: 0; border-top: 1px solid var(--border-strong); background: #1c1e18; box-shadow: 0 -6px 20px #0002; z-index: var(--z-bottom-nav); }
    .brand-mark, .sidebar-caption, .sidebar-note, .profile-button { display: none; }
    .sidebar-nav { flex-direction: row; justify-content: space-around; align-items: stretch; max-width: none; height: 100%; gap: 2px; }
    .nav-item { flex: 1 1 0; min-width: 0; max-width: none; height: 100%; flex-direction: column; justify-content: center; gap: 5px; padding: 5px 0; border: 0; border-radius: 5px; }
    .sidebar .nav-tooltip { display: inline; font-size: 8px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
    .sidebar .nav-item[data-section="Téléchargements"] .nav-tooltip { font-size: 0; }
    .sidebar .nav-item[data-section="Téléchargements"] .nav-tooltip::after { content: "Transferts"; font-size: 8px; }
    .nav-item svg { width: 19px; height: 19px; }
    .nav-item.active::before { display: none; }
    .top-header { min-height: 75px; gap: 10px; flex-wrap: nowrap; padding-top: env(safe-area-inset-top, 0px); }
    .welcome { display: flex; flex: 0 0 auto; }
    .welcome-text { display: none; }
    .mobile-brand-logo { display: block; width: 31px; height: 31px; }
    .search-box { flex: 1; width: auto; min-width: 0; }
    .search-box input { height: 43px; font-size: 11px; }
    .search-shortcut { display: none; }
    .header-actions-group { flex: 0 0 auto; gap: 4px; }
    .header-actions-group .header-action { width: 32px; height: 40px; padding: 6px; }
    .header-actions-group .header-action:first-child { display: none; }
    .edition-heading { padding: 24px 0 20px; }
    .edition-heading h2 { font-size: 31px; }
    .edition-date { max-width: 90px; font-size: 10px; }
    .hero { min-height: 0; grid-template-columns: minmax(0, 1fr); border-radius: 9px; }
    .hero-content { padding: 30px 25px 18px; text-align: left; }
    .hero-kicker { margin-bottom: 16px; font-size: 9px; }
    .hero h1 { font-size: clamp(36px, 8.5vw, 56px); line-height: 1.04; }
    .hero-description { margin-top: 16px; font-size: 12px; -webkit-line-clamp: 3; }
    .hero-meta { margin-top: 18px; justify-content: flex-start; row-gap: 10px; }
    .hero-meta span { font-size: 10px; padding: 0 9px; }
    .hero-actions { margin-top: 22px; }
    .hero .primary-button { flex: 1; padding: 12px; font-size: 11px; }
    .hero .secondary-button { min-width: 75px; padding: 12px; }
    .hero-visual, .book-scene { display: none !important; }
    .hero-content { padding-bottom: 28px; }
    .edition-jumps { flex-wrap: wrap; }
    .edition-jumps button { flex: 1 1 50%; padding: 14px 0; font-size: 10px; gap: 8px; }
    .edition-jumps button + button { padding-left: 14px; }
    .edition-jumps button:nth-child(3) { padding-left: 0; border-left: 0; border-top: 1px solid var(--border); }
    .edition-jumps button:nth-child(4) { border-top: 1px solid var(--border); }
    .edition-jumps b { margin-right: 12px; font-size: 14px; }
    .section-header { gap: 12px; margin-bottom: 16px; }
    .section-heading h2 { font-size: 25px; }
    .section-link { font-size: 10px; text-align: right; }
    .manga-grid, #series-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 18px 12px; }
    body[data-shelf-density="compact"] #series-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 18px 10px; }
    .manga-overlay, .card-overlay { padding: 36px 7px 8px; }
    .manga-overlay h3, .card-overlay h3 { font-size: 10px; }
    .manga-meta { font-size: 8px; }
    .manga-card-inner, .card-inner { border-radius: 3px 5px 5px 3px; }
    .manga-card:hover .manga-card-inner, .card:hover .card-inner { transform: none !important; }
    .continue-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .continue-card { padding: 13px; min-height: 118px; }
    .library-toolbar { flex-wrap: wrap; padding: 10px; gap: 8px; }
    .library-toolbar .search-wrapper { flex-basis: 100% !important; }
    .sort-select-wrapper { flex: 1; min-width: 0; }
    .sort-select { width: 100%; min-height: 44px; font-size: 11px; }
    .density-switch button { min-height: 38px; }
    .stats-layout { grid-template-columns: minmax(0, 1fr); }
    .page-intro { flex-direction: column; gap: 15px; padding: 10px 0 24px; }
    .page-intro p { max-width: none; }
    .catalog-results-grid { grid-template-columns: minmax(0, 1fr); }
    .nav-bar { gap: 8px; padding-inline: 18px; }
    .nav-bar h2 { font-size: 15px; }
    .storage-repair-btn, #storage-view .nav-bar .icon-btn { font-size: 10px; padding: 10px; }
    body.edition-login { display: flex; flex-direction: column; padding-bottom: 0; }
    .login-editorial { padding: 32px 28px; }
    .login-editorial h2 { font-size: 39px; margin: 15px 0; }
    .login-editorial p { font-size: 12px; }
    .login-volumes { display: none; }
    .edition-login .login-wrapper { padding: 34px 28px; }
    .login-logo { display: none; }
    .login-header h1 { font-size: 30px; }
    .profiles-wrapper { min-height: calc(100dvh - 78px); }
}
@media (max-width: 380px) {
    .main-content { padding-inline: 12px; }
    .mobile-brand-logo { width: 26px; height: 26px; }
    .top-header { gap: 6px; }
    .hero-content { padding-inline: 20px; }
    .manga-grid, #series-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    body[data-shelf-density="compact"] #series-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .book-3d { transform: rotateY(-12deg) !important; }
    .manga-card-inner, .card-inner, .series-cover-poster { transform: none !important; }
}

/* Reading filters and keyboard help share the edition controls. */
.reading-filter { display: flex; align-items: center; gap: 8px; color: var(--text-soft); font-size: 12px; }
.reading-filter select { min-height: 38px; max-width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-soft); color: var(--text); font: inherit; }
.reading-filter select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#chapter-toolbar { flex-wrap: wrap; gap: 12px; }
#books-grid [hidden] { display: none !important; }
.reading-empty { grid-column: 1 / -1; padding: 24px; color: var(--text-muted); text-align: center; }
.reader-shortcuts { width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); padding: 24px; border: 1px solid var(--border-strong); border-radius: 12px; color: var(--text); background: var(--surface-solid); box-shadow: 0 24px 64px #0006; }
.reader-shortcuts::backdrop { background: #0009; }
.reader-shortcuts form { float: right; }
.reader-shortcuts h2 { margin: 0 0 24px; font: 400 24px var(--editorial-font); }
.reader-shortcuts dl { display: grid; grid-template-columns: 130px 1fr; gap: 16px 12px; margin: 0; font-size: 13px; line-height: 1.5; }
.reader-shortcuts dt { color: var(--accent-light); }
.reader-shortcuts dd { margin: 0; color: var(--text-soft); }
@media (max-width: 768px) {
    .reading-filter { flex-wrap: wrap; }
    .reading-filter select { min-height: 44px; }
    .library-toolbar .reading-filter { flex: 1 1 100%; justify-content: space-between; }
    .reader-shortcuts { padding: 18px; }
    .reader-shortcuts dl { grid-template-columns: 105px 1fr; gap: 12px; }
}

/* Feedback stays away from the top actions and never intercepts input. */
#toast-container { top: auto; right: 18px; bottom: max(24px, var(--toast-reader-bottom, 0px)); max-width: min(360px, calc(100vw - 36px)); }
#toast-container, #toast-container .toast { pointer-events: none; }
#toast-container .toast { overflow-wrap: anywhere; }
@media (max-width: 768px) {
    #toast-container { right: 18px; bottom: max(calc(82px + env(safe-area-inset-bottom, 0px)), var(--toast-reader-bottom, 0px)); }
}

.download-control-panel { padding: 24px; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; margin: 0 0 28px; }
.download-panel-heading, .download-queue-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.download-panel-heading h2 { margin: 0; font-size: 1.2rem; }
.download-control-panel p { color: var(--text-secondary); font-size: .88rem; line-height: 1.6; }
.download-control-panel details { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 14px; }
.download-control-panel summary { cursor: pointer; padding: 8px 0; font-weight: 600; }
#download-settings-form { display: grid; gap: 18px; margin-top: 20px; }
#download-settings-form[hidden], #queue-list .queue-item[hidden], #queue-filter-empty[hidden], #queue-retry-failed[hidden] { display: none !important; }
#download-settings-form fieldset { min-width: 0; border: 1px solid var(--border); border-radius: 8px; padding: 18px; }
#download-settings-form legend { padding: 0 8px; }
.download-check, .download-languages label { display: flex; align-items: center; gap: 10px; min-height: 44px; }
#download-settings-form input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); flex-shrink: 0; }
.download-frequency { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.download-languages { display: flex; flex-wrap: wrap; gap: 8px 24px; }
#download-source-list { list-style: none; padding: 0; margin: 12px 0 0; }
#download-source-list li { display: flex; gap: 10px; align-items: center; justify-content: space-between; border-top: 1px solid var(--border); padding: 8px 0; }
#download-source-list label { display: flex; align-items: center; gap: 10px; min-width: 0; overflow-wrap: anywhere; }
.source-order-actions { display: flex; gap: 4px; flex-shrink: 0; }
.source-order-actions button { width: 44px; height: 44px; border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: 6px; cursor: pointer; }
.source-order-actions button:disabled { opacity: .3; cursor: default; }
.download-control-panel select, .download-queue-toolbar select { max-width: 100%; min-height: 44px; border: 1px solid var(--border); border-radius: 6px; padding: 8px; background: var(--bg); color: var(--text); }
.download-queue-toolbar { margin-bottom: 20px; }
.download-queue-toolbar label { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-width: 0; }
.update-report { font-size: .85rem; overflow-wrap: anywhere; }
.update-report ul { padding-left: 20px; max-height: 320px; overflow: auto; }
.update-report li { padding: 6px 0; }
.update-failed { color: var(--danger); }
.download-settings-link { margin-bottom: 20px; }
.queue-header-right { flex-wrap: wrap; }
.queue-priority-btn { font-size: .78rem; min-height: 36px; }
@media (max-width: 768px) {
    .download-control-panel { padding: 16px; }
    #download-settings-form fieldset { padding: 12px; }
    #download-source-list label { font-size: .82rem; }
    .queue-priority-btn { min-height: 44px; }
}
.download-control-panel .btn-primary, .download-control-panel .btn-secondary, .download-queue-toolbar .btn-secondary, .queue-priority-btn, .download-settings-link {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px;
    border: 1px solid var(--border-strong); border-radius: 7px; background: var(--surface-soft); color: var(--text);
    font-family: inherit; font-size: .82rem; font-weight: 600; line-height: 1.4; cursor: pointer;
}
.download-control-panel .btn-primary { background: var(--accent); color: var(--text-inverse); border-color: transparent; justify-self: start; }
.download-control-panel button:disabled, .download-queue-toolbar button:disabled, .queue-priority-btn:disabled { opacity: .55; cursor: wait; }
.download-control-panel button:focus-visible, .download-settings-link:focus-visible, .queue-priority-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
