/* APEX / Midnight edition. CSS-compatible Sass, no build step required.
   Edit tokens here, then copy/compile this file to styles.css.
   Dark slate, silver typography and desaturated ice blue. No orange.
   Sidebar anchors a quiet, data-first training journal; photos are secondary. */
/* ===== Design tokens ===== */
:root {
  --ink: #eef2f8;
  --muted: #a6afbe;
  --background: #334155;
  --gradient: linear-gradient(30deg, #a6afbe, #646a73, #334155, #191f2b);
  --surface: #191f2b;
  --raised: #212a39;
  --line: #30394a;
  --accent: #bfd3f5;
  --accent-text: #14223a;
  --accent-soft: #2b3b55;
  --radius: 14px;
  --display: "Avenir Next", "Segoe UI", Arial, sans-serif;
  color-scheme: dark;
  font-family: "Avenir Next", "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--gradient);
}

/* ===== Base resets & typography ===== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select {
  touch-action: manipulation;
}

button,
a {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

h2 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.35;
}

h3 {
  font-size: 15px;
  font-weight: 600;
}

p {
  line-height: 1.65;
  color: var(--muted);
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.skip {
  position: absolute;
  top: -100px;
}

.skip:focus {
  top: 8px;
  left: 8px;
  background: var(--raised);
  padding: 12px;
  z-index: 99;
}

svg.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* ===== Layout shell ===== */
.shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100vh;
}

.workspace {
  min-width: 0;
  padding: 0 34px 25px;
  max-width: 1620px;
  width: 100%;
  margin: 0 auto;
}

/* ===== Sidebar / navigation ===== */
.rail {
  background: #121925;
  border-right: 1px solid #263041;
  position: sticky;
  top: 0;
  height: 97vh;
  padding: 30px 18px;
  display: flex;
  flex-direction: column;
  margin: 10px;
  border-radius: 14px;
  box-shadow: 5px 5px 10px rgba(0, 0, 0, 0);
  background-color: rgba(18, 25, 37, 0.7);
}

@supports (-webkit-backdrop-filter: none) or (backdrop-filter: none) {
  .modal {
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.5);
  }
  .warning {
    display: none;
  }
}
.brand {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 10px;
}

.brand img {
  width: 37px;
  height: 37px;
  flex-shrink: 0;
}

.brand span {
  font-size: 8px;
  letter-spacing: 0.16em;
  width: 100%;
  padding-left: 47px;
  margin-top: -6px;
  color: var(--muted);
}

.sidebar-person {
  display: flex;
  align-items: center;
  flex-direction: column;
  text-align: center;
  margin-top: 32px;
  gap: 9px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.sidebar-person img {
  width: 62px;
  height: 62px;
  flex: 0 0 62px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #354157;
}

.sidebar-person strong {
  font-size: 13px;
  font-weight: 600;
}

.sidebar-person small {
  color: var(--muted);
  font-size: 10px;
}

.rail nav {
  display: grid;
  gap: 7px;
  margin-top: 27px;
}

.rail nav a,
.rail-bottom {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 46px;
  padding: 12px 15px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.rail nav a:hover,
.rail-bottom:hover {
  background: #202b3d;
  color: white;
}

.rail nav a.active,
.rail-bottom.active {
  background: #293a54;
  color: #e4eeff;
}

.rail a.active svg {
  color: var(--accent);
}

.rail-bottom {
  margin-top: auto;
}

/* ===== Topbar / header controls ===== */
.topbar {
  min-height: 81px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.wordmark {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.1em;
  color: #d4dded;
}

.wordmark span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  margin-top: 6px;
}

.profile-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-control label {
  font-size: 11px;
  color: var(--muted);
}

.profile-control select {
  max-width: 174px;
  border: 0;
  background: transparent;
  font-size: 12px;
  padding: 8px;
}

.avatar {
  display: block;
  width: 38px;
  height: 38px;
  min-width: 38px;
  flex: 0 0 38px;
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  border: 2px solid #44536c;
  border-radius: 50%;
  background: var(--raised);
}

.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.icon-button {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--raised);
  color: var(--ink);
  font-size: 21px;
}

.icon-button:hover {
  background: #354259;
}

.icon-button:disabled {
  opacity: 0.35;
  cursor: default;
}

/* ===== Page headings & actions ===== */
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 26px 0 24px;
}

.eyebrow {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
  color: var(--muted);
}

