/* ==========================================================================
   2027 Spatial Year Matrix — Dala-Inspired Obsidian Design System
   ========================================================================== */

:root {
  --bg-black: #000000;
  --bg-black-light: #070707;
  --border-hairline: hsla(0, 0%, 100%, 0.1);
  --border-subtle: hsla(0, 0%, 100%, 0.16);

  --t-white: #ffffff;
  --t-grey-light: #e9e9e9;
  --t-grey-muted: #bdbdbd;
  --t-grey-dim: #9a9a9a;

  --accent-violet: #8052ff;
  --accent-amber: #ffb829;
  --accent-teal: #189b81;
  --accent-lavender: #ecd6ff;
  --bg-glow-1: rgba(128, 82, 255, 0.09);
  --bg-glow-2: rgba(24, 155, 129, 0.035);

  --font-display: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-geo: "Space Grotesk", "DM Sans", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
  --header-height: 76px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-black);
  color: var(--t-white);
  font-family: var(--font-display);
  line-height: 1.15;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scrollbar-width: none;
}

body::-webkit-scrollbar {
  display: none;
}

button, input, textarea {
  font-family: inherit;
  color: inherit;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Brief Obsidian Preloader
   -------------------------------------------------------------------------- */
.site-loader {
  position: fixed;
  inset: 0;
  z-index: 10100;
  background: var(--bg-black);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.65s var(--ease-out-expo), visibility 0.65s;
}

body:not(.is-loading) .site-loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.site-loader__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.site-loader__prism {
  animation: loaderSpin 2.6s linear infinite;
}

.site-loader__label {
  font-family: var(--font-geo);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--t-grey-muted);
}

@keyframes loaderSpin {
  0% { transform: rotate(0deg) scale(0.96); }
  50% { transform: rotate(180deg) scale(1.06); }
  100% { transform: rotate(360deg) scale(0.96); }
}

/* --------------------------------------------------------------------------
   Fixed Full-Bleed WebGL Canvas & Projected Month Labels
   -------------------------------------------------------------------------- */
.canvas-stage {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: radial-gradient(circle at 50% 48%, var(--bg-glow-1) 0%, var(--bg-glow-2) 36%, #000000 72%);
  transition: background 0.6s ease;
}

#webglCanvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.month-labels-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.45s var(--ease-out-expo);
}

.month-labels-layer.is-visible {
  opacity: 1;
}

.month-label {
  position: absolute;
  transform: translate(-50%, -100%);
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  user-select: none;
  transition: opacity 0.3s ease;
}

.month-label__num {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--accent-amber);
  opacity: 0.78;
  transition: color 0.35s ease, opacity 0.25s ease;
}

.month-label__name {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.76);
  transition: color 0.25s ease, opacity 0.25s ease;
}

.month-label__count {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.42);
  transition: color 0.25s ease, opacity 0.25s ease;
}

.month-gear-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  margin-left: 2px;
  border-radius: 50%;
  border: 1px solid hsla(0, 0%, 100%, 0.09);
  background: rgba(255, 255, 255, 0.025);
  color: rgba(255, 255, 255, 0.44);
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease, background-color 0.25s ease, transform 0.25s var(--ease-out-expo), opacity 0.25s ease;
}

.month-gear-btn:hover {
  color: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 184, 41, 0.48);
  background: rgba(255, 184, 41, 0.12);
  transform: rotate(35deg) scale(1.08);
}

.month-label.is-past-month .month-label__num {
  color: rgba(255, 255, 255, 0.26);
}

.month-label.is-past-month .month-label__name {
  color: rgba(255, 255, 255, 0.30);
}

.month-label.is-past-month .month-label__count {
  color: rgba(255, 255, 255, 0.20);
}

.month-label.is-past-month .month-gear-btn {
  border-color: hsla(0, 0%, 100%, 0.05);
  background: rgba(255, 255, 255, 0.014);
  color: rgba(255, 255, 255, 0.22);
}

.month-label.is-past-month .month-gear-btn:hover {
  color: rgba(255, 255, 255, 0.88);
  border-color: rgba(255, 184, 41, 0.45);
  background: rgba(255, 184, 41, 0.12);
}

