:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --ink: #121826;
  --muted: #647282;
  --line: #dce3ea;
  --surface: #ffffff;
  --accent: #087f8c;
  --accent-2: #d1495b;
  --soft: #eef4f8;
  --shadow: 0 18px 54px rgba(18, 24, 38, 0.13);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1018;
  --ink: #f0f6ff;
  --muted: #a9b7c8;
  --line: #263545;
  --surface: #111a25;
  --accent: #22c7d6;
  --accent-2: #ffb454;
  --soft: #172434;
  --shadow: 0 18px 54px rgba(0, 0, 0, 0.34);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  letter-spacing: 0;
}

a { color: inherit; text-decoration: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 0 22px;
  background: rgba(246, 248, 251, 0.9);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 30px rgba(18, 24, 38, 0.05);
  backdrop-filter: blur(18px);
}
:root[data-theme="dark"] .topbar { background: rgba(11, 16, 24, 0.92); }

.brand, nav { display: flex; align-items: center; gap: 12px; }
.brand { font-weight: 800; }
nav a { color: var(--muted); font-weight: 650; }
main,
footer {
  margin-left: 0;
}
.nav-toggle {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
  background: #121826;
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(18, 24, 38, 0.14);
}
.app-sidebar {
  position: fixed;
  top: 82px;
  left: 14px;
  z-index: 30;
  display: grid;
  gap: 8px;
  width: min(240px, calc(100vw - 28px));
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 140ms ease, transform 140ms ease;
  backdrop-filter: blur(16px);
}
:root[data-theme="dark"] .app-sidebar {
  background: rgba(12, 28, 26, 0.96);
}
body.nav-open .app-sidebar {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.app-sidebar a {
  display: grid;
  gap: 2px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(18, 24, 38, 0.06);
  transition: border-color 140ms ease, transform 140ms ease, background 140ms ease;
}
.app-sidebar a:hover,
.app-sidebar a:focus,
.app-sidebar a.is-active {
  border-color: color-mix(in srgb, var(--accent) 44%, var(--line));
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, var(--surface)), var(--surface));
  transform: translateY(-1px);
}
.app-sidebar span {
  font-weight: 900;
}
.app-sidebar small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}
.mobile-quick-nav {
  display: none;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(38vw, 360px);
}
.global-search {
  display: grid;
  gap: 3px;
  flex: 1;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 850;
  text-transform: uppercase;
}
.global-search input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-transform: none;
}
.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
}
#themeToggle { display: none; }
.account-quick-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  max-width: 190px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px 4px 4px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 850;
  box-shadow: 0 10px 24px rgba(18, 24, 38, 0.08);
}
.account-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-weight: 950;
}
#accountQuickLabel {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-panel {
  position: fixed;
  top: 72px;
  right: 18px;
  z-index: 20;
  display: grid;
  gap: 8px;
  width: min(520px, calc(100vw - 28px));
  max-height: min(70vh, 560px);
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 20px 60px rgba(18, 32, 31, 0.18);
}
.search-panel a, .search-panel article {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}
.search-panel span { color: var(--muted); line-height: 1.4; }
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 12px clamp(18px, 5vw, 72px) 0;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 800;
}
.breadcrumbs a { color: var(--accent); }
.breadcrumbs b { color: var(--line); }

.mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 28px;
  align-items: stretch;
  min-height: calc(100vh - 68px);
  padding: clamp(28px, 6vw, 78px) clamp(18px, 5vw, 72px) 36px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 820px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-2);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.78rem;
}

h1, h2 { margin: 0; line-height: 1.02; letter-spacing: 0; }
h1 { font-size: clamp(3rem, 8vw, 7rem); max-width: 860px; }
h2 { font-size: clamp(2rem, 5vw, 4rem); }

[hidden] { display: none !important; }

.lead {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1.65;
}

