  :root{
    color-scheme: dark;
    --bg-deep:#0a1122;
    --bg-panel:#111b30;
    --bg-panel-2:#0d1626;
    --bg-card:#182544;
    --line:rgba(242,166,90,0.16);
    --line-soft:rgba(237,239,246,0.08);
    /* a more visible neutral (white-ish, not orange like --line-strong)
       border for cases where --line-soft reads as barely-there */
    --line-soft-strong:rgba(237,239,246,0.28);
    --line-strong:rgba(242,166,90,0.45);
    --orange:#f2a65a;
    --orange-soft:#ffd9a0;
    --orange-deep:#e6a05a;
    --text:#edeff6;
    --muted:#c3c9dc;
    --muted-dim:#98a1bc;
    --green-ok:#7fd8a0;
    --error-text:#ffb3b3;
    --yellow:#f2d94a;
    --purple:#b98af2;
    --pink:#f28ad0;
    --blue:#7ec4f2;
    --teal:#6fd6cf;
    --coral:#ff8f7a;
    --indigo:#a3b4ff;
    --brd-prep: rgba(127,216,160,0.65);
    --brd-camp1: rgba(242,217,74,0.65);
    --brd-camp2: rgba(230,160,90,0.65);
    /* semantic accent-tint tokens: the same handful of "how strong should
       this wash of the accent color be" roles (subtle bg, hover bg, hover
       border) kept getting reinvented with a slightly different alpha at
       each call site (0.04/0.06/0.08/0.1/0.12... for what was meant to be
       the same "subtle" role) -- these three are that role, named once */
    --tint-weak: rgba(242,166,90,0.08);
    --tint-hover: rgba(242,166,90,0.14);
    --border-hover: rgba(242,166,90,0.5);
    --text-on-accent: #1a1005;
    /* fixed (non-theme-reactive) palette for the ท้องฟ้าจำลอง module only:
       its UI chrome sits on an always-dark canvas regardless of site
       theme (like video-player controls), so it must NOT inherit the
       light-mode overrides below -- these are declared once, here, and
       intentionally never redefined under body.light-mode */
    --sky-bg: rgba(255,255,255,0.08);
    --sky-border: rgba(255,255,255,0.2);
    --sky-popup-bg: rgba(12,14,24,0.97);
    --sky-popup-border: rgba(255,255,255,0.18);
    --sky-text: #eef0f6;
    --sky-text-muted: #9aa0b8;
    --sky-accent: #f2a65a;
    --sky-accent-soft: #ffd9a0;
    --sky-accent-active-bg: rgba(242,166,90,0.28);
    --sky-accent-active-border: rgba(242,166,90,0.6);
  }
  /* plain dark theme: the default colours on a slightly darker, starless
     page (04's drawStars paints the canvas the same colour) */
  body.plain-dark{ --bg-deep:#070c19; }
  body.light-mode{
    color-scheme: light;
    --bg-deep:#ffffff;
    --bg-panel:#ffffff;
    --bg-panel-2:#ffffff;
    --bg-card:#ffffff;
    --line:rgba(217,130,43,0.25);
    --line-soft:rgba(20,20,30,0.09);
    --line-soft-strong:rgba(20,20,30,0.22);
    --line-strong:rgba(217,130,43,0.55);
    --orange:#d9822b;
    --orange-soft:#b8631a;
    --orange-deep:#b77a48;
    --text:#1c1f2a;
    --muted:#5a6076;
    --muted-dim:#8b91a6;
    --green-ok:#2f9a5c;
    --error-text:#c0392b;
    --yellow:#a17d0a;
    --purple:#8e44ad;
    --pink:#c2185b;
    --blue:#1f6fa8;
    --teal:#12807a;
    --coral:#c8462e;
    --indigo:#3f51b5;
    --tint-weak: rgba(217,130,43,0.08);
    --tint-hover: rgba(217,130,43,0.14);
    --border-hover: rgba(217,130,43,0.5);
  }
  *{box-sizing:border-box; margin:0; padding:0;}
  /* scrollbar-gutter: the width is the same before and after the page grows
     tall enough to scroll, so the home banner's early sizing (inline script
     in the HTML) is already final */
  html{scroll-behavior:smooth; scroll-padding-top:var(--top-strip-h); scrollbar-gutter:stable;}
  /* every scrollbar on the site, the page's own included: thin, rounded,
     theme-coloured, never the platform default (owner's rule). Places with
     their own look (sidebar, planetarium, search) override these. In
     Chromium the standard properties win over ::-webkit-scrollbar, which is
     kept for older WebKit/Safari. */
  :root{ --scroll-thumb:rgba(150,165,200,0.34); --scroll-thumb-hover:rgba(150,165,200,0.55); }
  body.light-mode{ --scroll-thumb:rgba(20,30,60,0.22); --scroll-thumb-hover:rgba(20,30,60,0.38); }
  html{ scrollbar-color:var(--scroll-thumb) transparent; }
  *{ scrollbar-width:thin; }
  body.light-mode, body.light-mode *{ scrollbar-color:var(--scroll-thumb) transparent; }
  ::-webkit-scrollbar{ width:10px; height:10px; }
  ::-webkit-scrollbar-track{ background:transparent; }
  ::-webkit-scrollbar-thumb{ background:var(--scroll-thumb); border-radius:10px; border:2px solid transparent; background-clip:padding-box; }
  ::-webkit-scrollbar-thumb:hover{ background-color:var(--scroll-thumb-hover); }
  ::-webkit-scrollbar-corner{ background:transparent; }

  /* option lists of every <select> (js/20-ui-select.js replaces the native
     popup): a small card in the site's style, above modals and the
     planetarium */
  .nsel-pop{
    position:fixed; z-index:10000; overflow-y:auto; overflow-x:hidden; padding:5px; border-radius:10px;
    background:var(--bg-panel); border:1px solid var(--line-soft-strong);
    box-shadow:0 14px 34px rgba(0,0,0,0.45); font-size:13.5px; color:var(--text);
  }
  body.light-mode .nsel-pop{ box-shadow:0 12px 28px rgba(20,30,60,0.16); }
  .nsel-opt{ padding:7px 12px; border-radius:7px; cursor:pointer; white-space:nowrap; }
  .nsel-opt.is-hi{ background:var(--tint-hover, rgba(255,255,255,0.08)); }
  .nsel-opt.is-sel{ color:var(--orange-soft); font-weight:600; }
  body.light-mode .nsel-opt.is-sel{ color:var(--orange-deep); }
  .nsel-opt.is-dis{ opacity:0.4; cursor:default; }
  /* planetarium selects: always dark, like the module */
  .nsel-pop.is-sky{ background:#0d1426; border-color:rgba(255,255,255,0.16); color:#e6e9f2; scrollbar-color:rgba(255,255,255,0.28) transparent; }
  .nsel-pop.is-sky .nsel-opt.is-hi{ background:rgba(255,255,255,0.1); }
  .nsel-pop.is-sky .nsel-opt.is-sel{ color:#ffd9a0; }
  /* closed selects that still showed the browser's arrow get the same
     small chevron as the rest of the site */
  .cal-nav select, .week-picker{
    appearance:none; -webkit-appearance:none; -moz-appearance:none; padding-right:24px;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa3bd' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat:no-repeat; background-position:right 6px center; background-size:13px;
  }
  select.nsel-open{ border-color:var(--border-hover); }
  /* no elastic overscroll ("rubber-band" bounce on touchpads / iOS, which
     dragged the page down and showed a gap under the fixed top bar above
     the full-bleed home banner). Also turns off pull-to-refresh on mobile.
     The x axis too: a sideways two-finger swipe on a touchpad otherwise
     triggers the browser's back/forward gesture, and every page here is a
     history entry, so a stray swipe jumped to another page. Sideways
     scrollers (rails, tabs) still scroll; only the page-level gesture goes. */
  html, body{ overscroll-behavior:none; }
  body{
    background:var(--bg-deep);
    color:var(--text);
    font-family:'Chakra Petch',sans-serif;
    min-height:100vh;
    overflow-x:hidden;
    position:relative;
  }
  h1,h2,h3,h4,.display{ font-family:'Chakra Petch',sans-serif; }
  ::selection{ background:var(--orange); color:#1a1005; }
  a{ color:inherit; }
  button{ font-family:inherit; cursor:pointer; }

  #stars-static{
    position:fixed; inset:0; z-index:0; pointer-events:none;
  }
  .shooting-layer{
    position:fixed; inset:0; z-index:0; pointer-events:none; overflow:hidden;
  }
  .shoot{
    position:absolute;
    width:2px; height:2px;
    background:linear-gradient(90deg, rgba(255,217,160,0.45), rgba(255,217,160,0));
    border-radius:2px;
    opacity:0;
    filter:drop-shadow(0 0 3px rgba(255,217,160,0.4));
    transform:rotate(var(--rot, -35deg));
  }
  .shoot::before{
    content:"";
    position:absolute; right:0; top:-1px;
    width:5px; height:4px;
    background:var(--orange-soft);
    border-radius:50%;
    box-shadow:0 0 6px 1px rgba(255,217,160,0.45);
    opacity:0.5;
  }
  @keyframes shootAcross{
    0%{ opacity:0; transform:translate(0,0) rotate(var(--rot, -35deg)) scaleX(0.3); }
    5%{ opacity:0.5; }
    70%{ opacity:0.4; }
    100%{ opacity:0; transform:translate(var(--tx, -420px), var(--ty, 300px)) rotate(var(--rot, -35deg)) scaleX(1); }
  }

  /* full-width bar fixed to the top of the viewport (above the sidebar too),
     holding the sidebar toggle on the left and the search/theme/profile/
     options cluster on the right -- .sidebar and main both get pushed down
     by --top-strip-h so nothing renders underneath it */
  :root{ --top-strip-h:60px; }
  .top-strip{
    position:fixed; top:0; left:0; right:0; z-index:80; height:var(--top-strip-h);
    display:flex; align-items:center; justify-content:space-between;
    padding:0 16px; gap:14px;
    /* no backdrop-filter -- blur() on a fixed bar stacked above another
       fixed overlay is a known culprit for touch/hit-test glitches on
       some mobile browsers (buttons visually present but not receiving
       taps); a slightly more opaque solid background gets a similar
       look without that risk. */
    background:rgba(10,17,34,0.94);
    border-bottom:1px solid var(--line-soft);
  }
  body.light-mode .top-strip{ background:rgba(255,255,255,0.96); }
  /* groups the sidebar toggle + mode switch as one left-hugging cluster --
     .top-strip's justify-content:space-between then only has two items
     to split (this group and .topbar), so the switch sits right next to
     the hamburger instead of floating in a middle gap of its own */
  .topbar-left-group{ display:flex; align-items:center; gap:10px; flex-shrink:0; }
  /* logo in the top bar, next to ☰ -- only where the sidebar's logo can't
     be seen: desktop with the sidebar collapsed, and mobile, where the
     sidebar is a closed drawer. Left-aligned rather than centred: centred,
     it collided with the right-side icon cluster on ~320px phones */
  .topbar-logo{ display:none; height:28px; width:auto; cursor:pointer; }
  body.light-mode .topbar-logo.logo-dark{ display:none !important; }
  body:not(.light-mode) .topbar-logo.logo-light{ display:none !important; }
  @media (min-width:881px){
    body.sidebar-hidden .topbar-logo{ display:block; }
  }
  @media (max-width:880px){
    .topbar-logo{ display:block; height:26px; }
  }
  .topbar{
    display:flex; align-items:center; gap:10px;
  }
  /* ดาราศาสตร์/ฟิสิกส์ switch -- lives inside .topbar now, right next to
     the search button, so it sits flush with the rest of the right-side
     icon cluster instead of floating alone in the middle of the bar.
     One pill (overflow:hidden clips both buttons to the container's own
     rounded corners), flat down the middle where the two halves meet --
     not two separately-rounded shapes -- with a plain 1px border as the
     "|" divider and the active half getting a solid fill instead of a
     floating rounded thumb. */
  .site-mode-switch{
    position:relative; display:flex; align-items:stretch; flex-shrink:0;
    background:var(--bg-card); border:1px solid var(--line-soft); border-radius:999px;
    overflow:hidden;
  }
  .mode-switch-opt{
    position:relative; display:flex; align-items:center; justify-content:center; gap:7px;
    background:none; border:none; padding:7px 15px; cursor:pointer;
    color:var(--muted); font-size:13px; font-family:inherit; white-space:nowrap;
    transition:color .2s ease, background .2s ease;
  }
  .mode-switch-astro{ border-right:1px solid var(--line-soft); }
  .mode-switch-icon{ display:flex; flex-shrink:0; }
  .mode-switch-icon svg{ width:16px; height:16px; }
  .mode-switch-astro{ color:#fff; background:linear-gradient(135deg, var(--orange-deep), var(--orange)); }
  body.physics-mode .mode-switch-astro{ color:var(--muted); background:none; }
  body.physics-mode .mode-switch-physics{ color:#fff; background:linear-gradient(135deg, rgb(130,60,200), rgb(168,85,247)); }
  /* physics track is switched off for now (see PHYSICS_ENABLED) -- keep
     the pill visible as a "coming soon" hint but greyed out and unclickable */
  .mode-switch-opt:disabled{ cursor:not-allowed; opacity:0.45; }
  /* narrow screens: drop the text label out of the row and show it as a
     tiny dim caption under the icon instead -- the icon (a custom-drawn
     telescope/atom, not a relied-on-OS emoji glyph) becomes the primary
     identifier, the caption is just a hint, not a full label anymore */
  @media (max-width:620px){
    .mode-switch-opt{ flex-direction:column; gap:2px; padding:6px 16px; }
    .mode-switch-icon svg{ width:18px; height:18px; }
    .mode-switch-label{ font-size:8.5px; opacity:0.65; font-weight:400; letter-spacing:0.01em; }
  }
  .topbar-btn{
    display:flex; align-items:center; gap:8px;
    background:var(--bg-card); border:1px solid var(--line-soft);
    border-radius:999px; padding:8px 14px; font-size:13px; color:var(--text);
    transition:border-color .2s ease, transform .15s ease;
  }
  .topbar-btn:hover{ border-color:var(--border-hover); transform:translateY(-1px); }
  /* icon-only search button -- same 38px circle as .topbar-dots, sitting
     right next to the theme toggle; the light-blue glyph (--blue, which is
     redefined darker for light mode) on a faint blue tint keeps it soft
     against the navy bar instead of a full-width pill */
  .topbar-search-icon{
    width:38px; height:38px; border-radius:50%; flex-shrink:0; padding:0; cursor:pointer;
    display:flex; align-items:center; justify-content:center;
    background:rgba(126,196,242,0.08); border:1px solid rgba(126,196,242,0.22);
    color:var(--blue);
    transition:border-color .2s ease, background .2s ease, transform .15s ease;
  }
  .topbar-search-icon svg{ width:18px; height:18px; }
  .topbar-search-icon:hover{ background:rgba(126,196,242,0.16); border-color:rgba(126,196,242,0.5); transform:translateY(-1px); }
  .topbar-search-icon:focus-visible{ outline:2px solid var(--blue); outline-offset:2px; }
  body.light-mode .topbar-search-icon{ background:rgba(31,111,168,0.07); border-color:rgba(31,111,168,0.22); }
  body.light-mode .topbar-search-icon:hover{ background:rgba(31,111,168,0.14); border-color:rgba(31,111,168,0.45); }
  .topbar-avatar{
    width:24px; height:24px; border-radius:50%;
    background:linear-gradient(135deg, var(--orange-soft), var(--orange-deep));
    display:flex; align-items:center; justify-content:center;
    font-family:'Chakra Petch',sans-serif; font-weight:700; font-size:11px; color:#1a1005;
    flex-shrink:0;
  }
  .topbar-dots{
    width:38px; height:38px; border-radius:50%;
    background:var(--bg-card); border:1px solid var(--line-soft);
    display:flex; align-items:center; justify-content:center;
    font-size:18px; letter-spacing:1px; color:var(--muted); line-height:0;
    transition:border-color .2s ease, transform .15s ease;
  }
  .topbar-dots:hover{ border-color:var(--border-hover); transform:translateY(-1px); color:var(--orange-soft); }
  .topbar-dropdown{
    position:absolute; top:calc(100% + 10px); right:0;
    background:var(--bg-panel); border:1px solid var(--line-soft); border-radius:8px;
    padding:8px; min-width:190px; display:none; flex-direction:column; gap:2px;
    box-shadow:0 12px 30px rgba(0,0,0,0.35);
  }
  .topbar-dropdown.show{ display:flex; }
  .dd-item{
    display:flex; align-items:center; gap:10px; width:100%; text-align:left;
    background:none; border:none; color:var(--text); font-size:13.5px;
    padding:10px 12px; border-radius:8px; transition:background .15s ease;
  }
  .dd-item:hover{ background:var(--bg-panel-2); }
  .dd-item .ic{ font-size:14px; width:18px; text-align:center; }
  .dd-sep{ height:1px; background:var(--line-soft); margin:4px 2px; }
  /* ⋯ menu: ธีม choices, the one in use ticked */
  .dd-head{ font-size:12px; font-weight:600; color:var(--muted); padding:6px 12px 2px; }
  .dd-theme .dd-check{ flex:none; width:16px; height:16px; color:var(--teal); visibility:hidden; }
  .dd-theme.active .dd-check{ visibility:visible; }
  .dd-theme.active{ font-weight:600; }
  .dd-sub{ margin-left:auto; padding-left:14px; font-size:12px; font-weight:400; color:var(--muted); white-space:nowrap; }

  .field-popup-wrap{ position:relative; width:100%; }
  .inline-popup{
    max-height:0; overflow:hidden; opacity:0;
    background:rgba(228,106,106,0.14); border:1px solid rgba(228,106,106,0.4);
    color:var(--error-text); font-size:13.5px; border-radius:8px;
    margin-top:0; padding:0 13px;
    transition:max-height .25s ease, opacity .2s ease, margin-top .25s ease, padding .25s ease;
  }
  .inline-popup.show{ max-height:80px; opacity:1; margin-top:10px; padding:10px 13px; }
  .inline-popup.warn{ background:var(--tint-hover); border-color:rgba(242,166,90,0.4); color:var(--orange-soft); }

  .pin-input-row{ display:flex; gap:8px; justify-content:center; margin:6px 0 16px; }
  .pin-box{
    width:44px; height:54px; text-align:center; font-size:22px; font-weight:700;
    background:var(--bg-card); border:1px solid var(--line-soft); border-radius:8px;
    color:var(--text); font-family:inherit;
  }
  .pin-box:focus{ outline:none; border-color:var(--orange); box-shadow:0 0 0 3px rgba(242,166,90,0.2); }

  /* weekly-quiz login lock */
  #sec-weekly{ position:relative; }
  .quiz-content-wrap.blurred{ filter:blur(6px); pointer-events:none; user-select:none; }
  .quiz-lock-overlay{
    display:none; position:fixed; inset:0; z-index:50;
    align-items:center; justify-content:center; text-align:center; padding:20px;
    pointer-events:none; /* let clicks reach the sidebar nav / topbar underneath */
  }
  .quiz-lock-overlay.show{ display:flex; }
  /* weekly quiz paused (WEEKLY_QUIZ_LIVE = false): sec-weekly becomes a
     free, login-free practice bank built from every staged week's set --
     the live-week UI stays in the markup, just hidden, so flipping the
     flag back restores it as-is */
  .weekly-archive-only{ display:none; }
  body.weekly-archive .weekly-archive-only{ display:revert; }
  body.weekly-archive .weekly-live-only{ display:none !important; }
  .quiz-lock-overlay .qlo-box{
    background:var(--bg-card); border:1px solid var(--line); border-radius:8px;
    padding:32px 36px; max-width:380px; box-shadow:0 20px 50px rgba(0,0,0,0.4);
    pointer-events:auto; /* the message box itself stays interactive */
  }

  /* coming soon overlay for weekly-quiz levels with no questions yet */
  .coming-soon-blurred{ filter:blur(5px); pointer-events:none; user-select:none; }
  .coming-soon-overlay{
    position:absolute; inset:0; z-index:20;
    display:flex; align-items:center; justify-content:center; text-align:center; padding:20px;
  }
  .coming-soon-overlay .cso-box{
    background:var(--bg-card); border:1px solid var(--line); border-radius:8px;
    padding:26px 30px; max-width:340px; box-shadow:0 20px 50px rgba(0,0,0,0.4);
  }
  .coming-soon-overlay .cso-box h3{ font-size:16px; margin-bottom:6px; }
  .coming-soon-overlay .cso-box p{ font-size:13px; color:var(--muted); }

  /* top-of-screen toast*/
  .top-toast{
    position:fixed; top:18px; left:50%; transform:translateX(-50%) translateY(-14px);
    z-index:500; background:var(--bg-card); border:1px solid var(--orange); border-radius:8px;
    padding:12px 20px; font-size:13.5px; color:var(--text); text-align:center; line-height:1.7;
    box-shadow:0 10px 30px rgba(0,0,0,0.35); opacity:0; pointer-events:none;
    transition:opacity .25s ease, transform .25s ease; max-width:min(90vw, 480px);
  }
  .top-toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }
  .top-toast b{ color:var(--orange-soft); }

  /* password field (no custom show/hide button: it collided with the
     browser's own reveal icon in Edge) */
  .pass-field{ position:relative; }

  /* small tags for camp / part labels */
  .badge-row{ display:flex; gap:6px; flex-wrap:wrap; margin-bottom:12px; }
  .tag-line{ font-size:12.5px; color:var(--muted); margin-bottom:12px; }
  .detail-top-row{ display:flex; align-items:flex-start; justify-content:space-between; gap:12px; flex-wrap:wrap; }
  .detail-top-row .badge-row{ margin-bottom:12px; }
  .detail-top-back{ flex:0 0 auto; white-space:nowrap; }
  .badge{
    font-size:12.5px; padding:4px 10px; border-radius:999px;
    border:1px solid var(--line); color:var(--orange-soft);
    background:var(--tint-weak); font-family:'Chakra Petch',sans-serif; letter-spacing:0.02em;
  }
  .badge.prep{ border-color:rgba(127,216,160,0.4); color:var(--green-ok); background:rgba(127,216,160,0.08); }
  .badge.camp2{ border-color:rgba(230,160,90,0.4); color:var(--orange-deep); background:rgba(230,160,90,0.1); }
  .badge.part{ border-color:var(--line-soft); color:var(--muted); background:transparent; }

  /* weekly problem section */
  /* attached-tab look, matching .skyview-quiz-tab: flat-bottomed tabs that
     overlap the panel's top border by 1px and share its background/border
     color when active, so the active tab reads as part of the panel below
     instead of a separate floating pill. */
  /* small left offset so the first tab clears the panel's own rounded
     corner below it instead of overhanging past the curve */
  .week-tabs{ display:flex; gap:2px; flex-wrap:wrap; margin-left:8px; }
  .week-tab{
    background:rgba(255,255,255,0.03); border:1px solid var(--line-soft); border-bottom:none;
    border-radius:10px 10px 0 0; padding:10px 16px; font-size:13.5px; color:var(--muted);
    cursor:pointer; position:relative; margin-bottom:-1px; z-index:0;
  }
  .week-tab:not(.active):hover{ background:rgba(255,255,255,0.08); color:var(--text); }
  .week-tab.active{ border-color:var(--orange); color:var(--text); background:var(--bg-card); font-weight:700; z-index:1; }
  /* per-level active color, matching each level's real color elsewhere
     on the site (.clr-prep/.clr-camp1/.clr-camp2) -- the generic orange
     above doesn't distinguish camp1/camp2 from prep at a glance. */
  .week-tab[data-week="prep"].active{ border-color:var(--green-ok); }
  .week-tab[data-week="camp1"].active{ border-color:var(--yellow); }
  .week-tab[data-week="camp2"].active{ border-color:var(--orange-deep); }
  .week-panel{ display:none; }
  .week-panel.active{ display:block; }
  .week-reset-bar{
    font-size:13px; color:var(--muted); margin-bottom:20px;
    display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  }
  .week-reset-bar b{ color:var(--orange-soft); }
  .prev-week-picker-row{ display:flex; align-items:center; gap:8px; margin-top:10px; }
  .prev-week-picker-row label{ font-size:13px; color:var(--muted); }
  .week-picker{
    background-color:var(--bg-card); border:1px solid var(--line-strong); border-radius:8px;
    color:var(--text); font-size:13px; font-weight:600; padding:7px 28px 7px 11px; font-family:'Chakra Petch',sans-serif;
    cursor:pointer;
  }
  .week-picker option{ background:var(--bg-card); color:var(--text); font-weight:500; }
  .part-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:16px; }
  .part-card{
    background:var(--bg-card); border:1px solid var(--line-soft); border-radius:8px; padding:20px;
    display:flex; flex-direction:column; gap:8px;
  }
  .part-card .part-tag{ font-size:13px; color:var(--orange-soft); font-family:'Chakra Petch',sans-serif; letter-spacing:0.05em; }
  .part-card h4{ font-size:16px; }
  .part-card .desc{ font-size:14px; color:var(--muted); line-height:1.65; flex:1; }

  .prev-week-card{
    background:var(--bg-card); border:1px solid var(--line-soft); border-radius:8px; padding:18px 20px;
    display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom:20px;
  }
  .prev-week-card .part-tag{ font-size:13px; color:var(--orange-soft); font-family:'Chakra Petch',sans-serif; letter-spacing:0.05em; }
  .prev-week-card h4{ font-size:16px; margin:4px 0 6px; }
  .prev-week-card .desc{ font-size:13.5px; color:var(--muted); line-height:1.65; max-width:560px; }
  button.prev-week-card{ width:100%; text-align:left; cursor:pointer; border-color:rgba(242,166,90,0.4); transition:background .2s ease, transform .15s ease; color:var(--text); font-family:inherit; }
  button.prev-week-card:hover{ background:var(--tint-weak); transform:translateX(-2px); }
  button.prev-week-card .pwc-arrow{ font-size:22px; color:var(--orange); flex-shrink:0; }

  /* content view button */
  .topic-actions{ display:flex; justify-content:flex-end; margin-top:4px; }

  .section-nav{ display:flex; margin-top:48px; padding-top:20px; border-top:1px solid var(--line-soft); }
  .section-nav-next.section-nav-next{ margin-left:auto; }

  .shell{
    position:relative; z-index:1;
    display:grid;
    /* minmax(0,1fr), not a bare 1fr -- a bare fr track's implicit minimum
       is auto (its content's min-content size), so any wide descendant
       (e.g. the star reference table's nowrap cells) silently forces
       this whole track past the viewport width instead of staying
       capped at the space actually available */
    grid-template-columns:250px minmax(0,1fr);
    min-height:100vh;
    transition:grid-template-columns .25s ease;
  }
  @media (max-width:880px){
    .shell{ grid-template-columns:minmax(0,1fr); }
  }
  @media (min-width:881px){
    /* collapsing the sidebar only ever slid it away with `transform` --
       the grid still reserved its 250px track, so content stayed shifted
       into the remaining column instead of re-centering across the full
       width. Zero out that track's width instead of dropping the column
       entirely -- the sidebar is position:sticky here (a real grid item,
       unlike on mobile where it's position:fixed and out of flow), so
       going to a single column left no cell for it to share with main,
       and grid auto-placement pushed main into a second row below it. */
    body.sidebar-hidden .shell{ grid-template-columns:0 minmax(0,1fr); }
  }

  .sidebar{
    background:linear-gradient(180deg, var(--bg-panel), var(--bg-panel-2));
    border-right:1px solid var(--line-soft);
    padding:28px 20px;
    display:flex; flex-direction:column;
    position:sticky; top:var(--top-strip-h); height:calc(100vh - var(--top-strip-h));
    /* explicit width -- without it, this box just stretches to fill
       whatever its grid column currently measures, so animating that
       column's width (for the collapse-when-hidden effect) dragged the
       sidebar's own rendered width down with it, squeezing/reflowing its
       text instead of just sliding the box off-screen via `transform`. */
    width:250px;
    overflow-y:auto;
    transition:transform .25s ease;
    scrollbar-width:thin;
    scrollbar-color:var(--line-soft) transparent;
  }
  .sidebar::-webkit-scrollbar{ width:8px; }
  .sidebar::-webkit-scrollbar-track{ background:transparent; }
  .sidebar::-webkit-scrollbar-thumb{ background-color:var(--line-soft); border-radius:8px; }
  .sidebar::-webkit-scrollbar-thumb:hover{ background-color:var(--line); }
  @media (max-width:880px){
    .sidebar{
      position:fixed; top:var(--top-strip-h); left:0; height:calc(100vh - var(--top-strip-h)); width:250px; max-width:82vw;
      z-index:70; border-right:1px solid var(--line-soft); border-bottom:none;
      transform:translateX(-100%);
      box-shadow:0 0 40px rgba(0,0,0,0.45);
    }
  }
  @media (min-width:881px){
    body.sidebar-hidden .sidebar{ transform:translateX(-100%); }
  }
  @media (max-width:880px){
    body.sidebar-hidden .sidebar{ transform:translateX(0); }
  }

  .sidebar-toggle-btn{
    flex:none;
    width:34px; height:34px; border-radius:8px;
    background:var(--bg-card); border:1px solid var(--line);
    color:var(--text); cursor:pointer; font-size:15px; line-height:1;
    display:flex; align-items:center; justify-content:center;
    transition:background .15s ease;
  }
  .sidebar-toggle-btn:hover{ background:rgba(242,166,90,0.12); }

  /* stops below the top bar (not inset:0) rather than relying on z-index
     alone -- some mobile browsers mishandle hit-testing over a fixed,
     backdrop-filter'd element (the top bar) that's stacked above another
     fixed overlay, leaving its buttons unclickable while this is up; a
     backdrop that never geometrically overlaps the bar sidesteps that
     regardless of the exact compositing quirk. */
  .sidebar-backdrop{ display:none; position:fixed; top:var(--top-strip-h); left:0; right:0; bottom:0; background:rgba(0,0,0,0.5); z-index:65; }
  @media (max-width:880px){
    body.sidebar-hidden .sidebar-backdrop{ display:block; }
  }
  .brand{ margin-bottom:6px; }
  .brand-logo{ width:100%; max-width:200px; height:auto; display:block; cursor:pointer; }
  .brand-logo.logo-light{ display:none; }
  body.light-mode .brand-logo.logo-dark{ display:none; }
  body.light-mode .brand-logo.logo-light{ display:block; }
  .brand .logo-en{
    font-family:'Chakra Petch',sans-serif;
    font-size:15px; letter-spacing:0.06em; color:var(--muted);
    font-weight:500;
  }
  .brand .logo-th{
    font-family:'Chakra Petch',sans-serif;
    font-weight:700;
    font-size:30px;
    color:var(--orange-soft);
    line-height:1.1;
    margin-top:2px;
    text-shadow:0 0 18px rgba(242,166,90,0.35);
  }
  .brand .logo-sub{
    font-size:12px; color:var(--muted-dim); margin-top:6px; line-height:1.5;
  }

  .constellation-nav{
    margin-top:18px;
    position:relative;
    flex:1;
  }
  /* the line runs from the first node's centre to the last one's (item
     padding 11px + node radius 10px), so nothing sticks out below the last
     node, e.g. into the next group's title in the mobile drawer */
  .constellation-nav svg{
    position:absolute; left:9px; top:21px; height:calc(100% - 42px); width:2px; overflow:visible;
  }
  .nav-item{
    position:relative;
    display:flex; align-items:center; gap:14px;
    padding:11px 0 11px 0;
    background:none; border:none; text-align:left;
    width:100%;
    color:var(--muted);
    font-size:15px;
  }
  .nav-item .node{
    width:20px; height:20px; border-radius:50%;
    border:2px solid var(--muted-dim);
    background:var(--bg-panel-2);
    flex-shrink:0;
    position:relative;
    z-index:2;
    transition:all .25s ease;
  }
  .nav-item .node::after{
    content:""; position:absolute; inset:5px; border-radius:50%;
    background:transparent; transition:all .25s ease;
  }
  .nav-item .label{ transition:color .2s ease; }
  .nav-item .num{
    font-family:'Chakra Petch',sans-serif; font-size:11px; color:var(--muted-dim);
    display:block; letter-spacing:0.05em;
  }
  .nav-item:hover .label{ color:var(--orange-soft); }
  .nav-item.active .node{ border-color:var(--orange); box-shadow:0 0 12px rgba(242,166,90,0.6); }
  .nav-item.active .node::after{ background:var(--orange); }
  .nav-item.active .label{ color:var(--text); font-weight:600; }
  /* physics-mode nav list -- its own accent (purple) instead of the
     orange the astronomy list uses, so switching modes visibly changes
     the whole sidebar's identity, not just which items are in it.
     Only one of #mainNav/#physicsNav is ever shown, driven purely by
     body.physics-mode (toggled from applySection()). */
  #physicsNav{ display:none; }
  body.physics-mode #mainNav{ display:none; }
  body.physics-mode #physicsNav{ display:block; }
  .constellation-nav-physics .nav-item:hover .label{ color:rgb(196,150,250); }
  .constellation-nav-physics .nav-item.active .node{ border-color:rgb(168,85,247); box-shadow:0 0 12px rgba(168,85,247,0.6); }
  .constellation-nav-physics .nav-item.active .node::after{ background:rgb(168,85,247); }

  .side-foot{
    margin-top:20px; padding-top:18px; border-top:1px solid var(--line-soft);
    font-size:13px; color:var(--muted-dim); line-height:1.7;
  }
  .sidebar-auth{
    margin-top:20px; padding-top:20px; border-top:1px solid var(--line-soft);
  }
  .home-info-grid{ display:grid; grid-template-columns:1fr; gap:24px; margin-top:8px; }
  .home-astro-details{ margin-top:24px; }
  .home-astro-details h2{ font-size:19px; margin-bottom:10px; }
  .home-astro-details .placeholder-box{
    margin-top:6px; color:var(--muted); font-size:13.5px; line-height:1.85;
  }

  /* สอวน. timeline. Vertical by default (phones, narrow panes): a soft line
     down the left edge, ringed dots, text to the right. The line is one
     absolutely-positioned strip spanning first dot to last dot; each dot is
     its own item's ::before. Wide enough, it becomes the horizontal strip
     in the @container rule below. */
  .home-timeline{ margin-top:24px; container-type:inline-size; }
  .home-timeline h2{ font-size:19px; margin-bottom:18px; }
  .home-timeline-track{ position:relative; padding-left:28px; }
  .home-timeline-track::before{
    content:''; position:absolute; left:5px; top:8px; bottom:30px; width:2px; border-radius:2px;
    background:linear-gradient(180deg, rgba(242,166,90,0.5), rgba(242,166,90,0.14));
  }
  .home-timeline-axis{ display:none; }
  .home-timeline-item{ position:relative; padding-bottom:20px; }
  .home-timeline-item:last-child{ padding-bottom:0; }
  .home-timeline-item::before{
    content:''; position:absolute; left:-28px; top:3px; width:12px; height:12px;
    border-radius:50%; background:var(--dot-clr, var(--orange));
    box-shadow:0 0 0 4px color-mix(in srgb, var(--dot-clr, var(--orange)) 22%, transparent);
  }
  .home-timeline-period{
    font-family:'Chakra Petch',sans-serif; font-weight:700; font-size:12.5px;
    color:var(--dot-clr, var(--orange-soft)); letter-spacing:0.02em; margin-bottom:1px;
  }
  .home-timeline-label{ font-size:15px; font-weight:600; color:var(--text); }
  @container (min-width:780px){
    .home-timeline-track{
      --inset:18px; height:172px; padding:0; border:1px solid var(--line-soft); border-radius:12px;
      background:rgba(10,16,34,0.35); overflow:hidden;
    }
    body.light-mode .home-timeline-track{ background:rgba(255,255,255,0.6); }
    .home-timeline-track::before{ display:none; }
    .home-timeline-axis{ display:block; position:absolute; left:var(--inset); right:var(--inset); top:36px; height:1px; background:rgba(200,208,230,0.32); }
    body.light-mode .home-timeline-axis{ background:rgba(20,20,30,0.25); }
    .home-timeline-tick{
      position:absolute; left:calc(100% * var(--x)); top:-36px; height:172px; padding:8px 0 0 5px;
      border-left:1px solid rgba(200,208,230,0.1); font-size:11.5px; color:var(--muted); white-space:nowrap;
    }
    .home-timeline-tick.is-year{ border-left-color:rgba(200,208,230,0.34); color:var(--text); font-weight:600; }
    .home-timeline-brace{ position:absolute; left:calc(100% * var(--x)); width:calc(100% * var(--w)); top:2px; height:13px; overflow:visible; }
    .home-timeline-brace path{ fill:none; stroke:currentColor; stroke-width:1.6; vector-effect:non-scaling-stroke; }
    .home-timeline-item.is-range::before{ display:none; }
    .home-timeline-item.is-range::after{ top:15px; }
    .home-timeline-item, .home-timeline-item:last-child{
      position:absolute; top:36px; left:calc(var(--inset) + (100% - 2 * var(--inset)) * var(--x));
      padding:18px 0 0 9px; white-space:nowrap;
    }
    .home-timeline-item.lvl-2{ padding-top:70px; }
    .home-timeline-item.is-flip{ transform:translateX(-100%); padding-left:0; padding-right:9px; text-align:right; }
    .home-timeline-item::before{ left:-5px; top:-5px; width:10px; height:10px; box-shadow:0 0 0 3px color-mix(in srgb, var(--dot-clr, var(--orange)) 22%, transparent); }
    .home-timeline-item.is-flip::before{ left:auto; right:-5px; }
    .home-timeline-item::after{ content:''; position:absolute; left:0; top:0; bottom:2px; border-left:1.5px solid var(--dot-clr, var(--orange)); opacity:0.55; }
    .home-timeline-item.is-flip::after{ left:auto; right:0; }
    .home-timeline-label{ font-size:14px; }
  }

  /* margin-left/right are set numerically by updateShellMargins() (JS),
     not via `margin:auto` -- `auto` isn't an interpolatable value, so a
     class-toggled `margin:auto` rule snaps to its resolved pixel value
     the instant the class applies, before the (separately, smoothly
     animating) grid column has moved at all. Explicit px values on both
     sides transition together in step with the sidebar's own .25s ease
     so the whole thing reads as one continuous motion. */
  main{ position:relative; z-index:1; padding:calc(24px + var(--top-strip-h)) 44px 90px; max-width:1080px; transition:margin .25s ease; }
  @media (max-width:880px){ main{ padding:calc(16px + var(--top-strip-h)) 20px 70px; } }

  .section{ display:none; animation:fadeIn .5s ease; scroll-margin-top:var(--top-strip-h); }
  .section.active{ display:block; }
  @keyframes fadeIn{ from{opacity:0; transform:translateY(8px);} to{opacity:1; transform:translateY(0);} }

  #sec-skyview.section.active{ position:fixed; inset:0; z-index:150; margin:0; padding:0; background:#05070f; }
  #skyviewCanvas{ position:absolute; inset:0; width:100%; height:100%; cursor:grab; touch-action:none; display:block; }
  #skyviewCanvas:active{ cursor:grabbing; }
  .skyview-bar{
    position:absolute; top:0; left:0; right:0; z-index:2;
    display:flex; flex-wrap:wrap; align-items:center; gap:8px;
    padding:10px 14px;
    background:rgba(8,10,18,0.88);
    border-bottom:1px solid rgba(255,255,255,0.15);
  }
  .skyview-bar-group{ display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
  .skyview-btn{
    background:var(--sky-bg); border:1px solid var(--sky-border);
    color:var(--sky-text); padding:6px 11px; border-radius:4px; font-size:13px; cursor:pointer;
    font-family:inherit; white-space:nowrap; transition:background .15s ease;
  }
  .skyview-mobile-menu-btn{ display:inline-flex; align-items:center; justify-content:center; }
  /* flex:1 -- without this #skyviewBarControls only shrink-wraps its own
     content width, so when it wraps onto its own line under the close/
     menu buttons, the search box's margin-left:auto (further down) only
     pushes it to the right edge of that shrunk box, not the actual
     screen edge -- flex:1 stretches the controls row to fill the
     available width so "push to the right" actually means the right. */
  #skyviewBarControls{ display:flex; flex-wrap:wrap; align-items:center; gap:8px; flex:1; }
  #skyviewBarControls.collapsed{ display:none; }
  /* one consistent "|" divider rule, applied uniformly at every top-level
     item boundary (close/menu/controls-wrapper) and at every group
     boundary inside the wrapper -- previously two separate, differently
     scoped rules (plus a zero column-gap on .skyview-bar) produced
     mismatched spacing: some junctions got no gap at all, others got an
     extra divider stacked on top of each button's own border box */
  .skyview-bar > * + *,
  #skyviewBarControls > * + *{
    border-left:1px solid rgba(255,255,255,0.16); padding-left:8px; margin-left:0;
  }
  /* background-color, not the background shorthand -- the shorthand
     implicitly resets background-image too, which knocked out the custom
     arrow glyph .skyview-select-btn/.skyview-quiz-select draw via
     background-image on every hover (it'd vanish, then visibly "pop" back
     in from nowhere on mouse-out as this rule stopped applying) */
  .skyview-btn:hover{ background-color:rgba(255,255,255,0.17); }
  .skyview-btn.active{ background:var(--sky-accent-active-bg); border-color:var(--sky-accent-active-border); color:var(--sky-accent-soft); }
  .skyview-btn:disabled{ opacity:0.4; cursor:not-allowed; }
  .skyview-btn:disabled:hover{ background:var(--sky-bg); }
  .skyview-label{ font-size:12px; color:#c7cbdb; white-space:nowrap; }
  .skyview-bar input[type=range]{ width:110px; accent-color:#f2a65a; }
  .skyview-tooltip{
    position:fixed; z-index:5; pointer-events:none; display:none;
    background:rgba(10,12,22,0.92); border:1px solid var(--sky-border);
    color:#f2f3f8; font-size:12.5px; padding:5px 10px; border-radius:6px;
    white-space:nowrap;
  }
  .skyview-search-wrap{ position:relative; }
  /* search-wrap now sits in the DOM right after close/menu (so it stays
     visible on mobile even while #skyviewBarControls is collapsed), but
     on desktop it should still visually sit at the far right like before
     -- order:5 pushes it there without needing to move it back out of
     the always-visible row. Reset to 0 on mobile (below) so it falls
     back to DOM order there instead: grouped with close/menu on row 1,
     ahead of #skyviewBarControls which wraps onto its own full-width row. */
  .skyview-search-wrap{ order:5; }
  .skyview-search-input{
    background:var(--sky-bg); border:1px solid var(--sky-border);
    color:var(--sky-text); padding:7px 12px; border-radius:8px; font-size:13px; font-family:inherit;
    width:260px; max-width:40vw;
  }
  .skyview-search-input::placeholder{ color:var(--sky-text-muted); }
  /* compact "ค้นหา" toggle button -- desktop never shows it (the real
     input is always visible there); mobile shows only this button and
     reveals the actual input as a flyout when tapped, since a full-width
     text field can't sit comfortably next to the close/menu buttons */
  .skyview-search-toggle-btn{ display:none; }
  .skyview-datetime-input{
    width:100%; background:var(--sky-bg); border:1px solid var(--sky-border);
    color:var(--sky-text); border-radius:8px; padding:6px 8px; font-family:inherit; font-size:12.5px;
    color-scheme:dark;
  }
  .skyview-search-input:focus{ outline:none; border-color:rgba(242,166,90,0.6); background:rgba(255,255,255,0.12); }
  .skyview-search-results{
    display:none; position:absolute; top:calc(100% + 6px); left:0; min-width:260px; max-width:340px;
    z-index:6;
    background:var(--sky-popup-bg); border:1px solid var(--sky-popup-border); border-radius:10px;
    padding:6px; box-shadow:0 12px 30px rgba(0,0,0,0.5);
  }
  .skyview-search-results.show{ display:block; }
  .skyview-search-tabs{ display:flex; gap:4px; padding:2px 2px 6px; border-bottom:1px solid rgba(255,255,255,0.12); margin-bottom:4px; }
  .skyview-search-tab{
    flex:1; background:rgba(255,255,255,0.06); border:1px solid rgba(255,255,255,0.15); border-radius:6px;
    color:#c7cbdb; font-size:11px; padding:5px 4px; cursor:pointer; font-family:inherit; white-space:nowrap;
  }
  .skyview-search-tab:hover{ background:rgba(255,255,255,0.14); }
  .skyview-search-tab.active{ background:var(--sky-accent-active-bg); border-color:var(--sky-accent-active-border); color:var(--sky-accent-soft); }
  .skyview-search-list{ max-height:320px; overflow-y:auto; }
  .skyview-search-item{
    display:flex; flex-direction:column; gap:1px; padding:8px 10px; border-radius:7px; cursor:pointer;
    color:var(--sky-text); font-size:13px;
  }
  .skyview-search-item:hover, .skyview-search-item.hi{ background:rgba(242,166,90,0.2); }
  .skyview-search-item .sub{ font-size:11px; color:#a8adc4; }
  .skyview-search-empty{ padding:8px 10px; color:var(--sky-text-muted); font-size:12.5px; }
  @media (max-width:760px){
    .skyview-search-wrap{ order:0; }
    .skyview-bar{ font-size:12px; padding:8px 12px; }
    .skyview-bar input[type=range]{ width:80px; }
    .skyview-search-input{ width:170px; }
    /* the controls row becomes its own full-width line under the
       close/menu buttons -- a single-line, horizontally scrollable strip
       (like a mobile tab bar) instead of the old vertical dropdown-card
       "accordion". Buttons keep their natural width here (no more
       align-items:stretch forcing bare children like #skyviewRefresh to
       stretch edge-to-edge), and it opens/closes with a short ease via
       max-height+opacity rather than a hard display:none snap. */
    #skyviewBarControls{
      flex-basis:100%; flex-wrap:nowrap; overflow-x:auto; -webkit-overflow-scrolling:touch;
      max-height:80px; opacity:1; margin-top:8px; padding-top:8px;
      border-top:1px solid rgba(255,255,255,0.14);
      transition:max-height .22s ease, opacity .18s ease, margin-top .22s ease, padding-top .22s ease, border-color .22s ease;
    }
    #skyviewBarControls.collapsed{
      display:flex; /* override the base display:none -- stay in flex flow so
        max-height/opacity can actually transition instead of snapping */
      max-height:0; opacity:0; margin-top:0; padding-top:0; border-top-color:transparent;
      overflow:hidden; pointer-events:none;
    }
    #skyviewBarControls .skyview-bar-group{ flex-wrap:nowrap; flex-shrink:0; }
    #skyviewBarControls > *{ flex-shrink:0; }
    /* styled scrollbar for the strip instead of the platform default --
       thin, themed to match the dark bar rather than a stock gray bar */
    #skyviewBarControls{ scrollbar-width:thin; scrollbar-color:rgba(255,255,255,0.3) transparent; }
    #skyviewBarControls::-webkit-scrollbar{ height:5px; }
    #skyviewBarControls::-webkit-scrollbar-track{ background:transparent; }
    #skyviewBarControls::-webkit-scrollbar-thumb{ background:rgba(255,255,255,0.3); border-radius:3px; }
    #skyviewBarControls::-webkit-scrollbar-thumb:hover{ background:rgba(255,255,255,0.45); }
  }
  /* the .skyview-options-panel/.skyview-opt-row-btns-inline/.skyview-submenu
     mobile overrides that used to live in the media query above were
     silently defeated -- their unconditional (desktop) versions are
     defined further down this stylesheet, so on identical specificity
     the later base rule always won regardless of viewport. Moved below,
     after all three base rules, so this one actually applies on mobile. */

  .skyview-options-panel{
    display:none; position:absolute; top:calc(100% + 6px); left:0; width:280px; z-index:6;
    background:var(--sky-popup-bg); border:1px solid var(--sky-popup-border); border-radius:10px;
    padding:12px; box-shadow:0 12px 30px rgba(0,0,0,0.5);
    max-height:calc(100vh - 80px); overflow-y:auto;
  }
  .skyview-options-panel.show{ display:block; }
  .skyview-opt-row{ margin-bottom:12px; }
  .skyview-opt-row:last-child{ margin-bottom:0; }
  .skyview-opt-row label{ display:block; font-size:12.5px; color:#c7cbdb; margin-bottom:6px; }
  .skyview-opt-row input[type=range]{ width:100%; }
  .skyview-opt-row-btns .skyview-btn{ width:100%; text-align:left; }
  .skyview-opt-row-btns-inline{ display:flex; gap:8px; }
  .skyview-opt-row-btns-inline .skyview-btn{ width:auto; flex:1; text-align:center; }
  .skyview-submenu-toggle{ display:flex; align-items:center; justify-content:space-between; width:100%; text-align:left; }
  .skyview-submenu-arrow{ font-size:16px; transition:transform 0.15s ease; }
  .skyview-submenu-toggle.open .skyview-submenu-arrow{ transform:rotate(90deg); }
  /* position:fixed (not absolute) and positioned via JS from the toggle
     button's actual screen rect -- .skyview-options-panel has
     overflow-y:auto, and per the CSS overflow spec a container can't
     have one axis "visible" while the other scrolls (the browser forces
     overflow-x to auto too), which clips/redirects any absolutely-
     positioned flyout into the panel's own scrollable area instead of
     letting it float outside. position:fixed escapes that entirely. */
  .skyview-submenu{
    display:none; position:fixed; width:260px;
    max-height:320px; overflow-y:auto;
    background:var(--sky-popup-bg); border:1px solid var(--sky-popup-border); border-radius:10px;
    padding:10px; box-shadow:0 12px 30px rgba(0,0,0,0.5); z-index:50;
  }
  .skyview-submenu.show{ display:block; }
  .skyview-submenu-label{ font-size:11px; color:var(--sky-text-muted); margin:10px 0 4px; text-transform:uppercase; letter-spacing:0.03em; }
  .skyview-submenu-label:first-child{ margin-top:0; }
  .skyview-check-row{ display:flex; align-items:center; gap:7px; font-size:12.5px; color:#e3e6f2; padding:4px 2px; cursor:pointer; border-radius:4px; }
  .skyview-check-row:hover{ background:var(--sky-bg); }
  .skyview-check-row input[type=checkbox]{ margin:0; flex-shrink:0; }
  .skyview-check-swatch{ display:inline-block; width:10px; height:10px; border-radius:2px; flex-shrink:0; }
  @media (max-width:760px){
    /* dropdown/flyout panels stay real floating overlays like on desktop
       (not stretched full-width inline blocks) -- just narrowed to
       roughly half the screen, with every row (including ones shown
       side-by-side on desktop) stacked one per line.
       position:fixed (not absolute), placed via skyviewPositionMobileFlyout()
       from the trigger button's own screen rect -- #skyviewBarControls now
       scrolls horizontally (overflow-x:auto), and per the CSS overflow
       spec that forces overflow-y to clip too, so a plain absolute flyout
       anchored inside it would get cut off instead of floating over the
       sky view (same reason .skyview-submenu already uses position:fixed). */
    .skyview-options-panel{ position:fixed; width:50vw; min-width:230px; }
    .skyview-opt-row-btns-inline{ flex-direction:column; }
    .skyview-opt-row-btns-inline .skyview-btn{ width:100%; }
    #skyviewSearchResults{ position:fixed; }
    /* search: just the compact "ค้นหา" button sits in the persistent top
       row by default; tapping it reveals the real input as its own
       fixed-position flyout (positioned via skyviewPositionMobileFlyout,
       same as the options/time panels) instead of a permanently-visible
       text field competing for space with close/menu. */
    .skyview-search-toggle-btn{ display:inline-flex; align-items:center; justify-content:center; }
    .skyview-search-input{ display:none; }
    .skyview-search-wrap.mobile-search-open .skyview-search-input{
      display:block; position:fixed; width:calc(100vw - 24px); max-width:none; z-index:11;
    }
  }
  /* select styled to match .skyview-btn exactly (same padding/radius/
     font as the plain toggle buttons in the same rows, so this doesn't
     look or align any differently just for being a <select>), plus
     min-width:0 -- flex items default to min-width:auto, which refuses to
     shrink below the content's intrinsic width (here, the longest option
     text) even with flex:1, and that's what was pushing this row past
     the panel's edge.
     Same color-scheme fix already used for .skyview-quiz-select below:
     color-scheme:dark alone can still lose to an inherited
     color-scheme:light from body.light-mode in Chromium's native
     dropdown-popup chrome, leaving light-on-light text -- var(--sky-popup-bg)
     plus a solid (non-translucent) :checked/:hover color are both needed
     too, since Chromium's popup doesn't reliably composite an rgba()
     option background against the OS's own accent-color highlight. */
  .skyview-select-btn{
    color-scheme:dark; min-width:0; overflow:hidden; text-overflow:ellipsis;
    /* same native-arrow fix as .skyview-quiz-select above -- color-scheme:dark
       renders the browser's own dropdown-arrow glyph stark white, so swap
       it out for a custom light-orange triangle matching the site accent */
    appearance:none; -webkit-appearance:none; -moz-appearance:none;
    padding-right:26px;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M0 0L5 6L10 0Z' fill='%23ffd9a0'/%3E%3C/svg%3E");
    background-repeat:no-repeat; background-position:right 10px center; background-size:10px 6px;
  }
  .skyview-select-btn option{ background:var(--sky-popup-bg); color:var(--sky-text); }
  .skyview-select-btn option:checked,
  .skyview-select-btn option:hover{ background:var(--sky-accent); color:#1a1005; }
  .skyview-airmass-row{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
  .skyview-airmass-row .skyview-check-row{ flex:1; padding:4px 2px; }
  .skyview-airmass-row .skyview-check-row[data-disabled="1"]{ opacity:0.45; cursor:not-allowed; pointer-events:none; }
  .skyview-bortle-wrap{ margin-top:8px; padding-top:8px; border-top:1px solid var(--sky-border); }
  .skyview-bortle-head{ display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:6px; }
  .skyview-bortle-head .lvl{ font-family:'Chakra Petch',sans-serif; font-weight:700; color:var(--sky-accent-soft); }
  .skyview-info-btn{
    width:18px; height:18px; border-radius:50%; flex-shrink:0;
    background:rgba(255,255,255,0.12); border:none; color:var(--sky-text); font-size:11px; font-weight:700;
    cursor:pointer; line-height:1; display:flex; align-items:center; justify-content:center;
  }
  .skyview-info-btn:hover{ background:rgba(255,255,255,0.24); }
  .skyview-bortle-slider{ width:100%; }
  .skyview-bortle-desc{ font-size:11.5px; color:var(--sky-text-muted); line-height:1.6; margin-top:6px; }
  .skyview-bortle-info-pop{
    display:none; position:fixed; width:280px; max-height:70vh; overflow-y:auto;
    background:var(--sky-popup-bg); border:1px solid var(--sky-popup-border); border-radius:10px;
    padding:12px; box-shadow:0 12px 30px rgba(0,0,0,0.5); z-index:60; font-size:12px; color:#e3e6f2; line-height:1.7;
  }
  .skyview-bortle-info-pop.show{ display:block; }
  .skyview-bortle-info-pop b{ color:var(--sky-accent-soft); }
  .skyview-map-modal-back{
    display:none; position:fixed; inset:0; z-index:200; background:rgba(4,6,12,0.82);
    align-items:center; justify-content:center; padding:20px;
  }
  .skyview-map-modal-back.show{ display:flex; }
  .skyview-map-modal{
    background:var(--sky-popup-bg); border:1px solid var(--sky-popup-border); border-radius:12px;
    padding:16px; max-width:720px; width:100%; max-height:90vh; overflow-y:auto;
    box-shadow:0 20px 60px rgba(0,0,0,0.6);
  }
  .skyview-map-modal-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; color:var(--sky-text); font-size:15px; position:relative; }
  .skyview-map-modal-head .skyview-star-info-close{ position:static; }
  .skyview-map-modal-body{ display:flex; flex-direction:column; gap:10px; }
  .skyview-map-canvas-wrap{
    position:relative; width:100%; border-radius:8px; overflow:hidden;
    border:1px solid var(--sky-border); cursor:crosshair; line-height:0;
  }
  #skyviewMapCanvas{ display:block; width:100%; height:auto; touch-action:none; }
  .skyview-map-pin{
    position:absolute; width:18px; height:18px; margin-left:-9px; margin-top:-18px;
    pointer-events:none;
  }
  .skyview-map-pin::before{
    content:''; position:absolute; inset:0; background:#ff6b4a; border:2px solid #fff;
    border-radius:50% 50% 50% 0; transform:rotate(-45deg); box-shadow:0 2px 6px rgba(0,0,0,0.5);
  }
  .skyview-map-zoom{ position:absolute; top:8px; right:8px; display:flex; flex-direction:column; gap:4px; line-height:1; }
  .skyview-map-zoom button{
    width:28px; height:28px; border-radius:6px; cursor:pointer; font-size:17px; line-height:1;
    background:var(--sky-bg); border:1px solid var(--sky-border); color:var(--sky-text);
  }
  .skyview-map-zoom button:hover{ border-color:var(--sky-accent-active-border); }
  .skyview-map-coords{ font-size:12.5px; color:var(--sky-text); text-align:center; font-family:'Chakra Petch',sans-serif; }
  .skyview-map-note{ font-size:11px; color:var(--sky-text-muted); line-height:1.6; }
  .skyview-map-modal-foot{ display:flex; justify-content:flex-end; gap:8px; margin-top:14px; }
  .skyview-datetime-fields{ display:flex; align-items:center; justify-content:center; gap:3px; flex-wrap:nowrap; max-width:100%; }
  .skyview-dt-stepper{ display:flex; flex-direction:column; align-items:stretch; gap:2px; }
  .skyview-dt-arrow{
    background:rgba(255,255,255,0.1); border:1px solid rgba(255,255,255,0.22); color:var(--sky-text);
    border-radius:3px; padding:0; height:18px; line-height:16px; font-size:11px; font-family:inherit;
    cursor:pointer; user-select:none;
  }
  .skyview-dt-arrow:hover{ background:rgba(255,255,255,0.22); }
  .skyview-dt-arrow:active{ background:rgba(255,255,255,0.32); }
  .skyview-dt-field{
    width:32px; background:var(--sky-bg); border:1px solid var(--sky-border);
    color:var(--sky-text); border-radius:4px; padding:5px 2px; font-family:inherit; font-size:12.5px;
    text-align:center; color-scheme:dark;
    -moz-appearance:textfield; appearance:textfield;
  }
  .skyview-dt-field::-webkit-inner-spin-button,
  .skyview-dt-field::-webkit-outer-spin-button{ -webkit-appearance:none; margin:0; }
  .skyview-dt-field.skyview-dt-year{ width:48px; }
  .skyview-dt-field.skyview-fov-num{ width:38px; }
  .skyview-fov-deg{ margin-left:-4px; font-size:15px; position:relative; top:2px; }
  .skyview-dt-sep{ color:var(--sky-text-muted); font-size:12px; }
  .skyview-speed-row{ display:flex; align-items:center; gap:8px; }
  .skyview-speed-row input[type=range]{ flex:1; }
  .skyview-speed-input{
    width:64px; background:var(--sky-bg); border:1px solid var(--sky-border);
    color:var(--sky-text); border-radius:4px; padding:5px 4px; font-family:inherit; font-size:12.5px; text-align:center;
  }

  .skyview-chips{
    position:absolute; top:66px; left:16px; z-index:2;
    display:flex; flex-wrap:wrap; gap:8px; max-width:70vw;
  }
  .skyview-chip{
    display:flex; align-items:center; gap:6px;
    background:rgba(90,200,180,0.18); border:1px solid rgba(90,200,180,0.55); border-radius:20px;
    padding:5px 6px 5px 12px; font-size:12.5px; color:#bdf5e9;
  }
  .skyview-chip button{
    pointer-events:auto; cursor:pointer; background:rgba(255,255,255,0.14); border:none; border-radius:50%;
    width:16px; height:16px; line-height:16px; text-align:center; color:var(--sky-text); font-size:11px; padding:0;
  }
  .skyview-chip button:hover{ background:rgba(255,255,255,0.3); }

  .skyview-selection{ position:fixed; z-index:3; pointer-events:none; opacity:1; }
  /* used only by the star-reference-table "peek" flash: after the ring's
     hold period, ease it out smoothly instead of cutting it instantly */
  .skyview-selection.skyview-peek-fade{ transition:opacity .6s ease-out; opacity:0; }
  .skyview-selection-ring{
    position:absolute; top:0; left:0; width:30px; height:30px; margin:-15px 0 0 -15px;
    border-radius:50%; border:2px dashed rgba(242,166,90,0.85);
    animation:skyviewSpin 3s linear infinite;
  }
  @keyframes skyviewSpin{ from{transform:rotate(0deg);} to{transform:rotate(360deg);} }
  .skyview-selection-label{
    position:absolute; left:0; bottom:22px; transform:translate(-50%,-8px);
    display:flex; align-items:center; gap:6px;
    background:var(--sky-popup-bg); border:1px solid var(--sky-accent-active-border); border-radius:7px;
    padding:5px 8px; white-space:nowrap; pointer-events:none;
  }
  .skyview-selection-label span{ font-size:12.5px; color:#ffe6c2; }
  .skyview-selection-close{
    pointer-events:auto; cursor:pointer; background:rgba(255,255,255,0.12); border:none; border-radius:50%;
    width:16px; height:16px; line-height:16px; text-align:center; color:var(--sky-text); font-size:12px; padding:0;
  }
  .skyview-selection-close:hover{ background:rgba(255,255,255,0.28); }
  .skyview-const-name{ font-family:'Chakra Petch',sans-serif; letter-spacing:0.12em; }

  .skyview-star-info{
    position:fixed; top:70px; left:16px; z-index:40; width:270px;
    max-height:calc(100vh - 90px); overflow-y:auto;
    background:var(--sky-popup-bg); border:1px solid var(--sky-popup-border); border-radius:10px;
    padding:14px 16px; box-shadow:0 12px 30px rgba(0,0,0,0.5); color:var(--sky-text);
    transition:transform .25s ease; touch-action:pan-y;
  }
  /* dragged (or "<" collapsed) fully past the left edge regardless of the
     panel's own width -- -100% alone would still leave a sliver on
     screen since left:16px means -100% only shifts it back to x=16-width,
     not necessarily past x=0 */
  .skyview-star-info.collapsed{ transform:translateX(calc(-100% - 40px)); }
  .skyview-star-info.dragging{ transition:none; }
  .skyview-star-info-close{
    position:absolute; top:8px; right:8px; width:24px; height:24px; border-radius:50%;
    background:rgba(255,255,255,0.12); border:none; color:var(--sky-text); font-size:15px; line-height:1;
    cursor:pointer;
  }
  .skyview-star-info-close:hover{ background:rgba(255,255,255,0.24); }
  .skyview-star-info-collapse{
    position:absolute; top:8px; right:38px; width:24px; height:24px; border-radius:50%;
    background:rgba(255,255,255,0.12); border:none; color:var(--sky-text); font-size:15px; line-height:1;
    cursor:pointer; display:flex; align-items:center; justify-content:center;
  }
  .skyview-star-info-collapse:hover{ background:rgba(255,255,255,0.24); }
  /* persistent little tab at the panel's resting spot -- lets the user
     bring a dragged/collapsed panel back without reselecting the object.
     Shown only while something is selected AND the panel is collapsed
     (toggled from JS, not CSS, since that also depends on selection state) */
  .skyview-star-info-reopen{
    position:fixed; top:70px; left:16px; z-index:40; width:28px; height:40px;
    border-radius:0 8px 8px 0; background:var(--sky-popup-bg);
    border:1px solid var(--sky-popup-border); border-left:none;
    color:var(--sky-text); font-size:18px; line-height:1; cursor:pointer;
    box-shadow:0 6px 16px rgba(0,0,0,0.4); display:flex; align-items:center; justify-content:center;
  }
  .skyview-star-info-reopen:hover{ background:rgba(255,255,255,0.14); }
  /* the history modal's × sits inside .skyview-quiz-box, which is itself
     the scrolling container (overflow-y:auto) -- plain position:absolute
     scrolls away with the rest of the content. sticky (plus float:right
     so it doesn't force a blank line above the rest of the box's
     content) keeps it pinned to the top-right corner the whole time the
     user scrolls through history/collections below it. */
  #skyviewHistoryXClose{ position:sticky; float:right; margin-left:8px; z-index:2; }
  .skyview-star-info h4{ margin:0 10px 10px 0; font-size:16px; color:var(--sky-accent-soft); font-family:'Chakra Petch',sans-serif; }
  .skyview-star-info-row{ display:flex; justify-content:space-between; gap:10px; padding:4px 0; font-size:12.5px; border-bottom:1px solid rgba(255,255,255,0.07); }
  .skyview-star-info-row:last-child{ border-bottom:none; }
  .skyview-star-info-row .k{ color:var(--sky-text-muted); flex-shrink:0; }
  .skyview-star-info-row .v{ color:var(--sky-text); font-weight:600; text-align:right; }
  .skyview-star-info-note{ margin-top:10px; font-size:11px; color:#8b91a6; line-height:1.5; }
  /* picture at the left of the info panel, and the short-article card */
  .skyview-obj-media{ display:grid; grid-template-columns:64px minmax(0, 1fr); gap:6px 10px; align-items:center; margin:0 0 10px; }
  .skyview-obj-media.no-img{ grid-template-columns:minmax(0, 1fr); }
  .skyview-obj-media[hidden]{ display:none; }
  .skyview-obj-media img{ width:64px; height:64px; object-fit:cover; border-radius:8px; background:#000; display:block; }
  .skyview-obj-media-txt b{ display:block; font-size:13px; color:var(--sky-text); font-weight:600; }
  .skyview-obj-media-txt span{ display:block; font-size:12px; color:var(--sky-text-muted); margin-top:2px; }
  .skyview-obj-credit{ grid-column:1 / -1; font-size:10.5px; color:#8b91a6; line-height:1.4; overflow-wrap:anywhere; }
  .skyview-obj-more{ width:100%; margin-top:12px; }
  .skyview-obj-more[hidden]{ display:none; }
  .skyview-objcard-back{
    display:none; position:fixed; inset:0; z-index:210; background:rgba(4,6,12,0.82);
    align-items:center; justify-content:center; padding:20px;
  }
  .skyview-objcard-back.show{ display:flex; }
  .skyview-objcard{
    position:relative; background:var(--sky-popup-bg); border:1px solid var(--sky-popup-border); border-radius:12px;
    padding:18px 18px 16px; max-width:560px; width:100%; max-height:88vh; overflow-y:auto; color:var(--sky-text);
    box-shadow:0 20px 60px rgba(0,0,0,0.6);
  }
  .skyview-objcard-head{ display:flex; gap:16px; align-items:flex-start; }
  .skyview-objcard-head figure{ margin:0; flex:0 0 132px; }
  .skyview-objcard-head img{ width:132px; height:132px; object-fit:cover; border-radius:10px; display:block; background:#000; }
  .skyview-objcard-head figcaption{ font-size:10.5px; color:#8b91a6; line-height:1.4; margin-top:5px; overflow-wrap:anywhere; }
  .skyview-objcard-title{ flex:1; min-width:0; }
  .skyview-objcard h3{ margin:0 30px 2px 0; font-size:18px; color:var(--sky-accent-soft); font-family:'Chakra Petch',sans-serif; }
  .skyview-objcard-en{ margin:0 0 8px; font-size:12.5px; color:var(--sky-text-muted); }
  .skyview-objcard > div > p, .skyview-objcard #skyviewObjCardBody > p{ font-size:14px; line-height:1.75; margin:12px 0 0; }
  .skyview-objcard-go{ margin-top:16px; width:100%; }
  @media (max-width:520px){ .skyview-objcard-head{ flex-direction:column; } .skyview-objcard-head figure{ flex-basis:auto; } }
  .skyview-mw-credit{ position:fixed; right:10px; bottom:6px; z-index:5; font-size:10px; line-height:1.4; color:rgba(200,208,228,0.55); pointer-events:none; max-width:min(60vw, 520px); text-align:right; }
  .skyview-mw-credit[hidden]{ display:none; }

  .skyview-quiz-setup, .skyview-quiz-results{
    /* z-index 90, not 60 -- above .top-strip's 80. Opened from the hub
       page (a normal section, not the fullscreen canvas which already
       sits at z-index 150 and covers the top strip on its own), this
       used to render BEHIND the site's fixed top bar, clipping the top
       of the box whenever it grew tall enough to approach its own
       max-height cap.
       z-index alone only fixes PAINT order though -- it doesn't stop the
       box from being vertically centered against the FULL viewport
       height, ignoring the top bar entirely. On a short viewport (or
       once the box grows tall, as it has since), that centering math can
       still place the box's top edge above the bar's bottom edge, so its
       corner -- or on short enough screens, actual content -- visually
       overlaps/hides under the bar even though it now paints above it.
       Starting the backdrop at top:var(--top-strip-h) instead of
       inset:0 keeps the box's own centered column entirely below the
       bar, so this can't happen at any viewport size. -- UPDATE: that
       left the strip itself (translucent, not dimmed) as a visible gap
       at the top of an otherwise-darkened screen. Now inset:0 for the
       darkening, with the same effect on the box's centering achieved
       via padding-top instead: flexbox centers within the CONTENT box
       (padding excluded), so the box still lands entirely below the
       bar, just via padding rather than a shorter backdrop. */
    position:fixed; inset:0; padding-top:var(--top-strip-h); z-index:90; display:none;
    flex-direction:column; align-items:center; justify-content:center;
    background:rgba(5,7,15,0.75);
  }
  .skyview-quiz-setup.show, .skyview-quiz-results.show{ display:flex; }
  .skyview-quiz-tabs{ display:flex; gap:2px; }
  .skyview-quiz-tab{
    background:rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.15); border-bottom:none;
    border-radius:10px 10px 0 0; color:var(--sky-text-muted); padding:9px 18px; font-size:13px; font-family:inherit;
    cursor:pointer; position:relative; margin-bottom:-1px; z-index:0;
  }
  .skyview-quiz-tab.active{
    background:var(--sky-popup-bg); border-color:var(--sky-accent-active-border); color:var(--sky-accent-soft); font-weight:700;
    z-index:1;
  }
  .skyview-quiz-tab:disabled{ opacity:0.35; cursor:not-allowed; }
  .skyview-quiz-tab:not(.active):not(:disabled):hover{ background:rgba(255,255,255,0.09); color:var(--sky-text); }
  .skyview-quiz-box{
    /* capped against the space actually available below the top bar
       (its parent backdrop starts at top:var(--top-strip-h), not y:0),
       not the full 88vh of the viewport -- otherwise on a very short
       viewport the box can still be taller than the room it's centered
       in and creep back above the bar */
    width:min(480px, 92vw); max-height:min(88vh, calc(100vh - var(--top-strip-h) - 24px)); overflow-y:auto;
    background:var(--sky-popup-bg); border:1px solid var(--sky-popup-border); border-radius:14px;
    padding:26px 28px; box-shadow:0 20px 50px rgba(0,0,0,0.6); color:var(--sky-text);
  }
  #skyviewQuizSetup .skyview-quiz-box{ width:min(360px, 92vw); }
  .skyview-quiz-box h3{ margin:0 0 8px; font-size:20px; font-family:'Chakra Petch',sans-serif; color:var(--sky-accent-soft); }
  .skyview-quiz-desc{ font-size:13px; color:#c7cbdb; margin-bottom:18px; }
  .skyview-quiz-field{ margin-bottom:16px; }
  .skyview-quiz-field label{ display:block; font-size:12.5px; color:var(--sky-text-muted); margin-bottom:8px; }
  .skyview-quiz-opt-row{ display:flex; flex-wrap:wrap; gap:8px; }
  .skyview-quiz-opt{
    background:rgba(255,255,255,0.06); border:1px solid var(--sky-border); color:#c7cbdb;
    padding:7px 13px; border-radius:6px; font-size:12.5px; cursor:pointer; font-family:inherit;
  }
  .skyview-quiz-opt.active{ background:rgba(242,166,90,0.25); border-color:rgba(242,166,90,0.7); color:var(--sky-accent-soft); }
  .skyview-quiz-opt:disabled{ opacity:0.35; cursor:not-allowed; }
  .skyview-quiz-field-select-row{ display:flex; align-items:center; gap:8px; }
  .skyview-quiz-select{
    flex:1; width:100%; background:rgba(255,255,255,0.06); border:1px solid var(--sky-border); color:var(--sky-text);
    padding:8px 12px; border-radius:6px; font-size:12.5px; cursor:pointer; font-family:inherit;
    /* like the rest of the ท้องฟ้าจำลอง module, this stays dark regardless
       of site theme -- without this, a page in light mode inherits
       color-scheme:light from body.light-mode, and Chromium's native
       dropdown-popup chrome renders light (near-white) despite the
       explicit dark option background/color below, leaving light-on-light
       text that's unreadable */
    color-scheme:dark;
    /* the browser's own native dropdown-arrow glyph renders stark white
       (a side effect of color-scheme:dark above, which also styles that
       glyph) -- appearance:none drops it entirely in favor of this custom
       light-orange triangle instead, matching the site's accent color */
    appearance:none; -webkit-appearance:none; -moz-appearance:none;
    padding-right:30px;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M0 0L5 6L10 0Z' fill='%23ffd9a0'/%3E%3C/svg%3E");
    background-repeat:no-repeat; background-position:right 12px center; background-size:10px 6px;
  }
  .skyview-quiz-select:focus{ outline:none; border-color:rgba(242,166,90,0.7); }
  .skyview-quiz-select option{ background:var(--sky-popup-bg); color:var(--sky-text); }
  .skyview-quiz-select option:disabled{ color:var(--sky-text-muted); }
  /* Chromium honors :checked/:hover backgrounds on <option> to varying
     degrees (native dropdown-popup rendering, not fully CSS-controlled)
     -- without this the popup falls back to the OS's own accent color
     for the highlighted row, which on Windows is blue, not this site's
     orange. A translucent rgba() here isn't reliable either -- the native
     popup doesn't necessarily composite it against this rule's own dark
     option background, so it can wash out pale/near-white instead of
     tinting dark. A solid, fully-opaque color sidesteps that regardless of
     whatever backdrop the OS popup actually paints, so pair it with dark
     text (same combo as the site's orange badge elsewhere) for guaranteed
     contrast instead of trying to keep the light --sky-text color. */
  .skyview-quiz-select option:checked,
  .skyview-quiz-select option:hover{ background:var(--sky-accent); color:#1a1005; }
  .skyview-quiz-field-inline{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
  .skyview-quiz-field-inline label{ margin-bottom:0; }
  .skyview-toggle-switch{ position:relative; display:inline-block; width:34px; height:18px; flex-shrink:0; cursor:pointer; }
  .skyview-toggle-switch input{ position:absolute; opacity:0; width:100%; height:100%; margin:0; cursor:pointer; }
  .skyview-toggle-track{
    position:absolute; inset:0; background:rgba(255,255,255,0.18); border:1px solid rgba(255,255,255,0.25);
    border-radius:18px; transition:background .15s ease, border-color .15s ease;
  }
  .skyview-toggle-track::before{
    content:''; position:absolute; top:1px; left:1px; width:14px; height:14px; border-radius:50%;
    background:#c7cbdb; transition:transform .15s ease, background .15s ease;
  }
  .skyview-toggle-switch input:checked + .skyview-toggle-track{ background:rgba(242,166,90,0.35); border-color:var(--orange); }
  .skyview-toggle-switch input:checked + .skyview-toggle-track::before{ background:var(--orange); transform:translateX(16px); }
  .skyview-quiz-box-btns{ display:flex; gap:10px; margin-top:22px; }
  .skyview-quiz-box-btns .skyview-btn{ flex:1; text-align:center; }
  .skyview-quiz-box-btns .skyview-btn:disabled{ opacity:0.35; cursor:not-allowed; }

  .skyview-quiz-topbar{
    position:fixed; top:0; left:0; right:0; z-index:55; display:none;
    align-items:center; justify-content:space-between; gap:14px;
    padding:12px 16px; background:rgba(8,10,18,0.88); border-bottom:1px solid rgba(255,255,255,0.15);
  }
  .skyview-quiz-topbar.show{ display:flex; }
  .skyview-quiz-progress{ font-size:13px; color:#c7cbdb; font-family:'Chakra Petch',sans-serif; }
  /* taken out of the topbar's own flex flow (space-between only truly
     centers a lone middle child when its neighbors are equal width,
     which the exit button and the -- during speed mode, empty -- dots
     container aren't) and centered against the full-width bar itself
     instead, so it's genuinely centered regardless of sibling widths */
  .skyview-speed-timer{ position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); font-size:15px; font-weight:700; color:var(--sky-accent-soft); }
  /* Minecraft-hotbar-style cooldown: a solid bar sweeps from fully
     covering the button down to nothing over the 1s skip cooldown
     (driven by a CSS transition, not a JS-ticked countdown, so it's
     perfectly smooth) -- position:relative + overflow:hidden keeps the
     bar clipped to the button's own rounded corners, and the label sits
     in its own stacking position above the bar so it stays readable
     throughout the sweep */
  .skyview-speed-skip{ position:relative; overflow:hidden; }
  .skyview-speed-skip-cooldown{
    position:absolute; inset:0; width:0%; background:rgba(255,255,255,0.45);
    pointer-events:none;
  }
  .skyview-speed-skip-label{ position:relative; }
  .skyview-quiz-dots{ display:flex; gap:6px; }
  .skyview-quiz-dot{
    width:10px; height:10px; border-radius:50%; background:rgba(255,255,255,0.18);
    border:1px solid rgba(255,255,255,0.3); cursor:pointer; padding:0;
  }
  .skyview-quiz-dot.current{ background:rgba(242,166,90,0.85); border-color:rgba(242,166,90,1); }
  /* "answered" is deliberately a neutral color, not green -- it only
     means "you've put something here", not "you got it right". Revealing
     correctness before the round is over would defeat the point of
     finishing all questions first. */
  .skyview-quiz-dot.answered{ background:rgba(255,255,255,0.55); border-color:rgba(255,255,255,0.7); }

  .skyview-quiz-review-bar{ position:fixed; top:16px; left:16px; z-index:55; display:none; }
  .skyview-quiz-review-bar.show{ display:block; }

  .skyview-quiz-answer-bar{
    position:fixed; bottom:22px; left:50%; transform:translateX(-50%); z-index:55; display:none;
    align-items:center; gap:8px; width:min(420px, 90vw);
    background:var(--sky-popup-bg); border:1px solid var(--sky-popup-border); border-radius:999px;
    padding:6px 8px; box-shadow:0 10px 30px rgba(0,0,0,0.5);
  }
  .skyview-quiz-answer-bar.show{ display:flex; }
  /* Bayer mode's Greek-letter picker -- one horizontally-scrollable row,
     stacked above the answer bar (see the HTML comment at its markup for
     why it's a separate bar rather than living inside
     .skyview-quiz-input-wrap alongside the suggestions popover) */
  .skyview-quiz-bayer-row{
    display:none; position:fixed; bottom:78px; left:50%; transform:translateX(-50%); z-index:55;
    gap:6px; width:min(420px, 90vw);
    overflow-x:auto; overflow-y:hidden; flex-wrap:nowrap;
    background:var(--sky-popup-bg); border:1px solid var(--sky-popup-border); border-radius:999px;
    padding:6px 10px; box-shadow:0 10px 30px rgba(0,0,0,0.5);
    scrollbar-width:thin;
  }
  .skyview-quiz-bayer-row.show{ display:flex; }
  .skyview-quiz-bayer-row::-webkit-scrollbar{ height:4px; }
  .skyview-quiz-bayer-row::-webkit-scrollbar-thumb{ background:rgba(255,255,255,0.25); border-radius:999px; }
  .skyview-quiz-bayer-btn{
    flex-shrink:0; width:30px; height:30px; border-radius:50%;
    background:var(--sky-bg); border:1px solid var(--sky-border); color:var(--sky-accent-soft);
    font-size:15px; cursor:pointer; line-height:1; font-family:inherit;
    display:flex; align-items:center; justify-content:center;
  }
  .skyview-quiz-bayer-btn:hover{ background:rgba(255,255,255,0.18); }
  .skyview-quiz-bayer-btn:active{ background:rgba(242,166,90,0.35); }
  /* pushed up further still while the Greek-letter row is showing, so the
     suggestions popover (which opens upward from the input) stacks above
     that row instead of covering it */
  .skyview-quiz-suggestions.push-above-bayer-row{ bottom:calc(100% + 8px + 52px); }
  .skyview-quiz-nav-btn{
    width:30px; height:30px; flex-shrink:0; border-radius:50%;
    background:var(--sky-bg); border:1px solid var(--sky-border); color:var(--sky-text);
    font-size:16px; cursor:pointer; line-height:1;
  }
  .skyview-quiz-nav-btn:hover{ background:rgba(255,255,255,0.18); }
  .skyview-quiz-nav-btn:disabled{ opacity:0.3; cursor:not-allowed; }
  .skyview-quiz-input-wrap{ position:relative; flex:1; min-width:0; }
  .skyview-quiz-input{
    width:100%; background:var(--sky-bg); border:1px solid var(--sky-border);
    color:var(--sky-text); border-radius:999px; padding:7px 14px; font-family:inherit; font-size:13px;
  }
  .skyview-quiz-suggestions{
    display:none; position:absolute; bottom:calc(100% + 8px); left:0; right:0;
    max-height:200px; overflow-y:auto;
    background:var(--sky-popup-bg); border:1px solid var(--sky-popup-border); border-radius:10px;
    padding:6px; box-shadow:0 12px 30px rgba(0,0,0,0.5);
  }
  .skyview-quiz-suggestions.show{ display:block; }
  .skyview-quiz-suggestion-item{
    padding:7px 10px; font-size:12.5px; color:#e3e6f2; border-radius:6px; cursor:pointer;
  }
  .skyview-quiz-suggestion-item:hover, .skyview-quiz-suggestion-item.hi{ background:rgba(242,166,90,0.2); }

  .skyview-quiz-score{ font-size:34px; font-weight:700; font-family:'Chakra Petch',sans-serif; color:var(--sky-accent-soft); margin:14px 0 4px; }
  .skyview-quiz-time{ font-size:13px; color:var(--sky-text-muted); margin-bottom:16px; }
  .skyview-quiz-points{ font-size:15px; font-weight:700; color:var(--sky-accent-soft); margin:-8px 0 16px; }
  .skyview-quiz-early-finish{ font-size:14px; font-weight:700; color:rgba(127,216,160,0.95); margin:-10px 0 16px; }
  .skyview-quiz-review{ display:flex; flex-direction:column; gap:6px; margin-bottom:6px; max-height:220px; overflow-y:auto; }
  .skyview-quiz-review-item{ display:flex; justify-content:space-between; gap:10px; font-size:12.5px; padding:6px 10px; border-radius:6px; background:rgba(255,255,255,0.04); }
  .skyview-quiz-review-item.correct{ color:#a8e6bd; }
  .skyview-quiz-review-item.wrong{ color:#ffb3b3; }

  .eyebrow{
    font-family:'Chakra Petch',sans-serif;
    font-size:12px; letter-spacing:0.14em; text-transform:uppercase;
    color:var(--orange);
    margin-bottom:10px;
    display:flex; align-items:center; gap:8px;
  }
  .eyebrow::before{ content:"✦"; font-size:11px; }

  .title{ font-size:32px; font-weight:700; margin-bottom:14px; line-height:1.25; }
  /* no max-width of its own -- it used to cap at 900px, narrower than
     main's own ~992px content width (max-width:1080px minus padding),
     so the lede paragraph wrapped shorter than every sibling element
     below it (filter chips, buttons, folder headers) on every page */
  .lede{ color:var(--muted); font-size:15.5px; line-height:1.75; margin-bottom:30px; }

    .title{ font-size:32px; font-weight:700; margin-bottom:14px; line-height:1.25; }
  .lede1{ color:var(--muted); font-size:15.5px; line-height:1.75; margin-bottom:10px; }
  /* the bank page's 3-paragraph intro (.lede1 + two .lede's) used
     mismatched gaps between them (10px, then 30px offset by a -8px
     inline hack on the last one) -- tightened to one consistent small
     gap between all 3, with normal spacing only after the last one */
  .bank-intro p{ margin-bottom:6px; }
  .bank-intro p:last-child{ margin-bottom:30px; }
  /* collapsible on narrow screens only -- the 4-paragraph intro used to
     push the actual set cards below the fold on a phone. Desktop never
     shows the toggle bar and always shows the full text, unchanged. */
  .bank-intro-toggle{ display:none; }
  @media (max-width:760px){
    .bank-intro-toggle{
      display:flex; align-items:center; justify-content:space-between; width:100%;
      background:var(--bg-card); border:1px solid var(--line-soft); border-radius:8px;
      color:var(--text); font:inherit; font-size:14px; padding:10px 14px; margin-bottom:14px;
      cursor:pointer; text-align:left;
    }
    .bank-intro-toggle-chevron{ transition:transform 0.15s ease; }
    .bank-intro-toggle[aria-expanded="true"] .bank-intro-toggle-chevron{ transform:rotate(180deg); }
    .bank-intro{ display:none; }
    .bank-intro.expanded{ display:block; }
  }

  /* plain horizontal divider under the homepage lede -- the same
     border-bottom the old countdown bar used to provide as a side effect
     of its own layout; kept as its own rule since the countdown (and now
     the free-list block below it) are both gone, but the visual
     separation from the nav-card grid beneath is still wanted */
  .home-lede-divider{ border-bottom:1.5px solid var(--line-strong); padding-bottom:20px; margin-bottom:26px; }
  /* countdown */
  .countdown-bar{
    display:flex; align-items:baseline; justify-content:flex-start; gap:22px; flex-wrap:wrap; text-align:left;
    margin-bottom:16px; padding-bottom:20px; border-bottom:1.5px solid var(--line-strong);
  }
  .countdown-bar .cd-text{ font-size:14px; color:var(--muted); }
  .countdown-bar .cd-text b{ color:var(--orange-soft); font-weight:600; }
  .cd-nums{ display:flex; gap:14px; }
  .cd-cell{ display:flex; align-items:baseline; gap:5px; text-align:left; }
  .cd-cell .n{ font-family:'Chakra Petch',sans-serif; font-size:26px; font-weight:700; color:var(--text); }
  .cd-cell .l{ font-size:12px; color:var(--muted-dim); letter-spacing:0.05em; }

  .link-btn{
    display:inline-block; background:none; border:1px solid transparent;
    padding:5px 9px; margin:-5px -9px; border-radius:8px;
    color:var(--orange-soft); font-weight:700; text-decoration:underline;
    font-family:'Chakra Petch',sans-serif; font-size:14px; cursor:pointer;
    transition:background .15s ease, border-color .15s ease;
  }
  .link-btn:hover{ background:var(--bg-card); border-color:var(--line); }

  .link-box-btn{
    display:inline-block; background:var(--tint-weak);
    border:1px solid var(--line-strong); border-radius:6px;
    padding:8px 16px; color:var(--orange-soft); font-weight:700;
    text-decoration:none; font-family:'Chakra Petch',sans-serif; font-size:14px;
    cursor:pointer; transition:background .15s ease, border-color .15s ease, transform .15s ease;
  }
  .link-box-btn:hover{ background:var(--orange-soft); border-color:var(--orange); color:#000; text-decoration:underline; transform:translateY(-1px); }

  .home-cta-row{
    display:flex; gap:14px; flex-wrap:wrap; margin-bottom:30px;
  }
  .home-cta-btn{
    padding:14px 26px; border-radius:8px; cursor:pointer;
    font-family:'Chakra Petch',sans-serif; font-size:15px; font-weight:700;
    transition:transform .15s ease, box-shadow .15s ease;
  }
  .home-cta-btn:hover{ transform:translateY(-2px); }
  .home-cta-primary{
    background:linear-gradient(135deg, var(--orange), #d98a3f);
    border:none; color:#1a1005;
    box-shadow:0 10px 30px rgba(242,166,90,0.35);
  }
  .home-cta-primary:hover{ box-shadow:0 14px 38px rgba(242,166,90,0.5); }
  .home-cta-secondary{
    background:var(--bg-card); border:1px solid var(--line);
    color:var(--text);
  }
  .home-cta-secondary:hover{ border-color:var(--orange-soft); background:var(--tint-weak); }

  .free-card-row{ display:grid; grid-template-columns:1fr 1fr; gap:20px; margin-bottom:20px; }
  @media (max-width:760px){ .free-card-row{ grid-template-columns:1fr; } }

  /* no box/background at all -- just two rows of title+download link,
     the download links column-aligned to whichever title is longer.
     display:table/table-row/table-cell (not grid) so the first column
     reliably auto-sizes to its widest row across all rendering engines.
     the table-cell lands on a plain wrapper div, never on the <button>
     itself -- buttons carry an internal UA box some engines don't fully
     reflow under non-default display values (table-cell/grid/etc.), which
     can throw off that engine's column-width measurement even though the
     rule computes fine elsewhere.
     vertical-align:top, not middle -- row 1's title cell holds the .free-tag
     badge (an inline-block) alongside its text, which inflates that cell's
     line-box height beyond row 2's plain-text title. vertical-align:middle
     centers each cell within ITS OWN row's height, so row 1 and row 2 ended
     up centering by different amounts and the button drifted out of line
     with its own title from one row to the next. top-alignment anchors
     both cells to the row's top edge regardless of that height difference,
     so the offset is small and identical on every row. */
  .free-list{ display:table; border-collapse:separate; border-spacing:0 10px; margin-bottom:26px; }
  .free-list-row{ display:table-row; }
  /* the badge gets its own column instead of sitting inline inside
     row 1's title text -- row 2 has no badge, so an inline badge only
     pushes row 1's TEXT rightward, leaving the two rows' body text
     starting at different x. as a table-cell (row 2 just has an empty
     one), its width joins the normal shared-column-width computation,
     so both rows' title TEXT columns line up regardless of badge width. */
  .free-list-badge-cell{ display:table-cell; vertical-align:top; padding-right:10px; }
  .free-list-title{ display:table-cell; font-size:15px; font-weight:600; color:var(--text); padding-right:18px; vertical-align:top; }
  .free-tag{
    display:inline-block;
    background:var(--orange); color:#1a1005; font-weight:700;
    font-size:12px; padding:3px 10px; border-radius:999px;
    font-family:'Chakra Petch',sans-serif; letter-spacing:0.04em;
  }
  body.light-mode .free-tag{ background:#f2a65a; }
  .free-list-dl-cell{ display:table-cell; vertical-align:top; }
  .free-list-dl{
    background:none; border:none; padding:0; font:inherit; font-size:14px; font-weight:700;
    color:var(--orange-soft); text-decoration:underline; text-underline-offset:2px;
    cursor:pointer; text-align:left; white-space:nowrap;
  }
  .free-list-dl:hover{ color:var(--orange); }
  @media (max-width:600px){
    .free-list{ display:block; }
    .free-list-row{ display:block; margin-bottom:14px; }
    .free-list-badge-cell{ display:inline; padding-right:0; }
    .free-list-title{ display:block; padding-right:0; margin-bottom:4px; }
    .free-list-dl-cell{ display:block; }
  }

  .free-card{
    background:linear-gradient(135deg, var(--tint-hover), rgba(20,31,56,0.0));
    border:1px solid rgba(242,166,90,0.4);
    border-radius:8px;
    padding:28px 30px;
    display:flex; flex-direction:column; align-items:flex-start; gap:16px;
    position:relative; overflow:hidden;
  }
  .free-card::before{
    content:""; position:absolute; right:19px; top:3px; font-size:40px; font-weight:700;
    font-family:'Chakra Petch',sans-serif; color:rgba(242,166,90,0.27); pointer-events:none;
  }
  .free-tag{
    display:inline-block;
    background:var(--orange); color:#1a1005; font-weight:700;
    font-size:12px; padding:3px 10px; border-radius:999px; margin-bottom:10px;
    font-family:'Chakra Petch',sans-serif; letter-spacing:0.04em;
  }
  /* same reasoning as the .btn override above: light mode's --orange is
     tuned for text contrast, not as a solid fill */
  body.light-mode .free-tag{ background:#f2a65a; }
  .free-card h3{ font-size:21px; margin-bottom:6px; }
  .free-card p{ color:var(--muted); font-size:14px; max-width:500px; }
  /* promo-card stays a single-row layout (text left, button right) instead of
     .free-card's usual vertical stack, so it reads as a shorter banner --
     title/description are capped to one line each with an ellipsis fallback
     rather than wrapping, which is what keeps the row short */
  .promo-card{ flex-direction:row; align-items:center; justify-content:space-between; gap:24px; padding-top:20px; padding-bottom:20px; }
  .promo-card > div:first-child{ flex:1; min-width:0; }
  .promo-card h3{ font-size:18px; margin-bottom:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .promo-card p{ max-width:100%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .promo-card .field-popup-wrap{ flex:none; }
  @media (max-width:700px){
    .promo-card{ flex-direction:column; align-items:flex-start; }
    .promo-card h3, .promo-card p{ white-space:normal; }
  }
  .free-card.olympiad{
    background:linear-gradient(135deg, rgba(185,138,242,0.16), rgba(20,31,56,0.00));
    border:1px solid rgba(185,138,242,0.45);
  }
  .free-card.olympiad::before{ color:rgba(185,138,242,0.27); }
  .free-card.olympiad .free-tag{ background:linear-gradient(90deg, var(--purple), var(--pink)); color:#fff; }
  .free-card.olympiad .link-box-btn{ background:rgba(185,138,242,0.12); border-color:rgba(185,138,242,0.5); color:#fff; }
  .free-card.olympiad .link-box-btn:hover{ background:rgba(185,138,242,0.22); border-color:var(--purple); }
  /* same green used everywhere else for คัดเลือกเข้าค่าย 1 content
     (.clr-prep, .chip.kw-prep, --brd-prep) -- rgba(127,216,160,...) is
     that color's dark-mode value, matching --brd-prep's own rgba() */
  .free-card.prep{
    background:linear-gradient(135deg, rgba(127,216,160,0.16), rgba(20,31,56,0.00));
    border:1px solid rgba(127,216,160,0.45);
  }
  .free-card.prep::before{ color:rgba(127,216,160,0.27); }
  .free-card.prep .free-tag{ background:var(--green-ok); color:#08160f; }
  .free-card.prep .link-box-btn{ background:rgba(127,216,160,0.12); border-color:rgba(127,216,160,0.5); color:#fff; }
  .free-card.prep .link-box-btn:hover{ background:rgba(127,216,160,0.22); border-color:var(--green-ok); }
  .free-card.skyview-card{
    background:linear-gradient(135deg, rgba(120,170,255,0.16), rgba(20,31,56,0.00));
    border:1px solid rgba(120,170,255,0.45);
  }
  .free-card.skyview-card::before{ color:rgba(120,170,255,0.27); }
  .free-card.skyview-card .free-tag{ background:rgba(120,170,255,0.9); color:#04142e; }
  .free-card.skyview-card .link-box-btn{ background:rgba(120,170,255,0.85); border-color:rgba(120,170,255,0.95); color:#000; }
  .free-card.skyview-card .link-box-btn:hover{ background:rgba(120,170,255,1); border-color:rgba(120,170,255,1); color:#000; text-decoration:underline; }
  .free-card .field-popup-wrap{ width:max-content; max-width:100%; }

  .home-nav-grid{ display:grid; grid-template-columns:1fr 1fr; gap:14px; margin:26px 0; }
  @media (max-width:760px){ .home-nav-grid{ grid-template-columns:1fr; } }
  .home-nav-card{
    display:flex; align-items:center; gap:14px; text-align:left; width:100%;
    background:var(--bg-card); border:1px solid var(--line); border-radius:10px;
    padding:16px 18px; cursor:pointer; font-family:inherit; color:var(--text);
    transition:transform .15s ease, border-color .15s ease, box-shadow .15s ease;
  }
  .home-nav-card:hover{ transform:translateY(-2px); box-shadow:0 8px 22px rgba(0,0,0,0.18); }
  .home-nav-card .hnc-icon{
    flex-shrink:0; width:42px; height:42px; border-radius:10px;
    display:flex; align-items:center; justify-content:center;
  }
  .home-nav-card .hnc-icon svg{ width:22px; height:22px; }
  .home-nav-card .hnc-text{ flex:1; min-width:0; }
  .home-nav-card .hnc-label{ display:block; font-family:'Chakra Petch',sans-serif; font-weight:700; font-size:15.5px; }
  .home-nav-card .hnc-desc{ display:block; font-size:12px; color:var(--muted); margin-top:2px; }
  .home-nav-card .hnc-arrow{ flex-shrink:0; color:var(--muted-dim); font-size:20px; transition:transform .15s ease; }
  .home-nav-card:hover .hnc-arrow{ transform:translateX(3px); }
  .home-nav-card.nav-bank{ border-color:rgba(242,166,90,0.45); }
  .home-nav-card.nav-bank .hnc-icon{ background:rgba(242,166,90,0.16); color:var(--orange); }
  .home-nav-card.nav-bank:hover{ border-color:rgba(242,166,90,0.8); }
  .home-nav-card.nav-content{ border-color:rgba(127,216,160,0.45); }
  .home-nav-card.nav-content .hnc-icon{ background:rgba(127,216,160,0.16); color:var(--green-ok); }
  .home-nav-card.nav-content:hover{ border-color:rgba(127,216,160,0.8); }
  .home-nav-card.nav-tutor{ border-color:rgba(185,138,242,0.45); }
  .home-nav-card.nav-tutor .hnc-icon{ background:rgba(185,138,242,0.16); color:var(--purple); }
  .home-nav-card.nav-tutor:hover{ border-color:rgba(185,138,242,0.8); }
  .home-nav-card.nav-weekly{ border-color:rgba(242,138,208,0.45); }
  .home-nav-card.nav-weekly .hnc-icon{ background:rgba(242,138,208,0.16); color:var(--pink); }
  .home-nav-card.nav-weekly:hover{ border-color:rgba(242,138,208,0.8); }
  .home-nav-card.nav-skyview{ border-color:rgba(120,170,255,0.45); }
  .home-nav-card.nav-skyview .hnc-icon{ background:rgba(120,170,255,0.16); color:rgb(120,170,255); }
  .home-nav-card.nav-skyview:hover{ border-color:rgba(120,170,255,0.8); }
  .home-nav-card.nav-about{ border-color:rgba(94,202,217,0.45); }
  .home-nav-card.nav-about .hnc-icon{ background:rgba(94,202,217,0.16); color:rgb(94,202,217); }
  .home-nav-card.nav-about:hover{ border-color:rgba(94,202,217,0.8); }
  /* physics is a different subject track from the rest of this astronomy
     site, so it gets its own accent color (purple -- distinct from the
     softer lavender already used by nav-tutor) rather than reusing an
     existing subject's color, so it reads as "something else" at a
     glance rather than blending in */
  .home-nav-card.nav-physics{ border-color:rgba(168,85,247,0.5); }
  .home-nav-card.nav-physics .hnc-icon{ background:rgba(168,85,247,0.16); color:rgb(168,85,247); }
  .home-nav-card.nav-physics:hover{ border-color:rgba(168,85,247,0.85); }
  #sec-skyview-hub .free-card-row.skyview-hub-row{ grid-template-columns:1fr; gap:10px; }
  /* buttons sit to the right of the card's text instead of below it --
     same row layout as .promo-card, but without its single-line/ellipsis
     truncation since these cards' descriptions wrap across 2 lines */
  #sec-skyview-hub .free-card.skyview-card{
    flex-direction:row; align-items:center; justify-content:space-between; gap:24px;
  }
  #sec-skyview-hub .free-card.skyview-card > div:first-child{ flex:1; min-width:0; }
  @media (max-width:700px){
    #sec-skyview-hub .free-card.skyview-card{ flex-direction:column; align-items:flex-start; }
  }

  .skyview-star-ref{ margin-top:8px; }
  /* extra breathing room specifically where the DSO list follows directly
     after the star table, on top of the plain 8px every .skyview-star-ref
     gets -- otherwise its heading sits right up against the star table's
     scroll box above it */
  .skyview-star-ref + .skyview-star-ref{ margin-top:40px; }
  .skyview-star-ref h3{ font-size:18px; margin-bottom:6px; font-family:'Chakra Petch',sans-serif; }
  .skyview-star-ref-note{ font-size:12.5px; color:var(--muted); margin-bottom:12px; }
  .skyview-star-ref-search{
    display:flex; align-items:center; gap:6px; margin-bottom:10px;
  }
  .skyview-star-ref-search-input-wrap{ position:relative; flex:1; max-width:320px; }
  .skyview-star-ref-search input{
    width:100%; padding:7px 30px 7px 12px; border-radius:6px; box-sizing:border-box;
    border:1px solid var(--line); background:var(--bg-card); color:var(--text); font:inherit; font-size:13px;
  }
  .skyview-star-ref-asterism-btn{ position:absolute; right:6px; top:50%; transform:translateY(-50%); margin-left:0; }
  .skyview-asterism-dropdown{
    display:none; position:absolute; top:calc(100% + 6px); left:0; z-index:6;
    width:min(320px, 90vw); max-height:280px; overflow-y:auto;
    background:var(--bg-panel); border:1px solid var(--line); border-radius:8px;
    padding:6px; box-shadow:0 12px 30px rgba(0,0,0,0.35);
  }
  .skyview-asterism-dropdown.show{ display:block; }
  .skyview-asterism-dropdown-item{
    padding:7px 10px; border-radius:6px; cursor:pointer; font-size:12.5px; color:var(--text);
  }
  .skyview-asterism-dropdown-item:hover{ background:var(--bg-card); }
  .skyview-asterism-dropdown-label{ font-size:11px; color:var(--muted-dim); padding:6px 10px 2px; text-transform:uppercase; letter-spacing:0.03em; }
  .skyview-star-ref-empty{ font-size:13px; color:var(--muted); padding:14px 12px; }
  .skyview-star-ref-table-wrap{
    max-height:420px; overflow-y:auto; overflow-x:auto; border:1px solid var(--line); border-radius:8px;
    scrollbar-color: rgba(120,170,255,0.55) rgba(120,170,255,0.08);
  }
  .skyview-star-ref-table-wrap::-webkit-scrollbar{ width:10px; height:10px; }
  .skyview-star-ref-table-wrap::-webkit-scrollbar-track{ background:rgba(120,170,255,0.08); }
  .skyview-star-ref-table-wrap::-webkit-scrollbar-thumb{ background:rgba(120,170,255,0.55); border-radius:8px; }
  .skyview-star-ref-table-wrap::-webkit-scrollbar-thumb:hover{ background:rgba(120,170,255,0.75); }
  /* separate class from skyview-star-ref-table-wrap above (not just a
     second element with the same class) -- skyviewQuizOpenReview's
     scroll-position restore does document.querySelector('.skyview-star-
     ref-table-wrap'), which only ever finds the first match, so sharing
     the class would silently break that restore for whichever of the two
     tables isn't first. Same visual styling either way. */
  .skyview-dso-ref-table-wrap{
    max-height:420px; overflow-y:auto; overflow-x:auto; border:1px solid var(--line); border-radius:8px;
    scrollbar-color: rgba(120,170,255,0.55) rgba(120,170,255,0.08);
  }
  .skyview-dso-ref-table-wrap::-webkit-scrollbar{ width:10px; height:10px; }
  .skyview-dso-ref-table-wrap::-webkit-scrollbar-track{ background:rgba(120,170,255,0.08); }
  .skyview-dso-ref-table-wrap::-webkit-scrollbar-thumb{ background:rgba(120,170,255,0.55); border-radius:8px; }
  .skyview-dso-ref-table-wrap::-webkit-scrollbar-thumb:hover{ background:rgba(120,170,255,0.75); }
  /* separate class again, same reasoning as skyview-dso-ref-table-wrap's
     own comment above -- a 3rd table needs a 3rd unique wrap class so
     document.querySelector(wrapSelector) in skyviewPeekObject (and the
     quiz-review scroll restore) can't resolve to the wrong table's wrap */
  .skyview-const-ref-table-wrap{
    max-height:420px; overflow-y:auto; overflow-x:auto; border:1px solid var(--line); border-radius:8px;
    scrollbar-color: rgba(120,170,255,0.55) rgba(120,170,255,0.08);
  }
  .skyview-const-ref-table-wrap::-webkit-scrollbar{ width:10px; height:10px; }
  .skyview-const-ref-table-wrap::-webkit-scrollbar-track{ background:rgba(120,170,255,0.08); }
  .skyview-const-ref-table-wrap::-webkit-scrollbar-thumb{ background:rgba(120,170,255,0.55); border-radius:8px; }
  .skyview-const-ref-table-wrap::-webkit-scrollbar-thumb:hover{ background:rgba(120,170,255,0.75); }
  /* table-layout:fixed + explicit per-column widths, shared by BOTH the
     star and DSO tables via this one class -- with auto layout, each
     <table> sizes its own columns from its own content independently, so
     the star table's 4 columns never lined up with the DSO table's 4
     columns below it even though the column COUNT matches. Fixed widths
     make both tables agree on the same boundaries regardless of which
     table's content happens to be wider in a given column. */
  .skyview-star-ref-table{ width:100%; table-layout:fixed; border-collapse:collapse; font-size:13px; }
  .skyview-star-ref-table th:nth-child(1), .skyview-star-ref-table td:nth-child(1){ width:32%; }
  .skyview-star-ref-table th:nth-child(2), .skyview-star-ref-table td:nth-child(2){ width:26%; }
  .skyview-star-ref-table th:nth-child(3), .skyview-star-ref-table td:nth-child(3){ width:18%; }
  .skyview-star-ref-table th:nth-child(4), .skyview-star-ref-table td:nth-child(4){ width:24%; }
  /* 2-column table (name + notable stars), no other table to line up
     with, so it gets its own split instead of the 4-column defaults above */
  .skyview-const-ref-table th:nth-child(1), .skyview-const-ref-table td:nth-child(1){ width:32%; }
  .skyview-const-ref-table th:nth-child(2), .skyview-const-ref-table td:nth-child(2){ width:68%; }
  .skyview-star-ref-table th, .skyview-star-ref-table td{
    padding:8px 12px; text-align:left; border-bottom:1px solid var(--line);
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }
  .skyview-star-ref-table th{
    position:sticky; top:0; background:var(--bg-card); color:var(--muted); font-weight:600; z-index:1;
  }
  /* the DSO name cell packs a name button + a Wikipedia link button --
     the cell's own overflow:hidden/ellipsis (for the fixed-width column
     shared with the star table) would otherwise clip the link button off
     a long name instead of just truncating the name text. flex-shrink:0
     on the link keeps it in a fixed spot; min-width:0 on the name button
     is what lets IT actually shrink/ellipsis instead of overflowing. */
  .skyview-dso-name-cell{ display:flex; align-items:center; gap:4px; }
  .skyview-dso-name-cell .skyview-star-ref-link{ overflow:hidden; text-overflow:ellipsis; min-width:0; }
  .skyview-dso-wiki-btn{
    display:inline-flex; align-items:center; justify-content:center; flex-shrink:0;
    width:17px; height:17px; border-radius:4px; border:1px solid var(--sky-border);
    color:var(--sky-text-muted); font-size:11px; text-decoration:none;
  }
  .skyview-dso-wiki-btn:hover{ border-color:var(--sky-accent); color:var(--sky-accent); }
  .skyview-star-ref-table tbody tr:hover{ background:rgba(120,170,255,0.08); }
  /* importance tiers, ordered gold (must-know) > silver (frequently
     examined, same weight as gold) > copper (supplementary extra) --
     new, dedicated pale tones so they read distinctly from the site's
     usual orange accent and don't fight the hover tint above. Hover on
     an untiered row already darkens slightly (rule above); tiered rows
     had no hover feedback of their own at all -- a nudge in the same
     direction (a bit more opaque, not a different color) on top of each
     tier's own background gives every row that same subtle response. */
  .skyview-star-ref-table tbody tr.tier-gold{ background:rgba(255,208,90,0.14); }
  .skyview-star-ref-table tbody tr.tier-gold:hover{ background:rgba(255,208,90,0.22); }
  .skyview-star-ref-table tbody tr.tier-silver{ background:rgba(196,208,224,0.16); }
  .skyview-star-ref-table tbody tr.tier-silver:hover{ background:rgba(196,208,224,0.25); }
  .skyview-star-ref-table tbody tr.tier-copper{ background:rgba(196,124,74,0.16); }
  .skyview-star-ref-table tbody tr.tier-copper:hover{ background:rgba(196,124,74,0.25); }
  /* dark grey "no tier assigned" -- distinct from an untiered row simply
     having no tier-* class at all (the old behavior): giving it its own
     explicit class/color means it reads as its own real category in the
     table (and can be filtered via the 4th button below) instead of
     silently blending into the default row background */
  .skyview-star-ref-table tbody tr.tier-none{ background:rgba(120,126,145,0.12); }
  .skyview-star-ref-table tbody tr.tier-none:hover{ background:rgba(120,126,145,0.2); }
  .skyview-tier-swatch{
    display:inline-block; width:12px; height:12px; border-radius:3px; margin-right:6px; vertical-align:-1px;
  }
  .skyview-tier-swatch.tier-gold{ background:rgba(255,208,90,0.9); }
  .skyview-tier-swatch.tier-silver{ background:rgba(196,208,224,0.9); }
  .skyview-tier-swatch.tier-copper{ background:rgba(196,124,74,0.9); }
  .skyview-tier-swatch.tier-none{ background:rgba(120,126,145,0.9); }
  /* same tier colors as the swatches above, but as an actual toggle:
     filled (active, the default) includes that tier in the table below,
     clicking again drops the fill to just an outline and hides its rows */
  .skyview-tier-filter-btn{
    display:inline-block; width:12px; height:12px; border-radius:50%; margin-left:5px;
    padding:0; cursor:pointer; vertical-align:-1px; background:transparent; border:2px solid;
  }
  .skyview-tier-filter-btn.tier-gold{ border-color:rgba(255,208,90,0.9); }
  .skyview-tier-filter-btn.tier-silver{ border-color:rgba(196,208,224,0.9); }
  .skyview-tier-filter-btn.tier-copper{ border-color:rgba(196,124,74,0.9); }
  .skyview-tier-filter-btn.tier-none{ border-color:rgba(120,126,145,0.9); }
  .skyview-tier-filter-btn.tier-gold.active{ background:rgba(255,208,90,0.9); }
  .skyview-tier-filter-btn.tier-silver.active{ background:rgba(196,208,224,0.9); }
  .skyview-tier-filter-btn.tier-copper.active{ background:rgba(196,124,74,0.9); }
  .skyview-tier-filter-btn.tier-none.active{ background:rgba(120,126,145,0.9); }
  /* each name in the constellation table's "ดาวเด่น" column, colored by
     that star's OWN reference-table tier (see skyviewConstNotableStars) --
     unrelated to the row's own tier-* class (the constellation's quiz
     category), hence a distinct selector rather than reusing the row rule */
  .skyview-const-notable-star.tier-gold{ color:rgba(255,208,90,0.95); }
  .skyview-const-notable-star.tier-silver{ color:rgba(196,208,224,0.95); }
  .skyview-const-notable-star.tier-copper{ color:rgba(196,124,74,0.95); }
  .skyview-const-notable-star.tier-none{ color:rgba(120,126,145,0.95); }
  .skyview-const-notable-star.tier-star-hidden{ display:none; }
  /* comma-separates only the currently-visible names -- since a hidden
     star's span (display:none) is skipped entirely by the general sibling
     combinator, this never leaves a dangling/leading comma no matter which
     combination of tiers is toggled off */
  .skyview-const-notable-star:not(.tier-star-hidden) ~ .skyview-const-notable-star:not(.tier-star-hidden)::before{
    content:", "; color:var(--sky-text-muted);
  }
  .skyview-star-note-btn{ margin-left:3px; }
  .skyview-bayer-sort-btn.active{ background:rgba(120,170,255,0.55); border-color:rgba(120,170,255,0.85); }
  .skyview-bayer-sort-btn.active:hover{ background:rgba(120,170,255,0.7); }
  .skyview-tier-sort-btn{ margin-left:4px; }
  .skyview-tier-sort-btn.active{ background:rgba(120,170,255,0.55); border-color:rgba(120,170,255,0.85); }
  .skyview-tier-sort-btn.active:hover{ background:rgba(120,170,255,0.7); }
  .skyview-note-popover{
    /* z-index 160, not 95 -- the popover lives outside every .section
       (see comment at its markup) so it can show while a section is
       active, but #sec-skyview.section.active itself claims z-index:150
       (it goes fullscreen over the whole site chrome while open), so a
       sibling popover at 95 rendered behind the entire active skyview
       section -- including its own "i" button's modal at z-index:90 --
       even though the click handler ran fine (text set, positioned,
       .show added), just invisibly behind it. 160 clears both. */
    display:none; position:fixed; z-index:160; max-width:280px;
    max-height:calc(100vh - 16px); overflow-y:auto;
    background:var(--bg-panel); border:1px solid var(--line); border-radius:8px;
    padding:10px 12px; font-size:12.5px; line-height:1.6; color:var(--text);
    box-shadow:0 12px 30px rgba(0,0,0,0.35);
  }
  .skyview-note-popover.show{ display:block; }
  .skyview-star-ref-link{
    background:none; border:none; padding:0; font:inherit; color:inherit; cursor:pointer;
    text-decoration:underline; text-underline-offset:2px;
  }
  .skyview-star-ref-link:hover{ color:var(--orange); }
  .skyview-info-btn{
    display:inline-flex; align-items:center; justify-content:center;
    width:16px; height:16px; border-radius:50%; margin-left:4px;
    background:rgba(120,170,255,0.18); border:1px solid rgba(120,170,255,0.5); color:var(--text);
    font-size:11px; font-style:italic; font-weight:700; font-family:Georgia,serif; line-height:1; cursor:pointer; padding:0;
  }
  .skyview-info-btn:hover{ background:rgba(120,170,255,0.32); }
  .skyview-spectral-info-body{ max-height:55vh; overflow-y:auto; font-size:13.5px; line-height:1.6; margin:14px 0; }
  .skyview-spectral-info-body p{ margin:0 0 12px; }
  .skyview-spectral-info-body p:last-child{ margin-bottom:0; }

  .skyview-peek-back-bar{ position:fixed; bottom:16px; left:16px; z-index:56; display:none; }
  .skyview-peek-back-bar.show{ display:block; }

  .skyview-history-modal{
    /* z-index 90, same reasoning as .skyview-quiz-setup above -- this
       modal (also shared by the spectral-info modal) is opened from the
       hub page, a normal section sitting below the top strip's z-index
       80, so it needs to clear that same bar. Also same top:var(--top-
       strip-h) fix as .skyview-quiz-setup: z-index only controls paint
       order, not the vertical-centering math, so without this the
       dashboard content (now much taller after adding the DSO
       collection/tiers) can still center itself with its top edge
       overlapping/under the bar on shorter viewports. Same inset:0 +
       padding-top swap as .skyview-quiz-setup, so the backdrop actually
       darkens the whole screen instead of leaving the strip's own
       translucent gap showing at the top. */
    position:fixed; inset:0; padding-top:var(--top-strip-h); z-index:90; display:none;
    align-items:center; justify-content:center;
    background:rgba(5,7,15,0.75);
  }
  .skyview-history-modal.show{ display:flex; }
  .skyview-history-list{ display:flex; flex-direction:column; gap:5px; max-height:50vh; overflow-y:auto; margin:14px 0; }
  .skyview-history-item{
    display:flex; justify-content:space-between; gap:10px; font-size:12px;
    padding:5px 10px; border-radius:6px; background:rgba(255,255,255,0.04); color:var(--sky-text);
  }
  .skyview-history-day-label{
    font-size:11px; font-weight:700; color:var(--sky-text-muted);
    margin:10px 0 4px; letter-spacing:0.3px;
  }
  .skyview-history-day-label:first-child{ margin-top:0; }
  .skyview-history-empty{ font-size:13px; color:var(--sky-text-muted); margin:14px 0; }
  /* prettier, thinner scrollbars for skyview's popup/modal scroll areas
     (history, spectral info, options panel, search results, quiz review)
     instead of the browser's chunky default */
  .skyview-quiz-box,
  .skyview-history-list,
  .skyview-spectral-info-body,
  .skyview-options-panel,
  .skyview-search-list,
  .skyview-quiz-review{ scrollbar-width:thin; scrollbar-color:var(--sky-border) transparent; }
  .skyview-quiz-box::-webkit-scrollbar,
  .skyview-history-list::-webkit-scrollbar,
  .skyview-spectral-info-body::-webkit-scrollbar,
  .skyview-options-panel::-webkit-scrollbar,
  .skyview-search-list::-webkit-scrollbar,
  .skyview-quiz-review::-webkit-scrollbar{ width:8px; }
  .skyview-quiz-box::-webkit-scrollbar-track,
  .skyview-history-list::-webkit-scrollbar-track,
  .skyview-spectral-info-body::-webkit-scrollbar-track,
  .skyview-options-panel::-webkit-scrollbar-track,
  .skyview-search-list::-webkit-scrollbar-track,
  .skyview-quiz-review::-webkit-scrollbar-track{ background:transparent; }
  .skyview-quiz-box::-webkit-scrollbar-thumb,
  .skyview-history-list::-webkit-scrollbar-thumb,
  .skyview-spectral-info-body::-webkit-scrollbar-thumb,
  .skyview-options-panel::-webkit-scrollbar-thumb,
  .skyview-search-list::-webkit-scrollbar-thumb,
  .skyview-quiz-review::-webkit-scrollbar-thumb{ background-color:var(--sky-border); border-radius:8px; }
  .skyview-quiz-box::-webkit-scrollbar-thumb:hover,
  .skyview-history-list::-webkit-scrollbar-thumb:hover,
  .skyview-spectral-info-body::-webkit-scrollbar-thumb:hover,
  .skyview-options-panel::-webkit-scrollbar-thumb:hover,
  .skyview-search-list::-webkit-scrollbar-thumb:hover,
  .skyview-quiz-review::-webkit-scrollbar-thumb:hover{ background-color:rgba(255,255,255,0.35); }
  /* one tier's grid -- several of these stack per collection (star: top
     25 / mag<2 / mag<3 / zodiac-only extras; DSO: basic / general),
     largest tier first, with .skyview-collection-divider between them.
     No per-tier max-height/scroll here anymore -- the whole modal
     (.skyview-quiz-box) already scrolls, so a nested scroll region per
     tier would just mean two scrollbars fighting each other. */
  .skyview-star-collection{
    /* minmax(0,1fr), not a bare 1fr -- see the .shell grid comment
       above for why a bare fr track's implicit auto minimum lets a
       long unbreakable name (e.g. "Rigil Kentaurus") force the whole
       row past the container width instead of truncating via the
       item's own text-overflow:ellipsis */
    display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:8px;
    margin-bottom:6px;
  }
  /* clearly visible group separator (gold/silver/copper) -- the old
     1px, 20%-opacity line was barely there since these 3 groups no
     longer have their own text headers to lean on for separation */
  .skyview-collection-divider{ height:2px; background:rgba(255,255,255,0.4); border-radius:1px; margin:16px 0; }
  .skyview-star-collection-item{
    background:rgba(255,255,255,0.04); border-radius:6px; padding:6px 8px; color:var(--sky-text);
  }
  .skyview-star-collection-item .name{ font-size:12.5px; display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .skyview-star-collection-item .stats{ font-size:10.5px; color:var(--sky-text-muted); display:block; margin-top:2px; white-space:nowrap; }
  .skyview-star-collection-item .stats .ok{ color:#a8e6bd; }
  .skyview-star-collection-item .stats .bad{ color:#ffb3b3; }
  /* tiered prominence: the most-notable group (brightest stars / basic
     DSOs) reads largest, tapering down for the less prominent groups */
  .skyview-star-collection.tier-1 .name{ font-size:15px; }
  .skyview-star-collection.tier-1 .stats{ font-size:11.5px; }
  .skyview-star-collection.tier-2 .name{ font-size:12.5px; }
  .skyview-star-collection.tier-3 .name{ font-size:10.5px; }
  .skyview-star-collection.tier-3 .stats{ font-size:9.5px; }
  /* achievement-list treatment: stars never encountered in a quiz yet
     show only their (dimmed) name and no stats row at all -- like an
     unlocked-vs-locked entry in a game's collection screen */
  .skyview-star-collection-item.locked .name{ color:var(--sky-text-muted); opacity:0.55; }

  .skyview-dashboard-note{ font-size:12.5px; color:var(--sky-text-muted); margin-bottom:10px; }
  .skyview-dashboard-stats{ display:flex; flex-direction:column; gap:4px; margin-bottom:14px; }
  .skyview-dashboard-stat{ font-size:13.5px; color:var(--sky-text); }
  .skyview-dashboard-stat b{ color:var(--sky-accent-soft); font-family:'Chakra Petch',sans-serif; }
  .skyview-history-heading-row{
    display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px 14px;
    margin-top:18px; margin-bottom:10px;
  }
  .skyview-history-heading-row h3{ margin:0; }

  /* homepage weekly quiz stack all 3 levels shown from the front page */
  .quiz-stack{ display:flex; flex-direction:column; gap:18px; margin-bottom:36px; }
  .quiz-block{
    background:var(--bg-card); border:1px solid var(--line); border-radius:8px; padding:22px 24px;
  }
  .quiz-block-head h3{ font-size:17.5px; margin-bottom:6px; }
  .quiz-block-sub{ font-size:13.5px; color:var(--muted); line-height:1.6; max-width:640px; }
  .quiz-questions{ display:grid; gap:12px; margin-top:16px; }
  .no-prev-quiz{
    margin-top:16px; border:1.5px dashed var(--line); border-radius:8px; padding:20px;
    color:var(--muted); font-size:13.5px; line-height:1.8; background:rgba(242,166,90,0.04);
  }
  .quiz-q{
    background:var(--bg-panel-2); border:1px solid var(--line-soft); border-radius:8px; padding:14px 16px;
    display:flex; flex-wrap:wrap; align-items:center; gap:12px; justify-content:space-between;
  }
  .quiz-q .quiz-q-text{ font-size:13.5px; color:var(--text); flex:1; min-width:200px; }
  .quiz-q .quiz-q-text .qnum{ color:var(--orange-soft); font-family:'Chakra Petch',sans-serif; font-weight:700; margin-right:6px; }
  .quiz-q input.quiz-answer{
    background:var(--bg-card); border:1px solid var(--line-soft); border-radius:8px;
    padding:9px 12px; color:var(--text); font-size:13.5px; font-family:'Chakra Petch',sans-serif;
    width:150px; outline:none;
  }
  .quiz-q input.quiz-answer:focus{ border-color:var(--orange); }
  .quiz-q.correct{ border-color:rgba(127,216,160,0.55); }
  .quiz-q.correct input.quiz-answer{ border-color:var(--green-ok); }
  .quiz-q.wrong{ border-color:rgba(228,106,106,0.55); }
  .quiz-q.wrong input.quiz-answer{ border-color:#e46a6a; }
  .quiz-actions{ display:flex; align-items:center; gap:14px; flex-wrap:wrap; margin-top:16px; }
  .quiz-result{ font-size:13.5px; line-height:1.7; }
  .quiz-result.ok{ color:var(--green-ok); }
  .quiz-result.fail{ color:var(--error-text); }
  .btn{
    font-family:'Chakra Petch',sans-serif; font-weight:600; font-size:14px;
    padding:12px 22px; border-radius:8px; border:none;
    background:var(--orange); color:#1a1005;
    transition:transform .15s ease, box-shadow .15s ease, background .2s;
    white-space:nowrap;
  }
  .btn:hover{ background:var(--orange-soft); transform:translateY(-1px); box-shadow:0 6px 18px rgba(242,166,90,0.3); }
  .btn.ghost{ background:transparent; border:1px solid rgba(255,255,255,0.4); color:var(--text); }
  .btn.ghost:hover{ background:var(--tint-weak); }
  /* dark mode's --line is a faint orange tint meant for large card
     outlines, not small buttons -- ghost buttons (ดูเฉลย, รายละเอียด, ...)
     need a border people can actually see at a glance, hence plain
     white/near-black instead of that same faint accent tint */
  body.light-mode .btn.ghost{ border-color:rgba(20,20,30,0.35); }
  .btn.small{ padding:8px 16px; font-size:12.5px; }
  .btn:disabled{ opacity:0.55; cursor:default; transform:none; box-shadow:none; }
  /* light mode's --orange (#d9822b) is tuned for text/icon contrast against a
     white page, which makes it too dark/saturated as a solid button fill --
     buttons get their own softer shade here instead (dark mode's own --orange
     value, which was already tuned to look right as a button fill) without
     touching --orange itself, since that would also dim every icon/border/
     focus-ring that relies on it for contrast */
  body.light-mode .btn:not(.ghost){ background:#f2a65a; }
  body.light-mode .btn:not(.ghost):hover{ background:#f7b876; }
  select.fr-level-select{
    appearance:none; -webkit-appearance:none; cursor:pointer; text-align:center; text-align-last:center;
  }

  /* auth section: center card in the middle of the screen */
  #sec-auth.section.active{
    display:flex; flex-direction:column; align-items:center; justify-content:center;
    min-height:calc(100vh - 116px); text-align:center;
  }
  #sec-auth .section-line{ margin-left:auto; margin-right:auto; }
  #sec-auth .login-grid{ width:100%; }

  /* login form */
  .login-grid{ display:grid; grid-template-columns:380px 1fr; gap:28px; }
  @media (max-width:760px){ .login-grid{ grid-template-columns:1fr; } }
  .login-box{
    background:var(--bg-card); border:1px solid var(--line-soft); border-radius:8px; padding:26px;
    text-align:left;
  }
  .login-box h3{ font-size:18px; margin-bottom:4px; }
  .login-box .sub{ font-size:13px; color:var(--muted); margin-bottom:20px; }
  .field{ margin-bottom:14px; }
  .field label{ display:block; font-size:13.5px; color:var(--muted); margin-bottom:6px; }
  .field input, .field textarea{
    width:100%; background:var(--bg-panel-2); border:1px solid var(--line-soft);
    border-radius:8px; padding:11px 13px; color:var(--text); font-size:14px; font-family:'Chakra Petch',sans-serif;
    outline:none;
  }
  .field input:focus, .field textarea:focus{ border-color:var(--orange); }
  .field textarea{ resize:vertical; min-height:80px; font-family:inherit; }
  .login-note{ font-size:13.5px; color:var(--muted-dim); margin-top:14px; line-height:1.6; }
  .unlock-result{
    margin-top:16px; padding:14px 16px; border-radius:8px; background:rgba(127,216,160,0.1);
    border:1px solid rgba(127,216,160,0.35); font-size:13.5px; color:var(--green-ok); display:none;
  }
  .unlock-result.show{ display:block; }

  .about-mini{ font-size:14.5px; color:var(--muted); line-height:1.85; }
  .about-mini h2{ color:var(--text); }
  .about-mini h4{ color:var(--text); font-size:15px; margin-bottom:10px; }
  .feature-list{ list-style:none; margin-top:16px; display:grid; gap:10px; }
  .feature-list li{ display:flex; gap:10px; align-items:baseline; font-size:14px; color:var(--muted); }
  .feature-list li::before{ content:"✦"; color:var(--orange); font-size:12px; }
  /* a weekly-only bullet that is shown must keep the flex layout above
     (the generic show rule uses display:revert, which drops it, so the
     star used to sit glued to the text) */
  body.weekly-archive .feature-list li.weekly-archive-only,
  body:not(.weekly-archive) .feature-list li.weekly-live-only{ display:flex; }

  /* เกี่ยวกับเว็บไซต์: one column per hub */
  .about-hubs{ display:grid; grid-template-columns:1fr 1fr; gap:28px 36px; }
  @media (max-width:760px){ .about-hubs{ grid-template-columns:1fr; } }
  .about-hub{ padding-top:14px; border-top:1px solid var(--line); font-size:14.5px; color:var(--muted); line-height:1.75; }
  .about-hub h3{ font-size:17px; color:var(--text); margin-bottom:6px; }
  .about-hub .feature-list{ margin-top:12px; }
  .about-hub > .link-btn{ margin-top:12px; }
  .about-plain{ font-size:14.5px; color:var(--muted); line-height:1.85; }

  /* bank grid */
  .tier-heading{
    font-family:'Chakra Petch',sans-serif; font-size:13px; letter-spacing:0.08em; text-transform:uppercase;
    color:var(--muted); margin:32px 0 14px; padding-bottom:10px; border-bottom:1px solid var(--line-soft);
    display:flex; align-items:center; gap:10px;
  }
  .tier-heading .dot{ width:8px; height:8px; border-radius:50%; }
  .tier-heading.easy .dot{ background:#7fd8a0; }
  .tier-heading.mid .dot{ background:var(--orange); }
  .tier-heading.hard .dot{ background:#e46a6a; }
  .tier-heading.camp2 .dot{ background:var(--green-ok); }

  .set-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(240px,1fr)); gap:16px; }
  .set-card{
    background:var(--bg-card); border:1px solid var(--line-soft); border-radius:8px; padding:20px;
    display:flex; flex-direction:column; gap:10px;
    transition:border-color .2s ease, transform .2s ease;
  }
  .set-card:hover{ border-color:rgba(242,166,90,0.4); transform:translateY(-2px); }
  .set-card .set-num{ font-family:'Chakra Petch',sans-serif; font-size:12px; color:var(--muted-dim); letter-spacing:0.05em; }
  .set-card h4{ font-size:16.5px; }
  .set-card .desc{ font-size:12.8px; color:var(--muted); line-height:1.6; flex:1; }
  .set-card .price-row{ display:flex; align-items:center; justify-content:space-between; margin-top:6px; }
  .set-card .price{ font-family:'Chakra Petch',sans-serif; font-weight:700; font-size:19px; color:var(--orange-soft); }
  .set-card .price span{ font-size:11px; color:var(--muted-dim); font-weight:400; }
  .set-card .row-btns{ display:flex; gap:8px; }
  .set-card .row-btns .btn{ flex:1; }

  /* modal */
  .modal-back{
    position:fixed; inset:0; background:rgba(6,10,20,0.75); backdrop-filter:blur(3px);
    display:none; align-items:center; justify-content:center; z-index:90; padding:20px;
  }
  .modal-back.show{ display:flex; }
  .modal{
    background:var(--bg-panel); border:1px solid var(--line); border-radius:8px; padding:28px;
    max-width:440px; width:100%;
  }
  .modal h4{ font-size:18px; margin-bottom:10px; }
  .modal p{ font-size:14px; color:var(--muted); line-height:1.75; margin-bottom:16px; }
  .modal .tags{ display:flex; flex-wrap:wrap; margin-bottom:18px; }
  .modal .tags span{ font-size:13px; color:var(--orange-soft); }
  .modal .tags span.fr-tag-sep{ color:var(--muted-dim); }
  .modal-actions{ display:flex; gap:10px; justify-content:flex-end; }

  .search-modal{ max-width:560px; width:100%; text-align:left; }
  .search-results-list{ max-height:50vh; overflow-y:auto; display:flex; flex-direction:column; gap:4px; }
  .search-result-item{
    display:block; width:100%; text-align:left; background:none; border:none;
    padding:10px 12px; border-radius:8px; cursor:pointer;
  }
  .search-result-item:hover{ background:var(--bg-panel-2); }
  .search-result-item .sr-label{ font-size:14px; color:var(--text); font-weight:600; }
  .search-result-item .sr-sub{ font-size:12.5px; color:var(--muted); margin-top:2px; }
  .search-result-item .sr-group{ font-size:11px; color:var(--orange-soft); margin-bottom:2px; }
  .search-suggest-label{ font-size:12.5px; color:var(--muted); margin:6px 0 8px; }
  .search-suggest-chips{ display:flex; flex-wrap:wrap; gap:8px; }
  .search-suggest-chips button{
    background:var(--bg-panel-2); border:1px solid var(--line-soft); border-radius:999px;
    padding:6px 14px; font-size:12.5px; color:var(--text); cursor:pointer; font-family:inherit;
  }
  .search-suggest-chips button:hover{ border-color:rgba(242,166,90,0.5); }
  .search-empty{ font-size:13px; color:var(--muted); padding:10px 12px; }

  /* content section */
  .topic-grid{ display:grid; gap:12px; }
  .topic{
    background:var(--bg-card); border:1px solid var(--line-soft); border-radius:8px;
    padding:18px 20px; cursor:pointer;
  }
  .topic-head{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
  .topic-head h4{ font-size:15.5px; }
  .topic-head .chev{ color:var(--muted-dim); transition:transform .2s ease; font-size:19px; }
  .topic.open .chev{ transform:rotate(90deg); color:var(--orange); }
  .topic-body{
    max-height:0; overflow:hidden; transition:max-height .3s ease;
    font-size:13.5px; color:var(--muted); line-height:1.8;
  }
  .topic.open .topic-body{ max-height:220px; margin-top:12px; }

  /* tutor section */
  /* ติวส่วนตัว: who + contacts beside the prices, then the details in two
     columns divided like .about-hub, so the page stays short */
  .tutor-intro{ display:grid; grid-template-columns:minmax(0, 1fr) 300px; gap:36px; align-items:start; margin-top:6px; }
  .tutor-intro h3{ font-size:19px; margin-bottom:8px; }
  .tutor-intro p{ font-size:14.5px; color:var(--muted); line-height:1.8; margin-bottom:8px; }
  .tutor-actions{ display:flex; flex-wrap:wrap; align-items:center; gap:10px 20px; margin-top:16px; }
  .tutor-price{ padding-left:28px; border-left:1px solid rgba(242,166,90,0.32); }
  .tutor-price h4{ font-size:14px; margin-bottom:10px; color:var(--text); }
  .tutor-price-row{ margin-bottom:10px; }
  .tutor-price-row b{ display:block; font-family:'Chakra Petch',sans-serif; font-size:24px; line-height:1.25; color:var(--orange-soft); }
  body.light-mode .tutor-price-row b{ color:var(--orange-deep); }
  .tutor-price-row span{ font-size:13px; color:var(--muted); }
  .tutor-price p{ font-size:12.5px; line-height:1.65; color:var(--muted-dim); margin:12px 0 0; }
  .tutor-sections{ display:grid; grid-template-columns:1fr 1fr; gap:24px 36px; margin-top:26px; }
  .tutor-sec{ padding-top:14px; border-top:1px solid rgba(242,166,90,0.32); }
  .tutor-sec h4{ font-size:16px; color:var(--text); margin-bottom:10px; }
  .tutor-sec .feature-list{ margin-top:0; gap:8px; }
  .tutor-sec .feature-list li{ line-height:1.65; }
  .tutor-sec .feature-list b{ color:var(--text); }
  .tutor-sec .feature-list b.tutor-silver{ color:#c3cbdc; }
  body.light-mode .tutor-sec .feature-list b.tutor-silver{ color:#66708a; }
  .tutor-closing{ margin-top:22px; font-size:14px; color:var(--muted); }
  @media (max-width:860px){
    .tutor-intro, .tutor-sections{ grid-template-columns:1fr; }
    .tutor-intro{ gap:18px; }
    .tutor-price{ padding:14px 0 0; border-left:0; border-top:1px solid rgba(242,166,90,0.32); }
  }
  .avatar{
    width:180px; height:180px; border-radius:50%;
    background:radial-gradient(circle at 35% 30%, var(--orange-soft), var(--orange-deep) 70%);
    display:flex; align-items:center; justify-content:center;
    font-family:'Chakra Petch',sans-serif; font-size:48px; font-weight:700; color:#1a1005;
    box-shadow:0 0 0 6px rgba(242,166,90,0.1), 0 0 40px rgba(242,166,90,0.25);
  }

  /* tutor booking form */
  .booking-form-grid{ display:grid; grid-template-columns:1fr 1fr; gap:32px; margin-top:20px; }
  @media (max-width:760px){ .booking-form-grid{ grid-template-columns:1fr; gap:0; } }
  #bookingFormWrap .field input, #bookingFormWrap .field textarea{ border-color:var(--line-strong); }
  .booking-subject-dropdown{ position:relative; }
  .booking-dropdown-toggle{
    width:100%; display:flex; align-items:center; justify-content:space-between; gap:10px;
    background:var(--bg-panel-2); border:1px solid var(--line-strong); border-radius:8px;
    padding:11px 13px; color:var(--text); font-size:14px; font-family:'Chakra Petch',sans-serif;
    cursor:pointer; text-align:left;
  }
  .booking-dropdown-toggle:hover{ border-color:var(--orange); }
  .booking-dropdown-arrow{ color:var(--muted); font-size:12px; transition:transform .15s ease; }
  .booking-subject-dropdown.open .booking-dropdown-arrow{ transform:rotate(180deg); }
  .booking-dropdown-panel{
    display:none; position:absolute; top:calc(100% + 6px); left:0; right:0; z-index:5;
    background:var(--bg-panel); border:1px solid var(--line-strong); border-radius:8px;
    padding:6px; max-height:280px; overflow-y:auto; box-shadow:0 12px 30px rgba(0,0,0,0.35);
  }
  .booking-subject-dropdown.open .booking-dropdown-panel{ display:block; }
  .booking-dropdown-item{
    display:flex; align-items:center; gap:10px; padding:9px 10px; border-radius:6px;
    cursor:pointer; font-size:13.5px; color:var(--muted);
    border:1px solid transparent; transition:background .15s ease, border-color .15s ease;
  }
  .booking-dropdown-item:hover{ background:var(--bg-panel-2); }
  .booking-dropdown-item:has(input:checked){
    background:var(--tint-hover); border-color:var(--line-strong);
    color:var(--text); font-weight:700;
  }
  .booking-dropdown-item input{ flex:none; accent-color:var(--orange); }
  .booking-subject-selected{ display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; }
  .booking-subject-selected .pill{
    display:inline-flex; align-items:center; background:rgba(242,166,90,0.12);
    border:1px solid rgba(242,166,90,0.35); color:var(--orange-soft);
    border-radius:999px; padding:5px 12px; font-size:12.5px;
  }
  .booking-stepper{
    display:flex; align-items:stretch; background:var(--bg-panel-2);
    border:1px solid var(--line-strong); border-radius:8px; overflow:hidden;
  }
  .booking-stepper input{
    flex:1; min-width:0; border:none; background:transparent; text-align:center;
    color:var(--text); font-size:16px; font-weight:700; font-family:'Chakra Petch',sans-serif; outline:none;
  }
  .booking-stepper-arrows{ display:flex; flex-direction:column; border-left:1px solid var(--line-strong); }
  .booking-stepper-arrows button{
    flex:1; width:44px; border:none; background:none; color:var(--orange);
    font-size:15px; line-height:1; cursor:pointer; display:flex; align-items:center; justify-content:center;
  }
  .booking-stepper-arrows button:first-child{ border-bottom:1px solid var(--line-strong); }
  .booking-stepper-arrows button:hover{ background:var(--tint-hover); }
  .booking-consent-wrap{ display:grid; gap:10px; margin-top:18px; }
  .booking-consent-row{ display:flex; align-items:flex-start; gap:10px; font-size:13.5px; color:var(--muted); cursor:pointer; }
  .booking-consent-row input{ margin-top:3px; flex:none; accent-color:var(--orange); }
  .booking-consent-row:has(input:checked) span{ color:var(--text); font-weight:600; }

  footer.site-foot{
    border-top:1px solid var(--line-soft); margin-top:60px; padding-top:20px;
    font-size:12px; color:var(--muted-dim); display:flex; justify-content:space-between; flex-wrap:wrap; gap:10px;
  }
  .site-foot-links{ display:flex; gap:16px; }
  .site-foot-links a{ color:var(--muted); text-decoration:none; }
  .site-foot-links a:hover{ color:var(--orange-soft); text-decoration:underline; }

  .clr-prep{ color:var(--green-ok); }
  .clr-camp1{ color:var(--yellow); }
  .clr-camp2{ color:var(--orange-deep); }
  .clr-olympiad{
    background:linear-gradient(90deg, var(--purple), var(--pink));
    -webkit-background-clip:text; background-clip:text; color:transparent;
  }
  .clr-stars{ color:var(--blue); }
  /* softer/lighter than the vivid rgb(168,85,247) used for physics UI
     accents (switch, sidebar, cards) -- that saturation reads fine as a
     small icon/border accent but felt "too purple" as a run of body text,
     so this is a paler, less saturated variant just for text emphasis */
  .clr-physics{ color:rgb(205,170,245); }

  .section-line{
    height:5px; width:72px; border-radius:999px; margin-bottom:16px;
    background:linear-gradient(90deg, var(--orange-deep), var(--orange), var(--orange-soft));
    box-shadow:0 0 14px rgba(242,166,90,0.4);
  }

  .filter-row{ display:flex; flex-wrap:wrap; gap:8px; margin-bottom:10px; }
  .filter-row + .filter-row{ margin-top:0; margin-bottom:22px; }
  .filter-group-label{
    font-size:12.5px; color:var(--muted-dim); font-family:'Chakra Petch',sans-serif;
    letter-spacing:0.06em; text-transform:uppercase; width:100%; margin-bottom:2px;
  }
  /* level chips + category chips on one row, with a thin divider between the
     two groups, instead of stacked on separate lines. flex-wrap on THIS
     container decides wrapping from each item's natural (unshrunk) content
     width -- flex-shrink only kicks in for items that already fit on a
     line, so with wrap allowed here the keyword row (wider on the เนื้อหา
     page, which has one more/longer chip than คลังโจทย์'s) just wrapped
     to its own line wholesale once its natural width didn't fit, instead
     of shrinking. nowrap forces both rows onto one line so the keyword
     row is forced to shrink (min-width:0) and wrap its OWN chips
     internally within whatever width that leaves it, regardless of
     container width. Reverts to the old stack-on-wrap behavior under
     600px, where forcing one line would leave no room for either row. */
  .filter-row-combined{ display:flex; flex-wrap:nowrap; align-items:center; margin-bottom:22px; }
  .filter-row-combined .filter-row{ margin:0; flex:1 1 auto; min-width:0; }
  .filter-row-combined .filter-row:first-child{ flex:0 0 auto; margin-right:6px; }
  .filter-sep{ width:1px; align-self:stretch; background:var(--line-soft); min-height:24px; margin-right:14px; }
  @media (max-width:600px){
    .filter-row-combined{ flex-wrap:wrap; }
    .filter-sep{ display:none; width:100%; }
    .filter-row-combined .filter-row:first-child{ margin-bottom:14px; }
  }
  .chip{
    font-size:13.5px; padding:7px 14px; border-radius:999px;
    border:1px solid var(--line); color:var(--orange-soft);
    background:rgba(242,166,90,0.06); font-family:'Chakra Petch',sans-serif; letter-spacing:0.02em;
    transition:all .18s ease;
  }
  .chip:hover{ background:var(--tint-hover); transform:translateY(-1px); }
  .chip.active{ background:var(--orange); color:#1a1005; border-color:var(--orange); box-shadow:0 4px 14px rgba(242,166,90,0.3); }
  .chip.kw-prep{ border-color:rgba(127,216,160,0.6); color:var(--green-ok); background:rgba(127,216,160,0.16); }
  .chip.kw-prep.active{ background:var(--green-ok); color:#08160f; border-color:var(--green-ok); }
  .chip.kw-camp1{ border-color:rgba(242,217,74,0.6); color:var(--yellow); background:rgba(242,217,74,0.16); }
  .chip.kw-camp1.active{ background:var(--yellow); color:#241d02; border-color:var(--yellow); }
  .chip.kw-camp2{ border-color:rgba(230,160,90,0.6); color:var(--orange-deep); background:rgba(230,160,90,0.16); }
  .chip.kw-camp2.active{ background:var(--orange-deep); color:#fff; border-color:var(--orange-deep); }
  .chip.kw-olympiad{ border-color:rgba(185,138,242,0.6); color:var(--purple); background:rgba(185,138,242,0.16); }
  .chip.kw-olympiad.active{ background:linear-gradient(90deg, var(--purple), var(--pink)); color:#fff; border-color:var(--purple); }
  .chip.kw-stars{ border-color:rgba(126,196,242,0.6); color:var(--blue); background:rgba(126,196,242,0.16); }
  .chip.kw-stars.active{ background:var(--blue); color:#052033; border-color:var(--blue); }
  .chip.camp2{ border-color:rgba(127,216,160,0.4); color:var(--green-ok); background:rgba(127,216,160,0.08); }
  .chip.camp2.active{ background:var(--green-ok); color:#08160f; border-color:var(--green-ok); }
  .chip.level{ border-color:var(--muted); color:var(--muted); background:transparent; }
  .chip.level.active{ background:var(--text); color:var(--bg-deep); border-color:var(--text); }
  .chip.clear{ color:var(--muted); border-style:dashed; background:transparent; }

  .folder{
    border:1px solid var(--line-soft-strong); border-radius:8px; margin-bottom:18px; overflow:hidden;
    background:var(--bg-panel-2);
  }
  .folder-head{
    display:flex; align-items:center; justify-content:space-between; gap:12px;
    padding:18px 22px; width:100%; background:none; border:none; text-align:left;
  }
  .folder-head:hover{ background:var(--tint-hover); }
  .folder-head{ color:var(--text); }
  .folder-head .fh-title{ display:flex; align-items:center; gap:12px; }
  .folder-head h3{ font-size:17px; }
  .cat-folder-head{ color:var(--text); }
  .folder-head .fh-count{
    font-size:13px; color:var(--muted-dim); font-family:'Chakra Petch',sans-serif;
  }
  .folder-head .fh-chev{ color:var(--orange); font-size:22px; transition:transform .2s ease; flex-shrink:0; }
  .folder.open .fh-chev{ transform:rotate(90deg); }
  .folder-head-wrap{ display:flex; align-items:center; flex-wrap:wrap; gap:4px 14px; }
  .folder-head-wrap .folder-head{ flex:1 1 240px; min-width:180px; width:auto; }
  .folder-head-wrap .bulk-buy-link{ flex:none; white-space:nowrap; margin:0 22px 0 auto; }
  @media (max-width:480px){
    .folder-head-wrap .bulk-buy-link{ margin:0 0 10px 22px; }
  }
  .folder-body{ display:none; padding:0 20px 20px; }
  .folder.open .folder-body{ display:block; }
  .folder-footnote{ font-size:12px; color:var(--muted-dim); font-style:italic; margin-top:14px; }
  /* bank parts with nothing in them yet (empty folders, the 2569 sub-folder,
     the keyword filter row): hidden until they get sets; !important beats
     applyBankFilters' inline display. One note stands in for them. */
  #sec-bank .is-upcoming{ display:none !important; }
  .bank-upcoming-note{ font-size:13px; color:var(--muted); margin:16px 2px 0; line-height:1.7; }
  .folder-sub-label{
    font-size:12px; color:var(--muted); font-family:'Chakra Petch',sans-serif; letter-spacing:0.05em;
    margin:16px 0 10px; padding-top:12px; border-top:1px solid var(--line-soft);
  }
  .folder-sub-label:first-child{ border-top:none; padding-top:0; margin-top:6px; }

  .subfolder{ border-top:1.5px solid var(--line-strong); margin-top:14px; padding-top:6px; }
  .subfolder:first-child{ border-top:none; margin-top:0; padding-top:0; }
  .subfolder-head{
    display:flex; align-items:center; justify-content:space-between; gap:12px;
    width:100%; background:none; border:none; text-align:left; cursor:pointer;
    padding:8px 2px; color:var(--text); font-size:13.5px; font-weight:700;
    font-family:'Chakra Petch',sans-serif; letter-spacing:0.03em;
  }
  .subfolder-head:hover{ color:var(--orange); }
  .subfolder-head .fh-chev{ color:var(--orange); font-size:19px; transition:transform .2s ease; flex-shrink:0; }
  .subfolder.open .subfolder-head .fh-chev{ transform:rotate(90deg); }
  .subfolder-body{ display:none; padding-top:4px; }
  .subfolder.open .subfolder-body{ display:block; }

  .file-row{
    display:flex; align-items:center; gap:18px;
    background:var(--bg-card); border:1px solid var(--line-soft); border-radius:8px;
    padding:14px 18px; margin-bottom:10px;
    transition:border-color .2s ease;
  }
  .file-row:hover{ filter:brightness(1.03); }
  .file-row[data-kw~="prep"]{ border-color:var(--brd-prep); }
  .file-row[data-kw~="camp1"]{ border-color:var(--brd-camp1); }
  .file-row[data-kw~="camp2"]{ border-color:var(--brd-camp2); }
  .file-row[data-kw~="olympiad"]{
    border-color:transparent;
    background-image:linear-gradient(var(--bg-card), var(--bg-card)), linear-gradient(90deg, var(--purple), var(--pink));
    background-origin:border-box;
    background-clip:padding-box, border-box;
  }
  body.light-mode .file-row{ box-shadow:0 1px 4px rgba(20,20,30,0.05); }
  .file-row .fr-num{
    font-family:'Chakra Petch',sans-serif; font-weight:700; font-size:15px; color:var(--text);
    flex-shrink:0; text-align:center; min-width:60px;
  }
  .file-row .fr-main{ flex:1; min-width:0; }
  .file-row .fr-main h4{ font-size:15px; margin-bottom:3px; color:var(--text); }
  .file-row .fr-main .desc{ font-size:13.5px; color:var(--muted); line-height:1.55; }
  .file-row .fr-tags{ display:flex; flex-wrap:wrap; margin-top:6px; }
  .file-row .fr-tags span{ font-size:12px; color:var(--orange-soft); }
  .file-row .fr-tags span.fr-tag-sep{ color:var(--muted-dim); }
  .file-row .fr-side{ display:flex; align-items:center; gap:10px; flex-shrink:0; }
  .file-row .fr-price{ font-family:'Chakra Petch',sans-serif; font-weight:700; font-size:16px; color:var(--orange-soft); text-align:right; white-space:nowrap; }
  .file-row .fr-price.free{ color:var(--green-ok); }
  .file-row .fr-price.owned{ color:var(--muted-dim); }
  .file-row .fr-price span{ display:block; font-size:11.5px; color:var(--muted-dim); font-weight:400; }
  .file-row .fr-btns{ display:flex; gap:8px; }
  .fr-owned-badge{
    display:inline-block; font-size:11px; font-weight:700; padding:2px 9px; border-radius:999px;
    background:var(--green-ok); color:#0a1a10; margin-left:8px; vertical-align:middle;
    font-family:'Chakra Petch',sans-serif; letter-spacing:0.03em;
  }
  .file-row.owned[data-kw~="prep"]{ background-image:linear-gradient(135deg, rgba(127,216,160,0.25), transparent 65%); }
  .file-row.owned[data-kw~="camp1"]{ background-image:linear-gradient(135deg, rgba(242,217,74,0.25), transparent 65%); }
  .file-row.owned[data-kw~="camp2"]{ background-image:linear-gradient(135deg, rgba(230,160,90,0.25), transparent 65%); }
  .file-row.owned[data-kw~="olympiad"]{
    border-color:var(--purple);
    background-image:linear-gradient(135deg, rgba(185,138,242,0.25), transparent 65%);
  }
  .file-row.pending .fr-price{ color:var(--muted-dim); }
  @keyframes fileRowGlow{
    from{ box-shadow:0 0 0 3px rgba(242,166,90,0.9), 0 0 26px 8px rgba(242,166,90,0.55); }
    to{ box-shadow:0 0 0 0px rgba(242,166,90,0), 0 0 0px 0px rgba(242,166,90,0); }
  }
  .file-row.flash-highlight{ animation:fileRowGlow 1s ease-out; }

  .answer-key-list{ display:grid; gap:8px; margin-top:10px; }
  .answer-key-item{
    background:var(--bg-panel-2); border:1px solid var(--line-soft); border-radius:8px;
    padding:10px 14px; display:flex; gap:14px; align-items:baseline; flex-wrap:wrap;
  }
  .answer-key-item .ak-no{ font-family:'Chakra Petch',sans-serif; font-weight:700; color:var(--orange-soft); min-width:52px; }
  .answer-key-item .ak-answer{ font-weight:700; color:var(--text); min-width:80px; }
  .answer-key-item .ak-solution{ color:var(--muted); font-size:13.5px; flex-basis:100%; }
  .answer-key-section{
    font-family:'Chakra Petch',sans-serif; font-weight:700; font-size:14.5px; color:var(--orange-soft);
    margin:16px 0 2px; padding-top:14px; border-top:1px solid var(--line-soft);
  }
  .answer-key-heading{ font-family:'Chakra Petch',sans-serif; font-weight:700; font-size:17px; color:var(--text); margin:20px 0 8px; }
  .answer-key-heading:first-child{ margin-top:0; }
  .answer-key-part-label{ font-size:13px; color:var(--muted); margin:10px 0 6px; }
  .answer-key-shortgrid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(68px,1fr)); gap:6px; margin-bottom:4px; }
  .answer-key-shortgrid .aks-item{
    background:var(--bg-panel-2); border:1px solid var(--line-soft); border-radius:6px;
    padding:6px 4px; text-align:center; display:flex; flex-direction:column; gap:2px;
  }
  .answer-key-shortgrid .aks-no{ color:var(--muted-dim); font-size:11px; }
  .answer-key-shortgrid .aks-ans{ font-weight:700; color:var(--orange-soft); font-family:'Chakra Petch',sans-serif; font-size:13.5px; }
  .answer-key-top-btn{
    display:block; margin:20px auto 0; background:none; border:1px solid var(--line-strong);
    border-radius:8px; padding:8px 18px; color:var(--orange-soft); font-weight:700;
    font-family:'Chakra Petch',sans-serif; font-size:13px; cursor:pointer;
    transition:background .15s ease, border-color .15s ease;
  }
  .answer-key-top-btn:hover{ background:var(--bg-card); border-color:var(--orange); }

  .order-history-list{ display:flex; flex-direction:column; gap:12px; }
  .order-card{
    display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap;
    background:var(--bg-card); border:1px solid var(--line-soft); border-radius:8px; padding:16px 18px;
  }
  .order-card .oc-main h4{ font-size:15px; margin-bottom:4px; }
  .order-card .oc-main .oc-time{ font-size:12.5px; color:var(--muted-dim); }
  .order-card .oc-side{ text-align:right; }
  .order-card .oc-price{ font-family:'Chakra Petch',sans-serif; font-weight:700; font-size:16px; color:var(--orange-soft); }
  .order-card .oc-price .oc-original{ font-size:12px; color:var(--muted-dim); text-decoration:line-through; font-weight:400; margin-right:6px; }
  .order-card .oc-status{ font-size:12px; padding:2px 10px; border-radius:999px; display:inline-block; margin-top:4px; }
  .order-card .oc-status.paid{ background:rgba(127,216,160,0.14); color:var(--green-ok); border:1px solid rgba(127,216,160,0.4); }
  .order-card .oc-status.pending{ background:var(--tint-hover); color:var(--orange-soft); border:1px solid rgba(242,166,90,0.4); }
  .order-card .oc-status.cancelled{ background:rgba(228,106,106,0.1); color:var(--error-text); border:1px solid rgba(228,106,106,0.35); }
  @media (max-width:640px){
    .file-row{ flex-wrap:wrap; gap:8px; padding:12px 14px; }
    /* short cards on phones: the description stays behind "รายละเอียด", and the
       price shares one line with the buttons */
    .file-row .fr-main .desc{ display:none; }
    .file-row .fr-side{ width:100%; justify-content:space-between; gap:8px; }
    .file-row .fr-btns{ flex-wrap:wrap; justify-content:flex-end; }
    /* set code now always appended to the title text itself (see
       renderFileRowContent) -- this column is redundant on narrow screens
       and was crowding the card, so drop it there only. */
    .file-row .fr-num{ display:none; }
    .file-row .fr-price span{ display:none; }
  }

  .spec-pdf-card{
    display:flex; align-items:center; gap:12px; width:100%; text-align:left;
    background:var(--bg-card); border:1px solid var(--line-soft-strong); border-radius:8px;
    padding:12px 16px; margin-bottom:20px; font-size:13.5px; color:var(--text);
    transition:border-color .2s ease, transform .2s ease;
  }
  .spec-pdf-card:hover{ border-color:rgba(242,166,90,0.5); transform:translateY(-1px); }
  .spec-pdf-card .spc-ic{ font-size:16px; flex-shrink:0; }
  .spec-pdf-card .spc-text{ flex:1; line-height:1.5; }
  .spec-pdf-card .spc-chev{ color:var(--orange); font-size:19px; flex-shrink:0; }
  .spec-pdf-modal{
    max-width:900px; width:96%; padding:0; overflow:hidden;
    display:flex; flex-direction:column; max-height:97vh; height:97vh;
  }
  .spec-pdf-modal-head{
    display:flex; align-items:center; justify-content:space-between; gap:12px;
    padding:10px 18px; border-bottom:1px solid var(--line-soft); flex-shrink:0;
  }
  .spec-pdf-modal-head h4{ font-size:14.5px; margin:0; }
  .spec-pdf-frame{ width:100%; flex:1; height:100%; border:none; display:block; background:#fff; }
  #specPdfModalBack{ padding:8px; }

  .content-view{ display:none; }
  .content-view.active{ display:block; }
  .cat-folder{ margin-bottom:4px; border-bottom:1.5px solid var(--line-strong); }
  /* :not(.content-plain) -- the plain variant deliberately resets
     background/border/padding to nothing (see .topic-detail.content-plain
     below) so it reads as flush with the page, not boxed; without this
     exclusion the shadow alone still rendered a faint box outline around
     it in light mode (invisible in dark mode, since no shadow is added
     there), contradicting the "no frame" intent of that variant. */
  body.light-mode .topic-detail:not(.content-plain){ box-shadow:0 1px 4px rgba(20,20,30,0.05); }
  .cat-folder-head{
    display:flex; align-items:center; justify-content:space-between; width:100%;
    background:none; border:none; text-align:left; padding:14px 4px;
  }
  .cat-folder-head:hover{ background:var(--tint-hover); }
  .cat-folder-head h3{ font-size:15.5px; }
  .cat-folder-head .cf-chev{ color:var(--orange); font-size:20px; transition:transform .2s ease; }
  .cat-folder.open .cf-chev{ transform:rotate(90deg); }
  .cat-folder-body{ display:none; padding:2px 4px 14px; display:grid; grid-template-columns:1fr 1fr; gap:4px 20px; }
  .cat-folder:not(.open) .cat-folder-body{ display:none !important; }
  .cat-folder.open .cat-folder-body{ display:grid; }
  @media (max-width:640px){ .cat-folder-body{ grid-template-columns:1fr; } }
  .sub-topic-item{
    display:flex; align-items:center; justify-content:space-between; gap:10px;
    background:none; border:none; border-bottom:1.5px solid var(--line-strong);
    padding:10px 4px; font-size:14.5px; width:100%; text-align:left; color:var(--text);
    transition:background .15s ease, border-color .15s ease;
  }
  .sub-topic-item:hover{ background:var(--tint-hover); border-bottom-color:var(--orange); }
  .sub-topic-item .sti-chev{ color:var(--muted-dim); font-size:19px; transition:color .15s ease; }
  .sub-topic-item:hover .sti-chev{ color:var(--orange); }
  .topic-detail{
    background:var(--bg-card); border:1px solid var(--line-soft); border-radius:8px; padding:26px 28px;
  }
  /* padding-bottom (not 0 like the other 3 sides) -- the plain variant is
     still meant to end with some breathing room below its last element
     (e.g. the "ดูเฉลย" button in #bankDetailView), otherwise it sits flush
     against whatever comes right after it on the page */
  .topic-detail.content-plain{ background:none; border:none; padding:0 0 24px; }
  /* the 17 สอวน. prep topics (js/08, class set in openTopicDetail): same
     reading style as the general articles, formulas in KaTeX without boxes;
     worked examples and notes are one large panel each */
  .placeholder-box.ct{ font-size:16px; line-height:1.85; }
  .ct h3{ color:var(--text); font-size:19px; margin:38px 0 12px; padding-top:18px; border-top:1px solid var(--line-soft); }
  .ct > h3:first-child{ margin-top:0; padding-top:0; border-top:0; }
  .ct h4{ color:var(--orange-soft); font-size:16px; margin:24px 0 8px; }
  body.light-mode .ct h4{ color:var(--orange-deep); }
  .ct p{ margin:0 0 14px; }
  .ct b{ color:var(--text); }
  .ct ul, .ct ol{ margin:6px 0 16px; padding-left:22px; display:grid; gap:7px; }
  .ct ul{ list-style:none; padding-left:0; }
  .ct ul > li{ padding-left:20px; }
  /* the star hangs inline in the first line (vertical-align:middle), so it
     sits on that line whatever the font size; an absolute top in em was
     measured from the star's own small font and floated above the text */
  .ct ul > li::before{ content:"✦"; color:var(--orange); font-size:10px; line-height:1; display:inline-block; width:20px; margin-left:-20px; vertical-align:middle; }
  .ct texb{ margin:16px 0; color:var(--text); }
  .ct .katex{ font-size:1.06em; }
  .ct texb .katex-display{ margin:0; }
  .ct .ct-where{ font-size:14.5px; margin-top:-4px; }
  .ct-label{ display:block; font-size:14px; font-weight:700; margin-bottom:6px; }
  .ct-ex, .ct-note{ margin:20px 0; padding:16px 20px; border-radius:12px; }
  .ct-ex{ background:var(--tint-weak); border:1px solid var(--line-strong); }
  .ct-ex .ct-label{ color:var(--text); }
  .ct-note{ background:rgba(242,166,90,0.08); border:1px solid rgba(242,166,90,0.3); }
  .ct-note .ct-label{ color:var(--orange-soft); }
  body.light-mode .ct-note .ct-label{ color:var(--orange-deep); }
  .ct-ex > :last-child, .ct-note > :last-child{ margin-bottom:0; }
  .ct-table{ width:100%; border-collapse:collapse; margin:10px 0 18px; font-size:14.5px; line-height:1.6; }
  .ct-table th{ text-align:left; color:var(--text); font-weight:700; padding:8px 12px 8px 0; border-bottom:1.5px solid var(--line-strong); }
  .ct-table td{ padding:8px 12px 8px 0; border-bottom:1px solid var(--line-soft); vertical-align:top; }
  .ct-table td:first-child{ color:var(--text); }
  .ct-table.ct-formulas{ width:auto; }
  .ct-formulas td{ vertical-align:middle; padding-right:36px; }
  /* tables scroll sideways on narrow screens instead of squeezing */
  /* (inline-size containment keeps a wide table from widening the page's
     grid column through its min-content size) */
  @media (max-width:640px){ .ct-table{ display:block; overflow-x:auto; contain:inline-size; font-size:14px; } }
  .ct-q{ margin:0 0 22px; }
  .ct-q > p:first-child{ color:var(--text); margin-bottom:8px; }
  .ct ul.ct-choices{ display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:4px 24px; margin:0 0 8px; padding:0; }
  .ct ul.ct-choices > li{ padding-left:0; }
  .ct ul.ct-choices > li::before{ content:none; }
  @media (max-width:640px){ .ct ul.ct-choices{ grid-template-columns:1fr; } }
  .ct-sol summary{
    display:inline-block; cursor:pointer; list-style:none; font-size:14.5px; font-weight:600; color:var(--orange);
    text-decoration:underline; text-underline-offset:3px; text-decoration-color:rgba(242,166,90,0.5);
  }
  .ct-sol summary::-webkit-details-marker{ display:none; }
  .ct-sol summary:hover{ color:var(--orange-soft); }
  .ct-sol[open] summary{ margin-bottom:8px; }
  .ct-sol[open]{ padding-left:14px; border-left:2px solid rgba(242,166,90,0.45); }
  .ct-sol p{ margin-bottom:8px; }
  .ct a{ color:var(--orange-soft); text-underline-offset:3px; }
  .ct-fig svg{ width:100%; max-width:420px; height:auto; display:block; margin:0 auto; }
  .ct .ct-fig{ max-width:440px; }
  .ct-fig .f-orbit{ fill:none; stroke:var(--line-strong); stroke-width:1.2; }
  .ct-fig .f-line{ stroke:var(--muted-dim); stroke-width:1; stroke-dasharray:4 4; }
  .ct-fig .f-line2{ stroke:var(--orange); }
  .ct-fig .f-arc{ fill:none; stroke:var(--orange); stroke-width:1.2; }
  .ct-fig .f-sun{ fill:#f6c453; }
  .ct-fig .f-earth{ fill:#5aa9e6; }
  .ct-fig .f-mars{ fill:#e0663f; }
  .ct-fig .f-old{ fill:none; stroke-width:1.6; }
  .ct-fig .f-earth.f-old{ stroke:#5aa9e6; }
  .ct-fig .f-mars.f-old{ stroke:#e0663f; }
  .ct-fig .f-txt{ fill:var(--muted); font-size:11px; font-family:inherit; }
  .ct-fig .f-strong{ fill:var(--orange); font-weight:700; }
  /* star charts (drawn from the planetarium catalog) and concept diagrams */
  .ct-fig .f-star{ fill:var(--text); }
  .ct-fig .f-cline{ stroke:var(--muted-dim); stroke-width:1.2; }
  .ct-fig .f-guide{ stroke:var(--orange); stroke-width:1.4; stroke-dasharray:5 4; fill:none; }
  .ct-fig .f-pole{ fill:none; stroke:var(--orange); stroke-width:1.6; }
  .ct-fig .f-axis{ stroke:var(--text); stroke-width:1.4; }
  .ct-fig .f-soft{ fill:var(--tint-weak); stroke:var(--line-strong); stroke-width:1; }
  .ct-fig .f-night{ fill:var(--muted-dim); opacity:0.55; }
  .ct-fig .f-moon{ fill:#d9d6cc; }
  .ct-fig .f-ray{ stroke:#f6c453; stroke-width:1.4; }
  .ct-fig .f-lead{ stroke:var(--muted-dim); stroke-width:0.8; }
  .ct-fig .f-small{ font-size:9.5px; }
  .ct-fig .f-planet{ fill:#e8b06a; }
  .ct-fig .f-dot{ fill:var(--muted); }
  .ct-fig .f-sector{ fill:rgba(242,166,90,0.28); stroke:var(--orange); stroke-width:1; }
  .ct-fig .f-moondark{ fill:#3a3f52; }
  .ct-fig .f-umbra{ fill:rgba(0,0,0,0.55); }
  .ct-fig .f-penumbra{ fill:rgba(120,130,160,0.22); }
  .ct-fig .f-band{ fill:none; stroke:rgba(242,166,90,0.55); stroke-width:16; stroke-linecap:round; stroke-linejoin:round; }
  .ct-fig .f-region{ fill:rgba(126,196,242,0.22); stroke:rgba(126,196,242,0.6); stroke-width:1; }
  body.light-mode .ct-fig .f-umbra{ fill:rgba(20,24,40,0.55); }
  body.light-mode .ct-fig .f-moondark{ fill:#8b8fa0; }
  .topic-detail .placeholder-box .ct-fig{ background:none; }
  .topic-detail .placeholder-box .ct-fig figcaption{ margin-top:4px; }
  .detail-nav-row{
    display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:10px;
    margin-top:22px; scroll-margin-top:90px;
  }
  .detail-nav-center{ display:flex; gap:8px; }
  .detail-nav-btn{ max-width:220px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  @media (max-width:700px){
    /* nowrap: a wrapping column sizes its line to the widest button
       (max-content), not to the row, so long titles pushed the page wide */
    .detail-nav-row{ flex-direction:column; align-items:stretch; flex-wrap:nowrap; }
    .detail-nav-center{ flex-direction:column; min-width:0; }
    /* a long neighbouring topic title ends in "..." instead of widening the page */
    .detail-nav-btn{ max-width:100%; min-width:0; }
  }
  .topic-detail .placeholder-box{
    margin-top:18px; border:1.5px dashed var(--line); border-radius:8px; padding:20px;
    color:var(--muted); font-size:16.5px; line-height:1.85; background:rgba(242,166,90,0.04);
  }
  .topic-detail.content-plain .placeholder-box{
    border:none; background:none; padding:20px 0 0;
  }
  .topic-detail .placeholder-box figure{ margin:18px auto; max-width:420px; text-align:center; }
  .topic-detail .placeholder-box figure img{ max-width:100%; height:auto; border-radius:8px; background:#fff; }
  .topic-detail .placeholder-box figure figcaption{ margin-top:8px; font-size:12px; color:var(--muted-dim); }

  .article-body{ margin-top:16px; font-size:14.5px; color:var(--muted); line-height:1.9; }
  .article-body h3{ color:var(--text); font-size:19px; margin:30px 0 10px; }
  .article-body h3:first-child{ margin-top:0; }
  .article-body h4{ color:var(--orange-soft); font-size:16px; margin:22px 0 8px; }
  .article-body p{ margin-bottom:14px; }
  .article-body ul{ list-style:none; margin:8px 0 16px; display:grid; gap:9px; }
  .article-body ul li{ padding-left:20px; }
  .article-body ul li::before{ content:"✦"; color:var(--orange); font-size:11px; line-height:1; display:inline-block; width:20px; margin-left:-20px; vertical-align:middle; }
  .article-body ol{ margin:8px 0 16px 22px; display:grid; gap:7px; }
  .article-body b, .article-body strong{ color:var(--text); font-weight:700; }
  .article-body hr{ border:none; border-top:1px solid var(--line-soft); margin:28px 0; }
  .article-body em{ color:var(--muted-dim); font-style:italic; }

  /* mobile top nav */
  .mobile-toggle{ display:none; }
  @media (max-width:880px){
    .topbar-btn{ padding:6px; }
  }

/* lazy-loaded planetarium (see ensureSkyviewLoaded in js/05-app.js):
   body.skyview-loading / .skyview-loaded / .skyview-load-failed */
.skyview-load-overlay{
  display:none; position:absolute; inset:0; z-index:5;
  align-items:center; justify-content:center; background:#05070f; color:#eef0f6;
}
body:not(.skyview-loaded) .skyview-load-overlay{ display:flex; }
.skyview-load-box{ text-align:center; padding:24px; max-width:360px; }
.skyview-load-spinner{
  width:34px; height:34px; margin:0 auto 14px; border-radius:50%;
  border:3px solid rgba(255,255,255,0.15); border-top-color:var(--orange);
  animation:skyviewLoadSpin .9s linear infinite;
}
@keyframes skyviewLoadSpin{ to{ transform:rotate(360deg); } }
.skyview-load-msg{ font-size:14px; color:#9aa0b8; }
.skyview-load-error{ display:none; font-size:14px; }
.skyview-load-error p{ margin-bottom:14px; }
.skyview-load-error .btn{ margin:0 4px; }
body.skyview-load-failed .skyview-load-spinner,
body.skyview-load-failed .skyview-load-msg{ display:none; }
body.skyview-load-failed .skyview-load-error{ display:block; }
.skyview-hub-load-note{ display:none; font-size:13px; color:var(--muted); margin:-4px 0 10px; }
.skyview-hub-failed-text{ display:none; color:var(--error-text); }
body.skyview-loading .skyview-hub-load-note,
body.skyview-load-failed .skyview-hub-load-note{ display:block; }
body.skyview-load-failed .skyview-hub-loading-text{ display:none; }
body.skyview-load-failed .skyview-hub-failed-text{ display:inline; }

/* ---- hubs: top-bar tabs + hub-grouped sidebar (see HUBS in js/05-app.js) */
.hub-tabs{ display:flex; align-items:center; gap:4px; flex:1; min-width:0; margin-left:6px; }
.hub-tab{
  background:none; border:none; cursor:pointer; white-space:nowrap;
  font-family:inherit; font-size:14px; color:var(--muted);
  padding:8px 14px; border-radius:999px; transition:color .2s ease, background .2s ease;
}
.hub-tab:hover{ color:var(--text); background:var(--bg-card); }
.hub-tab.active{ color:var(--orange-soft); background:rgba(242,166,90,0.12); font-weight:600; }
body.light-mode .hub-tab.active{ color:var(--orange-deep); }
body.physics-mode .hub-tabs{ visibility:hidden; }
/* mobile: no room in the bar -- every hub is listed in the drawer instead */
@media (max-width:880px){ .hub-tabs{ display:none; } }
/* "เพิ่มเติม" dropdown: same pill as the other tabs plus a chevron; the menu
   is a small panel in the site's card style. padding-top on the menu
   bridges the gap so moving the pointer down doesn't close it. */
.hub-more{ position:relative; }
.hub-more-btn{ display:inline-flex; align-items:center; gap:4px; }
.hub-more-chev{ width:14px; height:14px; transition:transform .2s ease; opacity:0.8; }
.hub-more-menu{
  position:absolute; top:100%; left:0; padding-top:8px; z-index:120;
  opacity:0; visibility:hidden; transform:translateY(-4px);
  transition:opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
}
.hub-more-panel{
  min-width:290px; padding:6px; border-radius:12px;
  background:var(--bg-panel); border:1px solid var(--line-soft-strong);
  box-shadow:0 14px 34px rgba(0,0,0,0.38);
}
.hub-more:hover:not(.just-picked) .hub-more-menu,
.hub-more:focus-within:not(.just-picked) .hub-more-menu,
.hub-more.open .hub-more-menu{ opacity:1; visibility:visible; transform:none; transition-delay:0s; }
.hub-more:hover:not(.just-picked) .hub-more-chev, .hub-more.open .hub-more-chev{ transform:rotate(180deg); }
.hub-more-item{
  display:flex; align-items:center; gap:12px; width:100%; text-align:left; cursor:pointer;
  background:none; border:0; border-radius:8px; padding:9px 10px; font-family:inherit; color:var(--text);
}
.hub-more-item:hover, .hub-more-item:focus-visible{ background:var(--tint-weak); outline:none; }
.hub-more-icon{ flex-shrink:0; width:32px; height:32px; border-radius:8px; display:flex; align-items:center; justify-content:center; }
.hub-more-icon svg{ width:18px; height:18px; }
.hub-more-icon.cal{ background:rgba(242,217,74,0.14); color:var(--yellow); }
.hub-more-icon.gl{ background:rgba(94,202,217,0.16); color:rgb(94,202,217); }
.hub-more-text{ display:flex; flex-direction:column; gap:1px; min-width:0; }
.hub-more-text b{ font-size:13.5px; font-weight:600; }
.hub-more-text span{ font-size:12px; color:var(--muted); }
body.light-mode .hub-more-panel{ box-shadow:0 14px 30px rgba(20,20,40,0.14); }

.hub-nav .hub-group{ display:none; }
.hub-nav .hub-group.active{ display:block; }
/* desktop: the home and learn hubs are a single page each (หน้าหลัก,
   ปฏิทินดาราศาสตร์), already named by their top tab, so their sidebar
   groups stay hidden; the mobile drawer below still lists them */
@media (min-width:881px){
  .hub-nav .hub-group[data-hub="home"],
  .hub-nav .hub-group[data-hub="learn"]{ display:none; }
}
.hub-group-title{
  font-family:'Chakra Petch',sans-serif; font-size:11.5px; font-weight:700; letter-spacing:0.06em;
  color:var(--muted-dim); text-transform:uppercase; margin:0 0 2px 34px;
}
.hub-group-items{ position:relative; }
@media (max-width:880px){
  .hub-nav .hub-group{ display:block; }
  .hub-nav .hub-group + .hub-group{ margin-top:14px; }
}

/* ---- home portal */
/* inline search: the dropdown is absolutely positioned so it floats over
   the entry cards below instead of pushing them down; z-index beats the
   cards' hover transform (which makes its own stacking context) */
.home-search{ position:relative; z-index:20; width:100%; max-width:620px; margin:0 0 30px; }
.home-search-field{
  display:flex; align-items:center; gap:12px; width:100%;
  padding:13px 18px; border-radius:999px; cursor:text;
  background:var(--bg-card); border:1px solid rgba(126,196,242,0.28);
  transition:border-color .2s ease, box-shadow .2s ease, border-radius .15s ease;
}
.home-search-field:hover{ border-color:rgba(126,196,242,0.6); }
.home-search-field:focus-within{ border-color:rgba(126,196,242,0.75); box-shadow:0 0 0 3px rgba(126,196,242,0.14); }
.home-search.is-open .home-search-field{ border-radius:22px 22px 0 0; border-bottom-color:rgba(126,196,242,0.18); box-shadow:none; }
.home-search-icon{ display:flex; color:var(--blue); flex-shrink:0; }
.home-search-icon svg{ width:19px; height:19px; }
.home-search-input{
  flex:1; min-width:0; background:none; border:none; outline:none; padding:0;
  color:var(--text); font-family:inherit; font-size:14.5px;
}
.home-search-input::placeholder{ color:var(--muted); opacity:1; }
.home-search-input::-webkit-search-cancel-button{ -webkit-appearance:none; appearance:none; }
.home-search-drop{
  position:absolute; left:0; right:0; top:100%;
  max-height:min(420px, 60vh); overflow-y:auto; overscroll-behavior:contain;
  padding:8px; background:var(--bg-panel);
  border:1px solid rgba(126,196,242,0.75); border-top:none; border-radius:0 0 22px 22px;
  box-shadow:0 18px 40px rgba(0,0,0,0.45);
  scrollbar-width:thin; scrollbar-color:rgba(126,196,242,0.4) transparent;
}
.home-search-drop[hidden]{ display:none; }
.home-search-drop::-webkit-scrollbar{ width:8px; }
.home-search-drop::-webkit-scrollbar-track{ background:transparent; margin:10px 0 18px; }
.home-search-drop::-webkit-scrollbar-thumb{ background-color:rgba(126,196,242,0.35); border-radius:8px; border:2px solid var(--bg-panel); }
.home-search-drop::-webkit-scrollbar-thumb:hover{ background-color:rgba(126,196,242,0.6); }
.home-search-drop .search-suggest-label{ margin:4px 8px 8px; }
.home-search-drop .search-suggest-chips{ padding:0 6px 6px; }
.home-search-drop .search-result-item.is-active{ background:var(--bg-panel-2); box-shadow:inset 3px 0 0 var(--blue); }
body.light-mode .home-search-drop{ box-shadow:0 14px 32px rgba(20,30,60,0.14); }
.home-block-title{ font-size:18px; margin:4px 0 14px; }
.home-nav-card.nav-posn{ border-color:rgba(242,166,90,0.45); }
.home-nav-card.is-wide{ grid-column:1 / -1; }
.home-nav-card.nav-posn .hnc-icon{ background:rgba(242,166,90,0.16); color:var(--orange); }
.home-nav-card.nav-posn:hover{ border-color:rgba(242,166,90,0.8); }
.home-block-title + .home-nav-grid{ margin-top:0; }

/* desktop: the top tab already names the hub, so the group heading above
   the sidebar items is redundant there; the mobile drawer lists every hub
   at once and keeps the headings to separate them */
@media (min-width:881px){ .hub-group-title{ display:none; } }

/* ---- home hero banner (js/11-home-hero.js) -------------------------------
   two stacked .home-hero-slide layers crossfade between photos; .shade keeps
   the headline legible on any image; without a photo the gradient below is
   what shows. Always dark (it's a photo band), in light mode too. */
#sec-home > .section-line, #sec-posn > .section-line, #sec-skyview-hub > .section-line,
#sec-general > .section-line, #sec-calendar > .section-line{ display:none; }
/* ดาราศาสตร์ทั่วไป banner: the Whirlpool Galaxy's core on the right */
.page-hero.gen-hero .home-hero-slide{ background-position:center 45%; }
/* ปฏิทินดาราศาสตร์ banner (js/14 calRenderHeroScene): a drawn night scene,
   the Moon low over hills in today's phase; the scene is an SVG inside the
   usual .home-hero-slide layer, so it gets the same bottom fade */
.cal-hero-scene svg{ display:block; }
.page-hero.cal-hero .home-hero-shade{
  background:linear-gradient(90deg, rgba(4,7,18,0.8) 0%, rgba(4,7,18,0.35) 45%, rgba(4,7,18,0) 70%);
}
/* planetarium hub banner: the render is already dark, so centre it on the
   Milky Way's core and lift it a little */
.page-hero.sky-hero .home-hero-slide{ background-position:center 50%; filter:brightness(1.35); }
/* สอวน. hub guide (sec-posn): recommended problems in three plain columns
   split by thin rules, then one link row per section. No card grid (the
   owner wanted this page to read differently from the home page). */
.posn-guide{ margin-bottom:34px; }
.posn-head{ display:flex; align-items:baseline; justify-content:space-between; gap:12px; padding-bottom:9px; border-bottom:1px solid rgba(200,208,230,0.32); }
body.light-mode .posn-head{ border-bottom-color:rgba(20,20,30,0.24); }
.posn-head h2{ font-size:19px; margin:0; }
.posn-bank{ margin:16px 0 0; }
#posnBankMore{ margin-bottom:22px; }
.posn-rows{ --row-line:rgba(242,166,90,0.34); border-top:1px solid var(--row-line); }
body.light-mode .posn-rows{ --row-line:rgba(201,106,20,0.34); }
.posn-row{
  display:flex; align-items:center; justify-content:space-between; gap:16px; width:100%; padding:15px 10px;
  background:none; border:0; border-bottom:1px solid var(--row-line); text-align:left; cursor:pointer; color:var(--text); font-family:inherit;
  transition:background .15s ease;
}
.posn-row:hover{ background:var(--tint-weak); }
.posn-row.is-soon:hover{ background:none; }
.posn-row > span:first-child{ display:flex; flex-direction:column; gap:2px; }
.posn-row b{ font-size:15.5px; }
.posn-row > span:first-child > span{ font-size:13px; color:var(--muted); }
.posn-row-go{ font-size:20px; color:var(--muted-dim); transition:transform .15s ease, color .15s ease; }
.posn-row:hover .posn-row-go{ color:var(--orange-soft); transform:translateX(3px); }
.posn-row:hover b{ color:var(--orange-soft); }
.posn-row.is-soon{ cursor:default; opacity:0.6; }
.posn-row.is-soon:hover b{ color:inherit; }
#posnWhat{ scroll-margin-top:calc(var(--top-strip-h, 0px) + 16px); }

/* a hub page's banner (สอวน.): same full-bleed photo band, much shorter,
   with one large title instead of the home page's kicker + name */
.home-hero.page-hero{ min-height:clamp(190px, 22vh, 250px); margin-bottom:26px; }
/* show the dome's lower half with the meteor streaks and its red rim; the
   shade is lighter than the home page's since the photo itself is dark */
.page-hero .home-hero-slide{ background-position:center 68%; filter:brightness(1.4) saturate(1.1); }
.page-hero .home-hero-shade{
  background:
    linear-gradient(90deg, rgba(4,7,18,0.7) 0%, rgba(4,7,18,0.35) 45%, rgba(4,7,18,0) 100%),
    linear-gradient(0deg, rgba(4,7,18,0.45) 0%, rgba(4,7,18,0) 55%);
}
.page-hero .home-hero-content{ padding-top:24px; padding-bottom:44px; }
.page-hero-title{
  font-family:'Chakra Petch',sans-serif; font-weight:700; line-height:1.1; margin:0 0 10px;
  font-size:clamp(32px, 4.4vw, 54px); color:#fff; letter-spacing:-0.005em;
  text-shadow:0 2px 18px rgba(0,0,0,0.55);
}
@media (max-width:880px){
  .home-hero.page-hero{ min-height:200px; }
  .page-hero .home-hero-content{ padding-bottom:56px; }
}
/* full-bleed: spans everything right of the sidebar and up to the top bar,
   breaking out of <main>'s padding/centering by --hero-bleed-left/-width,
   which js/11-home-hero.js keeps in sync with the sidebar (the fallbacks
   below are for before it runs). Text stays on the content column via the
   same offset as padding. Only the bottom edge is drawn. */
.home-hero{
  --hero-bleed-left:44px;
  position:relative; overflow:hidden; isolation:isolate;
  min-height:clamp(300px, 34vh, 440px);
  margin:-24px 0 30px calc(-1 * var(--hero-bleed-left));
  width:var(--hero-bleed-width, calc(100% + 2 * var(--hero-bleed-left)));
  display:flex; align-items:flex-end;
}
/* animate only later size changes (sidebar toggle), never the first sizing */
.home-hero.hero-anim{ transition:margin-left .25s ease, width .25s ease; }
/* the bottom ~third of every backdrop layer (fallback gradient, photos,
   shade) fades to transparent, so the banner melts into whatever the page
   background is -- the starfield in dark mode, white in light mode --
   instead of ending on a hard line. Text and credit aren't masked. */
.home-hero::before,
.home-hero-slide,
.home-hero-shade{
  -webkit-mask-image:linear-gradient(to bottom, #000 68%, transparent 100%);
  mask-image:linear-gradient(to bottom, #000 68%, transparent 100%);
}
.home-hero::before{
  content:""; position:absolute; inset:0; z-index:0; pointer-events:none;
  background:
    radial-gradient(ellipse 60% 70% at 78% 30%, rgba(168,85,247,0.38), transparent 70%),
    radial-gradient(ellipse 50% 60% at 62% 80%, rgba(242,166,90,0.28), transparent 70%),
    radial-gradient(ellipse 70% 80% at 20% 20%, rgba(70,120,230,0.30), transparent 70%),
    #060a18;
}
.home-hero-slide{
  position:absolute; inset:0; z-index:0;
  background-size:cover; background-position:center;
  opacity:0; transition:opacity 1.4s ease;
}
.home-hero-slide.show{ opacity:1; }
.home-hero-shade{
  position:absolute; inset:0; z-index:1; pointer-events:none;
  background:
    linear-gradient(90deg, rgba(4,7,18,0.82) 0%, rgba(4,7,18,0.55) 45%, rgba(4,7,18,0.12) 100%),
    linear-gradient(0deg, rgba(4,7,18,0.55) 0%, rgba(4,7,18,0) 55%);
}
/* bottom padding keeps the credit line clear of the text and the text
   above most of the bottom fade */
.home-hero-content{ position:relative; z-index:2; padding:34px 24px 64px var(--hero-bleed-left); max-width:calc(1000px + var(--hero-bleed-left)); box-sizing:border-box; }
.home-hero-kicker{
  font-family:'Chakra Petch',sans-serif; font-weight:700; line-height:1.05;
  font-size:clamp(30px, 4.4vw, 56px); color:#fff; margin:0 0 6px;
  letter-spacing:-0.01em;
}
/* outlined headline: only a faint stroke is drawn and the letters stay
   see-through, so the photo shows inside them. Browsers without text-stroke
   keep the plain white text above instead of turning invisible. */
@supports (-webkit-text-stroke: 1px #fff){
  .home-hero-kicker{ color:transparent; -webkit-text-stroke:1.5px rgba(255,255,255,0.95); }
}
/* ...tinted with a translucent nebula gradient (sky blue -> violet -> pink ->
   orange, the site's accent colours) that drifts slowly through the
   letters, plus a soft coloured glow -- the photo still shows through */
@supports ((-webkit-background-clip: text) or (background-clip: text)){
  .home-hero-kicker{
    background:linear-gradient(100deg,
      rgba(126,196,242,0.2) 0%, rgba(185,138,242,0.2) 25%, rgba(242,138,208,0.2) 50%,
      rgba(242,166,90,0.2) 75%, rgba(126,196,242,0.2) 100%);
    background-size:200% 100%;
    -webkit-background-clip:text; background-clip:text;
    /* faint neon: a tight white halo hugging the stroke, then a wider violet
       glow, both kept at ~20% of a full neon so the outline stays crisp */
    filter:drop-shadow(0 0 1.5px rgba(255,255,255,0.17)) drop-shadow(0 0 6px rgba(200,175,255,0.14)) drop-shadow(0 0 16px rgba(150,115,255,0.09));
    animation:heroKickerDrift 14s linear infinite;
  }
}
@keyframes heroKickerDrift{ from{ background-position:0% 0; } to{ background-position:200% 0; } }
@media (prefers-reduced-motion: reduce){ .home-hero-kicker{ animation:none; } }
.home-hero-title{
  font-family:'Chakra Petch',sans-serif; font-weight:700; line-height:1.05;
  font-size:clamp(24px, 3vw, 38px); margin:0 0 16px; letter-spacing:-0.01em;
  background:linear-gradient(90deg, var(--orange-soft), var(--orange) 55%, #f07f5a);
  -webkit-background-clip:text; background-clip:text; color:transparent;
  filter:drop-shadow(0 2px 18px rgba(0,0,0,0.45));
}
/* three short tags on one line, split by a faint bar; a tag never breaks in
   the middle, and on phones they stack (see the media query below) */
.home-hero-desc{ display:flex; flex-wrap:wrap; row-gap:4px; font-size:15.5px; line-height:1.6; color:rgba(238,240,246,0.92); margin:0; }
.home-hero-tag{ white-space:nowrap; }
.home-hero-tag + .home-hero-tag::before{ content:"|"; margin:0 12px; color:rgba(238,240,246,0.35); }
/* small and faint, but the image licences (CC BY 4.0, ESA/Webb & ESA/Hubble)
   require the full credit to stay clearly readable and unaltered -- so it
   wraps instead of being cut off with an ellipsis, and isn't dimmed further */
.home-hero-credit{
  position:absolute; right:14px; bottom:9px; left:14px; z-index:2;
  font-size:11px; line-height:1.4; color:rgba(255,255,255,0.68); text-decoration:none;
  text-align:right; white-space:nowrap; overflow:hidden; text-shadow:0 1px 4px rgba(0,0,0,0.8);
  transition:color .2s ease;
}
.home-hero-credit.wrap{ white-space:normal; }
.home-hero-credit:hover{ color:rgba(255,255,255,0.8); }
.home-hero:not(.has-image) .home-hero-credit{ display:none; }
@media (max-width:880px){
  .home-hero{ --hero-bleed-left:20px; min-height:320px; margin-top:-16px; }
  .home-hero-content{ padding:28px 20px 40px var(--hero-bleed-left); }
  .home-hero-shade{ background:linear-gradient(0deg, rgba(4,7,18,0.86) 0%, rgba(4,7,18,0.5) 60%, rgba(4,7,18,0.25) 100%); }
  .home-hero-desc{ font-size:14px; }
  .home-hero-kicker{ -webkit-text-stroke-width:1.2px; }
  .home-hero-credit{ right:12px; left:12px; bottom:8px; }
  .home-hero-content{ padding-bottom:68px; }
}
@media (prefers-reduced-motion: reduce){ .home-hero-slide{ transition:none; } }
/* the hero is a dark photo band in both themes, so it pins the dark-theme
   palette its text uses -- light mode's darker accents would be unreadable */
.home-hero{
  --orange:#f2a65a; --orange-soft:#ffd9a0; --orange-deep:#e6a05a;
  --green-ok:#7fd8a0; --yellow:#f2d94a; --purple:#b98af2; --pink:#f28ad0;
}
@media (max-width:880px){
  .home-hero-kicker{ font-size:clamp(24px, 7.6vw, 46px); }
  .home-hero-title{ font-size:clamp(18px, 5.4vw, 30px); }
}
@media (max-width:600px){
  .home-hero-desc{ flex-direction:column; }
  .home-hero-tag + .home-hero-tag::before{ content:none; }
}
/* light mode: the banner fades to the white page, so the credit (which sits
   in the faded strip) switches to dark text to stay readable */
body.light-mode .home-hero-credit{ color:rgba(30,38,60,0.78); text-shadow:0 0 6px rgba(255,255,255,0.9); }
body.light-mode .home-hero-credit:hover{ color:rgba(20,26,44,1); }
/* phones: the stacked tagline sits lower in the banner, so start the fade
   later to keep all three lines on the solid part of the photo */
@media (max-width:880px){
  .home-hero::before, .home-hero-slide, .home-hero-shade{
    -webkit-mask-image:linear-gradient(to bottom, #000 76%, transparent 100%);
    mask-image:linear-gradient(to bottom, #000 76%, transparent 100%);
  }
}

.home-nav-card.nav-observe{ border-color:rgba(242,217,74,0.42); }
.home-nav-card.nav-observe .hnc-icon{ background:rgba(242,217,74,0.14); color:var(--yellow); }
.home-nav-card.nav-observe:hover{ border-color:rgba(242,217,74,0.8); }
/* observing card icon: a little calendar page with today's month and day */
.home-nav-card .hnc-icon.hnc-today{
  flex-direction:column; justify-content:flex-start; overflow:hidden;
  box-shadow:inset 0 0 0 1.5px rgba(242,217,74,0.55);
}
.hnc-today-m{
  display:block; width:100%; padding:2px 0 1px; text-align:center;
  background:var(--yellow); color:#14182c;
  font-family:'Chakra Petch',sans-serif; font-weight:700; font-size:9.5px; line-height:1.15;
}
.hnc-today-d{
  flex:1; display:flex; align-items:center;
  font-family:'Chakra Petch',sans-serif; font-weight:700; font-size:18px; line-height:1;
}
/* planetarium card: the Orion area from the planetarium's catalog drawn
   faintly (20%) behind the text, and today's Moon phase as its icon */
.home-nav-card.nav-skyview{ position:relative; overflow:hidden; isolation:isolate; }
/* the other home entry cards get faint backgrounds too (.has-bg + .hnc-bg),
   kept light enough that the text reads as easily as on a plain card */
.home-nav-card.has-bg{ position:relative; overflow:hidden; isolation:isolate; }
.hnc-bg{ position:absolute; inset:0; z-index:-1; pointer-events:none; }
/* all four entry cards fade the same way (owner's spec): fully faded at
   the left edge, rising evenly to 75% faded (25% showing) at the right */
.home-nav-card .hnc-bg, .home-nav-card .hnc-sky{
  opacity:0.25;
  -webkit-mask-image:linear-gradient(90deg, transparent 0%, #000 100%); mask-image:linear-gradient(90deg, transparent 0%, #000 100%);
}
.hnc-bg-photo{ background-size:cover; background-position:center 62%; }
.hnc-bg-photo.hnc-bg-exam{ background-position:center 50%; }
.hnc-bg-saturn{ width:100%; height:100%; }
/* within the orbit drawing the orbits stay fainter than the bodies */
.hnc-bg-orbits{ width:100%; height:100%; color:rgb(200,210,235); }
.hnc-bg-orbits .orbits{ opacity:0.45; }
body.light-mode .hnc-bg-orbits{ color:rgb(40,50,80); }
.hnc-sky{ position:absolute; inset:0; width:100%; height:100%; z-index:-1; pointer-events:none; }
body.light-mode .hnc-sky{ filter:invert(1); }
.home-nav-card.nav-skyview .hnc-icon.hnc-moon{ background:rgba(120,170,255,0.12); }
.hnc-moon svg{ width:26px; height:26px; filter:drop-shadow(0 0 4px rgba(241,234,210,0.35)); }
/* สอวน. card: the foundation's logo instead of a line icon */
.home-nav-card .hnc-icon.hnc-logo{ background:rgba(255,255,255,0.92); }
.hnc-logo img{ height:34px; width:auto; display:block; }
.home-nav-card.nav-general{ border-color:rgba(127,216,160,0.4); }
.home-nav-card.nav-general .hnc-icon{ background:rgba(127,216,160,0.14); color:var(--green-ok); }
.home-nav-card.nav-general:hover{ border-color:rgba(127,216,160,0.8); }
/* entry cards for pages that aren't built yet (.is-soon); the "เร็ว ๆ นี้"
   note is plain muted text, not a small outlined pill (owner's rule) */
.home-nav-card.is-soon{ cursor:default; opacity:0.72; }
.home-nav-card.is-soon:hover{ transform:none; box-shadow:none; }
.hnc-soon{ margin-left:6px; font-family:inherit; font-size:12px; font-weight:500; letter-spacing:0; color:var(--muted); }

/* ---- ดาราศาสตร์ทั่วไป articles (js/18-general.js) ----------------------- */
/* cards in a row stretch to the tallest one; genGridHtml (18) puts photo
   cards and text-only cards in separate grids (.ga-grids) so rows match */
.ga-grid{ display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:14px; margin-top:18px; }
.ga-grids{ display:flex; flex-direction:column; gap:14px; margin-top:18px; }
.ga-grids > .ga-grid{ margin-top:0; }
.ga-card-text{ flex:1 1 auto; }
.ga-card{
  display:flex; flex-direction:column; padding:0; overflow:hidden; text-align:left; cursor:pointer;
  background:var(--bg-card); border:1px solid var(--line-soft); border-radius:12px; color:var(--text);
  font-family:inherit; transition:transform .15s ease, border-color .2s ease;
}
.ga-card:hover{ transform:translateY(-2px); border-color:var(--border-hover); }
.ga-card-text{ display:flex; flex-direction:column; gap:6px; padding:14px 18px 16px; min-width:0; }
/* cover photo on top (16:9); cards without one are just the text */
.ga-card-cover{ display:block; aspect-ratio:16 / 9; overflow:hidden; background:#0a0f1e; flex:none; }
.ga-card-cover img{ display:block; width:100%; height:100%; object-fit:cover; }
.ga-cat{ font-size:12px; font-weight:600; letter-spacing:0.01em; }
.ga-card-title{ font-size:15px; line-height:1.45; }
/* the opening of the article, cut to two lines with "..." */
.ga-card-sum{
  font-size:13px; color:var(--muted); line-height:1.6;
  display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; line-clamp:2; overflow:hidden;
  /* the hidden third line's Thai tone marks rise into the second line's
     leading and showed as stray dots under the "..." line: trim that strip */
  clip-path:inset(0 0 0.22em 0);
}
/* บทความแนะนำ: one row that scrolls sideways, most popular on the left. A
   card with a photo fills a column's full height; two cards without one
   share a column (each a little under half the height). */
.ga-rail{
  --rail-h:330px;
  display:grid; grid-auto-flow:column; grid-auto-columns:280px; gap:14px;
  overflow-x:auto; overscroll-behavior-x:contain; scroll-snap-type:x proximity;
  padding:2px 2px 12px; margin:0 -2px;
}
.ga-rail-col{ display:flex; flex-direction:column; gap:14px; height:var(--rail-h); scroll-snap-align:start; min-width:0; }
.ga-rail-col > .ga-card{ flex:1 1 0; min-height:0; }
.ga-rail-col > .ga-card.has-cover .ga-card-cover{ aspect-ratio:auto; flex:1 1 auto; min-height:0; }
.ga-rail-col > .ga-card:not(.has-cover){ justify-content:center; }
@media (max-width:600px){ .ga-rail{ grid-auto-columns:78%; --rail-h:320px; } }
/* ‹ › over the row's middle (the same round button as the timeline's, a
   size up for the bigger cards); is-off fades one out at its end */
.ga-rail-wrap{ position:relative; }
.ga-rail-nav{
  position:absolute; top:calc(50% - 5px); transform:translateY(-50%); z-index:2;
  width:40px; height:40px; padding:10px; border-radius:50%; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  background:var(--bg-card); border:1px solid var(--line-soft-strong); color:var(--text);
  box-shadow:0 4px 14px rgba(0,0,0,0.35); transition:opacity .2s ease, border-color .2s ease;
}
.ga-rail-nav svg{ width:100%; height:100%; }
.ga-rail-nav.prev{ left:-12px; } .ga-rail-nav.next{ right:-12px; }
.ga-rail-nav:hover{ border-color:var(--border-hover); }
.ga-rail-nav.is-off{ opacity:0; pointer-events:none; }
body.light-mode .ga-rail-nav{ box-shadow:0 4px 14px rgba(20,30,60,0.14); }
@media (max-width:600px){
  .ga-rail-nav{ width:34px; height:34px; padding:8px; }
  .ga-rail-nav.prev{ left:-6px; } .ga-rail-nav.next{ right:-6px; }
}
.home-block .ga-grid{ margin-top:0; }
@media (max-width:1100px){ .ga-grid{ grid-template-columns:repeat(2, minmax(0, 1fr)); } }
/* phones: still two columns (one card per row was too big), with smaller
   type so the title and the two-line opening fit a half-width card */
@media (max-width:600px){
  .ga-grid, .ga-grids{ gap:10px; }
  .ga-card-text{ gap:4px; padding:10px 12px 12px; }
  .ga-cat{ font-size:11px; }
  .ga-card-title{ font-size:13.5px; line-height:1.4; }
  .ga-card-sum{ font-size:12px; line-height:1.55; }
}

.ga-deeper{ margin-top:38px; }
.ga-deeper-note{ font-size:13.5px; color:var(--muted); margin:-6px 0 10px; }
.ga-deeper-list{ list-style:none; margin:0; padding:0; display:grid; gap:8px; }
.ga-deeper-link{
  background:none; border:0; padding:0; cursor:pointer; font-family:inherit; font-size:14px;
  color:var(--text); text-align:left;
}
.ga-deeper-link:hover{ color:var(--orange-soft); }

.ga-search-wrap{ margin:18px 0 4px; }
.ga-tabs{ margin:14px 0 10px; }
.ga-empty{ grid-column:1 / -1; color:var(--muted); font-size:13.5px; padding:14px 0; }
.ga-grid-tight{ margin-top:0; }
.ga-loading{ color:var(--muted); font-size:14px; padding:30px 0; }
/* the article's cover photo, its credit right under it (licence terms) */
/* computer / tablet: a smaller photo on the right (text and headings keep
   one left edge) with the opening and the
   text flowing beside it; phones: full width above the text */
.ga-cover{ margin:14px 0 18px; }
/* the whole photo (not cropped): width and proportions come from the img's
   inline style (18 genFigureImg), centred when a tall one is narrower */
.ga-cover img{ display:block; height:auto; margin:0 auto; border-radius:12px; background:#0a0f1e; }
@media (min-width:601px){
  .ga-cover{ float:right; width:36%; margin:6px 0 12px 26px; }
  .ga-detail .lede{ margin-bottom:18px; }
}
/* blocks with a frame or a rule start below the photo, never beside it */
.ga-myth, .ga-related, .ga-section, .ga-pager{ clear:both; }
.ga-cover figcaption{ margin-top:6px; font-size:11.5px; color:var(--muted-dim); line-height:1.5; }
.ga-cover-cap{ display:block; color:var(--muted); font-size:12.5px; margin-bottom:2px; }
.ga-cover figcaption a{ color:inherit; text-decoration:underline; text-underline-offset:2px; }
/* TeX formulas (KaTeX, js/18): hidden until typeset so the raw TeX never
   flashes; a display formula gets its own line and scrolls if too wide */
tex, texb{ opacity:0; transition:opacity .15s ease; }
tex.tex-done, texb.tex-done{ opacity:1; }
texb{ display:block; margin:14px 0; overflow-x:auto; overflow-y:hidden; text-align:center; padding:2px 0; }
.ga-body .katex{ font-size:1.08em; }
.ga-body texb .katex-display{ margin:0; }

/* landing: หนังสือและคลิปดาราศาสตร์แนะนำ, plain rows (no boxes) */
.gr-lede{ margin:-4px 0 14px; font-size:13.5px; color:var(--muted); }
.gr-group + .gr-group{ margin-top:26px; }
.gr-group-title{ margin:0 0 4px; font-family:'Chakra Petch',sans-serif; font-size:15px; font-weight:700; color:var(--text); }
.gr-list{ display:grid; grid-template-columns:repeat(auto-fill, minmax(320px, 1fr)); gap:0 36px; }
.gr-item{
  display:flex; flex-direction:column; gap:3px; padding:12px 0;
  border-bottom:1px solid var(--line-soft); color:var(--text); text-decoration:none;
}
.gr-title{ display:flex; align-items:center; gap:6px; font-size:14.5px; font-weight:600; }
.gr-ext{ width:13px; height:13px; flex-shrink:0; color:var(--muted); transition:color .15s ease; }
.gr-item:hover .gr-title{ color:var(--orange); }
.gr-item:hover .gr-ext{ color:var(--orange); }
.gr-meta{ display:flex; flex-wrap:wrap; gap:2px 14px; font-size:12px; color:var(--muted); }
.gr-lv-1{ color:var(--green-ok); }
.gr-lv-2{ color:var(--yellow); }
.gr-lv-3{ color:var(--pink); }
.gr-desc{ font-size:13px; line-height:1.55; color:var(--muted); }
@media (max-width:520px){ .gr-list{ grid-template-columns:1fr; } }

.ga-back{ margin-bottom:18px; }
.ga-detail{ display:flow-root; }
.ga-title{ margin-top:6px; margin-bottom:2px; }
.ga-en{ font-size:14px; color:var(--muted); margin:0 0 10px; font-style:italic; }
.ga-en:has(+ .ga-date){ margin-bottom:2px; }
.ga-date{ font-size:12.5px; color:var(--muted-dim); margin:0 0 10px; }
/* แสดงสูตรคณิตศาสตร์ (genFxOn in 18): .fx is the formula part of an
   article, .nofx the plain-language line that stands in for it. Only ever
   hidden here, never given a display, so each keeps its own layout. */
#generalDetail:not(.fx-on) .fx, #generalDetail.fx-on .nofx{ display:none !important; }
.ga-fx{ display:flex; align-items:center; flex-wrap:wrap; gap:4px 10px; margin:0 0 14px; cursor:pointer; width:fit-content; max-width:100%; }
.ga-fx-input{ position:absolute; opacity:0; width:1px; height:1px; margin:0; }
.ga-fx-track{ position:relative; flex:none; width:34px; height:18px; border-radius:18px; background:var(--tint-weak); border:1px solid var(--line-soft-strong); transition:background .15s ease, border-color .15s ease; }
.ga-fx-track::before{ content:''; position:absolute; top:1px; left:1px; width:14px; height:14px; border-radius:50%; background:var(--muted); transition:transform .15s ease, background .15s ease; }
.ga-fx-input:checked + .ga-fx-track{ background:rgba(242,166,90,0.3); border-color:var(--orange); }
.ga-fx-input:checked + .ga-fx-track::before{ background:var(--orange); transform:translateX(16px); }
.ga-fx-input:focus-visible + .ga-fx-track{ outline:2px solid var(--blue); outline-offset:2px; }
.ga-fx-text{ font-size:13.5px; font-weight:600; color:var(--text); }
.ga-fx-hint{ font-size:12.5px; color:var(--muted); }
.ga-section{ margin:8px 0 28px; }
.ga-section-h{ font-size:16px; margin:0 0 12px; }
.ga-section-note{ font-size:12.5px; color:var(--muted-dim); margin:8px 0 0; }
.ga-terms{ display:flex; flex-wrap:wrap; gap:6px 22px; }
.ga-term{
  display:inline-flex; align-items:baseline; gap:6px; background:none; border:0; padding:2px 0; cursor:pointer;
  font-family:inherit; font-size:13.5px; color:var(--text); text-align:left;
}
.ga-term b{ font-weight:600; text-decoration:underline; text-decoration-color:rgba(242,166,90,0.5); text-underline-offset:3px; }
.ga-term-th{ color:var(--muted); font-size:13px; }
.ga-term:hover b{ color:var(--orange-soft); }
.ga-body{ font-size:15px; line-height:1.85; }
.ga-body p{ margin:0 0 14px; }
.ga-body h3{ font-size:16.5px; margin:26px 0 10px; }
/* lists flow around the cover photo like the paragraphs and come back to the
   left edge under it (a grid list stayed a narrow column beside the photo);
   markers sit inside the text so they never overlap the floated photo */
.ga-body ul, .ga-body ol{ margin:0 0 14px; padding-left:0; list-style-position:inside; }
.ga-body li{ margin-bottom:6px; }
/* one panel for the misconception note: a large grouping frame is fine */
.ga-myth{
  margin:24px 0; padding:16px 20px; border-radius:12px;
  background:rgba(242,166,90,0.08); border:1px solid rgba(242,166,90,0.3);
}
.ga-myth-head{ display:block; font-weight:700; font-size:14px; color:var(--orange-soft); margin-bottom:6px; }
body.light-mode .ga-myth-head{ color:var(--orange-deep); }
.ga-myth p{ margin:0; font-size:14.5px; line-height:1.8; }
.ga-related{ display:flex; flex-direction:column; align-items:flex-start; gap:12px; margin:8px 0 30px; }
.ga-related .link-btn{ font-size:14px; margin:0; padding:0; border:0; }
.ga-related .link-btn:hover{ background:none; }
.ga-pager{ display:flex; justify-content:space-between; gap:16px; padding-top:18px; border-top:1px solid var(--line-soft); }
.ga-pager-btn{
  display:flex; flex-direction:column; gap:2px; max-width:48%; background:none; border:0; padding:0;
  cursor:pointer; font-family:inherit; color:var(--text); text-align:left;
}
.ga-pager-btn.next{ text-align:right; align-items:flex-end; margin-left:auto; }
.ga-pager-btn span{ font-size:12.5px; color:var(--muted); }
.ga-pager-btn b{ font-size:14px; line-height:1.45; }
.ga-pager-btn:hover b{ color:var(--orange-soft); }

/* ---- home sections below the entry cards (js/12-home-sections.js) ---- */
.home-block{ margin-top:38px; }
.home-block-head{ display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin-bottom:14px; }
.home-block-head .home-block-title{ margin:0; }
.home-block-head .link-btn{ font-size:13.5px; white-space:nowrap; }

/* today's sky: one compact row of plain columns (Moon and times, planets,
   sights), then the year's events as a timeline strip (.tl below) */
.home-sky-top{ display:grid; grid-template-columns:minmax(0, 1.05fr) minmax(0, 1fr) minmax(0, 1fr); gap:10px 36px; align-items:start; }
.home-sky-moon{ display:flex; align-items:center; gap:12px; margin-bottom:10px; }
.home-moon-svg{ width:46px; height:46px; flex-shrink:0; filter:drop-shadow(0 0 8px rgba(241,234,210,0.22)); }
.home-sky-moon-name{ font-weight:700; font-size:14.5px; }
.home-sky-line{ display:block; font-size:12px; color:var(--muted); line-height:1.55; }
.home-sky-times{ display:grid; grid-template-columns:auto 1fr; gap:3px 14px; margin:0; font-size:12.5px; }
.home-sky-times dt{ color:var(--muted); }
.home-sky-times dd{ margin:0; }
.home-sky-h{ font-size:12.5px; font-weight:600; color:var(--muted); margin:0 0 7px; letter-spacing:0.01em; }
.home-sky-h-note{ font-size:12px; font-weight:400; color:var(--muted-dim); margin-left:6px; }
.home-sky-list{ list-style:none; margin:0; padding:0; display:grid; gap:7px; }
.home-sky-list li{ font-size:12.5px; }
.home-sky-list li b{ font-size:13px; }
.home-sky-mag{ font-size:11.5px; color:var(--muted-dim); margin-left:4px; }
.home-sky-none{ color:var(--muted); font-size:12.5px; }
.home-sky-tl-head{ display:flex; align-items:baseline; flex-wrap:wrap; gap:2px 4px; margin:22px 0 8px; }
.home-sky-tl-head .home-sky-h{ margin:0; }
.home-sky-date{ font-size:13px; font-weight:400; color:var(--muted); margin-left:8px; }
.home-block-links{ display:flex; gap:4px; flex-wrap:wrap; justify-content:flex-end; }
.home-tonight-note{ font-size:12px; color:var(--muted-dim); margin:10px 0 0; }
@media (max-width:1000px){
  .home-sky-top{ grid-template-columns:minmax(0, 1fr) minmax(0, 1fr); }
  .home-sky-top .home-sky-col:first-child{ grid-column:1 / -1; }
  .home-sky-top .home-sky-col:first-child{ display:flex; flex-wrap:wrap; gap:8px 28px; align-items:flex-start; }
}
@media (max-width:600px){
  .home-sky-top{ grid-template-columns:1fr; gap:18px; }
  .home-block-head{ flex-wrap:wrap; }
}

/* ---- event timeline strip (astroTimelineRender in js/13; home + calendar)
   One framed box that scrolls sideways: month ticks above a horizontal
   axis, each event hanging below on a stem. Label size = importance. */
.tl{
  --ev-moon:#e9dfb4; --ev-eclipse:#f2a65a; --ev-planet:#7ec4f2; --ev-conj:#b98af2;
  --ev-season:#7fd8a0; --ev-meteor:#f28ad0;
  position:relative; border:1px solid var(--line-soft); border-radius:12px; background:rgba(10,16,34,0.35);
}
body.light-mode .tl{
  --ev-moon:#9a8233; --ev-eclipse:#c96a14; --ev-planet:#1f6fa8; --ev-conj:#8e44ad;
  --ev-season:#2f9a5c; --ev-meteor:#c2185b;
  background:rgba(255,255,255,0.6);
}
.tl-scroll{ overflow-x:auto; overflow-y:hidden; cursor:grab; scrollbar-width:thin; scrollbar-color:rgba(150,160,190,0.35) transparent; }
.tl-scroll.is-dragging{ cursor:grabbing; user-select:none; }
.tl-track{ position:relative; }
.tl-axis{ position:absolute; left:0; right:0; height:1px; background:rgba(200,208,230,0.32); }
body.light-mode .tl-axis{ background:rgba(20,20,30,0.25); }
.tl-month{ position:absolute; top:0; border-left:1px solid rgba(200,208,230,0.16); }
.tl-month span{ position:absolute; top:8px; left:5px; font-size:11.5px; color:var(--muted); white-space:nowrap; }
.tl-month.is-year{ border-left-color:rgba(200,208,230,0.4); }
.tl-month.is-year span{ color:var(--text); font-weight:600; }
.tl-today{ position:absolute; top:0; width:0; border-left:1.5px dashed var(--blue); opacity:0.85; pointer-events:none; }
.tl-today span{ position:absolute; top:8px; left:5px; font-size:11px; font-weight:700; color:var(--blue); white-space:nowrap; background:var(--bg-panel, #0d1530); padding:0 3px; }
.tl-moon{ position:absolute; width:9px; height:9px; margin:-4px 0 0 -4px; border-radius:50%; }
.tl-moon.full{ background:#f1ead2; box-shadow:0 0 5px rgba(241,234,210,0.5); }
.tl-moon.new{ background:var(--bg-panel); border:1px solid rgba(200,208,230,0.55); }
body.light-mode .tl-moon.full{ background:#c9b25a; box-shadow:none; }
.tl-stem{ position:absolute; width:0; border-left:1px solid var(--c, var(--muted)); opacity:0.55; }
.tl-stem.lvl-3{ opacity:0.9; border-left-width:1.5px; }
.tl-ev{
  position:absolute; display:flex; flex-direction:column; align-items:flex-start; gap:0; padding:0 0 0 7px;
  background:none; border:0; border-left:2px solid var(--c, var(--muted)); cursor:pointer; font-family:inherit; text-align:left; white-space:nowrap; color:var(--text);
}
.tl-ev.flip{ align-items:flex-end; text-align:right; padding:0 7px 0 0; border-left:0; border-right:2px solid var(--c, var(--muted)); }
.tl-ev b{ line-height:1.3; }
.tl-ev span{ font-size:11px; color:var(--muted); line-height:1.3; }
.tl-ev.lvl-3 b{ font-size:15px; font-weight:700; color:var(--c); }
.tl-ev.lvl-2 b{ font-size:13px; font-weight:600; }
.tl-ev.lvl-1 b{ font-size:11.5px; font-weight:500; color:var(--muted); }
.tl-ev:hover b{ text-decoration:underline; }
.tl-ev.is-dim{ opacity:0.55; }
.tl .cat-moon{ --c:var(--ev-moon); } .tl .cat-eclipse{ --c:var(--ev-eclipse); } .tl .cat-planet{ --c:var(--ev-planet); }
.tl .cat-conj{ --c:var(--ev-conj); } .tl .cat-season{ --c:var(--ev-season); } .tl .cat-meteor{ --c:var(--ev-meteor); }
.tl-nav{
  position:absolute; top:6px; z-index:2; width:28px; height:28px; border-radius:50%; cursor:pointer;
  background:var(--bg-card); border:1px solid var(--line-soft-strong); color:var(--text); font-size:18px; line-height:1;
}
.tl-nav.prev{ left:6px; } .tl-nav.next{ right:6px; }
.tl-nav:hover{ border-color:var(--border-hover); }
.tl-edge{
  position:absolute; background:none; border:0; cursor:pointer; font-family:inherit; font-size:13px; font-weight:600;
  color:var(--orange-soft); white-space:nowrap; padding:4px 0;
}
body.light-mode .tl-edge{ color:var(--orange-deep); }
.tl-edge.prev{ left:44px; } .tl-edge.next{ right:44px; }
.tl-edge:hover{ text-decoration:underline; }
/* beats .cal-view's 720px cap further down: the strip uses the full width */
.cal-view.cal-view-wide{ max-width:none; }

/* สอวน. block: one heading, then bank numbers / articles / tutoring */
.home-sub-head{ display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin:22px 0 12px; }
.home-sub-head h3{ font-size:14.5px; margin:0; color:var(--text); }
.home-block-head + .home-sub-head{ margin-top:4px; }
/* same orange as the block's heading link, but smaller and not underlined */
.home-sub-all{ font-size:13px; white-space:nowrap; color:var(--orange-soft); font-weight:600; text-decoration:none; }
body.light-mode .home-sub-all{ color:var(--orange-deep); }
.home-sub-all:hover{ text-decoration:underline; }

/* home sub-section heading ("รอบคัดเลือกเข้าค่าย 1", "เนื้อหา"): one rule
   under the title that spans the whole row of cards */
.home-posn .home-sub-head{ padding-bottom:9px; border-bottom:1px solid rgba(200,208,230,0.32); margin-bottom:14px; }
body.light-mode .home-posn .home-sub-head{ border-bottom-color:rgba(20,20,30,0.24); }
.home-posn .home-sub-head h3{ font-size:16px; }

/* free ways into the bank (js/13 renderHomeBankFeature): three equal cards
   in one row, each with a first-page preview on top. Large cards only, no
   small boxed labels (owner's rule). */
.home-bank{ display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:14px; }
.home-pcard{
  display:flex; flex-direction:column; padding:0; overflow:hidden; text-align:left; cursor:pointer;
  background:var(--bg-card); border:1px solid var(--line-soft); border-radius:12px; color:var(--text); font-family:inherit;
  transition:transform .15s ease, border-color .2s ease;
}
.home-pcard:hover{ transform:translateY(-2px); border-color:var(--border-hover); }
/* 5:2, a little shorter than the first-page crop needs, so the photo cards
   are closer in height to the text cards beside them */
.home-pcard-cover{ position:relative; display:block; aspect-ratio:5 / 2; overflow:hidden; background:#fff; border-bottom:1px solid var(--line-soft); }
/* both first-page images are 640x320 (2:1) in a 5:2 frame: full width and
   lifted by the same 14% of the frame, which leaves the สอวน. logo on the 2569
   page ~20 image px below the top edge at any card width */
.home-pcard-cover img{ position:absolute; left:0; top:-14%; width:100%; height:auto; }
/* the 0A page: its logo-to-"ชุด 0A (Free)" block (image y 122 to 263 of 320)
   is centred in the 5:2 frame, (122+263)/2 - 128 = 64.5 px of 640 = 25.2%;
   its printed header line ends up above the frame;
   the white frame behind reads as the rest of the page */
.home-pcard-cover img.cover-lift{ top:-25.2%; }
/* drawn stand-in for a first page that has no image yet */
.home-pcard-sheet{ position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; gap:7px; padding:18px 12% 0; background:#fbfaf7; }
.home-pcard-sheet b{ font-size:12px; color:#2a2f3d; text-align:center; line-height:1.4; margin-bottom:4px; }
.home-pcard-sheet i{ display:block; height:5px; border-radius:3px; background:#e3e1da; align-self:flex-start; }
.home-pcard-body{ display:flex; flex-direction:column; gap:4px; padding:14px 16px 16px; flex:1; }
.home-pcard-kicker{ font-size:12px; font-weight:700; color:var(--green-ok); }
.home-pcard-body b{ font-size:15px; line-height:1.4; }
.home-pcard-desc{ font-size:12.5px; color:var(--muted); line-height:1.6; flex:1; }
.home-pcard-cta{ margin-top:6px; font-size:13px; font-weight:600; color:var(--orange-soft); }
body.light-mode .home-pcard-cta{ color:var(--orange-deep); }
/* card 2 holds one link per year, so it is a plain card (no whole-card
   hover) with its links in a row */
/* third column: two short text-only cards stacked to the same height */
.home-pstack{ display:flex; flex-direction:column; gap:14px; min-width:0; }
.home-pstack > .home-pcard{ flex:1; }
.home-pcard.is-text .home-pcard-body{ justify-content:center; padding:18px 18px 18px; }
.home-pcard.is-text .home-pcard-body b{ font-size:16px; }
.home-pcard.is-text .home-pcard-desc{ flex:0; }
.home-bank-more{ grid-column:1 / -1; justify-self:start; margin:2px 0 0; padding:0; border:0; font-size:13px; }
.home-bank-more:hover{ background:none; }
/* course placeholder: one short framed strip until the course exists */
.home-course{
  display:flex; align-items:center; gap:16px; margin-top:14px; padding:12px 20px; border-radius:12px;
  border:1px dashed var(--line-soft-strong);
}
.home-course h3{ font-size:14.5px; margin:0 0 2px; }
.home-course p{ font-size:12.5px; color:var(--muted); margin:0; }
@media (max-width:860px){ .home-bank{ grid-template-columns:1fr; } }
.home-bank-more-row{ margin-top:12px; }
/* ค่าย 1 และค่าย 2 / ระดับชาติ: two short half-width sections, no cards */
.home-levels{ display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:0 36px; margin-top:8px; }
.home-level .home-sub-head{ margin-top:22px; margin-bottom:10px; }
.home-level-text{ margin:0; font-size:14px; line-height:1.7; color:var(--muted); }
@media (max-width:700px){ .home-levels{ grid-template-columns:1fr; } }
.bank-retired-note{ margin:4px 2px 2px; font-size:12.5px; line-height:1.7; color:var(--muted-dim); }
.home-bank-more-row:empty{ display:none; }
/* phones: the free-problem cards and the content cards become one row each
   that scrolls sideways (snapping card by card) instead of stacking, which
   made the home page over 4,500 px tall; the next card peeks in at the edge
   so it's clear there's more */
@media (max-width:600px){
  .home-posn .home-bank, .home-posn .home-articles{
    display:flex; gap:12px; overflow-x:auto; overscroll-behavior-x:contain;
    scroll-snap-type:x mandatory; padding-bottom:8px;
  }
  .home-posn .home-bank > .home-pcard, .home-posn .home-bank > .home-pstack, .home-posn .home-articles > .home-article-card{ flex:0 0 80%; scroll-snap-align:start; }
}

.home-articles{ display:grid; grid-template-columns:repeat(4, 1fr); gap:14px; }

/* ข้อสอบเก่า (sec-pastpapers, js/12b): plain rows of year, paper and where
   the file lives, grouped under headings; no boxes around the text */
.pp-list{ max-width:760px; }
.pp-group{ margin-bottom:30px; }
.pp-group h3{ font-size:17px; margin:0 0 2px; }
.pp-desc{ font-size:13px; color:var(--muted); margin:0 0 8px; }
.pp-centre{ font-size:14px; font-weight:600; margin:18px 0 2px; color:var(--orange-soft); }
body.light-mode .pp-centre{ color:var(--orange-deep); }
.pp-row{
  display:grid; grid-template-columns:52px minmax(0, 1fr) auto; gap:12px; align-items:baseline;
  padding:10px 6px; border-bottom:1px solid var(--line-soft); color:var(--text); text-decoration:none;
}
.pp-row:hover{ background:var(--tint-weak); }
.pp-row.pp-noyear{ grid-template-columns:minmax(0, 1fr) auto; }
.pp-year{ font-weight:700; font-variant-numeric:tabular-nums; }
.pp-name{ font-size:14px; }
.pp-src{ font-size:12.5px; color:var(--muted); white-space:nowrap; }
.pp-row:hover .pp-src{ color:var(--orange-soft); }
body.light-mode .pp-row:hover .pp-src{ color:var(--orange-deep); }
/* ข้อสอบระดับชาติ (sec-olympiad-papers): an archive row has no year column,
   its name and a one-line description instead */
.pp-row.pp-archive{ grid-template-columns:minmax(0, 1fr) auto; }
.pp-archive .pp-name b{ font-size:15px; }
.pp-country{ margin-left:8px; font-size:12.5px; color:var(--muted); }
.pp-sub{ display:block; margin-top:2px; font-size:13px; color:var(--muted); line-height:1.6; }
.pp-inline-link{ font-size:inherit; padding:0; margin:0; border:0; vertical-align:baseline; }
.pp-inline-link:hover{ background:none; text-decoration:underline; }
.pp-credit{ max-width:760px; font-size:12.5px; line-height:1.7; color:var(--muted); }
.pp-credit a{ color:var(--orange-soft); }
body.light-mode .pp-credit a{ color:var(--orange-deep); }
.home-article-card{
  display:flex; flex-direction:column; text-align:left; padding:0; overflow:hidden; cursor:pointer;
  background:var(--bg-card); border:1px solid var(--line-soft); border-radius:12px; color:var(--text);
  font-family:inherit; transition:transform .15s ease, border-color .2s ease;
}
.home-article-card:hover{ transform:translateY(-2px); border-color:var(--border-hover); }
.home-article-thumb{ display:block; aspect-ratio:2/1; background:#fff; overflow:hidden; }
.home-article-thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.home-article-body{ display:flex; flex-direction:column; padding:10px 12px 12px; }
.home-article-body b{
  font-size:13.5px; line-height:1.45;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
@media (max-width:1100px){ .home-articles{ grid-template-columns:repeat(2, 1fr); } }
@media (max-width:420px){ .home-articles{ grid-template-columns:1fr; } }


.home-tutor-cta{
  display:flex; align-items:center; justify-content:space-between; gap:18px; flex-wrap:wrap;
  margin-top:38px; padding:22px 24px; border-radius:14px;
  background:linear-gradient(120deg, rgba(185,138,242,0.16), rgba(242,166,90,0.14));
  border:1px solid rgba(185,138,242,0.35);
}
.home-tutor-cta h2, .home-tutor-cta h3{ font-size:16px; margin:0 0 4px; }
/* ปรับแต่งหน้าหลัก (js/19): a switched-off block is hidden even when its own
   class sets a display value (e.g. the flex tutor call-out) */
#sec-home [data-hs][hidden]{ display:none; }
.home-plain{ font-size:14px; line-height:1.75; color:var(--muted); margin:0; max-width:760px; }
.home-plain-actions{ display:flex; gap:10px; flex-wrap:wrap; margin-top:14px; }
/* one frame around the day's term (a grouping frame, not a box per line) */
.home-term{
  padding:16px 20px 18px; border-radius:12px;
  background:var(--bg-card); border:1px solid var(--line-soft);
}
.home-term-head{ display:flex; align-items:baseline; gap:10px; flex-wrap:wrap; }
.home-term-head b{ font-size:18px; }
.home-term-head span{ font-size:15px; color:var(--muted); }
.home-term p{ font-size:14px; line-height:1.75; margin:6px 0 0; }
.home-custom-modal{ max-width:480px; }
.home-custom-sub{ color:var(--muted); font-size:13px; margin:0 0 12px; }
.home-custom-list{ display:flex; flex-direction:column; max-height:min(60vh, 460px); overflow-y:auto; margin-bottom:16px; }
.home-custom-row{ display:flex; align-items:flex-start; gap:12px; padding:10px 2px; border-top:1px solid var(--line-soft); cursor:pointer; }
.home-custom-row:first-child{ border-top:0; }
.home-custom-row input{ margin-top:4px; width:16px; height:16px; accent-color:var(--orange); flex-shrink:0; }
.home-custom-row > span{ display:flex; flex-direction:column; gap:1px; }
.home-custom-row b{ font-size:14px; }
.home-custom-row > span > span{ font-size:12.5px; color:var(--muted); }
.home-custom-row.is-soon{ cursor:default; opacity:0.6; }
.home-tutor-cta p{ margin:0; font-size:13.5px; color:var(--muted); max-width:620px; }

/* ---- astronomy calendar (js/14-calendar.js) ------------------------------
   Airy on purpose: no card around the month, thin lines only between days,
   event colors as small dots/text accents rather than filled boxes. */
#sec-calendar, #sec-glossary{
  --ev-moon:#e9dfb4; --ev-eclipse:#f2a65a; --ev-planet:#7ec4f2; --ev-conj:#b98af2;
  --ev-season:#7fd8a0; --ev-meteor:#f28ad0;
}
body.light-mode #sec-calendar{
  --ev-moon:#9a8233; --ev-eclipse:#c96a14; --ev-planet:#1f6fa8; --ev-conj:#8e44ad;
  --ev-season:#2f9a5c; --ev-meteor:#c2185b;
}
/* the long rule under the tabs: --line-soft made ~25% stronger, which read
   too faint here (0.08 -> 0.10 dark, 0.09 -> 0.115 light) */
.cal-tabs{ display:flex; gap:22px; flex-wrap:wrap; margin:22px 0 18px; border-bottom:1px solid rgba(237,239,246,0.10); }
body.light-mode .cal-tabs{ border-bottom-color:rgba(20,20,30,0.115); }
.cal-tab{
  background:none; border:0; padding:8px 0 10px; margin-bottom:-1px; cursor:pointer; font-family:inherit;
  font-size:14px; color:var(--muted); border-bottom:2px solid transparent;
}
.cal-tab:hover{ color:var(--text); }
.cal-tab.active{ color:var(--text); font-weight:600; border-bottom-color:var(--orange); }
.cal-view{ display:none; max-width:720px; }
.cal-view.active{ display:block; }
/* the month card: a deep night-sky panel (navy gradient, two faint nebula
   glows, a thin colour line on top) with a sprinkle of stars that fades out
   above the day grid, so the dates themselves sit on a calm, even background */
.cal-card{
  position:relative; isolation:isolate; overflow:hidden; max-width:600px;
  padding:18px 18px 12px; border-radius:18px; border:1px solid rgba(255,255,255,0.08);
  background:
    radial-gradient(110% 70% at 100% 0%, rgba(110,98,255,0.20), transparent 60%),
    radial-gradient(80% 60% at 0% 100%, rgba(40,190,180,0.10), transparent 65%),
    linear-gradient(180deg, #0c1530 0%, #070b18 55%, #05070f 100%);
  box-shadow:0 22px 50px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.06);
}
.cal-card::before{
  content:""; position:absolute; inset:0; z-index:-1; pointer-events:none;
  background-image:
    radial-gradient(1.2px 1.2px at 8% 12%, rgba(255,255,255,0.8) 50%, transparent 52%),
    radial-gradient(1px 1px at 22% 30%, rgba(255,255,255,0.6) 50%, transparent 52%),
    radial-gradient(1.4px 1.4px at 37% 9%, rgba(255,236,200,0.85) 50%, transparent 52%),
    radial-gradient(1px 1px at 51% 24%, rgba(255,255,255,0.55) 50%, transparent 52%),
    radial-gradient(1.2px 1.2px at 63% 6%, rgba(200,215,255,0.8) 50%, transparent 52%),
    radial-gradient(1px 1px at 74% 20%, rgba(255,255,255,0.6) 50%, transparent 52%),
    radial-gradient(1.6px 1.6px at 86% 11%, rgba(255,255,255,0.9) 50%, transparent 52%),
    radial-gradient(1px 1px at 94% 27%, rgba(255,230,210,0.6) 50%, transparent 52%),
    radial-gradient(1px 1px at 30% 18%, rgba(255,255,255,0.45) 50%, transparent 52%),
    radial-gradient(1px 1px at 81% 31%, rgba(255,255,255,0.45) 50%, transparent 52%);
  -webkit-mask-image:linear-gradient(180deg, #000 0, #000 70px, transparent 150px);
          mask-image:linear-gradient(180deg, #000 0, #000 70px, transparent 150px);
}
.cal-card::after{
  content:""; position:absolute; left:0; right:0; top:0; height:2px; pointer-events:none;
  background:linear-gradient(90deg, transparent, var(--orange) 25%, #c98bff 60%, #6fa8ff 85%, transparent);
  opacity:0.8;
}
body.light-mode .cal-card{
  border-color:rgba(20,30,60,0.10);
  background:
    radial-gradient(110% 70% at 100% 0%, rgba(110,98,255,0.08), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, #f5f7fc 100%);
  box-shadow:0 14px 34px rgba(20,30,60,0.10);
}
body.light-mode .cal-card::before{ display:none; }
.cal-nav{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:14px; }
/* month card header: the month and year read as one big title, the arrows
   and วันนี้ sit on the right */
#calCard .cal-nav{ gap:4px 6px; margin-bottom:16px; }
#calCard .cal-nav #calMonthSel, #calCard .cal-nav #calYearSel{
  border-bottom:0; font-size:23px; font-weight:700; padding:2px 24px 2px 2px; background-position:right 4px center; letter-spacing:0.2px; field-sizing:content;
}
#calCard .cal-nav #calYearSel{ font-weight:400; color:var(--muted); }
#calCard .cal-nav #calToday{ order:3; margin-left:auto; margin-right:4px; }
#calCard .cal-nav #calPrevMonth{ order:4; }
#calCard .cal-nav #calNextMonth{ order:5; }
#calCard .cal-arrow{
  width:34px; height:34px; padding:0; border-radius:50%; font-size:20px; display:inline-flex; align-items:center; justify-content:center;
  border:1px solid rgba(255,255,255,0.12); background:rgba(255,255,255,0.03); color:var(--text);
}
#calCard .cal-arrow:hover{ background:rgba(255,255,255,0.08); border-color:rgba(255,255,255,0.22); }
#calCard .cal-arrow:disabled{ opacity:0.35; cursor:default; }
body.light-mode #calCard .cal-arrow{ border-color:rgba(20,30,60,0.14); background:rgba(20,30,60,0.02); }
body.light-mode #calCard .cal-arrow:hover{ background:rgba(20,30,60,0.06); }
.cal-nav select{
  font-family:inherit; font-size:14px; color:var(--text); background-color:transparent;
  border:0; border-bottom:1px solid var(--line-soft-strong); padding:4px 24px 4px 2px; cursor:pointer;
}
.cal-nav select option{ background:var(--bg-panel); color:var(--text); }
.cal-arrow{
  background:none; border:0; color:var(--muted); font-size:22px; line-height:1; padding:2px 8px; cursor:pointer; border-radius:6px;
}
.cal-arrow:hover{ color:var(--text); background:var(--tint-weak); }
.cal-nav .link-btn{ font-size:13px; margin-left:6px; }
.cal-check{ font-size:13px; color:var(--muted); display:inline-flex; align-items:center; gap:6px; margin-left:10px; cursor:pointer; }

.cal-grid{ display:grid; grid-template-columns:repeat(7, minmax(0, 1fr)); }
.cal-wd{ font-size:11.5px; font-weight:600; letter-spacing:0.4px; color:var(--muted-dim); text-align:left; padding:0 6px 7px; }
.cal-wd.sun{ color:var(--pink); opacity:0.85; }
.cal-cell{
  position:relative; min-height:58px; padding:6px 6px 6px; border-top:1px solid var(--line-soft); text-align:left;
  background:none; border-left:0; border-right:0; border-bottom:0; font-family:inherit; color:var(--text);
  cursor:pointer; display:flex; flex-direction:column; gap:3px; min-width:0; transition:background .15s ease;
}
#calCard .cal-cell{ border-top-color:rgba(255,255,255,0.06); }
body.light-mode #calCard .cal-cell{ border-top-color:rgba(20,30,60,0.08); }
.cal-cell:hover{ background:var(--tint-weak); }
.cal-cell.other{ color:var(--muted-dim); opacity:0.45; }
.cal-cell.selected{ background:var(--tint-hover); box-shadow:inset 0 -2px 0 var(--orange); }
/* today: a warm glow under the date, the number itself in an orange disc */
.cal-cell.today{ background:radial-gradient(90% 90% at 30% 25%, rgba(242,166,90,0.20), transparent 75%); }
.cal-cell.today.selected{ background:radial-gradient(90% 90% at 30% 25%, rgba(242,166,90,0.26), transparent 75%), var(--tint-hover); }
.cal-num{ font-size:13px; font-weight:600; display:flex; align-items:center; gap:6px; }
#calCard .cal-cell .astro-moon{ filter:drop-shadow(0 0 3px rgba(255,236,190,0.45)); }
body.light-mode #calCard .cal-cell .astro-moon{ filter:none; }
#calCard .cal-legend{ border-top:1px solid rgba(255,255,255,0.06); padding-top:10px; margin-top:6px; }
body.light-mode #calCard .cal-legend{ border-top-color:rgba(20,30,60,0.08); }
.cal-cell.today .cal-num b{ background:var(--orange); color:var(--text-on-accent); border-radius:999px; padding:0 6px; }
.cal-cell .astro-moon{ width:13px; height:13px; }
.cal-evs{ display:flex; flex-direction:column; gap:1px; width:100%; min-width:0; }
.cal-ev{ display:block; font-size:10px; line-height:1.35; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:100%; }
.cal-ev::before{ content:""; display:inline-block; width:6px; height:6px; border-radius:50%; margin-right:5px; vertical-align:1px; background:currentColor; }
.cal-ev.more{ color:var(--muted-dim); }
.cal-ev.more::before{ display:none; }
.cal-ev.cat-moon{ color:var(--ev-moon); }
.cal-ev.cat-eclipse{ color:var(--ev-eclipse); }
.cal-ev.cat-planet{ color:var(--ev-planet); }
.cal-ev.cat-conj{ color:var(--ev-conj); }
.cal-ev.cat-season{ color:var(--ev-season); }
.cal-ev.cat-meteor{ color:var(--ev-meteor); }
.cal-legend{ display:flex; flex-wrap:wrap; gap:6px 16px; font-size:12px; color:var(--muted); margin:12px 0 4px; }
.cal-legend span::before{ content:""; display:inline-block; width:7px; height:7px; border-radius:50%; margin-right:6px; vertical-align:1px; }
.cal-legend .cat-moon::before{ background:var(--ev-moon); } .cal-legend .cat-eclipse::before{ background:var(--ev-eclipse); }
.cal-legend .cat-planet::before{ background:var(--ev-planet); } .cal-legend .cat-conj::before{ background:var(--ev-conj); }
.cal-legend .cat-season::before{ background:var(--ev-season); } .cal-legend .cat-meteor::before{ background:var(--ev-meteor); }

.cal-day{ margin:20px 0 6px; }
.cal-day-head{ display:flex; align-items:center; gap:14px; margin-bottom:10px; }
.cal-day-head .astro-moon{ width:46px; height:46px; }
.cal-day-title{ font-size:16px; font-weight:700; }
.cal-day-times{ display:grid; grid-template-columns:repeat(auto-fit, minmax(180px, 1fr)); gap:6px 24px; font-size:13.5px; margin:0 0 6px; }
.cal-day-times div span{ color:var(--muted); margin-right:8px; }
.cal-h2{ font-size:16px; margin:28px 0 10px; }

.cal-list{ display:grid; }
.cal-item{
  display:grid; grid-template-columns:150px 1fr; gap:4px 18px; padding:11px 0; border-top:1px solid var(--line-soft);
  text-align:left; background:none; border-left:0; border-right:0; border-bottom:0; font-family:inherit; color:var(--text); width:100%;
}
.cal-item.is-link{ cursor:pointer; }
.cal-item.is-link:hover{ background:var(--tint-weak); }
.cal-item.is-link:focus-visible{ outline:2px solid var(--orange); outline-offset:-2px; }
.cal-item-when{ font-size:13px; color:var(--muted); }
.cal-item-when b{ display:block; color:var(--text); font-weight:600; font-size:13.5px; }
.cal-item-title{ font-size:14px; font-weight:600; display:flex; align-items:center; gap:8px; }
.cal-item-title .cal-dot{ width:7px; height:7px; border-radius:50%; flex-shrink:0; background:currentColor; }
.cal-item-detail{ font-size:13px; color:var(--muted); line-height:1.65; margin-top:2px; }
.cal-item.cat-moon .cal-dot{ color:var(--ev-moon); } .cal-item.cat-eclipse .cal-dot{ color:var(--ev-eclipse); }
.cal-item.cat-planet .cal-dot{ color:var(--ev-planet); } .cal-item.cat-conj .cal-dot{ color:var(--ev-conj); }
.cal-item.cat-season .cal-dot{ color:var(--ev-season); } .cal-item.cat-meteor .cal-dot{ color:var(--ev-meteor); }
.cal-item.is-dim{ opacity:0.6; }
.cal-tag{ font-size:11px; font-weight:600; color:var(--green-ok); white-space:nowrap; }
.cal-tag.partial{ color:var(--orange); }
.cal-tag.none{ color:var(--muted-dim); font-weight:400; }
.cal-year-head{ font-size:15px; font-weight:700; margin:22px 0 4px; }
.cal-year-head:first-child{ margin-top:4px; }
.cal-empty{ color:var(--muted); font-size:13.5px; padding:12px 0; }
.cal-filters{ display:flex; flex-wrap:wrap; gap:6px 16px; margin:0 0 10px; }
.cal-filters label{ font-size:13px; color:var(--muted); display:inline-flex; align-items:center; gap:6px; cursor:pointer; }
.cal-note{ font-size:13px; color:var(--muted); margin:0 0 12px; line-height:1.7; }
.cal-foot{ margin-top:30px; font-size:12px; color:var(--muted-dim); }
.cal-loading{ color:var(--muted); font-size:13.5px; padding:14px 0; }
@media (max-width:760px){
  .cal-card{ padding:14px 8px 8px; border-radius:14px; }
  #calCard .cal-nav{ padding:0 4px; }
  #calCard .cal-nav #calMonthSel, #calCard .cal-nav #calYearSel{ font-size:18px; padding-right:20px; }
  #calCard .cal-nav #calToday{ font-size:12.5px; margin-left:auto; }
  #calCard .cal-arrow{ width:30px; height:30px; font-size:18px; }
  .cal-cell{ min-height:48px; padding:5px 4px 6px; }
  .cal-wd{ padding:0 4px 6px; }
  .cal-ev{ font-size:0; line-height:0; display:inline-block; }
  .cal-ev::before{ margin-right:2px; }
  .cal-ev.more{ display:none; }
  .cal-evs{ flex-direction:row; flex-wrap:wrap; gap:1px; }
  .cal-item{ grid-template-columns:1fr; gap:2px; }
}

/* ---- astronomy glossary (js/15-glossary.js) ---------------------------- */
.gl-tools{ display:flex; align-items:center; gap:14px 24px; flex-wrap:wrap; margin:20px 0 12px; }
/* search field + a clear button at its right end, shown only while there
   is text (:placeholder-shown, so it also follows values set from code);
   the browser's own cancel cross is hidden */
.gl-search-wrap{ position:relative; flex:1 1 320px; max-width:560px; }
.gl-search{
  display:block; width:100%; font-family:inherit; font-size:14.5px; color:var(--text);
  background:transparent; border:0; border-bottom:1px solid var(--line-soft-strong); padding:8px 34px 8px 2px; outline:none;
}
.gl-search:focus{ border-bottom-color:var(--orange); }
.gl-search::placeholder{ color:var(--muted-dim); }
.gl-search::-webkit-search-cancel-button{ -webkit-appearance:none; appearance:none; }
.search-clear{
  position:absolute; right:0; top:50%; transform:translateY(-50%);
  width:28px; height:28px; padding:6px; border:0; border-radius:50%; background:none;
  color:var(--muted); cursor:pointer; display:flex; align-items:center; justify-content:center;
  transition:color .15s ease, background .15s ease;
}
.search-clear svg{ width:100%; height:100%; }
.search-clear:hover{ color:var(--text); background:var(--bg-panel-2); }
.gl-search:placeholder-shown + .search-clear{ display:none; }
.gl-sort{ display:flex; align-items:center; gap:4px; font-size:13px; }
.gl-sort-label{ color:var(--muted-dim); margin-right:6px; }
.gl-sort-btn{
  background:none; border:0; font-family:inherit; font-size:13px; color:var(--muted); padding:4px 8px; cursor:pointer; border-radius:6px;
}
.gl-sort-btn:hover{ color:var(--text); }
.gl-sort-btn.active{ color:var(--text); font-weight:600; background:var(--tint-hover); }
.gl-index{ display:flex; flex-wrap:wrap; gap:2px 2px; margin:4px 0 6px; }
.gl-index a{
  font-size:12.5px; color:var(--muted); text-decoration:none; padding:2px 6px; border-radius:5px; min-width:22px; text-align:center;
}
.gl-index a:hover{ color:var(--text); background:var(--tint-weak); }
.gl-index a.empty{ color:var(--muted-dim); opacity:0.4; pointer-events:none; }
.gl-index-end{ display:inline-flex; align-items:center; gap:2px; }
.gl-index-clear{
  margin-left:10px; padding:2px 8px; border:0; border-radius:5px; background:none; cursor:pointer;
  font-family:inherit; font-size:12.5px; color:var(--muted);
}
.gl-index-clear:hover:not(:disabled){ color:var(--text); background:var(--tint-weak); }
.gl-index-clear:disabled{ opacity:0.4; cursor:default; }
/* the letter being shown (no search: one letter per page, js/15) */
.gl-index a.active{ color:var(--orange-soft); font-weight:700; background:var(--tint-weak); }
body.light-mode .gl-index a.active{ color:var(--orange-deep); }
.gl-pager{ display:flex; justify-content:space-between; margin-top:22px; padding-top:14px; border-top:1px solid var(--line-soft); }
.gl-page-btn{
  background:none; border:0; padding:4px 0; cursor:pointer; font-family:inherit; font-size:14px; font-weight:600;
  color:var(--orange-soft);
}
body.light-mode .gl-page-btn{ color:var(--orange-deep); }
.gl-page-btn:hover{ text-decoration:underline; }
.gl-count{ font-size:12px; color:var(--muted-dim); margin:2px 0 8px; }
/* every letter heading (A-Z and ก-ฮ) gets the same full-width orange rule */
.gl-letter{ font-family:'Chakra Petch',sans-serif; font-size:18px; font-weight:700; color:var(--orange); margin:26px 0 4px; padding-bottom:4px; border-bottom:2px solid var(--orange); scroll-margin-top:calc(var(--top-strip-h, 0px) + 16px); }
.gl-entry{ padding:10px 0 11px; border-top:1px solid var(--line-soft); }
.gl-letter + .gl-entry{ border-top:0; }
.gl-term{ font-size:15px; font-weight:700; }
.gl-th{ font-size:14px; color:var(--muted); margin-left:10px; font-weight:400; }
.gl-def{ font-size:13.5px; line-height:1.7; margin:3px 0 0; color:var(--text); opacity:0.92; }
.gl-subs{ margin:6px 0 0 18px; padding-left:14px; border-left:1px solid var(--line-soft-strong); display:grid; gap:7px; }
.gl-sub-term{ font-size:14px; font-weight:600; }
.gl-sub-term .gl-head-dim{ color:var(--muted-dim); font-weight:400; }
.gl-sub .gl-th{ font-size:13.5px; }
.gl-sub .gl-def{ font-size:13px; margin-top:1px; }
.gl-also{ font-size:12.5px; color:var(--muted-dim); margin-top:3px; }
mark.gl-hit{ background:rgba(242,166,90,0.28); color:inherit; border-radius:2px; padding:0 1px; }
.gl-loading, .gl-empty{ color:var(--muted); font-size:13.5px; padding:14px 0; }
/* terms that have a ดาราศาสตร์ทั่วไป article (js/18): the underlined name is
   the link to it */
.gl-term-link{
  background:none; border:0; padding:0; font-family:inherit; color:inherit; cursor:pointer; text-align:left;
  text-decoration:underline; text-decoration-color:rgba(242,166,90,0.5); text-underline-offset:3px;
}
.gl-term-link:hover{ color:var(--orange-soft); }
body.light-mode .gl-term-link:hover{ color:var(--orange-deep); }
/* the term an article linked to: a soft flash so the eye finds it */
.gl-focus{ animation:glFocus 2.4s ease; border-radius:6px; }
@keyframes glFocus{ 0%, 60%{ background:rgba(242,166,90,0.16); } 100%{ background:transparent; } }
@media (max-width:760px){
  .gl-th{ display:block; margin-left:0; margin-top:1px; }
  .gl-subs{ margin-left:6px; padding-left:12px; }
}
/* บทความแนะนำ first on the article list (18), then the full grid */
.ga-list-featured{ margin-top:18px; }
.ga-list-featured[hidden]{ display:none; }
.ga-list-featured .home-block-title{ margin:0 0 12px; }
.ga-list-featured .ga-list-all-title{ margin:26px 0 0; }
.ga-list-featured + .ga-grids{ margin-top:12px; }
/* a figure of several photos side by side (18 genFigureSetHtml): same
   width as a single photo, so each one is about half the size */
.ga-fig-row{ display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px; }
.ga-fig-item img{ display:block; width:100%; height:auto; border-radius:10px; background:#0a0f1e; }
.ga-fig-label{ display:block; margin-top:6px; font-size:12.5px; }
.ga-fig-note{ display:block; font-size:11.5px; line-height:1.5; color:var(--muted); }
.ga-fig-credit{ display:block; margin-top:2px; font-size:11px; line-height:1.5; color:var(--muted-dim); }
.ga-fig-credit a{ color:inherit; text-decoration:underline; text-underline-offset:2px; }
.ga-fig-set figcaption{ margin-top:8px; }
/* home sections fade and rise into place as they scroll into view
   (js/13 homeReveal); html.rv-on is set in <head>, never for reduced motion */
.rv-on .rv{
  opacity:0; transform:translateY(16px);
  transition:opacity .4s ease, transform .45s cubic-bezier(.2, .7, .2, 1);
  transition-delay:var(--rv-delay, 0ms);
}
.rv-on .rv.is-in{ opacity:1; transform:none; }
/* เริ่มต้นจากศูนย์: the card on the article list and its page (18) */
.ga-path-card{
  display:flex; align-items:center; gap:14px; width:100%; margin:22px 0 0; padding:14px 18px;
  background:var(--bg-card); border:1px solid var(--line-soft); border-radius:12px; cursor:pointer;
  font-family:inherit; color:var(--text); text-align:left; transition:border-color .2s ease, transform .15s ease;
}
.ga-path-card:hover{ border-color:var(--border-hover); transform:translateY(-1px); }
.ga-path-icon{ flex:none; width:40px; height:40px; padding:9px; border-radius:10px; background:rgba(111,214,207,0.14); color:var(--teal); }
.ga-path-icon svg{ width:100%; height:100%; }
.ga-path-text{ display:flex; flex-direction:column; gap:2px; min-width:0; flex:1; }
.ga-path-text b{ font-size:15px; }
.ga-path-text span{ font-size:13px; color:var(--muted); }
.ga-path-go{ font-size:20px; color:var(--muted); }
.gp-progress{ margin:-8px 0 26px; }
.gp-bar{ height:6px; border-radius:6px; background:var(--tint-weak); overflow:hidden; }
.gp-bar i{ display:block; height:100%; background:var(--teal); border-radius:6px; transition:width .4s ease; }
.gp-progress-row{ display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; margin-top:10px; font-size:13.5px; color:var(--muted); }
.gp-continue{ font-size:13.5px; }
.gp-stage{ margin-bottom:30px; }
.gp-stage-title{ font-size:18px; margin:0 0 2px; }
.gp-stage-title span{ color:var(--teal); margin-right:6px; }
.gp-stage-desc{ font-size:13.5px; color:var(--muted); margin:0 0 8px; }
.gp-item{
  display:flex; align-items:center; gap:14px; width:100%; padding:10px 4px; background:none; border:0;
  border-bottom:1px solid var(--line-soft); cursor:pointer; font-family:inherit; color:var(--text); text-align:left;
}
.gp-item:hover{ background:var(--tint-weak); }
.gp-num{ flex:none; width:26px; text-align:center; font-size:13px; font-weight:700; color:var(--muted); font-variant-numeric:tabular-nums; }
.gp-item.is-read .gp-num{ color:var(--teal); }
.gp-num svg{ width:18px; height:18px; vertical-align:middle; }
.gp-thumb{ flex:none; width:88px; aspect-ratio:16 / 9; border-radius:6px; overflow:hidden; background:var(--bg-panel-2); }
.gp-thumb img{ display:block; width:100%; height:100%; object-fit:cover; }
.gp-text{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.gp-text b{ font-size:14.5px; }
.gp-text span{ font-size:13px; color:var(--muted); line-height:1.55; }
.gp-item.is-read .gp-text b{ color:var(--muted); }
@media (max-width:600px){ .gp-thumb{ width:64px; } }
/* under an article that's on the path */
.gp-next{ clear:both; display:flex; align-items:center; gap:8px 16px; flex-wrap:wrap; margin:6px 0 24px; padding:12px 0; border-top:1px solid var(--line-soft); }
.gp-next-label{ font-size:12.5px; color:var(--teal); font-weight:600; flex-basis:100%; }
.gp-next-btn{ background:none; border:0; padding:0; cursor:pointer; font-family:inherit; font-size:14.5px; font-weight:600; color:var(--text); text-align:left; }
.gp-next-btn:hover{ color:var(--orange-soft); }
.gp-next-all{ font-size:13px; margin:0; padding:0; border:0; }
/* the path's last article read through the path: the reading ends here */
.gp-end{ clear:both; margin:6px 0 24px; padding:16px 0 4px; border-top:1px solid var(--line-soft); }
.gp-end-title{ font-size:19px; margin:6px 0 6px; }
.gp-end-text{ font-size:14px; color:var(--muted); line-height:1.7; margin:0 0 14px; }
.gp-end-actions{ display:flex; flex-wrap:wrap; gap:8px; }
.gp-end-actions .btn{ max-width:100%; white-space:normal; text-align:left; }.gp-thumb.is-empty{ background:radial-gradient(circle at 30% 35%, color-mix(in srgb, var(--c) 45%, transparent), transparent 75%), var(--bg-panel-2); }
/* ทดสอบความรู้ดาราศาสตร์ (js/22) */
.kq-tabs{ margin:6px 0 18px; }
.kq-root{ max-width:820px; }
.kq-h{ font-size:18px; margin:0 0 10px; }
.kq-p{ font-size:14.5px; line-height:1.8; color:var(--muted); margin:0 0 16px; }
.kq-levels-note{ display:flex; flex-wrap:wrap; align-items:center; gap:4px 8px; margin:0 0 20px; font-size:13px; color:var(--text); }
.kq-levels-note i{ font-style:normal; color:var(--muted-dim); }
.kq-start{ font-size:15px; padding:11px 22px; }
.kq-q-top{ display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; font-size:13px; color:var(--muted); }
.kq-bar{ margin:8px 0 20px; }
.kq-question{ font-size:19px; line-height:1.6; margin:0 0 16px; }
.kq-choices{ display:grid; gap:10px; }
.kq-choice{
  display:flex; align-items:center; gap:12px; width:100%; padding:13px 16px; cursor:pointer; text-align:left;
  background:var(--bg-card); border:1px solid var(--line-soft); border-radius:12px; color:var(--text);
  font-family:inherit; font-size:15px; line-height:1.55; transition:border-color .15s ease, background .15s ease;
}
.kq-choice:hover{ border-color:var(--border-hover); }
.kq-choice.is-on{ border-color:var(--teal); background:color-mix(in srgb, var(--teal) 12%, var(--bg-card)); }
.kq-key{ flex:none; width:26px; height:26px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:12.5px; font-weight:700; color:var(--muted); border:1px solid var(--line-soft-strong); }
.kq-choice.is-on .kq-key{ background:var(--teal); border-color:var(--teal); color:var(--bg-panel); }
.kq-nav{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:20px; }
.kq-nav [hidden]{ visibility:hidden; display:inline; }
.kq-answered{ font-size:13px; color:var(--muted); }
.kq-nav .btn:disabled{ opacity:.45; cursor:default; }
.kq-hint{ font-size:13px; color:var(--muted); margin-top:12px; text-align:right; }
.kq-hint .link-btn{ margin:0 0 0 6px; padding:0; border:0; font-size:13px; }
.kq-result-k{ margin:0; font-size:13px; color:var(--muted); }
.kq-result-level{ font-size:30px; margin:2px 0 6px; color:var(--teal); }
.kq-result-score{ font-size:15px; margin:0 0 16px; }
.kq-best{ margin-left:8px; font-size:12.5px; font-weight:700; color:var(--orange-soft); }
body.light-mode .kq-best{ color:var(--orange-deep); }
.kq-ladder{ margin:0 0 16px; }
.kq-ladder-track{ position:relative; display:flex; gap:3px; height:8px; }
.kq-ladder-track span{ background:var(--tint-weak); border-radius:4px; }
.kq-ladder-track span.is-on{ background:var(--teal); }
.kq-ladder-track i{ position:absolute; top:-4px; width:4px; height:16px; margin-left:-2px; border-radius:2px; background:var(--text); }
.kq-ladder-labels{ display:flex; gap:3px; margin-top:6px; font-size:11.5px; line-height:1.4; color:var(--muted-dim); }
.kq-ladder-labels span{ min-width:0; }
.kq-ladder-labels span.is-on{ color:var(--text); font-weight:700; }
@media (max-width:600px){ .kq-ladder-labels span:not(.is-on){ visibility:hidden; } .kq-ladder-labels span.is-on{ white-space:nowrap; } }
.kq-actions{ display:flex; align-items:center; gap:12px 20px; flex-wrap:wrap; margin-bottom:30px; }
.kq-actions .link-btn{ margin:0; }
.kq-review{ margin-bottom:34px; }
.kq-rev{ display:flex; gap:12px; padding:12px 0; border-bottom:1px solid var(--line-soft); }
.kq-rev-mark{ flex:none; width:22px; height:22px; margin-top:2px; }
.kq-rev.is-ok .kq-rev-mark{ color:var(--teal); }
.kq-rev.is-bad .kq-rev-mark{ color:#e06c75; }
body.light-mode .kq-rev.is-bad .kq-rev-mark{ color:#c0392b; }
.kq-rev-mark svg{ width:100%; height:100%; }
.kq-rev-body{ display:flex; flex-direction:column; gap:3px; min-width:0; }
.kq-rev-body b{ font-size:14.5px; line-height:1.6; }
.kq-rev-ans{ font-size:13.5px; color:var(--muted); }
.kq-rev-ans s{ text-decoration-thickness:1px; }
.kq-rev-ans.is-right{ color:var(--text); }
.kq-rev-why{ font-size:13.5px; line-height:1.7; color:var(--muted); }
.kq-rev-link{ align-self:flex-start; margin:2px 0 0; padding:0; border:0; font-size:13px; }
.kq-stats{ margin-top:8px; }
.kq-stats-head{ display:flex; justify-content:space-between; align-items:baseline; }
.kq-clear{ font-size:12.5px; margin:0; padding:0; border:0; color:var(--muted); }
.kq-tiles{ display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:10px; margin:6px 0 22px; }
.kq-tiles div{ display:flex; flex-direction:column; }
.kq-tiles b{ font-size:24px; line-height:1.2; }
.kq-tiles span{ font-size:12.5px; color:var(--muted); }
.kq-chart-title{ font-size:14px; margin:0 0 8px; color:var(--text); }
.kq-chart{ position:relative; margin-bottom:24px; }
.kq-chart svg{ display:block; width:100%; height:auto; overflow:visible; }
.kq-grid{ stroke:var(--line-soft); stroke-width:1; }
.kq-axis{ fill:var(--muted-dim); font-size:11px; font-family:inherit; }
.kq-line{ fill:none; stroke:var(--teal); stroke-width:2; stroke-linejoin:round; stroke-linecap:round; }
.kq-dot{ fill:var(--teal); stroke:var(--bg-panel); stroke-width:2; }
.kq-val{ fill:var(--text); font-size:12px; font-weight:700; font-family:inherit; }
.kq-hit{ fill:transparent; cursor:pointer; }
.kq-tip{
  position:absolute; top:0; transform:translate(-50%, -100%); z-index:3; pointer-events:none; white-space:nowrap;
  padding:8px 10px; border-radius:8px; background:var(--bg-panel); border:1px solid var(--line-soft-strong);
  font-size:12px; line-height:1.55; color:var(--text); box-shadow:0 6px 18px rgba(0,0,0,0.3);
}
.kq-bars{ display:grid; gap:8px; margin-bottom:10px; }
.kq-bar-row{ display:grid; grid-template-columns:minmax(0, 170px) minmax(0, 1fr) 92px; align-items:center; gap:12px; font-size:13px; }
.kq-bar-label{ color:var(--text); }
.kq-bar-track{ height:10px; border-radius:5px; background:var(--tint-weak); overflow:hidden; }
.kq-bar-track i{ display:block; height:100%; border-radius:0 4px 4px 0; background:var(--teal); }
.kq-bar-val{ color:var(--text); font-variant-numeric:tabular-nums; }
.kq-bar-val small{ color:var(--muted); font-size:11.5px; }
.kq-note{ font-size:12px; color:var(--muted-dim); margin:8px 0 0; }
@media (max-width:600px){
  .kq-question{ font-size:17px; }
  .kq-tiles{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
  .kq-bar-row{ grid-template-columns:minmax(0, 1fr) 80px; }
  .kq-bar-label{ grid-column:1 / -1; }
}

/* Thai words the browser would break mid-word (js/01a-thai-keep.js) */
t-nw{ white-space:nowrap; }

/* ---- แบบจำลองแรงโน้มถ่วง (sec-gravity, js/23-gravity.js) ------------------
   The stage is always a dark night sky (like the planetarium); the side
   panel and help follow the site theme. */
#sec-gravity .lede{ max-width:820px; }
.gv-loading{ color:var(--muted); font-size:14px; padding:20px 0; }
.gv-bar{ display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px; margin:0 0 12px; }
.gv-play{ display:inline-flex; align-items:center; gap:6px; min-width:132px; justify-content:center; }
.gv-play svg{ width:14px; height:14px; }
.gv-warp{ display:flex; align-items:center; gap:10px; font-size:13px; color:var(--muted); flex:1 1 320px; min-width:0; }
.gv-warp input{ flex:1; min-width:90px; accent-color:var(--orange); }
.gv-warp b{ color:var(--text); font-weight:600; white-space:nowrap; min-width:150px; }
.gv-main{ display:grid; grid-template-columns:minmax(0, 1fr) 340px; gap:16px; align-items:start; }
.gv-stage{ position:relative; height:clamp(380px, 68vh, 720px); border-radius:14px; overflow:hidden; background:#04060d; border:1px solid rgba(255,255,255,0.08); }
.gv-stage canvas{ display:block; width:100%; height:100%; touch-action:none; cursor:grab; }
.gv-stage canvas:active{ cursor:grabbing; }
.gv-stage canvas.is-create{ cursor:crosshair; }
.gv-hud{ position:absolute; top:10px; left:12px; max-width:62%; font-size:12.5px; line-height:1.6; color:rgba(226,232,246,0.92); text-shadow:0 1px 3px rgba(0,0,0,0.9); pointer-events:none; }
.gv-hud b{ font-weight:600; color:#fff; }
.gv-dim{ color:rgba(200,208,228,0.7); }
.gv-warn{ color:#ffb38a; }
.gv-events{ position:absolute; left:12px; right:12px; bottom:40px; font-size:12.5px; line-height:1.55; color:#ffe2b8; text-shadow:0 1px 3px rgba(0,0,0,0.95); pointer-events:none; }
.gv-events div{ margin-top:4px; }
.gv-tools{ position:absolute; top:10px; right:10px; display:flex; gap:6px; align-items:center; }
.gv-tool, .gv-icon{
  font-family:inherit; color:#e6e9f2; background:rgba(10,14,28,0.72); border:1px solid rgba(255,255,255,0.16);
  cursor:pointer; transition:border-color .15s ease, color .15s ease;
}
.gv-tool{ font-size:13px; padding:5px 12px; border-radius:8px; }
.gv-tool.active{ border-color:var(--orange); color:#ffd9a0; }
.gv-icon{ width:32px; height:32px; border-radius:50%; font-size:18px; line-height:1; display:inline-flex; align-items:center; justify-content:center; padding:0; }
.gv-icon svg{ width:16px; height:16px; }
.gv-tool:hover, .gv-icon:hover{ border-color:rgba(255,255,255,0.4); }
.gv-side{ background:var(--bg-panel); border:1px solid var(--line-soft); border-radius:14px; padding:0 14px 14px; max-height:clamp(380px, 68vh, 720px); overflow:auto; }
.gv-tabs{ padding-top:4px; display:flex; flex-wrap:wrap; gap:0 11px; border-bottom:1px solid var(--line-soft); margin-bottom:10px; position:sticky; top:0; background:var(--bg-panel); z-index:1; }
.gv-tab{ background:none; border:0; border-bottom:2px solid transparent; font-family:inherit; font-size:13px; color:var(--muted); padding:10px 0 8px; cursor:pointer; }
.gv-tab.active{ color:var(--text); font-weight:600; border-bottom-color:var(--orange); }
.gv-pane{ display:none; }
.gv-pane.active{ display:block; }
.gv-pane h4{ font-size:13.5px; margin:14px 0 6px; color:var(--teal); }
.gv-row{ display:grid; grid-template-columns:104px minmax(0, 1fr); gap:8px; align-items:center; margin:8px 0; font-size:13px; }
.gv-row > span{ color:var(--muted); }
.gv-in{ display:flex; gap:6px; align-items:center; min-width:0; }
.gv-in input{ flex:1; min-width:0; }
.gv-in em{ font-style:normal; font-size:12px; color:var(--muted); white-space:nowrap; }
.gv-in2 input{ width:50%; }
.gv-in3 input{ width:33.3%; }
.gv input[type=text], .gv input[type=number], .gv select{
  font-family:inherit; font-size:13px; color:var(--text); background-color:var(--bg-panel-2);
  border:1px solid var(--line-soft-strong); border-radius:8px; padding:6px 8px; min-width:0;
}
.gv select{
  appearance:none; -webkit-appearance:none; padding-right:26px; cursor:pointer; max-width:100%;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa3bd' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 8px center; background-size:13px;
}
.gv input:disabled{ opacity:0.55; }
.gv input[type=color]{ width:44px; height:30px; padding:0; border:0; background:none; cursor:pointer; }
.gv-check{ display:flex; align-items:flex-start; gap:8px; font-size:13px; margin:7px 0; cursor:pointer; line-height:1.5; }
.gv-check input{ margin-top:3px; accent-color:var(--orange); }
.gv-derived, .gv-hint{ font-size:12.5px; color:var(--muted); line-height:1.65; margin:8px 0; }
.gv-warn-text{ font-size:12.5px; color:#e98a5a; line-height:1.6; margin:6px 0; }
body.light-mode .gv-warn-text{ color:#c0582c; }
.gv-actions{ display:flex; flex-wrap:wrap; gap:6px; margin:10px 0; }
.gv-danger{ color:#e98a5a !important; }
.gv-file{ cursor:pointer; }
.gv-info{ font-size:13px; }
.gv-info > div{ display:flex; justify-content:space-between; gap:12px; padding:4px 0; border-bottom:1px solid var(--line-soft); }
.gv-info > div span{ color:var(--muted); }
.gv-info > div b{ font-weight:600; text-align:right; }
.gv-scenes{ display:flex; flex-direction:column; }
.gv-scene-btn{ display:flex; flex-direction:column; gap:2px; text-align:left; background:none; border:0; border-bottom:1px solid var(--line-soft); padding:9px 4px; cursor:pointer; font-family:inherit; color:var(--text); border-radius:6px; }
.gv-scene-btn:hover{ background:var(--tint-weak); }
.gv-scene-btn b{ font-size:13.5px; }
.gv-scene-btn span{ font-size:12px; color:var(--muted); line-height:1.55; display:none; }
.gv-scene-btn.active b{ color:var(--orange-soft); }
.gv-scene-btn.active span{ display:block; }
.gv-pane h4 .gv-dim{ font-weight:400; font-size:12px; color:var(--muted); }
.gv-mis-status{ font-size:13px; color:var(--orange-soft); line-height:1.6; margin:8px 0 4px; }
body.light-mode .gv-mis-status{ color:var(--orange-deep); }
body.light-mode .gv-scene-btn.active b{ color:var(--orange-deep); }
.gv-save{ display:flex; align-items:center; gap:10px; padding:6px 0; border-bottom:1px solid var(--line-soft); font-size:13px; }
.gv-save > span{ flex:1; min-width:0; display:flex; flex-direction:column; }
.gv-save em{ font-style:normal; font-size:11.5px; color:var(--muted); }
.gv-save .link-btn{ font-size:12.5px; margin:0; }
.gv-help{ margin-top:26px; max-width:900px; }
.gv-help h3{ font-size:16px; margin:18px 0 8px; }
.gv-help li{ font-size:14px; line-height:1.75; margin:4px 0; }
@media (max-width:980px){
  .gv-main{ grid-template-columns:1fr; }
  .gv-side{ max-height:none; }
}
@media (max-width:640px){
  .gv-stage{ height:62vh; border-radius:12px; }
  .gv-hud{ font-size:11.5px; max-width:100%; right:12px; top:52px; }
  .gv-warp b{ min-width:0; }
}
.gv-reset{ display:inline-flex; align-items:center; gap:6px; }
.gv-reset svg{ width:14px; height:14px; }
.gv-unfollow{ position:absolute; right:10px; bottom:10px; z-index:1; }

/* ---- calendar events: the planetarium link, timeline popover (13/14) ---- */
.cal-sky-btn{
  display:inline-block; margin-top:4px; padding:0; border:0; background:none; cursor:pointer;
  font-family:inherit; font-size:12.5px; color:var(--blue); text-align:left;
}
.cal-sky-btn:hover{ text-decoration:underline; }
.ev-pop{
  position:fixed; z-index:300; width:min(320px, calc(100vw - 16px)); padding:12px 14px;
  display:flex; flex-direction:column; gap:4px;
  background:var(--bg-panel); border:1px solid var(--line-soft-strong); border-radius:12px;
  box-shadow:0 14px 34px rgba(0,0,0,0.38); color:var(--text);
}
body.light-mode .ev-pop{ box-shadow:0 14px 30px rgba(20,20,40,0.14); }
.ev-pop b{ font-size:14px; line-height:1.45; }
.ev-pop-when{ font-size:12.5px; color:var(--muted); }
.ev-pop-detail{ font-size:12.5px; color:var(--muted); line-height:1.6; }
.ev-pop-btns{ display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }

/* ---- an event shown in the planetarium (03c) ------------------------------ */
.skyev-hud{
  position:fixed; left:50%; bottom:18px; transform:translateX(-50%); z-index:45;
  width:min(440px, calc(100vw - 24px)); padding:12px 14px 12px;
  background:var(--sky-popup-bg); border:1px solid var(--sky-popup-border); border-radius:12px;
  box-shadow:0 12px 30px rgba(0,0,0,0.5); color:var(--sky-text);
}
.skyev-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.skyev-head b{ font-size:14.5px; line-height:1.4; color:var(--sky-accent-soft); }
.skyev-close{ background:none; border:0; color:var(--sky-text-muted); font-size:20px; line-height:1; cursor:pointer; padding:0 2px; }
.skyev-close:hover{ color:var(--sky-text); }
.skyev-time{ font-size:12.5px; color:var(--sky-text-muted); margin-top:2px; }
.skyev-status{ font-size:13px; margin-top:6px; line-height:1.55; min-height:20px; }
.skyev-scrub{ width:100%; margin:8px 0 2px; accent-color:var(--sky-accent); }
.skyev-ctrls{ display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-top:8px; }
.skyev-ctrls .skyview-btn.active{ background:var(--sky-accent-active-bg); border-color:var(--sky-accent-active-border); }
.skyev-check{ display:inline-flex; align-items:center; gap:5px; font-size:12.5px; color:var(--sky-text-muted); cursor:pointer; margin-left:4px; }
.skyev-note{ font-size:12px; color:var(--sky-text-muted); margin-top:8px; line-height:1.6; }
@media (max-width:600px){ .skyev-hud{ bottom:10px; padding:10px 12px; } }

/* ---- planetarium: what differs from the default sky (03) ---- */
.skyview-default-note{
  position:absolute; left:14px; bottom:12px; z-index:3; max-width:min(52%, 560px); pointer-events:none;
  white-space:pre-line; font-size:11.5px; line-height:1.6; color:rgba(225,232,248,0.5); text-shadow:0 1px 2px rgba(0,0,0,0.7);
}
.skyview-default-note:empty{ display:none; }
/* beside the event panel, which sits bottom centre */
#sec-skyview:has(.skyev-hud) .skyview-default-note{ max-width:calc(50% - 250px); }
/* on narrow screens the panel takes the whole bottom */
@media (max-width:900px){
  .skyview-default-note{ max-width:calc(100% - 28px); font-size:11px; }
  #sec-skyview:has(.skyev-hud) .skyview-default-note{ display:none; }
}

/* ---- eclipse maps (js/14b) ---- */
.ecm-back{ z-index:300; overflow-y:auto; align-items:flex-start; }
.ecm-modal{ max-width:760px; padding:20px 22px; margin:auto; }
.ecm-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:4px; }
.ecm-head h4{ margin:0; }
.ecm-close{ flex:none; width:30px; height:30px; border-radius:50%; cursor:pointer; font-size:18px; line-height:1; background:none; border:1px solid var(--line-strong); color:var(--text); }
.ecm-close:hover{ border-color:var(--orange); }
.ecm-modal .ecm-sum{ margin:0 0 12px; font-size:13.5px; line-height:1.7; }
.ecm-map{ position:relative; border-radius:10px; overflow:hidden; background:#070c18; }
.ecm-map:has(.ecm-wait){ min-height:200px; }
.ecm-map canvas{ display:block; width:100%; height:auto; }
.ecm-map.solar{ max-width:560px; margin:0 auto; }
.ecm-wait{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-size:14px; color:#c8d2e6; }
.ecm-legend{ list-style:none; margin:12px 0 0; display:grid; gap:6px; font-size:13px; color:var(--muted); line-height:1.5; }
.ecm-legend li{ display:flex; gap:9px; align-items:baseline; }
.ecm-legend i{ flex:none; width:11px; height:11px; border-radius:3px; }
.ecm-modal .ecm-note{ margin:12px 0 0; font-size:12px; line-height:1.6; color:var(--muted-dim); }
.ct-fig img.ecm-fig{ display:block; width:100%; max-width:560px; height:auto; margin:0 auto; border-radius:10px; }

/* the calendar's event buttons: a row of their own under the details */
.cal-item .cal-sky-btn{ display:inline-block; margin:6px 16px 0 0; }
.cal-item .cal-item-detail{ display:block; }

/* Milky Way brightness flyout (03) */
.skyview-mw-menu label{ display:flex; justify-content:space-between; gap:8px; margin-bottom:8px; font-size:13px; color:var(--sky-text); }
.skyview-mw-menu input[type=range]{ width:100%; display:block; }
.skyview-grid-swatch{ display:inline-block; width:14px; height:3px; border-radius:2px; margin-right:7px; vertical-align:middle; }
.skyview-menu-sep{ height:1px; margin:6px 0; background:var(--sky-popup-border); }
.skyview-filter-mode{ display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.skyview-opt-row-btns-inline .skyview-submenu-toggle{ gap:6px; padding-left:10px; padding-right:10px; min-width:0; white-space:nowrap; }
.skyview-opt-row-btns-inline .skyview-submenu-toggle > span:first-child{ overflow:hidden; text-overflow:ellipsis; }
.skyview-opt-row-btns .skyview-check-row input{ margin-right:7px; }
.hub-more-item{ text-align:left; }
/* phone: the two tutor prices share a line */
@media (max-width:860px){
  .tutor-price-rows{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
  .tutor-price-rows .tutor-price-row{ margin-bottom:0; }
  .tutor-price-row b{ font-size:21px; }
}
.tutor-actions a.btn{ display:inline-block; text-decoration:none; }
/* สอวน. timeline, narrow: the desktop strip stood upright, June at the top */
.home-timeline-brace-v{ display:none; }
@container (max-width:779px){
  .home-timeline-track{
    --inset:14px; --axis:56px; height:610px; padding:0; border:1px solid var(--line-soft); border-radius:12px;
    background:rgba(10,16,34,0.35); overflow:hidden;
  }
  body.light-mode .home-timeline-track{ background:rgba(255,255,255,0.6); }
  .home-timeline-track::before{ display:none; }
  .home-timeline-axis{ display:block; position:absolute; left:var(--axis); top:var(--inset); bottom:var(--inset); width:1px; background:rgba(200,208,230,0.32); }
  body.light-mode .home-timeline-axis{ background:rgba(20,20,30,0.25); }
  .home-timeline-tick{
    position:absolute; left:calc(-1 * var(--axis)); top:calc(100% * var(--x)); width:900px; padding:3px 0 0 10px;
    border-top:1px solid rgba(200,208,230,0.1); font-size:11.5px; line-height:1.2; color:var(--muted); white-space:nowrap;
  }
  .home-timeline-tick.is-year{ border-top-color:rgba(200,208,230,0.34); color:var(--text); font-weight:600; }
  .home-timeline-brace{ display:none; }
  .home-timeline-brace-v{ display:block; position:absolute; left:2px; top:calc(100% * var(--x)); height:calc(100% * var(--w)); width:13px; overflow:visible; }
  .home-timeline-brace-v path{ fill:none; stroke:currentColor; stroke-width:1.6; vector-effect:non-scaling-stroke; }
  .home-timeline-item, .home-timeline-item:last-child{
    position:absolute; left:calc(var(--axis) + 26px); right:8px; top:calc(var(--inset) + (100% - 2 * var(--inset)) * var(--x));
    transform:translateY(-50%); padding:0;
  }
  .home-timeline-item::before{
    left:-31px; top:50%; width:10px; height:10px; margin-top:-5px;
    box-shadow:0 0 0 3px color-mix(in srgb, var(--dot-clr, var(--orange)) 22%, transparent);
  }
  .home-timeline-item.is-range::before{ display:none; }
  .home-timeline-item::after{ content:''; position:absolute; left:-26px; width:22px; top:50%; border-top:1.5px solid var(--dot-clr, var(--orange)); opacity:0.55; }
  .home-timeline-item.is-range::after{ left:-11px; width:7px; }
  .home-timeline-period{ font-size:12px; margin-bottom:0; }
  .home-timeline-label{ font-size:14px; line-height:1.3; }
}
/* phone fixes: planetarium panels under the top bar, home cards */
.sky-credit-short{ display:none; }
.skyview-corner-logo{ display:none; }
.skyview-star-info{ top:calc(var(--sky-bar-h, 60px) + 10px); max-height:calc(100vh - var(--sky-bar-h, 60px) - 26px); }
@media (max-width:760px){
  #skyviewTimePanel{ width:calc(100vw - 20px); max-width:340px; }
  .sky-credit-full{ display:none; }
  .sky-credit-short{ display:inline; }
  .skyview-mw-credit{ font-size:9px; max-width:calc(100% - 20px); white-space:nowrap; }
  .skyview-corner-logo{
    display:block; position:fixed; left:12px; top:calc(var(--sky-bar-h, 58px) + 8px); z-index:1;
    height:22px; width:auto; opacity:0.38; pointer-events:none;
  }
  .skyview-default-note{ bottom:24px; }
  .home-nav-card .hnc-desc{ display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:3; overflow:hidden; }
}
/* beta notice: a strip under the top bar. --top-strip-h (which the sidebar,
   page padding and overlays all offset by) covers bar + notice; delete the
   strip from the HTML and set --beta-h to 0px to take it away again */
:root{ --top-bar-h:60px; --beta-h:28px; --top-strip-h:calc(var(--top-bar-h) + var(--beta-h)); }
.top-strip{ height:var(--top-bar-h); }
.beta-strip{
  position:fixed; top:var(--top-bar-h); left:0; right:0; z-index:79; height:var(--beta-h);
  display:flex; align-items:center; justify-content:center; padding:0 16px; box-sizing:border-box;
  font-size:12.5px; line-height:1.35; text-align:center; color:var(--orange-soft);
  background:linear-gradient(rgba(242,166,90,0.10), rgba(242,166,90,0.10)), #0d1528;
  border-bottom:1px solid var(--line-soft);
}
.beta-keep{ white-space:nowrap; }
.beta-close{
  display:inline-flex; align-items:center; justify-content:center; vertical-align:middle;
  width:28px; height:24px; margin-left:8px; padding:0; border:0; background:none;
  color:inherit; cursor:pointer; opacity:0.85;
}
.beta-close:hover{ opacity:1; }
.beta-close svg{ width:17px; height:17px; }
/* closed for this visit only: nothing is stored, so it is back next time */
html.beta-closed{ --beta-h:0px; }
html.beta-closed .beta-strip{ display:none; }
body.light-mode .beta-strip{ background:#fff4e6; color:#9a5a14; }
@media (max-width:760px){
  :root{ --beta-h:40px; }
  .beta-strip{ font-size:11.5px; padding:0 12px; }
}
/* "ลองคิดดู" practice set at the end of an article */
.ga-q{ margin:0 0 22px; }
.ga-q-text{ margin:0 0 10px; font-size:15px; line-height:1.75; }
.ga-q-text b{ color:var(--orange-soft); margin-right:8px; }
body.light-mode .ga-q-text b{ color:var(--orange-deep); }
.ga-q-choices{ display:flex; flex-direction:column; gap:8px; }
.ga-q-choice{
  text-align:left; font:inherit; font-size:14.5px; line-height:1.6; color:var(--text);
  background:var(--bg-card); border:1px solid var(--line-soft); border-radius:10px; padding:10px 14px;
  cursor:pointer; transition:border-color .15s ease;
}
.ga-q-choice:hover:not(:disabled){ border-color:var(--border-hover); }
.ga-q-choice:disabled{ cursor:default; }
.ga-q-choice.right{ border-color:var(--green-ok); background:rgba(127,216,160,0.12); }
.ga-q-choice.wrong{ border-color:var(--error-text); background:rgba(228,106,106,0.12); }
.ga-q-letter{ color:var(--muted); margin-right:2px; }
.ga-q-why{ margin:10px 0 0; font-size:14px; line-height:1.75; color:var(--muted); }
.ga-q-why b{ color:var(--text); margin-right:8px; }
