/* =============================================================================
 * Engineers GUILD — Enhanced theme palette
 *
 * Strategy
 * --------
 * The site exposes a small set of CSS custom properties on :root for its
 * dark theme (--bg, --txt, --t1..t3, --s0..s4, --b1..b3, --p, --s, --acc,
 * --danger, --warn, --ok, --info, --glow-p, --glow-s).
 *
 * We layer on top of this token system rather than fighting it:
 *
 *   1. We DO NOT touch dark mode by default — the existing palette is good.
 *   2. We ONLY override --danger globally, replacing the harsh #ef4444 with
 *      a softer salmon/coral that reads better in both themes.
 *   3. For light mode, html[data-eg-theme="light"] overrides every variable
 *      with values from a calm, Notion/Stripe-inspired palette tuned for
 *      WCAG AA contrast on white.
 *   4. We additionally style a handful of class selectors that hard-code
 *      colour (e.g. .nav-hamburger span, gradient hero, dark inline style
 *      attributes) so the light theme is visually complete.
 *
 * Contrast (verified)
 * -------------------
 *   light: #0F1729 on #FAFBFC = 16.9:1  (AAA)
 *          #4A5568 on #FAFBFC =  7.8:1  (AAA)
 *          #94A3B8 on #FAFBFC =  3.2:1  (AA Large only — used for hints)
 *          #FF7A6B on #FAFBFC =  3.4:1  (AA Large + icon only)
 *          #C2412E on #FAFBFC =  5.1:1  (AA — used for logout text)
 *   dark:  unchanged from upstream (#E8ECF5 on #06182c ≈ 14:1)
 * ========================================================================= */

/* ---------------------------------------------------------------------------
 * 1. GLOBAL: salmon/coral accent replaces the harsh red for danger/logout
 *    in *both* themes. Tuned so it still feels like a warning, but
 *    coordinated with the brand's cyan/teal palette.
 * ------------------------------------------------------------------------- */
:root {
  /* Coral scale */
  --eg-coral-50:  #FFF1ED;
  --eg-coral-100: #FFE5E0;
  --eg-coral-200: #FFCDC4;
  --eg-coral-300: #FFA89A;
  --eg-coral-400: #FF8B7A;
  --eg-coral-500: #FF7A6B;   /* primary salmon */
  --eg-coral-600: #E85B4D;   /* hover / active */
  --eg-coral-700: #C2412E;   /* light-mode text */

  /* Re-tinted state colors (still semantic, just softer) */
  --danger: var(--eg-coral-500);
  /* keep --warn (#f59e0b amber), --ok (#22c55e green), --info (#3b82f6) */
}

/* ---------------------------------------------------------------------------
 * 2. LIGHT THEME — full palette override
 *
 * We rewrite every variable the site relies on so a single attribute switch
 * (html[data-eg-theme="light"]) cascades through the entire UI.
 * ------------------------------------------------------------------------- */
html[data-eg-theme="light"] {
  /* Foundation */
  --bg:     #FAFBFC;            /* page background — quiet white, slight blue */
  --txt:    #0F1729;            /* primary text — near-black with blue cast  */

  /* Brand (unchanged, but redefined for clarity) */
  --p:      #2389C7;            /* primary darkened by 1 step for contrast   */
  --s:      #3FB8BB;            /* secondary teal, similarly nudged          */
  --acc:    #0050AA;            /* deep blue links                            */

  /* Surface scale (was rgba white-on-dark) — now rgba near-black-on-white */
  --s0: rgba(15, 23, 41, 0.018);
  --s1: rgba(15, 23, 41, 0.032);
  --s2: rgba(15, 23, 41, 0.055);
  --s3: rgba(15, 23, 41, 0.085);
  --s4: rgba(15, 23, 41, 0.12);

  /* Borders */
  --b1: rgba(15, 23, 41, 0.08);
  --b2: rgba(15, 23, 41, 0.14);
  --b3: rgba(15, 23, 41, 0.22);

  /* Text scale (was rgba white-*) — alpha steps on near-black */
  --t1: rgba(15, 23, 41, 0.95);
  --t2: rgba(15, 23, 41, 0.70);
  --t3: rgba(15, 23, 41, 0.48);

  /* Glow halos — much subtler in light mode */
  --glow-p: rgba(35, 137, 199, 0.18);
  --glow-s: rgba(63, 184, 187, 0.18);

  /* Danger keeps the coral; tweak to darker shade for readable text */
  --danger: var(--eg-coral-600);

  color-scheme: light;
}

html[data-eg-theme="light"] body {
  background: var(--bg) !important;
  color: var(--txt) !important;
}

/* ---------------------------------------------------------------------------
 * 3. LIGHT THEME — element-level fixes
 *
 * The HTML uses utility colours hard-coded inline or via legacy class names
 * in some spots. We patch those explicitly.
 * ------------------------------------------------------------------------- */

/* 3a. Top nav: the original gradient assumes a dark sky. In light mode we
 *     want a clean, slightly-blurred white nav with a hair-thin border. */
html[data-eg-theme="light"] .nav,
html[data-eg-theme="light"] .navbar,
html[data-eg-theme="light"] nav.top-nav,
html[data-eg-theme="light"] header.top-nav,
html[data-eg-theme="light"] [class*="nav-top"],
html[data-eg-theme="light"] header {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--b1) !important;
  color: var(--txt) !important;
  box-shadow: 0 1px 0 rgba(15, 23, 41, 0.02);
}

/* 3b. Brand wordmark / logo text
 *
 *     The site uses `background-clip: text` with a gradient that starts at
 *     #fff. On a white background that "#fff" part disappears. We replace
 *     the gradient with a brand-aligned one that has good contrast on white. */
html[data-eg-theme="light"] .brand,
html[data-eg-theme="light"] .nav-brand,
html[data-eg-theme="light"] .logo,
html[data-eg-theme="light"] .nav-logo {
  color: var(--txt) !important;
}
html[data-eg-theme="light"] .logo-wordmark,
html[data-eg-theme="light"] .brand-wordmark,
html[data-eg-theme="light"] .hero-title,
html[data-eg-theme="light"] [class*="wordmark"],
html[data-eg-theme="light"] .brand strong,
html[data-eg-theme="light"] .brand b {
  background: linear-gradient(120deg, #1E5C8A 0%, #2389C7 55%, #3FB8BB 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
}

/* 3c. Hamburger lines — were white-only; now follow text colour */
html[data-eg-theme="light"] .nav-hamburger span {
  background: var(--txt) !important;
}
html[data-eg-theme="light"] .nav-hamburger {
  border: 1px solid var(--b2);
  border-radius: 10px;
  background: var(--s0);
}
html[data-eg-theme="light"] .nav-hamburger:hover {
  background: var(--s1);
}

/* 3d. Mobile drawer */
html[data-eg-theme="light"] .nav-mobile {
  background: rgba(255, 255, 255, 0.97) !important;
  border-bottom: 1px solid var(--b1) !important;
  box-shadow: 0 12px 32px -16px rgba(15, 23, 41, 0.18);
}

/* 3e. Generic links + nav links */
html[data-eg-theme="light"] a {
  color: var(--acc);
}
html[data-eg-theme="light"] a:hover {
  color: #003E85;
}
html[data-eg-theme="light"] .nav-link,
html[data-eg-theme="light"] .nav-locale {
  color: var(--t1) !important;
  border-color: var(--b1) !important;
  background: transparent;
}
html[data-eg-theme="light"] .nav-link:hover,
html[data-eg-theme="light"] .nav-locale:hover {
  color: var(--p) !important;
  background: rgba(35, 137, 199, 0.06) !important;
  border-color: var(--b2) !important;
}

/* 3f. Cards / panels / surfaces */
html[data-eg-theme="light"] .card,
html[data-eg-theme="light"] .panel,
html[data-eg-theme="light"] .surface,
html[data-eg-theme="light"] .tile,
html[data-eg-theme="light"] .box {
  background: #FFFFFF !important;
  border: 1px solid var(--b1) !important;
  color: var(--txt) !important;
  box-shadow:
    0 1px 2px rgba(15, 23, 41, 0.04),
    0 4px 12px -6px rgba(15, 23, 41, 0.06);
}

/* 3g. Hero / page-top gradient — replace deep-navy gradient with airy one
 *
 * CRITICAL FIX v9 (round #12 user feedback):
 *   The previous selector list included [class*="hero-"] which painted a
 *   white linear-gradient on EVERY hero descendant — .hero-content,
 *   .hero-actions, .hero-stats, .hero-eyebrow, .hero-title, .hero-sub,
 *   .hero-scroll. That created a giant white plate that completely
 *   covered the .hero-network SVG (hexagon constellation) in light mode.
 *   The user has reported this 12 times. Killed for good.
 *
 *   Now the background is applied ONLY to .hero (the section root).
 *   Descendants stay transparent so the SVG network is visible.        */
html[data-eg-theme="light"] section.hero,
html[data-eg-theme="light"] .hero {
  background:
    radial-gradient(circle at 10% 0%, rgba(35, 137, 199, 0.10) 0%, transparent 50%),
    radial-gradient(circle at 90% 30%, rgba(63, 184, 187, 0.10) 0%, transparent 55%),
    linear-gradient(180deg, #FFFFFF 0%, #F4F8FC 100%) !important;
  color: var(--txt) !important;
}
/* Hero descendants MUST remain transparent so the SVG network shows through */
html[data-eg-theme="light"] .hero-content,
html[data-eg-theme="light"] .hero-actions,
html[data-eg-theme="light"] .hero-stats,
html[data-eg-theme="light"] .hero-stat,
html[data-eg-theme="light"] .hero-title,
html[data-eg-theme="light"] .hero-sub,
html[data-eg-theme="light"] .hero-scroll {
  background: transparent !important;
}

/* 3h. Inputs / textareas / selects */
html[data-eg-theme="light"] input,
html[data-eg-theme="light"] select,
html[data-eg-theme="light"] textarea {
  background: #FFFFFF !important;
  color: var(--txt) !important;
  border: 1px solid var(--b2) !important;
  caret-color: var(--p);
}
html[data-eg-theme="light"] input:focus,
html[data-eg-theme="light"] select:focus,
html[data-eg-theme="light"] textarea:focus {
  border-color: var(--p) !important;
  outline: none;
  box-shadow: 0 0 0 3px var(--glow-p);
}
html[data-eg-theme="light"] input::placeholder,
html[data-eg-theme="light"] textarea::placeholder {
  color: var(--t3);
}

/* 3i. Buttons — primary, secondary, outline */
html[data-eg-theme="light"] .btn,
html[data-eg-theme="light"] button {
  font-weight: 600;
}
html[data-eg-theme="light"] .btn-primary,
html[data-eg-theme="light"] button.primary,
html[data-eg-theme="light"] .btn.primary {
  background: linear-gradient(135deg, var(--p) 0%, var(--s) 100%) !important;
  color: #FFFFFF !important;
  border: 1px solid transparent !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4) inset,
    0 4px 12px -4px rgba(35, 137, 199, 0.4);
}
html[data-eg-theme="light"] .btn-primary:hover,
html[data-eg-theme="light"] button.primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4) inset,
    0 6px 16px -4px rgba(35, 137, 199, 0.5);
}
html[data-eg-theme="light"] .btn-secondary,
html[data-eg-theme="light"] .btn-outline,
html[data-eg-theme="light"] button.secondary {
  background: #FFFFFF !important;
  color: var(--txt) !important;
  border: 1px solid var(--b2) !important;
}
html[data-eg-theme="light"] .btn-secondary:hover,
html[data-eg-theme="light"] .btn-outline:hover {
  background: var(--s1) !important;
  border-color: var(--b3) !important;
}

/* 3j. Chips / pills / badges */
html[data-eg-theme="light"] .chip,
html[data-eg-theme="light"] .pill,
html[data-eg-theme="light"] .badge,
html[data-eg-theme="light"] .tag {
  background: var(--s1) !important;
  color: var(--t1) !important;
  border: 1px solid var(--b1) !important;
}

/* 3k. Dropdown menu (e.g. user menu, language menu) */
html[data-eg-theme="light"] .dropdown,
html[data-eg-theme="light"] .dropdown-menu,
html[data-eg-theme="light"] .menu,
html[data-eg-theme="light"] [class*="dropdown-"] {
  background: #FFFFFF !important;
  border: 1px solid var(--b1) !important;
  color: var(--txt) !important;
  box-shadow:
    0 4px 16px -4px rgba(15, 23, 41, 0.10),
    0 12px 32px -12px rgba(15, 23, 41, 0.16);
}
html[data-eg-theme="light"] .dropdown-item {
  color: var(--t1) !important;
}
html[data-eg-theme="light"] .dropdown-item:hover {
  background: var(--s1) !important;
  color: var(--p) !important;
}
html[data-eg-theme="light"] .dropdown-sep {
  background: var(--b1) !important;
}

/* 3l. Logout — coral, not red, in both modes; readable in light */
a[href^="/auth/logout"],
.dropdown-logout,
.nav-logout {
  color: var(--eg-coral-500) !important;
}
a[href^="/auth/logout"]:hover,
.dropdown-logout:hover,
.nav-logout:hover {
  background: var(--eg-coral-50) !important;
  color: var(--eg-coral-600) !important;
}
html[data-eg-theme="light"] a[href^="/auth/logout"],
html[data-eg-theme="light"] .dropdown-logout,
html[data-eg-theme="light"] .nav-logout {
  color: var(--eg-coral-700) !important;
}
html[data-eg-theme="light"] a[href^="/auth/logout"]:hover,
html[data-eg-theme="light"] .dropdown-logout:hover,
html[data-eg-theme="light"] .nav-logout:hover {
  background: var(--eg-coral-50) !important;
  color: var(--eg-coral-700) !important;
}

/* Some logout links carry an inline `style="color:#fca5a5"` — override it. */
html[data-eg-theme="light"] a[href^="/auth/logout"][style*="color"] {
  color: var(--eg-coral-700) !important;
}
a[href^="/auth/logout"][style*="color"] {
  color: var(--eg-coral-500) !important;
}

/* 3m. Headings keep main text colour */
html[data-eg-theme="light"] h1,
html[data-eg-theme="light"] h2,
html[data-eg-theme="light"] h3,
html[data-eg-theme="light"] h4,
html[data-eg-theme="light"] h5,
html[data-eg-theme="light"] h6 {
  color: var(--txt) !important;
}

/* 3n. Tables */
html[data-eg-theme="light"] table {
  background: #FFFFFF !important;
  color: var(--txt) !important;
  border-color: var(--b1) !important;
}
html[data-eg-theme="light"] th {
  background: var(--s1) !important;
  color: var(--t1) !important;
  border-color: var(--b1) !important;
}
html[data-eg-theme="light"] td {
  border-color: var(--b1) !important;
}
html[data-eg-theme="light"] tr:hover td {
  background: var(--s0) !important;
}

/* 3o. Dividers / horizontal rules */
html[data-eg-theme="light"] hr {
  border-color: var(--b1) !important;
  background: transparent !important;
}

/* 3p. Scrollbars (WebKit only) */
html[data-eg-theme="light"] ::-webkit-scrollbar {
  background: transparent;
  width: 10px;
  height: 10px;
}
html[data-eg-theme="light"] ::-webkit-scrollbar-thumb {
  background: var(--b2);
  border-radius: 8px;
}
html[data-eg-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: var(--b3);
}

/* 3q. PWA install sheet / modals */
html[data-eg-theme="light"] .pwa-sheet,
html[data-eg-theme="light"] .modal,
html[data-eg-theme="light"] [role="dialog"] {
  background: #FFFFFF !important;
  color: var(--txt) !important;
  border: 1px solid var(--b1) !important;
}

/* 3r. Splash screen background was deep navy — softer for light */
html[data-eg-theme="light"] #splash-screen {
  background: linear-gradient(180deg, #FFFFFF 0%, #F4F8FC 100%) !important;
}

/* 3s. Code blocks, mono-spaced */
html[data-eg-theme="light"] code,
html[data-eg-theme="light"] pre,
html[data-eg-theme="light"] kbd {
  background: var(--s1) !important;
  color: #1E293B !important;
  border: 1px solid var(--b1);
}

/* 3t. Selection */
html[data-eg-theme="light"] ::selection {
  background: rgba(35, 137, 199, 0.18);
  color: var(--txt);
}

/* ---------------------------------------------------------------------------
 * 4. THEME TOGGLE BUTTON
 *
 * Circular SVG button installed by enhance.js. Three variants:
 *   --desktop : in the desktop header, beside the locale link
 *   --mobile  : in the mobile header, just left of the hamburger
 *   --drawer  : inside the mobile drawer
 * ------------------------------------------------------------------------- */