.home-portal {
  min-height: calc(100vh - 68px);
  padding: clamp(22px, 5vw, 54px) clamp(18px, 5vw, 72px) 92px;
  background:
    linear-gradient(90deg, rgba(18, 24, 38, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(18, 24, 38, 0.038) 1px, transparent 1px),
    linear-gradient(135deg, #ffffff 0%, #eef4f8 48%, #fff4f2 100%);
  background-size: 48px 48px, 48px 48px, auto;
}
:root[data-theme="dark"] .home-portal {
  background:
    linear-gradient(90deg, rgba(236, 255, 251, 0.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(236, 255, 251, 0.04) 1px, transparent 1px),
    linear-gradient(135deg, #071312 0%, #0f1f1d 56%, #071a1d 100%);
  background-size: 48px 48px, 48px 48px, auto;
}
.home-orbit {
  position: relative;
  display: grid;
  place-items: center;
  min-height: calc(100vh - 136px);
  border: 1px solid rgba(18, 32, 31, 0.14);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(18, 32, 31, 0.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(18, 32, 31, 0.05) 1px, transparent 1px),
    rgba(255, 253, 247, 0.66);
  background-size: 44px 44px;
}
.home-gateway {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 520px);
  gap: clamp(18px, 4vw, 48px);
  align-items: center;
  min-height: min(720px, calc(100vh - 136px));
  max-width: 1240px;
  margin: 0 auto;
}
.home-core {
  z-index: 1;
  max-width: 780px;
  padding: 0;
  text-align: left;
}
.home-core h1 {
  max-width: 920px;
  font-size: clamp(3.2rem, 8.4vw, 7.7rem);
}
.home-core .lead { margin-left: 0; margin-right: auto; }
.byline {
  margin: 10px 0 0;
  color: var(--accent);
  font-size: clamp(1.1rem, 2vw, 1.6rem);
  font-weight: 850;
}
.home-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 12px;
  margin-top: 28px;
}
.start-button {
  display: inline-grid;
  place-items: center;
  min-width: min(78vw, 300px);
  min-height: 78px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #121826, #087f8c);
  color: white;
  cursor: pointer;
  font: inherit;
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 900;
  box-shadow: 0 18px 50px rgba(18, 24, 38, 0.24);
}
.home-command {
  display: grid;
  gap: 14px;
  align-self: stretch;
}
.home-device {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-height: 170px;
  padding: 18px;
  border: 1px solid rgba(18, 32, 31, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.10), transparent 46%),
    linear-gradient(315deg, rgba(180, 83, 9, 0.11), transparent 42%),
    rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 50px rgba(18, 32, 31, 0.12);
}
:root[data-theme="dark"] .home-device {
  background:
    linear-gradient(135deg, rgba(45, 212, 191, 0.14), transparent 46%),
    linear-gradient(315deg, rgba(245, 158, 11, 0.12), transparent 42%),
    rgba(12, 28, 26, 0.88);
}
.home-device img {
  width: 104px;
  height: 104px;
  border-radius: 8px;
  box-shadow: 0 16px 34px rgba(18, 32, 31, 0.18);
}
.home-device strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.35rem, 2.8vw, 2.1rem);
  line-height: 1.08;
}
.home-device p,
.home-status-grid p,
.route-card small {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}
.home-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.home-status-grid article {
  min-height: 128px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}
:root[data-theme="dark"] .home-status-grid article {
  background: rgba(12, 28, 26, 0.82);
}
.home-status-grid span,
.route-card span {
  color: var(--accent-2);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}
