/* Inventarc layout: the house fixed left navigation with every section visible
   at once, the stage track, the dashboard, and Leonardo's presence. */

/* ---------------------------------------------------------- shell */

.shell { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; }

.rail {
  position: fixed; inset: 0 auto 0 0; width: var(--rail);
  background: var(--rail-bg); color: var(--rail-ink);
  display: flex; flex-direction: column;
  border-right: 1px solid rgba(0,0,0,.45);
  overflow-y: auto; z-index: 40;
}
.rail__head { padding: 1.35rem 1.25rem 1rem; display: flex; align-items: center; gap: .7rem; }
.rail__head .wordmark { color: var(--rail-ink); font-size: 1.22rem; }
.rail__head .wordmark .arcsyl { color: var(--brass-2); }
.rail__head .mark { color: var(--rail-ink); }

.rail nav { padding: .25rem .75rem 1rem; }
.rail h4 {
  font: 600 .7rem/1 var(--text); letter-spacing: .13em; text-transform: uppercase;
  color: var(--rail-ink-faint); margin: 1.3rem .5rem .5rem; font-family: var(--text);
}
.rail a {
  display: flex; align-items: center; gap: .62rem;
  padding: .5rem .55rem; border-radius: 8px;
  color: var(--rail-ink); text-decoration: none; font-size: .93rem;
  position: relative;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), padding-left var(--t) var(--ease);
}
.rail a:hover { background: rgba(255,255,255,.08); color: #FFF; padding-left: .8rem; }
.rail a:focus-visible { outline: 2px solid var(--brass-2); outline-offset: 1px; }
.rail a.on { background: var(--rail-on-bg); color: var(--rail-on-ink); }
.rail a.on::before {
  content: ""; position: absolute; left: -.75rem; top: 50%; translate: 0 -50%;
  width: 3px; height: 62%; border-radius: 0 3px 3px 0; background: var(--brass);
  animation: railmark var(--t) var(--ease-out);
}
/* A rail link that is not yet reachable is dimmed, but never below the readable floor. */
.rail a.muted { color: var(--rail-ink-faint); }
@keyframes railmark { from { height: 0; opacity: 0; } to { opacity: 1; } }

/* stage dot in the rail: shows where the inventor is on the path */
.rail .dot {
  width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto;
  border: 1.6px solid var(--rail-ink-faint); background: transparent;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.rail a[data-state="active"] .dot { background: var(--brass); border-color: var(--brass); box-shadow: 0 0 0 4px rgba(201,150,46,.22); }
.rail a[data-state="done"]   .dot { background: var(--teal-2); border-color: var(--teal-2); }
.rail a[data-state="wait"]   .dot { background: var(--clay-2); border-color: var(--clay-2); }
.rail .state {
  margin-left: auto; font: 600 .66rem/1 var(--text); letter-spacing: .05em;
  text-transform: uppercase; color: var(--rail-ink-dim);
}

.rail__foot {
  margin-top: auto; padding: 1rem 1.25rem 1.4rem;
  border-top: 1px solid var(--rail-hair);
  font-size: .78rem; color: var(--rail-ink-dim);
}
.rail__foot a { display: inline; padding: 0; color: var(--rail-ink); text-decoration: underline; }

.main { grid-column: 2; padding: 2.2rem clamp(1rem, 3vw, 3rem) 7rem; max-width: 1180px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; width: auto; inset: auto; }
  .rail nav { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .1rem; }
  .rail h4 { grid-column: 1 / -1; }
  .main { grid-column: 1; padding: 1.5rem 16px 7rem; }
}

/* ---------------------------------------------------------- section rhythm */

section.band { padding: 2.4rem 0; border-bottom: 1px solid var(--line); scroll-margin-top: 1.5rem; }
section.band:last-of-type { border-bottom: 0; }
.eyebrow { font: 600 .72rem/1 var(--text); letter-spacing: .14em; text-transform: uppercase; color: var(--brass-ink); margin-bottom: .6rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1.1rem; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }

/* ---------------------------------------------------------- hero */

.hero { padding: 3.2rem 0 2.6rem; display: grid; grid-template-columns: 1.25fr .75fr; gap: 2.5rem; align-items: center; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }
.hero .mark { width: min(260px, 60vw); height: auto; color: var(--ink); }

/* ---------------------------------------------------------- stage track */

.track { display: flex; gap: .4rem; flex-wrap: wrap; margin: 1.2rem 0 1.6rem; }
.track .step {
  flex: 1 1 110px; min-width: 110px;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .7rem .8rem; position: relative; overflow: hidden;
  transition: border-color var(--t) var(--ease), transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.track .step::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--brass);
  transition: width var(--t-slow) var(--ease-out);
}
.track .step[data-state="active"] { border-color: var(--brass); box-shadow: var(--shadow-1); transform: translateY(-2px); }
.track .step[data-state="active"]::after { width: 55%; }
.track .step[data-state="done"]::after { width: 100%; background: var(--teal-2); }
.track .step[data-state="wait"]::after  { width: 100%; background: var(--clay-2); }
.track .step b { display: block; font: 600 .86rem/1.3 var(--text); }
.track .step i { font-style: normal; font-size: .72rem; color: var(--ink-3); letter-spacing: .04em; text-transform: uppercase; }

