button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}

button:focus-visible,
a:focus-visible {
  outline: 0;
  box-shadow: var(--focus-ring);
}

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

.auth-page {
  min-height: -webkit-fill-available;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: 100lvh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.auth-panel {
  position: relative;
  overflow: hidden;
  width: min(440px, calc(100vw - 48px));
  max-width: 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 {
  display: grid;
  gap: 14px;
}

.settings-form {
  min-width: 0;
  max-width: 100%;
}

.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);
}

.auth-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.45;
}

.auth-link-button,
.auth-recovery-link {
  justify-self: center;
  background: transparent;
  color: var(--green);
  font-weight: 850;
  text-decoration: none;
}

.auth-link-button:hover,
.auth-recovery-link:hover {
  text-decoration: underline;
}

.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: var(--input-surface);
  color: var(--ink);
  padding: 9px 11px;
}

.field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input-surface);
  color: var(--ink);
  font: inherit;
  font-weight: 760;
  padding: 9px 38px 9px 11px;
}

.field textarea {
  width: 100%;
  min-height: 240px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input-surface);
  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 select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(53, 102, 214, 0.14);
  outline: 0;
}

.field select:disabled {
  opacity: 0.72;
}

.field select[aria-invalid="true"] {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(217, 87, 61, 0.14);
}

.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: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 13px;
  font-weight: 800;
}

.full-width {
  width: 100%;
}

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

.btn-secondary {
  border-color: var(--control-border);
  background: var(--control-surface);
  color: var(--ink);
  box-shadow: var(--control-shadow);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  border-color: color-mix(in srgb, var(--blue) 46%, var(--control-border));
  background: var(--control-surface-hover);
  color: var(--blue);
}

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

.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: var(--message-ink);
  font-weight: 650;
}

.message.error {
  background: var(--coral-soft);
  color: var(--danger-ink);
}

.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: 260;
  display: grid;
  gap: 12px;
  margin-bottom: 0;
  padding: 24px 0 12px;
}

.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;
}

@media (min-width: 1321px) {
  .sticky-dashboard .app-hero {
    margin-inline: max(-20px, calc((1320px - 100vw) / 2));
  }
}

.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.hero-theme-toggle {
  overflow: hidden;
}

.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;
}

.theme-combo-icons {
  position: relative;
  width: 20px;
  height: 18px;
  display: inline-block;
}

.theme-combo-icons .icon {
  position: absolute;
  width: 15px;
  height: 15px;
}

.theme-combo-icons .icon:first-child {
  top: 0;
  left: 0;
}

.theme-combo-icons .icon:last-child {
  right: 0;
  bottom: 0;
}

.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.42);
  background: rgba(18, 24, 33, 0.74);
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.34);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(6px) saturate(1.06);
  -webkit-backdrop-filter: blur(6px) saturate(1.06);
}

.hero-current-week-button:hover,
.hero-current-week-button:focus-visible {
  border-color: rgba(255, 255, 255, 0.68);
  background: rgba(24, 33, 45, 0.9);
  color: white;
}

.mobile-command-bar {
  display: none;
}

.mobile-command-glass,
.mobile-command-controls,
.mobile-command-main,
.mobile-command-pill {
  min-width: 0;
}

.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;
}

.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-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:
    width 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.plan-row-form:has(.info-wrap:hover),
.plan-row-form:has(.info-wrap:focus-within),
.plan-row-form:has(.week-action-menu[open]) {
  z-index: 340;
  overflow: visible;
}

.plan-row-form:has(.week-day-cell.has-run-meta:hover),
.plan-row-form:has(.week-day-cell.has-run-meta:focus-visible),
.plan-row-form:has(.week-day-cell.has-run-meta.is-run-meta-open) {
  z-index: 250;
  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(96, 121, 138, 0.34);
  border-radius: 999px;
  background: var(--current-week-soft);
  color: var(--current-week-deep);
  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(--current-week);
  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);
}

.insert-plan-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid rgba(34, 82, 164, 0.48);
  border-radius: 8px;
  background: #e3eeff;
  box-shadow:
    inset 4px 0 0 rgba(34, 82, 164, 0.82),
    0 10px 22px rgba(30, 45, 70, 0.12);
  padding: 6px 8px 6px 12px;
}

