/* GravityFog — paper and olive. Values from apps/gm-mesh-console. Paper is the
   default; the previous navy is kept as an opt-in dark theme. apply_theme()
   always writes data-theme, so light is defined on both selectors. */
:root,
:root[data-theme="light"] {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
  --bg: #f8f7f1;
  --bg-soft: #f2f0e6;
  --panel: #ffffff;
  --panel-strong: #fbfaf4;
  --panel-glass: rgba(255, 255, 255, .86);
  --text: #1b2018;
  --muted: #6a7156;
  --line: #e6e5d8;
  --line-strong: #d5d3c2;
  --accent: #4f6b2c;
  --accent-strong: #3f5722;
  --accent-soft: rgba(79, 107, 44, .10);
  --violet: #5e4419;
  --good: #4f7a35;
  --good-soft: rgba(79, 122, 53, .12);
  --warning: #c26840;
  --bad: #a33a2a;
  --shadow: 0 18px 50px rgba(27, 32, 24, .13);
  --radius: 22px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #16150f;
  --bg-soft: #1c1b13;
  --panel: #1e1d16;
  --panel-strong: #26251c;
  --panel-glass: rgba(30, 29, 22, .86);
  --text: #f3f1ea;
  --muted: #a5a091;
  --line: #33312a;
  --line-strong: #4a473c;
  --accent: #9dc46b;
  --accent-strong: #b4d886;
  --accent-soft: rgba(157, 196, 107, .14);
  --violet: #c9a97a;
  --good: #7bbf4f;
  --good-soft: rgba(123, 191, 79, .14);
  --warning: #e0a33a;
  --bad: #e06a5f;
  --shadow: 0 24px 70px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 85% -10%, rgba(79, 107, 44, .05), transparent 31rem),
    radial-gradient(circle at 6% 34%, rgba(94, 68, 25, .035), transparent 28rem),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.brand-mark {
  position: relative;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--accent), var(--violet));
  box-shadow: 0 10px 22px rgba(79, 107, 44, .22);
  overflow: hidden;
}
.brand-mark span { position: absolute; display: block; border-radius: 999px; background: #fff; }
.brand-mark span:nth-child(1) { width: 24px; height: 5px; left: 9px; top: 10px; }
.brand-mark span:nth-child(2) { width: 17px; height: 5px; left: 9px; top: 19px; }
.brand-mark span:nth-child(3) { width: 10px; height: 5px; left: 9px; top: 28px; }

.button-link, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  font-weight: 720;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.button-link:hover, button:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--line-strong); }
.button-link.primary, button.primary {
  border-color: transparent;
  background: var(--text);
  color: var(--bg);
  box-shadow: 0 8px 18px rgba(27, 32, 24, .16);
}
.button-link.ghost, button.ghost, .theme-toggle { background: color-mix(in srgb, var(--panel), transparent 12%); }
.button-link.large { min-height: 50px; padding: 13px 20px; border-radius: 14px; }
button:disabled { opacity: .42; cursor: not-allowed; transform: none; }
button.danger { color: var(--bad); }

/* Hosted product and download portal */
.portal-shell { max-width: 1500px; margin: 0 auto; padding: 18px 34px 42px; }
.portal-nav {
  position: sticky;
  top: 12px;
  z-index: 20;
  min-height: 68px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 10px 12px 10px 14px;
  border: 1px solid color-mix(in srgb, var(--line), transparent 15%);
  border-radius: 20px;
  background: var(--panel-glass);
  box-shadow: 0 10px 30px rgba(27, 32, 24, .07);
  backdrop-filter: blur(20px);
}
.portal-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-size: 1.05rem; }
.portal-brand .brand-mark { width: 38px; height: 38px; flex-basis: 38px; border-radius: 12px; transform: scale(.9); }
.portal-nav nav { display: flex; gap: 8px; }
.portal-nav nav a { padding: 9px 12px; color: var(--muted); text-decoration: none; font-size: .88rem; font-weight: 650; }
.portal-nav nav a:hover { color: var(--text); }
.portal-actions { justify-self: end; display: flex; gap: 8px; align-items: center; }
.theme-toggle.compact { min-width: 42px; padding: 9px; }

