/*
 * Renatus business toolkit.
 * Uses the brand tokens, .hero, .card and .btn styles in site.css; do not add
 * a separate light theme here. Also used by the three homepage tool cards.
 * Calculation and lead-capture behavior live in js/business-tools.mjs.
 */

/* Foundations and accessible controls */
body.tools-page { color-scheme: dark; }
.tools-page [hidden] { display: none !important; }
.tools-page main { overflow-wrap: anywhere; }
.tools-page main [id] { scroll-margin-top: 110px; }
.tools-page button,
.tools-page input,
.tools-page select,
.tools-page textarea { font: inherit; }
.tools-page :focus-visible { outline: 3px solid var(--renatus-cyan); outline-offset: 4px; }
.tools-page .skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 9999;
  padding: 14px 20px;
  color: var(--renatus-bg);
  background: var(--renatus-gold);
}
.tools-page .skip-link:focus { top: 12px; }
.tools-page .btn { max-width: 100%; text-align: center; white-space: normal; }
.tools-page .btn:disabled { cursor: wait; opacity: .65; }
.tools-page label,
.tools-page legend { color: var(--renatus-white); }

/* Shared skyline hero: the background itself comes from .hero in hero.css. */
.tool-hero {
  position: relative;
  padding: 5rem 0;
  border-bottom: 1px solid var(--renatus-border);
}
.tool-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: center;
  gap: 44px;
}
.tool-hero h1 {
  margin: 20px 0 24px;
  max-width: 880px;
  color: var(--renatus-white);
  font-size: clamp(2.5rem, 4vw, 3.6rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -.045em;
  text-transform: uppercase;
  text-shadow: 0 8px 28px rgba(2, 3, 20, .55);
}
.tool-hero h1 span { color: var(--renatus-gold); }
.tool-hero-copy {
  max-width: 650px;
  margin: 0 0 24px;
  color: #d9d9dd;
  font-size: 1.05rem;
  line-height: 1.8;
}
.tool-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  color: var(--renatus-gold);
  font-size: .72rem;
  font-weight: 750;
  line-height: 1.6;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.tool-kicker::before {
  content: "";
  flex: 0 0 30px;
  height: 2px;
  background: linear-gradient(90deg, var(--renatus-orange), var(--renatus-pink));
}
.tool-hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; margin: 28px 0 20px; }
.tool-hero-actions .btn { gap: 14px; }
.tool-text-link { color: var(--renatus-gold); font-weight: 650; text-decoration: underline; text-underline-offset: 5px; }
.tool-text-link:hover,
.tool-text-link:focus-visible { color: var(--renatus-white); }
.tool-trust { color: #d9d9dd; font-size: .8rem; line-height: 1.8; }
.tool-hero-compact { padding: 3.5rem 0 4rem; }
.tool-hero-compact h1 { max-width: 920px; font-size: clamp(2.35rem, 4.5vw, 4rem); }
.tool-breadcrumb { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; color: #d9d9dd; font-size: .8rem; }
.tool-breadcrumb a:hover,
.tool-breadcrumb a:focus-visible { color: var(--renatus-gold); text-decoration: underline; }
.tool-pill { display: inline-block; padding: 6px 12px; border: 1px solid var(--renatus-border); border-radius: 5px; color: var(--renatus-gold); background: rgba(7, 8, 25, .8); font-size: .75rem; }

/* The hub's quick-start panel uses the same framed surfaces as other pages. */
.tool-start-panel {
  position: relative;
  padding: 28px;
  border: 1px solid var(--renatus-border);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(28, 27, 48, .97), rgba(9, 10, 29, .97));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 18px 40px rgba(2, 3, 18, .32);
}
.tool-start-panel::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 12px;
  right: 12px;
  height: 2px;
  background: linear-gradient(90deg, var(--renatus-orange), var(--renatus-pink), var(--renatus-cyan));
}
.tool-panel-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--renatus-border);
  color: var(--renatus-cyan);
  font: 600 .66rem/1.6 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .06em;
}
.tool-start-panel > a { display: flex; align-items: flex-start; gap: 14px; padding: 20px 0; border-top: 1px solid var(--renatus-border); }
.tool-start-panel > a:last-child { padding-bottom: 0; }
.tool-start-panel > a > span { flex: 0 0 1.35rem; white-space: nowrap; padding-top: 4px; color: var(--renatus-gold); font: 500 .78rem ui-monospace, monospace; }
.tool-start-panel > a > div { min-width: 0; }
.tool-start-panel strong { display: block; color: var(--renatus-white); font-size: 1rem; line-height: 1.5; }
.tool-start-panel small { display: block; margin-top: 7px; color: var(--renatus-muted); font-size: .82rem; line-height: 1.65; }
.tool-start-panel b { margin-left: auto; color: var(--renatus-gold); font-size: 1.2rem; }
.tool-start-panel a:hover strong,
.tool-start-panel a:focus-visible strong { color: var(--renatus-gold); text-decoration: underline; text-underline-offset: 4px; }
.tool-principles { background: var(--renatus-panel-deep); border-bottom: 1px solid var(--renatus-border); }
.tool-principles-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; padding-top: 24px; padding-bottom: 24px; }
.tool-principles p { margin: 0; font-size: .85rem; line-height: 1.7; }
.tool-principles strong,
.tool-principles span { display: block; }
.tool-principles strong { color: var(--renatus-white); }
.tool-principles span { margin-top: 5px; color: var(--renatus-muted); }

