/* Steward of the House: page components on top of base.css.
 * Load order: assets/css/base.css (tokens, both themes, the design system), then this file.
 * Everything here is theme-driven by the tokens; the few :root:not([data-theme="light"]) rules keep the parent's
 * inversions (ink on paper) in the dark theme where a plain token swap would give a light surface. */

/* the header is 81 px (brand row) below 1180 px and 113 px with the utility row; the JS path measures, this is for
 * native anchor jumps and the phone menu's max-height */
:root { --header-h: 81px; }
@media (min-width: 1180px) { :root { --header-h: 113px; } }
html { scroll-padding-top: calc(var(--header-h) + 16px); }
body { background: var(--paper); color: var(--ink); }

/* Elements the parent paints with var(--ink) as a background. In dark the primary button and the header's contact
 * button are solid accent with ink text (#2ec8f0 on #16181a is 9:1); active toggles, chips and segments invert to
 * ink on paper, and the rest of the accent is kept for the small signals (dot, .lnum, underline, one bar). The
 * primary button's hover is the cyan-to-blue half of the brand gradient (ink on its blue end is 5.4:1). */
:root:not([data-theme="light"]) .btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: none; }
:root:not([data-theme="light"]) .btn-primary:hover { background: linear-gradient(135deg, var(--accent-g1), var(--accent-g2)); color: var(--on-accent); }
:root:not([data-theme="light"]) .cta-small { background: var(--accent); color: var(--on-accent); }
:root:not([data-theme="light"]) .cta-small:hover { background: var(--accent-deep); }
:root:not([data-theme="light"]) .btn-ghost:hover { background: var(--ink); color: var(--paper); }
:root:not([data-theme="light"]) .toggle-btn.active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
:root:not([data-theme="light"]) .viz-dark .toggle-btn.active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
:root:not([data-theme="light"]) .level-btn.active, :root:not([data-theme="light"]) .phase-btn.active { background: var(--ink); color: var(--paper); }
:root:not([data-theme="light"]) .level-btn.active .lnum { color: var(--accent-on-light); }   /* the active button is light paper: the number needs the deep accent (4.5:1 or better) */
:root:not([data-theme="light"]) .chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
:root:not([data-theme="light"]) .nav-link.active { text-decoration-color: var(--accent); }
:root:not([data-theme="light"]) .viz-dark .bar-fill.pos { background: rgba(243, 242, 236, .55); }
:root:not([data-theme="light"]) .viz-dark .bar-fill.pos.is-total, :root:not([data-theme="light"]) .viz-dark .bar-fill.pos:first-child:last-child { background: rgba(243, 242, 236, .55); }
:root:not([data-theme="light"]) .viz-dark .summary-item .sv { color: var(--on-dark); }
:root:not([data-theme="light"]) .viz-dark .summary-item:first-child .sv { color: var(--accent-on-dark); }
:root:not([data-theme="light"]) .sim-range input[type=range] { accent-color: var(--ink-mid); }
:root:not([data-theme="light"]) .sim-range input[type=range]:focus-visible { accent-color: var(--accent); }

/* ============================== SKIP LINK ============================== */
.skip-link { position: absolute; left: 16px; top: -100px; z-index: 100; padding: 10px 14px; background: var(--accent); color: var(--on-accent); font-weight: 700; border-radius: 4px; }
.skip-link:focus { top: 12px; }

/* ============================== HEADER (steward-header) ============================== */
steward-header, steward-footer { display: block; }
.site-header { transition: transform .25s ease; }
.site-header.is-hidden { transform: translateY(-100%); }
/* utility row: open source line on the left, mail and the sister site on the right; collapses once the page scrolls */
.util-row { display: none; align-items: center; justify-content: space-between; gap: 16px; height: 32px; font-size: 12px; color: var(--ink-soft); border-bottom: 1px solid var(--rule-soft); overflow: hidden; transition: height .2s ease, opacity .2s ease, border-color .2s; }
.util-row .util-left { letter-spacing: .06em; text-transform: uppercase; font-weight: 600; font-size: 11px; }
.util-row .util-right { display: flex; align-items: center; gap: 20px; }
.util-link { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-soft); font-weight: 500; }
.util-link:hover { color: var(--ink); }
.util-link svg { width: 13px; height: 13px; }
.site-header.is-scrolled .util-row { height: 0; opacity: 0; border-color: transparent; }
.header-inner { gap: 16px; }
.brand { min-width: 0; }
.brand-title { white-space: nowrap; }
.brand-tag { display: block; text-transform: none; letter-spacing: 0; font-size: 11.5px; margin-top: 1px; white-space: nowrap; }
.logo-mark svg { display: block; }
/* navigation: anchors on the index page, index.html#... elsewhere. The nav may shrink and clips what does not fit
 * (padding and negative margin leave room for the focus ring), so a longer label can never cross the brand. */
