/*! RepMax Calculators 0.1.0 */
.rml { color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.6; }
.rml-content table { margin: 0 0 1.2em; }
.rml-content .faq h2 { margin-top: 1.6em; }
.rml .example h3 { margin-top: 0; }
.rml .calc { container: rml / inline-size; }
.rml:has(> .site-header) { container: rmlh / inline-size; }
.rml:has(> .site-footer) { container: rmlf / inline-size; }
.rml .site-header h2, .rml .site-footer h2 { font-family: var(--font); }
.rml, .toast {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #efede8;
  --text: #16161a;
  --muted: #55555e;
  --border: #d9d6cf;
  --accent: #c2410c;
  --accent-ink: #ffffff;
  --accent-soft: #fde8dc;
  --good: #166534;
  --warn-bg: #fff6db;
  --warn-ink: #6b4b00;
  --error: #b42318;
  --focus: #1d4ed8;
  --foot-bg: #16161a;
  --foot-text: #b9b9c2;
  --foot-strong: #ffffff;
  --foot-line: #33333b;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 4px 16px rgb(0 0 0 / 0.05);
  --font: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.rml *, .rml *::before, .rml *::after { box-sizing: border-box; }
.rml img, .rml svg { max-width: 100%; height: auto; }
.rml a { color: var(--accent); text-underline-offset: 3px; }
.rml a:hover { text-decoration-thickness: 2px; }
.rml :focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.rml code { font-family: var(--mono); font-size: 0.92em; background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 4px; }

.rml .wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.rml .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Breadcrumbs */

/* Cards and grid */
.rml .card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.rml .grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.rml .tool-card { display: block; text-decoration: none; color: var(--text); }
.rml .tool-card strong { display: block; color: var(--accent); margin-bottom: 4px; }
.rml .tool-card span { color: var(--muted); font-size: 0.95rem; }
.rml .tool-card:hover { border-color: var(--accent); }

/* Calculator */
.rml .calc { margin: 16px 0 8px; }
.rml .calc-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@container rml (min-width: 720px) { .rml .calc-grid { grid-template-columns: minmax(320px, 400px) 1fr; align-items: start; } }
.rml .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.rml .field label, .rml .field .label { font-weight: 650; font-size: 0.95rem; }
.rml .hint { font-size: 0.85rem; color: var(--muted); }
.rml .row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rml input[type='number'], .rml input[type='text'], .rml input[type='date'], .rml select {
  font: inherit;
  font-size: 1.15rem;
  min-height: 52px;
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}
.rml input.big { font-size: 1.6rem; font-weight: 700; min-height: 60px; }
.rml input[aria-invalid='true'] { border-color: var(--error); }
.rml .error { color: var(--error); font-size: 0.9rem; font-weight: 600; min-height: 0; }
.rml .error:empty { display: none; }

.rml .seg { display: inline-flex; border: 2px solid var(--border); border-radius: 10px; overflow: hidden; }
.rml .seg button { font: inherit; font-weight: 700; border: 0; background: transparent; color: var(--text); padding: 10px 18px; min-height: 48px; cursor: pointer; }
.rml .seg button[aria-pressed='true'] { background: var(--text); color: var(--bg); }

.rml .btn { font: inherit; font-weight: 700; border: 2px solid transparent; border-radius: 10px; padding: 12px 18px; min-height: 52px; cursor: pointer; }
.rml .btn-primary { background: var(--accent); color: var(--accent-ink); }
.rml .btn-primary:hover { filter: brightness(1.06); }
.rml .btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.rml .btn-ghost:hover { border-color: var(--text); }
.rml .btn-sm { min-height: 40px; padding: 6px 12px; font-size: 0.92rem; }
.rml .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.rml .actions .btn-primary { flex: 1 1 160px; }

.rml details.adv { border-top: 1px dashed var(--border); margin-top: 6px; padding-top: 10px; }
.rml details.adv summary { cursor: pointer; font-weight: 700; padding: 6px 0; }

.rml .result-hero { text-align: left; }
.rml .result-hero .kicker { color: var(--muted); font-size: 0.9rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; }
.rml .result-hero .big-number { font-size: clamp(2.6rem, 9vw, 4rem); font-weight: 850; line-height: 1; margin: 6px 0; font-variant-numeric: tabular-nums; }
.rml .result-hero .sub { color: var(--muted); }
.rml .range-bar { position: relative; height: 10px; background: var(--surface-2); border-radius: 99px; margin: 14px 0 6px; }
.rml .range-bar span { position: absolute; top: -3px; width: 4px; height: 16px; background: var(--text); border-radius: 2px; transform: translateX(-2px); }
.rml .range-bar .fill { position: absolute; top: 0; height: 10px; background: var(--accent-soft); border: 2px solid var(--accent); border-radius: 99px; }
.rml .empty-state { color: var(--muted); padding: 28px 8px; text-align: center; }
.rml .warn { background: var(--warn-bg); color: var(--warn-ink); border-radius: 10px; padding: 10px 12px; font-size: 0.93rem; margin: 10px 0; }
.rml .warn ul { margin: 0; padding-left: 18px; }

.rml .tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 18px 0 10px; }
.rml .tabs button { font: inherit; font-weight: 650; padding: 8px 14px; border-radius: 99px; border: 2px solid var(--border); background: transparent; color: var(--text); cursor: pointer; min-height: 42px; }
.rml .tabs button[aria-selected='true'] { border-color: var(--text); background: var(--text); color: var(--bg); }

