:root {
  color-scheme: light;
  --ink: #18212f;
  --muted: #667085;
  --paper: #e9eef2;
  --surface: #ffffff;
  --surface-2: #eef2f6;
  --border: #d7dde7;
  --green: #2f8062;
  --green-soft: #e4f3ed;
  --coral: #d9573d;
  --coral-soft: #fae8e4;
  --blue: #3566d6;
  --blue-soft: #e7ecfb;
  --gold: #a97814;
  --shadow: 0 14px 36px rgba(24, 33, 47, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  overscroll-behavior-y: none;
  scroll-padding-top: var(--sticky-row-offset, 260px);
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0) 280px),
    linear-gradient(135deg, rgba(47, 128, 98, 0.055) 0 1px, transparent 1px 28px),
    linear-gradient(180deg, #e7edf2 0%, #f3f6f8 48%, #eaf1ed 100%);
  background-attachment: fixed;
  color: var(--ink);
  overscroll-behavior-y: none;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-panel {
  position: relative;
  overflow: hidden;
  width: min(440px, 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 0 0 24px;
}

.auth-panel .brand-row {
  position: relative;
  min-height: 148px;
  align-items: flex-end;
  overflow: hidden;
  padding: 24px;
}

.auth-panel .brand-row > div {
  position: relative;
  z-index: 2;
}

.auth-panel .brand-row::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  background:
    linear-gradient(90deg, rgba(24, 33, 47, 0.72), rgba(24, 33, 47, 0.34) 54%, rgba(24, 33, 47, 0.1)),
    linear-gradient(0deg, rgba(24, 33, 47, 0.26), rgba(24, 33, 47, 0));
}

.auth-panel .brand-title {
  color: white;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.26);
}

.auth-tagline {
  margin: 6px 0 0;
  color: #d7f1e7;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.2;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.24);
}

.brand-row,
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: block;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(24, 33, 47, 0.14);
}

.auth-panel .brand-mark {
  position: absolute;
  inset: -18% -24%;
  z-index: 0;
  width: 148%;
  height: 136%;
  border-radius: 0;
  box-shadow: none;
  object-position: center 62%;
  opacity: 1;
  pointer-events: none;
}

.brand-title {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.1;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-form,
.settings-form,
.week-form {
  display: grid;
  gap: 14px;
}

.auth-form {
  margin: 16px 24px 0;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin: 22px 24px 0;
  border-radius: 8px;
  background: var(--surface-2);
  padding: 4px;
}

.auth-panel > .message {
  margin: 14px 24px 0;
}

.auth-tab {
  min-height: 38px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
}

.auth-tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 5px rgba(24, 33, 47, 0.1);
}

.field {
  display: grid;
  gap: 6px;
}

.field span,
.field label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 9px 11px;
}

.field textarea {
  width: 100%;
  min-height: 240px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 11px;
  font: 0.82rem/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(53, 102, 214, 0.14);
  outline: 0;
}

.field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(53, 102, 214, 0.14);
  outline: 0;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  padding: 9px 13px;
  font-weight: 800;
}

.full-width {
  width: 100%;
}

.btn-primary {
  background: var(--green);
  color: white;
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--ink);
}

.btn-danger {
  background: var(--coral-soft);
  color: #a52c17;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
}

.btn .icon {
  width: 17px;
  height: 17px;
}

.message {
  margin-top: 14px;
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--blue-soft);
  color: #244a9f;
  font-weight: 650;
}

.message.error {
  background: var(--coral-soft);
  color: #9d2b18;
}

.toast-layer {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 50;
  display: grid;
  justify-items: end;
  gap: 8px;
  pointer-events: none;
}

.toast {
  max-width: min(360px, calc(100vw - 36px));
  border: 1px solid rgba(53, 102, 214, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  color: #244a9f;
  padding: 11px 13px;
  font-weight: 750;
  backdrop-filter: blur(12px);
  animation: toast-in 160ms ease-out;
}

.toast.error {
  border-color: rgba(217, 87, 61, 0.22);
  color: #9d2b18;
}

.confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 45;
  overflow: hidden;
  pointer-events: none;
}

.confetti-piece {
  position: absolute;
  top: var(--origin-y);
  left: var(--origin-x);
  display: block;
  opacity: 0;
  transform: translate3d(-50%, -50%, 0) rotate(0deg) scale(0.36);
  animation: confetti-burst var(--duration) cubic-bezier(0.18, 0.82, 0.18, 1) var(--delay) forwards;
}

.confetti-piece.ribbon {
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.28);
}

.confetti-piece.sparkle {
  border-radius: 999px;
  box-shadow:
    0 0 12px currentColor,
    0 0 24px rgba(255, 255, 255, 0.44);
}

.confetti-piece.firework-trail {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  box-shadow:
    0 0 14px currentColor,
    0 0 28px rgba(255, 255, 255, 0.5);
  animation: firework-launch var(--duration) cubic-bezier(0.19, 0.92, 0.22, 1) var(--delay) forwards;
}

.confetti-piece.firework-spark {
  border-radius: 999px;
  box-shadow:
    0 0 12px currentColor,
    0 0 26px rgba(255, 255, 255, 0.5);
  animation: firework-bloom var(--duration) cubic-bezier(0.16, 0.78, 0.22, 1) var(--delay) forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes confetti-burst {
  0% {
    opacity: 0;
    transform: translate3d(-50%, -50%, 0) rotate(0deg) scale(0.36);
  }

  8% {
    opacity: 1;
  }

  42% {
    opacity: 0.98;
    transform: translate3d(var(--mid-x), var(--mid-y), 0) rotate(var(--mid-spin)) scale(var(--scale, 1));
  }

  to {
    opacity: 0;
    transform: translate3d(var(--tx), calc(var(--ty) + var(--fall)), 0) rotate(var(--spin)) scale(0.2);
  }
}

@keyframes firework-launch {
  0% {
    opacity: 0;
    transform: translate3d(-50%, -50%, 0) scale(0.42);
  }

  12% {
    opacity: 1;
  }

  82% {
    opacity: 1;
    transform: translate3d(var(--tx), var(--ty), 0) scale(1.2);
  }

  to {
    opacity: 0;
    transform: translate3d(var(--tx), var(--ty), 0) scale(0.24);
  }
}

@keyframes firework-bloom {
  0% {
    opacity: 0;
    transform: translate3d(-50%, -50%, 0) scale(0.24);
  }

  10% {
    opacity: 1;
  }

  60% {
    opacity: 0.96;
    transform: translate3d(var(--tx), var(--ty), 0) scale(var(--scale, 1));
  }

  to {
    opacity: 0;
    transform: translate3d(var(--tx), calc(var(--ty) + var(--fall)), 0) scale(0.14);
  }
}

@keyframes lock-ready-vibrate {
  0%,
  100% {
    transform: rotate(0deg) translateX(0);
  }

  18% {
    transform: rotate(-15deg) translateX(-2px);
  }

  36% {
    transform: rotate(14deg) translateX(2px);
  }

  54% {
    transform: rotate(-11deg) translateX(-2px);
  }

  72% {
    transform: rotate(9deg) translateX(2px);
  }
}

@keyframes lock-button-shake {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }

  18% {
    transform: translate3d(-2px, -1px, 0) rotate(-1.6deg);
  }

  36% {
    transform: translate3d(2px, 1px, 0) rotate(1.4deg);
  }

  54% {
    transform: translate3d(-1px, 1px, 0) rotate(-1.1deg);
  }

  72% {
    transform: translate3d(1px, -1px, 0) rotate(0.9deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .icon-btn.strong[data-action="lock-inline"]:not(:disabled):hover,
  .icon-btn.strong[data-action="lock-inline"]:not(:disabled):focus-visible,
  .icon-btn.strong[data-action="lock-inline"]:not(:disabled):hover .icon,
  .icon-btn.strong[data-action="lock-inline"]:not(:disabled):focus-visible .icon {
    animation: none;
  }
}

.shell {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(245, 247, 250, 0) 260px),
    var(--paper);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(215, 221, 231, 0.72);
  background: rgba(255, 255, 255, 0.88);
  padding: 14px max(20px, calc((100vw - 1320px) / 2));
  backdrop-filter: blur(12px);
}

.compact-topbar {
  justify-content: flex-end;
  min-height: 48px;
  padding-block: 8px;
}

.topbar .brand-mark {
  width: 42px;
  height: 42px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 5px 10px;
  font-size: 0.84rem;
  font-weight: 750;
}

.main {
  isolation: isolate;
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 0 20px 42px;
}

.shell:not(.metrics-collapsed) .main {
  padding-bottom: 220px;
}

.shell.metrics-collapsed .main {
  padding-bottom: 92px;
}

.sticky-dashboard {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  gap: 12px;
  margin-bottom: 0;
  padding: 24px 0 12px;
  transform: translateZ(0);
}

.sticky-dashboard::before {
  position: absolute;
  inset: 0 -20px -34px;
  z-index: 0;
  content: "";
  background:
    linear-gradient(180deg, rgba(245, 248, 252, 0.2), rgba(245, 248, 252, 0.06) 52%, rgba(245, 248, 252, 0)),
    rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(5px) saturate(1.08);
  -webkit-backdrop-filter: blur(5px) saturate(1.08);
  mask-image: linear-gradient(180deg, #000 0%, #000 58%, rgba(0, 0, 0, 0.42) 76%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 58%, rgba(0, 0, 0, 0.42) 76%, transparent 100%);
  pointer-events: none;
}

.sticky-dashboard > * {
  position: relative;
  z-index: 1;
}

.app-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: stretch;
  min-height: 166px;
  overflow: hidden;
  border: 1px solid rgba(215, 221, 231, 0.92);
  border-radius: 8px;
  margin-bottom: 0;
  padding: 26px;
  box-shadow: var(--shadow);
}

.app-hero::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  background:
    linear-gradient(90deg, rgba(24, 33, 47, 0.8), rgba(24, 33, 47, 0.46) 52%, rgba(24, 33, 47, 0.12)),
    linear-gradient(0deg, rgba(24, 33, 47, 0.32), rgba(24, 33, 47, 0.02));
}

.app-hero-image {
  position: absolute;
  inset: -30% -14%;
  z-index: 0;
  width: 128%;
  height: 160%;
  object-fit: cover;
  object-position: center 62%;
}

.app-hero-copy,
.app-hero-side,
.app-hero-corner-actions,
.app-hero-corner-btn,
.app-hero-badge {
  position: relative;
  z-index: 2;
}

