/* =========================================================================
 * Difficult Conversation Planner — styles.
 * Professional redesign pattern (15 Nov 2026): solid dark slate-zinc
 * identity, no gradients, visible borders, real card structure.
 * All motion disabled under prefers-reduced-motion.
 *
 * Palette (kept here as reference; the rules below use LITERAL colour
 * values, never CSS custom properties, so the design never depends on
 * custom-property resolution — a reviewer browser that drops them still
 * sees the intended design).
 * Accent: #3f3f46 (dark slate-zinc). Dark hover: #27272a. Accent tint: #f4f4f5.
 * ========================================================================= */

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  background: #f6f7fb;
  color: #141a2e;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: #141a2e; color: #ffffff; padding: 10px 16px; border-radius: 10px;
  text-decoration: none; font-weight: 700; transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

/* ---------------- header: solid white, clear bottom border ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: #ffffff;
  border-bottom: 1px solid #d9e0ec;
  box-shadow: 0 2px 12px rgba(20, 26, 46, 0.06);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #141a2e; font-weight: 800; font-size: 1.05rem; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: #3f3f46;
  box-shadow: 0 4px 12px rgba(63, 63, 70, 0.35);
}
.brand-mark svg { width: 20px; height: 20px; fill: none; stroke: #ffffff; stroke-width: 2; }
.nav { display: flex; gap: 4px; }
.nav a {
  color: #4b5573; text-decoration: none; font-weight: 600; font-size: 0.92rem;
  padding: 8px 12px; border-radius: 10px; transition: background 0.18s, color 0.18s;
}
.nav a:hover, .nav a:focus-visible { background: #eef1f8; color: #141a2e; outline: none; }

/* ---------------- hero: flat, compact, four short pills ---------------- */
.hero { padding: 28px 0 12px; background: #f6f7fb; }
.hero h1 {
  font-size: clamp(1.65rem, 3.4vw, 2.25rem);
  line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 8px; max-width: none;
  color: #141a2e;
}
.hero h1 .grad { color: #3f3f46; }
.lede { font-size: 1rem; color: #4b5573; max-width: 68ch; margin: 0 0 14px; }
.trust-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.trust-row li {
  display: inline-flex; align-items: center; gap: 7px;
  background: #ffffff; border: 1px solid #c3ccd9; border-radius: 999px;
  padding: 6px 12px; font-size: 0.82rem; font-weight: 600; color: #4b5573;
  box-shadow: 0 2px 8px rgba(20, 26, 46, 0.05);
}
.trust-row .dot { width: 7px; height: 7px; border-radius: 50%; background: #0f9d58; box-shadow: 0 0 0 3px #e5f6ec; }

/* ---------------- tool card: clearly visible container ---------------- */
.tool-section { padding: 8px 0 32px; }
.tool-card {
  background: #ffffff; border: 1.5px solid #c3ccd9;
  border-radius: 20px; box-shadow: 0 12px 32px rgba(20, 26, 46, 0.10);
  padding: clamp(20px, 3vw, 30px);
}
.tool-title { font-size: 1.35rem; letter-spacing: -0.01em; margin: 0 0 18px; color: #141a2e; }
.tool-title::after {
  content: ""; display: block; width: 40px; height: 3px;
  background: #3f3f46; border-radius: 2px; margin-top: 8px;
}
.legal-banner {
  background: #f4f4f5; border: 1px solid #f3c1c1; color: #27272a;
  border-radius: 12px; padding: 10px 14px; font-size: 0.92rem; margin: 0 0 18px;
}
.legal-banner strong { color: #27272a; }

/* buttons: solid brand slate-zinc, clear hover, solid grey disabled state */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 12px; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 0.92rem; text-decoration: none;
  padding: 10px 18px; transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn-primary { background: #3f3f46; color: #ffffff; box-shadow: 0 6px 16px rgba(63, 63, 70, 0.35); }
.btn-primary:hover:not(:disabled) { background: #27272a; transform: translateY(-1px); }
.btn-primary:disabled { background: #9aa3b2; color: #ffffff; cursor: not-allowed; box-shadow: none; }
.btn-ghost { background: #ffffff; border: 1.5px solid #c3ccd9; color: #141a2e; }
.btn-ghost:hover:not(:disabled) { background: #eef1f8; border-color: #b9c2d0; }
.btn-ghost:disabled { background: #eef1f8; color: #8a93ad; border-color: #d9e0ec; cursor: not-allowed; }
.btn-small { padding: 7px 13px; font-size: 0.85rem; border-radius: 10px; }
.btn:focus-visible { outline: 3px solid rgba(63, 63, 70, 0.4); outline-offset: 2px; }

/* ---------------- form ---------------- */
.input-label { font-weight: 800; color: #141a2e; display: block; margin: 0 0 8px; }
.decoder-state { color: #4b5573; font-size: 0.9rem; margin: 12px 0 0; }
.decoder-state:empty { display: none; }
.form-errors {
  background: #fdecec; border: 1px solid #f3c1c1; color: #7f1d1d;
  border-radius: 10px; padding: 10px 14px; font-size: 0.92rem; font-weight: 600;
  margin: 14px 0 0;
}
.form-errors:empty { display: none; }

/* ---------------- plan blocks ---------------- */
.plan-block {
  border: 1.5px solid #c3ccd9; border-radius: 16px; padding: 16px 18px 18px;
  background: #ffffff; min-width: 0; margin: 0 0 18px;
  box-shadow: 0 2px 10px rgba(20, 26, 46, 0.05);
}
.plan-block legend { padding: 0 8px; font-weight: 800; font-size: 1.02rem; color: #141a2e; }
.field-note { font-size: 0.85rem; color: #6b7488; margin: 6px 0 0; }
.field-note strong { color: #141a2e; }

/* ---------------- options row ---------------- */
.options-row {
  display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end;
  margin-top: 16px;
}
.option-field { display: grid; gap: 4px; min-width: 0; flex: 1 1 220px; }
.option-field.option-full { flex: 1 1 100%; margin-top: 16px; }
.option-field.option-narrow { flex: 0 0 auto; }
.option-field label { font-size: 0.85rem; font-weight: 700; color: #4b5573; }
.option-field input[type="text"], .option-field input[type="number"],
.option-field input[type="date"], .option-field select, .option-field textarea {
  border: 1.5px solid #c3ccd9; border-radius: 10px; padding: 8px 12px;
  font: inherit; font-size: 0.92rem; color: #141a2e; background: #ffffff; min-width: 0;
  width: 100%;
}
.option-field input:focus, .option-field select:focus, .option-field textarea:focus {
  outline: 3px solid rgba(63, 63, 70, 0.35); outline-offset: 1px; border-color: #3f3f46;
}
.option-field .field-note { font-size: 0.8rem; color: #6b7488; }
.char-count { font-size: 0.82rem; color: #6b7488; text-align: right; margin-top: 4px; }
.char-count.over { color: #b91c1c; font-weight: 700; }

/* ---------------- scenario picker ---------------- */
.scenario-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.scenario-btn.active { background: #3f3f46; color: #ffffff; border-color: #3f3f46; }

/* ---------------- suggestion chips ---------------- */
.suggest-list { display: grid; gap: 8px; margin-top: 12px; }
.suggest-card {
  background: #f4f4f5; border: 1px solid #d9e0ec; border-radius: 12px;
  padding: 10px 14px; font-size: 0.92rem; color: #4b5573; min-width: 0;
  display: flex; gap: 10px; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap;
}
.suggest-card .suggest-text { color: #141a2e; font-weight: 600; overflow-wrap: anywhere; flex: 1 1 260px; min-width: 0; }
.suggest-card .btn { flex: 0 0 auto; }

/* ---------------- key points / reactions ---------------- */
.check-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.check-item {
  border: 1px solid #d9e0ec; border-radius: 12px; padding: 10px 12px;
  background: #f8fafc; min-width: 0;
}
.check-item.is-checked { border-color: #d4d4d8; background: #f4f4f5; }
.check-row { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; min-width: 0; }
.check-row input[type="checkbox"] {
  position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden;
}
.check-box {
  flex: 0 0 auto; width: 22px; height: 22px; margin-top: 1px;
  border: 2px solid #b9c2d0; border-radius: 6px; background: #ffffff;
  display: grid; place-items: center; font-size: 0.9rem; font-weight: 800; color: #ffffff;
}
.check-row input[type="checkbox"]:checked + .check-box { background: #3f3f46; border-color: #3f3f46; }
.check-row input[type="checkbox"]:checked + .check-box::after { content: "✓"; }
.check-row input[type="checkbox"]:focus-visible + .check-box { outline: 3px solid rgba(63, 63, 70, 0.35); outline-offset: 2px; }
.check-label { flex: 1 1 auto; min-width: 0; font-weight: 600; color: #141a2e; overflow-wrap: anywhere; font-size: 0.95rem; }

.reaction-card {
  border: 1.5px solid #c3ccd9; border-radius: 16px; padding: 14px 16px;
  background: #ffffff; min-width: 0; margin: 12px 0 0;
  box-shadow: 0 2px 10px rgba(20, 26, 46, 0.05);
}
.reaction-card.is-open { border-color: #a1a1aa; background: #fafafa; }
.reaction-head { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.reaction-head .check-row { flex: 1 1 auto; min-width: 0; }
.reaction-body { margin-top: 10px; display: grid; gap: 6px; min-width: 0; }
.reaction-body label { font-size: 0.85rem; font-weight: 700; color: #4b5573; }
.reaction-body textarea {
  border: 1.5px solid #c3ccd9; border-radius: 10px; padding: 8px 12px;
  font: inherit; font-size: 0.92rem; color: #141a2e; background: #ffffff; min-width: 0;
  width: 100%;
}
.reaction-body textarea:focus {
  outline: 3px solid rgba(63, 63, 70, 0.35); outline-offset: 1px; border-color: #3f3f46;
}
.reaction-suggest { font-size: 0.88rem; color: #6b7488; margin: 0; }
.reaction-suggest strong { color: #3f3f46; }
.reaction-suggest .suggest-text { color: #141a2e; }
.reaction-remove { flex: 0 0 auto; }

/* ---------------- readiness summary ---------------- */
.score-hero {
  display: flex; gap: 20px; flex-wrap: wrap; align-items: center;
  background: #f4f4f5; border: 1.5px solid #d4d4d8; border-radius: 16px;
  padding: 18px 20px; margin-top: 18px; min-width: 0;
}
.score-hero:empty { display: none; }
.score-gauge { flex: 0 0 auto; text-align: center; min-width: 0; }
.score-number { font-size: 2.6rem; font-weight: 800; line-height: 1; color: #3f3f46; }
.score-number small { font-size: 1.2rem; color: #6b7488; }
.score-label { font-weight: 800; color: #141a2e; margin-top: 4px; }
.score-sub { font-size: 0.85rem; color: #6b7488; }
.score-factors { flex: 1 1 320px; min-width: 0; display: grid; gap: 8px; }
.factor-row { display: grid; grid-template-columns: minmax(0, 170px) minmax(0, 1fr) 44px; gap: 10px; align-items: center; font-size: 0.85rem; }
.factor-row .factor-name { font-weight: 700; color: #4b5573; overflow-wrap: anywhere; }
.factor-bar { height: 10px; border-radius: 999px; background: #e2e7f2; overflow: hidden; min-width: 0; }
.factor-fill { height: 100%; border-radius: 999px; background: #3f3f46; }
.factor-fill.low { background: #b91c1c; }
.factor-fill.mid { background: #b45309; }
.factor-fill.high { background: #177245; }
.factor-val { font-weight: 800; color: #141a2e; text-align: right; white-space: nowrap; }

/* ---------------- summary strip ---------------- */
.summary-strip {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0;
}
.summary-strip:empty { display: none; }
.sum-item {
  display: inline-flex; align-items: center; gap: 6px;
  background: #eef1f8; border: 1px solid #d9e0ec; border-radius: 999px;
  padding: 6px 13px; font-size: 0.85rem; font-weight: 600; color: #4b5573;
}
.sum-item b { color: #141a2e; font-size: 1rem; }
.sum-item.ok { background: #e5f6ec; border-color: #bcd8c6; color: #177245; }
.sum-item.ok b { color: #177245; }
.sum-item.warn { background: #fef3e2; border-color: #f3d9a4; color: #713f12; }
.sum-item.warn b { color: #713f12; }
.sum-item.danger { background: #fdecec; border-color: #f3c1c1; color: #7f1d1d; }
.sum-item.danger b { color: #7f1d1d; }

/* ---------------- next steps ---------------- */
.fixes-card {
  background: #fffbeb; border: 1.5px solid #f3d9a4; border-radius: 16px;
  padding: 16px 18px; margin-top: 18px; min-width: 0;
}
.fixes-card:empty { display: none; }
.fixes-card h3 { margin: 0 0 8px; font-size: 1.05rem; color: #713f12; }
.fixes-card ol { margin: 0; padding-left: 20px; color: #4b5573; }
.fixes-card li { margin: 6px 0; }
.fixes-card li strong { color: #141a2e; }

/* ---------------- plan preview ---------------- */
.plan-preview {
  background: #ffffff; border: 1.5px solid #c3ccd9; border-radius: 16px;
  padding: 18px 20px; margin-top: 18px; min-width: 0;
  box-shadow: 0 2px 10px rgba(20, 26, 46, 0.05);
}
.plan-preview:empty { display: none; }
.plan-preview h3 { margin: 0 0 4px; font-size: 1.1rem; color: #141a2e; }
.plan-preview .preview-meta { font-size: 0.88rem; color: #6b7488; margin: 0 0 12px; }
.preview-section { margin: 12px 0 0; }
.preview-section h4 { margin: 0 0 4px; font-size: 0.92rem; color: #3f3f46; text-transform: uppercase; letter-spacing: 0.04em; }
.preview-section p, .preview-section li { font-size: 0.95rem; color: #141a2e; margin: 2px 0; overflow-wrap: anywhere; }
.preview-section ul { margin: 0; padding-left: 20px; }
.preview-section .preview-empty { color: #6b7488; font-style: italic; }
.preview-quote { background: #f4f4f5; border-left: 3px solid #3f3f46; border-radius: 0 10px 10px 0; padding: 8px 12px; margin: 4px 0; }

/* ---------------- batch bar ---------------- */
.batch-bar {
  display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; padding-top: 18px;
  border-top: 1px solid #e2e7f2; align-items: flex-start;
}
.batch-bar .bb-text { flex: 1 1 200px; min-width: 0; display: grid; gap: 2px; }
.batch-bar .bb-text small { color: #6b7488; font-size: 0.85rem; }
.batch-bar .bb-actions { display: flex; gap: 10px; flex-wrap: wrap; }
#batch-status { font-weight: 700; color: #141a2e; }

/* ---------------- settings / status explainer ---------------- */
.settings { margin-top: 22px; padding-top: 18px; border-top: 1px solid #e2e7f2; }
.settings-title { font-size: 1.05rem; margin: 0 0 10px; color: #141a2e; }
.pdf-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pdf-facts li {
  background: #ffffff; border: 1px solid #d9e0ec; border-radius: 12px;
  padding: 10px 14px; font-size: 0.92rem; color: #4b5573;
}
.pdf-facts li strong { color: #141a2e; }
.pdf-alt { font-size: 0.92rem; color: #4b5573; margin: 14px 0 0; }
.pdf-alt a { color: #3f3f46; font-weight: 700; }
.pdf-alt a:hover { color: #27272a; }

/* privacy: solid dark slate card */
.privacy { padding: 8px 0 44px; }
.privacy-card {
  background: #27272a;
  color: #f4f4f5; border-radius: 22px; padding: clamp(22px, 3vw, 36px);
  box-shadow: 0 18px 50px rgba(39, 39, 42, 0.20);
}
.privacy-card h2 { color: #ffffff; margin: 0 0 10px; font-size: 1.4rem; }
.privacy-card p { margin: 0 0 16px; max-width: 68ch; }
.net-meter {
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px; padding: 9px 16px; font-weight: 700; color: #ffffff;
}
.net-meter b { font-size: 1.15rem; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: #34d399; animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
  50% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
}
.verify-steps { margin: 16px 0 0; padding-left: 20px; max-width: 68ch; }
.verify-steps li { margin: 6px 0; }
kbd {
  background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px; padding: 1px 7px; font: inherit; font-size: 0.85em;
}

/* content: readable line length, numbered step markers */
.content { padding: 20px 0 44px; }
.content h2 { font-size: 1.5rem; letter-spacing: -0.01em; margin: 0 0 12px; color: #141a2e; }
.content h3 { font-size: 1.08rem; margin: 28px 0 8px; color: #141a2e; }
.content p, .content li { color: #4b5573; }
.content .wrap > h2, .content .wrap > h3, .content .wrap > p,
.content .wrap > ol, .content .wrap > ul { max-width: 68ch; }
.content ul { padding-left: 22px; }
.content ul li { margin: 6px 0; }
.content ol { list-style: none; counter-reset: step; padding-left: 0; }
.content ol li { counter-increment: step; position: relative; padding-left: 44px; margin: 12px 0; }
.content ol li::before {
  content: counter(step); position: absolute; left: 0; top: 1px;
  width: 28px; height: 28px; border-radius: 50%;
  background: #3f3f46; color: #ffffff; font-weight: 800; font-size: 0.85rem;
  display: grid; place-items: center;
}
.prose-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 14px; }
.prose-card { background: #ffffff; border: 1px solid #d9e0ec; border-radius: 16px; padding: 18px; box-shadow: 0 2px 8px rgba(20, 26, 46, 0.04); min-width: 0; }
.prose-card h3 { margin: 0 0 6px; }
.prose-card p { margin: 0; font-size: 0.93rem; }

.faq details {
  background: #ffffff; border: 1px solid #d9e0ec; border-radius: 14px;
  padding: 14px 18px; margin: 8px 0; box-shadow: 0 1px 4px rgba(20, 26, 46, 0.04);
}
.faq details[open] { border-color: #b9c2d0; }
.faq summary { font-weight: 700; cursor: pointer; color: #141a2e; }
.faq summary:focus-visible { outline: 3px solid rgba(63, 63, 70, 0.35); outline-offset: 2px; border-radius: 6px; }
.faq details p { margin: 10px 0 2px; }

/* footer: top border, light background, grouped links */
.site-footer {
  border-top: 1px solid #d9e0ec; background: #ffffff;
  padding: 20px 0 28px; color: #6b7488; font-size: 0.85rem;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; justify-content: space-between; }
.site-footer p { margin: 0; }
.site-footer .footer-note { color: #6b7488; }
.site-footer a { color: #4b5573; font-weight: 600; }
.site-footer a:hover { color: #3f3f46; }

/* responsive */
@media (max-width: 860px) {
  .prose-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .nav { display: none; }
  .hero { padding: 20px 0 8px; }
  .batch-bar { display: grid; grid-template-columns: 1fr; }
  .batch-bar .btn { width: 100%; }
  .options-row { display: grid; grid-template-columns: 1fr; }
  .site-footer .wrap { flex-direction: column; gap: 2px; }
  .score-hero { display: grid; grid-template-columns: 1fr; }
  .score-gauge { text-align: left; }
  .factor-row { grid-template-columns: minmax(0, 150px) minmax(0, 1fr) 38px; }
  .suggest-card { display: grid; grid-template-columns: 1fr; }
  .suggest-card .btn { width: 100%; }
}

/* reduced motion: kill every animation */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* print: the prep sheet only */
@media print {
  .site-header, .hero, .privacy, .content, .site-footer, .batch-bar,
  .settings, #planner-form, .score-hero, .summary-strip, .fixes-card,
  .skip-link { display: none !important; }
  body { background: #ffffff; }
  .tool-card { border: none; box-shadow: none; padding: 0; }
  .plan-preview { border: none; box-shadow: none; padding: 0; }
}