/* ---------------------------------------------------------- enrollment steps */

.steps { display: flex; gap: .5rem; margin-bottom: 1.8rem; counter-reset: s; flex-wrap: wrap; }
.steps .s {
  display: flex; align-items: center; gap: .5rem; padding: .45rem .85rem .45rem .55rem;
  border-radius: 999px; background: var(--paper-3); color: var(--ink-3);
  font: 600 .84rem/1 var(--text);
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.steps .s em {
  font-style: normal; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: .76rem;
  background: var(--paper-2); color: var(--ink-3); border: 1px solid var(--line);
}
.steps .s.on { background: var(--ink); color: var(--paper); }
.steps .s.on em { background: var(--brass); color: #1A1204; border-color: transparent; }
.steps .s.done { background: color-mix(in srgb, var(--teal) 14%, transparent); color: var(--teal); }
.steps .s.done em { background: var(--teal); color: #fff; border-color: transparent; }

.panel { display: none; animation: panel-in var(--t-slow) var(--ease-out); }
.panel.on { display: block; }
@keyframes panel-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* the terms scroller: the inventor must reach the end before the box enables */
.terms {
  max-height: 340px; overflow-y: auto; padding: 1.1rem 1.25rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-2);
  font-size: .93rem; line-height: 1.6;
}
.terms h4 { font-family: var(--text); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--brass-ink); margin: 1.4rem 0 .4rem; }
.terms h4:first-child { margin-top: 0; }
.terms ul { padding-left: 1.1rem; margin: .3rem 0 .8rem; }
.terms li { margin-bottom: .4rem; }
.scrollnote { font-size: .82rem; color: var(--ink-3); margin-top: .5rem; transition: opacity var(--t) var(--ease); }
.scrollnote.done { color: var(--teal); }

/* ---------------------------------------------------------- free screen result */

.verdict { border-radius: var(--radius-lg); padding: 1.3rem 1.45rem; margin: 1.2rem 0; border: 1px solid var(--line); background: var(--paper-2); }
.verdict.proceed { border-left: 5px solid var(--teal); }
.verdict.problem { border-left: 5px solid var(--clay); }
.verdict.outside { border-left: 5px solid var(--ink-3); }
.verdict h3 { margin-bottom: .4rem; }

/* ---------------------------------------------------------- payment */

.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin: 1.2rem 0; }
.tier {
  border: 1.5px solid var(--line); border-radius: var(--radius-lg); padding: 1.2rem 1.3rem;
  background: var(--paper-2); cursor: pointer; position: relative;
  transition: border-color var(--t) var(--ease), transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.tier:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.tier.sel { border-color: var(--brass); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brass) 18%, transparent); }
.tier .price { font-family: var(--display); font-size: 1.9rem; line-height: 1; margin: .4rem 0 .2rem; }
.tier ul { list-style: none; padding: 0; margin: .8rem 0 0; font-size: .9rem; }
.tier li { padding-left: 1.2rem; position: relative; margin-bottom: .34rem; color: var(--ink-2); }
.tier li::before { content: ""; position: absolute; left: 0; top: .52em; width: 7px; height: 7px; border-radius: 50%; background: var(--brass); }

