:root {
  --ink: #17271e;
  --ink-soft: #4e5d53;
  --muted: #7c8980;
  --line: #dfe3dc;
  --paper: #fffefa;
  --canvas: #f4f3ed;
  --lime: #dff06e;
  --lime-dark: #a9c52f;
  --mint: #d9eee0;
  --peach: #f3d8c8;
  --blue: #dce8ee;
  --purple: #e5def1;
  --danger: #b8463f;
  --radius-lg: 24px;
  --radius-md: 16px;
  --shadow: 0 14px 36px rgba(35, 45, 38, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 8% 18%, rgba(223, 240, 110, 0.12), transparent 26rem),
    var(--canvas);
  color: var(--ink);
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(169, 197, 47, 0.42);
  outline-offset: 3px;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: white;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
}

.skip-link:focus {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.app-shell {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 92px;
  border-bottom: 1px solid rgba(23, 39, 30, 0.1);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 13px;
  background: var(--ink);
  color: var(--lime);
  box-shadow: 0 7px 16px rgba(23, 39, 30, 0.18);
}

.brand-mark svg {
  width: 28px;
  stroke-width: 2.8;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: inherit;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1.15;
}

.brand small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-button,
.icon-button,
.text-button,
.outline-button {
  border: 0;
  background: transparent;
}

.nav-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 12px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.nav-button:hover,
.nav-button.active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 3px 12px rgba(35, 45, 38, 0.05);
}

.nav-button svg,
.outline-button svg {
  width: 18px;
  height: 18px;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 254, 250, 0.68);
}

.icon-button:hover {
  border-color: #bbc3ba;
  background: var(--paper);
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

.history-button {
  margin-left: 8px;
}

main {
  padding: 52px 0 32px;
}

.week-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 30px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #7f8e39;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.week-hero h1 {
  margin: 0;
  font-family: inherit;
  font-size: clamp(30px, 3.2vw, 46px);
  font-weight: 800;
  letter-spacing: -0.065em;
  line-height: 1.16;
}

.hero-copy {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.week-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
}

#currentWeekButton {
  min-width: 190px;
  padding: 7px 16px;
  border: 0;
  background: transparent;
  text-align: center;
}

#currentWeekButton strong,
#currentWeekButton span {
  display: block;
}

#currentWeekButton strong {
  font-size: 14px;
}

#currentWeekButton span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 14px;
  min-height: 136px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid rgba(23, 39, 30, 0.07);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: 0 6px 18px rgba(35, 45, 38, 0.035);
}

.kpi-card::after {
  position: absolute;
  right: -18px;
  bottom: -30px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: currentColor;
  content: "";
  opacity: 0.055;
}

.kpi-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
  background: var(--canvas);
}

.kpi-icon svg {
  width: 21px;
  height: 21px;
}

.kpi-days {
  color: #728329;
}

.kpi-days .kpi-icon {
  background: #eef4cb;
}

.kpi-strength {
  color: #9d5d3c;
}

.kpi-strength .kpi-icon {
  background: var(--peach);
}

.kpi-cardio {
  color: #356f85;
}

.kpi-cardio .kpi-icon {
  background: var(--blue);
}

.kpi-weight {
  color: #6f5991;
}

.kpi-weight .kpi-icon {
  background: var(--purple);
}