.portal-hero {
  position: relative;
  min-height: calc(100svh - 108px);
  display: flex;
  align-items: center;
  margin-top: 18px;
  padding: clamp(76px, 9vw, 132px) clamp(28px, 7vw, 104px);
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--line);
  border-radius: 38px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}
.hero-copy { position: relative; z-index: 4; max-width: 720px; }
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.hero-kicker i, .connection-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px var(--good-soft); }
.hero-copy h1 { margin: 24px 0 20px; font-size: clamp(3rem, 6vw, 5.7rem); line-height: .98; letter-spacing: -.055em; }
.hero-copy > p { max-width: 650px; margin: 0; color: var(--muted); font-size: clamp(1.04rem, 1.7vw, 1.25rem); line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.hero-proof { display: flex; flex-wrap: wrap; gap: 9px 20px; margin-top: 25px; color: var(--muted); font-size: .82rem; }
.hero-proof span::before { content: "✓"; margin-right: 7px; color: var(--good); font-weight: 900; }

.mesh-illustration {
  position: absolute;
  inset: 0;
  margin: 0;
  overflow: hidden;
  isolation: isolate;
  border: 0;
  border-radius: inherit;
  background: var(--bg);
  box-shadow: none;
}
.mesh-illustration::after { content: ""; position: absolute; inset: 0; z-index: 1; background: none; pointer-events: none; }
.hero-art { position: absolute; inset: 0; }
.hero-art svg { display: block; width: 100%; height: 100%; }
.mesh-art-caption { position: absolute; z-index: 3; right: 28px; top: 28px; max-width: 230px; display: flex; flex-direction: column; gap: 3px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel-glass); color: var(--text); backdrop-filter: blur(12px); }
.mesh-art-caption span { color: var(--accent); font-size: .66rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.mesh-art-caption strong { font-size: .78rem; line-height: 1.35; }
.mesh-evidence { position: absolute; z-index: 3; right: 28px; bottom: 28px; display: flex; align-items: center; gap: 9px; padding: 11px 13px; border: 1px solid color-mix(in srgb, var(--good), var(--line) 55%); border-radius: 13px; background: var(--panel); color: var(--muted); font-size: .75rem; box-shadow: var(--shadow); }
.mesh-evidence i { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.mesh-evidence b { color: var(--good); }

.home-calculator-stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  margin-top: 56px;
  padding: clamp(72px, 8vw, 118px) clamp(18px, 5vw, 72px);
  overflow: hidden;
  isolation: isolate;
  scroll-margin-top: 92px;
  border: 1px solid var(--line);
  border-radius: 38px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}
.calculator-art, .calculator-art::after, .calculator-art-image { position: absolute; inset: 0; }
.calculator-art-image svg { display: block; width: 100%; height: 100%; }
.calculator-art::after { content: ""; background: linear-gradient(140deg, rgba(248, 247, 241, .30), rgba(248, 247, 241, .72)); }
:root[data-theme="dark"] .calculator-art::after { background: linear-gradient(140deg, rgba(22, 21, 15, .28), rgba(22, 21, 15, .68)); }
.calculator-art-image { width: 100%; height: 100%; }
.home-calculator-panel {
  position: relative;
  z-index: 2;
  width: min(100%, 1260px);
  border: 1px solid color-mix(in srgb, var(--line), transparent 8%);
  border-radius: 30px;
  background: color-mix(in srgb, var(--panel) 90%, transparent);
  box-shadow: 0 28px 80px rgba(27, 32, 24, .2);
  backdrop-filter: blur(22px);
}
.home-calculator-panel .calc { padding: clamp(24px, 4vw, 48px); }

.trust-strip { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-glass); box-shadow: var(--shadow); }
.trust-strip > div { display: flex; flex-direction: column; gap: 6px; padding: 24px 28px; }
.trust-strip > div + div { border-left: 1px solid var(--line); }
.trust-strip span { color: var(--muted); font-size: .84rem; line-height: 1.5; }
.portal-section { padding: 108px 16px 12px; }
.portal-section-heading { max-width: 760px; margin-bottom: 34px; }
.portal-section-heading > span { color: var(--accent); font-size: .73rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.portal-section-heading h2 { margin: 10px 0 10px; font-size: clamp(2rem, 4vw, 3.55rem); line-height: 1.06; letter-spacing: -.04em; }
.portal-section-heading p { color: var(--muted); }
.brand-story { padding-top: 128px; }
.brand-story-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.story-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.story-card-featured { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); }
.story-visual { min-height: 260px; overflow: hidden; background: var(--panel); }
.story-card-featured .story-visual { min-height: 410px; }
.themed-artwork { position: relative; width: 100%; height: 100%; min-height: inherit; }
.themed-artwork svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%;
  transition: transform .5s ease; }
