/* All onboarding and workspace UI is external to comply with the portal CSP. */
[hidden] {
  display: none !important;
}
.guide-focus
  .tab-panel:not(#tab-energi):not(#tab-skador):not(.guide-explicit-science)
  [data-view-science] {
  display: none !important;
}
/* Explicitly opening theory also works with an older saved practical profile. */
html[data-view-science="false"]
  :is(#tab-energi, #tab-skador, .guide-explicit-science)
  :is([data-view-science], .portal-quote, .theory-accordion):not(.hidden):not([hidden]) {
  display: revert !important;
}
.guide-micro {
  color: var(--text-dim, #b5bcc8);
  font-size: 0.875rem;
  line-height: 1.5;
  margin-block: 0 0.75rem;
}
.guide-segments {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  max-width: 100%;
  margin-block: 1rem;
}
html .guide-segments .seg-btn {
  white-space: normal;
  min-height: 44px;
  flex: 1 1 auto;
  padding: 0.65rem 0.8rem;
}
html .guide-segments .seg-btn.is-active {
  border-bottom: 3px solid var(--accent, #65dce9);
}
#portal-reference-group {
  width: 100%;
}
#portal-reference-group summary {
  padding: 0.75rem;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-dim, #aeb8c4);
}
#portal-reference-group .tab-btn {
  width: 100%;
}
.portal-shell,
#main-content,
.tab-panel {
  min-width: 0;
  max-width: 100%;
}
.week-heading {
  align-items: start;
  flex-wrap: wrap;
}
.week-heading > :first-child {
  flex: 1 1 12rem;
  min-width: 0;
}
.guide-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.guide-header-actions button,
.guide-header-actions summary,
.guide-checklist button,
.guide-mode {
  border: 1px solid var(--line-strong, #49515b);
  border-radius: var(--control-radius, 0.5rem);
  padding: 0.5rem 0.7rem;
  cursor: pointer;
  background: var(--surface, #20252a);
  color: var(--text-main, #e9edf2);
  box-shadow: var(--shadow-subpanel, inset 0 1px 0 0 rgba(255, 255, 255, 0.04));
  min-height: 44px;
  font-size: 0.8125rem;
  font-weight: 600;
  transition:
    background-color 150ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
    border-color 150ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
    color 150ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
    transform 100ms var(--ease-press, cubic-bezier(0.23, 1, 0.32, 1));
}
@media (hover: hover) and (pointer: fine) {
  :is(
    .guide-header-actions button,
    .guide-header-actions summary,
    .guide-checklist button,
    .guide-mode
  ):hover {
    background: var(--surface-elevated, #222a35);
    border-color: var(--accent-border, rgba(101, 220, 233, 0.42));
    color: var(--text-main, #f3f5f8);
  }
}
.guide-header-actions .guide-open {
  min-width: 44px;
  padding-inline: 0.5rem;
  background: transparent;
  border-color: var(--line, #414953);
  color: var(--text-dim, #b5bcc8);
}
.guide-mode {
  width: 100%;
  justify-content: center;
  font-size: 0.75rem;
}
#guide-data {
  position: relative;
}
#guide-data:not([open]) > .week-data-actions {
  display: none;
}
#guide-data .week-data-actions {
  position: absolute;
  inset-inline-end: 0;
  top: 100%;
  z-index: var(--z-dropdown, 60);
  display: grid;
  gap: 0.6rem;
  background: var(--surface, #191d23);
  margin-top: 0.5rem;
  padding: 1rem;
  border: 1px solid var(--line-strong, #49515b);
  border-radius: 0.6rem;
  width: min(340px, calc(100vw - 32px));
  max-height: 65dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.guide-checklist {
  border: 1px solid var(--line, #414953);
  border-radius: 0.7rem;
  padding: 0.65rem 1rem;
  background: var(--surface, #1b2026);
}
.guide-checklist summary {
  cursor: pointer;
  font-weight: 600;
}
.guide-checklist ol {
  padding-left: 1.3rem;
  display: grid;
  gap: 0.5rem;
  margin-block: 0.7rem;
}
.guide-checklist li {
  font-size: 0.8rem;
}
@keyframes guide-dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
#guide-dialog {
  background: var(--surface);
  color: var(--text-main, #f3f5f8);
  border: 1px solid var(--line-strong, rgb(227 234 245 / 23%));
  border-top: 2px solid var(--accent, #65dce9);
  border-radius: var(--card-radius, 14px);
  box-shadow: var(--shadow-elevated, 0 28px 68px rgba(0, 0, 0, 0.68));
  padding: 1.5rem;
  width: min(560px, calc(100vw - 1.5rem));
  max-height: min(90dvh, 840px);
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: auto;
}
#guide-dialog:modal {
  overscroll-behavior: contain;
}
html:has(#guide-dialog[open]) {
  overflow: hidden;
}
#guide-dialog[open] {
  animation: guide-dialog-in var(--duration-modal, 260ms)
    var(--ease-drawer, cubic-bezier(0.32, 0.72, 0, 1));
}
@media (prefers-reduced-motion: reduce) {
  #guide-dialog[open] {
    animation: none;
  }
}
#guide-dialog::backdrop {
  background: rgb(5 9 14 / 82%);
  overflow: hidden;
  overscroll-behavior: contain;
}
@media (prefers-reduced-transparency: reduce) {
  #guide-dialog::backdrop {
    background: rgba(11, 14, 20, 0.96) !important;
  }
}
.guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.85rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--line, rgb(227 234 245 / 11%));
}
.guide-header-meta {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1 1 auto;
  min-width: 0;
}
.guide-stepper {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.35rem;
  width: 100%;
  max-width: 26rem;
}
#guide-dialog .guide-step-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.32rem;
  min-height: 34px;
  padding: 0.22rem 0.45rem;
  border-radius: 999px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-meta, #a1afbf);
  background: var(--bg, #11141a);
  border: 1px solid var(--line-strong, rgb(227 234 245 / 23%));
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}
@media (hover: hover) and (pointer: fine) {
  #guide-dialog .guide-step-pill:hover {
    border-color: var(--accent-border, #65dce96b);
    color: var(--text-main, #f3f5f8);
  }
}
.guide-step-num {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
  background: rgb(227 234 245 / 8%);
  color: inherit;
  flex-shrink: 0;
}
.guide-step-lbl {
  font-family: inherit;
  font-size: 0.71rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#guide-dialog .guide-step-pill.is-active {
  background: var(--accent-soft, rgb(101 220 233 / 18%));
  border-color: var(--accent, #65dce9);
  color: var(--accent, #65dce9);
}
#guide-dialog .guide-step-pill.is-active .guide-step-num {
  background: var(--accent, #65dce9);
  color: var(--brand-on-primary, #091118);
}
#guide-dialog .guide-step-pill.is-done {
  background: var(--surface-elevated);
  border-color: var(--line-strong);
  color: var(--text-dim);
}
#guide-dialog .guide-step-pill.is-done .guide-step-num {
  background: var(--text-dim);
  color: var(--bg);
}
.guide-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 1.25rem;
  line-height: 1;
  background: var(--surface-elevated, #222a35);
  color: var(--text-dim, #bdc8d6);
  border: 1px solid var(--line-strong, rgb(227 234 245 / 23%));
  border-radius: 0.6rem;
  transition:
    border-color 150ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
    color 150ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
    background-color 150ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1));
}
@media (hover: hover) and (pointer: fine) {
  .guide-close:hover {
    color: var(--text-main, #f3f5f8);
    border-color: var(--accent-border, #65dce96b);
    background: var(--accent-soft, #65dce91c);
  }
}
#guide-progress {
  color: var(--accent, #65dce9);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
}
#guide-dialog h2 {
  font-size: 1.3rem;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main, #f3f5f8);
  margin: 0 0 1.1rem;
}
#guide-dialog button {
  padding: 0.7rem 0.95rem;
  border: 1px solid var(--line-strong, rgb(227 234 245 / 23%));
  border-radius: var(--control-radius, 8px);
  cursor: pointer;
  min-height: 44px;
  transition:
    background-color var(--duration-fast, 150ms) var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
    border-color var(--duration-fast, 150ms) var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
    color var(--duration-fast, 150ms) var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
    transform 160ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1));
}
#guide-dialog button:active {
  transform: scale(0.97);
  transition-duration: 100ms;
}
#guide-dialog :is(button, input, select):focus-visible {
  outline: 2px solid var(--accent, #65dce9);
  outline-offset: 2px;
}
#guide-dialog [data-guide-page="1"] {
  display: grid;
  gap: 0.75rem;
}
#guide-dialog [data-guide-choice] {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  min-height: 60px;
  padding: 0.85rem 1rem;
  text-align: left;
  background: var(--surface-elevated, #222a35);
  color: var(--text-main, #f3f5f8);
  border: 1px solid var(--line, rgb(227 234 245 / 11%));
  border-radius: var(--subpanel-radius, 10px);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.04);
  transition:
    border-color var(--duration-fast, 150ms) var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
    background-color var(--duration-fast, 150ms) var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
    transform 160ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
    box-shadow var(--duration-fast, 150ms) var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1));
}
@media (hover: hover) and (pointer: fine) {
  #guide-dialog [data-guide-choice]:hover {
    border-color: var(--accent-border, #65dce96b);
    background: var(--surface-elevated, #222a35);
  }
}
#guide-dialog [data-guide-choice]:active {
  transform: scale(0.98);
  transition-duration: 100ms;
}
#guide-dialog [data-guide-choice][aria-pressed="true"] {
  border-color: var(--accent, #65dce9);
  background: var(--accent-soft);
}
.guide-choice-icon {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg, #11141a);
  border: 1px solid var(--line, rgb(227 234 245 / 11%));
  color: var(--accent, #65dce9);
  flex-shrink: 0;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    color 150ms ease;
}
#guide-dialog [data-guide-choice][aria-pressed="true"] .guide-choice-icon {
  background: rgb(101 220 233 / 16%);
  border-color: var(--accent, #65dce9);
  color: var(--kpi-emerald, #34d399);
}
.guide-choice-icon svg {
  width: 1.15rem;
  height: 1.15rem;
}
.guide-choice-body {
  min-width: 0;
}
.guide-choice-title {
  display: block;
  font-weight: 700;
  font-size: 0.96rem;
  color: var(--text-main, #f3f5f8);
}
.guide-choice-arrow {
  color: var(--text-meta, #a1afbf);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.95rem;
  transition:
    transform 150ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
    color 150ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1));
}
#guide-dialog [data-guide-choice][aria-pressed="true"] .guide-choice-arrow {
  color: var(--accent, #65dce9);
  transform: translateX(2px);
}
@media (hover: hover) and (pointer: fine) {
  #guide-dialog [data-guide-choice]:hover .guide-choice-arrow {
    color: var(--accent, #65dce9);
    transform: translateX(2px);
  }
}
#guide-dialog small {
  display: block;
  color: var(--text-dim, #bdc8d6);
  margin-top: 0.2rem;
  font-weight: 400;
  font-size: 0.82rem;
  line-height: 1.4;
}
#guide-dialog .guide-fields-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}
#guide-dialog .guide-field-full {
  grid-column: 1 / -1;
}
#guide-dialog label {
  display: grid;
  gap: 0.35rem;
}
#guide-dialog label > span {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim, #bdc8d6);
}
#guide-dialog input,
#guide-dialog select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  background: var(--bg, #11141a);
  color: var(--text-main, #f3f5f8);
  border: 1px solid var(--line-strong, rgb(227 234 245 / 23%));
  padding: 0.65rem 0.75rem;
  border-radius: 0.55rem;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}