.insert-plan-banner-title {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: max-content;
}

.insert-plan-banner-title strong {
  font-size: 0.9rem;
}

.insert-plan-field {
  flex: 1 1 230px;
}

.insert-plan-week-field {
  flex: 0 0 150px;
}

.insert-plan-banner .field {
  display: flex;
  align-items: center;
  gap: 6px;
}

.insert-plan-banner .field span {
  white-space: nowrap;
}

.insert-plan-field select,
.insert-plan-week-field select {
  min-height: 32px;
  padding-top: 5px;
  padding-bottom: 5px;
}

.insert-plan-banner-estimate {
  flex: 0 0 auto;
  color: #24446f;
  font-size: 0.82rem;
  font-weight: 850;
  white-space: nowrap;
}

.insert-plan-banner-actions {
  flex-wrap: nowrap;
  gap: 6px;
  margin-left: auto;
}

.insert-plan-banner-actions .btn {
  min-height: 32px;
  padding: 5px 10px;
}

.plan-row-form.active {
  border-color: rgba(48, 75, 92, 0.88);
  background:
    linear-gradient(90deg, rgba(96, 121, 138, 0.2), rgba(122, 155, 145, 0.12) 20%, rgba(255, 255, 255, 0.98) 38%),
    linear-gradient(180deg, #ffffff, #f2f6f7);
  box-shadow:
    0 0 0 2px rgba(96, 121, 138, 0.22),
    0 20px 44px rgba(24, 33, 47, 0.14);
}

.plan-row-form.active::before {
  width: 8px;
  background: linear-gradient(180deg, var(--current-week-deep), var(--current-week-accent));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.72),
    0 0 18px rgba(96, 121, 138, 0.38);
}

.plan-row-form.active .row-kicker {
  background: linear-gradient(135deg, var(--current-week-deep), var(--current-week) 62%, var(--current-week-accent));
  color: white;
  box-shadow:
    0 0 0 2px rgba(96, 121, 138, 0.16),
    0 7px 16px rgba(48, 75, 92, 0.18);
}

.plan-row-form.active .plan-row-main {
  border-bottom-color: rgba(96, 121, 138, 0.3);
  background: rgba(255, 255, 255, 0.88);
}

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

.plan-row-form.active .week-day-cell {
  border-color: rgba(192, 204, 212, 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.42);
  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 > :not(.week-day-meta-tooltip) {
  filter: blur(var(--planning-content-blur, 7px)) saturate(0.78);
  transition: filter 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:
    linear-gradient(180deg, rgba(255, 255, 255, var(--planning-veil, 0.48)), rgba(255, 255, 255, 0.06)),
    repeating-linear-gradient(135deg, rgba(102, 112, 133, 0.08) 0 1px, transparent 1px 8px);
  content: "";
  pointer-events: none;
  transition: background 420ms ease;
}

.plan-row-form.context-row {
  border-color: rgba(215, 221, 231, 0.74);
  background: rgba(250, 252, 255, 0.86);
  box-shadow: none;
}

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

.plan-row-form.context-row .week-day-cell {
  border-color: rgba(215, 221, 231, 0.68);
  background: rgba(255, 255, 255, 0.72);
  color: #596579;
  box-shadow: none;
}

.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.34;
  filter: blur(1.1px) saturate(0.84);
  transform: scale(1.004);
  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;
}

.beyond-row-shell {
  position: relative;
  z-index: 0;
  display: grid;
  min-width: 0;
  overflow: visible;
}

.beyond-row-shell:has(.beyond-action-menu[open]) {
  z-index: 340;
  overflow: visible;
}

.plan-row-form.beyond-row {
  min-height: 104px;
  height: clamp(104px, 10vw, 132px);
  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 {
  height: 100%;
  overflow: hidden;
  opacity: 0.24;
  filter: blur(2.1px) saturate(0.64);
  transform: scale(1.012);
}

.beyond-row .future-row-overlay {
  gap: 5px;
  padding: 12px;
  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);
}

.title-factor.meta-recovery {
  background: rgba(44, 102, 184, 0.13);
  color: #2c66b8;
}

.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;
}

.week-action-menu {
  position: relative;
  flex: 0 0 auto;
}

