@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap");

:root {
  --canvas: #f5f2ec;
  --canvas-deep: #ede9e1;
  --panel: #fffdfa;
  --ink: #222722;
  --muted: #7f847d;
  --muted-2: #a4a79f;
  --line: #e6e2da;
  --charcoal: #232823;
  --coral: #f76f5d;
  --coral-deep: #e94d42;
  --blush-1: #f8d7d1;
  --blush-2: #f5aaa0;
  --blush-3: #ef7467;
  --blush-4: #d9453b;
  --mint: #dfeae0;
  --sage: #768979;
  --shadow: 0 14px 42px rgba(67, 60, 49, 0.07), 0 2px 8px rgba(67, 60, 49, 0.04);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  color-scheme: light;
  font-family: "DM Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html {
  scroll-behavior: smooth;
  background: var(--canvas);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.88), transparent 29rem),
    var(--canvas);
}

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

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

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(247, 111, 93, 0.25);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  color: white;
  background: var(--charcoal);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: none;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  display: flex;
  width: 224px;
  flex-direction: column;
  padding: 34px 22px 26px;
  border-right: 1px solid rgba(212, 207, 197, 0.7);
  background: rgba(250, 248, 244, 0.86);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: fit-content;
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -1.1px;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: flex;
  width: 30px;
  height: 30px;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--charcoal);
}

.brand-mark i {
  display: block;
  width: 4px;
  border-radius: 4px 4px 0 0;
  background: #fff;
  transform-origin: bottom;
}

.brand-mark i:first-child {
  height: 12px;
  transform: rotate(-24deg) translateY(-3px);
}

.brand-mark i:nth-child(2) {
  height: 19px;
  transform: translateY(-2px);
}

.brand-mark i:last-child {
  height: 12px;
  transform: rotate(24deg) translateY(-3px);
}

.side-nav {
  display: grid;
  gap: 7px;
  margin-top: 64px;
}

.side-nav-divider {
  height: 1px;
  margin: 9px 10px 8px;
  background: var(--line);
}

.nav-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 13px;
  padding: 12px 14px;
  border: 0;
  border-radius: 13px;
  color: #777c75;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: 160ms ease;
}

.nav-item:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
}

.nav-item.is-active {
  color: #fff;
  background: var(--charcoal);
  box-shadow: 0 8px 20px rgba(36, 40, 35, 0.14);
}

.icon {
  display: inline-grid;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  place-items: center;
}

.icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 14px 10px;
  border-top: 1px solid var(--line);
}

.sidebar-bottom > div:last-child {
  display: grid;
  gap: 2px;
}

.sidebar-bottom strong {
  font-size: 12px;
}

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

.goal-ring {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
}

.goal-ring svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.goal-ring circle {
  fill: none;
  stroke: #e2ded5;
  stroke-width: 3;
}

.goal-ring .goal-progress {
  stroke: var(--coral);
  stroke-dasharray: 80 21;
  stroke-linecap: round;
}

.goal-ring strong {
  font-size: 11px;
}

.main-content {
  min-height: 100vh;
  margin-left: 224px;
}

.dashboard {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 42px clamp(28px, 4vw, 68px) 80px;
}

.mobile-header,
.mobile-nav {
  display: none;
}

.dashboard-heading,
.section-heading,
.panel-heading,
.readiness-top,
.detail-heading,
.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dashboard-heading h1 {
  margin: 3px 0 0;
  font-family: "Manrope", sans-serif;
  font-size: clamp(26px, 2.4vw, 38px);
  line-height: 1;
  letter-spacing: -1.5px;
}

.eyebrow {
  margin: 0;
  color: #969a92;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.55px;
}

.heading-actions,
.date-nav {
  display: flex;
  align-items: center;
  gap: 9px;
}

.account-chip {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: #666b64;
  background: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.account-state-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #aaa9a3;
  box-shadow: 0 0 0 3px rgba(170, 169, 163, 0.14);
}

body[data-account-state="online"] .account-state-dot {
  background: #719078;
  box-shadow: 0 0 0 3px rgba(113, 144, 120, 0.16);
}

body[data-account-state="offline"] .account-state-dot,
body[data-account-state="syncing"] .account-state-dot {
  background: #e29465;
  box-shadow: 0 0 0 3px rgba(226, 148, 101, 0.17);
}

.date-nav {
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.icon-button,
.tool-button,
.modal-close {
  display: grid;
  border: 0;
  place-items: center;
  cursor: pointer;
}

.icon-button {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: transparent;
}

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

.today-button {
  padding: 7px 10px;
  border: 0;
  color: #666b64;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border-radius: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.primary-button {
  border: 1px solid var(--charcoal);
  color: white;
  background: var(--charcoal);
  box-shadow: 0 8px 18px rgba(35, 40, 35, 0.13);
}

.primary-button:hover:not(:disabled),
.secondary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 11px 24px rgba(35, 40, 35, 0.16);
}

.primary-button:disabled {
  border-color: #c9cbc5;
  color: #fff;
  background: #c9cbc5;
  box-shadow: none;
  cursor: not-allowed;
}

.secondary-button {
  border: 1px solid #d9d8d1;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.6);
}

.dashboard-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 28px 0 20px;
}

.period-tabs {
  display: inline-grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.56);
}

.period-tabs button,
.body-view-tabs button,
.anatomy-mode-tabs button {
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.period-tabs button {
  min-width: 72px;
  padding: 8px 16px;
  border-radius: 9px;
}

.period-tabs button.is-active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 2px 9px rgba(55, 51, 44, 0.1);
}

.data-mode-control {
  display: flex;
  align-items: center;
  gap: 11px;
}

.data-mode-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
}

.data-mode-note i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e59587;
  box-shadow: 0 0 0 3px rgba(229, 149, 135, 0.14);
}

body[data-data-mode="user"] .data-mode-note i {
  background: #78957d;
  box-shadow: 0 0 0 3px rgba(120, 149, 125, 0.14);
}

.data-mode-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.56);
}

.data-mode-tabs button {
  min-width: 70px;
  padding: 8px 12px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.data-mode-tabs button.is-active {
  color: #fff;
  background: var(--charcoal);
  box-shadow: 0 3px 10px rgba(42, 47, 42, 0.16);
}

.visual-layout {
  display: grid;
  grid-template-columns: minmax(510px, 1.65fr) minmax(300px, 0.85fr);
  gap: 20px;
  align-items: start;
}

.body-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 20px;
}

.panel {
  border: 1px solid rgba(226, 222, 214, 0.92);
  border-radius: var(--radius-xl);
  background: rgba(255, 253, 250, 0.9);
  box-shadow: var(--shadow);
}

