:root {
    --ink: #1a1815;
    --muted: #69645d;
    --faint: #9c948a;
    --line: #bdb4a6;
    --paper: #f4efe6;
    --paper-deep: #e9e0d2;
    --surface: #f8f3ea;
    --surface-soft: #eee6da;
    --black: #161513;
    --accent: #9a4f45;
    --accent-dark: #70362f;
    --accent-soft: #ead8d2;
    --gold: #b08a5a;
    --mint: #dce8dc;
    --amber: #efe0bf;
    --rose: #ecd8d3;
    --shadow: none;
    --display-font: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    --text-font: "Avenir Next", "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background: var(--paper);
    color: var(--ink);
    letter-spacing: 0;
    overflow-x: hidden;
    font-family: var(--text-font);
}

[hidden] {
    display: none !important;
}

body.modal-open {
    overflow: hidden;
}

.clipboard-fallback {
    position: fixed;
    left: -9999px;
}

.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 1000;
    padding: 12px 16px;
    border: 2px solid var(--black);
    background: var(--paper);
    color: var(--ink);
    font-weight: 800;
    transform: translateY(-160%);
    transition: transform 120ms ease;
}

.skip-link:focus {
    transform: translateY(0);
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.app-header {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

.app-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 68px;
    padding: 0;
}

.brand-mark {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 10px;
    color: var(--ink);
}

.brand-mark img {
    display: block;
    width: auto;
    height: 34px;
}

.brand-mark::before {
    content: none;
}

.brand-mark::after {
    content: none;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-select,
.soft-link {
    height: 30px;
    border-radius: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.control-select {
    padding: 0 6px;
}

.soft-link {
    display: inline-flex;
    align-items: center;
    padding: 0 4px;
}

.hero-copy {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
    min-height: 310px;
    padding: 42px 0 58px;
}

.hero-copy::before {
    content: "AN INQUIRY INTO SAFER CARE";
    position: absolute;
    top: 22px;
    left: 0;
    color: var(--gold);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.34em;
    text-transform: uppercase;
}

.hero-copy::after {
    content: none;
}

.hero-copy > * {
    position: relative;
    z-index: 1;
}

.hero-copy h1 {
    max-width: 620px;
    margin: 0;
    color: var(--ink);
    font-family: var(--display-font);
    font-size: clamp(44px, 5.7vw, 78px);
    line-height: 0.94;
    font-weight: 400;
    letter-spacing: 0;
}

.hero-copy p {
    max-width: 470px;
    margin-top: 22px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.65;
}

.trust-strip {
    display: grid;
    gap: 10px;
    min-width: 310px;
    padding: 0 0 0 22px;
    border-left: 1px solid var(--line);
    background: transparent;
}

.trust-strip span {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.trust-strip strong {
    color: var(--ink);
}

.progress-shell {
    position: relative;
    z-index: 50;
    border-bottom: 1px solid var(--line);
    background: rgba(244, 239, 230, 0.94);
    backdrop-filter: blur(12px);
}

.progress-inner {
    display: grid;
    grid-template-columns: auto minmax(180px, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 10px 0;
}

.context-strip {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 0 10px 0;
}

.context-strip.visible {
    display: flex;
}

.context-strip span {
    border-left: 1px solid var(--line);
    padding-left: 10px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.context-strip span:first-child {
    border-left: 0;
    padding-left: 0;
    color: var(--ink);
}

.step-indicator {
    display: flex;
    gap: 6px;
}

.step-indicator .step {
    width: 44px;
    height: 44px;
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    transition: 160ms ease;
}

.step-indicator .step.active,
.step-indicator .step.completed {
    border-color: var(--black);
    background: var(--black);
    color: var(--paper);
}

.progress-track {
    height: 2px;
    overflow: hidden;
    border-radius: 0;
    background: rgba(26, 24, 21, 0.18);
}

.progress-bar-fill {
    height: 100%;
    border-radius: 0;
    background: var(--accent);
    transition: width 0.35s ease;
}

.progress-step-1 { width: 25%; }
.progress-step-2 { width: 50%; }
.progress-step-3 { width: 75%; }
.progress-step-4 { width: 100%; }

.app-main {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 42px 0 64px;
}

.wizard-step {
    width: 100%;
}

.step-heading {
    display: grid;
    gap: 6px;
    margin-bottom: 18px;
}

.step-heading h2 {
    margin: 0;
    color: var(--ink);
    font-family: var(--display-font);
    font-size: clamp(32px, 4vw, 52px);
    line-height: 0.98;
    font-weight: 400;
}

.step-heading p {
    max-width: 620px;
    color: var(--muted);
    line-height: 1.65;
}

.care-situation-panel,
.quick-profile-panel,
.section-panel,
.result-panel {
    border: 1px solid var(--line);
    border-radius: 0;
    background: rgba(248, 243, 234, 0.92);
    box-shadow: var(--shadow);
}

.care-situation-panel {
    display: grid;
    gap: 18px;
    margin-bottom: 18px;
    padding: 24px;
    background: rgba(248, 243, 234, 0.88);
}

.care-situation-header {
    display: grid;
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
    gap: 18px;
    align-items: end;
}

.care-situation-header h2 {
    margin: 6px 0 0;
    font-family: var(--display-font);
    font-size: clamp(30px, 3.4vw, 46px);
    line-height: 1;
    font-weight: 400;
}

.care-situation-header p {
    color: var(--muted);
    line-height: 1.6;
}

.care-situation-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.care-situation-card {
    display: grid;
    gap: 10px;
    min-height: 190px;
    padding: 16px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}

.care-situation-card:hover,
.care-situation-card:focus-visible,
.care-situation-card.selected {
    border-color: var(--black);
    outline: none;
    background: var(--surface-soft);
}

.care-situation-card.selected {
    box-shadow: inset 0 0 0 1px var(--black);
}

.care-situation-card:disabled,
.quick-signal-chip:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.care-situation-card:disabled:hover,
.care-situation-card:disabled:focus-visible {
    border-color: var(--line);
    background: var(--surface);
    outline: none;
}

.care-situation-card h3 {
    margin: 0;
    font-family: var(--display-font);
    font-size: 26px;
    line-height: 1.05;
    font-weight: 400;
}

.care-situation-card p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.care-situation-card .mini-tag {
    width: fit-content;
    background: var(--amber);
    color: #6d471f;
}

.share-actions {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.share-actions-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.share-status {
    min-height: 18px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.quick-profile-panel {
    display: grid;
    grid-template-columns: minmax(240px, 0.9fr) minmax(0, 1.4fr);
    gap: 24px;
    align-items: start;
    margin-bottom: 36px;
    padding: 24px;
    background: var(--black);
    color: var(--paper);
}

.eyebrow {
    color: var(--gold);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.32em;
    text-transform: uppercase;
}

.quick-profile-panel h2 {
    margin: 6px 0 8px;
    font-family: var(--display-font);
    font-size: 32px;
    line-height: 1.02;
    font-weight: 400;
}

.quick-profile-panel p {
    color: rgba(244, 239, 230, 0.72);
    line-height: 1.5;
}

.profile-control-grid {
    display: grid;
    gap: 16px;
}

.control-label {
    display: grid;
    gap: 8px;
    color: rgba(244, 239, 230, 0.82);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.segmented-control,
.control-grid,
.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.segmented-control button,
.option-card,
.interest-chip,
.condition-check {
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 0;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.segmented-control button {
    padding: 0 14px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.quick-profile-panel .segmented-control button {
    border-color: rgba(244, 239, 230, 0.22);
    background: rgba(244, 239, 230, 0.04);
    color: var(--paper);
}

.segmented-control button:hover,
.option-card:hover,
.interest-chip:hover,
.condition-check:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.segmented-control button.selected,
.option-card.selected,
.interest-chip.selected {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px var(--accent);
    color: var(--accent-dark);
}

.quick-profile-panel .segmented-control button.selected {
    border-color: var(--paper);
    background: var(--paper);
    color: var(--black);
    box-shadow: none;
}

.locality-select {
    width: min(100%, 360px);
    min-height: 44px;
    border: 1px solid rgba(244, 239, 230, 0.22);
    border-radius: 0;
    background: rgba(244, 239, 230, 0.04);
    color: var(--paper);
    padding: 0 14px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    outline: none;
}

.locality-select:focus {
    border-color: var(--paper);
    background: rgba(244, 239, 230, 0.10);
}

.locality-select option {
    background: var(--paper);
    color: var(--ink);
}

.question-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.functional-groups {
    display: grid;
    gap: 18px;
}

.question-group {
    border-top: 1px solid var(--line);
    padding-top: 18px;
}

.question-group-header {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 18px;
    align-items: end;
    margin-bottom: 14px;
}

.question-group-kicker {
    color: var(--gold);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

.question-group-title {
    margin: 5px 0 0;
    font-family: var(--display-font);
    font-size: 30px;
    line-height: 1.02;
    font-weight: 400;
}

.question-group-copy {
    color: var(--muted);
    line-height: 1.6;
}

.question-card {
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 0;
    background: rgba(248, 243, 234, 0.82);
}

.question-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.question-head h3 {
    margin: 0 0 4px;
    font-family: var(--display-font);
    font-size: 22px;
    font-weight: 400;
    color: var(--ink);
}

.question-head p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.level-value {
    flex: 0 0 auto;
    border-radius: 0;
    background: var(--surface-soft);
    color: var(--muted);
    padding: 6px 9px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.scale-option {
    display: grid;
    gap: 2px;
    padding: 10px;
}

.question-card .segmented-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.scale-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.scale-option .option-title {
    font-size: 13px;
    font-weight: 800;
}

.scale-option .option-level {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.conditions-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.condition-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    font-weight: 800;
}

.condition-check input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.field-section {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 0;
    background: rgba(248, 243, 234, 0.82);
}

.field-section h3 {
    margin: 0;
    font-family: var(--display-font);
    font-size: 22px;
    font-weight: 400;
}

.acute-change-check {
    min-width: 0;
    border-left: 4px solid var(--gold);
}

.acute-change-check legend {
    padding: 0 6px;
    color: var(--ink);
    font-family: var(--display-font);
    font-size: 22px;
    font-weight: 400;
}

.acute-change-option {
    align-items: flex-start;
    font-size: 13px;
    line-height: 1.45;
}

.acute-change-boundary {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

.interest-chip {
    padding: 10px 13px;
    font-size: 13px;
    font-weight: 800;
}

.quick-signal-chip {
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    padding: 10px 13px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.quick-signal-chip.applied {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-dark);
    box-shadow: inset 0 0 0 1px var(--accent);
}

.btn-primary,
.btn-secondary {
    min-height: 46px;
    border-radius: 0 !important;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.btn-primary {
    border: 1px solid var(--black);
    background: var(--black);
    color: var(--paper);
}

.btn-primary:hover {
    transform: translateY(-1px);
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: none;
}

.btn-secondary {
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
}

.btn-secondary:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.step-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.result-panel {
    padding: 20px;
    margin-bottom: 16px;
}

.urgent-safety-panel {
    max-width: 780px;
    margin: 0 auto;
    border-left: 6px solid var(--accent);
    padding: clamp(22px, 5vw, 48px);
}

.urgent-safety-panel h2 {
    max-width: 650px;
    margin: 10px 0 16px;
    font-family: var(--display-font);
    font-size: clamp(34px, 5vw, 58px);
    font-weight: 400;
    line-height: 1.02;
}

.urgent-safety-intro,
.urgent-safety-disclaimer,
.urgent-safety-boundary {
    max-width: 650px;
    color: var(--muted);
    line-height: 1.65;
}

.urgent-safety-action {
    max-width: 650px;
    margin: 22px 0;
    border: 1px solid var(--accent);
    background: var(--accent-soft);
    padding: 18px;
    color: var(--ink);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.55;
}

.urgent-safety-disclaimer {
    margin-top: 14px;
    font-size: 13px;
}

.urgent-safety-boundary {
    margin: 8px 0 24px;
    font-size: 13px;
    font-weight: 700;
}

.results-shell {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.results-sidebar {
    position: sticky;
    top: 74px;
}

.summary-stat {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border-radius: 0;
    background: var(--black);
    color: var(--paper);
}

.summary-stat strong {
    color: var(--paper);
    font-family: var(--display-font);
    font-size: 42px;
    font-weight: 400;
    line-height: 1;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-row span,
.mini-tag,
.highlight-badge,
.price-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 0;
    padding: 3px 9px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.price-badge {
    background: var(--amber);
    color: #8a4b00;
}

.highlight-badge {
    background: var(--accent-soft);
    color: var(--accent-dark);
}

.plan-grid,
.brief-grid,
.care-grid,
.service-grid,
.safety-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.brief-panel {
    border-left: 4px solid var(--black);
}

.brief-panel.same-day {
    border-left-color: var(--accent);
    background: #f5e8e5;
}

.brief-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.brief-list {
    display: grid;
    gap: 8px;
}

.brief-list li {
    display: grid;
    gap: 4px;
    border: 1px solid var(--line);
    background: rgba(248, 243, 234, 0.64);
    padding: 10px;
}

.brief-evidence-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.brief-evidence-chip {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    border: 1px solid var(--line);
    padding: 2px 7px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.plan-card,
.care-card,
.service-card,
.safety-card,
.recommendation-card,
.unsafe-card {
    border: 1px solid var(--line);
    border-radius: 0;
    background: var(--surface);
    padding: 14px;
}

.plan-card.risk,
.unsafe-card {
    border-color: #ffc9c9;
    background: #f5e8e5;
}

.plan-card.verify,
.service-card {
    border-color: #c7b38c;
    background: #f1e8d8;
}

.plan-card.support {
    border-color: #bba39f;
    background: #f3ebe8;
}

.plan-card.option,
.safety-card {
    border-color: #aeb8a7;
    background: #eef2ea;
}

.care-card {
    display: grid;
    gap: 10px;
    border-color: #caa091;
    background: #f4ece6;
}

.care-card .mini-tag {
    max-width: 128px;
    justify-content: center;
    text-align: center;
    line-height: 1.25;
}

.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.recommendation-card {
    display: grid;
    gap: 10px;
    position: relative;
    box-shadow: none;
}

.compact-card-title {
    display: -webkit-box;
    min-height: 48px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.compact-card-copy {
    display: -webkit-box;
    min-height: 40px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.card-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: stretch;
    margin-top: auto;
}

.card-actions.single-action {
    grid-template-columns: 1fr;
}

.card-actions.single-action .details-trigger {
    width: 100%;
}

.source-link,
.view-link,
.details-trigger {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 38px;
    width: 100%;
    border-radius: 0;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    transition: background 140ms ease, border-color 140ms ease;
}

.details-trigger {
    min-width: 40px;
    width: 40px;
    padding: 0;
    background: var(--paper);
    cursor: pointer;
}

.link-domain {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1;
    opacity: 0.68;
    text-transform: none;
}

.source-link:hover,
.view-link:hover,
.details-trigger:hover,
.details-trigger:focus-visible {
    border-color: var(--black);
    background: var(--black);
    color: var(--paper);
}

.details-control {
    position: relative;
}

.details-popover {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    z-index: 30;
    display: none;
    width: min(280px, calc(100vw - 36px));
    border: 1px solid var(--black);
    background: var(--paper);
    box-shadow: 0 18px 50px rgba(36, 30, 27, 0.16);
    padding: 12px;
    color: var(--ink);
    text-align: left;
}

.details-control:hover .details-popover,
.details-control:focus-within .details-popover {
    display: block;
}

.details-popover-title {
    margin-bottom: 8px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.details-popover ul {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.details-popover li {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.offer-link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.offer-link-row .source-link {
    flex: 1 1 140px;
    width: auto;
}

.detail-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(36, 30, 27, 0.42);
}

.detail-modal.is-open {
    display: flex;
}

.detail-dialog {
    width: min(760px, 100%);
    max-height: min(760px, calc(100vh - 40px));
    overflow: auto;
    border: 1px solid var(--black);
    background: var(--paper);
    color: var(--ink);
    box-shadow: 0 30px 80px rgba(36, 30, 27, 0.22);
}

.detail-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px;
    border-bottom: 1px solid var(--line);
}

.detail-dialog-body {
    display: grid;
    gap: 16px;
    padding: 18px;
}

.detail-section {
    display: grid;
    gap: 8px;
}

.detail-section h4 {
    font-size: 11px;
    font-weight: 900 !important;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.detail-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.detail-close {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    font-size: 20px;
    line-height: 1;
}

.detail-close:hover,
.detail-close:focus-visible {
    border-color: var(--black);
    background: var(--black);
    color: var(--paper);
}

.result-panel h2,
.result-panel h3,
.result-panel h4,
.unsafe-card h3 {
    color: var(--ink) !important;
    font-family: var(--display-font);
    font-weight: 400 !important;
    letter-spacing: 0;
}

.result-panel p,
.result-panel .text-gray-500,
.result-panel .text-gray-600,
.result-panel .text-gray-700 {
    color: var(--muted) !important;
}

#step-label,
#limitations-label,
#conditions-label,
#preventive-count,
#offer-count,
#plan-confidence-badge,
.filter-btn,
.cat-filter-btn {
    border-radius: 0 !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

#plan-confidence-badge,
#preventive-count,
#offer-count,
.filter-btn,
.cat-filter-btn {
    border: 1px solid var(--line) !important;
    background: transparent !important;
    color: var(--ink) !important;
}

.filter-btn.bg-elder-100,
.cat-filter-btn.bg-elder-200,
.filter-btn:hover,
.cat-filter-btn:hover {
    border-color: var(--black) !important;
    background: var(--black) !important;
    color: var(--paper) !important;
}

.tag-row span {
    background: var(--surface-soft) !important;
    color: var(--ink) !important;
}

#profile-conditions-tags span {
    background: var(--rose) !important;
    color: var(--accent-dark) !important;
}

#catalog-rate-title,
#catalog-rate-copy {
    color: var(--paper) !important;
}

#missing-info-panel {
    border-color: var(--line) !important;
    border-radius: 0 !important;
    background: rgba(248, 243, 234, 0.72) !important;
}

#missing-info-panel li,
.plan-card .rounded-lg,
.safety-card .rounded-lg,
.unsafe-card .rounded-lg {
    border-radius: 0 !important;
    background: rgba(248, 243, 234, 0.64) !important;
}

.result-panel input,
.result-panel select {
    border-color: var(--line) !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--ink) !important;
}

.result-panel input:focus,
.result-panel select:focus {
    border-color: var(--accent) !important;
    box-shadow: none !important;
}

#pilot-consent {
    accent-color: var(--accent);
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid var(--accent) !important;
    outline-offset: 3px !important;
}

footer {
    border-top: 1px solid var(--line);
    background: var(--black) !important;
    color: rgba(244, 239, 230, 0.55) !important;
}

footer a {
    color: var(--paper) !important;
}

.fade-in {
    animation: fadeIn 0.28s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 980px) {
    .hero-copy,
    .care-situation-header,
    .care-situation-grid,
    .quick-profile-panel,
    .results-shell {
        grid-template-columns: 1fr;
    }

    .trust-strip,
    .results-sidebar {
        min-width: 0;
        position: static;
    }

    .question-grid,
    .question-group-header,
    .conditions-grid,
    .plan-grid,
    .brief-grid,
    .care-grid,
    .service-grid,
    .safety-grid,
    .recommendations-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .app-shell,
    .app-main {
        width: min(100% - 20px, 1180px);
    }

    .topbar {
        align-items: flex-start;
    }

    .brand-mark img {
        height: 30px;
    }

    .top-actions {
        flex-shrink: 0;
    }

    .soft-link {
        padding: 0 9px;
    }

    .hero-copy {
        padding-bottom: 18px;
    }

    .hero-copy h1 {
        font-size: 30px;
    }

    .hero-copy p {
        font-size: 15px;
    }

    .progress-inner {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    #step-label {
        justify-self: start;
    }

    .care-situation-panel,
    .quick-profile-panel,
    .result-panel,
    .question-card,
    .field-section {
        padding: 14px;
    }

    .scale-option {
        min-height: 52px;
    }

    .question-card .segmented-options {
        grid-template-columns: 1fr;
    }

    .step-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .step-actions .btn-primary,
    .step-actions .btn-secondary {
        width: 100%;
        padding-left: 14px !important;
        padding-right: 14px !important;
    }
}
