/* =====================================================================
   MINIMAL (2026-10-31): MERPY's soft look on every inner page.
   The user: "apply the similar UI (shape of the box, etc.) to every page,
   except homepage and hub", "whole MERPY look, but also mixed with the
   space theme/background".

   Loaded right AFTER /space.css, and only by the pages that want it (not
   the homepage, the three part hubs, /profile + log-in, or the F1 hub /
   drivers / teams). Same idea as MERPY's inline "MINIMAL" block, which is
   scoped to #app; here it is the page:
     · tokens on the root (same specificity as space.css, loaded later, so
       they win). space.css block 2 puts the old tokens back on the header,
       the phone tab bar, the arcade bar and the footer, so those keep their
       look;
     · --surface stays OPAQUE (pop-ups, sticky bars and menus read it); the
       see-through card fill is --card-bg, set only on the card list below;
     · the sky: MERPY's peach / lilac glow, with space.css's stars still
       there, fainter;
     · cards: frosted, a hairline, a soft shadow, 22-24px corners; card
       heads lose their tinted band; sticker tiles lose their outline;
     · ghost buttons are a soft fill, disabled ones look off, and whatever
       is selected is a dark ink pill (cream in dark mode).
   Motion: transform/opacity only. Never touches .bh.
   ===================================================================== */

/* ---------- tokens ---------- */
:root:root:root:not([data-theme="dark"]) {
  --surface: #faf8f3; --surface-soft: #f6f2ea; --fill: rgba(17, 17, 17, .045);
  --text: #111111; --muted: #6b655c;   /* was #6b655c, 3.9:1 on cream (2026-11-09) */
  --edge: rgba(17, 17, 17, .08); --line: rgba(17, 17, 17, .08); --line-strong: rgba(17, 17, 17, .16);
  --ink-sh: transparent;
  --hard: 0 1px 2px rgba(17, 17, 17, .04), 0 18px 40px -26px rgba(140, 70, 40, .35);
  --hard-sm: 0 1px 2px rgba(17, 17, 17, .04), 0 8px 22px -16px rgba(140, 70, 40, .3);
  --t0: #ffe3d3; --t1: #ffe1ea; --t2: #dff4e6; --t3: #e1ecff; --t4: #ece4ff; --t5: #fff1c6;
  --radius-xs: 10px; --radius-sm: 12px; --radius-md: 14px; --radius-lg: 20px; --radius-xl: 24px;
  --card-bg: rgba(255, 255, 255, .74); --card-r: 22px;
  --pill: #111111; --pill-text: #f8f5ee;
  --good: #1f9d57; --good-soft: rgba(31, 157, 87, .1);
  --sp-star: 0.1;
}
:root:root:root[data-theme="dark"] {
  --surface: #1b1b1b; --surface-soft: #222222; --fill: rgba(255, 238, 222, .05);
  --text: #f3eee3; --muted: #9b958c;
  --edge: rgba(255, 228, 200, .09); --line: rgba(255, 228, 200, .08); --line-strong: rgba(255, 228, 200, .16);
  --ink-sh: transparent;
  --hard: 0 1px 0 rgba(255, 238, 222, .04) inset, 0 18px 40px -24px rgba(0, 0, 0, .85);
  --hard-sm: 0 1px 0 rgba(255, 238, 222, .04) inset, 0 8px 22px -14px rgba(0, 0, 0, .8);
  --t0: #3a241a; --t1: #3a2230; --t2: #1c3226; --t3: #1d2c3d; --t4: #2a2440; --t5: #3a3218;
  --radius-xs: 10px; --radius-sm: 12px; --radius-md: 14px; --radius-lg: 20px; --radius-xl: 24px;
  --card-bg: rgba(255, 238, 222, .055); --card-r: 22px;
  --pill: #f3eee3; --pill-text: #1a120d;
  --good: #45d483; --good-soft: rgba(69, 212, 131, .12);
  --sp-star: 0.45;
}