/* Library cards: .card supplies the shared surface, border and accent strip. */
.tool-section-head { max-width: 740px; margin-bottom: 32px; }
.tool-section-head h2,
.tool-bottom-callout h2 { margin: 10px 0 16px; font-size: clamp(1.8rem, 3.3vw, 2.5rem); line-height: 1.12; font-weight: 800; letter-spacing: -.035em; text-transform: uppercase; }
.tool-section-head p:not(.tool-kicker),
.tool-bottom-callout p:not(.tool-kicker) { color: var(--renatus-muted); line-height: 1.8; }
.tool-filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 14px; }
.tool-filters button {
  min-height: 46px;
  padding: 11px 20px;
  border: 1px solid var(--renatus-border);
  border-radius: 5px;
  background: var(--renatus-panel-deep);
  color: var(--renatus-muted);
  cursor: pointer;
  font-size: .8rem;
  font-weight: 700;
}
.tool-filters button:hover { color: var(--renatus-white); border-color: var(--renatus-gold); }
.tool-filters button[aria-pressed="true"] { color: var(--renatus-bg); background: var(--renatus-gold); border-color: var(--renatus-gold); }
#tool-count { margin-bottom: 22px; }
.tool-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.tool-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 26px;
  transition: border-color .15s ease, transform .15s ease;
}
.tool-card:hover { border-color: var(--renatus-gold); transform: translateY(-3px); }
.tool-card-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.tool-category { color: var(--renatus-gold); font-size: .7rem; font-weight: 750; line-height: 1.7; letter-spacing: .1em; text-transform: uppercase; }
.tool-number { white-space: nowrap; color: var(--renatus-muted); font: 500 .75rem ui-monospace, monospace; }
.tool-card h3,
.tool-card h2 { margin: 22px 0 12px; font-size: 1.25rem; font-weight: 750; line-height: 1.35; letter-spacing: -.015em; }
body:not(.routepulse-page) .tool-card h3 { margin-top: 22px; margin-bottom: 12px; }
.tool-card h2 a:hover,
.tool-card h2 a:focus-visible { color: var(--renatus-gold); }
body:not(.routepulse-page) .tool-card p { margin: 0 0 24px; font-size: .93rem; line-height: 1.8; }
.tool-card-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: auto; padding-top: 18px; border-top: 1px solid var(--renatus-border); }
.tool-meta { max-width: 160px; color: var(--renatus-muted); font-size: .73rem; line-height: 1.65; }
.tool-open { display: inline-flex; align-items: center; gap: 10px; align-self: flex-start; margin-top: auto; color: var(--renatus-gold); font-size: .85rem; font-weight: 700; line-height: 1.7; }
.tool-open:hover,
.tool-open:focus-visible { color: var(--renatus-white); text-decoration: underline; text-underline-offset: 4px; }
.tool-bottom-callout { display: flex; align-items: center; gap: 36px; }
.tool-bottom-callout > div { flex: 1; min-width: 0; }
.tool-bottom-callout > .btn { flex-shrink: 0; }
.tool-narrow { max-width: 850px; }
.tool-narrow > p { color: var(--renatus-muted); line-height: 1.8; }
.tool-center { margin-top: 28px; text-align: center; }
.tool-center a { color: var(--renatus-gold); text-decoration: underline; text-underline-offset: 4px; }

