:root {
  --paper: #F6F6F9;
  --panel: #FFFFFF;
  --ink: #14162B;
  --muted: #5B6078;
  --royal: #2E3EA8;
  --gold: #C9A227;
  --saffron: #E07A1F; --sky: #2F6FCF;
  --line: #E2E3EC;
  --ok: #2E6B4F;
  --shadow: 0 2px 5px rgba(20, 22, 43, .05), 0 16px 40px rgba(20, 22, 43, .07);
  --radius: 22px;
  --font: Inter, system-ui, sans-serif;
  --serif: Fraunces, Georgia, serif;
  --top: 60px;
  --nav: #1C2470; --nav-ink: #F6F6F9; --sb-bg: #FFFFFF; --sb-w: 252px;
  --royal-solid: #2E3EA8; --hero-a: #141A55; --hero-b: #2E3EA8;
  --stage: #EEEFF5; --stage-line: rgba(46, 62, 168, .06); --gold-ink: #8A6A10;
  --rose: #B83A63; --green: #2E7D5B; --teal: #1D7385; --violet: #6741B8;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0B0D1A;
    --panel: #141833;
    --ink: #ECEAE4;
    --muted: #9AA3B8;
    --royal: #6F7FE8;
    --gold: #D9B443;
    --saffron: #F0913A; --sky: #7FB0F5;
    --line: #262B4A;
    --ok: #8FCBAA;
    --shadow: 0 2px 10px rgba(0, 0, 0, .35);
    --nav: #0E1230; --nav-ink: #ECEAE4; --sb-bg: #10142B;
    --royal-solid: #4252C8; --hero-a: #0B0F2C; --hero-b: #26318C;
    --stage: #0E1126; --stage-line: rgba(143, 155, 240, .07); --gold-ink: #E3C15A;
    --rose: #F08AAE; --green: #7FD1A8; --teal: #74C7D6; --violet: #B59CF5;
    color-scheme: dark;
  }
}
[data-theme="dark"] {
  --paper: #0B0D1A;
  --panel: #141833;
  --ink: #ECEAE4;
  --muted: #9AA3B8;
  --royal: #6F7FE8;
  --gold: #D9B443;
  --saffron: #F0913A; --sky: #7FB0F5;
  --line: #262B4A;
  --ok: #8FCBAA;
  --shadow: 0 2px 10px rgba(0, 0, 0, .35);
  --nav: #0E1230; --nav-ink: #ECEAE4; --sb-bg: #10142B;
  --royal-solid: #4252C8; --hero-a: #0B0F2C; --hero-b: #26318C;
  --stage: #0E1126; --stage-line: rgba(143, 155, 240, .07); --gold-ink: #E3C15A;
  --rose: #F08AAE; --green: #7FD1A8; --teal: #74C7D6; --violet: #B59CF5;
  color-scheme: dark;
}
[data-theme="light"] {
  --paper: #F6F6F9;
  --panel: #FFFFFF;
  --ink: #14162B;
  --muted: #5B6078;
  --royal: #2E3EA8;
  --gold: #C9A227;
  --saffron: #E07A1F; --sky: #2F6FCF;
  --line: #E2E3EC;
  --ok: #2E6B4F;
  --shadow: 0 2px 5px rgba(20, 22, 43, .05), 0 16px 40px rgba(20, 22, 43, .07);
  --nav: #1C2470; --nav-ink: #F6F6F9; --sb-bg: #FFFFFF; 
  --royal-solid: #2E3EA8; --hero-a: #141A55; --hero-b: #2E3EA8;
  --stage: #EEEFF5; --stage-line: rgba(46, 62, 168, .06); --gold-ink: #8A6A10;
  --rose: #B83A63; --green: #2E7D5B; --teal: #1D7385; --violet: #6741B8;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--royal); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--royal); outline-offset: 3px; }
.skip {
  position: absolute; left: 12px; top: -80px; background: var(--royal-solid); color: #fff;
  padding: 8px 12px; border-radius: 999px; z-index: 100;
}
.skip:focus { top: 8px; }

/* ---------- app shell: left sidebar + top bar (FengMaster pattern) ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.app { display: flex; min-height: 100vh; }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-main > main { flex: 1; }
.sidebar {
  position: sticky; top: 0; height: 100vh; width: var(--sb-w); flex: 0 0 var(--sb-w);
  background: var(--sb-bg); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 50; transition: width .18s ease, flex-basis .18s ease;
}
.sb-head { padding: 14px 14px 10px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-height: 44px; }
.brand .mark { width: 34px; height: 34px; flex: 0 0 34px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 1.12rem; }
.brand-by { font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.sb-scroll { flex: 1; overflow-y: auto; padding: 8px 10px 20px; scrollbar-width: thin; }
.sb-group { display: flex; flex-direction: column; gap: 1px; padding-bottom: 6px; }
.sb-top { border-bottom: 1px solid var(--line); margin-bottom: 4px; padding-bottom: 8px; }
.sb-cat { margin: 12px 8px 4px; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 750; }
.sb-item {
  display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 4px 8px; border-radius: 10px;
  color: var(--ink); text-decoration: none; font-size: .9rem; font-weight: 520;
}
.sb-item .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-item:hover { background: color-mix(in srgb, var(--royal) 7%, transparent); }
.sb-item.active { background: var(--royal-solid); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--royal-solid) 35%, transparent); }
.sb-item.active .glyph { background: rgba(255,255,255,.18); color: #fff; }
.sb-empty { color: var(--muted); font-size: .85rem; padding: 8px; }
.glyph {
  width: 28px; height: 28px; flex: 0 0 28px; border-radius: 8px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--tone) 14%, var(--panel)); color: var(--tone);
}
.glyph svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.9; }
.t-rose { --tone: var(--rose); } .t-green { --tone: var(--green); } .t-teal { --tone: var(--teal); }
.t-royal { --tone: var(--royal); } .t-gold { --tone: var(--gold-ink); } .t-violet { --tone: var(--violet); }
.sb-backdrop { position: fixed; inset: 0; background: rgba(11, 13, 26, .5); z-index: 45; }

.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 10px;
  min-height: var(--top); padding: 8px 16px; background: var(--nav); color: var(--nav-ink);
}
.icon-btn {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 10px; border: 1px solid transparent;
  background: transparent; color: inherit; display: grid; place-items: center; cursor: pointer;
}
.icon-btn svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.topbar .icon-btn { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); }
.topbar .icon-btn:hover { background: rgba(255,255,255,.16); }
.nav-toggle { display: none; }
.crumb { display: flex; align-items: center; gap: 8px; font-size: .9rem; min-width: 0; white-space: nowrap; }
.crumb a { color: rgba(255,255,255,.7); text-decoration: none; }
.crumb a:hover { color: #fff; }
.crumb span { color: rgba(255,255,255,.45); }
.crumb strong { font-weight: 650; overflow: hidden; text-overflow: ellipsis; }
.search {
  position: relative; flex: 1; max-width: 420px; margin: 0 auto; display: flex; align-items: center;
}
.search svg { position: absolute; left: 12px; width: 16px; height: 16px; stroke: rgba(255,255,255,.65); fill: none; stroke-width: 2; pointer-events: none; }
.search input {
  width: 100%; min-height: 38px; border-radius: 10px; border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08); color: #fff; padding: 6px 12px 6px 36px;
}
.search input::placeholder { color: rgba(255,255,255,.6); }
.search input:focus { outline: none; border-color: var(--gold); background: rgba(255,255,255,.14); }
.nav-end { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.login-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 10px;
  background: var(--gold); color: #14162B; font-weight: 700; text-decoration: none; font-size: .9rem; white-space: nowrap;
}
.login-link svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.login-link:hover { filter: brightness(1.06); }

/* collapsed sidebar (desktop) */
@media (min-width: 1024px) {
.sb-collapsed .sidebar { --sb-w: 72px; }
.sb-collapsed .sidebar .lbl, .sb-collapsed .sidebar .brand-text, .sb-collapsed .sidebar .sb-cat { display: none; }
.sb-collapsed .sidebar .sb-item { justify-content: center; padding: 4px; }
.sb-collapsed .sidebar .sb-head { padding: 14px 0 10px; display: flex; justify-content: center; }
.sb-collapsed .sidebar .sb-group:not(.sb-top) { border-top: 1px solid var(--line); padding-top: 6px; margin-top: 4px; }
}
@media (max-width: 1023px) {
  .nav-toggle { display: grid; }
  .sb-collapse { display: none; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; height: 100%; width: min(300px, 86vw); flex: none;
    transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow);
  }
  .sb-open .sidebar { transform: none; }
  .crumb { display: none; }
}
@media (max-width: 599px) {
  .topbar { padding: 8px 12px; gap: 8px; }
  .login-link span { display: none; }
  .login-link { padding: 0 11px; }
}