/* --------------------------------------------------------------------------
   Minimalist Header Chrome
   -------------------------------------------------------------------------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 1000;
  padding: env(safe-area-inset-top, 0px) clamp(18px, 3.6vw, 56px) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.56) 0%, rgba(0, 0, 0, 0.18) 60%, rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
}

.header > * {
  pointer-events: auto;
}

.header__left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-control {
  position: relative;
}

.theme-trigger-btn {
  padding: 0;
}

.theme-trigger-dots {
  display: grid;
  grid-template-columns: repeat(2, 4px);
  gap: 2.5px;
}

.theme-trigger-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  opacity: 0.78;
  transition: transform 0.25s ease, opacity 0.25s ease, background-color 0.3s ease;
}

.theme-trigger-btn:hover .theme-trigger-dot {
  opacity: 1;
}

.theme-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(284px, calc(100vw - 24px));
  padding: 12px;
  border-radius: 16px;
  border: 1px solid hsla(0, 0%, 100%, 0.09);
  background: rgba(8, 8, 12, 0.88);
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.78);
  z-index: 1100;
  transform-origin: top right;
  animation: themePopIn 0.22s var(--ease-out-expo);
}

@keyframes themePopIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.theme-popover__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 9px;
  margin-bottom: 9px;
  border-bottom: 1px solid hsla(0, 0%, 100%, 0.06);
}

.theme-popover__title {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.42);
}

.theme-popover__active {
  font-size: 0.66rem;
  color: rgba(255, 255, 255, 0.78);
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 10px;
  border: 1px solid hsla(0, 0%, 100%, 0.055);
  background: rgba(255, 255, 255, 0.018);
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.71rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.theme-option:hover {
  border-color: hsla(0, 0%, 100%, 0.15);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(255, 255, 255, 0.90);
}

.theme-option.is-active {
  border-color: hsla(0, 0%, 100%, 0.22);
  background: rgba(255, 255, 255, 0.075);
  color: rgba(255, 255, 255, 0.94);
}

.theme-option__swatches {
  display: inline-grid;
  grid-template-columns: repeat(2, 5px);
  gap: 2px;
  flex-shrink: 0;
}

.theme-option__swatch {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.theme-option__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.year-switcher {
  display: inline-flex;
  align-items: center;
  height: 32px;
  gap: 1px;
  padding: 2px;
  border-radius: 999px;
  border: 1px solid hsla(0, 0%, 100%, 0.07);
  background: rgba(255, 255, 255, 0.022);
  backdrop-filter: blur(10px);
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.year-switcher:hover {
  border-color: hsla(0, 0%, 100%, 0.13);
  background: rgba(255, 255, 255, 0.036);
}

.year-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 26px;
  padding: 0 9px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: color 0.25s ease, background-color 0.25s ease, transform 0.25s var(--ease-out-expo);
}

.year-nav-btn:hover:not(:disabled) {
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.055);
}

.year-nav-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.year-active-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  padding: 0 11px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: color 0.25s ease, background-color 0.25s ease;
}

.year-active-pill:hover {
  color: var(--t-white);
  background: rgba(255, 255, 255, 0.09);
}

.year-switcher__divider {
  width: 1px;
  height: 11px;
  background: hsla(0, 0%, 100%, 0.07);
}

.nav-quiet-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid hsla(0, 0%, 100%, 0.07);
  background: rgba(255, 255, 255, 0.022);
  backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.54);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease, background-color 0.25s ease, transform 0.25s var(--ease-out-expo);
}

.nav-quiet-btn:hover {
  color: rgba(255, 255, 255, 0.90);
  border-color: hsla(0, 0%, 100%, 0.16);
  background: rgba(255, 255, 255, 0.055);
}

.nav-quiet-btn--today:hover {
  border-color: rgba(128, 82, 255, 0.42);
  background: rgba(128, 82, 255, 0.09);
}

.nav-quiet-btn:active {
  transform: scale(0.97);
}

.side-year-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 400;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 11px;
  border-radius: 999px;
  border: 1px solid hsla(0, 0%, 100%, 0.055);
  background: rgba(255, 255, 255, 0.018);
  backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.44);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, color 0.25s ease, border-color 0.25s ease, background-color 0.25s ease, transform 0.3s var(--ease-out-expo);
}

.side-year-btn.is-visible {
  opacity: 0.42;
  pointer-events: auto;
}

.side-year-btn.is-visible:hover:not(:disabled) {
  opacity: 0.92;
  color: rgba(255, 255, 255, 0.9);
  border-color: hsla(0, 0%, 100%, 0.16);
  background: rgba(255, 255, 255, 0.05);
}

.side-year-btn:disabled {
  opacity: 0 !important;
  pointer-events: none !important;
}

.side-year-btn--prev {
  left: clamp(12px, 1.8vw, 24px);
}

.side-year-btn--prev.is-visible:hover:not(:disabled) {
  transform: translate(-3px, -50%);
}

.side-year-btn--next {
  right: clamp(46px, 4.4vw, 68px);
}

.side-year-btn--next.is-visible:hover:not(:disabled) {
  transform: translate(3px, -50%);
}

.side-year-btn__label {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}

/* Pill CTA Buttons */
.btn-pill {
  border: 0;
  border-radius: 1.875rem;
  padding: 12px 20px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.35s var(--ease-out-expo), background-color 0.35s ease, box-shadow 0.35s ease;
}