.nav { display: none; gap: 2px; min-width: 0; overflow: hidden; padding: 4px; margin: -4px -4px -4px auto; }
.nav-link { padding: 8px 9px; font-size: 14px; white-space: nowrap; }
.nav-link.active { text-decoration-thickness: 2.5px; text-underline-offset: 7px; }
.nav-controls { display: none; align-items: center; gap: 8px; flex: none; }
.nav-controls .cta-small { padding: 9px 14px; white-space: nowrap; }
.seg { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: 4px; overflow: hidden; }
.seg button { padding: 6px 10px; font-weight: 700; font-size: 12px; letter-spacing: .04em; color: var(--ink-soft); background: transparent; border-right: 1px solid var(--rule-strong); transition: background .15s, color .15s; line-height: 1.2; }
.seg button:last-child { border-right: 0; }
.seg button:hover { color: var(--ink); }
.seg button.active, .seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
/* the container clips overflow, so the focus ring is drawn inside the button */
.seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; position: relative; z-index: 1; }
.seg-label { font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); margin-right: 2px; display: none; }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 9px; min-height: 30px; border: 1px solid var(--rule-strong); border-radius: 4px; font-weight: 600; font-size: 12px; color: var(--ink-soft); background: transparent; }
.theme-toggle:hover { color: var(--ink); border-color: var(--ink); }
.theme-toggle svg { width: 14px; height: 14px; }
.theme-toggle .lbl { display: none; }
.theme-toggle .ic-moon { display: none; }
html[data-theme="light"] .theme-toggle .ic-sun { display: none; }
html[data-theme="light"] .theme-toggle .ic-moon { display: block; }
.menu-toggle { display: inline-flex; margin-left: auto; padding: 8px; border-radius: 4px; flex: none; }
/* phone menu: the links, then the three controls and the contact button */
.mobile-menu { display: none; border-top: 1px solid var(--rule); max-height: calc(100vh - var(--header-h)); overflow-y: auto; }
.mobile-menu.open { display: block; }
.mobile-menu .menu-list { padding: 12px 24px 20px; display: flex; flex-direction: column; gap: 2px; }
.mobile-menu .menu-nav { display: flex; flex-direction: column; gap: 2px; }
.mobile-menu .nav-link { padding: 12px 10px; font-size: 16px; border-bottom: 1px solid var(--rule-soft); }
.mobile-menu .nav-link.active { text-decoration: none; color: var(--ink); font-weight: 700; }
.mobile-menu .menu-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 18px 0 6px; }
.mobile-menu .menu-controls .seg button, .mobile-menu .menu-controls .theme-toggle { min-height: 40px; padding: 10px 13px; font-size: 13px; }
.mobile-menu .menu-controls .theme-toggle .lbl { display: inline; }
.mobile-menu .menu-controls .seg-label { display: inline; }
.mobile-menu .menu-cta { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; }
.mobile-menu .menu-cta .util-link { font-size: 14px; }
@media (min-width: 720px) {
  .nav-controls { display: flex; }
  .mobile-menu .menu-controls { display: none; }
}
@media (min-width: 1180px) {
  .util-row { display: flex; }
  .brand { flex: none; }            /* the brand never shrinks; the nav gives way instead */
  .nav { display: flex; }
  /* the row carries the brand, six links, three controls and the contact button in a 1280 px container: the links
   * and the gaps are a touch tighter than the parent's (the English labels are the longest; verified at 1180, 1280,
   * 1360 and 1440 px in sv and en) */
  .header-inner { gap: 12px; }
  .nav-link { font-size: 13.5px; padding: 8px 5px; }
  .nav-controls { margin-left: 2px; gap: 4px; }
  .nav-controls .cta-small { padding: 9px 12px; }
  .menu-toggle { display: none; }
  .theme-toggle .lbl { display: none; }
}
/* up to 1359 px (where the 1280 px container stops growing) the row fits only without the tag line under the wordmark */
@media (min-width: 1180px) and (max-width: 1359px) {
  .brand-tag { display: none; }
}
/* the contact button joins the header row from 1024 px; below that the phone menu carries it */
@media (max-width: 1023px) {
  .site-header .cta-small.nav-cta-head { display: none; }
}
@media (max-width: 400px) {
  .brand-tag { display: none; }
  .brand-title { font-size: 16px; }
}


/* ============================== READING LEVELS ============================== */
div[data-level]:not(.active) { display: none; }
html[data-level="1"] div[data-level]:not([data-level="1"]), html[data-level="3"] div[data-level]:not([data-level="3"]) { display: none; }
html[data-level="1"] div[data-level="1"], html[data-level="3"] div[data-level="3"] { display: block; }
.level-box { margin-top: 0; }
.level-track .level-btn { min-width: 0; }
@media (max-width: 640px) {
  .level-track { grid-template-columns: 1fr; }
}

