/* Whole Well styles: tokens, layout, components.
   Light/dark is chosen by data-scheme on <html> (set by js/theme-boot.js from the user's choice or the system
   setting). Colour themes in themes.css override these tokens via data-theme. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/inter-latin-wght-normal.woff2) format("woff2-variations"), url(/fonts/inter-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/inter-latin-ext-wght-normal.woff2) format("woff2-variations"), url(/fonts/inter-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url(/fonts/nunito/nunito-latin-wght-normal.woff2) format("woff2-variations"), url(/fonts/nunito/nunito-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url(/fonts/nunito/nunito-latin-ext-wght-normal.woff2) format("woff2-variations"), url(/fonts/nunito/nunito-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Whole Well brand colours (logo and wordmark). They stay the same in every colour theme. */
  --brand-ring: #2f6b4f;
  --brand-leaf: #8db580;
  --brand-font: "Nunito", "Inter", ui-sans-serif, system-ui, sans-serif;
  --bg: #f4f6f6;
  --surface: #ffffff;
  --surface-2: #f1f4f4;
  --border: #e3e8e8;
  --border-strong: #cdd5d5;
  --text: #0e1a18;
  --muted: #5a6866;
  --primary: #0f766e;
  --primary-hover: #0b5f58;
  --primary-soft: #e2f3f0;
  --on-primary: #ffffff;
  --accent: #0e7490;
  --hero-a: #0f766e;
  --hero-b: #0c4a6e;
  --ok: #157a3c; --ok-soft: #e3f5e9;
  --warn: #8a5a00; --warn-soft: #fdf1d6;
  --bad: #b42318; --bad-soft: #fde8e6;
  --info: #1d5fa8; --info-soft: #e5eefa;
  --focus: #2563eb;
  --ring: color-mix(in srgb, var(--primary) 28%, transparent);
  --chart: #0f766e;
  --chart-2: #94a3a0;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 26, 24, .05);
  --shadow: 0 1px 2px rgba(15, 26, 24, .04), 0 2px 6px -1px rgba(15, 26, 24, .06);
  --shadow-lg: 0 12px 32px -12px rgba(15, 26, 24, .22), 0 4px 10px -6px rgba(15, 26, 24, .08);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --heading-font: var(--font);
  --heading-weight: 700;
  --heading-transform: none;
  --heading-spacing: -.022em;
  --base-size: 15px;
  --control-h: 40px;
  --btn-radius: 10px;
  --input-radius: 10px;
  --sidebar-w: 252px;
  color-scheme: light;
}
:root[data-scheme="dark"] {
  --brand-ring: #8db580; --brand-leaf: #cfe3c3;
  --bg: #0a100f; --surface: #111917; --surface-2: #17211f; --border: #22302d; --border-strong: #31423e;
  --text: #e9f0ee; --muted: #9aaba7;
  --primary: #2dd4bf; --primary-hover: #5eead4; --primary-soft: #11342f; --on-primary: #04201c;
  --accent: #38bdf8;
  --ok: #4ade80; --ok-soft: #12301e; --warn: #fbbf24; --warn-soft: #3a2c0a; --bad: #f87171; --bad-soft: #3b1614;
  --info: #7cb3f5; --info-soft: #14263d; --focus: #93c5fd; --chart: #2dd4bf; --chart-2: #3b4d49;
  --shadow-sm: none;
  --shadow: 0 1px 0 rgba(255, 255, 255, .02) inset;
  --shadow-lg: 0 16px 40px -16px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--text); font: var(--base-size)/1.55 var(--font);
  background:
    radial-gradient(900px 480px at 100% -8%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 65%),
    radial-gradient(800px 420px at -5% 0%, color-mix(in srgb, var(--primary) 8%, transparent), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01", "cv02";
  text-rendering: optimizeLegibility;
}
a { color: var(--primary); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--primary-hover); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5rem; font-family: var(--heading-font); font-weight: var(--heading-weight); color: var(--text); }
h1, h2 { text-transform: var(--heading-transform); letter-spacing: var(--heading-spacing); }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.05rem; }
.h3 { font-size: 1rem; }
.h4 { font-size: .74rem; margin: 1.25rem 0 .6rem; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 700; }
p { margin: 0 0 .75rem; }
code { background: var(--surface-2); padding: .12em .4em; border-radius: 6px; font-size: .88em; border: 1px solid var(--border); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
main:focus { outline: none; }
.ic { flex: none; display: block; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: .5rem 1rem; border-radius: 8px; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.block { display: block; }
.text-bad { color: var(--bad); font-weight: 600; }
.loading { padding: 4rem 1rem; text-align: center; color: var(--muted); }
.loading::before { content: ""; display: block; width: 28px; height: 28px; margin: 0 auto .75rem; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: var(--control-h);
  padding: .5rem 1rem; border-radius: var(--btn-radius); border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); font: inherit; font-size: .92rem; font-weight: 600; letter-spacing: -.005em; text-decoration: none; cursor: pointer;
  white-space: nowrap; box-shadow: var(--shadow-sm); transition: background .15s, border-color .15s, box-shadow .15s, transform .15s, color .15s;
}
.btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn .ic { width: 18px; height: 18px; }
.btn-primary {
  background: var(--primary); border-color: transparent; color: var(--on-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .1), inset 0 1px 0 rgba(255, 255, 255, .14), 0 6px 14px -8px var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); border-color: transparent; color: var(--on-primary); box-shadow: 0 1px 2px rgba(0, 0, 0, .1), 0 10px 20px -10px var(--primary); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn-danger { background: var(--bad); border-color: transparent; color: #fff; }
.btn-danger:hover { background: var(--bad); color: #fff; filter: brightness(.92); }
.btn-danger-outline { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: transparent; }
.btn-danger-outline:hover { background: var(--bad-soft); color: var(--bad); }
.btn-sm { min-height: 32px; padding: .25rem .7rem; font-size: .83rem; border-radius: calc(var(--btn-radius) - 2px); }
.btn-lg { min-height: 50px; padding: .75rem 1.5rem; font-size: 1rem; border-radius: calc(var(--btn-radius) + 2px); }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.icon-btn { display: inline-grid; place-items: center; background: none; border: 0; color: var(--muted); cursor: pointer; padding: .4rem; border-radius: 10px; min-width: 36px; min-height: 36px; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; min-width: 0; }
.field label, .label-like { font-weight: 600; font-size: .86rem; color: var(--text); }
.req { color: var(--bad); }
.hint { font-size: .79rem; color: var(--muted); margin: 0; line-height: 1.45; }
input, select, textarea {
  font: inherit; font-size: .94rem; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--input-radius); padding: .55rem .75rem; min-height: calc(var(--control-h) + 2px); width: 100%;
  box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--primary) 35%, var(--border-strong)); }
textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring); }
input[readonly] { background: var(--surface-2); }
select { appearance: none; padding-right: 2.25rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%237b8a87' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .7rem center; }
[aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 18%, transparent); }
.field-error { color: var(--bad); font-size: .82rem; margin: 0; font-weight: 600; }
.form-error { color: var(--bad); background: var(--bad-soft); padding: .65rem .85rem; border-radius: 10px; font-weight: 600; font-size: .9rem; }
.row-2, .row-3 { display: grid; gap: 0 1rem; grid-template-columns: 1fr 1fr; }
.row-3 { grid-template-columns: 1fr 1fr 1fr; }
.bp { display: flex; align-items: center; gap: .4rem; }
.bp span { color: var(--muted); }
.check { display: flex; align-items: center; gap: .55rem; margin: 0 0 1rem; font-weight: 500; }
.check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--primary); box-shadow: none; }
.copy-row { display: flex; gap: .5rem; }
.copy-row input { flex: 1; font-size: .84rem; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.search-field input { padding-left: 2.4rem; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%237b8a87' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='5.5'/%3E%3Cpath d='m15.5 15.5-3.6-3.6'/%3E%3C/svg%3E") no-repeat .8rem center; }
.switch { display: inline-flex; align-items: center; gap: .75rem; cursor: pointer; font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { width: 46px; height: 26px; background: var(--border-strong); border-radius: 99px; position: relative; transition: background .2s; flex: none; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch input:checked + .switch-ui { background: var(--primary); }
.switch input:checked + .switch-ui::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-ui { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- App layout ---------- */
.layout { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: .25rem;
  padding: 1.15rem .85rem 1rem; background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-right: 1px solid var(--border); backdrop-filter: saturate(1.4) blur(10px);
}
.brand { display: inline-flex; align-items: center; gap: .45rem; font-weight: 800; font-size: 1.3rem; color: var(--text); text-decoration: none; letter-spacing: -.03em; padding: 0 .35rem; }
.brand:hover { color: var(--text); }
.logo { flex: none; }
.logo-ring, .logo-stem { stroke: var(--brand-ring); }
.logo-leaf { fill: var(--brand-leaf); }
.wm { font-family: var(--brand-font); font-weight: 800; letter-spacing: -.01em; }
.wm b { font-weight: inherit; color: var(--brand-ring); }
.brand-lg { font-size: 1.5rem; }
.studio-pill { display: flex; align-items: center; gap: .6rem; margin: 1rem 0 .75rem; padding: .55rem .65rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); min-width: 0; }
.studio-pill .studio-badge { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: .78rem; color: #fff; background: linear-gradient(135deg, var(--hero-a), var(--hero-b)); }
.studio-pill .studio-meta { min-width: 0; line-height: 1.25; }
.studio-name { display: block; font-weight: 650; font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-role { display: block; font-size: .74rem; color: var(--muted); }
.nav-label { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: .6rem .7rem .35rem; }
.sidenav { display: flex; flex-direction: column; gap: .15rem; }
.sidenav a { position: relative; display: flex; align-items: center; gap: .7rem; padding: .58rem .7rem; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .92rem; transition: background .15s, color .15s; }
.sidenav a .ic { width: 20px; height: 20px; }
.sidenav a:hover { background: var(--surface-2); color: var(--text); }
.sidenav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary); }
.sidenav a[aria-current="page"]::before { content: ""; position: absolute; left: -.85rem; top: 22%; bottom: 22%; width: 3px; border-radius: 0 3px 3px 0; background: var(--primary); }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: .65rem; padding: .7rem .55rem .2rem; border-top: 1px solid var(--border); }
.side-foot .who-text { min-width: 0; flex: 1; line-height: 1.25; }
.user-name { display: block; font-weight: 650; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { display: block; font-size: .74rem; color: var(--muted); text-transform: capitalize; }
.topbar { display: none; }
main#view { min-width: 0; }
.page { padding: 2rem clamp(1rem, 3.2vw, 2.75rem) 3.5rem; max-width: 1240px; }
.page.narrow { max-width: 800px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head h1 { margin-bottom: .2rem; }
.page-head p { margin: 0; }
.eyebrow { display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); margin-bottom: .35rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: .3rem; margin-bottom: 1rem; font-weight: 600; font-size: .88rem; text-decoration: none; color: var(--muted); }
.back:hover { color: var(--text); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 1.1rem; margin-bottom: 1.1rem; }
.grid-2 > .card { margin-bottom: 0; }

/* ---------- Cards, KPIs, stats ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.35rem 1.5rem; margin-bottom: 1.1rem; box-shadow: var(--shadow); min-width: 0; }
.card > h2, .card-head h2 { display: flex; align-items: center; gap: .5rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .85rem; }
.card-head h2 { margin: 0; }
.card-head a.small { font-weight: 600; text-decoration: none; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; margin-bottom: 1.1rem; }
.kpis-3 { grid-template-columns: repeat(3, 1fr); }
.kpi {
  position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.2rem 1.15rem; display: flex; flex-direction: column; gap: .2rem; text-decoration: none; color: var(--text);
  box-shadow: var(--shadow); transition: border-color .15s, box-shadow .2s, transform .2s;
}
a.kpi:hover { color: var(--text); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.kpi-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .35rem; }
.kpi strong { font-size: 1.85rem; font-weight: 750; letter-spacing: -.035em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi-label, .stat-label { font-size: .8rem; font-weight: 600; color: var(--muted); }
.kpi-sub { font-size: .8rem; color: var(--muted); }
.kpi-bad strong { color: var(--bad); }
.kpi-warn strong { color: var(--warn); }
.tone { --tone: var(--primary); --tone-soft: var(--primary-soft); width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--tone); background: var(--tone-soft); flex: none; }
.tone .ic { width: 20px; height: 20px; }
.tone-ok { --tone: var(--ok); --tone-soft: var(--ok-soft); }
.tone-bad { --tone: var(--bad); --tone-soft: var(--bad-soft); }
.tone-warn { --tone: var(--warn); --tone-soft: var(--warn-soft); }
.tone-info { --tone: var(--info); --tone-soft: var(--info-soft); }
.tone-sm { width: 30px; height: 30px; border-radius: 9px; }
.tone-sm .ic { width: 17px; height: 17px; }
.delta { display: inline-flex; align-items: center; gap: .2rem; font-weight: 700; font-size: .76rem; padding: .08rem .45rem; border-radius: 99px; }
.delta-up { color: var(--ok); background: var(--ok-soft); }
.delta-down { color: var(--bad); background: var(--bad-soft); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .85rem; margin-bottom: 1.1rem; }
.stat { position: relative; background: var(--surface-2); border: 1px solid transparent; border-radius: 12px; padding: .9rem 1rem; display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.page > .stat-row .stat { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow); }
.stat .tone { position: absolute; top: .8rem; right: .8rem; }
.stat strong { font-size: 1.45rem; font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat .stat-text { font-size: 1.05rem; letter-spacing: -.015em; }
.stat .unit { font-size: .82rem; font-weight: 600; color: var(--muted); margin-left: .15rem; letter-spacing: 0; }
.stat-bad { border-color: color-mix(in srgb, var(--bad) 35%, transparent) !important; }
.stat-bad strong { color: var(--bad); }
.trend-good { color: var(--ok); font-weight: 600; }
.trend-bad { color: var(--bad); font-weight: 600; }

/* ---------- Lists, tables, badges ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .75rem 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.list > li:first-child { border-top: 0; padding-top: .2rem; }
.list.compact > li { padding: .5rem 0; font-size: .92rem; }
.list > li.is-archived { opacity: .55; }
.row-link { display: inline-flex; align-items: center; gap: .7rem; color: var(--text); text-decoration: none; min-width: 0; }
a.row-link:hover strong { color: var(--primary); }
.avatar {
  --h: 172; width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: hsl(var(--h) 62% 92%); color: hsl(var(--h) 55% 28%); font-weight: 750; font-size: .78rem; letter-spacing: .01em;
  box-shadow: inset 0 0 0 1px hsl(var(--h) 40% 50% / .12);
}
:root[data-scheme="dark"] .avatar { background: hsl(var(--h) 32% 22%); color: hsl(var(--h) 70% 80%); }
.avatar.sm { width: 32px; height: 32px; font-size: .72rem; }
.avatar.lg { width: 60px; height: 60px; font-size: 1.15rem; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; }
.table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; padding: .55rem .75rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: .75rem .75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.table tr:last-child td { border-bottom: 0; }
.table-tight td { padding: .55rem .75rem; }
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .16rem .55rem; border-radius: 99px; font-size: .74rem; font-weight: 650; text-transform: capitalize; white-space: nowrap; line-height: 1.4; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-muted { background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--border); }
.code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 1.05rem; letter-spacing: .18em; background: var(--primary-soft); color: var(--primary); padding: .15rem .55rem; border-radius: 8px; }

/* ---------- Tabs (segmented control) ---------- */
.tabs { display: inline-flex; gap: 2px; flex-wrap: wrap; margin-bottom: 1.1rem; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.tabs button { font: inherit; font-weight: 600; font-size: .86rem; border: 0; background: transparent; color: var(--muted); border-radius: 9px; padding: .38rem .85rem; cursor: pointer; min-height: 34px; display: inline-flex; align-items: center; gap: .4rem; transition: background .15s, color .15s; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tabs .count { font-size: .72rem; font-weight: 700; padding: 0 .4rem; border-radius: 99px; background: var(--border); color: var(--muted); min-width: 1.4rem; text-align: center; }
.tabs button[aria-selected="true"] .count { background: var(--primary-soft); color: var(--primary); }
.toolbar { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: .35rem; }
.toolbar .search-field { flex: 1; min-width: 220px; }

/* ---------- At-risk ---------- */
.risk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.risk { display: flex; justify-content: space-between; align-items: center; gap: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.15rem; flex-wrap: wrap; box-shadow: var(--shadow); transition: box-shadow .2s, border-color .2s; }
.risk:hover { box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.risk-done { opacity: .62; }
.risk-who { display: flex; gap: .85rem; align-items: flex-start; min-width: 0; }
.risk-who a { text-decoration: none; color: var(--text); }
.risk-who a:hover { color: var(--primary); }
.risk-who p { margin: .35rem 0 0; }
.chips { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .35rem; }
.chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .76rem; font-weight: 650; padding: .16rem .6rem; border-radius: 99px; background: var(--surface-2); }
.chip-inactive { background: var(--warn-soft); color: var(--warn); }
.chip-new { background: var(--info-soft); color: var(--info); }
.chip-overdue { background: var(--bad-soft); color: var(--bad); }

/* ---------- Notices, alerts, empty states ---------- */
.notice { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: .8rem 1rem; font-size: .9rem; }
.notice p:last-child, .notice .field { margin-bottom: 0; }
.notice-ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.invite-notice { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 25%, transparent); }
.invite-notice p { margin: 0; }
.alert { border-radius: 12px; padding: .8rem 1rem; margin-bottom: 1.1rem; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; font-size: .92rem; border: 1px solid transparent; }
.alert-error { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 22%, transparent); }
.alert-warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 22%, transparent); }
.alert-ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 22%, transparent); }
.alert a { color: inherit; font-weight: 700; }
.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.empty h3 { color: var(--text); font-size: 1rem; margin-bottom: .3rem; }
.empty p { max-width: 42ch; margin-left: auto; margin-right: auto; font-size: .92rem; }
.empty-mark { width: 52px; height: 52px; margin: 0 auto .85rem; border-radius: 16px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); }
.empty-mark .ic { width: 24px; height: 24px; }
.empty .btn { margin-top: .35rem; }
.setup { border-color: color-mix(in srgb, var(--primary) 30%, transparent); background: linear-gradient(135deg, var(--primary-soft), var(--surface)); }
.checklist { list-style: none; padding: 0; margin: .25rem 0 0; display: grid; gap: .55rem; }
.checklist li { display: flex; align-items: flex-start; gap: .65rem; font-weight: 600; }
.checklist li > span:first-child { flex: none; width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--surface); border: 2px solid var(--primary); color: var(--primary); font-size: .78rem; font-weight: 800; }
.checklist li.done > span:first-child { background: var(--primary); color: var(--on-primary); }
.checklist li.done a { color: var(--muted); text-decoration: line-through; }
details { margin: .5rem 0; }
summary { cursor: pointer; font-weight: 600; padding: .3rem 0; }