.app-hero-corner-actions {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-hero-corner-btn {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: white;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(10px);
}

.app-hero-corner-btn.debug-toggle {
  width: auto;
  grid-auto-flow: column;
  gap: 6px;
  padding: 0 11px;
  font-size: 0.78rem;
  font-weight: 850;
}

.app-hero-corner-btn.debug-toggle.active {
  border-color: rgba(104, 211, 145, 0.58);
  background: rgba(47, 128, 98, 0.46);
}

.app-hero-corner-btn:hover,
.app-hero-corner-btn:focus-visible {
  background: rgba(255, 255, 255, 0.24);
  outline: 0;
}

.app-hero-corner-btn .icon {
  width: 18px;
  height: 18px;
}

.app-hero-copy {
  align-self: end;
}

.app-hero .eyebrow {
  color: #d7f1e7;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.24);
}

.app-hero-title {
  margin: 0;
  color: white;
  font-size: clamp(1.7rem, 4vw, 2.75rem);
  line-height: 1.02;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.28);
}

.app-hero-detail {
  max-width: 680px;
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 700;
  line-height: 1.4;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.22);
}

.app-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: white;
  padding: 7px 12px;
  font-size: 0.86rem;
  font-weight: 850;
  backdrop-filter: blur(10px);
}

.account-week-pill {
  padding: 4px 5px 4px 12px;
}

.account-week-label {
  white-space: nowrap;
}

.hero-signout-pill {
  min-height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 4px 9px;
  font-size: 0.78rem;
  font-weight: 850;
}

.hero-signout-pill:hover,
.hero-signout-pill:focus-visible {
  background: rgba(255, 255, 255, 0.3);
  outline: 0;
}

.app-hero-side {
  display: grid;
  align-self: start;
  justify-items: end;
  gap: 9px;
}

.app-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.app-hero-actions .user-pill,
.app-hero-actions .status-pill,
.app-hero-actions .btn {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.15);
  color: white;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(10px);
}

.app-hero-actions .btn:hover,
.app-hero-actions .btn:focus-visible {
  background: rgba(255, 255, 255, 0.24);
  outline: 0;
}

.hero-current-week-button {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 3;
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.18);
  color: white;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(12px) saturate(1.18);
  -webkit-backdrop-filter: blur(12px) saturate(1.18);
}

.hero-current-week-button:hover,
.hero-current-week-button:focus-visible {
  border-color: rgba(255, 255, 255, 0.56);
  background: rgba(255, 255, 255, 0.28);
  color: white;
}

.page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
}

.page-title {
  margin: 0;
  font-size: clamp(1.55rem, 4vw, 2.45rem);
  line-height: 1.05;
}

.source-line {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 650;
}

.summary-carousel {
  position: relative;
  isolation: isolate;
}

.summary-carousel::before,
.summary-carousel::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 7px;
  z-index: 2;
  width: 46px;
  opacity: 1;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.summary-carousel::before {
  left: 0;
  background: linear-gradient(90deg, rgba(239, 245, 247, 0.96), rgba(239, 245, 247, 0));
}

.summary-carousel::after {
  right: 0;
  background: linear-gradient(270deg, rgba(239, 245, 247, 0.96), rgba(239, 245, 247, 0));
}

.summary-carousel.at-start::before,
.summary-carousel.at-end::after {
  opacity: 0;
}

.summary-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max(224px, calc((100% - 36px) * 0.25));
  grid-template-columns: none;
  gap: 12px;
  margin-bottom: 0;
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-x: contain;
  scroll-padding-inline: 2px;
  scroll-snap-type: x proximity;
  padding: 1px 2px 7px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.summary-grid::-webkit-scrollbar {
  display: none;
}

.summary-grid > .metric {
  scroll-snap-align: start;
}

.metric-slide-button {
  position: absolute;
  top: calc(50% - 4px);
  transform: translateY(-50%);
  z-index: 3;
  width: 32px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.54);
  color: var(--ink);
  box-shadow:
    0 10px 22px rgba(24, 33, 47, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(10px) saturate(1.15);
  -webkit-backdrop-filter: blur(10px) saturate(1.15);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.summary-carousel.can-slide:not(.at-start) .metric-slide-prev,
.summary-carousel.can-slide:not(.at-end) .metric-slide-next {
  opacity: 0.92;
  pointer-events: auto;
}

.metric-slide-button:hover,
.metric-slide-button:focus-visible {
  background: rgba(255, 255, 255, 0.78);
  outline: 0;
}

.metric-slide-button .icon {
  width: 18px;
  height: 18px;
}

.metric-slide-button:disabled {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) scale(0.92);
}

.metric-slide-prev {
  left: -12px;
}

.metric-slide-next {
  right: -12px;
}

.metric {
  border: 1px solid rgba(215, 221, 231, 0.86);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 24px rgba(24, 33, 47, 0.07);
  padding: 15px;
}

.metrics-footer .metric {
  border-color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.4);
  box-shadow:
    0 14px 28px rgba(24, 33, 47, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(8px) saturate(1.18);
  -webkit-backdrop-filter: blur(8px) saturate(1.18);
}

.metrics-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 15;
  padding: 0 20px max(14px, env(safe-area-inset-bottom));
  pointer-events: none;
}

.metrics-footer::before {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  height: 190px;
  content: "";
  background: linear-gradient(180deg, rgba(238, 244, 247, 0), rgba(238, 244, 247, 0.72) 48%, rgba(238, 244, 247, 0.92));
  pointer-events: none;
}

.metrics-footer-glass {
  width: min(1320px, 100%);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0.2)),
    rgba(255, 255, 255, 0.24);
  box-shadow:
    0 22px 54px rgba(24, 33, 47, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    inset 0 -1px 0 rgba(215, 221, 231, 0.28);
  pointer-events: auto;
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
}

.metrics-footer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 8px;
}

.metrics-footer-kicker,
.metrics-footer-title {
  margin: 0;
}

.metrics-footer-kicker {
  color: var(--green);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.metrics-footer-title {
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 900;
}

.metrics-footer-toggle {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(47, 128, 98, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--green);
  padding: 5px 9px;
  font-size: 0.78rem;
  font-weight: 850;
}

.metrics-footer-toggle:hover,
.metrics-footer-toggle:focus-visible {
  border-color: rgba(47, 128, 98, 0.4);
  background: rgba(255, 255, 255, 0.78);
  outline: 0;
}

.metrics-footer-toggle .icon {
  width: 15px;
  height: 15px;
}

.metrics-footer-body {
  padding: 0 12px 12px;
}

.metrics-footer .summary-carousel::before {
  background: linear-gradient(90deg, rgba(243, 248, 249, 0.86), rgba(243, 248, 249, 0));
}

.metrics-footer .summary-carousel::after {
  background: linear-gradient(270deg, rgba(243, 248, 249, 0.86), rgba(243, 248, 249, 0));
}

.metrics-footer.is-collapsed {
  padding-left: 20px;
}

.metrics-footer.is-collapsed::before {
  height: 92px;
}

.metrics-footer.is-collapsed .metrics-footer-glass {
  width: min(360px, 100%);
  margin: 0 auto;
}

.metrics-footer.is-collapsed .metrics-footer-head {
  padding: 10px 12px;
}

.trend-card {
  --trend-color: var(--green);
  display: grid;
  gap: 9px;
  min-height: 132px;
  overflow: hidden;
}

.trend-blue {
  --trend-color: var(--blue);
}

.trend-gold {
  --trend-color: var(--gold);
}

.trend-coral {
  --trend-color: var(--coral);
}

.trend-card-head {
  display: grid;
  gap: 7px;
}

.metric-title {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-value {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 850;
  line-height: 1.15;
}

.trend-card .metric-title {
  margin: 0;
}

.metric-sparkline {
  width: 100%;
  height: 54px;
  display: block;
  color: var(--trend-color);
  overflow: visible;
  pointer-events: none;
}

.metric-sparkline-wrap {
  position: relative;
  min-height: 54px;
  overflow: visible;
}

.spark-hit {
  position: absolute;
  z-index: 2;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--trend-color);
  cursor: pointer;
  padding: 0;
  transform: translate(-50%, -50%);
}

.spark-hit::after {
  position: absolute;
  inset: 6px;
  border-radius: inherit;
  background: currentColor;
  content: "";
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 140ms ease, transform 140ms ease;
}

.spark-hit:hover::after,
.spark-hit:focus-visible::after {
  opacity: 0.2;
  transform: scale(1);
}

.spark-hit:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -4px;
}

.spark-area {
  fill: currentColor;
  opacity: 0.12;
}

.spark-line {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.6;
  vector-effect: non-scaling-stroke;
}

.spark-dot {
  fill: currentColor;
}

.spark-bar {
  fill: currentColor;
  opacity: 0.72;
}

.metric-empty-spark {
  min-height: 54px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(102, 112, 133, 0.26);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.metric-detail {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.trend-card .metric-detail {
  margin: 0;
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.45fr);
  gap: 18px;
  align-items: start;
}

.section {
  border: 1px solid rgba(215, 221, 231, 0.86);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 30px rgba(24, 33, 47, 0.08);
  margin-bottom: 18px;
}

.plan-section {
  position: relative;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.plan-section .section-head {
  position: relative;
  z-index: 2;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.44), rgba(255, 255, 255, 0.16)),
    rgba(255, 255, 255, 0.18);
  box-shadow:
    0 18px 34px rgba(24, 33, 47, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    inset 0 -1px 0 rgba(215, 221, 231, 0.32);
  padding: 12px;
  backdrop-filter: blur(8px) saturate(1.18);
  -webkit-backdrop-filter: blur(8px) saturate(1.18);
}

.plan-head-section {
  margin-bottom: 0;
}

.plan-card-section {
  margin-bottom: 18px;
}

.plan-section .section-head::after {
  position: absolute;
  inset: 0;
  z-index: 0;
  content: "";
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.62), transparent 28%),
    linear-gradient(120deg, rgba(255, 255, 255, 0.26), transparent 34%, rgba(255, 255, 255, 0.18) 74%, transparent);
  pointer-events: none;
}

.plan-section .section-head > * {
  position: relative;
  z-index: 1;
}

.section-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(215, 221, 231, 0.72);
  background: rgba(255, 255, 255, 0.78);
  padding: 15px;
}

.section-title {
  margin: 0;
  font-size: 1.05rem;
}

.section-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.plan-scroll {
  position: relative;
  display: grid;
  gap: 10px;
  height: auto;
  max-height: none;
  overflow: visible;
  background: transparent;
}

.plan-end-note {
  min-height: max(160px, calc(100vh - var(--sticky-row-offset, 360px) + 32px));
  position: relative;
  display: grid;
  align-content: start;
  justify-items: center;
  color: rgba(24, 33, 47, 0.34);
  padding: 14px 16px 96px;
  text-align: center;
  font-size: 0.94rem;
  pointer-events: none;
}

.plan-end-note blockquote {
  position: relative;
  z-index: 2;
  max-width: 620px;
  margin: 0;
  padding-top: 12px;
  mix-blend-mode: multiply;
}