/* ============================== LAYOUT HELPERS ============================== */
main > section, main > .hero { scroll-margin-top: calc(var(--header-h) + 8px); }
.section-tight { padding: 64px 0; }
.prose p { margin: 0 0 18px; line-height: 1.65; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { font-weight: 700; }
.prose { font-size: 16.5px; }
.small-note { font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; }
.hero-naming { font-size: 14px; color: var(--ink-soft); margin-top: 20px; max-width: 48rem; }
.hero .lead { max-width: 52rem; }
.hero .h1 { max-width: 16ch; }

/* The hero animation layer (assets/js/hero-anim.js, the cross-section, mounts into #hero-anim). From 1024 px the
 * scene is the full-width background layer behind the text column: the SVG is anchored to the right edge and
 * scaled to fit (its sky and ground extend past the drawing, so every aspect ratio is painted), the house sits in
 * the right half and the scrim fades the left half to paper under the headline; the text column is kept to
 * 14ch / 32rem so the headline never crosses the house. Below 1024 px the scene is an in-flow block under the text
 * (a crop around the pylon and the house, no scrim; the container gets ha-compact and follows the crop's aspect
 * ratio), and below 600 px the legend and the source line follow as ordinary text. All of it works without the
 * animation. The .hero--split variant puts the text left and the animation in a right-hand column instead. */
.hero { position: relative; overflow: hidden; isolation: isolate; }
.hero-anim { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.hero-anim > svg { display: block; width: 100%; height: 100%; }
.hero-scrim { position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, var(--paper) 0%, color-mix(in srgb, var(--paper) 92%, transparent) 34%, color-mix(in srgb, var(--paper) 50%, transparent) 50%, transparent 63%); }
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .hero-scrim { background: linear-gradient(90deg, var(--paper) 0%, var(--paper) 34%, transparent 63%); opacity: .92; }
}
.hero .hero-grid { z-index: 0; }
.hero.has-board .hero-grid { display: none; }
.hero .container { position: relative; z-index: 2; }
.hero-text { max-width: 56rem; }
/* the h1's italic word carries the brand gradient; the solid accent stays as the fallback colour */
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .hero .h1 .em-italic { background: var(--accent-gradient-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
}
@media (min-width: 1024px) {
  .hero:not(.hero--split) { min-height: clamp(720px, 52.8vw, 860px); display: flex; align-items: center; }
  .hero:not(.hero--split) .container { width: 100%; }
  /* the headline stays left of the house (x >= 64 percent): a touch smaller than the parent's h1 */
  .hero:not(.hero--split) .h1 { max-width: min(14ch, 46vw); font-size: clamp(46px, 5.6vw, 78px); }
  .hero:not(.hero--split) .lead, .hero:not(.hero--split) .hero-naming { max-width: 30rem; }
  .hero:not(.hero--split) .stats { max-width: 38rem; display: grid; grid-template-columns: auto auto; column-gap: 40px; row-gap: 28px; justify-content: start; }
  .hero:not(.hero--split) .stats .stat-divider { display: none; }
  .hero:not(.hero--split) .stats > div:nth-child(4n + 3) { border-left: 1px solid var(--rule); padding-left: 40px; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .hero:not(.hero--split) .lead, .hero:not(.hero--split) .hero-naming { max-width: 28rem; }
}
@media (max-width: 1023px) {
  .hero:not(.hero--split) { display: flex; flex-direction: column; align-items: stretch; padding-bottom: 0; }
  .hero:not(.hero--split) .hero-anim { position: relative; inset: auto; order: 1; width: 100%; aspect-ratio: 840 / 730; margin: 32px 0 0; }
  .hero:not(.hero--split) .hero-anim.ha-compact { aspect-ratio: auto; height: auto; }
  .hero-scrim { display: none; }
}
@media (max-width: 599px) {
  .hero:not(.hero--split) .hero-anim { aspect-ratio: 790 / 720; }
}
/* the phone's legend and source line, rendered by the animation as HTML under the SVG */
.hero-anim-legend { padding: 12px 24px 28px; font-size: 13px; line-height: 1.5; color: var(--ink-soft); }
.hero-anim-legend .row { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.hero-anim-legend .it { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; }
.hero-anim-legend .sw { display: inline-block; width: 12px; height: 5px; border-radius: 3px; opacity: .85; }
.hero-anim-legend .sw-dot { width: 9px; height: 9px; border-radius: 50%; }
.hero-anim-legend .sw-sm { width: 6px; height: 6px; }
.hero-anim-legend .cap { margin: 8px 0 0; font-size: 12.5px; }
/* the house card's legend element also carries .legend (base.css, the charts' row): stacked here, as in the card */
.hero-anim-legend.legend { display: block; margin-top: 0; font-size: 13px; color: var(--ink-soft); }
.hero--split .hero-anim { position: relative; inset: auto; min-height: 320px; }
.hero--split .hero-scrim { display: none; }
@media (min-width: 1024px) {
  .hero--split .container { display: grid; grid-template-columns: 6fr 6fr; gap: 48px; align-items: center; }
  .hero--split .hero-text { grid-column: 1; }
  .hero--split .hero-anim { grid-column: 2; grid-row: 1 / span 2; min-height: 520px; height: 100%; }
  .hero--split .stats { grid-column: 1; }
}
@media (max-width: 1023px) {
  .hero--split .hero-anim { order: -1; margin-bottom: 32px; }
}

.eyebrow-tight { margin-bottom: 20px; }

/* ============================== PLAN ILLUSTRATION ============================== */
.plan-grid { display: grid; grid-template-columns: 1fr; gap: 32px; }
@media (min-width: 1024px) { .plan-grid { grid-template-columns: 7fr 5fr; align-items: start; } }
.plan-panel { background: var(--paper-warm); border: 1px solid var(--rule); border-radius: 8px; padding: 24px 20px; margin: 0; }
@media (min-width: 640px) { .plan-panel { padding: 28px 28px; } }
.plan-quote { margin: 0; padding: 20px 22px; border-left: 3px solid var(--accent); background: var(--paper-card); border-radius: 2px; }
.plan-quote p { margin: 0; font-size: 17px; line-height: 1.5; font-weight: 500; }
.plan-quote cite { display: block; margin-top: 10px; font-style: normal; font-size: 12.5px; color: var(--ink-soft); }
.plan-reasons { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-direction: column; gap: 12px; }
.plan-reasons li { display: flex; gap: 12px; font-size: 15px; line-height: 1.55; }
.plan-reasons li::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 8px; background: var(--accent); }
.plan-caption { font-size: 13.5px; color: var(--ink-soft); margin: 20px 0 0; line-height: 1.55; }
.plan-fallback { font-size: 14px; color: var(--ink-soft); margin: 0; }
.ems-plan-chart .ems-pc-caption { color: var(--ink-soft); }
/* The plan section live from Villa A (assets/js/live.js). [data-sample] is the static sample day, [data-live-only] the
 * live version; live.js sets section[data-live="on"] while it shows the live plan. Without JavaScript nothing sets it,
 * so the page reads as the sample. The strip sits between the heading and the grid: a status row (the live dot,
 * grey with "senast sparade plan" when the feed is stale or unreachable), then six readings in one row from 1024 px,
 * three from 640 px, two below. The second cross-section (#live-anim) sits under the chart in the same panel look. */
#en-dag:not([data-live="on"]) [data-live-only] { display: none !important; }
#en-dag[data-live="on"] [data-sample] { display: none !important; }
.live-strip { --ls-bat: #2fb367; margin-top: 32px; padding: 16px 18px 14px; background: var(--paper-warm); border: 1px solid var(--rule); border-radius: 8px; }
html[data-theme="light"] .live-strip { --ls-bat: #25a35a; }
.live-strip[hidden] { display: none; }
.ls-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; font-size: 12.5px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.ls-status { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); }
.ls-dot { position: relative; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--ink-soft); opacity: .55; }
.live-strip[data-state="live"] .ls-dot { background: var(--pos); opacity: 1; }
.live-strip[data-state="live"] .ls-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--pos); opacity: 0; animation: ls-ring 2.4s ease-out infinite; }
@keyframes ls-ring { 0% { transform: scale(.5); opacity: .8; } 100% { transform: scale(1.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .live-strip .ls-dot::after { animation: none; } }
.ls-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 14px 0 0; background: var(--rule); border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
@media (min-width: 640px) { .ls-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .ls-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.ls-cell { min-width: 0; padding: 12px 14px; background: var(--paper-card); }
.ls-cell dt { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.ls-cell dd { margin: 0; }
.ls-cell .ls-val { margin-top: 6px; font-size: 18px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ls-cell .ls-sub { margin-top: 4px; font-size: 12.5px; line-height: 1.35; color: var(--ink-soft); }
.ls-cell .ls-bar { height: 5px; margin-top: 8px; border-radius: 3px; background: var(--rule-strong); overflow: hidden; }
.ls-cell .ls-bar > span { display: block; height: 100%; border-radius: 3px; background: var(--ls-bat); }
.ls-note { margin: 10px 0 0; }
.live-anim-panel { margin-top: 24px; padding: 0; overflow: hidden; }
.live-anim-panel .viz-kicker { margin: 0; padding: 20px 20px 12px; }
@media (min-width: 640px) { .live-anim-panel .viz-kicker { padding: 24px 28px 12px; } }
.live-anim { width: 100%; pointer-events: none; }
.live-anim > svg { display: block; }
.live-original { margin-top: 10px; }
.live-original-toggle { padding: 0; font-size: 12.5px; color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; background: none; border: 0; cursor: pointer; }
.live-original-toggle:hover { color: var(--ink); }
.live-original-text { margin: 10px 0 0; padding: 12px 14px; font-size: 13px; line-height: 1.55; color: var(--ink-soft); border: 1px solid var(--rule); border-radius: 4px; }

/* ============================== HOW IT WORKS ============================== */
.steps { display: grid; grid-template-columns: 1fr; gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
@media (min-width: 768px) { .steps { grid-template-columns: repeat(2, 1fr); } }
.step { background: var(--paper-warm); padding: 28px 24px 30px; }
.step .step-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.step .step-icon { width: 40px; height: 40px; border-radius: 4px; background: var(--paper-card); color: var(--accent-deep); display: grid; place-items: center; flex: none; border: 1px solid var(--rule); }
.step .step-icon svg { width: 20px; height: 20px; }
.step h3 { margin: 0; }
.step p { margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--ink-mid); }
.step p + p { margin-top: 12px; }
.step div[data-level="3"] p { font-size: 14.5px; }
html[data-theme="light"] .step .step-icon { color: var(--ink); background: var(--paper-warm); }

/* ============================== ASSISTANT ============================== */
/* The assistant section (#assistent): the text and its three levels left, an example conversation right from
 * 1024 px (11fr / 9fr like the installation intro, top aligned since the detailed level is long); below that the
 * conversation is a block under the text, at most 560 px wide. The conversation is real text in an ordered list:
 * your messages to the right, the fixed phrases' answers with a grey marker, the AI agent's with an accent marker
 * and an accent line. 1 px lines, 4 px radius, no shadows. */
.assist-intro { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }
.assist-levels { margin-top: 24px; max-width: 56rem; }
.assist-levels p { margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--ink-mid); }
.assist-levels p + p { margin-top: 12px; }
.assist-levels div[data-level="3"] p { font-size: 14.5px; }
.assist-levels em { font-style: italic; color: var(--ink); }
.assist-chat { margin: 0; max-width: 560px; background: var(--paper-warm); border: 1px solid var(--rule); border-radius: 4px; }
.assist-chat-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 14px 18px; border-bottom: 1px solid var(--rule); }
.assist-chat-head .viz-kicker { margin: 0; }
.assist-chat-head .badge-example { padding: 4px 10px; font-size: 10.5px; }
.chat-log { list-style: none; margin: 0; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.chat-msg { max-width: 88%; }
.chat-msg.you { align-self: flex-end; }
.chat-who { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.chat-msg.you .chat-who { justify-content: flex-end; }
.chat-msg.phrase .chat-who::before, .chat-msg.ai .chat-who::before { content: ""; flex: none; width: 7px; height: 7px; background: var(--ink-soft); }
.chat-msg.ai .chat-who::before { background: var(--accent); }
.chat-msg p { margin: 0; padding: 10px 13px; font-size: 14.5px; line-height: 1.5; color: var(--ink); background: var(--paper-card); border: 1px solid var(--rule); border-radius: 4px; }
.chat-msg.you p { background: transparent; border-color: var(--rule-strong); }
.chat-msg.ai p { border-color: rgba(var(--accent-rgb), .5); }
.chat-divider { display: flex; align-items: center; gap: 12px; margin: 4px 0; font-size: 12px; line-height: 1.4; color: var(--ink-soft); text-align: center; }
.chat-divider::before, .chat-divider::after { content: ""; flex: 1 1 20px; height: 1px; background: var(--rule-strong); }
.assist-chat figcaption { margin: 0; padding: 12px 18px 14px; border-top: 1px solid var(--rule); font-size: 12.5px; line-height: 1.55; color: var(--ink-soft); }
@media (min-width: 1024px) {
  .assist-intro { grid-template-columns: minmax(0, 11fr) minmax(0, 9fr); gap: 56px; align-items: start; }
  .assist-chat { max-width: none; }
}
@media (max-width: 640px) {
  .chat-log { padding: 16px 14px; }
  .chat-msg { max-width: 94%; }
}

/* ============================== COMPARISON TEASER (static) ============================== */
.cmp-static { margin-top: 32px; }
.cmp-static table.proj { min-width: 720px; }
.cmp-static table.proj th, .cmp-static table.proj td { white-space: normal; vertical-align: top; text-align: left; }
.cmp-static table.proj th { text-transform: none; letter-spacing: 0; font-size: 12px; }
.cmp-static table.proj th.axis { font-weight: 700; color: var(--on-dark); min-width: 150px; }
.cmp-static table.proj td { font-size: 13px; line-height: 1.5; }
.cmp-static table.proj td.steward { color: var(--on-dark); }
.cmp-static table.proj th.steward-col { color: var(--accent-on-dark); }
.cmp-static .fineprint { color: var(--on-dark-soft); margin: 16px 0 0; }
.cmp-static .fineprint a, .viz-dark a.text-link { color: var(--accent-on-dark); }
.axes-grid { display: grid; grid-template-columns: 1fr; gap: 32px 40px; margin-top: 48px; }
@media (min-width: 1024px) { .axes-grid { grid-template-columns: repeat(2, 1fr); } }
.axis-block h3 { margin-bottom: 10px; }
.axis-block p { margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--ink-mid); }
.fair { margin-top: 56px; padding: 28px 28px; border-left: 4px solid var(--accent); background: var(--paper-warm); border-radius: 2px; }
.fair h3 { margin-bottom: 12px; }
.fair p { margin: 0; font-size: 15.5px; line-height: 1.6; }
.fair ul { margin: 10px 0 0; padding-left: 20px; font-size: 15.5px; line-height: 1.6; }
.fair li { margin-bottom: 6px; }

/* ============================== SAVINGS ============================== */
.savings-grid { display: grid; grid-template-columns: 1fr; gap: 40px; margin-top: 8px; }
@media (min-width: 1024px) { .savings-grid { grid-template-columns: 7fr 5fr; align-items: start; } }
.viz.savings-viz { margin: 0; }
.savings-viz .viz-title { font-size: 14px; font-weight: 700; margin: -12px 0 20px; letter-spacing: -.005em; }
.month-chart.ems-mchart { height: 240px; gap: 12px; }
.ems-mchart .month-col { justify-content: flex-end; }
.ems-mchart .month-pair { height: 200px; align-items: flex-end; }
.ems-mchart .month-pair .b.after { width: clamp(36px, 8vw, 64px); background: var(--accent-deep); }
.ems-mchart .mval { font-weight: 700; font-size: 13.5px; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.ems-mchart .month-mo { font-size: 11.5px; }
.viz .discl { border-top-color: var(--rule); color: var(--ink-soft); }
.figs { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 32px; }
@media (min-width: 768px) { .figs { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1280px) { .figs.figs-3 { grid-template-columns: repeat(3, 1fr); } }
.fig { background: var(--paper-card); border: 1px solid var(--rule); border-radius: 6px; padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 8px; }
.fig .f-label { font-size: 11.5px; font-weight: 600; color: var(--ink-soft); letter-spacing: .04em; line-height: 1.4; }
.fig .f-value { font-weight: 800; font-size: 22px; letter-spacing: -.02em; line-height: 1.2; }
.fig .f-value.small { font-size: 16px; font-weight: 700; }
.fig .f-meaning { font-size: 13.5px; line-height: 1.55; color: var(--ink-mid); margin: 0; }
.fig .f-caveat { font-size: 13px; line-height: 1.55; color: var(--ink-soft); margin: 0; padding-top: 8px; border-top: 1px dashed var(--rule-strong); }
.fig .f-caveat .lbl, .fig .f-meaning .lbl { font-weight: 700; color: var(--ink); }
.fig details summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--accent-deep); list-style: none; }
html[data-theme="light"] .fig details summary, html[data-theme="light"] .badge-example, html[data-theme="light"] .faq summary::after, html[data-theme="light"] details.disc summary::after { color: var(--ink); }
.fig details summary::-webkit-details-marker { display: none; }
.fig details summary::before { content: "+ "; }
.fig details[open] summary::before { content: "− "; }
.fig details p { margin-top: 8px; }
.source-line { margin-top: 24px; }
.source-line .lbl { font-weight: 700; color: var(--ink); }

/* ============================== SIMULATOR ============================== */
.sim-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.badge-example { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--accent); color: var(--accent-deep); font-weight: 700; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; border-radius: 999px; }
.badge-example::before { content: ""; width: 8px; height: 8px; background: var(--accent); }
#simulator { margin-top: 40px; }
#simulator .sim-grid { margin-bottom: 8px; }
#simulator .viz-dark { margin-top: 24px; }
.sim-levels p { margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--ink-mid); }
/* The isometric house beside the simulator intro (assets/js/iso-anim.js mounts into #iso-anim). From 1024 px the
 * intro is two columns: the text left, the house right at 45 percent and vertically centred, with the caption
 * under it; below that the house is an in-flow block under the text (capped at 640 px, left aligned). The canvas
 * is square; the animation picks its mode by the container's width: compact from 560 px (legend and source line
 * inside the canvas), the phone mode below (iso-phone: larger type, the legend and the source line as HTML under
 * the canvas). The simulator form and result stay full width under the intro. Without JavaScript the empty
 * container and its caption are hidden and the text stands alone. (.sim-intro is the simulator's own class for
 * its result text, so the grid has its own names.) */
.sim-intro-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
.sim-intro-iso { max-width: 640px; }
.iso-anim { width: 100%; aspect-ratio: 1 / 1; overflow: hidden; pointer-events: none; }
.iso-anim > canvas { display: block; width: 100%; height: 100%; }
.iso-anim.iso-phone { aspect-ratio: auto; height: auto; }
.iso-anim.iso-phone > canvas { height: auto; aspect-ratio: 1 / 1; }
.iso-anim:empty, .iso-anim:empty + .iso-caption { display: none; }
.iso-caption { margin: 14px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); max-width: 40rem; }
@media (min-width: 1024px) {
  .sim-intro-split { grid-template-columns: minmax(0, 11fr) minmax(0, 9fr); gap: 56px; align-items: center; }
  .sim-intro-iso { max-width: none; }
}
.caveats { margin: 0; padding-left: 20px; font-size: 14.5px; line-height: 1.6; color: var(--ink-mid); }
.caveats li { margin-bottom: 8px; }
.sim-vs { margin-top: 24px; }
details.disc { border: 1px solid var(--rule); border-radius: 6px; padding: 14px 18px; background: var(--paper-warm); }
details.disc summary { cursor: pointer; font-weight: 700; font-size: 14px; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
details.disc summary::-webkit-details-marker { display: none; }
details.disc summary::after { content: "+"; font-weight: 400; font-size: 20px; line-height: 1; color: var(--accent-deep); flex: none; }
details.disc[open] summary::after { content: "−"; }
details.disc[open] summary { margin-bottom: 12px; }

/* ============================== INSTALLATION ============================== */
.svc-cards.two { grid-template-columns: 1fr; margin-top: 40px; }
@media (min-width: 900px) { .svc-cards.two { grid-template-columns: repeat(2, 1fr); } }
.svc-card .tag-pill { color: var(--on-dark-soft); border-color: var(--rule-dark); }
.svc-card .req-title { font-weight: 700; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--on-dark-soft); margin: 28px 0 12px; }
.svc-card .req { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.svc-card .req li { display: flex; gap: 10px; font-size: 13.5px; line-height: 1.5; color: var(--on-dark-soft); }
.svc-card .req li::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: 9px; background: var(--accent-on-dark); }
.svc-card .links { margin-top: 24px; display: flex; flex-direction: column; gap: 8px; }
.svc-card .links a { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-on-dark); font-weight: 600; font-size: 13.5px; }
.svc-card .links a:hover { text-decoration: underline; }
.svc-card .pro-steps { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-direction: column; gap: 14px; counter-reset: pstep; }
.svc-card .pro-steps li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; font-size: 13.5px; line-height: 1.5; color: var(--on-dark-soft); }
.svc-card .pro-steps li::before { counter-increment: pstep; content: counter(pstep); font-weight: 800; color: var(--accent-on-dark); font-size: 15px; line-height: 1.4; }
.svc-card .pro-steps strong { display: block; color: var(--on-dark); font-size: 14.5px; margin-bottom: 2px; }
.svc-card .btn-primary { margin-top: 28px; }
/* a filled surface on a dark panel is always --accent-on-dark with ink text, whatever the theme */
html[data-theme="light"] .svc-card .btn-primary { background: var(--accent-on-dark); color: var(--on-accent-on-dark); }
html[data-theme="light"] .svc-card .btn-primary:hover { background: var(--accent-on-dark-hover); color: var(--on-accent-on-dark); }
.svc-card .email-line { margin-top: 14px; font-size: 13.5px; color: var(--on-dark-soft); }
.svc-card .email-line a { color: var(--on-dark); font-weight: 600; }
.svc-card .card-note { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--rule-dark); font-size: 12.5px; color: var(--on-dark-soft); line-height: 1.55; }
.svc-card .desc { color: var(--on-dark-soft); }
.install-levels { margin-top: 24px; max-width: 56rem; }
.install-levels p { margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--ink-mid); }
.cross-link { margin-top: 20px; max-width: 56rem; padding-left: 16px; border-left: 3px solid var(--accent); }
.cross-link p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ink-mid); }
.cross-link a { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.cross-link a:hover { color: var(--accent-deep); }
/* The circuit board beside the installation text (assets/js/board-anim.js mounts into #board-anim). From 1024 px
 * the intro is two columns: the text left, the board right at 45 percent and vertically centred, with the caption
 * under it; below that the board is an in-flow block under the text (capped at 720 px, left aligned). The
 * animation picks its crop by the container's width: the compact crop (board-compact, 666 x 668 units) from
 * 560 px, the phone mode below (board-phone: a tighter crop, larger type, the legend and the source line as HTML
 * under the SVG), which is also what the desktop column gets. Without JavaScript the empty board and its caption
 * are hidden and the text stands alone. */
.install-intro { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
.install-board { max-width: 720px; }
.board-anim { width: 100%; aspect-ratio: 666 / 668; overflow: hidden; pointer-events: none; }
.board-anim > svg { display: block; width: 100%; height: 100%; }
.board-anim.board-phone { aspect-ratio: auto; height: auto; }
.board-anim.board-phone > svg { height: auto; aspect-ratio: 680 / 642; }
.board-anim.board-phone > .board-legend { height: auto; }
.board-anim:empty, .board-anim:empty + .board-caption { display: none; }
.board-caption { margin: 14px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); max-width: 40rem; }
@media (min-width: 1024px) {
  .install-intro { grid-template-columns: minmax(0, 11fr) minmax(0, 9fr); gap: 56px; align-items: center; }
  .install-board { max-width: none; }
}

/* ============================== FAQ ============================== */
.faq-list { border-top: 1px solid var(--rule); margin-top: 40px; }
.faq { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; padding: 20px 0; font-weight: 700; font-size: 17px; letter-spacing: -.01em; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 400; font-size: 22px; color: var(--accent-deep); flex: none; }
.faq[open] summary::after { content: "−"; }
.faq p { margin: 0 0 22px; font-size: 15.5px; line-height: 1.6; color: var(--ink-mid); max-width: 56rem; }

/* ============================== MANIFEST / FOOTNOTE ============================== */
.manifest .container { max-width: 64rem; padding-top: 96px; padding-bottom: 96px; }
.manifest-text em { font-style: italic; font-weight: 300; color: var(--accent-deep); }
.ems-footnote { border-top: 1px solid var(--rule); padding: 32px 0; }
.ems-footnote p { margin: 0; font-size: 13px; color: var(--ink-soft); line-height: 1.6; max-width: 60rem; }
.ems-footnote .upd { margin-top: 8px; font-size: 12px; }


/* ============================== FOOTER (steward-footer) ============================== */
.site-footer .brand-title { color: var(--on-dark); }
.footer-grid { grid-template-columns: 1fr; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr; } }
.footer-links a svg { width: 13px; height: 13px; vertical-align: -2px; margin-left: 3px; }
.footer-contact { margin-top: 18px; font-size: 14.5px; color: var(--on-dark-soft); }
.footer-contact a { color: var(--on-dark); font-weight: 600; }
.footer-legal { font-size: 12.5px; color: var(--on-dark-soft); margin: 12px 0 0; }
.site-footer .footer-bottom { padding-bottom: 40px; }