.btn-pill--violet {
  background-color: var(--accent-violet);
  color: var(--t-white);
  box-shadow: 0 0 24px rgba(128, 82, 255, 0.28);
}

.btn-pill--violet:hover {
  background-color: var(--accent-teal);
  box-shadow: 0 0 28px rgba(24, 155, 129, 0.36);
  transform: translateY(-1px);
}

.btn-pill--violet:active {
  transform: translateY(0) scale(0.98);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 1.875rem;
  padding: 11px 18px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--t-grey-muted);
  cursor: pointer;
  transition: border-color 0.3s ease, color 0.3s ease;
}

.btn-ghost:hover {
  border-color: var(--t-white);
  color: var(--t-white);
}

/* --------------------------------------------------------------------------
   Icon-Only Down Chevron Cue & 2-Stage Minimal Dots
   -------------------------------------------------------------------------- */
.hero-chevron-btn {
  position: fixed;
  left: 50%;
  bottom: max(26px, env(safe-area-inset-bottom, 26px));
  transform: translateX(-50%);
  z-index: 400;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: rgba(10, 10, 14, 0.55);
  backdrop-filter: blur(10px);
  color: var(--t-grey-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s var(--ease-out-expo), border-color 0.3s ease, color 0.3s ease;
  animation: chevronFloat 2.4s ease-in-out infinite;
}

.hero-chevron-btn.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.hero-chevron-btn:hover {
  border-color: var(--accent-amber);
  color: var(--t-white);
}

@keyframes chevronFloat {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 6px); }
}

.stage-dots {
  position: fixed;
  right: clamp(12px, 1.8vw, 24px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 650;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: opacity 0.35s ease;
}

body.is-detail-open .stage-dots {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.stage-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid hsla(0, 0%, 100%, 0.14);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: transform 0.35s var(--ease-out-expo), background-color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.stage-dot:hover {
  border-color: hsla(0, 0%, 100%, 0.42);
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.2);
}

.stage-dot.is-active {
  background: rgba(255, 255, 255, 0.56);
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 8px rgba(128, 82, 255, 0.20);
  transform: scale(1.18);
}

/* --------------------------------------------------------------------------
   Matrix Bottom HUD Dock
   -------------------------------------------------------------------------- */
.matrix-hud {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom, 18px));
  transform: translate(-50%, 24px);
  z-index: 600;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid hsla(0, 0%, 100%, 0.07);
  background: rgba(255, 255, 255, 0.022);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.52);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s var(--ease-out-expo), transform 0.45s var(--ease-out-expo), border-color 0.25s ease;
  max-width: calc(100vw - 24px);
}

.matrix-hud:hover {
  border-color: hsla(0, 0%, 100%, 0.11);
}

.matrix-hud.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

body.is-detail-open .matrix-hud {
  opacity: 0 !important;
  transform: translate(-50%, 24px) !important;
  pointer-events: none !important;
}

.matrix-hud__group {
  display: flex;
  align-items: center;
  gap: 11px;
}

.matrix-hud__legend {
  font-size: 0.71rem;
  color: rgba(255, 255, 255, 0.46);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.legend-item strong {
  color: rgba(255, 255, 255, 0.76);
  font-weight: 500;
}

.legend-tri {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
}

.legend-tri--bright {
  border-bottom: 9px solid var(--accent-violet);
  opacity: 0.78;
}

.legend-tri--closed {
  border-bottom: 9px solid #454a56;
  opacity: 0.75;
}

.legend-tri--future {
  border-bottom: 9px solid #737b8c;
  opacity: 0.78;
}

.legend-divider {
  width: 1px;
  height: 14px;
  background: hsla(0, 0%, 100%, 0.065);
}

.matrix-hud__today {
  padding: 0 12px;
  border-left: 1px solid hsla(0, 0%, 100%, 0.065);
  border-right: 1px solid hsla(0, 0%, 100%, 0.065);
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  font-size: 0.69rem;
  color: rgba(255, 255, 255, 0.72);
}

.eyebrow-inline {
  font-size: 0.59rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent-amber);
  opacity: 0.72;
}

.matrix-hud__modes {
  gap: 5px;
}

.mode-chip {
  background: transparent;
  border: 1px solid hsla(0, 0%, 100%, 0.065);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 0.63rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.42);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.mode-chip:hover {
  color: rgba(255, 255, 255, 0.86);
  border-color: hsla(0, 0%, 100%, 0.14);
  background: rgba(255, 255, 255, 0.04);
}