.story-card:hover .story-visual svg { transform: scale(1.015); }
.story-copy { display: flex; flex-direction: column; justify-content: flex-end; padding: 27px; }
.story-copy > span { color: var(--accent); font-size: .7rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.story-copy h3 { margin: 13px 0 9px; font-size: clamp(1.3rem, 2.3vw, 2rem); letter-spacing: -.035em; }
.story-copy p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.6; }
.how-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.how-grid article, .download-card { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(165deg, var(--panel), color-mix(in srgb, var(--panel-strong), transparent 10%)); box-shadow: var(--shadow); }
.how-grid article { min-height: 250px; padding: 24px; }
.how-grid b { color: var(--accent); font-size: .75rem; letter-spacing: .1em; }
.how-grid h3 { margin: 58px 0 10px; font-size: 1.12rem; }
.how-grid p { margin: 0; color: var(--muted); line-height: 1.58; font-size: .88rem; }
.download-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.download-card { position: relative; min-height: 280px; display: flex; flex-direction: column; padding: 20px; }
.platform-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: var(--accent-soft); color: var(--accent); font-size: 1.08rem; font-weight: 900; }
.download-card h3 { margin: 25px 0 6px; font-size: 1.1rem; }
.download-card p { min-height: 42px; margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.format-pill { position: absolute; right: 17px; top: 19px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .64rem; font-weight: 800; text-transform: uppercase; }
.download-button { width: 100%; margin-top: auto; background: var(--panel-strong); }
.download-card small { min-height: 34px; margin-top: 10px; color: var(--muted); font-size: .65rem; line-height: 1.4; overflow-wrap: anywhere; }
.release-note { margin: 18px 0 0; color: var(--muted); font-size: .8rem; }
.portal-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 110px; padding: 26px 4px 10px; border-top: 1px solid var(--line); color: var(--muted); }
.portal-footer > div { display: flex; align-items: center; gap: 10px; color: var(--text); }
.portal-footer .brand-mark { transform: scale(.7); margin: -8px; }