/* ============================== COMPARISON PAGE ============================== */
.page-top { padding-top: 64px; }
.page-top .back-row { margin: 0 0 24px; }
.page-top .link-arrow { display: inline-flex; align-items: center; gap: 6px; }
.page-top .level-box { margin-top: 48px; }
.cmp-intro { margin-top: 24px; max-width: 48rem; }
.cmp-intro p { margin: 0; font-size: 16.5px; line-height: 1.65; color: var(--ink-mid); }
.cmp-scroll-hint { margin: 16px 0 0; }
.legend-grid { display: grid; grid-template-columns: 1fr; gap: 12px 32px; margin-top: 24px; }
@media (min-width: 768px) { .legend-grid { grid-template-columns: repeat(2, 1fr); } }
.legend-item { display: grid; grid-template-columns: 90px 1fr; gap: 12px; font-size: 14px; line-height: 1.5; color: var(--ink-mid); }
.legend-item .st { font-weight: 700; color: var(--ink); }
.axes-dl { display: grid; grid-template-columns: 1fr; gap: 20px 40px; margin: 32px 0 0; }
@media (min-width: 1024px) { .axes-dl { grid-template-columns: repeat(2, 1fr); } }
.axes-dl dt { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.axes-dl dd { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--ink-mid); }
.method .prose { max-width: 56rem; }
.invite { margin-top: 32px; padding: 24px 28px; border-left: 4px solid var(--accent); background: var(--paper-warm); border-radius: 2px; max-width: 56rem; }
.invite p { margin: 0 0 16px; font-size: 15.5px; line-height: 1.6; }