.heading-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.heading-actions > span {
  font-size: 11px;
  color: var(--muted);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 42px;
  padding: 11px 17px;
  font-size: 12px;
  font-weight: 650;
  border-radius: 8px;
  transition: background 0.16s ease;
}

.button.dark,
.hero-button {
  background: var(--accent);
  color: var(--accent-text);
}

.button.dark:hover,
.hero-button:hover {
  background: #dbe8ff;
}

.button.light {
  background: var(--raised);
  color: var(--ink);
  border: 1px solid var(--line);
}

.button.light:hover {
  background: #2e3a4f;
}

.button:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* ===== Persona chooser ===== */
.persona-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 11px;
}

.persona-heading h2 {
  font-size: 13px;
}

.persona-heading > span {
  font-size: 11px;
  color: var(--muted);
}

.persona-switcher {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.persona-option {
  flex: 0 0 224px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 13px;
  display: flex;
  text-align: left;
  align-items: center;
  gap: 11px;
  min-width: 0;
  transition: background 0.16s;
}

.persona-option:hover {
  background: #27344a;
}

.persona-option.selected {
  background: #25344b;
  border-color: #7f9dc7;
}

.persona-option img {
  width: 36px;
  height: 36px;
  min-width: 36px;
  flex: 0 0 36px;
  object-fit: cover;
  border-radius: 50%;
  aspect-ratio: 1;
}

.persona-option strong {
  font-size: 11px;
  display: block;
}

.persona-option small {
  display: block;
  font-size: 10px;
  color: #b9c3d3;
  margin-top: 5px;
}

.selection-mark {
  margin-left: auto;
  font-size: 12px;
  color: var(--accent);
}

/* ===== Dashboard overview ===== */
.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 23px;
}

.main-column,
.insights {
  min-width: 0;
}

.welcome {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  min-height: 224px;
  background: #1e2c41;
  border-radius: var(--radius);
  overflow: hidden;
}

.welcome-copy {
  padding: 28px 26px;
  position: relative;
  z-index: 1;
}

.welcome-copy #persona-background {
  color: #b8c9e1;
  font-size: 10px;
  margin: 0 0 17px;
}

.welcome-copy #greeting {
  font: 600 clamp(24px, 2.4vw, 35px)/1.2 var(--display);
  letter-spacing: -0.03em;
  color: #f1f5fd;
  max-width: 330px;
}

.welcome-copy > p:not(#persona-background) {
  font-size: 12px;
  color: #c0ccdf;
  margin-top: 12px;
}

.hero-button {
  margin-top: 22px;
}

.training-photo {
  position: relative;
  min-width: 0;
  background: #1e2c41;
}

.training-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 52% 35%;
  filter: saturate(0.15) brightness(0.75);
}

.training-photo a {
  position: absolute;
  right: 7px;
  bottom: 6px;
  background: rgba(16, 23, 34, 0.862745098);
  padding: 4px 6px;
  font-size: 8px;
  color: #d5deed;
  border-radius: 3px;
}

/* ===== Section headings and common panels ===== */
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 24px 0 14px;
}

.section-heading h2 {
  font-size: 16px;
}

.section-heading span,
.section-heading a,
.section-heading p {
  font-size: 11px;
  color: var(--muted);
}

.section-heading a:hover {
  color: var(--accent);
  text-decoration: underline;
}

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

.metrics article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 19px 16px;
  min-width: 0;
}

.metrics article:nth-child(2) {
  background: #25354d;
  border-color: #405573;
}

.metrics p {
  font-size: 11px;
  margin-bottom: 15px;
  color: #bac4d4;
}

.metrics strong {
  font: 600 33px/1.05 var(--display);
  letter-spacing: -0.03em;
  display: block;
  font-variant-numeric: tabular-nums;
}

.metrics small {
  font-size: 10px;
  color: var(--muted);
  display: block;
  margin-top: 9px;
}

.mini-icon {
  width: 33px;
  height: 33px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: #2a374b;
  color: #bbcee9;
  flex-shrink: 0;
}

.metrics .mini-icon {
  float: right;
  width: 26px;
  height: 26px;
  margin-left: 4px;
}

.mini-icon svg {
  width: 17px;
  height: 17px;
}

.panel {
  padding: 24px;
  border: 0ch solid var(--line);
  border-radius: var(--radius);
  min-width: 0;
  box-shadow: 5px 5px 10px rgba(0, 0, 0, 0);
  background-color: rgba(18, 25, 37, 0.5);
}

