/* Homepage below the map. Loads after fasra.css. Tokens only. */
@import url("../static/preact/kit/kit.css");
@import url("../os/kit/kit.css");
@import url("../os/chat/chat.css");

.hm-small { font-size: 13px; }
.hm-slot { min-width: 0; }

/* 1. Baseline's own cards in place of the old placeholder (overrides .card.split from fasra.css) */
.card.split.hm-base { padding-right: var(--sp-5); padding-bottom: var(--sp-5); align-items: start; }
.card.split.hm-base .txt { padding-bottom: 0; }
.hm-board { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-3); }
.card.soon .hm-draw { margin-top: var(--sp-4); color: var(--text-secondary); }
.hm-draw svg { display: block; height: auto; }
.hd-page { fill: var(--surface-1); stroke: var(--border-subtle); }
.hd-line { fill: var(--border); }
.hd-acc { fill: var(--chart-3); }
.hd-axis { stroke: var(--border); stroke-width: 1; }
.hd-good { fill: var(--chart-1); }
.hd-bad { fill: var(--chart-4); }
.hd-slot { fill: color-mix(in oklab, var(--chart-3) 10%, var(--surface-1)); stroke: var(--chart-3); }
.hm-draw.wait { -webkit-mask-image: linear-gradient(transparent, transparent); mask-image: linear-gradient(transparent, transparent); }

/* 2. The answer that becomes a panel */
.hm-ask { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--sp-5); align-items: stretch; padding-inline: var(--sp-2); }
.hm-thread { display: flex; flex-direction: column; gap: var(--sp-4); padding: var(--sp-5); }
.hm-dash { padding: var(--sp-4); }
.hm-dash-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-3); font-size: 13px; line-height: var(--lh-2); color: var(--text-secondary); }
.hm-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-3); }
.hm-wide { grid-column: 1 / -1; }
.hm-drop { min-height: 146px; border-radius: 12px; outline: 1px dashed var(--border); outline-offset: -1px; }
.hm-drop.full { outline-color: transparent; }
.hm-drop .ch-card { margin-left: 0; }
.hm-ghost { border-radius: 12px; outline: 1px dashed var(--border); outline-offset: -1px; }
.hm-thread { justify-content: flex-end; }
.hm-act { display: flex; justify-content: center; padding-top: var(--sp-5); }
.hm-act .btn { min-height: 40px; }

/* 3. How it works */
.hm-how { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--sp-5); align-items: stretch; padding-inline: var(--sp-2); }
.hm-steps { list-style: none; margin: 0; padding: 0; counter-reset: s; display: grid; grid-auto-rows: 1fr; gap: var(--sp-2); }
.hm-steps li { counter-increment: s; display: grid; grid-template-columns: var(--sp-7) minmax(0, 1fr); align-content: start; padding: var(--sp-4); }
.hm-steps li::before { content: counter(s); grid-row: span 2; font-size: 15px; line-height: var(--lh-3); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.hm-steps b { font-size: 15px; line-height: var(--lh-3); font-weight: 500; }
.hm-steps span { font-size: 14px; line-height: var(--lh-2); color: var(--text-secondary); }
.hm-how-cards { display: grid; gap: var(--sp-3); }
.hm-map .kit-gbox { aspect-ratio: auto; height: 320px; }
/* While the renderer loads, hold the canvas box rather than the node list, so the card keeps its height. */
.hm-map .kit-graph.loading .kit-gbox { display: block; }
.hm-map .kit-graph.loading .kit-nodes { display: none; }

/* 4. Checks */
.hm-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); padding: 0 var(--sp-2); }
.hm-checks .card .hm-slot { margin-top: var(--sp-4); }
.hm-fix { margin: var(--sp-4) 0 0; font-size: 13px; line-height: var(--lh-2); }
.hm-fix div { display: flex; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-2) 0; }
.hm-fix div + div { border-top: 1px solid var(--border-subtle); }
.hm-fix dt { color: var(--text-secondary); }
.hm-fix dd { margin: 0; text-align: right; }
.hm-fix s { color: var(--text-secondary); }
.hm-said { margin-top: var(--sp-4); }
.hm-said p { font-size: 14px; line-height: var(--lh-2); }

/* Each slot holds the height of the card it will get, so nothing below moves when the card mounts. */
[data-card$="-list"]:empty { min-height: 227px; }
[data-card$="-chart"]:empty { min-height: 291px; }
[data-card="dash-chart"]:empty { min-height: 191px; }
[data-card="ask-stat"]:empty { min-height: 146px; }
[data-card="how-steps"]:empty { min-height: 223px; }
[data-card="how-graph"]:empty { min-height: 407px; }
[data-card="check-choice"]:empty { min-height: 199px; }
[data-card="check-broken"]:empty { min-height: 66px; }

