/* Soft Pulse plate home + stock charts */
:root {
  --text: #1a1f36;
  --muted: #6b7289;
  --faint: #9aa3b5;
  --ink: #12131a;
  --blue: #3d7bff;
  --gold: #ebb641;
  --teal: #48b0bf;
  --mint: #2ecc71;
  --magenta: #b03d9d;
  --consist: #2ecc71;
  --journal: #3d7bff;
  --mood: #b03d9d;
  --shadow: 0 12px 40px rgba(26, 37, 64, 0.08);
  --mx: 50%; --my: 40%;
  --b1x: 20%; --b1y: 25%; --b2x: 75%; --b2y: 20%;
  --b3x: 55%; --b3y: 70%; --b4x: 25%; --b4y: 75%; --b5x: 88%; --b5y: 60%;
  --glow: 1;
  --tilt-max: 3.2;
  --tilt-lift: 2;
  --tilt-ease: 0.14;
  --glass: rgba(255, 255, 255, 0.48);
  --card: rgba(255, 255, 255, 0.82);
  --dash-gap: 1rem;
  --dash-pad: 1.35rem;
  --animals-fr: 1.15fr;
  --profile-fr: 0.85fr;
  --shell-max: 1180px;
  --chart-h: 200px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background: #e8ecf6;
  overflow-x: hidden;
  min-height: 100vh;
}

.versions-link {
  position: fixed; top: 1rem; right: 1rem; z-index: 100;
  font-family: "Syne", sans-serif; font-size: 0.78rem; font-weight: 700;
  padding: 0.55rem 0.95rem; border-radius: 999px; text-decoration: none; color: var(--muted);
  background: rgba(255,255,255,0.85); backdrop-filter: blur(10px); box-shadow: var(--shadow);
}

.bg-fixed { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #e8ecf6; }
.orb {
  position: absolute; border-radius: 50%; filter: blur(64px);
  opacity: calc(0.58 * var(--glow)); transform: translate(-50%, -50%);
  will-change: left, top, opacity; pointer-events: none;
}
.orb.o1 { width: 56vmax; height: 56vmax; left: var(--b1x); top: var(--b1y); background: radial-gradient(circle, rgba(235,182,65,0.95), transparent 68%); }
.orb.o2 { width: 50vmax; height: 50vmax; left: var(--b2x); top: var(--b2y); background: radial-gradient(circle, rgba(61,123,255,0.92), transparent 68%); }
.orb.o3 { width: 46vmax; height: 46vmax; left: var(--b3x); top: var(--b3y); background: radial-gradient(circle, rgba(176,61,157,0.78), transparent 68%); }
.orb.o4 { width: 42vmax; height: 42vmax; left: var(--b4x); top: var(--b4y); background: radial-gradient(circle, rgba(72,176,191,0.88), transparent 68%); }
.orb.o5 { width: 36vmax; height: 36vmax; left: var(--b5x); top: var(--b5y); background: radial-gradient(circle, rgba(46,204,113,0.7), transparent 68%); }
.bg-spot {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle 480px at var(--mx) var(--my), rgba(255,255,255,0.42), rgba(61,123,255,0.08) 40%, transparent 58%);
}

.side-nav {
  position: fixed; left: 1.1rem; top: 43%; z-index: 40;
  transform: translate(-140%, -50%);
  opacity: 0; pointer-events: none;
  transition: transform 0.6s cubic-bezier(0.22,1,0.36,1), opacity 0.45s ease;
  display: flex; flex-direction: column; gap: 0.55rem;
}
.side-nav.show { transform: translate(0, -50%); opacity: 1; pointer-events: auto; }
.side-nav .nav-logo {
  position: relative;
  display: block;
  width: 108px;
  height: 58px;
  margin: 0 0 0.15rem 0.05rem;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  max-width: none;
  color: var(--text);
  overflow: visible;
}
.side-nav .nav-logo:hover {
  transform: none;
  background: transparent;
  color: var(--text);
  box-shadow: none;
}
.nav-logo-ace,
.nav-logo-you {
  position: absolute;
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: 1.72rem;
  letter-spacing: -0.045em;
  line-height: 0.95;
  color: inherit;
  pointer-events: none;
  white-space: nowrap;
}
.nav-logo-ace {
  left: 18px;
  top: -19px;
  font-size: 37px;
  transform: scaleX(1) scaleY(1.4);
  transform-origin: left center;
  z-index: 2;
}
.nav-logo-you {
  left: -11px;
  top: 18px;
  font-size: 37px;
  transform: scaleX(0.98) scaleY(1.41);
  transform-origin: left center;
  z-index: 1;
}
.side-nav a:not(.nav-logo),
.side-nav .nav-settings {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.7rem 0.85rem; border-radius: 999px;
  text-decoration: none; color: var(--muted); font-weight: 700; font-size: 0.82rem;
  font-family: inherit; cursor: pointer; border: 1px solid rgba(255,255,255,0.65);
  background: rgba(255,255,255,0.42);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 28px rgba(26,37,64,0.08);
  width: max-content; max-width: 11rem;
  transition: transform 0.35s ease, background 0.35s ease, color 0.35s ease, box-shadow 0.35s ease;
}
.side-nav a:hover,
.side-nav .nav-settings:hover { transform: translateX(4px); background: rgba(255,255,255,0.75); color: var(--text); }
.side-nav a.active {
  background: rgba(18,19,26,0.92); color: #fff;
  box-shadow: 0 14px 32px rgba(18,19,26,0.25);
}
.side-nav a .dot,
.side-nav .nav-settings .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor; opacity: 0.55; flex-shrink: 0;
}
.nav-lang {
  display: flex;
  gap: 0.35rem;
  width: max-content;
  max-width: 11rem;
}
.nav-lang-btn {
  flex: 1 1 0;
  min-width: 2.4rem;
  padding: 0.7rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.65);
  background: rgba(255,255,255,0.42);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 28px rgba(26,37,64,0.08);
  color: var(--muted);
  font-family: inherit;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.35s ease, color 0.35s ease, box-shadow 0.35s ease;
}
.nav-lang-btn:hover {
  background: rgba(255,255,255,0.75);
  color: var(--text);
}
.nav-lang-btn.is-on {
  background: rgba(18,19,26,0.92);
  color: #fff;
  box-shadow: 0 14px 32px rgba(18,19,26,0.25);
}

.page { position: relative; z-index: 2; }

/* SPA views â€” shell (nav/bg) never unloads */
.sg-view[hidden] { display: none !important; }
.sg-view.is-active { display: block; }
@media (prefers-reduced-motion: no-preference) {
  .sg-view.sg-view-anim {
    animation: sgViewIn 0.34s ease;
  }
}
@keyframes sgViewIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Legacy multi-page leave/enter (unused in SPA) */
@media (prefers-reduced-motion: no-preference) {
  html.sg-leaving .page,
  html.sg-leaving .versions-link {
    opacity: 0 !important;
    pointer-events: none;
    transition: opacity 0.32s ease;
  }
  html.sg-enter-pending .page,
  html.sg-enter-pending .versions-link {
    opacity: 0;
  }
  html.sg-enter-pending.sg-entered .page,
  html.sg-enter-pending.sg-entered .versions-link {
    opacity: 1;
    transition: opacity 0.38s ease;
  }
}
.hero-content {
  min-height: 100svh; display: grid; align-items: end;
  padding: 5.5rem 1.35rem 3.5rem;
  width: min(var(--shell-max), calc(100% - 2rem)); margin: 0 auto;
}
/* Gate Ace/You ratios (desktop locked), scaled to fit hero */
.hero-brand {
  --hb-s: 0.48;
  position: relative;
  width: min(100%, calc((135 + 420) * var(--hb-s) * 1px));
  height: calc((193 + 185 * 1.41) * var(--hb-s) * 1px);
  margin: 0 0 0.15rem;
}
.hero-brand-ace,
.hero-brand-you {
  position: absolute;
  display: block;
  font-family: "Syne", sans-serif;
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.95;
  color: var(--text);
  transform-origin: left center;
  user-select: none;
}
.hero-brand-ace {
  left: calc(135 * var(--hb-s) * 1px);
  top: 0;
  font-size: calc(183 * var(--hb-s) * 1px);
  transform: scaleX(1) scaleY(1.4);
}
.hero-brand-you {
  left: 0;
  top: calc(193 * var(--hb-s) * 1px);
  font-size: calc(185 * var(--hb-s) * 1px);
  transform: scaleX(0.9) scaleY(1.41);
}
@media (max-width: 860px) {
  .hero-brand { --hb-s: 0.32; }
}
.brand {
  font-family: "Syne", sans-serif; font-weight: 800;
  font-size: clamp(2.8rem, 7vw, 4.6rem); letter-spacing: -0.045em; line-height: 0.95;
}
.headline {
  margin-top: 0.85rem; max-width: 28ch;
  font-size: clamp(1.15rem, 2.3vw, 1.5rem); font-weight: 600;
  line-height: 1.35;
}
.sub { margin-top: 0.65rem; max-width: 38ch; color: var(--muted); font-size: 1.02rem; line-height: 1.55; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.65rem; margin-top: 1.4rem; }
.btn {
  font-family: "Syne", sans-serif; font-weight: 700; font-size: 0.9rem;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0.75rem 1.25rem; border-radius: 999px; border: none;
  text-decoration: none; cursor: pointer; color: inherit;
}
.btn-dark { background: var(--ink); color: #fff; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-ghost { background: rgba(255,255,255,0.75); box-shadow: var(--shadow); }

.plate-wrap { padding: 0 1rem 3rem; transition: padding-left 0.45s ease; }
body.nav-on .plate-wrap { padding-left: 9.5rem; }
@media (max-width: 860px) {
  body.nav-on .plate-wrap { padding-left: 1rem; }
  .side-nav {
    left: 50%; top: auto; bottom: 1rem; flex-direction: row; flex-wrap: wrap; justify-content: center;
    width: min(96vw, 420px); transform: translate(-50%, 140%);
  }
  .side-nav.show { transform: translate(-50%, 0); }
  .side-nav a .txt, .side-nav .nav-settings .txt { display: none; }
  .side-nav .nav-logo { display: none; }
  .nav-lang { max-width: none; }
}

.shell {
  width: min(var(--shell-max), 100%); margin: 0 auto;
  background: var(--glass);
  backdrop-filter: blur(26px) saturate(1.3);
  -webkit-backdrop-filter: blur(26px) saturate(1.3);
  border-radius: 28px; border: 1px solid rgba(255,255,255,0.68);
  box-shadow: 0 30px 80px rgba(26,37,64,0.12); overflow: clip;
}

/* Soft Pulse dash grid */
.dash {
  padding: var(--dash-pad);
  display: grid;
  gap: var(--dash-gap);
}
@media (min-width: 960px) {
  .dash { grid-template-columns: var(--animals-fr) var(--profile-fr); }
}
.card {
  background: var(--card);
  border-radius: 20px; padding: 1.2rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.9);
  will-change: transform;
}
.tilt { transform-style: preserve-3d; will-change: transform; }
.prof-photo.tilt,
.prof-mid.tilt,
.prof-right.tilt,
.prof-goals-row.tilt,
.goals-panel.tilt,
.mirror-private.tilt {
  will-change: transform;
  transform-style: preserve-3d;
}
.full { grid-column: 1 / -1; }

.section-head {
  display: flex; justify-content: space-between; gap: 0.75rem; align-items: flex-start;
  margin-bottom: 0.85rem;
}
.section-head h2 {
  font-family: "Syne", sans-serif;
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  letter-spacing: -0.03em; max-width: 16ch;
}
.badge {
  display: inline-flex; padding: 0.3rem 0.65rem; border-radius: 999px;
  background: rgba(46,204,113,0.15); color: #1a8f4a; font-size: 0.72rem; font-weight: 700;
  white-space: nowrap;
}
.badge.soon { background: rgba(176,61,157,0.12); color: #8a2a7a; }
.badge.live { background: rgba(61,123,255,0.14); color: #2a5fd4; }

.animals {
  display: grid; gap: 0.7rem;
  grid-template-columns: repeat(2, 1fr);
  margin-top: 0.85rem;
}
@media (min-width: 560px) { .animals { grid-template-columns: repeat(4, 1fr); } }
.animal {
  text-align: center; border: none; font: inherit; cursor: pointer; color: inherit;
  background: #fff; border-radius: 18px; padding: 1.1rem 0.7rem; box-shadow: var(--shadow);
  width: 100%;
}
.animal .emoji { font-size: 2.1rem; display: block; transition: transform 0.45s cubic-bezier(0.22,1,0.36,1); }
.animal:hover .emoji { transform: scale(1.08) rotate(-4deg); }
.animal.selected { outline: 2px solid var(--blue); }
.animal h3 { margin-top: 0.45rem; font-family: "Syne", sans-serif; font-size: 0.95rem; }
.animal p { font-size: 0.75rem; color: var(--muted); }

/* Profile block â€” title + 3 columns, no outer plate */
.profile-block {
  grid-column: 1 / -1;
}
.profile-block > h2,
.stats-block > h2,
.progress-block > h2,
.achievements-block h2,
.section-head h2 {
  font-family: "Syne", sans-serif;
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  letter-spacing: -0.03em;
  text-align: left;
}
.profile-block > h2,
.stats-block > h2,
.progress-block > h2,
.achievements-block h2 {
  margin-top: 0.85rem;
  margin-bottom: 1.35rem;
}
#homePlate .progress-block > h2 { margin-bottom: 0.95rem; }
#homePlate .profile-block > h2 { margin-bottom: 1.35rem; }
#homePlate .achievements-block h2 { margin-bottom: 0.2rem; }
#homePlate .stats-block > h2 { margin-bottom: 1.35rem; }
#homePlate .contacts-home > h2 { margin-bottom: 1.35rem; }

.profile-block { margin-top: 0.25rem; }
.stats-block,
.progress-block,
.achievements-block,
.journal-home,
.contacts-home {
  margin-top: 1.75rem;
}
#homePlate .progress-block { margin-top: -0.05rem; }
#homePlate .profile-block { margin-top: 1.15rem; }
#homePlate .achievements-block { margin-top: 0.65rem; }
#homePlate .stats-block { margin-top: 0.5rem; }
#homePlate .contacts-home { margin-top: 1.75rem; }

.profile-layout {
  display: grid;
  gap: 0.85rem;
  align-items: stretch;
  grid-template-columns: minmax(200px, 260px) minmax(180px, 0.9fr) minmax(200px, 0.95fr);
  grid-template-areas:
    "photo mid metrics"
    "goals goals goals";
}
.profile-layout-no-goals {
  grid-template-areas: "photo mid metrics";
}

.prof-photo {
  grid-area: photo;
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.9);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 0.65rem;
  min-height: 300px;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.prof-photo-frame {
  flex: 1 1 auto;
  height: 100%;
  min-height: 280px;
  width: 100%;
  border-radius: 14px;
  display: grid;
  place-content: center;
  gap: 0.45rem;
  background:
    linear-gradient(160deg, rgba(61,123,255,0.12), transparent 55%),
    linear-gradient(145deg, #f4f7ff, #e8eef8);
  border: 1px dashed rgba(61,123,255,0.28);
  text-align: center;
  cursor: pointer;
  font: inherit;
  color: inherit;
  padding: 0.55rem;
  position: relative;
  overflow: hidden;
}
button.prof-photo-frame {
  appearance: none;
  -webkit-appearance: none;
}
.prof-avatar-img {
  width: min(100%, 220px);
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 16px;
  display: block;
  margin: 0 auto;
  background: #e8eef8;
  transform-origin: center center;
}
.prof-photo-ph { font-size: 3.2rem; line-height: 1; opacity: 0.85; }
.prof-photo-cap {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--faint);
}
button.prof-photo-frame:hover .prof-photo-cap,
button.prof-photo-frame:focus-visible .prof-photo-cap {
  color: var(--blue);
}

/* Middle â€” name + animal (narrower, taller) */
.prof-mid {
  grid-area: mid;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.55rem;
  border-radius: 18px;
  background: rgba(61,123,255,0.06);
  border: 1px solid rgba(61,123,255,0.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
  min-height: 300px;
}
.prof-mid > .animal-tile {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}
.prof-tile {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.95);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 0.8rem 0.9rem;
}
.prof-tile .lbl,
.prof-metric .lbl {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--faint);
}
.prof-name {
  margin-top: 0.3rem;
  font-family: "Syne", sans-serif;
  font-weight: 800; font-size: 1.25rem; letter-spacing: -0.03em;
}
.animal-row {
  margin-top: 0.45rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: center;
}
.animal-avatar {
  width: 72px;
  display: grid;
  justify-items: center;
  gap: 0.25rem;
  padding: 0.55rem 0.4rem;
  border-radius: 16px;
  background: linear-gradient(145deg, #fff, #eef3ff);
  border: 1px solid rgba(255,255,255,0.95);
}
.animal-avatar span { font-size: 1.85rem; line-height: 1; }
.animal-avatar strong {
  font-family: "Syne", sans-serif;
  font-size: 0.78rem; font-weight: 800; letter-spacing: -0.02em;
}
.quality-stack {
  list-style: none;
  display: grid;
  gap: 0.35rem;
  margin: 0; padding: 0;
}
.quality-stack li {
  font-size: 0.78rem; font-weight: 700;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: rgba(61,123,255,0.1);
  color: #2a5fd4;
  width: fit-content;
}
.goals-tile .lbl {
  font-size: 0.82rem;
}
.goals-tile .goals {
  margin: 0.45rem 0 0;
  padding-left: 1.05rem;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.5;
}
.goals-tile .goals li + li { margin-top: 0.38rem; }
.goals-tile .goals-home-empty {
  margin-top: 0.45rem;
  font-size: 1.05rem;
  line-height: 1.5;
  font-weight: 500;
}
.prof-goals-row {
  grid-area: goals;
}

/* Metrics â€” 2Ã—2 inside shared panel (like name + animal) */
.prof-right {
  grid-area: metrics;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 0.55rem;
  min-height: 300px;
  padding: 0.55rem;
  border-radius: 18px;
  background: rgba(61,123,255,0.06);
  border: 1px solid rgba(61,123,255,0.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
  box-sizing: border-box;
}
.prof-metric.is-streak .hint {
  margin-top: 0.15rem;
  opacity: 0.7;
  font-size: 0.78rem;
}
.prof-metric {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.95);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 0;
  height: 100%;
}
.prof-metric .num {
  margin-top: 0.25rem;
  font-family: "Syne", sans-serif;
  font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em;
}
.prof-metric .num.date-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.05;
  gap: 0.05rem;
}
.prof-metric .hint {
  margin-top: 0.2rem; color: var(--muted); font-size: 0.72rem;
}
.prof-metric .lbl {
  max-width: 100%;
  line-height: 1.25;
}

@media (max-width: 900px) {
  .profile-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "photo"
      "mid"
      "metrics"
      "goals";
  }
  .profile-layout-no-goals {
    grid-template-areas:
      "photo"
      "mid"
      "metrics";
  }
  .prof-photo,
  .prof-mid,
  .prof-right {
    min-height: 0;
  }
  .prof-photo-frame {
    min-height: 200px;
  }
  .prof-right {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }
}

.profile-avatar {
  width: 56px; height: 56px; border-radius: 18px;
  display: grid; place-items: center; font-size: 1.8rem;
  background: linear-gradient(145deg, #fff, #eef3ff);
  box-shadow: var(--shadow);
}
.chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.65rem; }
.chip {
  font-size: 0.72rem; font-weight: 700; padding: 0.28rem 0.6rem; border-radius: 999px;
  background: rgba(61,123,255,0.1); color: #2a5fd4;
}

/* Stats: title + left tiles + right chart (no outer plate) */
.stats-block {
  grid-column: 1 / -1;
}