.plan-end-note p {
  margin: 0;
  color: rgba(24, 33, 47, 0.36);
  font-size: clamp(1rem, 1.7vw, 1.28rem);
  font-style: italic;
  font-weight: 620;
  line-height: 1.45;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.38);
}

.plan-end-note cite {
  display: block;
  margin-top: 10px;
  color: rgba(102, 112, 133, 0.42);
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 760;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.plan-row-form {
  display: grid;
  gap: 0;
  position: relative;
  z-index: 0;
  scroll-margin-top: var(--sticky-row-offset, 260px);
  overflow: hidden;
  border: 1px solid rgba(194, 202, 215, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 8px 18px rgba(24, 33, 47, 0.06);
  padding: 0;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.plan-row-form::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 1;
  width: 4px;
  border-radius: 8px 0 0 8px;
  background: transparent;
  pointer-events: none;
  transition: background 160ms ease;
}

.plan-row-form:has(.info-wrap:hover),
.plan-row-form:has(.info-wrap:focus-within) {
  z-index: 80;
  overflow: visible;
}

.plan-head-actions {
  display: flex;
  align-self: center;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.current-week-button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(47, 128, 98, 0.3);
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 850;
}

.current-week-button[hidden] {
  display: none;
}

.current-week-button:hover,
.current-week-button:focus-visible {
  border-color: var(--green);
  outline: 0;
}

.current-week-button .icon {
  width: 16px;
  height: 16px;
}

.plan-row-form:last-child {
  border-bottom: 1px solid rgba(215, 221, 231, 0.86);
}

.plan-row-form.active {
  border-color: rgba(47, 128, 98, 0.46);
  background: rgba(255, 255, 255, 0.99);
  box-shadow:
    0 18px 38px rgba(47, 128, 98, 0.12),
    0 7px 18px rgba(24, 33, 47, 0.06);
}

.plan-row-form.active::before {
  background: var(--green);
}

.plan-row-form.locked {
  background: #fbfcfe;
}

.plan-row-form.active.locked {
  background: rgba(255, 255, 255, 0.99);
}

.plan-row-form.active .row-kicker {
  background: var(--green);
  color: white;
  box-shadow: 0 6px 14px rgba(47, 128, 98, 0.18);
}

.plan-row-form.active .plan-row-main {
  background: rgba(246, 252, 249, 0.94);
}

.plan-row-form.active .week-day-cell {
  border-color: rgba(196, 206, 218, 0.96);
  background: rgba(255, 255, 255, 0.98);
}

.plan-row-form.active .week-day-cell.empty-day {
  border-color: rgba(224, 229, 236, 0.82);
  background:
    repeating-linear-gradient(135deg, rgba(238, 242, 247, 0.72) 0 1px, transparent 1px 8px),
    rgba(248, 250, 252, 0.74);
}

.plan-row-form.target-highlight,
.week-day-cell.target-highlight {
  position: relative;
  z-index: 3;
}

.plan-row-form.target-highlight::after,
.week-day-cell.target-highlight::after {
  position: absolute;
  inset: 0;
  z-index: 5;
  border: 2px solid rgba(217, 119, 6, 0.9);
  border-radius: inherit;
  background:
    radial-gradient(circle at 50% 35%, rgba(251, 191, 36, 0.36), transparent 66%),
    linear-gradient(180deg, rgba(255, 249, 219, 0.42), rgba(255, 237, 153, 0.22));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.88),
    0 0 0 0 rgba(217, 119, 6, 0.3),
    0 14px 30px rgba(146, 64, 14, 0.12);
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: scale(1);
  transform-origin: center;
  animation: target-card-highlight 1.5s ease-out forwards;
}

.week-day-cell.target-highlight::after {
  inset: -1px;
  animation-name: target-cell-highlight;
}

@keyframes target-card-highlight {
  0% {
    opacity: 1;
    transform: scale(1);
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.88),
      0 0 0 5px rgba(217, 119, 6, 0.28),
      0 14px 30px rgba(146, 64, 14, 0.14);
  }

  42% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: scale(1.012);
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.88),
      0 0 0 14px rgba(217, 119, 6, 0),
      0 14px 30px rgba(146, 64, 14, 0);
  }
}

@keyframes target-cell-highlight {
  0% {
    opacity: 1;
    transform: scale(1);
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.88),
      0 0 0 5px rgba(217, 119, 6, 0.3),
      0 12px 24px rgba(146, 64, 14, 0.16);
  }

  42% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: scale(1.018);
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.88),
      0 0 0 13px rgba(217, 119, 6, 0),
      0 12px 24px rgba(146, 64, 14, 0);
  }
}

.plan-row-form.planned-row {
  border-color: rgba(186, 195, 209, 0.72);
  border-style: dashed;
  background: rgba(250, 252, 255, 0.82);
  box-shadow: none;
}

.plan-row-form.planned-row .row-kicker {
  background: rgba(102, 112, 133, 0.1);
  color: #667085;
}

.plan-row-form.planned-row .plan-row-main,
.plan-row-form.planned-row .plan-row-footer {
  background: rgba(248, 250, 252, 0.52);
}

.plan-row-form.planned-row .row-stat-pill {
  border-color: rgba(215, 221, 231, 0.62);
  background: rgba(247, 249, 252, 0.72);
  color: #596579;
}

.plan-row-form.planned-row .week-day-cell {
  border-color: rgba(215, 221, 231, 0.58);
  background: rgba(250, 252, 255, 0.64);
  color: #596579;
  box-shadow: none;
}

.plan-row-form.planned-row .week-day-distance,
.plan-row-form.planned-row .week-day-pace {
  opacity: 0.72;
}

.plan-row-form.planned-row .week-day-slot.planning-focus-slot .week-day-cell {
  opacity: var(--planning-opacity, 0.58);
  transition:
    opacity 420ms ease,
    background 420ms ease,
    border-color 420ms ease,
    box-shadow 420ms ease;
}

.plan-row-form.planned-row .week-day-slot.planning-focus-slot .week-day-cell::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255, 255, 255, var(--planning-veil, 0.32));
  backdrop-filter: blur(var(--planning-veil-blur, 5px));
  content: "";
  pointer-events: none;
  transition:
    background 420ms ease,
    backdrop-filter 420ms ease;
}

.plan-row-form.planned-row .week-day-slot.planning-focus-slot .week-day-head,
.plan-row-form.planned-row .week-day-slot.planning-focus-slot .week-day-distance,
.plan-row-form.planned-row .week-day-slot.planning-focus-slot .week-day-pace-wrap {
  filter: blur(var(--planning-content-blur, 3.4px));
  transition: filter 420ms ease;
}

.plan-row-form.future-row {
  overflow: hidden;
  border-style: dashed;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(240, 244, 249, 0.56)),
    rgba(249, 251, 253, 0.9);
}

.future-row-content {
  display: grid;
  gap: 0;
  opacity: 0.48;
  filter: blur(7px);
  transform: scale(1.01);
  user-select: none;
}

.future-row-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 7px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.32) 42%, rgba(255, 255, 255, 0.1)),
    linear-gradient(180deg, rgba(245, 247, 250, 0.34), rgba(245, 247, 250, 0.18));
  color: var(--ink);
  padding: 22px;
  text-align: center;
}

.future-row-overlay strong {
  font-size: 1.22rem;
}

.future-row-overlay > span:last-child {
  max-width: 260px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
  line-height: 1.35;
}

.plan-row-form.beyond-row {
  border-color: rgba(202, 211, 224, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.2) 70%, rgba(255, 255, 255, 0)),
    rgba(249, 251, 253, 0.56);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 56%, rgba(0, 0, 0, 0.44) 78%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 56%, rgba(0, 0, 0, 0.44) 78%, transparent 100%);
}

.beyond-row .future-row-content {
  opacity: 0.28;
  filter: blur(8px) saturate(0.82);
}

.beyond-row .future-row-overlay {
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.18) 44%, rgba(255, 255, 255, 0)),
    linear-gradient(180deg, rgba(245, 247, 250, 0.2), rgba(245, 247, 250, 0));
}

.beyond-row .future-row-overlay > span:last-child {
  color: rgba(102, 112, 133, 0.72);
}

.future-line {
  width: 58%;
  height: 16px;
  border-radius: 999px;
  background: rgba(102, 112, 133, 0.18);
}

.future-line.wide {
  width: 84%;
}

.future-lines {
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 50px;
}

.plan-row-main {
  display: grid;
  grid-template-columns: minmax(180px, 0.75fr) minmax(0, 1.25fr);
  gap: 12px;
  align-items: center;
  overflow: visible;
  border-bottom: 1px solid rgba(215, 221, 231, 0.72);
  background: rgba(250, 252, 255, 0.78);
  padding: 10px 12px 9px 16px;
}

.plan-row-title {
  min-width: 0;
}

.plan-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.title-factor {
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(102, 112, 133, 0.1);
  color: var(--muted);
  padding: 3px 7px;
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.title-factor-edit {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(102, 112, 133, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  color: currentColor;
  padding: 0;
}

.title-factor-edit:hover,
.title-factor-edit:focus-visible {
  border-color: currentColor;
  background: white;
  outline: 0;
}

.title-factor-edit .icon {
  width: 11px;
  height: 11px;
}

.title-factor.meta-positive {
  background: rgba(47, 128, 98, 0.12);
  color: var(--green);
}

.title-factor.meta-negative {
  background: rgba(217, 87, 61, 0.12);
  color: #b13a27;
}

.title-factor.meta-neutral {
  background: rgba(102, 112, 133, 0.1);
  color: var(--muted);
}

.row-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border-radius: 5px;
  background: rgba(47, 128, 98, 0.12);
  color: var(--green);
  padding: 3px 6px;
  font-size: 0.66rem;
  font-weight: 850;
  text-transform: uppercase;
}

.plan-row-title h4 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-row-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
}

.plan-row-title .debug-raw-sunday {
  width: fit-content;
  margin-top: 7px;
  border: 1px solid rgba(47, 128, 98, 0.2);
  border-radius: 999px;
  background: rgba(47, 128, 98, 0.08);
  color: #276f55;
  padding: 3px 8px;
  font-size: 0.7rem;
  font-weight: 850;
}

.plan-row-meta {
  display: grid;
  justify-items: end;
  gap: 8px;
  min-width: 0;
  overflow: visible;
}

.row-stat-pills {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
  overflow: visible;
}