.kpi-card > div:nth-child(2) span {
  display: block;
  margin: 1px 0 7px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.kpi-card strong {
  display: flex;
  align-items: baseline;
  color: var(--ink);
  font-size: 12px;
}

.kpi-card strong b {
  font-size: 28px;
  letter-spacing: -0.04em;
}

.kpi-card strong small {
  margin-left: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.kpi-note {
  grid-column: 1 / -1;
  align-self: end;
  color: var(--muted);
  font-size: 10px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(340px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.panel {
  border: 1px solid rgba(23, 39, 30, 0.08);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.quick-log-panel,
.progress-panel,
.calendar-panel,
.recent-panel {
  padding: 26px;
}

.panel-head,
.modal-head,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.panel-head h2,
.modal-head h2 {
  margin: 0;
  font-family: inherit;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.045em;
}

.segmented-control {
  display: inline-flex;
  padding: 4px;
  border-radius: 12px;
  background: #eeeee8;
}

.segmented-control button {
  min-width: 72px;
  padding: 8px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.segmented-control button.active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 2px 7px rgba(30, 42, 34, 0.08);
}

.log-date-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 24px 0 4px;
  padding: 14px 0;
  border-top: 1px solid #ebede8;
  border-bottom: 1px solid #ebede8;
}

.log-date-row > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.day-chips {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.day-chip {
  display: grid;
  min-height: 46px;
  padding: 5px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
}

.day-chip small,
.day-chip b {
  display: block;
}

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

.day-chip b {
  margin-top: 1px;
  font-size: 13px;
}

.day-chip:hover {
  background: var(--canvas);
}

.day-chip.active {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.day-chip.active small {
  color: var(--lime);
}

.day-chip.today:not(.active) {
  color: #77882a;
}

.quick-form fieldset {
  min-width: 0;
  margin: 24px 0 0;
  padding: 0;
  border: 0;
}

.quick-form legend {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  font-size: 13px;
  font-weight: 800;
}

.quick-form legend span {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--lime);
  font-size: 10px;
}

.field-help {
  margin: 7px 0 0 30px;
  color: var(--muted);
  font-size: 10px;
}

.muscle-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.muscle-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfbf8;
  text-align: left;
}

.muscle-option:hover {
  border-color: #acb4aa;
}

.muscle-option.active {
  border-color: var(--ink);
  background: #f1f5df;
  box-shadow: inset 0 0 0 1px var(--ink);
}

.muscle-option > span:nth-child(2) {
  min-width: 0;
}

.muscle-option strong,
.muscle-option small {
  display: block;
}

.muscle-option strong {
  font-size: 13px;
}

.muscle-option small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.muscle-week-count {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  min-width: 34px;
  height: 20px;
  padding: 0 6px;
  place-items: center;
  border-radius: 999px;
  background: var(--ink);
  color: var(--lime);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.muscle-week-count.goal-met {
  background: var(--lime);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.muscle-visual {
  position: relative;
  width: 35px;
  height: 43px;
  flex: 0 0 auto;
  border-radius: 44% 44% 36% 36%;
  background: #e4e6df;
}

.muscle-visual::before,
.muscle-visual::after {
  position: absolute;
  content: "";
}

.muscle-visual::before {
  top: -5px;
  left: 12px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #cfd4ca;
}

.chest-visual::after {
  top: 9px;
  left: 5px;
  width: 25px;
  height: 10px;
  border-radius: 50% 50% 35% 35%;
  background: #d98660;
}

.back-visual::after {
  top: 8px;
  left: 5px;
  width: 25px;
  height: 20px;
  clip-path: polygon(0 0, 50% 15%, 100% 0, 78% 100%, 22% 100%);
  background: #6b8fa0;
}

.legs-visual::after {
  bottom: 2px;
  left: 6px;
  width: 23px;
  height: 20px;
  border-radius: 4px 4px 10px 10px;
  background: #8873a6;
}

.abs-visual::after {
  top: 10px;
  left: 10px;
  width: 15px;
  height: 21px;
  border-radius: 5px;
  background: repeating-linear-gradient(to bottom, #bd9549 0 5px, transparent 5px 8px);
}

.exercise-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.exercise-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 58px;
  padding: 8px 10px 8px 15px;
  border: 1px solid #e5e8e2;
  border-radius: 13px;
  background: #fbfbf8;
}

.exercise-row.has-sets {
  border-color: #cbd993;
  background: #f7f9ea;
}

.exercise-name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.exercise-name > span:first-child {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  background: white;
  font-size: 15px;
}

.exercise-name strong,
.exercise-name small {
  display: block;
}

.exercise-name strong {
  font-size: 12px;
}

.exercise-name small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.set-stepper {
  display: flex;
  align-items: center;
  gap: 5px;
}

.set-stepper button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  font-size: 18px;
  font-weight: 500;
}

.set-stepper button:hover:not(:disabled) {
  border-color: var(--ink);
}

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

.set-stepper output {
  min-width: 34px;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
}

.set-stepper output small {
  display: block;
  margin-top: -2px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #ebede8;
}

.form-footer > div span,
.form-footer > div strong {
  display: block;
}

.form-footer > div span {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
}

.form-footer > div strong {
  font-size: 15px;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--ink);
  border-radius: 12px;
  background: var(--ink);
  color: white;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 8px 16px rgba(23, 39, 30, 0.14);
}

.primary-button:hover:not(:disabled) {
  background: #233b2d;
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
  box-shadow: none;
}

.primary-button svg {
  width: 18px;
  color: var(--lime);
  stroke-width: 2.5;
}

.cardio-picker {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.cardio-option {
  display: grid;
  min-height: 86px;
  padding: 10px 5px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fbfbf8;
  font-size: 11px;
  font-weight: 700;
}

.cardio-option span:first-child {
  font-size: 22px;
}

.cardio-option.active {
  border-color: var(--ink);
  background: #eaf2f2;
  box-shadow: inset 0 0 0 1px var(--ink);
}

.duration-picker,
.intensity-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.choice-chip {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfbf8;
  font-size: 11px;
  font-weight: 700;
}

.choice-chip.active {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.guide-link {
  color: #74852e;
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
}

.guide-link:hover {
  text-decoration: underline;
}

.progress-intro {
  margin: 18px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.progress-intro strong {
  color: var(--ink);
}

.muscle-progress-list {
  display: grid;
  gap: 10px;
}

.muscle-progress-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 13px;
  padding: 13px;
  border: 1px solid #e5e8e2;
  border-radius: 15px;
  background: #fbfbf8;
}

.progress-ring {
  --progress: 0;
  --ring-color: var(--lime-dark);
  position: relative;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--ring-color) calc(var(--progress) * 1%), #e7e9e3 0);
}

.progress-ring::before {
  position: absolute;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fbfbf8;
  content: "";
}

.progress-ring b {
  position: relative;
  z-index: 1;
  font-size: 11px;
}

.progress-copy strong,
.progress-copy span {
  display: block;
}

.progress-copy strong {
  font-size: 12px;
}

.progress-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.progress-count {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

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

.guide-note {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding: 14px;
  border-radius: 13px;
  background: #f3f6df;
}

.guide-note svg {
  width: 17px;
  flex: 0 0 auto;
  color: #75852d;
}

.guide-note p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.65;
}

.guide-note strong {
  color: var(--ink);
  font-size: 10px;
}

.lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(330px, 0.75fr);
  gap: 18px;
  margin-top: 18px;
}

.legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 9px;
}

.legend i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 5px;
  border-radius: 50%;
  background: #d98660;
}

.legend i:nth-child(2) {
  background: #6b8fa0;
}

.week-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(66px, 1fr));
  gap: 7px;
  margin-top: 20px;
  overflow-x: auto;
}