.home-status-grid strong {
  display: block;
  margin-top: 6px;
  line-height: 1.14;
}
.home-route-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  max-width: 1240px;
  margin: 0 auto 16px;
}
.route-card {
  display: grid;
  gap: 8px;
  min-height: 190px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 30px rgba(18, 32, 31, 0.07);
}
:root[data-theme="dark"] .route-card {
  background: rgba(12, 28, 26, 0.88);
}
.route-card strong {
  font-size: 1.12rem;
  line-height: 1.2;
}
.route-hot {
  border-color: rgba(15, 118, 110, 0.45);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.13), transparent 56%),
    rgba(255, 255, 255, 0.92);
}
.partner-route {
  border-color: color-mix(in srgb, var(--accent-2) 34%, var(--line));
}
.mobile-action-dock {
  display: none;
}
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: start end;
  padding: 74px 18px 18px;
  background: rgba(18, 32, 31, 0.28);
  backdrop-filter: blur(6px);
}
.auth-popover {
  position: relative;
  display: grid;
  gap: 12px;
  width: min(470px, calc(100vw - 28px));
  max-height: calc(100vh - 92px);
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.auth-popover h2 {
  font-size: clamp(1.55rem, 5vw, 2.25rem);
}
.auth-popover p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}
.auth-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--soft);
  color: var(--ink);
  cursor: pointer;
  font-weight: 950;
}
.portal-button {
  display: inline-grid;
  place-items: center;
  min-height: 54px;
  padding: 0 18px;
  border: 1px solid rgba(18, 32, 31, 0.16);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.82);
  color: var(--ink);
  font-weight: 850;
  box-shadow: 0 10px 28px rgba(18, 32, 31, 0.08);
}
.help-dot {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-top: 12px;
  padding: 0;
  border: 1px solid rgba(18, 32, 31, 0.16);
  border-radius: 50%;
  background: #fffdf7;
  color: var(--accent-2);
  font-weight: 950;
}
.help-dot::after {
  content: attr(data-tip);
  position: absolute;
  z-index: 5;
  display: none;
  width: min(320px, 82vw);
  left: 0;
  top: calc(100% + 8px);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #12201f;
  color: white;
  font-size: .9rem;
  font-weight: 650;
  line-height: 1.45;
  text-align: left;
}
.help-dot:hover::after, .help-dot:focus-visible::after { display: block; }
.orbit-note {
  position: absolute;
  max-width: 210px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(18, 32, 31, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-weight: 750;
}
.orbit-note-a { top: 12%; left: 8%; }
.orbit-note-b { top: 18%; right: 8%; }
.orbit-note-c { bottom: 14%; left: 10%; }
.orbit-note-d { right: 12%; bottom: 12%; }
.help-bubble {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(18, 32, 31, 0.16);
  border-radius: 50%;
  background: #fffdf7;
  color: var(--accent-2);
  font-weight: 950;
}
.help-bubble::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  display: none;
  width: min(260px, 78vw);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #12201f;
  color: white;
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.4;
  transform: translateX(-50%);
}
.help-bubble:hover::after, .help-bubble:focus-visible::after { display: block; }
.help-bubble-a { top: 9%; left: 28%; }
.help-bubble-b { top: 34%; right: 18%; }
.help-bubble-c { left: 18%; bottom: 28%; }
.help-bubble-d { right: 31%; bottom: 10%; }
.player-page { background: #f7faf8; min-height: calc(100vh - 68px); }
.player-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.player-card {
  display: grid;
  gap: 12px;
  min-height: 250px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(18, 32, 31, 0.06);
}
.player-card strong { font-size: 1.2rem; line-height: 1.2; }
.player-card p { margin: 0; color: var(--muted); line-height: 1.5; }
.games-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: 16px;
}
.game-card {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 170px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(18, 32, 31, 0.07);
}
.featured-game {
  background:
    linear-gradient(135deg, rgba(255, 61, 127, 0.12), transparent 42%),
    linear-gradient(315deg, rgba(38, 240, 189, 0.16), transparent 48%),
    var(--surface);
}
.locked-game { opacity: 0.82; }
.game-icon {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 8px;
  background: #12201f;
  color: white;
  font-size: 2.4rem;
  font-weight: 950;
}
.pulso-mark {
  background:
    radial-gradient(circle at 50% 35%, #26f0bd 0 18%, transparent 19%),
    linear-gradient(135deg, #ff3d7f, #8c6cff 48%, #07070b);
  box-shadow: 0 18px 38px rgba(255, 61, 127, 0.24);
}
.game-info {
  display: grid;
  gap: 7px;
  min-width: 0;
}
.game-info strong {
  font-size: clamp(1.45rem, 3vw, 2.4rem);
  line-height: 1;
}
.game-info span:last-child {
  color: var(--muted);
  line-height: 1.45;
}
.tools-page {
  min-height: calc(100vh - 68px);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.10), transparent 36%),
    linear-gradient(315deg, rgba(180, 83, 9, 0.10), transparent 42%),
    #fbfdfb;
}
.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}
.tool-card-link { color: inherit; }
.tool-card {
  display: grid;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(18, 32, 31, 0.06);
}
.tool-card label {
  font-weight: 850;
  color: var(--ink);
}
.tool-card input, .tool-card select, .tool-card textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
.tool-card textarea {
  padding: 12px;
  resize: vertical;
  line-height: 1.45;
}
.tool-card input[type="file"] {
  min-height: auto;
  padding: 11px 12px;
}
.tool-card output {
  min-height: 72px;
  padding: 12px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  line-height: 1.5;
}
.tool-logo-card {
  align-content: start;
  min-height: 280px;
}
.tool-logo {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border-radius: 8px;
  background: #12201f;
  color: white;
  font-size: 2.7rem;
  font-weight: 950;
  box-shadow: 0 18px 40px rgba(18, 32, 31, 0.18);
}
.audio-logo {
  background:
    linear-gradient(135deg, #0f766e, #b45309);
}
.tool-logo-card h3 {
  margin: 0;
  font-size: 1.45rem;
}
.tool-logo-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}
.gateway-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  max-width: 1240px;
  margin: 0 auto;
}
.gateway-grid article {
  display: grid;
  gap: 7px;
  min-height: 148px;
  padding: 18px;
  border: 1px solid rgba(18, 32, 31, 0.14);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.82);
  box-shadow: 0 12px 34px rgba(18, 32, 31, 0.09);
}
:root[data-theme="dark"] .gateway-grid article {
  background: rgba(12, 28, 26, 0.84);
}
.gateway-grid span {
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 900;
}
.gateway-grid strong {
  font-size: 1.15rem;
}
.gateway-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.partner-page {
  background:
    linear-gradient(90deg, rgba(18, 24, 38, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(18, 24, 38, 0.032) 1px, transparent 1px);
  background-size: 42px 42px;
}

.partner-spotlight {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(280px, 1.05fr);
  gap: 16px;
  max-width: 1120px;
}

.partner-card,
.partner-map article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 14px 36px rgba(18, 24, 38, 0.08);
}

.partner-card {
  display: grid;
  align-content: center;
  gap: 14px;
  min-height: 360px;
  padding: clamp(20px, 4vw, 34px);
}

.partner-card h3 {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 4.6rem);
  line-height: 0.98;
}

.partner-card p,
.partner-map p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.partner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.partner-map {
  display: grid;
  gap: 12px;
}

.partner-map article {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 18px;
}

.partner-map span {
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 950;
}

