/* ============================================================================
   Tool pages
   ----------------------------------------------------------------------------
   Loaded after css/app.css, which owns the palette, the theme switching and the
   shared chrome (topbar, buttons, panels, byline). Nothing here redefines a
   colour: every value below is one of the tokens on :root, so the tool pages
   follow light and dark exactly as the calculator does.

   What this file adds is the two things the tool pages have and the PI-RADS
   page does not: the question/result split, and a long prose column under it.
   ========================================================================== */

/* -------------------------------------------------------------- layout -- */

.tool-layout {
  max-width: 68rem;
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 2.5rem) clamp(1rem, 4vw, 2rem) 4rem;
}

.tool-layout > h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  line-height: 1.2;
  margin: 0 0 .5rem;
}

.lede {
  font-size: 1.08rem;
  color: var(--text-dim);
  max-width: 46rem;
  margin: 0 0 1.75rem;
}

/* ---------------------------------------------------------- calculator -- */

.tool-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1rem, 3vw, 1.5rem);
  margin-bottom: 3rem;
}

.review-banner {
  background: var(--mid-bg);
  border: 1px solid var(--mid);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: .75rem .9rem;
  margin-bottom: 1rem;
  font-size: .92rem;
}

.review-banner strong { color: var(--mid); }

.applies { margin: 0 0 .6rem; font-size: .92rem; color: var(--text-dim); }

.applies-label {
  display: inline-block;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: .74rem;
  margin-right: .35rem;
}

.exclusions-wrap { margin-bottom: 1.25rem; font-size: .92rem; }
.exclusions-wrap summary { cursor: pointer; color: var(--text-dim); }
.exclusions-wrap ul { margin: .5rem 0 0; padding-left: 1.2rem; color: var(--text-dim); }
.exclusions-wrap li { margin: .2rem 0; }

/* The questions and the result sit side by side while there is room for both,
   because the result changes as the questions are answered and a reader should
   not have to scroll to see that happen. */
.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2rem);
  align-items: start;
}

@media (max-width: 760px) {
  .tool-grid { grid-template-columns: minmax(0, 1fr); }
}

.field { margin-bottom: 1.1rem; }

.field-label {
  display: block;
  font-weight: 600;
  font-size: .92rem;
  margin-bottom: .4rem;
}

.field-help { margin: .4rem 0 0; font-size: .82rem; color: var(--text-faint); }

.choices { display: flex; flex-wrap: wrap; gap: .35rem; }

.choice {
  font: inherit;
  font-size: .88rem;
  padding: .42rem .7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.choice:hover { border-color: var(--accent); }

.choice.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.number-wrap { display: flex; align-items: center; gap: .5rem; }

.number {
  font: inherit;
  width: 7rem;
  padding: .42rem .6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
}

.unit { color: var(--text-faint); font-size: .88rem; }

/* ------------------------------------------------------------- result -- */

.result {
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: var(--radius-sm);
  padding: 1rem;
  background: var(--surface-2);
}

.result.waiting { color: var(--text-faint); }
.waiting-text { margin: 0; font-size: .92rem; }

.result-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .6rem; }
.result-head h3 { margin: 0; font-size: 1.05rem; }

.badge {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 700;
  padding: .18rem .45rem;
  border-radius: 4px;
}

/* The four urgency levels reuse the calculator's own low/mid/high tokens, so a
   colour means the same thing on every page of the site. */
.level-none    { border-left-color: var(--low);  background: var(--low-bg); }
.level-none    .badge { background: var(--low);  color: var(--accent-ink); }
.level-routine { border-left-color: var(--low);  background: var(--low-bg); }
.level-routine .badge { background: var(--low);  color: var(--accent-ink); }
.level-short   { border-left-color: var(--mid);  background: var(--mid-bg); }
.level-short   .badge { background: var(--mid);  color: var(--accent-ink); }
.level-urgent  { border-left-color: var(--high); background: var(--high-bg); }
.level-urgent  .badge { background: var(--high); color: var(--accent-ink); }

.recommendation { margin: .7rem 0 0; font-weight: 600; }

.notes { margin: .6rem 0 0; padding-left: 1.1rem; font-size: .88rem; color: var(--text-dim); }
.notes li { margin: .2rem 0; }

.report {
  margin-top: .9rem;
  padding-top: .8rem;
  border-top: 1px solid var(--line);
}

.report-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-faint);
  margin-bottom: .3rem;
}

.report-text { margin: 0; font-family: var(--mono); font-size: .84rem; line-height: 1.55; }

.result .citation { margin: .8rem 0 0; font-size: .78rem; color: var(--text-faint); }

.tool-actions { display: flex; gap: .5rem; margin-top: .75rem; }
.tool-actions button { flex: 0 0 auto; }

.tool-source { margin: 1.25rem 0 0; font-size: .8rem; color: var(--text-faint); }

/* --------------------------------------------------------------- prose -- */

.prose { max-width: 46rem; }
.prose section { margin-bottom: 2.5rem; }

.prose h2 {
  font-size: 1.28rem;
  margin: 0 0 .7rem;
  padding-bottom: .35rem;
  border-bottom: 1px solid var(--line-soft);
}

.prose p { line-height: 1.68; margin: 0 0 .9rem; }

.table-wrap { overflow-x: auto; margin: 1.1rem 0; }

.prose table { border-collapse: collapse; width: 100%; font-size: .88rem; }

.prose caption {
  caption-side: top;
  text-align: left;
  font-size: .78rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding-bottom: .45rem;
}

.prose th,
.prose td {
  border: 1px solid var(--line);
  padding: .45rem .6rem;
  text-align: left;
  vertical-align: top;
}

.prose thead th { background: var(--surface-2); font-size: .8rem; }
.prose tbody th { font-weight: 600; background: var(--surface-2); }

/* A blank first cell continues the category above it rather than starting a
   new one, so it carries no border on the side it continues from. */
.prose td.cont { background: var(--surface-2); border-top-color: transparent; }

/* ----------------------------------------------------------------- faq -- */

.faq-item {
  border-bottom: 1px solid var(--line-soft);
  padding: .7rem 0;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: .96rem;
}

.faq-item p { margin: .6rem 0 0; color: var(--text-dim); line-height: 1.65; }

.source .citation { font-size: .9rem; color: var(--text-dim); }
.disclaimer { font-size: .84rem; color: var(--text-faint); line-height: 1.6; }

/* --------------------------------------------------------- other tools -- */

.more-tools { max-width: 46rem; margin-top: 1rem; }
.more-tools h2 { font-size: 1.1rem; margin: 0 0 .8rem; }
.more-tools ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }

.more-tools a {
  display: block;
  padding: .75rem .9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
}

.more-tools a:hover { border-color: var(--accent); }
.more-tools b { display: block; font-size: .95rem; margin-bottom: .15rem; }
.more-tools span { display: block; font-size: .85rem; color: var(--text-dim); line-height: 1.5; }

/* --------------------------------------------------------------- misc -- */

/* .brand-name lives in css/app.css — index.html carries it too and does not
   load this file. */

.site-foot a { color: var(--accent); }