/* ---------- hero bands ---------- */
.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.hero {
  position: relative; overflow: hidden; color: #F6F6F9;
  background: radial-gradient(120% 180% at 100% 0%, #3A46B8 0%, #2E3EA8 42%, #1A226E 100%);
  border-bottom: 1px solid transparent;
}
.hero-geo { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .45; pointer-events: none; }
.hero-inner { position: relative; padding: 48px 0 56px; max-width: 740px; }
.home-hero .hero-geo { left: auto; right: 0; width: min(46%, 560px); opacity: .5; }
.home-hero .hero-inner { max-width: 1120px; }
.home-hero .hero-inner > * { max-width: 600px; }
@media (max-width: 899px) { .home-hero .hero-geo { opacity: .16; width: 100%; } }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; letter-spacing: .12em; text-transform: uppercase; font-size: 12px; font-weight: 700; color: #E7D48A; }
.eyebrow::before { content: ""; width: 22px; height: 1px; background: #E7D48A; }
.hero h1 { font-family: var(--serif); font-weight: 560; font-size: clamp(1.8rem, 5vw, 2.7rem); line-height: 1.15; margin: 12px 0; color: #fff; }
.hero .lead { margin: 0; color: rgba(255,255,255,.82); font-size: 1.05rem; max-width: 62ch; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.daily-list { list-style: none; padding: 0; margin: 16px 0 0; max-width: 62ch; }
.daily-list li { display: none; color: rgba(255,255,255,.88); }
html.no-js .daily-list li, .daily-list li.on { display: list-item; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 650; cursor: pointer; text-decoration: none; background: transparent; color: var(--ink);
}
.btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.btn-primary { background: var(--royal); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-gold { background: var(--gold); color: #14162B; }
.btn-ghost { border-color: var(--line); background: var(--panel); color: var(--ink); }
.hero .btn-ghost { background: transparent; border-color: rgba(255,255,255,.35); color: #fff; }
.btn-sm { min-height: 44px; padding: 0 12px; font-size: .9rem; }
.btn[disabled], .btn:disabled { opacity: .55; cursor: not-allowed; }

.section { padding: 42px 0; }
.section h2 { font-family: var(--serif); font-weight: 560; font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 8px; }
.sub { color: var(--muted); margin: 0 0 18px; }
.row-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-end; flex-wrap: wrap; }

.tool-grid, .card-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.tool-card, .learn-card, .cat-card, .panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); color: inherit; text-decoration: none;
}
.tool-card { padding: 18px; display: flex; flex-direction: column; gap: 8px; min-height: 160px; }
.tool-card:hover, .learn-card:hover, .cat-card:hover { border-color: var(--royal); }
.tool-card .glyph, .cat-card .glyph { width: 38px; height: 38px; flex-basis: 38px; border-radius: 11px; }
.tool-card .glyph svg, .cat-card .glyph svg { width: 20px; height: 20px; }
.tool-card h3, .learn-card h3, .cat-card h3 { margin: 0; font-size: 1.05rem; font-weight: 650; }
.tool-card p, .learn-card p, .cat-card p { margin: 0; color: var(--muted); flex: 1; }
.tool-card .go { color: var(--royal); font-weight: 650; font-size: .9rem; }
.cat-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.cat-card { padding: 16px 18px; display: flex; gap: 12px; align-items: center; }
.cat-card strong { font-family: var(--serif); font-size: 1.4rem; color: var(--royal); }
.learn-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.learn-card { padding: 20px; display: block; }
.subscribe {
  display: grid; gap: 14px; padding: 22px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.subscribe form { display: flex; flex-wrap: wrap; gap: 8px; }
.subscribe input, .field input, .field textarea, .field select {
  min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper);
  padding: 10px 12px; width: 100%;
}
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-weight: 600; font-size: .92rem; }
.note { color: var(--muted); font-size: .92rem; }

.site-footer { border-top: 1px solid var(--line); margin-top: 20px; padding: 36px 0 24px; color: var(--muted); }
.ft-grid { display: grid; grid-template-columns: 1fr; gap: 22px; }
.site-footer h2 { font-family: var(--serif); color: var(--ink); font-size: 1.2rem; margin: 0 0 8px; font-weight: 560; }
.site-footer a { color: var(--muted); text-decoration: none; display: inline-flex; min-height: 44px; align-items: center; }
.site-footer a:hover { color: var(--royal); }
.ft-links { display: flex; flex-direction: column; }
.socials { display: flex; gap: 8px; margin-top: 8px; }
.socials a { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 999px; display: grid; place-items: center; color: var(--ink); }
.socials svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.ft-bottom { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px; font-size: .9rem; }
.legal-links { display: flex; flex-wrap: wrap; gap: 4px 14px; }

.prose { max-width: 760px; }
.prose h1 { font-family: var(--serif); font-weight: 560; font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 8px 0 12px; }
.prose h2 { font-family: var(--serif); font-weight: 560; font-size: 1.35rem; margin: 1.4rem 0 .4rem; }
.prose h3 { font-size: 1.05rem; margin: 1rem 0 .3rem; }
.page { padding: 28px 0 48px; }
table { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: 16px; overflow: hidden; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .85rem; color: var(--muted); font-weight: 650; }
.price-table { border: 1px solid var(--line); border-radius: 22px; overflow: auto; }

/* ---------- tool page: hero + studio ---------- */
.page-pad { width: min(1240px, calc(100% - 32px)); margin: 0 auto; padding: 0 0 36px; }
.tool-hero {
  position: relative; overflow: hidden; color: #F6F6F9;
  background: linear-gradient(115deg, var(--hero-a) 0%, var(--hero-b) 62%, color-mix(in srgb, var(--tone) 55%, var(--hero-b)) 140%);
}
.tool-hero .hero-geo { position: absolute; inset: 0; width: 100%; height: 100%; color: #E7D48A; opacity: .32; pointer-events: none; }
.tool-hero .hero-inner { position: relative; width: min(1240px, calc(100% - 32px)); margin: 0 auto; padding: 26px 0 64px; max-width: none; }
.tool-hero h1 { font-family: var(--serif); font-weight: 560; font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.15; margin: 8px 0 6px; color: #fff; }
.tool-hero .lead { margin: 0; color: rgba(255,255,255,.84); max-width: 62ch; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 14px 0 0; }
.chips li { font-size: .78rem; font-weight: 650; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); color: #fff; }
.chips li:first-child { background: color-mix(in srgb, var(--ok) 30%, transparent); border-color: rgba(143,203,170,.55); }

.studio {
  position: relative; margin-top: -40px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.studio-head {
  display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.studio-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.studio-actions .btn { min-height: 40px; padding: 0 14px; font-size: .92rem; }
.steps { display: flex; flex-wrap: wrap; gap: 6px; }
.steps .s { min-height: 30px; display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: .78rem; font-weight: 600; background: var(--paper); }
.steps .s.on { border-color: var(--royal); color: #fff; background: var(--royal-solid); }
.studio-body { display: grid; grid-template-columns: 1fr; }
.stage { position: relative; min-width: 0; background: var(--stage); }
.stage-tools {
  display: flex; gap: 2px; padding: 3px; margin-right: 4px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
}
.stage-tools .icon-btn { width: 34px; height: 34px; flex-basis: 34px; border-radius: 9px; color: var(--ink); }
.stage-tools .icon-btn:hover { background: color-mix(in srgb, var(--royal) 10%, transparent); }
.canvas-wrap {
  position: relative; height: clamp(360px, 62vh, 760px); overflow: hidden; touch-action: none;
  background-color: var(--stage);
  background-image: linear-gradient(var(--stage-line) 1px, transparent 1px), linear-gradient(90deg, var(--stage-line) 1px, transparent 1px);
  background-size: 24px 24px;
}
.canvas-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.inspector { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-top: 1px solid var(--line); min-width: 0; }
.score-card { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); }
.score-ring {
  width: 104px; height: 104px; flex: 0 0 104px; border-radius: 50%;
  display: grid; place-items: center; background: conic-gradient(var(--gold) 0%, var(--line) 0);
}
.score-ring .inner { width: 80%; height: 80%; border-radius: 50%; background: var(--panel); display: grid; place-items: center; align-content: center; text-align: center; gap: 2px; }
.score-ring strong { font-family: var(--serif); font-size: 1.75rem; line-height: 1; color: var(--ink); }
.score-ring span { font-size: .64rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.score-note { margin: 0; font-size: .86rem; color: var(--muted); }
.panel-box { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
.panel-box:empty { display: none; }
.panel-box h2 { margin: 0 0 8px; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 750; }
.panel-box .btn { min-height: 38px; padding: 0 12px; font-size: .88rem; }
.panel-box label { font-size: .9rem; }
.panel-box input[type=range] { width: 100%; }
.panel-box select, .panel-box input[type=number], .panel-box input[type=text], .panel-box input[type=color] {
  min-height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); padding: 6px 10px; max-width: 100%;
}
.meas-list { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow: auto; }
.meas { text-align: left; width: 100%; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; cursor: pointer; }
.meas.active { border-color: var(--royal); box-shadow: inset 3px 0 0 var(--royal); }
.meas .row { display: flex; justify-content: space-between; gap: 8px; font-size: .86rem; }
.meas .row strong { color: var(--royal); }
.meas .sub { display: block; color: var(--muted); font-size: .76rem; }
.meas .bar { display: block; height: 4px; background: var(--line); border-radius: 4px; margin-top: 6px; overflow: hidden; }
.meas .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--ok)); }
.clinical { margin: 0; background: color-mix(in srgb, var(--saffron) 12%, var(--panel)); border: 1px solid color-mix(in srgb, var(--saffron) 35%, var(--line)); border-radius: 12px; padding: 8px 10px; font-size: .86rem; }
.studio-foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 14px;
  border-top: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 60%, var(--panel));
}
.foot-label { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 750; }
.studio-exports { display: flex; flex-wrap: wrap; gap: 8px; }
.studio-exports .btn { min-height: 40px; padding: 0 13px; font-size: .9rem; }
.btn .lock { display: inline-grid; place-items: center; margin-left: -2px; color: var(--muted); }
.btn .lock svg { width: 13px; height: 13px; }
.gate-note { margin: 0 0 0 auto; display: flex; gap: 6px; align-items: center; font-size: .8rem; color: var(--muted); }
.gate-note svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; flex: 0 0 14px; }

.edu-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 20px; }
.edu { padding: 0; max-width: none; display: flex; flex-direction: column; gap: 14px; }
.edu-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.edu-card h2 { margin-top: 0; }
.edu-card p { margin: 0 0 .7rem; }
/* GP-BUILD-10: the calm card a raised tool shows once its free uses are used (js/core/workspace.js gate) */
.gate-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 18px; margin: 18px auto; max-width: 720px; }
.gate-card h2 { margin: 0 0 .5rem; }
.gate-card ul { margin: .4rem 0 1rem; padding-left: 1.2rem; }
.gate-card li { margin: .2rem 0; }
.tips { margin: 0; padding-left: 1.2rem; }
.tips li { margin: .3rem 0; }
.edu details { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; margin: 8px 0; }
.edu summary { cursor: pointer; font-weight: 650; min-height: 44px; display: flex; align-items: center; }
.edu-side { display: flex; flex-direction: column; gap: 14px; }
.next-card {
  display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: var(--radius); text-decoration: none;
  color: #fff; background: linear-gradient(135deg, var(--hero-b), var(--hero-a));
}
.next-card .note { color: #E7D48A; font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 750; }
.next-card strong { font-family: var(--serif); font-size: 1.25rem; font-weight: 560; }
.next-card small { color: rgba(255,255,255,.8); font-size: .9rem; }
.next-card .go { margin-top: 8px; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--gold); }
.next-card .go svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.rel-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.rel-card h2 { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 750; margin: 2px 4px 8px; font-family: var(--font); }
.rel-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px; border-radius: 12px; text-decoration: none; color: var(--ink); }
.rel-item:hover { background: color-mix(in srgb, var(--royal) 6%, transparent); }
.rel-item strong { display: block; font-size: .92rem; }
.rel-item small { display: block; color: var(--muted); font-size: .8rem; line-height: 1.4; }
.split { display: flex; gap: 8px; align-items: center; }
.split input[type=range] { flex: 1; min-height: 44px; }
.preview-html { padding: 16px; overflow: auto; height: 100%; }
.swatches { display: grid; gap: 6px; }
.swatch-row { display: flex; gap: 4px; }
.swatch { flex: 1; min-height: 44px; border-radius: 8px; border: 1px solid var(--line); }
.composites { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.composites canvas, .composites img { width: 100%; border-radius: 12px; background: var(--paper); }
.toast {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%) translateY(12px);
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: .2s; z-index: 80; max-width: calc(100% - 24px);
}
.toast.show { opacity: 1; transform: translateX(-50%); }
.modal-back { position: fixed; inset: 0; background: rgba(11, 13, 26, .55); display: grid; place-items: center; z-index: 70; padding: 16px; }
.modal-card { width: min(460px, 100%); background: var(--panel); color: var(--ink); border-radius: 22px; padding: 18px; border: 1px solid var(--line); max-height: min(90vh, 720px); overflow: auto; }
.modal-card h2 { font-family: var(--serif); margin: 0 0 8px; font-weight: 560; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: .9rem; margin: 8px 0 12px; }
.check input { width: 20px; height: 20px; margin-top: 2px; }
.install-bar {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 60;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow); padding: 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--royal); }
.diagrams { display: grid; grid-template-columns: 1fr; gap: 10px; }
.diagrams figure { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 8px; }
.diagrams figcaption { font-size: .85rem; color: var(--muted); }
.muted { color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 8px; }
.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

