/* ---- /tools: the homepage's parts (stage bezel, Rubber Segment, command band, Copy, spotlight cards, rule-card
   tiles) arranged as a reference. Tokens and spacing come from styles.css; tables and code wells from docs.css. */

/* hero: the line and what it is on the left, the connect card (the homepage installer's parts) on the right */
.thero { padding-top: var(--s-7); }
.thero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 33rem; column-gap: var(--col-gap); align-items: end; }
.th1 { font-size: 3.5rem; max-width: 15ch; }
.thero .lede code { padding: 0.0625rem 0.375rem; border-radius: 4px; background: var(--raised); box-shadow: inset 0 0 0 1px var(--line-strong); font-size: 0.875em; white-space: nowrap; }
.tconnect-seg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tconnect-seg .seg-item { padding: 0 var(--s-5); }
/* a URL is pasted, not run: no prompt before it */
.cmdbar[data-url] .ps { display: none; }
@media (max-width: 1079px) { .thero-grid { grid-template-columns: minmax(0, 1fr); row-gap: var(--s-6); } .tconnect { max-width: 36rem; } }
@media (max-width: 767px) {
  .thero { padding-top: var(--s-6); }
  .th1 { font-size: 2.375rem; line-height: 1.08; }
  .thero-grid { row-gap: var(--s-5); }
}

/* ---- the explorer in the bezel. It sits flat: DESIGN.md allows two leaning devices (the stage and the analyst panel) */
.tstage .stage-scene { width: min(100%, 76rem); }
.tstage .stage-lean { --tilt: 0deg; }
.xrail { flex-wrap: nowrap; }
.xseg { grid-template-columns: repeat(6, minmax(0, 1fr)); flex: none; }
.xseg .seg-item { height: 2.25rem; padding: 0 var(--s-3); gap: var(--s-2); }
.seg-n { font-size: 0.75rem; color: var(--ink-3); font-variant-numeric: tabular-nums; transition: color 160ms var(--ease-smooth); }
.seg-item[aria-selected='true'] .seg-n { color: var(--pop-up); }
.xcap { white-space: normal; }

.xscreen { height: 31rem; }
.xscreen::after { z-index: 1; }
.xgrid { display: grid; grid-template-columns: 15rem minmax(0, 1fr); height: 100%; }
.xlist { display: flex; flex-direction: column; gap: 2px; padding: var(--s-3) var(--s-2); border-right: 1px solid var(--line); overflow-y: auto; scrollbar-width: thin; }
.xitem { position: relative; display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); min-height: 2.25rem; padding: 0 var(--s-3); border-radius: 7px; text-align: left; font: 500 0.8125rem var(--font-mono); font-feature-settings: "liga" 0; color: var(--ink-3); transition: color 160ms var(--ease-smooth), background-color 160ms var(--ease-smooth); }
.xitem span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (hover: hover) { .xitem:hover { color: var(--ink); background: #0e1310; } }
.xitem[aria-selected='true'] { color: var(--ink); background: var(--raised); box-shadow: inset 0 0 0 1px #34453a; }
.xitem[aria-selected='true']::before { content: ''; position: absolute; left: 0; top: var(--s-2); bottom: var(--s-2); width: 2px; border-radius: 2px; background: var(--pop-up); box-shadow: 0 0 10px rgb(74 222 128 / 0.7); }
.xitem:focus-visible { outline-offset: -2px; }
/* tools that also run on the hosted connector say so in words */
.xchip { flex: none; padding: 0 0.375rem; border-radius: 4px; font: 500 0.75rem/1.5 var(--font-mono); font-style: normal; color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--line-strong); }
.xitem[aria-selected='true'] .xchip { color: var(--ink-2); }

.xdetail { position: relative; display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; padding: var(--s-5) var(--s-6); overflow-y: auto; scrollbar-width: thin; }
.xhead { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); }
.xname { margin: 0; font: 600 1.625rem/1.15 var(--font-mono); letter-spacing: -0.03em; color: var(--ink); overflow-wrap: anywhere; }
.xdesc { margin: 0; max-width: 64ch; font-size: 0.9375rem; line-height: 1.6; color: var(--ink-2); }
.xlabel { margin: var(--s-2) 0 0; font: 500 0.75rem var(--font-mono); color: var(--ink-3); }
/* the command band runs the pane's full width, hairlines above and below, as on the installer */
.xcmd { margin-inline: calc(-1 * var(--s-6)); padding-left: var(--s-6); flex: none; }
.xcmd .cmd { font-size: 0.8125rem; }
.xparams { margin-top: var(--s-1); }
.xparams .ttable { font-size: 0.8125rem; }
.xmore { align-self: flex-start; display: inline-flex; align-items: center; min-height: 2.75rem; margin-top: auto; font: 500 0.8125rem var(--font-mono); color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--ink-4); text-underline-offset: 0.35em; transition: color 200ms var(--ease-smooth), text-decoration-color 200ms var(--ease-smooth); }
@media (hover: hover) { .xmore:hover { color: var(--ink); text-decoration-color: var(--pop-up); } }
/* a new tool fades up in place; the command types itself (tools.js) */
@keyframes x-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) { .xdetail[data-in] > :not(.xcmd) { animation: x-in 260ms var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1)) both; } }
html:not(.js) .xseg .seg-item:not([aria-selected='true']) { pointer-events: none; }