.partner-map strong {
  font-size: 1.12rem;
}
.access-gate {
  min-height: calc(100vh - 68px);
  padding: clamp(28px, 6vw, 76px) clamp(18px, 5vw, 72px);
  background: linear-gradient(135deg, #fffaf0 0%, var(--bg) 52%, #edf6f7 100%);
}
.gate-panel {
  display: grid;
  gap: 18px;
  max-width: 820px;
  padding: clamp(20px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(18, 32, 31, 0.12);
}
.gate-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}
.diary-card {
  display: grid;
  gap: 12px;
}
.diary-entry p {
  white-space: pre-wrap;
}
.speed-logo {
  font-size: 1.15rem;
  color: #083344;
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.22), rgba(20, 184, 166, 0.20)),
    #ecfeff;
}
.revenue-logo {
  color: #f7fee7;
  background:
    linear-gradient(135deg, rgba(20, 83, 45, 0.92), rgba(15, 118, 110, 0.82)),
    #14532d;
}
.compact-focus-tool {
  margin-top: 18px;
}
.tool-ideas {
  margin-top: 28px;
}
.compact-title {
  margin-bottom: 16px;
}
.compact-title h2 {
  font-size: clamp(1.7rem, 3vw, 2.5rem);
}
.tool-idea-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.tool-idea {
  display: grid;
  gap: 10px;
  min-height: 180px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.82);
}
.tool-idea strong {
  font-size: 1.05rem;
}
.tool-idea p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}
.tool-hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.event-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.event-card {
  display: grid;
  gap: 12px;
  min-height: 260px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(18, 32, 31, 0.06);
}
.event-card h3 { margin: 0; }
.event-card p { margin: 0; color: var(--muted); line-height: 1.5; }
.course-page {
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.07), transparent 34%),
    #f8fbfb;
}
.lesson-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.lesson-card {
  min-height: 210px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 12px 30px rgba(18, 32, 31, 0.05);
}
.lesson-card h3 { margin: 10px 0 8px; }
.lesson-card p { margin: 0; color: var(--muted); line-height: 1.55; }
.seo-checklist {
  width: min(980px, 100%);
  margin: 22px auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
}
.seo-checklist ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  padding-left: 20px;
}
.reading-page {
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.08), transparent 34%),
    #fbfdfb;
}
.reading-article {
  display: grid;
  gap: 16px;
  width: min(980px, 100%);
  margin: 0 auto;
  padding: clamp(20px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 42px rgba(18, 32, 31, 0.07);
}
.reading-article h3 {
  margin: 8px 0 0;
  font-size: clamp(1.2rem, 2.4vw, 1.8rem);
}
.reading-article p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.72;
}
.reading-note {
  padding: 16px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 8px;
  background: #ecfdf5;
  color: #14532d;
  line-height: 1.55;
}
.reading-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.utility-page {
  min-height: calc(100vh - 68px);
  background:
    linear-gradient(180deg, rgba(180, 83, 9, 0.06), transparent 32%),
    #f8fbfb;
}
.utility-card {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 30px);
}
.utility-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}
.speed-test-page {
  background:
    linear-gradient(180deg, rgba(14, 165, 233, 0.08), transparent 34%),
    #f8fbfb;
}
.speed-card {
  align-items: center;
  text-align: center;
}
.speed-meter {
  position: relative;
  display: grid;
  place-items: center;
  width: min(300px, 82vw);
  aspect-ratio: 2 / 1;
  margin: 0 auto 8px;
  overflow: hidden;
  border-radius: 300px 300px 12px 12px;
  background:
    radial-gradient(circle at 50% 100%, var(--surface) 0 34%, transparent 35%),
    conic-gradient(from 270deg at 50% 100%, #ef4444 0deg 38deg, #f59e0b 38deg 84deg, #22c55e 84deg 180deg, transparent 180deg 360deg);
  border: 1px solid var(--line);
}
.speed-meter strong {
  position: absolute;
  bottom: 20px;
  font-size: clamp(2.4rem, 8vw, 4.4rem);
  line-height: 1;
  color: var(--ink);
}
.speed-meter small {
  position: absolute;
  bottom: 4px;
  color: var(--muted);
  font-weight: 800;
}
.speed-needle {
  position: absolute;
  bottom: 0;
  width: 44%;
  height: 4px;
  transform-origin: right center;
  transform: rotate(-90deg);
  background: #083344;
  border-radius: 999px;
  transition: transform 220ms ease;
}
.speed-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}
.speed-stats article {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}
.speed-stats span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}
.speed-stats strong {
  font-size: 1.05rem;
}
.secondary-button {
  background: #f8fafc;
  color: var(--ink);
  border: 1px solid var(--line);
}
.speed-details {
  width: 100%;
  display: grid;
  gap: 12px;
  text-align: left;
}
.speed-details h3 {
  margin: 4px 0 0;
}
.speed-identity-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.speed-identity-grid article {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}
.speed-identity-grid span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}
.speed-identity-grid strong {
  overflow-wrap: anywhere;
  font-size: 0.88rem;
}
.speed-details pre {
  max-height: 280px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #082f2f;
  color: #e6fffb;
  font-size: 0.82rem;
  line-height: 1.45;
  white-space: pre-wrap;
}
.revenue-card output {
  display: block;
  margin-top: 10px;
  font-weight: 850;
}
.revenue-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.revenue-results article {
  display: grid;
  gap: 5px;
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}
.revenue-results span {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 800;
  text-transform: uppercase;
}
.revenue-results strong {
  color: #14532d;
  font-size: clamp(1.1rem, 2vw, 1.55rem);
}
.revenue-results small {
  color: var(--muted);
  line-height: 1.35;
}
.revenue-playbook {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}
.related-links {
  display: grid;
  gap: 10px;
  padding: 20px clamp(18px, 5vw, 72px);
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.related-links div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.related-links a {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  font-weight: 800;
}
textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  font: inherit;
  background: white;
}
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] select,
:root[data-theme="dark"] input,
:root[data-theme="dark"] .tool-card input,
:root[data-theme="dark"] .tool-card select,
:root[data-theme="dark"] .tool-card textarea {
  background: #071312;
  color: var(--ink);
}
.preview-canvas {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.qr-box {
  display: grid;
  place-items: center;
  min-height: 220px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: white;
}
.converter-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.42fr) minmax(160px, 1fr);
  gap: 10px;
  align-items: end;
}
.audio-tool .button[hidden] { display: none !important; }
.audio-tool .button { text-align: center; }
.audio-converter-page {
  min-height: calc(100vh - 68px);
  padding-left: clamp(18px, 4vw, 56px);
  padding-right: clamp(18px, 4vw, 56px);
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.08), transparent 36%),
    #f8fbfb;
}
.audio-title {
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.audio-tool-layout {
  display: grid;
  grid-template-columns: minmax(150px, 0.42fr) minmax(420px, 1.35fr) minmax(150px, 0.42fr);
  gap: clamp(14px, 2vw, 24px);
  align-items: stretch;
  width: min(1180px, 100%);
  margin: 0 auto;
}
.audio-tool-layout .ad-slot {
  margin: 0;
}
.audio-tool {
  min-height: 380px;
  justify-content: center;
  padding: clamp(20px, 3vw, 34px);
}
.audio-side-ad {
  min-height: 380px;
}
.audio-ad {
  width: min(1180px, 100%);
  margin: 18px auto;
}
.audio-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: min(1180px, 100%);
  margin: 18px auto 0;
}
.ad-slot-inline {
  margin-bottom: 16px;
}
.hidden-story-key {
  position: fixed;
  right: 7px;
  bottom: 7px;
  z-index: 9;
  display: grid;
  place-items: center;
  width: 8px;
  height: 8px;
  overflow: hidden;
  border-radius: 50%;
  color: transparent;
  background: rgba(18, 32, 31, 0.28);
}
.hidden-story-key:hover, .hidden-story-key:focus-visible {
  width: 18px;
  height: 18px;
  color: white;
  background: var(--accent-2);
}
.manual-page { background: #eef6e9; min-height: calc(100vh - 68px); }
.story-page {
  min-height: calc(100vh - 68px);
  background:
    radial-gradient(circle at 12% 22%, rgba(180, 83, 9, 0.18), transparent 30%),
    linear-gradient(145deg, #fffdf7, #eef6e9);
}
.story-stage {
  display: grid;
  gap: 16px;
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(20px, 5vw, 42px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 50px rgba(18, 32, 31, 0.10);
}
.story-stage h2 { font-size: clamp(2rem, 6vw, 4.5rem); }
.story-stage p { margin: 0; color: var(--muted); font-size: 1.08rem; line-height: 1.7; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.button, button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 750;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.button.primary { background: var(--accent); color: white; border-color: var(--accent); }
.button.ghost { background: transparent; }

.signal-panel, .tool-card, .module-card, .book-card, .app-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(18, 32, 31, 0.06);
}

.signal-panel {
  align-self: end;
  padding: 24px;
  min-height: 260px;
}

.status-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  border-radius: 50%;
  background: #22c55e;
}

.ad-slot {
  margin: 0 clamp(18px, 5vw, 72px);
  min-height: 92px;
  padding: 16px;
  border: 1px dashed #9ca3af;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.5);
  text-align: center;
}
.ad-slot[data-ads-ready="true"] {
  display: block;
  border-style: solid;
  background: rgba(255, 255, 255, 0.72);
}
.ad-slot[data-ads-ready="auto"] {
  display: none;
  min-height: 0;
  padding: 0;
  border: 0;
  opacity: 0;
}
.ad-slot[data-ads-ready="false"],
.ad-slot:empty {
  display: none;
}
.ad-slot-home {
  margin-top: -74px;
  margin-bottom: 18px;
}
.ad-slot-home[data-ads-ready="auto"] {
  min-height: 54px;
  opacity: 0.46;
}
.ad-slot-native { margin-top: 24px; margin-bottom: 24px; }

.section {
  padding: 76px clamp(18px, 5vw, 72px);
  border-top: 1px solid var(--line);
}

.section-title { position: relative; max-width: 780px; margin-bottom: 26px; }
.module-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.module-card { min-height: 220px; padding: 18px; display: flex; flex-direction: column; justify-content: space-between; }
.module-card p { color: var(--muted); line-height: 1.5; }
.library-band { background: #eef6e9; }
.book-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.book-card { overflow: hidden; min-height: 360px; display: flex; flex-direction: column; }
.book-cover {
  display: grid;
  place-items: center;
  min-height: 230px;
  padding: 16px;
  background: linear-gradient(145deg, #0f766e, #164e63);
  color: white;
  text-align: center;
  font-weight: 850;
}
.book-cover img { width: 100%; height: 230px; object-fit: cover; border-radius: 0; }
.book-body { padding: 14px; display: flex; flex: 1; flex-direction: column; gap: 8px; }
.book-body h3 { margin: 0; font-size: 1rem; line-height: 1.2; }
.book-body p { margin: 0; color: var(--muted); line-height: 1.4; }
.book-actions { margin-top: auto; display: flex; gap: 8px; }
.book-detail-grid { display: grid; grid-template-columns: minmax(220px, 340px) minmax(0, 1fr); gap: 18px; align-items: stretch; }
.detail-cover { min-height: 420px; }
.pdf-reader { width: 100%; min-height: 78vh; margin-top: 18px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.mini-list { display: grid; gap: 12px; margin-top: 12px; }
.mini-list-item { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.72); }
.mini-list-item p { margin: 0; color: var(--muted); line-height: 1.45; }
.download-landing { min-height: calc(100vh - 68px); }
.ad-grid { display: grid; grid-template-columns: minmax(160px, .7fr) minmax(280px, 1.3fr) minmax(160px, .7fr); gap: 16px; align-items: stretch; }
.download-focus { display: grid; place-items: center; min-height: 360px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.policy-page { background: #f8fbfb; }
.policy-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.templo-page {
  background: #f7faf8;
}
.compact-title {
  margin-top: 34px;
}
.templo-principles,
.templo-grid,
.templo-map,
.templo-history-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.templo-principles article,
.templo-card,
.templo-map article,
.templo-history-list article,
.templo-timeline article,
.templo-question-grid article {
  display: grid;
  gap: 9px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(18, 32, 31, 0.06);
}
.templo-principles span,
.templo-timeline span,
.templo-question-grid span {
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 900;
}
.templo-principles p,
.templo-card p,
.templo-map p,
.templo-history-list p,
.templo-history-list small,
.templo-timeline p,
.templo-question-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}
.templo-search {
  max-width: 920px;
  margin: 24px 0 28px;
}
.templo-search input,
.templo-history-form textarea,
.templo-history-form input,
.templo-history-form select {
  width: 100%;
}
.templo-search-output {
  display: grid;
  gap: 10px;
  min-height: 76px;
  padding: 12px;
  border-radius: 8px;
  background: var(--soft);
}
.templo-search-output a,
.templo-search-output article {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.72);
}
.templo-card {
  min-height: 178px;
}
.templo-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}
.templo-selected {
  max-width: none;
  margin-bottom: 26px;
}
.templo-question-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.templo-timeline {
  display: grid;
  gap: 12px;
  max-width: 980px;
}
.templo-timeline article {
  grid-template-columns: 120px 140px minmax(0, 1fr);
  align-items: start;
}
.templo-timeline h3,
.templo-timeline p {
  grid-column: 3;
}
.templo-history-form {
  max-width: 980px;
  margin-bottom: 18px;
}
.app-band { background: #f7faf8; }
.app-panel { padding: 22px; align-self: stretch; }
.app-panel span { display: inline-flex; margin-top: 16px; color: var(--accent); font-weight: 850; }
.puzzle-band { background: #f4f1e8; }
.fragment-stage {
  display: grid;
  gap: 14px;
  max-width: 980px;
  margin-bottom: 22px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
}
.fragment-stage[hidden] { display: none; }
.fragment-stage h3 { margin: 0; font-size: 1.55rem; line-height: 1.15; }
.fragment-stage p { margin: 0; color: var(--muted); line-height: 1.55; }
.fragment-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.puzzle-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.puzzle-card {
  display: grid;
  gap: 10px;
  min-height: 190px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(18, 32, 31, 0.06);
}
.puzzle-card strong { font-size: 1.05rem; line-height: 1.2; }
.puzzle-card p { margin: 0; color: var(--muted); line-height: 1.45; }
.puzzle-code { color: var(--accent-2); font-size: 0.78rem; font-weight: 850; letter-spacing: 0; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 420px); gap: 28px; align-items: start; }
.tool-card { padding: 18px; display: grid; gap: 10px; }
label { font-weight: 750; }
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  font: inherit;
}
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  font: inherit;
}
output { color: var(--muted); line-height: 1.45; }

.account-auth-card {
  margin-bottom: 18px;
}

.auth-status-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  max-width: 1120px;
  margin: 0 0 18px;
}

.auth-status-panel article {
  display: grid;
  gap: 8px;
  min-height: 128px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(18, 24, 38, 0.06);
}

.auth-status-panel span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.auth-status-panel strong {
  width: fit-content;
  border-radius: 8px;
  padding: 6px 9px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.94rem;
}

.auth-status-panel strong[data-status="on"] {
  background: color-mix(in srgb, var(--accent) 15%, var(--surface));
  color: var(--accent);
}

.auth-status-panel strong[data-status="warn"] {
  background: color-mix(in srgb, var(--accent-2) 16%, var(--surface));
  color: var(--accent-2);
}

.auth-status-panel strong[data-status="off"] {
  background: color-mix(in srgb, #d1495b 12%, var(--surface));
  color: #d1495b;
}

.auth-status-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.account-menu-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.account-menu-grid .module-card {
  color: inherit;
  min-height: 190px;
}

.shop-shelf,
.life-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 1100px;
}

.social-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 1120px;
}
.social-composer,
.social-feed-card {
  display: grid;
  gap: 12px;
}
.social-feed {
  display: grid;
  gap: 10px;
  max-height: 620px;
  overflow: auto;
}
.social-post {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}
.social-post time {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}
.social-post p {
  margin: 0;
  line-height: 1.5;
  white-space: pre-wrap;
}
.direct-post {
  background: color-mix(in srgb, var(--soft) 72%, var(--accent) 12%);
}