.body-card {
  position: relative;
  display: flex;
  height: 690px;
  flex-direction: column;
  padding: 25px 28px 20px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 49%, rgba(248, 238, 228, 0.66) 0, rgba(255, 253, 250, 0.1) 40%),
    rgba(255, 253, 250, 0.92);
}

.panel-heading {
  position: relative;
  z-index: 4;
}

.panel-heading h2,
.section-heading h2,
.history-section h2,
.readiness-card h2,
.muscle-detail h2,
.focus-card h2,
.modal-header h2 {
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-size: 17px;
  letter-spacing: -0.45px;
}

.panel-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.viewer-heading-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.body-view-tabs,
.anatomy-mode-tabs {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f8f5ef;
}

.body-view-tabs button,
.anatomy-mode-tabs button {
  padding: 7px 12px;
  border-radius: 8px;
}

.body-view-tabs button.is-active {
  color: #fff;
  background: var(--charcoal);
}

.anatomy-mode-tabs button.is-active {
  color: #963f35;
  background: #f9ded9;
  box-shadow: inset 0 0 0 1px rgba(235, 112, 95, 0.12);
}

.body-visual-wrap {
  position: relative;
  display: grid;
  min-height: 565px;
  flex: 1;
  place-items: center;
  perspective: 1200px;
}

.body-glow {
  position: absolute;
  top: 49%;
  left: 50%;
  width: min(82%, 490px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(234, 219, 206, 0.45), rgba(246, 241, 234, 0.1) 58%, transparent 71%);
  transform: translate(-50%, -50%);
  filter: blur(2px);
}

.body-stage-window {
  position: absolute;
  z-index: 2;
  inset: 0;
  overflow: hidden;
  border-radius: 22px;
}

.body-stage {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
  touch-action: none;
  cursor: grab;
  user-select: none;
  perspective: 1200px;
}

.body-card .body-stage {
  width: 100%;
}

.body-stage-window .body-stage {
  height: 100%;
}

#muscle-canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 420ms ease;
}

.body-stage.is-model-ready #muscle-canvas {
  opacity: 1;
}

.model-loading,
.model-error {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: #666b64;
  background: radial-gradient(circle, rgba(255, 253, 250, 0.55), rgba(255, 253, 250, 0));
  text-align: center;
}

.model-loading[hidden],
.model-error[hidden] {
  display: none;
}

.model-loading strong,
.model-error strong {
  font-family: "Manrope", sans-serif;
  font-size: 12px;
}

.model-loading > span:last-child,
.model-error span {
  color: var(--muted);
  font-size: 9px;
}

.model-loader-ring {
  width: 34px;
  height: 34px;
  margin-bottom: 4px;
  border: 3px solid #eee7de;
  border-top-color: var(--coral);
  border-radius: 50%;
  animation: model-spin 800ms linear infinite;
}

@keyframes model-spin {
  to { transform: rotate(360deg); }
}

.body-stage:active {
  cursor: grabbing;
}

.body-rotator {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 620ms cubic-bezier(0.2, 0.75, 0.15, 1);
}

.body-rotator.is-back {
  transform: rotateY(180deg);
}

.body-rotator.is-focused {
  transform: scale(1.035);
}

.body-rotator.is-back.is-focused {
  transform: rotateY(180deg) scale(1.035);
}

.body-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.body-back {
  transform: rotateY(180deg);
}

.body-face svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 18px 17px rgba(59, 47, 37, 0.11));
}

.body-base {
  fill: url(#body-base-gradient);
  stroke: #d3cfc6;
  stroke-width: 1.2;
}

.body-detail {
  fill: none;
  stroke: rgba(116, 108, 99, 0.26);
  stroke-width: 1.15;
  stroke-linecap: round;
}

.body-shade {
  fill: rgba(194, 188, 177, 0.28);
}

.muscle {
  fill: #e7e3dc;
  stroke: rgba(122, 112, 103, 0.37);
  stroke-width: 1.05;
  cursor: pointer;
  transition: fill 200ms ease, stroke 200ms ease, filter 200ms ease, opacity 200ms ease;
  vector-effect: non-scaling-stroke;
}

.muscle:hover,
.muscle:focus {
  stroke: #6b5f57;
  stroke-width: 1.8;
  filter: brightness(1.01) saturate(1.08);
  outline: none;
}

.muscle.load-1 {
  fill: var(--blush-1);
}

.muscle.load-2 {
  fill: var(--blush-2);
}

.muscle.load-3 {
  fill: var(--blush-3);
  stroke: rgba(140, 61, 54, 0.46);
}

.muscle.load-4 {
  fill: var(--blush-4);
  stroke: rgba(113, 38, 32, 0.55);
}

.body-face.has-selection .muscle:not(.is-selected) {
  opacity: 0.48;
}

.muscle.is-selected {
  stroke: #80362f;
  stroke-width: 2.2;
  filter: drop-shadow(0 0 7px rgba(232, 78, 67, 0.35));
}

.body-tools {
  position: absolute;
  z-index: 4;
  right: 0;
  bottom: 7px;
  left: 0;
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  margin: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 23px rgba(62, 56, 48, 0.08);
  backdrop-filter: blur(12px);
}

.tool-button {
  width: 37px;
  height: 37px;
  border-radius: 11px;
  color: #5f645e;
  background: #f5f2ec;
}

.tool-button:hover {
  color: #fff;
  background: var(--charcoal);
}

.view-label {
  display: grid;
  min-width: 78px;
  gap: 1px;
  text-align: center;
}

.view-label span {
  font-size: 11px;
  font-weight: 700;
}

.view-label small {
  color: var(--muted);
  font-size: 8px;
}

.muscle-popover {
  position: absolute;
  z-index: 8;
  top: 28%;
  left: calc(50% + 80px);
  display: grid;
  width: max-content;
  min-width: 184px;
  max-width: min(264px, calc(100% - 24px));
  gap: 9px;
  padding: 11px 28px 11px 12px;
  border: 1px solid rgba(223, 217, 208, 0.9);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 30px rgba(51, 46, 40, 0.13);
  backdrop-filter: blur(10px);
  animation: pop-in 180ms ease-out both;
}

.muscle-popover[hidden] {
  display: none;
}

.muscle-popover::before {
  position: absolute;
  top: 50%;
  right: 100%;
  width: 30px;
  height: 1px;
  background: #c5bcb1;
  content: "";
}

.muscle-popover #close-popover {
  position: absolute;
  top: 2px;
  right: 6px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 17px;
  cursor: pointer;
}

.popover-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 4px rgba(247, 111, 93, 0.15);
}

.popover-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.popover-summary {
  display: grid;
}

.popover-summary strong {
  font-size: 11px;
}

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