.beyond-action-menu {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 350;
}

.week-action-menu-toggle {
  list-style: none;
  cursor: pointer;
}

.week-action-menu-toggle::-webkit-details-marker {
  display: none;
}

.week-action-menu-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 360;
  width: min(260px, calc(100vw - 32px));
  display: grid;
  gap: 4px;
  border: 1px solid rgba(192, 202, 214, 0.86);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 42px rgba(26, 35, 50, 0.18);
  padding: 8px;
}

.beyond-action-menu .week-action-menu-panel {
  top: calc(100% + 8px);
  bottom: auto;
  z-index: 360;
  isolation: isolate;
  background: #fff;
}

.week-action-menu.reset-only .week-action-menu-panel {
  width: min(220px, calc(100vw - 32px));
}

.week-action-menu-item {
  width: 100%;
  display: grid;
  gap: 2px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  padding: 9px 10px;
  text-align: left;
}

.week-action-submenu {
  position: relative;
}

.week-action-submenu-toggle {
  list-style: none;
  cursor: pointer;
}

.week-action-submenu-toggle::-webkit-details-marker {
  display: none;
}

.week-action-submenu-toggle strong::after {
  content: "›";
  float: right;
  color: var(--muted);
  font-size: 1rem;
  line-height: 0.85;
}

.week-action-submenu[open] > .week-action-submenu-toggle {
  background: rgba(230, 239, 247, 0.82);
}

.week-action-submenu-panel {
  display: grid;
  gap: 4px;
  margin-top: 4px;
  padding: 4px;
  border-radius: 10px;
  background: rgba(244, 248, 251, 0.9);
  border: 1px solid rgba(224, 231, 238, 0.9);
}

.week-action-menu-item strong {
  font-size: 0.86rem;
  line-height: 1.1;
}

.week-action-menu-item span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 720;
}

.week-action-menu-item:not(:disabled):hover,
.week-action-menu-item:not(:disabled):focus-visible {
  background: rgba(230, 239, 247, 0.82);
  outline: 0;
}

.week-action-menu-item.danger strong {
  color: #9d2b18;
}

.week-action-menu-item.danger:not(:disabled):hover,
.week-action-menu-item.danger:not(:disabled):focus-visible {
  background: rgba(255, 232, 226, 0.86);
}

.week-action-menu-item:disabled {
  cursor: default;
  opacity: 0.46;
}

.week-action-menu-divider {
  display: block;
  height: 1px;
  margin: 4px 2px;
  background: rgba(226, 231, 238, 0.94);
}

.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;
}