.mode-chip.is-active {
  background: rgba(255, 255, 255, 0.075);
  border-color: hsla(0, 0%, 100%, 0.16);
  color: rgba(255, 255, 255, 0.88);
}

/* --------------------------------------------------------------------------
   Hover Tooltip
   -------------------------------------------------------------------------- */
.tri-tooltip {
  position: fixed;
  z-index: 800;
  pointer-events: none;
  min-width: 224px;
  padding: 12px 15px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: rgba(8, 8, 12, 0.92);
  backdrop-filter: blur(14px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.68);
  opacity: 0;
  transform: translate(14px, -50%) scale(0.96);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.tri-tooltip.is-visible {
  opacity: 1;
  transform: translate(14px, -50%) scale(1);
}

.tri-tooltip__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.tri-tooltip__badge {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(128, 82, 255, 0.24);
  color: var(--accent-lavender);
}

.tri-tooltip.is-future .tri-tooltip__badge {
  background: rgba(255, 255, 255, 0.08);
  color: var(--t-grey-dim);
}

.tri-tooltip__daynum {
  font-size: 0.66rem;
  color: var(--accent-amber);
}

.tri-tooltip__date {
  font-size: 0.96rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--t-white);
  margin-bottom: 4px;
}

.tri-tooltip__metrics {
  font-size: 0.7rem;
  color: var(--t-grey-muted);
}

/* --------------------------------------------------------------------------
   Split Detail View (Left: Zoomed 3D Triangle, Right: Day Telemetry)
   -------------------------------------------------------------------------- */
.detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: grid;
  grid-template-columns: 1fr 1fr;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s var(--ease-out-expo), visibility 0.5s;
}

.detail-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.detail-left-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--header-height) + 18px) clamp(20px, 4vw, 56px) 36px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.detail-left-zone:active {
  cursor: grabbing;
}

.detail-back-pill {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(10, 10, 14, 0.74);
  backdrop-filter: blur(12px);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--t-white);
  cursor: pointer;
  transition: border-color 0.3s ease, background-color 0.3s ease, transform 0.3s var(--ease-out-expo);
}

.detail-back-pill:hover {
  border-color: var(--accent-violet);
  background: rgba(128, 82, 255, 0.22);
  transform: translateX(-2px);
}

.detail-back-pill kbd {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--t-grey-muted);
}

.detail-left-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  pointer-events: none;
}

.detail-left-meta__tag {
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  color: var(--accent-amber);
}

.detail-left-meta__hint {
  font-size: 0.78rem;
  color: var(--t-grey-dim);
}

/* Right Side Panel */
.detail-right-panel {
  position: relative;
  display: flex;
  align-items: center;
  padding: calc(var(--header-height) + 12px) clamp(24px, 4.5vw, 72px) 28px clamp(16px, 2.5vw, 40px);
  background: linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.78) 14%, rgba(5, 5, 8, 0.95) 40%);
  transform: translateX(48px);
  opacity: 0;
  transition: transform 0.6s var(--ease-out-expo), opacity 0.55s ease;
}

.detail-overlay.is-open .detail-right-panel {
  transform: translateX(0);
  opacity: 1;
}

.detail-panel__scroll {
  width: 100%;
  max-width: 580px;
  max-height: calc(100dvh - var(--header-height) - 44px);
  overflow-y: auto;
  padding-right: 4px;
  touch-action: pan-y;
  scrollbar-width: none;
}

.detail-panel__scroll::-webkit-scrollbar {
  display: none;
}

.detail-panel__header {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-hairline);
  margin-bottom: 20px;
}

.detail-eyebrow-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.eyebrow {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-amber);
}

.eyebrow--muted {
  color: var(--t-grey-dim);
}

.detail-overlay.is-future .detail-eyebrow-row .eyebrow {
  color: var(--t-grey-dim);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-violet);
  box-shadow: 0 0 14px var(--accent-violet);
}

.detail-overlay.is-future .status-dot {
  background: #646975;
  box-shadow: none;
}

.detail-date {
  margin: 0 0 8px;
  font-size: clamp(1.85rem, 3.5vw, 3.25rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--t-white);
}

.detail-weekday {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 300;
  color: var(--t-grey-muted);
}

/* 4 Metric Cards */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric-card {
  padding: 15px 17px;
  border-radius: 16px;
  background: rgba(18, 18, 24, 0.74);
  border: 1px solid var(--border-hairline);
  transition: border-color 0.3s ease, transform 0.3s var(--ease-out-expo);
}