.muscle-layer-picker {
  display: grid;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid #eee9e1;
}

.muscle-layer-picker[hidden] {
  display: none;
}

.layer-picker-label {
  color: #8b8982;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.muscle-layer-options {
  display: grid;
  gap: 4px;
}

.muscle-popover .layer-option {
  position: static;
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--ink);
  background: #f7f5f1;
  text-align: left;
  cursor: pointer;
}

.muscle-popover .layer-option:hover,
.muscle-popover .layer-option.is-active {
  border-color: rgba(247, 111, 93, 0.34);
  background: rgba(247, 111, 93, 0.1);
}

.layer-option > span {
  display: grid;
  min-width: 0;
}

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

.layer-option small {
  color: var(--muted);
  font-size: 8px;
}

.layer-option i {
  color: var(--coral);
  font-size: 16px;
  font-style: normal;
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(5px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.heat-legend {
  position: absolute;
  z-index: 4;
  bottom: 24px;
  left: 27px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.heat-legend i {
  display: block;
  width: 16px;
  height: 6px;
  border-radius: 8px;
}

.heat-legend .heat-1 { margin-left: 4px; background: var(--blush-1); }
.heat-legend .heat-2 { background: var(--blush-2); }
.heat-legend .heat-3 { background: var(--blush-3); }
.heat-legend .heat-4 { margin-right: 4px; background: var(--blush-4); }

.insights-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.readiness-card,
.activity-calendar,
.muscle-detail,
.quick-stat,
.attention-card,
.focus-card {
  padding: 23px;
}

.activity-calendar[hidden] {
  display: none;
}

.activity-calendar {
  flex: 0 0 auto;
  padding: 20px 22px 18px;
}

.calendar-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.calendar-card-heading h2 {
  margin: 4px 0 0;
  font-family: "Manrope", sans-serif;
  font-size: 17px;
  letter-spacing: -0.45px;
}

.calendar-active-count {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  color: #a95246;
  background: #fae8e4;
  font-size: 9px;
  font-weight: 800;
}

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

.calendar-weekdays {
  margin-top: 16px;
  color: #a1a39d;
  font-size: 8px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}

.calendar-days {
  margin-top: 7px;
  row-gap: 3px;
}

.calendar-day {
  display: grid;
  min-width: 0;
  min-height: 29px;
  place-items: center;
  color: #777a74;
  font-size: 10px;
}

.calendar-day-number {
  display: grid;
  width: 27px;
  height: 27px;
  border: 2px solid transparent;
  border-radius: 50%;
  place-items: center;
}

.calendar-day.has-workout .calendar-day-number {
  border-color: var(--coral);
  color: #903f35;
  background: #fff1ed;
  box-shadow: 0 3px 9px rgba(215, 91, 75, 0.12);
  font-weight: 800;
}

.calendar-day.is-today:not(.has-workout) .calendar-day-number {
  color: var(--ink);
  font-weight: 800;
}

.activity-calendar[data-calendar-period="week"] .calendar-day {
  min-height: 39px;
}

.activity-calendar[data-calendar-period="week"] .calendar-day-number {
  width: 32px;
  height: 32px;
}

.readiness-card {
  color: white;
  border-color: var(--charcoal);
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.13), transparent 42%),
    var(--charcoal);
}

.readiness-card .eyebrow {
  color: #aeb7ad;
}

.readiness-card h2 {
  margin-top: 5px;
  font-size: 20px;
}

.readiness-card > p {
  margin: 18px 0;
  color: #c7cec6;
  font-size: 12px;
  line-height: 1.6;
}

.score-disc {
  display: grid;
  width: 55px;
  height: 55px;
  flex: 0 0 auto;
  border: 5px solid rgba(255, 255, 255, 0.17);
  border-top-color: var(--coral);
  border-right-color: var(--coral);
  border-radius: 50%;
  place-items: center;
  font-family: "Manrope", sans-serif;
  font-size: 15px;
  font-weight: 800;
  transform: rotate(10deg);
}

.score-disc::first-line {
  transform: rotate(-10deg);
}

.balance-track,
.detail-progress {
  height: 6px;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
}

.balance-track i,
.detail-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--coral);
  transition: width 500ms ease;
}

.muscle-detail {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
}

.detail-heading {
  justify-content: flex-start;
}

.detail-muscle-icon {
  position: relative;
  width: 45px;
  height: 45px;
  flex: 0 0 auto;
  margin-right: 12px;
  border-radius: 14px;
  background: #f9e3df;
}

.detail-muscle-icon::before,
.detail-muscle-icon::after {
  position: absolute;
  top: 11px;
  width: 12px;
  height: 20px;
  border-radius: 60% 40% 45% 55%;
  background: var(--coral);
  content: "";
}

.detail-muscle-icon::before { left: 10px; transform: rotate(-8deg); }
.detail-muscle-icon::after { right: 10px; transform: scaleX(-1) rotate(-8deg); }

.detail-heading .subtle {
  margin-left: auto;
  color: var(--muted);
  font-size: 20px;
}

.detail-heading .subtle[hidden] {
  display: none;
}

.detail-heading h2 {
  margin-top: 3px;
  font-size: 18px;
}

.muscle-detail.is-empty .detail-numbers,
.muscle-detail.is-empty .detail-progress,
.muscle-detail.is-empty .detail-note,
.muscle-detail.is-empty .detail-history,
.muscle-detail.is-empty .muscle-suggestions {
  display: none;
}

.muscle-detail-empty {
  display: grid;
  min-height: 210px;
  flex: 1;
  align-content: center;
  justify-items: center;
  padding: 24px 12px 10px;
  text-align: center;
}

.muscle-detail-empty[hidden] {
  display: none;
}

.muscle-detail-empty strong {
  margin-top: 13px;
  font-family: "Manrope", sans-serif;
  font-size: 13px;
}

.muscle-detail-empty > span:last-child {
  max-width: 230px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.empty-target-mark {
  position: relative;
  display: grid;
  width: 47px;
  height: 47px;
  border: 1px solid #ddd6cc;
  border-radius: 50%;
  background: #f6f2ec;
  place-items: center;
}

.empty-target-mark::before {
  width: 24px;
  height: 24px;
  border: 1px solid #d3c9be;
  border-radius: 50%;
  content: "";
}

.empty-target-mark i {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--coral);
}

.detail-numbers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 26px 0 17px;
}

.detail-numbers > div {
  display: grid;
  gap: 2px;
  padding-right: 10px;
  border-right: 1px solid var(--line);
}

.detail-numbers > div:last-child {
  border: 0;
}

.detail-numbers strong {
  font-family: "Manrope", sans-serif;
  font-size: 22px;
  letter-spacing: -0.7px;
}

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