.week-action-menu > .week-action-menu-toggle {
  border-color: rgba(96, 121, 138, 0.28);
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  box-shadow: 0 8px 18px rgba(37, 49, 68, 0.06);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.week-action-menu > .week-action-menu-toggle:hover,
.week-action-menu > .week-action-menu-toggle:focus-visible,
.week-action-menu[open] > .week-action-menu-toggle {
  border-color: rgba(53, 102, 214, 0.46);
  background: rgba(239, 246, 255, 0.94);
  color: var(--blue);
  box-shadow: 0 10px 22px rgba(53, 102, 214, 0.12);
  outline: 0;
}

.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.has-run-meta {
  cursor: help;
  overflow: visible;
}

.week-day-elevation-trace {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  color: rgba(47, 128, 98, 0.24);
  opacity: 0.62;
  mix-blend-mode: multiply;
  overflow: visible;
  pointer-events: none;
}

.week-day-elevation-trace polyline {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
  vector-effect: non-scaling-stroke;
}

.week-day-cell.has-elevation-trace > :not(.week-day-elevation-trace):not(.week-day-meta-tooltip):not(.week-day-source-badge) {
  position: relative;
  z-index: 1;
}

.week-day-cell.has-elevation-trace::before {
  z-index: 2;
}

.week-day-source-badge {
  position: absolute;
  right: 7px;
  bottom: 7px;
  z-index: 3;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(47, 128, 98, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--green);
  box-shadow: 0 4px 10px rgba(37, 49, 68, 0.08);
  pointer-events: none;
}

.week-day-cell.has-source-badge .week-day-pace-wrap { box-sizing: border-box; padding-right: 22px; }

.week-day-source-badge .icon {
  width: 12px;
  height: 12px;
  stroke-width: 2.2;
}

.week-day-cell.has-run-meta:hover,
.week-day-cell.has-run-meta:focus-visible,
.week-day-cell.has-run-meta.is-run-meta-open {
  position: relative;
  z-index: 260;
  border-color: rgba(96, 121, 138, 0.46);
  outline: 0;
  box-shadow:
    0 0 0 2px rgba(96, 121, 138, 0.12),
    0 12px 24px rgba(37, 49, 68, 0.1);
}

.week-day-meta-tooltip {
  z-index: var(--z-floating-popover);
  transition-delay: 0s;
}

.week-day-cell.has-run-meta:hover .week-day-meta-tooltip {
  opacity: 1;
  transform: translate(-50%, -100%);
  transition-delay: 0.38s;
  visibility: visible;
}

.week-day-cell.has-run-meta:focus-visible .week-day-meta-tooltip,
.week-day-cell.has-run-meta.is-run-meta-open .week-day-meta-tooltip {
  opacity: 1;
  transform: translate(-50%, -100%);
  transition-delay: 0s;
  visibility: visible;
}

.week-day-cell.has-run-meta:hover .week-day-meta-tooltip.is-below,
.week-day-cell.has-run-meta:focus-visible .week-day-meta-tooltip.is-below,
.week-day-cell.has-run-meta.is-run-meta-open .week-day-meta-tooltip.is-below {
  transform: translate(-50%, 0);
}

.week-day-cell.has-run-meta.is-run-meta-open .week-day-meta-tooltip:not(.run-meta-tooltip-portal) {
  opacity: 0;
  transform: translate(-50%, calc(-100% + 5px));
  visibility: hidden;
}

.week-day-cell.has-run-meta.is-run-meta-open .week-day-meta-tooltip.is-below:not(.run-meta-tooltip-portal) {
  transform: translate(-50%, -5px);
}

.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);
}

@media (hover: none), (pointer: coarse) {
  button.week-day-cell:hover,
  .plan-row-form.active button.week-day-cell.needs-pace:hover,
  button.week-day-cell.pace-complete:hover {
    transform: none;
  }

  .week-day-cell.has-run-meta {
    cursor: pointer;
  }

  .week-day-cell.has-run-meta:hover .week-day-meta-tooltip {
    opacity: 0;
    transform: translate(-50%, calc(-100% + 5px));
    transition-delay: 0s;
    visibility: hidden;
  }

  .week-day-cell.has-run-meta:hover .week-day-meta-tooltip.is-below {
    transform: translate(-50%, -5px);
  }

  .week-day-cell.has-run-meta.is-run-meta-open .week-day-meta-tooltip,
  .week-day-cell.has-run-meta:focus-visible .week-day-meta-tooltip {
    opacity: 1;
    transform: translate(-50%, -100%);
    visibility: visible;
  }

  .week-day-cell.has-run-meta.is-run-meta-open .week-day-meta-tooltip.is-below,
  .week-day-cell.has-run-meta:focus-visible .week-day-meta-tooltip.is-below {
    transform: translate(-50%, 0);
  }

}

.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%, 320px);
  color: #3b4558;
  font-size: clamp(0.78rem, 2.15vw, 1rem);
  font-weight: 920;
  line-height: 1.14;
  text-overflow: ellipsis;
  white-space: normal;
}

.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-achieved {
  max-width: 100%;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  overflow: hidden;
}

.week-day-achieved-distance {
  max-width: 100%;
  color: #7b8796;
  font-size: 0.7rem;
  font-weight: 860;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.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-adjusted-suffix {
  font-size: 0.82em;
  font-weight: 900;
  letter-spacing: 0;
}

.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(--input-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: var(--settings-row-muted-surface);
  color: var(--muted);
  opacity: 1;
}

.input-action input[aria-invalid="true"] {
  border-color: var(--coral);
  background: var(--settings-invalid-surface);
  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 var(--control-border);
  border-radius: 8px;
  background: var(--control-surface);
  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;
}

.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;
}

.metric-label-meta.meta-recovery {
  background: rgba(44, 102, 184, 0.13);
  color: #2c66b8;
}

.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);
}

.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;
}