/* 5. Claude chat specimen (fills fasra.css's .duo .r, which was sized for a placeholder) */
.duo .r.hm-claude { display: flex; flex-direction: column; gap: var(--sp-4); padding: var(--sp-6); }

@media (max-width: 900px) {
  .hm-board, .hm-ask, .hm-how { grid-template-columns: minmax(0, 1fr); }
  .hm-checks { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .card.split.hm-base { padding: var(--sp-4); }
  .hm-ask, .hm-how, .hm-checks { padding-inline: 0; }
  .hm-thread, .duo .r.hm-claude { padding: var(--sp-4); }
  .hm-grid { grid-template-columns: minmax(0, 1fr); }
  .hm-claude .ch-card, .hm-thread .ch-card { margin-left: 0; }
  [data-card="dash-chart"]:empty { min-height: 211px; }
  [data-card="check-choice"]:empty { min-height: 219px; }
  [data-card="check-broken"]:empty { min-height: 86px; }
}
@media (max-width: 440px) { [data-card="check-broken"]:empty { min-height: 106px; } }
@media (prefers-reduced-motion: reduce) {
  .hm-draw.wait { -webkit-mask-image: none; mask-image: none; }
}

/* Round 1 review: one section gap, 12px floor, 40px touch targets, phone length. */
#products ~ .spacer { height: var(--sp-5); }
#products .head, #panel .head, #how .head, #checked .head { padding-top: var(--sp-7); padding-bottom: var(--sp-6); }
#products .tag { font-size: 12px; }
.hm-slot .kit-ax { font-size: 12px; }
.duo .l { justify-content: center; }
/* Under .card p in the cascade unless it names the card too. */
.hm-cap, .card p.hm-cap { margin: var(--sp-4) 0 var(--sp-2); font-size: 12px; line-height: var(--lh-1); color: var(--text-secondary); }
.hm-code { display: block; padding: var(--sp-2) var(--sp-3); font-size: 12px; line-height: var(--lh-1); overflow-x: auto; white-space: nowrap; }
.hm-checks [data-card="check-broken"] { margin-top: var(--sp-2); }
.hm-olds summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; min-height: var(--h-1); }
.hm-olds summary::-webkit-details-marker { display: none; }
.hm-olds[open] summary { color: var(--text-primary); }
.hm-olds span { display: inline-flex; gap: var(--sp-3); margin-left: var(--sp-3); }
.hm-olds a { display: inline-flex; align-items: center; min-height: var(--h-1); }
.hm-grid [data-card$="-stat"]:empty, .hm-drop { min-height: 146px; }
@media (pointer: coarse), (max-width: 760px) {
  #products .btn, #panel .btn, .duo .btn, .hm-slot .kit-opts button { min-height: 40px; }
  footer ul a, .hm-olds summary, .hm-olds a { min-height: 40px; }
  .hm-map .gl-label { min-height: 40px; display: flex; flex-direction: column; justify-content: center; box-sizing: border-box; margin-block: -10px; }
}
@media (max-width: 760px) {
  #products .head, #panel .head, #how .head, #checked .head { padding-top: var(--sp-6); padding-bottom: var(--sp-4); }
  #products ~ .spacer { height: var(--sp-4); }
  .hm-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .hm-grid .kit-stat-v { font-size: 32px; line-height: 40px; }
  .card.soon { display: grid; grid-template-columns: minmax(0, 1fr) 112px; column-gap: var(--sp-4); align-items: center; }
  .card.soon h3, .card.soon p { grid-column: 1; }
  .card.soon .hm-draw { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; }
  .hm-steps { grid-auto-rows: auto; }
  .hm-steps li { padding: var(--sp-3) var(--sp-4); }
  .hm-olds span { flex-wrap: wrap; margin-left: 0; }
  .hm-olds[open] { display: grid; }
}
[data-card="claude-rival"]:empty { min-height: 234px; }
footer .base { flex-wrap: wrap; gap: var(--sp-2); }
.hm-olds span { flex-wrap: wrap; }
.hm-olds:not([open]) span { display: none; }
@media (pointer: coarse), (max-width: 760px) { [data-card="check-choice"]:empty { min-height: 243px; } }
/* The error line's height is held whether or not it has mounted, so its wrap never moves the page. */
[data-card="check-broken"] { min-height: 66px; }
@media (max-width: 900px) { [data-card="check-broken"], [data-card="check-broken"]:empty { min-height: 106px; } }
@media (max-width: 440px) { .hm-grid [data-card$="-stat"]:empty, .hm-drop { min-height: 158px; } }
@media (max-width: 360px) { .hm-grid [data-card$="-stat"]:empty, .hm-drop { min-height: 198px; } }

