/* A desktop-only Y2K reading room. Phone and tablet layouts stay untouched. */
.topbar nav .desktop-nav-label,
.topbar nav .desktop-account-label,
.topbar nav .desktop-account-icon { display: none; }

@media (min-width: 1024px) {
  :root {
    --canvas: #08050e;
    --surface: #100b1b;
    --surface-raised: #211339;
    --stroke: #7355a9;
    --text: #f7efff;
    --muted: #b9a8d0;
    --rose: #f29bcf;
    --accent: #e270c5;
    --line: #614a8a;
    --soft: #b9a8d0;
    --panel: #100b1b;
    background: #08050e;
    color: #f7efff;
  }
  body:not(.reader-active) {
    background:
      radial-gradient(circle at 10% 5%, #822fd641, transparent 24%),
      radial-gradient(circle at 97% 23%, #5a1f9b4d, transparent 28%),
      repeating-linear-gradient(135deg, #aa7ae008 0 1px, transparent 1px 7px),
      #08050e;
  }
  body:not(.reader-active)::before {
    content: '✦';
    position: fixed;
    top: 174px;
    right: 23px;
    z-index: 0;
    color: #dca9ff88;
    font-size: 36px;
    text-shadow: 0 0 18px #b058ff;
    pointer-events: none;
  }
  body:not(.reader-active) .topbar {
    position: sticky;
    inset: 0 auto auto;
    z-index: 30;
    width: 100%;
    height: 112px;
    padding: 30px clamp(18px, 2.5vw, 44px) 11px;
    display: grid;
    grid-template-columns: minmax(185px, 245px) minmax(0, 1fr) minmax(220px, 300px);
    align-items: center;
    gap: clamp(14px, 2vw, 34px);
    border: 0;
    border-bottom: 2px solid #9874d6;
    background: linear-gradient(180deg, #151022 0 28px, #050408 28px 100%);
    box-shadow: 0 5px 0 #2b1746, 0 13px 30px #000b;
  }
  body:not(.reader-active) .topbar::before {
    content: 'MANGARAWMAX.EXE     /     THE READING ROOM';
    position: absolute;
    inset: 0 0 auto;
    height: 27px;
    padding: 5px clamp(18px, 2.5vw, 44px);
    border-bottom: 1px solid #c3a7ff;
    background: linear-gradient(90deg, #6650bc, #a86dd1 55%, #443682);
    color: #140c29;
    font: 700 12px/17px 'Courier New', monospace;
    letter-spacing: .04em;
  }
  body:not(.reader-active) .topbar::after {
    content: '−  □  ×';
    position: absolute;
    top: 3px;
    right: clamp(18px, 2.5vw, 44px);
    padding: 1px 6px;
    border: 1px solid #1d1039;
    background: #c2b0ef;
    color: #190e2c;
    font: 700 14px/15px 'Courier New', monospace;
    box-shadow: inset 1px 1px #fff;
    pointer-events: none;
  }
  .topbar .brand {
    position: relative;
    margin: 0;
    gap: 10px;
    color: #fff;
    font: 900 clamp(18px, 1.8vw, 27px)/1.1 'Courier New', monospace;
    letter-spacing: -.08em;
    text-shadow: 2px 2px #7040a4, 0 0 14px #9e55e9;
  }
  .topbar .brand::after {
    content: '♥  ONLINE  ♥';
    position: absolute;
    top: 27px;
    left: 51px;
    color: #e996d1;
    font: 700 9px/1 'Courier New', monospace;
    letter-spacing: .13em;
    text-shadow: 0 0 9px #f578ca;
  }
  .topbar .brand-mark {
    width: 39px;
    height: 39px;
    border: 1px solid #dba3ff;
    border-radius: 2px;
    background: linear-gradient(135deg, #b273e8, #4a218f 65%, #210e46);
    box-shadow: inset 1px 1px #f9d9ff, 0 0 16px #a74afca8;
  }
  .topbar .brand-mark .icon { width: 25px; height: 25px; }
  .topbar .accent { color: #f8a7d8; }
  .topbar nav {
    order: initial;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: clamp(2px, .7vw, 12px);
    width: 100%;
    min-width: 0;
  }
  .topbar nav .nav-caption { display: none; }
  .topbar nav a, .topbar nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 0;
    min-height: 64px;
    padding: 5px clamp(5px, .8vw, 14px);
    gap: 5px;
    border: 1px solid transparent;
    border-radius: 2px;
    color: #d8c8ed;
    font: 700 10px/1.25 'Courier New', monospace;
    text-align: center;
    white-space: nowrap;
  }
  .topbar nav a:hover, .topbar nav button:hover,
  .topbar nav [aria-current="page"] {
    border-color: #8b62c7;
    background: #8d58c33b;
    color: #fff;
    box-shadow: inset 0 0 12px #9e55e94b;
  }
  .topbar nav .icon { width: 22px; height: 22px; color: #bd8aff; filter: drop-shadow(0 0 5px #a14dff); }
  .topbar nav #account-menu {
    position: static;
    width: auto;
    min-width: 0;
    padding: 5px clamp(5px, .8vw, 14px);
    border-top: 1px solid transparent;
  }
  .topbar nav #account-menu .account-avatar {
    width: 22px;
    height: 22px;
    border: 1px solid #d696ef;
    border-radius: 2px;
    background: #6e3e93;
    color: #fff;
  }
  .topbar nav #account-menu .account-name { max-width: 90px; }
  .topbar .top-search {
    order: initial;
    width: 100%;
    height: 42px;
    min-height: 0;
    margin: 0;
    border: 2px solid #8567c1;
    border-radius: 2px;
    background: #130d20;
    box-shadow: inset 2px 2px #050409, 2px 2px #56377e;
  }
  .topbar .top-search:focus-within { border-color: #f1a3e8; box-shadow: 0 0 14px #df6aca8c; }
  .topbar .top-search select {
    width: 68px;
    padding: 0 6px;
    border-radius: 0;
    border-right: 1px solid #8b67be;
    background: #4b3179;
    color: #fff;
  }
  .topbar .top-search input { padding: 9px 7px; color: #fff; }
  .topbar .top-search input::placeholder { color: #b4a3ca; }
  .topbar .top-search button { color: #edb2ff; }
  body:not(.reader-active) #app {
    position: relative;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 28px clamp(18px, 3.1vw, 58px) 90px;
  }
  body:not(.reader-active) .site-footer {
    margin: 0;
    padding: 16px clamp(18px, 3.1vw, 58px);
    border-top: 2px solid #7b56ae;
    background: #08050e;
    color: #aa8bc6;
    font: 11px 'Courier New', monospace;
  }
  body:not(.reader-active) .site-footer::after { content: '© 2004 → ∞   ·   BEST VIEWED WITH IMAGINATION   ✦'; }
  .welcome-hero {
    min-height: clamp(395px, 36vw, 575px);
    margin: 0 0 26px;
    border: 2px solid #a77bde;
    border-radius: 2px;
    background: linear-gradient(90deg, #08020ed9 0%, #18053361 38%, transparent 65%), url('/assets/violet-y2k-lounge-reading.png') 70% center / cover;
    box-shadow: 0 0 0 4px #170b2a, 0 0 0 5px #59358a, 0 22px 50px #000b, inset 0 0 40px #160a34;
  }
  .welcome-hero::before {
    content: '✦  WELCOME 2 MY WORLD  /  MANGARAWMAX.EXE';
    position: absolute;
    inset: 0 0 auto;
    height: 30px;
    padding: 6px 13px;
    border-bottom: 1px solid #d5b0ff;
    background: linear-gradient(90deg, #6b47bb, #a77dd9 70%, #3c227f);
    color: #150a2d;
    font: 700 12px/17px 'Courier New', monospace;
    letter-spacing: .07em;
    pointer-events: none;
  }
  .welcome-hero::after {
    content: '✧  NOW READING  /  ALWAYS ONLINE  ✧';
    position: absolute;
    right: 20px;
    bottom: 19px;
    padding: 10px 13px;
    border: 1px solid #d7b5ff;
    background: #0a0615d9;
    color: #f2b5ea;
    font: 700 10px 'Courier New', monospace;
    box-shadow: 3px 3px #543581, 0 0 18px #aa62f75a;
  }
  .hero-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    max-width: 690px;
    min-height: inherit;
    padding: 54px clamp(35px, 5vw, 88px) 50px;
  }
  .hero-kicker { color: #e9b9ff; font: 700 12px 'Courier New', monospace; letter-spacing: .17em; text-shadow: 0 0 13px #d969ff; }
  .hero-kicker i { background: #a75dff; box-shadow: 0 0 16px #b55cff; }
  .hero-copy h1 {
    margin: 23px 0 19px;
    color: #f8edff;
    font-size: clamp(53px, 6.2vw, 102px);
    font-weight: 1000;
    line-height: 1.03;
    letter-spacing: -.09em;
    transform: rotate(-3deg);
    text-shadow: 3px 3px #e684d4, 6px 6px #7139ae, 9px 9px #301248, 0 0 28px #dc7cf082;
  }
  .hero-copy p { max-width: 450px; color: #f4dafa; font-size: 15px; font-weight: 700; line-height: 1.8; text-shadow: 0 2px 8px #000; }
  .hero-count {
    margin-top: 25px;
    padding: 8px 14px;
    border: 1px solid #ffb8e5;
    border-radius: 2px;
    background: linear-gradient(180deg, #d78cdd, #8652ae);
    color: #210d35;
    font: 900 12px 'Courier New', monospace;
    box-shadow: inset 1px 1px #fff3, 3px 3px #321747;
  }
  .hero-count span { font-size: 14px; }
  .hero-art { display: none; }
  .eyebrow { color: #d397f4; font: 800 10px 'Courier New', monospace; letter-spacing: .15em; }
  .section-head h1, .section-head h2 { color: #f4c1e9; text-shadow: 2px 2px #532365, 0 0 15px #8d41c26c; }
  .section-head p { color: #bdacd2; }
  .section-link { color: #e5b6ff; text-decoration: underline; text-underline-offset: 3px; }
  .result-count { border: 1px solid #a57bd1; border-radius: 2px; background: #130b24; color: #cdb2ef; font: 700 11px 'Courier New', monospace; }
  .continue-section {
    margin: 30px 0 44px;
    padding: 0 15px 16px;
    border: 2px solid #7855ac;
    background: #08050ec9;
    box-shadow: 4px 4px #2f1b4e, 0 0 28px #7637b944;
  }
  .continue-section .section-head {
    margin: 0 -15px 15px;
    padding: 10px 15px;
    border-bottom: 1px solid #bb8bf0;
    background: linear-gradient(90deg, #40247d, #68449f 70%, #241447);
  }
  .continue-section .section-head h2 { margin-top: 3px; color: #fff; font-size: 20px; text-shadow: 1px 1px #1a0e2e; }
  .continue-section .eyebrow { color: #e5c1ff; }
  .continue-strip { padding-bottom: 4px; }
  .continue-strip .card { padding: 6px; border: 1px solid #654294; background: #160c25; }
  .continue-strip .cover { border-radius: 1px; }
  .continue-strip .card h3 { margin: 9px 3px 4px; color: #f5e5ff; }
  .continue-strip .card .latest { margin: 0 3px 3px; color: #d1a6e4; }
  .feed-heading { padding-bottom: 14px; border-bottom: 2px dotted #764aa8; }
  .feed-heading h1 { font-size: clamp(29px, 3vw, 42px); }
  .grid, .feed-grid { gap: 26px clamp(15px, 1.3vw, 25px); }
  .grid > .card, .feed-grid > .feed-card {
    overflow: hidden;
    border: 2px solid #805ab3;
    border-radius: 2px;
    background: #0d0717;
    box-shadow: 4px 4px #291643, 0 0 0 1px #140923;
    transition: transform .18s, box-shadow .18s, border-color .18s;
  }
  .grid > .card:hover, .feed-grid > .feed-card:hover {
    transform: translateY(-3px);
    border-color: #e2a8f6;
    box-shadow: 5px 6px #462467, 0 0 20px #ba67ed70;
  }
  .grid > .card { padding: 6px 6px 13px; background: #0d0717; }
  .grid > .card .cover { border: 1px solid #4d2a79; border-radius: 1px; }
  .grid > .card h3 { color: #f4d9ff; }
  .grid > .card .latest { color: #bca7d2; }
  .feed-grid > .feed-card .feed-cover .cover { border-radius: 0; }
  .feed-grid > .feed-card .feed-info { padding: 13px 14px 16px; background: linear-gradient(180deg, #1b1032, #0c0716); }
  .feed-kind {
    display: inline-block;
    margin: -13px -14px 2px;
    padding: 5px 12px;
    width: calc(100% + 28px);
    border-bottom: 1px solid #a880da;
    background: linear-gradient(90deg, #7755bc, #9c72d0 75%, #5b368f);
    color: #170a29;
    font: 900 11px 'Courier New', monospace;
    letter-spacing: .06em;
  }
  .feed-info h3 { color: #f7e7ff; }
  .feed-info p { color: #bda6d5; }
  .feed-read { color: #ecaaf0; font: 800 12px 'Courier New', monospace; }
  .card-detail-link { border-radius: 1px; background: #1c0e2beb; }
  .notice, .import-panel, .source-row, .reference-table, .chapter-link, .dialog-card {
    border-color: #7651a6;
    border-radius: 2px;
    background: #110a1d;
    color: #e5d6f4;
    box-shadow: 3px 3px #291644;
  }
  .breadcrumb, .breadcrumb a { color: #dcb1eb; }
  .detail-cover { border: 2px solid #986cc8; border-radius: 2px; box-shadow: 6px 6px #2c164c, 0 0 24px #8e51bc8c; }
  .detail h1 { color: #f4d8ff; text-shadow: 2px 2px #642e94; }
  .tag { border-color: #9b65c0; border-radius: 2px; background: #341b4a; color: #ebbaef; }
  .primary-btn, .ghost-btn, .pagination button {
    border: 1px solid #a779d3;
    border-radius: 2px;
    background: linear-gradient(180deg, #c18bde, #754aa7);
    color: #190d29;
    font-weight: 800;
    box-shadow: inset 1px 1px #ffe5ff88, 3px 3px #32194e;
  }
  .ghost-btn, .pagination button { background: #26143e; color: #ebccff; }
  .primary-btn:hover, .ghost-btn:hover, .pagination button:hover { background: #e2a2ef; color: #190d29; }
  .chapter-link:hover { background: #27143e; border-color: #d08ee4; }
  .chapter-tools input, .local-search input, .pair-url-row input, .import-panel input[type=text] {
    border-color: #835db0;
    border-radius: 2px;
    background: #110a1d;
    color: #fff;
  }
  .account-avatar { border-radius: 1px; }
  .search-suggestions { border: 2px solid #9874d6; border-radius: 2px; background: #110a1d; }
  :focus-visible { outline-color: #edb1ff; }
}

@media (min-width: 1024px) and (max-width: 1190px) {
  .topbar .brand { font-size: 18px; }
  .topbar nav a, .topbar nav button { font-size: 9px; }
  .topbar nav #account-menu .account-name { max-width: 58px; }
  .hero-copy h1 { font-size: clamp(50px, 6vw, 70px); }
}

@media (min-width: 1024px) {
  .auth-page {
    grid-template-columns: minmax(0, 1.15fr) minmax(440px, .85fr);
    background: repeating-linear-gradient(135deg, #aa7ae008 0 1px, transparent 1px 7px), #08050e;
  }
  .auth-showcase {
    border-right: 2px solid #9d71d3;
    background: linear-gradient(90deg, #08020ed9, #18053361 50%, transparent), url('/assets/violet-y2k-lounge-reading.png') 70% center / cover;
  }
  .auth-showcase::before {
    content: '✦  PRIVATE ACCESS  /  MANGARAWMAX.EXE';
    position: absolute;
    inset: 0 0 auto;
    width: auto;
    height: 27px;
    padding: 5px 17px;
    border: 0;
    border-bottom: 1px solid #d7b5ff;
    border-radius: 0;
    background: linear-gradient(90deg, #6944b8, #9b6dd2);
    box-shadow: none;
    color: #170a2d;
    font: 700 12px/17px 'Courier New', monospace;
  }
  .auth-showcase::after { background: linear-gradient(90deg, #08040bd9, #0a0513a8 42%, transparent 85%); }
  .showcase-inner { width: min(700px, 78%); }
  .showcase-label { color: #e9afff; font: 800 12px 'Courier New', monospace; text-shadow: 0 0 12px #ca77ff; }
  .showcase-inner strong {
    margin-top: 26px;
    color: #fff0ff;
    font-size: clamp(42px, 5vw, 82px);
    line-height: 1.22;
    text-shadow: 3px 3px #df80d3, 6px 6px #6b319a, 0 0 22px #b257e7;
  }
  .showcase-inner p { color: #f2d9fa; font-size: 15px; font-weight: 700; text-shadow: 0 2px 8px #000; }
  .showcase-art { display: none; }
  .auth-card {
    position: relative;
    width: min(520px, calc(100% - 60px));
    margin: 45px 0;
    padding: 60px 33px 34px;
    border: 2px solid #9c73ce;
    background: #0e0819;
    box-shadow: 5px 5px #2a164a, 0 0 35px #7533a157;
  }
  .auth-card::before {
    content: '✦  MEMBER TERMINAL';
    position: absolute;
    inset: 0 0 auto;
    height: 28px;
    padding: 5px 12px;
    border-bottom: 1px solid #dfbdff;
    background: linear-gradient(90deg, #6e49b2, #a67ad4);
    color: #1a0b2e;
    font: 700 12px/17px 'Courier New', monospace;
  }
  .auth-card .brand { font: 900 22px 'Courier New', monospace; text-shadow: 2px 2px #6b319a; }
  .auth-card .brand > span:last-child { color: #f1a8dc; }
  .auth-card .brand-symbol {
    border: 1px solid #e8c5ff;
    border-radius: 2px;
    background: linear-gradient(135deg, #b27bdb, #583194);
    color: #fff;
    box-shadow: 0 0 15px #a955dc9e;
  }
  .auth-card h1, .admin-page .auth-card h1 { margin-top: 60px; color: #f7d6f9; text-shadow: 2px 2px #673482; }
  .auth-card p { color: #c8b4d7; }
  .auth-card input { border-color: #815ca9; border-radius: 2px; background: #180f29; }
  .auth-card input:focus { border-color: #e4aeef; box-shadow: 0 0 10px #c065d862; }
  .auth-card button {
    border: 1px solid #d5acec;
    border-radius: 2px;
    background: linear-gradient(180deg, #d69be3, #8b54b1);
    color: #190b28;
    box-shadow: inset 1px 1px #fff8, 3px 3px #391f58;
  }
  .auth-card a { color: #e5aef3; }
  .admin-page #invite-result { box-shadow: 4px 4px #2a164a; }
}

@media (min-width: 1024px) and (prefers-reduced-motion: reduce) {
  .grid > .card, .feed-grid > .feed-card { transition: none; }
}

@media (min-width: 1024px) {
  /* The desktop tabs have their own small window frame and status detailing. */
  body:not(.reader-active) .topbar { height: 124px; }
  .topbar nav {
    display: grid;
    grid-template-columns: repeat(3, 96px);
    width: max-content;
    justify-self: center;
    gap: 5px;
    padding: 4px;
    border: 1px solid #7a5ba8;
    background: linear-gradient(180deg, #211438, #10091d);
    box-shadow: inset 1px 1px #b88ee866, 2px 2px #311a50;
  }
  .topbar nav a, .topbar nav button,
  .topbar nav #account-menu {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: 96px;
    height: 72px;
    min-width: 96px;
    min-height: 72px;
    padding: 7px 4px 5px;
    border: 1px solid #4b3568;
    background: linear-gradient(145deg, #24163b, #0b0714 70%);
    box-shadow: inset 1px 1px #b18cda33, inset -1px -1px #000;
    transition: background .18s, box-shadow .18s, border-color .18s, transform .18s;
  }
  .topbar nav a::before, .topbar nav button::before {
    content: attr(data-tab);
    position: absolute;
    top: 4px;
    left: 6px;
    color: #ab8bcd;
    font: 700 9px 'Courier New', monospace;
  }
  .topbar nav a::after, .topbar nav button::after {
    content: '✦';
    position: absolute;
    top: 2px;
    right: 5px;
    color: #a475cc;
    font-size: 11px;
  }
  .topbar nav a:hover, .topbar nav button:hover {
    transform: translateY(-2px);
    border-color: #c891eb;
    background: linear-gradient(145deg, #7045a5, #2e1754);
    box-shadow: inset 1px 1px #f5d5ff88, 0 0 16px #a153d878;
  }
  .topbar nav [aria-current="page"] {
    border-color: #ecc0ff;
    background: linear-gradient(145deg, #9f72c9, #542d89);
    color: #fff;
    box-shadow: inset 1px 1px #fff8, 0 0 13px #ca7aeeb0, 0 3px #2b1649;
  }
  .topbar nav [aria-current="page"]::before,
  .topbar nav [aria-current="page"]::after { color: #fff; }
  .topbar nav .icon, .topbar nav #account-menu .account-avatar {
    width: 23px;
    height: 23px;
    margin: 0 auto;
    filter: drop-shadow(0 0 5px #c578ff);
  }
  .topbar nav #account-menu .account-name { max-width: 100%; }
  body:not(.reader-active) .topbar::before { content: ''; }
  .topbar .brand::after { content: none; }
  .welcome-hero { min-height: clamp(370px, 33vw, 510px); }
  .welcome-hero::before { content: 'MANGARAWMAX'; }
  .welcome-hero::after {
    content: '✦';
    right: 26px;
    bottom: 15px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #e6b4ff;
    font-size: 38px;
    text-shadow: 0 0 16px #ba6df5;
    box-shadow: none;
  }
  .welcome-hero .hero-copy, .welcome-hero .hero-art { display: none; }
  .continue-section .eyebrow, .feed-heading .eyebrow { display: none; }
  .feed-heading p { display: none; }
  .site-footer::after { content: none !important; }
  .auth-showcase .showcase-inner { display: none; }
  .auth-showcase::before { content: 'MANGARAWMAX'; }
  .auth-card::before { content: 'LOGIN'; }
  .admin-page .auth-card::before { content: 'ADMIN'; }
}

@media (min-width: 1024px) {
  body:not(.reader-active) #app:has(> .welcome-hero)::before {
    content: '';
    position: fixed;
    inset: 124px 0 0;
    z-index: 0;
    background:
      linear-gradient(180deg, transparent 62%, #08030e77 100%),
      url('/assets/violet-y2k-lounge-reading.png') 80% center / cover no-repeat;
    transform: scale(1.2);
    transform-origin: 78% 19%;
    pointer-events: none;
  }
  body:not(.reader-active) #app:has(> .welcome-hero) > * {
    position: relative;
    z-index: 1;
  }
  .welcome-hero {
    min-height: clamp(390px, 36vw, 570px);
    margin-bottom: 28px;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }
  .welcome-hero::before, .welcome-hero::after { content: none; }
}

@media (min-width: 1024px) {
  body:not(.reader-active) .topbar {
    height: 44px;
    padding: 0 clamp(18px, 2.5vw, 44px);
    grid-template-rows: 43px;
    align-items: center;
    border-bottom: 1px solid #7654a3;
    background: #0b0712ef;
    box-shadow: 0 3px 14px #0009;
    overflow: visible;
  }
  body:not(.reader-active) .topbar::before,
  body:not(.reader-active) .topbar::after { content: none; display: none; }
  .topbar .brand {
    height: 32px;
    align-self: center;
    display: flex;
    align-items: center;
    margin: 0;
    font-size: 18px;
    gap: 7px;
  }
  .topbar .brand-mark { width: 28px; height: 28px; }
  .topbar .brand-mark .icon { width: 18px; height: 18px; }
  .topbar nav {
    grid-template-columns: repeat(3, 80px);
    gap: 6px;
    align-self: start;
    margin-top: 2px;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
  }
  .topbar nav a, .topbar nav button, .topbar nav #account-menu {
    width: 80px;
    height: 60px;
    min-width: 80px;
    min-height: 60px;
    padding: 7px 5px 9px;
    gap: 5px;
    border: 1px solid #7755a7;
    border-radius: 5px 5px 8px 8px;
    background: linear-gradient(160deg, #33204d 0%, #1b102c 47%, #0b0715 100%);
    color: #ecdaf6;
    box-shadow: inset 1px 1px #d9b5f250, 0 3px 0 #28133f, 0 7px 14px #0009;
    font: 800 10px/1.1 'Noto Sans JP', system-ui, sans-serif;
    letter-spacing: .01em;
    white-space: nowrap;
    overflow: visible;
  }
  .topbar nav a::before, .topbar nav button::before,
  .topbar nav a::after, .topbar nav button::after { content: none; }
  .topbar nav a:hover, .topbar nav button:hover {
    transform: translateY(-2px);
  }
  .topbar nav [aria-current="page"] {
    border-color: #e7b2f5;
    background: linear-gradient(160deg, #8e5cb8, #513070 60%, #25143b);
    box-shadow: inset 1px 1px #fff8, 0 3px 0 #392052, 0 0 18px #be75e584;
  }
  .topbar nav .icon,
  .topbar nav #account-menu .desktop-account-icon {
    display: block;
    width: 22px;
    height: 22px;
    flex: none;
    margin: 0 auto;
    color: #dcacfb;
    stroke-width: 1.8;
    filter: drop-shadow(0 0 5px #c578ff);
  }
  .topbar nav #nav-history .full-nav-label,
  .topbar nav #account-menu .account-avatar,
  .topbar nav #account-menu .account-name { display: none; }
  .topbar nav #nav-history .desktop-nav-label,
  .topbar nav #account-menu .desktop-account-label { display: block; }
  .topbar nav #account-menu .desktop-account-label { max-width: none; }
  .topbar .top-search {
    height: 30px;
    min-height: 0;
    align-self: center;
    margin: 0;
    border-width: 1px;
    box-shadow: none;
  }
  .topbar .top-search input { padding: 4px 8px; }
  body:not(.reader-active) #app:has(> .welcome-hero)::before { top: 44px; }
}

/* The desktop reader shares the reading room's palette without changing page rendering. */
@media (min-width: 1024px) {
  body.reader-active .komga-reader {
    color: #f7efff;
  }
  body.reader-active .komga-toolbar {
    height: 60px;
    gap: 9px;
    padding: 0 clamp(16px, 2.2vw, 38px);
    border-color: #8764b8;
    border-style: solid;
    border-width: 0;
    background: linear-gradient(180deg, #21142ef7, #0b0715f8 72%);
    box-shadow: 0 8px 24px #000b, inset 0 1px #d3a6fa38;
    backdrop-filter: blur(14px);
  }
  body.reader-active .komga-topbar {
    border-bottom-width: 1px;
  }
  body.reader-active .komga-bottombar {
    border-top-width: 1px;
    background: linear-gradient(0deg, #21142ef7, #0b0715f8 72%);
    box-shadow: 0 -8px 24px #000b, inset 0 -1px #d3a6fa38;
  }
  body.reader-active .komga-title {
    gap: 2px;
    padding-left: 12px;
    border-left: 2px solid #e270c5;
  }
  body.reader-active .komga-title strong {
    color: #fff3ff;
    font-size: 14px;
    letter-spacing: .025em;
    text-shadow: 0 0 12px #b15ee588;
  }
  body.reader-active .komga-title small {
    color: #caa9e4;
    font: 700 10px/1.2 'Courier New', monospace;
    letter-spacing: .07em;
  }
  body.reader-active .komga-icon {
    min-width: 40px;
    height: 38px;
    border: 1px solid #634783;
    border-radius: 5px;
    background: linear-gradient(145deg, #2d1c43, #160d26);
    color: #e5c9fa;
    box-shadow: inset 1px 1px #f7d8ff20, 0 2px 0 #050309;
    transition: background .16s, border-color .16s, color .16s, box-shadow .16s;
  }
  body.reader-active .komga-icon:hover,
  body.reader-active .komga-icon:focus-visible {
    border-color: #e7a6f2;
    background: linear-gradient(145deg, #6a3d91, #392052);
    color: #fff;
    box-shadow: inset 1px 1px #ffddff78, 0 0 14px #b56bea7a;
  }
  body.reader-active .komga-icon:focus-visible,
  body.reader-active .reader-detail-link:focus-visible,
  body.reader-active .thumbnail-grid button:focus-visible,
  body.reader-active .sheet-card select:focus-visible {
    outline: 2px solid #f0a8db;
    outline-offset: 2px;
  }
  body.reader-active .komga-icon:disabled,
  body.reader-active .komga-icon[aria-disabled='true'] {
    opacity: .4;
    box-shadow: none;
  }
  body.reader-active .reader-detail-link {
    min-height: 38px;
    padding: 7px 13px;
    border-color: #9f70b8;
    border-radius: 5px;
    background: linear-gradient(135deg, #543370, #29153e);
    color: #fff1fb;
    box-shadow: inset 1px 1px #f8cdff55, 0 2px 0 #050309;
  }
  body.reader-active .reader-detail-link:hover {
    border-color: #efb8f5;
    background: linear-gradient(135deg, #8554a7, #503077);
    box-shadow: inset 1px 1px #fff8, 0 0 15px #b56bea82;
  }
  body.reader-active .komga-bottombar > span {
    min-width: 38px;
    color: #f4c6e8;
    font: 700 14px 'Courier New', monospace;
    text-shadow: 0 0 10px #dd72c58c;
  }
  body.reader-active .komga-bottombar input[type='range'],
  body.reader-active .sheet-card input[type='range'] {
    accent-color: #d985df;
    cursor: pointer;
  }
  body.reader-active .komga-dialog,
  body.reader-active .komga-sheet {
    background: #07030bbb;
    backdrop-filter: blur(8px);
  }
  body.reader-active .dialog-card,
  body.reader-active .sheet-card {
    border: 1px solid #9a6aba;
    border-radius: 8px;
    background: linear-gradient(145deg, #1b102b, #0c0815 65%);
    color: #f7efff;
    box-shadow: inset 1px 1px #e3baff2e, 0 22px 70px #000e, 0 0 30px #9a47c52c;
  }
  body.reader-active .sheet-card {
    width: min(540px, 100vw);
    border-radius: 8px 8px 0 0;
  }
  body.reader-active .dialog-head {
    height: 56px;
    border-bottom: 1px solid #8c59ad;
    background: linear-gradient(90deg, #5b357a, #312049 62%, #1c122a);
    box-shadow: inset 0 1px #f3c8ff4d;
  }
  body.reader-active .dialog-head h2 {
    color: #fff3ff;
    font: 800 16px/1.2 'Courier New', monospace;
    letter-spacing: .04em;
    text-shadow: 0 0 12px #df9cf59c;
  }
  body.reader-active .dialog-head .komga-icon {
    height: 34px;
    min-width: 34px;
    font-size: 21px;
  }
  body.reader-active .thumbnail-grid {
    gap: 12px;
    padding: 20px;
  }
  body.reader-active .thumbnail-grid button {
    border: 1px solid #654583;
    border-radius: 5px;
    background: linear-gradient(145deg, #241536, #100a1a);
    color: #e7caef;
    box-shadow: inset 1px 1px #f2ceff1f;
  }
  body.reader-active .thumbnail-grid button:hover {
    border-color: #e692dc;
    background: #3d2353;
    box-shadow: 0 0 14px #b56bea66;
  }
  body.reader-active .thumbnail-grid small {
    font: 700 11px 'Courier New', monospace;
  }
  body.reader-active .help-card dt {
    color: #f1a9dc;
    font-family: 'Courier New', monospace;
  }
  body.reader-active .help-card dd {
    color: #d8c7e5;
  }
  body.reader-active #reader-settings-status {
    margin: 16px 20px 8px;
    color: #c9a6d9;
    font-size: 12px;
  }
  body.reader-active .sheet-card > label {
    border-bottom: 1px solid #78569030;
    color: #e9d9f3;
  }
  body.reader-active .sheet-card select {
    min-height: 38px;
    border-color: #765395;
    border-radius: 4px;
    background: #20132e;
    color: #faf0ff;
  }
  body.reader-active .sheet-card output {
    color: #f1a9dc;
    font-family: 'Courier New', monospace;
  }
  body.reader-active .chapter-transition-card {
    border-color: #a06bbf;
    border-radius: 8px;
    background: linear-gradient(145deg, #2c1745e8, #0e0919eb);
    box-shadow: inset 1px 1px #e6b5ff38, 0 18px 48px #000a, 0 0 24px #9a47c55c;
    backdrop-filter: blur(10px);
  }
  body.reader-active .chapter-transition-card span {
    color: #f0a2d8;
    text-shadow: 0 0 14px #ec70d280;
  }
  body.reader-active .chapter-transition-card strong { color: #fff3ff; }
  body.reader-active .chapter-transition-card small { color: #cbb3da; }
  body.reader-active .page-load-error {
    background: #120c1c;
    color: #ead6f4;
  }
  body.reader-active .page-load-error button {
    border-color: #d788d5;
    border-radius: 5px;
    background: #422255;
  }
}
.card-cover, .feed-cover { position: relative; }
.remove-work { position: absolute; z-index: 5; right: 8px; top: 8px; padding: 7px 11px; border: 1px solid #ff9ed3; border-radius: 4px; background: #31132ce8; color: #ffe1f2; font-size: 12px; font-weight: 800; cursor: pointer; box-shadow: 0 3px 12px #0009; }
.remove-work:hover { background: #692044; }
.remove-work:disabled { opacity: .55; cursor: wait; }
.work-toasts { position: fixed; z-index: 1000; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); pointer-events: none; }
.work-toast { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border: 1px solid #e6a4cf; background: #271338; color: #fff1fb; box-shadow: 0 14px 40px #000a; pointer-events: auto; }
.work-toast button { flex: none; padding: 7px 12px; color: #261131; background: #edb4e0; border: 0; font-weight: 800; cursor: pointer; }
@media (max-width: 700px) { .mobile-work-card .remove-work { position: static; align-self: flex-start; margin-top: 10px; } }

/* Place the reading queue in the open left side of the desktop backdrop. */
@media (min-width: 1024px) {
  #app > .welcome-hero { min-height: clamp(500px, 36vw, 560px); }
  body:not(.reader-active) #app:has(> .welcome-hero) > .continue-section {
    position: absolute;
    top: clamp(64px, 5vw, 78px);
    left: clamp(18px, 3.1vw, 58px);
    right: 48vw;
    width: auto;
    margin: 0;
    padding: 0 11px 12px;
    background: #08050edc;
    backdrop-filter: blur(8px);
  }
  .continue-section .section-head {
    align-items: center;
    gap: 10px;
    margin: 0 -11px 12px;
    padding: 10px 12px;
  }
  .continue-section .section-head h2 { margin: 0; font-size: 19px; }
  .continue-section .section-link { font-size: 11px; }
  .continue-strip {
    grid-auto-flow: column;
    grid-template-rows: auto;
    grid-auto-columns: var(--continue-card-width, clamp(235px, 18vw, 265px));
    gap: 12px;
    padding: 1px 1px 7px;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: #8054ad #180d2a;
  }
  .continue-strip .card {
    display: block;
    width: 100%;
    height: auto;
    padding: 6px 6px 12px;
    overflow: hidden;
    scroll-snap-align: start;
  }
  .continue-strip .card-cover { position: relative; top: auto; left: auto; min-width: 0; }
  .continue-strip .cover { width: 100%; height: auto; aspect-ratio: 4 / 5; }
  .continue-strip .card h3 {
    margin: 11px 3px 5px;
    font-size: 14px;
    line-height: 1.4;
    -webkit-line-clamp: 2;
  }
  .continue-strip .card .latest {
    margin: 0 3px;
    font-size: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }
  .continue-strip .reading-badge { top: 8px; left: 8px; right: auto; }
  .continue-strip .card-detail-link { right: 8px; bottom: 8px; padding: 7px 9px; }
  .continue-strip .card-detail-link span { display: inline; }
  .continue-strip .remove-work { top: 8px; right: 8px; padding: 7px 11px; font-size: 12px; }
  .continue-section > .notice { padding: 18px; font-size: 12px; line-height: 1.6; }
}