/* comparison renderer hooks (module classes from comparison.js) */
.cmp-panel { margin: 24px 0; }
.cmp-table { min-width: 720px; }
.cmp-table--full { min-width: 2600px; }
.cmp-table th.cmp-th, .cmp-table td.cmp-cell, .cmp-table th.cmp-product { white-space: normal; vertical-align: top; text-align: left; }
.cmp-table th.cmp-th { min-width: 160px; line-height: 1.35; }
.cmp-table--teaser th.cmp-th { min-width: 200px; }
.cmp-table th.cmp-sticky, .cmp-table td.cmp-sticky { position: sticky; left: 0; z-index: 1; background: var(--panel-dark); box-shadow: 1px 0 0 var(--rule-dark); }
.cmp-table tr.positive th.cmp-sticky { background: var(--panel-dark); }
.cmp-table--full th.cmp-product { min-width: 220px; max-width: 260px; font-weight: 400; }
.cmp-table th.cmp-product { text-transform: none; letter-spacing: 0; font-size: 12.5px; }
.cmp-product-name { display: block; font-weight: 700; font-size: 13px; }
.cmp-vendor, .cmp-category, .cmp-note, .cmp-version { display: block; font-size: 11px; color: var(--on-dark-soft); margin-top: 2px; }
.cmp-note { color: var(--on-dark); }
.cmp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px 2px 6px; border-radius: 999px; font-size: 11px; font-weight: 600; border: 1px solid transparent; }
.cmp-chip-mark { font-weight: 700; }
.cmp-chip--yes { background: rgba(var(--accent-on-dark-rgb), .18); color: var(--accent-on-dark); border-color: rgba(var(--accent-on-dark-rgb), .4); }
.cmp-chip--partly { background: rgba(243, 242, 236, .10); color: #f3f2ec; border-color: rgba(243, 242, 236, .3); }
.cmp-chip--no { background: rgba(224, 103, 74, .16); color: #f0917a; border-color: rgba(224, 103, 74, .4); }
.cmp-chip--unknown { background: transparent; color: var(--on-dark-soft); border-color: rgba(243, 242, 236, .25); border-style: dashed; }
.cmp-text { display: block; margin-top: 6px; font-size: 12px; line-height: 1.45; color: var(--on-dark); }
.cmp-detail { display: none; margin-top: 6px; font-size: 11.5px; line-height: 1.45; color: var(--on-dark-soft); }
.cmp-table--detail .cmp-detail { display: block; }
.cmp-fn { margin-left: 4px; }
.cmp-fn a { color: var(--accent-on-dark); text-decoration: none; }
.cmp-count { display: block; margin-top: 4px; font-size: 10.5px; color: var(--on-dark-soft); }
.cmp-legend { margin-top: 20px; }
.cmp-legend .legend { flex-wrap: wrap; }
.cmp-axes { margin: 12px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 32px; font-size: 13px; }
.cmp-axes dt { font-weight: 700; }
.cmp-axes dd { margin: 0; color: var(--on-dark-soft); }
.cmp-axes-wrap, .cmp-sources-wrap { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--rule-dark); }
.cmp-sources { font-size: 11.5px; color: var(--on-dark-soft); column-count: 2; column-gap: 32px; padding-left: 28px; }
.cmp-sources li { margin-bottom: 4px; break-inside: avoid; }
.cmp-sources a { color: var(--on-dark); word-break: break-all; }
.cmp-sources li:target, .cmp-sources li.is-target { color: var(--accent-on-dark); }
.cmp-toolbar { margin-bottom: 12px; }
.cmp-toolbar .toggle-row { max-width: 480px; flex-wrap: wrap; }
.cmp-toolbar .toggle-btn { flex: 1 1 auto; white-space: nowrap; }
.cmp-panel .legend, .cmp-panel .fineprint, .cmp-panel .cmp-teaser-note { color: var(--on-dark-soft); }
.cmp-panel .fineprint a { color: var(--accent-on-dark); }
@media (max-width: 720px) { .cmp-axes { grid-template-columns: 1fr; } .cmp-sources { column-count: 1; } }
@media (max-width: 640px) {
  /* a narrow product column leaves room for the cells; name and version stay, the rest is in the sources */
  .cmp-table--full th.cmp-product { min-width: 132px; max-width: 132px; }
  .cmp-table--full .cmp-vendor, .cmp-table--full .cmp-category, .cmp-table--full .cmp-note { display: none; }
  .cmp-table--full th.cmp-th { min-width: 150px; }
}

/* ============================== FOCUS, MOTION, PHONE ============================== */
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
/* on the dark panels the ring uses the panel accent, so it holds 3:1 in the light theme too */
.viz-dark :focus-visible, .svc-card :focus-visible, .section-dark :focus-visible, .site-footer :focus-visible { outline-color: var(--accent-on-dark); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
@media (max-width: 640px) {
  .hero { padding: 56px 0 64px; }
  .section { padding: 64px 0; }
  .stats { gap: 16px 24px; margin-top: 40px; }
  .stat-divider { display: none; }
  .svc-card { padding: 32px 22px 28px; }
  .fair { padding: 20px 18px; }
  .plan-quote { padding: 16px 16px; }
  .viz, .viz-dark { padding: 22px 16px; }
}
html, body { overflow-x: clip; }