#guide-dialog input:focus,
#guide-dialog select:focus {
  border-color: var(--accent, #65dce9);
}
.guide-returning-strip {
  margin-top: 0.35rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line, rgb(227 234 245 / 11%));
  display: grid;
  gap: 0.55rem;
}
.guide-returning-label {
  font-size: 0.78rem;
  color: var(--text-meta, #a1afbf);
  font-weight: 500;
}
.guide-returning-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
#guide-dialog .guide-returning-btn {
  flex: 1 1 11rem;
  min-height: 44px;
  padding: 0.55rem 0.85rem;
  background: var(--bg, #11141a);
  color: var(--accent, #65dce9);
  border: 1px solid var(--line-strong, rgb(227 234 245 / 23%));
  border-radius: 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    color 150ms ease;
}
@media (hover: hover) and (pointer: fine) {
  #guide-dialog .guide-returning-btn:hover {
    border-color: var(--accent-border, #65dce96b);
    background: var(--accent-soft, #65dce91c);
    color: var(--accent-hover, #9deaf3);
  }
}
#guide-dialog .guide-returning-btn#guide-returning-import {
  color: var(--kpi-emerald, #34d399);
}
@media (hover: hover) and (pointer: fine) {
  #guide-dialog .guide-returning-btn#guide-returning-import:hover {
    border-color: rgb(52 211 153 / 50%);
    background: rgb(52 211 153 / 12%);
    color: #6ee7b7;
  }
}
.guide-bw-wrap {
  display: grid;
  gap: 0.35rem;
}
.guide-bw-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: center;
}
#guide-dialog .guide-bw-row input {
  text-align: center;
  font-weight: 700;
  font-size: 1.05rem;
}
#guide-dialog .guide-nudge-btn {
  min-width: 52px;
  min-height: 44px;
  padding: 0 0.75rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--surface-elevated, #222a35);
  color: var(--text-main, #f3f5f8);
  border-color: var(--line-strong, rgb(227 234 245 / 23%));
}
@media (hover: hover) and (pointer: fine) {
  #guide-dialog .guide-nudge-btn:hover {
    border-color: var(--accent-border, #65dce96b);
    background: var(--accent-soft, #65dce91c);
    color: var(--accent, #65dce9);
  }
}
.guide-age-helper {
  margin-top: 0.75rem;
  border: 1px solid var(--line, rgb(227 234 245 / 11%));
  border-radius: 0.65rem;
  background: var(--bg, #11141a);
  padding: 0.5rem 0.85rem;
}
.guide-age-helper summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent, #65dce9);
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.guide-age-row {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--line, rgb(227 234 245 / 11%));
  display: grid;
  grid-template-columns: auto 5.5rem minmax(0, 1fr);
  align-items: center;
  gap: 0.6rem;
}
.guide-age-row label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim, #bdc8d6);
}
#guide-dialog .guide-age-row input {
  text-align: center;
  font-weight: 700;
}
#guide-dialog .guide-age-btn {
  min-height: 44px;
  padding: 0.55rem 0.85rem;
  background: rgb(101 220 233 / 14%);
  border: 1px solid var(--accent-border, #65dce96b);
  color: var(--accent, #65dce9);
  font-size: 0.8rem;
  font-weight: 700;
}
@media (hover: hover) and (pointer: fine) {
  #guide-dialog .guide-age-btn:hover {
    background: rgb(101 220 233 / 22%);
    border-color: var(--accent, #65dce9);
  }
}
.guide-live-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 0.95rem;
}
.guide-zones-ribbon {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem 1rem;
  padding: 0.55rem 0.85rem;
  border-radius: 0.6rem;
  background: var(--bg, #11141a);
  border: 1px solid var(--line, rgb(227 234 245 / 11%));
  font-size: 0.78rem;
}
.guide-zones-ribbon span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-dim, #bdc8d6);
}
.guide-zones-ribbon strong {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  padding: 0.12rem 0.42rem;
  border-radius: 0.35rem;
  background: rgb(101 220 233 / 12%);
  color: var(--accent, #65dce9);
}
.guide-zones-ribbon em {
  font-style: normal;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-main, #f3f5f8);
}
.guide-kpi-card {
  display: grid;
  gap: 0.25rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--subpanel-radius, 10px);
  background: var(--surface-subtle);
  border: 1px solid var(--line);
}
.guide-kpi-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim, #bdc8d6);
  letter-spacing: 0.01em;
}
.guide-kpi-value {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent, #65dce9);
  line-height: 1.25;
}
.guide-kpi-card:nth-child(2) .guide-kpi-value {
  color: var(--kpi-emerald, #34d399);
}
.guide-tips-list {
  display: grid;
  gap: 0.6rem;
}
.guide-step-kicker {
  margin: 0 0 0.9rem;
  padding: 0.55rem 0.85rem;
  border-radius: 0.6rem;
  background: rgb(101 220 233 / 8%);
  border: 1px solid rgb(101 220 233 / 24%);
  color: var(--text-main, #e9edf2);
  font-size: 0.83rem;
  font-weight: 500;
  line-height: 1.45;
}
/* Step 3: View preset + extra tools selector */
.guide-preset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}
#guide-dialog .guide-preset-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 0.75rem 0.8rem;
  text-align: left;
  background: var(--surface-elevated, #222a35);
  border: 1px solid var(--line, rgb(227 234 245 / 11%));
  border-radius: 0.65rem;
  color: var(--text-main, #f3f5f8);
}
#guide-dialog .guide-preset-card strong {
  font-size: 0.88rem;
  line-height: 1.25;
}
#guide-dialog .guide-preset-card small {
  font-size: 0.74rem;
  line-height: 1.35;
  margin: 0;
}
#guide-dialog .guide-preset-card[aria-pressed="true"] {
  border-color: var(--accent, #65dce9);
  background: var(--accent-soft);
}
.guide-preset-badge {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.12rem 0.42rem;
  border-radius: 999px;
  color: var(--text-dim);
}
.guide-extra-block {
  padding: 0.85rem;
  border-radius: 0.7rem;
  background: var(--bg, #11141a);
  border: 1px solid var(--line, rgb(227 234 245 / 11%));
  margin-bottom: 0.85rem;
}
.guide-extra-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}
.guide-extra-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-dim, #bdc8d6);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.guide-tools-summary {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent, #65dce9);
}
.guide-extra-tools-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
#guide-dialog .guide-tool-chip {
  min-height: 40px;
  padding: 0.42rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--surface-elevated, #222a35);
  color: var(--text-dim, #bdc8d6);
  border: 1px solid var(--line-strong, rgb(227 234 245 / 20%));
}
#guide-dialog .guide-tool-chip[aria-pressed="true"] {
  background: rgb(101 220 233 / 16%);
  border-color: var(--accent, #65dce9);
  color: var(--text-main, #f3f5f8);
  box-shadow: inset 0 0 0 1px rgb(101 220 233 / 35%);
}
.guide-nav-preview-wrap {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--line, rgb(227 234 245 / 12%));
  display: grid;
  gap: 0.4rem;
}
.guide-nav-preview-lbl {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-meta, #a1afbf);
}
.guide-nav-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.guide-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--surface-elevated, #222a35);
  color: var(--text-main, #f3f5f8);
  border: 1px solid var(--line, rgb(227 234 245 / 14%));
}
.guide-nav-pill.is-core {
  border-color: rgb(52 211 153 / 38%);
  background: rgb(52 211 153 / 11%);
  color: #a7f3d0;
}
.guide-nav-pill.is-added {
  border-color: rgb(101 220 233 / 42%);
  background: rgb(101 220 233 / 12%);
  color: #bae6fd;
}
.guide-detail-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.65rem;
}
#guide-dialog .guide-caveman-btn {
  min-height: 44px;
  padding: 0.55rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--surface-elevated, #222a35);
  color: var(--text-dim, #bdc8d6);
  border: 1px solid var(--line-strong, rgb(227 234 245 / 23%));
  white-space: nowrap;
}
#guide-dialog .guide-caveman-btn[aria-pressed="true"] {
  background: rgb(245 158 11 / 16%);
  border-color: #f59e0b;
  color: #fde68a;
}