.calendar-day {
  min-height: 136px;
  padding: 11px 9px;
  border: 1px solid #e7e9e3;
  border-radius: 13px;
  background: #fafaf7;
}

.calendar-day.today {
  border-color: #aabb65;
  background: #f8faeb;
}

.calendar-day > span,
.calendar-day > strong {
  display: block;
  text-align: center;
}

.calendar-day > span {
  color: var(--muted);
  font-size: 9px;
}

.calendar-day > strong {
  margin: 3px 0 10px;
  font-size: 14px;
}

.calendar-pill {
  margin-top: 5px;
  padding: 5px 6px;
  overflow: hidden;
  border-radius: 6px;
  background: var(--peach);
  color: #74432d;
  font-size: 8px;
  font-weight: 700;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-pill.cardio {
  background: var(--blue);
  color: #315e70;
}

.calendar-empty {
  display: grid;
  height: 52px;
  place-items: center;
  color: #c0c6bd;
  font-size: 20px;
}

.text-button {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}

.text-button span {
  margin-left: 3px;
}

.recent-list {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

.recent-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 11px 0;
  border-bottom: 1px solid #eceee9;
}

.recent-item:last-child {
  border-bottom: 0;
}

.recent-icon {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border-radius: 10px;
  background: var(--peach);
  font-size: 15px;
}

.recent-icon.cardio {
  background: var(--blue);
}

.recent-item strong,
.recent-item span {
  display: block;
}

.recent-item strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.recent-item > b {
  font-size: 11px;
}

.empty-state {
  display: grid;
  min-height: 174px;
  padding: 20px;
  place-items: center;
  border: 1px dashed #d9ded6;
  border-radius: 13px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  line-height: 1.7;
}

.empty-state span {
  display: block;
  margin-bottom: 5px;
  font-size: 25px;
}

.storage-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.storage-note svg {
  width: 14px;
}

.modal {
  width: min(620px, calc(100% - 32px));
  max-height: min(820px, calc(100vh - 32px));
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(23, 39, 30, 0.1);
  border-radius: 24px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(23, 39, 30, 0.2);
}

.wide-modal {
  width: min(880px, calc(100% - 32px));
}

.modal::backdrop {
  background: rgba(20, 29, 23, 0.52);
  backdrop-filter: blur(4px);
}

.modal-head {
  padding: 22px 26px;
  border-bottom: 1px solid #e6e9e3;
}

.modal-head .icon-button {
  width: 38px;
  height: 38px;
  font-size: 23px;
}

.dialog-body {
  max-height: calc(100vh - 155px);
  padding: 24px 26px 28px;
  overflow-y: auto;
}

.stats-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stats-summary-card {
  padding: 16px;
  border-radius: 14px;
  background: var(--canvas);
}

.stats-summary-card span,
.stats-summary-card strong {
  display: block;
}

.stats-summary-card span {
  color: var(--muted);
  font-size: 9px;
}

.stats-summary-card strong {
  margin-top: 5px;
  font-size: 21px;
}

.stats-summary-card small {
  margin-left: 2px;
  color: var(--muted);
  font-size: 9px;
}

.chart-section {
  margin-top: 26px;
}

.section-title h3,
.weight-entry h3 {
  margin: 0;
  font-size: 14px;
}

.section-title p,
.weight-entry p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.volume-chart {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 10px;
  height: 210px;
  margin-top: 16px;
  padding: 14px 12px 0;
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 48px, #eceee9 49px);
}

.week-bar {
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
  gap: 8px;
  height: 100%;
  text-align: center;
}

.bar-stack {
  display: flex;
  height: 100%;
  align-items: end;
  justify-content: center;
  gap: 3px;
}

.bar-stack i {
  width: min(17px, 42%);
  min-height: 2px;
  border-radius: 5px 5px 0 0;
  background: #d98660;
}

.bar-stack i:last-child {
  background: #6b8fa0;
}

.week-bar span {
  color: var(--muted);
  font-size: 8px;
  white-space: nowrap;
}

.muscle-bars {
  display: grid;
  gap: 13px;
  margin-top: 16px;
}

.muscle-bar-row {
  display: grid;
  grid-template-columns: 48px 1fr 46px;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  font-weight: 700;
}

.muscle-bar-row > div {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8ebe5;
}

.muscle-bar-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #d98660;
}