/* Authenticated local dashboard */
.app-shell { max-width: 1480px; margin: auto; padding: 30px; }
.topbar { display: flex; justify-content: space-between; gap: 30px; align-items: flex-start; margin-bottom: 26px; }
.brand-heading { display: flex; align-items: flex-start; gap: 16px; }
.topbar h1 { margin: 3px 0 7px; font-size: clamp(2rem, 4vw, 3.65rem); line-height: 1; letter-spacing: -.045em; }
.subtitle, .muted, small { color: var(--muted); }
.subtitle { max-width: 780px; margin: 0; line-height: 1.55; }
.eyebrow { margin: 0; color: var(--accent); font-size: .7rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }
.connection-pill { display: inline-flex; align-items: center; gap: 9px; min-height: 42px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .76rem; white-space: nowrap; }
.banner { padding: 14px 16px; border: 1px solid transparent; border-radius: 14px; margin-bottom: 18px; }
.banner.info { border-color: color-mix(in srgb, var(--accent), transparent 72%); background: var(--accent-soft); color: var(--accent); }
.banner.error { background: rgba(255, 107, 122, .13); color: var(--bad); }
.banner.success { background: var(--good-soft); color: var(--good); }
.hero-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.metric-card, .card { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(165deg, var(--panel), color-mix(in srgb, var(--panel-strong), transparent 14%)); box-shadow: var(--shadow); }
.metric-card { min-height: 132px; display: flex; flex-direction: column; gap: 7px; padding: 20px; }
.metric-card span { color: var(--muted); font-size: .69rem; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.metric-card strong { margin-top: auto; font-size: 1.6rem; letter-spacing: -.03em; }
.card { padding: 23px; }
.progress-card, .cloud-control-card { margin-bottom: 14px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.section-heading h2 { margin: 4px 0 0; font-size: 1.26rem; letter-spacing: -.02em; }
.pill, .chart-range { display: inline-flex; align-items: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .72rem; white-space: nowrap; }
.pill.success { color: var(--good); border-color: color-mix(in srgb, var(--good), transparent 55%); background: var(--good-soft); }
.pill.danger { color: var(--bad); }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.progress-track { height: 11px; overflow: hidden; border-radius: 999px; background: var(--panel-strong); }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-strong), var(--violet)); }
.live-progress-list { display: grid; gap: 11px; margin-top: 16px; }
.live-progress-row { display: grid; gap: 8px; padding: 13px 0 0; border-top: 1px solid var(--line); }
.worker-progress-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.live-progress-row small { font-variant-numeric: tabular-nums; }
.line-chart { width: 100%; height: auto; border-radius: 15px; background: color-mix(in srgb, var(--panel-strong), transparent 18%); }
.axis { stroke: var(--line); stroke-width: 1; }
.trend-line { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.chart-labels { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; overflow: auto; }
.chart-labels span { min-width: 48px; display: flex; flex-direction: column; align-items: center; }
.chart-labels small { font-size: .7rem; }
.worker-list, .timeline, .safety-list, .evidence-grid { display: flex; flex-direction: column; gap: 10px; }
.worker-row, .evidence-row, .safety-list > div { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.worker-row div { display: flex; flex-direction: column; gap: 4px; }
.timeline-item { display: grid; grid-template-columns: 14px 1fr; gap: 10px; }
.timeline-item > span { width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--accent); }
.timeline-item div { display: flex; flex-direction: column; gap: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.safety-list .good { color: var(--good); }
.safety-list .bad { color: var(--bad); }
.raw-card pre { max-height: 420px; overflow: auto; padding: 16px; border-radius: 14px; background: var(--panel-strong); white-space: pre-wrap; word-break: break-word; }
.empty { padding: 38px; text-align: center; color: var(--muted); }
summary { cursor: pointer; font-weight: 700; }

/* Cloud orchestration reads as a guided workflow instead of one dense form. */
.cloud-control-card { padding: 0; overflow: hidden; }
.cloud-control-card > .section-heading, .cloud-control-card > .muted, .cloud-control-card > .banner { margin-left: 23px; margin-right: 23px; }
.cloud-control-card > .section-heading { margin-top: 23px; }
.cloud-control-card label { display: flex; flex-direction: column; gap: 7px; color: var(--muted); font-size: .7rem; font-weight: 760; letter-spacing: .07em; text-transform: uppercase; }
.cloud-control-card input, .cloud-control-card select { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-strong); color: var(--text); font: inherit; letter-spacing: normal; text-transform: none; }
/* The card gives its own controls a recessed ground — but a primary button
   keeps its ink fill. Overriding its background here left paper-on-paper in
   the light theme and bark-on-bark in the dark one: an invisible button. */
.cloud-control-card button { min-height: 44px; }
.cloud-control-card button:not(.primary) { background: var(--panel-strong); }
.cloud-step { padding: 20px 23px; border-top: 1px solid var(--line); }
.cloud-step-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.cloud-step-heading span { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: .7rem; font-weight: 900; }
.cloud-step-heading strong { font-size: .88rem; }
.cloud-step-heading small { margin-left: auto; }
.cloud-form-grid { display: grid; grid-template-columns: 1fr minmax(240px, 2fr) auto auto; gap: 11px; align-items: end; }
.cloud-search-grid { display: grid; grid-template-columns: 1fr 1fr auto; gap: 11px; align-items: end; }
.cloud-rent-row { display: grid; grid-template-columns: minmax(260px, 1.2fr) minmax(300px, 1fr) auto; gap: 11px; align-items: end; }
.confirmation-box { display: grid; gap: 6px; }
.confirmation-box code { color: var(--accent); font-size: .7rem; overflow-wrap: anywhere; }
.cloud-instance-list { display: grid; gap: 9px; padding: 20px 23px; border-top: 1px solid var(--line); }
.cloud-instance-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cloud-instance-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-strong); }
.cloud-instance-row > div { display: flex; flex-direction: column; gap: 4px; }
.round-controls { display: grid; grid-template-columns: 1fr 1fr auto auto auto; gap: 11px; align-items: end; padding: 20px 23px 23px; border-top: 1px solid var(--line); }