/* Round 2 review */
/* Anchors land below the sticky 64px header with some air. */
#products, #panel, #how, #checked, footer { scroll-margin-top: 88px; }
/* One left and right edge: the header's. The frame already insets by --sp-5, so sections add none of their own. */
#products .bento, .hm-ask, .hm-how, .hm-checks { padding-inline: 0; }
.duo .l { padding-left: 0; }
#map + .spacer { height: 0; }
.head p, .card p, .duo .l p { text-wrap: pretty; }
.head h2, .head p { text-wrap: balance; }

/* Baseline card: both kit cards the same height, prompt names wrap to two lines before they cut. */
.hm-board { align-items: stretch; }
.hm-board .hm-slot { display: flex; flex-direction: column; }
.hm-board .hm-slot > .kit-card { flex: 1; }
.hm-slot .kit-nm { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hm-facts { max-width: 22em; }

/* Coming agents: small real pictures of what each will make. */
.hm-pic { box-sizing: border-box; padding: var(--sp-3) var(--sp-4); font-size: 13px; line-height: var(--lh-2); color: var(--text-primary); display: flex; flex-direction: column; gap: var(--sp-1); }
.card.soon .hm-pic { margin-top: auto; }
.card.soon h3 + p { margin-bottom: var(--sp-4); }
.hm-pic b { font-weight: 500; font-size: 14px; }
.hm-pic p { margin: 0; max-width: none; font-size: 13px; color: var(--text-secondary); }
.hm-pic mark { background: color-mix(in oklab, var(--chart-3) 22%, transparent); color: var(--text-primary); border-radius: 3px; padding: 0 2px; }
.hm-pk, .hm-pf, .hm-url { font-size: 12px; line-height: var(--lh-1); color: var(--text-secondary); }
.hm-url { color: var(--leaf-text, var(--text-secondary)); }
.hm-pf { margin-top: var(--sp-2); padding-top: var(--sp-2); border-top: 1px solid var(--border-subtle); }
.hm-split { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; margin: var(--sp-2) 0; }
.hm-split i { width: var(--w); }
.hm-split i:nth-child(1), .hm-leg div:nth-child(1) i { background: var(--chart-1); }
.hm-split i:nth-child(2), .hm-leg div:nth-child(2) i { background: var(--chart-3); }
.hm-split i:nth-child(3), .hm-leg div:nth-child(3) i { background: var(--chart-4); }
.hm-leg { margin: 0; }
.hm-leg div { display: flex; justify-content: space-between; padding: 2px 0; }
.hm-leg dt { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--text-secondary); }
.hm-leg dt i { width: 8px; height: 8px; border-radius: 50%; }
.hm-leg dd { margin: 0; }

/* Ask: messages start at the top, the slot the card leaves says where it went. */
.hm-thread { justify-content: flex-start; }
.hm-ghost { display: flex; align-items: center; justify-content: center; font-size: 13px; line-height: var(--lh-2); color: var(--text-secondary); }

/* How it works: steps sized to their text, the task card under them, the map beside both. */
.hm-how-l { display: flex; flex-direction: column; gap: var(--sp-3); }
.hm-steps { grid-auto-rows: auto; }
.hm-map { display: flex; flex-direction: column; }
.hm-map > .kit-card { flex: 1; display: flex; flex-direction: column; }
.hm-map .kit-b { flex: 1; display: flex; flex-direction: column; }
.hm-map .kit-graph { flex: 1; display: flex; flex-direction: column; }
.hm-map .kit-gbox { flex: 1; min-height: 320px; }
/* Inset the stage inside its clipped box so labels at the rim are never cut. */
/* The renderer keeps labels inside the region and off hub orbs, so the canvas uses the whole box. */
[data-card="how-graph"]:empty { min-height: 600px; }

/* Claude: left column fills with what you can ask. */
.duo .l { justify-content: flex-start; padding-top: var(--sp-6); }
.hm-asklab { margin: var(--sp-5) 0 var(--sp-2); font-size: 12px; line-height: var(--lh-1); font-weight: 500; color: var(--text-secondary); }
/* One width in px for both lists in the column: their text sizes differ, so an em width gave two right edges. */
.hm-asks { list-style: none; margin: 0; padding: 0; width: 100%; max-width: 364px; }
.hm-asks li { padding: var(--sp-2) 0; font-size: 14px; line-height: var(--lh-2); border-top: 1px solid var(--border-subtle); }
.hm-asks li:last-child { border-bottom: 1px solid var(--border-subtle); }

