/* Draw with AI: additions to /assets/hub.css for /product/intelligence/ and the pages under it.
   Load after /assets/hub.css and /assets/product/replay.css. Nothing here restyles the shared layer for other hubs. */

/* ---- What the replay runner does not style: a pressed Discard, a pressed starter, a selection in the field. ---- */
.replay .rp-discard[data-pressed] { color: var(--rp-ink); text-decoration: underline; text-decoration-thickness: 2px }
.replay .rp-starters span[data-pressed] { border-color: var(--rp-ink); background: var(--rp-ink); color: #fff }
.replay .rp-input mark { padding: .05em 0; background: #cfe0f5; color: inherit }
/* Pasted lines keep their line breaks where the conversation has room for them. */
@container replay (min-width: 720px) { .rp-turn.you p { white-space: pre-line } }

/* ---- Words a person types into the conversation. ---- */
.hub-page main code { padding: .12em .4em; border: 1px solid #c5ceb9; border-radius: 4px; background: #fffdf4; color: var(--ink); font: 500 .86em/1.4 ui-monospace,Menlo,monospace; overflow-wrap: anywhere }
.hub-section[data-tone="ink"] code { border-color: #4d6759; background: #1b3128; color: #faf9f1 }

/* ---- A still slate with the conversation that drew it: the same frame as a replay, at rest. ---- */
.ai-shot { container: shot / inline-size }
.ai-shot-body { display: grid; grid-template-columns: minmax(0,1fr) }
.ai-turns { display: grid; align-content: start; gap: .65rem; min-width: 0; padding: .8rem .9rem .9rem; overflow: hidden; background: #fffdf4; border-top: 1px solid #cfd5c4; color: var(--ink); font: 500 .82rem/1.42 "Helvetica Neue",Arial,sans-serif; text-align: left }
.ai-turns > b { font: 700 1.05rem/1 "Archivo Narrow","Arial Narrow",Arial,sans-serif }
.ai-turn small { display: block; margin-bottom: .2rem; color: #5a6a5e; font: 500 .75rem/1.5 ui-monospace,Menlo,monospace }
.ai-turn p { margin: 0; color: var(--ink) !important; font-size: .82rem !important }
.ai-turn.you p { padding: .5rem .65rem; border-radius: 8px 8px 8px 2px; background: #eef1e4; white-space: pre-line }
.ai-turn ul { margin: .3rem 0 0; padding-left: 1.05rem; color: #3e5145 }
.ai-turn .rp-plan { display: inline-block; padding: .08rem .42rem; border: 1px solid #b89a45; border-radius: 99px; background: #fbf0cf; color: #5e4a0f; font: 600 .75rem/1.4 ui-monospace,Menlo,monospace; white-space: nowrap }
@container shot (min-width: 540px) {
  .ai-shot:not(.stack) .ai-shot-body { grid-template-columns: minmax(0,1fr) clamp(200px,36cqi,290px); aspect-ratio: var(--shot-ratio,2/1) }
  .stage.mini.ai-shot:not(.stack) .stage-body { aspect-ratio: auto; height: 100% }
  .ai-shot:not(.stack) .ai-turns { border-top: 0; border-left: 1px solid #cfd5c4 }
}

/* ---- The drawing and the route made from it. A phone shows the first two stops, large enough to read. ---- */
.ai-route-still { --stage-ratio: 1118/420 }
.ai-route-still.large { --stage-ratio: 1118/480 }
@media (max-width: 800px) { .ai-route-still, .ai-route-still.large { --stage-ratio: 548/240 } }

/* A workshop of two lanes needs height. On a phone its frame is square so the cards keep their size. */
.ai-lanes-still { --stage-ratio: 16/10 }
@media (max-width: 800px) { .ai-lanes-still { --stage-ratio: 1/1 } }

/* ---- Cards: a replay inside a card, and a wide card with its canvas on the left. ---- */
.hub-card-media > .replay, .hub-card-media > .stage { width: 100% }
.hub-card-media > .replay { --rp-status-narrow: 2.4rem; box-shadow: none }
/* A short card beside a taller one: the canvas takes the spare height, so the words line up along the bottom. */
.hub-card.fill .hub-card-media { flex: 1; display: grid; align-items: center }
.hub-card.wide.flip .hub-card-media { order: -1; border-left: 0; border-right: 1px solid var(--s-line) }
.hub-card.wide.tall .hub-card-media { flex: 1.9 }
.hub-card-copy .ai-also { margin-top: .2rem; padding-top: .6rem; border-top: 1px solid var(--s-line); font-size: .88rem !important }
@media (max-width: 800px) { .hub-card.wide.flip .hub-card-media { border-right: 0 } }

/* ---- The starters: a wider stage than the default tab panel, so the conversation sits beside the canvas. ---- */
@media (min-width: 801px) { .ai-starters .hub-tabpanel { grid-template-columns: minmax(0,2.1fr) minmax(0,1fr); align-items: start } }
/* One scene and reduced motion leave the controls empty, so they take no room. */
@media (prefers-reduced-motion: reduce) {
  .ai-starters .replay { --rp-controls-on: 0 }
  .ai-starters .replay > .rp-controls { display: none }
}
.ai-fills { margin: 1.2rem 0 0 }
.ai-fills > div { padding: .7rem 0; border-top: 1px solid var(--s-line) }
.ai-fills > div:last-child { border-bottom: 1px solid var(--s-line) }
.ai-fills dt { margin-bottom: .25rem; font: 600 .78rem/1.5 ui-monospace,Menlo,monospace }
.ai-fills dd { font-size: .95rem }
.ai-fills mark { padding: .05em .1em; background: #cfe0f5; color: inherit }
.hub-tabpanel .ai-more { margin-top: 1rem; font-weight: 600 }

/* ---- A quoted source beside the drawing made from it. ---- */
.ai-quote { margin: 1.4rem 0 0; padding-left: 1rem; border-left: 3px solid var(--hub-deep); max-width: 34rem }
.ai-quote p { margin: 0 !important; color: var(--s-ink) !important; font: 700 clamp(1.25rem,1.7vw,1.6rem)/1.15 "Archivo Narrow","Arial Narrow",sans-serif; letter-spacing: -.02em }
.ai-quote footer { display: block; padding: .5rem 0 0; font: 500 .78rem/1.5 ui-monospace,Menlo,monospace }
.ai-links { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin-top: 1.4rem; font-weight: 600 }
.ai-links a { display: inline-flex; align-items: center; min-height: 44px }

/* ---- Limits, as a table people can scan. ---- */
.ai-limits { width: 100%; border-collapse: collapse; font-size: .95rem; text-align: left }
.ai-limits caption { margin-bottom: .8rem; color: var(--s-soft); font: 500 .78rem/1.5 ui-monospace,Menlo,monospace; text-align: left }
.ai-limits :is(th,td) { padding: .75rem .9rem .75rem 0; border-top: 1px solid var(--s-line); vertical-align: top }
.ai-limits tr:last-child :is(th,td) { border-bottom: 1px solid var(--s-line) }
.ai-limits thead th { font: 600 .78rem/1.5 ui-monospace,Menlo,monospace }
.ai-limits tbody th { width: 34%; font-weight: 600 }
.ai-limits td { color: var(--s-soft) }
@media (max-width: 640px) {
  .ai-limits thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%) }
  .ai-limits :is(tr,th,td) { display: block; width: auto }
  .ai-limits tbody th { width: auto; padding-bottom: 0 }
  .ai-limits td { padding-top: .2rem; border-top: 0 }
  .ai-limits td[data-plan]::before { content: attr(data-plan) ": "; color: var(--s-ink); font-weight: 600 }
  .ai-limits tr:last-child th { border-bottom: 0 }
}

/* ---- A phone shows the hero stage's top above the fold. ---- */
@media (max-width: 800px) {
  .hub-hero-copy .hub-fine { font-size: .8rem }
}

/* A hero heading breaks into lines of even length, so no short word is left hanging at the end of a line. */
[data-hub="intelligence"] .hub-hero h1 { text-wrap: balance }
