/* ===========================================================================
   three-quotes.css — page-scoped gaps for Tool 04 only.

   RULES OBSERVED
   - Every colour resolves through a canon token from assets/v4.css or the
     mirrored :root in assets/tool-chassis.css. There is not one hex literal
     in this file, and there must never be one.
   - Nothing here overrides a chassis rule. The focus ring, the 44px targets,
     the honest blank and the held block are the chassis's, untouched.
   - No score, meter, badge, seal, star or progress bar is styled here,
     because none exists on the page.
   - prefers-reduced-motion removes motion and takes no content with it.
   =========================================================================== */

/* --------------------------------------------------------------------------
   Page frame
   -------------------------------------------------------------------------- */

.t3q-intro {
  padding: clamp(28px, 5vw, 56px) 0 clamp(12px, 2vw, 20px);
  background: var(--foam-50);
}

.t3q-intro__inner {
  display: grid;
  gap: 14px;
  max-width: 900px;
}

.t3q-crumb {
  font-size: 13px;
  font-weight: 600;
  color: var(--pacific-700);
  letter-spacing: .01em;
}

.t3q-crumb a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.t3q-intro h1 {
  margin: 0;
  font-size: clamp(30px, 4.4vw, 50px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.02em;
  color: var(--pacific-900);
  text-wrap: balance;
  max-width: 22ch;
}

.t3q-lede {
  margin: 0;
  max-width: 66ch;
  font-size: clamp(16px, 1.5vw, 19px);
  color: var(--pacific-700);
  text-wrap: pretty;
}

.t3q-stage {
  padding: clamp(20px, 3vw, 36px) 0 clamp(32px, 5vw, 64px);
  background: var(--foam-50);
}

.t3q-stage__inner {
  display: grid;
  gap: clamp(20px, 3vw, 32px);
  max-width: 1080px;
}

/* --------------------------------------------------------------------------
   Typography inside the tool card
   -------------------------------------------------------------------------- */

.t3q-h3 {
  margin: 10px 0 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--pacific-900);
  text-wrap: balance;
}

.t3q-note {
  margin: 0;
  max-width: 72ch;
  font-size: 14px;
  line-height: 1.6;
  color: var(--pacific-900);
  text-wrap: pretty;
}

.t3q-note--caption {
  padding: 12px 14px;
  background: var(--sand-200);
  border-radius: 8px;
}

.t3q-note a,
.t3q-steps a,
.t3q-related__list a,
.t3q-src-link {
  color: var(--pacific-900);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}

.t3q-priv {
  margin: 0;
  max-width: 72ch;
  font-size: 13px;
  line-height: 1.6;
  color: var(--pacific-700);
}

.t3q-priv b {
  color: var(--pacific-900);
}

/* Wide controls span the whole input grid on roomy viewports. */
.t3q-control--wide {
  grid-column: 1 / -1;
}

.t3q-result__hint {
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   The generated brief
   -------------------------------------------------------------------------- */

.t3q-brief {
  display: grid;
  gap: 8px;
  padding: 16px;
  background: var(--foam-100);
  border: 1px solid var(--ocean-600);
  border-radius: 8px;
}

.t3q-brief__text {
  min-height: 260px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre;
  overflow-x: auto;
  background: var(--white);
}

.t3q-copy-note {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--pacific-900);
}

/* --------------------------------------------------------------------------
   Inclusion lists — native <details>, one per job type, all present in the
   HTML so the page reads completely with JavaScript off.
   -------------------------------------------------------------------------- */

.t3q-inclusions {
  display: grid;
  gap: 10px;
}

.t3q-inc {
  border: 1px solid var(--ocean-600);
  border-radius: 8px;
  background: var(--white);
}

.t3q-inc__summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--pacific-900);
  cursor: pointer;
  list-style: none;
  border-radius: 8px;
}

.t3q-inc__summary::-webkit-details-marker {
  display: none;
}

.t3q-inc__summary::before {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 180ms cubic-bezier(.2, .7, .3, 1);
}

.t3q-inc[open] > .t3q-inc__summary::before {
  transform: rotate(45deg);
}

.t3q-inc__summary:hover {
  background: var(--foam-100);
}

/* The selected job type is marked in words as well as in colour: the JS writes
   a visible "In your brief" tag and aria-current. Colour alone carries nothing. */
.t3q-inc[aria-current="true"] {
  border-width: 3px;
  border-color: var(--pacific-900);
}

.t3q-inc__tag {
  margin-inline-start: auto;
  padding: 3px 10px;
  border: 1px solid var(--ocean-600);
  border-radius: 999px;
  background: var(--foam-100);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .01em;
  white-space: nowrap;
}