.stats-layout {
  display: grid;
  gap: 0.75rem;
  align-items: stretch;
}
@media (min-width: 860px) {
  .stats-layout {
    grid-template-columns: minmax(150px, 210px) minmax(0, 1fr);
    gap: 0.85rem;
  }
}
.stats-tiles {
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  gap: 0.65rem;
  min-height: 0;
}
@media (max-width: 859px) {
  .stats-tiles { grid-template-rows: none; }
  .stat-tile { min-height: 96px; }
}
.stat-tile {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 88px;
  height: 100%;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.9);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.stat-tile::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--accent, var(--consist));
}
.stat-tile.c-consist { --accent: var(--consist); }
.stat-tile.c-journal { --accent: var(--journal); }
.stat-tile.c-mood { --accent: var(--mood); }
.stat-tile .lbl {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--faint);
}
.stat-tile .num {
  margin-top: 0.3rem;
  font-family: "Syne", sans-serif;
  font-weight: 800; font-size: 1.35rem; letter-spacing: -0.03em;
  line-height: 1.1;
}
.stat-tile .hint {
  margin-top: 0.3rem; color: var(--muted); font-size: 0.75rem; line-height: 1.35;
}
.stat-tile .delta {
  display: inline-block; margin-top: 0.4rem;
  font-size: 0.72rem; font-weight: 700; padding: 0.12rem 0.4rem; border-radius: 999px;
  width: fit-content;
}
.stat-tile .delta.up { background: rgba(46,204,113,0.15); color: #178a45; }
.stat-tile .delta.down { background: rgba(201,47,43,0.12); color: #b42318; }
.stat-tile .delta.flat { background: rgba(106,114,137,0.12); color: var(--muted); }

.stats-chart {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.9);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 0.95rem 1rem 0.8rem;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
.chart-legend {
  display: flex; flex-wrap: wrap; gap: 0.55rem 1rem;
  margin-bottom: 0.65rem;
}
.legend-item {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.8rem; font-weight: 700;
}
.legend-item .swatch {
  width: 10px; height: 10px; border-radius: 999px; flex-shrink: 0;
}
.legend-item .val { color: var(--muted); font-weight: 600; font-size: 0.76rem; }
.legend-item.is-soon .val { font-style: italic; }
.stats-chart .chart-svg {
  width: 100%; flex: 1 1 auto; min-height: var(--chart-h, 200px); display: block;
}
.stats-chart .chart-svg .hgrid { stroke: rgba(26,37,64,0.07); stroke-width: 1; }
.stats-chart .chart-svg .vguide {
  stroke: rgba(120,128,148,0.55);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}
.stats-chart .chart-svg .x-label {
  fill: var(--faint);
  font-size: 9px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
}
.stats-chart .chart-svg .area { opacity: 0.1; }
.stats-chart .chart-svg .line {
  fill: none; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round;
}
.stats-chart .chart-svg .line.dashed { stroke-dasharray: 6 5; opacity: 0.65; stroke-width: 2.3; }
.stats-chart .chart-svg .dot { stroke: #fff; stroke-width: 1.6; }
.chart-dates {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  margin-top: 0.35rem;
  gap: 0;
}
.chart-dates span {
  text-align: center;
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--faint);
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}
.stats-chart .chart-foot {
  margin-top: 0.5rem; color: var(--faint); font-size: 0.68rem; font-weight: 600;
}

/* â€”â€” Progress â€”â€” */
.progress-block { grid-column: 1 / -1; }
.progress-layout {
  display: grid;
  gap: 0.85rem;
  align-items: stretch;
  grid-template-columns: 1fr;
}
.progress-layout > .home-phase-map-card { order: -1; }
@media (min-width: 860px) {
  .progress-layout {
    grid-template-columns: minmax(200px, 280px) minmax(0, 1fr);
  }
  .progress-layout > .home-phase-map-card { order: 0; }
}
.prog-phase {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
  gap: 0.45rem;
  min-height: 160px;
  padding: 1.25rem 1.2rem;
  border-radius: 18px;
  text-decoration: none;
  color: inherit;
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.95);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}
.prog-phase::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: linear-gradient(180deg, #75bf76, #a5e66a);
}
.prog-phase.p2::before { background: linear-gradient(180deg, #d97a1e, #e0cc44); }
.prog-phase.p3::before { background: linear-gradient(180deg, #c92f2b, #fa7669); }
.prog-phase.p4::before { background: linear-gradient(180deg, #b03d9d, #ed6ce1); }
.prog-phase .phase-num {
  font-family: "Syne", sans-serif;
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--muted);
  line-height: 1.15;
}
.prog-phase h3 {
  font-family: "Syne", sans-serif;
  font-size: 1.42rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  max-width: none;
  line-height: 1.2;
  margin: 0;
}
.prog-tasks {
  display: grid;
  gap: 0.45rem;
  grid-template-rows: 2fr 1fr 1fr;
  min-height: 0;
  align-content: stretch;
  --done-title: 1.04rem;
  --done-check: 1.5rem;
  --done-check-icon: 18px;
  --done-gap: 0.45rem;
  --done-pad-y: 0.3rem;
  --done-pad-x: 0.75rem;
  --feat-kicker: 1.1rem;
  --feat-kicker-track: 0.13em;
  --feat-title: 1.12rem;
  --feat-rule: 2.5px;
  --feat-rule-opacity: 0.9;
  --feat-gap: 0.45rem;
  --feat-xp: 0.66rem;
  --feat-xp-pad-y: 0.22rem;
  --feat-xp-pad-x: 0.45rem;
  --feat-pad-y: 0.85rem;
  --feat-pad-x: 1.05rem;
}
.prog-task {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.95);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 0.45rem 0.65rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  cursor: pointer;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  position: relative;
  isolation: isolate;
}
.prog-task.done {
  padding: var(--done-pad-y) var(--done-pad-x);
}
.prog-task-row {
  display: flex;
  align-items: center;
  gap: var(--done-gap);
  min-width: 0;
}
.prog-done-check {
  flex-shrink: 0;
  width: var(--done-check);
  height: var(--done-check);
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.prog-done-check svg {
  width: var(--done-check-icon);
  height: var(--done-check-icon);
  display: block;
}
.prog-task.done.p1 .prog-done-check {
  background: linear-gradient(145deg, #a5e66a, #75bf76);
}
.prog-task.done.p2 .prog-done-check {
  background: linear-gradient(145deg, #e0cc44, #d97a1e);
}
.prog-task.done.p3 .prog-done-check {
  background: linear-gradient(145deg, #fa7669, #c92f2b);
}
.prog-task.done.p4 .prog-done-check {
  background: linear-gradient(145deg, #ed6ce1, #b03d9d);
}
.prog-task.done h3 {
  font-family: "Syne", sans-serif;
  font-size: var(--done-title);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
}
.prog-task-top {
  display: flex; justify-content: space-between; gap: 0.5rem; align-items: flex-start;
}
.prog-task-top h3 {
  font-family: "Syne", sans-serif;
  font-size: 0.88rem; font-weight: 800; letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0;
}
.xp-pill {
  flex-shrink: 0;
  font-size: 0.66rem; font-weight: 800;
  padding: 0.22rem 0.45rem; border-radius: 999px;
  background: rgba(234,88,12,0.12); color: #c2410c;
}
.prog-task.plan {
  border-color: rgba(26, 37, 64, 0.14);
}
.prog-task.plan .status.plan {
  color: #1a2540;
  font-weight: 700;
}
.prog-task.plan .prog-plan-cta {
  font-size: 0.82rem;
  padding: 0.45rem 0.85rem;
}
.prog-task-bot {
  display: flex; justify-content: space-between; align-items: center; gap: 0.5rem;
}
.status {
  font-size: 0.7rem; font-weight: 700;
  padding: 0.2rem 0.45rem; border-radius: 999px;
}
.status.next { background: rgba(61,123,255,0.12); color: #2a5fd4; }
.status.wait { background: rgba(154,163,181,0.18); color: #5c6578; }
.status.done { background: rgba(46,204,113,0.14); color: #178a45; }
.status.plan { background: rgba(26,37,64,0.1); color: #1a2540; }
.prog-open {
  min-height: 38px; padding: 0.45rem 0.9rem; font-size: 0.8rem;
}
.unlock-clock.is-prog {
  margin-top: 0;
  font-size: 0.85rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.88);
}
.prog-task.featured {
  padding: var(--feat-pad-y) var(--feat-pad-x);
  justify-content: flex-start;
  gap: var(--feat-gap);
  border-width: 2px;
  border-color: rgba(255, 255, 255, 0.92);
  color: #fff;
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.35) inset,
    0 14px 28px rgba(26, 37, 64, 0.16);
}
.prog-task.featured.p1 {
  background: linear-gradient(145deg, #a5e66a, #75bf76);
}
.prog-task.featured.p2 {
  background: linear-gradient(145deg, #e0cc44, #d97a1e);
}
.prog-task.featured.p3 {
  background: linear-gradient(145deg, #fa7669, #c92f2b);
}
.prog-task.featured.p4 {
  background: linear-gradient(145deg, #ed6ce1, #b03d9d);
}
.prog-task-kicker {
  font-family: "Syne", sans-serif;
  font-size: var(--feat-kicker);
  font-weight: 800;
  letter-spacing: var(--feat-kicker-track);
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.2;
}
.prog-task-rule {
  height: var(--feat-rule);
  width: 100%;
  background: rgba(255, 255, 255, 0.72);
  opacity: var(--feat-rule-opacity);
}
.prog-task-featured-body {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
}
.prog-task.featured h3 {
  font-family: "Syne", sans-serif;
  font-size: var(--feat-title);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0;
  color: #fff;
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.prog-task.featured .xp-pill {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.45);
  font-size: var(--feat-xp);
  padding: var(--feat-xp-pad-y) var(--feat-xp-pad-x);
}
.prog-task-featured-foot {
  margin-top: auto;
}
.prog-task.featured::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 72%;
  background: rgba(255, 255, 255, 0.4);
  transform: translateX(-130%) skewX(-16deg);
  transform-origin: center center;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}
.prog-task.featured.is-sweeping::after {
  opacity: 1;
  animation: progGlassSweep 0.35s linear forwards;
}
@keyframes progGlassSweep {
  from { transform: translateX(-130%) skewX(-16deg); }
  to { transform: translateX(175%) skewX(-16deg); }
}
.prog-task.featured > *:not(.prog-task-rule) {
  position: relative;
  z-index: 2;
}
@media (prefers-reduced-motion: reduce) {
  .prog-task.featured.is-sweeping::after {
    animation: none;
    opacity: 0;
  }
}
.home-phase-map-card {
  position: relative;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.home-phase-map-label {
  position: absolute;
  z-index: 4;
  top: 0.7rem;
  left: 0.85rem;
  max-width: min(70%, 16rem);
  padding: 0.35rem 0.55rem;
  border-radius: 10px;
  background: transparent;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.home-phase-map-kicker {
  font-family: "Syne", sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.2;
}
.home-phase-map-label strong {
  font-family: "Syne", sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
  text-shadow: 0 1px 10px rgba(255, 255, 255, 0.45);
}
.home-task-map.task-map {
  flex: 1 1 auto;
  width: 100%;
  aspect-ratio: auto;
  min-height: 220px;
  max-height: none;
  height: 100%;
  --tile: 122px;
  --tile-font: 1.28rem;
  --dash-w: 10;
  --home-word-size: 1.08rem;
  --home-label-x: -3px;
  --home-label-y: 4px;
  padding: 0.35rem;
  border-radius: 18px;
}
.home-task-map .task-word {
  font-size: var(--home-word-size);
  max-width: 5.6rem;
}
.home-task-map .task-label {
  transform: translate(calc(-50% + var(--home-label-x)), calc(-50% + var(--home-label-y))) translateZ(1px);
}
@media (min-width: 860px) {
  .progress-layout {
    min-height: 280px;
  }
  .home-task-map.task-map {
    min-height: 280px;
  }
}
html.mode-dark .home-phase-map-label strong,
body.mode-dark .home-phase-map-label strong {
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45);
}

/* â€”â€” Achievements badges â€”â€” */
.achievements-block { grid-column: 1 / -1; }
.achievements-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1.35rem;
}
.achievements-head h2 { margin: 0; }
.see-all { min-height: 40px; padding: 0.5rem 1rem; font-size: 0.82rem; }

.badges-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.25rem 0.15rem;
  justify-items: center;
}
@media (max-width: 700px) {
  .badges-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.55rem 0.35rem;
  }
}
.badge-item {
  display: grid;
  justify-items: center;
  gap: 0.28rem;
  text-align: center;
  width: 100%;
  max-width: 64px;
  perspective: 600px;
}
.badge-orb {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: #ffffff;
  border: 1px solid rgba(26,37,64,0.08);
  box-shadow: 0 6px 16px rgba(26,37,64,0.08);
  color: #3d7bff;
  transform-style: preserve-3d;
  will-change: transform;
}
.badge-ico { width: 52%; height: 52%; display: block; }
.badge-item.unlocked .badge-orb {
  background: #ffffff;
  color: #c47a00;
  border-color: rgba(235,182,65,0.45);
  box-shadow: 0 8px 18px rgba(235,182,65,0.18);
}
.badge-item.locked .badge-orb {
  background: #ffffff;
  color: #9aa3b5;
  opacity: 0.55;
  filter: grayscale(0.35);
}
.badge-item:hover .badge-orb {
  animation: badgeSpin 0.85s cubic-bezier(0.33, 0.1, 0.2, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  .badge-item:hover .badge-orb { animation: none; transform: translateY(-4px) scale(1.06); }
}
@keyframes badgeSpin {
  from { transform: translateY(0) rotateY(0deg) scale(1); }
  to { transform: translateY(-8px) rotateY(360deg) scale(1.06); }
}
.badge-word {
  font-size: 0.62rem; font-weight: 700;
  color: var(--text);
  line-height: 1.15;
}
.badge-item.locked .badge-word { color: var(--faint); }

/* â€”â€” Achievements modal (same morph shell as task/journal) â€”â€” */
body.achieve-modal-open {
  overflow: hidden;
  padding-right: var(--sg-scrollbar-pad, 0px);
}
.achieve-morph-root {
  z-index: 125;
}
.achieve-morph-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  overflow: hidden;
  background: rgba(255, 246, 220, 0.62);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border: 1px solid rgba(212, 168, 75, 0.58);
  box-shadow:
    0 24px 60px rgba(26, 37, 64, 0.2),
    0 0 0 1px rgba(255, 230, 170, 0.45) inset,
    0 1px 0 rgba(255, 255, 255, 0.55) inset;
}
.achieve-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  flex: 0 0 auto;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid rgba(212, 168, 75, 0.22);
  background: rgba(255, 250, 235, 0.35);
}
.achieve-modal-head h2 {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}
.achieve-modal-x {
  width: 40px; height: 40px;
  border: none; border-radius: 999px;
  background: rgba(196, 122, 0, 0.1);
  color: var(--text);
  font-size: 1.45rem; line-height: 1;
  cursor: pointer;
}
.achieve-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 1rem 1.15rem 1.25rem;
  overflow: auto;
}
.achieve-modal-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}
.achieve-card {
  min-height: 168px;
  border-radius: 16px;
  padding: 0.9rem 0.85rem;
  border: 1px solid rgba(26,37,64,0.08);
  background: rgba(255, 255, 255, 0.78);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
}
.achieve-card h3 {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.achieve-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
  flex: 1;
}
.achieve-card-ico {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(61,123,255,0.1);
  color: #3d7bff;
}
.achieve-card-ico .badge-ico { width: 58%; height: 58%; }
.achieve-card.is-unlocked {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #fff8e8 0%, #ffffff 55%);
  border-color: rgba(235,182,65,0.45);
}
.achieve-card.is-unlocked .achieve-card-ico {
  background: rgba(235,182,65,0.2);
  color: #c47a00;
}
.achieve-card.is-unlocked::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 72%;
  background: rgba(255, 255, 255, 0.55);
  transform: translateX(-130%) skewX(-16deg);
  transform-origin: center center;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
}
.achieve-card.is-unlocked.is-sweeping::after {
  opacity: 1;
  animation: progGlassSweep 0.35s linear forwards;
}
.achieve-card.is-unlocked > * {
  position: relative;
  z-index: 1;
}
@media (prefers-reduced-motion: reduce) {
  .achieve-card.is-unlocked.is-sweeping::after {
    animation: none;
    opacity: 0;
  }
}
.achieve-card.is-available {
  background: #f3f5f8;
  border-color: rgba(26,37,64,0.06);
  color: #5b6478;
}
.achieve-card.is-available h3 { color: #3d4558; }
.achieve-card.is-available .achieve-card-ico {
  background: rgba(26,37,64,0.06);
  color: #8a93a6;
}
.achieve-card-progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(26,37,64,0.08);
  overflow: hidden;
  margin-top: 0.25rem;
}
.achieve-card-progress i {
  display: block; height: 100%;
  background: #3d7bff;
  border-radius: inherit;
}
.achieve-card-prog-label,
.achieve-card-date {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--faint);
}
.achieve-card.is-locked {
  min-height: 140px;
  place-items: center;
  display: grid;
  background: #e8ebf1;
  border-style: dashed;
  border-color: rgba(26,37,64,0.12);
}
.achieve-card-mystery {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: 1.35rem;
  color: #9aa3b5;
  background: rgba(255,255,255,0.7);
}
.achieve-modal-empty,
.achieve-page-placeholder {
  color: var(--muted);
  line-height: 1.5;
}
.achieve-page-placeholder h2 {
  margin: 0 0 0.4rem;
  font-family: "Syne", sans-serif;
  color: var(--text);
}

/* â€”â€” Rewards / XP wallpapers â€”â€” */
#view-achievements {
  --rw-title-y: 13px;
  --rw-title-size: 42px;
  --rw-title-bottom: 23px;
  --rw-xp-y: 8px;
  --rw-xp-pad-y: 14px;
  --rw-xp-after: 14px;
  --rw-nav-lx: 20px;
  --rw-nav-ly: 0px;
  --rw-nav-rx: -16px;
  --rw-nav-ry: 0px;
  --rw-nav-size: 44px;
}
.rewards-hero.page-hero-mini {
  padding: 0.55rem 1.35rem 0;
  margin-bottom: 0;
  transform: translateY(var(--rw-title-y));
}
.rewards-hero .kicker,
.rewards-hero p { display: none; }
.rewards-hero h1 {
  margin: 0 0 var(--rw-title-bottom);
  font-family: "Syne", sans-serif;
  font-size: var(--rw-title-size);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
}
.rewards-shell-pad {
  padding-top: 0.25rem !important;
}
.rewards-page {
  --rw-stage-w: 1180px;
  --rw-stage-h: 560px;
  --rw-desk-w: 928px;
  --rw-desk-h: 522px;
  --rw-desk-x: 0px;
  --rw-desk-y: 17px;
  --rw-phone-w: 229px;
  --rw-phone-h: 522px;
  --rw-phone-x: 940px;
  --rw-phone-y: 17px;
  --rw-gap: 12px;
  display: grid;
  gap: 0.85rem;
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: visible;
}
.achieve-full {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.rewards-xp {
  padding: var(--rw-xp-pad-y) 1rem;
  margin-bottom: var(--rw-xp-after);
  transform: translateY(var(--rw-xp-y));
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid rgba(26,37,64,0.08);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.rewards-xp-next {
  margin: 0 0 0.55rem;
  font-family: "Syne", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.rewards-xp-bar {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: rgba(26,37,64,0.08);
  overflow: hidden;
}
.rewards-xp-bar i {
  position: relative;
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ebb641, #c47a00);
  border-radius: inherit;
  overflow: hidden;
  box-shadow: 0 0 14px rgba(235, 182, 65, 0.55);
}
.rewards-xp-bar i::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 42%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.75), transparent);
  transform: translateX(-130%) skewX(-18deg);
  animation: rewardsXpSweep 2.2s linear infinite;
}
@keyframes rewardsXpSweep {
  from { transform: translateX(-130%) skewX(-18deg); }
  to { transform: translateX(280%) skewX(-18deg); }
}
@media (prefers-reduced-motion: reduce) {
  .rewards-xp-bar i::after { animation: none; opacity: 0; }
}
.rewards-stage {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.rw-nav {
  width: 44px; height: 44px;
  border: none; border-radius: 999px;
  background: rgba(255,255,255,0.92);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 1.6rem; line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}
.rw-nav-sm { width: 36px; height: 36px; font-size: 1.25rem; }
.rw-nav-on {
  position: absolute;
  z-index: 6;
  top: 50%;
  width: var(--rw-nav-size);
  height: var(--rw-nav-size);
  font-size: calc(var(--rw-nav-size) * 0.42);
  display: grid;
  place-items: center;
  padding: 0;
}
.rw-nav-on.is-prev {
  left: 0;
  transform: translate(var(--rw-nav-lx), calc(-50% + var(--rw-nav-ly)));
}
.rw-nav-on.is-next {
  right: 0;
  left: auto;
  transform: translate(var(--rw-nav-rx), calc(-50% + var(--rw-nav-ry)));
}
.rewards-rails {
  --rw-ribbon: 56px;
  --rw-ribbon-phone: 48px;
  position: relative;
  width: min(100%, var(--rw-stage-w));
  height: var(--rw-stage-h);
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
  overflow: visible;
  box-sizing: border-box;
}
.rewards-page.rw-frames-tune .rewards-rails {
  outline: 1px dashed rgba(26, 37, 64, 0.28);
  outline-offset: 4px;
  background: rgba(26, 37, 64, 0.02);
}
.rw-col {
  position: absolute;
  z-index: 1;
  display: flex;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
  /* Inset so card border-radius is not clipped by the frame edge. */
  padding: 3px;
}
.rw-col.is-desk {
  left: var(--rw-desk-x);
  top: var(--rw-desk-y);
  width: var(--rw-desk-w);
  height: var(--rw-desk-h);
  max-width: none;
  transform: none;
}
.rw-col.is-phone {
  left: var(--rw-phone-x);
  top: var(--rw-phone-y);
  width: var(--rw-phone-w);
  height: var(--rw-phone-h);
  transform: none;
}
.rewards-page.rw-frames-tune .rw-col.is-desk {
  outline: 2px solid rgba(196, 122, 0, 0.95);
  outline-offset: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.rewards-page.rw-frames-tune .rw-col.is-phone {
  outline: 2px solid rgba(37, 99, 180, 0.95);
  outline-offset: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.rewards-page.rw-frames-tune .rw-col.is-desk::before,
.rewards-page.rw-frames-tune .rw-col.is-phone::before {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 20;
  padding: 0.12rem 0.4rem;
  border-radius: 6px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  pointer-events: none;
  color: #fff;
}
.rewards-page.rw-frames-tune .rw-col.is-desk::before {
  content: "Desk frame";
  background: rgba(196, 122, 0, 0.92);
}
.rewards-page.rw-frames-tune .rw-col.is-phone::before {
  content: "Phone frame";
  background: rgba(37, 99, 180, 0.92);
}
.rw-rail {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.rw-rail[data-history="right"] {
  justify-content: flex-end;
}
.rw-col.is-desk .rw-rail,
.rw-col.is-phone .rw-rail {
  height: 100%;
}
.rw-slot {
  position: relative;
  height: 100%;
  min-width: 0;
  overflow: hidden;
  border-radius: var(--rw-radius, 28px);
  flex: 0 0 auto;
  will-change: flex-basis, width, opacity, transform;
}
.rw-slot[data-slot="left"] .rw-art {
  background-position: 100% center;
}
.rw-slot[data-slot="right"] .rw-art {
  background-position: 0 center;
}
.rw-slot[data-slot="hero"] .rw-card.is-in,
.rw-slot[data-slot="hero"] .rw-card.is-out {
  position: absolute;
  inset: 0;
}
.rw-col.is-desk .rw-slot.is-hero {
  aspect-ratio: auto;
}
.rw-slot.is-ghost {
  pointer-events: none;
}
.rw-card {
  position: absolute;
  inset: 0;
  margin: 0;
  border: none;
  padding: 0;
  width: 100%;
  height: 100%;
  border-radius: 28px;
  overflow: hidden;
  cursor: pointer;
  background: #111;
  box-shadow: var(--shadow);
  color: inherit;
  text-align: left;
}
.rw-slot.is-side .rw-caption,
.rw-slot.is-side .rw-kind,
.rw-slot.is-side .rw-text-canvas,
.rw-slot.is-ghost .rw-caption,
.rw-slot.is-ghost .rw-kind,
.rw-slot.is-ghost .rw-text-canvas { opacity: 0; }
.rw-art {
  position: absolute; inset: 0;
  background: linear-gradient(145deg, var(--rw-c0), var(--rw-c1) 48%, var(--rw-c2));
  background-size: cover;
  background-repeat: no-repeat;
}
.rw-art.has-photo,
.rw-thumb-art.has-photo {
  background-image: var(--rw-photo), linear-gradient(145deg, var(--rw-c0), var(--rw-c1) 48%, var(--rw-c2));
  background-position: var(--rw-photo-pos, center);
  background-size: cover;
}
.rw-art::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.15), rgba(0,0,0,0.45));
}
.rw-text-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  display: block;
}
.rw-slot.is-side .rw-text-canvas,
.rw-slot.is-ghost .rw-text-canvas { opacity: 0; }
.rw-card.is-locked .rw-text-canvas {
  filter: blur(2px);
  opacity: 0.35;
}
.rw-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  z-index: 2;
  padding: 1rem 1rem 1.15rem;
  color: #fff;
  transition: opacity 0.35s ease;
}
.rw-quote {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-weight: 700;
  font-size: clamp(0.85rem, 1.5vw, 1.05rem);
  line-height: 1.35;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 12px rgba(0,0,0,0.35);
}
.rw-by {
  margin: 0.45rem 0 0;
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  opacity: 0.85;
}
.rw-kind {
  position: absolute; top: 0.7rem; left: 0.7rem; z-index: 2;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  transition: opacity 0.35s ease;
}
.rw-card.is-locked .rw-caption { filter: blur(2px); opacity: 0.35; }
.rw-slot.is-side .rw-card.is-locked .rw-caption { opacity: 0; }
.rw-lock {
  position: absolute; inset: 0; z-index: 3;
  display: grid; place-content: center; gap: 0.45rem;
  background: rgba(12, 14, 22, 0.42);
  color: #fff;
  text-align: center;
}
.rw-lock-svg { color: #fff; justify-self: center; }
.rw-lock-xp {
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}
.rewards-actions {
  display: flex; flex-wrap: wrap; gap: 0.65rem;
  justify-content: center;
}
.rewards-actions .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.rewards-thumbs {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
  box-sizing: border-box;
  overflow: visible;
}
/* Centered strip matching .rewards-rails — view aligns to desk/phone frames. */
.rewards-thumbs-stage {
  position: relative;
  width: min(100%, var(--rw-stage-w));
  max-width: 100%;
  margin: 0 auto;
  /* Layout room above/below for active thumb shadow */
  height: calc(var(--rw-thumb-h, 94px) + 56px);
  box-sizing: border-box;
  overflow: visible;
}
/* Thumb strip flush with desk ←→ phone frames (may extend past stage when frames do). */
.rewards-thumbs-view {
  --rw-thumb-w: 112px;
  --rw-thumb-ribbon: 28px;
  --rw-thumb-h: 94px;
  --rw-thumb-gap: 8px;
  position: absolute;
  left: var(--rw-desk-x);
  width: calc(var(--rw-phone-x) + var(--rw-phone-w) - var(--rw-desk-x));
  top: 14px;
  height: var(--rw-thumb-h, 94px);
  display: flex;
  align-items: center;
  overflow: visible;
  min-width: 0;
  max-width: none;
  box-sizing: border-box;
  padding: 0;
  z-index: 1;
}
.rewards-thumbs > .rw-nav-on {
  z-index: 8;
}
.rewards-thumbs > .rw-nav-on:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}
.rw-thumb-track {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: var(--rw-thumb-gap);
  height: var(--rw-thumb-h, 94px);
  width: max-content;
  max-width: none;
  box-sizing: border-box;
}
.rw-thumb-card {
  position: relative;
  flex: 0 0 var(--rw-thumb-w);
  width: var(--rw-thumb-w);
  max-width: var(--rw-thumb-w);
  height: 100%;
  margin: 0;
  border: 2px solid transparent;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
  opacity: 0.4;
}
.rw-thumb-card.is-edge {
  flex-basis: var(--rw-thumb-ribbon);
  width: var(--rw-thumb-ribbon);
  max-width: var(--rw-thumb-ribbon);
  cursor: default;
  box-shadow: none;
}
.rw-thumb-card.is-full {
  box-shadow: none;
}
.rw-thumb-card.is-active {
  border-color: #ffffff;
  box-shadow: 0 10px 24px rgba(26, 37, 64, 0.32);
  opacity: 1;
  z-index: 2;
}
.rw-thumb-art {
  display: block; width: 100%; height: 100%;
  background: linear-gradient(145deg, var(--rw-c0), var(--rw-c1) 50%, var(--rw-c2));
  background-size: cover;
  background-repeat: no-repeat;
}
.rw-thumb-art.has-photo {
  background-image: var(--rw-photo), linear-gradient(145deg, var(--rw-c0), var(--rw-c1) 50%, var(--rw-c2));
  background-position: var(--rw-photo-pos, center);
}
.rw-thumb-card.is-locked .rw-thumb-art { filter: saturate(0.4) brightness(0.55); }
.rw-thumb-lock {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: #fff;
  background: rgba(0,0,0,0.28);
}
.rw-thumb-lock .rw-lock-svg { width: 16px; height: 16px; }
.rw-thumb-need {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 0.15rem 0.2rem;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 0.58rem; font-weight: 700;
  text-align: center;
}
.rw-thumb-card.is-edge .rw-thumb-need { display: none; }
@media (prefers-reduced-motion: reduce) {
  .rw-slot, .rw-thumb-card, .rw-thumb-track { transition: none; }
}
@media (max-width: 860px) {
  .rewards-rails {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: auto;
    min-height: 0;
    gap: 0.75rem;
    outline: none !important;
    background: transparent !important;
  }
  .rw-col.is-desk,
  .rw-col.is-phone {
    position: relative;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100%;
    height: auto;
    transform: none;
    outline: none !important;
    box-shadow: none !important;
  }
  .rw-col.is-desk { min-height: 200px; }
  .rw-col.is-phone {
    width: min(100%, var(--rw-phone-w)) !important;
    height: var(--rw-phone-h);
  }
  .rewards-page.rw-frames-tune .rw-col.is-desk::before,
  .rewards-page.rw-frames-tune .rw-col.is-phone::before { display: none; }
  .rewards-thumbs {
    width: 100%;
  }
  .rewards-thumbs-stage {
    margin-left: 0;
    width: 100%;
  }
  .rewards-thumbs-view {
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
    height: var(--rw-thumb-h, 94px);
    margin: 20px 0;
  }
  .rw-col.is-desk .rw-rail { height: auto; min-height: 200px; }
  .rw-col.is-desk .rw-slot.is-hero {
    aspect-ratio: 16 / 10;
    height: auto;
    min-height: 180px;
  }
  .rw-col.is-desk .rw-slot.is-side {
    align-self: stretch;
    height: auto;
    min-height: 180px;
  }
}

.rw-anim-tuner {
  position: fixed;
  right: 0.75rem;
  top: 4.8rem;
  z-index: 80;
  width: min(320px, calc(100vw - 1.5rem));
  max-height: calc(100vh - 5.5rem);
  overflow: auto;
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(26,37,64,0.12);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(26,37,64,0.16);
  padding: 0.7rem 0.8rem 0.85rem;
  display: none;
}
@media (min-width: 861px) {
  .rw-anim-tuner { display: block; }
}
.rw-anim-tuner.is-collapsed .rw-anim-tuner-body { display: none; }
.rw-anim-tuner-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  margin-bottom: 0.45rem;
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.rw-anim-tuner.is-dragging .rw-anim-tuner-head { cursor: grabbing; }
.rw-anim-tuner.is-dragging { opacity: 0.96; }
.rw-anim-tuner-head strong {
  font-family: "Syne", sans-serif;
  font-size: 0.86rem;
}
.rw-anim-tuner-toggle {
  width: 28px; height: 28px;
  border: none; border-radius: 8px;
  background: rgba(26,37,64,0.06);
  cursor: pointer;
}
.rw-anim-sec {
  margin: 0.55rem 0 0.35rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}
.rw-anim-row {
  display: grid; gap: 0.15rem;
  margin-bottom: 0.45rem;
  font-size: 0.7rem;
  color: var(--muted);
}
.rw-anim-row strong { color: var(--text); }
.rw-anim-row input[type="range"] { width: 100%; }
.rw-anim-actions {
  display: flex; flex-wrap: wrap; gap: 0.35rem;
  margin-top: 0.45rem;
}
.rw-anim-actions .btn {
  min-height: 32px;
  padding: 0.3rem 0.55rem;
  font-size: 0.7rem;
}
@media (max-width: 980px) {
  .achieve-modal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .achieve-modal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .achieve-card { min-height: 150px; }
}
@media (max-width: 420px) {
  .achieve-modal-grid { grid-template-columns: 1fr; }
}

/* â€”â€” Journal home â€”â€” */
.journal-home { grid-column: 1 / -1; }
.journal-home > h2 {
  font-family: "Syne", sans-serif;
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  letter-spacing: -0.03em;
  margin-top: 0.85rem;
  margin-bottom: 1.35rem;
}
.journal-home-layout {
  display: grid;
  gap: 0.85rem;
}
@media (min-width: 860px) {
  .journal-home-layout {
    grid-template-columns: 1fr;
  }
  .journal-sliders {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    align-items: start;
  }
  .journal-sliders .lbl {
    grid-column: 1 / -1;
  }
}
.journal-last,
.journal-sliders {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.95);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1.1rem 1.15rem;
}
.journal-last .lbl,
.journal-sliders .lbl {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--faint);
}
.journal-last h3 {
  margin-top: 0.35rem;
  font-family: "Syne", sans-serif;
  font-size: 1.15rem; font-weight: 800; letter-spacing: -0.02em;
}
.journal-last p {
  margin-top: 0.55rem; color: var(--muted); line-height: 1.55; font-size: 0.92rem;
}
.feel-slider + .feel-slider { margin-top: 0.85rem; }
@media (min-width: 860px) {
  .journal-sliders .feel-slider + .feel-slider { margin-top: 0; }
}
.feel-top {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 0.85rem; font-weight: 700; margin-bottom: 0.4rem;
}
.feel-top strong { font-family: "Syne", sans-serif; letter-spacing: -0.02em; }
.feel-track {
  height: 10px; border-radius: 999px;
  background: rgba(26,37,64,0.08);
  overflow: hidden;
}
.feel-track i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #3d7bff, #48b0bf);
}
.feel-slider:nth-child(2) .feel-track i { background: linear-gradient(90deg, #ebb641, #d97a1e); }
.feel-slider:nth-child(3) .feel-track i { background: linear-gradient(90deg, #c92f2b, #fa7669); }
.feel-slider:nth-child(4) .feel-track i { background: linear-gradient(90deg, #2ecc71, #75bf76); }

/* â€”â€” Contacts home â€”â€” */
.contacts-home { grid-column: 1 / -1; }
.contacts-home > h2 {
  font-family: "Syne", sans-serif;
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  letter-spacing: -0.03em;
  margin-top: 0.85rem;
  margin-bottom: 1.35rem;
}
.contacts-home-grid {
  display: grid; gap: 0.7rem;
}
@media (min-width: 700px) {
  .contacts-home-grid { grid-template-columns: 1fr 1fr 1fr; }
}
.contact-cta {
  background: linear-gradient(145deg, rgba(61,123,255,0.12), rgba(255,255,255,0.9));
  border-color: rgba(61,123,255,0.25);
}
.contact-form {
  margin-top: 1rem;
  display: grid;
  gap: 0.75rem;
}
.contact-form label {
  display: grid; gap: 0.35rem;
  font-size: 0.82rem; font-weight: 700; color: var(--muted);
}
.contact-form input,
.contact-form textarea {
  font: inherit; color: var(--text);
  border-radius: 14px; border: 1px solid rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.85);
  padding: 0.75rem 0.9rem;
  box-shadow: var(--shadow);
}
.contact-form textarea { min-height: 140px; resize: vertical; }
.contact-form .form-actions {
  display: flex; flex-wrap: wrap; gap: 0.65rem; margin-top: 0.25rem;
}

html.mode-dark .journal-last,
html.mode-dark .journal-sliders,
html.mode-dark .contact-form input,
html.mode-dark .contact-form textarea,
body.mode-dark .journal-last,
body.mode-dark .journal-sliders,
body.mode-dark .contact-form input,
body.mode-dark .contact-form textarea {
  border-color: rgba(255,255,255,0.1);
}
html.mode-dark .badge-orb,
body.mode-dark .badge-orb {
  background: #1e2334;
  border-color: rgba(255,255,255,0.1);
}
html.mode-dark .chart-svg .vguide,
body.mode-dark .chart-svg .vguide { stroke: rgba(170,178,196,0.35); }
html.mode-dark .chart-svg .x-label,
body.mode-dark .chart-svg .x-label { fill: #8b93a7; }

.phases { display: grid; gap: 0.6rem; }
.phase {
  display: grid; grid-template-columns: auto 1fr auto; gap: 0.8rem; align-items: center;
  padding: 0.9rem 1rem; text-decoration: none; color: inherit;
  background: rgba(255,255,255,0.75); border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.95); box-shadow: var(--shadow);
}
.idx {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  font-family: "Syne", sans-serif; font-weight: 800; color: #fff;
}
.p1 .idx { background: linear-gradient(135deg, #75bf76, #a5e66a); }
.p2 .idx { background: linear-gradient(135deg, #d97a1e, #e0cc44); }
.p3 .idx { background: linear-gradient(135deg, #c92f2b, #fa7669); }
.p4 .idx { background: linear-gradient(135deg, #b03d9d, #ed6ce1); }
.phase h3 { font-family: "Syne", sans-serif; font-size: 1rem; letter-spacing: -0.02em; }
.phase .more { color: var(--muted); font-size: 0.85rem; margin-top: 0.15rem; }
.phase .tap {
  font-size: 0.72rem; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em;
}

.modules { display: grid; gap: 0.7rem; grid-template-columns: 1fr 1fr; }
@media (min-width: 700px) { .modules { grid-template-columns: repeat(4, 1fr); } }
.module {
  text-align: center; min-height: 120px; display: grid; place-content: center; gap: 0.25rem;
  text-decoration: none; color: inherit;
}
.module h3 { font-family: "Syne", sans-serif; font-size: 1.05rem; }
.module p { color: var(--muted); font-size: 0.85rem; }

.contacts { display: grid; gap: 0.7rem; }
@media (min-width: 700px) { .contacts { grid-template-columns: 1fr 1fr; } }
.contact {
  display: flex; gap: 0.85rem; align-items: center; text-decoration: none; color: inherit;
}
.contact .ico {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
  background: #eef3ff; color: var(--blue); font-weight: 800; flex-shrink: 0;
}
.contact h3 { font-family: "Syne", sans-serif; font-size: 1rem; }
.contact p { color: var(--muted); font-size: 0.85rem; margin-top: 0.1rem; }

.close {
  padding: 1.6rem 1.35rem 1.8rem; text-align: center;
  border-top: 1px solid rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.28);
}
.close .brand {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
}
.close p { margin: 0.55rem auto 0; max-width: 32ch; color: var(--muted); }
.close .cta-row { justify-content: center; }

.side-nav a.nav-journal,
.side-nav a[data-route="journal"] {
  position: relative;
}
.nav-msg-badge {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  height: 50%;
  aspect-ratio: 1;
  width: auto;
  min-width: 0;
  padding: 0;
  border-radius: 999px;
  background: #c92f2b;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(201, 47, 43, 0.35);
  pointer-events: none;
  z-index: 2;
  animation: navMsgPulse 1.7s ease-in-out infinite;
}
.nav-msg-badge::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 50%;
  transform: translateY(-50%);
  border-style: solid;
  border-width: 5px 6px 5px 0;
  border-color: transparent #c92f2b transparent transparent;
}
.nav-msg-badge-icon {
  width: 58%;
  height: 58%;
  display: block;
}
@keyframes navMsgPulse {
  0%, 100% { transform: translateY(-50%) scale(1); opacity: 1; }
  50% { transform: translateY(-50%) scale(1.08); opacity: 0.82; }
}
.journal-hero-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.25rem;
}
.journal-hero-row .journal-hero-lead {
  flex: 1 1 auto;
  min-width: 0;
}
.journal-msg-btn {
  --journal-msg-size: 0.88;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: calc(0.45rem * var(--journal-msg-size));
  margin-top: 0.1rem;
  padding: calc(1.1rem * var(--journal-msg-size)) calc(1.8rem * var(--journal-msg-size));
  min-height: calc(3.2rem * var(--journal-msg-size));
  border-radius: 999px;
  border: 1px solid rgba(201, 47, 43, 0.35);
  background: #c92f2b;
  color: #fff;
  font-family: "Syne", sans-serif;
  font-size: calc(1.35rem * var(--journal-msg-size));
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 14px 32px rgba(201, 47, 43, 0.3);
}
.journal-msg-btn-label {
  position: relative;
  z-index: 2;
}
.journal-msg-btn::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 72%;
  background: rgba(255, 255, 255, 0.42);
  transform: translateX(-130%) skewX(-16deg);
  transform-origin: center center;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}
.journal-msg-btn.is-sweeping::after {
  opacity: 1;
  animation: journalMsgSweep 0.35s linear forwards;
}
@keyframes journalMsgSweep {
  from { transform: translateX(-130%) skewX(-16deg); }
  to { transform: translateX(175%) skewX(-16deg); }
}
.coach-msg-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(18, 19, 26, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.coach-msg-overlay.is-open { display: flex; }
.coach-msg-panel {
  width: min(900px, calc(100vw - 2rem));
  height: min(560px, calc(100vh - 2rem));
  max-width: 100%;
  overflow: hidden;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(26, 37, 64, 0.1);
  box-shadow: 0 24px 60px rgba(26, 37, 64, 0.22);
  padding: 1rem 1.1rem 1.1rem;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.coach-msg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex: 0 0 auto;
}
.coach-msg-head h2 {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.coach-msg-layout {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr;
  gap: 0.85rem;
  min-height: 0;
  flex: 1 1 auto;
}
.coach-msg-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 0;
  overflow: auto;
  padding-right: 0.15rem;
  border-right: 1px solid rgba(26, 37, 64, 0.08);
}
.coach-msg-list-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(26, 37, 64, 0.08);
  background: rgba(26, 37, 64, 0.03);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  font-family: "Syne", sans-serif;
  font-size: 0.86rem;
  font-weight: 750;
  color: var(--text);
  cursor: pointer;
}
.coach-msg-list-item.is-unread {
  border-color: rgba(201, 47, 43, 0.28);
  background: rgba(201, 47, 43, 0.07);
}
.coach-msg-list-item.is-active {
  background: rgba(18, 19, 26, 0.9);
  border-color: rgba(18, 19, 26, 0.9);
  color: #fff;
}
.coach-msg-read {
  min-height: 0;
  overflow: auto;
}
.coach-msg-read-card {
  padding: 1rem 1.05rem;
  border-radius: 16px;
  background: rgba(26, 37, 64, 0.04);
  border: 1px solid rgba(26, 37, 64, 0.06);
  min-height: 100%;
  box-sizing: border-box;
}
.coach-msg-read-card.is-unread {
  border-color: rgba(201, 47, 43, 0.22);
  background: rgba(201, 47, 43, 0.05);
}
.coach-msg-read-label {
  margin: 0 0 0.65rem;
  font-family: "Syne", sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}
.coach-msg-read-card p:last-child {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
  font-size: 1rem;
}
.coach-msg-empty {
  margin: 0;
  color: var(--muted);
}
@media (prefers-reduced-motion: reduce) {
  .nav-msg-badge { animation: none; }
  .journal-msg-btn.is-sweeping::after {
    animation: none;
    opacity: 0;
  }
}
@media (max-width: 860px) {
  .journal-hero-row {
    flex-direction: column;
    align-items: stretch;
  }
  .journal-msg-btn {
    align-self: flex-end;
  }
  .side-nav a[data-route="journal"].has-msg-badge {
    margin-right: 1.35rem;
  }
  .nav-msg-badge {
    left: calc(100% + 6px);
    top: 50%;
  }
  .coach-msg-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .coach-msg-list {
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid rgba(26, 37, 64, 0.08);
    padding-bottom: 0.55rem;
  }
  .coach-msg-list-item {
    white-space: nowrap;
    width: auto;
  }
}
.page-hero-mini { padding: 1.1rem 1.35rem 0; }
.page-hero-mini h1 {
  font-family: "Syne", sans-serif; font-weight: 800;
  font-size: clamp(1.6rem, 3.5vw, 2.2rem); letter-spacing: -0.03em;
}
.page-hero-mini p { margin-top: 0.4rem; color: var(--muted); max-width: 46rem; line-height: 1.5; }
.page-hero-mini .journal-hero-lead {
  margin: 0;
  width: 100%;
  max-width: none;
  display: flex;
  flex-direction: column;
  gap: 0.12em;
  font-family: "Syne", sans-serif;
  font-size: clamp(1.45rem, 2.8vw, 1.95rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: var(--muted);
}
.page-hero-mini .journal-hero-lead span {
  display: block;
  width: 100%;
}
.shell-pad { padding: 1.35rem 1.25rem 1.55rem; }
.billing-issue-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem 1rem;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  margin: 0 0 1.1rem;
  padding: 0.95rem 1.05rem;
  border-radius: 16px;
  border: 2px solid #d32f2f;
  background: var(--card, #fff);
  box-shadow: none;
}
#homePlate .billing-issue-banner,
.dash .billing-issue-banner {
  grid-column: 1 / -1;
}
.billing-issue-copy {
  flex: 1 1 16rem;
  min-width: 0;
}
.billing-issue-text {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.35;
  color: var(--text);
}
.billing-issue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.billing-issue-actions .btn {
  font-size: 0.78rem;
  font-weight: 700;
}
html.mode-dark .billing-issue-banner,
body.mode-dark .billing-issue-banner {
  border-color: #ef5350;
  background: rgba(30, 35, 52, 0.92);
}
.plans-manifesto {
  margin: 1.25rem 0 0;
  max-width: 52rem;
  font-size: calc(0.95rem * 1.23);
  line-height: 1.5;
  color: var(--muted);
}
.plans-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
}
@media (max-width: 1180px) {
  .plans-grid {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 0.15rem 0.1rem 0.65rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .plans-grid .plan-card {
    flex: 0 0 min(17.5rem, 78vw);
    scroll-snap-align: start;
  }
}
.plan-card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.95);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1rem 0.95rem 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-width: 0;
  height: 100%;
  position: relative;
  overflow: visible;
  --plan-accent: #000000;
  --mx: 50px;
  --my: 50px;
  --contour-radius: 500px;
}
.plan-card.is-clickable {
  cursor: pointer;
}
.plan-card.is-clickable:focus-visible {
  outline: 2px solid rgba(61, 123, 255, 0.55);
  outline-offset: 2px;
}
.plan-card-head {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.plan-card-head h3 {
  font-family: "Syne", sans-serif;
  font-size: clamp(1.55rem, 1.35rem + 0.6vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  margin: 0;
  line-height: 1.12;
}
.plan-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  flex: 1 1 auto;
  min-height: 0;
}
.plan-card-foot {
  margin-top: auto;
  padding-top: 0.25rem;
}
.plan-spots-banner {
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  background: rgba(201, 47, 43, 0.12);
  color: #7a2430;
  box-sizing: border-box;
}
.plan-spots-banner-title {
  display: block;
  font-family: "Syne", sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.25;
}
.plan-spots-banner-body {
  margin: 0.4rem 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0;
  text-transform: none;
  color: #7a2430;
}
.plan-block h4 {
  margin: 0 0 0.35rem;
  font-size: calc(0.66rem * 1.23);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}
.plan-list {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text);
  font-size: calc(0.8rem * 1.23);
  line-height: 1.4;
}
.plan-list li {
  position: relative;
  margin: 0;
  padding: 0.22rem 0 0.22rem 1.05rem;
}
.plan-list li + li {
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}
.plan-list li::before {
  position: absolute;
  left: 0;
  top: 0.22rem;
  font-size: calc(0.72rem * 1.23);
  font-weight: 800;
  line-height: 1.4;
}
.plan-list-inc li::before {
  content: "+";
  color: rgba(46, 120, 52, 0.9);
}
.plan-list-exc li::before {
  content: "\2212";
  color: rgba(160, 70, 70, 0.75);
}
.plan-block-exc .plan-list {
  color: var(--muted);
  font-size: calc(0.76rem * 1.23);
}
.plan-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border: 1px solid var(--plan-accent, #000000);
  border-radius: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
  -webkit-mask-image: radial-gradient(
    circle var(--contour-radius) at var(--mx) var(--my),
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 1) 55%,
    rgba(0, 0, 0, 0) 100%
  );
  mask-image: radial-gradient(
    circle var(--contour-radius) at var(--mx) var(--my),
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 1) 55%,
    rgba(0, 0, 0, 0) 100%
  );
}
.plan-card.is-cursor-contour::after {
  opacity: 1;
}
.plan-dots-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.plan-card > :not(.plan-dots-canvas) {
  position: relative;
  z-index: 1;
}
.plan-price {
  font-family: "Syne", sans-serif;
  font-size: clamp(1.55rem, 1.4rem + 0.45vw, 1.95rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  white-space: nowrap;
}
.plan-price span {
  display: inline;
  margin-left: 0.22rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  vertical-align: 0.35em;
}
.plan-who {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: clamp(0.95rem, 0.88rem + 0.25vw, 1.08rem);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  min-height: calc(1.35em * 2);
}
.plan-note {
  margin: 0;
  color: var(--muted);
  font-size: calc(0.74rem * 1.23);
  line-height: 1.4;
}
.plan-note strong {
  display: block;
  font-size: calc(0.62rem * 1.23);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.12rem;
}
.plan-soon {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}
.plans-manage {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 0.75rem;
}
.plan-manage-btn {
  font-size: 0.82rem;
  font-weight: 700;
}
.plan-cta {
  width: 100%;
  margin-top: 0;
  justify-content: center;
  font-family: "Syne", sans-serif;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.plan-cta-subscribe {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.06)),
    linear-gradient(135deg, rgba(61, 123, 255, 0.88), rgba(18, 52, 120, 0.92));
  border-color: rgba(170, 210, 255, 0.55);
  color: #fff;
  box-shadow: 0 10px 28px rgba(61, 123, 255, 0.22);
}
.plan-cta-current {
  opacity: 0.72;
  cursor: default;
}
.plan-avail {
  display: inline-flex;
  align-items: center;
  margin: 0 0 0.5rem;
  padding: 0.22rem 0.58rem;
  border-radius: 999px;
  font-family: "Syne", sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.2;
}
.plan-avail.is-open {
  color: #1f6b2e;
  background: rgba(117, 191, 118, 0.18);
}
.plan-avail.is-seats,
.plan-avail.is-limited {
  color: #8a4b00;
  background: rgba(217, 122, 30, 0.16);
}
.plan-avail.is-full {
  color: #7a2430;
  background: rgba(201, 47, 43, 0.12);
}
.plan-cta-waitlist {
  background: rgba(26, 37, 64, 0.06);
  border: 1px solid rgba(26, 37, 64, 0.14);
  color: var(--text);
  box-shadow: none;
}
.plan-cta-waitlist.is-joined,
.plan-cta-waitlist:disabled {
  opacity: 0.7;
  cursor: default;
}
.plan-card.is-full {
  opacity: 0.96;
}
.plan-card[data-plan="p1"] .plan-cta-subscribe {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.06)),
    linear-gradient(135deg, rgba(117, 191, 118, 0.92), rgba(46, 120, 52, 0.92));
  border-color: rgba(165, 230, 106, 0.45);
  box-shadow: 0 10px 28px rgba(117, 191, 118, 0.2);
}
.plan-card[data-plan="p2"] .plan-cta-subscribe {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.06)),
    linear-gradient(135deg, rgba(217, 122, 30, 0.92), rgba(160, 90, 20, 0.92));
  border-color: rgba(224, 204, 68, 0.45);
  box-shadow: 0 10px 28px rgba(217, 122, 30, 0.2);
}
.plan-card[data-plan="p3"] .plan-cta-subscribe {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.06)),
    linear-gradient(135deg, rgba(201, 47, 43, 0.92), rgba(120, 18, 15, 0.92));
  border-color: rgba(250, 118, 105, 0.45);
  box-shadow: 0 10px 28px rgba(201, 47, 43, 0.2);
}
.plan-card[data-plan="p4"] .plan-cta-subscribe {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.06)),
    linear-gradient(135deg, rgba(176, 61, 157, 0.92), rgba(110, 30, 96, 0.92));
  border-color: rgba(237, 108, 225, 0.45);
  box-shadow: 0 10px 28px rgba(176, 61, 157, 0.2);
}
.kicker {
  font-family: "Syne", sans-serif; font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint);
}
.grid { display: grid; gap: 0.85rem; margin-top: 1rem; }
@media (min-width: 700px) {
  .grid.two { grid-template-columns: 1fr 1fr; }
  .grid.four { grid-template-columns: repeat(4, 1fr); }
}
.grid a.card { text-decoration: none; color: inherit; display: block; }
.card h3 { font-family: "Syne", sans-serif; font-size: 1.05rem; letter-spacing: -0.02em; }
.card p { margin-top: 0.35rem; color: var(--muted); font-size: 0.92rem; line-height: 1.45; }
.phase-card.tall {
  min-height: 220px;
  display: block;
  padding: 1.45rem 1.35rem 1.35rem;
  position: relative;
  overflow: hidden;
}
.phase-card-copy {
  position: absolute;
  left: 31px;
  top: 17px;
  bottom: auto;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  max-width: calc(100% - 210px - 1.2rem - 2.7rem);
  min-width: 0;
  transform: scale(1);
  transform-origin: top left;
}
.phase-card.tall .phase-label {
  font-family: "Syne", sans-serif;
  font-size: clamp(1.85rem, 4vw, 2.55rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.95;
  color: var(--text);
  margin-bottom: 0.55rem;
}
.phase-card.tall h3 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  max-width: 18ch;
  color: var(--muted);
}
.phase-card.tall p {
  margin-top: 0.45rem;
  font-size: 0.88rem;
  color: var(--faint);
  max-width: 28ch;
}
.phase-card.tall .stripe {
  margin-top: 1.1rem;
  padding-top: 0;
  height: 7px;
  width: 72px;
  border-radius: 999px;
}
.phase-card-map {
  position: absolute;
  right: 1.35rem;
  top: 50%;
  z-index: 1;
  width: 210px;
  min-width: 0;
  max-width: none;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  user-select: none;
  transform: translate(-13px, -50%) scale(0.88);
  transform-origin: center center;
}
.phase-card-map.is-faded {
  opacity: 0.48;
  filter: grayscale(0.18);
}
.phase-card-task-map.task-map {
  width: 100%;
  aspect-ratio: 1 / 1.08;
  min-height: 0;
  max-height: none;
  height: auto;
  --tile: 66px;
  --tile-font: 0.93rem;
  --dash-w: 10;
  padding: 0.2rem;
  border-radius: 16px;
  box-shadow: 0 8px 18px rgba(26, 37, 64, 0.08);
}
.phase-card-task-map .task-word { display: none; }
.phase-card-task-map .task-label {
  transform: translate(-50%, -50%) translateZ(1px);
}
.phase-card-task-map .task-num {
  font-size: var(--tile-font);
}
.phase-card-task-map .task-pad {
  filter: drop-shadow(0 8px 8px rgba(26, 37, 64, 0.16));
}
.phase-card-task-map .task-node.current .task-pad::before {
  inset: -5px -7px;
}
@media (max-width: 560px) {
  .phase-card-copy {
    max-width: calc(100% - min(40%, 150px) - 1.2rem - 2rem);
  }
}