/* Step 4: Native accessible sliders & readiness check */
.guide-sliders-stack {
  display: grid;
  gap: 0.85rem;
}
.guide-slider-row {
  display: grid;
  gap: 0.25rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.65rem;
  background: var(--bg, #11141a);
  border: 1px solid var(--line, rgb(227 234 245 / 11%));
}
.guide-slider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
#guide-dialog .guide-slider-head label {
  display: inline;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main, #f3f5f8);
}
.guide-slider-val {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent, #65dce9);
}
#guide-dialog input[type="range"].guide-range {
  --slider-track-size: 0.5rem;
  --slider-thumb-size: 1.35rem;
  --slider-track-radius: 999px;
  --slider-thumb-radius: 50%;
  --slider-track-color: #27313f;
  --slider-fill-color: var(--accent, #65dce9);
  --slider-thumb-color: #f3f5f8;
  --slider-direction: to right;
  --attr-min: 0;
  --attr-max: 2;
  --control-value: 2;
  --slider-progress: calc(progress(var(--control-value), var(--attr-min), var(--attr-max)) * 100%);
  appearance: none;
  inline-size: 100%;
  block-size: 2.75rem;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}
@supports not (opacity: progress(1, 0, 100)) {
  #guide-dialog input[type="range"].guide-range {
    --slider-progress: calc(
      (var(--control-value) - var(--attr-min)) / (var(--attr-max) - var(--attr-min)) * 100%
    );
  }
}
#guide-dialog input[type="range"].guide-range::-webkit-slider-runnable-track {
  block-size: var(--slider-track-size);
  border: 0;
  border-radius: var(--slider-track-radius);
  background: linear-gradient(
    var(--slider-direction),
    var(--slider-fill-color) var(--slider-progress),
    var(--slider-track-color) var(--slider-progress)
  );
}
#guide-dialog input[type="range"].guide-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  inline-size: var(--slider-thumb-size);
  block-size: var(--slider-thumb-size);
  margin-block-start: calc((var(--slider-track-size) - var(--slider-thumb-size)) / 2);
  border: 2px solid var(--slider-fill-color);
  border-radius: var(--slider-thumb-radius);
  background: var(--slider-thumb-color);
  box-shadow: 0 2px 8px rgb(0 0 0 / 45%);
}
#guide-dialog input[type="range"].guide-range::-moz-range-track {
  block-size: var(--slider-track-size);
  border: 0;
  border-radius: var(--slider-track-radius);
  background: var(--slider-track-color);
}
#guide-dialog input[type="range"].guide-range::-moz-range-progress {
  block-size: var(--slider-track-size);
  border-radius: var(--slider-track-radius);
  background: var(--slider-fill-color);
}
#guide-dialog input[type="range"].guide-range::-moz-range-thumb {
  inline-size: var(--slider-thumb-size);
  block-size: var(--slider-thumb-size);
  border: 2px solid var(--slider-fill-color);
  border-radius: var(--slider-thumb-radius);
  background: var(--slider-thumb-color);
}
#guide-dialog input[type="range"].guide-range:focus-visible {
  outline: 2px solid var(--accent, #65dce9);
  outline-offset: 4px;
}
.guide-range-stops {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  margin-top: 0.1rem;
}
#guide-dialog .guide-range-stops button {
  min-height: 36px;
  padding: 0.3rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 0.5rem;
  background: var(--surface-elevated, #222a35);
  color: var(--text-dim, #bdc8d6);
  border: 1px solid var(--line, rgb(227 234 245 / 11%));
}
@media (hover: hover) and (pointer: fine) {
  #guide-dialog .guide-range-stops button:hover {
    border-color: var(--accent-border, #65dce96b);
    color: var(--text-main, #f3f5f8);
  }
}
#guide-dialog .guide-range-stops button[aria-pressed="true"] {
  background: rgb(101 220 233 / 16%);
  border-color: var(--accent, #65dce9);
  color: var(--text-main, #f3f5f8);
  box-shadow: inset 0 0 0 1px rgb(101 220 233 / 35%);
}
.guide-hr-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.65rem;
  background: var(--bg, #11141a);
  border: 1px solid var(--line, rgb(227 234 245 / 11%));
}
#guide-dialog .guide-hr-inline label {
  display: inline;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main, #f3f5f8);
}
.guide-hr-stepper {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
#guide-dialog .guide-hr-stepper button {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  font-size: 1.05rem;
  font-weight: 700;
  background: var(--surface-elevated, #222a35);
  color: var(--text-main, #f3f5f8);
}
#guide-dialog .guide-hr-stepper input {
  width: 5.2rem;
  text-align: center;
  font-weight: 700;
}
.guide-readiness-live {
  margin-top: 0.9rem;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.95rem;
  background: rgb(52 211 153 / 10%);
  border: 1px solid rgb(52 211 153 / 36%);
}
.guide-readiness-live.is-cyan {
  background: rgb(101 220 233 / 10%);
  border-color: rgb(101 220 233 / 38%);
}
.guide-readiness-live.is-amber {
  background: rgb(245 158 11 / 12%);
  border-color: rgb(245 158 11 / 42%);
}
.guide-rdy-ring-wrap {
  position: relative;
  width: 3.75rem;
  height: 3.75rem;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.guide-rdy-ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.guide-rdy-ring-bg {
  fill: none;
  stroke: rgb(227 234 245 / 12%);
  stroke-width: 4;
}
.guide-rdy-ring-fg {
  fill: none;
  stroke: var(--kpi-emerald, #34d399);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 125.66;
  stroke-dashoffset: calc(125.66 * (1 - var(--rdy-pct, 100) / 100));
  transition:
    stroke-dashoffset 240ms ease,
    stroke 180ms ease;
}
.guide-readiness-live.is-cyan .guide-rdy-ring-fg {
  stroke: var(--accent, #65dce9);
}
.guide-readiness-live.is-amber .guide-rdy-ring-fg {
  stroke: #fbbf24;
}
.guide-rdy-meta {
  display: grid;
  gap: 0.16rem;
  min-width: 0;
}
.guide-rdy-kicker {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim, #bdc8d6);
}
.guide-rdy-badge {
  font-size: 0.94rem;
  color: var(--text-main, #f3f5f8);
}
.guide-rdy-plan {
  font-size: 0.78rem;
  color: var(--text-dim, #bdc8d6);
  line-height: 1.4;
}
.guide-rdy-score {
  position: absolute;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.85rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--kpi-emerald, #34d399);
}
.guide-readiness-live.is-cyan .guide-rdy-score {
  color: var(--accent, #65dce9);
}
.guide-readiness-live.is-amber .guide-rdy-score {
  color: #fbbf24;
}

/* Step 5: Personalized 1-5 summary */
.guide-summary-list {
  list-style: none;
  margin: 0 0 0.85rem;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.guide-summary-list li {
  display: block;
  padding: 0;
  margin: 0;
}
#guide-dialog .guide-sum-row-btn {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 46px;
  padding: 0.55rem 0.85rem;
  text-align: left;
  border-radius: 0.6rem;
  background: var(--bg, #11141a);
  border: 1px solid var(--line, rgb(227 234 245 / 11%));
  font-size: 0.82rem;
}
@media (hover: hover) and (pointer: fine) {
  #guide-dialog .guide-sum-row-btn:hover {
    border-color: var(--accent-border, #65dce96b);
    background: var(--surface-elevated, #222a35);
  }
}
.guide-sum-idx {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgb(52 211 153 / 18%);
  color: var(--kpi-emerald, #34d399);
}
.guide-sum-label {
  color: var(--text-dim, #bdc8d6);
  font-weight: 600;
}
.guide-summary-list strong {
  text-align: right;
  color: var(--text-main, #f3f5f8);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
}
.guide-sum-edit {
  color: var(--text-meta, #a1afbf);
  font-size: 0.82rem;
}
@media (hover: hover) and (pointer: fine) {
  #guide-dialog .guide-sum-row-btn:hover .guide-sum-edit {
    color: var(--accent, #65dce9);
  }
}
.guide-launch-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}
#guide-dialog .guide-launch-tile {
  display: grid;
  gap: 0.22rem;
  align-content: start;
  text-align: left;
  padding: 0.75rem 0.85rem;
  border-radius: 0.65rem;
  background: var(--surface-elevated, #222a35);
  border: 1px solid var(--line, rgb(227 234 245 / 12%));
  color: var(--text-main, #f3f5f8);
}
@media (hover: hover) and (pointer: fine) {
  #guide-dialog .guide-launch-tile:hover {
    border-color: var(--accent-border, #65dce96b);
    background: var(--surface-elevated, #222a35);
  }
}
#guide-dialog .guide-launch-tile.is-recommended {
  border-color: var(--accent-border);
  background: var(--accent-soft);
}
.guide-launch-tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}
.guide-launch-tile-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main, #f3f5f8);
}
.guide-launch-tile-tag {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.1rem 0.38rem;
  border-radius: 999px;
  background: rgb(52 211 153 / 18%);
  color: var(--kpi-emerald, #34d399);
}
.guide-launch-tile-desc {
  font-size: 0.74rem;
  color: var(--text-dim, #bdc8d6);
  line-height: 1.35;
}
.guide-tips-toggle {
  border: 1px solid var(--line, rgb(227 234 245 / 11%));
  border-radius: 0.65rem;
  background: var(--bg, #11141a);
  padding: 0.5rem 0.85rem;
}
.guide-tips-toggle summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim, #bdc8d6);
  min-height: 32px;
  display: flex;
  align-items: center;
}
.guide-tips-toggle[open] .guide-tips-list {
  margin-top: 0.65rem;
}
.guide-tip-card {
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: 0.7rem;
  background: var(--surface-elevated, #222a35);
  border: 1px solid var(--line, rgb(227 234 245 / 11%));
  color: var(--text-dim, #bdc8d6);
  font-size: 0.88rem;
  line-height: 1.55;
}
.guide-step3-quick {
  margin-top: 0.9rem;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  background: var(--surface-subtle);
  border: 1px solid var(--line-strong);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}
.guide-step3-quick-label {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent, #65dce9);
}
#guide-dialog .guide-quick-route-btn {
  min-height: 44px;
  padding: 0.55rem 0.95rem;
  border-radius: 0.55rem;
  background: var(--surface-elevated, #222a35);
  color: var(--text-main, #f3f5f8);
  border: 1px solid var(--accent-border, #65dce96b);
  font-size: 0.84rem;
  font-weight: 700;
  transition:
    border-color 150ms ease,
    background-color 150ms ease;
}
@media (hover: hover) and (pointer: fine) {
  #guide-dialog .guide-quick-route-btn:hover {
    border-color: var(--accent, #65dce9);
    background: var(--accent-soft, #65dce91c);
  }
}
#guide-dialog kbd {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  padding: 0.15rem 0.42rem;
  border-radius: 0.35rem;
  background: var(--bg, #11141a);
  border: 1px solid var(--line-strong, rgb(227 234 245 / 23%));
  color: var(--accent, #65dce9);
}
#guide-dialog footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.35rem;
  padding-top: 1rem;
  padding-bottom: 0.25rem;
  border-top: 1px solid var(--line, rgb(227 234 245 / 11%));
}
#guide-dialog #guide-back {
  background: var(--surface-subtle, #161b23);
  color: var(--text-dim, #bdc8d6);
  border: 1px solid var(--line-strong, rgb(227 234 245 / 23%));
  font-weight: 600;
}
@media (hover: hover) and (pointer: fine) {
  #guide-dialog #guide-back:hover {
    background: var(--surface-elevated, #222a35);
    color: var(--text-main, #f3f5f8);
    border-color: var(--accent-border, #65dce96b);
  }
}
#guide-dialog #guide-next {
  background: var(--accent, #65dce9);
  color: var(--brand-on-primary, #091118);
  border: 1px solid transparent;
  font-weight: 800;
  padding-inline: 1.25rem;
  margin-left: auto;
  transition:
    background-color 150ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
    transform 160ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1));
}
@media (hover: hover) and (pointer: fine) {
  #guide-dialog #guide-next:hover {
    background: var(--accent-hover, #9deaf3);
  }
}
#guide-error {
  color: var(--kpi-rose, #f43f5e);
  font-size: 0.82rem;
  font-weight: 600;
  margin: 0.5rem 0 0;
  min-height: 1.1em;
}
@media (max-width: 640px) {
  #guide-dialog {
    width: calc(100vw - 1rem);
    padding: 1.15rem;
    border-radius: 0.9rem;
  }
  #guide-dialog .guide-fields-grid {
    grid-template-columns: 1fr;
  }
  .guide-live-preview,
  .guide-preset-grid,
  .guide-detail-row,
  .guide-launch-tiles {
    grid-template-columns: 1fr;
  }
  .guide-age-row {
    grid-template-columns: auto 1fr;
  }
  .guide-age-row .guide-age-btn {
    grid-column: 1 / -1;
  }
  #guide-dialog .guide-step-pill {
    flex-direction: column;
    gap: 0.12rem;
    padding: 0.25rem 0.2rem;
    min-height: 44px;
  }
  #guide-dialog .guide-tool-chip,
  #guide-dialog .guide-range-stops button {
    min-height: 44px;
  }
  .guide-step-lbl {
    font-size: 0.65rem;
  }
  .guide-step3-quick {
    flex-direction: column;
    align-items: stretch;
  }
  #guide-dialog .guide-quick-route-btn {
    width: 100%;
    text-align: center;
  }
  #guide-dialog [data-guide-choice] {
    min-height: 56px;
    padding: 0.8rem 0.85rem;
  }
  #guide-dialog .guide-bw-row input,
  #guide-dialog input,
  #guide-dialog select {
    font-size: 16px;
    min-height: 46px;
  }
  #guide-dialog footer {
    position: sticky;
    bottom: -1.15rem;
    margin-inline: -1.15rem;
    margin-bottom: -1.15rem;
    padding: 0.85rem 1.15rem;
    background: var(--surface, #191e26);
  }
  #guide-dialog footer button {
    flex: 1 1 0;
    min-height: 48px;
  }
  #guide-dialog #guide-next {
    margin-left: 0;
  }
}
.legacy-guide-open {
  overflow: hidden;
}
#athlete-xp-banner {
  padding-block: 0.5rem;
}
#athlete-xp-banner > .grid {
  gap: 0.5rem;
}
#athlete-xp-banner .rounded-xl {
  padding-block: 0.5rem;
}
#week-compliance-strip {
  gap: 0.5rem;
}
#week-compliance-strip > div {
  padding-block: 0.5rem;
}
.guide-research-badge,
.portal-quote figcaption {
  color: var(--text-meta, #9da5b0);
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none;
  cursor: default;
}
@media (max-width: 1023px) {
  .portal-nav-foot > .guide-open,
  .portal-nav-foot > .guide-mode {
    display: none !important;
  }
  #mobile-tab-bar {
    display: none;
  }
  html #mobile-tab-select {
    width: auto;
    min-width: 0;
    max-width: 100%;
    min-height: 44px;
    flex: 1 1 7rem;
    order: 0;
  }
  #mobile-tab-bar .guide-mode {
    width: auto;
    flex: 0 1 auto;
    min-height: 44px;
    order: 1;
  }
  #mobile-tab-bar .guide-open {
    order: 2;
    padding-inline: 0.7rem;
    font-size: 0.75rem;
    min-width: 44px;
    min-height: 44px;
  }
  .portal-nav .portal-nav-foot {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: auto;
    min-height: 48px;
    padding: 4px 10px;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .week-heading > :first-child {
    flex-basis: 100%;
  }
  .guide-header-actions {
    justify-content: flex-end;
    width: 100%;
  }
  #guide-data summary {
    white-space: nowrap;
  }
}
@media (min-width: 1024px) {
  #mobile-tab-bar {
    display: none;
  }
}
/* Keep the first morning check visible beneath the day's sessions once start plan is collapsed or hidden. */
#main-content:has(> #portal-first-start:not([hidden]):not(.is-compact)) #guide-checklist {
  display: none;
}
#guide-checklist {
  padding: 0;
  overflow: hidden;
}
#guide-checklist > summary {
  min-height: 48px;
  padding: 0.65rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  list-style: none;
}
#guide-checklist > summary::-webkit-details-marker {
  display: none;
}
.guide-rail-summary-right {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.guide-rail-meter {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--accent, #65dce9);
}
.guide-rail-track {
  width: 5.5rem;
  height: 6px;
  border-radius: 999px;
  background: var(--bg, #11141a);
  overflow: hidden;
}
.guide-rail-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent, #65dce9), var(--kpi-emerald, #34d399));
  transform-origin: left center;
  transform: scaleX(var(--rail-scale, 0));
  transition: transform 200ms var(--ease-out-quart, cubic-bezier(0.22, 1, 0.36, 1));
}
@media (prefers-reduced-motion: reduce) {
  .guide-rail-fill {
    transition: none;
  }
}
#guide-checklist[open] {
  padding-bottom: 0.85rem;
}
#guide-checklist .guide-rail-list {
  list-style: none;
  margin: 0;
  padding: 0.35rem 1rem 0.65rem;
  display: grid;
  gap: 0.5rem;
}
.guide-rail-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  padding: 0.5rem 0.7rem;
  border-radius: 0.6rem;
  background: var(--bg, #11141a);
  border: 1px solid var(--line, rgb(227 234 245 / 11%));
}
.guide-rail-num {
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgb(101 220 233 / 15%);
  color: var(--accent, #65dce9);
  flex-shrink: 0;
}
.guide-rail-item:has(input:checked) .guide-rail-num {
  background: rgb(52 211 153 / 18%);
  color: var(--kpi-emerald, #34d399);
}
.guide-rail-btns {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.guide-rail-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-inline: 1rem;
}
.guide-rail-wizard-btn {
  border-color: var(--accent-border, #65dce96b);
  color: var(--accent, #65dce9);
  font-weight: 700;
}
#today-focus-banner {
  padding: 1rem;
}
#today-focus-banner .week-day-heading {
  gap: 0.4rem 1rem;
  padding-bottom: 0.5rem;
}
#today-focus-banner .week-section-title {
  font-size: 1.35rem !important;
}
#today-focus-banner .week-slot {
  padding-block: 0.55rem;
}
html .guide-segments .seg-btn {
  font-family: inherit;
  font-weight: 600;
  font-size: 0.8rem;
  line-height: 1.4;
}
.guide-checklist label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.guide-checklist input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
  flex: 0 0 auto;
}
.guide-checklist label:has(input:checked) {
  color: var(--text-dim);
  text-decoration: line-through;
}
.tab-panel canvas {
  max-width: 100%;
}