.rml table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.rml th, .rml td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); }
.rml th { font-size: 0.85rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.rml td.num, .rml th.num { text-align: right; white-space: nowrap; }
.rml tr.hl td { background: var(--accent-soft); font-weight: 700; }
.rml .table-scroll { overflow-x: auto; }

.rml .formula-bar { display: inline-block; height: 8px; background: var(--accent); border-radius: 4px; vertical-align: middle; }

/* Plates visual */
.rml .barbell { display: flex; align-items: center; justify-content: center; gap: 2px; min-height: 120px; padding: 10px 0; overflow-x: auto; }
.rml .barbell .shaft { height: 10px; width: 60px; background: #8a8a93; border-radius: 2px; flex: 0 0 auto; }
.rml .barbell .sleeve { height: 16px; width: 18px; background: #6b6b74; flex: 0 0 auto; }
.rml .plate { flex: 0 0 auto; width: 16px; border-radius: 3px; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; color: #fff; writing-mode: vertical-rl; transform: rotate(180deg); border: 1px solid rgb(0 0 0 / 0.25); }
.rml .plate-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; }
.rml .plate-list li { background: var(--surface-2); border-radius: 8px; padding: 6px 10px; font-weight: 700; }
.rml .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.rml .chip { display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--border); border-radius: 99px; padding: 6px 12px; cursor: pointer; font-weight: 650; min-height: 42px; }
.rml .chip input { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); }

/* Content blocks */
.rml .example { background: var(--surface); border-left: 4px solid var(--accent); padding: 14px 18px; border-radius: 8px; }
.rml .disclaimer { font-size: 0.9rem; color: var(--muted); border-top: 1px solid var(--border); margin-top: 32px; padding-top: 14px; }
.rml .faq details { border-bottom: 1px solid var(--border); padding: 12px 0; }
.rml .faq summary { font-weight: 700; cursor: pointer; }
.rml .faq details p { margin: 10px 0 0; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 650; z-index: 20; }
.rml [hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) { .rml * { transition: none !important; animation: none !important; } }

@media print {
  .rml .site-header, .rml .site-footer, .rml .no-print, .rml .faq, .rml .crumbs, .rml form .actions, .rml details.adv summary { display: none !important; }
  .rml .card { box-shadow: none; border: 1px solid #999; }
  .rml .print-only { display: block !important; }
  .rml details.adv[open] > *:not(summary) { display: block; }
  .rml a { color: #000; text-decoration: none; }
}
.rml .print-only { display: none; }

/* Layout refinements */
.rml .field .seg { align-self: flex-start; }


/* ================= Site header ================= */
.rml .site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.rml .hdr { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.rml .logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.15rem; white-space: nowrap; letter-spacing: -0.01em; }
.rml .logo svg { width: 30px; height: 30px; flex: 0 0 auto; }
.rml .logo small { display: block; font-size: 0.68rem; font-weight: 600; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; line-height: 1; margin-top: 2px; }
.rml .logo .logo-text { display: flex; flex-direction: column; line-height: 1.1; }

.rml .mainnav { display: none; margin-left: auto; }
.rml .mainnav > ul { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.rml .mainnav a, .rml .mainnav .dd-btn {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 0.95rem; font-weight: 600;
  color: var(--text); text-decoration: none; background: transparent; border: 0; cursor: pointer;
  padding: 10px 12px; border-radius: 10px; min-height: 44px;
}
.rml .mainnav a:hover, .rml .mainnav .dd-btn:hover, .rml .mainnav .dd-btn[aria-expanded='true'] { background: var(--surface-2); }
.rml .mainnav a[aria-current='page'] { color: var(--accent); }
.rml .dd { position: relative; }
.rml .dd-btn svg { width: 14px; height: 14px; transition: transform .15s; }
.rml .dd-btn[aria-expanded='true'] svg { transform: rotate(180deg); }
.rml .dd-menu {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 260px; list-style: none; margin: 0; padding: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.14);
}
.rml .dd-menu a { display: flex; flex-direction: column; align-items: flex-start; gap: 0; width: 100%; padding: 10px 12px; }
.rml .dd-menu a span { font-size: 0.82rem; font-weight: 500; color: var(--muted); }

.rml .hdr-cta {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; font-size: 0.95rem;
  color: var(--accent-ink); background: var(--accent); padding: 10px 16px; border-radius: 10px; min-height: 44px; white-space: nowrap;
}
.rml .hdr-cta:hover { filter: brightness(1.06); }
.rml .hdr-cta svg { width: 18px; height: 18px; }

.rml .menu-btn {
  margin-left: auto; display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px;
  border: 2px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); cursor: pointer;
}
.rml .menu-btn svg { width: 24px; height: 24px; }
.rml .menu-btn .i-close { display: none; }
.rml .menu-btn[aria-expanded='true'] .i-open { display: none; }
.rml .menu-btn[aria-expanded='true'] .i-close { display: block; }
.rml .hdr .hdr-cta { display: none; }

/* Mobile drawer */
.rml .drawer { border-top: 1px solid var(--border); background: var(--surface); max-height: calc(100dvh - 64px); overflow-y: auto; }
.rml .drawer .wrap { padding-block: 12px 20px; display: grid; gap: 18px; }
.rml .drawer h2 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 6px; }
.rml .drawer ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.rml .drawer a { display: flex; align-items: center; min-height: 48px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); color: var(--text); text-decoration: none; font-weight: 650; font-size: 0.95rem; }
.rml .drawer a[aria-current='page'] { outline: 2px solid var(--accent); outline-offset: -2px; color: var(--accent); }
.rml .drawer a.hdr-cta { display: flex; justify-content: center; min-height: 52px; background: var(--accent); color: var(--accent-ink); }

