/* ============================================================================
   Rounds /tools/ — citation-first clinical tools styling
   ----------------------------------------------------------------------------
   Lives alongside `static/css/base.css` (fundLP design system). Scoped under
   .tool-page so it never leaks into chat or article surfaces.
   ============================================================================ */

.tool-page {
  --tool-cream: #fbf7f0;
  --tool-teal: #0e6e6c;
  --tool-teal-dark: #094645;
  --tool-orange: #f6a560;
  --tool-soft-line: rgba(11, 32, 56, 0.08);
}

.tool-page .tool-hero {
  background: var(--tool-cream);
  border-radius: 18px;
  padding: 32px 28px;
  margin-bottom: 28px;
  border: 1px solid var(--tool-soft-line);
}

.tool-page .tool-hero h1 {
  font-family: "Source Serif 4", "Source Serif Pro", Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.75rem, 2.4vw, 2.4rem);
  color: var(--tool-teal-dark);
  margin: 0 0 10px 0;
}

.tool-page .tool-hero .tool-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tool-teal);
  margin-bottom: 12px;
}

.tool-page .tool-hero p.lead {
  color: #1f2937;
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 78ch;
  margin: 0;
}

.tool-page .tool-section {
  background: #ffffff;
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
  border: 1px solid var(--tool-soft-line);
}

.tool-page .tool-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #0b2038;
  margin: 0 0 12px 0;
}

.tool-page .tool-section h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #0b2038;
  margin: 18px 0 8px 0;
}

.tool-page .calc-form .form-label {
  font-weight: 500;
  color: #1f2937;
  margin-bottom: 4px;
}

.tool-page .calc-form .form-text {
  font-size: 0.825rem;
  color: #4b5563;
}

.tool-page .calc-result {
  background: #f6fbfb;
  border: 1px solid #c5e2e1;
  border-radius: 12px;
  padding: 20px 22px;
  margin-top: 18px;
}

.tool-page .calc-result .result-headline {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--tool-teal-dark);
  margin: 0;
}

.tool-page .calc-result .result-band {
  display: inline-block;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--tool-soft-line);
  color: var(--tool-teal-dark);
  margin-top: 8px;
}

.tool-page .interpretation-table {
  width: 100%;
  border-collapse: collapse;
}

.tool-page .interpretation-table th,
.tool-page .interpretation-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--tool-soft-line);
  font-size: 0.95rem;
  text-align: left;
  vertical-align: top;
}

.tool-page .interpretation-table th {
  font-weight: 600;
  background: #f9fafb;
}

.tool-page .ask-rounds-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  background: linear-gradient(180deg, #ffffff, #f1faf9);
  border: 1px solid #c5e2e1;
  border-radius: 14px;
  padding: 18px 22px;
  margin: 24px 0;
}

.tool-page .ask-rounds-cta .ask-rounds-text {
  flex: 1 1 280px;
  font-size: 0.98rem;
  color: #1f2937;
  margin: 0;
}

.tool-page .ask-rounds-cta .btn {
  white-space: nowrap;
}

.tool-page .ask-rounds-cta .btn-primary {
  background: var(--tool-teal);
  border-color: var(--tool-teal);
}

.tool-page .ask-rounds-cta .btn-primary:hover {
  background: var(--tool-teal-dark);
  border-color: var(--tool-teal-dark);
}

.tool-page .safety-disclaimer {
  background: #fff6ec;
  border: 1px solid #f6cf99;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.tool-page .safety-disclaimer i {
  color: #c2680b;
  font-size: 1.2rem;
  margin-top: 2px;
}

.tool-page .safety-disclaimer .safety-text {
  font-size: 0.9rem;
  color: #5b3b08;
  line-height: 1.45;
  margin: 0;
}

.tool-page .cited-source {
  background: #f6fbfb;
  border: 1px solid #c5e2e1;
  border-radius: 12px;
  padding: 14px 18px;
  margin-top: 16px;
}

.tool-page .cited-source .cited-source-name {
  font-weight: 600;
  color: var(--tool-teal-dark);
}

.tool-page .cited-source small {
  display: block;
  margin-top: 4px;
  color: #4b5563;
}

.tool-page .faq-list details {
  border-bottom: 1px solid var(--tool-soft-line);
  padding: 12px 0;
}

.tool-page .faq-list details:last-child {
  border-bottom: 0;
}

.tool-page .faq-list summary {
  cursor: pointer;
  font-weight: 600;
  color: #0b2038;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tool-page .faq-list summary::after {
  content: "+";
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--tool-teal);
}