.row-stat-pill {
  position: relative;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(202, 210, 222, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  padding: 5px 8px;
  font-size: 0.76rem;
  font-weight: 820;
  line-height: 1;
  white-space: nowrap;
  overflow: visible;
}

.row-stat-pill.editable:hover,
.row-stat-pill.editable:focus-within {
  border-color: rgba(47, 128, 98, 0.5);
  background: rgba(228, 243, 237, 0.86);
}

.row-stat-label,
.row-stat-value {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.row-stat-label {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 850;
  text-transform: uppercase;
}

.row-stat-value strong {
  font-size: 0.88rem;
  font-weight: 900;
}

.row-stat-value small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
}

.row-stat-pill .metric-label-meta {
  min-height: 18px;
  padding: 2px 6px;
  font-size: 0.67rem;
}

.row-stat-pill .info-icon {
  width: 15px;
  height: 15px;
  font-size: 0.62rem;
}

.row-stat-edit {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(47, 128, 98, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--green);
  padding: 0;
}

.row-stat-edit:hover,
.row-stat-edit:focus-visible {
  border-color: var(--green);
  background: white;
  outline: 0;
}

.row-stat-edit .icon {
  width: 14px;
  height: 14px;
}

.stat-average {
  background: rgba(228, 243, 237, 0.74);
  border-color: rgba(47, 128, 98, 0.18);
}

.stat-factor {
  color: #596579;
  background: rgba(247, 249, 252, 0.68);
}

.stat-planned {
  background: rgba(244, 248, 255, 0.8);
  border-color: rgba(53, 102, 214, 0.18);
}

.plan-row-footer {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid rgba(226, 231, 238, 0.86);
  background: rgba(250, 252, 255, 0.64);
  padding: 8px 12px;
}

.plan-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.icon {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.icon-btn.labeled {
  width: auto;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 7px;
  padding: 0 11px;
  font-size: 0.82rem;
  font-weight: 850;
  white-space: nowrap;
}

.icon-btn.labeled .icon {
  width: 16px;
  height: 16px;
}

.icon-btn:not(:disabled):hover,
.icon-btn:not(:disabled):focus-visible {
  border-color: var(--blue);
  color: var(--blue);
  outline: 0;
}

.icon-btn.strong {
  border-color: var(--green);
  background: var(--green);
  color: white;
}

.icon-btn.strong[data-action="lock-inline"]:not(:disabled) {
  position: relative;
  overflow: visible;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.icon-btn.strong:not(:disabled):hover,
.icon-btn.strong:not(:disabled):focus-visible {
  border-color: #277a5d;
  background: #277a5d;
  color: white;
  outline: 0;
}

.icon-btn.strong[data-action="lock-inline"]:not(:disabled):hover,
.icon-btn.strong[data-action="lock-inline"]:not(:disabled):focus-visible {
  animation: lock-button-shake 480ms ease-in-out infinite;
  box-shadow:
    0 10px 22px rgba(47, 128, 98, 0.24),
    0 0 0 4px rgba(47, 128, 98, 0.12);
}

.icon-btn.strong[data-action="lock-inline"]:not(:disabled):hover .icon,
.icon-btn.strong[data-action="lock-inline"]:not(:disabled):focus-visible .icon {
  animation: lock-ready-vibrate 420ms ease-in-out infinite;
  transform-origin: 50% 55%;
}

.icon-btn.danger {
  background: var(--coral-soft);
  color: #9d2b18;
}

.icon-btn.danger:not(:disabled):hover,
.icon-btn.danger:not(:disabled):focus-visible {
  border-color: rgba(194, 65, 45, 0.42);
  background: rgba(255, 232, 226, 0.96);
  color: #8f2416;
  outline: 0;
}

.icon-btn.small {
  width: 34px;
  height: 34px;
  border-radius: 7px;
}

.locked-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 800;
}

.locked-pill .icon {
  width: 16px;
  height: 16px;
}

.muted-pill {
  background: var(--surface-2);
}

.run-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  padding: 10px 12px 12px 16px;
}

.run-grid.single-run {
  justify-content: center;
  padding-block: 12px 14px;
}

.week-day-slot {
  min-width: 0;
  display: grid;
}

.week-day-cell {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 80px;
  display: grid;
  grid-template-rows: auto minmax(28px, 1fr) auto;
  align-items: center;
  justify-items: center;
  gap: 5px;
  border: 1px solid rgba(213, 220, 230, 0.92);
  border-left: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  padding: 8px 4px 7px;
  text-align: center;
  box-shadow: none;
}

.week-day-slot:first-child .week-day-cell {
  border-left: 1px solid rgba(213, 220, 230, 0.92);
  border-radius: 7px 0 0 7px;
}

.week-day-slot:last-child .week-day-cell {
  border-radius: 0 7px 7px 0;
}

.run-grid.single-run .week-day-slot:first-child .week-day-cell,
.run-grid.single-run .week-day-slot:last-child .week-day-cell {
  border-left: 1px solid rgba(213, 220, 230, 0.92);
  border-radius: 8px;
}

.week-day-cell.start-run {
  min-height: 96px;
}

.week-day-cell.start-run .week-day-abbrev {
  color: var(--green);
  font-size: 0.78rem;
}

button.week-day-cell {
  cursor: pointer;
  font: inherit;
}

button.week-day-cell:hover,
button.week-day-cell:focus-visible {
  position: relative;
  z-index: 2;
  border-color: rgba(47, 128, 98, 0.54);
  background: rgba(247, 252, 250, 0.98);
  outline: 0;
  box-shadow: 0 0 0 2px rgba(47, 128, 98, 0.1);
  transform: translateY(-1px);
}

.week-day-cell.empty-day {
  border-color: rgba(224, 229, 236, 0.82);
  background:
    repeating-linear-gradient(135deg, rgba(238, 242, 247, 0.72) 0 1px, transparent 1px 8px),
    rgba(248, 250, 252, 0.74);
  box-shadow: none;
}

.plan-row-form.active .week-day-cell.needs-pace {
  border-color: rgba(53, 102, 214, 0.7);
  background:
    linear-gradient(180deg, rgba(229, 238, 255, 0.98), rgba(244, 248, 255, 0.96)),
    rgba(255, 255, 255, 0.98);
  box-shadow:
    inset 0 4px 0 var(--blue),
    inset 0 0 0 1px rgba(255, 255, 255, 0.72),
    0 0 0 2px rgba(53, 102, 214, 0.12),
    0 10px 22px rgba(53, 102, 214, 0.1);
}

.plan-row-form.active .week-day-cell.needs-pace::before {
  position: absolute;
  top: 7px;
  left: 7px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--blue);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow:
    0 0 0 3px rgba(53, 102, 214, 0.12),
    inset 0 0 0 2px rgba(255, 255, 255, 0.84);
  content: "";
  pointer-events: none;
}

.plan-row-form.active button.week-day-cell.needs-pace:hover,
.plan-row-form.active button.week-day-cell.needs-pace:focus-visible {
  z-index: 3;
  border-color: rgba(53, 102, 214, 0.82);
  background:
    linear-gradient(180deg, rgba(221, 234, 255, 0.98), rgba(238, 245, 255, 0.98)),
    rgba(255, 255, 255, 0.98);
  box-shadow:
    inset 0 4px 0 var(--blue),
    inset 0 0 0 1px rgba(255, 255, 255, 0.78),
    0 0 0 3px rgba(53, 102, 214, 0.16),
    0 14px 26px rgba(53, 102, 214, 0.16);
  transform: translateY(-1px);
}

.week-day-cell.pace-complete {
  border-color: rgba(47, 128, 98, 0.28);
  background:
    linear-gradient(180deg, rgba(235, 248, 242, 0.96), rgba(247, 252, 250, 0.94)),
    rgba(255, 255, 255, 0.96);
  box-shadow:
    inset 0 3px 0 rgba(47, 128, 98, 0.72),
    inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.week-day-cell.pace-complete::before {
  position: absolute;
  top: 7px;
  left: 7px;
  width: 12px;
  height: 12px;
  border: 2px solid white;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 128, 98, 0.12);
  content: "";
  pointer-events: none;
}

button.week-day-cell.pace-complete:hover,
button.week-day-cell.pace-complete:focus-visible {
  z-index: 3;
  border-color: rgba(47, 128, 98, 0.44);
  background:
    linear-gradient(180deg, rgba(229, 246, 238, 0.98), rgba(242, 251, 247, 0.96)),
    rgba(255, 255, 255, 0.96);
  box-shadow:
    inset 0 3px 0 rgba(47, 128, 98, 0.82),
    inset 0 0 0 1px rgba(255, 255, 255, 0.78),
    0 0 0 3px rgba(47, 128, 98, 0.14),
    0 14px 26px rgba(47, 128, 98, 0.13);
  transform: translateY(-1px);
}