@supports (-webkit-backdrop-filter: none) or (backdrop-filter: none) {
  .modal {
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.5);
  }
  .warning {
    display: none;
  }
}
.goal {
  height: 100%;
}

.chart-panel {
  background-color: rgba(18, 25, 37, 0.9);
}

.panel > p {
  margin: 8px 0 20px;
  font-size: 12px;
}

.chart-panel {
  margin-top: 23px;
}

.chart-panel .section-heading {
  margin: 0 0 15px;
}

.pill {
  background: #283348;
  padding: 7px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.chart {
  min-height: 170px;
}

.chart svg {
  width: 100%;
  height: auto;
  max-height: 245px;
  overflow: visible;
}

.chart text {
  fill: #a7b3c7;
  font: 11px "Segoe UI", Arial, sans-serif;
}

.chart-bottom {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  font-size: 11px;
  color: var(--muted);
}

.chart-bottom a {
  font-weight: 600;
  color: var(--accent);
}

/* ===== Weekly summary cards ===== */
.week-art {
  background: #1c2635;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 23px;
}

.week-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
}

.week-heading svg {
  color: var(--accent);
}

.week-total {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 22px 0;
}

.week-total strong {
  font: 500 49px/1 var(--display);
  letter-spacing: -0.04em;
}

.week-total small {
  max-width: 115px;
  font-size: 11px;
  line-height: 1.7;
  color: #b7c3d5;
}

.week-dots {
  display: flex;
  gap: 6px;
  justify-content: space-between;
  margin: 19px 0 21px;
}

.week-dots span {
  width: 28px;
  height: 32px;
  border: 1px solid #40506a;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: #222d3d;
  color: #aebcd1;
  font-size: 10px;
  font-weight: 600;
}

.week-dots span.done {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

.week-art > a {
  font-size: 11px;
  font-weight: 600;
  display: block;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  color: var(--accent);
}

/* ===== Insights / energy / goals ===== */
.insight-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 5px;
}

.insight-card small {
  font-size: 11px;
  color: var(--muted);
  display: block;
}

.insight-card strong {
  font-size: 22px;
  font-weight: 500;
  display: block;
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

.insight-card > span:last-child {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted);
}

.energy {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-top: 23px;
}

.energy .section-heading {
  margin: 0;
}

.ring {
  width: 142px;
  height: 142px;
  border-radius: 50%;
  padding: 10px;
  margin: 21px auto;
}

.ring > div {
  background: var(--surface);
  border-radius: 50%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.ring strong {
  font: 500 29px var(--display);
  letter-spacing: -0.03em;
}

.ring small {
  font-size: 10px;
  color: var(--muted);
}

.fuel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  margin-top: 14px;
}

.fuel-row span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.fuel-row b {
  font-weight: 500;
}

.fuel-row i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.fuel-row .purple-dot {
  background: #7586a4;
}

.micro {
  font-size: 11px !important;
  line-height: 1.7;
  margin-top: 14px !important;
  color: var(--muted);
}

.goal-card {
  margin-top: 23px;
  padding: 23px;
  background: #223047;
  border-radius: var(--radius);
}

.goal-card h2 {
  font-size: 22px;
  margin: 9px 0;
}

.goal-card p {
  font-size: 12px;
  color: #bac7db;
}

.goal-card .button {
  margin-top: 17px;
}

/* ===== Sessions / tables / notes ===== */
.session-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px 15px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  background: var(--surface);
  border-radius: 14px;
  margin-bottom: 5px;
}

.session-row > div {
  min-width: 0;
  overflow-wrap: anywhere;
}

.session-row small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 5px;
}

.session-row > b {
  margin-left: auto;
  white-space: nowrap;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

table {
  border-collapse: collapse;
  width: 100%;
  white-space: nowrap;
  text-align: left;
  font-size: 12px;
}

th {
  padding: 16px;
  background: #253044;
  font-weight: 500;
  color: #c6d2e6;
}

td {
  padding: 17px 16px;
  border-top: 1px solid var(--line);
}

td:last-child,
th:last-child {
  text-align: right;
}

.note {
  padding: 18px 20px;
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}

.empty {
  padding: 35px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

/* ===== Progress / calendar / strength ===== */
.progress-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 1fr);
  gap: 23px;
  align-items: start;
}

.progress-grid .section-heading {
  margin-top: 0;
}

.strength-panel {
  grid-column: 1;
}

.consistency-panel {
  grid-column: 2;
  grid-row: 1/span 2;
}

.strength-panel label {
  font-size: 11px;
  max-width: 190px;
  color: var(--muted);
}