@media (min-width: 700px) {
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-grid, .learn-grid { grid-template-columns: repeat(3, 1fr); }
  .ft-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
  .subscribe { grid-template-columns: 1.4fr .8fr; align-items: center; }
  .diagrams { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1100px) {
  .tool-grid { grid-template-columns: repeat(3, 1fr); }
  .studio-body { grid-template-columns: minmax(0, 1fr) 360px; }
  .inspector { border-top: 0; border-left: 1px solid var(--line); max-height: clamp(360px, 62vh, 760px); overflow: auto; }
  .edu-grid { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
  .edu-side { position: sticky; top: calc(var(--top) + 16px); }
}
@media (max-width: 699px) {
  .page-pad { width: calc(100% - 20px); }
  .studio { margin-top: -28px; border-radius: 18px; }
  .studio-head, .studio-foot { padding: 10px; }
  .studio-actions .btn span, .studio-exports .btn span { font-size: .86rem; }
  .canvas-wrap { height: 64vh; min-height: 320px; }
  .gate-note { margin: 0; }
  .tool-hero .hero-inner { width: calc(100% - 20px); padding: 20px 0 52px; }
  .score-ring { width: 88px; height: 88px; flex-basis: 88px; }
}
@media (max-width: 359px) {
  .wrap { width: calc(100% - 20px); }
}

/* ---------- v2 catalogue: tones, hero images, flagships, plans ---------- */
.t-saffron { --tone: var(--saffron); } .t-sky { --tone: var(--sky); }
.hero-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: right center;
  pointer-events: none; opacity: .92;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.35) 30%, #000 62%);
          mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.35) 30%, #000 62%);
}
.tool-hero .hero-img ~ .hero-geo, .home-hero .hero-img ~ .hero-geo { display: none; }
.home-hero .hero-inner { padding: 64px 0 72px; }
@media (max-width: 899px) {
  .hero-img { opacity: .4; -webkit-mask-image: none; mask-image: none; }
  .home-hero .hero-inner { padding: 40px 0 48px; }
}
.page-pad { position: relative; }
.page-pad > *:not(.page-mark) { position: relative; z-index: 1; }
.page-mark {
  position: absolute; right: 0; bottom: 0; z-index: 0; width: min(620px, 70%); height: auto;
  pointer-events: none; opacity: .22; border-radius: 28px;
  -webkit-mask-image: radial-gradient(120% 120% at 100% 100%, #000 30%, transparent 72%);
          mask-image: radial-gradient(120% 120% at 100% 100%, #000 30%, transparent 72%);
}
[data-theme="dark"] .page-mark { opacity: .3; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .page-mark { opacity: .3; } }
.edu-side { padding-bottom: 120px; }
@media (max-width: 899px) { .page-mark { width: 100%; opacity: .14; } .edu-side { padding-bottom: 60px; } }

.flag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.flag-card {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 200px;
  border-radius: var(--radius); overflow: hidden; color: #fff; text-decoration: none; isolation: isolate;
  border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .18s ease;
}
.flag-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .4s ease; }
.flag-card::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(10,12,30,.05) 20%, rgba(10,12,30,.88) 100%); }
.flag-card:hover { transform: translateY(-2px); }
.flag-card:hover img { transform: scale(1.04); }
.flag-body { display: grid; gap: 4px; padding: 16px; }
.flag-cat { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: #F2D27A; }
.flag-body strong { font-family: var(--serif); font-weight: 560; font-size: 1.15rem; }
.flag-body small { color: rgba(255,255,255,.82); line-height: 1.4; }
@media (prefers-reduced-motion: reduce) { .flag-card, .flag-card img { transition: none; } }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 22px 0 10px; }
.plan-card { display: flex; flex-direction: column; gap: 6px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.plan-card h2 { margin: 0; font-family: var(--serif); font-weight: 560; }
.plan-hot { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), var(--shadow); }
.plan-price { margin: 4px 0 0; font-size: 1.9rem; font-weight: 700; }
.plan-price small { font-size: .9rem; font-weight: 500; color: var(--muted); }
.plan-list { list-style: none; padding: 0; margin: 10px 0 16px; display: grid; gap: 8px; flex: 1; }
.plan-list li { display: flex; gap: 8px; align-items: flex-start; }
.plan-list svg, .price-table td svg { width: 18px; height: 18px; flex: none; stroke: var(--ok, #2E7D5B); fill: none; stroke-width: 2; }
.price-table { margin: 14px 0 24px; }

/* sign-in and upgrade sheet */
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; margin: 12px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.up-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 12px 0; }
.up-plan { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.up-plan.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.up-plan h3 { margin: 0; font-size: 1rem; }
.up-plan ul { margin: 0; padding-left: 18px; font-size: .85rem; color: var(--muted); flex: 1; }
.up-price { font-weight: 700; font-size: 1.1rem; }
.linkish { background: none; border: 0; padding: 0; color: var(--royal); font: inherit; text-decoration: underline; cursor: pointer; text-align: left; }
.code, .bigout { display: block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 10px; overflow-wrap: anywhere; white-space: pre-wrap; }

/* tool lists */
.vf-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 10px; }
.vf-item { display: grid; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font: inherit; font-size: .8rem; cursor: pointer; }
.vf-item img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; }
.vf-item.on, .bc-item.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.bc-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; margin-top: 6px; font-size: .85rem; }
.bc-item .linkish { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 70%; }
.swatch-pick { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.swatch-pick .sw { width: 30px; height: 30px; min-height: 0; padding: 0; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; }
.swatch-pick .sw.on { outline: 2px solid var(--gold); outline-offset: 2px; }
/* OV-07 B: the glossary and the questions page */
.glossary dt { font-weight: 650; margin-top: 1.1rem; }
.glossary dd { margin: .2rem 0 0; }
.glossary dd p { margin: .2rem 0; }
.faq-list details { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; margin: 8px 0; }
.faq-list summary { cursor: pointer; font-weight: 650; min-height: 44px; display: flex; align-items: center; }

/* GP-BUILD-08: face shape headline, colour and contrast tools */
.shape-head { display: grid; gap: 4px; }
.shape-head .note { margin: 0; }
.shape-name { margin: 0 0 4px; font-family: var(--serif); font-size: 1.9rem; line-height: 1.1; color: var(--royal); }
[data-theme="dark"] .shape-name { color: var(--gold); }
.shape-head h3 { margin: 8px 0 2px; font-size: .86rem; }
.shape-head .tips { font-size: .88rem; }
.preset-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.preset-row .btn { min-height: 32px; padding: 0 10px; font-size: .82rem; }
.preset-row .btn.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.two-col .field { margin-bottom: 8px; min-width: 0; }
.out-big { font-family: var(--serif); font-size: 1.6rem; line-height: 1.2; margin: 4px 0; overflow-wrap: anywhere; }
.pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; margin-top: 8px; }
.pick-item { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font: inherit; font-size: .78rem; cursor: pointer; min-width: 0; }
.pick-item i { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line); }
.pick-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.colour-pair { display: flex; gap: 6px; align-items: center; }
.colour-pair input[type=color] { flex: none; width: 44px; height: 38px; padding: 2px; }
.colour-pair input[type=text] { flex: 1; min-width: 0; }
.contrast-preview { border-radius: 12px; padding: 14px; border: 1px solid var(--line); margin: 8px 0; overflow-wrap: anywhere; }
.contrast-preview h3 { margin: 0 0 6px; font-size: 1.3rem; color: inherit; }
.contrast-preview p { margin: 0 0 8px; color: inherit; }
.contrast-preview small { display: block; margin-top: 8px; font-size: .78rem; color: inherit; }
.contrast-preview .demo-btn { display: inline-block; padding: 8px 14px; border-radius: 10px; font-weight: 600; border: 2px solid currentColor; }
.scale-pre { max-height: 220px; overflow: auto; }