.phase-card.soon {
  cursor: default;
  opacity: 0.78;
  background:
    linear-gradient(160deg, rgba(154,163,181,0.12), transparent 55%),
    var(--card);
}
.phase-card.soon .phase-label { color: var(--faint); }
.phase-card.soon h3 {
  color: var(--muted);
  font-style: italic;
  max-width: none;
}
.phase-card .num {
  font-family: "Syne", sans-serif; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint);
}
.phase-card .stripe { margin-top: 0.65rem; height: 6px; width: 64px; border-radius: 999px; }
.p1 .stripe { background: linear-gradient(90deg, #75bf76, #a5e66a); }
.p2 .stripe { background: linear-gradient(90deg, #d97a1e, #e0cc44); }
.p3 .stripe { background: linear-gradient(90deg, #c92f2b, #fa7669); }
.p4 .stripe { background: linear-gradient(90deg, #b03d9d, #ed6ce1); }
.p5 .stripe { background: linear-gradient(90deg, #9aa3b5, #c5cad6); }
.phases-board .rest-banner,
.phases-board .wait-banner,
.phases-board .plan-banner {
  grid-column: 1 / -1;
}
.phase-card.rest-lock {
  opacity: 0.42;
  pointer-events: none;
  cursor: default;
}
.rest-banner,
.wait-banner,
.plan-banner {
  margin: 0 0 1.1rem;
  padding: 1.15rem 1.25rem 1.25rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(26, 37, 64, 0.08);
  box-shadow: 0 10px 28px rgba(26, 37, 64, 0.06);
}
html.mode-dark .rest-banner,
body.mode-dark .rest-banner,
html.mode-dark .wait-banner,
body.mode-dark .wait-banner,
html.mode-dark .plan-banner,
body.mode-dark .plan-banner {
  background: rgba(18, 22, 34, 0.72);
  border-color: rgba(255, 255, 255, 0.08);
}
.rest-banner h3,
.wait-banner h3,
.plan-banner h3 {
  font-family: "Syne", sans-serif;
  font-size: 1.05rem;
  margin: 0 0 0.35rem;
}
.rest-banner p,
.wait-banner p,
.plan-banner p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}
.plan-banner .btn {
  margin-top: 0.85rem;
}
.unlock-clock {
  margin-top: 0.75rem;
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  font-size: 1.15rem;
}
.unlock-clock.is-lg { font-size: 1.55rem; }
.unlock-clock.is-node {
  position: absolute;
  left: 50%;
  top: calc(100% + 6px);
  transform: translateX(-50%);
  margin-top: 0;
  font-size: 0.72rem;
  white-space: nowrap;
  color: var(--muted);
  z-index: 3;
}
.task-node.waiting .task-orb {
  border-style: dashed;
  opacity: 0.85;
}
.task-map-wrap .wait-banner,
.task-map-wrap .rest-banner,
.task-map-wrap .plan-banner {
  margin-bottom: 1rem;
}
.mirror-lead {
  margin-top: 0.55rem !important;
  font-weight: 600;
}
.progress-block .rest-banner,
.progress-block .wait-banner,
.progress-block .plan-banner {
  margin-top: 0.4rem;
}
/* â€”â€” Phase task map â€”â€” */
.task-map-wrap {
  display: block !important;
  margin-top: 0.5rem;
}
.task-map {
  --map-a: #75bf76;
  --map-b: #a5e66a;
  --tile: 188px;
  --tile-font: 2.45rem;
  --dash-w: 15;
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.22;
  min-height: 640px;
  max-height: 920px;
  border-radius: 22px;
  overflow: visible;
  background:
    radial-gradient(circle at 20% 15%, color-mix(in srgb, var(--map-a) 28%, transparent), transparent 42%),
    radial-gradient(circle at 80% 70%, color-mix(in srgb, var(--map-b) 22%, transparent), transparent 48%),
    linear-gradient(160deg, rgba(255,255,255,0.55), rgba(255,255,255,0.28));
  border: 1px solid rgba(255,255,255,0.75);
  box-shadow: var(--shadow);
  padding: 0.5rem;
}
.task-map.p1 { --map-a: #75bf76; --map-b: #a5e66a; }
.task-map.p2 { --map-a: #d97a1e; --map-b: #e0cc44; }
.task-map.p3 { --map-a: #c92f2b; --map-b: #fa7669; }
.task-map.p4 { --map-a: #b03d9d; --map-b: #ed6ce1; }
.task-map.p5 { --map-a: #9aa3b5; --map-b: #c5cad6; }

.task-map-lines {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}
.task-dash {
  fill: none;
  stroke: var(--map-a);
  stroke-width: var(--dash-w);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 34 22;
  opacity: 0.72;
}

.task-map-nodes {
  position: absolute; inset: 0;
  z-index: 2;
}
.task-node-anchor {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 2;
  overflow: visible;
}
.task-node {
  display: grid;
  justify-items: center;
  width: var(--tile);
  cursor: default;
  user-select: none;
  transform-style: preserve-3d;
  overflow: visible;
}
.task-pad {
  width: var(--tile);
  height: calc(var(--tile) * 0.72);
  display: grid;
  place-items: center;
  position: relative;
  overflow: visible;
  transform: perspective(520px) rotateX(32deg);
  transform-style: preserve-3d;
  filter: drop-shadow(0 22px 18px rgba(26, 37, 64, 0.22));
}
.task-orb {
  width: calc(var(--tile) * 0.92);
  height: calc(var(--tile) * 0.68);
  border-radius: 22px;
  box-sizing: border-box;
  border: 3px solid rgba(255,255,255,0.95);
  background: #fff;
  position: relative;
  z-index: 1;
  box-shadow:
    0 2px 0 rgba(255,255,255,0.9) inset,
    0 16px 0 -4px rgba(26,37,64,0.12);
}
.task-label {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: max-content;
  max-width: none;
  gap: 0.18rem;
  transform: translate(-50%, -50%) translateZ(1px);
  pointer-events: none;
  overflow: visible;
}

/* Phase shapes â€” shared */
.task-map.shape-circle .task-pad {
  height: calc(var(--tile) * 0.88);
}
.task-map.shape-circle .task-orb {
  width: calc(var(--tile) * 0.8);
  height: calc(var(--tile) * 0.8);
  border-radius: 50%;
}
.task-map.shape-circle .task-node.current .task-pad::before {
  border-radius: 50%;
  inset: -14%;
}

.task-map.shape-hex .task-pad {
  height: calc(var(--tile) * 0.9);
}
.task-map.shape-hex .task-orb {
  width: calc(var(--tile) * 0.86);
  height: calc(var(--tile) * 0.78);
  border-radius: 0;
  border: none;
  clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0% 50%);
  box-shadow: none;
  filter: drop-shadow(0 14px 10px rgba(26, 37, 64, 0.18));
}
.task-map.shape-hex .task-node.done .task-orb,
.task-map.shape-hex .task-node.locked .task-orb,
.task-map.shape-hex .task-node.current .task-orb {
  box-shadow: none;
}
.task-map.shape-hex .task-node.current .task-pad::before {
  clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0% 50%);
  border-radius: 0;
  inset: -12% -8%;
}

.task-map.shape-diamond .task-pad {
  height: calc(var(--tile) * 0.92);
}
.task-map.shape-diamond .task-orb {
  width: calc(var(--tile) * 0.7);
  height: calc(var(--tile) * 0.7);
  border-radius: 14px;
  transform: rotate(45deg);
}
.task-map.shape-diamond .task-num {
  font-size: calc(var(--tile-font) * 0.9);
}
.task-map.shape-diamond .task-node.current .task-pad::before {
  border-radius: 18px;
  inset: -10%;
  transform: translateZ(-1px) rotate(45deg);
  animation: currentGlowDiamond 2.2s ease-in-out infinite;
}

.task-num {
  display: block;
  width: 100%;
  text-align: center;
  line-height: 0.95;
  font-weight: 800;
  font-size: var(--tile-font);
  letter-spacing: -0.04em;
  margin: 0;
  color: var(--faint);
}
.task-word {
  display: block;
  width: max-content;
  max-width: none;
  margin: 0;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: clamp(0.78rem, 1.45vw, 1rem);
  font-weight: 700;
  letter-spacing: 0;
  color: var(--muted);
  text-align: center;
  line-height: 1.05;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

/* completed â€” phase color */
.task-node.done .task-orb {
  background: linear-gradient(145deg, var(--map-b), var(--map-a));
  color: #fff;
  border-color: rgba(255,255,255,0.75);
  box-shadow:
    0 2px 0 rgba(255,255,255,0.35) inset,
    0 16px 0 -4px color-mix(in srgb, var(--map-a) 45%, transparent),
    0 0 0 4px color-mix(in srgb, var(--map-a) 22%, transparent);
}
.task-node.done .task-word { color: rgba(255,255,255,0.92); }
.task-node.done .task-num { color: #fff; }

/* current â€” gold glow behind, still locked look */
.task-node.current .task-orb {
  background: #eef0f5;
  color: #8b93a7;
  border-color: rgba(255,255,255,0.9);
}
.task-node.current .task-pad::before {
  content: "";
  position: absolute;
  inset: -18% -12%;
  border-radius: 28px;
  z-index: 0;
  background: radial-gradient(circle, rgba(255,214,90,0.9), rgba(235,182,65,0.4) 48%, transparent 72%);
  animation: currentGlow 2.2s ease-in-out infinite;
  transform: translateZ(-1px);
}
.task-node.current .task-word,
.task-node.current .task-num { color: #8b93a7; }

@keyframes currentGlow {
  0%, 100% { opacity: 0.7; transform: translateZ(-1px) scale(1); }
  50% { opacity: 1; transform: translateZ(-1px) scale(1.1); }
}
@keyframes currentGlowDiamond {
  0%, 100% { opacity: 0.7; transform: translateZ(-1px) rotate(45deg) scale(1); }
  50% { opacity: 1; transform: translateZ(-1px) rotate(45deg) scale(1.1); }
}

/* locked */
.task-node.locked .task-orb {
  background: #dfe3ec;
  color: #9aa3b5;
  border-color: rgba(255,255,255,0.7);
  box-shadow:
    0 2px 0 rgba(255,255,255,0.5) inset,
    0 14px 0 -4px rgba(26,37,64,0.1);
}
.task-node.locked .task-word,
.task-node.locked .task-num { color: #9aa3b5; }

.task-map-quote {
  margin-top: 1.35rem;
  text-align: center;
  font-family: "Syne", sans-serif;
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.4;
  color: var(--muted);
  max-width: 36ch;
  margin-left: auto;
  margin-right: auto;
}

html.mode-dark .task-map,
body.mode-dark .task-map {
  border-color: rgba(255,255,255,0.08);
  background:
    radial-gradient(circle at 20% 15%, color-mix(in srgb, var(--map-a) 22%, transparent), transparent 42%),
    radial-gradient(circle at 80% 70%, color-mix(in srgb, var(--map-b) 16%, transparent), transparent 48%),
    linear-gradient(160deg, rgba(30,35,52,0.9), rgba(24,28,42,0.75));
}
html.mode-dark .task-node.locked .task-orb,
body.mode-dark .task-node.locked .task-orb {
  background: #2a3144;
  color: #7a8499;
}
html.mode-dark .task-node.current .task-orb,
body.mode-dark .task-node.current .task-orb {
  background: #2a3144;
}

@media (max-width: 700px) {
  .task-map {
    --tile: 112px;
    --tile-font: 1.55rem;
    --dash-w: 9;
    min-height: 480px;
  }
}
.journal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1.1rem;
}
.journal-phase-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-right: auto;
}
.journal-phase-btn {
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  padding: 0.5rem 0.9rem;
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(26, 37, 64, 0.1);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.journal-phase-btn.is-active {
  background: var(--phase-btn, #75bf76);
  border-color: transparent;
  color: #fff;
}
.journal-phase-btn:not(.is-active):hover {
  border-color: color-mix(in srgb, var(--phase-btn, #75bf76) 45%, #fff);
}
html.mode-dark .journal-phase-btn,
body.mode-dark .journal-phase-btn {
  background: #fff;
  color: #12151f;
  border-color: rgba(18, 21, 31, 0.12);
}
html.mode-dark .journal-phase-btn.is-active,
body.mode-dark .journal-phase-btn.is-active {
  background: var(--phase-btn, #75bf76);
  color: #12151f;
  border-color: transparent;
}
html.mode-dark .journal-phase-btn:not(.is-active):hover,
body.mode-dark .journal-phase-btn:not(.is-active):hover {
  border-color: color-mix(in srgb, var(--phase-btn, #75bf76) 50%, #12151f);
}
.journal-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  margin-left: auto;
}
.journal-sort select {
  font: inherit;
  font-weight: 700;
  color: var(--text);
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.95);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.55rem 0.75rem;
  min-height: 40px;
  cursor: pointer;
}
.journal-phase-group + .journal-phase-group { margin-top: 1.75rem; }
.journal-phase-head h2 {
  font-family: "Syne", sans-serif;
  font-size: clamp(1.25rem, 2.2vw, 1.55rem);
  letter-spacing: -0.03em;
}
.journal-phase-sub {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.journal-phase-entries {
  margin-top: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  align-items: stretch;
}
@media (max-width: 1100px) {
  .journal-phase-entries { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .journal-phase-entries { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .journal-phase-entries { grid-template-columns: 1fr; }
  .journal-toolbar { flex-direction: column; align-items: stretch; }
  .journal-phase-tabs { margin-right: 0; }
  .journal-sort { margin-left: 0; }
}
.journal-full .journal-entry,
.achieve-full .achieve-row {
  background: var(--card); border-radius: 16px; padding: 0.75rem 0.85rem;
  border: 1px solid rgba(255,255,255,0.9); box-shadow: var(--shadow);
}
.journal-full .journal-entry {
  display: flex;
  flex-direction: column;
  min-height: 132px;
  height: 100%;
  cursor: pointer;
  transform-style: preserve-3d;
  padding: 0;
  overflow: hidden;
  background: #ffffff;
}
.journal-entry-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.55rem 0.85rem;
  background: var(--entry-phase, #75bf76);
  color: #fff;
  min-height: 3.55rem;
  height: 3.55rem;
  box-sizing: border-box;
}
.journal-entry-banner .journal-task-num {
  flex: 0 0 1.5em;
  width: 1.5em;
  height: calc(0.95rem * 1.34 * 2);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-family: "Syne", sans-serif;
  font-size: 2.55rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.05em;
  line-height: 1;
  color: #fff;
}
.journal-entry-banner h3 {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  height: calc(0.95rem * 1.34 * 2);
  font-family: "Syne", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.34;
  color: #ffffff;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.journal-entry-body {
  padding: 0.7rem 0.85rem 0.85rem;
  background: #ffffff;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.achieve-full .achieve-row + .achieve-row { margin-top: 0.75rem; }
.journal-entry-meta {
  display: flex; flex-wrap: wrap; gap: 0.35rem 0.65rem;
  align-items: baseline;
  font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--faint);
}
.journal-entry h3 {
  margin-top: 0.28rem;
  font-family: "Syne", sans-serif;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}
.journal-full .body {
  margin-top: 0;
  color: var(--muted);
  line-height: 1.4;
  font-size: 0.82rem;
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.journal-ratings {
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid color-mix(in srgb, var(--entry-phase, #75bf76) 62%, rgba(255,255,255,0.35));
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--faint);
  letter-spacing: 0.02em;
}

.back-row {
  margin-top: 2rem;
}
footer.site {
  width: min(var(--shell-max), 100%);
  margin: 1.75rem auto 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-family: "Syne", sans-serif;
}
footer.site a { color: inherit; }

/* â€”â€” Task morph modal (point â†’ ribbon â†’ panel) â€”â€” */
.task-node.done,
.task-node.current { cursor: pointer; }
.task-morph-root {
  position: fixed; inset: 0; z-index: 130;
  pointer-events: none;
  overflow: visible;
}
.task-morph-root.active { pointer-events: auto; }
.task-morph-hit {
  position: absolute; inset: 0;
  background: rgba(26, 37, 64, 0.25);
  backdrop-filter: blur(7px) saturate(1.05);
  -webkit-backdrop-filter: blur(7px) saturate(1.05);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  pointer-events: none;
  cursor: default;
}
.task-morph-root .task-morph-hit.is-on {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
html.mode-dark .task-morph-hit,
body.mode-dark .task-morph-hit {
  background: rgba(8, 10, 18, 0.35);
}
/* Journal popup keeps same backdrop tokens (class specificity) */
.journal-morph-root .task-morph-hit {
  background: rgba(26, 37, 64, 0.25);
  backdrop-filter: blur(7px) saturate(1.05);
  -webkit-backdrop-filter: blur(7px) saturate(1.05);
}
html.mode-dark .journal-morph-root .task-morph-hit,
body.mode-dark .journal-morph-root .task-morph-hit {
  background: rgba(8, 10, 18, 0.35);
}
.task-morph-anchor {
  position: fixed;
  z-index: 132;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  will-change: left, top, width, height, opacity;
  overflow: visible;
}
.task-morph-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 0;
  width: 220%;
  height: 200%;
  transform: translate(-50%, -50%) scale(0.55);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(235, 182, 65, 0.62) 0%,
    rgba(235, 182, 65, 0.34) 28%,
    rgba(235, 182, 65, 0.14) 48%,
    rgba(235, 182, 65, 0.05) 62%,
    transparent 74%
  );
  filter: blur(36px);
  will-change: transform, opacity;
}
html.mode-dark .task-morph-glow,
body.mode-dark .task-morph-glow {
  background: radial-gradient(
    ellipse at center,
    rgba(235, 182, 65, 0.42) 0%,
    rgba(235, 182, 65, 0.22) 30%,
    rgba(235, 182, 65, 0.09) 50%,
    rgba(235, 182, 65, 0.03) 64%,
    transparent 76%
  );
  filter: blur(40px);
}
.task-morph-shape {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: #75bf76;
  box-shadow: 0 22px 48px rgba(26, 37, 64, 0.18), 0 8px 18px rgba(26, 37, 64, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform-style: preserve-3d;
  perspective: 1200px;
  will-change: transform, border-radius, background, opacity;
  pointer-events: auto;
}
.task-morph-shape.is-panel {
  /* Transparent shell â€” only the flip faces carry glass, so no static double plate */
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  box-shadow: none;
  overflow: visible;
  border-radius: 22px;
}
.task-morph-flip {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}
.task-morph-flip.is-back {
  transform: rotateY(180deg);
}
.task-morph-face-front,
.task-morph-face-back {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 22px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(22px) saturate(1.3);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 22px 48px rgba(26, 37, 64, 0.18), 0 8px 18px rgba(26, 37, 64, 0.1);
}
/* Task front face â€” journal-style phase panel (size unchanged) */
.task-morph-face-front {
  background: rgba(117, 191, 118, 0.65);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid rgba(255, 255, 255, 0.95);
}
.task-morph-head {
  flex: 0 0 auto;
  padding: 1.05rem 1.1rem 1.2rem;
  z-index: 2;
  background: linear-gradient(
    to bottom,
    var(--tm-phase, #75bf76) 0%,
    var(--tm-phase, #75bf76) 60%,
    transparent 100%
  );
}
.task-morph-head .settings-head {
  margin: 0;
  border-bottom: none;
  padding-bottom: 0.25rem;
}
.task-morph-head .task-morph-kicker {
  color: #ffffff !important;
  font-size: 0.92rem !important;
  letter-spacing: 0.06em !important;
  font-weight: 800 !important;
  text-transform: none;
}
.task-morph-head .settings-head h2 {
  color: #1a2540;
  font-family: "Syne", sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-top: 0.3rem;
}
.task-morph-head .settings-close {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.75);
  color: #ffffff;
}
.task-morph-main {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.task-morph-face-back {
  transform: rotateY(180deg);
}
.task-morph-face-front .task-morph-scroll {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  padding: 0.45rem 1.1rem 0.35rem;
  /* Soft opacity fade at edges â€” same idea as journal browse */
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0,
    #000 22px,
    #000 calc(100% - 22px),
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0,
    #000 22px,
    #000 calc(100% - 22px),
    transparent 100%
  );
}
.task-morph-face-back .task-morph-scroll {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  -webkit-mask-image: none;
  mask-image: none;
}
.journal-morph-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  overflow: hidden;
  background: rgba(117, 191, 118, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 22px 48px rgba(26, 37, 64, 0.18), 0 8px 18px rgba(26, 37, 64, 0.1);
}
.journal-morph-head {
  flex: 0 0 auto;
  padding: 1.15rem 1.15rem 1.35rem;
  z-index: 2;
  /* Top 60% solid phase color; bottom 40% fades into transparent window */
  background: linear-gradient(
    to bottom,
    var(--jm-phase, #75bf76) 0%,
    var(--jm-phase, #75bf76) 60%,
    transparent 100%
  );
}
.journal-morph-head .settings-head {
  margin: 0;
  border-bottom: none;
  padding-bottom: 0.35rem;
}
.journal-morph-kicker {
  color: #ffffff !important;
  font-size: 0.92rem !important;
  letter-spacing: 0.06em !important;
  font-weight: 800 !important;
}
.journal-morph-head .settings-head h2 {
  color: #1a2540;
  font-size: 1.35rem;
  margin-top: 0.35rem;
}
.journal-morph-head .settings-close {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.75);
  color: #ffffff;
}
.journal-morph-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.journal-morph-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.55rem 1.1rem 0.85rem;
  scrollbar-width: none;
  /* Soft opacity fade at edges â€” content dissolves, no blur bands */
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0,
    #000 30px,
    #000 calc(100% - 30px),
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0,
    #000 30px,
    #000 calc(100% - 30px),
    transparent 100%
  );
}
.journal-morph-scroll::-webkit-scrollbar { width: 0; height: 0; }
.jr-browse-masonry {
  display: grid;
  grid-template-columns: repeat(var(--jr-cols, 3), minmax(0, 1fr));
  gap: 0 0.75rem;
  align-items: start;
}
.jr-browse-mcol {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
  padding: 0 0.65rem;
  border-left: 1px solid rgba(26, 37, 64, 0.14);
}
.jr-browse-mcol:first-child {
  border-left: none;
  padding-left: 0;
}
.jr-browse-mcol:last-child {
  padding-right: 0;
}
.jr-browse-card {
  margin-top: 0;
  background: #ffffff;
  height: auto;
}
.jr-browse-when {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
}
.jr-browse-body {
  margin-top: 0.55rem;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.jr-browse-card .jr-sliders {
  margin-top: 0.85rem;
}
.jr-ribbon-track input[type="range"]:disabled {
  cursor: default;
  opacity: 1;
}
@media (max-width: 900px) {
  .jr-browse-masonry { grid-template-columns: 1fr; }
  .jr-browse-mcol,
  .jr-browse-mcol:first-child,
  .jr-browse-mcol:last-child {
    border-left: none;
    padding: 0;
  }
}
html.mode-dark .jr-browse-mcol,
body.mode-dark .jr-browse-mcol {
  border-left-color: rgba(255,255,255,0.14);
}
html.mode-dark .jr-browse-card,
body.mode-dark .jr-browse-card {
  background: #ffffff;
  border-color: rgba(26, 37, 64, 0.08);
}
html.mode-dark .journal-morph-face,
body.mode-dark .journal-morph-face {
  border-color: rgba(255, 255, 255, 0.92);
}
html.mode-dark .journal-morph-head,
body.mode-dark .journal-morph-head {
  background: linear-gradient(
    to bottom,
    var(--jm-phase, #75bf76) 0%,
    var(--jm-phase, #75bf76) 60%,
    transparent 100%
  );
}
html.mode-dark .journal-morph-head .settings-head h2,
body.mode-dark .journal-morph-head .settings-head h2 {
  color: #1a2540;
}

.task-morph-foot {
  position: relative;
  flex: 0 0 auto;
  z-index: 3;
  padding: 0.35rem 1.1rem 1.15rem;
}
.task-morph-foot-inner {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
}
.task-morph-root.journal-lock .task-morph-hit {
  pointer-events: none;
}
.task-morph-sub {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
}
.task-morph-done {
  display: flex;
  align-items: center;
  justify-content: center;
  /* Same visual width as before +30% task panel (~396 âˆ’ foot padding) */
  width: 100%;
  max-width: 361px;
  margin-top: 0;
  margin-left: auto;
  margin-right: auto;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 14px;
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  cursor: pointer;
  background: var(--ink, #1a2540);
  box-shadow: 0 10px 24px rgba(26, 37, 64, 0.32);
  transform-style: preserve-3d;
  box-sizing: border-box;
}
.task-morph-done:hover { filter: brightness(1.05); }
.task-morph-save {
  min-height: 44px;
  border: none;
  border-radius: 14px;
  font-family: "Syne", sans-serif;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  background: var(--done-color, #75bf76);
  padding: 0.65rem 1.2rem;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--done-color, #75bf76) 30%, transparent);
}
.jr-text-card,
.jr-sliders-card {
  margin-top: 0.85rem;
}
.jr-sliders-card { margin-top: 0.7rem; }
.jr-field { display: block; margin-top: 0; }
.jr-field textarea {
  width: 100%;
  min-height: 143px;
  resize: vertical;
  border-radius: 12px;
  border: 1px solid rgba(26, 37, 64, 0.1);
  background: #f7f8fb;
  padding: 0.75rem 0.85rem;
  font: inherit;
  color: var(--text);
  line-height: 1.5;
}
.jr-field textarea::placeholder { color: #9aa3b5; }
.jr-field textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--blue) 45%, #fff);
  box-shadow: 0 0 0 3px rgba(61, 123, 255, 0.12);
  background: #fff;
}
.jr-hint {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--faint);
}
.jr-hint.bad { color: #c92f2b; }
.jr-sliders { margin-top: 0; display: grid; gap: 0.45rem; }
.jr-ribbon {
  display: grid;
  grid-template-columns: 7.2rem minmax(0, 1fr) 1.7rem;
  align-items: center;
  gap: 0.55rem;
  min-height: 30px;
  padding: 0;
  background: transparent;
  border: none;
}
.jr-ribbon-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  white-space: nowrap;
}
.jr-ribbon-val {
  font-family: "Syne", sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--jr-accent, #75bf76);
  text-align: right;
  line-height: 1;
}
.jr-ribbon-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #d7dde8, color-mix(in srgb, var(--jr-accent, #75bf76) 75%, #fff));
  box-shadow: inset 0 1px 2px rgba(26, 37, 64, 0.08);
}
.jr-ribbon-track input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.jr-ribbon-track input[type="range"]::-webkit-slider-runnable-track {
  height: 12px;
  background: transparent;
}
.jr-ribbon-track input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 3px 10px rgba(26, 37, 64, 0.16);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
}
.jr-ribbon-track input[type="range"]::-moz-range-track {
  height: 12px;
  background: transparent;
  border: none;
}
.jr-ribbon-track input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 3px 10px rgba(26, 37, 64, 0.16);
}
.jr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  margin-top: 1.1rem;
}
.jr-saved {
  margin-top: 1rem;
  text-align: center;
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--done-color, #75bf76);
  letter-spacing: -0.02em;
}
html.mode-dark .task-morph-face-back,
body.mode-dark .task-morph-face-back {
  background: rgba(30, 35, 52, 0.82);
}
html.mode-dark .jr-field textarea,
body.mode-dark .jr-field textarea {
  background: #232839;
  border-color: rgba(255,255,255,0.08);
  color: #e8ecf6;
}
html.mode-dark .jr-field textarea:focus,
body.mode-dark .jr-field textarea:focus {
  background: #2a3144;
}
html.mode-dark .jr-ribbon-label,
body.mode-dark .jr-ribbon-label {
  color: #e8ecf6;
}
.task-morph-body {
  flex: 1 1 auto;
  min-height: 0;
  opacity: 0;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}
.task-morph-body.show {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.28s ease;
}
.task-morph-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: visible;
  overflow-y: auto;
  padding: 1.1rem 1.1rem 1.55rem;
  scrollbar-width: none;
}
.task-morph-scroll::-webkit-scrollbar { width: 0; height: 0; }
.task-morph-kicker {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--faint);
}
.task-morph-scroll h2 {
  margin-top: 0.2rem;
  font-family: "Syne", sans-serif;
  font-size: 1.15rem; font-weight: 800; letter-spacing: -0.03em;
}
.task-morph-block {
  margin-top: 0.85rem;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid rgba(26, 37, 64, 0.06);
  position: relative;
}
.task-morph-face-front .task-morph-block:first-child {
  margin-top: 0.15rem;
}
.task-morph-block-task {
  overflow: visible;
  z-index: 1;
  border-color: color-mix(in srgb, var(--task-glow, #75bf76) 42%, rgba(26, 37, 64, 0.06));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--task-glow, #75bf76) 32%, transparent),
    0 0 22px color-mix(in srgb, var(--task-glow, #75bf76) 45%, transparent),
    0 0 48px color-mix(in srgb, var(--task-glow, #75bf76) 28%, transparent),
    inset 0 0 28px color-mix(in srgb, var(--task-glow, #75bf76) 16%, transparent);
}
.task-morph-block h3 {
  font-family: "Syne", sans-serif;
  font-size: 0.92rem; font-weight: 800; letter-spacing: -0.02em;
}
.task-morph-face-front .task-morph-block h3,
html.mode-dark .task-morph-face-front .task-morph-block h3,
body.mode-dark .task-morph-face-front .task-morph-block h3 {
  color: #12151f;
}
.task-morph-block p {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}
html.mode-dark .task-morph-shape.is-panel,
body.mode-dark .task-morph-shape.is-panel {
  background: transparent;
  border: none;
  box-shadow: none;
}
html.mode-dark .task-morph-face-front,
body.mode-dark .task-morph-face-front {
  border-color: rgba(255, 255, 255, 0.92);
}
html.mode-dark .task-morph-head,
body.mode-dark .task-morph-head {
  background: linear-gradient(
    to bottom,
    var(--tm-phase, #75bf76) 0%,
    var(--tm-phase, #75bf76) 60%,
    transparent 100%
  );
}
html.mode-dark .task-morph-head .settings-head h2,
body.mode-dark .task-morph-head .settings-head h2 {
  color: #1a2540;
}
/* Front-face task cards stay opaque white like journal browse */
html.mode-dark .task-morph-face-front .task-morph-block,
body.mode-dark .task-morph-face-front .task-morph-block {
  background: #ffffff;
  border-color: rgba(26, 37, 64, 0.08);
}
html.mode-dark .task-morph-face-back .task-morph-block,
body.mode-dark .task-morph-face-back .task-morph-block {
  background: #2a3144;
  border-color: rgba(255,255,255,0.08);
}
html.mode-dark .task-morph-block-task,
body.mode-dark .task-morph-block-task {
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--task-glow, #75bf76) 22%, transparent),
    0 0 16px color-mix(in srgb, var(--task-glow, #75bf76) 28%, transparent),
    0 0 34px color-mix(in srgb, var(--task-glow, #75bf76) 16%, transparent),
    inset 0 0 22px color-mix(in srgb, var(--task-glow, #75bf76) 12%, transparent);
}

body.theme-soft { --tilt-max: 3.4; --tilt-lift: 2.1; --tilt-ease: 0.15; }
body.theme-calm { --tilt-max: 2.6; --tilt-lift: 1.5; --tilt-ease: 0.11; }
body.theme-drift { --tilt-max: 2.0; --tilt-lift: 1.1; --tilt-ease: 0.08; }
body.theme-drift .orb { filter: blur(72px); }

/* Settings (subtle fade) */
.settings-root { position: fixed; inset: 0; z-index: 120; pointer-events: none; }
.settings-panel {
  position: fixed; left: var(--settings-left, 8.5rem); top: 50%; z-index: 121;
  width: min(360px, calc(100vw - 2rem)); max-height: min(72vh, 640px);
  display: flex; flex-direction: column; border-radius: 22px; padding: 0; overflow: hidden;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(22px) saturate(1.3); -webkit-backdrop-filter: blur(22px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 22px 48px rgba(26, 37, 64, 0.14), 0 8px 18px rgba(26, 37, 64, 0.07);
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translate3d(-14px, -50%, 0) scale(0.97); transform-origin: left center;
  transition: opacity 0.55s cubic-bezier(0.22,1,0.36,1), transform 0.6s cubic-bezier(0.22,1,0.36,1), visibility 0s linear 0.55s;
}
.settings-root.open .settings-panel {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translate3d(0, -50%, 0) scale(1);
  transition: opacity 0.55s cubic-bezier(0.22,1,0.36,1), transform 0.6s cubic-bezier(0.22,1,0.36,1), visibility 0s linear 0s;
}
.settings-panel.from-bottom {
  top: auto; bottom: 5.5rem;
  transform: translate3d(0, 16px, 0) scale(0.97); transform-origin: bottom center;
}
.settings-root.open .settings-panel.from-bottom { transform: translate3d(0, 0, 0) scale(1); }
.settings-scroll {
  flex: 1 1 auto; min-height: 0; overflow: auto; padding: 1.1rem 1.1rem 1.55rem;
  scrollbar-width: none; -ms-overflow-style: none;
}
.settings-scroll::-webkit-scrollbar { width: 0; height: 0; }
.settings-fade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 22px; pointer-events: none;
  border-radius: 0 0 22px 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,0.42));
  opacity: 0; transition: opacity 0.25s ease;
}
.settings-panel.can-down .settings-fade { opacity: 1; }
.settings-panel.can-up:not(.can-down) .settings-fade {
  opacity: 1; top: 0; bottom: auto; border-radius: 22px 22px 0 0;
  background: linear-gradient(0deg, rgba(255,255,255,0), rgba(255,255,255,0.42));
}
.settings-hint {
  position: absolute; left: 50%; bottom: 0.2rem; transform: translateX(-50%); z-index: 2;
  width: 24px; height: 24px; display: grid; place-items: center; cursor: pointer; border-radius: 999px;
  background: rgba(255,255,255,0.82); border: 1px solid rgba(255,255,255,0.95);
  box-shadow: 0 4px 10px rgba(26,37,64,0.08); color: var(--text);
  opacity: 0; pointer-events: none; transition: opacity 0.22s ease;
}
.settings-panel.can-down .settings-hint,
.settings-panel.can-up .settings-hint { opacity: 1; pointer-events: auto; }
.settings-panel.can-up:not(.can-down) .settings-hint { top: 0.2rem; bottom: auto; }
.settings-hint svg { width: 12px; height: 12px; display: block; animation: hintNudge 1.4s ease-in-out infinite; }
.settings-panel.can-up:not(.can-down) .settings-hint svg {
  transform: rotate(180deg); animation: hintNudgeUp 1.4s ease-in-out infinite;
}
@keyframes hintNudge { 0%,100%{transform:translateY(0)} 50%{transform:translateY(2px)} }
@keyframes hintNudgeUp { 0%,100%{transform:rotate(180deg) translateY(0)} 50%{transform:rotate(180deg) translateY(2px)} }
.settings-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem;
  padding-bottom: 0.85rem; margin-bottom: 0.15rem; border-bottom: 1px solid rgba(26,37,64,0.08);
}
#settingsPanel .settings-head {
  border-bottom: none;
  padding-bottom: 0.15rem;
  margin-bottom: 0;
}
.settings-head h2 { font-family: "Syne", sans-serif; font-size: 1.15rem; font-weight: 800; letter-spacing: -0.03em; }
.settings-head p { margin-top: 0.25rem; color: var(--muted); font-size: 0.82rem; line-height: 1.4; }
.settings-close {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.55); cursor: pointer; font-size: 1.15rem; line-height: 1;
  background: rgba(255,255,255,0.45); color: var(--text); backdrop-filter: blur(10px);
}
.settings-section { margin-top: 1rem; }
.settings-section h3 {
  font-family: "Syne", sans-serif; font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); margin-bottom: 0.55rem;
}
.settings-row {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.75rem 0.85rem; border-radius: 14px;
  background: rgba(255,255,255,0.45); border: 1px solid rgba(255,255,255,0.7);
}
.settings-section .settings-row + .settings-row { margin-top: 0.55rem; }
.settings-row-action {
  display: flex;
  justify-content: stretch;
}
.settings-row-action .btn {
  width: 100%;
  justify-content: center;
}
.settings-row-stack {
  flex-direction: column;
  align-items: stretch;
}
.settings-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}
.settings-field input {
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.75);
  padding: 0.5rem 0.7rem;
  font: inherit;
  font-weight: 600;
  color: var(--text);
}
.settings-delete { color: #b42318; }
.row-text strong { display: block; font-size: 0.9rem; }
.row-text span { display: block; margin-top: 0.2rem; color: var(--muted); font-size: 0.78rem; line-height: 1.35; }
.settings-note { color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
.settings-select {
  border-radius: 999px; border: 1px solid rgba(255,255,255,0.7); background: rgba(255,255,255,0.7);
  padding: 0.45rem 0.75rem; font: inherit; font-weight: 700; font-size: 0.82rem; color: var(--text);
}
.settings-time {
  min-width: 7.2rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.7);
  padding: 0.45rem 0.75rem;
  font: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text);
}
.settings-time:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.theme-toggle {
  display: inline-flex;
  gap: 0.35rem;
  border: none;
  background: transparent;
  overflow: visible;
}
.theme-toggle .ob-theme-btn {
  width: 2.35rem;
  min-width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.55);
  color: var(--text);
  cursor: pointer;
}
.theme-toggle .ob-theme-btn.is-on,
.theme-toggle .ob-theme-btn.active {
  background: rgba(18,19,26,0.9);
  color: #fff;
  border-color: rgba(18,19,26,0.9);
}
html.mode-dark .theme-toggle .ob-theme-btn,
body.mode-dark .theme-toggle .ob-theme-btn {
  background: rgba(30,35,52,0.72);
  border-color: rgba(255,255,255,0.16);
  color: #d7deef;
}
html.mode-dark .settings-time,
body.mode-dark .settings-time,
html.mode-dark .settings-select,
body.mode-dark .settings-select {
  background: rgba(30,35,52,0.72);
  border-color: rgba(255,255,255,0.16);
  color: #d7deef;
}
html.mode-dark .theme-toggle .ob-theme-btn.is-on,
html.mode-dark .theme-toggle .ob-theme-btn.active,
body.mode-dark .theme-toggle .ob-theme-btn.is-on,
body.mode-dark .theme-toggle .ob-theme-btn.active {
  background: #ebb641;
  color: #1a1f36;
  border-color: #ebb641;
}
.switch { position: relative; width: 46px; height: 28px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; border-radius: 999px; background: rgba(26,37,64,0.15); cursor: pointer;
  transition: background 0.25s ease;
}
.slider::before {
  content: ""; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px;
  border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(26,37,64,0.2);
  transition: transform 0.25s ease;
}
.switch input:checked + .slider { background: var(--mint); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.faq-list { display: grid; gap: 0.45rem; }
.faq-item {
  border-radius: 12px; background: rgba(255,255,255,0.45); border: 1px solid rgba(255,255,255,0.7);
  padding: 0.65rem 0.8rem;
}
.faq-item summary { cursor: pointer; font-weight: 700; font-size: 0.88rem; }
.faq-item p { margin-top: 0.45rem; color: var(--muted); font-size: 0.82rem; line-height: 1.45; }

html.mode-dark, body.mode-dark {
  --text: #e8ecf6; --muted: #9aa3b5; --faint: #6b7289;
  --glass: rgba(24, 28, 42, 0.62); --card: rgba(30, 35, 52, 0.92);
  background: #12151f; color: var(--text);
}
html.mode-dark .bg-fixed, body.mode-dark .bg-fixed { background: #12151f; }
html.mode-dark .versions-link, body.mode-dark .versions-link { background: rgba(30,35,52,0.9); color: var(--muted); }
html.mode-dark .side-nav a:not(.nav-logo), html.mode-dark .side-nav .nav-settings, html.mode-dark .nav-lang-btn,
body.mode-dark .side-nav a:not(.nav-logo), body.mode-dark .side-nav .nav-settings, body.mode-dark .nav-lang-btn {
  background: rgba(30,35,52,0.72); border-color: rgba(255,255,255,0.08); color: var(--muted);
}
html.mode-dark .side-nav .nav-logo,
body.mode-dark .side-nav .nav-logo {
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--text);
}
html.mode-dark .side-nav a.active, body.mode-dark .side-nav a.active,
html.mode-dark .nav-lang-btn.is-on, body.mode-dark .nav-lang-btn.is-on {
  background: rgba(232,236,246,0.95); color: #12151f;
}
html.mode-dark .shell, body.mode-dark .shell {
  border-color: rgba(255,255,255,0.08); box-shadow: 0 30px 80px rgba(0,0,0,0.4);
}
html.mode-dark .card, html.mode-dark .animal, html.mode-dark .phase, html.mode-dark .stat-tile, html.mode-dark .stats-chart,
html.mode-dark .prof-photo, html.mode-dark .prof-tile, html.mode-dark .prof-metric, html.mode-dark .prof-mid, html.mode-dark .prof-right,
html.mode-dark .prog-phase, html.mode-dark .prog-task, html.mode-dark .badge-orb,
html.mode-dark .mini-stat, html.mode-dark .settings-panel, html.mode-dark .plan-card,
body.mode-dark .card, body.mode-dark .animal, body.mode-dark .phase, body.mode-dark .stat-tile, body.mode-dark .stats-chart,
body.mode-dark .prof-photo, body.mode-dark .prof-tile, body.mode-dark .prof-metric, body.mode-dark .prof-mid, body.mode-dark .prof-right,
body.mode-dark .prog-phase, body.mode-dark .prog-task, body.mode-dark .badge-orb,
body.mode-dark .mini-stat, body.mode-dark .settings-panel, body.mode-dark .plan-card {
  border-color: rgba(255,255,255,0.1);
}
html.mode-dark .settings-panel, body.mode-dark .settings-panel {
  background: rgba(24, 28, 42, 0.58);
  box-shadow: 0 22px 48px rgba(0,0,0,0.4), 0 8px 18px rgba(0,0,0,0.22);
}
html.mode-dark .settings-fade, body.mode-dark .settings-fade {
  background: linear-gradient(180deg, rgba(24,28,42,0), rgba(24,28,42,0.55));
}
html.mode-dark .settings-panel.can-up:not(.can-down) .settings-fade,
body.mode-dark .settings-panel.can-up:not(.can-down) .settings-fade {
  background: linear-gradient(0deg, rgba(24,28,42,0), rgba(24,28,42,0.55));
}
html.mode-dark .settings-hint, body.mode-dark .settings-hint {
  background: rgba(30,35,52,0.9); border-color: rgba(255,255,255,0.12); color: var(--text);
}
html.mode-dark .settings-row, html.mode-dark .faq-item, html.mode-dark .settings-close,
body.mode-dark .settings-row, body.mode-dark .faq-item, body.mode-dark .settings-close {
  background: rgba(18,21,31,0.45); border-color: rgba(255,255,255,0.08);
}
html.mode-dark .chart-svg .grid line, body.mode-dark .chart-svg .grid line { stroke: rgba(255,255,255,0.08); }
html.mode-dark .btn-ghost, body.mode-dark .btn-ghost { background: rgba(30,35,52,0.85); color: var(--text); }
html.mode-dark .close, body.mode-dark .close {
  background: rgba(18,21,31,0.35); border-top-color: rgba(255,255,255,0.08);
}

/* â€”â€” Onboarding: Gate â†’ Mirror â†’ Portrait â†’ Auth â€”â€” */
body.is-onboarding .side-nav,
body.is-onboarding #appViews {
  visibility: hidden;
  pointer-events: none;
}
/* Versions link stays for you during Gate; hide later for end users */
body.is-onboarding .versions-link {
  visibility: visible;
  pointer-events: auto;
  z-index: 220;
}
.onboard-root {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  overflow: auto;
  background:
    radial-gradient(ellipse 80% 60% at 20% 15%, rgba(235, 182, 65, 0.18), transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 80%, rgba(72, 176, 191, 0.16), transparent 50%),
    rgba(244, 246, 251, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
html.mode-dark .onboard-root,
body.mode-dark .onboard-root {
  background:
    radial-gradient(ellipse 80% 60% at 20% 15%, rgba(235, 182, 65, 0.12), transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 80%, rgba(72, 176, 191, 0.1), transparent 50%),
    rgba(12, 14, 22, 0.94);
}
/* Gate + Mirror: real site orbs + cursor glow â€” no overlay wash */
body.is-onboarding-live .onboard-root,
html.mode-dark body.is-onboarding-live .onboard-root,
body.mode-dark.is-onboarding-live .onboard-root {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 5.5rem 1.35rem 3.5rem;
}

/* Mirror / portrait / auth panels â€” same glass chrome as Gate login */
.ob-shell.ob-mirror.shell,
.ob-shell.ob-portrait.shell,
.ob-shell.ob-auth.shell {
  width: min(640px, 100%);
  margin: 0 auto;
  max-height: min(92vh, 860px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.85rem;
  padding: var(--dash-pad);
  background: var(--glass);
  backdrop-filter: blur(26px) saturate(1.3);
  -webkit-backdrop-filter: blur(26px) saturate(1.3);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.22),
    0 30px 80px rgba(26, 37, 64, 0.12);
}
/* Mirror: transparent shell â€” only flip faces carry glass (no static double plate) */
.ob-shell.ob-mirror.shell {
  width: min(760px, 100%);
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  box-shadow: none;
  overflow: visible;
  padding: 0;
  gap: 0.65rem;
}
.ob-shell.ob-mirror .ob-brand {
  padding: 0 0.35rem;
}
.ob-flip-stage {
  width: 100%;
  flex: 1 1 auto;
  /* Perspective is applied on the rotating inner via transform: perspective() â€”
     parent perspective + absolute child often looks flat. */
}
/* Height morph lives here â€” never put overflow:hidden on the 3D rotator */
.ob-flip-sizer {
  position: relative;
  width: 100%;
  transform-style: preserve-3d;
}
.ob-flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform-origin: center center;
  transition: transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
  transform: perspective(920px) rotateY(0deg);
}
/* Next = left (negative Y), Back = right (positive Y) */
.ob-flip-inner.is-flip-next { transform: perspective(920px) rotateY(-180deg); }
.ob-flip-inner.is-flip-prev { transform: perspective(920px) rotateY(180deg); }
.ob-flip-sizer.is-sizing .ob-flip-inner {
  position: absolute;
  inset: 0;
}
.ob-flip-face {
  width: 100%;
  box-sizing: border-box;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  overflow: visible;
}
.ob-flip-chrome {
  height: 100%;
  box-sizing: border-box;
  border-radius: 28px;
  overflow: hidden;
  background: var(--glass);
  backdrop-filter: blur(26px) saturate(1.3);
  -webkit-backdrop-filter: blur(26px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.58);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.22),
    0 30px 80px rgba(26, 37, 64, 0.12);
  padding: var(--dash-pad);
}
.ob-flip-sizer.is-sizing .ob-flip-chrome {
  overflow: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: rgba(255, 255, 255, 0.94);
}
html.mode-dark .ob-flip-sizer.is-sizing .ob-flip-chrome,
body.mode-dark .ob-flip-sizer.is-sizing .ob-flip-chrome {
  background: rgba(30, 35, 52, 0.96);
}
.ob-flip-sizer.is-sizing .ob-flip-chrome::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
.ob-flip-front {
  position: relative;
  transform: rotateY(0deg);
}
.ob-flip-back {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transform: rotateY(180deg);
}
.ob-flip-sizer.is-sizing .ob-flip-front,
.ob-flip-sizer.is-sizing .ob-flip-back {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
}
.ob-flip-inner.is-flip-next .ob-flip-back,
.ob-flip-inner.is-flip-prev .ob-flip-back {
  pointer-events: auto;
}
.ob-flip-inner.is-flip-next .ob-flip-front,
.ob-flip-inner.is-flip-prev .ob-flip-front {
  pointer-events: none;
}
html.mode-dark .ob-shell.ob-mirror.shell,
body.mode-dark .ob-shell.ob-mirror.shell {
  background: transparent;
  border: none;
  box-shadow: none;
}
html.mode-dark .ob-flip-chrome,
body.mode-dark .ob-flip-chrome {
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.16),
    0 30px 80px rgba(0, 0, 0, 0.4);
}

/* Auth: two equal panels side by side */
.ob-auth-layout {
  width: min(920px, calc(100% - 2rem));
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-items: stretch;
}
.ob-auth-layout .ob-brand {
  text-align: center;
}
.ob-auth-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  align-items: stretch;
}
.ob-auth-panel.shell {
  width: 100%;
  margin: 0;
  max-height: min(86vh, 720px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.75rem;
  padding: var(--dash-pad);
  background: var(--glass);
  backdrop-filter: blur(26px) saturate(1.3);
  -webkit-backdrop-filter: blur(26px) saturate(1.3);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.22),
    0 30px 80px rgba(26, 37, 64, 0.12);
}
.ob-auth-panel h1,
.ob-auth-panel h2 {
  font-family: "Syne", sans-serif;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0.1rem 0 0;
}
.ob-auth-panel h1 { font-size: clamp(1.35rem, 3vw, 1.7rem); }
.ob-auth-panel h2 { font-size: clamp(1.2rem, 2.6vw, 1.45rem); }
.ob-auth-panel .ob-oauth {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.25rem;
}
.ob-auth-panel .ob-submit,
.ob-auth-panel .ob-oauth .btn {
  width: 100%;
  justify-content: center;
}
html.mode-dark .ob-auth-panel.shell,
body.mode-dark .ob-auth-panel.shell {
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.16),
    0 30px 80px rgba(0, 0, 0, 0.4);
}
@media (max-width: 720px) {
  .ob-auth-split {
    grid-template-columns: 1fr;
  }
}
html.mode-dark .ob-shell.ob-portrait.shell,
html.mode-dark .ob-shell.ob-auth.shell,
body.mode-dark .ob-shell.ob-portrait.shell,
body.mode-dark .ob-shell.ob-auth.shell {
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.16),
    0 30px 80px rgba(0, 0, 0, 0.4);
}

.ob-gate-stage {
  position: relative;
  z-index: 1;
  width: min(var(--shell-max), calc(100% - 2rem));
  height: min(72vh, 640px);
  margin: 0 auto;
}
.ob-gate-title-panel {
  position: absolute;
  left: 48px;
  top: 120px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  width: 420px;
  min-height: 260px;
  padding: 0.75rem;
  box-sizing: border-box;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.ob-gate-title-panel.show-frame,
.ob-gate-sub-panel.show-frame {
  outline: 1.5px dashed rgba(26, 37, 64, 0.35);
  outline-offset: 0;
  background: rgba(255, 255, 255, 0.12);
}
.ob-gate-title-panel.is-dragging,
.ob-gate-sub-panel.is-dragging,
.ob-gate-drag.is-dragging {
  cursor: grabbing;
}
.ob-gate-title-panel .brand {
  font-size: clamp(2.8rem, 7vw, 4.6rem);
  line-height: var(--gate-title-lh, 0.95);
  transform: scaleX(var(--gate-title-sx, 1)) scaleY(var(--gate-title-sy, 1));
  transform-origin: left center;
  word-spacing: var(--gate-title-word, 0px);
}
.ob-gate-ace-panel,
.ob-gate-you-panel {
  position: absolute;
  left: 48px;
  top: 120px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  padding: 0.75rem;
  box-sizing: border-box;
  cursor: default;
  touch-action: none;
  user-select: none;
}
.ob-gate-ace-panel.ob-gate-drag,
.ob-gate-you-panel.ob-gate-drag {
  cursor: grab;
}
.ob-gate-ace-panel.show-frame,
.ob-gate-you-panel.show-frame {
  outline: 1.5px dashed rgba(26, 37, 64, 0.35);
  outline-offset: 0;
  background: rgba(255, 255, 255, 0.12);
}
.ob-gate-ace-panel.is-dragging,
.ob-gate-you-panel.is-dragging {
  cursor: grabbing;
}
.ob-gate-ace-panel {
  min-height: 120px;
}
.ob-gate-you-panel {
  min-height: 90px;
}
.ob-gate-ace-panel,
.ob-gate-ace-panel.ob-gate-drag {
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: var(--gate-ace-font, clamp(2.8rem, 7vw, 4.6rem));
  line-height: var(--gate-ace-lh, 0.95);
  letter-spacing: -0.045em;
  color: var(--text);
  transform: scaleX(var(--gate-ace-sx, 1)) scaleY(var(--gate-ace-sy, 1));
  transform-origin: left center;
  word-spacing: var(--gate-ace-word, 0px);
}
.ob-gate-you-panel,
.ob-gate-you-panel.ob-gate-drag {
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: var(--gate-you-font, clamp(2.8rem, 7vw, 4.6rem));
  line-height: var(--gate-you-lh, 0.95);
  letter-spacing: -0.045em;
  color: var(--text);
  transform: scaleX(var(--gate-you-sx, 1)) scaleY(var(--gate-you-sy, 1));
  transform-origin: left center;
  word-spacing: var(--gate-you-word, 0px);
}
.ob-gate-sub-panel {
  position: absolute;
  left: 48px;
  top: 305px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  width: 420px;
  min-height: 120px;
  padding: 0.75rem;
  box-sizing: border-box;
  cursor: default;
  touch-action: none;
  user-select: none;
}
.ob-gate-sub-panel.ob-gate-drag {
  cursor: grab;
}
.ob-gate-sub-panel .headline {
  margin-top: 0;
  max-width: none;
  transform: scaleX(var(--gate-sub-sx, 1)) scaleY(var(--gate-sub-sy, 1));
  transform-origin: left top;
}
.ob-gate-panel.shell {
  position: absolute;
  left: 520px;
  top: 110px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.85rem;
  padding: var(--dash-pad);
  width: min(320px, 100%);
  min-height: 0;
  overflow: visible;
  touch-action: none;
  border: 1px solid rgba(255, 255, 255, 0.58);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.22),
    0 30px 80px rgba(26, 37, 64, 0.12);
}
.ob-gate-panel.shell.tilt,
.ob-shell.tilt {
  will-change: transform;
  transform-style: preserve-3d;
}
html.mode-dark .ob-gate-panel.shell,
body.mode-dark .ob-gate-panel.shell {
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.16),
    0 30px 80px rgba(0, 0, 0, 0.4);
}
.ob-gate-drag {
  cursor: grab;
  user-select: none;
}
/* Only the small "â ¿ Ð¿Ð°Ð½ÐµÐ»" handle â€” NOT Ace/You text panels */
.ob-gate-panel > .ob-gate-drag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 0.15rem 0 0.25rem;
}
.ob-gate-nav {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  align-items: stretch;
}
.ob-gate-panel .ob-gate-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  width: 100%;
  margin-top: 0;
  align-self: stretch;
}
.ob-gate-panel .ob-lang,
.ob-gate-panel .ob-theme {
  display: inline-flex;
  gap: 0.35rem;
  margin-top: 0;
  align-self: center;
  flex-shrink: 0;
}
.ob-gate-panel .ob-theme-btn {
  width: 2.35rem;
  min-width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ob-theme-ico {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
}
html.mode-dark .ob-gate-panel .ob-lang-btn,
body.mode-dark .ob-gate-panel .ob-lang-btn {
  color: #d7deef;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(30, 35, 52, 0.72);
}
html.mode-dark .ob-gate-panel .ob-lang-btn.is-on,
body.mode-dark .ob-gate-panel .ob-lang-btn.is-on {
  color: #fff;
  background: rgba(48, 56, 82, 0.95);
  border-color: rgba(61, 123, 255, 0.55);
}
.ob-gate-tuner {
  position: fixed;
  right: 0.85rem;
  bottom: 0.85rem;
  z-index: 230;
  width: min(280px, calc(100vw - 1.5rem));
  max-height: min(70vh, 560px);
  overflow: auto;
  padding: 0.85rem 0.9rem 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 18px 40px rgba(26, 37, 64, 0.16);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 0.78rem;
  color: var(--text);
}
html.mode-dark .ob-gate-tuner,
body.mode-dark .ob-gate-tuner {
  background: rgba(30, 35, 52, 0.94);
  border-color: rgba(255, 255, 255, 0.1);
  color: #e8ecf6;
}
.ob-gate-tuner strong {
  font-family: "Syne", sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
}
.ob-tune-hint {
  margin: 0.35rem 0 0.55rem;
  color: var(--muted);
  line-height: 1.35;
}
.ob-tune-sec {
  margin: 0.65rem 0 0.25rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.68rem;
  color: var(--faint);
}
.ob-tune-row {
  display: grid;
  gap: 0.2rem;
  margin-top: 0.35rem;
  font-weight: 600;
  color: var(--muted);
}
.ob-tune-row em {
  font-style: normal;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.ob-tune-row input[type="range"] {
  width: 100%;
}
.ob-tune-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.55rem;
}
.ob-gate-tuner .ob-nav-btn {
  margin-top: 0.75rem;
  width: 100%;
}
@media (max-width: 820px) {
  /* Locked mobile gate: absolute layout from gateMobileTuneDefaults */
  body.is-gate-mobile-layout.is-onboarding-gate.is-onboarding-live .onboard-root {
    padding: 1.25rem 0.75rem 4.75rem;
    align-items: flex-start;
    justify-content: flex-start;
  }
  body.is-gate-mobile-layout .ob-gate-stage {
    display: block;
    position: relative;
    width: 100%;
    max-width: 100%;
    height: min(78vh, 720px);
    margin: 0 auto;
    padding-top: 0;
  }
  body.is-gate-mobile-layout .ob-gate-ace-panel,
  body.is-gate-mobile-layout .ob-gate-you-panel,
  body.is-gate-mobile-layout .ob-gate-sub-panel,
  body.is-gate-mobile-layout .ob-gate-panel.shell {
    position: absolute;
    touch-action: manipulation;
  }
  body.is-gate-mobile-layout .ob-gate-panel.shell {
    width: min(300px, calc(100% - 1.5rem));
  }
  body.is-gate-mobile-layout .ob-gate-sub-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.35rem 0.5rem;
  }
  body.is-gate-mobile-layout .ob-gate-sub-panel .headline {
    margin: 0;
    width: 100%;
    max-width: none;
    text-align: center;
    font-size: clamp(1.38rem, 2.76vw, 1.8rem);
    line-height: 1.35;
    transform: scaleX(var(--gate-sub-sx, 1)) scaleY(var(--gate-sub-sy, 1));
    transform-origin: center center;
  }
  body.is-gate-mobile-layout .ob-gate-tuner {
    display: none;
  }

  /* Only while re-tuning mobile */
  body.is-gate-mobile-tuning .ob-gate-ace-panel.ob-gate-drag,
  body.is-gate-mobile-tuning .ob-gate-you-panel.ob-gate-drag,
  body.is-gate-mobile-tuning .ob-gate-sub-panel.ob-gate-drag {
    cursor: grab;
    user-select: none;
    touch-action: none;
  }
  body.is-gate-mobile-tuning .ob-gate-tuner {
    display: block;
    left: 0.5rem;
    right: 0.5rem;
    bottom: 0.5rem;
    width: auto;
    max-height: 38vh;
    z-index: 280;
  }
}

/* Gate: implied GDPR / terms (no checkbox) */
.ob-gdpr-line {
  position: fixed;
  left: 0;
  right: 0;
  bottom: max(0.55rem, env(safe-area-inset-bottom, 0px));
  z-index: 210;
  margin: 0;
  padding: 0 1rem;
  text-align: center;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--muted);
  pointer-events: none;
}
@media (max-width: 820px) {
  body.is-onboarding-gate .ob-gdpr-line {
    bottom: max(0.4rem, env(safe-area-inset-bottom, 0px));
    padding: 0 0.85rem 0.15rem;
    font-size: 0.72rem;
    z-index: 220;
  }
}
.ob-gdpr-link {
  pointer-events: auto;
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}
.ob-gdpr-link:hover,
.ob-gdpr-link:focus-visible {
  color: var(--ink, #1a2540);
  outline: none;
}
html.mode-dark .ob-gdpr-link:hover,
html.mode-dark .ob-gdpr-link:focus-visible,
body.mode-dark .ob-gdpr-link:hover,
body.mode-dark .ob-gdpr-link:focus-visible {
  color: #e8ecf6;
}
.ob-terms-modal {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
.ob-terms-modal[hidden] {
  display: none !important;
}
.ob-terms-scrim {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(12, 14, 22, 0.45);
  cursor: pointer;
}
.ob-terms-dialog.shell {
  position: relative;
  z-index: 1;
  width: min(100%, 28rem);
  max-height: min(72vh, 540px);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.25rem 1.35rem 1.15rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
html.mode-dark .ob-terms-dialog.shell,
body.mode-dark .ob-terms-dialog.shell {
  background: rgba(22, 26, 40, 0.92);
}
.ob-terms-dialog h2 {
  margin: 0;
  font-size: 1.2rem;
}
.ob-terms-body {
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--muted);
}
.ob-terms-body p {
  margin: 0 0 0.75rem;
}
.ob-terms-body p:last-child {
  margin-bottom: 0;
}
.ob-terms-actions {
  display: flex;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.ob-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 0.85rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 28px rgba(26, 37, 64, 0.08);
  width: 100%;
  transition: transform 0.35s ease, background 0.35s ease, color 0.35s ease, box-shadow 0.35s ease;
}
.ob-nav-btn:hover {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.75);
  color: var(--text);
}
.ob-nav-btn .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
  flex-shrink: 0;
}
html.mode-dark .ob-nav-btn,
body.mode-dark .ob-nav-btn {
  background: rgba(30, 35, 52, 0.55);
  border-color: rgba(255, 255, 255, 0.12);
  color: #c5cad6;
}
html.mode-dark .ob-nav-btn:hover,
body.mode-dark .ob-nav-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #e8ecf6;
}

.ob-shell {
  width: min(520px, 100%);
  max-height: min(92vh, 860px);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.35rem 1.35rem 1.25rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 22px 48px rgba(26, 37, 64, 0.14);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}
html.mode-dark .ob-shell,
body.mode-dark .ob-shell {
  background: rgba(30, 35, 52, 0.88);
  border-color: rgba(255, 255, 255, 0.1);
}
.ob-portrait { width: min(560px, 100%); }
.ob-brand {
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  color: var(--text, #1a1f36);
}
.ob-shell h1, .ob-card h2 {
  font-family: "Syne", sans-serif;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text, #1a1f36);
  line-height: 1.15;
}
.ob-shell h1 { font-size: clamp(1.6rem, 4vw, 2rem); margin: 0.15rem 0 0; }
.ob-card h2 { font-size: 1.35rem; margin: 0.2rem 0 0; }
.ob-lead, .ob-card .ob-lead {
  color: var(--muted, #6b7289);
  line-height: 1.5;
  font-size: 0.98rem;
  margin: 0;
}
.ob-kicker {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint, #9aa3b5);
  margin: 0;
}
.ob-privacy {
  display: inline-flex;
  align-self: flex-start;
  margin: 0;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #5a4a1a;
  background: rgba(235, 182, 65, 0.28);
  border: 1px solid rgba(235, 182, 65, 0.45);
}
html.mode-dark .ob-privacy, body.mode-dark .ob-privacy {
  color: #f3e6b8;
  background: rgba(235, 182, 65, 0.18);
}
.ob-actions, .ob-oauth {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.35rem;
}
.ob-submit, .ob-oauth .btn { width: 100%; justify-content: center; }
.ob-actions { justify-content: space-between; align-items: center; }
.ob-journey-btn {
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.ob-journey-btn:hover {
  transform: translateY(-3px);
  background: #2a3148;
  box-shadow: 0 14px 28px rgba(26, 37, 64, 0.22);
}
.ob-next-btn {
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}
.ob-next-btn:hover {
  transform: translateY(-2px);
  background: #2a3148;
  box-shadow: 0 10px 22px rgba(26, 37, 64, 0.2);
}
.ob-next-btn:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 4px 10px rgba(26, 37, 64, 0.16);
}
.ob-lang {
  display: inline-flex;
  gap: 0.35rem;
  margin-top: 0.75rem;
  align-self: center;
}
.ob-lang-btn {
  border: 1px solid rgba(26, 37, 64, 0.18);
  background: rgba(255,255,255,0.55);
  border-radius: 10px;
  padding: 0.35rem 0.65rem;
  font-weight: 700;
  cursor: pointer;
  color: #2a3148;
}
.ob-lang-btn.is-on {
  color: #12151f;
  background: #fff;
  border-color: rgba(61, 123, 255, 0.45);
}
.ob-gate-panel .ob-lang-btn {
  color: #1e2438;
  border-color: rgba(26, 37, 64, 0.22);
  background: rgba(255, 255, 255, 0.72);
}
.ob-gate-panel .ob-lang-btn.is-on {
  color: #0f121c;
  background: #fff;
  border-color: rgba(61, 123, 255, 0.5);
}
.ob-progress {
  height: 4px;
  border-radius: 99px;
  background: rgba(26, 37, 64, 0.08);
  overflow: hidden;
  margin-bottom: 0.35rem;
}
.ob-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ebb641, #48b0bf);
  border-radius: inherit;
}
.ob-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted, #6b7289);
}
.ob-field-hint {
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--faint, #9aa3b5);
}
.ob-field input,
.ob-field textarea {
  border: 1px solid rgba(26, 37, 64, 0.12);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  font: inherit;
  font-weight: 500;
  color: var(--text, #1a1f36);
  background: #f7f8fb;
  resize: vertical;
  min-height: 2.6rem;
}
.ob-field input:focus,
.ob-field textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, #3d7bff 45%, #fff);
  box-shadow: 0 0 0 3px rgba(61, 123, 255, 0.12);
  background: #fff;
}
html.mode-dark .ob-field input, body.mode-dark .ob-field input,
html.mode-dark .ob-field textarea, body.mode-dark .ob-field textarea {
  background: #232839;
  border-color: rgba(255,255,255,0.1);
  color: #e8ecf6;
}
.ob-field-inline { margin-top: 0.35rem; width: 100%; }
.ob-actions-single { justify-content: stretch; }
.ob-actions-single .btn { width: 100%; justify-content: center; text-align: center; }
.ob-loading-bar {
  margin-top: 1rem;
  height: 4px;
  border-radius: 99px;
  background: rgba(26, 37, 64, 0.1);
  overflow: hidden;
}
.ob-loading-bar span {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ebb641, #48b0bf);
  animation: ob-load-slide 1.1s ease-in-out infinite;
}
@keyframes ob-load-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.ob-choice-cols {
  display: flex;
  align-items: stretch;
  margin-top: 0.85rem;
  border: 1px solid rgba(26, 37, 64, 0.14);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.28);
}
.ob-choice-col {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.75rem 0.55rem;
  border-right: 1px solid rgba(26, 37, 64, 0.14);
}
.ob-choice-col:last-child { border-right: none; }
.ob-choice-col-head,
.ob-choice-row-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text, #1a1f36);
  margin-bottom: 0.55rem;
}
.ob-choice-num {
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: rgba(26, 37, 64, 0.1);
  font-size: 0.72rem;
  flex: 0 0 auto;
}
.ob-choice-col .ob-choices {
  flex-direction: column;
  align-items: stretch;
  margin-top: 0;
  gap: 0.4rem;
}
.ob-choice-col .ob-choice {
  width: 100%;
  text-align: left;
  border-radius: 12px;
  white-space: normal;
  line-height: 1.25;
}
.ob-choice-rows {
  display: flex;
  flex-direction: column;
  margin-top: 0.85rem;
}
.ob-choice-row {
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(26, 37, 64, 0.14);
}
.ob-choice-row:first-child { padding-top: 0.25rem; }
.ob-choice-row:last-child { border-bottom: none; padding-bottom: 0.15rem; }
.ob-choice-row .ob-choices { margin-top: 0.35rem; }
html.mode-dark .ob-choice-cols,
body.mode-dark .ob-choice-cols {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}
html.mode-dark .ob-choice-col,
body.mode-dark .ob-choice-col,
html.mode-dark .ob-choice-row,
body.mode-dark .ob-choice-row {
  border-color: rgba(255, 255, 255, 0.12);
}
html.mode-dark .ob-choice-num,
body.mode-dark .ob-choice-num {
  background: rgba(255, 255, 255, 0.1);
  color: #e8ecf6;
}
@media (max-width: 720px) {
  .ob-choice-cols {
    flex-direction: column;
  }
  .ob-choice-col {
    border-right: none;
    border-bottom: 1px solid rgba(26, 37, 64, 0.14);
  }
  .ob-choice-col:last-child { border-bottom: none; }
  .ob-choice-col .ob-choices {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .ob-choice-col .ob-choice { width: auto; }
}
.ob-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.7rem;
}
.ob-choice {
  border: 1px solid rgba(26, 37, 64, 0.12);
  background: rgba(255,255,255,0.65);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text, #1a1f36);
}
.ob-choice.is-on {
  background: #1a1f36;
  color: #fff;
  border-color: #1a1f36;
}
html.mode-dark .ob-choice, body.mode-dark .ob-choice {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
  color: #e8ecf6;
}
html.mode-dark .ob-choice.is-on, body.mode-dark .ob-choice.is-on {
  background: #ebb641;
  color: #1a1f36;
  border-color: #ebb641;
}
.ob-err {
  color: #c92f2b;
  font-size: 0.88rem;
  font-weight: 600;
  margin: 0.5rem 0 0;
}
.ob-err.is-ok {
  color: #2f6f3e;
}
.onboard-root.is-auth-busy {
  cursor: wait;
}
.onboard-root.is-auth-busy .ob-auth-layout,
.onboard-root.is-auth-busy .ob-journey-btn {
  pointer-events: none;
}
.onboard-root.is-auth-busy .ob-submit,
.onboard-root.is-auth-busy .ob-oauth .btn,
.onboard-root.is-auth-busy .ob-journey-btn {
  opacity: 0.72;
  cursor: wait;
}
.ob-portrait-scroll {
  overflow: auto;
  max-height: min(52vh, 420px);
  padding-right: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.ob-portrait-scroll p {
  margin: 0;
  line-height: 1.55;
  color: var(--text, #1a1f36);
  font-size: 0.95rem;
}
.ob-closing {
  font-family: "Syne", sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.ob-cta-lead {
  margin: 1rem 0 0.55rem;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--muted, #5b6478);
}
.ob-form { display: flex; flex-direction: column; gap: 0.15rem; }
.ob-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--faint, #9aa3b5);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0.35rem 0;
}
.ob-divider::before, .ob-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(26, 37, 64, 0.12);
}
.ob-switch, .ob-back-link {
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted, #6b7289);
  margin: 0.25rem 0 0;
}
.ob-link {
  border: none;
  background: none;
  color: #3d7bff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ob-card { display: flex; flex-direction: column; gap: 0.35rem; min-height: 0; }

.mirror-private {
  margin-top: 1.1rem;
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.75);
}
html.mode-dark .mirror-private, body.mode-dark .mirror-private {
  background: rgba(30, 35, 52, 0.72);
  border-color: rgba(255,255,255,0.08);
}
.mirror-private-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.65rem;
}
.mirror-private-head h3 {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text, #1a1f36);
}
.mirror-private-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: #e8b84a;
  color: #1a1408;
  border: 1px solid rgba(90, 60, 10, 0.22);
}
html.mode-dark .mirror-private-badge,
body.mode-dark .mirror-private-badge {
  background: #d4a017;
  color: #140f05;
  border-color: rgba(255, 220, 140, 0.35);
}
html.mode-dark .mirror-private-head h3,
body.mode-dark .mirror-private-head h3 {
  color: #e8ecf6;
}
.mirror-private p {
  margin: 0 0 0.65rem;
  line-height: 1.5;
  font-size: 0.92rem;
  color: var(--text, #1a1f36);
}
html.mode-dark .mirror-private p,
body.mode-dark .mirror-private p {
  color: #d8dde8;
}
.mirror-private p:last-child { margin-bottom: 0; }
.mirror-private .btn {
  margin-top: 0.9rem;
}

.profile-page {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}
.profile-page .profile-block {
  margin-top: 0;
}
.profile-page .profile-block > h2 {
  margin-top: 0;
}
.prof-section-mirror {
  margin-top: 0.25rem;
}
.prof-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}
.prof-danger {
  margin-top: 0.5rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(26, 37, 64, 0.1);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
}
.prof-danger h3 {
  font-family: "Syne", sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  margin: 0 0 0.35rem;
}
.prof-danger p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
  flex: 1;
  min-width: 0;
}
.prof-danger .settings-delete {
  flex-shrink: 0;
}
html.mode-dark .prof-danger,
body.mode-dark .prof-danger {
  border-top-color: rgba(255,255,255,0.1);
}
.sg-toast-host {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 180;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  pointer-events: none;
  max-width: min(22rem, calc(100vw - 2rem));
}
.sg-toast {
  padding: 0.85rem 1rem;
  border-radius: 16px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(255,255,255,0.7);
  box-shadow: 0 16px 40px rgba(26,37,64,0.16);
  color: var(--text);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.sg-toast.is-in {
  opacity: 1;
  transform: translateY(0);
}
.sg-toast strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 800;
}
.sg-toast span {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.35;
}
html.mode-dark .sg-toast,
body.mode-dark .sg-toast {
  background: rgba(28,32,48,0.94);
  border-color: rgba(255,255,255,0.1);
}
.sg-offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 12000;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  padding: 0.55rem 1rem;
  background: #1a1f36;
  color: #f4f6fb;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 0.82rem;
  line-height: 1.35;
  box-shadow: 0 2px 12px rgba(18, 19, 26, 0.18);
}
.sg-offline-banner[hidden] {
  display: none !important;
}
.sg-offline-banner-title {
  font-weight: 700;
  letter-spacing: 0.02em;
}
.sg-offline-banner-body {
  opacity: 0.88;
}
html.is-offline body {
  padding-top: 2.4rem;
}
html.has-outbox body {
  padding-top: 2.4rem;
}
@media (max-width: 860px) {
  html.is-offline body,
  html.has-outbox body {
    padding-top: 2.8rem;
  }
}
html.mode-dark .sg-offline-banner,
body.mode-dark .sg-offline-banner {
  background: #0e1018;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
html.has-outbox:not(.is-offline) .sg-offline-banner {
  background: #243056;
}
body.sg-overlay-open,
body.avatar-picker-open {
  overflow: hidden;
  padding-right: var(--sg-scrollbar-pad, 0px);
}
.sg-overlay {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: 1.15rem;
}
.sg-overlay[hidden] { display: none !important; }
.sg-overlay-scrim {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(18, 22, 36, 0.48);
  backdrop-filter: blur(10px) saturate(1.15);
  -webkit-backdrop-filter: blur(10px) saturate(1.15);
  cursor: pointer;
}
.sg-overlay-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 26rem);
  padding: 1.2rem 1.3rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 24px;
}
html.mode-dark .sg-overlay-dialog,
body.mode-dark .sg-overlay-dialog {
  background: rgba(28, 32, 48, 0.94);
}
.sg-overlay-form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.sg-overlay-form .ob-submit { width: 100%; justify-content: center; }
.plan-paywall-overlay .sg-overlay-scrim {
  z-index: 0;
  background: rgba(8, 12, 22, 0.22);
  backdrop-filter: blur(4px) saturate(1.05);
  -webkit-backdrop-filter: blur(4px) saturate(1.05);
}
.plan-paywall-overlay .plan-paywall-dialog {
  z-index: 2;
  width: min(100%, 32rem);
  gap: 0;
  padding: 1.25rem 1.2rem 1.15rem;
  background: rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(22px) saturate(1.45);
  -webkit-backdrop-filter: blur(22px) saturate(1.45);
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 24px;
  box-shadow:
    0 28px 70px rgba(8, 12, 24, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.52),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08);
  overflow: visible;
}
html.mode-dark .plan-paywall-overlay .plan-paywall-dialog,
body.mode-dark .plan-paywall-overlay .plan-paywall-dialog {
  background: rgba(12, 16, 28, 0.52);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04);
}
.plan-paywall-dialog h2 {
  font-family: "Syne", sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 0.95rem;
  line-height: 1.25;
  text-shadow: 0 1px 12px rgba(255, 255, 255, 0.35);
}
html.mode-dark .plan-paywall-dialog h2,
body.mode-dark .plan-paywall-dialog h2 {
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.35);
}
.plan-paywall-section {
  position: relative;
  padding: 0.85rem 0.95rem 0.9rem;
  border-radius: 16px;
  backdrop-filter: blur(14px) saturate(1.25);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 8px 24px rgba(8, 12, 24, 0.08);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.42);
}
.plan-paywall-section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.22) 0%, transparent 42%);
  pointer-events: none;
}
.plan-paywall-section::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.72;
}
.plan-paywall-section + .plan-paywall-section {
  margin-top: 0.65rem;
  padding-top: 0.85rem;
  border-top: none;
}
.plan-paywall-good {
  border-color: rgba(37, 99, 235, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.52),
    0 8px 28px rgba(37, 99, 235, 0.18);
}
.plan-paywall-good::after {
  background: linear-gradient(to bottom right, #4ade80, #2563eb);
  opacity: 0.43;
}
.plan-paywall-bad {
  border-color: rgba(236, 72, 153, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.48),
    0 8px 28px rgba(236, 72, 153, 0.18);
}
.plan-paywall-bad::after {
  background: linear-gradient(to bottom right, #ec4899, #fb923c);
  opacity: 0.40;
}
html.mode-dark .plan-paywall-section,
body.mode-dark .plan-paywall-section {
  background: rgba(28, 32, 48, 0.55);
}
html.mode-dark .plan-paywall-section::before,
body.mode-dark .plan-paywall-section::before {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.12) 0%, transparent 42%);
}
.plan-paywall-section h3 {
  position: relative;
  z-index: 2;
  font-family: "Climate Crisis", "Syne", sans-serif;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0 0 0.45rem;
}
.plan-paywall-good h3 {
  color: #1d4ed8;
  font-size: 1.26rem;
}
.plan-paywall-bad h3 {
  color: #be185d;
  font-size: 1.34rem;
}
html.mode-dark .plan-paywall-good h3,
body.mode-dark .plan-paywall-good h3,
html.mode-dark .plan-paywall-bad h3,
body.mode-dark .plan-paywall-bad h3 {
  -webkit-text-stroke: 0;
  paint-order: normal;
  text-shadow:
    0 0 6px rgba(255, 255, 255, 0.95),
    0 0 14px rgba(255, 255, 255, 0.85),
    0 0 28px rgba(255, 255, 255, 0.55),
    0 0 42px rgba(255, 255, 255, 0.35);
}
.plan-paywall-section p {
  position: relative;
  z-index: 2;
  margin: 0;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.55;
}
.plan-paywall-question {
  margin: 39px 0 42px;
  font-family: "Syne", sans-serif;
  font-size: 24px;
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.02em;
}
.plan-paywall-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
}
/* Flowbite-style gradient border buttons (inner soft fill → transparent on hover) */
.plan-paywall-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 0;
  height: auto;
  min-height: 0;
  padding: 0.125rem; /* p-0.5 */
  overflow: hidden;
  border: none;
  border-radius: 0.5rem;
  font-family: "Climate Crisis", "Syne", sans-serif;
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text, #1a1f36);
  text-shadow: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  z-index: 0;
}
.plan-paywall-btn::before,
.plan-paywall-btn::after {
  content: none;
  display: none;
}
.plan-paywall-btn-inner {
  position: relative;
  display: block;
  padding: 10px 40px;
  line-height: 1.25rem;
  border-radius: 0.4rem;
  background: rgba(255, 255, 255, 0.92);
  transition: background-color 75ms ease-in, color 75ms ease-in;
}
.plan-paywall-btn:hover {
  transform: none;
  filter: none;
  color: #fff;
}
.plan-paywall-btn:hover .plan-paywall-btn-inner {
  background: transparent;
  color: #fff;
}
.plan-paywall-btn:focus {
  outline: none;
}
.plan-paywall-btn-yes {
  background: linear-gradient(to bottom right, #ec4899, #fb923c); /* pink-500 → orange-400 */
}
.plan-paywall-btn-yes:focus-visible {
  box-shadow: 0 0 0 4px rgba(251, 207, 232, 0.7);
}
.plan-paywall-btn-no {
  background: linear-gradient(to bottom right, #4ade80, #2563eb); /* green-400 → blue-600 */
}
.plan-paywall-btn-no:focus-visible {
  box-shadow: 0 0 0 4px rgba(134, 239, 172, 0.55);
}
html.mode-dark .plan-paywall-btn,
body.mode-dark .plan-paywall-btn {
  color: #fff;
}
html.mode-dark .plan-paywall-btn-inner,
body.mode-dark .plan-paywall-btn-inner {
  background: rgba(28, 32, 48, 0.96);
}
html.mode-dark .plan-paywall-btn:hover .plan-paywall-btn-inner,
body.mode-dark .plan-paywall-btn:hover .plan-paywall-btn-inner {
  background: transparent;
  color: #fff;
}
html.mode-dark .plan-paywall-btn-yes:focus-visible,
body.mode-dark .plan-paywall-btn-yes:focus-visible {
  box-shadow: 0 0 0 4px rgba(157, 23, 77, 0.55);
}
html.mode-dark .plan-paywall-btn-no:focus-visible,
body.mode-dark .plan-paywall-btn-no:focus-visible {
  box-shadow: 0 0 0 4px rgba(22, 101, 52, 0.65);
}

.goals-home-link {
  color: inherit;
  font-weight: 700;
  text-underline-offset: 0.15em;
}

/* Goals editor (Profile page) */
.goals-panel {
  padding: 1.1rem 1.15rem 1.2rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.75);
}
html.mode-dark .goals-panel,
body.mode-dark .goals-panel {
  background: rgba(30, 35, 52, 0.72);
  border-color: rgba(255, 255, 255, 0.08);
}
.goals-panel-head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.95rem;
}
.goals-panel-lead {
  margin: 0;
  flex: 1 1 auto;
  font-weight: 600;
  line-height: 1.45;
  font-size: 0.98rem;
}
.goals-info {
  position: relative;
  flex: 0 0 auto;
  margin-top: 0.1rem;
}
.goals-info-btn {
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  border: 1.5px solid rgba(26, 37, 64, 0.28);
  background: rgba(255, 255, 255, 0.75);
  color: var(--muted);
  font-family: "Syne", sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
html.mode-dark .goals-info-btn,
body.mode-dark .goals-info-btn {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(20, 24, 38, 0.75);
  color: #c5cad8;
}
.goals-info-tip {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  z-index: 5;
  width: min(18rem, 72vw);
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(26, 37, 64, 0.12);
  box-shadow: 0 14px 36px rgba(26, 37, 64, 0.14);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.45;
}
html.mode-dark .goals-info-tip,
body.mode-dark .goals-info-tip {
  background: rgba(22, 26, 40, 0.98);
  border-color: rgba(255, 255, 255, 0.1);
}
.goals-info:hover .goals-info-tip,
.goals-info.is-open .goals-info-tip {
  display: block;
}
.goals-slots {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.goals-slot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 0.8rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.8);
}
html.mode-dark .goals-slot,
body.mode-dark .goals-slot {
  background: rgba(18, 22, 34, 0.55);
  border-color: rgba(255, 255, 255, 0.08);
}
.goals-slot-text {
  margin: 0;
  flex: 1 1 12rem;
  font-weight: 600;
  line-height: 1.4;
}
.goals-slot-input {
  flex: 1 1 12rem;
  min-width: 0;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  background: transparent;
  border: none;
  outline: none;
  padding: 0.15rem 0;
}
.goals-slot-input::placeholder {
  color: var(--muted);
  font-weight: 500;
}
.goals-slot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-left: auto;
}
.goals-btn {
  min-height: 2.2rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
}
.goals-btn-icon {
  width: 2.2rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.goals-ico {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
}
.goals-completed {
  margin-top: 1.15rem;
  padding-top: 0.95rem;
  border-top: 1px solid rgba(26, 37, 64, 0.1);
}
html.mode-dark .goals-completed,
body.mode-dark .goals-completed {
  border-top-color: rgba(255, 255, 255, 0.1);
}
.goals-completed-title {
  margin: 0 0 0.55rem;
  font-family: "Syne", sans-serif;
  font-size: 1.02rem;
  font-weight: 800;
}
.goals-completed-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--muted);
  line-height: 1.5;
}
.goals-completed-list li {
  margin: 0.25rem 0;
}

/* Avatar picker â€” split glass panels (no shared plate) */
/* avatar-picker-open scroll lock shares rule with sg-overlay-open above */
.avatar-overlay {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center;
  padding: 1rem 1.15rem;
  background: rgba(18, 22, 36, 0.48);
  backdrop-filter: blur(10px) saturate(1.15);
  -webkit-backdrop-filter: blur(10px) saturate(1.15);
}
.avatar-overlay[hidden] { display: none !important; }
.avatar-editor {
  width: min(960px, 100%);
  max-height: min(94vh, 860px);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(240px, 0.85fr);
  gap: 1rem;
  align-items: stretch;
}
.avatar-panel {
  min-height: 0;
  max-height: min(94vh, 860px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 24px;
  /* Solid panels (no glass) per request */
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid rgba(255, 255, 255, 0.68);
  box-shadow: 0 30px 80px rgba(26, 37, 64, 0.18);
}
html.mode-dark .avatar-panel,
body.mode-dark .avatar-panel {
  background: rgba(28, 32, 48, 0.92);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}
.avatar-panel-head {
  flex: 0 0 auto;
  padding: 1rem 1rem 0.35rem;
}
.avatar-panel-head h3 {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: 1.2rem; font-weight: 800; letter-spacing: -0.02em;
}
.avatar-panel-head p {
  margin: 0.3rem 0 0;
  color: var(--muted); font-size: 0.86rem; line-height: 1.4;
}
.avatar-panel-bar {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  padding: 0.75rem 0.75rem 0.15rem;
}
.avatar-close {
  width: 2rem; height: 2rem; border-radius: 10px;
  border: 1px solid rgba(26, 37, 64, 0.12);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text); font-size: 1.25rem; line-height: 1;
  cursor: pointer;
}
html.mode-dark .avatar-close,
body.mode-dark .avatar-close {
  background: rgba(20, 24, 38, 0.8);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e8ecf6;
}
.avatar-editor-left {
  padding: 0.95rem 0.9rem 0.95rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.avatar-editor-right {
  padding: 0;
}
.avatar-fields-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.avatar-preview-wrap {
  display: grid;
  place-items: center;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 0 0.75rem;
  overflow: hidden;
  border-radius: 24px;
  width: 100%;
}
.avatar-preview {
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: cover;
  border-radius: 24px;
  background: #e8eef8;
  box-shadow: var(--shadow);
  transform-origin: center center;
}
.avatar-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  /* Keep everything inside the panel (no scroll) */
  gap: 0.25rem;
  overflow: hidden;
  padding-bottom: 0;
  flex: 0 0 auto;
}
.avatar-preset {
  appearance: none;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 0.12rem;
  background: rgba(61, 123, 255, 0.06);
  cursor: pointer;
}
.avatar-preset img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 9px;
}
.avatar-preset.is-active,
.avatar-preset:hover {
  border-color: var(--blue);
  background: rgba(61, 123, 255, 0.12);
}
.avatar-fields {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 0.75rem 0.8rem;
}
.avatar-field {
  display: grid; gap: 0.32rem;
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint);
}
.avatar-field select {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.92rem; font-weight: 600;
  letter-spacing: 0; text-transform: none;
  color: var(--text);
  padding: 0.62rem 0.75rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: var(--card);
  box-shadow: var(--shadow);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.avatar-field select:hover {
  border-color: rgba(61, 123, 255, 0.35);
}
.avatar-field select:focus {
  border-color: rgba(61, 123, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(61, 123, 255, 0.18);
}
html.mode-dark .avatar-field select,
body.mode-dark .avatar-field select {
  background: rgba(20, 24, 38, 0.88);
  border-color: rgba(255, 255, 255, 0.1);
  color: #e8ecf6;
  box-shadow: none;
}
.avatar-dd {
  position: relative;
}
.avatar-dd-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.42rem 0.65rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: var(--card);
  box-shadow: var(--shadow);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.avatar-dd-trigger:hover,
.avatar-dd-trigger[aria-expanded="true"] {
  border-color: rgba(61, 123, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(61, 123, 255, 0.14);
}
.avatar-dd-trigger-img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
  background: rgba(26, 37, 64, 0.06);
}
.avatar-dd-trigger-swatch {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: block;
  background: var(--swatch, #ccc);
  border: 1px solid rgba(26, 37, 64, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.avatar-dd-caret {
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  margin: -0.2rem 0.35rem 0 0;
  flex: 0 0 auto;
}
.avatar-dd-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.4rem);
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  padding: 0.55rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 36px rgba(26, 37, 64, 0.16);
  max-height: none;
  overflow: visible;
}
.avatar-dd-panel[data-avatar-dd-panel="hair"] {
  left: auto;
  right: 0;
  width: min(320px, calc(100vw - 3rem));
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  padding: 0.65rem;
}
.avatar-dd-panel[hidden] { display: none !important; }
.avatar-dd-panel-swatches {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.avatar-dd-opt,
.avatar-dd-swatch {
  appearance: none;
  border: 2px solid transparent;
  background: rgba(26, 37, 64, 0.04);
  border-radius: 12px;
  padding: 0.2rem;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.avatar-dd-opt img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 9px;
  object-fit: cover;
}
.avatar-dd-swatch {
  aspect-ratio: 1;
  background: var(--swatch, #ccc);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.avatar-dd-opt:hover,
.avatar-dd-swatch:hover {
  transform: translateY(-1px);
  border-color: rgba(61, 123, 255, 0.35);
}
.avatar-dd-opt.is-active,
.avatar-dd-swatch.is-active {
  border-color: rgba(18, 19, 26, 0.88);
}
html.mode-dark .avatar-dd-trigger,
body.mode-dark .avatar-dd-trigger,
html.mode-dark .avatar-dd-panel,
body.mode-dark .avatar-dd-panel {
  background: rgba(20, 24, 38, 0.96);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
}
html.mode-dark .avatar-dd-opt,
body.mode-dark .avatar-dd-opt {
  background: rgba(255, 255, 255, 0.05);
}
html.mode-dark .avatar-dd-opt.is-active,
body.mode-dark .avatar-dd-opt.is-active,
html.mode-dark .avatar-dd-swatch.is-active,
body.mode-dark .avatar-dd-swatch.is-active {
  border-color: #fff;
}
.avatar-actions {
  flex: 0 0 auto;
  display: flex; flex-wrap: wrap; gap: 0.55rem; justify-content: flex-end;
  margin-top: auto;
  padding: 0.85rem 0.8rem 0.9rem;
  border-top: 1px solid rgba(26, 37, 64, 0.08);
}
html.mode-dark .avatar-actions,
body.mode-dark .avatar-actions {
  border-top-color: rgba(255, 255, 255, 0.08);
}
@media (max-width: 760px) {
  .avatar-editor {
    width: min(520px, 100%);
    max-height: none;
    grid-template-columns: 1fr;
  }
  .avatar-panel {
    max-height: none;
  }
  .avatar-fields-scroll {
    max-height: none;
    overflow: visible;
  }
  .avatar-preview-wrap {
    width: 100%;
    min-height: 220px;
  }
  .avatar-presets { grid-template-columns: repeat(4, 1fr); }
  .avatar-actions { justify-content: stretch; }
  .avatar-actions .btn { flex: 1 1 calc(50% - 0.55rem); }
}
@media (max-width: 420px) {
  .avatar-presets { grid-template-columns: repeat(3, 1fr); }
}

/* —— Admin portal (separate from user app) —— */
body.is-admin-mode .side-nav,
body.is-admin-mode #appViews,
body.is-admin-mode .versions-link,
body.is-admin-mode .settings-root,
body.is-admin-mode #settingsOpen {
  display: none !important;
}
.admin-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  background:
    radial-gradient(900px 480px at 12% -10%, rgba(90, 140, 255, 0.14), transparent 60%),
    radial-gradient(700px 420px at 90% 10%, rgba(255, 170, 120, 0.1), transparent 55%),
    var(--bg, #eef1f7);
  color: var(--text, #1a2540);
}
.admin-root[hidden] { display: none !important; }
.admin-rail {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem 1rem;
  border-right: 1px solid rgba(26, 37, 64, 0.1);
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(12px);
}
.admin-rail-brand {
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.admin-rail-brand span {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.55;
  margin-top: 0.15rem;
}
.admin-rail-nav { display: grid; gap: 0.55rem; flex: 1; align-content: start; }
.admin-rail-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text, #1a2540);
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.2;
  border: 1px solid rgba(26, 37, 64, 0.14);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 1px 0 rgba(26, 37, 64, 0.04);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.admin-rail-link:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(26, 37, 64, 0.22);
}
.admin-rail-link.is-on {
  background: rgba(26, 37, 64, 0.92);
  border-color: transparent;
  color: #fff;
}
html.mode-dark .admin-rail-link,
body.mode-dark .admin-rail-link {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  color: inherit;
}
html.mode-dark .admin-rail-link.is-on,
body.mode-dark .admin-rail-link.is-on {
  background: rgba(255, 255, 255, 0.92);
  color: #12161f;
}
.admin-rail-foot {
  display: grid;
  gap: 0.65rem;
}
.admin-rail-lang { display: flex; gap: 0.35rem; }
.admin-logout { justify-self: stretch; }
.admin-main {
  overflow: auto;
  padding: 1.4rem 1.5rem 2.5rem;
}
.admin-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 1.1rem;
}
.admin-head h1 {
  margin: 0.15rem 0 0.35rem;
  font-family: "Syne", sans-serif;
  font-size: clamp(1.45rem, 2.4vw, 1.9rem);
  letter-spacing: -0.03em;
}
.admin-kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.55;
}
.admin-lead {
  margin: 0;
  max-width: 42rem;
  color: var(--muted, rgba(26, 37, 64, 0.65));
  font-size: 0.92rem;
}
.admin-note {
  margin: 0;
  max-width: 18rem;
  font-size: 0.82rem;
  color: var(--muted, rgba(26, 37, 64, 0.62));
}
.admin-plan-tabs,
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
}
.admin-tab {
  appearance: none;
  border: 1px solid rgba(26, 37, 64, 0.12);
  background: rgba(255, 255, 255, 0.55);
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.admin-tab.is-on {
  background: rgba(26, 37, 64, 0.9);
  border-color: transparent;
  color: #fff;
}
.admin-tab-count {
  display: inline-flex;
  min-width: 1.25rem;
  justify-content: center;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  font-size: 0.7rem;
  background: rgba(26, 37, 64, 0.1);
}
.admin-tab.is-on .admin-tab-count {
  background: rgba(255, 255, 255, 0.2);
}
.admin-wait-list {
  display: grid;
  gap: 0;
  border: 1px solid rgba(26, 37, 64, 0.1);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.5);
}
.admin-wait-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1.4fr) minmax(0, 1fr) auto;
  gap: 0.65rem 0.85rem;
  align-items: center;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid rgba(26, 37, 64, 0.08);
  cursor: pointer;
  background: transparent;
}
.admin-wait-line:last-child { border-bottom: 0; }
.admin-wait-line:hover {
  background: rgba(26, 37, 64, 0.03);
}
.admin-wait-line.is-selected {
  background: rgba(61, 123, 255, 0.08);
}
.admin-wait-check {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.admin-wait-check input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: #1a2540;
  cursor: pointer;
}
.admin-wait-line-main {
  min-width: 0;
  display: grid;
  gap: 0.1rem;
}
.admin-wait-line-main strong { font-size: 0.92rem; }
.admin-wait-email {
  font-size: 0.78rem;
  opacity: 0.65;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-wait-line-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  font-size: 0.78rem;
  opacity: 0.75;
}
.admin-wait-spacer { width: 1px; }
.admin-invite-bar {
  display: flex;
  justify-content: flex-start;
  margin: 0.75rem 0;
}
.admin-invite-bar-top {
  margin-top: 0.35rem;
  position: sticky;
  top: 0.5rem;
  z-index: 3;
  padding: 0.35rem 0;
  background: linear-gradient(to bottom, var(--bg, #eef1f7) 70%, transparent);
}
.admin-invite-bar-bottom {
  margin-bottom: 0;
  position: sticky;
  bottom: 0.5rem;
  z-index: 3;
  padding: 0.35rem 0;
  background: linear-gradient(to top, var(--bg, #eef1f7) 70%, transparent);
}
.admin-invite-bar .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
html.mode-dark .admin-wait-list,
body.mode-dark .admin-wait-list {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}
html.mode-dark .admin-wait-line,
body.mode-dark .admin-wait-line {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
html.mode-dark .admin-wait-line.is-selected,
body.mode-dark .admin-wait-line.is-selected {
  background: rgba(90, 140, 255, 0.14);
}
@media (max-width: 760px) {
  .admin-wait-line {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .admin-wait-line-meta,
  .admin-wait-line .btn {
    grid-column: 2;
  }
}
.admin-seats-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.85rem;
  padding: 0.7rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(26, 37, 64, 0.1);
  background: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
}
.admin-seats-banner.is-limited {
  border-color: rgba(217, 122, 30, 0.28);
  background: rgba(217, 122, 30, 0.1);
}
.admin-seats-banner.is-full {
  border-color: rgba(201, 47, 43, 0.22);
  background: rgba(201, 47, 43, 0.08);
}
.admin-seats-banner.is-open {
  border-color: rgba(117, 191, 118, 0.28);
  background: rgba(117, 191, 118, 0.12);
}
html.mode-dark .admin-seats-banner,
body.mode-dark .admin-seats-banner {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}
.admin-section { margin-bottom: 1.5rem; }
.admin-section h2 {
  margin: 0 0 0.35rem;
  font-family: "Syne", sans-serif;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.admin-section-lead {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--muted, rgba(26, 37, 64, 0.62));
}
.admin-people { display: grid; gap: 0.55rem; }
.admin-person {
  appearance: none;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(26, 37, 64, 0.1);
  background: rgba(255, 255, 255, 0.55);
  border-radius: 14px;
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.55rem 1rem;
  color: inherit;
  font: inherit;
}
.admin-person:hover,
.admin-person.is-queue {
  border-color: rgba(217, 122, 30, 0.35);
  box-shadow: 0 8px 24px rgba(26, 37, 64, 0.06);
}
.admin-person-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.82rem;
  opacity: 0.8;
}
.admin-sub {
  display: block;
  font-size: 0.78rem;
  opacity: 0.65;
  margin-top: 0.15rem;
}
.admin-empty {
  margin: 0.5rem 0 0;
  color: var(--muted, rgba(26, 37, 64, 0.62));
}
.admin-cta-table-wrap {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid rgba(26, 37, 64, 0.1);
  background: rgba(255, 255, 255, 0.45);
}
.admin-cta-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}
.admin-cta-table th,
.admin-cta-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(26, 37, 64, 0.08);
}
.admin-cta-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}
.admin-cta-table tr.is-off {
  opacity: 0.55;
}
.admin-cta-num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.admin-cta-rate {
  font-weight: 800;
  font-family: "Syne", sans-serif;
}
.admin-cta-form {
  display: grid;
  gap: 0.65rem;
  max-width: 36rem;
}
.admin-cta-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.admin-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}
.admin-pill.is-needs {
  color: #8a4b00;
  background: rgba(217, 122, 30, 0.16);
}
.admin-copy-bar {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(26, 37, 64, 0.1);
  background: rgba(255, 255, 255, 0.5);
}
.admin-copy-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
}
.admin-check {
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.admin-copy-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.admin-detail {
  display: grid;
  grid-template-columns: minmax(200px, 0.55fr) minmax(0, 1.45fr);
  gap: 1rem;
  align-items: start;
}
.admin-card {
  border: 1px solid rgba(26, 37, 64, 0.1);
  background: rgba(255, 255, 255, 0.55);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.75rem;
}
.admin-card h3 {
  margin: 0 0 0.45rem;
  font-family: "Syne", sans-serif;
  font-size: 0.95rem;
}
.admin-card ul { margin: 0; padding-left: 1.1rem; }
.admin-card p { margin: 0; }
.admin-side-panel {
  padding: 0;
  overflow: hidden;
}
.admin-side-block {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(26, 37, 64, 0.08);
}
.admin-side-block:last-child { border-bottom: 0; }
.admin-notes-block {
  background: rgba(176, 61, 157, 0.04);
}
.admin-notes-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.admin-notes-list time,
.admin-sent-list time {
  display: block;
  font-size: 0.72rem;
  opacity: 0.6;
  margin-bottom: 0.2rem;
}
.admin-note-form,
.admin-reply-form {
  display: grid;
  gap: 0.5rem;
}
.admin-note-form textarea,
.admin-reply-form textarea {
  width: 100%;
  resize: vertical;
  border-radius: 10px;
  border: 1px solid rgba(26, 37, 64, 0.14);
  padding: 0.55rem 0.65rem;
  font: inherit;
  background: rgba(255, 255, 255, 0.75);
  color: inherit;
}
.admin-journal-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.65rem;
}
.admin-journal-row {
  border-radius: 12px;
  background: rgba(26, 37, 64, 0.04);
  overflow: hidden;
}
.admin-journal-toggle {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  text-align: left;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0.65rem 0.7rem;
  cursor: pointer;
}
.admin-journal-toggle-text {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
}
.admin-journal-toggle time {
  font-size: 0.72rem;
  opacity: 0.6;
}
.admin-journal-preview {
  font-size: 0.88rem;
  line-height: 1.35;
  opacity: 0.85;
}
.admin-chevron {
  flex: 0 0 auto;
  margin-top: 0.1rem;
  transition: transform 0.18s ease;
  opacity: 0.7;
}
.admin-journal-row.is-open .admin-chevron {
  transform: rotate(180deg);
}
.admin-journal-body {
  padding: 0 0.7rem 0.75rem 2.05rem;
}
.admin-journal-body p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
}
.admin-reply-card {
  border-color: rgba(201, 47, 43, 0.28);
  background: rgba(201, 47, 43, 0.05);
}
.admin-reply-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.55rem;
}
.admin-reply-head h3 { margin-bottom: 0.2rem; }
.admin-reply-head .admin-section-lead { margin-bottom: 0; }
.btn-admin-send {
  justify-self: start;
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  background: #c92f2b;
  box-shadow: 0 8px 18px rgba(201, 47, 43, 0.22);
}
.btn-admin-send:hover {
  background: #b42824;
}
.admin-sent-list {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.35rem;
}
.admin-sent-list article {
  padding: 0.65rem 0.7rem;
  border-radius: 12px;
  background: rgba(26, 37, 64, 0.04);
}
.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.admin-modal[hidden] { display: none !important; }
.admin-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 22, 31, 0.45);
}
.admin-modal-sheet {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: min(72vh, 640px);
  overflow: auto;
  border-radius: 18px;
  padding: 1rem 1.1rem 1.15rem;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(26, 37, 64, 0.1);
  box-shadow: 0 24px 60px rgba(18, 22, 31, 0.22);
}
.admin-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.admin-modal-head h2 {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: 1.1rem;
}
.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
}
html.mode-dark .admin-root,
body.mode-dark .admin-root {
  background:
    radial-gradient(900px 480px at 12% -10%, rgba(90, 140, 255, 0.12), transparent 60%),
    #12161f;
}
html.mode-dark .admin-rail,
html.mode-dark .admin-person,
html.mode-dark .admin-card,
html.mode-dark .admin-copy-bar,
html.mode-dark .admin-modal-sheet,
body.mode-dark .admin-rail,
body.mode-dark .admin-person,
body.mode-dark .admin-card,
body.mode-dark .admin-copy-bar,
body.mode-dark .admin-modal-sheet {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}
html.mode-dark .admin-modal-sheet,
body.mode-dark .admin-modal-sheet {
  background: #1a2030;
}
html.mode-dark .admin-side-block,
body.mode-dark .admin-side-block {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
html.mode-dark .admin-notes-block,
body.mode-dark .admin-notes-block {
  background: rgba(176, 61, 157, 0.08);
}
html.mode-dark .admin-reply-card,
body.mode-dark .admin-reply-card {
  background: rgba(201, 47, 43, 0.1);
  border-color: rgba(255, 120, 110, 0.28);
}
html.mode-dark .admin-tab,
body.mode-dark .admin-tab {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: inherit;
}
html.mode-dark .admin-tab.is-on,
body.mode-dark .admin-tab.is-on {
  background: rgba(255, 255, 255, 0.92);
  color: #12161f;
}
html.mode-dark .admin-note-form textarea,
html.mode-dark .admin-reply-form textarea,
body.mode-dark .admin-note-form textarea,
body.mode-dark .admin-reply-form textarea {
  background: rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 255, 255, 0.14);
}
@media (max-width: 900px) {
  .admin-root { grid-template-columns: 1fr; }
  .admin-rail {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid rgba(26, 37, 64, 0.1);
  }
  .admin-rail-nav { flex: 1; }
  .admin-rail-foot { margin-left: auto; grid-auto-flow: column; align-items: center; }
  .admin-detail { grid-template-columns: 1fr; }
}