/* Questionnaires and review forms */
.tool-panel { padding: 36px; color: var(--renatus-white); border: 1px solid var(--renatus-border); border-radius: 10px; background: var(--renatus-panel-deep); box-shadow: 0 18px 40px rgba(2, 3, 18, .2); }
.tools-page .tool-panel h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; line-height: 1.1; letter-spacing: -.035em; text-transform: uppercase; }
.tool-progress-head { display: flex; justify-content: space-between; gap: 16px; color: var(--renatus-muted); font-size: .8rem; line-height: 1.7; }
.tool-progress-head #step-label { color: var(--renatus-gold); font-weight: 750; }
.tool-panel progress { appearance: none; display: block; width: 100%; height: 6px; overflow: hidden; margin: 16px 0 30px; border: 0; border-radius: 3px; background: var(--renatus-panel); accent-color: var(--renatus-gold); }
.tool-panel progress::-webkit-progress-bar { background: var(--renatus-panel); }
.tool-panel progress::-webkit-progress-value { background: linear-gradient(90deg, var(--renatus-orange), var(--renatus-pink)); }
.tool-panel progress::-moz-progress-bar { background: linear-gradient(90deg, var(--renatus-orange), var(--renatus-pink)); }
.tool-step { min-width: 0; padding: 0; border: 0; margin: 0; }
.tool-step legend { width: 100%; margin-bottom: 26px; padding: 0; font-size: 1.3rem; font-weight: 750; line-height: 1.4; }
.tool-field { min-width: 0; margin-bottom: 24px; }
.tool-field label { display: block; margin: 0 0 10px; font-size: .95rem; font-weight: 600; line-height: 1.65; }
.question-number { margin-right: 5px; color: var(--renatus-gold); font: .75rem ui-monospace, monospace; }
body.tools-page .tool-field input,
body.tools-page .tool-field select,
body.tools-page .tool-field textarea { min-height: 48px; padding: 12px; font-size: 1rem; line-height: 1.5; }
body.tools-page .tool-field input:focus-visible,
body.tools-page .tool-field select:focus-visible,
body.tools-page .tool-field textarea:focus-visible { outline: 3px solid var(--renatus-cyan); outline-offset: 3px; }
.tool-field input::placeholder,
.tool-field textarea::placeholder { color: var(--renatus-muted); opacity: .85; }
.tool-field select option { color: var(--renatus-white); background: var(--renatus-panel-deep); }
.tool-help { margin: 8px 0 0; color: var(--renatus-muted); font-size: .82rem; line-height: 1.75; overflow-wrap: anywhere; }
.tool-help a,
.tool-consent a { color: var(--renatus-gold); text-decoration: underline; text-underline-offset: 3px; }
.tool-two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.tool-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 26px 0 16px; }
.tool-error { padding: 14px 16px; color: #ffc0c7; border: 1px solid #ac4960; border-radius: 5px; background: #321727; font-size: .9rem; line-height: 1.7; }
.tool-status { color: var(--renatus-cyan); font-size: .88rem; line-height: 1.7; }
.tool-status:empty { display: none; }
body.tools-page .tool-consent { display: flex; align-items: flex-start; gap: 12px; margin: 24px 0; color: var(--renatus-muted); font-size: .86rem; line-height: 1.8; }
body.tools-page .tool-consent input { flex: 0 0 20px; width: 20px; min-width: 20px; max-width: 20px; height: 20px; margin: 4px 0 0; padding: 0; accent-color: var(--renatus-gold); }
.tool-consent span { min-width: 0; overflow-wrap: anywhere; }
.tools-page details > summary { cursor: pointer; padding: 14px 0; color: var(--renatus-gold); font-weight: 650; line-height: 1.7; }
.tools-page details > summary:hover { color: var(--renatus-white); }
.tool-loading { opacity: .65; pointer-events: none; }

/* Methods, service workflows, and supporting context */
.tool-method-grid { display: grid; gap: 22px; }
.tool-method-grid article { padding-top: 16px; border-top: 1px solid var(--renatus-border); }
.tool-method-grid h3 { font-size: 1.1rem; }
.tool-method-grid p,
.tool-industry-sections p,
.tool-lede { color: var(--renatus-muted); line-height: 1.85; }
.tool-industry-sections article { margin: 40px 0; }
.tool-industry-sections h2 { font-size: 1.6rem; font-weight: 750; line-height: 1.3; }
.tool-lede { font-size: 1.1rem; }
.tool-notice { padding: 24px; border: 1px solid var(--renatus-border); border-left: 3px solid var(--renatus-gold); border-radius: 6px; background: var(--renatus-panel); color: var(--renatus-muted); line-height: 1.8; }
.tool-notice h2 { color: var(--renatus-white); font-size: 1.3rem; }
.tool-notice a { color: var(--renatus-gold); text-decoration: underline; }
.tool-proof { margin: 30px 0; padding: 28px; border: 1px solid var(--renatus-border); border-radius: 10px; background: var(--renatus-panel-deep); }
.tool-proof h2 { font-size: 1.3rem; }
.tool-proof h2 a { color: var(--renatus-gold); text-decoration: underline; text-underline-offset: 4px; }
.tool-proof p:not(.tool-kicker) { color: var(--renatus-muted); line-height: 1.8; }

/* Results use the same dark system; printing is the intentional exception. */
.tool-result-panel h2 { font-size: 1.9rem; line-height: 1.2; letter-spacing: -.025em; }
.tool-result-panel > p:not(.tool-kicker) { color: var(--renatus-muted); line-height: 1.8; }
.tool-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 26px 0; }
.tool-metric { min-width: 0; padding: 22px; border: 1px solid var(--renatus-border); border-radius: 6px; background: var(--renatus-panel); }
.tool-metric .metric-label { display: block; color: var(--renatus-muted); font-size: .8rem; line-height: 1.6; }
.tool-metric strong { display: block; margin: 10px 0; color: var(--renatus-gold); font-size: clamp(1.4rem, 2.8vw, 2rem); font-weight: 750; letter-spacing: -.035em; line-height: 1.2; overflow-wrap: anywhere; }
.tool-metric p { margin: 0; color: var(--renatus-muted); font-size: .8rem; line-height: 1.7; }
.tool-result-method { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--renatus-border); color: var(--renatus-muted); font-size: .86rem; line-height: 1.8; }
.tool-result-method h3 { color: var(--renatus-white); font-size: 1rem; }
.tool-action { margin: 26px 0; padding-left: 18px; border-left: 3px solid var(--renatus-cyan); }
.tool-action h4 { margin: 6px 0; font-size: 1.05rem; line-height: 1.5; }
.tool-action p { margin: 7px 0; color: var(--renatus-muted); font-size: .93rem; line-height: 1.8; }
.tool-action .priority { color: var(--renatus-cyan); font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.tool-action[data-priority="Verify"] { border-left-color: var(--renatus-gold); }
.tool-action[data-priority="Verify"] .priority { color: var(--renatus-gold); }
.tool-report-preview { max-height: 350px; padding: 18px; overflow: auto; border: 1px solid var(--renatus-border); border-radius: 6px; color: var(--renatus-muted); background: var(--renatus-bg); white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; font: .78rem/1.8 ui-monospace, SFMono-Regular, Consolas, monospace; }
.tool-report-table-wrap { margin: 20px 0; overflow: auto; border: 1px solid var(--renatus-border); border-radius: 6px; }
.tool-report-table { width: 100%; min-width: 480px; border-collapse: collapse; table-layout: fixed; color: var(--renatus-muted); font-size: .84rem; }
.tool-report-table th,
.tool-report-table td { padding: 14px; border-bottom: 1px solid var(--renatus-border); text-align: left; vertical-align: top; overflow-wrap: anywhere; line-height: 1.75; }
.tool-report-table thead th { color: var(--renatus-gold); background: var(--renatus-panel); }
.tool-report-table tbody th { width: 25%; color: var(--renatus-white); font-weight: 600; }
.tool-report-table caption { padding: 14px; color: var(--renatus-white); background: var(--renatus-panel-deep); text-align: left; font-weight: 600; }
.tool-check-status { display: block; margin-bottom: 6px; font-size: .76rem; font-weight: 700; }
.tool-check-status[data-status="observed"] { color: var(--renatus-cyan); }
.tool-check-status[data-status="review"],
.tool-check-status[data-status="not-observed"] { color: var(--renatus-gold); }
.tool-unknown-list { padding-left: 22px; color: var(--renatus-muted); font-size: .9rem; line-height: 1.8; }
.tool-groups { display: flex; flex-wrap: wrap; gap: 10px; }
.tool-group { padding: 12px 16px; border: 1px solid var(--renatus-border); border-radius: 5px; background: var(--renatus-panel); font-size: .8rem; line-height: 1.7; }
.tool-group strong { display: block; color: var(--renatus-white); }
.tool-group span { color: var(--renatus-muted); }

/* Responsive layouts. Tables scroll inside their own labelled region. */
@media (max-width: 900px) {
  .tool-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .tool-hero { padding: 3.5rem 0; }
  .tool-hero h1 { max-width: 720px; }
  .tool-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-bottom-callout { display: block; }
  .tool-bottom-callout > .btn { margin-top: 16px; }
  .tool-principles-grid { gap: 20px; }
  .tool-report-table th,
  .tool-report-table td { padding: 10px; }
}
@media (max-width: 600px) {
  body.tools-page main > .section { padding: 3rem 0; }
  .tool-card-grid,
  .tool-principles-grid,
  .tool-metrics { grid-template-columns: minmax(0, 1fr); }
  .tool-principles-grid { gap: 18px; }
  .tool-principles p + p { padding-top: 18px; border-top: 1px solid var(--renatus-border); }
  .tool-hero h1 { font-size: clamp(2.1rem, 8.5vw, 3rem); }
  .tool-hero-copy { font-size: 1rem; }
  .tool-hero-actions { gap: 18px; }
  .tool-hero-actions .btn { width: 100%; }
  .tool-panel { padding: 24px 18px; }
  .tool-two-col { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .tool-progress-head { flex-direction: column; gap: 5px; }
  .tool-card { padding: 24px; }
  .tool-section-head h2 { font-size: 1.8rem; }
  .tool-actions .btn { flex: 1 1 auto; }
  .tool-filters { gap: 8px; }
  .tool-filters button { padding: 10px 14px; }
  .tool-start-panel { padding: 24px 20px; }
  .tool-start-panel > a { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .tool-card,
  .tools-page .btn { transition: none; }
  .tool-card:hover,
  body.tools-page .btn:hover { transform: none; }
}
@media (forced-colors: active) {
  .tool-card,
  .tool-panel,
  .tool-metric,
  .tool-filters button { border: 1px solid CanvasText; }
  .tool-filters button[aria-pressed="true"] { outline: 2px solid Highlight; }
}
@media print {
  /* Keep reports legible and economical on paper, regardless of screen theme. */
  body.tools-page,
  body.tools-page main,
  body.tools-page main > .section { color-scheme: light; background: #fff !important; color: #111 !important; }
  .tools-page main * { background: transparent !important; color: #111 !important; border-color: #aaa !important; text-shadow: none !important; box-shadow: none !important; }
  .tools-page .site-header,
  .tools-page .site-footer,
  .tools-page .skip-link,
  .tools-page .tool-print-hide,
  .tools-page .tool-actions,
  .tools-page #personal-review { display: none !important; }
  .tools-page:has(#tool-results:not([hidden])) main > section:not(#tool-results) { display: none !important; }
  body.tools-page main > #tool-results { padding: 0; border: 0; }
  .tools-page .tool-result-panel { padding: 0; border: 0; }
  .tools-page .container { max-width: 100%; padding: 0; }
  .tools-page .tool-metric,
  .tools-page .tool-result-method,
  .tools-page .tool-action { break-inside: avoid; }
  .tools-page .tool-report-table-wrap { overflow: visible; }
  .tools-page .tool-report-table { min-width: 0; font-size: 8pt; }
  .tools-page .tool-report-table th,
  .tools-page .tool-report-table td { padding: 6px; }
  .tools-page .tool-report-preview { max-height: none; overflow: visible; }
  .tools-page details:not([open]) > summary { display: none; }
  .tools-page .tool-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