@media (max-width: 1180px) {
  .portal-hero { padding-inline: clamp(28px, 6vw, 72px); }
  .download-grid { grid-template-columns: repeat(3, 1fr); }
  .how-grid { grid-template-columns: 1fr 1fr; }
  .cloud-form-grid, .cloud-rent-row, .round-controls { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .portal-shell { padding-inline: 18px; }
  /* The nav used to be display:none here, which left a phone with the brand
     and a download button and no route to any page at all -- What it costs,
     Prices, Downloads and the tour were simply unreachable.
     Rows are placed explicitly because source order is brand, nav, actions:
     without it the nav claims row 1 and pushes the actions onto their own line
     with the brand stranded in the middle. It WRAPS rather than scrolls -- a
     sideways-scrolling nav hides its last item, which here is the tour. */
  .portal-nav { grid-template-columns: 1fr auto; row-gap: 4px; gap: 12px;
    padding: 9px 10px 10px 12px; }
  .portal-brand   { grid-column: 1; grid-row: 1; }
  .portal-actions { grid-column: 2; grid-row: 1; }
  .portal-nav nav { grid-column: 1 / -1; grid-row: 2;
    flex-wrap: wrap; gap: 2px; margin: 0 -9px; }
  .portal-nav nav .navlink { flex: 0 0 auto; white-space: nowrap;
    padding: 10px 9px; line-height: 1.25; }
  .portal-hero { min-height: calc(100svh - 96px); padding: 82px 42px 62px; }
  .mesh-illustration { inset: 0; width: auto; max-width: none; margin: 0; }
  .trust-strip { grid-template-columns: 1fr; }
  .trust-strip > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .download-grid { grid-template-columns: 1fr 1fr; }
  .topbar { flex-direction: column; }
  .topbar-actions { justify-content: flex-start; }
  .hero-grid, .two-column { grid-template-columns: 1fr 1fr; }
  .cloud-search-grid { grid-template-columns: 1fr 1fr; }
  .story-card-featured { grid-template-columns: 1fr; }
  .story-card-featured .story-visual { min-height: 0; aspect-ratio: 16 / 9; }
}
@media (max-width: 620px) {
  .portal-shell, .app-shell { padding: 12px; }
  .portal-nav { top: 7px; }
  .portal-brand strong, .portal-actions .ghost { display: none; }
  .portal-nav { min-height: 0; }
  .portal-nav nav .navlink { font-size: .85rem; padding: 10px 8px; }
  /* The label is only ever "Download GravityFog" or "View desktop releases",
     both short. Letting it wrap cost ~50px of a sticky header on a phone. */
  .portal-actions .button-link.primary { white-space: nowrap; font-size: .85rem;
    padding: 9px 13px; min-height: 40px; }
  .theme-toggle.compact { min-width: 38px; min-height: 40px; padding: 8px; }
  .portal-hero { min-height: calc(100svh - 82px); margin-top: 12px; padding: 64px 22px 52px; border-radius: 28px; }
  .hero-copy h1 { font-size: 2.75rem; }
  .mesh-illustration { transform: none; border-radius: inherit; }
  .mesh-illustration::after { background: linear-gradient(180deg, rgba(248, 247, 241, .94) 0%, rgba(248, 247, 241, .84) 58%, rgba(248, 247, 241, .44) 100%); }
  :root[data-theme="dark"] .mesh-illustration::after { background: linear-gradient(180deg, rgba(22, 21, 15, .95) 0%, rgba(22, 21, 15, .84) 58%, rgba(22, 21, 15, .5) 100%); }
  .mesh-art-caption, .mesh-evidence { display: none; }
  .home-calculator-stage { min-height: 0; margin-top: 30px; padding: 54px 10px; border-radius: 28px; }
  .home-calculator-panel { border-radius: 22px; }
  .home-calculator-panel .calc { padding: 22px 16px; }
  .calc-head { flex-direction: column; gap: 12px; }
  .how-grid, .download-grid, .hero-grid, .two-column { grid-template-columns: 1fr; }
  .brand-story-grid { grid-template-columns: 1fr; }
  .story-card-featured { grid-column: auto; }
  .portal-section { padding-top: 78px; }
  .portal-footer { flex-direction: column; align-items: flex-start; }
  .brand-heading .brand-mark { display: none; }
  .topbar-actions { width: 100%; }
  .topbar-actions .connection-pill { width: 100%; }
  .topbar-actions button, .topbar-actions .button-link { flex: 1; }
  .cloud-form-grid, .cloud-search-grid, .cloud-rent-row, .round-controls { grid-template-columns: 1fr; }
  .cloud-instance-row { grid-template-columns: 1fr auto; }
  .cloud-instance-row button { grid-column: 1 / -1; }
}


/* ── GravityFog dashboard shell ─────────────────────────────────────────── */
.gf-shell { display: grid; grid-template-columns: 246px minmax(0, 1fr); min-height: 100vh; }

.gf-rail { display: flex; flex-direction: column; gap: 4px; padding: 18px 14px;
  background: var(--panel); border-right: 1px solid var(--line); }
.gf-brand { display: flex; gap: 10px; align-items: center; padding: 2px 6px 16px; }
.gf-mark { width: 30px; height: 30px; border-radius: 10px; background: var(--accent-soft);
  color: var(--accent); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex: none; }
.gf-brand b { font-size: 13.5px; display: block; line-height: 1.2; }
.gf-brand span { color: var(--muted); font-size: 10.5px; }

.gf-navsec { font-size: 9.5px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase;
  color: var(--muted); padding: 14px 8px 6px; }
.gf-navitem { display: block; padding: 9px 11px; border-radius: 12px; color: var(--muted);
  font-size: 12.5px; font-weight: 500; text-decoration: none; }
a.gf-navitem:hover { background: var(--bg-soft); color: var(--text); }
.gf-navitem.on { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.gf-navitem.off { opacity: .42; cursor: default; }

.gf-spacer { flex: 1; }
.gf-getapp { display: block; text-align: center; padding: 9px 11px; margin-bottom: 8px;
  border: 1px solid var(--line); border-radius: 12px; color: var(--text);
  font-size: 12.5px; font-weight: 650; text-decoration: none; }
.gf-getapp:hover { border-color: var(--line-strong); }

.gf-seg { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--bg-soft); }
.gf-seg button { flex: 1; min-height: 0; padding: 7px 8px; border: none; background: none;
  border-radius: 9px; color: var(--muted); font-size: 11.5px; font-weight: 650; }
.gf-seg button:hover:not(:disabled) { transform: none; }
.gf-seg button.on { background: var(--panel); color: var(--text);
  box-shadow: 0 1px 2px rgba(27, 32, 24, .10); }

.gf-main { padding: 26px 30px 40px; display: flex; flex-direction: column; gap: 18px;
  min-width: 0; background: var(--bg); }
.gf-main .pagehead { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.gf-main .pagehead h1 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -.5px; }
.gf-main .pagehead p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; max-width: 62ch; }
.pagehead-actions { display: flex; gap: 8px; align-items: center; flex: none; }
.pagehead-actions button { min-height: 36px; padding: 8px 13px; font-size: 12.5px; }