/* —— Admin wallpapers —— */
.admin-wall-toolbar { margin: 0 0 1rem; }
.admin-wall-list {
  display: grid;
  gap: 0.85rem;
}
.admin-wall-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 0.85rem;
  padding: 0.75rem;
  border-radius: 16px;
  border: 1px solid rgba(26, 37, 64, 0.1);
  background: rgba(255, 255, 255, 0.55);
}
.admin-wall-card.is-off { opacity: 0.62; }
.admin-wall-thumb {
  width: 112px;
  height: 84px;
  border-radius: 12px;
  background: #1a1f36 center/cover no-repeat;
}
.admin-wall-card-body strong {
  display: block;
  font-family: "Syne", sans-serif;
  margin-bottom: 0.25rem;
}
.admin-wall-card-body p {
  margin: 0 0 0.45rem;
  font-size: 0.86rem;
  line-height: 1.35;
  opacity: 0.8;
}
.admin-wall-card-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.78rem;
  margin-bottom: 0.55rem;
}
.admin-wall-pill {
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(26, 37, 64, 0.08);
}
.admin-wall-card-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
/* Wallpaper editor: keep preview on screen; tools scroll on their own */
.admin-main:has(> .admin-wall-editor) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 1rem;
}
.admin-main:has(> .admin-wall-editor) > .admin-head {
  flex: 0 0 auto;
  margin-bottom: 0.75rem;
}
.admin-wall-editor {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.9fr);
  gap: 1.25rem;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.admin-wall-stage-wrap {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
  overscroll-behavior: contain;
}
.admin-wall-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
  flex: 0 0 auto;
  align-items: center;
}
.admin-wall-tabs-sep {
  width: 1px;
  height: 1.4rem;
  margin: 0 0.15rem;
  background: rgba(26, 37, 64, 0.18);
  flex: 0 0 auto;
}
html.mode-dark .admin-wall-tabs-sep,
body.mode-dark .admin-wall-tabs-sep {
  background: rgba(255, 255, 255, 0.18);
}
.admin-wall-stage {
  position: relative;
  width: 100%;
  min-height: 200px;
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  border-radius: 16px;
  overflow: hidden;
  background: #12161f;
  border: 1px solid rgba(26, 37, 64, 0.12);
  touch-action: none;
  user-select: none;
  padding: 0.5rem;
  box-sizing: border-box;
}
.admin-wall-img-wrap {
  position: relative;
  max-width: 100%;
  line-height: 0;
}
.admin-wall-img {
  display: block;
  max-width: 100%;
  max-height: min(58vh, 520px);
  width: auto;
  height: auto;
  pointer-events: none;
}
.admin-wall-drop {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.7);
  font-family: "Syne", sans-serif;
}
.admin-wall-dim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
  pointer-events: none;
}
.admin-wall-crop {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid #5a8cff;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.42);
  cursor: move;
  /* Visible so quote/author hit-boxes can leave the frame while editing;
     painted text still clips to the canvas / export size. */
  overflow: visible;
}
.admin-wall-crop::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.22);
  pointer-events: none;
  z-index: 0;
}
.admin-wall-crop[data-mode="phone"] {
  border-color: #4ecf8a;
}
.admin-wall-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.35);
}
.admin-wall-handle[data-handle="nw"] { left: -6px; top: -6px; cursor: nwse-resize; }
.admin-wall-handle[data-handle="ne"] { right: -6px; top: -6px; cursor: nesw-resize; }
.admin-wall-handle[data-handle="sw"] { left: -6px; bottom: -6px; cursor: nesw-resize; }
.admin-wall-handle[data-handle="se"] { right: -6px; bottom: -6px; cursor: nwse-resize; }
.admin-wall-quote-box,
.admin-wall-author-box {
  position: absolute;
  color: #fff;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
  font-family: "Syne", sans-serif;
  cursor: grab;
  padding: 0;
  border: 1px dashed rgba(255, 255, 255, 0.55);
  background: rgba(0, 0, 0, 0.12);
  box-sizing: border-box;
  overflow: hidden;
  z-index: 2;
  white-space: pre-wrap;
}
.admin-wall-text-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  /* Clip painted text to the wallpaper frame (WYSIWYG with download). */
  overflow: hidden;
}
.admin-wall-quote-box.is-hit-only,
.admin-wall-author-box.is-hit-only {
  color: transparent;
  text-shadow: none;
  background: rgba(90, 140, 255, 0.08);
  font-size: 0;
  line-height: 0;
}
.admin-wall-quote-box {
  font-weight: 600;
  min-height: 8%;
}
.admin-wall-author-box {
  font-weight: 700;
  min-height: 5%;
}
.admin-wall-style {
  margin: 0.75rem 0 0.35rem;
  padding: 0.65rem 0.75rem 0.75rem;
  border: 1px solid rgba(26, 37, 64, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.4);
}
.admin-wall-style legend {
  padding: 0 0.35rem;
  font-family: "Syne", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
}
.admin-wall-style-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: center;
  margin-top: 0.35rem;
}
.admin-wall-style-row select {
  margin-top: 0.2rem;
  min-width: 7rem;
}
.admin-wall-scale {
  display: grid;
  gap: 0.35rem;
}
.admin-wall-color {
  display: grid;
  gap: 0.35rem;
}
.admin-wall-color input[type="color"] {
  width: 3.2rem;
  height: 2.2rem;
  padding: 0;
  border: 1px solid rgba(26, 37, 64, 0.18);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}