.totals { display: flex; justify-content: space-between; padding: .45rem 0; font-size: .95rem; }
.totals.grand { border-top: 1px solid var(--line); margin-top: .4rem; padding-top: .7rem; font-weight: 700; font-size: 1.1rem; }
.codeline { display: flex; gap: .5rem; align-items: flex-start; }
.codeline input { flex: 1; }

/* ---------------------------------------------------------- review checks */

.checks { list-style: none; padding: 0; margin: 1rem 0; }
.checks li {
  display: flex; align-items: center; gap: .75rem; padding: .62rem .2rem;
  border-bottom: 1px solid var(--line); font-size: .94rem;
  animation: tick-in var(--t) var(--ease-out) backwards;
}
.checks li:last-child { border-bottom: 0; }
.checks .ico { width: 20px; height: 20px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: .68rem; font-weight: 800; }
.checks .ico.pass { background: var(--teal); color: #fff; }
.checks .ico.fix  { background: var(--brass); color: #1A1204; }
.checks .ico.run  { background: var(--paper-3); color: var(--ink-3); }
.checks .when { margin-left: auto; font-size: .78rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------- uploads */

.drop {
  border: 2px dashed var(--line); border-radius: var(--radius-lg);
  padding: 2.1rem 1.3rem; text-align: center; color: var(--ink-3);
  background: var(--paper-2);
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease), transform var(--t) var(--ease);
}
.drop.hot { border-color: var(--brass); background: color-mix(in srgb, var(--brass) 8%, var(--paper-2)); transform: scale(1.01); color: var(--brass-ink); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .7rem; margin-top: 1rem; }
.gallery .f {
  border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem; background: var(--paper-2);
  font-size: .8rem; word-break: break-word;
  animation: file-in var(--t-slow) var(--ease-out) backwards;
}
@keyframes file-in { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------- Leonardo
   Our own control. Small orb, always clear of the Netlify badge. The panel
   appears only once a conversation is running, and the text box only if the
   inventor asks for it. */

.leo {
  position: fixed; right: 24px; bottom: 96px; z-index: 60;
  display: flex; flex-direction: column; align-items: flex-end; gap: .55rem;
}

.leo__orb {
  position: relative; width: 54px; height: 54px; flex: 0 0 auto;
  border: 0; padding: 0; border-radius: 50%; cursor: pointer;
  background: var(--rail-bg);
  box-shadow: var(--shadow-2);
  display: grid; place-items: center;
  transition: transform var(--t) var(--ease);
}
.leo__orb:hover { transform: scale(1.06); }
.leo__orb:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

/* Leonardo's face. An original Renaissance-sage portrait drawn for this site,
   in flat masses so it still reads at 54px. The tones are fixed rather than
   themed: the orb is always dark, so the face must not follow the page. */
.leo__face {
  width: 90%; height: 90%; display: block;
  transition: transform var(--t) var(--ease);
}
.lf-skin  { fill: #F0E3CA; }
.lf-hair  { fill: #A8781F; }
.lf-beard { fill: #D3A648; }
.lf-nose  { fill: #E3D3B5; }
.lf-mouth { fill: #5E3418; transition: transform 110ms var(--ease); transform-origin: 32px 45px; }
.lf-eyes  { fill: #101722; transform-origin: 32px 29.4px; }
.lf-brow  { fill: none; stroke: #101722; stroke-width: 1.9; stroke-linecap: round; }

/* He blinks. Nothing else idles, so it is the one sign the orb is awake. */
.leo__orb .lf-eyes { animation: leo-blink 6.4s steps(1, end) infinite; }
@keyframes leo-blink {
  0%, 95.5%, 100% { transform: scaleY(1); }
  97%             { transform: scaleY(.1); }
}
/* While he speaks the mouth moves. The ring cannot show amplitude over this
   connection, so the mouth is a state indicator too, not a meter. */
.leo[data-mode="speaking"] .leo__orb .lf-mouth { animation: leo-talk 420ms var(--ease) infinite; }
@keyframes leo-talk {
  0%, 100% { transform: scaleY(1); }
  50%      { transform: scaleY(2.6); }
}
.leo[data-mode="speaking"] .leo__face { transform: scale(1.05); }
/* The ring tracks whoever is speaking, so the inventor can see they are heard. */
.leo__ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--brass);
  opacity: calc(.35 + (var(--level, 0) * .65));
  transform: scale(calc(1 + (var(--level, 0) * .22)));
  transition: opacity 90ms linear, transform 90ms linear;
}
.leo[data-status="idle"] .leo__ring { opacity: .3; }
.leo[data-status="connecting"] .leo__ring { animation: leo-pulse 1.1s var(--ease-out) infinite; }
.leo[data-status="error"] .leo__ring { border-color: var(--clay-2); opacity: .9; }
@keyframes leo-pulse { 0%,100% { transform: scale(1); opacity: .35; } 50% { transform: scale(1.22); opacity: .9; } }

/* ------------------------------------------------- while Leonardo is talking
   The face, a one-word state above it, and one small offer of text below it.
   No panel, nothing covering the page. The offer sits in the gap between the
   orb and the Netlify badge, which is why the orb is parked at 96px. */

.leo__under {
  position: absolute; top: calc(100% + 8px); right: 0;
  display: flex; justify-content: flex-end;
}
.leo__totext {
  font: 600 .72rem/1 var(--text); color: var(--ink-2);
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: 999px; padding: .42em .8em; cursor: pointer;
  white-space: nowrap; box-shadow: var(--shadow-1);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.leo__totext:hover { background: var(--paper-3); color: var(--ink); }
.leo__totext:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

/* The state caption reuses the tooltip slot above the orb, and stays put while
   a conversation is running instead of appearing only on hover. */
.leo[data-status="connected"] .leo__tip,
.leo[data-status="connecting"] .leo__tip { opacity: 1; transform: none; }

/* A small end marker on the orb, so pressing the face to hang up is visible
   rather than something you have to discover. */
.leo__end {
  position: absolute; top: -3px; right: -3px;
  width: 19px; height: 19px; border-radius: 50%;
  display: none; place-items: center;
  font-size: .82rem; line-height: 1; color: var(--ink-2);
  background: var(--paper-2); border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}
.leo[data-status="connected"] .leo__end,
.leo[data-status="connecting"] .leo__end { display: grid; }

/* Present for screen readers, never on screen. */
.leo__sr {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------------------------------------------------------- the nudge
   First visit only, front page only, gone the moment it is used or waved
   away. It sits above the orb so it never covers the orb itself. */

.leo__nudge {
  position: absolute; right: 0; bottom: 72px;
  opacity: 0; transform: translateY(6px) scale(.97);
  pointer-events: none;
  transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out);
}
.leo__nudge.is-in { opacity: 1; transform: none; pointer-events: auto; }

.leo__nudge-go {
  display: flex; align-items: center; gap: .55rem;
  background: var(--paper-2); color: var(--ink);
  border: 1px solid var(--brass); border-radius: 999px;
  padding: .4rem .9rem .4rem .4rem; cursor: pointer;
  box-shadow: var(--shadow-2);
  animation: leo-beckon 2.6s var(--ease) 4;
}
.leo__nudge-go:hover { background: var(--paper-3); }
.leo__nudge-go:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
@keyframes leo-beckon {
  0%, 72%, 100% { transform: translateX(0); }
  80%           { transform: translateX(-4px); }
  88%           { transform: translateX(0); }
}

.leo__nudge-face {
  width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%;
  background: var(--rail-bg); display: grid; place-items: center;
}
.leo__nudge-text {
  display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15;
  font: 700 .82rem/1.15 var(--text); color: var(--ink);
  white-space: nowrap;
}
.leo__nudge-text b { font: 500 .74rem/1.2 var(--text); color: var(--ink-2); }

/* Tucked onto the pill's corner rather than floating beside it, so it reads as
   this pill's control and takes no width of its own. */
.leo__nudge-x {
  position: absolute; top: -7px; right: -7px;
  width: 21px; height: 21px; padding: 0; cursor: pointer;
  display: grid; place-items: center;
  font-size: .9rem; line-height: 1; color: var(--ink-2);
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: 50%; box-shadow: var(--shadow-1);
}
.leo__nudge-x:hover { color: var(--ink); background: var(--paper-3); }
.leo__nudge-x:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

/* The arrow is drawn, then redrawn, pointing from the pill down into the orb. */
.leo__nudge-arrow {
  position: absolute; right: 22px; top: calc(100% - 7px); width: 40px; height: 30px;
  overflow: visible; pointer-events: none;
}
/* brass-ink, not brass: it is dark brass on paper and light brass in dark mode,
   so the line is visible either way instead of washing out on the light page. */
.leo__nudge-line {
  fill: none; stroke: var(--brass-ink); stroke-width: 2.4;
  stroke-linecap: round; stroke-linejoin: round;
}
/* A filled head, not a stroked chevron. At this size two thin strokes meeting
   at a point read as a smudge; a solid triangle reads as an arrow. */
.leo__nudge-head { fill: var(--brass-ink); stroke: none; }
/* It draws itself a few times and then stays drawn. An arrow that redraws
   forever in the corner of a page someone is reading is the annoyance this is
   meant to avoid. */
.leo__nudge-line {
  stroke-dasharray: 42; stroke-dashoffset: 42;
  animation: leo-draw 2.6s var(--ease-out) 4 forwards;
}
.leo__nudge-head { opacity: 0; animation: leo-tip 2.6s var(--ease-out) 4 forwards; }
@keyframes leo-draw { 0% { stroke-dashoffset: 42; } 34%, 100% { stroke-dashoffset: 0; } }
@keyframes leo-tip  { 0%, 30% { opacity: 0; } 42%, 100% { opacity: 1; } }

/* Nothing here is load-bearing, so motion sensitivity turns all of it off and
   leaves the pointer itself in place. */
@media (prefers-reduced-motion: reduce) {
  .leo__orb .lf-eyes,
  .leo[data-mode="speaking"] .leo__orb .lf-mouth,
  .leo[data-status="connecting"] .leo__ring,
  .leo__nudge-go, .leo__nudge-line, .leo__nudge-head { animation: none; }
  .leo__nudge-line { stroke-dashoffset: 0; }
  .leo__nudge-head { opacity: 1; }
  .leo__nudge { transition: none; }
}

.leo__tip {
  font: 600 .74rem/1 var(--text); color: var(--ink-2);
  background: var(--paper-2); border: 1px solid var(--line);
  padding: .34rem .55rem; border-radius: 999px; box-shadow: var(--shadow-1);
  opacity: 0; transform: translateY(-3px); pointer-events: none;
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
  order: -1;
}
.leo:hover .leo__tip, .leo:focus-within .leo__tip { opacity: 1; transform: none; }
/* While connected the tip is no longer a hover tooltip: it is the state
   caption, so it must not be display:none here. Its visibility is set with the
   rules further down. */

.leo__panel {
  width: min(320px, calc(100vw - 48px));
  background: var(--paper-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2); padding: .9rem 1rem 1rem;
  animation: panel-in var(--t) var(--ease-out);
  order: -1;
}
.leo__head { display: flex; align-items: center; gap: .6rem; margin-bottom: .4rem; }
.leo__state { font: 600 .82rem/1.3 var(--text); color: var(--brass-ink); }
.leo[data-status="error"] .leo__state { color: var(--clay); }
.leo__x {
  margin-left: auto; background: none; border: 0; cursor: pointer;
  font-size: 1.3rem; line-height: 1; color: var(--ink-3); padding: 0 .2rem;
}
.leo__x:hover { color: var(--ink); }
.leo__said { font-size: .88rem; color: var(--ink-2); margin: 0 0 .7rem; max-height: 6.5em; overflow-y: auto; }
.leo__said:empty { display: none; }
/* The panel only opens for typing or an error, so its transcript is opt-in. */

.leo__type { display: flex; gap: .4rem; margin-bottom: .6rem; }
.leo__type input { flex: 1; padding: .5em .6em; font-size: .9rem; }

.leo__tools { display: flex; gap: .4rem; }
.leo__tool {
  font: 600 .76rem/1 var(--text); color: var(--ink-2);
  background: var(--paper-3); border: 1px solid var(--line);
  border-radius: 999px; padding: .4em .7em; cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.leo__tool:hover { background: var(--line); color: var(--ink); }
.leo__tool[aria-pressed="true"] { background: var(--brass); border-color: var(--brass); color: #1A1204; }

@media (max-width: 560px) { .leo { right: 16px; bottom: 96px; } }

/* ---------------------------------------------------------- misc */

.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; font-size: .92rem; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }
table.t { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.t th, table.t td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t th { font: 600 .76rem/1 var(--text); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.spinner { width: 16px; height: 16px; border: 2px solid color-mix(in srgb, currentColor 30%, transparent); border-top-color: currentColor; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------- FAQ
   Native details/summary so the answers are in the page source for search and
   for AI engines, open or closed, and keyboard accessible without script. */
.faq { border-top: 1px solid var(--line); margin-top: 1.2rem; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item > summary {
  cursor: pointer; list-style: none; padding: 1rem .2rem;
  display: flex; align-items: flex-start; gap: .8rem;
  transition: color var(--t-fast) var(--ease);
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after {
  content: "+"; margin-left: auto; flex: 0 0 auto;
  font: 400 1.4rem/1 var(--text); color: var(--brass-ink);
  transition: transform var(--t) var(--ease);
}
.faq-item[open] > summary::after { transform: rotate(45deg); }
.faq-item > summary:hover h3 { color: var(--brass-ink); }
.faq-item > summary:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; border-radius: 6px; }
.faq-item h3 { display: inline; margin: 0; font-size: 1.06rem; font-family: var(--text); font-weight: 600; }
.faq-item > p { padding: 0 2.2rem 1.1rem .2rem; margin: 0; color: var(--ink-2); max-width: 74ch;
  animation: panel-in var(--t) var(--ease-out); }

/* With the typing panel open the state already appears in its header, so the
   caption above the orb would just say it twice. */
.leo[data-typing="true"] .leo__tip { display: none; }

/* ------------------------------------------------------- the stage views
   Long-form legal text, a claim, and a wide support matrix each need their own
   measure. Reading a claim at body width is why claims are hard to read. */

.intake { display: grid; gap: 1rem; max-width: 56rem; margin-top: 1.2rem; }
.intake .hint { display: block; font: 400 .82rem/1.45 var(--text); color: var(--ink-3); margin-top: .3rem; font-style: normal; }
.intake textarea { resize: vertical; min-height: 4.5em; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }

/* A claim is one long sentence and is read element by element, so it gets a
   narrower measure and a hanging indent rather than running as body text. */
.claim {
  display: block; font: 400 .95rem/1.7 var(--text); color: var(--ink);
  padding-left: 1.1rem; border-left: 2px solid var(--brass);
  max-width: 46rem;
}
ol.claims { padding-left: 1.4rem; }
ol.claims li { margin-bottom: .9rem; }

/* The matrix is the part an attorney checks first; let it use the full width
   and keep the element column from collapsing. */
#bu-body table.t td:first-child, #pa-body table.t td:first-child { min-width: 12rem; }
#bu-body table.t { font-size: .88rem; }

/* A stage that takes minutes needs a waiting state that distinguishes slow
   from stuck, so it carries an elapsed count rather than an endless spinner. */
.working { display: flex; gap: .85rem; align-items: flex-start; padding: 1rem 0; }
.working strong { font: 600 .95rem/1.4 var(--text); color: var(--ink); }
.spin {
  flex: 0 0 auto; width: 18px; height: 18px; margin-top: .15rem;
  border: 2px solid var(--line); border-top-color: var(--brass);
  border-radius: 50%; animation: spin 820ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spin { animation: none; border-top-color: var(--brass); }
}

/* Drawing sheets in the workspace. The sheet itself is white line art by
   rule, so it sits on a white card in both themes. */
.sheets { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin: 12px 0 20px; }
.sheet { margin: 0; background: #fff; border: 1px solid rgba(0,0,0,.12); border-radius: 6px; padding: 8px; }
.sheet img { display: block; width: 100%; height: auto; aspect-ratio: 612 / 792; background: #fff; }
.sheet figcaption { font-size: .82rem; color: #333; margin-top: 6px; line-height: 1.35; }
.field + h3.sub, h3.sub { margin: 1.6rem 0 .4rem; font-size: 1.02rem; }