/* ---------- the sky: MERPY's glow + the space stars, fainter ---------- */
:root:root:root body::before {
  background:
    radial-gradient(60% 46% at 100% 0%, rgba(255, 196, 160, .5), transparent 70%),
    radial-gradient(55% 42% at 0% 6%, rgba(226, 208, 255, .55), transparent 72%),
    radial-gradient(70% 40% at 50% 104%, rgba(255, 214, 228, .45), transparent 70%);
}
:root:root:root[data-theme="dark"] body::before {
  background:
    radial-gradient(60% 46% at 100% 0%, rgba(255, 102, 69, .17), transparent 70%),
    radial-gradient(55% 42% at 0% 6%, rgba(150, 120, 255, .1), transparent 72%),
    radial-gradient(70% 40% at 50% 104%, rgba(255, 102, 140, .07), transparent 70%);
}

/* ---------- cards: frosted, hairline, soft shadow ---------- */
:root:root:root body :is(
  .card, .panel, .gcard, .np-card, .acc-card, .cc-card, .bf-card, .social-card, .contact-card,
  .wk-card, .wk-info, .wk-toc, .wk-pc, .tv-card, .tv-cta-card, .pay-card, .summary-card, .history-card,
  .restaurant-card, .suggestion-card, .activity-card, .app-card, .mb-chat, .tc-big, .sp-tile,
  .fd-wheel-box, .ap-card, .ap-list > a, .ap-join, .pl-trip, .seo-howto, .seo-faq details, .bl-choose
):not(.bh *):not(.cz-foot *):not(.ms-bottomnav *) {
  background-color: var(--card-bg) !important;
  border: 1px solid var(--edge) !important;
  border-radius: var(--card-r) !important;
  box-shadow: var(--hard) !important;
}
:root:root:root body :is(.card, .panel, .gcard, .np-card, .acc-card, .ap-card, .ap-list > a, .pl-trip):not(.bh *):hover { box-shadow: var(--hard) !important; }
:root:root:root body :is(.ap-card, .ap-list > a, .pl-trip, .gcard):not(.bh *):active { transform: scale(.985); }
/* pop-ups: solid, rounder, a deeper shadow */
:root:root:root body :is(.share-modal, .bill-guide-modal, .pay-sheet, .place-modal-card, .ar-modal .box, .ar-modal > div, .tv-sheet):not(.bh *) {
  border: 1px solid var(--edge) !important; border-radius: 24px !important;
  box-shadow: 0 30px 70px -30px rgba(30, 15, 5, .55) !important;
}

/* card heads: no tinted band, a hairline under them */
:root:root:root body :is(.cc-head, .panel-h, .np-card-head, .bf-head, .acc-head, .wk-card-t):not(.bh *) {
  background: transparent !important; border-bottom: 1px solid var(--line) !important;
}
/* sticker tiles inside cards: no outline */
:root:root:root body :is(.cc-ic, .panel-ic, .gicon, .hero-tile, .wk-title-ic, .wk-card-ic, .ap-card-art, .ap-li-ic, .ap-join-ic, .ap-quick span, .pl-trip-ic, .np-ic, .acc-ic):not(.bh *):not(.ms-bottomnav *) {
  border: 0 !important; box-shadow: none !important;
}
/* dashed rows inside cards become plain hairlines */
:root:root:root body :is(.cc-card, .bf-card, .panel, .card, .wk-info) :is(hr, .cc-row, .bf-row) { border-style: solid; }

/* ---------- buttons ---------- */
:root:root:root body :is(.btn-secondary, .hero-btn.secondary, .btn.ghost, .ap-btn.ghost, .np-btn:not(.primary), .secondary-btn, .login-secondary, .dashboard-secondary-btn, .ar-modal .btn.ghost):not(.bh *):not(.cz-foot *) {
  border: 0 !important; background: var(--fill) !important; box-shadow: inset 0 0 0 1px var(--line) !important;
}
:root:root:root body :is(.btn-secondary, .hero-btn.secondary, .btn.ghost, .ap-btn.ghost, .np-btn:not(.primary), .secondary-btn, .login-secondary, .dashboard-secondary-btn):not(.bh *):not(.cz-foot *):hover {
  background: var(--line) !important;
}
:root:root:root body :is(.btn, .btn-primary, .btn-secondary, .cc-btn, .bf-btn):not(.bh *):not(.cz-foot *):not(.ms-bottomnav *):disabled {
  background: var(--fill) !important; color: var(--muted) !important; border-color: transparent !important; box-shadow: none !important; cursor: default;
}
:root:root:root body :is(.backbtn, .ap-hero-btn i):not(.bh *) { border: 0 !important; box-shadow: var(--hard-sm) !important; }
/* food.css buttons (/kin-arai-dee, the wheels, /lists): pills; the plain one is a soft fill */
:root:root:root body .fd-btn { border: 0 !important; border-radius: 999px; box-shadow: none !important; }
:root:root:root body .fd-btn:not(.primary):not(.line) { background: var(--fill); box-shadow: inset 0 0 0 1px var(--line) !important; }
:root:root:root body .fd-btn.primary { box-shadow: 0 10px 22px -12px rgba(255, 75, 43, .7) !important; }
:root:root:root body .fd-btn:active { transform: scale(.97); }
/* XO's mode boxes */
:root:root:root body .modes .mode { border: 1px solid var(--edge); background: var(--card-bg); box-shadow: var(--hard-sm); }
:root:root:root body .modes .mode:hover { transform: translateY(-1px); box-shadow: var(--hard); }
:root:root:root body .modes .mode:active { transform: scale(.985); box-shadow: var(--hard-sm); }