.plan-row-form.locked .week-day-cell.pace-not-entered {
  border-color: rgba(202, 138, 4, 0.3);
  background:
    linear-gradient(180deg, rgba(255, 251, 235, 0.95), rgba(255, 247, 237, 0.9)),
    rgba(255, 255, 255, 0.94);
  box-shadow:
    inset 0 3px 0 rgba(202, 138, 4, 0.54),
    inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.plan-row-form.locked .week-day-cell.pace-not-entered::before {
  position: absolute;
  top: 7px;
  left: 7px;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(202, 138, 4, 0.78);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 0 0 3px rgba(202, 138, 4, 0.1);
  content: "";
  pointer-events: none;
}

.week-day-head {
  max-width: 100%;
  display: grid;
  justify-items: center;
  gap: 2px;
  overflow: hidden;
}

.week-day-abbrev,
.week-day-description {
  max-width: 100%;
  overflow: hidden;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.week-day-abbrev {
  color: #596579;
  font-size: clamp(0.62rem, 1.8vw, 0.74rem);
  font-weight: 900;
  text-transform: uppercase;
}

.week-day-description {
  color: var(--green);
  font-size: clamp(0.55rem, 1.55vw, 0.66rem);
  font-weight: 850;
}

.week-day-distance {
  max-width: 100%;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  overflow: hidden;
  color: var(--ink);
  font-size: clamp(0.98rem, 3.2vw, 1.5rem);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.week-day-distance small {
  color: var(--muted);
  font-size: 0.48em;
  font-weight: 850;
}

.week-day-workout {
  max-width: min(100%, 140px);
  color: #3b4558;
  font-size: clamp(0.78rem, 2.15vw, 1rem);
  font-weight: 920;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workout-minutes-label {
  color: #9ba6b5;
  text-transform: none;
}

.workout-empty {
  color: #a3acba;
  font-size: 0.78rem;
  font-weight: 850;
}

.workout-run-edit-grid {
  grid-template-columns: minmax(0, 1fr);
}

.week-day-cell.empty-day .week-day-distance {
  color: transparent;
}

.week-day-cell.empty-day .week-day-abbrev {
  color: #9aa4b2;
}

.week-day-pace-wrap {
  max-width: 100%;
  min-height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.week-day-pace {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  overflow: hidden;
  font-size: clamp(0.58rem, 1.7vw, 0.74rem);
  font-weight: 900;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.week-day-pace.pace-default {
  color: #a5afbf;
  font-weight: 820;
}

.week-day-pace.pace-faster {
  color: var(--green);
}

.week-day-pace.pace-slower {
  color: #c2412d;
}

.pace-entered-value,
.pace-threshold-compare {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}

.pace-threshold-compare {
  color: #9aa4b2;
  font-size: 0.9em;
  font-weight: 820;
}

.pace-triangle {
  font-size: 0.74em;
  line-height: 1;
}

.run-cell {
  display: grid;
  grid-template-columns: minmax(100px, 0.38fr) minmax(0, 1.62fr);
  gap: 10px;
  align-items: end;
  min-width: 0;
  border: 1px solid rgba(215, 221, 231, 0.82);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 6px 16px rgba(24, 33, 47, 0.045);
  padding: 9px;
}

.plan-row-form.active .run-cell.needs-pace {
  border-color: rgba(53, 102, 214, 0.48);
  background:
    linear-gradient(180deg, rgba(53, 102, 214, 0.08), rgba(255, 255, 255, 0.92)),
    rgba(255, 255, 255, 0.92);
  box-shadow:
    0 10px 24px rgba(53, 102, 214, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.run-cell.pace-complete {
  border-color: rgba(215, 221, 231, 0.9);
}

.run-cell.editing-pace {
  border-color: rgba(47, 128, 98, 0.46);
  background: rgba(246, 252, 249, 0.94);
}

.run-cell-head {
  display: grid;
  gap: 3px;
  align-self: center;
}

.run-cell-head span {
  color: var(--ink);
  font-weight: 850;
}

.run-cell-head strong {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.run-entry-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(176px, 1fr));
  gap: 8px;
  min-width: 0;
}

.inline-field {
  position: relative;
  display: grid;
  gap: 4px;
}

.inline-field > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.input-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
  align-items: center;
}

.input-action input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 7px 9px;
}

.input-action input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(53, 102, 214, 0.14);
  outline: 0;
}

.input-action input:disabled {
  background: #f1f4f8;
  color: #596579;
  opacity: 1;
}

.input-action input[aria-invalid="true"] {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(217, 87, 61, 0.12);
}

.unit-pill {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(215, 221, 231, 0.86);
  border-radius: 8px;
  background: #f7f9fc;
  color: var(--muted);
  padding: 0 9px;
  font-size: 0.74rem;
  font-weight: 850;
  white-space: nowrap;
}

.pace-input.invalid {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(217, 87, 61, 0.12);
}

.pace-input.needs-entry {
  border-color: rgba(53, 102, 214, 0.45);
  background: #fbfdff;
  box-shadow: inset 0 0 0 1px rgba(53, 102, 214, 0.08);
}

.pace-input.uses-default {
  color: #98a2b3;
  font-weight: 650;
}

.pace-input.uses-default::placeholder {
  color: #98a2b3;
  opacity: 1;
}

.pace-input.pace-locked:disabled {
  background: #f1f4f8;
  color: #596579;
  -webkit-text-fill-color: #596579;
  cursor: default;
}

.pace-action-save {
  border-color: rgba(47, 128, 98, 0.48);
  background: var(--green);
  color: white;
}

.pace-action-save:hover,
.pace-action-save:focus-visible {
  border-color: var(--green);
  background: #276d52;
  color: white;
}

.field-error {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  z-index: 20;
  max-width: min(240px, 100%);
  border: 1px solid rgba(217, 87, 61, 0.22);
  border-radius: 8px;
  background: white;
  box-shadow: 0 10px 24px rgba(24, 33, 47, 0.16);
  color: #9d2b18;
  opacity: 0;
  padding: 7px 9px;
  pointer-events: none;
  visibility: hidden;
  font-size: 0.76rem;
  font-weight: 750;
  transform: translateY(-4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.inline-field.has-error .field-error {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

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

.row-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.read-only-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.read-only-value {
  min-height: 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(215, 221, 231, 0.86);
  border-radius: 8px;
  background: #f7f9fc;
  color: var(--ink);
  padding: 0 9px;
}

.read-only-value > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.read-only-value strong {
  font-size: 0.88rem;
  font-weight: 900;
}

.read-only-value small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
}

.week-card {
  padding: 15px;
}

.week-card.current {
  background: var(--green-soft);
}

.week-card h3 {
  margin: 0;
  font-size: 1.2rem;
}

.week-meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 650;
}

.session-grid,
.mini-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.session-chip,
.mini-metric {
  border: 1px solid rgba(215, 221, 231, 0.86);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  padding: 10px;
}

.session-chip > span,
.mini-metric > span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.session-chip > strong,
.mini-metric strong {
  display: block;
  font-size: 1rem;
}

.mini-metric .metric-label {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  line-height: 1.2;
}

.metric-label-meta {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border-radius: 999px;
  background: rgba(47, 128, 98, 0.1);
  color: var(--green);
  padding: 3px 7px;
  font-size: 0.72rem;
  font-weight: 850;
  white-space: nowrap;
}

.metric-label-meta.meta-positive {
  background: rgba(47, 128, 98, 0.12);
  color: var(--green);
}

.metric-label-meta.meta-negative {
  background: rgba(217, 87, 61, 0.13);
  color: #b93826;
}

.metric-label-meta.meta-neutral {
  background: rgba(102, 112, 133, 0.1);
  color: #596579;
}

.row-metrics .metric-label {
  min-height: 2.05rem;
  align-items: flex-start;
}

.metric-readout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-height: 34px;
  margin-top: 6px;
}

.metric-readout strong {
  min-height: 34px;
  display: flex;
  align-items: center;
  border: 1px solid rgba(215, 221, 231, 0.86);
  border-radius: 8px;
  background: #f7f9fc;
  color: var(--ink);
  padding: 0 10px;
  font-weight: 850;
}

.metric-unit {
  min-width: 34px;
}

.info-wrap {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  z-index: 120;
}

.info-icon {
  width: 17px;
  height: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(102, 112, 133, 0.28);
  border-radius: 999px;
  background: #f7f9fc;
  color: var(--muted);
  padding: 0;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
}

.info-icon:focus-visible {
  box-shadow: 0 0 0 3px rgba(53, 102, 214, 0.14);
  outline: 0;
}

.info-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 240;
  width: max-content;
  max-width: min(300px, calc(100vw - 28px));
  border: 1px solid rgba(215, 221, 231, 0.92);
  border-radius: 8px;
  background: white;
  box-shadow: 0 14px 30px rgba(24, 33, 47, 0.18);
  color: var(--ink);
  opacity: 0;
  padding: 9px 10px;
  pointer-events: none;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  transform: translate(-50%, 4px);
  transition: opacity 140ms ease, transform 140ms ease;
  white-space: normal;
}

.info-wrap:hover .info-tooltip,
.info-wrap:focus-within .info-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.mini-input-action {
  margin-top: 6px;
  min-height: 34px;
}

.mini-input-action input {
  min-height: 34px;
  font-weight: 850;
}

.planned-increase-input:disabled {
  -webkit-text-fill-color: #18212f;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 15px;
}

.chart-panel {
  min-width: 0;
  border: 1px solid rgba(215, 221, 231, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  padding: 12px;
}

.chart-title {
  margin: 0 0 8px;
  font-weight: 850;
}

canvas {
  width: 100%;
  height: 220px;
  display: block;
  border: 1px solid rgba(215, 221, 231, 0.72);
  border-radius: 8px;
  background: rgba(251, 252, 254, 0.9);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

tr.current-row {
  background: var(--green-soft);
}

.table-button {
  background: transparent;
  color: var(--blue);
  font-weight: 850;
  padding: 4px 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(24, 33, 47, 0.46);
  overscroll-behavior: contain;
  padding: 18px;
}

.settings-discard-backdrop {
  z-index: 35;
  background: rgba(24, 33, 47, 0.32);
}

.modal {
  width: min(720px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  overscroll-behavior: contain;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.settings-modal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1080px, calc(100vw - 36px));
  height: min(88vh, 900px);
  max-height: min(88vh, 900px);
  overflow: hidden;
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 16px;
}

.settings-modal .modal-head {
  position: relative;
  z-index: 8;
}

.modal-title {
  margin: 0;
  font-size: 1.35rem;
}

.modal-body {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.settings-modal-body {
  align-content: start;
  overflow: auto;
  overscroll-behavior: contain;
  padding-top: 0;
}

.compact-modal {
  width: min(540px, 100%);
}

.settings-discard-dialog {
  width: min(460px, 100%);
}

.compact-modal-body {
  gap: 14px;
}

.modal-summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-note {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.4;
}

.lock-confirm-copy {
  margin: 0;
}

.lock-warning {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(217, 119, 6, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 247, 214, 0.96), rgba(255, 251, 235, 0.84)),
    var(--surface);
  color: #92400e;
  padding: 12px;
}

.lock-warning strong {
  font-size: 0.9rem;
}

.lock-warning span {
  color: #9a5a16;
  font-size: 0.84rem;
  font-weight: 720;
  line-height: 1.4;
}

.key-run-distance-policy {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.choice-pill {
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(146, 64, 14, 0.2);
  border-radius: 8px;
  color: #713f12;
  cursor: pointer;
  display: flex;
  gap: 8px;
  min-height: 40px;
  padding: 9px 10px;
}

.choice-pill input {
  accent-color: var(--green);
}

.choice-pill:has(input:checked) {
  background: rgba(232, 245, 238, 0.92);
  border-color: rgba(47, 132, 95, 0.52);
  color: var(--green-dark);
}

.choice-pill span {
  color: inherit;
  font-size: 0.82rem;
}

.lock-confirm-actions {
  justify-content: flex-end;
}

.formula-token-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.formula-token-row::before {
  content: "Insert";
  margin-right: 2px;
}

.token-button {
  min-height: 34px;
  border: 1px solid rgba(47, 133, 102, 0.25);
  border-radius: 999px;
  background: rgba(231, 245, 239, 0.88);
  color: var(--green);
  padding: 0 12px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  font-weight: 850;
}

.token-button:hover,
.token-button:focus-visible {
  border-color: rgba(47, 133, 102, 0.42);
  background: rgba(214, 239, 228, 0.95);
}

.average-pace-inline-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.average-pipeline-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid rgba(47, 133, 102, 0.24);
  border-radius: 999px;
  background: rgba(232, 246, 240, 0.88);
  color: #1f6b50;
  padding: 2px 8px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  font-weight: 850;
}

.average-pace-inline-field input {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(203, 212, 225, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  padding: 9px 11px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.84rem;
  font-weight: 760;
}

.average-pace-inline-field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(53, 102, 214, 0.14);
  outline: 0;
}

.average-pace-inline-field input.invalid,
.average-pace-inline-field input[aria-invalid="true"] {
  border-color: rgba(217, 87, 61, 0.7);
  background: rgba(255, 251, 250, 0.98);
  box-shadow: 0 0 0 3px rgba(217, 87, 61, 0.1);
}

.average-pace-rule-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.average-pace-rule-line strong {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 850;
}

.formula-help {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 720;
  line-height: 1.45;
}

.formula-help code {
  color: var(--ink);
  font-weight: 850;
}

.compact-actions {
  margin-top: 0;
}

.settings-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.settings-head-actions .button-row {
  gap: 8px;
}

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

.settings-tabs {
  position: sticky;
  top: 0;
  z-index: 7;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 4px;
  margin: 0 -16px;
  border-bottom: 1px solid rgba(203, 212, 225, 0.78);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 253, 0.9)),
    var(--surface);
  backdrop-filter: blur(12px);
  padding: 10px 16px;
}

.settings-tab {
  min-height: 38px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
}

.settings-tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 5px rgba(24, 33, 47, 0.1);
}

.settings-tab-panel {
  display: grid;
  gap: 12px;
}

.settings-tab-panel[hidden] {
  display: none !important;
}

.settings-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 14px;
}

.settings-panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.settings-help-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid rgba(203, 212, 225, 0.82);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #1f6b50;
  padding: 0 12px;
  font-size: 0.82rem;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 1px 5px rgba(24, 33, 47, 0.08);
}