.reader-app,
.reader-shell {
  display: grid;
  gap: 18px;
}
.reader-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.reader-header h2 {
  font-size: clamp(1.8rem, 5vw, 3.4rem);
}
.reader-header p {
  margin: 8px 0 0;
  color: var(--muted);
}
.reader-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.reader-surface {
  min-height: 70vh;
  padding: clamp(16px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: var(--reader-font-size, 18px);
  line-height: 1.75;
}
.reader-frame {
  min-height: 78vh;
}
.reader-text {
  max-width: 820px;
  margin: 0 auto;
  white-space: pre-wrap;
}

.home-continue,
.store-cart {
  display: grid;
  gap: 14px;
  width: min(1100px, 100%);
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 12px 32px rgba(18, 32, 31, 0.08);
}

:root[data-theme="dark"] .home-continue,
:root[data-theme="dark"] .store-cart {
  background: rgba(12, 28, 26, 0.78);
}

.home-continue {
  margin: 6px auto 0;
}

.home-continue-grid,
.store-cart-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.home-continue-card,
.store-cart-item {
  display: grid;
  gap: 8px;
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.home-continue-card strong,
.store-cart-item strong {
  font-size: 1.02rem;
}

.home-continue-card p,
.store-cart-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.goal-done {
  opacity: 0.76;
}

.goal-done h3 {
  text-decoration: line-through;
}

.shop-product,
.reading-progress-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(18, 32, 31, 0.06);
}

.shop-product h3,
.reading-progress-card h3 {
  margin: 0;
}

.shop-product p,
.reading-progress-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.reading-progress-card {
  margin: 18px 0;
  max-width: 980px;
}

.reading-progress-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.account-auth-form {
  display: grid;
  gap: 12px;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.auth-actions .button {
  min-width: 128px;
}

.social-auth-actions {
  display: grid;
  grid-template-columns: 1fr;
}

.social-button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 54px;
  gap: 12px;
  font-size: 0.98rem;
}

.social-button span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #121826;
  font-weight: 950;
}