/* ---------- what's selected: a dark ink pill ---------- */
:root:root:root body .segtabs:not(.bh *) { border: 1px solid var(--edge); background: var(--card-bg); box-shadow: var(--hard-sm); }
:root:root:root body .segtabs .tab-pill { background: var(--pill) !important; box-shadow: none !important; }
:root:root:root body .segtabs .tab[aria-selected="true"] { color: var(--pill-text) !important; }
:root:root:root body .planner-tabbar { border: 1px solid var(--edge); border-radius: 999px; background: var(--card-bg); box-shadow: var(--hard-sm); }
:root:root:root body .planner-tab { border-radius: 999px; }
:root:root:root body .planner-tabbar:not(.has-glide) .planner-tab.active { background: var(--pill); color: var(--pill-text); box-shadow: none; }
:root:root:root body .planner-tabbar.has-glide .planner-tab.active { color: var(--pill-text); background: none; box-shadow: none; }
:root:root:root body .pl-tab-glide { border-radius: 999px; background: var(--pill); box-shadow: none; }
:root:root:root body :is(.cc-seg, .bf-seg, .seg):not(.bh *) { border: 1px solid var(--line-strong) !important; border-radius: 999px !important; background: var(--surface) !important; box-shadow: none !important; padding: 3px; }
:root:root:root body :is(.cc-seg, .bf-seg, .seg) button { border: 0 !important; border-radius: 999px !important; box-shadow: none !important; }
:root:root:root body :is(.cc-seg, .bf-seg, .seg) button:is([aria-pressed="true"], [aria-selected="true"], .on, .active) {
  background: var(--pill) !important; color: var(--pill-text) !important;
}
:root:root:root body :is(.fd-chip, .dk-chips button, .rl-tools button):is([aria-pressed="true"], .on, .active) {
  background: var(--pill) !important; color: var(--pill-text) !important; border-color: var(--pill) !important;
}

/* ---------- fields ---------- */
:root:root:root body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="submit"]):not([type="button"]), select, textarea):not(.bh *):not(.cz-foot *) {
  background-color: var(--surface) !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: 14px;
}

/* ---------- the page head: calmer ---------- */
:root:root:root body .app-head { border-bottom: 0; padding-bottom: 6px; }
:root:root:root body .app-head h1 {
  font-size: clamp(28px, 3.6vw, 44px) !important; line-height: 1.15; text-transform: none; letter-spacing: -0.005em !important;
}
:root:root:root body .app-head p { color: var(--muted); }
:root:root:root body .app-head .app-pill { border: 0 !important; background: var(--card-bg) !important; box-shadow: var(--hard-sm); }
/* a long keyword title's tail, on its own smaller line (Phase B) */
:root:root:root body h1 .h1-sub { display: block; margin-top: 4px; font-size: .52em; font-weight: 600 !important; letter-spacing: 0 !important; color: var(--muted); text-transform: none; }

/* ---------- small bits ---------- */
:root:root:root body .uk-toast { border: 0; border-radius: 999px; background: var(--pill); color: var(--pill-text); box-shadow: 0 14px 30px -12px rgba(30, 15, 5, .5); }
:root:root:root body .chip:not(.bh *):not(.ms-bottomnav *) { border: 0 !important; }
:root:root:root body .wk-tip { border-radius: 16px; }
:root:root:root body .wk-table { border-radius: 16px; overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  :root:root:root body :is(.ap-card, .ap-list > a, .pl-trip, .gcard):active { transform: none; }
}
