/* Meso — AI strength-training program designer.
   Ported from the Meso.dc.html Claude Design prototype. The root container in
   the template carries the design tokens as CSS custom properties (--bg, --ink,
   --accent, ...); this file holds the global resets, fonts, scrollbar styling,
   and keyframes that the prototype declared in its <helmet>. */

* {
  box-sizing: border-box;
}

html,
body.meso {
  margin: 0;
  padding: 0;
  height: 100%;
}

body.meso {
  background: #f5f6f7;
  font-family: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
}

/* Default design tokens. The designer also sets these inline on its root (so it
   stays self-contained); here they live on .meso so the standard pages inherit
   them without repeating the block. */
.meso {
  --bg: #f5f6f7;
  --surface: #ffffff;
  --rail: #fbfbfc;
  --ink: #16181c;
  --dim: #71777e;
  --line: #e7e9ec;
  --line-2: #f1f3f5;
  --radius: 8px;
  --pad: 14px;
  --accent: oklch(0.56 0.14 258);
  --accent-ink: #ffffff;
  --soft: color-mix(in srgb, var(--accent) 9%, #fff);
  --soft-line: color-mix(in srgb, var(--accent) 26%, #fff);
  --accent-deep: color-mix(in srgb, var(--accent) 82%, #1a1a1a);
  --warn: #b4541f;
  --warn-soft: #fbefe8;
  --ok: #2f8f56;
}

/* Hide Alpine-managed elements until Alpine initializes (avoids a flash). */
[x-cloak] {
  display: none !important;
}

.meso input,
.meso textarea {
  font-family: inherit;
}

.meso ::placeholder {
  color: #abb0b6;
}

.meso *::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

.meso *::-webkit-scrollbar-thumb {
  background: rgba(20, 24, 30, 0.16);
  border-radius: 7px;
  border: 3px solid transparent;
  background-clip: content-box;
}

.meso *::-webkit-scrollbar-thumb:hover {
  background: rgba(20, 24, 30, 0.28);
  border: 3px solid transparent;
  background-clip: content-box;
}

.meso *::-webkit-scrollbar-track {
  background: transparent;
}

@keyframes msgIn {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes blink {
  0%,
  80%,
  100% {
    opacity: 0.2;
  }
  40% {
    opacity: 1;
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translate(-50%, -10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Hover/focus affordances that the prototype expressed as inline style-hover /
   style-focus attributes (not real CSS). Re-expressed here as real rules. */
.meso [data-hover="rail"]:hover {
  background: var(--rail);
}
.meso [data-hover="brighten"]:hover {
  filter: brightness(1.06);
}
.meso [data-hover="chip"]:hover {
  background: var(--soft);
  border-color: var(--soft-line);
}
.meso [data-hover="add"]:hover {
  background: var(--rail);
  color: var(--accent);
}
.meso .meso-cell:focus {
  background: var(--soft);
  box-shadow: inset 0 0 0 1px var(--soft-line);
}
.meso .meso-note:focus {
  background: var(--soft);
  box-shadow: inset 0 0 0 1px var(--soft-line);
  color: var(--ink);
}
.meso .meso-phone-input:focus {
  border-color: var(--soft-line);
  background: var(--surface);
}
.meso .meso-composer:focus-within {
  border-color: var(--soft-line);
  box-shadow: 0 0 0 3px var(--soft);
}

/* Display helper for elements toggled by x-show. Alpine resets style.display to
   "" when revealing, which would drop an inline `display:flex`; sourcing the
   flex from a class makes that reset fall back to flex instead of block. */
.meso .meso-flex {
  display: flex;
}

/* Segmented controls (mode / view / period toggles). The prototype rendered an
   on + off variant per button; here one button styles itself via .is-on. */
.meso .meso-seg {
  display: inline-flex;
  background: var(--rail);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.meso .meso-seg-btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 550;
  letter-spacing: -0.01em;
  padding: 5px 12px;
  border-radius: 6px;
  background: transparent;
  color: var(--dim);
}
.meso .meso-seg-btn.is-on {
  background: var(--surface);
  color: var(--ink);
  font-weight: 650;
  box-shadow: 0 1px 2px rgba(16, 18, 22, 0.09);
}
.meso .meso-seg-btn--v {
  font-size: 12.5px;
  padding: 5px 13px;
}
.meso .meso-seg-btn--p {
  font-size: 12px;
  padding: 4px 11px;
}

/* ==========================================================================
   Shared component layer for the spine screens (roster, profile, review,
   deliver, results). The designer is a full-viewport tool with its own chrome;
   these classes give the surrounding pages a consistent look built from the
   same tokens. Standard pages set --bg/--ink/etc. on body.meso and scroll
   normally (the designer locks the viewport instead).
   ========================================================================== */

.meso-app {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* --- top nav --- */
.meso-topnav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 55px;
  padding: 0 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.meso-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
}
.meso-brand-mark {
  width: 23px;
  height: 23px;
  border-radius: 6px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.meso-brand-mark i {
  width: 8px;
  height: 8px;
  background: var(--accent-ink);
  border-radius: 2px;
  transform: rotate(45deg);
}
.meso-brand b {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.025em;
}
.meso-navlinks {
  display: flex;
  align-items: center;
  gap: 2px;
}
.meso-navlink {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--dim);
  text-decoration: none;
  padding: 6px 11px;
  border-radius: 7px;
}
.meso-navlink:hover {
  background: var(--rail);
  color: var(--ink);
}
.meso-navlink.is-active {
  color: var(--ink);
  background: var(--soft);
}
.meso-spacer {
  flex: 1;
}

/* --- page scaffold --- */
.meso-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 26px 24px 64px;
}
.meso-page--narrow {
  max-width: 860px;
}
.meso-eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 0 0 8px;
}
.meso-h1 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.025em;
}
.meso-sub {
  margin: 0;
  font-size: 13px;
  color: var(--dim);
}
.meso-pagehead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.meso-crumbs {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--dim);
  margin-bottom: 14px;
}
.meso-crumbs a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

/* --- cards --- */
.meso-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(16, 18, 22, 0.03);
}
.meso-card--pad {
  padding: 18px 20px;
}
.meso-grid {
  display: grid;
  gap: 14px;
}
.meso-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.meso-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.meso-grid--profile {
  grid-template-columns: 320px minmax(0, 1fr);
  align-items: start;
}

/* --- buttons --- */
.meso-btn {
  appearance: none;
  cursor: pointer;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.meso-btn:hover {
  background: var(--rail);
}
.meso-btn--primary {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: transparent;
  font-weight: 650;
  box-shadow: 0 1px 2px rgba(16, 18, 22, 0.12);
}
.meso-btn--primary:hover {
  filter: brightness(1.06);
  background: var(--accent);
}
.meso-btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--accent);
  padding-left: 0;
  padding-right: 0;
}
.meso-btn--ghost:hover {
  background: transparent;
  text-decoration: underline;
}

/* --- badges / status pills --- */
.meso-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.meso-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.meso-badge--accent {
  color: var(--accent-deep);
  background: var(--soft);
  border: 1px solid var(--soft-line);
}
.meso-badge--warn {
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid color-mix(in srgb, var(--warn) 22%, #fff);
}
.meso-badge--ok {
  color: var(--ok);
  background: color-mix(in srgb, var(--ok) 12%, #fff);
  border: 1px solid color-mix(in srgb, var(--ok) 26%, #fff);
}
.meso-badge--muted {
  color: var(--dim);
  background: var(--rail);
  border: 1px solid var(--line);
}
.meso-tag {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}
.meso-tag--accent {
  background: var(--soft);
  border-color: var(--soft-line);
  color: var(--accent-deep);
  font-weight: 600;
}

/* --- avatars --- */
.meso-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
  flex: 0 0 auto;
  background: #eef0f2;
  color: var(--dim);
  width: 38px;
  height: 38px;
  font-size: 13px;
}
.meso-avatar--accent {
  background: var(--soft);
  border: 1px solid var(--soft-line);
  color: var(--accent-deep);
}
.meso-avatar--sm {
  width: 28px;
  height: 28px;
  font-size: 11px;
}
.meso-avatar--lg {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  font-size: 16px;
}

/* --- athlete rows / list --- */
.meso-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-2);
  text-decoration: none;
  color: var(--ink);
}
.meso-row:last-child {
  border-bottom: 0;
}
.meso-row:hover {
  background: var(--rail);
}
.meso-row-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.meso-row-meta {
  font-size: 11.5px;
  color: var(--dim);
}

/* --- progress bar --- */
.meso-meter {
  height: 6px;
  border-radius: 4px;
  background: var(--line);
  overflow: hidden;
  flex: 1;
}
.meso-meter > span {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
}

/* --- divider + misc --- */
.meso-hr {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 16px 0;
}
.meso-muted {
  color: var(--dim);
}
.meso-mono {
  font-family: "IBM Plex Mono", monospace;
}