.pill.good { background: var(--good-soft); color: var(--good); }

.gf-main .card, .gf-main .metric-card { border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--panel); box-shadow: none; }
.gf-main .section-heading h2 { font-size: 14px; font-weight: 700; letter-spacing: -.25px; }
.gf-main .eyebrow { font-size: 9.5px; font-weight: 700; letter-spacing: .11em;
  text-transform: uppercase; color: var(--muted); }

@media (max-width: 900px) {
  .gf-shell { grid-template-columns: minmax(0, 1fr); }
  .gf-rail { flex-direction: row; flex-wrap: wrap; align-items: center;
    border-right: none; border-bottom: 1px solid var(--line); }
  .gf-navsec, .gf-spacer, .gf-seg { display: none; }
}


/* ── public site: nav, calculator, prices ───────────────────────────────── */
.navlink { min-height: 0; padding: 9px 12px; border: none; background: none;
  color: var(--muted); font-size: .88rem; font-weight: 650; cursor: pointer; }
a.navlink { display: inline-flex; align-items: center; text-decoration: none; }
.navlink:hover { color: var(--text); transform: none; }
.navlink.on { color: var(--text); }
.portal-brand { border: none; background: none; padding: 0; cursor: pointer; min-height: 0; }
.portal-brand:hover { transform: none; }