/* GP-BUILD-09: face-shape guides */
.fs-art { color: var(--gold); width: 100%; height: auto; display: block; }
.fs-head { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: center; }
.fs-figure { margin: 0; width: min(180px, 46vw); justify-self: center; }
@media (min-width: 700px) { .fs-head { grid-template-columns: 1fr 180px; } .fs-figure { justify-self: end; } }
.fs-cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 4px; }
.fs-sec ul.tips li { margin: .45rem 0; }
.fs-box { margin: 1.6rem 0; padding: 14px 18px; border: 1px solid var(--gold); border-radius: 16px; background: var(--panel); }
.fs-box h2 { margin-top: .2rem; }
.fs-box ul { margin: 0; padding: 0; list-style: none; }
.fs-box li { padding: .55rem 0; border-top: 1px solid var(--line); }
.fs-box li:first-child { border-top: 0; }
.fs-avoid { display: block; color: var(--muted); }
.fs-try { display: block; font-weight: 600; }
.fs-others { margin-top: 1.4rem; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
.fs-hub .prose { margin-bottom: 18px; }
.fs-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 600px) { .fs-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .fs-grid { grid-template-columns: repeat(3, 1fr); } }
.fs-card { display: grid; grid-template-columns: 76px 1fr; gap: 14px; align-items: center; text-decoration: none; color: var(--ink); }
.fs-card .fs-art { width: 76px; }
.fs-card-text { display: flex; flex-direction: column; gap: 4px; }
.fs-card-text strong { font-family: var(--serif); font-size: 1.2rem; font-weight: 560; }
.fs-card-text small { color: var(--muted); font-size: .9rem; }
a.fs-side { display: block; text-decoration: none; color: var(--ink); }
a.fs-side:hover { border-color: var(--royal); }
.fs-side-row { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: center; font-size: .9rem; color: var(--muted); padding: 0 4px 4px; }
.fs-side-row .fs-art { width: 44px; }