.t3q-inc__list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 4px 18px 18px 34px;
  color: var(--pacific-900);
  font-size: 15px;
  line-height: 1.6;
}

/* With JavaScript off there is no selected job type, so no list should be
   folded away: every inclusion list opens and the whole brief is readable as
   plain text. Native <details> still works without JS, this just removes the
   click. */
html:not(.js) .t3q-inc__list {
  display: grid;
}

html:not(.js) .t3q-inc__summary::before {
  transform: rotate(45deg);
}

.t3q-format {
  padding: 16px 18px 16px 36px;
  border: 1px solid var(--ocean-600);
  border-radius: 8px;
  background: var(--white);
}

.t3q-steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-inline-start: 22px;
  max-width: 72ch;
  color: var(--pacific-900);
  font-size: 15px;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Consent control — native checkbox, 44px row, real label
   -------------------------------------------------------------------------- */

.t3q-consent {
  margin-top: 4px;
}

/* The whole row is the label, so the touch target is the row — comfortably past
   44px — rather than a 24px box a thumb has to find. The box stays 24px because
   a 44px checkbox looks like an error. */
.t3q-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 44px;
  padding: 12px 14px;
  background: var(--white);
  border: 2px solid var(--ocean-600);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  line-height: 1.5;
  text-wrap: pretty;
}

.t3q-check__box {
  flex: none;
  width: 24px;
  height: 24px;
  margin: 4px 0 0;
  accent-color: var(--pacific-900);
  cursor: pointer;
}

.t3q-check__text {
  display: block;
  min-height: 20px;
}

/* --------------------------------------------------------------------------
   The three gates inside the held block
   -------------------------------------------------------------------------- */

.t3q-gates {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: t3q-gate;
}

.t3q-gate {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  background: var(--foam-100);
  border-radius: 8px;
  border-inline-start: 6px solid var(--pacific-900);
}

.t3q-gate__name {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--pacific-900);
  text-wrap: pretty;
}

/* "Not cleared." is a word, at full weight and full contrast. There is no
   tick, no cross, no dial and no percentage anywhere near it. */
.t3q-gate__state {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--pacific-900);
}

.t3q-gate__why {
  margin: 0;
  max-width: 72ch;
  font-size: 14px;
  line-height: 1.6;
  color: var(--pacific-900);
  text-wrap: pretty;
}

/* --------------------------------------------------------------------------
   Related tools + disclosure
   -------------------------------------------------------------------------- */

.t3q-related {
  display: grid;
  gap: 12px;
  padding: clamp(18px, 2.6vw, 26px);
  background: var(--white);
  border: 1px solid var(--sky-400);
  border-radius: 8px;
}

.t3q-related__list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-inline-start: 20px;
  max-width: 78ch;
  color: var(--pacific-900);
  font-size: 15px;
  line-height: 1.6;
}

.t3q-disclosure {
  padding: clamp(20px, 3vw, 32px) 0;
  background: var(--foam-100);
}

.t3q-disclosure p {
  margin: 0;
  max-width: 90ch;
  font-size: 14px;
  line-height: 1.65;
  color: var(--pacific-900);
}

/* --------------------------------------------------------------------------
   Narrow viewports
   -------------------------------------------------------------------------- */

@media (max-width: 620px) {
  .t3q-inc__tag {
    margin-inline-start: 0;
  }

  .t3q-inc__summary {
    flex-wrap: wrap;
  }
}

/* --------------------------------------------------------------------------
   Print — the brief is the document. Everything the homeowner would send is
   on the paper, including the inclusion lists, so a printed copy is usable
   even if the copy button never worked.
   -------------------------------------------------------------------------- */

@media print {
  .site-header,
  .source-rail,
  .site-footer,
  .t3q-related,
  .tc-actions,
  .tc-input,
  .tc-nojs,
  .tc-status {
    display: none !important;
  }

  .t3q-stage,
  .t3q-intro {
    background: none;
  }

  .tc-tool {
    border: none;
    box-shadow: none;
    padding: 0;
  }

  .t3q-inc {
    break-inside: avoid;
  }

  .t3q-brief__text {
    min-height: 0;
    height: auto;
    white-space: pre-wrap;
    border: none;
  }
}

/* --------------------------------------------------------------------------
   Reduced motion — the chevron stops turning; the open/closed state is still
   carried by the native <details>, by aria-current and by the visible tag.
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .t3q-inc__summary::before {
    transition: none;
  }
}
