.demo-page { background: #f6f9fd; }
.demo-hero { padding-block: clamp(2.5rem, 6vw, 5rem); background: radial-gradient(ellipse at 15% 10%, #d9f4f1, transparent 60%), linear-gradient(125deg, #f9fcff, #eaf4ff); }
.demo-hero h1 { max-width: 46rem; margin-bottom: 1rem; font-size: clamp(2.4rem, 6vw, 4.4rem); line-height: 1.2; }
.demo-hero .lead { max-width: 45rem; }
.demo-notice { max-width: 52rem; color: #334d67; font-size: .98rem; line-height: 1.85; }
.demo-skip { display: inline-flex; min-height: 44px; align-items: center; gap: .7rem; font-weight: 700; text-decoration: underline; text-underline-offset: .3rem; }
.demo-workspace { padding-top: 2rem; scroll-margin-top: calc(var(--header-height) + 1rem); }
.demo-scenarios, .demo-entry-fields { min-width: 0; margin: 0; padding: 0; border: 0; }
.demo-scenarios > legend { font-size: 1.4rem; font-weight: 700; }
.demo-scenarios > p { color: #566b80; margin-top: .4rem; }
.demo-scenario-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; }
.demo-scenario-card { display: flex; gap: .8rem; align-items: flex-start; padding: 1.1rem; border: 2px solid #d7e5f0; border-radius: 1rem; background: #fff; cursor: pointer; }
.demo-scenario-card:has(input:checked) { border-color: #075fbf; background: #eef6ff; }
.demo-scenario-card:focus-within { outline: 3px solid #075fbf; outline-offset: 3px; }
.demo-scenario-card input { flex-shrink: 0; width: 1.15rem; height: 1.15rem; margin: .3rem 0 0; accent-color: #075fbf; }
.demo-scenario-card strong, .demo-scenario-card small { display: block; }
.demo-scenario-card strong { font-size: 1.1rem; }
.demo-scenario-card small { margin-top: .25rem; color: #475d74; font-size: .91rem; }
.demo-context { margin-block: 1.8rem 1.3rem; }
.demo-context h2 { margin: .35rem 0; font-size: clamp(1.35rem, 3vw, 1.8rem); }
.demo-context p { margin: .3rem 0; max-width: 65rem; }
.demo-label { display: inline-flex; border-radius: 2rem; padding: .2rem .7rem; color: #064b97; background: #dfedfc; font-size: .88rem; font-weight: 700; }
.demo-unit { color: #566b80; font-size: .9rem; }
.demo-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; }
.demo-stat { display: flex; min-width: 0; flex-direction: column; gap: .5rem; padding: 1.15rem; border: 1px solid #d7e5f0; border-radius: 1.1rem; background: #fff; }
.demo-stat > span { color: #475d74; font-size: .98rem; }
.demo-stat > strong { align-self: flex-start; max-width: 100%; overflow-wrap: anywhere; color: #0b1b3a; font-size: clamp(1.5rem, 3vw, 2rem); font-variant-numeric: tabular-nums; line-height: 1.3; }
.demo-stat-primary { background: #075fbf; border-color: #075fbf; box-shadow: 0 10px 25px #075fbf20; }
.demo-stat-primary > span, .demo-stat-primary > strong { color: #fff; }
.demo-progress-row { display: flex; align-items: center; gap: 1rem; margin-top: 1.1rem; }
.demo-progress-row label { flex-shrink: 0; color: #334d67; }
.demo-progress-row strong { display: inline-block; margin-inline-start: .4rem; min-width: 3rem; }
.demo-progress-row progress { width: 100%; height: .6rem; border: 0; border-radius: 1rem; overflow: hidden; accent-color: #087a50; background: #dce8ef; }
.demo-progress-row progress::-webkit-progress-bar { background: #dce8ef; }
.demo-progress-row progress::-webkit-progress-value { background: #087a50; }
.demo-progress-row progress::-moz-progress-bar { background: #087a50; }
.demo-explanation { margin: .75rem 0 1.6rem; color: #475d74; font-size: .96rem; }
.demo-columns { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.3fr); gap: 1.25rem; align-items: start; }
.demo-entry-card, .demo-ledger-card { min-width: 0; padding: clamp(1.1rem, 3vw, 1.6rem); border: 1px solid #d7e5f0; border-radius: 1.3rem; background: #fff; box-shadow: 0 8px 26px #092a5208; }
.demo-entry-card h2, .demo-ledger-card h2 { font-size: 1.3rem; margin: 0 0 1rem; }
.demo-entry-fields { display: grid; gap: .5rem; }
.demo-entry-fields label { font-weight: 700; }
.demo-entry-fields select, .demo-entry-fields input { width: 100%; min-width: 0; min-height: 48px; padding: .7rem .8rem; border: 1px solid #a1b8cc; border-radius: .65rem; background: #fff; color: #172b43; font: inherit; }
.demo-entry-fields input::placeholder { color: #566b80; opacity: 1; }
.demo-entry-fields input[aria-invalid="true"] { border: 2px solid #a42721; }
.demo-entry-fields .btn { margin-top: .4rem; width: 100%; }
.demo-field-hint { margin: 0 0 .55rem; color: #566b80; font-size: .9rem; line-height: 1.75; }
.demo-error { margin: 0; padding: .7rem; border-inline-start: 3px solid #a42721; border-radius: .3rem; color: #8d1e19; background: #fff1f0; font-size: .94rem; }
.demo-error[hidden] { display: none; }
.demo-status { min-height: 3.6rem; margin: 1rem 0 .5rem; color: #075d3e; font-size: .98rem; }
.demo-reset { min-height: 44px; padding: .4rem .2rem; border: 0; color: #064b97; background: transparent; font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: .3rem; cursor: pointer; }
.demo-ledger-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .4rem 1rem; }
.demo-ledger-heading > span { color: #566b80; font-size: .91rem; }
.demo-table-wrap { max-height: 32rem; overflow: auto; overscroll-behavior: contain; border: 1px solid #e0e8ef; border-radius: .7rem; }
.demo-table { width: 100%; border-collapse: collapse; text-align: start; font-size: .94rem; }
.demo-table th, .demo-table td { padding: .85rem .65rem; border-bottom: 1px solid #e6edf3; text-align: start; vertical-align: top; }
.demo-table th { color: #334d67; background: #f1f6fa; font-weight: 700; }
.demo-table tr:last-child td { border-bottom: 0; }
.demo-table td:last-child { color: #475d74; min-width: 7rem; }
.demo-amount-cell { font-variant-numeric: tabular-nums; font-weight: 700; }
.demo-type-label { display: inline-block; min-width: 3.5rem; padding: .1rem .5rem; border-radius: 2rem; text-align: center; font-size: .87rem; font-weight: 700; }
.demo-type-debt { background: #fff0ee; color: #952d25; }
.demo-type-payment { background: #e6f7ef; color: #096540; }
.demo-type-expense { background: #fff3df; color: #78510c; }
.demo-ledger-note { margin-bottom: 0; color: #566b80; font-size: .9rem; }
.demo-guide-links { display: flex; justify-content: center; flex-wrap: wrap; gap: .7rem 1.5rem; margin-top: 1.4rem; }
.demo-guide-links a { display: inline-flex; min-height: 44px; align-items: center; text-decoration: underline; text-underline-offset: .3rem; }
@media (max-width: 760px) {
    .demo-scenario-options { grid-template-columns: 1fr; gap: .6rem; }
    .demo-scenario-card { padding: .85rem 1rem; }
    .demo-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .demo-columns { grid-template-columns: 1fr; }
    .demo-stat { padding: .95rem; }
    .demo-stat > span { font-size: .9rem; }
    .demo-table th, .demo-table td { padding: .7rem .4rem; }
}
@media (prefers-reduced-motion: reduce) { .demo-page { scroll-behavior: auto; } }