.calc { padding: 8px 42px 56px; }
.calc-head { display: flex; justify-content: space-between; align-items: flex-start;
  gap: 24px; margin-bottom: 20px; }
.calc-head h2 { margin: 0 0 6px; font-size: 1.7rem; letter-spacing: -.02em; }
.calc-head p { margin: 0; color: var(--muted); max-width: 66ch; line-height: 1.55; }

.sources { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.src { padding: 4px 10px; border-radius: 999px; font-size: .72rem; font-weight: 650; }
.src.ok { background: var(--good-soft); color: var(--good); }
.src.bad { background: var(--accent-soft); color: var(--muted); }

.calc-models { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.calc-model { flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 10px 14px; text-align: left; }
.calc-model code { font-size: .8rem; font-weight: 650; }
.calc-model small { color: var(--muted); font-size: .74rem; font-weight: 500; }
.calc-model.on { border-color: var(--accent); background: var(--accent-soft); }

.calc-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px; margin-bottom: 12px; }
.calc-method { flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 15px 17px; min-height: 0; text-align: left; }
.calc-method b { font-size: .95rem; }
.calc-method small { color: var(--muted); font-size: .76rem; font-weight: 500; }
.calc-method strong { margin-top: 6px; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.calc-method span { color: var(--muted); font-size: .72rem; font-weight: 500; }
.calc-method.on { border-color: var(--accent); background: var(--accent-soft); }

.calc-student { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.calc-student span { color: var(--muted); font-size: .78rem; font-weight: 650; }
.calc-student input { width: 120px; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--panel); color: var(--text); }

.calc-split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 16px; align-items: start; }
@media (max-width: 1040px) { .calc-split { grid-template-columns: minmax(0, 1fr); } }

.panel-box { border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); padding: 18px 20px; overflow-x: auto; }
.panel-box h3 { margin: 0 0 12px; font-size: 1rem; }
.calc-table { width: 100%; border-collapse: collapse; }
.calc-table th { text-align: left; font-size: .68rem; text-transform: uppercase;
  letter-spacing: .09em; color: var(--muted); padding: 0 8px 9px; white-space: nowrap; }
.calc-table td { padding: 10px 8px; border-top: 1px solid var(--line); font-size: .86rem; }
.calc-table td b { display: block; font-weight: 650; }
.calc-table td small { display: block; color: var(--muted); font-size: .72rem; }
.calc-table .r { text-align: right; }
.calc-table .num { font-variant-numeric: tabular-nums; }
.calc-table .strong { font-weight: 700; }
.calc-table .dim { color: var(--muted); }
.calc-table tr.out { opacity: .4; }

.panel-box .row { display: flex; justify-content: space-between; gap: 14px;
  padding: 9px 0; border-top: 1px solid var(--line); font-size: .85rem; }
.panel-box .row:first-of-type { border-top: none; }
.panel-box .row b { font-variant-numeric: tabular-nums; }
.panel-box .row.total { border-top: 1px solid var(--text); font-weight: 700; }
.calc-note { margin: 12px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.55; }

.quote { display: inline-flex; flex-direction: column; gap: 2px; margin-top: 18px;
  padding: 14px 18px; border: 1px solid var(--accent); border-radius: var(--radius);
  background: var(--accent-soft); }
.quote span { color: var(--muted); font-size: .76rem; font-weight: 650; }
.quote strong { font-size: 2rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.quote small { color: var(--muted); font-size: .76rem; }

.portal-footer p b { color: var(--text); }

/* Sealed-evidence sits behind the downloads heading: the chain is what the
   app produces, so it belongs on the page where people install it. */
.downloads-section { position: relative; overflow: hidden; }
.section-art { position: absolute; inset: 0; z-index: 0; opacity: .55; pointer-events: none; }
.section-art svg { display: block; width: 100%; height: 100%; }
.downloads-section > *:not(.section-art) { position: relative; z-index: 1; }