.metric-card:hover {
  border-color: var(--border-subtle);
  transform: translateY(-2px);
}

.metric-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.metric-card__label {
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  color: var(--t-grey-dim);
}

.metric-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.88;
}

.metric-card--violet .metric-card__icon { color: var(--accent-violet); }
.metric-card--amber .metric-card__icon { color: var(--accent-amber); }
.metric-card--lavender .metric-card__icon { color: var(--accent-lavender); }
.metric-card--teal .metric-card__icon { color: var(--accent-teal); }

.metric-card__value-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 10px;
}

.metric-card__value {
  font-size: clamp(1.45rem, 2.2vw, 1.95rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--t-white);
}

.metric-card__unit {
  font-size: 0.82rem;
  color: var(--t-grey-dim);
}

.metric-card__bar {
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 10px;
}

.metric-card__bar-fill {
  height: 100%;
  width: 50%;
  border-radius: 999px;
  transition: width 0.6s var(--ease-out-expo);
}

.metric-card--violet .metric-card__bar-fill { background: linear-gradient(90deg, var(--accent-violet), var(--accent-lavender)); }
.metric-card--amber .metric-card__bar-fill { background: linear-gradient(90deg, var(--accent-amber), #ffd778); }
.metric-card--lavender .metric-card__bar-fill { background: linear-gradient(90deg, #b88cff, var(--accent-amber)); }
.metric-card--teal .metric-card__bar-fill { background: linear-gradient(90deg, var(--accent-teal), #4be3c4); }

.detail-overlay.is-future .metric-card__bar-fill {
  background: #5b606b;
  opacity: 0.55;
}

.metric-card__sub {
  margin: 0;
  font-size: 0.77rem;
  font-weight: 300;
  line-height: 1.4;
  color: var(--t-grey-muted);
}

/* Note Block */
.detail-note-block {
  padding: 15px 0 18px;
  border-top: 1px solid var(--border-hairline);
  border-bottom: 1px solid var(--border-hairline);
  margin-bottom: 18px;
}

.detail-note-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.inline-edit-trigger {
  background: transparent;
  border: 0;
  padding: 2px 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-amber);
  cursor: pointer;
  position: relative;
}

.inline-edit-trigger::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--accent-amber);
  transition: width 0.45s var(--ease-out-expo);
}

.inline-edit-trigger:hover::after {
  width: 100%;
}

.detail-note-text {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 300;
  line-height: 1.55;
  color: var(--t-grey-light);
}

/* Edit Form */
.edit-form {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  background: rgba(16, 16, 22, 0.92);
  margin-bottom: 18px;
}

.edit-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.edit-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--t-grey-muted);
}

.edit-field input,
.edit-field textarea {
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.65);
  font-size: 0.88rem;
  color: var(--t-white);
  outline: none;
  transition: border-color 0.25s ease;
}

.edit-field input:focus,
.edit-field textarea:focus {
  border-color: var(--accent-violet);
}

.edit-field--full {
  margin-bottom: 14px;
}

.edit-form__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Dala Circular Arrow Footer */
.detail-panel__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.day-nav-circles {
  display: flex;
  align-items: center;
  gap: 10px;
}

.circle-arrow-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: var(--accent-violet);
  color: var(--t-white);
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s var(--ease-out-expo);
}

.circle-arrow-btn:hover {
  background: var(--accent-teal);
  transform: scale(1.06);
}

.circle-arrow-btn:disabled {
  opacity: 0.32;
  cursor: not-allowed;
  transform: none;
}

.day-nav-label {
  font-size: 0.78rem;
  color: var(--t-grey-dim);
  margin-left: 4px;
}

.inline-gold-link {
  background: transparent;
  border: 0;
  padding: 4px 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-amber);
  cursor: pointer;
  position: relative;
}

.inline-gold-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--accent-amber);
  transition: width 0.5s var(--ease-out-expo);
}

.inline-gold-link:hover::after {
  width: 100%;
}

/* --------------------------------------------------------------------------
   Authenticated Header Controls
   -------------------------------------------------------------------------- */
[hidden] {
  display: none !important;
}

.header-user-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid hsla(0, 0%, 100%, 0.07);
  background: rgba(255, 255, 255, 0.022);
  backdrop-filter: blur(10px);
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.58);
  cursor: pointer;
  transition: border-color 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}

.user-chip:hover {
  color: rgba(255, 255, 255, 0.90);
  border-color: hsla(0, 0%, 100%, 0.16);
  background: rgba(255, 255, 255, 0.055);
}

.user-chip__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(24, 155, 129, 0.72);
  transition: box-shadow 0.25s ease, background-color 0.25s ease;
}