/* GP-BUILD-09: "Embed this calculator" on the tool page */
.embed-panel { margin: 24px 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 1000px) { .embed-panel { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.embed-panel h2 { font-family: var(--serif); font-weight: 560; margin: 0 0 6px; font-size: 1.35rem; }
.embed-panel .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.embed-panel textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; width: 100%; resize: vertical; }
.embed-frame { overflow: auto; max-width: 100%; border: 1px dashed var(--line); border-radius: 16px; padding: 8px; background: var(--paper); }
.embed-frame iframe { border: 0; display: block; max-width: 100%; }

/* GP-BUILD-09: the bare calculator at /embed/<id> */
body.gp-embed { margin: 0; background: var(--paper); }
.embed-main { padding: 12px; display: flex; flex-direction: column; gap: 10px; max-width: 760px; margin: 0 auto; }
.embed-title { font-family: var(--serif); font-weight: 560; font-size: 1.15rem; margin: 2px 0 0; }
.gp-embed .ar-photo { display: none; }
.embed-foot { margin: 4px 0 0; font-size: .85rem; text-align: right; }

/* GP-BUILD-09: the result card dialog */
.share-card .sc-preview { width: 100%; max-height: 52vh; object-fit: contain; border-radius: 12px; background: #141A55; }
.share-card .inline { display: flex; flex-wrap: wrap; gap: 8px; }

/* GP-BUILD-10 C: the course */
.tier-badge { display: inline-block; font-size: .75rem; line-height: 1.4; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); vertical-align: middle; }
.tier-badge.t-free { color: var(--royal); border-color: var(--royal); }
.tier-badge.t-plus, .tier-badge.t-pro { color: var(--gold-ink); border-color: var(--gold); }
.course-progress { margin: 6px 0 18px; }
.course-progress i { background: var(--gold); }
.c-module ol { margin: .4rem 0 0; padding-left: 1.4rem; }
.c-lesson { margin: .35rem 0; }
.c-lesson.c-done > a { color: var(--muted); }
.c-lesson.c-locked > a { color: var(--ink); }
.lesson-part { margin: 1.6rem 0 0; }
.lesson-part h2 { font-size: 1.15rem; }
.c-q { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 0 0 12px; min-width: 0; }
.c-q legend { padding: 0 4px; font-weight: 600; }
.c-q .check { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; }
.lesson-gate { margin-left: 0; margin-right: 0; }
.lesson-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 2rem 0 0; }
.lesson-nav .btn { white-space: normal; text-align: left; }
.lesson-sources { margin-top: 1.4rem; }

/* GP-BUILD-15: the tool-group pages (/tools/<page>): each English line is followed by its Hindi, in the system's
   Devanagari face (no font is fetched), as on the Academy's course pages */
.cat-hi { color: var(--muted); font-family: "Nirmala UI", "Kohinoor Devanagari", "Noto Sans Devanagari", "Mangal", var(--font); }
p.cat-hi { margin-top: -0.4em; }
.cat-h1-hi { font-size: 1.15rem; margin: 0.2rem 0 0.8rem; }
.cat-faq summary .cat-hi { display: block; font-weight: 400; font-size: 0.95em; }
.cat-links ul { padding-left: 1.1rem; }
.cat-links .note { margin-left: 4px; }
.cat-others a { margin-right: 10px; white-space: nowrap; }
.tool-sec h2 a { color: inherit; text-decoration: none; }
.tool-sec h2 a:hover { text-decoration: underline; }
.cat-tool { font-weight: 600; }
