/* ============================================================================
   shell.css — the shared design language.

   Same vocabulary as Classical Mind and Classical Architecture: warm cream
   ground with soft sunbursts, a coloured app bar, system sans at heavy weights
   with tight letter-spacing, gradient-outline tiles, and the "For today" feed
   of tap-to-open cards. Hero Tales takes the bronze/gold accent rather than
   Classical Architecture's sky blue.

   Loaded BEFORE style.css on every page. Page-specific rules live there.
   ========================================================================= */

:root {
  /* ---------------------------------------------------------------------
     These tokens are byte-identical to Classical Mind and Classical
     Architecture. Do not drift them — the three apps are meant to read as
     one family. Anything peculiar to Hero Tales goes in the block below.
     --------------------------------------------------------------------- */
  --ink: #2A2038;
  --ink-soft: #5C4B6B;
  --ink-mute: #7A6D85;
  --paper: #FAF6EC;
  --paper-warm: #FFF6D9;
  --paper-card: #FFFFFF;
  --paper-surface: #FFFBF0;
  --rule: #F0E5C8;
  --rule-soft: #F6EED4;
  --rule-strong: #E6D6A8;

  --sun: #FFD64A;
  --sun-hot: #FF9F3D;
  --pink: #FF5E8E;
  --sky: #4A9ED4;
  --sky-soft: #6CB4E2;
  --mint: #4CCB9F;

  --sky-deep: #2D6FA8;
  --sun-deep: #C97D2A;
  --leaf: #4CCB9F;
  --leaf-soft: #D5F4E6;
  --rose: #FF5E8E;
  --rose-soft: #FFE0EB;
  --sky-soft-bg: #E0F0FA;
  --sun-soft: #FFF6D9;

  --grad-warm: linear-gradient(135deg, #FFD64A 0%, #FF9F3D 50%, #FF5E8E 100%);
  --grad-sun: linear-gradient(135deg, #FFD64A 0%, #FF9F3D 100%);
  --grad-sky: linear-gradient(135deg, #6CB4E2 0%, #4A9ED4 100%);
  --grad-fresh: linear-gradient(135deg, #FFD64A 0%, #4CCB9F 100%);
  --grad-pink: linear-gradient(135deg, #FF9F3D 0%, #FF5E8E 100%);

  --serif: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Helvetica, Arial, sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Helvetica, Arial, sans-serif;

  --shadow-sm: 0 1px 2px rgba(40, 30, 20, 0.05), 0 4px 12px rgba(40, 30, 20, 0.06);
  --shadow-md: 0 2px 4px rgba(40, 30, 20, 0.06), 0 10px 28px rgba(40, 30, 20, 0.10);
  --shadow-lg: 0 4px 12px rgba(40, 30, 20, 0.10), 0 24px 60px rgba(40, 30, 20, 0.14);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  /* ---- The app bar, same as the siblings: sky blue with gold accents ---- */
  --gold: #E7A83C;
  --gold-deep: #C6811A;
  --gold-dark: #8A5A0F;
  --grad-gold: linear-gradient(135deg, #E7A83C, #C6811A);
  --grad-sky-app: linear-gradient(135deg, #5FB1DD, #3F8FCB);
  --grad-app: var(--grad-sky-app);

  /* ---- Hero Tales only: one colour pair per shelf ---- */
  --shelf-hero-c: #B4560F;   --shelf-hero-cd: #7A360A;
  --shelf-fable-c: #65A30D;  --shelf-fable-cd: #3F6B08;
  --shelf-feat-c: #2F9E77;   --shelf-feat-cd: #1F6B52;
  --shelf-stand-c: #8C2F39;  --shelf-stand-cd: #5E1F26;
  --shelf-ledger-c: #4F5560; --shelf-ledger-cd: #2B3038;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(900px 500px at -10% -20%, rgba(255, 214, 74, 0.22), transparent 60%),
    radial-gradient(900px 500px at 110% -10%, rgba(255, 94, 142, 0.16), transparent 60%),
    var(--paper);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

/* ------------------------------------------------- Top bar (v29, family) */
/* The Classical family bar (reference: his-own-words v40). No coloured slab:
   the bar is the page itself, transparent at the top, so round buttons sit
   straight on the paper. Once you scroll, a solid paper strip fades in
   (.is-scrolled; no blur since v32). On inner pages the title only fades in after ~110px
   (.show-title) — the page's own heading already says it. Home has no icon
   and no name: dark mode on the left, ? and Get app on the right.
   Built by renderAppbar() in shell.js. Still 56px tall. */
body { --bar-glass: #FAF6EC; --bar-line: rgba(60, 45, 20, .10); --bar-btn: var(--gold-deep); }
.appbar {
  /* Sticks BELOW the status-bar strip (style.css), not behind the clock. */
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40;
  background: transparent;
  transition: background-color .25s ease, box-shadow .25s ease;
}
/* v32: a SOLID strip on scroll, no blur — the frosted glass looked out of focus. */
.appbar.is-scrolled { background: var(--bar-glass); box-shadow: 0 1px 0 var(--bar-line); }
.appbar .row {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px;
  height: 56px; max-width: 820px; margin: 0 auto; padding: 0 16px;
}
.appbar .brand {
  justify-self: center; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 800 16.5px/1.1 var(--sans); letter-spacing: -.015em; color: var(--ink);
  opacity: 0; transform: translateY(5px);
  transition: opacity .22s ease, transform .3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.appbar.show-title .brand { opacity: 1; transform: none; }

/* v32: equal side columns, so the search bar sits dead centre on the screen. */
.appbar-home .row { grid-template-columns: 84px minmax(0, 1fr) 84px; gap: 8px; }
.appbar-home .ab-tools { grid-column: 3; }

/* ---- Search bar (v32, from his-own-words v42): the app's name, faint ---- */
.ab-search {
  position: relative; justify-self: stretch; display: flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; min-width: 0; padding: 0 10px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--paper-card); color: var(--ink-mute);
  font: 600 13.5px/1 var(--sans); letter-spacing: -.015em;
  box-shadow: 0 1px 2px rgba(60, 45, 20, .08), 0 3px 10px rgba(60, 45, 20, .08);
  -webkit-tap-highlight-color: transparent; transition: transform .25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ab-search::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: linear-gradient(135deg, #F2C35E, #E07A4F 60%, #B05FD0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.ab-search:active { transform: scale(.96); }
.ab-search svg { width: 15px; height: 15px; flex: 0 0 auto; color: var(--bar-btn); }
.ab-search span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Search screen (v32) ---- */
body.srch-on { overflow: hidden; }
.srch {
  position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; background: var(--paper);
  padding-top: env(safe-area-inset-top, 0px); animation: srch-in .22s ease;
}
@keyframes srch-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.srch-top { display: flex; align-items: center; gap: 10px; max-width: 820px; width: 100%; margin: 0 auto; padding: 9px 16px; }
.srch-field {
  position: relative; flex: 1; display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: 999px;
  background: var(--paper-card); color: var(--bar-btn); box-shadow: 0 1px 2px rgba(60, 45, 20, .08), 0 3px 10px rgba(60, 45, 20, .08);
}
.srch-field::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: linear-gradient(135deg, #F2C35E, #E07A4F 60%, #B05FD0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.srch-field svg { width: 17px; height: 17px; flex: 0 0 auto; }
.srch-field input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink);
  font: 600 16px/1.2 var(--sans); -webkit-appearance: none; appearance: none; padding: 0; box-shadow: none;
}
.srch-field input::placeholder { color: var(--ink-mute); font-weight: 500; }
.srch-field input::-webkit-search-cancel-button { -webkit-appearance: none; }
.srch-cancel { border: 0; background: none; padding: 8px 2px; cursor: pointer; color: var(--bar-btn); font: 700 15px/1 var(--sans); }
.srch-out {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  max-width: 820px; width: 100%; margin: 0 auto; padding: 6px 16px calc(40px + env(safe-area-inset-bottom, 0px));
}
.srch-grp { margin: 10px 0 18px; }
.srch-grp h3 { margin: 0 0 8px; font: 800 12px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-mute); }
.srch-grp h3 small { font-size: inherit; color: var(--bar-btn); margin-left: 4px; }
.srch-go, .srch-hit {
  display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; margin: 0 0 8px; border-radius: 14px; border: 0;
  text-decoration: none; color: var(--ink); background: var(--paper-card); box-shadow: 0 1px 2px rgba(60, 45, 20, .06), 0 4px 12px rgba(60, 45, 20, .06);
}
/* The global `a` rules in style.css colour and underline links on hover. */
.srch-go:hover, .srch-hit:hover { border: 0; color: var(--ink); text-decoration: none; }
.srch-go b { font: 800 15.5px/1.2 var(--sans); }
.srch-go span { font-size: 13px; color: var(--ink-mute); }
.srch-ref { font: 800 11.5px/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--bar-btn); }
.srch-txt { font: 400 16px/1.45 Georgia, "Iowan Old Style", serif; }
.srch-txt mark { background: rgba(242, 195, 94, .45); color: inherit; border-radius: 3px; padding: 0 1px; }
.srch-list .extra { display: none; }
.srch-list.all .extra { display: flex; }
.srch-more { width: 100%; border: 0; padding: 11px; border-radius: 999px; cursor: pointer; background: var(--sun-soft); color: var(--bar-btn); font: 800 14px/1 var(--sans); }
.srch-note { margin: 18px 4px; font-size: 14.5px; line-height: 1.5; color: var(--ink-mute); }
.ab-tools { display: flex; gap: 8px; justify-self: end; }
.ab-help { font: 800 17px/1 var(--sans); }
.ab-help .td-dot { top: -1px; right: -1px; }

/* Round buttons: 38px, card fill, 1.5px gradient ring, icon in the accent. */
.ab-btn {
  position: relative; width: 38px; height: 38px; padding: 0; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  color: var(--bar-btn); background: var(--paper-card); border: 0 !important; text-decoration: none;
  box-shadow: 0 1px 2px rgba(60, 45, 20, .08), 0 3px 10px rgba(60, 45, 20, .08);
  -webkit-tap-highlight-color: transparent;
  transition: transform .25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ab-btn::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: linear-gradient(135deg, #F2C35E, #E07A4F 60%, #B05FD0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
/* The global `a` rules in style.css colour and underline links on hover. */
.ab-btn:hover, .ab-btn:focus { color: var(--bar-btn); text-decoration: none; }
.ab-btn:active { transform: scale(.88); }
.ab-btn:focus-visible { outline: 2px solid var(--bar-btn); outline-offset: 3px; }
.ab-btn svg { width: 19px; height: 19px; display: block; }
.appbar .row > .ab-btn:first-child { justify-self: start; }
.appbar .row > .ab-btn:last-child { justify-self: end; }
/* Theme button: the moon in light mode, the sun in dark mode */
.ab-theme .i-sun { display: none; }
[data-theme="dark"] .ab-theme .i-sun { display: block; }
[data-theme="dark"] .ab-theme .i-moon { display: none; }
.ab-theme svg { transition: transform .45s cubic-bezier(0.34, 1.56, 0.64, 1); }
.ab-theme:active svg { transform: rotate(-40deg); }
/* Home: the date + Today sit straight under the buttons. */
.appbar-home + .shell-main { padding-top: 4px; }

/* ------------------------------------------------------------------ Shell */

.shell-main {
  max-width: 820px;
  margin: 0 auto;
  padding: 18px 16px 40px;
}

.ht-hero { margin: 6px 0 20px; }
.ht-hero h1 {
  font-weight: 800;
  font-size: clamp(26px, 6.5vw, 36px);
  letter-spacing: -.03em;
  line-height: 1.05;
  margin: 0;
  color: var(--ink);
}
.ht-hero p {
  margin: .5em 0 0;
  font-size: 16px; line-height: 1.5;
  color: var(--ink-mute);
  max-width: 54ch;
}

.shell-footer {
  max-width: 820px;
  margin: 0 auto;
  padding: 8px 20px calc(34px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  font-size: 13.5px; line-height: 1.6;
  color: var(--ink-mute);
}
.shell-footer a { color: inherit; opacity: .75; }

/* ------------------------------------------------------- "New here?" panel */

.welcome {
  margin: 0 0 20px;
  border-radius: 15px; overflow: hidden;
  background: linear-gradient(135deg, #FFF6E2, #FDEFCF);
  border: 1.5px solid #F0DCA8;
}
.welcome[open] {
  background: var(--paper-card); border-color: var(--rule);
  box-shadow: var(--shadow-md);
}
.welcome-sum {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  color: var(--gold-dark);
}
.welcome-sum::-webkit-details-marker { display: none; }
.welcome[open] .welcome-sum { color: var(--ink); border-bottom: 1px solid var(--rule); }
.wl-badge { font-size: 19px; line-height: 1; }
.wl-sumtxt { flex: 1; font: 600 14px/1.35 var(--sans); }
.wl-sumtxt b { font-weight: 800; }
.wl-chev { transition: transform .2s; opacity: .6; }
.welcome[open] .wl-chev { transform: rotate(180deg); }
.welcome-body { padding: 14px 15px 16px; font-size: 15px; line-height: 1.55; color: var(--ink-soft); }
.welcome-body p { margin: 0 0 .7em; }
.welcome-body p:last-child { margin-bottom: 0; }
.welcome-body b { color: var(--ink); }

/* ------------------------------------------------------- "For today" feed */

.today-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 0 12px;
}
.daily-lead {
  font-weight: 800; font-size: 1.22em; letter-spacing: -.02em;
  color: var(--ink);
}
.today-shuffle {
  cursor: pointer;
  font: 800 .8em var(--sans);
  color: var(--gold-deep);
  background: var(--paper-card);
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-pill);
  display: inline-flex; gap: .45em; align-items: center;
  padding: .5em .95em;
  box-shadow: 0 2px 4px rgba(60, 45, 20, .06);
  transition: transform .15s ease, border-color .15s ease;
}
.today-shuffle:hover { border-color: var(--gold); }
.today-shuffle:active { transform: scale(.95); }

.today-list { display: flex; flex-direction: column; gap: .7em; margin-bottom: 30px; }

.today-bar {
  position: relative;
  display: flex; align-items: stretch; width: 100%;
  border: none; padding: 0; cursor: pointer; text-align: left;
  background: var(--paper-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  font-family: var(--sans);
  transition: transform .15s cubic-bezier(.34, 1.56, .64, 1), box-shadow .15s ease;
}
.today-bar::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 5px; z-index: 3;
  background: linear-gradient(180deg, var(--tc), var(--tcd));
}
.today-bar:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(60, 45, 20, .13); }
.today-bar:active { transform: scale(.99); }
.today-bar .tb-text {
  flex: 1; min-width: 0;
  padding: .85em 1em .85em 1.2em;
  display: flex; flex-direction: column; justify-content: center; gap: .22em;
}
.today-bar .tb-kicker {
  font: 800 .64rem/1 var(--sans);
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--tcd);
  display: inline-flex; gap: .4em; align-items: center;
}
.today-bar .tb-title {
  font-weight: 800; font-size: 1.05em; letter-spacing: -.01em;
  color: var(--ink); line-height: 1.18;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.today-bar .tb-teaser {
  font-size: .88em; color: var(--ink-mute); line-height: 1.34;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.today-bar .tb-photo {
  flex: none; width: 92px; align-self: stretch;
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, var(--tc), var(--tcd));
}
.today-bar .tb-glyph {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 2rem; color: #fff; z-index: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .3));
}
/* Real photo over the gradient+glyph; removes itself on 404 to reveal the glyph. */
.today-bar .tb-photo img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; z-index: 1;
}

/* ------------------------------------------------------------ Daily modal */

.ht-modal-overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(30, 22, 15, .55);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  /* v31: room all round, so a tap outside the card closes it */
  padding: max(64px, calc(env(safe-area-inset-top) + 40px)) 32px
           max(64px, calc(env(safe-area-inset-bottom) + 40px));
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
}
.ht-modal-overlay.open { opacity: 1; pointer-events: auto; }
.ht-modal {
  position: relative;
  width: 100%; max-width: 460px; max-height: 100%;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--paper-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .38);
  transform: scale(.9); opacity: 0;
  transition: transform .26s cubic-bezier(.34, 1.56, .64, 1), opacity .18s ease;
}
.ht-modal-overlay.open .ht-modal { transform: scale(1); opacity: 1; }
.ht-mhead {
  padding: 22px 22px 16px;
  color: #fff;
  background: linear-gradient(140deg, var(--mc, #C6811A), var(--mcd, #8A5A0F));
}
.ht-mkicker {
  display: inline-flex; align-items: center; gap: .5em;
  font: 800 11px/1 var(--sans);
  letter-spacing: .1em; text-transform: uppercase; opacity: .95;
}
.ht-mtitle {
  margin: .5em 0 0;
  font-weight: 800; font-size: clamp(22px, 5.5vw, 28px);
  letter-spacing: -.02em; line-height: 1.12;
}
.ht-mbody { padding: 20px 22px 26px; color: var(--ink-soft); font-size: 16px; line-height: 1.6; }
.ht-mbody p { margin: 0 0 .9em; }
.ht-mbody p:last-child { margin-bottom: 0; }
.ht-quote { font-size: 1.28em; font-weight: 600; line-height: 1.4; color: var(--ink); }
.ht-verse { white-space: pre-wrap; font-size: 1.05em; line-height: 1.55; color: var(--ink); }
.ht-source { margin-top: .4em; font-weight: 700; color: var(--mcd, #8A5A0F); }
.ht-note {
  margin-top: 1em; padding-top: .9em;
  border-top: 1px solid var(--rule);
  font-size: .92em; color: var(--ink-mute); font-style: italic;
}
.ht-word-line { display: flex; gap: .6em; margin: 0 0 .55em; font-size: .98em; }
.ht-word-line b { flex: none; width: 6.5em; color: var(--mcd, #8A5A0F); }
.ht-morelink {
  display: inline-block; margin-top: 1.1em;
  font: 800 14px var(--sans); color: #fff;
  background: linear-gradient(140deg, var(--mc, #C6811A), var(--mcd, #8A5A0F));
  padding: .6em 1.15em; border-radius: var(--radius-pill);
  text-decoration: none;
}
.ht-read {
  display: inline-flex; align-items: center; gap: .5em;
  margin-top: 1.1em; margin-right: .6em; cursor: pointer;
  font: 800 14px var(--sans);
  color: var(--mcd, #8A5A0F);
  background: var(--paper-card); border: 1.6px solid currentColor;
  padding: .55em 1.05em; border-radius: var(--radius-pill);
}
.ht-mclose {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%;
  border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .22);
  color: #fff; font-size: 20px; line-height: 34px; text-align: center;
}

/* -------------------------------------------------------------- Row tiles */

.tile-section { margin: 0 0 28px; }
.tile-section-title {
  font-weight: 800; font-size: 1.22em; letter-spacing: -.02em;
  color: var(--ink); margin: 0 0 .2em;
}
.tile-section-sub {
  margin: 0 0 .85em;
  font-size: .92em; line-height: 1.45; color: var(--ink-mute);
  max-width: 56ch;
}

.rtile-list { display: flex; flex-direction: column; gap: .7em; }
.rtile {
  position: relative; display: flex; align-items: stretch; width: 100%;
  text-decoration: none; background: var(--paper-card);
  border-radius: var(--radius-md); overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform .15s cubic-bezier(.34, 1.56, .64, 1), box-shadow .15s ease;
}
.rtile::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 5px; z-index: 3;
  background: linear-gradient(180deg, var(--c), var(--cd));
}
.rtile:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(60, 45, 20, .14); }
.rtile:active { transform: scale(.99); }
.rtile-photo {
  flex: none; width: 96px; align-self: stretch;
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, var(--c), var(--cd));
}
.rtile-ic {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: #fff; z-index: 3;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .3));
}
.rtile-ic svg { width: 34px; height: 34px; }
/* Real photo behind the white icon; a soft scrim keeps the icon legible. */
.rtile-photo img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; z-index: 1;
}
.rtile-photo.has-img::after {
  content: ""; position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(150deg, rgba(0, 0, 0, .18), rgba(0, 0, 0, .42));
}
.rtile-body {
  flex: 1; min-width: 0;
  padding: 13px 12px 13px 16px;
  display: flex; flex-direction: column; justify-content: center; gap: .18em;
}
.rtile-name { font-weight: 800; font-size: 1.06em; letter-spacing: -.01em; color: var(--ink); line-height: 1.15; }
.rtile-tagline { font-size: .88em; line-height: 1.35; color: var(--ink-mute); }
.rtile-count {
  margin-top: .3em;
  font-size: .72rem; font-weight: 800; letter-spacing: .02em;
  text-transform: uppercase; color: var(--cd);
}
.rtile-chev { flex: none; align-self: center; padding-right: 14px; color: var(--ink-mute); font-size: 1.2em; opacity: .6; }

/* ------------------------------------------------------------------ Chips */

.chip-row { display: flex; flex-wrap: wrap; gap: .45em; margin: 0 0 1em; }
.chip {
  cursor: pointer;
  font: 700 .82em var(--sans);
  color: var(--ink-soft);
  background: var(--paper-card);
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-pill);
  padding: .45em .9em;
  display: inline-flex; align-items: center; gap: .45em;
  box-shadow: 0 2px 4px rgba(60, 45, 20, .05);
  transition: transform .12s ease, border-color .12s ease;
}
.chip:hover { border-color: var(--gold); }
.chip:active { transform: scale(.95); }
.chip.active {
  color: #fff;
  background: linear-gradient(135deg, var(--c1, var(--gold)), var(--c2, var(--gold-deep)));
  border-color: transparent;
}
.chip-count { font-size: .82em; opacity: .68; font-weight: 800; }

/* ---------------------------------------------------------- Corner nav bits */

.version-pill {
  position: fixed;
  right: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  z-index: 70;
  font: 800 12px/1 var(--sans);
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
  color: #fff;
  background: var(--grad-app);
  border: 1.5px solid rgba(255, 255, 255, .55);
  border-radius: var(--radius-pill);
  padding: 6px 11px;
  box-shadow: 0 2px 8px rgba(31, 90, 140, .32);
  cursor: pointer;
  user-select: none;
}
.version-pill:active { transform: scale(.94); }

.refresh-banner {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 60; cursor: pointer;
  font: 800 14px var(--sans); color: #fff;
  background: var(--grad-app);
  padding: .7em 1.2em; border-radius: var(--radius-pill);
  box-shadow: var(--shadow-lg);
}
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(70px + env(safe-area-inset-bottom, 0px));
  z-index: 90;
  font: 700 14px var(--sans); color: #fff;
  background: rgba(42, 37, 32, .93);
  padding: .65em 1.15em; border-radius: var(--radius-pill);
  box-shadow: var(--shadow-lg);
}

/* ------------------------------------------------------------ Empty states */

.empty-note {
  text-align: center;
  padding: 34px 18px;
  color: var(--ink-mute);
  font-size: .95em;
  background: var(--paper-card);
  border: 1.5px dashed var(--rule-strong);
  border-radius: var(--radius-md);
}
