.first-visit {
  container: first-visit / inline-size;
  margin-inline: clamp(0px, 2vw, 24px);
  --inset: 20px;
  --gap: 10px;
  --entry-accent: #b51024;
  --request-color: #2563eb;
  --agreement-color: #16803d;
  --primary-fill: #15181c;
  --primary-ink: #fff;
}
.is-graphite .first-visit {
  --entry-accent: #ff922e;
  --request-color: #60a5fa;
  --agreement-color: #4ade80;
  --primary-fill: var(--ov-button);
  --primary-ink: var(--ov-text);
  --primary-border: var(--ov-border);
}
.first-visit :is(.entry-hero, .buyer-flow) {
  --action-width: min(248px, calc((100cqi - 2 * var(--inset) - 3 * var(--gap) - 2px) / 4));
  --action-height: 50px;
}
#project-overview .entry-hero { padding: clamp(30px, 4vw, 62px) 0 clamp(30px, 3.5vw, 50px); }
.first-visit :is(h1,h2,h3,h4,p) { text-align: start; }
.first-visit .overview-eyebrow { margin: 0 0 14px; color: var(--ov-secondary); }
.entry-heading, .entry-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: clamp(20px, 3vw, 40px); }
.entry-heading h1 { margin: 0; color: var(--ov-text); font-size: clamp(38px, 5cqi, 64px); font-weight: 600; letter-spacing: -.045em; line-height: 1.04; text-wrap: balance; }
.entry-lead { margin: 0 0 14px; color: var(--ov-secondary); font-size: clamp(16px, 1.6cqi, 19px); line-height: 1.5; }
.entry-main-actions { display: flex; flex-wrap: wrap; gap: var(--gap); }
.entry-choices { margin-top: clamp(24px, 3vw, 40px); }
.buyer-start { border-top: 2px solid var(--entry-accent); padding: var(--inset) 0; }
.first-visit :is(.buyer-start h2, .buyer-support h3) { margin: 0; color: var(--ov-text); font-size: clamp(20px, 2.1cqi, 26px); line-height: 1.2; letter-spacing: -.025em; font-weight: 600; }
.buyer-start p, .buyer-support p { margin: 8px 0 16px; color: var(--ov-secondary); font-size: 15px; line-height: 1.5; max-width: 74ch; }
.buyer-actions, .entry-links { display: grid; gap: var(--gap); justify-content: start; align-content: start; }
#project-overview .buyer-button {
  box-sizing: border-box; display: flex; align-items: center; gap: 8px;
  inline-size: var(--action-width); max-inline-size: 100%; min-block-size: var(--action-height);
  padding: 6px 13px; border: 1px solid var(--ov-border); border-radius: 6px;
  color: var(--ov-text); background: var(--ov-button);
  font-family: inherit; font-weight: 550; font-size: 14px; line-height: 1.25;
  text-align: start; text-decoration: none;
}
.buyer-button span { flex: 1; min-inline-size: 0; }
.buyer-button svg { flex: none; }
#project-overview .buyer-primary { color: var(--primary-ink); background: var(--primary-fill); border-color: var(--primary-border, var(--primary-fill)); }
.is-graphite .first-visit .buyer-primary > svg:first-child { color: var(--entry-accent); }
#project-overview .buyer-button:focus-visible { outline: 2px solid var(--ov-text); outline-offset: 3px; }
.entry-panel {
  --entry-surface: #111317; --entry-open: #20252b; --entry-rule: #48525b;
  --entry-muted: #c4ccd2; --entry-icon: #fff; --entry-chip: #c51024;
  overflow: hidden; overflow-anchor: none; border: 1px solid var(--entry-rule); border-radius: 9px;
  color: #fff; background: var(--entry-surface);
}
.is-graphite .entry-panel { --entry-surface: #14171c; --entry-open: #1d2229; --entry-rule: #414b57; --entry-icon: #ff922e; --entry-chip: #23282f; }
.entry-panel h2 { margin: 0; padding: 15px var(--inset); font-size: 21px; font-weight: 600; line-height: 1.25; color: white; }
.entry-list { display: grid; grid-auto-rows: 1fr auto; }
.entry-task { display: contents; }
#project-overview .entry-toggle {
  display: grid; grid-template-columns: 32px minmax(0,1fr) 16px; align-items: center; gap: 12px;
  min-height: 58px; width: 100%; padding: 9px var(--inset); color: white; background: transparent;
  border: 0; border-top: 1px solid var(--entry-rule); border-radius: 0; box-shadow: none; cursor: pointer; font: inherit; text-align: start;
}
.entry-label { display: grid; gap: 2px; }
.entry-label strong { font-size: 16px; line-height: 1.25; font-weight: 600; }
.entry-label > span, .entry-detail-body p { font-size: 14px; line-height: 1.45; color: var(--entry-muted); }
.entry-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--entry-icon); background: var(--entry-chip); }
.entry-chevron { color: var(--entry-muted); transition: transform 300ms ease; }
#project-overview .entry-toggle[aria-expanded=true], .entry-detail { background: var(--entry-open); }
.entry-toggle[aria-expanded=true] .entry-chevron { transform: rotate(180deg); }
.entry-detail { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 320ms cubic-bezier(.35,0,.2,1); }
.entry-detail[aria-hidden=false] { grid-template-rows: 1fr; }
.entry-clip { min-height: 0; overflow: hidden; }
.entry-detail-body { padding: 4px var(--inset) 16px; }
.entry-detail-body p { margin: 0 0 10px; }
.entry-links { display: flex; flex-wrap: wrap; }
#project-overview .entry-panel .buyer-button { color: white; background: var(--entry-surface); border-color: #74808d; }
#project-overview .entry-panel .buyer-button:focus-visible { outline-color: white; }
#project-overview .entry-toggle:focus-visible { outline: 2px solid white; outline-offset: -3px; }
.buyer-flow { padding: clamp(28px, 3.5vw, 46px) 0; border-block: 1px solid var(--ov-border); scroll-margin-top: 88px; }
.buyer-flow h2 { margin: 0; color: var(--ov-text); font-size: clamp(30px, 3.4cqi, 44px); line-height: 1.12; font-weight: 600; letter-spacing: -.035em; }
.trade-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; }
/* Both alternatives size the same cell so wrapped text cannot shift the controls. */
.trade-text { display: grid; }
.trade-text > span { grid-area: 1 / 1; }
.trade-text > [aria-hidden="true"] { visibility: hidden; }
.trade-switch { flex: none; display: inline-grid; grid-template-columns: repeat(2, 1fr); min-inline-size: 0; padding: 2px; margin: 0; border: 1px solid var(--ov-border); border-radius: 7px; background: var(--ov-canvas); }
.trade-switch label { position: relative; min-width: 52px; cursor: pointer; }
.trade-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.trade-switch span { display: grid; place-items: center; min-height: 44px; padding-inline: 8px; border-radius: 4px; font-size: 14px; line-height: 1; color: var(--ov-secondary); }
.trade-switch input:checked + span { background: #15181c; color: white; font-weight: 600; }
.is-graphite .trade-switch input:checked + span { background: #303840; color: var(--ov-text); }
.trade-switch input:focus-visible + span { outline: 2px solid var(--ov-text); outline-offset: 2px; }
.buyer-phase { margin: 24px 0; }
.phase-request { --phase-color: var(--request-color); }
.phase-agreement { --phase-color: var(--agreement-color); }
.buyer-phase > h3::before { content: ''; display: inline-block; width: 20px; height: 3px; margin: 0 9px 4px 0; background: var(--phase-color); }
.entry-search .buyer-button:not(.buyer-primary) svg:first-child { color: var(--request-color); }
.buyer-phase > h3 { margin: 0 0 12px; font-size: 18px; line-height: 1.3; font-weight: 600; color: var(--ov-text); }
.buyer-steps { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); padding: 0; margin: 0; background: var(--ov-card); border: 1px solid var(--ov-border); border-radius: 8px; list-style: none; }
.buyer-step { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 13px; padding: var(--inset); min-inline-size: 0; }
.buyer-step + .buyer-step { border-inline-start: 1px solid var(--ov-border); }
.buyer-step-heading { display: flex; align-items: center; gap: 10px; }
.buyer-step-heading h4 { font-size: 18px; color: var(--ov-text); font-weight: 600; line-height: 1.25; letter-spacing: -.015em; margin: 0; }
.buyer-icon { flex: none; color: var(--phase-color); }
.buyer-copy p, .buyer-visibility { font-size: 15px; color: var(--ov-secondary); line-height: 1.5; margin: 0; }
.buyer-visibility { padding: 0; list-style: none; }
.buyer-visibility li { display: flex; align-items: start; gap: 6px; }
.buyer-visibility li + li { margin-top: 5px; }
.buyer-visibility svg { flex: none; margin-top: 3px; }
.buyer-visibility strong { color: var(--ov-text); font-weight: 600; }
.buyer-support { padding: var(--inset); background: var(--ov-active); border: 1px solid var(--ov-border); border-radius: 8px; }
.buyer-support .buyer-actions { grid-template-columns: repeat(4, var(--action-width)); }
@media (hover:hover) {
  #project-overview .buyer-button:hover { background: var(--ov-button-hover); color: var(--ov-button-hover-text); border-color: var(--ov-line); }
  #project-overview .buyer-button:hover .buyer-arrow { color: #ff8491; }
  .is-graphite #project-overview .buyer-button:hover .buyer-arrow { color: #ff922e; }
  #project-overview .entry-toggle:hover, #project-overview .entry-panel .buyer-button:hover { background: var(--entry-open); }
}
@container first-visit (max-width: 840px) {
  .first-visit :is(.entry-hero,.buyer-flow) { --action-width: min(244px, calc((100cqi - 2 * var(--inset) - var(--gap) - 2px) / 2)); }
  .entry-heading, .entry-choices { gap: 22px; }
  .buyer-support .buyer-actions { grid-template-columns: repeat(2, var(--action-width)); }
  .buyer-steps { grid-template-columns: 1fr; }
  .buyer-step { grid-row: auto; grid-template-columns: minmax(0,1fr) var(--action-width); grid-template-rows: auto auto; gap: 8px 20px; }
  .buyer-step + .buyer-step { border-inline-start: 0; border-top: 1px solid var(--ov-border); }
  .buyer-step .buyer-actions { grid-column: 2; grid-row: 1 / 3; }
}
@container first-visit (max-width: 600px) {
  .first-visit :is(.entry-hero,.buyer-flow) { --action-width: min(310px, calc(100cqi - 2 * var(--inset) - 2px)); }
  .entry-heading, .entry-choices { grid-template-columns: minmax(0,1fr); gap: 16px; }
  .entry-heading h1 { font-size: clamp(32px,8.25cqi,42px); }
  .entry-choices { margin-top: 22px; }
  .buyer-start { padding: 14px 0 0; }
  .buyer-step { display: block; }
  .buyer-copy { margin-block: 10px 14px; }
  .buyer-support .buyer-actions { grid-template-columns: 1fr; }
}
@media(max-width:800px) { .first-visit { margin-inline: 0; --inset: 14px; } }
@media(prefers-reduced-motion:reduce) { .first-visit .entry-detail, .first-visit .entry-chevron { transition: none; } }
