/* Ingress, Roof works index: "Which kind is yours?" panel, 20 November 2026.
   Loaded after ingress.css, ingress-build.css and ingress-finish.css. Existing tokens only; no new colours.
   The accent is used once on this screen: the result card's outline. */

.wk { padding: var(--space-8) 0; background: var(--ground); border-bottom: 1px solid var(--grey-rule); }
.wk-head { margin-bottom: var(--space-6); row-gap: var(--space-2); }
.wk-head .s-title { grid-column: 1 / span 8; }
.wk-head .wk-sub { grid-column: 1 / span 7; margin: 0; color: var(--grey-caption); }
.wk-grid { display: grid; grid-template-columns: 55fr 45fr; column-gap: var(--space-6); align-items: start; }

/* ---------- Questions ---------- */
.wk-qs { display: flex; flex-direction: column; gap: var(--space-2); }
.wk-q { margin: 0; padding: 0; border: 0; min-width: 0; }
.wk-q legend { display: flex; gap: var(--space-2); padding: 0; margin-bottom: var(--space-3); font-size: var(--title-size); line-height: var(--title-line); }
.wk-q legend .num { color: var(--grey-caption); }
.wk-q[hidden] { display: none; }

/* Radio cards: the Reports selector card on ground, answer text only */
.wk-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.wk-cards[data-cols="1"] { grid-template-columns: 1fr; }
.wk-cards[data-cols="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wk-card { position: relative; display: flex; align-items: center; min-height: 72px; padding: var(--space-2) var(--space-3); background: var(--paper); color: var(--ink); border-top: 4px solid var(--ink); font-size: var(--body-size); line-height: 24px; cursor: pointer; }
.wk-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.wk-card:hover span { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.wk-card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.wk-card:has(input:checked) { background: var(--ink); color: var(--ground); border-top-color: var(--ink); }

/* An answered question collapses to one line: the question, then the chosen answer. The line reopens it. */
.wk-done { display: grid; grid-template-columns: 32px 1fr auto; column-gap: var(--space-2); align-items: baseline; width: 100%; padding: var(--space-2) 0; border: 0; border-top: 1px solid var(--grey-rule); background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.wk-done[hidden] { display: none; }
.wk-done .num { color: var(--grey-caption); font-size: var(--caption-size); line-height: var(--caption-line); }
.wk-done .q { color: var(--grey-caption); font-size: var(--caption-size); line-height: var(--caption-line); }
.wk-done .a { grid-column: 2; font-size: var(--body-size); line-height: 24px; font-weight: 500; }
.wk-done::after { content: ""; grid-column: 3; grid-row: 1 / span 2; align-self: center; width: 8px; height: 8px; border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); transform: rotate(45deg); margin-right: 4px; }
.wk-done:hover .a { text-decoration: underline; text-underline-offset: 4px; }
.wk-done:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wk-qs .wk-done:last-of-type { border-bottom: 1px solid var(--grey-rule); }

/* ---------- Result card ---------- */
.wk-result { position: relative; min-height: 560px; padding: var(--space-4); background: var(--paper); border: 1px solid var(--grey-rule); }
.wk-result[data-state="empty"] { display: flex; align-items: center; justify-content: center; background: transparent; }
.wk-empty { margin: 0; color: var(--grey-caption); }
.wk-result[data-state="empty"] .wk-body, .wk-result:not([data-state="empty"]) .wk-empty { display: none; }

/* The outline: the Measure band's accent line over a white halo, drawn once when the fourth answer is chosen */
.wk-draw { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); pointer-events: none; overflow: visible; }
.wk-draw rect { fill: none; }
.wk-result.is-drawn .wk-draw rect { stroke-dasharray: 1; }
.wk-draw .halo { stroke: #FFFFFF; stroke-width: 6; }
.wk-draw .line { stroke: var(--accent); stroke-width: 3; }
.wk-result[data-state="empty"] .wk-draw { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .wk-result.is-drawn .wk-draw rect { animation: wk-draw 1600ms cubic-bezier(0.4, 0, 0.2, 1) both; }
}
@keyframes wk-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

.wk-body { display: flex; flex-direction: column; gap: var(--space-1); }
.wk-body .t-label { margin: 0; color: var(--grey-caption); }
.wk-body .t-label + * { margin-top: 0; }
.wk-title { margin: 0 0 var(--space-1); font-weight: 300; font-size: var(--heading-size); line-height: var(--heading-line); }
.wk-body p { margin: 0; }
.wk-block { padding-top: var(--space-2); margin-top: var(--space-2); border-top: 1px solid var(--grey-rule); }
.wk-block:first-child { padding-top: 0; margin-top: 0; border-top: 0; }
/* Worth knowing: the slot is always there, so the card keeps its height whether the block shows or not */
.wk-block.worth.is-absent { visibility: hidden; }

.wk-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-top: var(--space-4); }
.wk-actions .btn-ink { color: var(--ground); }
.wk-actions .btn-ground { background: var(--paper); }
.wk-actions .wk-link { font-size: 16px; line-height: 24px; }
.wk-use { margin-top: var(--space-2) !important; color: var(--grey-caption); font-size: var(--caption-size); line-height: var(--caption-line); }

/* Send me this: revealed inside the card; never needed to see the answer */
.wk-send { margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--ink); }
.wk-send[hidden] { display: none; }
.wk-send > p { margin: 0 0 var(--space-2); }
.wk-send-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: var(--space-2); align-items: end; }
.wk-send .field input { background: var(--paper); }
.wk-sent { margin: 0; font-weight: 500; }

/* ---------- The join: page prose on the page background ---------- */
.wk-prose { padding-top: var(--space-7); }
.wk-prose .lead-big { margin: 0; }
.wk-prose .split + .split { margin-top: var(--space-5); }

/* ---------- Tablet: questions above the result ---------- */
@media (max-width: 1023px) {
  .wk-grid { grid-template-columns: 1fr; row-gap: var(--space-5); }
  .wk-result { min-height: 0; }
  .wk-result[data-state="empty"] { min-height: 160px; }
}

/* ---------- Phone: every card full width; the result follows the last question ---------- */
@media (max-width: 639px) {
  .wk { padding: var(--space-7) 0; }
  .wk-head { margin-bottom: var(--space-5); }
  .wk-cards, .wk-cards[data-cols="3"] { grid-template-columns: 1fr; gap: var(--space-1); }
  .wk-card { min-height: 56px; }
  .wk-q legend { font-size: 20px; line-height: 28px; }
  .wk-result { margin: 0 calc(-1 * var(--margin)); padding: var(--space-4) var(--margin); border-left: 0; border-right: 0; }
  .wk-result[data-state="empty"] { min-height: 120px; }
  .wk-actions { flex-direction: column; align-items: stretch; }
  .wk-actions .btn { width: 100%; }
  .wk-send-row { grid-template-columns: 1fr; }
}

/* Phone: the full-bleed card's outline sits inside the screen edge */
@media (max-width: 639px) { .wk-draw { inset: 0; width: 100%; height: 100%; } }
