/* InBody Tool — Editorial × Arkitektonisk hybrid
   Single source of truth for tokens. Tenants and dark mode flip via
   [data-tenant] and [data-theme] attributes on the app root. */

/* ─── Fonts ──────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --serif: "Geist", -apple-system, BlinkMacSystemFont, "Helvetica Neue", system-ui, sans-serif;
  --sans:  "Geist", -apple-system, BlinkMacSystemFont, "Helvetica Neue", system-ui, sans-serif;
  --mono:  "JetBrains Mono", "SF Mono", ui-monospace, Menlo, monospace;

  /* Light mode — warm paper */
  --paper:      #f4f0e8;
  --paper-2:    #ece6d6;
  --paper-deep: #e0d8c1;
  --ink:        #1a1714;
  --ink-2:      #3d3833;
  --ink-soft:   #5b554a;
  --ink-mute:   #8b8273;
  --ink-faint:  #b8af9d;
  --rule:       #1a1714;
  --rule-soft:  rgba(26,23,20,0.18);
  --rule-hair:  rgba(26,23,20,0.10);
  --surface:    #ffffff;          /* card surfaces only — used sparingly */
  --surface-2:  #ece6d6;          /* subtle inset blocks */

  /* Tenant accent — Core Gym = oxblood */
  --accent:     #7a2e1f;
  --accent-2:   #a85a48;
  --accent-bg:  #f0e0db;

  --good:       #3d5e3d;
  --good-bg:    #dde4d6;
  --warn:       #8a6a1f;
  --warn-bg:    #f0e7c8;
  --bad:        #7a2e1f;
  --bad-bg:     #f0e0db;

  --tenant-name: "Core Gym Club";
    --accent-fg: #fff;
--tenant-mark: "CGC";
}

/* ─── SHIFT tenant — forest green, more clinical ──────────────────── */
[data-tenant="shift"] {
  --accent:     #2f5240;
  --accent-2:   #5a8470;
  --accent-bg:  #dee6df;
  --tenant-name: "SHIFT — 12 veckor";
  --tenant-mark: "SHIFT";
}

/* ─── Neutral tenant — pure graphite, no wordmark ─────────────────── */
[data-tenant="neutral"] {
  --accent:     #2a2620;
  --accent-2:   #5b554a;
  --accent-bg:  #e0d8c1;
  --tenant-name: "InBody-arkiv";
  --tenant-mark: "IB";
}