.social-button.google {
  background: #ffffff;
  color: #121826;
  border-color: #ccd6e0;
}

.social-button.facebook {
  background: #1877f2;
  color: #ffffff;
  border-color: #1877f2;
}

.form-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.form-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.offline, .soft-band { background: var(--soft); }
.offline ul { display: grid; gap: 10px; padding-left: 20px; max-width: 820px; }
.download-link[aria-disabled="true"] {
  opacity: 0.68;
  pointer-events: none;
}
.meta-pill {
  display: inline-flex;
  width: fit-content;
  border-radius: 8px;
  padding: 6px 9px;
  background: var(--soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  padding: 28px clamp(18px, 5vw, 72px);
  color: var(--muted);
}

@media (max-width: 860px) {
  main,
  footer {
    margin-left: 0;
  }
  .app-sidebar {
    top: 78px;
    left: 12px;
    right: 12px;
    bottom: auto;
    grid-template-columns: 1fr;
    width: auto;
    padding: 10px;
  }
  .app-sidebar a {
    min-width: 0;
    padding: 12px;
    text-align: left;
  }
  .app-sidebar span {
    font-size: 1rem;
  }
  .app-sidebar small {
    display: block;
  }
  body { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  .mobile-quick-nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 48px rgba(18, 32, 31, 0.2);
    backdrop-filter: blur(14px);
  }
  :root[data-theme="dark"] .mobile-quick-nav {
    background: rgba(12, 28, 26, 0.96);
  }
  .mobile-quick-nav a {
    display: grid;
    place-items: center;
    min-height: 42px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 900;
  }
  .mobile-quick-nav a:focus,
  .mobile-quick-nav a:hover,
  .mobile-quick-nav a.is-active {
    background: var(--soft);
    color: var(--accent);
  }
  body[data-page="inicio"] .mobile-quick-nav {
    display: none;
  }
  .topbar {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 10px 14px;
    gap: 10px;
  }
  .top-actions {
    grid-column: 1 / -1;
  }
  nav { width: 100%; justify-content: space-between; }
  .top-actions { width: 100%; min-width: 0; }
  .search-panel { top: 112px; right: 14px; }
  .hero, .split, .home-gateway { grid-template-columns: 1fr; min-height: auto; }
  .home-core { padding: 0; }
  .home-route-board,
  .gateway-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-status-grid { grid-template-columns: 1fr; }
  .home-orbit { min-height: 680px; }
  .orbit-note { position: static; margin: 8px; justify-self: stretch; }
  .help-bubble { position: static; margin: 6px; }
  .home-core { order: -1; }
  .module-grid { grid-template-columns: 1fr; }
  .policy-grid { grid-template-columns: 1fr; }
  .templo-principles,
  .templo-grid,
  .templo-map,
  .templo-history-list,
  .templo-question-grid {
    grid-template-columns: 1fr;
  }
  .templo-timeline article {
    grid-template-columns: 1fr;
  }
  .templo-timeline h3,
  .templo-timeline p {
    grid-column: auto;
  }
  .player-grid { grid-template-columns: 1fr; }
  .games-grid { grid-template-columns: 1fr; }
  .game-card { grid-template-columns: 62px minmax(0, 1fr); }
  .game-card .button { grid-column: 1 / -1; }
  .game-icon { width: 62px; height: 62px; font-size: 2rem; }
  .account-menu-grid,
  .auth-status-panel { grid-template-columns: 1fr; }
  .home-continue-grid,
  .store-cart-grid { grid-template-columns: 1fr 1fr; }
  .shop-shelf,
  .life-layout,
  .social-layout,
  .partner-spotlight,
  .reading-progress-form { grid-template-columns: 1fr; }
  .reader-header { display: grid; }
  .reader-actions { justify-content: flex-start; }
  .tools-grid { grid-template-columns: 1fr; }
  .tool-idea-grid { grid-template-columns: 1fr; }
  .tool-hub-grid { grid-template-columns: 1fr; }
  .event-grid { grid-template-columns: 1fr; }
  .lesson-grid { grid-template-columns: 1fr; }
  .seo-checklist ul { grid-template-columns: 1fr; }
  .utility-row { grid-template-columns: 1fr; }
  .speed-stats { grid-template-columns: 1fr 1fr; }
  .speed-identity-grid { grid-template-columns: 1fr; }
  .revenue-results { grid-template-columns: 1fr; }
  .revenue-playbook { grid-template-columns: 1fr; }
  .book-detail-grid, .ad-grid { grid-template-columns: 1fr; }
  .audio-tool-layout { grid-template-columns: 1fr; }
  .audio-info-grid { grid-template-columns: 1fr; }
  .audio-side-ad { min-height: 120px; }
  .puzzle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-overlay {
    place-items: start center;
    padding-top: 92px;
  }
  .account-quick-button {
    max-width: 160px;
  }
  footer { flex-direction: column; }
  .section { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .reading-article { padding: 18px; }
}

@media (max-width: 560px) {
  .brand span:last-child { font-size: 0.92rem; }
  .topbar nav:not(.mobile-quick-nav) { display: none; }
  #accountQuickLabel { display: none; }
  .account-quick-button {
    width: 42px;
    padding: 4px;
    justify-content: center;
  }
  .breadcrumbs { font-size: .8rem; }
  .book-grid { grid-template-columns: 1fr; }
  .puzzle-grid { grid-template-columns: 1fr; }
  .converter-row { grid-template-columns: 1fr; }
  .auth-actions { display: grid; grid-template-columns: 1fr; }
  .auth-actions .button { width: 100%; }
  .section-title h2 { font-size: clamp(1.7rem, 11vw, 2.6rem); }
  .home-portal {
    min-height: calc(100vh - 124px);
    padding: 18px 16px 92px;
  }
  .home-gateway { gap: 18px; }
  .home-core h1 { font-size: clamp(2.7rem, 16vw, 4.6rem); }
  .home-core .lead { font-size: 1.02rem; line-height: 1.55; }
  .home-device {
    grid-template-columns: 72px minmax(0, 1fr);
    min-height: 132px;
    padding: 14px;
  }
  .home-device img {
    width: 72px;
    height: 72px;
  }
  .home-device strong { font-size: 1.2rem; }
  .home-route-board,
  .gateway-grid { grid-template-columns: 1fr; }
  .route-card {
    min-height: 138px;
    padding: 16px;
  }
  .start-button { min-width: 100%; min-height: 62px; font-size: 1.18rem; }
  .portal-button { width: 100%; }
  .home-continue-grid,
  .store-cart-grid { grid-template-columns: 1fr; }
  .gateway-grid article {
    min-height: 132px;
    padding: 14px;
  }
  .mobile-quick-nav {
    left: 6px;
    right: 6px;
    gap: 4px;
    padding: 6px;
  }
  .mobile-quick-nav a {
    font-size: 0.72rem;
  }
  .mobile-action-dock {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 18px 60px rgba(18, 32, 31, 0.24);
    backdrop-filter: blur(16px);
  }
  :root[data-theme="dark"] .mobile-action-dock {
    background: rgba(12, 28, 26, 0.95);
  }
  .mobile-action-dock a,
  .mobile-action-dock button {
    display: grid;
    place-items: center;
    min-height: 42px;
    padding: 0 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 900;
    text-align: center;
  }
}
