﻿:root {
        color-scheme: light;
        --green: #00B7FF;
        --green-dark: #0077B6;
        --green-deep: #003B5C;
        --masthead: #005A8A;
        --red: #d8232a;
        --ink: #14222B;
        --muted: #546A75;
        --bg: #EDF4F8;
        --panel: #ffffff;
        --panel-2: #F2F8FB;
        --line: #D3E2EA;
        --stage: #DDEAF1;
        --chip: #DFF3FD;
        --shadow: 0 10px 30px rgba(0, 90, 140, .16);
        --focus: rgba(0, 183, 255, .35);
      }
      @media (prefers-color-scheme: dark) {
        :root {
          color-scheme: dark;
          --ink: #E6F3FA;
          --muted: #9DB8C6;
          --bg: #0C141A;
          --panel: #12222D;
          --panel-2: #182C3A;
          --line: #274354;
          --stage: #081118;
          --chip: #12384D;
          --shadow: 0 10px 30px rgba(0, 0, 0, .5);
          --focus: rgba(0, 183, 255, .40);
        }
      }
      * { box-sizing: border-box; }
      html { scroll-behavior: smooth; }
      body {
        margin: 0;
        font-family: "Hind Siliguri", "Noto Sans Bengali", sans-serif;
        background: var(--bg);
        color: var(--ink);
        line-height: 1.55;
      }
      button, a, input { font: inherit; }
      button { cursor: pointer; }
      :focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
      .serif { font-family: "Noto Serif Bengali", "Hind Siliguri", serif; }

      /* ---------- top strip ---------- */
      .topstrip {
        background: var(--green-deep);
        color: #D8F2FF;
        font-size: .86rem;
      }
      .topstrip .wrap {
        max-width: 100%; margin: 0 auto; padding: .35rem clamp(.75rem, 2vw, 2rem);
        display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; align-items: center; justify-content: space-between;
      }
      .topstrip .dates { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; }
      .topstrip button {
        background: transparent; border: 1px solid rgba(255,255,255,.35); color: #fff;
        border-radius: 999px; padding: .3rem .9rem; min-height: 36px; font-size: .86rem;
        display: inline-flex; align-items: center; gap: .45rem;
      }
      .topstrip button:hover { background: rgba(255,255,255,.12); }

      /* ---------- masthead ---------- */
      .masthead { background: var(--masthead); color: #fff; }
      .masthead .wrap {
        max-width: 100%; margin: 0 auto; padding: .9rem clamp(.75rem, 2vw, 2rem);
        display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
      }
      .masthead .logo-text { font-size: clamp(1.3rem, 2.6vw, 1.55rem); font-weight: 700; color: #fff; line-height: 1.1; letter-spacing: .01em; white-space: nowrap; display: inline-flex; align-items: center; gap: .5rem; }
      .logo-mark { color: #ffd23e; font-weight: 800; letter-spacing: -.04em; }
      .logo-it { color: #ffd23e; }
      .masthead .meta { margin-left: auto; text-align: right; font-size: .92rem; color: #E0F5FF; }
      .masthead .meta strong { color: #fff; font-size: 1.02rem; }
      .date-stamp { display: block; margin-top: .3rem; font-size: .78rem; color: #C4ECFF; letter-spacing: .02em; }
      .masthead-banner {
        flex: 1 1 300px; max-width: 728px; margin: 0 auto; min-height: 88px;
        border: 1.5px dashed rgba(255,255,255,.55); border-radius: 8px;
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
        color: #D8F2FF; text-align: center; padding: .5rem 1rem; background: rgba(255,255,255,.06);
      }
      .masthead-banner .banner-tag { font-size: .68rem; letter-spacing: .14em; font-weight: 700; text-transform: uppercase; }
      .masthead-banner .banner-size { font-size: .85rem; }
      .prefooter-banner { max-width: 100%; padding: 0 clamp(.75rem, 2vw, 2rem) 1.4rem; }
      .prefooter-banner .promo-slot { max-width: 970px; margin: 0 auto; min-height: 110px; }
      /* ---------- marquee notice ---------- */
      .marquee {
        background: var(--panel-2); border-bottom: 1px solid var(--line);
        display: flex; align-items: stretch; overflow: hidden;
      }
      .marquee .mq-label {
        flex: none; display: inline-flex; align-items: center; padding: .38rem .85rem;
        background: var(--chip); color: var(--green-dark); font-weight: 700; font-size: .88rem;
      }
      .marquee .mq-view { flex: 1; overflow: hidden; display: flex; align-items: center; }
      .mq-track {
        display: inline-flex; white-space: nowrap; will-change: transform;
        animation: mq-move 55s linear infinite;
      }
      .mq-track span { padding-right: 3.5rem; font-size: .93rem; color: var(--ink); }
      @keyframes mq-move { from { transform: translateX(-50%); } to { transform: translateX(0); } }
      @media (prefers-reduced-motion: reduce) { .mq-track { animation: none; } }

      .edition-pill {
        display: inline-block; background: var(--red); color: #fff; font-weight: 600;
        border-radius: 4px; padding: .08rem .55rem; margin-left: .4rem; font-size: .85rem;
      }

      /* ---------- nav ---------- */
      nav.mainnav {
        background: var(--green-deep); position: sticky; top: 0; z-index: 40;
        box-shadow: 0 2px 10px rgba(0,0,0,.18);
      }
      nav.mainnav .wrap {
        max-width: 100%; margin: 0 auto; padding: 0 clamp(.5rem, 1.6vw, 1.5rem);
        display: flex; flex-wrap: wrap; align-items: stretch;
      }
      nav.mainnav button {
        background: none; border: 0; color: #E6F6FF; padding: .55rem .95rem; min-height: 44px;
        font-size: 1rem; border-bottom: 3px solid transparent;
      }
      nav.mainnav button:hover { background: rgba(255,255,255,.09); color: #fff; }
      nav.mainnav button.active { border-bottom-color: #ffd23e; color: #fff; font-weight: 600; }
      nav.mainnav .allpages { margin-left: auto; font-weight: 600; color: #ffd23e; }
      /* numbered pagination below the marquee */
      nav.mainnav .pagenum { min-width: 46px; text-align: center; font-weight: 600; font-size: 1.05rem; }
      nav.mainnav .pagenum.active { background: var(--green); border-bottom-color: transparent; color: #fff; }
      nav.mainnav .pagenext { font-weight: 600; }
      nav.mainnav button:disabled { opacity: .45; cursor: default; }
      nav.mainnav button:disabled:hover { background: none; color: #E6F6FF; }

      /* ---------- reader toolbar ---------- */
      .toolbar {
        max-width: 100%; margin: 0 auto; padding: .8rem clamp(.75rem, 2vw, 2rem) .2rem;
        display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
      }
      .toolbar .pagetitle { font-size: 1.25rem; font-weight: 700; }
      .toolbar .pagetitle .sec { color: var(--green-dark); }
      .toolbar .spacer { flex: 1; }
      .tbtn {
        background: var(--panel); color: var(--ink); border: 1px solid var(--line);
        border-radius: 8px; padding: .42rem .85rem; min-height: 40px;
        display: inline-flex; align-items: center; gap: .45rem; font-size: .95rem;
        text-decoration: none;
      }
      .tbtn:hover { border-color: var(--green-dark); color: var(--green-dark); }
      .tbtn:disabled { opacity: .45; cursor: default; }
      .tbtn:disabled:hover { border-color: var(--line); color: var(--ink); }
      .tbtn.primary { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }
      .tbtn.primary:hover { background: var(--green-deep); border-color: var(--green-deep); color: #fff; }
      .zoomval { min-width: 3.8rem; text-align: center; font-weight: 700; font-size: 1.12rem; font-family: system-ui, "Segoe UI", Arial, sans-serif; }

      /* ---------- reader layout ---------- */
      .reader {
        max-width: 100%; margin: 0 auto; padding: .8rem clamp(.75rem, 2vw, 2rem) 2rem;
        display: grid; grid-template-columns: 118px minmax(0, 1fr) 300px; gap: 1rem; align-items: start;
      }
      /* right ad sidebar */
      .promo-col { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 64px; }
      .promo-col h2 { font-size: 1rem; margin: 0 0 .1rem; }
      .promo-slot {
        border: 1.5px dashed var(--line); background: var(--panel-2); border-radius: 10px;
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem;
        color: var(--muted); text-align: center; padding: 1rem;
      }
      .promo-slot .banner-tag { font-size: .72rem; letter-spacing: .14em; font-weight: 700; text-transform: uppercase; }
      .promo-slot .banner-size { font-size: .85rem; }
      .promo-slot.wide { min-height: 250px; }
      .promo-slot.tall { min-height: 480px; }
      .zoom-group {
        display: inline-flex; align-items: center; gap: .25rem;
        background: var(--panel); border: 1.5px solid var(--green); border-radius: 999px; padding: .25rem;
      }
      .zoom-group .tbtn {
        border: 0; border-radius: 999px; min-width: 42px; min-height: 40px; justify-content: center;
        background: var(--chip); color: var(--green-dark); font-size: 1.3rem; font-weight: 700; line-height: 1;
      }
      /* the three toolbar action buttons share one exact size */
      .tbtn.eq { width: 10rem; justify-content: center; text-align: center; }
      .zoom-group .tbtn:hover { background: var(--green-dark); color: #fff; }
      /* thumbnails */
      .thumbs { display: flex; flex-direction: column; gap: .8rem; position: sticky; top: 64px; }
      .thumbs h2 { font-size: 1rem; margin: 0 0 .1rem; }
      .thumb {
        background: var(--panel); border: 2px solid var(--line); border-radius: 8px; padding: 6px;
        text-align: center; width: 100%; color: var(--ink);
      }
      .thumb img { width: 100%; height: auto; display: block; border-radius: 3px; }
      .thumb .lbl { display: block; padding-top: .35rem; font-size: .92rem; font-weight: 600; }
      .thumb .sub { display: block; font-size: .8rem; color: var(--muted); font-weight: 400; }
      .thumb.active { border-color: var(--green); box-shadow: 0 0 0 3px var(--focus); }
      /* stage */
      .stage-col { min-width: 0; }
      .stage {
        position: relative; background: var(--stage); border: 1px solid var(--line);
        border-radius: 10px; padding: clamp(8px, 2vw, 22px);
      }
      .page-scroll { overflow: auto; max-height: calc(100vh - 190px); border-radius: 4px; }
      .page-wrap { position: relative; margin: 0 auto; box-shadow: var(--shadow); background: #fff; }
      .page-wrap img.page { width: 100%; height: auto; display: block; }
      .area {
        position: absolute; border: 2px solid transparent; background: transparent;
        border-radius: 2px; padding: 0; min-height: 0;
      }
      .area:hover { background: rgba(0, 183, 255, .18); border-color: rgba(0, 119, 182, .8); }
      .area.selected { background: rgba(216, 35, 42, .13); border-color: var(--red); box-shadow: 0 0 0 2px rgba(216,35,42,.35); }
      .navarrow {
        position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
        width: 52px; height: 52px; border-radius: 50%; border: 0;
        background: var(--green-dark); color: #fff; font-size: 1.7rem; line-height: 1;
        box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center;
      }
      .navarrow:hover { background: var(--green-deep); }
      .navarrow:disabled { background: #7FA3B5; cursor: default; }
      .navarrow.prev { left: 10px; }
      .navarrow.next { right: 10px; }
      /* clip modal (center full-screen popup) */
      .overlay.clip-overlay { padding: .6rem; align-items: center; }
      .modal.clip-modal {
        max-width: 1180px; width: 100%; height: calc(100vh - 1.2rem); height: calc(100dvh - 1.2rem);
        margin-top: 0; display: flex; flex-direction: column; padding: 1rem;
      }
      .clip-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .7rem; }
      .clip-toolbar a.tbtn { text-decoration: none; }
      .clip-scroll { flex: 1; min-height: 0; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--stage); margin-top: .8rem; padding: 10px; }
      .clip-scroll .clip-wrap { margin: 0 auto; background: #fff; box-shadow: var(--shadow); }
      .clip-scroll img { width: 100%; height: auto; display: block; }
      .rel-label {
        display: none; background: var(--red); color: #fff; font-size: .85rem; font-weight: 600;
        padding: .25rem .6rem; border-radius: 4px; margin: .7rem 0 0;
      }
      .rel-label.on { display: inline-block; }
      .print-area { display: none; }
      @media print {
        body > * { display: none !important; }
        body > .print-area { display: block !important; }
        .print-area img { width: 100%; height: auto; }
      }

      /* ---------- all pages ---------- */
      .allpages-view { display: none; max-width: 100%; margin: 0 auto; padding: .5rem clamp(.75rem, 2vw, 2rem) 2.5rem; }
      .allpages-view.on { display: block; }
      .allpages-view h2 { font-size: 1.35rem; margin: .4rem 0 1rem; }
      .pages-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1.1rem; }
      .pages-grid .thumb .lbl { font-size: 1rem; }

      /* ---------- footer ---------- */
      footer { background: #005A8A; color: #C9ECFF; margin-top: 1rem; }
      footer .wrap {
        max-width: 100%; margin: 0 auto; padding: 2rem clamp(.75rem, 2vw, 2rem) 1.2rem;
        display: grid; grid-template-columns: 1.2fr 1.6fr; gap: 2rem;
      }
      footer .logo-text { display: inline-flex; align-items: center; gap: .5rem; font-size: 1.4rem; font-weight: 700; color: #fff; line-height: 1.15; margin-bottom: .45rem; }
      footer h3 { color: #fff; margin: 0 0 .7rem; font-size: 1.05rem; }
      footer p { margin: .3rem 0; font-size: .94rem; }
      footer ul { list-style: none; margin: 0; padding: 0; }
      footer ul li { margin: .2rem 0; }
      footer button.flink {
        background: none; border: 0; color: #C9ECFF; padding: .3rem 0; min-height: 36px; font-size: .95rem; text-align: left;
      }
      footer button.flink:hover { color: #fff; text-decoration: none; }
      footer a { color: #C9ECFF; text-decoration: none; }
      footer a:hover { color: #fff; text-decoration: none; }
      .socials { display: flex; gap: .6rem; margin-top: .8rem; flex-wrap: wrap; }
      .socials a {
        border: 1px solid rgba(255,255,255,.35); border-radius: 50%; width: 42px; height: 42px;
        text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
      }
      .socials a svg { width: 19px; height: 19px; flex: none; fill: currentColor; }
      .socials a:hover { background: rgba(255,255,255,.12); }
      .copyright {
        border-top: 1px solid rgba(255,255,255,.16); text-align: center;
        padding: .9rem 1rem 1.1rem; font-size: .88rem; color: #9FD3EE;
      }

      /* ---------- modal / calendar ---------- */
      .overlay {
        position: fixed; inset: 0; background: rgba(3, 24, 38, .72); z-index: 80;
        display: none; align-items: flex-start; justify-content: center; padding: 1rem; overflow: auto;
      }
      .overlay.on { display: flex; }
      .modal {
        background: var(--panel); color: var(--ink); border-radius: 12px; padding: 1.2rem;
        max-width: 430px; width: 100%; margin-top: 4vh; box-shadow: var(--shadow);
      }
      .modal.wide { max-width: 1180px; width: 100%; }
      .modal header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
      .modal h2 { margin: 0; font-size: 1.2rem; }
      .xbtn {
        background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
        width: 40px; height: 40px; font-size: 1.1rem; color: var(--ink); flex: none;
      }
      .cal-head { display: flex; align-items: center; justify-content: space-between; margin: .8rem 0 .4rem; font-weight: 700; }
      .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
      .cal-grid .dow { text-align: center; font-size: .8rem; color: var(--muted); padding: .3rem 0; font-weight: 600; }
      .cal-grid button {
        border: 1px solid var(--line); background: var(--panel-2); color: var(--ink);
        border-radius: 6px; min-height: 42px; font-size: .95rem;
      }
      .cal-grid button:disabled { opacity: .35; cursor: default; }
      .cal-grid button.today { background: var(--green-dark); border-color: var(--green-dark); color: #fff; font-weight: 700; }
      .cal-note { font-size: .9rem; color: var(--muted); margin-top: .7rem; }
      .fullview-img { width: 100%; height: auto; display: block; margin-top: .8rem; box-shadow: var(--shadow); }
      .fv-scroll { max-height: 74vh; overflow: auto; margin-top: .8rem; background: var(--stage); padding: 10px; border-radius: 8px; }
      .fv-scroll .page-wrap { box-shadow: var(--shadow); }
      /* full-view toolbar: nav left, zoom centered, print/download right */
      .fv-toolbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .5rem; margin-top: .7rem; }
      .fv-toolbar .fv-nav { display: flex; gap: .5rem; flex-wrap: wrap; justify-self: start; }
      .fv-toolbar .fv-actions { display: flex; gap: .5rem; justify-self: end; }
      .fv-toolbar .zoom-group { justify-self: center; }
      .tbtn.icon-btn { width: 44px; height: 44px; min-height: 44px; padding: 0; justify-content: center; }
      .tbtn.icon-btn svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
      @media (max-width: 640px) {
        /* full-view toolbar on phones: two compact lines —
           line 1: prev/next + print/download, line 2: zoom centred */
        .fv-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem .5rem; }
        .fv-toolbar .fv-nav { order: 1; justify-self: auto; flex-wrap: nowrap; gap: .4rem; }
        .fv-toolbar .fv-actions { order: 2; justify-self: auto; gap: .4rem; }
        .fv-toolbar .zoom-group { order: 3; flex: 1 1 100%; justify-self: auto; justify-content: center; padding: .18rem; }
        .fv-toolbar .tbtn { min-height: 38px; padding: .32rem .6rem; font-size: .9rem; white-space: nowrap; }
        .fv-toolbar .tbtn.icon-btn { width: 38px; height: 38px; min-height: 38px; padding: 0; }
        .fv-toolbar .zoom-group .tbtn { min-width: 36px; min-height: 34px; font-size: 1.1rem; }
        .fv-toolbar .zoomval { min-width: 3rem; font-size: .95rem; }
      }

      /* ---------- toast ---------- */
      .toast {
        position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(20px);
        background: var(--green-deep); color: #fff; padding: .7rem 1.2rem; border-radius: 999px;
        font-size: .95rem; opacity: 0; pointer-events: none; transition: .25s; z-index: 120;
        box-shadow: var(--shadow); max-width: min(92vw, 560px); text-align: center;
      }
      .toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

      /* ---------- responsive ---------- */
      @media (max-width: 1250px) {
        .reader { grid-template-columns: 104px minmax(0, 1fr) 250px; }
        .promo-slot.tall { min-height: 380px; }
      }
      @media (max-width: 1020px) {
        .reader { grid-template-columns: 104px minmax(0, 1fr); }
        .promo-col { grid-column: 1 / -1; position: static; display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
        .promo-col h2 { grid-column: 1 / -1; }
        .promo-slot.tall { min-height: 250px; }
      }
      @media (max-width: 880px) {
        .reader { grid-template-columns: minmax(0, 1fr); }
        /* mobile order: newspaper page first, then সব পাতা at the end of the
           paper — in the spot where the first advertisement was — ads after it */
        .stage-col { order: 1; }
        .thumbs { order: 2; position: static; flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
        .thumbs h2 { width: 100%; }
        .thumbs .thumb { width: 100px; flex: none; }
        .promo-col { order: 3; grid-template-columns: 1fr; }
        .page-scroll { max-height: none; }
        .modal.clip-modal { padding: .7rem; }
        .masthead .meta { margin-left: 0; text-align: left; }
        .masthead-banner { order: 3; flex-basis: 100%; max-width: none; }
        footer .wrap { grid-template-columns: 1fr; gap: 1.4rem; }
        .navarrow { width: 44px; height: 44px; font-size: 1.4rem; }
      }

      /* ---------- phones ---------- */
      @media (max-width: 640px) {
        /* mobile header slimmed down: the whole top strip (dates / times /
           archive button) is hidden so the header stays short */
        .topstrip { display: none; }

        /* masthead: ONLY the CodeZen IT brand name stays — the header ad
           slot and the edition meta (আজকের ই-পেপার / দ্বিতীয় সংস্করণ /
           date stamp) are hidden on phones; desktop keeps all of them */
        .masthead .wrap { flex-direction: column; align-items: center; text-align: center; gap: 0; padding: .7rem .75rem .75rem; }
        .masthead .logo-text { font-size: 1.5rem; }
        .masthead .meta { display: none; }
        .masthead-banner { display: none; }

        /* main menu: page numbers + next on the left, সব পাতা pushed right —
           one compact row, numbers keep their natural width */
        nav.mainnav .wrap { flex-wrap: nowrap; padding: 0 .25rem; }
        nav.mainnav button { flex: none; text-align: center; padding: .55rem .5rem; font-size: .98rem; white-space: nowrap; }
        nav.mainnav .pagenum { min-width: 40px; padding-left: .3rem; padding-right: .3rem; }
        nav.mainnav .allpages { margin-left: auto; }

        /* reader toolbar: phones — ONE single line with four things:
           প্রথম পাতা · জুম ইন/আউট · ফুল ভিউ · ডাউনলোড
           (no সব পাতা button here — সব পাতা lives in the nav and in the
           thumbnail section at the end of the paper, so it isn't duplicated.
           The page title keeps its natural width; the three controls —
           zoom, ফুল ভিউ, ডাউনলোড — grow equally to fill the rest of the
           line, so ডাউনলোড ends flush at the right edge with no empty
           gap after it.) */
        .toolbar {
          display: flex; flex-wrap: nowrap; gap: .3rem;
          padding: .6rem .45rem .1rem; align-items: center;
        }
        .toolbar .pagetitle { flex: none; font-size: 1rem; white-space: nowrap; line-height: 1.2; }
        .toolbar .spacer { display: none; }
        #allPagesBtn { display: none !important; }
        .toolbar .zoom-group { flex: 1 1 0; justify-content: center; padding: .14rem; gap: .12rem; }
        .toolbar .zoomval { min-width: 2.55rem; font-size: .88rem; }
        .toolbar .zoom-group .tbtn { min-width: 28px; min-height: 28px; font-size: 1rem; padding: 0; }
        .tbtn.eq { width: auto; min-height: 34px; padding: .28rem .5rem; font-size: .88rem; }
        #fullViewBtn { flex: 1 1 0; width: auto; justify-content: center; white-space: nowrap; }
        #dlPage { flex: 1 1 0; width: auto; height: 34px; min-height: 34px; padding: 0; justify-content: center; }
        #dlPage svg { width: 17px; height: 17px; }

        /* reader: page runs (nearly) full screen — frame and padding removed */
        .reader { padding: .5rem 0 1.4rem; gap: .85rem; }
        .stage { padding: 0; border: 0; border-radius: 0; background: transparent; }
        .page-scroll { border-radius: 0; }
        .page-wrap { box-shadow: none; }
        .thumbs, .promo-col { padding-left: .6rem; padding-right: .6rem; }
        /* prev/next: no round badge — just the arrow in the header's primary colour */
        .navarrow {
          width: 40px; height: 40px; font-size: 1.7rem;
          background: transparent; border: 0; box-shadow: none; color: var(--masthead);
        }
        .navarrow:hover { background: transparent; color: var(--masthead); }
        .navarrow:disabled { background: transparent; color: var(--muted); opacity: .55; }
        .navarrow.prev { left: 2px; }
        .navarrow.next { right: 2px; }
        .thumbs { gap: .6rem; }
        .thumbs .thumb { flex: 1 1 0; width: auto; max-width: 168px; padding: 5px; }
        .thumbs .thumb .lbl { font-size: .88rem; }
        .promo-slot.wide { min-height: 150px; }
        .promo-slot.tall { min-height: 180px; }
        .promo-col { gap: .7rem; }

        /* all-pages grid: two neat columns instead of one huge card */
        .allpages-view { padding: .4rem .75rem 2rem; }
        .allpages-view h2 { font-size: 1.12rem; margin-bottom: .8rem; }
        .pages-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
        .pages-grid .thumb .lbl { font-size: .92rem; }

        .prefooter-banner { padding: 0 .6rem 1.1rem; }
        .prefooter-banner .promo-slot { min-height: 90px; }

        /* popups: use the full phone width, actions wrap evenly */
        .overlay { padding: .5rem; }
        .modal { padding: .95rem; margin-top: 2vh; }
        .modal.clip-modal { height: calc(100dvh - 1rem); padding: .8rem; }
        .clip-toolbar { gap: .45rem; }
        .clip-toolbar .tbtn { flex: 1 1 auto; justify-content: center; padding: .42rem .5rem; font-size: .92rem; }
        .clip-toolbar .zoom-group { flex: none; }
        .clip-toolbar .zoom-group .tbtn { flex: none; }
        .clip-toolbar > span { display: none; }
        .cal-grid button { min-height: 40px; }
        .toast { bottom: 14px; font-size: .9rem; }
      }
      @media (max-width: 380px) {
        .topstrip .dates { grid-template-columns: 1fr; }
        .topstrip .dates span:nth-child(even) { text-align: left; }
        .thumbs .thumb { max-width: 150px; }
        /* extra-narrow phones: keep the four toolbar items on one line */
        .toolbar { gap: .25rem; padding-left: .4rem; padding-right: .4rem; }
        .toolbar .pagetitle { font-size: .92rem; }
        .toolbar .zoomval { min-width: 2.3rem; font-size: .84rem; }
        .toolbar .zoom-group .tbtn { min-width: 26px; min-height: 26px; }
        .tbtn.eq { padding: .26rem .4rem; font-size: .84rem; }
        #dlPage { height: 32px; min-height: 32px; }
      }
      @media (prefers-reduced-motion: reduce) {
        html { scroll-behavior: auto; }
        .toast { transition: none; }
      }