/* Lattent palette: deep lattice indigo, with copper (Cu Kα, the X-ray source of most
   diffractometers) as the signature accent. Neutrals lean slightly towards the indigo. */
:root {
  --bg: #f6f7fb; --card: #ffffff; --ink: #0e1330; --ink-2: #3a4160; --ink-3: #656d8c;
  --line: #e2e5ef; --line-2: #eef0f6; --grid: #eceef5; --axis: #9aa0b8;
  --brand: #3e4ed8; --brand-ink: #2d3aad; --brand-soft: #eceefd;
  --accent: #e0712c; --accent-ink: #a5501a; --accent-soft: #fdf1e7;
  --night: #0b0e24; --night-2: #141a42;
  --ok: #157a3b; --ok-soft: #e7f5ec; --warn: #9a5b00; --warn-soft: #fff4e0; --bad: #b42318; --bad-soft: #fdecea;
  /* chart series, checked for colour-blind separation (worst adjacent ΔE 11) */
  --s1: #3e4ed8; --s2: #e0712c; --s3: #0d9488; --s4: #8b4fc9; --s5: #d14d7d;
  --r: 12px; --shadow: 0 1px 2px rgba(14,19,48,.05), 0 8px 26px -14px rgba(14,19,48,.16);
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --display: 'Space Grotesk', Inter, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #090c1b; --card: #0f1328; --ink: #eef0fb; --ink-2: #c3c8dc; --ink-3: #8a91ab;
    --line: #222844; --line-2: #181d36; --grid: #1c2140; --axis: #4a5272;
    --brand: #5664e6; --brand-ink: #a9b3ff; --brand-soft: #1a1f45;
    --accent: #f0954f; --accent-ink: #f6ad73; --accent-soft: #2b1d12;
    --ok: #4cc27a; --ok-soft: #10261a; --warn: #f0b04a; --warn-soft: #2a2010; --bad: #ff7a6b; --bad-soft: #2c1513;
    --s1: #6474ec; --s2: #cf6a28; --s3: #14998b; --s4: #9a6ad8; --s5: #d4577f;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -16px rgba(0,0,0,.65);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #090c1b; --card: #0f1328; --ink: #eef0fb; --ink-2: #c3c8dc; --ink-3: #8a91ab;
    --line: #222844; --line-2: #181d36; --grid: #1c2140; --axis: #4a5272;
    --brand: #5664e6; --brand-ink: #a9b3ff; --brand-soft: #1a1f45;
    --accent: #f0954f; --accent-ink: #f6ad73; --accent-soft: #2b1d12;
    --ok: #4cc27a; --ok-soft: #10261a; --warn: #f0b04a; --warn-soft: #2a2010; --bad: #ff7a6b; --bad-soft: #2c1513;
    --s1: #6474ec; --s2: #cf6a28; --s3: #14998b; --s4: #9a6ad8; --s5: #d4577f;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -16px rgba(0,0,0,.65);
    color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 Inter, system-ui, -apple-system, 'Segoe UI', sans-serif; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
[id] { scroll-margin-top: 84px; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin: 0; text-wrap: balance; }
h3, h4 { font-weight: 600; letter-spacing: -0.01em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap { max-width: 1240px; margin: 0 auto; padding-inline: 24px; }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: 600 14px/1 Inter, sans-serif; padding: 10px 16px; border-radius: 9px; cursor: pointer; text-decoration: none !important; transition: border-color .15s, background .15s; }
.btn:hover { border-color: var(--axis); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; }
.btn.small { padding: 7px 11px; font-size: 13px; }
.btn.big { padding: 14px 22px; font-size: 15.5px; border-radius: 11px; }
.btn svg { width: 15px; height: 15px; }

/* header */
.top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.top-in { max-width: 1240px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 28px; }
.logo { display: inline-flex; align-items: center; gap: 9px; color: var(--ink) !important; font: 600 19px var(--display); letter-spacing: -0.025em; text-decoration: none !important; }
.logo svg { width: 28px; height: 28px; flex: none; }
.logo span { text-transform: lowercase; line-height: 1; padding-bottom: 1px; }
.nav { display: flex; align-items: center; gap: 2px; flex: 1; }
.nav-top { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); background: none; border: 0; font: 500 14.5px Inter, system-ui, sans-serif; padding: 8px 12px; border-radius: 8px; text-decoration: none !important; cursor: pointer; }
.nav-top svg { width: 12px; height: 12px; opacity: .65; transition: transform .18s; }
.nav-top:hover, .nav-group.open > .nav-top, .nav-top.cur { color: var(--ink); background: var(--line-2); }
.nav-group.open > .nav-top svg { transform: rotate(180deg); }
.nav-top:focus-visible, .mm-item:focus-visible, .mm-feat:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.nav-m-acts { display: none; }
.top-r { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.signin { color: var(--ink-2); font-weight: 500; font-size: 14.5px; text-decoration: none !important; white-space: nowrap; }
.signin:hover { color: var(--ink); }
/* mega menu panel: full width under the header bar */
.mm-panel { position: absolute; left: 0; right: 0; top: 100%; background: var(--card); border-bottom: 1px solid var(--line); box-shadow: 0 24px 48px -24px rgba(14,19,48,.28); animation: mm-in .16s ease-out; }
@keyframes mm-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .mm-panel { animation: none; } }
.mm-in { max-width: 1240px; margin: 0 auto; padding: 26px 24px 30px; display: grid; grid-template-columns: 290px repeat(3, minmax(0, 1fr)); gap: 24px; }
#mm-platform .mm-in { grid-template-columns: 260px repeat(4, minmax(0, 1fr)); gap: 18px; }
@media (min-width: 961px) {
  .nav-group.compact { position: relative; }
  .mm-panel.compact { left: 0; right: auto; top: calc(100% + 12px); width: 300px; border: 1px solid var(--line); border-radius: 14px; }
  .mm-panel.compact .mm-in { display: block; padding: 8px; max-width: none; }
}
.mm-feat { display: flex; flex-direction: column; gap: 8px; padding: 22px; border-radius: 14px; color: #eef0fb !important; text-decoration: none !important; background: radial-gradient(320px 200px at 100% 0%, rgba(86,100,230,.55), transparent 70%), radial-gradient(240px 160px at 0% 100%, rgba(240,140,62,.16), transparent 70%), var(--night); min-height: 210px; }
.mm-feat .mm-k { font: 600 11px Inter, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: #f6b27a; }
.mm-feat b { font: 600 19px/1.25 var(--display); letter-spacing: -0.02em; }
.mm-feat > span:not(.mm-k) { color: #b9bfdb; font-size: 13.5px; line-height: 1.55; }
.mm-feat i { font-style: normal; margin-top: auto; font-weight: 600; font-size: 13.5px; color: #c9cfff; }
.mm-feat:hover i { color: #fff; }
.mm-col h6 { margin: 4px 0 10px 10px; font: 600 11.5px Inter, sans-serif; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3); }
.mm-list { display: grid; gap: 2px; }
.mm-col.wide { grid-column: span 2; }
.mm-col.wide .mm-list { grid-template-columns: 1fr 1fr; column-gap: 8px; }
.mm-item { display: grid; gap: 2px; padding: 9px 10px; border-radius: 10px; text-decoration: none !important; }
.mm-item b { color: var(--ink); font-weight: 600; font-size: 14.5px; }
.mm-item span { color: var(--ink-3); font-size: 13px; line-height: 1.45; }
.mm-item:hover { background: var(--line-2); }
.mm-item:hover b { color: var(--brand-ink); }
.pop-wrap { position: relative; display: inline-flex; }
.pop-menu { position: absolute; right: 0; top: calc(100% + 10px); z-index: 60; min-width: 190px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 44px -18px rgba(14,19,48,.35); padding: 6px; animation: mm-in .14s ease-out; }
.theme-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); cursor: pointer; padding: 0; }
.theme-btn:hover { color: var(--ink); border-color: var(--axis); }
.theme-btn svg { width: 18px; height: 18px; }
.theme-menu button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; color: var(--ink-2); font: 500 14px Inter, sans-serif; padding: 8px 10px; border-radius: 8px; cursor: pointer; text-align: left; }
.theme-menu button svg { width: 17px; height: 17px; flex: none; }
.theme-menu button:hover { background: var(--line-2); color: var(--ink); }
.theme-menu button[aria-checked="true"] { color: var(--brand-ink); background: var(--brand-soft); }
.theme-menu button[aria-checked="true"]::after { content: ''; margin-left: auto; width: 8px; height: 4.5px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg) translateY(-2px); }
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; font: 600 13.5px var(--display); letter-spacing: .02em; color: #fff; background: radial-gradient(circle at 30% 25%, #6f7cf0, var(--brand) 55%, #2a2f86); box-shadow: 0 0 0 2px var(--card), 0 0 0 3.5px color-mix(in srgb, var(--accent) 70%, transparent); }
.avatar.lg { width: 42px; height: 42px; font-size: 15px; cursor: default; flex: none; }
.acct-menu { min-width: 260px; padding: 8px; }
.am-head { display: flex; gap: 12px; align-items: center; padding: 8px 8px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.am-head > div { display: grid; gap: 3px; min-width: 0; }
.am-head b { font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-plan { justify-self: start; font: 600 11.5px Inter, sans-serif; padding: 2px 8px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); }
.am-plan.pro { background: var(--brand-soft); color: var(--brand-ink); }
.am-plan.trial { background: var(--accent-soft); color: var(--accent-ink); }
.acct-menu a { display: block; padding: 9px 10px; border-radius: 8px; color: var(--ink-2); font-size: 14px; font-weight: 500; text-decoration: none !important; }
.acct-menu a:hover { background: var(--line-2); color: var(--ink); }
.acct-menu a.am-up { color: var(--accent-ink); }
.acct-menu a.am-out { border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; margin-top: 4px; padding-top: 11px; }
.nav-m-theme { display: none; }
.pro-chip { font-size: 13.5px; font-weight: 600; padding: 7px 13px; border-radius: 9px; border: 1px solid color-mix(in srgb, var(--brand) 55%, var(--line)); color: var(--brand-ink) !important; text-decoration: none !important; white-space: nowrap; }
.pro-chip:hover { border-color: var(--brand); }
.pro-chip.on { background: var(--brand-soft); border-color: transparent; }
.menu-btn { display: none; background: none; border: 0; width: 38px; height: 38px; cursor: pointer; padding: 10px 8px; }
.menu-btn span { display: block; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; transition: transform .18s; }
.top.open .menu-btn span:first-child { transform: translateY(3.5px) rotate(45deg); }
.top.open .menu-btn span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
@media (max-width: 1100px) { .mm-in, #mm-platform .mm-in { grid-template-columns: 230px repeat(3, minmax(0, 1fr)); gap: 18px; } #mm-platform .mm-col:last-child { display: none; } }
@media (max-width: 960px) {
  .top-in { padding: 0 16px; gap: 12px; }
  .nav { display: none; position: fixed; top: calc(60px + env(safe-area-inset-top, 0px)); left: 0; right: 0; bottom: 0; flex-direction: column; align-items: stretch; gap: 0; overflow-y: auto; background: var(--card); border-top: 1px solid var(--line); padding: 8px max(16px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
  .top.open { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--card); }
  .top.open .nav { display: flex; }
  .nav-top { width: 100%; justify-content: space-between; font-size: 16.5px; font-weight: 600; color: var(--ink); padding: 14px 6px; border-radius: 0; border-bottom: 1px solid var(--line-2); }
  .nav-top:hover, .nav-group.open > .nav-top, .nav-top.cur { background: none; }
  .mm-panel { position: static; border: 0; box-shadow: none; animation: none; background: none; }
  .mm-in { display: block; padding: 4px 0 12px; }
  .mm-feat { display: none; }
  .mm-col h6 { margin: 12px 6px 4px; }
  .mm-col.wide .mm-list { grid-template-columns: 1fr; }
  .mm-item { padding: 8px 6px; }
  .mm-item span { display: none; }
  .nav-m-theme { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 6px 4px; color: var(--ink-3); font-size: 14px; font-weight: 500; }
  .seg-t { display: flex; background: var(--line-2); border-radius: 10px; padding: 3px; gap: 2px; }
  .seg-t button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--ink-2); font: 500 13px Inter, sans-serif; padding: 7px 10px; border-radius: 8px; cursor: pointer; }
  .seg-t button svg { width: 15px; height: 15px; }
  .seg-t button[aria-checked="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.1); }
  .top .theme-wrap { display: none; }
  .nav-m-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
  .nav-m-acts .btn { justify-content: center; }
  .menu-btn { display: block; }
  .signin { display: none; }
  body:has(.top.open) { overflow: hidden; }
}
@media (max-width: 420px) { .top-r .open-studio { display: none; } }

/* footer */
.foot { border-top: 1px solid var(--line); margin-top: 80px; padding: 48px 0 calc(32px + env(safe-area-inset-bottom, 0px)); background: var(--card); }
.foot-in { max-width: 1240px; margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: 1.6fr 1fr 1.15fr 1fr 1fr; gap: 28px; }
.foot-in p { color: var(--ink-3); font-size: 14px; max-width: 300px; }
.foot h5 { margin: 4px 0 10px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.foot-in a:not(.logo) { display: block; color: var(--ink-2); font-size: 14px; padding: 3px 0; }
.foot-note { max-width: 1240px; margin: 28px auto 0; padding: 0 24px; color: var(--ink-3); font-size: 13px; }
@media (max-width: 760px) { .foot-in { grid-template-columns: 1fr 1fr; } }

/* tool page */
.tool-head { padding: 34px 0 22px; display: flex; gap: 20px; align-items: flex-end; flex-wrap: wrap; }
.tool-head .t { flex: 1; min-width: 260px; }
.tool-head h1 { font-size: clamp(26px, 3vw, 34px); }
.tool-head p { color: var(--ink-2); margin: 8px 0 0; max-width: 720px; }
.tool-head .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.app { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 20px; align-items: start; }
.app > * { min-width: 0; }
@media (max-width: 1000px) { .app { grid-template-columns: minmax(0, 1fr); } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.side { padding: 18px; position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow: auto; }
@media (max-width: 1000px) { .side { position: static; max-height: none; } }
.side h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 18px 0 8px; font-family: Inter, sans-serif; font-weight: 600; }
.side h2:first-child { margin-top: 0; }
.field { margin: 10px 0; }
.field > label, .lbl { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.field small, .hint { display: block; color: var(--ink-3); font-size: 12.5px; margin-top: 4px; line-height: 1.45; }
textarea, input[type=text], input[type=number], select { width: 100%; font: 13.5px/1.45 Inter, sans-serif; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; }
textarea { font-family: var(--mono); font-size: 12.5px; min-height: 180px; resize: vertical; white-space: pre; tab-size: 12; }
textarea.drag { border-color: var(--brand); background: var(--brand-soft); }
textarea:focus, input:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent); border-color: var(--brand); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row2 > * { min-width: 0; }
.seg { display: flex; background: var(--line-2); border-radius: 9px; padding: 3px; gap: 2px; }
.seg label { flex: 1; text-align: center; font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 6px 4px; border-radius: 7px; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--brand); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); margin: 8px 0; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.inline { display: flex; gap: 8px; align-items: center; }
.inline input { width: 90px; }
.examples { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.examples button { font: 500 12.5px Inter, sans-serif; border: 1px dashed var(--axis); background: none; color: var(--ink-2); border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.examples button:hover { border-style: solid; color: var(--ink); }
.ta-tools { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.linkbtn { background: none; border: 0; color: var(--brand-ink); font: 600 12.5px Inter, sans-serif; cursor: pointer; padding: 2px 0; }

.main { display: grid; gap: 20px; }
.main > * { min-width: 0; }
.chart-card { padding: 16px 16px 10px; }
.chart-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.chart-bar h3 { font-size: 16px; flex: 1; min-width: 160px; }
.chart-host { position: relative; }
.chart-host svg { display: block; width: 100%; height: auto; }
.chart-host .pt { cursor: pointer; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--card); font-size: 12.5px; padding: 6px 9px; border-radius: 7px; white-space: nowrap; z-index: 5; box-shadow: var(--shadow); }
.chart-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--ink-3); font-size: 12.5px; padding-top: 6px; }
.exp { display: flex; gap: 6px; flex-wrap: wrap; }
.lock { font-size: 10.5px; font-weight: 700; color: var(--brand-ink); background: var(--brand-soft); padding: 2px 6px; border-radius: 5px; letter-spacing: .02em; }

.res { padding: 18px; }
.res h3 { font-size: 16px; margin-bottom: 12px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.kpi .k { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.kpi .v { font: 700 22px/1.2 var(--display); margin-top: 3px; letter-spacing: -0.01em; }
.kpi .v small { font-size: 14px; color: var(--ink-2); font-weight: 600; }
.kpi .ci { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.kpi .sw { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.tbl-wrap { overflow-x: auto; }
table.t { border-collapse: collapse; width: 100%; font-size: 13.5px; font-variant-numeric: tabular-nums; }
table.t th { text-align: right; font-size: 12.5px; color: var(--ink-3); font-weight: 600; padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { text-align: right; padding: 7px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
table.t th:first-child, table.t td:first-child { text-align: left; }
table.t td.l, table.t th.l { text-align: left; }
table.t tr.dim td { color: var(--ink-3); }
.flag { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 5px; background: var(--warn-soft); color: var(--warn); }
.flag.bad { background: var(--bad-soft); color: var(--bad); }
.flag.ok { background: var(--ok-soft); color: var(--ok); }
.notes { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.notes li { font-size: 13.5px; padding: 8px 12px 8px 34px; border-radius: 9px; background: var(--warn-soft); color: var(--ink); position: relative; }
.notes li::before { content: '!'; position: absolute; left: 12px; top: 8px; width: 15px; height: 15px; border-radius: 50%; background: var(--warn); color: var(--card); font: 700 11px/15px Inter, sans-serif; text-align: center; }
.notes li.info { background: var(--line-2); }
.notes li.info::before { content: 'i'; background: var(--ink-3); }
.err { padding: 14px 16px; border-radius: 10px; background: var(--bad-soft); color: var(--bad); font-weight: 500; }
.empty { padding: 60px 20px; text-align: center; color: var(--ink-3); }
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -4px 0 14px; overflow-x: auto; }
.subtabs button { background: none; border: 0; border-bottom: 2px solid transparent; font: 600 13.5px Inter, sans-serif; color: var(--ink-3); padding: 8px 10px; cursor: pointer; white-space: nowrap; }
.subtabs button[aria-selected=true] { color: var(--ink); border-bottom-color: var(--brand); }

/* report */
.rep { padding: 18px; position: relative; overflow: hidden; }
.rep-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.rep-head h3 { font-size: 16px; flex: 1; }
.rep-actions { display: flex; gap: 6px; }
.rep-body section { margin-top: 12px; }
.rep-body h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 4px; font-family: Inter, sans-serif; }
.rep-body p { margin: 0 0 8px; font-family: 'Source Serif 4', Georgia, serif; font-size: 15.5px; line-height: 1.65; color: var(--ink); }
.rep-body.locked { filter: blur(5px); user-select: none; pointer-events: none; max-height: 230px; overflow: hidden; }
.rep-lock { position: absolute; inset: 56px 0 0 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; padding: 20px; background: linear-gradient(to bottom, color-mix(in srgb, var(--card) 40%, transparent), var(--card) 70%); }
.rep-lock p { margin: 0; max-width: 380px; color: var(--ink-2); }

/* modal */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(8,12,22,.5); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .15s; }
.modal-box { background: var(--card); border-radius: 16px; max-width: 560px; width: 100%; padding: 28px; position: relative; box-shadow: 0 30px 80px -20px rgba(0,0,0,.45); max-height: 92vh; overflow: auto; }
.modal-x { position: absolute; top: 10px; right: 12px; background: none; border: 0; font-size: 26px; line-height: 1; color: var(--ink-3); cursor: pointer; padding: 4px 8px; }
.m-kicker { margin: 0 0 6px; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--brand-ink); }
.modal-box h2 { font-size: 22px; margin-bottom: 12px; }
.m-list { padding: 0; list-style: none; margin: 0 0 18px; display: grid; gap: 8px; }
.m-list li { padding-left: 26px; position: relative; color: var(--ink-2); }
.m-list li::before { content: ''; position: absolute; left: 4px; top: 7px; width: 10px; height: 6px; border-left: 2px solid var(--brand); border-bottom: 2px solid var(--brand); transform: rotate(-45deg); }
.m-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.m-plans:empty { display: none; }
.plan-btn { border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; color: var(--ink) !important; text-decoration: none !important; }
.plan-btn:hover { border-color: var(--brand); }
.plan-btn.best { border-color: var(--brand); background: var(--brand-soft); }
.plan-btn span { font: 700 20px var(--display); }
.plan-btn small { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.m-note { color: var(--ink-3); font-size: 13.5px; }
.m-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
@keyframes fade { from { opacity: 0; } }

#bf-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); background: var(--ink); color: var(--card); padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: .2s; z-index: 200; max-width: calc(100% - 32px); }
#bf-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* method notes under tools */
.method { margin-top: 28px; padding: 24px; }
.method h2 { font-size: 18px; margin-bottom: 10px; }
.method p, .method li { color: var(--ink-2); font-size: 14.5px; }
.method code { font-family: var(--mono); font-size: 13px; background: var(--line-2); padding: 1px 5px; border-radius: 4px; }
.eq { font-family: 'Source Serif 4', Georgia, serif; font-size: 16px; background: var(--line-2); border-radius: 9px; padding: 10px 14px; overflow-x: auto; white-space: nowrap; color: var(--ink); }
.method .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.method .grid > * { min-width: 0; }

/* landing */
.hero { padding: 72px 0 40px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; align-items: center; }
@media (max-width: 960px) { .hero { grid-template-columns: minmax(0, 1fr); padding-top: 44px; } }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 600; color: var(--ink-2); border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 12px 5px 6px; }
.eyebrow b { background: var(--ok-soft); color: var(--ok); border-radius: 999px; padding: 2px 8px; font-size: 12px; }
.hero h1 { font-size: clamp(36px, 5.2vw, 60px); line-height: 1.04; letter-spacing: -0.03em; margin: 18px 0 18px; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero .lede { font-size: 18.5px; color: var(--ink-2); max-width: 560px; margin: 0 0 26px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .assure { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 22px; color: var(--ink-3); font-size: 13.5px; }
.hero .assure span::before { content: '✓'; color: var(--ok); font-weight: 700; margin-right: 6px; }
.demo { padding: 14px; }
.demo-top { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.demo-top i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.demo-top span { margin-left: 8px; font-size: 12.5px; color: var(--ink-3); font-family: var(--mono); }
.demo-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.demo-kpis div { border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; font-size: 12px; color: var(--ink-3); }
.demo-kpis b { display: block; color: var(--ink); font-size: 16px; font-family: var(--display); }
.section { padding-block: 64px 8px; }
.sec-head { max-width: 680px; margin-bottom: 30px; }
.sec-head h2 { font-size: clamp(26px, 3.2vw, 36px); letter-spacing: -0.025em; }
.sec-head p { color: var(--ink-2); font-size: 17px; margin: 10px 0 0; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.tool-card { padding: 22px; display: flex; flex-direction: column; gap: 10px; color: var(--ink) !important; text-decoration: none !important; transition: transform .15s, border-color .15s; }
.tool-card:hover { transform: translateY(-2px); border-color: var(--brand); }
.tool-card .ic { width: 44px; height: 44px; border-radius: 11px; background: var(--brand-soft); display: grid; place-items: center; }
.tool-card .ic svg { width: 26px; height: 26px; }
.tool-card h3 { font-size: 18px; }
.tool-card p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.tool-card ul { margin: 4px 0 0; padding-left: 18px; color: var(--ink-3); font-size: 13.5px; }
.tool-card .go { margin-top: auto; padding-top: 6px; color: var(--brand-ink); font-weight: 600; font-size: 14px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; counter-reset: s; }
.step { padding: 22px; }
.step::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--card); font-weight: 700; font-size: 14px; margin-bottom: 12px; }
.step h3 { font-size: 16.5px; margin-bottom: 6px; }
.step p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.why { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 28px 36px; }
.why h3 { font-size: 16.5px; margin-bottom: 6px; }
.why p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; align-items: stretch; }
.price { padding: 26px; display: flex; flex-direction: column; gap: 12px; }
.price.best { border: 2px solid var(--brand); }
.price h3 { font-size: 17px; display: flex; justify-content: space-between; align-items: center; }
.price h3 span { font-size: 11.5px; background: var(--brand); color: #fff; padding: 3px 8px; border-radius: 999px; font-family: Inter, sans-serif; letter-spacing: .02em; }
.price .amt { font: 700 38px/1 var(--display); letter-spacing: -0.03em; }
.price .amt small { font-size: 15px; color: var(--ink-3); font-weight: 500; letter-spacing: 0; }
.price .sub { color: var(--ink-3); font-size: 13.5px; margin: -6px 0 0; }
.price ul { list-style: none; padding: 0; margin: 4px 0 8px; display: grid; gap: 7px; font-size: 14.5px; color: var(--ink-2); }
.price li { padding-left: 24px; position: relative; }
.price li::before { content: ''; position: absolute; left: 3px; top: 7px; width: 10px; height: 6px; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg); }
.price .btn { margin-top: auto; justify-content: center; }
.faq { display: grid; gap: 10px; max-width: 860px; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: 14px 18px; }
.faq summary { font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: '+'; color: var(--ink-3); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.faq p { color: var(--ink-2); margin: 10px 0 2px; }
.band { margin-top: 64px; padding: 46px 48px; border-radius: 20px; background: radial-gradient(600px 260px at 100% 0%, rgba(86,100,230,.45), transparent 65%), radial-gradient(420px 220px at 0% 100%, rgba(240,140,62,.16), transparent 65%), var(--night); border: 1px solid rgba(255,255,255,.07); color: #eef0fb; display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.band h2 { font-size: clamp(24px, 3vw, 32px); letter-spacing: -0.025em; }
.band p { color: #b9bfdb; margin: 8px 0 0; }
.band .btn { background: var(--card); color: var(--ink); border: 0; }

/* plain pages */
.page { max-width: 760px; padding-block: 44px 20px; }
.page h1 { font-size: 34px; margin-bottom: 14px; }
.page h2 { font-size: 20px; margin: 30px 0 8px; }
.page p, .page li { color: var(--ink-2); }
.acct { padding: 26px; margin-top: 20px; }
.acct .row { display: flex; gap: 10px; flex-wrap: wrap; }
.acct .row input { flex: 1; min-width: 220px; font-family: var(--mono); }
.status { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--line-2); margin-bottom: 16px; font-size: 14.5px; }
.status.on { background: var(--ok-soft); color: var(--ok); }
@media (max-width: 560px) {
  .wrap { padding-inline: 16px; }
  .side, .res, .rep, .method, .chart-card { padding: 14px; }
  .band { padding: 28px; }
  .row2 { grid-template-columns: 1fr; }
}

@media (max-width: 860px) { .open-studio { display: none !important; } }

/* payment choice in the buy dialog */
.pay-opts { display: grid; gap: 10px; margin: 16px 0 12px; }
.pay-opt { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); text-align: left; cursor: pointer; font: inherit; color: var(--ink); }
.pay-opt:hover { border-color: var(--brand); background: var(--brand-soft); }
.pay-opt b { display: block; font-size: 15px; }
.pay-opt small { display: block; color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.pay-opt i { font-style: normal; font: 700 18px var(--display); color: var(--brand-ink); white-space: nowrap; }
.plan-btn { font: inherit; cursor: pointer; text-align: left; }

/* numbered three-step strip */
.how { list-style: none; counter-reset: how; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.how li { counter-increment: how; position: relative; padding: 4px 0 0 52px; display: grid; gap: 4px; align-content: start; }
.how li::before { content: counter(how); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font: 700 16px var(--display); color: #fff; background: var(--night); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); }
.how b { font: 600 16.5px var(--display); color: var(--ink); }
.how span { color: var(--ink-2); font-size: 14.5px; line-height: 1.55; }
@media (max-width: 900px) { .how { grid-template-columns: minmax(0, 1fr); } }

/* Lattent guide (help agent) */
.ag { position: fixed; right: max(18px, env(safe-area-inset-right, 0px)); bottom: max(18px, env(safe-area-inset-bottom, 0px)); z-index: 25; display: flex; flex-direction: column-reverse; align-items: flex-end; gap: 10px; }
.ag-fab { display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer; padding: 11px 16px 11px 13px; border-radius: 999px; font: 600 14px Inter, sans-serif; color: #fff; background: linear-gradient(135deg, var(--brand), #5a3fc6); box-shadow: 0 10px 28px -10px rgba(40,50,160,.7), 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent); }
.ag-fab svg { width: 20px; height: 20px; }
.ag-fab:hover { filter: brightness(1.08); }
.ag-fab:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.ag-panel { width: 380px; max-width: calc(100vw - 32px); max-height: min(560px, calc(100vh - 110px)); display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 26px 60px -24px rgba(14,19,48,.5); overflow: hidden; animation: mm-in .16s ease-out; }
.ag-panel header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; color: #fff; background: linear-gradient(135deg, var(--night), var(--night-2)); }
.ag-panel header div { display: grid; }
.ag-panel header small { color: #b9bfdb; font-size: 12px; }
.ag-x { border: 0; background: none; color: #c9cfff; font-size: 24px; line-height: 1; cursor: pointer; }
.ag-log { flex: 1; overflow-y: auto; padding: 14px; display: grid; gap: 8px; align-content: start; min-height: 120px; }
.ag-m { max-width: 92%; padding: 9px 12px; border-radius: 12px; font-size: 14px; line-height: 1.55; }
.ag-m p { margin: 0 0 6px; }
.ag-m.u { justify-self: end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.ag-m.a { justify-self: start; background: var(--line-2); color: var(--ink); border-bottom-left-radius: 4px; }
.ag-m.rel { background: none; padding: 0 2px; color: var(--ink-3); }
.ag-link { font-weight: 600; font-size: 13.5px; }
.ag-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.ag-chips button { border: 1px solid var(--line); background: var(--card); color: var(--ink-2); border-radius: 999px; padding: 5px 11px; font: 500 12.5px Inter, sans-serif; cursor: pointer; text-align: left; }
.ag-chips button:hover { border-color: var(--brand); color: var(--ink); }
.ag-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.ag-form input { flex: 1; min-width: 0; padding: 9px 11px; font-size: 14px; }
.ag-foot { margin: 0; padding: 0 14px 12px; font-size: 12px; color: var(--ink-3); }
@media (max-width: 560px) { .ag-fab span { display: none; } .ag-fab { padding: 13px; } .ag-panel { width: calc(100vw - 32px); } }
@media print { .ag { display: none; } }
/* Cite Lattent */
.cite-box { max-width: 640px; display: grid; gap: 14px; }
.cite-box h2 { margin: 0; }
.cite-box .m-sub { margin: -6px 0 0; color: var(--ink-2); font-size: 14.5px; }
.cite-blk { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cite-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px 7px 14px; background: var(--line-2); font-size: 13px; }
.cite-blk pre { margin: 0; padding: 12px 14px; font: 12.5px/1.55 var(--mono); color: var(--ink); overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.cite-apa { margin: 0; padding: 12px 14px; font-size: 14px; line-height: 1.55; color: var(--ink); }
.cite-more summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.cite-more ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.cite-box .hint { margin: 0; font-size: 13px; color: var(--ink-3); }
/* technical note (validation) */
.note { margin: 40px 0; padding-top: 8px; border-top: 1px solid var(--line); }
.note-meta { font: 500 12.5px var(--mono); color: var(--ink-3); margin: -4px 0 14px; }
.note-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.note-kpis div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 4px; min-width: 0; }
.note-kpis b { font: 700 24px/1.1 var(--display); letter-spacing: -0.02em; color: var(--ink); }
.note-kpis span { font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.note td.bad { color: var(--bad); font-weight: 600; }
.note th.grp { text-align: center; border-bottom: 1px solid var(--line); }
.note-all { margin: 16px 0; }
.note-all summary { cursor: pointer; font-weight: 600; }
.note-cite { margin-top: 14px; }
@media (max-width: 820px) { .note-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .note-kpis b { font-size: 20px; } }