.user-chip:hover .user-chip__dot {
  background: var(--accent-teal);
  box-shadow: 0 0 8px rgba(24, 155, 129, 0.65);
}

.user-chip__gear {
  color: rgba(255, 255, 255, 0.34);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.25s ease;
}

.user-chip:hover .user-chip__gear {
  color: rgba(255, 255, 255, 0.75);
}

.icon-circle-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid hsla(0, 0%, 100%, 0.07);
  background: rgba(255, 255, 255, 0.022);
  backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.48);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease, background-color 0.25s ease;
}

.icon-circle-btn:hover {
  border-color: rgba(255, 184, 41, 0.35);
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 184, 41, 0.07);
}

body.is-auth-open .hero-chevron-btn {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* --------------------------------------------------------------------------
   Dala-Inspired Obsidian Login / Register Overlay
   -------------------------------------------------------------------------- */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-height) + 12px) 20px 28px;
  background: radial-gradient(circle at 50% 45%, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.82) 75%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.65s var(--ease-out-expo), visibility 0.65s;
}

.auth-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.auth-back-pill {
  position: fixed;
  top: calc(var(--header-height) + 12px);
  left: clamp(18px, 3.6vw, 56px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(10, 10, 15, 0.72);
  backdrop-filter: blur(12px);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--t-grey-muted);
  cursor: pointer;
  transition: border-color 0.3s ease, color 0.3s ease, transform 0.3s var(--ease-out-expo);
}

.auth-back-pill:hover {
  border-color: var(--accent-amber);
  color: var(--t-white);
  transform: translateX(-2px);
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 430px;
  max-height: calc(100dvh - var(--header-height) - 56px);
  overflow-y: auto;
  scrollbar-width: none;
  padding: 28px 28px 26px;
  border-radius: 24px;
  border: 1px solid var(--border-subtle);
  background: rgba(8, 8, 12, 0.84);
  backdrop-filter: blur(26px);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.85), inset 0 1px 0 hsla(0, 0%, 100%, 0.08);
  transform: translateY(28px) scale(0.97);
  transition: transform 0.65s var(--ease-out-expo);
}

.auth-card::-webkit-scrollbar {
  display: none;
}

.auth-overlay.is-open .auth-card {
  transform: translateY(0) scale(1);
}

.auth-card__glow {
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-amber), var(--accent-violet), var(--accent-teal), transparent);
  opacity: 0.85;
}

.auth-card__emblem {
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
}

.auth-card__emblem svg {
  animation: emblemFloat 6s ease-in-out infinite;
}

@keyframes emblemFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(6deg); }
}

.auth-card__eyebrow {
  margin: 0 0 6px;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--accent-amber);
}

.auth-card__title {
  margin: 0 0 20px;
  text-align: center;
  font-size: 1.65rem;
  font-weight: 400;
  letter-spacing: -0.03em;
  color: var(--t-white);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-hairline);
  margin-bottom: 18px;
}

.auth-tab {
  border: 0;
  border-radius: 999px;
  padding: 9px 12px;
  background: transparent;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  color: var(--t-grey-dim);
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.auth-tab.is-active {
  background: var(--accent-violet);
  color: var(--t-white);
  box-shadow: 0 4px 16px rgba(128, 82, 255, 0.35);
}

.auth-error {
  margin-bottom: 14px;
  padding: 10px 13px;
  border-radius: 12px;
  border: 1px solid rgba(255, 108, 108, 0.35);
  background: rgba(255, 72, 72, 0.12);
  font-size: 0.8rem;
  line-height: 1.4;
  color: #ffb4b4;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field span {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--t-grey-dim);
}

.auth-field input {
  width: 100%;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.62);
  font-size: 0.92rem;
  color: var(--t-white);
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.auth-field input:focus {
  border-color: var(--accent-violet);
  box-shadow: 0 0 0 3px rgba(128, 82, 255, 0.16);
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 42px;
}

.pw-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  padding: 6px;
  color: var(--t-grey-muted);
  opacity: 0.65;
  cursor: pointer;
}

.pw-toggle:hover {
  opacity: 1;
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
  padding: 13px 20px;
}

/* --------------------------------------------------------------------------
   Sport Preset Chips & Settings Modal
   -------------------------------------------------------------------------- */
.sport-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.sport-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.72rem;
  color: var(--t-grey-light);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.sport-chip:hover,
.sport-chip.is-active {
  border-color: var(--accent-teal);
  background: rgba(24, 155, 129, 0.18);
  color: var(--t-white);
}

.sport-chip__remove {
  opacity: 0.6;
  font-size: 0.78rem;
  line-height: 1;
}