.detail-progress {
  background: #eeeae3;
}

.detail-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 10px 0 18px;
  color: #68746a;
  font-size: 10px;
  font-weight: 600;
}

.detail-note span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #78a17d;
}

.detail-exercises {
  display: grid;
  gap: 8px;
}

.detail-history {
  margin-top: auto;
}

.detail-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
  color: #8c8f88;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-section-heading small {
  color: #aaa9a3;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.detail-exercise-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-top: 8px;
  border-top: 1px solid #eeebe5;
}

.detail-exercise-row:first-child {
  border-top: 0;
}

.tiny-thumb,
.exercise-thumb,
.history-thumb {
  position: relative;
  display: grid;
  overflow: hidden;
  background: linear-gradient(145deg, #f3eee7, #e8e2d9);
  isolation: isolate;
  place-items: center;
}

.tiny-thumb {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.empty-thumb {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 1px solid #e8e3db;
  border-radius: 8px;
  background: #f4f1ec;
}

.tiny-thumb img,
.exercise-thumb img,
.history-thumb img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  color: transparent;
  font-size: 0;
  object-fit: cover;
  opacity: 0;
  transition: opacity 180ms ease;
}

.tiny-thumb img.is-loaded,
.exercise-thumb img.is-loaded,
.history-thumb img.is-loaded {
  opacity: 1;
}

.detail-exercise-row div:nth-child(2) {
  display: grid;
  min-width: 0;
}

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

.detail-exercise-row span {
  color: var(--muted);
  font-size: 9px;
}

.muscle-suggestions {
  margin-top: 17px;
  padding-top: 13px;
  border-top: 1px solid #e9e5de;
}

.muscle-suggestions[hidden] {
  display: none;
}

.muscle-suggestion-list {
  display: grid;
  gap: 5px;
}

.muscle-suggestion-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 25px;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--ink);
  background: #f7f4ef;
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.muscle-suggestion-row:hover {
  border-color: #ecc6bf;
  background: #fff3f0;
  transform: translateY(-1px);
}

.muscle-suggestion-row .tiny-thumb {
  width: 34px;
  height: 34px;
}