@container rmlh (min-width: 960px) {
  .rml .mainnav { display: block; }
  .rml .menu-btn, .rml .drawer { display: none !important; }
  .rml .hdr .hdr-cta { display: inline-flex; margin-left: 8px; }
}

/* ================= Site footer ================= */
.rml .site-footer { margin-top: 64px; background: var(--foot-bg); color: var(--foot-text); font-size: 0.93rem; }
.rml .site-footer a { color: var(--foot-text); text-decoration: none; }
.rml .site-footer a:hover { color: var(--foot-strong); text-decoration: underline; }
.rml .ft-top { display: grid; gap: 32px; padding-block: 44px 28px; grid-template-columns: 1fr; }
.rml .ft-brand .logo { color: var(--foot-strong); }
.rml .ft-brand .logo small { color: var(--foot-text); }
.rml .ft-brand p { margin: 12px 0 0; max-width: 34ch; line-height: 1.55; }
.rml .ft-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; list-style: none; padding: 0; }
.rml .ft-badges li { border: 1px solid var(--foot-line); border-radius: 99px; padding: 4px 10px; font-size: 0.8rem; color: var(--foot-strong); }
.rml .ft-cols { display: grid; gap: 28px 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rml .ft-cols h2 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--foot-strong); margin: 0 0 12px; }
.rml .ft-cols ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.rml .ft-cols li a { display: inline-block; padding: 6px 0; }
.rml .ft-bottom { border-top: 1px solid var(--foot-line); padding-block: 18px 28px; display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; align-items: center; font-size: 0.85rem; }
.rml .ft-bottom p { margin: 0; }
.rml .ft-top-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; }
@container rmlf (min-width: 700px) {
  .rml .ft-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@container rmlf (min-width: 1000px) {
  .rml .ft-top { grid-template-columns: 300px 1fr; gap: 48px; }
}

@media print { .rml .site-header, .rml .site-footer, .rml .drawer { display: none !important; } }