.strength-panel select {
  margin-top: 7px;
}

.calendar-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0;
  font-size: 13px;
}

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

.calendar-weekdays {
  font-size: 10px;
  text-align: center;
  color: var(--muted);
  margin-bottom: 9px;
}

.calendar-grid {
  margin-bottom: 20px;
}

.calendar-day {
  min-width: 0;
  aspect-ratio: 1/1.1;
  border-radius: 7px;
  background: #151c28;
  border: 1px solid #354156;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #b4c0d5;
  gap: 3px;
}

.calendar-day span {
  font-size: 11px;
}

.calendar-day b {
  font-size: 11px;
  font-weight: 500;
}

.calendar-day.done {
  background: var(--accent);
  color: #13243f;
  border-color: var(--accent);
}

.calendar-day.today {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

.calendar-day[aria-pressed=true] {
  box-shadow: inset 0 0 0 2px #6685ae;
}

.calendar-day:disabled {
  opacity: 0.4;
  cursor: default;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  font-size: 10px;
  color: var(--muted);
}

.calendar-legend > span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.calendar-legend i {
  font-style: normal;
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 5px;
  border: 1px solid #354156;
}

.legend-done {
  background: var(--accent);
  color: #13243f;
}

.legend-rest {
  background: #151c28;
}

.calendar-detail {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 15px;
  font-size: 11px;
  line-height: 1.8;
  color: var(--muted);
}

.calendar-detail strong {
  color: var(--ink);
}

/* ===== Forms, dialogs and workout editing ===== */
.text-button {
  background: none;
  padding: 4px;
  color: var(--accent);
  text-decoration: underline;
  font-size: 11px;
}

.panel > small {
  font-size: 11px;
  color: var(--muted);
}

.form-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

form label {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0;
  font-size: 12px;
  color: #cbd4e5;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  min-height: 43px;
  padding: 11px 12px;
  border: none;
  border-bottom: solid 1px var(--accent);
  border-radius: 0px;
  background: var(--display);
  color: var(--ink);
}

option {
  background: #192333;
}

input::placeholder {
  color: #9daac1;
}

textarea {
  resize: vertical;
}

.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.fields label {
  margin: 8px 0;
}

.prediction {
  border-color: #374a65;
}

.prediction h2 {
  font-size: 28px;
  font-weight: 500;
}

.prediction-result {
  padding: 22px 0;
  border-top: 1px solid #455673;
  margin-top: 24px;
}

.prediction-result strong {
  font: 500 37px var(--display);
  display: block;
  margin-bottom: 12px;
}

.form-error {
  color: #ffb6bd;
  font-size: 12px;
  line-height: 1.6;
  margin: 12px 0;
}

.error-banner {
  padding: 18px;
  background: #3e2937;
  border: 1px solid #795363;
  border-radius: 12px;
  font-size: 13px;
  margin-top: 20px;
}

.error-banner button {
  margin-left: 12px;
}

.loading {
  padding: 60px;
  text-align: center;
  color: var(--muted);
}

footer {
  display: flex;
  gap: 15px;
  margin-top: 35px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  font-weight: 700;
}

footer span {
  font-weight: 400;
  color: var(--muted);
}

footer span:last-child {
  margin-left: auto;
}

dialog {
  width: min(720px, 100vw - 24px);
  max-height: 90vh;
  border: none;
  border-radius: 16px;
  padding: 27px;
  color: var(--ink);
  background: #1b2433;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

dialog::backdrop {
  background: rgba(6, 11, 20, 0.7490196078);
}

.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.dialog-heading h2 {
  font-size: 24px;
  font-weight: 500;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #3b4960;
}

.exercise-entry {
  border: 1px solid #3b4960;
  border-radius: 11px;
  padding: 16px;
  margin: 18px 0;
  background: #151f2e;
}

.exercise-entry .section-heading {
  margin: 0;
}

.exercise-entry .section-heading > label {
  flex: 1;
}

.set-line {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid #2f3c50;
}

.set-line label {
  min-width: 0;
  flex: 1;
  font-size: 10px;
  margin: 8px 0;
}

.set-line .icon-button {
  min-width: 28px;
  width: 28px;
  background: transparent;
  flex: 0 0 28px;
}

.set-number {
  font-size: 10px;
  color: var(--muted);
  min-width: 30px;
}

.set-line .completed-check {
  flex: 0 0 44px;
  text-align: center;
  align-items: center;
  flex-direction: column-reverse;
  font-size: 10px;
}

.completed-check input {
  width: 17px;
  height: 17px;
  min-height: 17px;
  accent-color: var(--accent);
}

.calorie-estimate {
  background: #283b56;
  padding: 16px 19px;
  border-radius: 10px;
  margin: 18px 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.calorie-estimate > span {
  font-size: 12px;
  color: #d1e0f5;
}

.calorie-estimate strong {
  font-size: 22px;
  font-weight: 500;
}

.calorie-estimate small {
  grid-column: 1/-1;
  font-size: 10px;
  color: #bdcde4;
  line-height: 1.6;
}

.onboard-goal {
  border: 1px solid #455774;
  border-radius: 11px;
  padding: 8px 19px 17px;
  margin: 50px 0 0;
}

.onboard-goal legend {
  padding: 0 8px;
  color: var(--accent);
  font-size: 13px;
}

.workout-record {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  margin-bottom: 16px;
  overflow: hidden;
}

.workout-record-heading {
  display: flex;
  align-items: center;
  gap: 17px;
  padding: 21px 23px;
}

.workout-record-heading > div:not(.workout-energy) {
  min-width: 0;
  overflow-wrap: anywhere;
}

.workout-record h3 {
  font-size: 15px;
  font-weight: 550;
}

.workout-record p {
  font-size: 11px;
  margin-top: 5px;
}

.workout-glyph {
  background: #293b57;
  color: var(--accent);
  width: 39px;
  height: 39px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.workout-energy {
  margin-left: auto;
  white-space: nowrap;
  text-align: right;
}

.workout-energy strong {
  display: block;
  font-size: 21px;
  font-weight: 500;
}

.workout-energy small {
  font-size: 9px;
  color: var(--muted);
}

.workout-record details {
  border-top: 1px solid var(--line);
}

.workout-record summary {
  padding: 14px 23px;
  color: #b4c6e1;
  font-size: 11px;
  cursor: pointer;
}

.set-history {
  padding: 0 23px 20px;
  display: grid;
  gap: 18px;
}

.set-history h4 {
  font-size: 13px;
  font-weight: 500;
  margin: 10px 0;
}

.set-history ol {
  padding: 0;
  list-style: none;
  margin: 0;
}

.set-history li {
  display: flex;
  align-items: center;
  gap: 20px;
  border-top: 1px solid #29364a;
  padding: 10px 0;
  font-size: 11px;
}

.set-history li span {
  color: var(--accent);
  min-width: 52px;
}

.set-history b {
  font-weight: 400;
}

.set-history small {
  margin-left: auto;
  color: var(--muted);
}

#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: #d3e1f7;
  color: #15243c;
  padding: 15px 22px;
  border-radius: 10px;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  z-index: 99;
  max-width: 90vw;
}

#toast.show {
  opacity: 1;
}

/* ===== Responsive adjustments ===== */
@media (min-width: 1550px) {
  .welcome {
    min-height: 260px;
  }
  .welcome-copy {
    padding: 33px;
  }
  .dashboard-layout {
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 28px;
  }
}
@media (max-width: 1150px) {
  .shell {
    grid-template-columns: 184px minmax(0, 1fr);
  }
  .rail {
    padding: 28px 12px;
  }
  .workspace {
    padding: 0 23px 24px;
  }
  .dashboard-layout {
    grid-template-columns: minmax(0, 1fr) 248px;
    gap: 18px;
  }
  .welcome-copy {
    padding: 24px 20px;
  }
  .welcome-copy #greeting {
    font-size: 26px;
  }
  .metrics article {
    padding: 16px 12px;
  }
  .metrics .mini-icon {
    display: none;
  }
  .week-art {
    padding: 20px;
  }
  .week-dots {
    gap: 4px;
  }
  .progress-grid {
    grid-template-columns: 1fr;
  }
  .consistency-panel,
  .strength-panel {
    grid-column: auto;
    grid-row: auto;
  }
}
@media (max-width: 1000px) {
  .shell {
    display: block;
  }
  .rail {
    height: auto;
    position: static;
    flex-direction: row;
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 15px 24px;
    gap: 20px;
  }
  .brand {
    font-size: 21px;
    padding: 0;
    flex-wrap: nowrap;
    gap: 8px;
  }
  .brand img {
    width: 30px;
    height: 30px;
  }
  .brand span,
  .sidebar-person {
    display: none;
  }
  .rail nav {
    display: flex;
    margin: 0;
    gap: 3px;
    flex: 1;
    justify-content: flex-end;
  }
  .rail nav a,
  .rail-bottom {
    gap: 7px;
    padding: 10px;
    font-size: 11px;
    min-height: 40px;
  }
  .rail-bottom {
    margin: 0;
  }
  .rail-bottom span {
    display: none;
  }
  .topbar {
    min-height: 75px;
  }
}
@media (max-width: 760px) {
  .dashboard-layout,
  .form-columns {
    grid-template-columns: 1fr;
  }
  .rail nav a span {
    display: none;
  }
  .persona-option {
    flex-basis: 205px;
  }
  .persona-heading > span {
    display: none;
  }
  .welcome {
    min-height: 230px;
  }
  .welcome-copy #greeting {
    font-size: 30px;
  }
  .insights {
    margin-top: 4px;
  }
  .workout-record-heading {
    flex-wrap: wrap;
  }
  .workout-record .edit-workout {
    margin-left: auto;
  }
}
@media (max-width: 650px) {
  .workspace {
    padding: 0 17px 24px;
  }
  .rail {
    position: fixed;
    inset: auto 0 0;
    z-index: 30;
    height: 65px;
    border-top: 1px solid #36445d;
    padding: 8px 12px;
    gap: 0;
    background: #121c2b;
  }
  .rail .brand {
    display: none;
  }
  .rail nav {
    justify-content: space-around;
    gap: 0;
  }
  .rail nav a,
  .rail-bottom {
    justify-content: center;
    min-width: 43px;
    height: 45px;
  }
  .topbar {
    min-height: 72px;
    gap: 10px;
  }
  .wordmark {
    font-size: 9px;
  }
  .wordmark span {
    display: none;
  }
  .profile-control {
    gap: 5px;
  }
  .profile-control label {
    display: none;
  }
  .profile-control select {
    max-width: 114px;
    font-size: 11px;
    padding: 5px;
  }
  .profile-control .avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    flex-basis: 32px;
  }
  .page-heading {
    margin: 23px 0 20px;
    gap: 12px;
  }
  h1 {
    font-size: 26px;
  }
  .eyebrow {
    font-size: 8px;
  }
  .heading-actions > span {
    display: none;
  }
  .heading-actions .button {
    font-size: 11px;
    padding: 11px 12px;
  }
  .welcome {
    grid-template-columns: 1.3fr 1fr;
    min-height: 225px;
  }
  .welcome-copy {
    padding: 23px 17px;
  }
  .welcome-copy #greeting {
    font-size: 24px;
  }
  .welcome-copy #persona-background {
    font-size: 9px;
  }
  .welcome-copy > p:not(#persona-background) {
    font-size: 11px;
  }
  .hero-button {
    padding: 11px;
    font-size: 10px;
    gap: 8px;
  }
  .training-photo img {
    object-position: 52% center;
  }
  .training-photo a {
    font-size: 7px;
    right: 3px;
    bottom: 4px;
    padding: 3px;
  }
  .metrics {
    gap: 8px;
  }
  .metrics article {
    padding: 15px 11px;
  }
  .metrics p {
    font-size: 10px;
    min-height: 24px;
  }
  .metrics strong {
    font-size: 29px;
  }
  .metrics small {
    font-size: 9px;
    line-height: 1.5;
  }
  .section-heading {
    flex-wrap: wrap;
  }
  .section-heading h2 {
    font-size: 15px;
  }
  .section-heading span {
    font-size: 10px;
  }
  .panel {
    padding: 19px;
  }
  .chart-bottom > span {
    display: none;
  }
  .fields {
    gap: 9px;
  }
  footer {
    padding-bottom: 78px;
    flex-wrap: wrap;
  }
  footer > span:nth-child(2) {
    display: none;
  }
  #toast {
    bottom: 80px;
  }
  dialog {
    padding: 20px 16px;
  }
  .exercise-entry {
    padding: 12px;
  }
  .set-line {
    gap: 7px;
    flex-wrap: wrap;
  }
  .set-number {
    width: 100%;
  }
  .set-line input[type=number] {
    padding: 9px 7px;
  }
  .calorie-estimate {
    grid-template-columns: 1fr;
  }
  .workout-record-heading {
    padding: 18px;
    gap: 12px;
  }
  .workout-glyph {
    display: none;
  }
  .workout-record summary {
    padding: 14px 18px;
  }
  .set-history {
    padding: 0 18px 18px;
  }
  .set-history li {
    gap: 8px;
    flex-wrap: wrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
.hiddenbtn {
  display: none;
}