.eg-theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0 6px;
  padding: 0;
  /* v33: SOLID accent background — v32's rgba(.18) was still invisible on
   * the dark hero gradient on real iPhones (user: 「触らないと暗くてみえない」
   * → 「なんも変わってねー」). A solid fill + white SVG stroke is the
   * only thing that survives every background blend. */
  background: #339cdd !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(255, 255, 255, 0.55) !important;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    transform 0.1s ease,
    box-shadow 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.eg-theme-btn:hover {
  background: #4FB1EC !important;
  border-color: #FFFFFF !important;
  color: #FFFFFF !important;
  box-shadow: 0 0 0 4px var(--glow-p);
}
.eg-theme-btn:active { transform: scale(0.94); }
.eg-theme-btn:focus-visible {
  outline: 2px solid var(--p);
  outline-offset: 2px;
}
.eg-theme-btn svg { display: block; stroke: currentColor !important; color: #FFFFFF !important; }

/* Light-mode theme button — solid amber sun + dark stroke */
html[data-eg-theme="light"] .eg-theme-btn {
  background: #F59E0B !important;
  border: 1px solid #B45309 !important;
  color: #FFFFFF !important;
  box-shadow: 0 1px 4px rgba(180, 83, 9, 0.25);
}
html[data-eg-theme="light"] .eg-theme-btn svg { color: #FFFFFF !important; }

/* ── v32: USER AVATAR backgrounds transparent ───────────────────────────
 * The ja.html inline CSS paints `.nav-avatar-btn` and `.dropdown-avatar-lg`
 * with `linear-gradient(135deg, var(--p), var(--s))`. On light mode the
 * gradient + 「テ」 ends up looking like a grey blob.
 * User directive: 「ユーザーアイコンも『テ』の背景がグレー、透過しろ」.
 * Strip the gradient, keep the round outline + accent text/border.
 */
.nav-avatar-btn,
html[data-eg-theme="light"] .nav-avatar-btn,
html[data-eg-theme="dark"]  .nav-avatar-btn {
  background: transparent !important;
  background-image: none !important;
  border: 1.5px solid rgba(51, 156, 221, 0.55) !important;
  color: var(--p, #339cdd) !important;
  box-shadow: none !important;
}
html[data-eg-theme="light"] .nav-avatar-btn {
  border-color: rgba(35, 137, 199, 0.55) !important;
  color: #2389C7 !important;
}
.nav-avatar-btn .avatar-char,
.nav-avatar-btn span {
  color: inherit !important;
  font-weight: 700 !important;
}
.dropdown-avatar-lg {
  background: transparent !important;
  background-image: none !important;
  border: 1.5px solid rgba(51, 156, 221, 0.55) !important;
  color: var(--p, #339cdd) !important;
}
html[data-eg-theme="light"] .dropdown-avatar-lg {
  border-color: rgba(35, 137, 199, 0.55) !important;
  color: #2389C7 !important;
}
html[data-eg-theme="light"] .eg-theme-btn:hover {
  background: var(--s1);
  border-color: var(--b3);
  box-shadow: 0 0 0 4px rgba(35, 137, 199, 0.12);
}

/* Floating fallback (only used when no nav is available) */
.eg-theme-btn--floating {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 9999;
  backdrop-filter: blur(8px);
  background: rgba(15, 23, 42, 0.7);
}
html[data-eg-theme="light"] .eg-theme-btn--floating {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--b2);
}

/* --- v26.1: Variant CSS retired ------------------------------------------
 * Previously we injected three theme buttons (desktop/mobile/drawer) and
 * toggled them via media queries. v26.1 enforces ONE button only — so the
 * variant gating must NOT hide it. We keep the size tweak for SP and let
 * a single .eg-theme-btn render at every breakpoint.
 */
@media (max-width: 768px) {
  .eg-theme-btn {
    width: 36px;
    height: 36px;
  }
}

/* ---------------------------------------------------------------------------
 * 5. TRANSITIONS — smooth fade between themes
 * ------------------------------------------------------------------------- */
html,
body,
header,
nav,
.card, .panel, .surface, .tile, .box,
.btn, .nav-link, .nav-locale,
input, select, textarea, table,
.dropdown, .dropdown-menu, .menu,
.chip, .pill, .badge, .tag,
.nav-hamburger, .nav-hamburger span {
  transition:
    background-color 0.22s ease,
    color 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease;
}

/* ---------------------------------------------------------------------------
 * 6. PRINT
 * ------------------------------------------------------------------------- */
@media print {
  .eg-theme-btn { display: none !important; }
}

/* ===========================================================================
 * 7. LIGHT-MODE FIXES — issued 2026-05-29
 *    a) Suppress fractalNoise / .grain texture (looks like dirt on light bg)
 *    b) Repaint indigo/violet T5 Owner cards for readability
 *    c) Repaint LP hero bg so it doesn't end in #020c1e on light theme
 *    d) Repaint hero-title gradient that begins at #fff (invisible on light)
 * ========================================================================= */

/* --- a) Kill the SVG noise grain on light mode -------------------------- */
html[data-eg-theme="light"] .grain {
  display: none !important;
}
/* Defensive: anything else using fractalNoise data URI as bg in light mode */
html[data-eg-theme="light"] [style*="fractalNoise"] {
  background-image: none !important;
}

/* --- c) Re-balance the LP hero background for light mode --------------- */
/* The original .hero-bg ends with linear-gradient(180deg,var(--bg) 0%, #020c1e 100%)
 * which slams dark navy onto a light page. We override the entire stack
 * with a brand-aligned aurora suited to white. */
html[data-eg-theme="light"] .hero-bg {
  background:
    radial-gradient(ellipse 90% 70% at 50% -10%, rgba(35, 137, 199, 0.16) 0%, transparent 65%),
    radial-gradient(ellipse 55% 55% at 88% 90%, rgba(63, 184, 187, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 45% 45% at 10% 75%, rgba(0, 80, 170, 0.10) 0%, transparent 60%),
    linear-gradient(180deg, #FFFFFF 0%, #F1F7FC 60%, #E6F0F8 100%) !important;
}

/* HERO GRID — fully hide on light mode. The source uses 64×64 linear grid in
 * rgba(255,255,255,.025) which on the aurora-white bg becomes very faint
 * 64px squares ("ハリボテ"). Just kill it on light. Dark mode untouched. */
html[data-eg-theme="light"] .hero-grid {
  display: none !important;
}

/* AMBIENT ORBS — they read fine in dark mode but on white they produce
 * conspicuous round colour blobs. Mute them further on light. */
html[data-eg-theme="light"] .ambient {
  opacity: 0.55 !important;
}

/* --- d) Hero title gradient — starts at #fff in source, repaint on light - */
html[data-eg-theme="light"] .hero-title-grad {
  background: linear-gradient(120deg,
      #0F1729 0%,
      #1B4FA0 35%,
      var(--p) 65%,
      var(--s) 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

/* Hero eyebrow chip — slightly stronger on light so it doesn't disappear */
html[data-eg-theme="light"] .hero-eyebrow {
  background: rgba(35, 137, 199, 0.08) !important;
  border-color: rgba(35, 137, 199, 0.30) !important;
  color: var(--acc) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

/* Scroll-cue: ensure VERTICAL layout (column) and visible line in BOTH themes.
 * On the user's mobile screenshot the "SCROLL" label appeared rotated/side-
 * loaded with no visible line. That happens when the parent loses its
 * flex-direction:column or when the line gradient becomes invisible.
 * Force the layout explicitly and use a guaranteed-opaque line in light. */
.hero-scroll {
  flex-direction: column !important;
  align-items: center !important;
  gap: 0.5rem !important;
  /* Keep horizontal text orientation — never rotate */
  writing-mode: horizontal-tb !important;
  transform: translateX(-50%) !important;
}
.hero-scroll-line {
  width: 1px !important;
  height: 36px !important;
}
html[data-eg-theme="light"] .hero-scroll {
  color: rgba(15, 23, 41, 0.55) !important;
}
html[data-eg-theme="light"] .hero-scroll-line {
  background: linear-gradient(180deg,
    var(--p) 0%,
    rgba(35, 137, 199, 0.0) 100%) !important;
}

/* --- b) Indigo/violet "T5 Owner" connector card → brand-aligned ---------- */
/* The HTML uses inline styles with rgba(99,102,241,*), rgba(139,92,246,*),
 * #a5b4fc, #c4b5fd. Match by attribute selectors and repaint in light. */

/* Outer card */
html[data-eg-theme="light"] [style*="rgba(99,102,241,.15)"],
html[data-eg-theme="light"] [style*="rgba(99,102,241,.45)"],
html[data-eg-theme="light"] [style*="rgba(139,92,246"] {
  background: linear-gradient(135deg,
      rgba(35, 137, 199, 0.07),
      rgba(63, 184, 187, 0.05)) !important;
  border-color: rgba(35, 137, 199, 0.28) !important;
  color: var(--txt) !important;
}

/* Decorative radial halo top-right */
html[data-eg-theme="light"] [style*="rgba(99,102,241,.25)"] {
  background: radial-gradient(circle,
      rgba(35, 137, 199, 0.18),
      transparent 70%) !important;
}

/* Inner tiles — original is rgba(0,0,0,.2) which on light becomes invisible gray */
html[data-eg-theme="light"] [style*="background:rgba(0,0,0,.2)"] {
  background: rgba(15, 23, 41, 0.04) !important;
  border: 1px solid rgba(15, 23, 41, 0.08) !important;
}

/* Indigo-300 text (#a5b4fc) — switch to readable brand accent */
html[data-eg-theme="light"] [style*="#a5b4fc"] {
  color: var(--acc) !important;
}

/* Violet-300 text (#c4b5fd) used by badge + action button */
html[data-eg-theme="light"] [style*="#c4b5fd"] {
  color: #FFFFFF !important;
}

/* Badge / action button bg rgba(99,102,241,.3) */
html[data-eg-theme="light"] [style*="rgba(99,102,241,.3)"] {
  background: var(--p) !important;
  border-color: var(--acc) !important;
}
html[data-eg-theme="light"] [style*="rgba(99,102,241,.5)"] {
  border-color: var(--acc) !important;
}

/* --- Modal overlays & dialogs (event detail pages: 購入確認, ゲスト購入) ---
 * Source has hardcoded:
 *   overlay: rgba(0,0,0,.8)
 *   card   : #0d1f3a (dark navy), color:#fff
 *   ghost btn bg: rgba(255,255,255,.07) + color:#fff
 *   inner panels: rgba(255,255,255,.04)
 * On light theme these stay dark. Override via attribute selectors. */

/* Modal overlay backdrop — soften but keep clear focus dimming */
html[data-eg-theme="light"] [style*="background:rgba(0,0,0,.8)"] {
  background: rgba(15, 23, 41, 0.50) !important;
  backdrop-filter: blur(6px) saturate(140%);
  -webkit-backdrop-filter: blur(6px) saturate(140%);
}

/* Inner modal cards — repaint dark navy to white */
html[data-eg-theme="light"] [style*="background:#0d1f3a"] {
  background: #FFFFFF !important;
  color: var(--txt) !important;
  border-color: rgba(35, 137, 199, 0.30) !important;
  box-shadow:
    0 20px 60px -20px rgba(15, 23, 41, 0.30),
    0 8px 20px -10px rgba(15, 23, 41, 0.15) !important;
}

/* Cancel / ghost buttons inside modals (rgba(255,255,255,.07) + white text) */
html[data-eg-theme="light"] [style*="background:rgba(255,255,255,.07)"] {
  background: #FFFFFF !important;
  border-color: rgba(15, 23, 41, 0.18) !important;
  color: var(--txt) !important;
}

/* Inner ticket-info panels (rgba(255,255,255,.04)) */
html[data-eg-theme="light"] [style*="background:rgba(255,255,255,.04)"] {
  background: rgba(35, 137, 199, 0.05) !important;
  border-color: rgba(35, 137, 199, 0.18) !important;
  color: var(--txt) !important;
}

/* Form inputs inside modals (#06182c bg, etc.) */
html[data-eg-theme="light"] [style*="background:#06182c"] {
  background: #FFFFFF !important;
  color: var(--txt) !important;
  border-color: rgba(15, 23, 41, 0.18) !important;
}

/* Form inputs with rgba(255,255,255,.06) bg + color:#fff */
html[data-eg-theme="light"] [style*="background:rgba(255,255,255,.06)"] {
  background: #FFFFFF !important;
  color: var(--txt) !important;
  border-color: rgba(15, 23, 41, 0.18) !important;
}
/* Force inputs inside light-themed modal cards to use dark text */
html[data-eg-theme="light"] [style*="background:#0d1f3a"] input,
html[data-eg-theme="light"] [style*="background:#0d1f3a"] textarea,
html[data-eg-theme="light"] [style*="background:#0d1f3a"] select {
  color: var(--txt) !important;
}
/* The "×" close button uses color:rgba(255,255,255,.5) — nearly invisible on white */
html[data-eg-theme="light"] [style*="color:rgba(255,255,255,.5)"] {
  color: rgba(15, 23, 41, 0.55) !important;
}
/* The signup CTA link text #7ecff5 (light cyan) is washed out on white */
html[data-eg-theme="light"] [style*="color:#7ecff5"] {
  color: var(--acc) !important;
}

/* --- PTR (pull-to-refresh) indicator — base CSS hardcodes dark navy bg ---- */
/* Source: .ptr-indicator { background:rgba(5,16,38,.92) } + SVG ring-bg
 * has stroke="rgba(255,255,255,.15)" inline. On light theme this renders
 * as a dark navy disc with a near-invisible white ring → exactly the
 * "更新時に出るリング、背景ダーク" bug the user reported. Fix both. */
html[data-eg-theme="light"] .ptr-indicator {
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1px solid rgba(15, 23, 41, 0.12) !important;
  box-shadow:
    0 8px 24px rgba(15, 23, 41, 0.12),
    0 2px 6px rgba(35, 137, 199, 0.18) !important;
  color: var(--p) !important;
}
html[data-eg-theme="light"] .ptr-indicator.ready {
  border-color: rgba(63, 184, 187, 0.55) !important;
  box-shadow:
    0 8px 24px rgba(15, 23, 41, 0.15),
    0 0 0 3px rgba(63, 184, 187, 0.18),
    0 2px 12px rgba(63, 184, 187, 0.35) !important;
}
html[data-eg-theme="light"] .ptr-indicator.refreshing {
  border-color: rgba(35, 137, 199, 0.55) !important;
  box-shadow:
    0 8px 24px rgba(15, 23, 41, 0.15),
    0 2px 12px rgba(35, 137, 199, 0.35) !important;
}
/* The inline-stroked background ring inside the SVG (rgba(255,255,255,.15))
 * is invisible on white. Override via attribute selector on the circle. */
html[data-eg-theme="light"] .ptr-indicator .ptr-ring-bg {
  stroke: rgba(15, 23, 41, 0.12) !important;
}

/* PTR safety: when none of {active,ready,refreshing} is set the indicator
 * MUST be invisible and not catch pointer events. Some browsers leave the
 * disc on screen after touchend because the base rule only sets opacity:0
 * without visibility. Force hide at rest. */
.ptr-indicator:not(.active):not(.ready):not(.refreshing) {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ===========================================================================
 * 8. LP COMPONENTS — light-mode repaint using ACTUAL classnames in ja.html
 *    Source classes used:
 *      .hero-stats / .hero-stat / .hero-stat-val / .hero-stat-label / .hero-stat-sep
 *      .hero-float-cards / .hero-float-card / .hero-float-card-dot
 *      .lp-event-card / .lp-event-card-title / .lp-event-card-meta
 *      .lp-event-card-arrow / .lp-section-header / .features-title
 *      .badge .badge-purple .badge-blue
 *      .reveal (IntersectionObserver-driven; needs safety fallback)
 *
 *    These were previously coded against incorrect names (.stat-card / .stat-num),
 *    so nothing applied. Fixed below. Dark mode untouched.
 * ========================================================================= */

/* ── .reveal safety fallback (CSS-side belt-and-braces) ──────────────────
 * Primary fix is in enhance.js (forceRevealVisible). This CSS provides a
 * second safety: if enhance.js doesn't run for any reason, .reveal elements
 * will at least transition in once IntersectionObserver fires OR after a
 * delayed override below. We avoid CSS @keyframes here because it collided
 * with the source page's per-element animation:fadeUp .7s. */
.reveal {
  /* Force minimum visibility after 2s. transition stays the same on the
   * source rule — this just nudges the final state. */
  transition:
    opacity 0.6s var(--ease, ease) 2s,
    transform 0.6s var(--ease, ease) 2s !important;
}
.reveal:not(.visible) {
  /* keep opacity:0 from source by default */
}
.reveal.visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
  /* No delay — IntersectionObserver / JS forced this in */
  transition:
    opacity 0.45s var(--ease, ease),
    transform 0.45s var(--ease, ease) !important;
}

/* ── Defensive: the .hero-stats container should NEVER show a box.
 * Some browsers in light mode were showing a faint outline. Strip it. */
.hero-stats { background: transparent !important; border: 0 !important; box-shadow: none !important; }

/* ── .hero-stat-val (the 5 / 3 numbers next to 会員 / イベント) ─────────────
 * Original uses gradient text var(--p)→var(--s). On light that's still
 * #339CDD→#54CCCF which is visible BUT thin in 1.75rem. Strengthen with
 * a deeper start point and bump weight. */
html[data-eg-theme="light"] .hero-stat-val {
  background: linear-gradient(135deg,
      var(--acc) 0%, var(--p) 55%, var(--s) 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  text-shadow: none;
}
html[data-eg-theme="light"] .hero-stat-label {
  color: rgba(15, 23, 41, 0.55) !important;
}
html[data-eg-theme="light"] .hero-stat-sep {
  background: rgba(15, 23, 41, 0.18) !important;
}

/* ── .hero-float-card (ライブQ&A稼働中 / QRチェックイン対応 / 日英完全対応) ──
 * Source: bg rgba(255,255,255,.05) + border rgba(255,255,255,.10).
 * On white these become invisible → exactly the empty 折り紙 boxes. */
html[data-eg-theme="light"] .hero-float-card {
  background: rgba(255, 255, 255, 0.82) !important;
  border: 1px solid rgba(35, 137, 199, 0.22) !important;
  color: var(--txt) !important;
  box-shadow:
    0 4px 14px -6px rgba(35, 137, 199, 0.18),
    0 1px 2px rgba(15, 23, 41, 0.04) !important;
  backdrop-filter: blur(10px);
}
html[data-eg-theme="light"] .hero-float-card-dot {
  background: #16a34a !important;
  box-shadow: 0 0 8px rgba(22, 163, 74, 0.7) !important;
}

/* ── .lp-event-card (the event cards below the hero) ──────────────────── */
html[data-eg-theme="light"] .lp-event-card {
  background: #FFFFFF !important;
  border: 1px solid rgba(15, 23, 41, 0.10) !important;
  box-shadow:
    0 2px 8px -2px rgba(15, 23, 41, 0.06),
    0 1px 2px rgba(15, 23, 41, 0.04);
}
html[data-eg-theme="light"] .lp-event-card:hover {
  border-color: rgba(35, 137, 199, 0.35) !important;
  transform: translateY(-4px);
  box-shadow:
    0 14px 36px -16px rgba(35, 137, 199, 0.30),
    0 4px 10px -4px rgba(15, 23, 41, 0.10) !important;
}
html[data-eg-theme="light"] .lp-event-card-title {
  color: var(--txt) !important;
}
html[data-eg-theme="light"] .lp-event-card-meta {
  color: rgba(15, 23, 41, 0.55) !important;
}
html[data-eg-theme="light"] .lp-event-card-arrow {
  background: rgba(35, 137, 199, 0.08) !important;
  border-color: rgba(35, 137, 199, 0.25) !important;
  color: var(--p) !important;
}

/* ── Badges on event cards (badge-purple / badge-blue) ──────────────────
 * Originals use #c4b5fd / #7dd3fc text on light tinted bg → readable-ish
 * on dark, but on white the very pale fg becomes faint. Darken. */
html[data-eg-theme="light"] .badge-purple {
  background: rgba(124, 58, 237, 0.10) !important;
  color: #6d28d9 !important;
  border-color: rgba(124, 58, 237, 0.30) !important;
}
html[data-eg-theme="light"] .badge-blue {
  background: rgba(35, 137, 199, 0.10) !important;
  color: var(--acc) !important;
  border-color: rgba(35, 137, 199, 0.30) !important;
}

/* ── Section headings on LP ──────────────────────────────────────────── */
html[data-eg-theme="light"] .features-label {
  color: var(--acc) !important;
}
html[data-eg-theme="light"] .features-sub {
  color: rgba(15, 23, 41, 0.60) !important;
}
html[data-eg-theme="light"] .section-title {
  color: var(--acc) !important;
}

/* ── Ambient orbs — light variants ──────────────────────────────────── */
html[data-eg-theme="light"] .orb-1 {
  background: radial-gradient(circle, rgba(35, 137, 199, 0.18) 0%, transparent 70%) !important;
}
html[data-eg-theme="light"] .orb-2 {
  background: radial-gradient(circle, rgba(63, 184, 187, 0.16) 0%, transparent 70%) !important;
}
html[data-eg-theme="light"] .orb-3 {
  background: radial-gradient(circle, rgba(0, 80, 170, 0.10) 0%, transparent 70%) !important;
}

/* ───────────────────────────────────────────────────────────────────────
 * Buttons — refined for light
 * ─────────────────────────────────────────────────────────────────── */
html[data-eg-theme="light"] .btn-secondary {
  background: #FFFFFF !important;
  border: 1px solid rgba(15, 23, 41, 0.18) !important;
  color: var(--txt) !important;
  box-shadow: 0 1px 2px rgba(15, 23, 41, 0.05);
}
html[data-eg-theme="light"] .btn-secondary:hover {
  border-color: var(--p) !important;
  color: var(--p) !important;
  background: rgba(35, 137, 199, 0.05) !important;
}
html[data-eg-theme="light"] .btn-primary {
  box-shadow:
    0 10px 24px -10px rgba(35, 137, 199, 0.45),
    0 2px 6px -2px rgba(35, 137, 199, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.30) !important;
}
html[data-eg-theme="light"] .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow:
    0 14px 32px -10px rgba(35, 137, 199, 0.55),
    0 4px 10px -2px rgba(35, 137, 199, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.40) !important;
}

/* Primary CTA sheen sweep — works both themes */
.btn-primary {
  position: relative;
  overflow: hidden;
}
.btn-primary::after {
  content: "";
  position: absolute;
  top: 0; left: -120%;
  width: 60%; height: 100%;
  background: linear-gradient(110deg,
      transparent 0%,
      rgba(255, 255, 255, 0.28) 50%,
      transparent 100%);
  transform: skewX(-22deg);
  transition: left 0.7s cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
}
.btn-primary:hover::after { left: 130%; }

/* ===========================================================================
 * 9. HERO UNIFIED REDESIGN  (ja.html / en.html — top hero section)
 *
 * Rationale
 * ---------
 * Previous patches kept adding individual !important overrides which created
 * stacking conflicts (e.g. .hero-bg with linear-gradient ending in #020c1e
 * was being painted under the light aurora; .hero-float-card was invisible
 * because rgba(255,255,255,.05) reads as white-on-white; the scroll line
 * was rendered as a 1px sub-pixel gradient that disappeared on mobile DPI;
 * the empty box below "5 | 3" was actually compounded margin between
 * .hero-actions → .hero-stats → .hero-float-cards).
 *
 * This section takes hero ownership end-to-end for BOTH themes:
 *   - normalises vertical rhythm (one consistent gap instead of compound margins)
 *   - makes hero-float-card always readable (dark: smoked glass; light: white card)
 *   - guarantees SCROLL has a visible 2px line (not 1px) using box-shadow as
 *     a redundant render path so it survives sub-pixel rounding
 *   - kills the dark-navy .hero-bg terminator on light by painting an opaque
 *     light gradient OVER the inline source gradient
 *   - mirrors the same polish onto dark mode so the portal looks designed,
 *     not duct-taped.
 * ========================================================================= */

/* ── 9a. HERO vertical rhythm — one source of truth for spacing ────────── */
.hero { padding: 5.5rem 1.5rem 8rem !important; }
.hero-content > * + * { margin-top: 0; }
.hero-eyebrow   { margin-bottom: 1.5rem !important; }
.hero-title     { margin-bottom: 1rem !important; }
.hero-sub       { margin-bottom: 2.25rem !important; }
.hero-actions   { margin-bottom: 0 !important; }
.hero-stats     { margin-top: 2.5rem !important; margin-bottom: 0 !important; }
.hero-float-cards {
  margin-top: 1.75rem !important;
  margin-bottom: 0 !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: 0.6rem !important;
}

/* ── 9b. HERO background — guarantee no dark band on light ─────────────── */
html[data-eg-theme="light"] .hero {
  background:
    radial-gradient(ellipse 95% 80% at 50% -12%, rgba(35,137,199,0.14) 0%, transparent 65%),
    radial-gradient(ellipse 60% 55% at 88% 92%, rgba(84,204,207,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 50% 45% at 8% 78%, rgba(0,80,170,0.09) 0%, transparent 60%),
    linear-gradient(180deg, #FFFFFF 0%, #F1F7FC 55%, #E8F1F8 100%) !important;
}
html[data-eg-theme="light"] .hero-bg,
html[data-eg-theme="light"] .hero-grid {
  display: none !important;
}

/* ── 9c. hero-float-card — readable in BOTH themes ─────────────────────── */
.hero-float-card {
  font-size: 0.84rem !important;
  font-weight: 600 !important;
  padding: 0.6rem 1rem !important;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  white-space: nowrap !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}
/* DARK — keep the existing smoked glass but harden it so the pills aren't
 * mistaken for empty boxes. Solid-ish bg + visible border. */
html:not([data-eg-theme="light"]) .hero-float-card,
html[data-eg-theme="dark"] .hero-float-card {
  background: rgba(20, 40, 65, 0.62) !important;
  border: 1px solid rgba(120, 200, 235, 0.22) !important;
  color: #DDEBF5 !important;
  box-shadow:
    0 2px 12px -4px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.05) !important;
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
}
/* LIGHT — white card with brand-tinted border and subtle shadow */
html[data-eg-theme="light"] .hero-float-card {
  background: #FFFFFF !important;
  border: 1px solid rgba(35,137,199,0.22) !important;
  color: #1B2740 !important;
  box-shadow:
    0 4px 14px -6px rgba(35,137,199,0.20),
    0 1px 2px rgba(15,23,41,0.04) !important;
}
.hero-float-card:hover { transform: translateY(-1px); }
html[data-eg-theme="light"] .hero-float-card:hover {
  box-shadow:
    0 8px 22px -8px rgba(35,137,199,0.32),
    0 2px 4px rgba(15,23,41,0.06) !important;
}
.hero-float-card-dot {
  width: 7px !important; height: 7px !important; flex-shrink: 0;
  border-radius: 50% !important;
  background: #22c55e !important;
  box-shadow: 0 0 8px rgba(34,197,94,0.65) !important;
  animation: heroDotPulse 1.8s ease-in-out infinite;
}
@keyframes heroDotPulse {
  0%,100% { transform: scale(1);   opacity: 1;   }
  50%     { transform: scale(1.3); opacity: 0.7; }
}

/* ── 9d. SCROLL cue — guarantee the line is visible at every DPI ──────── */
.hero-scroll {
  position: absolute !important;
  bottom: 2rem !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 0.55rem !important;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  font-size: 0.68rem !important;
  letter-spacing: 0.18em !important;
  text-transform: uppercase !important;
  font-weight: 700 !important;
  opacity: 1 !important;
}
/* Use a 2px wide line (not 1px) so sub-pixel rounding never zeros it out.
 * Add a box-shadow fallback for retina screens where the gradient might
 * lose its centre stop. */
.hero-scroll-line {
  display: block !important;
  width: 2px !important;
  height: 40px !important;
  border-radius: 2px !important;
  background: linear-gradient(180deg,
    rgba(51,156,221,0) 0%,
    rgba(51,156,221,1) 50%,
    rgba(51,156,221,0) 100%) !important;
  box-shadow: 0 0 6px rgba(51,156,221,0.35) !important;
  animation: scrollLineV2 1.8s ease-in-out infinite !important;
}
@keyframes scrollLineV2 {
  0%,100% { opacity: 0.55; transform: scaleY(0.85); }
  50%     { opacity: 1;    transform: scaleY(1.15); }
}
/* Dark scroll text */
html:not([data-eg-theme="light"]) .hero-scroll,
html[data-eg-theme="dark"] .hero-scroll {
  color: rgba(220, 236, 250, 0.62) !important;
}
/* Light scroll text + line tint */
html[data-eg-theme="light"] .hero-scroll {
  color: rgba(15,23,41,0.58) !important;
}
html[data-eg-theme="light"] .hero-scroll-line {
  background: linear-gradient(180deg,
    rgba(35,137,199,0) 0%,
    rgba(35,137,199,1) 50%,
    rgba(35,137,199,0) 100%) !important;
  box-shadow: 0 0 6px rgba(35,137,199,0.30) !important;
}

/* ── 9e. hero-stats — bigger, more confident numbers ───────────────────── */
.hero-stats {
  display: inline-flex !important;
  align-items: center !important;
  gap: 1.75rem !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}
.hero-stat-val {
  font-size: 2rem !important;
  font-weight: 900 !important;
  letter-spacing: -0.045em !important;
  line-height: 1 !important;
}
.hero-stat-label {
  font-size: 0.7rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  margin-top: 0.35rem !important;
  display: block !important;
}
.hero-stat-sep {
  width: 1px !important;
  height: 32px !important;
  align-self: center !important;
}
html:not([data-eg-theme="light"]) .hero-stat-sep,
html[data-eg-theme="dark"] .hero-stat-sep {
  background: rgba(255,255,255,0.18) !important;
}
html[data-eg-theme="light"] .hero-stat-sep {
  background: rgba(15,23,41,0.16) !important;
}
html[data-eg-theme="light"] .hero-stat-label {
  color: rgba(15,23,41,0.55) !important;
}

/* ── 9f. Dark hero polish — make the portal look DESIGNED, not patched ── */
html:not([data-eg-theme="light"]) .hero-title-grad,
html[data-eg-theme="dark"] .hero-title-grad {
  background: linear-gradient(120deg,
    #FFFFFF 0%,
    #C6E4F5 35%,
    #54CCCF 65%,
    #339CDD 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

/* Mobile: tighten paddings, shrink stat numbers slightly */
@media (max-width: 640px) {
  .hero { padding: 4.5rem 1.25rem 7rem !important; }
  .hero-stat-val { font-size: 1.75rem !important; }
  .hero-stats { gap: 1.25rem !important; }
  .hero-float-cards { gap: 0.5rem !important; margin-top: 1.5rem !important; }
  .hero-float-card { font-size: 0.78rem !important; padding: 0.5rem 0.85rem !important; }
}

/* ===========================================================================
 * 10. HERO GIMMICKS (paired with the JS in enhance.js heroGimmicks IIFE)
 *
 * Visual language
 * ---------------
 *   - LIVE PULSE: red heartbeat dot + small uppercase label, pill-shaped.
 *     Sits above the eyebrow on its own line. Reads as "this is live, not
 *     a screenshot."
 *   - rotating tagline: monospaced ↳ arrow + animated text, indents under
 *     the sub-copy. Vertical motion of 6px on swap.
 *   - cursor-glare: a 320px radial highlight that follows the pointer at
 *     `--gx,--gy`. Multiply-friendly mix-blend so it adds light, not haze.
 *   - flow particles: handled in SVG by the JS, just needs filter/blur.
 *   - CTA microbadge: a tiny 11px chip pinned to the right of the primary
 *     CTA, signalling "3件受付中".
 * ========================================================================= */

/* ── 10a. LIVE PULSE pill ─────────────────────────────────────────────── */
/* v11: dock to the TOP-LEFT of the hero-title. Hero is text-align:center;
 * we wrap the pulse in a flex row that pushes itself to the left edge of
 * the title block, sitting just above it. */
.eg-live-pulse {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  padding: 0.35rem 0.85rem 0.35rem 0.55rem !important;
  border-radius: 999px !important;
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em !important;
  /* anchor to the left, not centred */
  margin: 0 0 0.65rem 0 !important;
  align-self: flex-start;
  animation: egPulsePillFadeIn 0.7s var(--ease, ease) 0.05s both;
}
/* Wrap the title + pulse in a left-aligned column so the pulse pins to
 * the title's left edge. We toggle the hero-content to flex-column with
 * align-items:flex-start ONLY around the title block via a JS-applied
 * wrapper. CSS hook below. */
.eg-title-block {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  text-align: left;
}
.eg-title-block .hero-title { text-align: left !important; margin: 0 !important; }
html:not([data-eg-theme="light"]) .eg-live-pulse,
html[data-eg-theme="dark"] .eg-live-pulse {
  background: rgba(220, 38, 38, 0.10);
  border: 1px solid rgba(220, 38, 38, 0.30);
  color: #FFD3D1;
  box-shadow:
    0 0 0 1px rgba(220, 38, 38, 0.05),
    0 6px 18px -8px rgba(220, 38, 38, 0.45);
}
html[data-eg-theme="light"] .eg-live-pulse {
  background: rgba(220, 38, 38, 0.06);
  border: 1px solid rgba(220, 38, 38, 0.28);
  color: #B91C1C;
}
.eg-live-pulse-dot {
  position: relative;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  animation: egHeartbeat 2.6s ease-out infinite;
  flex-shrink: 0;
}
.eg-live-pulse-label {
  font-weight: 800 !important;
  letter-spacing: 0.16em !important;
  text-transform: uppercase;
}
.eg-live-pulse-sub {
  font-weight: 500 !important;
  letter-spacing: 0.02em !important;
  opacity: 0.8;
  padding-left: 0.4rem;
  border-left: 1px solid currentColor;
  margin-left: 0.1rem;
}
@keyframes egHeartbeat {
  0%   { box-shadow: 0 0 0 0   rgba(239, 68, 68, 0.65); transform: scale(1); }
  50%  { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);    transform: scale(1.15); }
  100% { box-shadow: 0 0 0 0   rgba(239, 68, 68, 0);    transform: scale(1); }
}
@keyframes egPulsePillFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (max-width: 520px) {
  .eg-live-pulse-sub { display: none; }
  .eg-live-pulse { padding: 0.3rem 0.75rem 0.3rem 0.5rem !important; }
}

/* ── 10b. Rotating tagline ─────────────────────────────────────────────── */
.eg-rotating-tagline {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  margin: -1.5rem auto 2rem !important;
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.4;
  max-width: 540px;
  text-align: left;
  opacity: 0;
  animation: egTaglineFadeIn 0.6s var(--ease, ease) 0.5s forwards;
}
.eg-rotating-tagline-arrow {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.95em;
  flex-shrink: 0;
}
.eg-rotating-tagline-text {
  display: inline-block;
  transition: opacity 0.28s ease, transform 0.28s ease;
}
html:not([data-eg-theme="light"]) .eg-rotating-tagline,
html[data-eg-theme="dark"] .eg-rotating-tagline {
  color: rgba(220, 236, 250, 0.78);
}
html:not([data-eg-theme="light"]) .eg-rotating-tagline-arrow,
html[data-eg-theme="dark"]      .eg-rotating-tagline-arrow {
  color: #54CCCF;
}
html[data-eg-theme="light"] .eg-rotating-tagline {
  color: rgba(15, 23, 41, 0.72);
}
html[data-eg-theme="light"] .eg-rotating-tagline-arrow {
  color: var(--acc, #0050AA);
}
@keyframes egTaglineFadeIn {
  to { opacity: 1; }
}

/* ── 10c. Cursor glare (desktop only — JS gates this) ─────────────────── */
.eg-cursor-glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
  background:
    radial-gradient(circle 320px at var(--gx, 50%) var(--gy, 50%),
      rgba(84, 204, 207, 0.18) 0%,
      rgba(51, 156, 221, 0.10) 30%,
      transparent 70%);
  mix-blend-mode: screen;
}
html[data-eg-theme="light"] .eg-cursor-glare {
  background:
    radial-gradient(circle 320px at var(--gx, 50%) var(--gy, 50%),
      rgba(51, 156, 221, 0.14) 0%,
      rgba(84, 204, 207, 0.08) 30%,
      transparent 70%);
  mix-blend-mode: multiply;
}

/* ── 10d. Flow particles (SVG) — JS animated, CSS just adds glow ───────── */
.eg-flow-particle {
  /* filter declared inline by JS for cross-browser support */
}

/* ── 10e. CTA microbadge ───────────────────────────────────────────────── */
.hero-actions a.btn-primary {
  position: relative;
}
.eg-cta-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.65rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  position: relative;
  top: -1px;
}
.eg-cta-badge::before {
  content: '';
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.85);
  margin-right: 0.4rem;
  animation: egCtaDot 1.6s ease-in-out infinite;
}
@keyframes egCtaDot {
  0%,100% { opacity: 1;   transform: scale(1);   }
  50%     { opacity: 0.6; transform: scale(1.3); }
}

/* Mobile: stack the badge under the label so the CTA never wraps ugly */
@media (max-width: 420px) {
  .eg-cta-badge {
    margin-left: 0.4rem;
    font-size: 0.6rem;
    padding: 0.15rem 0.4rem;
  }
}

/* ── 10f. Reduced motion: kill all animations ─────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .eg-live-pulse,
  .eg-live-pulse-dot,
  .eg-rotating-tagline-text,
  .eg-cta-badge::before {
    animation: none !important;
  }
  .eg-cursor-glare { display: none !important; }
}

/* ===========================================================================
 * 11. v8 FIXES — user feedback (round #11)
 *
 *   a. Light theme hero hexagon network was dying into white-on-white.
 *      The source SVG uses rgba(51,156,221,0.07..0.18) strokes which are
 *      invisible on a light aurora background. Stamp the stroke darker in
 *      light mode (and bump opacity) so the network is *visible*.
 *
 *   b. Kill the 3 fake hero-float-cards (ライブQ&A稼働中 / 🎫QRチェックイン
 *      対応 / 🌏日英完全対応). They read as a "ハリボテ slideshow", not as
 *      product. We replace them via JS with a real, D1-backed live stat
 *      strip — but in case JS hasn't booted yet, hide them here.
 *
 *   c. Kill the rotating tagline with the ↳ arrow. Variable text width
 *      makes the arrow jiggle; the user called it "ダサい / やばい".
 *
 *   d. PWA install banner close-button position bug: on small viewports
 *      the .pwa-badge ('New') and the .pwa-close-btn were colliding at
 *      different times. Pin the close-btn HIGHER z-index and give it a
 *      proper hit area that does not collide with the badge regardless
 *      of badge size.
 *
 *   e. Locale slide-toggle (JP ⇄ EN) for the top nav. The bare 'EN' link
 *      reads as "broken text"; replace it with a 2-state pill toggle the
 *      user can clearly see is interactive.
 * ========================================================================= */

/* ── 11a. HEXAGON NETWORK — replaced by JS installHexagonNetwork() ────── */
/* The new SVG uses currentColor for all strokes/fills, so we control the
 * palette by setting `color` on the .hero-network container.
 * Subtle, premium, brand-blue. No grey. */
.hero-network { pointer-events: none; }
html:not([data-eg-theme="light"]) .hero-network,
html[data-eg-theme="dark"]       .hero-network {
  color: rgba(120, 200, 235, 0.32);
}
html[data-eg-theme="light"] .hero-network {
  color: rgba(35, 137, 199, 0.28);
}
/* Hex outline is the strongest line; diagonals are whisper-thin */
.eg-hex-outline {
  stroke-width: 1.1 !important;
  opacity: 0.85;
}
.eg-hex-spoke {
  stroke-width: 0.75 !important;
  opacity: 0.55;
}
.eg-hex-diag {
  stroke-width: 0.45 !important;
  opacity: 0.35;
}
/* Vertex nodes — slightly brighter than the lattice so they read as nodes */
html:not([data-eg-theme="light"]) .eg-hex-node,
html[data-eg-theme="dark"] .eg-hex-node {
  fill: rgba(84, 204, 207, 0.85) !important;
  filter: drop-shadow(0 0 4px rgba(84, 204, 207, 0.45));
}
html[data-eg-theme="light"] .eg-hex-node {
  fill: rgba(35, 137, 199, 0.85) !important;
  filter: drop-shadow(0 0 3px rgba(35, 137, 199, 0.35));
}
/* Subtle glow on the whole lattice for both themes */
html:not([data-eg-theme="light"]) .hero-network,
html[data-eg-theme="dark"] .hero-network {
  filter: drop-shadow(0 0 8px rgba(84, 204, 207, 0.10));
}
html[data-eg-theme="light"] .hero-network {
  filter: drop-shadow(0 0 6px rgba(35, 137, 199, 0.08));
}
/* Data-flow particles ride the brand palette in both modes */
html:not([data-eg-theme="light"]) .eg-flow-particle,
html[data-eg-theme="dark"] .eg-flow-particle {
  fill: rgba(132, 218, 220, 0.95) !important;
}
html[data-eg-theme="light"] .eg-flow-particle {
  fill: rgba(35, 137, 199, 0.90) !important;
}

/* ── 11b. KILL the 3 fake float cards in BOTH themes ──────────────────── */
.hero-float-cards,
.hero-float-card { display: none !important; }

/* ── 11c. KILL the rotating tagline (variable width, jiggly arrow) ────── */
.eg-rotating-tagline { display: none !important; }

/* ── 11d. PWA install close button — fix collision with .pwa-badge ─────
 *   - elevate z-index above badge
 *   - move closer to corner so it never lands under the badge
 *   - enforce 44x44 hit target (Apple HIG)                              */
.pwa-close-btn {
  position: absolute !important;
  top: 0.55rem !important;
  right: 0.55rem !important;
  width: 32px !important;
  height: 32px !important;
  z-index: 30 !important;
  background: rgba(15, 23, 41, 0.55) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.pwa-close-btn::before {
  /* enlarge tap target without moving the visible button */
  content: '' !important;
  position: absolute !important;
  inset: -10px !important;
  border-radius: 50% !important;
}
.pwa-close-btn svg { width: 14px !important; height: 14px !important; color: #fff !important; }
/* Push the New badge LEFT so it can never overlap the X */
.pwa-badge {
  left: 1rem !important;
  right: auto !important;
  z-index: 20 !important;
  max-width: calc(100% - 4rem) !important;
}
/* iOS body padding-top so badge + close-btn always have room */
.pwa-body { padding-top: 2.6rem !important; }

/* ── 11e. NAV LOCALE SLIDE TOGGLE (JP ⇄ EN) ───────────────────────────── */
.eg-locale-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 78px;
  height: 28px;
  padding: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  cursor: pointer;
  user-select: none;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-left: 0.6rem;
  transition: background 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
html[data-eg-theme="light"] .eg-locale-toggle {
  background: rgba(7, 49, 100, 0.06);
  border-color: rgba(7, 49, 100, 0.20);
}
.eg-locale-toggle:hover { border-color: rgba(84, 204, 207, 0.45); }
.eg-locale-toggle-knob {
  position: absolute;
  top: 2px; left: 2px;
  width: calc(50% - 2px);
  height: calc(100% - 4px);
  border-radius: 999px;
  background: linear-gradient(180deg, #54CCCF 0%, #339CDD 100%);
  box-shadow: 0 4px 12px -4px rgba(51, 156, 221, 0.55);
  transition: transform 0.28s cubic-bezier(.7,.2,.2,1.2);
  z-index: 1;
}
.eg-locale-toggle[data-active="en"] .eg-locale-toggle-knob {
  transform: translateX(100%);
}
.eg-locale-toggle-label {
  position: relative;
  z-index: 2;
  flex: 1;
  text-align: center;
  line-height: 1;
  color: rgba(220, 236, 250, 0.55);
  transition: color 0.2s ease;
}
html[data-eg-theme="light"] .eg-locale-toggle-label {
  color: rgba(7, 49, 100, 0.55);
}
.eg-locale-toggle[data-active="ja"] .eg-locale-toggle-label[data-loc="ja"],
.eg-locale-toggle[data-active="en"] .eg-locale-toggle-label[data-loc="en"] {
  color: #fff;
}
/* Hide the bare 'EN'/'JP' anchor that lived in the navbar — we replaced it */
a.nav-locale[data-eg-replaced="1"] { display: none !important; }

/* ── 11f. Engineers GUILD identity overrides ───────────────────────────── */
/* The mirror still says "Engineers GUILD" in the hero gradient. JS swaps the
 * text, but we also tighten the gradient so the new wordmark reads. */
.hero-title-grad {
  /* let JS set textContent; keep gradient legible in both themes */
  background-clip: text !important;
  -webkit-background-clip: text !important;
}

/* ===========================================================================
 * 12. v9 FIXES — user feedback (round #12)
 *
 *   a. LIVE pill must be BLUE, not red — Engineers GUILD brand is blue.
 *   b. PWA install banner is too tall and covers half the screen, the
 *      top whitespace is wasted, and in light theme the body has a
 *      grey wash that the user doesn't want. Compact it.
 *   c. Locale toggle (JP⇄EN) must sit to the LEFT of the theme button.
 *   d. .hero-sub will be relocated below the hero (JS does the move);
 *      this rule centers it nicely between SCROLL and 直近のイベント.
 *   e. .hero-eyebrow needs to land BELOW the hero-title (JS moves it).
 * ========================================================================= */

/* ── 12a. LIVE pulse → BLUE brand ─────────────────────────────────────── */
html:not([data-eg-theme="light"]) .eg-live-pulse,
html[data-eg-theme="dark"] .eg-live-pulse {
  background: rgba(51, 156, 221, 0.12) !important;
  border: 1px solid rgba(51, 156, 221, 0.42) !important;
  color: #C6E4F5 !important;
  box-shadow:
    0 0 0 1px rgba(51, 156, 221, 0.08),
    0 6px 18px -8px rgba(51, 156, 221, 0.45) !important;
}
html[data-eg-theme="light"] .eg-live-pulse {
  background: rgba(51, 156, 221, 0.10) !important;
  border: 1px solid rgba(35, 137, 199, 0.40) !important;
  color: #0050AA !important;
}
.eg-live-pulse-dot {
  background: #339CDD !important;
  box-shadow: 0 0 0 0 rgba(51, 156, 221, 0.7) !important;
}
@keyframes egHeartbeat {
  0%   { box-shadow: 0 0 0 0   rgba(51, 156, 221, 0.65); transform: scale(1); }
  50%  { box-shadow: 0 0 0 8px rgba(51, 156, 221, 0);    transform: scale(1.15); }
  100% { box-shadow: 0 0 0 0   rgba(51, 156, 221, 0);    transform: scale(1); }
}

/* ── 12b. PWA install banner — compact, kill grey wash ─────────────────── */
#pwa-prompt {
  /* allow content to size itself; don't force min-heights */
}
.pwa-sheet {
  max-width: 92vw !important;
  padding: 0.85rem 1rem 1rem !important;
  border-radius: 18px !important;
}
.pwa-body {
  padding-top: 0.4rem !important;   /* was 2.6rem in 11d, way too tall */
  padding-bottom: 0.2rem !important;
  display: flex !important;
  align-items: flex-start !important;
  gap: 0.75rem !important;
}
/* LIGHT MODE — remove the grey wash on the sheet body; pure white */
html[data-eg-theme="light"] .pwa-sheet {
  background: #FFFFFF !important;
  border: 1px solid rgba(35,137,199,0.18) !important;
  box-shadow:
    0 12px 32px -10px rgba(15,23,41,0.18),
    0 2px 6px rgba(15,23,41,0.04) !important;
}
html[data-eg-theme="light"] .pwa-body,
html[data-eg-theme="light"] .pwa-text,
html[data-eg-theme="light"] .pwa-icon-wrap {
  background: transparent !important;
}
html[data-eg-theme="light"] .pwa-title { color: #0B1530 !important; }
html[data-eg-theme="light"] .pwa-sub { color: rgba(15,23,41,0.62) !important; }
html[data-eg-theme="light"] .pwa-close-btn {
  background: rgba(15, 23, 41, 0.06) !important;
  border-color: rgba(15, 23, 41, 0.14) !important;
}
html[data-eg-theme="light"] .pwa-close-btn svg { color: #0B1530 !important; }
/* Slimmer title + sub */
.pwa-title { font-size: 0.92rem !important; line-height: 1.35 !important; }
.pwa-sub {
  font-size: 0.78rem !important;
  line-height: 1.5 !important;
  margin-top: 0.25rem !important;
  /* v30.1: explicit 2-line via <br> from JS, centered.
   * Block layout (default) honours <br> faithfully; previous
   * -webkit-line-clamp swallowed the line break on some engines. */
  text-align: center !important;
  white-space: normal !important;
}
/* v28.1: title also centered to match the centered sub */
.pwa-title { text-align: center !important; }
.pwa-icon-wrap { width: 40px !important; height: 40px !important; flex-shrink: 0; }
.pwa-icon-wrap svg, .pwa-icon-wrap img { width: 100% !important; height: 100% !important; }
/* v28.1: simplified phone icon — accent color, no fake-logo backdrop */
.pwa-icon-wrap.eg-pwa-icon-simple {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  border: none !important;
  color: var(--p, #339cdd) !important;
}
.pwa-icon-wrap.eg-pwa-icon-simple svg {
  width: 28px !important;
  height: 28px !important;
}
/* v28.1: the title/sub column takes the remaining space; icon stays left */
.pwa-text {
  flex: 1 1 auto !important;
  min-width: 0 !important;
}
/* v28.1: iOS step row — center the whole row */
.pwa-ios-steps {
  text-align: center !important;
}
.pwa-ios-arrow {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.4rem !important;
  flex-wrap: wrap;
  margin: 0 auto !important;
  padding: 0.55rem 0.75rem !important;
}
/* Position: dock to bottom with safe gap, never half-screen */
#pwa-prompt {
  position: fixed !important;
  left: 0; right: 0; bottom: 0 !important;
  padding: 0 0.6rem max(0.6rem, env(safe-area-inset-bottom)) !important;
  z-index: 80 !important;
}
.pwa-sheet { margin: 0 auto !important; }
/* Make sure the New badge doesn't stretch height */
.pwa-badge {
  position: absolute !important;
  top: -0.65rem !important;
  left: 0.85rem !important;
  font-size: 0.58rem !important;
  padding: 0.12rem 0.45rem !important;
}

/* ── 12c. Locale toggle goes LEFT of the theme button ──────────────────── */
.eg-locale-toggle {
  margin-left: 0 !important;
  margin-right: 0.55rem !important;
  order: -1; /* if parent is flex */
}

/* ── 12d. Relocated hero-sub appears between hero and 直近のイベント ─── */
.eg-hero-sub-relocated {
  max-width: 640px;
  margin: 1.25rem auto 0;
  padding: 0 1.25rem;
  font-size: 1.02rem;
  font-weight: 500;
  line-height: 1.75;
  text-align: center;
}
html:not([data-eg-theme="light"]) .eg-hero-sub-relocated,
html[data-eg-theme="dark"] .eg-hero-sub-relocated {
  color: rgba(220, 236, 250, 0.82) !important;
}
html[data-eg-theme="light"] .eg-hero-sub-relocated {
  color: rgba(15, 23, 41, 0.78) !important;
}

/* ── 12e. The eyebrow now sits BELOW the title, not above it ───────────── */
.eg-eyebrow-below {
  margin: 0.5rem auto 2.25rem !important;
}

/* ===========================================================================
 * 13. v11 FIXES — round #14
 *
 *   a. eyebrow ("エンジニアによる…") MUST be plain text. No dot, no pill
 *      frame. The pill was meant for the hero of a generic landing page;
 *      under our title it reads as duplicate noise. Strip background,
 *      border, padding, and the pulsing dot.
 *   b. Mobile: hero is too tall, '直近のイベント' falls below the fold.
 *      Compress vertical paddings + tighten gaps so the events section
 *      starts before scroll on a 6.1" screen.
 *   c. CTA secondary button text was "フィードへ →" — meaningless given
 *      the user is unauthenticated and the page is the public portal.
 *      JS rewrites the textContent to a meaningful label per locale and
 *      drops the arrow. CSS only ensures alignment without the arrow.
 * ========================================================================= */

/* ── 13a. Eyebrow → pure text, no pill, no dot, CENTERED (v32) ────────── */
/* Selectors are layered to beat the inline page CSS that ships
 * `display:inline-flex; background:rgba(51,156,221,.1); border:...;
 *  border-radius:999px; padding:.32rem 1rem;` on `.hero-eyebrow`. */
.hero-eyebrow,
.hero-eyebrow.eg-eyebrow-below,
.hero .hero-content .hero-eyebrow,
html[data-eg-theme="dark"]  .hero-eyebrow,
html[data-eg-theme="light"] .hero-eyebrow {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  font-size: 0.92rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em !important;
  text-transform: none !important;
  line-height: 1.5 !important;
  /* v32: must be block (not inline-flex) so text-align:center actually
   * centres the text instead of just centring an inline pill. */
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  /* User directive: 「センタリングせよ、左上に寄ってるぞ」 */
  text-align: center !important;
  margin: 0.75rem auto 1.75rem !important;
}
html:not([data-eg-theme="light"]) .hero-eyebrow,
html[data-eg-theme="dark"] .hero-eyebrow {
  color: rgba(220, 236, 250, 0.78) !important;
}
html[data-eg-theme="light"] .hero-eyebrow {
  color: rgba(15, 23, 41, 0.72) !important;
}
/* Hide the inherited eyebrow dot completely */
.hero-eyebrow .hero-eyebrow-dot,
.hero-eyebrow-dot { display: none !important; }

/* ── 13b. Mobile hero compression — reveal '直近のイベント' above fold ── */
@media (max-width: 640px) {
  .hero {
    min-height: auto !important;
    padding: 3.25rem 1rem 4.5rem !important;
  }
  .hero-title { font-size: clamp(2rem, 9vw, 2.8rem) !important; margin: 0 !important; }
  .eg-live-pulse { margin-bottom: 0.55rem !important; }
  .hero-eyebrow { margin: 0.55rem auto 1.35rem !important; font-size: 0.86rem !important; text-align: center !important; }
  .hero-actions { margin-top: 1.25rem !important; gap: 0.65rem !important; }
  .hero-stats { margin-top: 1.5rem !important; gap: 1.25rem !important; }
  .hero-stat-val { font-size: 1.65rem !important; }
  /* Mobile: SCROLL hint disappears entirely. It has no information value
   * here — content already begins right under the hero — and trying to
   * statically render the absolute-positioned line caused it to leak
   * sideways next to the CTAs (v11 regression). Just hide it. */
  .hero-scroll { display: none !important; }
  /* network lattice can be slightly less tall so the hero box shrinks */
  .hero-network svg { transform: scale(0.92); transform-origin: center; }
}

/* ── 13c. CTA secondary button — no arrow, normal weight, full alignment─ */
.hero-actions a.btn-secondary,
.hero-actions a.btn-ghost {
  letter-spacing: 0.01em;
}



/* ============================================================
   v15 (2026-05-29): Auth-aware nav + login button + dedup
   ============================================================ */

/* Login button (shown to guests when no pulse_session cookie) */
.eg-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
  color: #fff !important;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 2px 12px rgba(14, 165, 233, 0.25);
  transition: transform .15s ease, box-shadow .15s ease;
  cursor: pointer;
}
.eg-login-btn:hover,
.eg-login-btn:focus {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.4);
  color: #fff !important;
}

/* Mobile login button stretches full width in slide-over */
.nav-mobile .eg-login-btn {
  display: block;
  text-align: center;
  margin: 8px 0 16px;
}

/* Mobile locale toggle (added by installMobileLocaleToggle) */
.eg-locale-toggle-mobile {
  display: block;
  padding: 12px 0;
  font-size: 0.95rem;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
  margin-top: 12px;
}

/* Hide duplicate feed posts (safety net; JS also sets display:none) */
article.feed-post[data-eg-dupe="1"] {
  display: none !important;
}

/* Hide gated nav elements with !important to win against any inline style */
[data-eg-gate="hidden"] {
  display: none !important;
}

/* ============================================================
   v16 (2026-05-29): Tier-aware UI + top-of-navbar locale pill
   ============================================================ */

/* Top-of-navbar JP/EN pill — positioned absolutely so it sits next to
   the logo on both desktop and mobile, never inside the hamburger. */
.eg-locale-pill-top {
  position: absolute;
  top: 50%;
  right: 110px;           /* leaves room for theme btn + hamburger */
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.25);
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  user-select: none;
  -webkit-user-select: none;
  z-index: 60;
  transition: background .15s ease, border-color .15s ease;
}
.eg-locale-pill-top:hover {
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(56, 189, 248, 0.5);
}
.eg-locale-pill-top .eg-lp-label {
  position: relative;
  z-index: 1;
  display: inline-block;
  padding: 4px 8px;
  color: rgba(148, 163, 184, 0.7);
  transition: color .15s ease;
}
.eg-locale-pill-top[data-active="ja"] .eg-lp-label[data-loc="ja"],
.eg-locale-pill-top[data-active="en"] .eg-lp-label[data-loc="en"] {
  color: #f8fafc;
}
.eg-locale-pill-top .eg-lp-knob {
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
  box-shadow: 0 1px 6px rgba(14, 165, 233, 0.45);
  transition: transform .2s cubic-bezier(.4,0,.2,1);
  z-index: 0;
}
.eg-locale-pill-top[data-active="ja"] .eg-lp-knob { transform: translateX(0); }
.eg-locale-pill-top[data-active="en"] .eg-lp-knob { transform: translateX(100%); }

@media (max-width: 768px) {
  .eg-locale-pill-top {
    right: 72px;  /* hamburger is closer to edge on mobile */
    font-size: 0.65rem;
  }
  .eg-locale-pill-top .eg-lp-label { padding: 3px 6px; }
}

/* Hide the in-hamburger locale link added in v15 (we have top-nav pill now) */
.eg-locale-toggle-mobile { display: none !important; }

/* Hide footer locale switcher entirely — we have one in the top nav */
.locale-switcher { display: none !important; }

/* Belt-and-braces hide for gated elements */
[data-eg-gate="hidden"] { display: none !important; }

/* Tier badge colours — make sure the badge in dropdown reflects real tier */
.dropdown-tier-badge.tier-guest { background: rgba(100, 116, 139, 0.16); color: #cbd5e1; }
.dropdown-tier-badge.tier-free  { background: rgba(255,255,255,.09);   color: rgba(255,255,255,.6); }
.dropdown-tier-badge.tier-paid  { background: rgba(51,156,221,.16);    color: #7dd3fc; }
.dropdown-tier-badge.tier-core  { background: rgba(167,139,250,.16);   color: #c4b5fd; }
.dropdown-tier-badge.tier-staff { background: rgba(245,158,11,.16);    color: #fcd34d; }
.dropdown-tier-badge.tier-owner { background: rgba(239,68,68,.16);     color: #fca5a5; }

/* ──────────────────────────────────────────────────────────────────
 * FOUC PREVENTION (v20): hide guest-forbidden UI until enhance.js
 * has resolved the user's tier via /auth/me.
 *
 * Default state: html[data-eg-tier-resolved] is absent (or "false").
 * In this state, we hide everything that should NOT show to a T1 guest.
 *
 * Once enhance.js sets html[data-eg-tier-resolved="true"], these rules
 * stop applying and applyTierGating() takes over (showing what each
 * tier is allowed to see, hiding what they aren't).
 *
 * This means: even if a guest momentarily lands on /ja/events with a
 * cold cache and slow JS, they will NEVER flash the admin link, the
 * hamburger drawer contents, the bottom tabbar, etc.
 * ────────────────────────────────────────────────────────────────── */
html:not([data-eg-tier-resolved="true"]) .nav-admin-link,
html:not([data-eg-tier-resolved="true"]) .nav-avatar-btn,
html:not([data-eg-tier-resolved="true"]) #nav-user-wrap,
html:not([data-eg-tier-resolved="true"]) .nav-dropdown,
html:not([data-eg-tier-resolved="true"]) .nav-hamburger,
html:not([data-eg-tier-resolved="true"]) #nav-hamburger,
html:not([data-eg-tier-resolved="true"]) .nav-mobile,
html:not([data-eg-tier-resolved="true"]) #nav-links,
html:not([data-eg-tier-resolved="true"]) .app-tabbar,
html:not([data-eg-tier-resolved="true"]) #open-post-btn,
html:not([data-eg-tier-resolved="true"]) #post-modal,
html:not([data-eg-tier-resolved="true"]) .fab-post,
html:not([data-eg-tier-resolved="true"]) .nav-links-desktop a[href*="/app/"],
html:not([data-eg-tier-resolved="true"]) .nav-mobile a[href*="/app/"],
html:not([data-eg-tier-resolved="true"]) .nav-mobile a[href*="/auth/logout"],
html:not([data-eg-tier-resolved="true"]) [data-eg-min-tier],
html:not([data-eg-tier-resolved="true"]) a[href*="/app/live"],
html:not([data-eg-tier-resolved="true"]) [data-eg-hardcoded-demo] {
  display: none !important;
}

/* ═══════════════════════════════════════════════════════════════════
 * v26: CLEAN MOBILE NAVIGATION
 *
 * Decisive split between TOP page (/ja, /en) and everything else.
 *
 *   TOP page  (body[data-eg-page="top"])
 *     SP top nav  : [logo] [empty space] [JP/EN] [theme] — that's it
 *     SP bottom   : no tabbar (we're on landing — buttons are inline)
 *     PC top nav  : unchanged (logo + links + JP/EN + theme + login)
 *
 *   AUTH pages (body[data-eg-page="auth"])
 *     SP top nav  : [logo] only
 *     SP bottom   : no tabbar
 *     PC top nav  : [logo] only
 *
 *   APP pages (body[data-eg-page="app"])
 *     SP top nav  : [logo] only  ←  no JP/EN, no theme, no links
 *     SP bottom   : tabbar = sole navigation (tier-gated)
 *     PC top nav  : unchanged
 *
 * No floating buttons anywhere. No hamburger anywhere.
 * Settings (JP/EN, theme) live in /app/me for signed-in users.
 * ═══════════════════════════════════════════════════════════════════ */

/* ── A. KILL ALL FLOATING BUTTONS (v23-v25 baggage) ───────────────── */
.eg-login-btn-floating,
.eg-logout-btn-floating,
.eg-locale-pill-top,
.eg-locale-toggle-floating,
.eg-theme-btn--floating {
  display: none !important;
}

/* ── A.1 v26.1: JP/EN + THEME ARE TOP-PAGE-ONLY (any breakpoint) ──── */
/* The native <a class="nav-locale">EN</a> links baked into the source
 * HTML must not show on auth/app pages either — the rule is identical
 * across mobile + desktop: language / theme are "set once on landing".
 */
body[data-eg-page="auth"] a.nav-locale,
body[data-eg-page="app"]  a.nav-locale,
body[data-eg-page="auth"] .eg-locale-toggle,
body[data-eg-page="app"]  .eg-locale-toggle,
body[data-eg-page="auth"] [data-eg-theme-btn],
body[data-eg-page="app"]  [data-eg-theme-btn] {
  display: none !important;
}

/* ── B. HAMBURGER + MOBILE DRAWER STAY DEAD ───────────────────────── */
.nav-hamburger,
#nav-hamburger,
.nav-mobile,
#nav-links {
  display: none !important;
}

/* ── C. MOBILE TOP-NAV RULES (≤768px) ─────────────────────────────── */
@media (max-width: 768px) {
  /* DEFAULT (app + auth pages): hide all top-nav links on mobile.
   * Only the logo is visible in the header. Tabbar handles navigation. */
  .nav-links-desktop {
    display: none !important;
  }
  /* No JP/EN and no theme toggle on app/auth pages on mobile.
   * They are top-page-only (configured once on landing). */
  body[data-eg-page="app"] .eg-locale-toggle,
  body[data-eg-page="auth"] .eg-locale-toggle,
  body[data-eg-page="app"] [data-eg-theme-btn],
  body[data-eg-page="auth"] [data-eg-theme-btn] {
    display: none !important;
  }

  /* TOP PAGE only: show a compact right-aligned cluster of
   * [JP/EN] + [theme btn] in the header. No nav links, no avatar.
   * Login CTA stays in the page body, not the header. */
  body[data-eg-page="top"] .nav-links-desktop {
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 0 !important;
    overflow: visible;
  }
  /* Hide every <a class="nav-link"> on the top page (these are
   * the link items — フィード / 分科会 / レポート / 管理). They
   * belong in the in-page CTA or — once signed-in — the tabbar. */
  body[data-eg-page="top"] .nav-links-desktop .nav-link {
    display: none !important;
  }
  /* Keep the .nav-right cluster (which contains the toggle + theme btn) */
  body[data-eg-page="top"] .nav-links-desktop .nav-right {
    display: flex !important;
    gap: 8px;
    flex-shrink: 0;
    margin-left: 0 !important;
  }
  /* Locale toggle on top page: pinned at a sensible size */
  body[data-eg-page="top"] .eg-locale-toggle {
    transform: scale(0.92);
    transform-origin: right center;
  }
}

/* ── D. AUTH PAGE: even on PC, strip nav down to the logo ─────────── */
body[data-eg-page="auth"] .nav-links-desktop .nav-link {
  display: none !important;
}
body[data-eg-page="auth"] .nav-links-desktop .nav-right {
  /* Keep theme/locale only for those who need it on PC, but hide on SP */
}
@media (max-width: 768px) {
  body[data-eg-page="auth"] .nav-links-desktop {
    display: none !important;
  }
}

/* ── E. BOTTOM TABBAR is THE mobile navigation (app pages only) ───── */
@media (max-width: 768px) {
  body[data-eg-page="top"]  .app-tabbar,
  body[data-eg-page="auth"] .app-tabbar {
    display: none !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════
 * v24: PORTAL DESIGN OVERHAUL
 *
 * 1. Kill the hexagon / orb ambient animation across every page.
 * 2. Replace with one cohesive, barely-perceptible smooth gradient
 *    background (light + dark). 60s motion cycle — vivid but tranquil.
 * 3. Floating ログアウト button (mirror of login btn) for signed-in.
 * 4. PC font-size + page-margin tune-up (containers were too cramped).
 * 5. Subtle scroll-driven gimmick + cohesive typographic rhythm.
 *
 * Treat the entire site, top to bottom, as one portal experience.
 * ═══════════════════════════════════════════════════════════════════ */

/* ──────────────────────────────────────────────────────────────────
 * v25: KILL THE HEXAGON, FOR REAL THIS TIME.
 * The hero-network SVG mesh and the .ambient orb cluster are gone.
 * The portal gradient sheet (body::before) is the only ambient now.
 * ────────────────────────────────────────────────────────────────── */
.ambient,
.hero-network,
svg.hero-network,
div.hero-network,
.eg-hex,
.eg-hex-group,
.eg-hex-node,
.eg-hex-outline,
.eg-hex-spoke,
.eg-hex-diag,
.hex-network,
.hero-bg-network,
.bg-network,
.network-bg,
[data-eg-hexnet] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  animation: none !important;
}

/* v25: Also kill the network particles overlay if any older inline JS
 * injected a <canvas> for it. */
canvas.eg-network-canvas,
canvas[data-eg-particles],
.eg-network-particles {
  display: none !important;
}

/* v25: ONE-LOGIN-BUTTON RULE.
 * Hide any inline header `.eg-login-btn` that isn't the floating one.
 * (enhance.js strips them at runtime, but belt-and-suspenders.) */
.eg-login-btn:not(.eg-login-btn-floating) {
  display: none !important;
}

/* ──────────────────────────────────────────────────────────────────
 * 24.2  Smooth, vivid, barely-perceptible portal gradient sheet.
 *   - 5-stop conic + radial blend
 *   - 60s rotate cycle (so slow you have to stare to notice)
 *   - Sits at z-index:0 over .ambient, under .container (z-index:1)
 *   - Different palettes for dark (default) and light themes
 *
 *   "うごいているかうごいていないかわからないくらい
 *    なめらかに あざやかに"
 * ────────────────────────────────────────────────────────────────── */
body::before {
  content: "";
  position: fixed;
  inset: -20vmax;            /* overflow margin so rotation never reveals edges */
  z-index: 0;
  pointer-events: none;
  background:
    /* Layer 1: vivid conic that slowly rotates */
    conic-gradient(
      from 0deg at 50% 50%,
      rgba(51,156,221,.20)   0deg,
      rgba(84,204,207,.16)  72deg,
      rgba(167,139,250,.14) 144deg,
      rgba(245,158,11,.10)  216deg,
      rgba(239,68,68,.10)   288deg,
      rgba(51,156,221,.20) 360deg
    ),
    /* Layer 2: deep radial wash that anchors color */
    radial-gradient(
      ellipse 80% 60% at 30% 25%,
      rgba(51,156,221,.18) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse 70% 55% at 75% 80%,
      rgba(167,139,250,.16) 0%,
      transparent 60%
    );
  background-blend-mode: screen, normal, normal;
  filter: blur(48px) saturate(1.15);
  animation: egPortalDrift 60s linear infinite;
  /* mix mode so it reads as light, not paint */
  mix-blend-mode: screen;
  opacity: .9;
}

@keyframes egPortalDrift {
  0%   { transform: rotate(0deg)   scale(1.05); }
  50%  { transform: rotate(180deg) scale(1.08); }
  100% { transform: rotate(360deg) scale(1.05); }
}

/* Light theme: tone down + recolor for white backgrounds */
html[data-eg-theme="light"] body::before {
  background:
    conic-gradient(
      from 0deg at 50% 50%,
      rgba(51,156,221,.10)   0deg,
      rgba(84,204,207,.08)  72deg,
      rgba(167,139,250,.07) 144deg,
      rgba(245,158,11,.06)  216deg,
      rgba(0,80,170,.06)    288deg,
      rgba(51,156,221,.10) 360deg
    ),
    radial-gradient(
      ellipse 80% 60% at 30% 25%,
      rgba(51,156,221,.12) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse 70% 55% at 75% 80%,
      rgba(167,139,250,.10) 0%,
      transparent 60%
    );
  background-blend-mode: multiply, normal, normal;
  filter: blur(56px) saturate(1.25);
  mix-blend-mode: multiply;
  opacity: .85;
}

/* Respect reduced-motion: just stop. Color still subtly there. */
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none !important; }
  .ambient .orb,
  .ambient .orb-1,
  .ambient .orb-2,
  .ambient .orb-3 { animation: none !important; }
}

/* ──────────────────────────────────────────────────────────────────
 * 24.3  Floating ログアウト button (mirror of .eg-login-btn-floating).
 *   - Top-right, fixed. Same vertical line as the login btn for guests.
 *   - Renders only when signed-in (controlled by enhance.js).
 *   - Subtle glass pill, brand-tinted hover.
 *   - Auto-hides on /auth/* pages.
 * ────────────────────────────────────────────────────────────────── */
.eg-logout-btn-floating {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 10000;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px 8px 12px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  color: rgba(255,255,255,.92);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: .02em;
  cursor: pointer;
  transition: transform .15s ease, background .2s, border-color .2s, box-shadow .2s;
  box-shadow: 0 2px 14px rgba(0,0,0,.28);
}
.eg-logout-btn-floating:hover {
  background: rgba(239,68,68,.18);
  border-color: rgba(239,68,68,.45);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(239,68,68,.28);
}
.eg-logout-btn-floating:active { transform: translateY(0); }
.eg-logout-btn-floating svg { display: block; }

html[data-eg-theme="light"] .eg-logout-btn-floating {
  background: rgba(255,255,255,.7);
  border-color: rgba(15,23,42,.12);
  color: #1e293b;
  box-shadow: 0 2px 14px rgba(15,23,42,.08);
}
html[data-eg-theme="light"] .eg-logout-btn-floating:hover {
  background: rgba(239,68,68,.10);
  border-color: rgba(239,68,68,.45);
  color: #b91c1c;
}

/* FOUC guard: hide until tier resolved (so guests never flash it) */
html:not([data-eg-tier-resolved="true"]) .eg-logout-btn-floating { display: none !important; }
/* Hide for guests (signed-out) */
html[data-eg-tier-resolved="true"][data-eg-tier="guest"] .eg-logout-btn-floating { display: none !important; }
/* Hide on auth pages */
body[data-eg-on-auth-page="1"] .eg-logout-btn-floating { display: none !important; }

/* When BOTH floating buttons could be visible (transient), keep them
 * from overlapping. (Login is shown only for guests; logout only when
 * signed-in — mutually exclusive in steady state.) */
.eg-login-btn-floating { z-index: 10000; }

/* On narrow widths, hide the text label, keep the icon */
@media (max-width: 380px) {
  .eg-logout-btn-floating .eg-logout-btn-label { display: none; }
  .eg-logout-btn-floating { padding: 8px 10px; }
}

/* ──────────────────────────────────────────────────────────────────
 * 24.4  PC font-size + page-margin global tune-up.
 *
 * User feedback: 'PCにおいて、基本的にフォントのサイズと、
 * ページの余白が合っていなさすぎる。調整しろ。'
 *
 * Issues observed:
 *   - .container max-width 1140px with px-1.5rem feels cramped
 *     at 1440-1920px viewports.
 *   - Body font ~15px on PC reads small for a portal/landing.
 *   - Section padding inconsistent across pages.
 *
 * Strategy: scope to wide viewports (≥1024px). Don't touch mobile.
 * ────────────────────────────────────────────────────────────────── */
@media (min-width: 1024px) {
  /* Slight uptick in baseline body type */
  html { font-size: 16.5px; }
  body { font-size: 1rem; line-height: 1.65; }

  /* Container: roomier max-width + breathing room on the sides */
  .container,
  main > .container,
  section > .container {
    max-width: 1200px !important;
    padding-left: 2rem !important;
    padding-right: 2rem !important;
  }
  .container-sm { max-width: 820px !important; padding-left: 2rem !important; padding-right: 2rem !important; }

  /* Headings: tighter leading, more weight */
  h1, .h1, .hero-title { font-size: clamp(2.4rem, 3.8vw, 3.4rem) !important; line-height: 1.08 !important; letter-spacing: -0.022em !important; }
  h2, .h2 { font-size: clamp(1.6rem, 2.4vw, 2.1rem) !important; line-height: 1.18 !important; letter-spacing: -0.015em !important; }
  h3, .h3 { font-size: clamp(1.18rem, 1.6vw, 1.4rem) !important; line-height: 1.28 !important; }

  /* Section vertical rhythm */
  section { padding-top: clamp(3rem, 6vh, 5rem); padding-bottom: clamp(3rem, 6vh, 5rem); }

  /* Nav: a hair more breathing room horizontally */
  .site-nav,
  nav.site-nav,
  header .site-nav { padding-left: 2rem !important; padding-right: 2rem !important; }

  /* Buttons read fine; nudge primary CTAs a touch larger */
  .nav-cta { padding: .5rem 1.3rem; font-size: .88rem; }

  /* Card grids: more generous gaps */
  .card-grid, .events-grid, .reports-grid {
    gap: clamp(1rem, 2vw, 1.75rem) !important;
  }
}

@media (min-width: 1440px) {
  .container, main > .container, section > .container { max-width: 1280px !important; }
  html { font-size: 17px; }
  /* Pull section padding outwards a bit more on very wide PCs */
  section { padding-top: clamp(4rem, 7vh, 6rem); padding-bottom: clamp(4rem, 7vh, 6rem); }
}

/* ──────────────────────────────────────────────────────────────────
 * 24.5  Cohesive portal gimmicks — subtle but present:
 *
 *   a. Section reveal: anything tagged [data-eg-reveal] fades+rises
 *      as it enters viewport (driven by IntersectionObserver in JS,
 *      with CSS-only fallback below).
 *   b. Card hover: gentle lift + glow that respects the brand.
 *   c. Link underline shimmer.
 *   d. Sticky-nav scroll glow once user scrolls past 80px.
 *   e. Gradient text utility (.eg-gradient-text) using the same hues
 *      as the portal sheet — so headers harmonize with background.
 *   f. Section divider with hairline glow.
 * ────────────────────────────────────────────────────────────────── */

/* a. Reveal: only animate IF the JS observer flips data-eg-revealed="1".
 * CSS-only fallback: assume visible (so no JS = no broken layout). */
[data-eg-reveal] {
  opacity: 1;
  transform: none;
  transition: opacity .9s cubic-bezier(.22,1,.36,1),
              transform .9s cubic-bezier(.22,1,.36,1);
}
html[data-eg-reveal-enabled="1"] [data-eg-reveal]:not([data-eg-revealed="1"]) {
  opacity: 0;
  transform: translateY(18px);
}

/* b. Gentle card lift */
.event-card, .report-card, .feed-post, .product-card, .subgroup-card {
  transition: transform .35s cubic-bezier(.22,1,.36,1),
              box-shadow .35s cubic-bezier(.22,1,.36,1),
              border-color .35s ease;
}
.event-card:hover, .report-card:hover, .product-card:hover, .subgroup-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 38px rgba(51,156,221,.16), 0 2px 8px rgba(0,0,0,.18);
}

/* c. Link shimmer (utility, opt-in via class) */
.eg-link-shimmer {
  position: relative;
  background-image: linear-gradient(90deg,
    rgba(51,156,221,0) 0%,
    rgba(51,156,221,.4) 50%,
    rgba(51,156,221,0) 100%);
  background-size: 200% 100%;
  background-position: -100% 0;
  background-repeat: no-repeat;
  transition: background-position .5s ease;
}
.eg-link-shimmer:hover { background-position: 200% 0; }

/* d. Header glow when scrolled (header gets .scrolled class from inline JS) */
.site-header.scrolled {
  box-shadow:
    0 4px 40px rgba(0,0,0,.5),
    0 0 0 1px rgba(51,156,221,.12) inset !important;
}
html[data-eg-theme="light"] .site-header.scrolled {
  box-shadow:
    0 4px 24px rgba(15,23,42,.08),
    0 0 0 1px rgba(51,156,221,.18) inset !important;
}

/* e. Gradient text utility */
.eg-gradient-text {
  background: linear-gradient(120deg,
    #fff 0%,
    #7dd3fc 35%,
    #c4b5fd 65%,
    #fcd34d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
html[data-eg-theme="light"] .eg-gradient-text {
  background: linear-gradient(120deg,
    #1e293b 0%,
    #0369a1 35%,
    #7c3aed 65%,
    #b45309 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* f. Section divider with hairline glow */
.eg-divider {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(51,156,221,.35) 50%,
    transparent 100%);
  margin: clamp(2rem, 4vh, 3.5rem) 0;
}

/* ──────────────────────────────────────────────────────────────────
 * 24.6  Ensure portal sheet sits BELOW page content but ABOVE the
 *  old .ambient / .grain layers. Pages already use z-index:1 for
 *  .container, so this is non-disruptive.
 * ────────────────────────────────────────────────────────────────── */
.ambient { z-index: 0; }
.grain   { z-index: 0; opacity: .02; }   /* drop grain to whisper level */

/* ===========================================================================
 * 25. v32 ROUND 19 — slow pulse + brighter CTA badge + PWA fixes
 *
 *   User feedback (round #19):
 *   a. 「LIVE の 左の 玉 は、ゆっくり ちかちか した方がよい」
 *      → LIVE pulse dot must pulse SLOWLY (was 2.6s, now 4.5s).
 *   b. 「３件受付中 は、背景がもう少しあかるくないと、左の 緑の玉が、みえない、これも ゆっくり 点滅」
 *      → CTA badge background must be brighter so the green dot reads.
 *        Green dot also pulses slowly (was 1.6s, now 3.6s).
 *   c. 「PWA の、左上に、変な残像（怖い）」
 *      → The .pwa-badge "NEW" pill in the top-left is the ghostly afterimage.
 *        Kill it outright; the banner doesn't need a "New" label anyway.
 *   d. 「PWAの文章が、右に寄ってる。PWA全体の、センターに」
 *      → .pwa-body is a flex-row (icon-left | text | close-btn-absolute) so
 *        text reads as offset-right. Switch to flex-column + center.
 * ========================================================================= */

/* ── 25a. LIVE pulse — slow heartbeat ─────────────────────────────────── */
/* Override the v12 keyframes (which were 2.6s) with a calmer, slower pulse.
 * The selector specificity is fine — we're redefining the rule that paints
 * the dot, then redefining the keyframe name to a new identifier so the
 * earlier @keyframes egHeartbeat 2.6s is naturally superseded.          */
.eg-live-pulse-dot {
  animation: egHeartbeatSlow 4.5s ease-in-out infinite !important;
}
@keyframes egHeartbeatSlow {
  0%   { box-shadow: 0 0 0 0   rgba(51, 156, 221, 0.62); transform: scale(1); }
  50%  { box-shadow: 0 0 0 10px rgba(51, 156, 221, 0);   transform: scale(1.18); }
  100% { box-shadow: 0 0 0 0   rgba(51, 156, 221, 0);    transform: scale(1); }
}

/* ── 25b. CTA badge — brighter background, slower green dot ──────────── */
/* Override the base .eg-cta-badge (background rgba(255,255,255,.18)) with
 * a brighter fill so the green dot reads on the blue primary-button.    */
.eg-cta-badge {
  background: rgba(255, 255, 255, 0.32) !important;
  border: 1px solid rgba(255, 255, 255, 0.55) !important;
  color: #FFFFFF !important;
  /* a touch of saturation for the dot to pop against */
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}
.eg-cta-badge::before {
  /* brighter green + bigger glow so it survives the lighter background */
  width: 6px !important;
  height: 6px !important;
  background: #4ADE80 !important;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.95) !important;
  animation: egCtaDotSlow 3.6s ease-in-out infinite !important;
}
@keyframes egCtaDotSlow {
  0%, 100% { opacity: 1;    transform: scale(1);    }
  50%      { opacity: 0.45; transform: scale(1.35); }
}

/* ── 25c. KILL the PWA "NEW" badge (the scary upper-left afterimage) ─── */
/* ja.html inline CSS at line 1319 places `.pwa-badge` absolute at top:.8rem
 * left:1rem with a pulsing dot. The user reads it as a ghost / afterimage
 * because it sits OUTSIDE the visible icon column and the close-X. Hide it
 * with high specificity (id + class) to defeat any later inline overrides. */
#pwa-prompt .pwa-badge,
.pwa-sheet .pwa-badge,
.pwa-badge {
  display: none !important;
}

/* ── 25d. PWA banner — center the entire content column ──────────────── */
/* Switch the flex row to a column and pin everything to the centre so the
 * icon, title, sub, and step row all share the same vertical centreline. */
#pwa-prompt .pwa-body,
.pwa-sheet .pwa-body,
.pwa-body {
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  gap: 0.55rem !important;
  padding-top: 0.4rem !important;
  padding-bottom: 0.2rem !important;
}
/* When the column collapses, .pwa-text no longer needs flex:1 — let it
 * size to its content so the whole block reads centred. */
#pwa-prompt .pwa-text,
.pwa-sheet .pwa-text,
.pwa-body .pwa-text {
  flex: 0 1 auto !important;
  width: 100% !important;
  min-width: 0 !important;
  text-align: center !important;
}
/* The icon stays centred on its own line above the title. */
#pwa-prompt .pwa-icon-wrap,
.pwa-sheet .pwa-icon-wrap,
.pwa-body .pwa-icon-wrap {
  margin: 0 auto !important;
}
/* iOS steps row already centred via 11d; re-affirm here in case any later
 * rule re-introduces left alignment. */
#pwa-prompt .pwa-ios-steps,
.pwa-sheet .pwa-ios-steps,
.pwa-ios-steps {
  justify-content: center !important;
  text-align: center !important;
}

/* ═════════════════════════════════════════════════════════════════════════
 * v33 — Hard-cache buster + visible-from-default polish (round #18 follow-up)
 *   User feedback「なんも変わってねー」on v32. The two main culprits:
 *     a) iOS Safari was serving cached v31 HTML on every reload.
 *     b) The v32 theme button used rgba(.18) which still vanished against
 *        the dark hero gradient — needed to be SOLID.
 *     c) The PWA "ホーム画面に追加してね" sheet kept showing a black-ish
 *        rectangle ("長四角きたない、透過しろ") — we now make it actually
 *        translucent (no solid backdrop) plus shrink it.
 *     d) The "3件受付中" pill on the primary CTA was invisible against the
 *        blue button — switch to solid green so the count reads at a glance.
 * ═════════════════════════════════════════════════════════════════════════ */

/* PWA sheet: truly translucent now (was rgba(8,20,50,.82) which read as a
 * solid black rectangle on iOS). Only blur + faint accent veil remain. */
#pwa-prompt .pwa-sheet,
.pwa-sheet {
  background: rgba(15, 28, 60, 0.42) !important;
  -webkit-backdrop-filter: blur(34px) saturate(180%) !important;
  backdrop-filter:        blur(34px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  box-shadow:
    0 24px 56px -16px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset !important;
}
/* Kill the ::before radial glow (added more visual weight, conflicting with
 * "透過しろ"). */
#pwa-prompt .pwa-sheet::before,
.pwa-sheet::before {
  background: none !important;
  opacity: 0 !important;
}
/* Light mode: airy white with subtle accent tint */
html[data-eg-theme="light"] .pwa-sheet,
html[data-eg-theme="light"] #pwa-prompt .pwa-sheet {
  background: rgba(255, 255, 255, 0.78) !important;
  -webkit-backdrop-filter: blur(28px) saturate(160%) !important;
  backdrop-filter:        blur(28px) saturate(160%) !important;
  border: 1px solid rgba(35, 137, 199, 0.18) !important;
}

/* "3件受付中" eg-cta-badge — make it solid green so it reads against blue. */
.eg-cta-badge {
  background: #16a34a !important;
  background-image: none !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  font-weight: 700 !important;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}
html[data-eg-theme="light"] .eg-cta-badge {
  background: #15803D !important;
  color: #FFFFFF !important;
  border-color: rgba(15, 23, 41, 0.12) !important;
}

/* =========================================================================
   v34 (2026-05-30) — User-reported bug fixes
   1) 受付 (Check-in) button restyle: bright-blue outline + hover, both themes
   2) Toast component for ?denied=1 server-side bounce notifications
   3) Dark-mode "chiguhagu" minor sweep
   ========================================================================= */

/* (1) 受付 / Check-in button — override the inline orange gradient ---------- */
a[href*="/admin/checkin"] {
  background: transparent !important;
  background-image: none !important;
  color: #38bdf8 !important;                /* bright sky blue */
  border: 1.5px solid #38bdf8 !important;
  box-shadow: 0 0 0 0 rgba(56, 189, 248, 0);
  transition:
    background .18s ease,
    color .18s ease,
    border-color .18s ease,
    box-shadow .25s ease,
    transform .15s ease !important;
  font-weight: 700 !important;
}
a[href*="/admin/checkin"]:hover,
a[href*="/admin/checkin"]:focus-visible {
  background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%) !important;
  background-image: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%) !important;
  color: #ffffff !important;
  border-color: #0ea5e9 !important;
  box-shadow: 0 4px 18px rgba(14, 165, 233, 0.45),
              0 0 0 3px rgba(56, 189, 248, 0.18) !important;
  transform: translateY(-1px);
  outline: none;
}
a[href*="/admin/checkin"]:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.35) !important;
}
/* Light-mode: deeper blue for contrast on white */
html[data-eg-theme="light"] a[href*="/admin/checkin"] {
  color: #0284c7 !important;
  border-color: #0284c7 !important;
}
html[data-eg-theme="light"] a[href*="/admin/checkin"]:hover,
html[data-eg-theme="light"] a[href*="/admin/checkin"]:focus-visible {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important;
  background-image: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important;
  color: #ffffff !important;
  border-color: #0369a1 !important;
}
/* The wrapping "🛡 スタッフ操作" banner uses an orange tint — re-color to blue */
div[style*="rgba(245,158,11"] {
  background: rgba(56, 189, 248, 0.08) !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
}
div[style*="rgba(245,158,11"] > div > div:first-child {
  color: #38bdf8 !important;
}
html[data-eg-theme="light"] div[style*="rgba(245,158,11"] {
  background: rgba(14, 165, 233, 0.08) !important;
  border-color: rgba(14, 165, 233, 0.40) !important;
}
html[data-eg-theme="light"] div[style*="rgba(245,158,11"] > div > div:first-child {
  color: #0369a1 !important;
}

/* (2) Toast (.eg-toast) — for ?denied=1 home-redirect notification --------- */
.eg-toast {
  position: fixed;
  left: 50%;
  top: 24px;
  transform: translateX(-50%) translateY(0);
  background: rgba(15, 30, 60, 0.95);
  color: #fff;
  padding: 0.75rem 1.2rem;
  border-radius: 10px;
  border: 1px solid rgba(99, 179, 237, 0.55);
  font-size: 0.88rem;
  font-weight: 600;
  z-index: 99999;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  max-width: 90vw;
  pointer-events: none;
  opacity: 1;
  transition: opacity .35s ease, transform .35s ease;
  animation: eg-toast-in .35s ease-out;
}
.eg-toast--leaving {
  opacity: 0;
  transform: translateX(-50%) translateY(-8px);
}
@keyframes eg-toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
html[data-eg-theme="light"] .eg-toast {
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  border-color: rgba(14, 165, 233, 0.4);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.18);
}

/* (3) Dark-mode minor sweep — keep this conservative */
html[data-eg-theme="dark"] .pulse-card,
html:not([data-eg-theme]) .pulse-card,
html:not([data-eg-theme="light"]) .pulse-card {
  background: rgba(15, 30, 60, 0.55) !important;
  border-color: rgba(56, 189, 248, 0.18) !important;
}

/* =========================================================================
   v35 (2026-05-30) — More user-reported bug fixes (mobile)
   A) Post modal on /ja/app/feed: lock body scroll, raise z-index above tabbar
      and header, give the modal-card flex-shrink and a proper scrollable body
   B) Avatar + theme-btn duplication on mobile LP header — hide the duplicate
      desktop avatar that bleeds through the responsive media query
   C) My-page マイチケット card: kill stray left padding/decoration leaking
      from outer wrapper
   D) Live session list left edge: ensure the section container respects
      page padding (no negative-margin bleed past viewport)
   E) Hygiene 連携設定を開く button: in light mode the translucent purple
      surface + light-purple text becomes invisible. Force solid contrast.
   ========================================================================= */

/* --- (A) Post modal hardening ------------------------------------------- */
/* The modal is `position:fixed; inset:0; display:none|flex` inline-styled.
 * 1. When it's visible, the BODY underneath is still scrollable, which on
 *    iOS lets the user accidentally pull the feed up and bury the dialog
 *    behind the header / tabbar. Fix by locking body when the modal is
 *    forced open via `body[data-eg-post-modal-open="1"]` (set by JS below).
 * 2. Raise z-index above the .app-tabbar (z-index 500) and any sticky
 *    header (z-index 499). Inline styles put it at 9999 already but we
 *    re-affirm and also ensure overflow-y on the inner card.
 */
body[data-eg-post-modal-open="1"] {
  overflow: hidden !important;
  touch-action: none;
  overscroll-behavior: contain;
}
#post-modal {
  z-index: 100000 !important;
  /* On mobile, center vertically but allow tall content to scroll inside */
  align-items: center !important;
  /* iOS safe area */
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom)) 1rem !important;
}
#post-modal > div {
  /* The inner card */
  max-height: calc(100vh - 2rem) !important;
  max-height: calc(100dvh - 2rem) !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  margin: 0 auto !important;
}
@media (max-width: 480px) {
  #post-modal > div {
    /* On very narrow screens, hug the viewport */
    width: 100% !important;
    max-width: 100% !important;
  }
}
/* Hide the bottom app-tabbar while the modal is open so the user can never
 * tap behind it. */
body[data-eg-post-modal-open="1"] .app-tabbar {
  pointer-events: none;
  opacity: 0.25;
}

/* --- (B) Mobile header duplicate avatar suppression --------------------- */
/* On the LP, .nav-avatar-btn lives inside .nav-links-desktop which is
 * display:none below 768px — BUT some tier-gating code may toggle
 * `display:flex` on the avatar wrap (#nav-user-wrap) regardless of
 * viewport, surfacing it alongside the mobile theme button.
 * Pin the rule: on mobile the desktop nav-user-wrap MUST stay hidden. */
@media (max-width: 768px) {
  .nav-links-desktop,
  .nav-links-desktop #nav-user-wrap,
  .nav-links-desktop .nav-avatar-btn,
  .nav-links-desktop .nav-locale {
    display: none !important;
  }
  /* The mobile theme button stays, hamburger stays — that's it. */
  .eg-theme-btn--mobile {
    /* Make the theme button visually distinct from a user avatar:
     * smaller circle, no fat orange fill (the prior v33 override painted
     * a solid #F59E0B circle in light mode, which next to the avatar
     * read as a "second account"). Use ghosted style instead. */
    background: transparent !important;
    border: 1.5px solid currentColor !important;
    color: var(--t2, #5a6478) !important;
    box-shadow: none !important;
  }
  html[data-eg-theme="light"] .eg-theme-btn--mobile {
    background: rgba(255, 255, 255, 0.6) !important;
    border-color: #0f172a !important;
    color: #0f172a !important;
  }
  html[data-eg-theme="light"] .eg-theme-btn--mobile svg {
    color: #0f172a !important;
  }
  html[data-eg-theme="dark"] .eg-theme-btn--mobile {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.45) !important;
    color: rgba(255, 255, 255, 0.85) !important;
  }
}

/* --- (C) /ja/app/me マイチケット card — strip stray left decoration ------ */
/* The cards above (profile / saved buttons) sit fine, but the マイチケット
 * card sometimes inherits a left-side ::before from a sibling rule below.
 * Reset its position context so nothing leaks in. */
.app-main .card:has(> h3.section-title),
main .card:has(> h3.section-title) {
  position: relative;
  overflow: hidden;
}
.app-main .card > h3.section-title + a,
main .card > h3.section-title + a {
  position: relative;
  z-index: 1;
}

/* --- (D) Live session list left edge ------------------------------------ */
/* Ensure the .app-main containing the live session cards never overflows
 * left of the viewport. Some inline cards use negative margin from heavy
 * red border + box-shadow — clamp via overflow-x on the main scroll
 * container. */
.app-main, main.app-main, main > div {
  overflow-x: clip;
}
@supports not (overflow: clip) {
  .app-main, main.app-main {
    overflow-x: hidden;
  }
}

/* --- (E) Hygiene 連携設定を開く button — light-mode contrast ------------- */
/* The HTML hardcodes:
 *   background: rgba(99,102,241,.3)
 *   border:     rgba(99,102,241,.5)
 *   color:      #c4b5fd  (light lavender)
 * On a near-white light surface that reads as invisible. Force a solid
 * indigo button instead. */
html[data-eg-theme="light"] a[href*="/admin/connectors"] {
  background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
  background-image: linear-gradient(135deg, #6366f1, #4f46e5) !important;
  color: #ffffff !important;
  border: 1.5px solid #4338ca !important;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.32) !important;
  font-weight: 700 !important;
}
html[data-eg-theme="light"] a[href*="/admin/connectors"]:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca) !important;
  background-image: linear-gradient(135deg, #4f46e5, #4338ca) !important;
  box-shadow: 0 6px 22px rgba(67, 56, 202, 0.45) !important;
  transform: translateY(-1px);
}
/* The wrapping card also has rgba(99,102,241,.15) bg → washed out in light.
 * Repaint the surface with a clearer indigo tint. */
html[data-eg-theme="light"] div[style*="rgba(99,102,241,.15)"] {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(139, 92, 246, 0.03)) !important;
  background-image: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(139, 92, 246, 0.03)) !important;
  border-color: rgba(79, 70, 229, 0.32) !important;
}
html[data-eg-theme="light"] div[style*="rgba(99,102,241,.15)"] *[style*="color:#a5b4fc"],
html[data-eg-theme="light"] div[style*="rgba(99,102,241,.15)"] *[style*="color: #a5b4fc"] {
  color: #4338ca !important;
}
html[data-eg-theme="light"] div[style*="rgba(99,102,241,.15)"] *[style*="color:#c4b5fd"],
html[data-eg-theme="light"] div[style*="rgba(99,102,241,.15)"] *[style*="color: #c4b5fd"] {
  color: #4f46e5 !important;
}
/* Inner stat tiles "rgba(0,0,0,.2)" — repaint for light bg readability */
html[data-eg-theme="light"] div[style*="rgba(99,102,241,.15)"] div[style*="rgba(0,0,0,.2)"] {
  background: rgba(255, 255, 255, 0.78) !important;
  border: 1px solid rgba(79, 70, 229, 0.18) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

/* =========================================================================
   v38 (2026-05-30) — User-reported visual bugs, 6th request
   I) Theme button icon invisible (6回目！) — the SVG stroke was inheriting
      currentColor which on the mobile ghost variant resolves to a near-
      invisible grey on the dark header. Pin the SVG stroke and lift size.
   H) Light mode nav-dropdown / #post-modal rendering as dark navy on a
      light page (chiguhagu)
   C) Receipt button — already styled but reinforce in both themes
   ========================================================================= */

/* --- (I) Theme button icon — force visible stroke in ALL contexts -------- */
/* The sun (circle + 8 rays) and moon (crescent path) were rendered with
 * stroke="currentColor". When the button uses transparent background +
 * grey color (.eg-theme-btn--mobile light variant) the lines disappear
 * against the page background — user only sees the outer circle (◎). */
.eg-theme-btn svg,
.eg-theme-btn--mobile svg,
.eg-theme-btn--floating svg,
.eg-theme-btn--drawer svg,
[data-eg-theme-btn] svg {
  width: 22px !important;
  height: 22px !important;
  display: block !important;
  fill: none !important;
  stroke-width: 2.2 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  overflow: visible !important;
  opacity: 1 !important;
}
/* Dark theme: sun/moon must be WHITE on the accent blue button */
html[data-eg-theme="dark"] .eg-theme-btn svg,
html[data-eg-theme="dark"] [data-eg-theme-btn] svg,
html:not([data-eg-theme="light"]) .eg-theme-btn svg,
html:not([data-eg-theme="light"]) [data-eg-theme-btn] svg {
  stroke: #FFFFFF !important;
  color: #FFFFFF !important;
}
html[data-eg-theme="dark"] .eg-theme-btn svg *,
html[data-eg-theme="dark"] [data-eg-theme-btn] svg *,
html:not([data-eg-theme="light"]) .eg-theme-btn svg *,
html:not([data-eg-theme="light"]) [data-eg-theme-btn] svg * {
  stroke: #FFFFFF !important;
  fill: none !important;
}
/* Light theme: solid amber button → sun/moon must be WHITE for contrast */
html[data-eg-theme="light"] .eg-theme-btn svg,
html[data-eg-theme="light"] [data-eg-theme-btn] svg {
  stroke: #FFFFFF !important;
  color: #FFFFFF !important;
}
html[data-eg-theme="light"] .eg-theme-btn svg *,
html[data-eg-theme="light"] [data-eg-theme-btn] svg * {
  stroke: #FFFFFF !important;
  fill: none !important;
}
/* Mobile ghost variant override: the v35 mobile rule made the button
 * transparent grey. That kills the icon. Repaint it as a clear filled
 * pill so the SVG is always visible. */
@media (max-width: 768px) {
  .eg-theme-btn--mobile,
  html[data-eg-theme="light"] .eg-theme-btn--mobile,
  html[data-eg-theme="dark"] .eg-theme-btn--mobile {
    background: #339cdd !important;
    border: 1.5px solid rgba(255, 255, 255, 0.6) !important;
    color: #FFFFFF !important;
  }
  html[data-eg-theme="light"] .eg-theme-btn--mobile {
    background: #F59E0B !important;
    border-color: #B45309 !important;
  }
  .eg-theme-btn--mobile svg,
  html[data-eg-theme="light"] .eg-theme-btn--mobile svg,
  html[data-eg-theme="dark"]  .eg-theme-btn--mobile svg {
    stroke: #FFFFFF !important;
    color: #FFFFFF !important;
  }
  .eg-theme-btn--mobile svg *,
  html[data-eg-theme="light"] .eg-theme-btn--mobile svg *,
  html[data-eg-theme="dark"]  .eg-theme-btn--mobile svg * {
    stroke: #FFFFFF !important;
    fill: none !important;
  }
}

/* --- (H) Light mode: nav-dropdown + post-modal chiguhagu fix ------------ */
/* These elements have inline dark-navy backgrounds baked into the HTML.
 * In light mode they look like black floating boxes on a white page. */
html[data-eg-theme="light"] .nav-dropdown,
html[data-eg-theme="light"] [class*="nav-dropdown"],
html[data-eg-theme="light"] .dropdown-menu,
html[data-eg-theme="light"] .dropdown-panel {
  background: #FFFFFF !important;
  background-image: none !important;
  color: var(--txt, #0f172a) !important;
  border: 1px solid var(--b2, rgba(15, 23, 42, 0.12)) !important;
  box-shadow:
    0 4px 16px -4px rgba(15, 23, 41, 0.10),
    0 12px 32px -12px rgba(15, 23, 41, 0.18) !important;
}
html[data-eg-theme="light"] .nav-dropdown *,
html[data-eg-theme="light"] [class*="nav-dropdown"] *,
html[data-eg-theme="light"] .dropdown-menu *,
html[data-eg-theme="light"] .dropdown-panel * {
  color: inherit;
}
html[data-eg-theme="light"] .nav-dropdown a,
html[data-eg-theme="light"] [class*="nav-dropdown"] a {
  color: var(--txt, #0f172a) !important;
}
html[data-eg-theme="light"] .nav-dropdown a:hover,
html[data-eg-theme="light"] [class*="nav-dropdown"] a:hover {
  background: rgba(51, 156, 221, 0.08) !important;
  color: #0369a1 !important;
}
/* Hairline separators inside dropdown */
html[data-eg-theme="light"] .nav-dropdown hr,
html[data-eg-theme="light"] [class*="nav-dropdown"] hr,
html[data-eg-theme="light"] .nav-dropdown [style*="border-top"],
html[data-eg-theme="light"] [class*="nav-dropdown"] [style*="border-top"] {
  border-color: var(--b1, rgba(15, 23, 42, 0.08)) !important;
}

/* Post modal overlay + card on light theme */
html[data-eg-theme="light"] #post-modal {
  background: rgba(15, 23, 41, 0.45) !important;
  background-image: none !important;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
html[data-eg-theme="light"] #post-modal > div {
  background: #FFFFFF !important;
  background-image: none !important;
  color: var(--txt, #0f172a) !important;
  border: 1px solid var(--b2, rgba(15, 23, 42, 0.12)) !important;
  box-shadow: 0 24px 64px -16px rgba(15, 23, 41, 0.32) !important;
}
html[data-eg-theme="light"] #post-modal h1,
html[data-eg-theme="light"] #post-modal h2,
html[data-eg-theme="light"] #post-modal h3,
html[data-eg-theme="light"] #post-modal h4,
html[data-eg-theme="light"] #post-modal label,
html[data-eg-theme="light"] #post-modal p,
html[data-eg-theme="light"] #post-modal span,
html[data-eg-theme="light"] #post-modal div {
  color: var(--txt, #0f172a) !important;
}
html[data-eg-theme="light"] #post-modal input,
html[data-eg-theme="light"] #post-modal textarea,
html[data-eg-theme="light"] #post-modal select {
  background: #FFFFFF !important;
  color: var(--txt, #0f172a) !important;
  border: 1px solid var(--b2, rgba(15, 23, 42, 0.16)) !important;
}
html[data-eg-theme="light"] #post-modal input::placeholder,
html[data-eg-theme="light"] #post-modal textarea::placeholder {
  color: rgba(15, 23, 42, 0.45) !important;
}

/* --- (H2) Body background — kill the dark flash under modals ------------ */
/* The source HTML hard-codes body { background: #0b0f1a }. Even with the
 * inline EARLY_PAINT script setting data-eg-theme=light, the static body
 * style wins. Force the light-mode body. */
html[data-eg-theme="light"],
html[data-eg-theme="light"] body {
  background: var(--bg, #FAFBFC) !important;
  color: var(--txt, #0f172a) !important;
}
html[data-eg-theme="light"] body[style*="background"] {
  background: var(--bg, #FAFBFC) !important;
  background-image: none !important;
}

/* --- (C) Receipt button — reinforce bright blue border + hover in BOTH themes */
/* The base rules already exist near line 2744. These reinforce specificity
 * so inline gradient styles cannot win. */
a[href*="/admin/checkin"]:not(.eg-theme-btn) {
  background: transparent !important;
  background-image: none !important;
  color: #38bdf8 !important;
  border: 2px solid #38bdf8 !important;
  border-radius: 10px !important;
  padding: 0.55rem 1rem !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  box-shadow: 0 0 0 0 rgba(56, 189, 248, 0);
  transition:
    background .18s ease,
    color .18s ease,
    border-color .18s ease,
    box-shadow .25s ease,
    transform .15s ease !important;
}
a[href*="/admin/checkin"]:not(.eg-theme-btn):hover,
a[href*="/admin/checkin"]:not(.eg-theme-btn):focus-visible {
  background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%) !important;
  background-image: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%) !important;
  color: #FFFFFF !important;
  border-color: #0ea5e9 !important;
  box-shadow:
    0 6px 18px rgba(14, 165, 233, 0.45),
    0 0 0 3px rgba(56, 189, 248, 0.20) !important;
  transform: translateY(-1px);
  outline: none;
}
html[data-eg-theme="light"] a[href*="/admin/checkin"]:not(.eg-theme-btn) {
  color: #0369a1 !important;
  border-color: #0ea5e9 !important;
  background: rgba(56, 189, 248, 0.06) !important;
}
html[data-eg-theme="light"] a[href*="/admin/checkin"]:not(.eg-theme-btn):hover,
html[data-eg-theme="light"] a[href*="/admin/checkin"]:not(.eg-theme-btn):focus-visible {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important;
  background-image: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important;
  color: #FFFFFF !important;
  border-color: #0369a1 !important;
}

/* ──────────────────────────────────────────────────────────────────
 * v40/v41 (2026-05-30): Portal hero "受付" / "Reception" button
 *
 *   The .btn-secondary in .hero-actions is rewritten by enhance.js to
 *   show the label "受付" (or "Reception" in EN).
 *
 *   v41 design (per user request):
 *     • Perfect circle (border-radius:50%, fixed width/height)
 *     • Centered on its own row (independently of the .btn-primary above)
 *     • Soft outward-spreading blue glow (animated pulse, sun-corona vibe)
 *
 *   Behaviour (handled in enhance.js):
 *     • Guest          →  /auth/{loc}/login
 *     • Signed-in T2+  →  /{loc}/app/feed   (in-app "📰 ホーム" tab)
 * ────────────────────────────────────────────────────────────────── */

/* v42/v43 layout: switch .hero-actions to a CSS grid with a single centered
 * column. This guarantees each CTA lands on its own row regardless of the
 * source page's flex rules (the v41 flex approach lost a specificity
 * battle and the circle ended up beside the primary CTA).
 *
 *   Row 1: 📅 イベントを見る  (.btn-primary)
 *   Row 2: 受付 circle        (.btn-secondary[data-eg-cta-uketsuke])
 *
 * v43: removed the v42 "イベント" text link — it was a duplicate of Row 1.
 */
.hero-actions {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  justify-items: center !important;
  align-items: center !important;
  row-gap: 1.25rem !important;
  gap: 1.25rem !important;
}
.hero-actions > * {
  grid-column: 1 !important;
}
.hero-actions a.btn-primary {
  /* Primary CTA: keep its natural pill shape, centered, capped width */
  width: auto !important;
  max-width: 320px !important;
  margin: 0 auto !important;
}
.hero-actions a.btn-secondary[data-eg-cta-uketsuke="1"],
.hero-actions a.btn-secondary[data-eg-cta-rewritten="1"] {
  /* Force the circle to be a fixed-size circle, centered in its grid cell */
  width: 116px !important;
  height: 116px !important;
  min-width: 116px !important;
  min-height: 116px !important;
  max-width: 116px !important;
  flex: 0 0 auto !important;
  padding: 0 !important;
  margin: 0.25rem auto !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  /* Visual */
  background: transparent !important;
  background-image: none !important;
  color: #38bdf8 !important;
  border: 2px solid #38bdf8 !important;
  font-weight: 800 !important;
  font-size: 1.05rem !important;
  letter-spacing: 0.04em !important;
  line-height: 1 !important;
  /* Soft outward-spreading glow (corona) — animated */
  box-shadow:
    0 0 0 4px rgba(56, 189, 248, 0.10),
    0 0 18px 4px rgba(56, 189, 248, 0.35),
    0 0 40px 8px rgba(56, 189, 248, 0.18);
  animation: eg-uketsuke-corona 2.6s ease-in-out infinite;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease !important;
}
/* v43: the v42 .eg-hero-events-link was a duplicate of the primary CTA and
 * has been removed. Hide any stale instance defensively in case a cached
 * enhance.js still injects one before the v43 script takes over. */
.hero-actions a.eg-hero-events-link { display: none !important; }

@keyframes eg-uketsuke-corona {
  0%, 100% {
    box-shadow:
      0 0 0 4px rgba(56, 189, 248, 0.10),
      0 0 18px 4px rgba(56, 189, 248, 0.35),
      0 0 40px 8px rgba(56, 189, 248, 0.18);
  }
  50% {
    box-shadow:
      0 0 0 8px rgba(56, 189, 248, 0.14),
      0 0 28px 8px rgba(56, 189, 248, 0.50),
      0 0 64px 16px rgba(56, 189, 248, 0.28);
  }
}

.hero-actions a.btn-secondary[data-eg-cta-uketsuke="1"]:hover,
.hero-actions a.btn-secondary[data-eg-cta-uketsuke="1"]:focus-visible,
.hero-actions a.btn-secondary[data-eg-cta-rewritten="1"]:hover,
.hero-actions a.btn-secondary[data-eg-cta-rewritten="1"]:focus-visible {
  background: radial-gradient(circle at 30% 30%, #54CCCF 0%, #38bdf8 45%, #0ea5e9 100%) !important;
  background-image: radial-gradient(circle at 30% 30%, #54CCCF 0%, #38bdf8 45%, #0ea5e9 100%) !important;
  color: #ffffff !important;
  border-color: #0ea5e9 !important;
  /* On hover the corona swells brighter and the button lifts */
  box-shadow:
    0 0 0 6px rgba(56, 189, 248, 0.20),
    0 0 32px 10px rgba(56, 189, 248, 0.65),
    0 0 80px 20px rgba(56, 189, 248, 0.35),
    0 6px 22px rgba(14, 165, 233, 0.55) !important;
  transform: translateY(-2px) scale(1.04);
  outline: none;
  animation-play-state: paused;
}
.hero-actions a.btn-secondary[data-eg-cta-uketsuke="1"]:active,
.hero-actions a.btn-secondary[data-eg-cta-rewritten="1"]:active {
  transform: translateY(0) scale(1.0);
  box-shadow:
    0 0 0 4px rgba(56, 189, 248, 0.15),
    0 0 18px 4px rgba(56, 189, 248, 0.40),
    0 2px 8px rgba(14, 165, 233, 0.35) !important;
}

/* Light-mode: deeper blue for contrast on the white background */
html[data-eg-theme="light"] .hero-actions a.btn-secondary[data-eg-cta-uketsuke="1"],
html[data-eg-theme="light"] .hero-actions a.btn-secondary[data-eg-cta-rewritten="1"] {
  color: #0284c7 !important;
  border-color: #0284c7 !important;
  box-shadow:
    0 0 0 4px rgba(2, 132, 199, 0.10),
    0 0 18px 4px rgba(56, 189, 248, 0.40),
    0 0 40px 10px rgba(56, 189, 248, 0.22);
}
html[data-eg-theme="light"] .hero-actions a.btn-secondary[data-eg-cta-uketsuke="1"]:hover,
html[data-eg-theme="light"] .hero-actions a.btn-secondary[data-eg-cta-uketsuke="1"]:focus-visible,
html[data-eg-theme="light"] .hero-actions a.btn-secondary[data-eg-cta-rewritten="1"]:hover,
html[data-eg-theme="light"] .hero-actions a.btn-secondary[data-eg-cta-rewritten="1"]:focus-visible {
  background: radial-gradient(circle at 30% 30%, #38bdf8 0%, #0ea5e9 45%, #0284c7 100%) !important;
  background-image: radial-gradient(circle at 30% 30%, #38bdf8 0%, #0ea5e9 45%, #0284c7 100%) !important;
  color: #ffffff !important;
  border-color: #0369a1 !important;
  box-shadow:
    0 0 0 6px rgba(2, 132, 199, 0.18),
    0 0 32px 10px rgba(14, 165, 233, 0.55),
    0 0 80px 20px rgba(56, 189, 248, 0.30) !important;
}

/* Respect reduced-motion preference: don't pulse, keep static glow */
@media (prefers-reduced-motion: reduce) {
  .hero-actions a.btn-secondary[data-eg-cta-uketsuke="1"],
  .hero-actions a.btn-secondary[data-eg-cta-rewritten="1"] {
    animation: none !important;
  }
}

/* Mobile tightening — slightly smaller circle so it doesn't dominate
 * narrow viewports. */
@media (max-width: 480px) {
  .hero-actions a.btn-secondary[data-eg-cta-uketsuke="1"],
  .hero-actions a.btn-secondary[data-eg-cta-rewritten="1"] {
    width: 100px !important;
    height: 100px !important;
    min-width: 100px !important;
    min-height: 100px !important;
    font-size: 0.98rem !important;
  }
}

/* ──────────────────────────────────────────────────────────────────
 * v44/v45 (2026-05-30): bottom .app-tabbar — translucency coordination
 *
 *   USER FEEDBACK (v44 → v45): the v44 light-theme tabbar was too opaque
 *   (.78) compared to the top nav (.60). And the dark-theme tabbar from
 *   the source page (rgba(5,16,38,.92)) is almost solid. Both feel
 *   disconnected from the top navbar.
 *
 *   Reference surfaces (top navbar baseline, from feed.html):
 *     • DARK  .site-header        rgba(6, 18, 40, 0.60) + blur(24px) saturate(200%)
 *     • LIGHT html[..="light"] nav rgba(255,255,255,0.85) + blur(14px) saturate(160%)
 *
 *   v45 brings the bottom tabbar to the SAME translucency profile as the
 *   top navbar so the two bars feel like one design system.
 *
 *   Light-theme goals (kept from v44, opacity lowered):
 *     • Frosted-glass white, same alpha/blur/saturate as the top nav
 *     • Hairline top border + soft upward lift for definition
 *     • Inactive = muted near-black; active = brand blue with radial pill
 *     • Underline accent = brand gradient (--p → --s)
 *     • Live tab = coral #DC2D4A (contrast-tuned for white)
 *     • Pull-to-refresh chip mirrors the same surface
 * ────────────────────────────────────────────────────────────────── */

/* DARK theme: align bottom tabbar with .site-header translucency.
 * Source HTML sets background:rgba(5,16,38,.92) on .app-tabbar — that's
 * almost solid. The top .site-header uses rgba(6,18,40,0.60). Match it. */
.app-tabbar {
  background: rgba(6, 18, 40, 0.60) !important;
  backdrop-filter: blur(24px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(200%) !important;
}

/* LIGHT theme: mirror the top-nav surface treatment. */
html[data-eg-theme="light"] .app-tabbar {
  background: rgba(255, 255, 255, 0.60) !important;
  backdrop-filter: saturate(160%) blur(14px) !important;
  -webkit-backdrop-filter: saturate(160%) blur(14px) !important;
  border-top: 1px solid rgba(15, 23, 41, 0.10) !important;
  box-shadow:
    0 -1px 0 rgba(255, 255, 255, 0.6) inset,
    0 -8px 24px -12px rgba(15, 23, 41, 0.10);
}

/* Inactive tab: muted near-black text, smooth hover */
html[data-eg-theme="light"] .app-tabbar .app-tab {
  color: rgba(15, 23, 41, 0.55) !important;
}
html[data-eg-theme="light"] .app-tabbar .app-tab:hover {
  color: rgba(15, 23, 41, 0.85) !important;
}

/* Active tab: brand blue + subtle tinted pill behind the icon for depth.
 * The pill uses a soft brand-tinted radial wash so it reads as "selected"
 * without competing with the underline accent. */
html[data-eg-theme="light"] .app-tabbar .app-tab.active {
  color: #2389C7 !important;
}
html[data-eg-theme="light"] .app-tabbar .app-tab.active .tab-icon {
  background: radial-gradient(
    circle at 50% 50%,
    rgba(35, 137, 199, 0.14) 0%,
    rgba(35, 137, 199, 0.06) 60%,
    rgba(35, 137, 199, 0) 100%
  );
  border-radius: 50%;
  padding: 4px;
  margin: -4px;
}

/* Underline accent: brighten the gradient slightly so it pops on white */
html[data-eg-theme="light"] .app-tabbar .app-tab::after {
  background: linear-gradient(90deg, #2389C7 0%, #3FB8BB 100%) !important;
  height: 2.5px !important;
  border-radius: 0 0 4px 4px !important;
  box-shadow: 0 1px 6px rgba(35, 137, 199, 0.35);
}

/* Tab label tint follows the same scale */
html[data-eg-theme="light"] .app-tabbar .tab-label {
  color: inherit;
}

/* Live tab: keep coral identity, lift contrast for white background.
 * Use the brand coral palette so it doesn't look like a raw red. */
html[data-eg-theme="light"] .app-tabbar .app-tab.live-tab,
html[data-eg-theme="light"] .app-tabbar .app-tab.live-tab.active {
  color: #DC2D4A !important;
}
html[data-eg-theme="light"] .app-tabbar .live-dot {
  background: #DC2D4A !important;
  box-shadow:
    0 0 0 2px rgba(220, 45, 74, 0.22),
    0 0 8px rgba(220, 45, 74, 0.45) !important;
}
html[data-eg-theme="light"] .app-tabbar .app-tab.live-tab.active .tab-icon {
  background: radial-gradient(
    circle at 50% 50%,
    rgba(220, 45, 74, 0.14) 0%,
    rgba(220, 45, 74, 0.06) 60%,
    rgba(220, 45, 74, 0) 100%
  );
}

/* Pull-to-refresh chip — mirror the frosted-white treatment so the two
 * floating surfaces feel like one design family. */
html[data-eg-theme="light"] .ptr-indicator {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: saturate(180%) blur(20px) !important;
  -webkit-backdrop-filter: saturate(180%) blur(20px) !important;
  border: 1px solid rgba(15, 23, 41, 0.10) !important;
  color: #2389C7 !important;
  box-shadow:
    0 8px 24px rgba(15, 23, 41, 0.12),
    0 2px 6px rgba(35, 137, 199, 0.18) !important;
}

/* Tiny-screen safety: keep the white surface, just compact the inner
 * pill behind the active icon. */
@media (max-width: 380px) {
  html[data-eg-theme="light"] .app-tabbar .app-tab.active .tab-icon {
    padding: 3px;
    margin: -3px;
  }
}

/* ──────────────────────────────────────────────────────────────────
 * v46 (2026-05-30): TOP PAGE — PC-only 3-column layout for content
 *
 *   USER REQUEST:
 *     "PC画面のトップページだけ、下にあるコンテンツ（イベント予定、機能など）
 *      を3列に表示させることは可能でしょうか？
 *      スマホのページは変えたくない"
 *
 *   The source CSS uses `repeat(auto-fit/auto-fill, minmax(270-290px, 1fr))`
 *   for both .lp-event-grid (events) and .feature-grid (features). This
 *   auto-fits 1/2/3 columns depending on viewport width:
 *       <  640px  → 1 col
 *       640–960px → 2 cols
 *       ≥ 960px   → 3 cols (fits the 1140px container)
 *
 *   At intermediate widths (~770–950px, common for laptop split screen) the
 *   events grid drops to 2 cols because each card needs ≥ 290px. The user
 *   wants a consistent 3-column look on PC across that whole range.
 *
 *   v46 explicitly LOCKS both grids to 3 columns from 768px upward on the
 *   top page only. Mobile (< 768px) is COMPLETELY UNTOUCHED — the existing
 *   1-col / auto-fit rules continue to apply.
 *
 *   Scope:  body[data-eg-page="top"]   (set by middleware on /ja and /en)
 *   Trigger: min-width: 768px           (standard tablet / PC breakpoint)
 * ────────────────────────────────────────────────────────────────── */

@media (min-width: 768px) {

  /* Lock 3 columns for the upcoming-events grid on the top page only. */
  body[data-eg-page="top"] .lp-event-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  /* Lock 3 columns for the features grid on the top page only.
   * With 6 feature cards this yields a tidy 3 × 2 matrix. */
  body[data-eg-page="top"] .feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  /* Slightly wider container on the top page for a more comfortable
   * 3-column gutter (1140 → 1200px). Cards stay capped because grid
   * minmax(0, 1fr) divides evenly. */
  body[data-eg-page="top"] .lp-events .container,
  body[data-eg-page="top"] .features  .container {
    max-width: 1200px !important;
  }

  /* Bump the inter-card gap a touch at PC so 3 cards breathe. */
  body[data-eg-page="top"] .lp-event-grid,
  body[data-eg-page="top"] .feature-grid {
    gap: 1.25rem !important;
  }
}

/* Safety: keep mobile behavior fully intact. The source page already has
 *    @media (max-width: 768px) { .feature-grid, .event-grid { grid-template-columns: 1fr } }
 * and
 *    @media (max-width: 640px) { .lp-event-grid { grid-template-columns: 1fr } }
 * so we explicitly do nothing in the < 768px range. */

/* ──────────────────────────────────────────────────────────────────
 * v47 (2026-05-30): TOP PAGE — PC hero side columns (1 : 1.5 : 1)
 *
 *   User request:
 *     "トップ画面の左右の白紙に、イベント3列と機能セクションが配置される
 *      イメージです。
 *      比率: 1 : 1.5 : 1 (バランス重視)
 *      下のセクションは PC 時のみ非表示 (option A)
 *      スマホのビューは絶対に変えない"
 *
 *   Strategy:
 *     • enhance.js (v47 installHeroSideColumns) injects a [.eg-hero-side]
 *       column on each side of the existing .hero-content at min-width:1024px.
 *     • CSS turns .hero into a 3-column grid (left | center | right) with
 *       the requested 1 : 1.5 : 1 ratio at PC width.
 *     • body[data-eg-hero-sides="1"] marker hides the original
 *       .lp-events and .features sections (PC only — option A).
 *
 *   GUARANTEE: every rule in this block is scoped inside
 *     @media (min-width: 1024px) and body[data-eg-page="top"].
 *     Mobile (< 1024px) and any non-top page are 100% untouched.
 * ────────────────────────────────────────────────────────────────── */

@media (min-width: 1024px) {

  /* Turn the .hero into a 3-column grid at PC width on the top page.
   *
   * v49: Restore full-viewport hero so the dark background no longer
   *      reads as a small "framed box" surrounded by the body color.
   *      In v47 we used min-height:auto to avoid an empty zone, but
   *      that made the hero shorter than the viewport and the dark
   *      body bg (#06182c) became visible above + below the hero,
   *      surrounding the slightly-different hero gradient — looking
   *      like a separate frame.  Restoring 90vh matches the source. */
  body[data-eg-page="top"][data-eg-hero-sides="1"] .hero {
    display: grid !important;
    grid-template-columns: 1fr 1.5fr 1fr !important;
    grid-template-areas: "left center right" !important;
    column-gap: 2rem !important;
    align-items: stretch !important;
    padding-left: 2rem !important;
    padding-right: 2rem !important;
    /* v49: full-viewport hero, matches source .hero{min-height:90vh}. */
    min-height: 90vh !important;
    padding-top: 5.5rem !important;
    padding-bottom: 5rem !important;
    /* v49: edge-to-edge horizontally so the dark gradient covers the
     * entire upper viewport.  Clear any inherited max-width / margin
     * from a parent wrapper. */
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
  }

  /* Place the existing .hero-content into the CENTER grid cell. The
   * source markup keeps .hero-bg, .hero-grid, .hero-network as siblings,
   * so we explicitly grid-place every direct child. */
  body[data-eg-page="top"][data-eg-hero-sides="1"] .hero > .hero-content {
    grid-area: center !important;
    max-width: 100% !important;
    align-self: center !important;
  }
  /* v53: only .hero-network and .hero-scroll need to be grid-placed to
   * sit across all 3 columns.  .hero-bg and .hero-grid are now handled
   * by the dedicated block below which removes them from grid flow
   * entirely (grid-column/row: auto) and gives them negative offsets
   * covering .hero's full padding box. */
  body[data-eg-page="top"][data-eg-hero-sides="1"] .hero > .hero-network,
  body[data-eg-page="top"][data-eg-hero-sides="1"] .hero > .hero-scroll {
    grid-column: 1 / -1 !important;  /* span across all 3 columns */
    grid-row: 1 / -1 !important;
  }

  /* v49 + v53: extend .hero-bg to cover the ENTIRE .hero element
   * including its padding (top 5.5rem / bottom 5rem / left/right 2rem)
   * so the gradient touches all four viewport edges.
   *
   * Root cause clarified in v53:
   *   The source rule is  .hero-bg { position:absolute; inset:0 }.
   *   But .hero is `display:grid` at PC width AND .hero-bg is placed
   *   into a specific grid cell via grid-row/grid-column above.  For
   *   abspos children of a grid container, the containing block becomes
   *   the GRID CELL (not the .hero padding box), and the grid cell
   *   excludes the hero's padding.  Therefore `top:0; bottom:0` resolves
   *   to ~90px down from the top of .hero and ~82px up from the bottom,
   *   producing the visible empty bands above + below the gradient that
   *   the user reported.
   *
   * Fix in v53:
   *   1. Remove .hero-bg / .hero-grid / .hero-network from grid placement
   *      (rule above no longer touches them — see updated selector).
   *   2. Override top/bottom with negative offsets equal to .hero padding
   *      (5.5rem top, 5rem bottom) so the gradient extends UP into the
   *      padding area, edge to edge, matching the source's natural inset:0
   *      behavior when .hero was display:flex.
   *   3. Keep left/right -2rem as before (cancels the horizontal padding).
   */
  body[data-eg-page="top"][data-eg-hero-sides="1"] .hero > .hero-bg,
  body[data-eg-page="top"][data-eg-hero-sides="1"] .hero > .hero-grid {
    top: -5.5rem !important;
    bottom: -5rem !important;
    left: -2rem !important;
    right: -2rem !important;
    width: auto !important;
    height: auto !important;
    /* v53: drop the grid placement so the abspos containing block
     * becomes the .hero padding box, not a single grid cell. */
    grid-column: auto !important;
    grid-row: auto !important;
  }
  body[data-eg-page="top"][data-eg-hero-sides="1"] .hero > .eg-hero-side--left {
    grid-area: left !important;
  }
  body[data-eg-page="top"][data-eg-hero-sides="1"] .hero > .eg-hero-side--center {
    /* Phantom placeholder — invisible, but reserves the center cell
     * so the grid resolves predictably even if .hero-content order changes. */
    grid-area: center !important;
    visibility: hidden !important;
    pointer-events: none !important;
    width: 0; height: 0;
  }
  body[data-eg-page="top"][data-eg-hero-sides="1"] .hero > .eg-hero-side--right {
    grid-area: right !important;
  }

  /* Side column container */
  body[data-eg-page="top"][data-eg-hero-sides="1"] .eg-hero-side {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-self: center;
    max-height: 78vh;
    overflow-y: auto;
    padding: 0.25rem 0.4rem;
    scrollbar-width: thin;
  }
  body[data-eg-page="top"][data-eg-hero-sides="1"] .eg-hero-side::-webkit-scrollbar {
    width: 6px;
  }
  body[data-eg-page="top"][data-eg-hero-sides="1"] .eg-hero-side::-webkit-scrollbar-thumb {
    background: rgba(51, 156, 221, 0.35);
    border-radius: 3px;
  }

  /* Section heading inside each side column */
  body[data-eg-page="top"][data-eg-hero-sides="1"] .eg-hero-side-head {
    margin-bottom: 0.25rem;
    text-align: left;
  }
  body[data-eg-page="top"][data-eg-hero-sides="1"] .eg-hero-side-eyebrow {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--p);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
  }
  body[data-eg-page="top"][data-eg-hero-sides="1"] .eg-hero-side-title {
    font-size: 1.05rem;
    font-weight: 800;
    margin: 0 0 0.5rem;
    letter-spacing: -0.01em;
    color: var(--t1);
  }

  /* Card list inside each column */
  body[data-eg-page="top"][data-eg-hero-sides="1"] .eg-hero-side-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
  }

  /* Cloned cards: shrink to fit the narrower column, keep the same
   * visual language as the originals. */
  body[data-eg-page="top"][data-eg-hero-sides="1"] .eg-hero-side-card {
    display: block;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--b1);
    border-radius: 12px;
    padding: 0.85rem 0.95rem;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    text-decoration: none;
    color: inherit;
    position: relative;
  }
  body[data-eg-page="top"][data-eg-hero-sides="1"] .eg-hero-side-card:hover {
    transform: translateY(-2px);
    border-color: rgba(51, 156, 221, 0.35);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  }
  /* Event card: shrink the title + meta inside the cloned card */
  body[data-eg-page="top"][data-eg-hero-sides="1"] .eg-hero-side-card--event .lp-event-card-title {
    font-size: 0.88rem !important;
    margin-bottom: 0.4rem !important;
    line-height: 1.35 !important;
  }
  body[data-eg-page="top"][data-eg-hero-sides="1"] .eg-hero-side-card--event .lp-event-card-meta {
    font-size: 0.7rem !important;
    gap: 0.3rem !important;
  }
  body[data-eg-page="top"][data-eg-hero-sides="1"] .eg-hero-side-card--event .lp-event-card-arrow {
    display: none !important; /* save space in narrow column */
  }
  body[data-eg-page="top"][data-eg-hero-sides="1"] .eg-hero-side-card--event .lp-event-card-top {
    margin-bottom: 0.5rem !important;
  }
  body[data-eg-page="top"][data-eg-hero-sides="1"] .eg-hero-side-card--event .badge {
    font-size: 0.62rem !important;
    padding: 0.15rem 0.5rem !important;
  }

  /* Feature card: more compact, single line title */
  body[data-eg-page="top"][data-eg-hero-sides="1"] .eg-hero-side-card--feature {
    display: flex !important;
    align-items: flex-start !important;
    gap: 0.65rem !important;
    padding: 0.7rem 0.85rem !important;
  }
  body[data-eg-page="top"][data-eg-hero-sides="1"] .eg-hero-side-card--feature .feature-icon-wrap {
    width: 28px !important;
    height: 28px !important;
    font-size: 1rem !important;
    flex-shrink: 0;
    margin: 0 !important;
  }
  body[data-eg-page="top"][data-eg-hero-sides="1"] .eg-hero-side-card--feature h3 {
    font-size: 0.82rem !important;
    margin: 0 0 0.15rem !important;
    line-height: 1.3 !important;
  }
  body[data-eg-page="top"][data-eg-hero-sides="1"] .eg-hero-side-card--feature p {
    font-size: 0.72rem !important;
    line-height: 1.45 !important;
    margin: 0 !important;
    color: var(--t3) !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* "See all events →" tail link below the event list */
  body[data-eg-page="top"][data-eg-hero-sides="1"] .eg-hero-side-more {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--p);
    text-decoration: none;
    align-self: flex-start;
    transition: transform 0.18s ease, color 0.18s ease;
  }
  body[data-eg-page="top"][data-eg-hero-sides="1"] .eg-hero-side-more:hover {
    transform: translateX(2px);
    color: var(--s);
  }

  /* Option A: HIDE the duplicate sections below the hero on PC top-page
   * when the side-columns are active. Mobile (<1024px) is untouched. */
  body[data-eg-page="top"][data-eg-hero-sides="1"] .lp-events,
  body[data-eg-page="top"][data-eg-hero-sides="1"] .features {
    display: none !important;
  }

  /* Light-theme side-column polish */
  html[data-eg-theme="light"] body[data-eg-page="top"][data-eg-hero-sides="1"] .eg-hero-side-card {
    background: rgba(255, 255, 255, 0.65) !important;
    border: 1px solid rgba(15, 23, 41, 0.10) !important;
    box-shadow: 0 2px 6px rgba(15, 23, 41, 0.04);
  }
  html[data-eg-theme="light"] body[data-eg-page="top"][data-eg-hero-sides="1"] .eg-hero-side-card:hover {
    border-color: rgba(35, 137, 199, 0.4) !important;
    box-shadow: 0 8px 24px rgba(15, 23, 41, 0.10);
  }
  html[data-eg-theme="light"] body[data-eg-page="top"][data-eg-hero-sides="1"] .eg-hero-side-title {
    color: var(--txt) !important;
  }
}

/* v47 GUARANTEE: nothing below this point applies at < 1024px.
 * The matchMedia guard in enhance.js also prevents DOM mutation on
 * narrower viewports, so mobile/tablet users see the original page
 * exactly as before. */

/* ─────────────────────────────────────────────────────────────────
 * v49 / v52 — DARK MODE body bg unification (vertical seam fix)
 *
 *   v49 user report (verbatim):
 *     「トップ画面ですが、ダークモードだけ、背景が小さくて、別の枠が
 *      できてしまっているように見えちゃいますね。画面いっぱいに上部の
 *      背景を上にも左右にも広げて欲しいです。」
 *
 *   v52 follow-up user report (verbatim):
 *     「PC用のダークモードなのですが、左右には広がりましたが、まだ、
 *      上下に隙間が残っており、つぎはぎになっております。」
 *
 *   v49 fixed the LEFT/RIGHT gaps (`.hero-bg` negative inset + full
 *   viewport hero).  v52 fixes the remaining VERTICAL seam.
 *
 *   Root cause of the vertical seam:
 *     - Source hero gradient ends at  #020c1e  (very deep navy)
 *     - v49 forced body bg to         #06182c  (mid navy)
 *     → at the bottom edge of `.hero` (min-height:90vh), the deep
 *       navy gradient end abruptly transitions to the lighter
 *       body bg → visible horizontal seam right below the hero.
 *     - Below 90vh (and the feature section area) the user sees
 *       a flat lighter band before the footer.
 *
 *   v52 fix:
 *     1. Align body bg with the hero gradient TERMINAL color (#020c1e).
 *     2. Paint the body of `[data-eg-page="top"]` with a continuation
 *        gradient so the area BELOW the hero blends into the same
 *        deep navy without a banding step.
 *     3. Keep the `.hero` element itself bg-color anchored to the
 *        same terminal color so any sub-pixel gap blends in.
 *
 *   This applies on ALL viewport widths. */
html[data-eg-theme="dark"],
html[data-eg-theme="dark"] body {
  /* v52: use the hero gradient terminal color #020c1e instead of
   * v49's #06182c so the hero-bottom → body transition is invisible. */
  background-color: #020c1e !important;
}
/* v52: continuation gradient on the top-page body so the area
 * below the .hero block (features section, footer lead-in)
 * blends into the same deep navy with a soft tonal continuation
 * instead of stopping abruptly at the .hero bottom edge. */
html[data-eg-theme="dark"] body[data-eg-page="top"] {
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(51,156,221,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(0,80,170,0.05) 0%, transparent 70%),
    #020c1e !important;
  background-attachment: fixed !important;
}
html[data-eg-theme="dark"] body[data-eg-page="top"] .hero {
  /* Belt-and-suspenders: paint the .hero element itself with the
   * same terminal color so any sub-pixel gap inside .hero-bg
   * coverage is filled seamlessly. */
  background-color: #020c1e !important;
}

/* ─────────────────────────────────────────────────────────────────
 * v51 — UNIFIED frosted-glass card treatment across ALL app pages
 *
 *   User feedback (after v50):
 *     「ショップだけ、トーンが変わり、カード背景白になってしまいました。
 *      また、イベントのページも、枠が見えないですね。
 *      全ページで、既存のデザインに合わせて欲しい。
 *      透過、ぬるぬる感さいこう！」
 *
 *   Translation: "v50 made shop cards solid-white which clashes with the
 *   rest of the app, and events page borders are also invisible. Please
 *   match the existing design across all pages. Translucent + slippery-
 *   glass aesthetic is the best!"
 *
 *   Background — the app has TWO kinds of cards:
 *     A. Class-based cards (.subgroup-card, .event-card, etc.) that use
 *        CSS custom-property tokens (background:var(--s0); border:1px
 *        solid var(--b1)).  These are theme-aware AND look great on
 *        both themes because the tokens flip via EARLY_PAINT (v48).
 *        → subgroups page is in this group.  Looks perfect.
 *
 *     B. Inline-styled cards built into the page HTML with literal
 *        rgba(255,255,255,.0X) values.  These look great on DARK theme
 *        (semi-transparent white over deep navy = glassy) but are
 *        INVISIBLE on light theme (white over near-white).
 *        → events, live, shop, me, feed all have this problem.
 *
 *   v51 strategy — unify group B cards to MATCH the group A aesthetic:
 *     • Replace the invisible white-3% background with a soft white-55%
 *       glass tint that sits OVER the page's pale-blue gradient.  The
 *       result reads as frosted glass — visible card edges but with the
 *       background gradient still showing through (= "ぬるぬる感").
 *     • Add backdrop-filter: blur(...) saturate(...) for true frosted
 *       glass blur — pixels behind the card are slightly blurred,
 *       creating the depth/slippery quality the user loves.
 *     • Border becomes a slate hairline matching --b1.
 *     • Hover preserves blue accent + adds a soft lift shadow.
 *
 *   DARK THEME: also gets a backdrop-filter blur upgrade — same
 *   frosted-glass feel, just over the dark navy background instead of
 *   pale blue.  Visual result on dark is nearly identical to before
 *   (the 3%-white tint still wins visually) plus a touch more depth.
 *
 *   SCOPE: any element that has the canonical inline glass-style
 *   "background:rgba(255,255,255,.03)" or .025, .04, .05 variants
 *   inside any app sub-section page.  Matches via attribute-selector.
 *   Mobile and PC both benefit.
 * ───────────────────────────────────────────────────────────────── */

/* ── Selector building blocks ──────────────────────────────────────
 * We catch the common inline-style background patterns found across
 * shop.html, events.html, live.html, feed.html, me.html.  The
 * attribute selector matches a substring of the inline style string
 * so it doesn't matter where it appears.  Both compact and spaced
 * RGBA syntaxes are covered.
 *
 * Patterns observed in the source HTML:
 *   background:rgba(255,255,255,.03)   ← shop, events, live, etc.
 *   background:rgba(255,255,255,.025)
 *   background:rgba(255,255,255,.05)
 *   background:rgba(255,255,255,.04)
 * ───────────────────────────────────────────────────────────────── */

/* (1) LIGHT theme — frosted-glass surface for any app-section page.
 *     The selector requires body[data-eg-app-section] to be present
 *     (set by v50 middleware) so we don't touch the marketing top
 *     page (which uses different inline styles for its hero side
 *     columns and we want those untouched). */
html[data-eg-theme="light"]
  body[data-eg-app-section]
  [style*="background:rgba(255,255,255,.03)"],
html[data-eg-theme="light"]
  body[data-eg-app-section]
  [style*="background: rgba(255,255,255,.03)"],
html[data-eg-theme="light"]
  body[data-eg-app-section]
  [style*="background:rgba(255,255,255,.025)"],
html[data-eg-theme="light"]
  body[data-eg-app-section]
  [style*="background:rgba(255,255,255,.04)"],
html[data-eg-theme="light"]
  body[data-eg-app-section]
  [style*="background:rgba(255,255,255,.05)"] {
  /* Translucent frosted glass over the pale-blue page gradient.
   * 55% white tint is opaque enough to define the card silhouette
   * while still letting the body gradient bleed through. */
  background: rgba(255, 255, 255, 0.55) !important;
  border-color: rgba(15, 23, 41, 0.10) !important;
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  box-shadow:
    0 1px 2px rgba(15, 23, 41, 0.03),
    0 8px 24px rgba(15, 23, 41, 0.06) !important;
}

/* (2) LIGHT theme — repair white-tone BORDERS on cards (any opacity
 *     variant) so they read as slate hairlines, not invisible white. */
html[data-eg-theme="light"]
  body[data-eg-app-section]
  [style*="border:1px solid rgba(255,255,255,.08)"],
html[data-eg-theme="light"]
  body[data-eg-app-section]
  [style*="border:1px solid rgba(255,255,255,.1)"],
html[data-eg-theme="light"]
  body[data-eg-app-section]
  [style*="border:1px solid rgba(255,255,255,.06)"],
html[data-eg-theme="light"]
  body[data-eg-app-section]
  [style*="border:1px solid rgba(255,255,255,.12)"],
html[data-eg-theme="light"]
  body[data-eg-app-section]
  [style*="border: 1px solid rgba(255,255,255,.08)"],
html[data-eg-theme="light"]
  body[data-eg-app-section]
  [style*="border: 1px solid rgba(255,255,255,.1)"] {
  border-color: rgba(15, 23, 41, 0.10) !important;
}

/* (3) LIGHT theme — internal horizontal dividers (border-top on the
 *     price row inside shop cards, etc.) become invisible on white.
 *     Re-tone to slate. */
html[data-eg-theme="light"]
  body[data-eg-app-section]
  [style*="border-top:1px solid rgba(255,255,255,.06)"],
html[data-eg-theme="light"]
  body[data-eg-app-section]
  [style*="border-top: 1px solid rgba(255,255,255,.06)"],
html[data-eg-theme="light"]
  body[data-eg-app-section]
  [style*="border-top:1px solid rgba(255,255,255,.08)"] {
  border-top-color: rgba(15, 23, 41, 0.08) !important;
}

/* (4) LIGHT theme — hover state.  Inline onmouseover handlers set
 *     borderColor to rgba(51,156,221,.4) (blue accent); we keep
 *     that but lift the shadow for a clearer affordance. */
html[data-eg-theme="light"]
  body[data-eg-app-section]
  [style*="background:rgba(255,255,255,.03)"]:hover,
html[data-eg-theme="light"]
  body[data-eg-app-section]
  [style*="background: rgba(255,255,255,.03)"]:hover,
html[data-eg-theme="light"]
  body[data-eg-app-section]
  [style*="background:rgba(255,255,255,.05)"]:hover {
  background: rgba(255, 255, 255, 0.72) !important;
  border-color: rgba(35, 137, 199, 0.40) !important;
  box-shadow:
    0 12px 32px rgba(35, 137, 199, 0.14),
    0 2px 8px rgba(15, 23, 41, 0.06) !important;
}

/* (5) DARK theme — add the frosted-glass blur to give the same
 *     "ぬるぬる感" depth feel.  The base 3% white tint is preserved
 *     (looks great on dark navy already), we just enhance it with
 *     a backdrop blur so anything behind the card (e.g. the orbs
 *     in the ambient layer) reads softly through. */
html[data-eg-theme="dark"]
  body[data-eg-app-section]
  [style*="background:rgba(255,255,255,.03)"],
html[data-eg-theme="dark"]
  body[data-eg-app-section]
  [style*="background: rgba(255,255,255,.03)"],
html[data-eg-theme="dark"]
  body[data-eg-app-section]
  [style*="background:rgba(255,255,255,.025)"],
html[data-eg-theme="dark"]
  body[data-eg-app-section]
  [style*="background:rgba(255,255,255,.04)"],
html[data-eg-theme="dark"]
  body[data-eg-app-section]
  [style*="background:rgba(255,255,255,.05)"] {
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
}

/* (6) CLASS-based cards on app pages — the .subgroup-card,
 *     .event-card-grid, .live-card, etc. already use var(--s0) +
 *     var(--b1) which our EARLY_PAINT already overrides correctly
 *     for light theme.  But the base tokens are very faint
 *     (--s0: 1.8% slate).  Strengthen the base on light so these
 *     cards have the same "visible glass" presence as our
 *     attribute-matched overrides above.  This makes the .event-card
 *     in /app/events visible regardless of how it's built. */
html[data-eg-theme="light"] body[data-eg-app-section] .subgroup-card,
html[data-eg-theme="light"] body[data-eg-app-section] .event-card,
html[data-eg-theme="light"] body[data-eg-app-section] .live-card,
html[data-eg-theme="light"] body[data-eg-app-section] .session-card,
html[data-eg-theme="light"] body[data-eg-app-section] .card {
  background: rgba(255, 255, 255, 0.55) !important;
  border-color: rgba(15, 23, 41, 0.10) !important;
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  box-shadow:
    0 1px 2px rgba(15, 23, 41, 0.03),
    0 8px 24px rgba(15, 23, 41, 0.06) !important;
}
html[data-eg-theme="light"] body[data-eg-app-section] .subgroup-card:hover,
html[data-eg-theme="light"] body[data-eg-app-section] .event-card:hover,
html[data-eg-theme="light"] body[data-eg-app-section] .live-card:hover,
html[data-eg-theme="light"] body[data-eg-app-section] .session-card:hover,
html[data-eg-theme="light"] body[data-eg-app-section] .card:hover {
  background: rgba(255, 255, 255, 0.72) !important;
  border-color: rgba(35, 137, 199, 0.40) !important;
  box-shadow:
    0 12px 32px rgba(35, 137, 199, 0.14),
    0 2px 8px rgba(15, 23, 41, 0.06) !important;
}

/* (7) DARK theme — also blur class-based cards for unified depth. */
html[data-eg-theme="dark"] body[data-eg-app-section] .subgroup-card,
html[data-eg-theme="dark"] body[data-eg-app-section] .event-card,
html[data-eg-theme="dark"] body[data-eg-app-section] .live-card,
html[data-eg-theme="dark"] body[data-eg-app-section] .session-card {
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
}

/* ─────────────────────────────────────────────────────────────────
 * v54 — Remove decorative .hero-grid + .hero-network overlays
 *
 *   User report (verbatim):
 *     「ダークモードで、画面を更新すると、まだ、背景に 六角形の線の図が
 *      残っているのですね、不要です、表示も重くなりますので、削除ください。
 *      ライトモードも同様です」
 *
 *   Source HTML has two decorative overlays inside the .hero block:
 *     1. <div class="hero-grid"></div>   — 64px linear-gradient mesh
 *        masked into an ellipse → reads as a faint hexagonal/grid pattern
 *     2. <div class="hero-network">...</div> — animated network graph
 *
 *   Both are purely cosmetic, slightly hurt paint performance on refresh,
 *   and the user does not want them.  Hide them entirely on BOTH themes.
 *   We use `display:none` so the elements are removed from the layout
 *   tree (no paint, no animation tick, no compositor layer) — the cheapest
 *   way to eliminate them without touching the source HTML.
 *
 *   This applies on ALL viewport widths (mobile + PC), both themes.
 */
.hero > .hero-grid,
.hero > .hero-network {
  display: none !important;
}