/* ─── Dark mode — inverted, same warmth ───────────────────────────── */
[data-theme="dark"] {
  --paper:      #0a0d12;
  --paper-2:    #161a23;
  --paper-deep: #1f2533;
  --ink:        #eef1f7;
  --ink-2:      #c5cdd8;
  --ink-soft:   #8a94a3;
  --ink-mute:   #5d6573;
  --ink-faint:  #3a4150;
  --rule:       #eef1f7;
  --rule-soft:  rgba(232,238,245,0.16);
  --rule-hair:  rgba(232,238,245,0.07);
  --surface:    #161a23;
  --surface-2:  #1f2533;
  --accent:     #ff6b3d;
  --accent-2:   #ff9176;
  --accent-bg:  #2d1410;
  --accent-fg:  #ffd9cb;
  --accent2:    #b9ff3d;
  --accent2-bg: #1f2a0e;
  --accent3:    #6ea8ff;
  --accent3-bg: #0f1828;
  --warn:       #ffc83d;
  --warn-bg:    #2a2010;
  --good:       #6eea9a;
  --good-bg:    #0f2418;
  --bad:        #ff6b3d;
  --bad-bg:     #2d1410;
}
[data-theme="dark"][data-tenant="shift"] { --accent: #6eea9a; --accent-2: #a8f3c0; --accent-bg: #0f2418; --accent-fg: #cff2dd; }
[data-theme="dark"][data-tenant="neutral"] { --accent: #6ea8ff; --accent-2: #a8c5ff; --accent-bg: #0f1828; --accent-fg: #cfddf6; }

/* ─── Base ────────────────────────────────────────────────────────── */
html, body { margin: 0; padding: 0; height: 100%; background: var(--paper); }
body {
  font-family: var(--sans);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "tnum";
  overscroll-behavior: none;
}
* { box-sizing: border-box; }
a { color: inherit; }

/* ─── Type primitives ────────────────────────────────────────────── */
.ib-serif { font-family: var(--serif); font-feature-settings: "lnum","tnum"; }
.ib-mono  { font-family: var(--mono); font-feature-settings: "tnum"; }
.ib-num   { font-variant-numeric: lining-nums tabular-nums; }
.ib-tnum  { font-variant-numeric: tabular-nums; }
.ib-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.ib-eyebrow-num {
  color: var(--accent);
  font-weight: 700;
  margin-right: 6px;
}

/* Rules */
.ib-rule       { border-top: 1px solid var(--rule); }
.ib-rule-soft  { border-top: 1px solid var(--rule-soft); }
.ib-rule-hair  { border-top: 1px solid var(--rule-hair); }

/* Buttons — M3 Expressive: pill, springy, color-forward */
.ib-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--sans); font-weight: 600; font-size: 15px;
  padding: 18px 28px; background: var(--accent); color: var(--accent-fg, #fff);
  border: none; border-radius: 999px; cursor: pointer;
  letter-spacing: -0.005em;
  transition: transform .18s cubic-bezier(.2,.9,.3,1.4), background .15s ease, box-shadow .2s ease, border-radius .25s cubic-bezier(.2,.9,.3,1.4);
  text-decoration: none; box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.ib-btn:hover  { transform: translateY(-2px) scale(1.015); border-radius: 18px; box-shadow: 0 10px 28px rgba(0,0,0,0.18); }
.ib-btn:active { transform: translateY(0) scale(0.97); border-radius: 999px; transition-duration: .08s; }
.ib-btn-ghost  { background: var(--surface-2); color: var(--ink); border: none; box-shadow: none; }
.ib-btn-ghost:hover { background: var(--paper-deep); }
.ib-btn-accent { background: var(--accent); color: var(--accent-fg, #fff); }
.ib-btn-warn   { background: var(--warn-bg); color: var(--warn); border: none; }
.ib-btn-danger { background: var(--bad-bg); color: var(--bad); border: none; }
.ib-btn-text   { background: transparent; color: var(--ink-mute); border: none; padding: 14px 20px; font-size: 13px; border-radius: 999px; box-shadow: none; }
.ib-btn-text:hover { background: var(--surface-2); transform: none; border-radius: 999px; }
.ib-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Tag/badge — filled chip, M3 expressive */
.ib-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--mono); font-size: 9px; font-weight: 600;
  padding: 4px 9px; letter-spacing: 0.06em; text-transform: uppercase;
  border: none; line-height: 1; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-soft);
}
.ib-tag-warn { background: var(--warn-bg); color: var(--warn); }
.ib-tag-good { background: var(--good-bg); color: var(--good); }
.ib-tag-bad  { background: var(--bad-bg); color: var(--bad); }
.ib-tag-mute { background: var(--surface-2); color: var(--ink-mute); }
.ib-tag-fill { background: var(--ink); color: var(--paper); }
.ib-tag-accent { background: var(--accent-bg); color: var(--accent); }

/* Hairlines — visible 8px grid (B's spine) */
.ib-grid8 {
  background-image: linear-gradient(var(--rule-hair) 1px, transparent 1px);
  background-size: 100% 8px;
}

/* Number sizes */
.ib-display { font-family: var(--sans); font-weight: 300; line-height: 0.92; letter-spacing: -0.035em; }
.ib-h1      { font-family: var(--sans); font-weight: 500; line-height: 1.05; letter-spacing: -0.025em; }
.ib-h2      { font-family: var(--sans); font-weight: 500; line-height: 1.1;  letter-spacing: -0.02em; }
.ib-body    { font-family: var(--sans); font-size: 14px; line-height: 1.5; color: var(--ink-2); font-weight: 400; }

/* Hide scrollbars inside cards but keep scroll */
.ib-noscroll::-webkit-scrollbar { display: none; }
.ib-noscroll { scrollbar-width: none; }

/* Utility */
.ib-flex { display: flex; }
.ib-row  { display: flex; align-items: center; }
.ib-col  { display: flex; flex-direction: column; }
.ib-gap-s { gap: 6px; } .ib-gap-m { gap: 12px; } .ib-gap-l { gap: 20px; }
.ib-grow { flex: 1; }