.settings-help-link:hover,
.settings-help-link:focus-visible {
  border-color: rgba(47, 133, 102, 0.34);
  background: rgba(232, 246, 240, 0.92);
  outline: 0;
}

.algorithm-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
}

.algorithm-author-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid rgba(203, 212, 225, 0.82);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(247, 250, 253, 0.9)),
    var(--surface);
  padding: 12px;
}

.program-design-fieldset {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.program-design-fieldset:disabled {
  opacity: 0.82;
}

.protected-note {
  margin: 0;
  border: 1px solid rgba(203, 212, 225, 0.74);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.86);
  color: #667085;
  padding: 10px 12px;
  font-size: 0.82rem;
  font-weight: 760;
}

.program-design-name-field {
  max-width: 520px;
}

.algorithm-source-field {
  min-width: 0;
}

.algorithm-source-input {
  min-height: 420px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 251, 253, 0.96)),
    white;
}

.running-days-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(203, 212, 225, 0.82);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(47, 133, 102, 0.075), rgba(53, 102, 214, 0.045)),
    rgba(255, 255, 255, 0.76);
  padding: 12px;
}

.algorithm-step-card {
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.algorithm-step-card.is-collapsed {
  gap: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(244, 248, 251, 0.82)),
    rgba(255, 255, 255, 0.78);
}

.base-config-card {
  background:
    linear-gradient(135deg, rgba(47, 133, 102, 0.085), rgba(17, 24, 39, 0.035)),
    rgba(255, 255, 255, 0.82);
}

.base-config-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.base-config-title-field {
  grid-column: 1 / -1;
}

.base-config-planned-field {
  grid-column: 1 / -1;
}

.base-config-planned-field input.invalid,
.base-config-planned-field input[aria-invalid="true"] {
  border-color: rgba(217, 87, 61, 0.72);
  background: rgba(255, 251, 250, 0.96);
  box-shadow: 0 0 0 3px rgba(217, 87, 61, 0.1);
}

.running-days-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.algorithm-step-head {
  align-items: center;
}

.algorithm-step-toggle {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-align: left;
}

.algorithm-step-toggle:hover,
.algorithm-step-toggle:focus-visible {
  color: var(--green);
  outline: 0;
}

.algorithm-step-toggle > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.algorithm-step-toggle strong {
  color: currentColor;
  font-size: 0.98rem;
  font-weight: 900;
  line-height: 1.15;
}

.algorithm-step-toggle .icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  stroke-width: 2.4;
}

.algorithm-step-content {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.algorithm-step-content[hidden] {
  display: none;
}

.settings-step-label {
  color: var(--green);
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.running-days-head h4 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 0.98rem;
}

.running-days-head p {
  max-width: 250px;
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 750;
  line-height: 1.35;
  text-align: right;
}

.running-days-list {
  display: grid;
  gap: 7px;
}

.running-day-row {
  display: grid;
  grid-template-columns: minmax(112px, 0.88fr) minmax(94px, 0.7fr) minmax(138px, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(203, 212, 225, 0.7);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  padding: 8px;
}

.running-day-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 900;
}

.running-day-check input {
  width: 17px;
  height: 17px;
  accent-color: var(--green);
}

.running-day-description,
.running-day-target,
.key-run-select-row {
  display: grid;
  gap: 4px;
}

.running-day-description span,
.running-day-target span,
.key-run-select-row span {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 900;
  text-transform: uppercase;
}

.running-day-description input,
.running-day-target select,
.key-run-select-row select {
  min-height: 34px;
  border: 1px solid rgba(203, 212, 225, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 800;
  padding: 7px 9px;
}

.running-day-target select,
.key-run-select-row select {
  cursor: pointer;
}

.key-run-card {
  background:
    linear-gradient(135deg, rgba(53, 102, 214, 0.07), rgba(47, 133, 102, 0.05)),
    rgba(255, 255, 255, 0.78);
}

.average-pace-card {
  background:
    linear-gradient(135deg, rgba(17, 24, 39, 0.035), rgba(47, 133, 102, 0.075)),
    rgba(255, 255, 255, 0.82);
}

.formula-token-row::before {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 930;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.average-pace-formula-panel {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(203, 212, 225, 0.74);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(246, 249, 252, 0.74)),
    rgba(255, 255, 255, 0.78);
  padding: 10px;
}

.run-rules-card {
  background:
    linear-gradient(135deg, rgba(53, 102, 214, 0.055), rgba(47, 133, 102, 0.07)),
    rgba(255, 255, 255, 0.82);
}

.run-rules-list {
  display: grid;
  gap: 7px;
}

.run-rule-row {
  display: grid;
  grid-template-columns: minmax(118px, 0.28fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(203, 212, 225, 0.74);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  padding: 9px;
}

.run-rule-row.is-disabled {
  background: rgba(244, 247, 250, 0.74);
}

.run-rule-row.has-error {
  border-color: rgba(217, 87, 61, 0.44);
  background: rgba(255, 251, 250, 0.9);
}

.run-rule-day {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.run-rule-day strong {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 920;
}

.run-rule-day small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 880;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.run-rule-input {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(203, 212, 225, 0.88);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  padding: 8px 10px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  font-weight: 720;
}

.run-rule-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(53, 102, 214, 0.13);
  outline: 0;
}

.run-rule-input.invalid,
.run-rule-input[aria-invalid="true"] {
  border-color: rgba(217, 87, 61, 0.7);
  background: rgba(255, 251, 250, 0.98);
  box-shadow: 0 0 0 3px rgba(217, 87, 61, 0.1);
}

.run-rule-input:disabled {
  border-color: rgba(203, 212, 225, 0.58);
  background: rgba(236, 241, 246, 0.72);
  color: rgba(99, 111, 130, 0.78);
}

.fallback-rules-card {
  background:
    linear-gradient(135deg, rgba(47, 133, 102, 0.07), rgba(53, 102, 214, 0.05)),
    rgba(255, 255, 255, 0.82);
}

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

.fallback-rule {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid rgba(203, 212, 225, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(247, 250, 252, 0.78)),
    rgba(255, 255, 255, 0.84);
  padding: 10px;
}

.fallback-rule span {
  color: var(--green);
  font-size: 0.66rem;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.fallback-rule strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.3;
}

.fallback-rule p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
  line-height: 1.35;
}

.grammar-source-value[hidden] {
  display: none;
}

.grammar-editor-shell {
  position: relative;
  display: grid;
  gap: 8px;
  min-width: 0;
}

.grammar-editor-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.grammar-editor-meta span {
  border: 1px solid rgba(203, 212, 225, 0.82);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  padding: 4px 8px;
  text-transform: uppercase;
}

.grammar-source-editor {
  min-height: 420px;
  max-height: min(56vh, 560px);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(176, 188, 205, 0.86);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 253, 0.96)),
    white;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: #1f2937;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.9;
  outline: 0;
  padding: 14px;
  tab-size: 2;
  white-space: pre-wrap;
  word-break: break-word;
}

.grammar-editor-shell[data-grammar-editor-mode="remaining"] .grammar-source-editor {
  min-height: 260px;
}

.grammar-source-editor:focus {
  border-color: rgba(47, 133, 102, 0.68);
  box-shadow:
    0 0 0 3px rgba(47, 133, 102, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.grammar-editor-shell.has-error .grammar-source-editor,
.grammar-editor-shell.has-error .grammar-source-editor:focus {
  border-color: rgba(217, 87, 61, 0.7);
  box-shadow:
    0 0 0 3px rgba(217, 87, 61, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.grammar-token,
.grammar-number,
.grammar-string,
.grammar-comment,
.grammar-punctuation {
  border-radius: 999px;
}

.grammar-token {
  display: inline;
  border: 1px solid rgba(203, 212, 225, 0.82);
  background: rgba(241, 245, 249, 0.86);
  color: #334155;
  padding: 1px 5px;
  font-weight: 850;
}

.grammar-token-keyword {
  border-color: rgba(47, 133, 102, 0.24);
  background: rgba(232, 246, 240, 0.88);
  color: #1f6b50;
}

.grammar-token-source,
.grammar-token-day {
  border-color: rgba(53, 102, 214, 0.22);
  background: rgba(232, 238, 255, 0.88);
  color: #2f58b6;
}

.grammar-token-action {
  border-color: rgba(180, 123, 36, 0.22);
  background: rgba(255, 244, 221, 0.86);
  color: #946013;
}

.grammar-token-unit {
  border-color: rgba(100, 116, 139, 0.24);
  background: rgba(248, 250, 252, 0.92);
  color: #475569;
}

.grammar-number {
  background: rgba(15, 118, 110, 0.09);
  color: #0f766e;
  font-weight: 950;
  padding: 1px 3px;
}

.grammar-string {
  color: #7c3aed;
  font-weight: 850;
}

.grammar-comment {
  color: #94a3b8;
  font-style: italic;
  font-weight: 700;
}

.grammar-punctuation {
  color: #64748b;
  font-weight: 900;
  padding: 0 1px;
}

.grammar-suggestions {
  border: 1px solid rgba(203, 212, 225, 0.86);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.92)),
    rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.1);
  padding: 8px;
}

.grammar-suggestions-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 950;
  padding: 0 4px 6px;
  text-transform: uppercase;
}

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

