/* Tool pages (/tools and every calculator or checklist).
   Loaded after css/style.min.css and css/ux-fixes.css, like the city pages.
   The first block repeats the city page components (the <style id="city-page-css"> block of
   living-trust-napa.html) under the same class names, so markup copied from a city page looks
   the same here. The second block is the tool area. Mobile first. */

/* ---- Page basics (as in the city page head) ---- */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; line-height: 1.6; color: #1a202c; background: #ffffff; }
.navbar { background: rgba(255,255,255,0.95); box-shadow: 0 2px 4px rgba(0,0,0,0.1); padding: 1rem 0; position: fixed; width: 100%; top: 0; z-index: 100; }
.nav-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.5rem; font-weight: bold; color: #2563eb; }
.nav-phone { color: #1a202c; text-decoration: none; font-weight: 500; }
.btn-nav { background: #2563eb; color: white; padding: 0.5rem 1.5rem; border-radius: 4px; text-decoration: none; }
.btn-primary { background: #2563eb; color: white; padding: 1rem 2rem; border-radius: 4px; text-decoration: none; display: inline-block; }
.btn-secondary { border: 2px solid white; color: white; padding: 1rem 2rem; border-radius: 4px; text-decoration: none; display: inline-block; }
h1 { font-size: 2rem; margin-bottom: 1.5rem; line-height: 1.2; }
h2 { font-size: 1.6rem; margin-bottom: 1.25rem; }
h3 { font-size: 1.25rem; margin-bottom: 1rem; }
p { margin-bottom: 1rem; line-height: 1.8; }
table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
th, td { padding: 0.75rem; text-align: left; border-bottom: 1px solid #e5e7eb; }
th { background: #2563eb; color: white; font-weight: 600; }
@media (min-width: 768px) { h1 { font-size: 2.5rem; } h2 { font-size: 2rem; } }

/* ---- City page components (same names as city-page-css) ---- */
.breadcrumb.city-bc { background: transparent; border: 0; padding: 0 0 1.25rem; font-size: 0.9rem; }
.breadcrumb.city-bc ol { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; padding: 0; margin: 0 auto; }
.breadcrumb.city-bc li { display: flex; align-items: center; color: #dbeafe; }
.breadcrumb.city-bc li:not(:last-child)::after { content: ">"; margin: 0 10px; color: #bfdbfe; }
.breadcrumb.city-bc a { color: #ffffff; text-decoration: underline; }
.reviewed-by { font-size: 0.95rem; color: #dbeafe; margin: -0.75rem 0 1.25rem; }
.reviewed-by a { color: #ffffff; }
.city-main { max-width: 1000px; margin: 0 auto; padding: 0 16px; }
.city-main section { padding: 2.5rem 0 1rem; scroll-margin-top: 90px; }
.city-main h2 { font-size: 1.6rem; color: #1e3a5f; margin-bottom: 1.25rem; }
.city-main h3 { font-size: 1.2rem; color: #1e3a5f; margin: 1.5rem 0 0.75rem; }
.city-main p, .city-main li { color: #374151; }
.city-main ul, .city-main ol { margin: 0 0 1rem 1.5rem; }
.city-main li { margin-bottom: 0.5rem; line-height: 1.7; }
.quick-answer { background: #eff6ff; padding: 1.5rem; border-radius: 12px; margin: 2rem 0 1.5rem; border: 2px solid #2563eb; }
.quick-answer h2 { font-size: 1.3rem; margin: 0 0 0.75rem; color: #1e40af; }
.quick-answer p { margin: 0; }
.fact-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 1.25rem 1.5rem; margin: 1rem 0; }
.calc-link { display: inline-block; background: #2563eb; color: #fff; padding: 0.7rem 1.4rem; border-radius: 6px; text-decoration: none; font-weight: 600; margin: 0.5rem 0 1rem; }
.faq-item { background: #fff; padding: 1.25rem; border-radius: 8px; margin-bottom: 1rem; box-shadow: 0 2px 4px rgba(0,0,0,0.08); }
.faq-item .faq-q { color: #2563eb; margin: 0 0 0.5rem; font-size: 1.15rem; }
.faq-item .faq-a { margin: 0; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; }
.related-grid ul { list-style: none; margin: 0; }
.related-grid a { color: #2563eb; text-decoration: none; font-weight: 500; }
.sources-list { font-size: 0.95rem; }
.sources-list a { color: #2563eb; word-break: break-word; }
.author-box { background: #f8fafc; border-top: 4px solid #1e3a8a; border-bottom: 4px solid #1e3a8a; padding: 24px 16px; margin: 50px 0 0; display: flex; align-items: center; gap: 30px; flex-wrap: wrap; }
@media (min-width: 768px) { .city-main { padding: 0 20px; } .author-box { padding: 40px; } .city-main h2 { font-size: 1.8rem; } }

/* ---- Hero and closing call to action (the city page gradient) ---- */
.tool-hero { background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); padding: 110px 16px 40px; color: #fff; text-align: center; }
.tool-hero-inner { max-width: 900px; margin: 0 auto; }
.tool-hero .tool-lede { font-size: 1.1rem; margin-bottom: 0; }
.tool-cta { padding: 48px 16px; background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); color: #fff; text-align: center; margin-top: 3rem; }
.tool-cta-inner { max-width: 800px; margin: 0 auto; }
.tool-cta h2 { color: #fff; }
.tool-cta-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1.5rem; }
.tool-cta .btn-primary { background: #fff; color: #2563eb; font-weight: 600; }
.tool-cta small { display: block; font-size: 0.9rem; opacity: 0.9; }
.tool-cta small a { color: #fff; }
@media (min-width: 768px) { .tool-hero { padding: 110px 20px 56px; } .tool-hero .tool-lede { font-size: 1.2rem; } }

/* ---- Tool area ---- */
.tool-box { background: #f8fafc; border: 1px solid #e2e8f0; border-top: 4px solid #2563eb; border-radius: 12px; padding: 1.25rem; margin: 1.5rem 0; }
.tool-form { display: grid; gap: 1rem; }
.tool-field { display: flex; flex-direction: column; gap: 0.35rem; }
.tool-field label, .tool-field legend { font-weight: 600; color: #1e3a5f; }
.tool-field .tool-hint { font-size: 0.9rem; color: #64748b; margin: 0; line-height: 1.5; }
.tool-field input[type="text"], .tool-field input[type="number"], .tool-field input[type="date"], .tool-field select {
  font: inherit; font-size: 1rem; padding: 0.7rem 0.8rem; border: 1px solid #94a3b8; border-radius: 6px; background: #fff; color: #1a202c; width: 100%; min-height: 44px; }
.tool-field fieldset { border: 0; padding: 0; margin: 0; }
.tool-choices { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.tool-choices label { font-weight: 400; display: inline-flex; align-items: center; gap: 0.4rem; min-height: 44px; cursor: pointer; }
.tool-form input:focus-visible, .tool-form select:focus-visible, .tool-btn:focus-visible, .tool-check input:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }
.tool-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.tool-btn { font: inherit; font-weight: 600; background: #2563eb; color: #fff; border: 0; border-radius: 6px; padding: 0.75rem 1.4rem; min-height: 44px; cursor: pointer; }
.tool-btn.secondary { background: #fff; color: #2563eb; border: 2px solid #2563eb; }
.tool-error { color: #b91c1c; font-weight: 600; margin: 0; }
.tool-result { background: #fff; border: 2px solid #2563eb; border-radius: 10px; padding: 1.25rem; margin-top: 1.25rem; }
.tool-result:empty { display: none; }
.tool-result h3 { margin-top: 0; }
.tool-result .tool-big { font-size: 1.6rem; font-weight: 700; color: #1e3a5f; margin: 0.25rem 0 0.75rem; }
.tool-result table { margin: 0.75rem 0; }
.tool-result td.num, .tool-result th.num { text-align: right; white-space: nowrap; }
.tool-asof { font-size: 0.9rem; color: #64748b; margin: 0.75rem 0 0; }
.tool-disclaimer { background: #fffbeb; border-left: 4px solid #f59e0b; padding: 1rem 1.25rem; border-radius: 6px; margin: 1.5rem 0; color: #78350f; }
.tool-disclaimer p { margin: 0; color: #78350f; }

/* Checklists (localStorage only) */
.tool-checklist { list-style: none; margin: 0; padding: 0; }
.tool-checklist li { margin: 0; }
.tool-check { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.75rem 0; border-bottom: 1px solid #e2e8f0; cursor: pointer; }
.tool-check input { width: 22px; height: 22px; margin-top: 0.2rem; flex: 0 0 auto; }
.tool-check .tool-step { color: #374151; }

/* Hub cards */
.tool-hub-list { display: grid; grid-template-columns: 1fr; gap: 1rem; list-style: none; margin: 0 !important; padding: 0; }
.tool-hub-list li { background: #fff; border: 1px solid #e2e8f0; border-left: 4px solid #2563eb; border-radius: 8px; padding: 1rem 1.25rem; margin: 0; }
.tool-hub-list .tool-name { display: block; font-weight: 700; color: #1e3a5f; font-size: 1.1rem; margin-bottom: 0.25rem; }
.tool-hub-list a.tool-name { color: #2563eb; text-decoration: underline; }
.tool-hub-list .tool-soon { font-size: 0.85rem; color: #64748b; font-weight: 400; }
.tool-hub-list p { margin: 0; line-height: 1.6; }
@media (min-width: 768px) { .tool-hub-list { grid-template-columns: 1fr 1fr; } .tool-box { padding: 1.75rem; } }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 10px; top: 10px; z-index: 1000; background: #fff; padding: 0.5rem 1rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Print: the tool and its result, no navigation */
@media print {
  .navbar, .tool-cta, .footer, .skip-link, .ltc-lang-switch, .tool-actions, #related { display: none !important; }
  .tool-hero { background: none; color: #000; padding: 0 0 1rem; }
  .tool-hero .breadcrumb, .tool-hero .reviewed-by, .tool-hero .reviewed-by a { color: #000; }
  .tool-box, .tool-result { border-color: #000; background: #fff; }
  a { color: #000; }
}

/* Estate plan health check (/estate-plan-health-check): stacked answers, numbered fixes */
.tool-health .tool-field { border-top: 1px solid #e2e8f0; padding-top: 1rem; }
.tool-health .tool-choices { flex-direction: column; gap: 0; }
.tool-health .tool-choices label { align-items: flex-start; padding: 0.55rem 0; min-height: 44px; }
.tool-health .tool-choices input { width: 20px; height: 20px; margin-top: 0.15rem; flex: 0 0 auto; }
.tool-result .tool-fixes { padding-left: 1.25rem; }
.tool-result .tool-fixes li { margin-bottom: 0.75rem; line-height: 1.6; }

/* california-probate-timeline */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tl-table th[scope="row"] { background: #f8fafc; color: #1e3a5f; font-weight: 600; vertical-align: top; }
.tl-table td { vertical-align: top; font-size: 0.95rem; }
.tl-tag { display: inline-block; font-size: 0.8rem; font-weight: 700; padding: 0.1rem 0.5rem; border-radius: 999px; margin-right: 0.25rem; }
.tl-min { background: #dbeafe; color: #1e3a8a; }
.tl-deadline { background: #fee2e2; color: #7f1d1d; }
.tl-court { background: #e5e7eb; color: #1f2937; }
.tl-path { background: #fef3c7; color: #78350f; }
@media print { .tl-tag { border: 1px solid #000; background: #fff; color: #000; } }

/* ---- trust-funding-checklist: asset grid, checklist sections, print/PDF view ---- */
.tfc-assets { display: grid; grid-template-columns: 1fr; gap: 0 1.25rem; }
.tfc-assets label { font-weight: 400; display: flex; align-items: center; gap: 0.6rem; min-height: 44px; cursor: pointer; color: #1a202c; }
.tfc-assets input, .tfc-form .tool-choices input { width: 22px; height: 22px; flex: 0 0 auto; }
.tfc-form .tool-field[hidden] { display: none; }
.tfc-section h4 { color: #1e3a5f; font-size: 1.1rem; margin: 1.25rem 0 0.25rem; }
.tfc-summary { background: #eff6ff; border-radius: 6px; padding: 0.75rem 1rem; }
.tfc-print-date { font-size: 0.9rem; color: #64748b; }
.tfc-cite { font-size: 0.9rem; }
.tfc-cite a { color: #2563eb; }
@media (min-width: 768px) { .tfc-assets { grid-template-columns: 1fr 1fr; } }
@media print {
  .tfc-page .tfc-form, .tfc-page #faq, .tfc-page .tool-lede, .tfc-page .breadcrumb, .tfc-page .tool-asof, .tfc-page noscript { display: none !important; }
  .tfc-page .tool-result { border: 0; padding: 0; margin: 0; }
  .tfc-page .tool-box { border: 0; padding: 0; margin: 0; }
  .tfc-page .tfc-print-date { color: #000; }
  .tfc-page .tool-check { break-inside: avoid; }
  .tfc-page .tfc-section h4 { break-after: avoid; }
  .tfc-page .author-box { break-inside: avoid; margin-top: 1.5rem; }
}

/* Probate cost calculator (/california-probate-cost-calculator) */
.tool-result .pcc-instead { background: #ecfdf5; border-left: 4px solid #10b981; padding: 0.75rem 1rem; border-radius: 6px; color: #065f46; }
.tool-result .pcc-note { background: #eff6ff; border-left: 4px solid #2563eb; padding: 0.75rem 1rem; border-radius: 6px; }
.tool-result .pcc-share { margin-top: 1rem; }
.tool-result .pcc-share input { font: inherit; font-size: 0.9rem; padding: 0.6rem; border: 1px solid #94a3b8; border-radius: 6px; width: 100%; min-height: 44px; }
.tool-result td small { color: #64748b; }
@media print {
  .pcc-noprint, .pcc-share { display: none !important; }
}

/* Successor trustee checklist (successor-trustee-checklist.html) */
.sttee-period { font-size: 1.1rem; color: #1e3a5f; margin: 1.25rem 0 0.25rem; padding-bottom: 0.25rem; border-bottom: 2px solid #2563eb; }
.sttee-due { display: inline-block; background: #fef3c7; color: #78350f; font-weight: 600; font-size: 0.9rem; padding: 0.1rem 0.5rem; border-radius: 4px; margin-left: 0.25rem; }
.sttee-cite { font-size: 0.9rem; color: #64748b; }
.sttee-cite a { color: #2563eb; word-break: break-word; }
@media print {
  .sttee-page #tool-form, .sttee-page .tool-asof + noscript { display: none !important; }
  .sttee-page .tool-check { break-inside: avoid; }
  .sttee-due { background: none; border: 1px solid #000; color: #000; }
}

/* Glossary (glossary.html) */
.gl-page [hidden] { display: none !important; }
.gl-jump ul { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.gl-jump li { margin: 0; line-height: 1; }
.gl-jump a, .gl-jump span { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border-radius: 6px; font-weight: 700; font-size: 1rem; }
.gl-jump a { background: #fff; border: 1px solid #94a3b8; color: #1e3a5f; text-decoration: none; }
.gl-jump a:hover { background: #eff6ff; border-color: #2563eb; }
.gl-jump span { color: #94a3b8; border: 1px dashed #cbd5e1; }
.gl-filter input[type="search"] { font: inherit; font-size: 1rem; padding: 0.7rem 0.8rem; border: 1px solid #94a3b8; border-radius: 6px; background: #fff; color: #1a202c; width: 100%; min-height: 44px; box-sizing: border-box; }
.gl-count { font-weight: 600; color: #1e3a5f; margin: 0.75rem 0 0.25rem; }
.city-main .gl-list { padding-top: 0.5rem; }
.gl-letter { scroll-margin-top: 90px; border-top: 2px solid #2563eb; margin-top: 1.5rem; }
.city-main .gl-letter > h2 { margin: 0.75rem 0 0; font-size: 1.8rem; }
.gl-entry { scroll-margin-top: 90px; padding: 0.25rem 0 0.75rem; border-bottom: 1px solid #e2e8f0; }
.gl-entry:target { background: #fffbeb; box-shadow: 0 0 0 8px #fffbeb; }
.city-main .gl-name { margin: 1rem 0 0.4rem; font-size: 1.15rem; }
.gl-def { margin: 0 0 0.5rem; line-height: 1.7; }
.city-main .gl-meta { font-size: 0.92rem; color: #475569; margin: 0; line-height: 1.6; }
.gl-meta a { color: #2563eb; overflow-wrap: anywhere; }
.gl-label { font-weight: 600; color: #1e3a5f; }
.gl-top { font-size: 0.9rem; margin: 0.75rem 0 0; }
.gl-none { font-weight: 600; }
@media print {
  .gl-page .gl-jump, .gl-page .gl-filter, .gl-page .gl-count, .gl-page .gl-top { display: none !important; }
  .gl-entry { break-inside: avoid; }
}

/* Estate planning quiz (/quiz): one question at a time with JavaScript, all questions without it */
.quiz-form .quiz-step { border-top: 1px solid #e2e8f0; padding-top: 1rem; }
.quiz-form .tool-choices { flex-direction: column; gap: 0; }
.quiz-form .tool-choices label { align-items: flex-start; padding: 0.55rem 0; min-height: 44px; }
.quiz-form .tool-choices input { width: 20px; height: 20px; margin-top: 0.15rem; flex: 0 0 auto; }
.quiz-form [hidden] { display: none !important; }
.quiz-progress { font-weight: 600; color: #64748b; font-size: 0.9rem; margin: 0; }
.quiz-form:not(.quiz-js) .quiz-progress, .quiz-form:not(.quiz-js) .tool-actions { display: none; }
.tool-result h4 { color: #1e3a5f; margin: 1rem 0 0.5rem; }
.tool-result .quiz-reasons, .tool-result .quiz-steps { padding-left: 1.25rem; margin-bottom: 1rem; }
.tool-result .quiz-reasons li, .tool-result .quiz-steps li { margin-bottom: 0.6rem; line-height: 1.6; }
.tool-result a.tool-btn { text-decoration: none; display: inline-flex; align-items: center; }
.city-main .quiz-result-section { border-left: 4px solid #e2e8f0; padding: 0.25rem 0 0.25rem 1rem; margin: 1.5rem 0; }
.city-main .quiz-result-section:target, .city-main .quiz-result-section.quiz-yours { border-left-color: #2563eb; background: #eff6ff; }
.city-main .quiz-result-section h3 { margin-top: 0.75rem; }
.city-main .quiz-result-section h4 { color: #1e3a5f; margin: 1rem 0 0.5rem; }

/* ---- Site search (/search) and the Ask the attorney form (/search, /tools) ---- */
.search-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.search-row input[type="search"] { flex: 1 1 14rem; min-width: 0; font: inherit; font-size: 1rem; padding: 0.7rem 0.8rem; border: 1px solid #94a3b8; border-radius: 6px; background: #fff; color: #1a202c; min-height: 44px; }
.search-row input[type="search"]:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }
.search-count { font-weight: 600; color: #1e3a5f; margin: 1rem 0 0.5rem; }
.city-main ol.search-results { list-style: none; margin: 0; padding: 0; }
.city-main .search-results li.search-hit { margin: 0; padding: 0.85rem 0; border-bottom: 1px solid #e2e8f0; }
.search-type { display: block; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #64748b; }
.search-link { display: inline-block; font-weight: 700; font-size: 1.1rem; color: #2563eb; text-decoration: underline; padding: 0.15rem 0; min-height: 44px; line-height: 1.4; }
.search-link:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }
.city-main .search-snippet { margin: 0.1rem 0 0; font-size: 0.95rem; line-height: 1.6; color: #374151; word-break: break-word; }
.search-results mark { background: #fef3c7; color: inherit; padding: 0 1px; }
.ask-section .tool-field input[type="email"], .ask-section .tool-field input[type="tel"], .ask-section .tool-field textarea {
  font: inherit; font-size: 1rem; padding: 0.7rem 0.8rem; border: 1px solid #94a3b8; border-radius: 6px; background: #fff; color: #1a202c; width: 100%; min-height: 44px; }
.ask-section .tool-field textarea { resize: vertical; line-height: 1.5; }
.ask-section .tool-form textarea:focus-visible, .ask-section .tool-form input:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }
.ask-section .ask-consent { border-bottom: 0; font-weight: 400; }
.ask-section .ask-consent span { color: #374151; line-height: 1.5; }
.ask-section [aria-invalid="true"] { border-color: #b91c1c !important; }
.ask-section .ask-err, .city-main .ask-section p.tool-error { font-size: 0.95rem; color: #b91c1c; }
.ask-hp, .ask-section [hidden], .search-form [hidden] { display: none !important; }
.ask-section .ask-note { margin: 0 0 1rem; font-weight: 600; color: #1f2937; line-height: 1.5; }
.ask-section .tool-btn[aria-disabled="true"] { opacity: 0.7; cursor: progress; }