.muscle-bar-row:nth-child(2) i {
  background: #6b8fa0;
}

.muscle-bar-row:nth-child(3) i {
  background: #8873a6;
}

.muscle-bar-row:nth-child(4) i {
  background: #bd9549;
}

.muscle-bar-row strong {
  text-align: right;
}

.weight-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 18px;
}

.weight-entry,
.weight-chart-card {
  padding: 20px;
  border: 1px solid #e5e8e2;
  border-radius: 16px;
  background: #fbfbf8;
}

.weight-entry .primary-button {
  width: 100%;
}

.weight-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 23px 0;
}

.weight-stepper button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  font-size: 19px;
}

.weight-stepper label {
  display: flex;
  align-items: baseline;
}

.weight-stepper input {
  width: 92px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.05em;
  text-align: center;
}

.weight-stepper span {
  color: var(--muted);
  font-size: 10px;
}

.weight-chart {
  min-height: 190px;
  margin-top: 12px;
}

.weight-chart svg {
  width: 100%;
  height: 190px;
  overflow: visible;
}

.weight-chart .grid-line {
  stroke: #e7eae4;
  stroke-width: 1;
}

.weight-chart .area {
  fill: url(#weightGradient);
  stroke: none;
}

.weight-chart .line {
  fill: none;
  stroke: #74872d;
  stroke-width: 3;
}

.weight-chart circle {
  fill: var(--paper);
  stroke: #74872d;
  stroke-width: 2;
}

.weight-history {
  display: flex;
  gap: 8px;
  padding: 0 26px 26px;
  overflow-x: auto;
}

.weight-history-item {
  min-width: 92px;
  padding: 11px;
  border-radius: 12px;
  background: var(--canvas);
  text-align: center;
}

.weight-history-item strong,
.weight-history-item span {
  display: block;
}

.weight-history-item strong {
  font-size: 12px;
}

.weight-history-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.outline-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  font-size: 10px;
  font-weight: 700;
}

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

.history-row {
  display: grid;
  grid-template-columns: 72px auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  border: 1px solid #e5e8e2;
  border-radius: 13px;
}

.history-row time {
  color: var(--muted);
  font-size: 9px;
}

.type-badge {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--peach);
  color: #74432d;
  font-size: 8px;
  font-weight: 800;
}

.type-badge.cardio {
  background: var(--blue);
  color: #315e70;
}

.history-row strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-row > b {
  font-size: 10px;
}

.delete-button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #98a097;
}

.delete-button:hover {
  background: #f7e9e6;
  color: var(--danger);
}

.delete-button svg {
  width: 15px;
}