/* ---------- Charts ---------- */
.chart { margin: .25rem 0 .5rem; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .line { fill: none; stroke: var(--chart); stroke-width: 2.75; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart .dot { fill: var(--surface); stroke: var(--chart); stroke-width: 2.25; vector-effect: non-scaling-stroke; }
.chart .dot-studio { fill: var(--chart); }
.chart .bar { opacity: .42; transition: opacity .15s; }
.chart .bar-hi { opacity: 1; }
.chart .bar:hover { opacity: .85; }
.chart .goal { stroke: var(--warn); stroke-dasharray: 5 5; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.chart .g-start { stop-color: var(--chart); }
.chart .g-end { stop-color: var(--accent); }
.chart .a-start { stop-color: var(--chart); stop-opacity: .22; }
.chart .a-end { stop-color: var(--chart); stop-opacity: 0; }
.chart-legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .78rem; color: var(--muted); }
.ring { position: relative; width: 120px; height: 120px; flex: none; }
.ring svg { width: 100%; height: 100%; }
.ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 10; }
.ring-fg { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dasharray .6s ease; }
.ring .r-start { stop-color: var(--hero-a); }
.ring .r-end { stop-color: var(--accent); }
.ring-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.ring-text strong { font-size: 1.9rem; font-weight: 800; letter-spacing: -.04em; }
.ring-text span { font-size: .76rem; color: var(--muted); }
.goal-row { display: flex; gap: 1.4rem; align-items: center; }
.goal-msg { font-weight: 700; font-size: 1.12rem; letter-spacing: -.015em; margin-bottom: .3rem; }

/* Gradient hero card (member home, setup) */
.hero-card {
  position: relative; overflow: hidden; color: #fff; border: 0; border-radius: calc(var(--radius) + 4px);
  background:
    radial-gradient(420px 220px at 100% 0%, rgba(255, 255, 255, .2), transparent 70%),
    linear-gradient(135deg, var(--hero-a), var(--hero-b));
  box-shadow: 0 18px 40px -22px var(--hero-a);
}
.hero-card::after {
  content: ""; position: absolute; right: -10px; bottom: -6px; width: 260px; height: 90px; opacity: .14; pointer-events: none;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 260 90' fill='none' stroke='white' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M0 55h60l14-32 22 58 18-40 12 14h134'/%3E%3C/svg%3E");
}
.hero-card h2, .hero-card a, .hero-card .goal-msg { color: #fff; }
.hero-card .muted, .hero-card .ring-text span { color: rgba(255, 255, 255, .8); }
.hero-card .ring-bg { stroke: rgba(255, 255, 255, .22); }
.hero-card .ring-fg { stroke: #fff !important; }
.hero-card .pill-light { display: inline-flex; align-items: center; gap: .35rem; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .22); padding: .2rem .6rem; border-radius: 99px; font-size: .8rem; font-weight: 600; }

/* ---------- Profile ---------- */
.profile-head .who { display: flex; gap: 1rem; align-items: center; min-width: 0; }
.profile-head h1 { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .2rem; }
.profile-head .badge { font-size: .74rem; letter-spacing: 0; }
.inline-form .btn-row { margin-top: .25rem; }
.profile-line { margin: 0 0 .15rem; font-weight: 600; font-size: .92rem; }

/* ---------- Import ---------- */
.drop { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 2.25rem 1rem; text-align: center; margin-bottom: 1rem; background: color-mix(in srgb, var(--surface-2) 60%, transparent); transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--primary); background: var(--primary-soft); }
.drop label.btn { cursor: pointer; }
.drop:focus-within label.btn { outline: 3px solid var(--focus); outline-offset: 2px; }
.import-summary { margin-bottom: .75rem; }

/* ---------- Dialog & toasts ---------- */
.dialog { border: 1px solid var(--border); border-radius: 20px; padding: 0; width: min(540px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); background: var(--surface); color: var(--text); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45); }
.dialog[open] { animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.dialog-wide { width: min(740px, calc(100vw - 2rem)); }
.dialog::backdrop { background: rgba(8, 14, 13, .45); backdrop-filter: blur(3px); }
.dialog form { display: flex; flex-direction: column; max-height: calc(100vh - 2rem); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.2rem 1.5rem .6rem; }
.dialog-head h2 { margin: 0; font-size: 1.12rem; }
.dialog-body { padding: .5rem 1.5rem 1rem; overflow-y: auto; }
.dialog-foot { display: flex; justify-content: flex-end; gap: .5rem; padding: .9rem 1.5rem 1.1rem; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); border-radius: 0 0 20px 20px; }
.toasts { position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%); display: grid; gap: .5rem; z-index: 1000; width: min(420px, calc(100vw - 2rem)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: .6rem; background: #111a18; color: #f2f6f5; padding: .75rem 1rem; border-radius: 12px; font-weight: 600; font-size: .9rem; box-shadow: 0 12px 32px -10px rgba(0, 0, 0, .45); transition: opacity .4s, transform .4s; animation: pop .2s ease-out; }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #34d399; flex: none; }
.toast-error::before { background: #f87171; }
.toast-warn::before { background: #fbbf24; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- Public pages ---------- */
.public-main { min-height: 100vh; }

/* Auth: brand panel + form */
.auth-split { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-panel {
  position: relative; overflow: hidden; color: #fff; padding: 2.5rem clamp(2rem, 5vw, 4rem); display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(600px 300px at 90% 10%, rgba(255, 255, 255, .16), transparent 70%),
    radial-gradient(500px 400px at 0% 100%, rgba(0, 0, 0, .25), transparent 70%),
    linear-gradient(150deg, var(--hero-a), var(--hero-b));
}
.auth-panel .brand { color: #fff; padding: 0; }
.auth-panel .brand { --brand-ring: #ffffff; --brand-leaf: #cfe3c3; }
.auth-panel .wm b { color: #cfe3c3; }
.auth-panel h2 { color: #fff; font-size: clamp(1.8rem, 3vw, 2.5rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.1; max-width: 16ch; margin-bottom: 1rem; }
.auth-panel p { color: rgba(255, 255, 255, .82); max-width: 42ch; font-size: 1.02rem; }
.auth-points { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .8rem; }
.auth-points li { display: flex; gap: .7rem; align-items: center; font-weight: 600; }
.auth-points .tone { --tone: #fff; --tone-soft: rgba(255, 255, 255, .16); }
.auth-panel .pulse-art { position: absolute; right: -40px; bottom: 90px; width: 520px; opacity: .14; pointer-events: none; }
.auth-panel small { color: rgba(255, 255, 255, .7); }
.auth { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 1.25rem; padding: 2.5rem 1.25rem; }
.auth .brand-mobile { display: none; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 1.65rem; letter-spacing: -.03em; margin-bottom: .35rem; }
.auth-card > p { margin-bottom: 1.5rem; }
.auth-card .btn-block { margin-top: .35rem; min-height: 46px; }
.auth-foot { color: var(--muted); font-size: .9rem; text-align: center; max-width: 420px; }

/* Landing */
.landing { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem 4rem; }
.landing-head { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; padding: 1rem 0; background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(12px); }
.landing-head nav { display: flex; gap: .5rem; align-items: center; }
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(2.5rem, 6vw, 4.5rem); }
.hero h1 { font-size: clamp(2.4rem, 5.6vw, 4rem); font-weight: 800; letter-spacing: -.045em; line-height: 1.02; margin-bottom: 1.25rem; }
.grad-text { background: linear-gradient(110deg, var(--hero-a), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 1.15rem; color: var(--muted); line-height: 1.6; max-width: 52ch; }
.hero-cta { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.75rem; }
.hero-trust { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-top: 1.5rem; color: var(--muted); font-size: .88rem; font-weight: 500; }
.hero-trust span { display: inline-flex; align-items: center; gap: .4rem; }
.hero-trust .ic { color: var(--primary); width: 18px; height: 18px; }
.pill { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .75rem .3rem .35rem; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: .84rem; font-weight: 600; color: var(--text); margin-bottom: 1.25rem; }
.pill .tone { width: 24px; height: 24px; border-radius: 99px; }
.pill .tone .ic { width: 14px; height: 14px; }
.mock { position: relative; }
.mock-window { position: relative; z-index: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-lg), 0 40px 80px -40px color-mix(in srgb, var(--hero-a) 45%, transparent); padding: 1.1rem; }
.mock-bar { display: flex; gap: 6px; margin-bottom: .9rem; }
.mock-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.mock-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: .8rem; }
.mock .hero-card { padding: 1.1rem; display: flex; gap: 1rem; align-items: center; grid-column: 1 / -1; }
.mock .hero-card .ring { width: 92px; height: 92px; }
.mock .hero-card .ring-text strong { font-size: 1.5rem; }
.mock .mini { background: var(--surface-2); border-radius: 14px; padding: .8rem .9rem; }
.mock .mini strong { display: block; font-size: 1.35rem; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.mock .mini .chart { margin: .4rem 0 0; }
.mock-float {
  position: absolute; z-index: 2; left: -1.5rem; bottom: -2.6rem; display: flex; gap: .7rem; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: .75rem .9rem; box-shadow: var(--shadow-lg); max-width: 300px;
}
.mock-float strong { display: block; font-size: .88rem; }
.mock-float span.small { color: var(--muted); }
.mock-glow { position: absolute; inset: 10% -6% -8% 8%; z-index: 0; border-radius: 40px; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 30%, transparent), transparent); filter: blur(30px); }
.section-head { text-align: center; max-width: 640px; margin: 1rem auto 2.25rem; }
.section-head h2 { font-size: clamp(1.6rem, 3.2vw, 2.25rem); font-weight: 800; letter-spacing: -.035em; margin-bottom: .6rem; }
.section-head p { color: var(--muted); font-size: 1.05rem; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; margin-bottom: 4rem; }
@media (max-width: 1000px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .features { grid-template-columns: 1fr; } }
.features article { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.features article:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.features .tone { margin-bottom: 1rem; width: 44px; height: 44px; border-radius: 13px; }
.features h3 { font-size: 1.08rem; letter-spacing: -.02em; margin-bottom: .45rem; }
.features p { color: var(--muted); margin: 0; font-size: .95rem; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; counter-reset: step; margin-bottom: 4rem; }
.steps li { list-style: none; position: relative; padding: 1.4rem 1.4rem 1.4rem 4.2rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.steps li::before { counter-increment: step; content: counter(step); position: absolute; left: 1.35rem; top: 1.35rem; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--hero-a), var(--hero-b)); }
.steps strong { display: block; margin-bottom: .2rem; }
.steps span { color: var(--muted); font-size: .92rem; }
.cta-band { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap; padding: 2rem 2.25rem; }
.cta-band h2 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.03em; margin: 0 0 .35rem; }
.cta-band p { margin: 0; color: rgba(255, 255, 255, .85); }
.cta-band .btn { background: #fff; color: var(--hero-a); border: 0; }
.cta-band .btn:hover { background: #f1f5f4; color: var(--hero-a); }
.landing-foot { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; color: var(--muted); font-size: .86rem; padding-top: 2.5rem; margin-top: 2.5rem; border-top: 1px solid var(--border); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .topbar {
    display: flex; align-items: center; gap: .75rem; padding: .65rem 1rem; position: sticky; top: 0; z-index: 15;
    background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--border);
  }
  .topbar .studio-name { color: var(--muted); font-size: .8rem; font-weight: 600; flex: 1; text-align: right; }
  .sidebar {
    position: fixed; z-index: 20; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; padding: .35rem .35rem calc(.35rem + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 92%, transparent);
  }
  .sidebar > .brand, .studio-pill, .side-foot, .nav-label { display: none; }
  .sidenav { flex-direction: row; justify-content: space-around; width: 100%; gap: 0; }
  .sidenav a { flex: 1 1 0; flex-direction: column; gap: .2rem; padding: .4rem .2rem; font-size: .68rem; text-align: center; min-width: 0; border-radius: 12px; }
  .sidenav a span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .sidenav a[aria-current="page"]::before { display: none; }
  main#view { padding-bottom: 84px; }
  .page { padding: 1.25rem 1rem 2rem; }
  .hero { grid-template-columns: 1fr; }
  .mock { max-width: 520px; margin: 0 auto 1.5rem; width: 100%; }
  .mock-float { left: .5rem; bottom: -1.75rem; }
  .steps { grid-template-columns: 1fr; }
  .auth-split { grid-template-columns: 1fr; }
  .auth-panel { display: none; }
  .auth .brand-mobile { display: inline-flex; }
}
@media (max-width: 640px) {
  h1 { font-size: 1.45rem; }
  .row-2, .row-3 { grid-template-columns: 1fr; }
  .kpis, .kpis-3 { grid-template-columns: 1fr 1fr; gap: .65rem; }
  .stat-row { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .stat { padding: .8rem .85rem; }
  .stat strong { font-size: 1.25rem; }
  .stat .tone { top: .65rem; right: .65rem; }
  .kpi { padding: .9rem .95rem; }
  .kpi strong { font-size: 1.4rem; }
  .kpi .tone { width: 32px; height: 32px; border-radius: 9px; }
  .card { padding: 1.1rem 1.05rem; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
  .tabs { display: flex; }
  /* Tables become stacked cards */
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border: 1px solid var(--border); border-radius: 12px; padding: .45rem .8rem; margin-bottom: .6rem; background: var(--surface); }
  .table tbody tr:hover td { background: transparent; }
  .table td { border: 0; padding: .32rem 0; display: flex; justify-content: space-between; gap: 1rem; text-align: right; }
  .table td[data-label]::before { content: attr(data-label); font-weight: 650; color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; text-align: left; }
  .table td:first-child { text-align: left; }
  .table td:first-child[data-label="Name"]::before, .table td:first-child[data-label="Member"]::before { content: none; }
  .goal-row { gap: 1rem; }
  .dialog-foot .btn { flex: 1; }
  .mock-grid { grid-template-columns: 1fr 1fr; }
  .mock-float { position: relative; left: 0; bottom: 0; margin-top: -.5rem; max-width: none; }
  .cta-band { padding: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Quick-entry measurement form (assess.js) ----------
   Readings sit two per row when the form itself is wide enough (container query), so the same component works in
   the wide assessment dialog, the narrower member Log card and on phones. */
.mform { display: grid; gap: .75rem; container-type: inline-size; }
.mmeta { display: grid; gap: .1rem .9rem; }
.mmeta .field { margin-bottom: .35rem; gap: .3rem; min-width: 0; }
.choice-row { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.choice {
  font: inherit; font-size: .82rem; font-weight: 600; padding: .34rem .75rem; min-height: 34px; border-radius: 99px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); transition: background .15s, border-color .15s, color .15s;
}
.choice:hover { border-color: var(--primary); }
.choice[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.choice-row input[type="date"] { width: auto; min-height: 34px; padding: .25rem .6rem; font-size: .84rem; border-radius: 99px; }
.device-pick { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.device-select { width: auto; min-width: 12rem; max-width: 100%; min-height: 34px; padding: .25rem 2.1rem .25rem .75rem; font-size: .86rem; font-weight: 600; border-radius: 99px; }
.device-input { flex: 1 1 10rem; width: auto; min-height: 34px; padding: .25rem .75rem; font-size: .86rem; border-radius: 99px; }
.mhint { margin: -.35rem 0 0; }
.mrows { display: grid; gap: .5rem; }
.mrow { border: 1px solid var(--border); border-radius: 12px; padding: .55rem .65rem .6rem; background: var(--surface); min-width: 0; transition: background .15s; }
.mrow.off { background: var(--surface-2); }
.mrow.off .mctrl, .mrow.off .mbp, .mrow.off .mdelta { opacity: .4; }
.mhead { display: flex; align-items: center; gap: .5rem; cursor: pointer; margin-bottom: .4rem; min-width: 0; }
.mhead .m-on { width: 17px; height: 17px; min-height: 0; accent-color: var(--primary); box-shadow: none; flex: none; margin: 0; }
.mhead .tone { width: 26px; height: 26px; border-radius: 8px; }
.mhead .tone .ic { width: 15px; height: 15px; }
.mlabel { font-weight: 650; font-size: .88rem; white-space: nowrap; }
.munit-inline { color: var(--muted); font-weight: 500; font-size: .78rem; }
.mdelta { margin-left: auto; font-size: .72rem; color: var(--muted); font-weight: 600; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mctrl { display: grid; grid-template-columns: 34px minmax(40px, 1fr) 34px auto; gap: .4rem; align-items: center; }
.mbp { display: grid; gap: .45rem; }
.mbp-part { display: grid; gap: .2rem; min-width: 0; }
.msub { font-size: .74rem; color: var(--muted); font-weight: 600; }
.step {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  display: grid; place-items: center; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none;
  transition: background .12s, border-color .12s, transform .08s;
}
.step .ic { width: 16px; height: 16px; }
.step:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.step:active:not(:disabled) { transform: scale(.94); background: var(--primary-soft); }
.step:disabled { cursor: not-allowed; }
.m-range { -webkit-appearance: none; appearance: none; width: 100%; height: 26px; min-height: 0; padding: 0; border: 0; background: transparent; box-shadow: none; cursor: pointer; }
.m-range:focus-visible { box-shadow: none; outline: 3px solid var(--focus); outline-offset: 2px; }
.m-range::-webkit-slider-runnable-track { height: 5px; border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--accent)); opacity: .9; }
.m-range::-moz-range-track { height: 5px; border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.m-range::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -7.5px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
.m-range::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
.m-range:disabled { cursor: not-allowed; }
.mval { display: flex; align-items: center; gap: .25rem; }
.mval .m-num { width: 4.6rem; min-height: 34px; padding: .25rem .4rem; text-align: right; font-weight: 700; font-size: .98rem; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.mval .m-num::-webkit-outer-spin-button, .mval .m-num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.munit { font-size: .74rem; color: var(--muted); font-weight: 600; width: 2.4rem; flex: none; }
.mcalc:empty { display: none; }
.mcalc { border-radius: 12px; padding: .65rem .75rem; background: linear-gradient(135deg, var(--primary-soft), color-mix(in srgb, var(--surface-2) 70%, var(--surface))); border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent); display: flex; flex-wrap: wrap; gap: .4rem .5rem; align-items: center; }
.calc-head { display: flex; align-items: center; gap: .3rem; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); width: 100%; }
.calc-list { display: contents; }
.calc { display: inline-flex; align-items: center; gap: .35rem; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: .28rem .55rem; font-size: .82rem; }
.calc strong { font-variant-numeric: tabular-nums; }
.calc-k { color: var(--muted); font-weight: 600; font-size: .76rem; }
.calc-tag { font-size: .7rem; font-weight: 700; padding: .04rem .42rem; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.calc-tag.ok { background: var(--ok-soft); color: var(--ok); }
.calc-tag.warn { background: var(--warn-soft); color: var(--warn); }
.calc-tag.bad { background: var(--bad-soft); color: var(--bad); }
.calc-warn { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.mcalc .btn-sm { min-height: 30px; }
.mcalc .hint { width: 100%; }

/* Wide form: date + device side by side and readings two per row (blood pressure stacks systolic over diastolic
   in its cell, next to resting heart rate). */
@container (min-width: 600px) {
  .mmeta:not(.single) { grid-template-columns: auto minmax(0, 1fr); }
  .mrows { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
/* Narrow form (phones): drop the sliders and show compact − value + steppers, two readings per row. Hold-to-repeat
   with acceleration covers big changes. The change-since-last note wraps under the label. */
@container (max-width: 439px) {
  .mrows { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: .45rem; }
  .mrow { padding: .5rem .5rem .55rem; }
  .mhead { flex-wrap: wrap; gap: .35rem .4rem; margin-bottom: .35rem; }
  .mhead .tone { display: none; }
  .mlabel { font-size: .84rem; white-space: normal; line-height: 1.2; }
  .mdelta { order: 5; width: 100%; margin-left: 0; text-align: left; font-size: .7rem; }
  .m-range { display: none; }
  .mctrl { grid-template-columns: 32px minmax(0, 1fr) 32px; gap: .25rem; }
  .mctrl .step[data-dir="-1"] { order: 1; }
  .mctrl .mval { order: 2; flex-direction: column; gap: 0; }
  .mctrl .step[data-dir="1"] { order: 3; }
  .mval .m-num { width: 100%; text-align: center; padding: .2rem 0; font-size: .95rem; letter-spacing: -.02em; }
  .munit { width: auto; font-size: .68rem; line-height: 1.1; }
  .step { width: 32px; height: 40px; border-radius: 9px; }
  .msub { font-size: .7rem; }
}
@container (max-width: 279px) {
  .mrows { grid-template-columns: 1fr; }
}

/* ---------- Sign-in extras ---------- */
.forgot-link { align-self: flex-end; font-weight: 600; text-decoration: none; margin-top: .1rem; }

/* ---------- QR check-in kiosk (full screen on a tablet) ---------- */
.kiosk { min-height: 100vh; display: flex; flex-direction: column; padding: clamp(1rem, 2.5vw, 2rem); gap: 1.5rem; }
.kiosk-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.kiosk-head .brand { font-size: 1.3rem; }
.kiosk-actions { display: flex; gap: .5rem; }
.kiosk-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, .8fr); gap: clamp(1rem, 3vw, 2.5rem); align-items: center; }
.kiosk-qr { text-align: center; display: flex; flex-direction: column; align-items: center; }
.qr-box { width: min(62vh, 92%); aspect-ratio: 1; background: #fff; border-radius: 28px; padding: clamp(14px, 2.4vh, 26px); box-shadow: var(--shadow-lg), 0 0 0 8px color-mix(in srgb, var(--primary) 18%, transparent); margin-bottom: 1.4rem; }
.qr-box svg { width: 100%; height: 100%; display: block; }
.kiosk-qr h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); font-weight: 800; letter-spacing: -.04em; margin-bottom: .4rem; }
.kiosk-qr .lead { margin: 0 0 .5rem; }
.kiosk-side { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); align-self: stretch; display: flex; flex-direction: column; }
.kiosk-clock { font-size: clamp(2.2rem, 4vw, 3.2rem); font-weight: 800; letter-spacing: -.04em; margin: 0 0 1rem; font-variant-numeric: tabular-nums; }
.kiosk-side h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .6rem; }
.kiosk-feed { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.kiosk-feed li { display: flex; gap: .7rem; align-items: center; padding: .6rem .7rem; border-radius: 12px; background: var(--surface-2); }
.kiosk-feed li.fresh { background: var(--ok-soft); animation: pop .4s ease-out; }
.kiosk-feed li.fresh strong { color: var(--ok); }
@media (max-width: 900px) {
  .kiosk-body { grid-template-columns: 1fr; }
  .qr-box { width: min(78vw, 420px); }
}

/* ---------- QR scan result (member phone) ---------- */
.scan-result { text-align: center; padding: 2.2rem 1.5rem; margin-top: 1rem; }
.scan-result h1 { font-size: 1.7rem; margin: .8rem 0 .3rem; color: inherit; }
.scan-icon { width: 76px; height: 76px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .18); color: #fff; }
.scan-icon .ic { width: 40px; height: 40px; }
.scan-icon.bad { background: var(--bad-soft); color: var(--bad); }

/* ---------- Quick-fill workout form (workout.js) ---------- */
.wform { display: grid; gap: .35rem; container-type: inline-size; }
.wform .field { margin-bottom: .55rem; }
.wgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .25rem .8rem; }
.wstep { display: grid; grid-template-columns: 36px minmax(0, 1fr) 36px; gap: .3rem; align-items: center; max-width: 230px; }
.wstep .mval { justify-content: center; }
.wstep .m-num { width: 100%; max-width: 5.6rem; text-align: center; min-height: 36px; padding: .25rem .3rem; font-weight: 700; font-size: 1rem; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.wstep .m-num::-webkit-outer-spin-button, .wstep .m-num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.wstep .step { width: 36px; height: 36px; }
.wstep .munit { width: auto; }
.choice-sm { padding: .22rem .6rem; min-height: 30px; font-size: .78rem; }
.dur-row { margin-top: .35rem; }
.type-row .choice { padding: .3rem .7rem; }
.intensity-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; }
.intensity {
  font: inherit; display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; text-align: left; cursor: pointer;
  padding: .5rem .6rem; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.intensity strong { font-size: .86rem; }
.intensity span { font-size: .72rem; color: var(--muted); line-height: 1.25; }
.intensity:hover { border-color: var(--primary); }
.intensity[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary); }
.intensity[aria-pressed="true"] strong { color: var(--primary); }
.hr-row { margin: .1rem 0 .6rem; }
.hr-row .msub { display: block; margin-bottom: .2rem; }
.auto-tag { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: .05rem .4rem; border-radius: 99px; background: var(--primary-soft); color: var(--primary); margin-left: .3rem; }
.link-btn { background: none; border: 0; padding: .2rem 0; font: inherit; font-size: .8rem; font-weight: 600; color: var(--primary); cursor: pointer; text-align: left; }
.link-btn:hover { text-decoration: underline; }
.wpace:empty { display: none; }
.wcalc { margin-top: .2rem; }
@container (max-width: 420px) {
  .intensity-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wgrid { gap: .2rem .5rem; }
  .wstep { grid-template-columns: 32px minmax(0, 1fr) 32px; }
  .wstep .step { width: 32px; height: 36px; }
}
@container (max-width: 300px) {
  .wgrid { grid-template-columns: 1fr; }
}

/* ---------- House ads (free trial only) ---------- */
.ad-slot { margin-bottom: 1.1rem; }
.ad-card { display: flex; gap: 1rem; align-items: center; padding: 1rem 1.1rem; border-radius: var(--radius); border: 1px dashed var(--border-strong); background: var(--surface); box-shadow: var(--shadow); }
.ad-img { width: 120px; height: 80px; object-fit: cover; border-radius: 10px; flex: none; background: var(--surface-2); }
.ad-icon { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; flex: none; color: var(--primary); background: var(--primary-soft); }
.ad-text { min-width: 0; display: grid; gap: .15rem; justify-items: start; }
.ad-text strong { font-size: 1rem; letter-spacing: -.01em; }
.ad-text p { margin: 0 0 .35rem; color: var(--muted); font-size: .9rem; }
.ad-label { font-size: .66rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ad-note { margin: .35rem 0 0; font-size: .76rem; color: var(--muted); }
@media (max-width: 640px) { .ad-img { width: 84px; height: 64px; } }

/* ---------- Subscription banner, lock screen, plan cards ---------- */
.sub-banner { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; padding: .6rem clamp(1rem, 3.2vw, 2.75rem); font-size: .88rem; font-weight: 600; border-bottom: 1px solid var(--border); }
.sub-banner.trial { background: var(--primary-soft); color: var(--primary); }
.sub-banner.warn { background: var(--warn-soft); color: var(--warn); }
.sub-banner.bad { background: var(--bad-soft); color: var(--bad); }
.sub-banner a { color: inherit; font-weight: 800; }
.sub-banner .ic { width: 18px; height: 18px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 1rem; margin-bottom: 1.1rem; }
.plan-card { position: relative; display: flex; flex-direction: column; gap: .5rem; padding: 1.3rem 1.25rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); }
.plan-card.current { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), var(--shadow-lg); }
.plan-card h3 { font-size: 1.05rem; margin: 0; }
.plan-price { font-size: 2rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.plan-price span { font-size: .85rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.plan-card ul { list-style: none; margin: .2rem 0 .6rem; padding: 0; display: grid; gap: .35rem; font-size: .88rem; }
.plan-card li { display: flex; gap: .45rem; align-items: flex-start; }
.plan-card li .ic { color: var(--ok); width: 17px; height: 17px; margin-top: .15rem; }
.plan-card .btn { margin-top: auto; }
.plan-badge { position: absolute; top: .9rem; right: .9rem; }
.lock-card { text-align: center; max-width: 560px; margin: 2rem auto; padding: 2.2rem 1.6rem; }
.lock-card .scan-icon { background: var(--warn-soft); color: var(--warn); }
.pay-box { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: .85rem 1rem; font-size: .9rem; }

/* ---------- Super admin ---------- */
.layout-admin .studio-pill .studio-badge { background: linear-gradient(135deg, #111827, #4338ca); }
.status-trial { background: var(--info-soft); color: var(--info); }
.admin-kpis { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1100px) { .admin-kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .admin-kpis { grid-template-columns: 1fr 1fr; } }
.ad-preview { max-width: 520px; }
.img-drop { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.img-drop img { width: 120px; height: 80px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.main-col { min-width: 0; display: flex; flex-direction: column; }

/* Wide data tables scroll inside their card instead of widening the page. */
.table-scroll { overflow-x: auto; max-width: 100%; }
.table-scroll > .table th, .table-scroll > .table td { white-space: nowrap; }
.table-scroll > .table td:first-child { white-space: normal; min-width: 14rem; }
@media (max-width: 640px) {
  .table-scroll > .table th, .table-scroll > .table td, .table-scroll > .table td:first-child { white-space: normal; min-width: 0; }
  .table td:first-child[data-label="Studio"]::before { content: none; }
}
/* Four stats: one row on wide screens, a tidy 2×2 otherwise (never 3 + 1). */
.stat-row-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .stat-row-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Marketplace: find a studio, studio home page ---------- */
.hide-sm { display: inline; }
.market { padding-bottom: 3rem; }
.market-head .btn.is-active { color: var(--primary); }
.mk-hero { text-align: center; max-width: 820px; margin: 1.5rem auto 1.75rem; }
.mk-hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; letter-spacing: -.04em; line-height: 1.05; margin: .4rem 0 .75rem; }
.mk-hero .lead { margin: 0 auto 1.5rem; max-width: 600px; }
.mk-search { display: flex; gap: .5rem; align-items: center; padding: .45rem; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); position: relative; }
.mk-search-ic { position: absolute; left: 1.05rem; color: var(--muted); display: grid; pointer-events: none; }
.mk-search input { flex: 1; min-width: 0; border: 0; box-shadow: none; background: transparent; padding-left: 2.6rem; font-size: 1rem; }
.mk-search input:focus { outline: none; box-shadow: none; }
.mk-search:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.mk-search .btn { flex: none; }
.btn.btn-on { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.mk-cats { justify-content: center; margin-top: 1rem; }
.mk-count { margin: 0 0 .75rem; font-size: .9rem; min-height: 1.2em; }
.mk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 1.1rem; margin-bottom: 2.5rem; }
.mk-grid > .loading, .mk-grid > .mk-empty { grid-column: 1 / -1; }
.mk-card { display: flex; flex-direction: column; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s, border-color .15s; }
.mk-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.mk-card:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.mk-cover { aspect-ratio: 16 / 8; background: var(--surface-2); overflow: hidden; }
.mk-cover img, .mk-hero-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mk-cover-blank { display: grid; place-items: center; background: linear-gradient(135deg, var(--primary-soft), var(--surface-2)); }
.mk-card-body { padding: .9rem 1.05rem 1.05rem; display: grid; gap: .35rem; }
.mk-card-top { display: flex; justify-content: space-between; gap: .5rem; align-items: flex-start; }
.mk-card h3 { font-size: 1.05rem; margin: 0; letter-spacing: -.01em; }
.mk-tagline { margin: 0; color: var(--muted); font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mk-where { display: flex; gap: .35rem; align-items: flex-start; margin: 0; font-size: .86rem; color: var(--muted); }
.mk-where .ic { flex: none; margin-top: .1rem; }
.mk-price { margin: .25rem 0 0; font-size: .9rem; }
.mk-owner-band { margin-top: 1rem; }
.mk-preview { display: flex; gap: .5rem; align-items: center; margin: .5rem 0 1rem; }
.mk-studio-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1.75rem; align-items: center; margin-bottom: 1.5rem; }
.mk-hero-cover { aspect-ratio: 16 / 10; border-radius: calc(var(--radius) + 6px); overflow: hidden; box-shadow: var(--shadow-lg); background: var(--surface-2); }
.mk-hero-cover.mk-cover-blank .avatar { transform: scale(1.6); }
.mk-hero-text h1 { font-size: clamp(1.9rem, 4.2vw, 2.8rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.08; margin: .6rem 0 .5rem; }
.mk-hero-text .lead { margin: 0 0 .75rem; }
.mk-hero-text .mk-where { font-size: .95rem; margin-bottom: 1.1rem; }
.mk-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.1rem; align-items: start; }
.mk-side { position: sticky; top: 5rem; }
.mk-about, .mk-hours, .enq-msg { white-space: pre-line; }
.mk-about { margin: 0; line-height: 1.65; }
.mk-desc { margin: 0 0 .4rem; }
.mk-plan .badge { align-self: flex-start; margin-top: auto; }
.mk-line { display: flex; gap: .6rem; align-items: flex-start; margin: 0 0 .85rem; font-size: .92rem; }
.mk-line > .ic { flex: none; color: var(--primary); margin-top: .1rem; }
.mk-line p { margin: 0; }
.mk-pcat { margin: 1rem 0 .6rem; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.mk-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: .75rem; }
.mk-product { display: flex; gap: .8rem; padding: .8rem; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); }
.mk-product img, .mk-product-ic { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; flex: none; }
.mk-product-ic { display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.mk-product h4 { margin: 0 0 .15rem; font-size: .95rem; }
.mk-product p { margin: 0 0 .35rem; }
.mk-pprice { font-size: .95rem; }
.mk-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.mk-join-plan { display: flex; gap: .75rem; align-items: flex-start; padding: .8rem 1rem; border-radius: 12px; background: var(--primary-soft); margin-bottom: 1rem; }
.mk-join-plan p { margin: .2rem 0 0; }
.mk-agree { align-items: flex-start; font-size: .88rem; }
.mk-agree input { margin-top: .15rem; }
@media (max-width: 960px) {
  .mk-studio-hero, .mk-layout { grid-template-columns: 1fr; }
  .mk-side { position: static; }
}
@media (max-width: 640px) {
  .hide-sm { display: none; }
  .mk-search { flex-wrap: wrap; }
  .mk-search input { flex-basis: 100%; }
  .mk-search .btn { flex: 1; }
  .mk-search-ic { top: 1.05rem; }
  .mk-cats { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding-bottom: .4rem; }
  .mk-cats .choice { flex: none; }
  .mk-hero-text .btn-row .btn { flex: 1 1 calc(50% - .5rem); }
}

/* ---------- Studio: home page editor & enquiries ---------- */
.hp-status-row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.hp-status .small { margin: .6rem 0 .8rem; }
.hp-url { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: .45rem .7rem; font-size: .84rem; }
.hp-cover { aspect-ratio: 16 / 8; border-radius: 14px; overflow: hidden; background: var(--surface-2); border: 1px dashed var(--border-strong); margin-bottom: .8rem; }
.hp-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hp-cover-empty { height: 100%; display: grid; place-content: center; justify-items: center; gap: .4rem; color: var(--muted); font-size: .9rem; }
.hp-pin { display: flex; gap: .5rem; align-items: flex-start; padding: .7rem .85rem; border-radius: 12px; background: var(--warn-soft); color: var(--text); font-size: .88rem; margin-bottom: .75rem; }
.hp-pin > .ic { color: var(--warn); flex: none; margin-top: .05rem; }
.hp-pin.set { background: var(--ok-soft); }
.hp-pin.set > .ic { color: var(--ok); }
.hp-save { display: flex; justify-content: flex-end; align-items: center; gap: 1rem; margin: 0 0 1.1rem; position: sticky; bottom: 1rem; z-index: 5; }
.hp-save .btn { box-shadow: var(--shadow-lg); }
.hp-plans li p { margin: .2rem 0 0; }
.hp-products { display: grid; gap: .6rem; margin-top: .75rem; }
.hp-product { display: flex; gap: .8rem; align-items: center; padding: .65rem .75rem; border: 1px solid var(--border); border-radius: 12px; flex-wrap: wrap; }
.hp-product > div:nth-child(2) { flex: 1; min-width: 160px; }
.hp-product p { margin: .15rem 0 0; }
.hp-product img, .hp-product-ic { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex: none; }
.hp-product-ic { display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.hp-product.inactive { opacity: .65; }
.hp-geo-list .check { align-items: flex-start; font-size: .9rem; }
.enq-list { display: grid; gap: .75rem; }
.enq { margin: 0; }
.enq.new { border-left: 3px solid var(--primary); }
.enq-head { display: flex; gap: .75rem; align-items: flex-start; }
.enq-head > div { flex: 1; min-width: 0; }
.enq-head p { margin: .2rem 0 0; }
.enq-msg { margin: .8rem 0; padding: .7rem .9rem; border-radius: 10px; background: var(--surface-2); font-size: .92rem; }
.mk-dist { text-transform: none; }
.hp-status .badge, .page-head .actions .badge, .enq-head .badge { text-transform: none; }