.admin-wall-scale em {
  font-style: normal;
  opacity: 0.7;
  margin-left: 0.35rem;
}
.admin-wall-scale input[type="range"] {
  width: 100%;
}
.admin-wall-stage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.7rem;
  flex: 0 0 auto;
}
.admin-wall-file-btn { cursor: pointer; }
.admin-wall-form {
  display: grid;
  gap: 0.7rem;
  align-content: start;
  padding: 0.9rem;
  border-radius: 16px;
  border: 1px solid rgba(26, 37, 64, 0.1);
  background: rgba(255, 255, 255, 0.5);
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}
.admin-wall-copy-text {
  justify-self: start;
}
.admin-wall-surface-hint {
  margin: 0;
  font-size: 0.82rem;
  opacity: 0.75;
}
.admin-wall-form label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.82rem;
}
.admin-wall-form input[type="text"],
.admin-wall-form input[type="number"],
.admin-wall-form textarea {
  width: 100%;
  box-sizing: border-box;
  border-radius: 10px;
  border: 1px solid rgba(26, 37, 64, 0.14);
  padding: 0.55rem 0.65rem;
  font: inherit;
  background: rgba(255, 255, 255, 0.85);
}
.admin-wall-check {
  display: flex !important;
  align-items: center;
  gap: 0.45rem;
  grid-template-columns: none !important;
}
.admin-wall-form-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.25rem;
}
.admin-wall-status {
  font-size: 0.82rem;
  opacity: 0.75;
}
html.mode-dark .admin-wall-card,
html.mode-dark .admin-wall-form,
body.mode-dark .admin-wall-card,
body.mode-dark .admin-wall-form {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}
html.mode-dark .admin-wall-form input,
html.mode-dark .admin-wall-form textarea,
body.mode-dark .admin-wall-form input,
body.mode-dark .admin-wall-form textarea {
  background: rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 255, 255, 0.14);
  color: inherit;
}
@media (max-width: 980px) {
  .admin-wall-editor {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }
  .admin-wall-stage-wrap {
    max-height: 42vh;
  }
  .admin-wall-img {
    max-height: min(36vh, 320px);
  }
}