/* =========================================================================
   Modern Web Guidance: Smooth Details Disclosure + Starting Style + Tour/Tips
   ========================================================================= */

@supports (interpolate-size: allow-keywords) {
  @media (prefers-reduced-motion: no-preference) {
    :root {
      interpolate-size: allow-keywords;
    }
    :is(
      .theory-accordion,
      .guide-tips-toggle,
      .guide-age-helper,
      .guide-checklist,
      .lab-outline
    )::details-content {
      contain: layout;
      overflow-y: clip;
      transition-property: block-size, content-visibility, display;
      transition-duration: 0.24s;
      transition-timing-function: ease;
      transition-behavior: allow-discrete;
    }
    :is(
        .theory-accordion,
        .guide-tips-toggle,
        .guide-age-helper,
        .guide-checklist,
        .lab-outline
      ):not([open])::details-content {
      block-size: 0;
    }
    :is(
        .theory-accordion,
        .guide-tips-toggle,
        .guide-age-helper,
        .guide-checklist,
        .lab-outline
      )[open]::details-content {
      block-size: auto;
    }
  }
}

.ft-tip-popover,
.ft-tour-popover {
  margin: 0;
  color: var(--text-main, #f3f5f8);
  background: var(--surface, #191e26);
  border: 1px solid var(--line-strong, rgba(227, 234, 245, 0.23));
  border-radius: var(--card-radius, 14px);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.08),
    0 20px 48px -8px rgba(0, 0, 0, 0.72);
  opacity: 0;
  transition-property: opacity, transform, display, overlay;
  transition-duration: 0.16s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}

.ft-tip-popover:not(:popover-open):not(.\:popover-open),
.ft-tour-popover:not(:popover-open):not(.\:popover-open) {
  display: none;
}

.ft-tip-popover:is(:popover-open, .\:popover-open),
.ft-tour-popover:is(:popover-open, .\:popover-open) {
  display: block;
  opacity: 1;
}

@starting-style {
  .ft-tip-popover:is(:popover-open, .\:popover-open),
  .ft-tour-popover:is(:popover-open, .\:popover-open) {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .ft-tip-popover,
  .ft-tour-popover {
    transform: translateY(4px);
  }

  .ft-tip-popover:is(:popover-open, .\:popover-open),
  .ft-tour-popover:is(:popover-open, .\:popover-open) {
    transform: translateY(0);
  }

  @starting-style {
    .ft-tip-popover:is(:popover-open, .\:popover-open),
    .ft-tour-popover:is(:popover-open, .\:popover-open) {
      transform: translateY(4px);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .ft-tip-popover,
  .ft-tour-popover {
    transition-duration: 0.08s;
  }
}

.ft-tip-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.ft-tip-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  align-self: center;
  border-radius: 999px;
  border: 1px solid var(--accent-border, rgba(101, 220, 233, 0.45));
  background: var(--accent-soft, rgba(101, 220, 233, 0.1));
  color: var(--accent, #65dce9);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    transform 0.1s ease;
}

.ft-tip-btn::after {
  content: "";
  position: absolute;
  inset: -11px;
}

.ft-tip-btn:active {
  transform: scale(0.95);
}

.ft-tip-btn:focus-visible {
  outline: 2px solid var(--accent, #65dce9);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .ft-tip-btn:hover {
    background: color-mix(in srgb, var(--accent, #65dce9) 22%, transparent);
    border-color: var(--accent, #65dce9);
  }
}

.ft-tip-popover {
  position: fixed;
  z-index: 95;
  max-width: min(300px, calc(100vw - 24px));
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.45;
}

@supports (position-area: block-start) {
  .ft-tip-popover {
    inset: auto;
    margin: 0;
    position-area: block-start span-all;
    position-try-fallbacks:
      flip-block,
      block-start span-inline-end,
      block-start span-inline-start,
      block-end span-inline-end,
      block-end span-inline-start;
    margin-block-end: 8px;
  }
}

@supports not (position-area: block-start) {
  .ft-tip-popover {
    inset: auto;
    left: var(--ft-tip-x, 12px);
    top: var(--ft-tip-y, 16px);
  }
}

.ft-tip-title {
  display: block;
  color: var(--accent, #65dce9);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 4px;
}

.ft-tip-body {
  margin: 0 0 6px;
  color: var(--text-main, #f3f5f8);
}

.ft-tip-target {
  margin: 0;
  color: var(--kpi-emerald, #34d399);
  font-size: 11px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

.ft-tip-glossary-btn {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--accent-border, rgba(101, 220, 233, 0.35));
  background: var(--accent-soft, rgba(101, 220, 233, 0.08));
  color: var(--accent, #65dce9);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.ft-zone-spectrum {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg, #11141a);
  border: 1px solid var(--line, rgb(227 234 245 / 11%));
}

.ft-zone-spectrum-title {
  display: block;
  font-size: 11px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  color: var(--text-meta, #a1afbf);
  margin-bottom: 8px;
}

.ft-zone-spectrum-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.ft-zone-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 6px;
  border-radius: var(--subpanel-radius, 3px);
  background: var(--surface, #191e26);
  border-top: 2px solid var(--line-strong, #64748b);
  font-variant-numeric: tabular-nums;
}

.ft-zone-cell.is-z1 {
  border-top-color: var(--text-meta, #94a3b8);
}
.ft-zone-cell.is-z2 {
  border-top-color: var(--kpi-emerald, #34d399);
}
.ft-zone-cell.is-z3 {
  border-top-color: var(--accent, #65dce9);
}
.ft-zone-cell.is-z4 {
  border-top-color: var(--kpi-amber, #f59e0b);
}
.ft-zone-cell.is-z5 {
  border-top-color: var(--kpi-rose, #f43f5e);
}

.ft-zone-cell-tag {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 800;
  color: var(--text-main, #f3f5f8);
}

.ft-zone-cell-bpm {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent, #65dce9);
}

.ft-zone-cell-feel {
  font-size: 10px;
  color: var(--text-meta, #a1afbf);
  line-height: 1.2;
}

@media (max-width: 540px) {
  .ft-zone-spectrum-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ft-mood-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.ft-mood-lbl {
  font-size: 11px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  color: var(--text-meta, #a1afbf);
}

.ft-mood-btn {
  min-height: 40px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong, rgb(227 234 245 / 23%));
  background: var(--bg, #11141a);
  color: var(--text-main, #f3f5f8);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease,
    transform 0.1s ease;
}

.ft-mood-btn:active {
  transform: scale(0.97);
}

.ft-mood-btn[aria-pressed="true"] {
  border-color: var(--accent, #65dce9);
  background: var(--accent-soft, rgba(101, 220, 233, 0.14));
  color: var(--accent, #65dce9);
}

.ft-mood-btn:focus-visible {
  outline: 2px solid var(--accent, #65dce9);
  outline-offset: 2px;
}

.guide-finish-tour-btn {
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--accent-border, rgba(101, 220, 233, 0.45));
  background: var(--accent-soft, rgba(101, 220, 233, 0.1));
  color: var(--accent, #65dce9);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition:
    background-color 0.15s ease,
    transform 0.1s ease;
}

.guide-finish-tour-btn:active {
  transform: scale(0.98);
}

.guide-finish-tour-btn:focus-visible {
  outline: 2px solid var(--accent, #65dce9);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .guide-finish-tour-btn:hover,
  .ft-mood-btn:hover {
    border-color: var(--accent, #65dce9);
    background: color-mix(in srgb, var(--accent, #65dce9) 18%, transparent);
  }
}

.ft-checklist-tour-btn {
  min-height: 44px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--accent-border, rgba(101, 220, 233, 0.45));
  background: var(--accent-soft, rgba(101, 220, 233, 0.12));
  color: var(--accent, #65dce9);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.ft-tour-target {
  position: relative;
  z-index: 40;
  outline: 2px solid var(--accent, #65dce9);
  outline-offset: 4px;
  border-radius: 14px;
}

@supports (anchor-name: --ft-tour-anchor) and (position-area: block-end) {
  .ft-tour-target {
    anchor-name: --ft-tour-anchor;
  }

  .ft-tour-popover.is-anchored:not(.is-bottom-dock):not(.is-corner-dock) {
    position-anchor: --ft-tour-anchor;
    position-area: block-end span-inline-end;
    position-try-fallbacks:
      flip-block,
      block-start span-inline-end,
      block-end span-inline-start,
      block-start span-inline-start;
    inset: auto;
    margin: 12px 0;
  }
}

.ft-tour-popover:not(.is-bottom-dock):not(.is-corner-dock):not(.is-anchored) {
  inset: auto;
  left: var(--ft-tour-x, 16px);
  top: var(--ft-tour-y, 80px);
}

@supports not ((anchor-name: --ft-tour-anchor) and (position-area: block-end)) {
  .ft-tour-popover:not(.is-bottom-dock):not(.is-corner-dock) {
    inset: auto;
    left: var(--ft-tour-x, 16px);
    top: var(--ft-tour-y, 80px);
  }
}

.ft-tour-popover {
  position: fixed;
  z-index: 100;
  width: min(370px, calc(100vw - 24px));
  padding: 14px 16px;
}

.ft-tour-popover.is-corner-dock {
  inset: auto 20px 20px auto;
  width: min(370px, calc(100vw - 32px));
  margin: 0;
}

.ft-tour-popover.is-bottom-dock {
  inset: auto 12px calc(5.75rem + env(safe-area-inset-bottom)) 12px;
  width: auto;
  margin: 0;
}

.ft-tour-dots {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin-bottom: 10px;
}

.ft-tour-dot {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--line-strong, rgb(227 234 245 / 23%));
  background: var(--bg, #11141a);
  color: var(--text-meta, #a1afbf);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease,
    color 0.15s ease;
}

.ft-tour-dot::after {
  content: "";
  position: absolute;
  inset: -10px;
}

.ft-tour-dot.is-done {
  border-color: color-mix(in srgb, var(--kpi-emerald, #34d399) 50%, transparent);
  background: color-mix(in srgb, var(--kpi-emerald, #34d399) 14%, transparent);
  color: var(--kpi-emerald, #34d399);
}

.ft-tour-dot.is-active {
  border-color: var(--accent, #65dce9);
  background: var(--accent-soft, rgba(101, 220, 233, 0.18));
  color: var(--accent, #65dce9);
}

.ft-tour-dot:focus-visible {
  outline: 2px solid var(--accent, #65dce9);
  outline-offset: 2px;
}

.ft-tour-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.ft-tour-step-lbl {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent, #65dce9);
}

.ft-tour-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line-strong, rgb(227 234 245 / 23%));
  background: transparent;
  color: var(--text-dim, #bdc8d6);
  font-size: 16px;
  cursor: pointer;
}

.ft-tour-progress {
  width: 100%;
  height: 4px;
  margin-bottom: 10px;
  accent-color: var(--accent, #65dce9);
  border-radius: 999px;
}

.ft-tour-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main, #f3f5f8);
}

.ft-tour-desc {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-dim, #bdc8d6);
}

.ft-tour-try-badge {
  margin: 0 0 12px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px dashed var(--accent-border, rgba(101, 220, 233, 0.4));
  background: var(--accent-soft, rgba(101, 220, 233, 0.08));
  color: var(--accent, #65dce9);
  font-size: 11px;
  font-weight: 600;
}

.ft-tour-try-badge.is-done {
  border-style: solid;
  border-color: color-mix(in srgb, var(--kpi-emerald, #34d399) 55%, transparent);
  background: color-mix(in srgb, var(--kpi-emerald, #34d399) 14%, transparent);
  color: var(--kpi-emerald, #34d399);
}

.ft-tour-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ft-tour-foot-nav {
  display: flex;
  gap: 8px;
}

.ft-tour-btn {
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--line-strong, rgb(227 234 245 / 23%));
  background: var(--bg, #11141a);
  color: var(--text-main, #f3f5f8);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.ft-tour-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ft-tour-btn-primary {
  border-color: var(--accent, #65dce9);
  background: var(--accent, #65dce9);
  color: var(--brand-on-primary, #11141a);
}

.ft-tour-btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--text-meta, #a1afbf);
  padding-inline: 8px;
}

.ft-starter-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface, #191e26);
  border: 1px solid var(--accent-border, rgba(101, 220, 233, 0.28));
}

.ft-starter-copy {
  flex: 1 1 240px;
  min-width: 0;
}

.ft-starter-title {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main, #f3f5f8);
  margin-bottom: 2px;
}

.ft-starter-desc {
  margin: 0;
  font-size: 12px;
  color: var(--text-meta, #a1afbf);
  line-height: 1.4;
}

.ft-starter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ft-starter-btn {
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--accent-border, rgba(101, 220, 233, 0.45));
  background: var(--accent-soft, rgba(101, 220, 233, 0.14));
  color: var(--accent, #65dce9);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.ft-starter-dismiss {
  min-width: 44px;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line-strong, rgb(227 234 245 / 23%));
  background: transparent;
  color: var(--text-meta, #a1afbf);
  font-size: 12px;
  cursor: pointer;
}

.ft-starter-btn:focus-visible,
.ft-starter-dismiss:focus-visible,
.ft-tour-btn:focus-visible,
.ft-tour-close:focus-visible,
.ft-checklist-tour-btn:focus-visible,
.ft-tip-glossary-btn:focus-visible {
  outline: 2px solid var(--accent, #65dce9);
  outline-offset: 2px;
}

@media (forced-colors: active) {
  .ft-tour-target,
  .ft-tip-popover,
  .ft-tour-popover,
  .ft-starter-card {
    border: 2px solid CanvasText;
    outline-color: Highlight;
  }
}

/* Start with today's sessions; keep the tour in the same reading and tab order. */
#portal-first-start .portal-first-start-head,
#portal-first-start .portal-first-start-head-actions,
#portal-first-start .portal-tour-launch,
#portal-first-start .portal-tour-launch-actions {
  display: flex;
}
#portal-first-start.is-compact .portal-first-start-title-wrap {
  order: 1;
}
#portal-first-start.is-compact .portal-first-start-intro {
  order: 2;
  font-size: 0.875rem;
  line-height: 1.45;
}
#portal-first-start.is-compact .portal-first-start-head-actions {
  order: 3;
  width: 100%;
}
#portal-first-start.is-compact .portal-tour-launch {
  order: 4;
}
#portal-first-start #portal-first-start-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--accent);
  border-radius: var(--control-radius);
  background: var(--accent);
  color: var(--bg);
  font-weight: 750;
  cursor: pointer;
}
#portal-first-start #portal-first-start-tour {
  min-height: 44px;
  border: 1px solid var(--line-strong);
  background: var(--surface-subtle);
  color: var(--text-main);
  box-shadow: none;
}
@media (hover: hover) and (pointer: fine) {
  #portal-first-start #portal-first-start-primary:hover {
    background: var(--accent-hover);
  }
  #portal-first-start #portal-first-start-tour:hover {
    background: var(--surface-elevated);
  }
}
#portal-first-start .portal-tour-launch {
  margin-top: 12px;
}
#portal-first-start.is-compact .portal-tour-launch {
  margin-top: 0;
}
.portal-tour-launch-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.portal-tour-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--accent-border, #65dce96b);
  background: var(--accent-soft, #65dce91c);
  color: var(--accent-hover, #9deaf3);
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.portal-tour-status-pill[hidden] {
  display: none;
}
.ft-tour-practice-count {
  font-size: 0.75rem;
  color: var(--text-dim, #cbd5e1);
}
.ft-tour-task {
  margin: 10px 0;
  font-size: 0.875rem;
  color: var(--text-main, #f3f5f8);
  line-height: 1.5;
}
#ft-tour-try {
  margin-bottom: 8px;
}
.ft-tour-popover {
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
@media (max-width: 639px) {
  #portal-first-start .portal-first-start-head {
    width: 100%;
  }
  #portal-first-start #portal-first-start-primary {
    flex: 1 1 100%;
  }
  #portal-first-start.is-compact .portal-first-start-customize {
    display: none;
  }
  .portal-tour-launch-actions {
    width: 100%;
  }
  .portal-tour-launch-actions > button {
    flex: 1 1 auto;
  }
  .portal-first-start.is-compact .portal-tour-launch-actions {
    width: auto;
  }
  .portal-first-start.is-compact .portal-tour-launch-actions > button {
    flex: 0 0 auto;
  }
  .ft-tour-popover.is-bottom-dock {
    max-height: min(55dvh, 440px);
  }
}

/* Practice mode leaves the actual inputs visible while keeping tour controls reachable and dialog title in the ARIA tree. */
.ft-tour-popover.is-practicing
  :is(
    .ft-tour-progress,
    .ft-tour-dots,
    .ft-tour-desc,
    .ft-tour-task,
    #ft-tour-try,
    .ft-tour-practice-count
  ) {
  display: none;
}
.ft-tour-popover.is-practicing .ft-tour-title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.ft-tour-popover.is-practicing {
  max-height: 35dvh;
}
@media (max-width: 1023px), (pointer: coarse) {
  #guide-dialog .guide-step-pill,
  #guide-dialog .guide-tool-chip,
  #guide-dialog .guide-range-stops button {
    min-height: 44px;
  }
}

/* P3: module controls share the existing Grappling Lab design tokens. */
#main-content {
  --portal-module-gap: 0.75rem;
  --portal-tool-touch: 44px;
  --portal-tool-radius: var(--control-radius, 8px);
}
#main-content .tab-panel .guide-segments {
  gap: 0.375rem;
}
#main-content .tab-panel .guide-segments .seg-btn {
  border-radius: var(--portal-tool-radius);
  min-height: var(--portal-tool-touch);
  line-height: 1.35;
}
#main-content .tab-panel .guide-segments .seg-btn:focus-visible,
#main-content .tab-panel .portal-page-title .term-help:focus-visible {
  outline: 2px solid var(--accent, #65dce9);
  outline-offset: 2px;
}
@media (max-width: 767px) {
  #main-content .tab-panel .guide-segments {
    margin-block: 0.5rem 0.875rem;
    gap: 0.375rem;
  }
  #main-content .tab-panel > .guide-micro {
    margin-block: 0 0.5rem;
    max-width: 65ch;
  }
}


/* Narrow-phone supplements: keep the weight action and full card headings on screen.
   The 320px athlete journey uses both controls before showing dose guidance. */
@media (max-width: 359px) {
  #tab-tillskott #supp-bw-input {
    box-sizing: border-box;
    flex: 1 1 7rem;
    width: 7rem;
    min-width: 0;
    max-width: 100%;
  }

  #tab-tillskott #supp-sync-bw-btn {
    flex: 0 1 9rem;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    text-align: center;
    overflow-wrap: anywhere;
  }

  #tab-tillskott #supp-dose-cards [data-supp-card] > .flex {
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: flex-start;
  }

  #tab-tillskott #supp-dose-cards [data-supp-card] > .flex > h4 {
    flex: 1 1 100%;
    min-width: 0;
  }

  #tab-tillskott #supp-dose-cards [data-supp-card] > .flex > span {
    flex: 0 1 auto;
    max-width: 100%;
    white-space: normal;
    text-align: left;
  }
}