.grammar-suggestion {
  display: grid;
  gap: 3px;
  min-width: 0;
  border: 1px solid rgba(203, 212, 225, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  cursor: pointer;
  padding: 8px 9px;
  text-align: left;
}

.grammar-suggestion[data-active="true"],
.grammar-suggestion:hover {
  border-color: rgba(47, 133, 102, 0.38);
  background: rgba(231, 245, 239, 0.92);
}

.grammar-suggestion span {
  overflow: hidden;
  font-size: 0.78rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grammar-suggestion small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.algorithm-preview-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid rgba(203, 212, 225, 0.88);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 249, 252, 0.82)),
    var(--surface);
  padding: 12px;
}

.algorithm-preview-top {
  position: sticky;
  top: calc(var(--settings-tabs-height, 58px) + 8px);
  z-index: 6;
  padding: 10px;
  box-shadow: 0 10px 24px rgba(24, 33, 47, 0.08);
}

.grammar-preview-summary {
  display: grid;
  grid-template-columns: minmax(210px, 0.34fr) minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.grammar-preview-summary > .grammar-status:only-child {
  grid-column: 1 / -1;
}

.grammar-impact-head span,
.grammar-impact-metric span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.grammar-impact {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(47, 133, 102, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(47, 133, 102, 0.08), rgba(56, 189, 248, 0.06)),
    rgba(255, 255, 255, 0.78);
  padding: 12px;
}

.grammar-impact-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.grammar-impact-head strong {
  color: var(--ink);
  font-size: 0.88rem;
}

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

.grammar-preview-summary .grammar-impact-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grammar-impact-metric {
  display: grid;
  gap: 3px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  padding: 9px 10px;
}

.grammar-impact-metric strong {
  color: var(--ink);
  font-size: 0.96rem;
}

.grammar-impact-metric small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.grammar-status {
  display: grid;
  gap: 4px;
  border-radius: 8px;
  padding: 11px 12px;
}

.grammar-status strong {
  font-size: 0.9rem;
}

.grammar-status span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.35;
}

.grammar-status-ok {
  border: 1px solid rgba(47, 128, 98, 0.2);
  background: rgba(228, 243, 237, 0.82);
  color: var(--green);
}

.grammar-status-error {
  border: 1px solid rgba(217, 87, 61, 0.24);
  background: rgba(253, 238, 234, 0.9);
  color: #9d2b18;
}

.grammar-rule-card {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(215, 221, 231, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  padding: 10px;
}

.grammar-rule-card span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
}

.grammar-rule-card strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.grammar-rule-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.35;
}

.tuning-set-layout {
  display: grid;
  gap: 12px;
  align-items: start;
}

.tuning-set-editor {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.tuning-set-picker-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(215, 221, 231, 0.82);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(246, 249, 252, 0.8)),
    var(--surface);
  padding: 12px;
}

.tuning-set-picker-main {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.tuning-set-select-field {
  max-width: 520px;
  min-width: 0;
}

.tuning-set-select-field select {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(203, 212, 225, 0.96);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 820;
  padding: 0 40px 0 12px;
}

.tuning-set-picker-status,
.tuning-set-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.tuning-set-picker-status {
  justify-content: space-between;
}

.tuning-set-actions {
  justify-content: flex-end;
}

.mini-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid rgba(215, 221, 231, 0.9);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 850;
}

.mini-pill.active {
  border-color: rgba(47, 128, 98, 0.36);
  background: var(--green);
  color: white;
}

.mini-pill.selected {
  border-color: rgba(53, 102, 214, 0.28);
  background: rgba(239, 245, 255, 0.95);
  color: var(--blue);
}

.metric-settings-panel {
  background:
    linear-gradient(135deg, rgba(53, 102, 214, 0.055), rgba(47, 133, 102, 0.07)),
    #fbfcfe;
}

.metric-picker-list {
  display: grid;
  gap: 8px;
}

.metric-setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(203, 212, 225, 0.78);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 250, 253, 0.82)),
    var(--surface);
  padding: 10px;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.metric-picker-list.is-dragging {
  user-select: none;
}

.metric-setting-row.is-dragging {
  position: relative;
  z-index: 2;
  border-color: rgba(53, 102, 214, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 245, 255, 0.9)),
    var(--surface);
  box-shadow: 0 14px 28px rgba(24, 33, 47, 0.14);
}

.metric-setting-row.is-disabled {
  background: rgba(244, 247, 250, 0.72);
  opacity: 0.72;
}

.metric-setting-row.is-unavailable:not(.is-disabled) {
  border-style: dashed;
}

.metric-setting-check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.metric-setting-check input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.metric-setting-toggle {
  width: 38px;
  height: 22px;
  border: 1px solid rgba(148, 163, 184, 0.72);
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.88);
  position: relative;
  box-shadow: inset 0 1px 3px rgba(24, 33, 47, 0.08);
  transition:
    background 160ms ease,
    border-color 160ms ease;
}

.metric-setting-toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: white;
  box-shadow: 0 2px 5px rgba(24, 33, 47, 0.16);
  transition: transform 160ms ease;
}

.metric-setting-check input:checked + .metric-setting-toggle {
  border-color: rgba(47, 133, 102, 0.42);
  background: rgba(47, 133, 102, 0.88);
}

.metric-setting-check input:checked + .metric-setting-toggle::after {
  transform: translateX(16px);
}

.metric-setting-check input:focus-visible + .metric-setting-toggle {
  outline: 3px solid rgba(53, 102, 214, 0.18);
  outline-offset: 2px;
}

.metric-setting-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.metric-setting-copy strong {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
}

.metric-setting-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 740;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-drag-handle {
  width: 38px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(203, 212, 225, 0.82);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: rgba(71, 85, 105, 0.78);
  cursor: grab;
  touch-action: none;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.metric-drag-handle:hover,
.metric-drag-handle:focus-visible {
  border-color: rgba(53, 102, 214, 0.32);
  background: rgba(239, 245, 255, 0.92);
  color: var(--blue);
  outline: 0;
}

.metric-drag-handle:active,
.metric-setting-row.is-dragging .metric-drag-handle {
  cursor: grabbing;
  transform: scale(0.98);
}

.metric-drag-handle:disabled {
  opacity: 0.32;
  cursor: default;
  pointer-events: none;
}

.metric-drag-handle .icon {
  width: 19px;
  height: 19px;
}

.metric-empty-card {
  min-height: 120px;
}

.factor-map-row.locked {
  opacity: 0.78;
}

.tuning-name-field {
  max-width: 360px;
}

.factor-map-visual {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(215, 221, 231, 0.82);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(238, 242, 246, 0.58)),
    var(--surface);
  padding: 10px;
}

.factor-map-chart {
  min-width: 0;
}

.factor-map-chart svg {
  width: 100%;
  height: 118px;
  display: block;
  color: var(--blue);
}

.factor-map-line {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.2;
  vector-effect: non-scaling-stroke;
}

.factor-map-axis,
.factor-map-grid {
  fill: none;
  vector-effect: non-scaling-stroke;
}

.factor-map-axis {
  stroke: rgba(102, 112, 133, 0.42);
  stroke-width: 1.4;
}

.factor-map-grid {
  stroke: rgba(215, 221, 231, 0.86);
  stroke-dasharray: 3 4;
  stroke-width: 1;
}

.factor-map-point {
  fill: currentColor;
  stroke: white;
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}

.factor-map-summary {
  display: grid;
  justify-items: end;
  gap: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 780;
  white-space: nowrap;
}

.factor-map-summary strong {
  color: var(--ink);
  font-size: 1rem;
}

.factor-map-empty {
  grid-column: 1 / -1;
  border: 1px dashed rgba(102, 112, 133, 0.3);
  border-radius: 8px;
  color: var(--muted);
  padding: 16px;
  text-align: center;
  font-weight: 780;
}

.factor-map-table {
  display: grid;
  gap: 8px;
}

.factor-map-rows {
  display: grid;
  gap: 8px;
}

.factor-map-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.factor-map-row-head {
  align-items: center;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.compact-field {
  gap: 4px;
}

.factor-map-row:not(.factor-map-row-head) .compact-field > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.share-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 14px;
}

.share-panel.active {
  background: var(--green-soft);
  border-color: rgba(47, 128, 98, 0.28);
}

.share-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.admin-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(241, 246, 250, 0.72)),
    var(--surface);
}

.admin-list {
  display: grid;
  gap: 8px;
}

.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(215, 221, 231, 0.82);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  padding: 10px;
}

.admin-row.active {
  border-color: rgba(47, 128, 98, 0.32);
  background: var(--green-soft);
}

.admin-row.muted {
  opacity: 0.68;
}

.admin-row-main {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.admin-row-detail {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.token-text {
  overflow: hidden;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  margin: 0;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  padding: 14px;
  text-align: center;
}

.readonly-link {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 10px;
  font: inherit;
}

.summary-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.summary-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.summary-list dt {
  color: var(--muted);
  font-weight: 750;
}

.summary-list dd {
  margin: 0;
  font-weight: 850;
}

.help-page {
  min-height: 100vh;
}

.help-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 72px;
}

.help-hero,
.help-section {
  border: 1px solid rgba(203, 212, 225, 0.82);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 253, 0.9)),
    var(--surface);
  box-shadow: 0 16px 42px rgba(24, 33, 47, 0.1);
}

.help-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 14px;
  padding: 40px;
}

.help-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(24, 33, 47, 0.78), rgba(24, 33, 47, 0.32)),
    url("/app-icon.png") center / cover no-repeat;
  opacity: 0.18;
}

.help-hero > * {
  position: relative;
}