@media (max-width: 900px) {
  [data-card="how-graph"]:empty { min-height: 407px; }
  .hm-map .kit-gbox { min-height: 320px; height: 320px; }
}
@media (max-width: 760px) {
  .card.soon { display: flex; }
  .duo .l { padding: var(--sp-6) 0 var(--sp-4); }

}
#products .head { padding-top: var(--sp-5); }
.hm-board .kit-list li { height: auto; min-height: var(--h-2); padding-block: var(--sp-1); box-sizing: border-box; }
.hm-slot .kit-nm { line-height: var(--lh-1); }
.hm-drop:not(.full) { display: flex; align-items: center; justify-content: center; }
.hm-drop:not(.full)::before { content: "Cards you keep land here"; font-size: 13px; line-height: var(--lh-2); color: var(--text-secondary); }
[data-card="base-list"]:empty { min-height: 243px; }
@media (min-width: 761px) { [data-card="base-list"]:empty { min-height: 291px; } }
.hm-dash .hm-act { padding-top: var(--sp-3); justify-content: flex-start; }
footer .base { align-items: baseline; }
@media (max-width: 760px) { footer .base { padding-inline: 0; } }
/* Round 3 */
.hm-kinds { width: 100%; max-width: 364px; }
.duo .l > .btn { margin-top: var(--sp-4); }
.hm-ask { align-items: start; }
.card.soon .hm-pic { margin-top: 0; flex: 1; }
.card.soon > p { min-height: calc(2 * var(--lh-2)); }
@media (max-width: 1100px) and (min-width: 901px) {
  .card.split.hm-base { grid-template-columns: minmax(0, 1fr); }
  .card.soon > p { min-height: calc(3 * var(--lh-2)); }
}
@media (min-width: 761px) { .duo .l { justify-content: flex-end; padding-bottom: 33px; } }
.duo .l .hm-kinds { margin-top: 0; }
@media (max-width: 1100px) and (min-width: 901px) {
  .card.split.hm-base .txt { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--sp-6); align-content: start; }
  .card.split.hm-base .txt > * { grid-column: 1; }
  .card.split.hm-base .txt > .hm-facts { grid-column: 2; grid-row: 1 / span 3; align-self: start; max-width: none; margin-top: 0; }
  .card.split.hm-base .txt > .btn { grid-column: 2; grid-row: 4; justify-self: start; }
}
@media (pointer: coarse), (max-width: 760px) {
  footer .mark { position: relative; }
  footer .mark::after { content: ""; position: absolute; inset: -6px -4px; }
}

/* The switch between the visitor's site and Fasra's products (fasra.js sw), the UI library's segmented control, set
   in the map's top right corner. Its thumb rules are ui.css's own, which the home page does not load whole. */
.graph .gswitch { position: absolute; right: max(var(--sp-5), calc((100% - var(--frame)) / 2 + var(--sp-5))); top: var(--sp-3); z-index: 3; }
.graph .gswitch .ui-seg { position: relative; isolation: isolate; }
.graph .gswitch .ui-seg > label { z-index: 1; }
.graph .gswitch .ui-seg > label:has(input:checked) { background: transparent; }
.graph .gswitch .ui-seg-th { position: absolute; left: 0; top: var(--y, 2px); width: var(--w, 0); height: var(--h, 0); border-radius: calc(var(--radius) - 2px); background: var(--fill-active); transform: translateX(var(--x, 0)); pointer-events: none; }
.graph .gswitch .ui-seg.ready .ui-seg-th { transition: transform var(--dur-sheet) var(--ease-out), width var(--dur-sheet) var(--ease-out); }
.graph .gswitch-note { position: absolute; right: max(var(--sp-5), calc((100% - var(--frame)) / 2 + var(--sp-5))); top: calc(var(--sp-3) + var(--sp-7) - var(--sp-1)); z-index: 3; max-width: 260px; margin: 0; font-size: 13px; line-height: var(--lh-1); color: var(--text-secondary); text-align: right; }
@media (max-width: 940px) { .graph .gswitch { top: var(--sp-2); } .graph .gswitch-note { top: var(--sp-7); } }

/* The last thing a card gives to fit its box (fasra.js fit, d-one): each tile's name keeps to one line, whole in the
   tile's title, so the card's bottom padding stays whole. */
.gpanel.d-one .gp-tiles .gp-tile b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* After that the tiles' heading sits closer to them (d-snug), and last the tiles take a third column (d-c3). */
.gpanel.d-snug .gp-side h4 { margin-bottom: var(--sp-2); }
.gpanel.d-c3 .gp-tiles:not(.gp-stack) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