.toast {
  position: fixed;
  z-index: 200;
  right: 22px;
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(380px, calc(100% - 44px));
  padding: 13px 16px;
  border-radius: 13px;
  background: var(--ink);
  color: white;
  font-size: 11px;
  box-shadow: 0 15px 40px rgba(23, 39, 30, 0.26);
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
  transition: 180ms ease;
}

.toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.toast button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--lime);
  font-size: 10px;
  font-weight: 800;
}

@media (max-width: 1050px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-grid,
  .lower-grid {
    grid-template-columns: 1fr;
  }

  .muscle-progress-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .muscle-progress-card {
    grid-template-columns: auto 1fr;
  }

  .progress-count {
    grid-column: 1 / -1;
    text-align: center;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 24px, 680px);
  }

  .topbar {
    min-height: 74px;
  }

  .top-actions .nav-button {
    width: 40px;
    min-height: 40px;
    padding: 0;
    justify-content: center;
    font-size: 0;
  }

  .history-button {
    margin-left: 0;
  }

  .brand-mark {
    width: 39px;
    height: 39px;
  }

  .brand small {
    display: none;
  }

  main {
    padding-top: 34px;
  }

  .week-hero {
    display: block;
  }

  .week-switcher {
    margin-top: 24px;
    justify-content: center;
  }

  .kpi-grid {
    gap: 9px;
  }

  .kpi-card {
    min-height: 122px;
    padding: 15px;
  }

  .kpi-icon {
    width: 35px;
    height: 35px;
  }

  .kpi-card strong b {
    font-size: 23px;
  }

  .quick-log-panel,
  .progress-panel,
  .calendar-panel,
  .recent-panel {
    padding: 20px;
  }

  .panel-head {
    align-items: flex-start;
  }

  .log-date-row {
    display: block;
  }

  .day-chips {
    margin-top: 10px;
  }

  .muscle-picker {
    grid-template-columns: repeat(2, 1fr);
  }

  .muscle-option {
    min-height: 62px;
  }

  .muscle-visual {
    height: 36px;
  }

  .cardio-picker {
    grid-template-columns: repeat(3, 1fr);
  }

  .muscle-progress-list {
    grid-template-columns: 1fr;
  }

  .muscle-progress-card {
    grid-template-columns: auto 1fr auto;
  }

  .progress-count {
    grid-column: auto;
  }

  .weight-layout {
    grid-template-columns: 1fr;
  }

  .stats-summary {
    grid-template-columns: 1fr;
  }

  .history-row {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
  }

  .history-row time {
    display: none;
  }
}

@media (max-width: 480px) {
  .brand strong {
    font-size: 18px;
  }

  .top-actions {
    gap: 3px;
  }

  .top-actions .nav-button,
  .history-button {
    width: 36px;
    height: 36px;
    min-height: 36px;
  }

  .week-hero h1 {
    font-size: 29px;
  }

  .hero-copy {
    max-width: 280px;
    line-height: 1.6;
  }

  #currentWeekButton {
    min-width: 164px;
    padding-inline: 6px;
  }

  .kpi-card {
    display: block;
    min-height: 128px;
  }

  .kpi-card > div:nth-child(2) span {
    margin-top: 9px;
  }

  .kpi-note {
    display: none;
  }

  .panel-head h2 {
    font-size: 18px;
  }

  .segmented-control button {
    min-width: 58px;
    padding-inline: 8px;
  }

  .day-chips {
    gap: 2px;
  }

  .day-chip {
    min-height: 43px;
    padding: 3px;
  }

  .exercise-row {
    grid-template-columns: minmax(0, 1fr) auto;
    padding-left: 10px;
  }

  .exercise-name > span:first-child {
    display: none;
  }

  .form-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .form-footer .primary-button {
    width: 100%;
  }

  .cardio-picker {
    grid-template-columns: repeat(2, 1fr);
  }

  .calendar-panel {
    overflow: hidden;
  }

  .week-calendar {
    margin-right: -20px;
    padding-right: 20px;
  }

  .modal {
    width: 100%;
    max-height: calc(100vh - 12px);
    margin-bottom: 0;
    border-radius: 22px 22px 0 0;
  }

  .modal[open] {
    position: fixed;
    top: auto;
    bottom: 0;
  }

  .modal-head,
  .dialog-body {
    padding-right: 18px;
    padding-left: 18px;
  }

  .history-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .outline-button {
    justify-content: center;
  }

  .volume-chart {
    gap: 4px;
    padding-inline: 4px;
  }

  .weight-history {
    padding-inline: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