.help-hero h1 {
  max-width: 760px;
  margin: 2px 0 10px;
  font-size: clamp(2.2rem, 7vw, 5.1rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.help-hero p:not(.eyebrow) {
  max-width: 780px;
  margin: 0;
  color: #445064;
  font-size: 1.05rem;
  font-weight: 720;
  line-height: 1.5;
}

.help-back-link {
  position: absolute;
  top: 18px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid rgba(203, 212, 225, 0.78);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  padding: 0 12px;
  font-size: 0.82rem;
  font-weight: 850;
  text-decoration: none;
  backdrop-filter: blur(12px);
}

.help-section {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding: 24px;
}

.help-section h2 {
  margin: 0;
  font-size: 1.35rem;
}

.help-section p {
  margin: 0;
  color: #4d5a6c;
  font-weight: 650;
  line-height: 1.55;
}

.help-table {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(203, 212, 225, 0.82);
  border-radius: 8px;
  background: rgba(203, 212, 225, 0.82);
}

.help-table > div {
  display: grid;
  grid-template-columns: minmax(140px, 0.7fr) minmax(220px, 1fr) minmax(260px, 1.25fr);
  gap: 0;
  background: rgba(255, 255, 255, 0.95);
}

.help-table > div:first-child {
  background: rgba(232, 246, 240, 0.95);
}

.help-table span,
.help-table strong {
  padding: 13px 14px;
  line-height: 1.4;
}

.help-table span {
  color: #465266;
  font-size: 0.92rem;
  font-weight: 650;
}

.help-table strong {
  color: #1f6b50;
  font-size: 0.82rem;
  text-transform: uppercase;
}

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

.help-card {
  display: grid;
  align-content: start;
  gap: 9px;
  min-width: 0;
  border: 1px solid rgba(203, 212, 225, 0.82);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  padding: 14px;
}

.help-card h3 {
  margin: 0;
  font-size: 1rem;
}

.help-card code,
.help-table code,
.help-list code {
  border: 1px solid rgba(47, 133, 102, 0.2);
  border-radius: 6px;
  background: rgba(232, 246, 240, 0.78);
  color: #1f6b50;
  padding: 2px 6px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.86em;
  font-weight: 850;
}

.help-card code {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.help-code {
  overflow: auto;
  margin: 0;
  border: 1px solid rgba(203, 212, 225, 0.9);
  border-radius: 8px;
  background: #111827;
  color: #edf5f2;
  padding: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.help-code code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.65;
  white-space: pre;
}

.help-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
  color: #465266;
  font-weight: 680;
  line-height: 1.5;
}

@media (max-width: 860px) {
  .app-hero {
    grid-template-columns: 1fr;
    min-height: 176px;
  }

  .app-hero-badge {
    justify-self: start;
  }

  .app-hero-side {
    justify-self: start;
    justify-items: start;
  }

  .app-hero-actions {
    justify-content: flex-start;
  }

  .page-head,
  .layout-grid,
  .chart-grid,
  .algorithm-layout,
  .tuning-set-layout,
  .base-config-grid,
  .fallback-rule-grid,
  .grammar-preview-summary {
    grid-template-columns: 1fr;
  }

  .grammar-preview-summary .grammar-impact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grammar-suggestions-list {
    grid-template-columns: 1fr;
  }

  .settings-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-help-link {
    width: fit-content;
  }

  .row-metrics .metric-label {
    min-height: 0;
  }

  .plan-row-main {
    grid-template-columns: 1fr;
  }

  .plan-row-meta {
    justify-items: start;
  }

  .row-stat-pills,
  .plan-row-actions {
    justify-content: flex-start;
  }

  .plan-row-footer {
    justify-content: flex-start;
  }

  .tuning-set-picker-main {
    grid-template-columns: 1fr;
  }

  .help-table > div,
  .help-card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .main {
    padding: 0 10px 32px;
  }

  .shell:not(.metrics-collapsed) .main {
    padding-bottom: 190px;
  }

  .shell.metrics-collapsed .main {
    padding-bottom: 82px;
  }

  .sticky-dashboard {
    gap: 8px;
    padding: 10px 0 8px;
  }

  .sticky-dashboard::before {
    inset: 0 -10px -20px;
    backdrop-filter: blur(3px) saturate(1.05);
    -webkit-backdrop-filter: blur(3px) saturate(1.05);
    mask-image: linear-gradient(180deg, #000 0%, #000 50%, rgba(0, 0, 0, 0.3) 74%, transparent 100%);
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 50%, rgba(0, 0, 0, 0.3) 74%, transparent 100%);
  }

  .app-hero {
    min-height: 156px;
    gap: 9px;
    padding: 46px 14px 14px;
  }

  .help-shell {
    width: min(calc(100% - 20px), 1120px);
    padding: 18px 0 48px;
  }

  .help-hero,
  .help-section {
    padding: 18px;
  }

  .help-hero h1 {
    font-size: 2.4rem;
  }

  .help-back-link {
    position: relative;
    top: auto;
    right: auto;
    margin-bottom: 18px;
  }

  .plan-row-form {
    scroll-margin-top: var(--sticky-row-offset, 290px);
  }

  .app-hero-image {
    inset: -20% -32%;
    width: 156%;
    height: 142%;
  }

  .app-hero-corner-actions {
    top: 10px;
    left: 10px;
    gap: 6px;
  }

  .app-hero-corner-btn {
    width: 34px;
    height: 34px;
  }

  .app-hero-corner-btn.debug-toggle {
    width: 34px;
    gap: 0;
    padding: 0;
  }

  .app-hero-corner-btn.debug-toggle span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .app-hero-title {
    font-size: clamp(1.42rem, 8vw, 1.95rem);
  }

  .app-hero-detail {
    margin-top: 5px;
    font-size: 0.84rem;
    line-height: 1.25;
  }

  .app-hero-side {
    width: 100%;
    justify-self: stretch;
    justify-items: start;
  }

  .app-hero-badge {
    max-width: 100%;
    min-height: 32px;
    padding: 5px 8px;
    font-size: 0.78rem;
  }

  .account-week-pill {
    max-width: 100%;
    padding: 4px 4px 4px 9px;
  }

  .account-week-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hero-signout-pill {
    flex: 0 0 auto;
    min-height: 24px;
    padding-inline: 8px;
  }

  .hero-current-week-button {
    right: 10px;
    bottom: 10px;
    min-height: 32px;
    padding: 6px 8px;
  }

  .hero-current-week-button span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .topbar,
  .brand-row {
    align-items: flex-start;
  }

  .topbar {
    flex-direction: column;
  }

  .compact-topbar {
    flex-direction: row;
    align-items: center;
  }

  .topbar-actions,
  .settings-head-actions,
  .button-row {
    width: 100%;
  }

  .compact-topbar .topbar-actions {
    justify-content: flex-end;
  }

  .topbar-actions .btn,
  .settings-head-actions .btn,
  .app-hero-actions .btn,
  .button-row .btn {
    flex: 1;
  }

  .settings-modal {
    width: calc(100vw - 12px);
    height: min(calc(100dvh - 12px), 900px);
    max-height: min(calc(100dvh - 12px), 900px);
  }

  .modal-backdrop {
    padding: 8px;
  }

  .modal-head {
    gap: 10px;
    padding: 12px;
  }

  .modal-title {
    font-size: 1.14rem;
  }

  .modal-body {
    gap: 12px;
    padding: 12px;
  }

  .settings-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 9px 12px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

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

  .settings-tab {
    flex: 0 0 auto;
    min-width: max-content;
    min-height: 34px;
    padding: 0 11px;
    scroll-snap-align: start;
  }

  .compact-topbar .topbar-actions .btn {
    flex: 0 0 auto;
  }

  .run-cell,
  .run-entry-row,
  .row-metrics,
  .session-grid,
  .mini-metric-grid,
  .read-only-fields,
  .form-grid,
  .running-day-row,
  .run-rule-row,
  .factor-map-visual {
    grid-template-columns: 1fr;
  }

  .tuning-set-actions {
    justify-content: flex-start;
  }

  .tuning-set-actions .btn {
    flex: 1 1 150px;
  }

  .plan-scroll {
    gap: 8px;
  }

  .plan-row-main {
    gap: 8px;
    padding: 8px 9px 8px 12px;
  }

  .plan-title-line {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 6px;
    width: 100%;
  }

  .plan-row-title h4 {
    font-size: 0.94rem;
  }

  .plan-row-title p {
    margin-top: 3px;
    font-size: 0.72rem;
    line-height: 1.3;
  }

  .row-kicker {
    min-height: 18px;
    padding: 2px 5px;
    font-size: 0.6rem;
  }

  .title-factor {
    min-height: 20px;
    padding: 2px 6px;
    font-size: 0.63rem;
  }

  .plan-row-meta {
    width: 100%;
  }

  .row-stat-pills {
    width: 100%;
    justify-content: stretch;
  }

  .row-stat-pill {
    max-width: 100%;
    min-height: 28px;
    padding: 4px 7px;
    font-size: 0.7rem;
  }

  .row-stat-pill.stat-average {
    width: 100%;
    justify-content: space-between;
  }

  .row-stat-label {
    min-width: 0;
    gap: 3px;
  }

  .row-stat-value strong {
    font-size: 0.82rem;
  }

  .row-stat-value small {
    font-size: 0.62rem;
  }

  .row-stat-pill .metric-label-meta {
    min-height: 17px;
    padding: 2px 5px;
    font-size: 0.62rem;
  }

  .row-stat-pill .info-icon {
    width: 15px;
    height: 15px;
  }

  .run-grid {
    gap: 0;
    padding: 8px 7px 9px 10px;
  }

  .week-day-cell {
    min-height: 74px;
    grid-template-rows: auto minmax(24px, 1fr) auto;
    gap: 4px;
    padding: 6px 2px 5px;
  }

  .week-day-cell.start-run {
    min-height: 86px;
  }

  .week-day-abbrev {
    font-size: 0.58rem;
  }

  .week-day-description {
    font-size: 0.52rem;
  }

  .week-day-distance {
    font-size: clamp(0.88rem, 4.45vw, 1.24rem);
  }

  .week-day-distance small {
    display: none;
  }

  .week-day-pace {
    flex-direction: column;
    gap: 2px;
    font-size: 0.55rem;
  }

  .pace-entered-value,
  .pace-threshold-compare {
    max-width: 100%;
    justify-content: center;
  }

  .pace-threshold-compare {
    font-size: 0.78em;
  }

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

  .plan-title-line {
    flex-wrap: wrap;
  }

  .trend-card {
    min-height: 110px;
    gap: 6px;
  }

  .metrics-footer {
    padding: 0 8px max(8px, env(safe-area-inset-bottom));
  }

  .metrics-footer::before {
    height: 154px;
  }

  .metrics-footer-glass {
    border-radius: 10px;
  }

  .metrics-footer-head {
    padding: 8px 9px 6px;
  }

  .metrics-footer-kicker {
    font-size: 0.6rem;
  }

  .metrics-footer-title {
    font-size: 0.84rem;
  }

  .metrics-footer-toggle {
    min-height: 28px;
    padding: 4px 8px;
    font-size: 0.72rem;
  }

  .metrics-footer-body {
    padding: 0 8px 8px;
  }

  .metrics-footer .metric {
    padding: 10px;
  }

  .summary-grid {
    grid-auto-columns: minmax(210px, calc(100% - 36px));
    gap: 8px;
    padding: 1px 34px 4px 2px;
  }

  .metric-title {
    font-size: 0.66rem;
  }

  .metric-value {
    font-size: 1.2rem;
  }

  .metric-slide-prev {
    left: 0;
  }

  .metric-slide-next {
    right: 0;
  }

  .metric-sparkline,
  .metric-empty-spark {
    min-height: 42px;
    height: 42px;
  }

  .metric-slide-button {
    width: 28px;
    height: 40px;
  }

  .share-link-row {
    grid-template-columns: 1fr;
  }

  .admin-row {
    grid-template-columns: 1fr;
  }

  .admin-row-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .section-head,
  .plan-head-actions {
    align-items: flex-start;
  }

  .plan-head-actions {
    align-self: flex-start;
  }

  .section-head {
    flex-direction: column;
  }

  .main {
    padding-inline: 10px;
  }
}