.sport-chip:hover .sport-chip__remove {
  opacity: 1;
  color: #ff9c9c;
}

.btn-danger-link {
  margin-left: auto;
  background: transparent;
  border: 0;
  font-size: 0.76rem;
  font-weight: 600;
  color: #ff8e8e;
  cursor: pointer;
}

.btn-danger-link:hover {
  text-decoration: underline;
}

.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-out-expo), visibility 0.4s;
}

.settings-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.settings-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
}

.settings-modal {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  scrollbar-width: none;
  padding: 24px 26px;
  border-radius: 22px;
  border: 1px solid var(--border-subtle);
  background: rgba(9, 9, 14, 0.94);
  backdrop-filter: blur(24px);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.85);
}

.settings-modal::-webkit-scrollbar {
  display: none;
}

.settings-modal--compact {
  max-width: 440px;
}

.settings-hint-box {
  margin: 0 0 16px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-hairline);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.8rem;
  font-weight: 300;
  line-height: 1.45;
  color: var(--t-grey-muted);
}

.settings-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.settings-modal__title {
  margin: 4px 0 0;
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.03em;
}

.settings-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-hairline);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.settings-tab {
  border: 1px solid var(--border-hairline);
  border-radius: 999px;
  padding: 7px 14px;
  background: transparent;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--t-grey-dim);
  cursor: pointer;
  transition: all 0.2s ease;
}

.settings-tab.is-active {
  background: rgba(128, 82, 255, 0.22);
  border-color: var(--accent-violet);
  color: var(--t-white);
}

.settings-status {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(24, 155, 129, 0.45);
  background: rgba(24, 155, 129, 0.14);
  font-size: 0.8rem;
  color: #a9f5e4;
}

.settings-status.is-error {
  border-color: rgba(255, 108, 108, 0.45);
  background: rgba(255, 72, 72, 0.14);
  color: #ffb4b4;
}

.inline-add-row {
  display: flex;
  gap: 8px;
}

.inline-add-row input {
  flex: 1;
}

.settings-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.tg-status-card {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border-hairline);
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 16px;
}

.tg-status-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.tg-badge {
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--t-grey-muted);
}

.tg-badge.is-linked {
  background: rgba(24, 155, 129, 0.25);
  color: #6df3d7;
}

.tg-status-card__desc {
  margin: 0 0 12px;
  font-size: 0.8rem;
  font-weight: 300;
  line-height: 1.45;
  color: var(--t-grey-muted);
}

.tg-code-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.58);
  border: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.tg-code-box code {
  font-size: 0.85rem;
  color: var(--accent-amber);
}

.tg-code-box__btns {
  display: flex;
  gap: 6px;
}

.tg-code-box__btns .btn-ghost {
  padding: 6px 11px;
  font-size: 0.72rem;
}

.tg-notify-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-hairline);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
}

.toggle-row strong {
  display: block;
  font-size: 0.86rem;
  margin-bottom: 3px;
}

.toggle-row small {
  display: block;
  font-size: 0.74rem;
  color: var(--t-grey-dim);
}

.toggle-switch {
  -webkit-appearance: none;
  appearance: none;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.25s ease;
}

.toggle-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--t-white);
  transition: transform 0.25s var(--ease-out-expo);
}

.toggle-switch:checked {
  background: var(--accent-teal);
}

.toggle-switch:checked::after {
  transform: translateX(20px);
}