@media (max-width: 1023px) {
  .xrail { flex-wrap: wrap; }
  .xseg { width: 100%; }
}
@media (max-width: 767px) {
  .xseg { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: row; }
  .xseg .seg-item { height: 2.75rem; }
  .xcap { min-height: 2.6em; }
  .xscreen { height: auto; }
  .xgrid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; }
  /* the group's tools become one scrolling strip, faded at the edge so it reads as more */
  .xlist { flex-direction: row; gap: var(--s-1); padding: var(--s-2) var(--s-5); border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--s-5), #000 calc(100% - var(--s-7)), transparent); mask-image: linear-gradient(90deg, transparent, #000 var(--s-5), #000 calc(100% - var(--s-7)), transparent); }
  .xlist::-webkit-scrollbar { display: none; }
  .xitem { flex: none; min-height: 2.75rem; }
  .xitem[aria-selected='true']::before { left: var(--s-3); right: var(--s-3); top: auto; bottom: 0; width: auto; height: 2px; }
  .xdetail { padding: var(--s-4); min-height: 30rem; overflow: visible; }
  .xcmd { margin-inline: calc(-1 * var(--s-4)); padding-left: var(--s-4); }
  .xname { font-size: 1.375rem; }
}

/* ---- badges: one neutral chip; the words say hosted or local (green stays for live, selected and confirmed) */
.tbadge { display: inline-flex; align-items: center; height: 1.375rem; padding: 0 var(--s-2); border-radius: 4px; font: 500 0.75rem var(--font-mono); white-space: nowrap; color: var(--ink-2); background: #151b17; box-shadow: inset 0 0 0 1px var(--line-strong); }
.tbadge-host { color: var(--ink); }

/* ---- tables inside cards and the device: the homepage table, compact, hairline rows */
.ttable { font-size: 0.8125rem; }
.ttable th, .ttable td { padding: var(--s-2) var(--s-3) var(--s-2) 0; vertical-align: baseline; }
.ttable thead th { padding-block: var(--s-2); font-size: 0.75rem; }
.ttable tbody th code { font-size: 0.8125rem; color: var(--ink); white-space: nowrap; }
.ttable td { color: var(--ink-2); }
.ttable td:nth-child(2), .ttable td:nth-child(3) { font: 400 0.75rem var(--font-mono); white-space: nowrap; }
.ttable td:last-child { font: inherit; color: var(--ink-2); text-align: left; white-space: normal; padding-right: 0; }
.ttable thead th:last-child { text-align: left; }
.ttable td code { padding: 0 0.3125rem; border-radius: 4px; background: rgb(237 242 238 / 0.05); box-shadow: inset 0 0 0 1px var(--line); font-size: 0.75rem; white-space: nowrap; }
.ttable tbody tr:last-child th, .ttable tbody tr:last-child td { border-bottom: 0; }
.treq { color: var(--ink); }
.tdim, .tdot { color: var(--ink-3); }
.tnone { margin: 0; font: 400 0.8125rem var(--font-mono); color: var(--ink-3); }

/* ---- reference: contents column, then one section per group of spotlight cards */
.tref { padding-bottom: var(--section); }
.tdocs { grid-template-columns: 13rem minmax(0, 1fr); margin-top: 0; }
/* six groups with their counts; only the group being read lists its tools (tools.js), so the column fits one
   screen. It sits on the page colour, so the trench never runs through the names. */
.ttoc { background: var(--bg); box-shadow: 0 0 0 var(--s-3) var(--bg); }
.ttoc-g + .ttoc-g { margin-top: var(--s-2); }
.toc-list a.ttoc-group { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); min-height: 2rem; padding: 0 var(--s-3) 0 0; border-left: 0; font: 500 0.8125rem var(--font-mono); color: var(--ink-2); }
.toc-list a.ttoc-group[aria-current] { color: var(--ink); }
.ttoc-group span { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ttoc .ttoc-items a { padding-block: 0.25rem; }
html[data-toc-js] .ttoc-g:not([data-open]) .ttoc-items { display: none; }

.tgroup + .tgroup { margin-top: var(--s-8); }
.tgroup-head { display: flex; flex-direction: column; gap: var(--s-2); margin-bottom: var(--s-5); }
.tgroup-title { margin: 0; font: 600 1.75rem/1.12 var(--font-mono); letter-spacing: -0.035em; }
.tgroup-line { margin: 0; max-width: 60ch; color: var(--ink-2); font-size: 0.9375rem; }
.tgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); align-items: start; }