.tool-page .faq-list details[open] summary::after {
  content: "−";
}

.tool-page .faq-list .faq-answer {
  margin-top: 10px;
  color: #1f2937;
  font-size: 0.97rem;
  line-height: 1.55;
}

.tool-page .related-tools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.tool-page .related-tools a {
  display: block;
  background: #ffffff;
  border: 1px solid var(--tool-soft-line);
  border-radius: 10px;
  padding: 14px 16px;
  text-decoration: none;
  color: #0b2038;
  transition: border-color 0.15s ease, transform 0.1s ease;
}

.tool-page .related-tools a:hover {
  border-color: var(--tool-teal);
  transform: translateY(-1px);
}

.tool-page .related-tools .related-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.tool-page .related-tools .related-meta {
  font-size: 0.82rem;
  color: #4b5563;
  margin-top: 4px;
}

/* AI tool error + result */
.tool-page .ai-result {
  background: #ffffff;
  border: 1px solid var(--tool-soft-line);
  border-radius: 12px;
  padding: 18px 20px;
  margin-top: 18px;
}

.tool-page .ai-result h3 {
  margin: 0 0 8px 0;
  font-size: 1.05rem;
}

.tool-page .ai-result .ai-section {
  margin-bottom: 14px;
}

.tool-page .ai-result .ai-section:last-child {
  margin-bottom: 0;
}

.tool-page .ai-result .ai-bullets {
  margin: 8px 0 0 18px;
  padding: 0;
}

.tool-page .ai-result .ai-bullets li {
  margin-bottom: 6px;
  font-size: 0.96rem;
}

.tool-page .ai-result .verify-sources {
  background: #f6fbfb;
  border-left: 3px solid var(--tool-teal);
  padding: 10px 12px;
  font-size: 0.92rem;
  color: #1f2937;
  margin-top: 12px;
}

.tool-page .ai-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 10px;
  padding: 12px 14px;
  color: #7f1d1d;
  font-size: 0.93rem;
}

/* Sticky mobile CTA */
.tool-sticky-mobile-cta {
  display: none;
}

@media (max-width: 768px) {
  .tool-sticky-mobile-cta {
    display: flex;
    position: fixed;
    bottom: 12px;
    left: 12px;
    right: 12px;
    z-index: 100;
    background: var(--tool-teal);
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 999px;
    font-weight: 600;
    text-decoration: none;
    justify-content: center;
    align-items: center;
    gap: 8px;
    box-shadow: 0 12px 24px rgba(11, 32, 56, 0.15);
  }
  .tool-sticky-mobile-cta:hover,
  .tool-sticky-mobile-cta:focus {
    color: #ffffff;
    background: var(--tool-teal-dark);
  }
}

/* Landing page */
.tool-landing-hero {
  background: var(--tool-cream);
  border-radius: 22px;
  padding: 44px 28px;
  margin-bottom: 30px;
  text-align: center;
  border: 1px solid var(--tool-soft-line);
}

.tool-landing-hero h1 {
  font-family: "Source Serif 4", "Source Serif Pro", Georgia, serif;
  font-weight: 600;
  font-size: clamp(2rem, 3vw, 2.8rem);
  color: var(--tool-teal-dark);
  margin: 0 0 12px 0;
}

.tool-landing-hero p {
  font-size: 1.08rem;
  color: #1f2937;
  max-width: 60ch;
  margin: 0 auto;
}

.tool-category {
  margin-bottom: 36px;
}

.tool-category h2 {
  font-size: 1.4rem;
  font-weight: 600;
  color: #0b2038;
  margin: 0 0 6px 0;
}

.tool-category .tool-category-blurb {
  color: #4b5563;
  font-size: 0.95rem;
  margin: 0 0 14px 0;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid var(--tool-soft-line);
  border-radius: 12px;
  padding: 18px 20px;
  text-decoration: none;
  color: #0b2038;
  transition: border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.tool-card:hover {
  border-color: var(--tool-teal);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(11, 32, 56, 0.06);
  color: #0b2038;
}

.tool-card .tool-card-icon {
  font-size: 1.4rem;
  color: var(--tool-teal);
  margin-bottom: 8px;
}

.tool-card .tool-card-title {
  font-weight: 600;
  font-size: 1rem;
  margin: 0 0 4px 0;
}

.tool-card .tool-card-meta {
  font-size: 0.85rem;
  color: #4b5563;
  margin: 0;
}
