:root {
  --bg: #111214;
  --panel: #1a1c1f;
  --panel2: #24262a;
  --line: #33363b;
  --text: #f4f4f5;
  --muted: #adb0b8;
  --red: #e54b4b;
  --radius: 14px;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
}
html,
body {
  background: var(--bg);
}
button {
  transition:
    background 0.16s,
    border-color 0.16s,
    transform 0.16s;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #ff9292;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}
h1 {
  letter-spacing: -0.035em;
}
input,
select,
textarea {
  max-width: 100%;
}
.input {
  min-height: 46px;
  font-size: 16px;
  width: 100%;
  background: #151619;
  border-radius: 9px;
}
.btn {
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 9px;
  padding: 10px 16px;
}
.btn.small {
  min-height: 40px;
  font-size: 14px;
}
.btn.primary {
  background: #d94141;
  border-color: #d94141;
}
.btn.primary:hover {
  background: #ee5353;
}
.btn.danger {
  background: transparent;
  color: #ff9c9c;
  border-color: #6c3c3c;
}
.card {
  background: var(--panel);
  box-shadow: none;
  padding: 24px;
  border-color: #303236;
}
.card-title h2 {
  font-size: 18px;
}
.sub,
.badge,
.recommend {
  font-size: 13px;
  line-height: 1.5;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: #c5c7cc;
  font-weight: 600;
}
.field label {
  font-size: 14px;
  font-weight: 500;
}
.shell {
  max-width: none;
  margin: 0;
  padding: 0 40px 60px 260px;
}
.topbar {
  height: 88px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: none;
  margin-bottom: 28px;
}
.brand {
  position: fixed;
  top: 27px;
  left: 24px;
  font-size: 21px;
  z-index: 45;
}
.brand b {
  color: #f06565;
}
.context-label {
  font-size: 14px;
  color: var(--muted);
}
.top-actions {
  margin-left: auto;
}
.athlete-select {
  font-size: 16px;
  min-width: 180px;
  background: #202226;
  border-radius: 9px;
  min-height: 44px;
}
.icon-button {
  height: 44px;
  width: 48px;
  border-radius: 9px;
}
.content {
  max-width: 1320px;
  margin: auto;
}
.bottom-nav {
  transform: none;
  inset: 0 auto 0 0;
  width: 220px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: #191a1d;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 110px 16px 24px;
  backdrop-filter: none;
}
.bottom-nav button {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 14px;
  text-align: left;
  border-radius: 9px;
  min-height: 52px;
}
.bottom-nav button span {
  width: 24px;
  font-size: 22px;
  text-align: center;
}
.bottom-nav button small {
  font-size: 15px;
  font-weight: 500;
}
.bottom-nav button.active {
  background: #3b2427;
  color: #ff9797;
  box-shadow: inset 3px 0 #ee5c5c;
}
.bottom-nav:after {
  content: "IRONTRACK / 03";
  margin-top: auto;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: #999da5;
  padding: 16px;
}
.page-head {
  align-items: center;
  margin: 0 0 26px;
}
.page-head h1 {
  font-size: 36px;
  line-height: 1.15;
  margin: 8px 0;
}
.grid {
  gap: 20px;
}
.grid.two {
  grid-template-columns: 1.05fr 1fr;
}
.metric {
  position: relative;
  display: flex;
  flex-direction: column-reverse;
  gap: 16px;
  min-height: 130px;
}
.metric strong {
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.04em;
}
.metric span {
  font-size: 14px;
}
.metric:first-child {
  border-top: 2px solid var(--red);
}
.quick-start {
  grid-template-columns: 1fr auto;
}
.quick-start .input {
  min-width: 0;
}
.list-item {
  padding: 16px 0;
  gap: 12px;
}
.list-main b {
  white-space: normal;
}
.history-card {
  width: 100%;
}
.history-card:hover {
  background: #24262b;
}
.history-card + .history-card {
  margin-top: 10px;
}
.row {
  flex-wrap: wrap;
}
.card-title {
  flex-wrap: wrap;
}
.calendar {
  gap: 8px;
}
.cal-day {
  min-height: 54px;
  background: transparent;
  border-color: transparent;
  border-radius: 9px;
  font-size: 14px;
}
.cal-day:hover {
  background: #303239;
}
.cal-day.today {
  background: #cf4141;
  color: white;
  border: 0;
}
.cal-day.has {
  border-color: #494048;
}
.cal-day.has:after {
  background: #ff9393;
}
.cal-label {
  font-size: 13px;
}
.tabs-inline {
  gap: 8px;
  margin-bottom: 18px;
}
.tabs-inline button.active {
  background: #3b2427;
  color: #ffa0a0;
  border-color: #69393e;
}
.tabs-inline .btn {
  white-space: nowrap;
}
.active-workout {
  margin-bottom: 20px;
  border-left: 3px solid var(--red);
  background: #272023;
}
.workout-header {
  top: 0;
  padding: 16px 0;
  position: relative;
  background: var(--bg);
}
.workout-header h1 {
  font-size: 28px;
  line-height: 1.2;
}
.workout-exercise {
  margin: 20px 0;
}
.exercise-top {
  align-items: start;
}
.exercise-top h3 {
  font-size: 20px;
  line-height: 1.4;
}
.set-row {
  grid-template-columns: 32px 1fr 1fr 1fr 40px;
}
.set-table {
  margin-top: 22px;
  gap: 12px;
}
.set-labels {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.set-index {
  background: transparent;
  font-size: 14px;
  color: var(--muted);
}
.set-status {
  display: block;
  font-size: 14px;
}
.sticky-save {
  bottom: 16px;
  background: #25272d;
  border: 1px solid #494b53;
  box-shadow: 0 8px 25px #0005;
  padding: 14px;
  border-radius: 12px;
  align-items: center;
  justify-content: space-between;
}
.sticky-save .badge {
  border: 0;
  font-weight: 400;
}
.rir-help {
  font-size: 14px;
  color: var(--muted);
  margin-top: 14px;
}
.rest-control {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
}
.rest-control output {
  font-variant-numeric: tabular-nums;
  color: #ffa0a0;
}
.chart {
  height: 230px;
}
.chart-caption {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0;
}
.search-field {
  margin: 0 0 18px;
}
.empty {
  line-height: 1.6;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}
.modal {
  border-radius: 16px;
  max-height: 90dvh;
}
#modalContent {
  padding: 28px;
}
.toast {
  max-width: calc(100% - 32px);
  bottom: 28px;
  font-size: 14px;
  line-height: 1.5;
}
.progress-controls {
  grid-template-columns: 1fr auto;
}
.template-line {
  grid-template-columns: minmax(120px, 1fr) 55px 65px 55px auto;
}
.template-line b {
  overflow-wrap: anywhere;
}
.ai-panel {
  background: var(--bg);
}
.ai-compose .row {
  margin-top: 8px;
}
.ai-quick {
  flex-wrap: wrap;
}
.metric-note {
  color: var(--muted);
  font-size: 14px;
}
.section-gap {
  margin-top: 20px;
}
.input-error {
  color: #ffa0a0;
}
@media (min-width: 1550px) {
  .shell {
    padding-right: 64px;
    padding-left: 284px;
  }
}
@media (max-width: 1100px) {
  .shell {
    padding-left: 236px;
    padding-right: 20px;
  }
  .grid.two {
    grid-template-columns: 1fr;
  }
  .grid.metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .context-label {
    display: none;
  }
}
@media (max-width: 760px) {
  .shell {
    padding: 0 16px calc(110px + env(safe-area-inset-bottom));
  }
  .topbar {
    height: 74px;
    margin-bottom: 22px;
    gap: 10px;
    position: relative;
  }
  .brand {
    position: static;
    font-size: 19px;
  }
  .athlete-select {
    min-width: 0;
    width: 145px;
    max-width: 38vw;
    font-size: 16px;
  }
  .icon-button {
    width: 40px;
  }
  .top-actions {
    gap: 6px;
  }
  .bottom-nav {
    inset: auto 0 0 0;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
    gap: 0;
    border-top: 1px solid var(--line);
    border-right: 0;
    background: #191a1dfa;
  }
  .bottom-nav button {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 8px 0;
    min-height: 58px;
    text-align: center;
  }
  .bottom-nav button small {
    font-size: 12px;
  }
  .bottom-nav button span {
    font-size: 21px;
  }
  .bottom-nav button.active {
    box-shadow: none;
    background: #342326;
  }
  .bottom-nav:after {
    display: none;
  }
  .page-head h1 {
    font-size: 30px;
  }
  .page-head {
    gap: 10px;
    margin-bottom: 20px;
  }
  .card {
    padding: 18px;
  }
  .grid {
    gap: 12px;
  }
  .metric {
    min-height: 110px;
    gap: 10px;
  }
  .metric strong {
    font-size: 30px;
  }
  .quick-start {
    grid-template-columns: 1fr;
  }
  .cal-day {
    min-height: 40px;
    padding: 5px;
  }
  .calendar {
    gap: 4px;
  }
  .cal-label {
    font-size: 12px;
  }
  .sticky-save {
    bottom: calc(85px + env(safe-area-inset-bottom));
    padding: 10px;
    gap: 8px;
  }
  .sticky-save .badge {
    max-width: 48%;
    font-size: 12px;
  }
  .sticky-save .btn {
    padding: 10px;
    font-size: 14px;
  }
  .workout-header {
    align-items: start;
    flex-direction: column;
    gap: 12px;
  }
  .workout-header .row {
    width: 100%;
  }
  .workout-header h1 {
    font-size: 24px;
  }
  .exercise-top h3 {
    font-size: 18px;
  }
  .exercise-top {
    flex-wrap: wrap;
  }
  .set-row {
    grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1fr) minmax(
        0,
        1fr
      ) 32px;
    gap: 6px;
  }
  .set-row .input {
    padding: 10px 5px;
    font-size: 16px;
  }
  .set-status {
    display: block;
  }
  .template-line {
    grid-template-columns: 1fr 50px 60px;
  }
  .template-line b {
    grid-column: 1/-1;
  }
  .template-line > span:last-child {
    grid-column: 1/-1;
  }
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .field {
    min-width: 0;
  }
  .tabs-inline {
    width: 100%;
  }
  .tabs-inline .btn {
    padding: 10px;
    font-size: 14px;
  }
  .list-item {
    flex-wrap: wrap;
  }
  .toast {
    bottom: calc(96px + env(safe-area-inset-bottom));
  }
  .modal {
    width: calc(100% - 16px);
  }
  #modalContent {
    padding: 20px;
  }
  .ai-panel {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .history-card .row {
    align-items: start;
  }
  .progress-controls {
    grid-template-columns: 1fr;
  }
  .page-head {
    flex-direction: row;
    flex-wrap: wrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