/* a tool: React Bits Spotlight Card (light and edge drawn from --sx, --sy, --sp set by ui.js spotlightGrid) */
.tcard { --sx: 50%; --sy: 0%; --sp: 0; position: relative; isolation: isolate; display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-5); border-radius: 16px; background: #0e1310; box-shadow: inset 0 0 0 1px var(--line-strong), inset 0 1px 0 rgb(255 255 255 / 0.04), 0 30px 60px -30px rgb(0 0 0 / 0.9); scroll-margin-top: calc(var(--bar-h) + var(--s-5)); }
.tcard-light, .tcard-edge { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: var(--sp); }
.tcard-edge { z-index: 2; padding: 1px; -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
/* the light is drawn only while the pointer is near (ui.js sets data-lit) or a key has focus inside the card */
.tcard[data-lit] .tcard-light, .tcard:has(:focus-visible) .tcard-light { z-index: -1; background: radial-gradient(circle 16rem at var(--sx) var(--sy), rgb(74 222 128 / 0.12), rgb(74 222 128 / 0.03) 45%, transparent 72%); }
.tcard[data-lit] .tcard-edge, .tcard:has(:focus-visible) .tcard-edge { background: radial-gradient(circle 10rem at var(--sx) var(--sy), rgb(74 222 128 / 0.9), rgb(74 222 128 / 0.2) 50%, transparent 80%); }
.tcard-light { z-index: -1; }
.tcard:has(:focus-visible) { --sp: 1; --sx: 50%; --sy: 0%; }
.tcard:target { box-shadow: inset 0 0 0 1px #3a4c41, inset 0 1px 0 rgb(255 255 255 / 0.06), 0 30px 60px -30px rgb(0 0 0 / 0.9); }
.tcard-name { margin: 0; font: 600 1rem/1.3 var(--font-mono); letter-spacing: -0.01em; font-feature-settings: "liga" 0; overflow-wrap: anywhere; }
.tcard-name a { transition: color 160ms var(--ease-smooth); }
@media (hover: hover) { .tcard-name a:hover { color: var(--pop-up); } }
/* two lines on the face, the same height on every card, so closed rows line up; the full text is in Details */
.tcard-sum { margin: 0; min-height: calc(2 * 1.55em); font-size: 0.875rem; line-height: 1.55; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
html:not(.js) .tcard-sum { display: none; }
.tcard-meta { display: flex; align-items: center; gap: var(--s-3); margin-top: var(--s-2); }
.tcard-count { font: 400 0.75rem var(--font-mono); color: var(--ink-3); white-space: nowrap; }
.tcard-toggle { display: inline-flex; align-items: center; gap: var(--s-2); height: 2.25rem; margin-left: auto; padding: 0 var(--s-3); border-radius: 8px; border: 1px solid var(--line-strong); font: 500 0.75rem var(--font-mono); color: var(--ink-2); transition: color 200ms var(--ease-smooth), border-color 200ms var(--ease-smooth), background-color 200ms var(--ease-smooth); }
.tcard-toggle svg { width: 0.875rem; height: 0.875rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
@media (hover: hover) { .tcard-toggle:hover { color: var(--ink); border-color: #3a4a40; background: #111612; } }
.tcard-toggle:active { transform: scale(0.97); }
.tcard[data-accordion-status='active'] .tcard-toggle { color: var(--ink); }
.tcard[data-accordion-status='active'] .faq-plus { display: none; }
html:not(.js) .tcard-toggle { display: none; }
/* Osmo Accordion CSS Animation: the body opens by its grid row, so it animates to its own height */
.tcard-bottom { display: grid; grid-template-rows: 1fr; }
html.js .tcard-bottom { grid-template-rows: 0fr; transition: grid-template-rows 600ms var(--ease-osmo); }
html.js .tcard[data-accordion-status='active'] .tcard-bottom { grid-template-rows: 1fr; }
.tcard-wrap { min-height: 0; overflow: hidden; }
html.js .tcard:not([data-accordion-status='active']) .tcard-wrap { visibility: hidden; transition: visibility 0s linear 600ms; }
.tcard-body { display: flex; flex-direction: column; gap: var(--s-4); margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--line); }
.tcard-desc { margin: 0; font-size: 0.875rem; line-height: 1.65; color: var(--ink-2); overflow-wrap: anywhere; }
.tcard-body .ttable { width: 100%; }
.tcode { margin: 0; }
.tcode pre { padding-right: var(--s-4); }
.tcode code { display: block; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.tcode-label { display: block; margin-bottom: var(--s-1); font-size: 0.75rem; color: var(--ink-3); }
.tprompt { display: flex; flex-direction: column; gap: var(--s-1); margin: 0; font-size: 0.9375rem; line-height: 1.5; color: var(--ink); }
.tprompt-who { font: 500 0.75rem var(--font-mono); color: var(--ink-3); }

@media (max-width: 1279px) { .tgrid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 991px) {
  .tdocs { grid-template-columns: minmax(0, 1fr); }
  /* the folded card sticks flush under the bar, so nothing scrolls through a gap above it */
  .ttoc { top: var(--bar-h); box-shadow: inset 0 0 0 1px var(--line-strong), 0 16px 32px -16px rgb(0 0 0 / 0.9), 0 calc(-1 * var(--s-2)) 0 var(--bg); }
  .toc-list a.ttoc-group { min-height: 2.75rem; }
  /* folded on a phone, every group lists its tools */
  html[data-toc-js] .ttoc-g:not([data-open]) .ttoc-items { display: block; }
}
@media (max-width: 767px) {
  .tgroup + .tgroup { margin-top: var(--s-7); }
  .tgroup-title { font-size: 1.5rem; }
  .tcard { padding: var(--s-4); }
  .tcard-toggle { height: 2.75rem; }
  /* params stack: name, type and need on one line, the allowed values under them, so nothing is dropped */
  .ttable thead { display: none; }
  .ttable tr { display: grid; grid-template-columns: auto auto 1fr; column-gap: var(--s-3); align-items: baseline; padding-block: var(--s-2); border-bottom: 1px solid var(--line); }
  .ttable tbody tr:last-child { border-bottom: 0; }
  .ttable th, .ttable td { display: block; padding: 0; border: 0; }
  .ttable td:last-child { grid-column: 1 / -1; padding-top: var(--s-1); }
}
@media (pointer: coarse) { .tcard-toggle, .xitem { min-height: 2.75rem; } }
@media (prefers-reduced-motion: reduce) { html.js .tcard-bottom { transition: none; } }
