/* UnitEcon in the OPYEB studio skin. The app keeps its own layout and ids;
   this layer retunes its palette, typography and surfaces. */

html[data-theme], html[data-theme="dark"], html[data-theme="light"] {
  --canvas: var(--s-bg);
  --surface: var(--s-panel);
  --line: var(--s-line);
  --ink: var(--s-ink);
  --ink-muted: var(--s-muted);
  --ink-faint: var(--s-muted2);
  --primary: var(--s-accent);
  --primary-tint: var(--s-accent-dim);
  --on-primary: var(--s-on-accent);
  --accent: var(--s-accent);
  --ok: var(--s-ok);
  --warn: var(--s-warn);
  --danger: var(--s-danger);
  --ok-tint: rgba(127, 211, 155, .13);
  --warn-tint: rgba(229, 180, 92, .13);
  --danger-tint: rgba(255, 139, 122, .13);
}
html[data-theme="dark"] { --primary-strong: #f0c877; }
html[data-theme="light"] {
  --primary-strong: #7d5510;
  --ok-tint: rgba(31, 107, 61, .10);
  --warn-tint: rgba(138, 83, 0, .10);
  --danger-tint: rgba(163, 40, 27, .10);
}

body { background-color: var(--s-bg); color: var(--s-ink); }
a { color: var(--s-accent); }

.wrap { max-width: 1180px; }

/* hero */
.hero { padding: 34px 0 18px; }
.hero h1 {
  font-family: var(--serif); font-weight: 400; letter-spacing: -.02em;
  font-size: clamp(30px, 6.4vw, 50px); line-height: 1.08; color: var(--s-ink);
  text-wrap: balance;
}
.sub { color: var(--s-muted); font-size: clamp(14px, 3.6vw, 16px); line-height: 1.65; max-width: 68ch; }

.presets { gap: 8px; margin: 18px 0 6px; }
.preset-btn {
  background: var(--s-panel); border: 1px solid var(--s-line); color: var(--s-muted);
  border-radius: 999px; font-family: var(--mono); font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; padding: 8px 13px; transition: color .18s, border-color .18s, background .18s;
}
.preset-btn:hover { border-color: var(--s-line2); color: var(--s-ink); background: var(--s-panel2); }
.preset-btn.active {
  border-color: rgba(229,180,92,.5); background: var(--s-accent-dim); color: var(--s-accent);
}
html[data-theme="light"] .preset-btn.active { border-color: rgba(154,107,18,.5); }

/* panels */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0) 46%), var(--s-panel);
  border: 1px solid var(--s-line); border-radius: var(--radius);
  padding: 22px 20px;
}
html[data-theme="light"] .card { background: var(--s-panel); }
.card h2 {
  font-family: var(--display); font-size: 11.5px; font-weight: 700; letter-spacing: .2em;
  text-transform: uppercase; color: var(--s-muted); margin: 0 0 16px;
}

/* inputs */
.field { margin-bottom: 14px; }
.field label, .field label span {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--s-muted2); margin-bottom: 6px;
}
.field input {
  background: var(--s-bg2); border: 1px solid var(--s-line); border-radius: var(--radius-sm);
  color: var(--s-ink); padding: 10px 12px; font-size: 15px;
  font-family: var(--mono); transition: border-color .18s, box-shadow .18s;
}
.field input:focus {
  outline: none; border-color: rgba(229,180,92,.55); box-shadow: 0 0 0 3px var(--s-accent-dim);
}
html[data-theme="light"] .field input:focus { border-color: rgba(154,107,18,.55); }

/* buttons */
.btn-primary {
  background: var(--s-accent); color: var(--s-on-accent); border: 1px solid var(--s-accent);
  border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 700; letter-spacing: .02em;
  padding: 10px 15px; min-height: 40px;
}
.btn-primary:hover { background: var(--s-accent); filter: brightness(1.06); }
.btn-ghost {
  background: transparent; border: 1px solid var(--s-line); color: var(--s-ink);
  border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 600;
  padding: 10px 14px; min-height: 40px;
}
.btn-ghost:hover { border-color: var(--s-line2); background: var(--s-panel2); }
.actions { gap: 8px; margin-top: 16px; }
#baselineNote { color: var(--s-muted2) !important; font-family: var(--mono); font-size: 11.5px !important; }

/* KPI tiles */
.kpis { gap: 10px; }
.kpi {
  background: var(--s-panel); border: 1px solid var(--s-line); border-radius: var(--radius);
  padding: 16px 15px; position: relative; overflow: hidden;
}
.kpi::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(90% 70% at 88% -20%, rgba(229,180,92,.10), transparent 62%);
}
.kpi .lbl {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em; font-weight: 600;
  color: var(--s-muted2); text-transform: uppercase;
}
.kpi .val {
  font-family: var(--display); font-size: 25px; font-weight: 700; letter-spacing: -.03em;
  color: var(--s-ink); margin: 6px 0 3px; font-variant-numeric: tabular-nums;
}
.kpi .hint { font-size: 11.5px; color: var(--s-muted); line-height: 1.45; }
.badge { font-family: var(--mono); font-size: 10px; letter-spacing: .04em; padding: 3px 8px; border-radius: 5px; }
.b-ok { background: var(--ok-tint); color: var(--s-ok); }
.b-warn { background: var(--warn-tint); color: var(--s-warn); }
.b-danger { background: var(--danger-tint); color: var(--s-danger); }