.muscle-suggestion-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.muscle-suggestion-copy strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.muscle-suggestion-copy span {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-add {
  display: grid;
  width: 23px;
  height: 23px;
  border-radius: 8px;
  color: #a95246;
  background: #fae4df;
  place-items: center;
  font-size: 15px;
  font-weight: 600;
}

.quick-stat {
  display: grid;
  grid-template-columns: 42px repeat(3, 1fr);
  align-items: center;
  gap: 10px;
}

.quick-stat > div:not(:first-child) {
  display: grid;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

.quick-stat > div:nth-child(2) {
  padding-left: 0;
  border-left: 0;
}

.quick-stat strong {
  font-family: "Manrope", sans-serif;
  font-size: 16px;
}

.quick-stat span {
  color: var(--muted);
  font-size: 8px;
}

.quick-icon {
  display: grid;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  place-items: center;
}

.quick-icon.mint {
  color: #64766a;
  background: var(--mint);
}

.section-heading h2 {
  margin-top: 5px;
  font-size: 19px;
}

.filter-select-wrap {
  position: relative;
}

.filter-select-wrap label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.filter-select-wrap select {
  min-height: 36px;
  padding: 0 30px 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: #626760;
  background: #f9f7f2;
  font-size: 11px;
  font-weight: 600;
}

.attention-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px 26px;
  margin-top: 22px;
}

.attention-item {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid #eeeae3;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.attention-item:nth-last-child(-n+2) {
  border-bottom: 0;
}

.attention-icon {
  display: grid;
  width: 33px;
  height: 33px;
  border-radius: 10px;
  color: #9c938a;
  background: #f1ede6;
  place-items: center;
  font-size: 13px;
}

.attention-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.attention-copy strong {
  font-size: 11px;
}

.attention-copy span,
.attention-status {
  color: var(--muted);
  font-size: 9px;
}

.attention-status {
  padding: 4px 7px;
  border-radius: 7px;
  background: #f1eee8;
  font-weight: 700;
}

.attention-status.light {
  color: #a06d62;
  background: #fae7e3;
}

.focus-card {
  position: relative;
  overflow: hidden;
  color: white;
  background: #7a8d7c;
}

.focus-card .eyebrow {
  color: #dbe3dc;
}

.focus-card h2 {
  position: relative;
  z-index: 2;
  width: 70%;
  margin-top: 105px;
  font-size: 19px;
}

.focus-card > p:not(.eyebrow) {
  position: relative;
  z-index: 2;
  margin: 8px 0 17px;
  color: #e0e6e1;
  font-size: 11px;
  line-height: 1.5;
}

.focus-card .secondary-button {
  position: relative;
  z-index: 2;
  width: 100%;
  border-color: rgba(255, 255, 255, 0.3);
  color: white;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: none;
  font-size: 11px;
}

.focus-illustration {
  position: absolute;
  top: 17px;
  right: 5px;
  width: 160px;
  height: 130px;
}

.focus-orbit {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
}

.focus-orbit.one { inset: 14px 3px 0 17px; transform: rotate(-18deg); }
.focus-orbit.two { inset: 27px 25px 7px 0; transform: rotate(27deg); }

.focus-glyph {
  position: absolute;
  top: 27px;
  right: 44px;
  display: grid;
  width: 55px;
  height: 55px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  place-items: center;
  font-size: 30px;
}

.history-section {
  padding-top: 36px;
}

.history-section .section-heading {
  margin-bottom: 17px;
}

.muted-count {
  color: var(--muted);
  font-size: 11px;
}

.workout-history {
  display: grid;
  gap: 10px;
}

.history-row {
  display: grid;
  grid-template-columns: 82px minmax(180px, 1fr) minmax(220px, 1.4fr) 80px 34px;
  align-items: center;
  gap: 17px;
  padding: 13px 16px;
  border: 1px solid rgba(226, 222, 214, 0.95);
  border-radius: 17px;
  background: rgba(255, 253, 250, 0.74);
}

.history-date {
  display: grid;
}

.history-date strong {
  font-size: 11px;
}

.history-date span,
.history-exercises span,
.history-volume span {
  color: var(--muted);
  font-size: 9px;
}

.history-name {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.history-thumb {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 11px;
}

.history-name div:last-child,
.history-volume {
  display: grid;
  min-width: 0;
}

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

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

.history-exercises {
  display: flex;
  min-width: 0;
  gap: 5px;
  overflow: hidden;
}

.exercise-pill {
  overflow: hidden;
  padding: 5px 8px;
  border-radius: 8px;
  color: #6a6f69;
  background: #efede7;
  font-size: 9px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-volume {
  text-align: right;
}

.history-volume strong {
  font-family: "Manrope", sans-serif;
  font-size: 13px;
}

.row-menu {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.row-menu:hover {
  color: var(--ink);
  background: #efede7;
}

.empty-history {
  display: grid;
  min-height: 130px;
  padding: 24px;
  border: 1px dashed #d7d2c8;
  border-radius: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.35);
  place-items: center;
  text-align: center;
  font-size: 12px;
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 32px 3px 0;
  color: var(--muted);
  font-size: 9px;
}

.app-footer a {
  color: inherit;
  text-underline-offset: 3px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px 16px;
}

.weights-view {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 42px clamp(28px, 4vw, 68px) 80px;
}

.weights-view[hidden] {
  display: none;
}

.weights-heading,
.weights-heading-actions,
.weights-toolbar,
.weights-toolbar-meta,
.weight-card-heading,
.weight-exercise-title,
.weight-card-metrics,
.weight-unit-setting {
  display: flex;
  align-items: center;
}

.weights-heading {
  justify-content: space-between;
  gap: 24px;
}

.weights-heading h1 {
  margin: 3px 0 7px;
  font-family: "Manrope", sans-serif;
  font-size: clamp(30px, 3vw, 44px);
  letter-spacing: -1.7px;
}

.weights-heading > div:first-child > p:last-child {
  max-width: 580px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.weights-heading-actions {
  gap: 10px;
}

.unit-tabs {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.66);
}

.unit-tabs button {
  min-width: 48px;
  min-height: 34px;
  padding: 0 11px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.unit-tabs button.is-active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 2px 9px rgba(55, 51, 44, 0.1);
}

.weights-toolbar {
  justify-content: space-between;
  gap: 18px;
  margin: 28px 0 18px;
  padding: 13px;
  border-radius: 19px;
}

.weight-search-field {
  display: flex;
  width: min(560px, 60%);
  min-height: 46px;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid #dedad2;
  border-radius: 13px;
  background: #fff;
}

.weight-search-field .icon {
  width: 18px;
  color: #9a9e97;
}

.weight-search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
}

.weight-search-field input::placeholder {
  color: #a7aaa3;
}

.weights-toolbar-meta {
  gap: 13px;
}

.weights-toolbar-meta > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.weight-chart-list {
  display: grid;
  gap: 16px;
}

.weight-chart-list[hidden] {
  display: none;
}

.weight-card {
  padding: 22px 24px 18px;
  border-radius: 23px;
}

.weight-card-heading {
  justify-content: space-between;
  gap: 18px;
}

.weight-exercise-title {
  min-width: 0;
  gap: 12px;
}

.weight-exercise-title .exercise-thumb {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 14px;
}

.weight-exercise-title > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.weight-exercise-title h2 {
  overflow: hidden;
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weight-exercise-title span,
.weight-card-metrics span {
  color: var(--muted);
  font-size: 9px;
}

.weight-card-metrics {
  flex: 0 0 auto;
  gap: 8px;
}

.weight-card-metrics > div {
  display: grid;
  min-width: 96px;
  gap: 3px;
  padding: 8px 12px;
  border-left: 1px solid var(--line);
}

.weight-card-metrics strong {
  font-family: "Manrope", sans-serif;
  font-size: 13px;
}

.weight-card-metrics .is-positive strong {
  color: #66826b;
}

.weight-chart-wrap {
  width: 100%;
  aspect-ratio: 900 / 230;
  margin-top: 12px;
}

.weight-chart {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.weight-chart-grid line {
  stroke: #ebe7df;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.weight-chart-grid text {
  fill: #a0a39c;
  font-size: 9px;
}

.weight-chart-x-axis line {
  stroke: #cfcbc3;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.weight-chart-x-axis text {
  fill: #888d85;
  font-size: 9px;
  font-weight: 600;
}

.weight-chart-area {
  fill: rgba(247, 111, 93, 0.08);
  stroke: none;
}

.weight-chart-line {
  fill: none;
  stroke: var(--coral);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.weight-chart-points circle {
  fill: #fffdfa;
  stroke: var(--coral-deep);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.weight-chart-points circle:focus {
  outline: none;
  fill: var(--coral);
}

.weight-empty {
  display: grid;
  min-height: 360px;
  padding: 40px;
  border-radius: 24px;
  place-items: center;
  align-content: center;
  text-align: center;
}

.weight-empty[hidden] {
  display: none;
}

.weight-empty-mark {
  display: grid;
  width: 56px;
  height: 56px;
  margin-bottom: 14px;
  border-radius: 18px;
  color: #fff;
  background: var(--charcoal);
  place-items: center;
  font-size: 24px;
}

.weight-empty h2 {
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-size: 18px;
}

.weight-empty p {
  max-width: 420px;
  margin: 7px 0 18px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.modal-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  padding: 18px;
  background: rgba(31, 34, 31, 0.42);
  backdrop-filter: blur(7px);
  place-items: center;
}

.modal-overlay[hidden] {
  display: none;
}

.log-modal {
  display: flex;
  width: min(720px, 100%);
  max-height: min(850px, calc(100vh - 36px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 28px;
  background: #fcfaf6;
  box-shadow: 0 28px 90px rgba(25, 27, 24, 0.3);
  animation: modal-in 240ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.account-modal {
  width: min(540px, 100%);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 28px;
  background: #fcfaf6;
  box-shadow: 0 28px 90px rgba(25, 27, 24, 0.3);
  animation: modal-in 240ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.account-body {
  display: grid;
  gap: 22px;
  padding: 24px 26px;
}

.account-intro {
  margin: 0 0 17px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f0ede7;
}

.auth-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.auth-tabs button.is-active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 2px 9px rgba(55, 51, 44, 0.1);
}

.auth-form {
  display: grid;
  gap: 13px;
  margin-top: 18px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: #626760;
  font-size: 11px;
  font-weight: 700;
}

.auth-form input {
  width: 100%;
  min-height: 45px;
  padding: 0 13px;
  border: 1px solid #dcd8cf;
  border-radius: 12px;
  color: var(--ink);
  background: white;
  font-size: 14px;
}

.auth-form .primary-button {
  width: 100%;
  margin-top: 2px;
}

.auth-message {
  min-height: 17px;
  margin: -3px 0;
  color: #ba4f45;
  font-size: 11px;
}

.signed-in-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
}

.account-initials {
  display: grid;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  color: white;
  background: #788d7b;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
}

.signed-in-card > div:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.signed-in-card span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.signed-in-card strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
}

.signed-in-card .account-sync-state {
  padding: 5px 8px;
  border-radius: 8px;
  color: #58705d;
  background: #e8f0e8;
  white-space: nowrap;
}

.account-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 13px;
}

.weight-unit-setting {
  justify-content: space-between;
  gap: 16px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #f5f2ec;
}

.weight-unit-setting > div:first-child {
  display: grid;
  gap: 3px;
}

.weight-unit-setting strong {
  font-size: 12px;
}

.weight-unit-setting span {
  color: var(--muted);
  font-size: 9px;
}

.account-footer {
  padding: 14px 26px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(15px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.modal-grabber {
  display: none;
}

.modal-header {
  padding: 24px 26px 19px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin-top: 4px;
  font-size: 23px;
}

.modal-close {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: #757a73;
  background: #efede7;
  font-size: 23px;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 26px;
}

.date-field,
.notes-field,
.exercise-search-wrap > label {
  display: grid;
  gap: 7px;
  color: #626760;
  font-size: 11px;
  font-weight: 700;
}

.date-field {
  grid-template-columns: 40px 1fr;
  align-items: center;
}

.date-field input,
.notes-field textarea {
  border: 1px solid var(--line);
  color: var(--ink);
  background: white;
}

.date-field input {
  width: fit-content;
  min-height: 39px;
  padding: 0 11px;
  border-radius: 11px;
  font-size: 12px;
}

.workout-describer {
  margin-top: 20px;
  padding: 15px;
  border: 1px solid #e5d8d3;
  border-radius: 17px;
  background:
    radial-gradient(circle at 100% 0%, rgba(247, 111, 93, 0.1), transparent 42%),
    #fffaf8;
}

.workout-describer-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.workout-describer-heading > div {
  display: grid;
  gap: 2px;
}

.workout-describer-heading strong {
  font-family: "Manrope", sans-serif;
  font-size: 12px;
}

.workout-describer-heading span:not(.ai-mark) {
  color: var(--muted);
  font-size: 9px;
}

.ai-mark {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  border-radius: 10px;
  color: #a64e43;
  background: #f8dfda;
  place-items: center;
  font-size: 15px;
}

.workout-describer textarea {
  width: 100%;
  min-height: 96px;
  margin-top: 12px;
  resize: vertical;
  padding: 11px 12px;
  border: 1px solid #ddd6ce;
  border-radius: 12px;
  outline: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  line-height: 1.5;
}

.workout-describer textarea:focus {
  border-color: #bb8c83;
  box-shadow: 0 0 0 4px rgba(187, 140, 131, 0.1);
}

.workout-describer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 9px;
}

.workout-describer-actions > span {
  color: #97938d;
  font-size: 8px;
}

.ai-parse-button {
  display: inline-flex;
  min-height: 37px;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 0;
  border-radius: 11px;
  color: white;
  background: var(--charcoal);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.ai-parse-button:hover {
  background: #343a34;
}

.ai-parse-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.ai-parse-button.is-loading > span {
  animation: model-spin 800ms linear infinite;
}

.workout-description-result {
  display: grid;
  gap: 3px;
  margin-top: 11px;
  padding: 10px 11px;
  border-radius: 11px;
  color: #526558;
  background: #e8f0e8;
  font-size: 9px;
  line-height: 1.45;
}

.workout-description-result[hidden] {
  display: none;
}

.workout-description-result strong {
  color: #405448;
  font-size: 10px;
}

.workout-description-result.is-error {
  color: #93483e;
  background: #fae5e1;
}

.workout-description-result.is-error strong {
  color: #843c33;
}

.form-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 19px 0 -2px;
  color: #a4a099;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form-divider::before,
.form-divider::after {
  height: 1px;
  flex: 1;
  background: #e4dfd7;
  content: "";
}

.exercise-search-wrap {
  position: relative;
  margin-top: 20px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  padding: 0 14px;
  border: 1px solid #dcd8cf;
  border-radius: 14px;
  background: white;
  transition: border 150ms ease, box-shadow 150ms ease;
}

.search-field:focus-within {
  border-color: #9f9a91;
  box-shadow: 0 0 0 4px rgba(120, 110, 99, 0.08);
}

.search-field .icon {
  color: var(--muted);
}

.search-field input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
}

.search-field kbd {
  padding: 3px 6px;
  border: 1px solid #dedad2;
  border-radius: 6px;
  color: #999d96;
  background: #f7f5f0;
  font: 9px/1.2 inherit;
}

.search-results {
  position: absolute;
  z-index: 6;
  top: calc(100% + 7px);
  right: 0;
  left: 0;
  max-height: 310px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 45px rgba(44, 40, 35, 0.18);
}

.search-results[hidden] {
  display: none;
}

.search-result {
  display: grid;
  width: 100%;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 8px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.search-result:hover,
.search-result.is-keyboard-active {
  background: #f6f2ec;
}

.exercise-thumb {
  width: 48px;
  height: 48px;
  border-radius: 11px;
}

.exercise-thumb::before,
.history-thumb::before,
.tiny-thumb::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  background: linear-gradient(105deg, transparent 25%, rgba(255, 255, 255, 0.62) 44%, transparent 63%);
  content: "";
  transform: translateX(-110%);
  animation: thumbnail-shimmer 1.65s ease-in-out infinite;
  transition: opacity 150ms ease;
}

.exercise-thumb::after,
.history-thumb::after,
.tiny-thumb::after {
  position: relative;
  z-index: 1;
  width: 23px;
  height: 16px;
  background:
    linear-gradient(#aaa398 0 0) center / 15px 2px no-repeat,
    linear-gradient(#aaa398 0 0) left 2px center / 3px 8px no-repeat,
    linear-gradient(#aaa398 0 0) left 6px center / 3px 13px no-repeat,
    linear-gradient(#aaa398 0 0) right 6px center / 3px 13px no-repeat,
    linear-gradient(#aaa398 0 0) right 2px center / 3px 8px no-repeat;
  content: "";
  opacity: 0.58;
  transition: opacity 150ms ease;
}

.tiny-thumb::after {
  transform: scale(0.72);
}

.exercise-thumb:has(img.is-loaded)::before,
.history-thumb:has(img.is-loaded)::before,
.tiny-thumb:has(img.is-loaded)::before,
.exercise-thumb:has(img.is-loaded)::after,
.history-thumb:has(img.is-loaded)::after,
.tiny-thumb:has(img.is-loaded)::after {
  opacity: 0;
  animation: none;
}

.exercise-thumb:not(:has(img))::before,
.history-thumb:not(:has(img))::before,
.tiny-thumb:not(:has(img))::before {
  display: none;
  animation: none;
}

@keyframes thumbnail-shimmer {
  55%, 100% { transform: translateX(110%); }
}

.search-result-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.search-result-copy strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-copy span {
  color: var(--muted);
  font-size: 9px;
  text-transform: capitalize;
}

.add-result {
  display: grid;
  width: 27px;
  height: 27px;
  border-radius: 8px;
  color: white;
  background: var(--charcoal);
  place-items: center;
  font-size: 17px;
}

.draft-empty {
  display: grid;
  min-height: 210px;
  margin-top: 20px;
  padding: 30px;
  border: 1px dashed #d8d3ca;
  border-radius: 18px;
  background: #f8f5ef;
  place-items: center;
  align-content: center;
  text-align: center;
}

.draft-empty[hidden] {
  display: none;
}

.empty-plus {
  display: grid;
  width: 42px;
  height: 42px;
  margin-bottom: 10px;
  border-radius: 13px;
  color: white;
  background: var(--charcoal);
  place-items: center;
  font-size: 22px;
}

.draft-empty h3 {
  margin: 0 0 5px;
  font-family: "Manrope", sans-serif;
  font-size: 14px;
}

.draft-empty p {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.draft-exercises {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.draft-exercise {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}

.draft-exercise-main {
  display: grid;
  grid-template-columns: 46px minmax(130px, 1fr) repeat(3, 84px) 28px;
  align-items: end;
  gap: 10px;
}

.draft-exercise-name {
  display: grid;
  align-self: center;
  gap: 3px;
}

.draft-name-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.draft-exercise-name strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-exercise-name span {
  color: var(--muted);
  font-size: 9px;
  text-transform: capitalize;
}

.draft-source-badge {
  flex: 0 0 auto;
  padding: 3px 5px;
  border-radius: 6px;
  color: #7c675e;
  background: #eee9e2;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: uppercase;
}

.draft-source-badge.is-custom {
  color: #9a4b40;
  background: #f9e2de;
}

.number-field {
  display: grid;
  gap: 5px;
}

.number-field label {
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.number-field label small {
  color: #adb0aa;
  font-size: 7px;
  font-weight: 600;
  text-transform: lowercase;
}

.number-field input {
  width: 100%;
  min-height: 37px;
  padding: 0 8px;
  border: 1px solid #dedad2;
  border-radius: 9px;
  outline: 0;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
}

.number-field input:focus {
  border-color: #9f9a91;
}

.draft-weight input:placeholder-shown {
  border-style: dashed;
  color: #9fa29c;
  background: #f1efea;
  font-weight: 600;
}

.draft-weight input::placeholder {
  color: #aeb0aa;
  opacity: 1;
}

.remove-exercise {
  width: 28px;
  height: 37px;
  border: 0;
  border-radius: 9px;
  color: #a1a49e;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
}

.remove-exercise:hover {
  color: var(--coral-deep);
  background: #fff0ed;
}

.notes-field {
  margin-top: 20px;
}

.notes-field small {
  color: #aaada7;
  font-weight: 500;
}

.notes-field textarea {
  resize: vertical;
  padding: 11px 12px;
  border-radius: 12px;
  outline: 0;
  font-size: 11px;
}

.modal-footer {
  min-height: 75px;
  padding: 13px 26px;
  border-top: 1px solid var(--line);
  background: rgba(252, 250, 246, 0.95);
}

.workout-form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.danger-button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #e3b9b3;
  border-radius: 13px;
  color: #a63f34;
  background: #fff5f3;
  font-weight: 700;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.danger-button:hover {
  border-color: #cf776b;
  background: #ffebe7;
  transform: translateY(-1px);
}

.danger-button[hidden] {
  display: none;
}

.draft-summary {
  display: grid;
  gap: 1px;
}

.draft-summary strong {
  font-size: 11px;
}

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

.toast {
  position: fixed;
  z-index: 150;
  right: 24px;
  bottom: 24px;
  max-width: 330px;
  padding: 12px 16px;
  border-radius: 13px;
  color: white;
  background: var(--charcoal);
  box-shadow: 0 15px 40px rgba(31, 35, 31, 0.25);
  font-size: 11px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 1120px) {
  .sidebar { width: 184px; padding-inline: 15px; }
  .main-content { margin-left: 184px; }
  .visual-layout { grid-template-columns: minmax(430px, 1.4fr) minmax(270px, 0.8fr); }
  .body-card { height: 660px; }
  .body-stage { width: min(75%, 330px); }
  .quick-stat { grid-template-columns: repeat(3, 1fr); }
  .quick-icon { display: none; }
  .history-row { grid-template-columns: 70px minmax(160px, 1fr) minmax(150px, 1fr) 70px 30px; }
}

@media (max-width: 900px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
  .mobile-header {
    display: flex;
    height: 68px;
    align-items: center;
    justify-content: space-between;
    padding: max(13px, env(safe-area-inset-top)) 20px 10px;
    border-bottom: 1px solid rgba(221, 216, 207, 0.76);
    background: rgba(248, 246, 241, 0.82);
    backdrop-filter: blur(14px);
  }
  .avatar {
    display: grid;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    color: white;
    background: #7c8e7e;
    place-items: center;
    font-size: 9px;
    font-weight: 700;
  }
  .account-chip { display: none; }
  .dashboard, .weights-view { padding: 26px 20px 110px; }
  .dashboard-toolbar { align-items: stretch; }
  .data-mode-control { margin-left: auto; }
  .visual-layout { grid-template-columns: 1fr; }
  .body-card { height: 700px; }
  .body-stage { width: min(57%, 350px); height: 565px; }
  .insights-column { display: grid; grid-template-columns: 1fr 1.4fr; grid-template-rows: auto; }
  .insights-column.has-calendar .muscle-detail { grid-column: 1 / -1; }
  .quick-stat { grid-column: 1 / -1; }
  .focus-card { grid-column: 1 / -1; }
  .history-row { grid-template-columns: 70px minmax(180px, 1fr) minmax(170px, 1fr) 70px 30px; }
  .history-exercises { display: none; }
  .history-row { grid-template-columns: 70px minmax(180px, 1fr) 70px 30px; }
  .mobile-nav {
    position: fixed;
    z-index: 30;
    right: 14px;
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 14px;
    display: grid;
    height: 63px;
    grid-template-columns: 1fr 76px 1fr;
    align-items: center;
    border: 1px solid rgba(222, 217, 208, 0.87);
    border-radius: 21px;
    background: rgba(255, 253, 250, 0.93);
    box-shadow: 0 13px 42px rgba(44, 40, 34, 0.18);
    backdrop-filter: blur(16px);
  }
  .mobile-nav button {
    display: grid;
    gap: 2px;
    border: 0;
    color: var(--muted);
    background: transparent;
    place-items: center;
    font-size: 9px;
    font-weight: 700;
  }
  .mobile-nav button.is-active { color: var(--ink); }
  .mobile-nav .mobile-add {
    width: 58px;
    height: 58px;
    margin: -28px auto 0;
    border: 5px solid var(--canvas);
    border-radius: 19px;
    color: white;
    background: var(--charcoal);
    box-shadow: 0 9px 20px rgba(34, 39, 34, 0.22);
  }
  .mobile-nav .mobile-add .icon { width: 24px; height: 24px; }
}

@media (max-width: 680px) {
  .mobile-header { height: 62px; }
  .brand { font-size: 20px; }
  .brand-mark { width: 27px; height: 27px; }
  .dashboard, .weights-view { padding: 23px 14px 100px; }
  .dashboard-heading { align-items: flex-end; }
  .dashboard-heading h1 { font-size: 27px; }
  .heading-actions { gap: 5px; }
  .date-nav { gap: 0; }
  .desktop-log { display: none; }
  .dashboard-toolbar { display: grid; gap: 10px; margin: 20px 0 14px; }
  .period-tabs { width: 100%; }
  .period-tabs button { min-width: 0; }
  .data-mode-control { width: 100%; justify-content: space-between; margin-left: 0; }
  .data-mode-tabs { flex: 0 0 auto; }
  .body-card { height: 655px; padding: 20px 16px 18px; border-radius: 23px; }
  .panel-heading > div:first-child p { display: none; }
  .body-card .panel-heading { display: grid; gap: 12px; }
  .viewer-heading-controls { width: 100%; justify-content: space-between; }
  .body-view-tabs button, .anatomy-mode-tabs button { padding: 6px 10px; font-size: 10px; }
  .body-visual-wrap { min-height: 540px; }
  .body-stage { width: 100%; height: 520px; }
  .heat-legend { bottom: 13px; left: 0; right: 0; justify-content: center; }
  .body-tools { bottom: 36px; }
  .muscle-popover { left: 56%; min-width: 145px; }
  .insights-column { grid-template-columns: 1fr; }
  .insights-column.has-calendar .muscle-detail { grid-column: auto; }
  .readiness-card, .activity-calendar, .muscle-detail, .quick-stat, .attention-card, .focus-card { padding: 20px; }
  .quick-stat { grid-column: auto; }
  .quick-stat { grid-template-columns: repeat(3, 1fr); }
  .attention-list { grid-template-columns: 1fr; }
  .attention-item:nth-last-child(2) { border-bottom: 1px solid #eeeae3; }
  .focus-card h2 { margin-top: 92px; }
  .history-section { padding-top: 30px; }
  .history-row { grid-template-columns: 56px minmax(0, 1fr) 58px 26px; gap: 8px; padding: 10px; }
  .history-name { gap: 8px; }
  .history-thumb { display: block; width: 36px; height: 36px; border-radius: 10px; }
  .history-date span { display: none; }
  .history-volume strong { font-size: 11px; }
  .app-footer { flex-direction: column; gap: 8px; padding-top: 26px; text-align: center; }
  .footer-links { justify-content: center; }
  .modal-overlay { align-items: end; padding: 0; }
  .log-modal {
    width: 100%;
    max-height: calc(100dvh - max(8px, env(safe-area-inset-top)));
    border-radius: 25px 25px 0 0;
  }
  .account-modal {
    width: 100%;
    max-height: calc(100dvh - max(8px, env(safe-area-inset-top)));
    overflow-y: auto;
    border-radius: 25px 25px 0 0;
  }
  .account-body { padding: 20px 18px; }
  .account-footer { padding: 13px 18px max(16px, env(safe-area-inset-bottom)); }
  .modal-grabber {
    display: block;
    width: 42px;
    height: 4px;
    margin: 8px auto -6px;
    border-radius: 5px;
    background: #d4d0c8;
  }
  .modal-header { padding: 20px 18px 15px; }
  .modal-body { padding: 17px 18px; }
  .modal-footer { padding: 12px 18px max(12px, env(safe-area-inset-bottom)); }
  .search-field kbd { display: none; }
  .draft-exercise-main {
    grid-template-columns: 42px minmax(100px, 1fr) 58px 58px 58px 24px;
    gap: 6px;
  }
  .draft-exercise .exercise-thumb { width: 42px; height: 42px; }
  .number-field input { padding-inline: 3px; }
  .toast { right: 14px; bottom: 91px; left: 14px; text-align: center; }
  .weights-heading { align-items: flex-start; flex-direction: column; }
  .weights-heading-actions { width: 100%; justify-content: space-between; }
  .weights-toolbar { align-items: stretch; flex-direction: column; }
  .weight-search-field { width: 100%; }
  .weights-toolbar-meta { justify-content: space-between; }
  .weight-card { padding: 17px 14px 14px; }
  .weight-card-heading { align-items: stretch; flex-direction: column; }
  .weight-card-metrics { display: grid; grid-template-columns: repeat(3, 1fr); }
  .weight-card-metrics > div { min-width: 0; padding: 7px 8px; }
  .weight-card-metrics > div:first-child { border-left: 0; }
  .weight-chart-wrap { aspect-ratio: 360 / 190; }
}

@media (max-width: 420px) {
  .today-button { display: none; }
  .data-mode-note { max-width: 145px; white-space: normal; line-height: 1.25; }
  .data-mode-tabs button { min-width: 62px; padding-inline: 9px; }
  .body-card { height: 630px; }
  .body-stage { width: 100%; height: 500px; }
  .body-visual-wrap { min-height: 520px; }
  .muscle-popover { top: 24%; left: 48%; }
  .detail-numbers { gap: 7px; }
  .section-heading { align-items: flex-end; }
  .history-thumb { width: 34px; height: 34px; }
  .draft-exercise { padding: 10px; }
  .draft-exercise-main {
    grid-template-columns: 38px 1fr 1fr 1fr 22px;
    align-items: end;
  }
  .draft-exercise .exercise-thumb { width: 38px; height: 38px; }
  .draft-exercise-name { grid-column: 2 / -1; grid-row: 1; }
  .draft-exercise .exercise-thumb { grid-column: 1; grid-row: 1; }
  .draft-exercise .draft-sets { grid-column: 1 / span 2; }
  .draft-exercise .draft-reps { grid-column: 3; }
  .draft-exercise .draft-weight { grid-column: 4; }
  .remove-exercise { grid-column: 5; }
  .workout-describer-actions { align-items: stretch; flex-direction: column; }
  .ai-parse-button { justify-content: center; width: 100%; }
  .weights-heading-actions .primary-button { padding-inline: 12px; }
  .weight-exercise-title .exercise-thumb { width: 42px; height: 42px; }
  .weight-card-metrics strong { font-size: 11px; }
  .weight-card-metrics span { font-size: 8px; }
}

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