:root {
  color-scheme: light;
  --paper: #f4f8fa;
  --surface: #fff;
  --soft: #edf5f8;
  --wash: #e0edf4;
  --select: #d0e7f2;
  --stroke: #cbdde6;
  --ink: #122d43;
  --muted: #506b80;
  --accent: #155e7d;
  --on-accent: #fff;
  --mint: #157256;
  --rose: #a34b59;
  --gold: #97672a;
  --scene: url("assets/scene-lagoon.png");
  --shadow: 0 9px 30px #244c640a;
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
}
[data-theme=dark] {
  color-scheme: dark;
  --paper: #101820;
  --surface: #182530;
  --soft: #1e303d;
  --wash: #223645;
  --select: #294d5c;
  --stroke: #334b5b;
  --ink: #edf6f9;
  --muted: #b0c3ce;
  --accent: #92d5ec;
  --on-accent: #122e3d;
  --mint: #9bd6c2;
  --rose: #edacb2;
  --gold: #e9c18c;
  --scene: url("assets/scene-midnight.png");
  --shadow: 0 9px 30px #0002;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: progress; opacity: .65; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
::selection { background: var(--select); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
svg { display: block; width: 21px; height: 21px; }
input, select, textarea {
  min-width: 0; padding: 11px 13px; min-height: 44px;
  background: var(--surface); border: 1px solid var(--stroke); border-radius: 9px;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
label:has(> input), label:has(> select), label:has(> textarea) { display: grid; gap: 7px; font-size: .9rem; font-weight: 600; }
.primary, .secondary {
  min-height: 41px; border: 1px solid var(--accent); border-radius: 9px;
  background: var(--accent); color: var(--on-accent); padding: 9px 14px; font-weight: 650; font-size: .9rem;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.secondary { background: var(--surface); color: var(--ink); border-color: var(--stroke); }
.primary:hover { filter: brightness(1.13); }
.secondary:hover, .icon-button:hover, .avatar:hover { background: var(--select); border-color: var(--accent); }
.primary svg, .secondary svg { width: 17px; height: 17px; }
.wordmark { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; flex: none; }
.wordmark img { display: block; width: 151px; height: auto; }
.wordmark .logo-dark, [data-theme=dark] .wordmark .logo-light { display: none; }
[data-theme=dark] .wordmark .logo-dark { display: block; }
.plan {
  font-size: .73rem; letter-spacing: .08em; border-radius: 6px;
  color: var(--accent); padding: 4px 7px; border: 1px solid var(--stroke); background: var(--soft);
}
.topbar { border-bottom: 1px solid var(--stroke); background: var(--surface); }
.topbar-inner {
  max-width: 1390px; padding: 0 44px; height: 74px; margin: auto;
  display: grid; grid-template-columns: 1fr minmax(260px, 416px) 1fr; align-items: center;
}
.global-search {
  display: flex; gap: 9px; align-items: center; padding: 0 11px 0 12px;
  background: var(--soft); border: 1px solid var(--stroke); border-radius: 9px; color: var(--muted);
}
.global-search svg { width: 17px; height: 17px; }
.global-search input { width: 100%; flex: 1 1 0; font-size: .86rem; background: transparent; border: 0; padding: 7px 0; min-height: 39px; }
.global-search input::-webkit-calendar-picker-indicator { opacity: 0; }
kbd { padding: 3px 6px; font-family: inherit; font-size: .75rem; border: 1px solid var(--stroke); border-radius: 5px; white-space: nowrap; }
.top-actions { display: flex; gap: 9px; justify-content: end; }
.icon-button, .avatar {
  display: grid; place-items: center; width: 38px; height: 38px; padding: 0; text-decoration: none;
  background: var(--surface); border: 1px solid var(--stroke); border-radius: 10px; color: var(--accent);
}
.icon-button svg { width: 18px; height: 18px; }
.avatar { background: var(--wash); border-radius: 50%; font-weight: 750; }
.shell { width: min(calc(100% - 88px), 1302px); margin: 35px auto 120px; outline: none; }
.heading { display: flex; justify-content: space-between; align-items: end; gap: 14px; margin-bottom: 22px; }
.heading h1 { font-size: clamp(1.75rem, 3.6vw, 2.45rem); line-height: 1.15; letter-spacing: -.045em; font-weight: 730; }
.heading p { color: var(--muted); margin-top: 6px; font-size: .93rem; }
.mode { border: 1px solid var(--stroke); border-radius: 7px; padding: 5px 9px; font-size: .78rem; color: var(--muted); white-space: nowrap; }
.surface { background: var(--surface); border: 1px solid var(--stroke); border-radius: 14px; box-shadow: var(--shadow); }
.product-banner {
  position: relative; isolation: isolate; overflow: hidden; min-height: 106px;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: 17px; padding: 15px 20px; margin-bottom: 18px; border-radius: 14px;
  border: 1px solid var(--stroke); background: var(--wash);
}
.product-banner::before {
  content: ""; position: absolute; z-index: -1; inset: 0;
  background: linear-gradient(90deg, var(--wash) 28%, transparent 115%), var(--scene) center 42%/cover;
  opacity: .54;
}
.product-banner h2 { margin: 3px 0; font-size: clamp(1.12rem, 2vw, 1.45rem); letter-spacing: -.025em; }
.product-banner small { color: var(--muted); font-size: .82rem; }
.product-image {
  display: grid; place-items: center; width: 73px; height: 73px; border-radius: 11px;
  background: var(--soft); color: var(--accent); border: 1px solid var(--stroke); overflow: hidden;
}
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.product-image svg { width: 28px; height: 28px; }
.period-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 17px; }
.segmented { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--stroke); border-radius: 10px; background: var(--soft); }
.segmented button {
  padding: 6px 12px; min-height: 33px; font-size: .84rem; font-weight: 625;
  border-radius: 6px; border: 1px solid transparent; background: transparent; color: var(--muted); white-space: nowrap;
}
.segmented button:hover { background: var(--wash); color: var(--ink); }
.segmented button[aria-pressed=true] { color: var(--ink); background: var(--surface); border-color: var(--stroke); box-shadow: 0 2px 4px #102c4010; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 17px; }
.metric {
  position: relative; display: grid; grid-template-rows: auto auto auto; gap: 7px; text-align: left;
  min-height: 109px; padding: 14px 16px; color: var(--ink); transition: background .17s, border-color .17s, translate .17s;
}
.metric:hover { border-color: var(--accent); translate: 0 -2px; }
.metric[aria-pressed=true] { background: var(--soft); border-color: var(--accent); }
.metric .metric-title { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; }
.metric svg { width: 17px; height: 17px; color: var(--accent); }
.metric-value { font-size: clamp(1.35rem, 2.7vw, 1.95rem); font-weight: 735; line-height: 1.1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.metric small, .subtle { color: var(--muted); font-size: .82rem; }
.positive { color: var(--mint) !important; }
.negative { color: var(--rose) !important; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 2.08fr) minmax(275px, 1fr); gap: 16px; align-items: start; }
.graph, .side, .section-card { padding: 18px 19px; min-width: 0; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 15px; }
.card-top h2, .section-card h2 { font-size: 1.07rem; letter-spacing: -.02em; }
.graph-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 9px; }
.graph-meta b { font-size: 1.24rem; letter-spacing: -.025em; }
.graph:fullscreen { display: grid; align-content: center; padding: 5vw; background: var(--surface); }
.graph:fullscreen canvas { height: 65vh; }
.canvas-frame { position: relative; width: 100%; margin-top: 5px; }
canvas { width: 100%; height: clamp(220px, 23vw, 285px); display: block; touch-action: pan-y; }
.graph-tip {
  position: absolute; top: 9px; left: 0; pointer-events: none; z-index: 2;
  background: var(--surface); border: 1px solid var(--stroke); box-shadow: var(--shadow);
  padding: 7px 9px; border-radius: 7px; color: var(--ink); font-size: .81rem; white-space: nowrap;
}
.events { display: grid; }
.event { display: grid; grid-template-columns: 35px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 13px 0; border-top: 1px solid var(--stroke); }
.event b { font-size: .9rem; }
.event small { display: block; margin-top: 2px; color: var(--muted); font-size: .79rem; }
.event > span:last-child { color: var(--accent); font-size: .86rem; font-weight: 650; }
.event-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--soft); color: var(--accent); }
.event-icon svg { width: 17px; height: 17px; }
.event-icon:has([data-kind=box]) { color: var(--gold); }
.spotlight { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--stroke); margin-top: 6px; padding-top: 16px; }
.spotlight strong { display: block; font-size: 1.2rem; margin-top: 2px; }
.dock {
  position: fixed; z-index: 3; inset: auto auto 19px 50%; transform: translateX(-50%);
  max-width: calc(100% - 20px); display: flex; align-items: end; gap: 5px; padding: 7px;
  background: color-mix(in srgb, var(--surface), transparent 6%); border: 1px solid var(--stroke);
  border-radius: 17px; box-shadow: 0 10px 35px #17374a23, 0 1px 2px #17374a14; backdrop-filter: blur(15px);
}
.dock a {
  display: grid; align-content: center; justify-items: center; gap: 4px; position: relative;
  width: clamp(58px, 7.7vw, 95px); min-height: 53px; padding: 5px 3px; border-radius: 11px;
  color: var(--muted); text-decoration: none;
}
.dock a[aria-current=page] { color: var(--accent); background: var(--select); }
.dock a:hover { background: var(--wash); color: var(--ink); }
.dock a span { transform: translateY(calc(-4px * var(--lift, 0))) scale(calc(1 + .24 * var(--lift, 0))); transition: transform .17s cubic-bezier(.2,.75,.3,1.2); }
.dock a small { font-size: .73rem; white-space: nowrap; }
.dock a svg { width: 20px; height: 20px; }
.loading, .empty { padding: 22px 0; color: var(--muted); }
.table-wrap { overflow: auto; }
table { border-collapse: collapse; width: 100%; min-width: 620px; text-align: left; }
th, td { padding: 12px; border-bottom: 1px solid var(--stroke); }
th { font-size: .8rem; color: var(--muted); }
td { font-size: .92rem; }
td a { color: var(--accent); text-underline-offset: 4px; font-weight: 650; }
td > small { display: block; margin-top: 3px; color: var(--muted); }
.stack { display: grid; gap: 15px; }
.vertical-form { display: grid; gap: 13px; max-width: 570px; }
.vertical-form button { justify-self: start; }
.form-line { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.form-line label { flex: 1 1 185px; }
.query-list { display: grid; margin-top: 11px; }
.query-row, .switch-row { min-height: 63px; display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--stroke); }
.query-row:last-child, .switch-row:last-child { border-bottom: 0; }
.query-row small { display: block; margin-top: 4px; color: var(--muted); }
.switch-row label { display: flex; align-items: center; gap: 10px; }
input[type=checkbox] { width: 19px; min-height: 19px; accent-color: var(--accent); }
.result { padding: 13px 15px; background: var(--soft); border: 1px solid var(--stroke); border-radius: 9px; }
.form-message { color: var(--rose); min-height: 1.3em; font-size: .89rem; }
.toast {
  position: fixed; z-index: 4; bottom: 102px; right: 20px; max-width: calc(100% - 40px);
  padding: 11px 15px; color: var(--ink); background: var(--surface); border: 1px solid var(--stroke);
  border-radius: 10px; box-shadow: var(--shadow); font-size: .9rem;
}
.enter { animation: arrive .24s ease-out both; }
@keyframes arrive { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.login-page { display: grid; place-items: center; padding: 24px; }
.login-shell {
  width: min(100%, 830px); min-height: 452px; display: grid; grid-template-columns: 1fr 1.2fr;
  border: 1px solid var(--stroke); border-radius: 20px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow);
}
.login-art { display: grid; place-items: center; background: var(--scene) center/cover; }
.login-art img { width: min(46%, 168px); filter: drop-shadow(0 16px 22px #19405725); }
.login-card { padding: 44px 46px; }
.login-card h1 { margin: 25px 0 19px; font-size: 2rem; letter-spacing: -.04em; }
.login-card form { display: grid; gap: 13px; }
.login-card .primary { align-self: start; }
.login-card > .secondary { margin-top: 14px; }
.launch-page {
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr;
  background: linear-gradient(145deg, #f4f8fa 17%, #f4f8fadc 50%, #e4eff0a8 100%), var(--scene) center / cover;
}
.launch-header {
  display: flex;
  justify-content: flex-end;
  padding: clamp(16px, 3vw, 42px);
}
.launch-header .secondary { min-width: 94px; }
.launch-content {
  align-self: center;
  justify-self: center;
  width: min(100%, 740px);
  padding: 18px 26px clamp(64px, 14vh, 150px);
  text-align: center;
}
.launch-content img { display: block; width: 100%; height: auto; margin-inline: auto; }
.launch-content h1 {
  margin: clamp(18px, 4vw, 32px) 0 0;
  font-size: clamp(1.3rem, 3.4vw, 2.45rem);
  line-height: 1.2;
  letter-spacing: -.04em;
}
.market-home { --home-width: 1190px; }
.home-wrap { width: min(calc(100% - 72px), var(--home-width)); margin-inline: auto; }
.home-top { border-bottom: 1px solid var(--stroke); background: var(--surface); }
.home-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; min-height: 72px; align-items: center; }
.home-nav nav, .home-nav-actions { display: flex; align-items: center; gap: 16px; }
.home-nav nav { gap: 25px; }
.home-nav nav a, .home-footer > a:last-child { text-decoration: none; color: var(--muted); font-size: .91rem; font-weight: 580; }
.home-nav nav a:hover, .home-footer > a:last-child:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 5px; }
.home-nav-actions { justify-content: end; gap: 9px; }
.home-hero {
  padding: 54px 0 55px;
  background: linear-gradient(180deg, var(--paper), var(--soft));
  border-bottom: 1px solid var(--stroke);
}
.home-intro { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 30px; }
.home-intro h1 { font-size: clamp(3rem, 7.3vw, 6.35rem); line-height: .95; letter-spacing: -.075em; font-weight: 720; }
.home-intro p { max-width: 540px; margin-top: 19px; color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.18rem); line-height: 1.52; }
.home-intro-action { padding-bottom: 4px; }
.home-intro-action a { min-height: 47px; padding-inline: 16px; }
.home-demo {
  scroll-margin-top: 15px; border: 1px solid var(--stroke); border-radius: 24px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--wash), transparent 22%), transparent), var(--scene) center/cover;
  padding: clamp(12px, 2.9vw, 35px);
}
.demo-frame {
  border: 1px solid var(--stroke); border-radius: 16px; overflow: hidden;
  background: var(--soft); box-shadow: 0 14px 55px #163f5331;
}
.demo-chrome { display: flex; justify-content: space-between; align-items: center; gap: 11px; min-height: 49px; padding: 7px 18px; border-bottom: 1px solid var(--stroke); background: var(--surface); }
.demo-brand { display: flex; align-items: center; gap: 8px; font-weight: 690; font-size: .9rem; }
.demo-brand img { display: block; width: 26px; height: 26px; }
.demo-label, .demo-period { color: var(--muted); font-size: .78rem; }
.home-demo-body { padding: 17px 18px 18px; }
.demo-product { display: flex; align-items: center; gap: 13px; margin-bottom: 16px; }
.demo-product h2 { font-size: clamp(1.13rem, 2vw, 1.45rem); letter-spacing: -.024em; }
.demo-product .subtle { margin-bottom: 4px; }
.demo-photo { width: 60px; height: 60px; object-fit: cover; background: var(--wash); border: 1px solid var(--stroke); border-radius: 10px; }
.demo-period { margin-left: auto; white-space: nowrap; border: 1px solid var(--stroke); border-radius: 8px; padding: 6px 9px; }
.home-dock {
  width: fit-content; max-width: 100%; display: flex; align-items: end; gap: 5px;
  padding: 5px; margin: 0 0 13px; border: 1px solid var(--stroke); border-radius: 12px;
  background: var(--surface); box-shadow: var(--shadow);
}
.home-dock button {
  min-width: 88px; padding: 8px 12px; display: flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: .85rem;
}
.home-dock button[aria-pressed=true] { background: var(--select); color: var(--accent); }
.home-dock button:hover { background: var(--wash); color: var(--ink); }
.home-dock button svg { width: 17px; height: 17px; }
.home-dock button span { transition: transform .22s cubic-bezier(.18,.66,.4,1.24); transform: translateY(calc(-3px * var(--lift, 0))) scale(calc(1 + .23 * var(--lift, 0))); }
.demo-details { display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(200px, 1fr); gap: 10px; }
.demo-chart-pane, .demo-aside { background: var(--surface); border: 1px solid var(--stroke); border-radius: 11px; }
.demo-chart-pane { padding: 14px 14px 6px; }
.demo-chart-heading { display: flex; gap: 10px; justify-content: space-between; align-items: start; }
.demo-chart-heading p { margin-bottom: 3px; font-size: .86rem; color: var(--muted); }
.demo-chart-heading strong { font-size: 1.71rem; letter-spacing: -.04em; }
.demo-chart-heading > span { color: var(--accent); font-size: .81rem; margin-top: 5px; }
.demo-chart-pane canvas { height: clamp(170px, 19vw, 245px); }
.demo-aside { padding: 0 14px; display: grid; grid-template-rows: repeat(4, 1fr); }
.demo-aside > div { padding: 10px 0; display: grid; align-content: center; gap: 2px; }
.demo-aside > div + div { border-top: 1px solid var(--stroke); }
.demo-aside span, .demo-aside small { font-size: .78rem; color: var(--muted); }
.demo-aside strong { font-size: 1.16rem; letter-spacing: -.022em; }
.home-features { padding: 47px 0 52px; }
.home-features h2 { font-size: clamp(1.65rem, 3.4vw, 2.7rem); letter-spacing: -.042em; margin-bottom: 18px; }
.home-feature { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(0, 1.4fr); align-items: baseline; gap: 18px; padding: 17px 0; border-top: 1px solid var(--stroke); }
.home-feature h3 { font-size: 1.04rem; letter-spacing: -.02em; }
.home-feature p { color: var(--muted); line-height: 1.5; }
.home-footer { min-height: 81px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--stroke); gap: 15px; }
@media (max-width: 690px) {
  .home-wrap { width: calc(100% - 28px); }
  .home-nav { grid-template-columns: 1fr auto; min-height: 62px; gap: 8px; }
  .home-nav nav { display: none; }
  .home-nav .wordmark img { width: 133px; }
  .home-nav-actions .primary { padding: 6px 9px; }
  .home-hero { padding-top: 33px; padding-bottom: 31px; }
  .home-intro { display: grid; justify-content: start; margin-bottom: 17px; }
  .home-intro p { margin-top: 13px; }
  .demo-details { grid-template-columns: minmax(0,1fr); }
  .demo-aside { grid-template-rows: auto; grid-template-columns: 1fr 1fr; column-gap: 11px; }
  .demo-aside > div:nth-child(2) { border-top: 0; }
  .home-demo-body { padding: 11px; }
  .demo-chrome { padding-inline: 11px; }
  .demo-product { gap: 8px; }
  .demo-photo { width: 42px; height: 42px; }
  .home-dock { width: 100%; }
  .home-dock button { flex: 1; min-width: 0; flex-direction: column; gap: 4px; padding: 6px 1px; font-size: .74rem; }
  .home-feature { grid-template-columns: 1fr; gap: 6px; }
}
@media (max-width: 900px) {
  .topbar-inner { padding: 0 22px; grid-template-columns: 1fr minmax(220px, 1.3fr) auto; gap: 12px; }
  .shell { width: calc(100% - 44px); }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr) minmax(240px, .65fr); }
  .dock a { width: clamp(44px, 8.6vw, 72px); }
  .dock a small { font-size: .66rem; }
}
@media (max-width: 680px) {
  .topbar-inner { height: auto; padding: 11px 14px; grid-template-columns: 1fr auto; gap: 10px; }
  .global-search { grid-row: 2; grid-column: 1/-1; }
  .global-search kbd { display: none; }
  .shell { width: calc(100% - 28px); margin-top: 23px; }
  .heading { flex-wrap: wrap; align-items: start; margin-bottom: 15px; }
  .product-banner { padding: 12px; gap: 10px; }
  .product-banner .secondary { grid-column: 1/-1; justify-self: start; }
  .product-image { width: 53px; height: 53px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric { padding: 11px 12px; min-height: 94px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .graph, .side, .section-card { padding: 13px; }
  .dock { bottom: max(9px, env(safe-area-inset-bottom)); justify-content: start; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
  .dock a { flex: 0 0 47px; min-height: 43px; }
  .dock a small { display: none; }
  .login-shell { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-card { padding: 25px; }
}
@media (max-width: 375px) { .segmented button { padding-inline: 7px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
  .dock a span { transform: none; }
}