/* chart + table */
#breakEvenLabel { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: var(--s-accent); }
.tbl-wrap { border: 1px solid var(--s-line); border-radius: var(--radius-sm); max-height: 300px; }
table th {
  background: var(--s-bg2); color: var(--s-muted2); font-family: var(--mono);
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600;
}
table td { border-bottom: 1px solid var(--s-line); color: var(--s-ink); }
table td:first-child { color: var(--s-muted); font-family: var(--mono); font-size: 12px; }

/* info cards, ad slot, footer */
.info-grid .card p, .info-grid .card li { color: var(--s-muted); font-size: 13.5px; }
.info-grid .card strong { color: var(--s-ink); }
.info-grid .card code {
  background: var(--s-bg2); border: 1px solid var(--s-line); color: var(--s-accent);
  border-radius: 5px; padding: .08em .35em; font-size: .88em;
}
.info-grid .card h2 { margin-bottom: 10px; }
.ad-slot .lbl {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--s-muted2) !important;
}
footer {
  border-top: 1px solid var(--s-line); color: var(--s-muted2); font-size: 12px;
  margin: 44px 0 30px; padding-top: 20px;
}
footer a { color: var(--s-muted); text-decoration: none; border-bottom: 1px solid transparent; }
footer a:hover { color: var(--s-ink); border-bottom-color: var(--s-line2); }
.toast {
  background: var(--s-panel2); color: var(--s-ink); border: 1px solid rgba(229,180,92,.4);
  border-radius: var(--radius-sm); font-size: 12.5px; box-shadow: 0 14px 40px -18px rgba(0,0,0,.8);
}

/* document pages (privacy, terms, contact) */
main.wrap { padding-top: 30px; padding-bottom: 20px; }
main.wrap h1 {
  font-family: var(--serif); font-weight: 400; letter-spacing: -.02em;
  font-size: clamp(23px, 4.4vw, 32px); line-height: 1.2; color: var(--s-ink);
  margin: 0 0 12px;
}
main.wrap h2 { font-size: 16px; font-weight: 700; color: var(--s-ink); margin: 26px 0 8px; }
main.wrap p, main.wrap li { color: var(--s-muted); font-size: 14.5px; line-height: 1.7; }
main.wrap a { color: var(--s-accent); }
main.wrap strong { color: var(--s-ink); }
main.wrap code {
  background: var(--s-bg2); border: 1px solid var(--s-line); color: var(--s-accent);
  border-radius: 5px; padding: .08em .35em; font-size: .88em;
}
main.wrap .card { padding: 26px 22px; }
main.wrap footer { border-top: 1px solid var(--s-line); }

/* keep grid items from pushing the page wider than the screen */
.grid, .grid > *, .kpis, .kpi, .info-grid, .info-grid > * { min-width: 0; }
.tbl-wrap, .chart-box, #cohortChart { max-width: 100%; }
.tbl-wrap table { width: 100%; }
@media (max-width: 560px) {
  table th, table td { padding: 7px 6px; font-size: 12px; }
}

/* light mode: controls must not stay obsidian */
html[data-theme="light"] input, html[data-theme="light"] select, html[data-theme="light"] textarea,
html[data-theme="light"] .mono-input, html[data-theme="light"] .tc, html[data-theme="light"] .cue-text,
html[data-theme="light"] .formula, html[data-theme="light"] pre, html[data-theme="light"] code {
  background: var(--s-bg2) !important; color: var(--s-ink) !important; border-color: var(--s-line) !important;
}
html[data-theme="light"] .formula, html[data-theme="light"] pre { color: var(--s-muted) !important; }

/* ---- OPYEB official brand symbol (site-wide logo package) ---- */
.brand-mark{display:inline-block;width:28px;height:28px;min-width:0;padding:0!important;border:0!important;border-radius:0;background:transparent!important;box-shadow:none!important;flex:none;line-height:0;overflow:visible}
.brand-mark .brand-sym{display:block;width:100%;height:100%;object-fit:contain}
.brand-mark .brand-sym-light{display:none}
html[data-resolved="light"] .brand-mark .brand-sym-dark{display:none}
html[data-resolved="light"] .brand-mark .brand-sym-light{display:block}
html[data-resolved="dark"] .brand-mark .brand-sym-light{display:none}
html[data-resolved="dark"] .brand-mark .brand-sym-dark{display:block}
html[data-theme="light"] .brand-mark .brand-sym-dark{display:none}
html[data-theme="light"] .brand-mark .brand-sym-light{display:block}
html[data-theme="dark"] .brand-mark .brand-sym-light{display:none}
html[data-theme="dark"] .brand-mark .brand-sym-dark{display:block}
.topbar .tb-brand .brand-mark{width:28px;height:28px;min-width:0;padding:0!important;border:0!important;background:transparent!important;display:inline-block}
@media (prefers-color-scheme: light){html:not([data-theme="dark"]):not([data-resolved="dark"]) .brand-mark .brand-sym-dark{display:none}html:not([data-theme="dark"]):not([data-resolved="dark"]) .brand-mark .brand-sym-light{display:block}}
@media (max-width:639px){.topbar .tb-brand .brand-mark{width:26px;height:26px}}