/* --------------------------------------------------------------------------
   Responsive Breakpoints: iPad Air 11" (820x1180) & iPhone 16 Pro (393x852)
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .matrix-hud {
    flex-wrap: wrap;
    justify-content: center;
    border-radius: 20px;
    padding: 10px 16px;
    gap: 10px 14px;
  }

  .matrix-hud__today {
    border: 0;
    padding: 0;
  }

  .detail-overlay {
    grid-template-columns: 1fr;
    grid-template-rows: 34dvh 66dvh;
  }

  .detail-left-zone {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    padding: calc(var(--header-height) + 6px) 20px 8px;
  }

  .detail-left-meta {
    align-items: flex-end;
    text-align: right;
    padding-top: 4px;
  }

  .detail-right-panel {
    padding: 14px 24px max(22px, env(safe-area-inset-bottom, 22px));
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(4, 4, 7, 0.96) 10%);
    align-items: flex-start;
    transform: translateY(36px);
  }

  .detail-overlay.is-open .detail-right-panel {
    transform: translateY(0);
  }

  .detail-panel__scroll {
    max-width: 100%;
    max-height: calc(66dvh - 30px);
  }
}

@media (max-width: 600px) {
  :root {
    --header-height: 62px;
  }

  .btn-pill {
    padding: 10px 15px;
    font-size: 0.72rem;
  }

  .brand__name {
    font-size: 1.15rem;
  }

  .brand__tag {
    display: none;
  }

  .stage-dots {
    right: 8px;
    gap: 10px;
  }

  .month-label {
    gap: 4px;
  }

  .month-label__num {
    font-size: 0.56rem;
  }

  .month-label__name {
    font-size: 0.58rem;
    letter-spacing: 0.06em;
  }

  .month-label__count {
    display: none;
  }

  .matrix-hud {
    width: calc(100vw - 20px);
    bottom: max(10px, env(safe-area-inset-bottom, 10px));
    border-radius: 18px;
    padding: 9px 12px;
    gap: 8px 10px;
  }

  .matrix-hud__legend {
    font-size: 0.7rem;
    gap: 8px;
  }

  .matrix-hud__today {
    font-size: 0.68rem;
    gap: 5px;
  }

  .eyebrow-inline {
    display: inline;
    font-size: 0.58rem;
  }

  .month-gear-btn {
    width: 17px;
    height: 17px;
  }

  .mode-chip {
    padding: 5px 9px;
    font-size: 0.62rem;
  }

  .detail-overlay {
    grid-template-rows: 37dvh 63dvh;
  }

  .detail-left-zone {
    padding: calc(var(--header-height) + 4px) 14px 6px;
  }

  .detail-back-pill {
    padding: 7px 12px;
    font-size: 0.68rem;
  }

  .detail-back-pill kbd {
    display: none;
  }

  .detail-left-meta__tag {
    font-size: 0.6rem;
  }

  .detail-left-meta__hint {
    font-size: 0.64rem;
  }

  .detail-right-panel {
    padding: 10px 16px max(14px, env(safe-area-inset-bottom, 14px));
  }

  .detail-panel__scroll {
    max-height: calc(63dvh - 20px);
  }

  .detail-panel__header {
    padding-bottom: 10px;
    margin-bottom: 10px;
  }

  .detail-eyebrow-row {
    margin-bottom: 5px;
  }

  .eyebrow {
    font-size: 0.66rem;
  }

  .detail-date {
    font-size: 1.48rem;
    margin-bottom: 3px;
  }

  .detail-weekday {
    font-size: 0.78rem;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
  }

  .metric-card {
    padding: 9px 11px;
    border-radius: 12px;
  }

  .metric-card__head {
    margin-bottom: 4px;
  }

  .metric-card__label {
    font-size: 0.58rem;
  }

  .metric-card__value-row {
    margin-bottom: 6px;
  }

  .metric-card__value {
    font-size: 1.24rem;
  }

  .metric-card__bar {
    margin-bottom: 6px;
  }

  .metric-card__sub {
    font-size: 0.66rem;
    line-height: 1.3;
  }

  .detail-note-block {
    padding: 10px 0 11px;
    margin-bottom: 12px;
  }

  .detail-note-text {
    font-size: 0.84rem;
    line-height: 1.4;
  }

  .detail-panel__footer {
    gap: 8px;
  }

  .day-nav-label {
    font-size: 0.7rem;
  }

  .inline-gold-link {
    font-size: 0.72rem;
  }

  .edit-form__grid {
    grid-template-columns: 1fr;
  }

  .circle-arrow-btn {
    width: 34px;
    height: 34px;
    font-size: 0.95rem;
  }

  .tri-tooltip,
  .side-year-btn {
    display: none;
  }

  .header__left {
    gap: 8px;
  }

  .year-nav-btn {
    padding: 0 7px;
    font-size: 0.64rem;
  }

  .year-active-pill {
    padding: 0 9px;
    font-size: 0.68rem;
  }

  .nav-quiet-btn {
    height: 30px;
    padding: 0 10px;
    font-size: 0.62rem;
  }

  .header-user-bar {
    gap: 5px;
  }

  .user-chip {
    height: 30px;
    padding: 0 9px;
    font-size: 0.66rem;
    max-width: 112px;
  }

  .user-chip__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .icon-circle-btn {
    width: 30px;
    height: 30px;
  }

  .auth-back-pill {
    top: calc(var(--header-height) + 6px);
    left: 14px;
    padding: 7px 12px;
    font-size: 0.66rem;
  }

  .auth-card {
    padding: 22px 18px 20px;
    border-radius: 20px;
  }

  .auth-card__title {
    font-size: 1.4rem;
    margin-bottom: 16px;
  }

  .starter-picker__options {
    grid-template-columns: 1fr;
  }

  .settings-modal {
    padding: 18px 16px;
    border-radius: 18px;
  }
}
