.drive-demo {
  --dd-ink: #142d25;
  --dd-text: #44594f;
  --dd-dark: #112b24;
  --dd-acid: #c5f476;
  --dd-line: #d4dcd1;
  --dd-mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  color: var(--dd-ink);
  background: #f6f7f1;
  padding-block: clamp(4rem, 8vw, 8rem);
  scroll-margin-top: 4rem;
}

.drive-demo *, .drive-demo *::before, .drive-demo *::after { box-sizing: border-box; }
.drive-demo [hidden] { display: none !important; }
.dd-container { width: min(1280px, calc(100% - clamp(2.25rem, 8vw, 8rem))); margin-inline: auto; }
.dd-intro { display: flex; justify-content: space-between; align-items: end; gap: 2rem; margin-bottom: clamp(1.75rem, 3.7vw, 3.75rem); }
.drive-demo .dd-kicker, .drive-demo .dd-caption, .drive-demo .dd-period-label {
  font: 500 .76rem/1.4 var(--dd-mono);
  letter-spacing: .095em;
  text-transform: uppercase;
}
.drive-demo .dd-kicker { color: #486446; margin: 0 0 1.15rem; }
.dd-intro h2 { color: var(--dd-ink); margin: 0; font-size: clamp(2.7rem, 5.7vw, 5.3rem); font-weight: 550; line-height: .99; letter-spacing: -.068em; }
.dd-intro > p { max-width: 27rem; margin: 0 0 .2rem; color: var(--dd-text); font-size: clamp(1rem, 1.4vw, 1.13rem); line-height: 1.6; }
.dd-instrument { background: #fdfefa; border: 1px solid #c6d0c2; border-radius: 1.125rem; overflow: clip; box-shadow: 0 .9rem 2.5rem -1.8rem #26432873; }
.dd-toolbar, .dd-periodbar, .dd-footnote { padding-inline: clamp(1rem, 2.45vw, 2.3rem); }
.dd-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem 1.25rem; padding-top: .75rem; padding-bottom: .75rem; border-bottom: 1px solid var(--dd-line); }
.dd-name { display: flex; align-items: center; gap: .65rem; color: var(--dd-ink); font-weight: 650; font-size: 1.22rem; letter-spacing: -.055em; }
.dd-mark { width: 2.05rem; height: 2.05rem; padding: .36rem; border-radius: .55rem; background: var(--dd-dark); stroke: var(--dd-acid); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; fill: none; }
.dd-tabs, .dd-periods { display: flex; align-items: stretch; gap: .32rem; }
.dd-instrument button { appearance: none; font-family: inherit; cursor: pointer; }
.dd-tabs button, .dd-periods button { border-radius: .46rem; border: 1px solid transparent; color: var(--dd-text); background: transparent; line-height: 1.2; min-height: 2.65rem; transition: background-color .15s ease, color .15s ease; }
.dd-tabs button { font-size: .935rem; padding: .45rem .92rem; font-weight: 550; }
.dd-tabs button[aria-selected="true"] { background: var(--dd-dark); color: #fff; }
.dd-tabs button:not([aria-selected="true"]):hover, .dd-periods button:not([aria-pressed="true"]):hover { background: #e5ecdf; color: var(--dd-ink); }
.drive-demo button:focus-visible, .dd-view:focus-visible { outline: 2px solid #26713a; outline-offset: 2px; }
.dd-tabs button { scroll-margin-top: 6rem; }
.dd-periodbar { display: flex; align-items: center; gap: 1.5rem; padding-top: .55rem; padding-bottom: .55rem; }
.drive-demo .dd-period-label, .drive-demo .dd-caption { color: #536a59; }
.dd-periods { gap: .2rem; }
.dd-periods button { padding: .28rem .66rem; font-size: .85rem; }
.dd-periods button[aria-pressed="true"] { color: #263f25; font-weight: 650; background: #e1edcf; border-color: #cbdcbc; }
.dd-view { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(17rem, .85fr); gap: clamp(1.2rem, 3vw, 3.3rem); padding: 0 clamp(.85rem, 1.55vw, 1.65rem) clamp(.85rem, 1.55vw, 1.65rem); }
.dd-view > * { min-width: 0; }
.dd-static { grid-column: 1 / -1; padding: 1rem; font-size: 1rem; line-height: 1.6; }
.dd-chart-card, .dd-narrative, .dd-report { border-radius: .75rem; padding: clamp(1.2rem, 2.9vw, 2.8rem); }
.dd-chart-card, .dd-narrative { background: var(--dd-dark); color: #f7fcf1; }
.dd-chart-card { display: flex; flex-direction: column; overflow: hidden; background-image: radial-gradient(100% 105% at 103% 90%, #204639 0, transparent 67%); }
.dd-chart-top { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.dd-chart-top h3 { margin: 0; font-size: 1.02rem; letter-spacing: -.017em; font-weight: 550; color: #eff6ed; }
.dd-chart-key { color: #adc0ae; font: .78rem/1 var(--dd-mono); }
.dd-chart-metric { display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap; margin: 1.1rem 0 1.15rem; }
.dd-chart-metric > strong { color: var(--dd-acid); font-size: clamp(3rem, 4.2vw, 4.25rem); letter-spacing: -.075em; line-height: .95; font-weight: 450; font-variant-numeric: tabular-nums; }
.dd-chart-metric strong > span { margin-left: .18rem; font-size: .47em; letter-spacing: -.07em; vertical-align: .35em; }
.dd-chart-metric > span { color: #c2cec0; font-size: .875rem; }
.dd-chart-body { display: grid; grid-template-columns: 2.2rem minmax(0,1fr); grid-template-rows: minmax(8.6rem, 1fr) auto; gap: .5rem .25rem; flex: 1; }
.dd-y-axis, .dd-x-axis, .dd-readout, .dd-chart-key { font-family: var(--dd-mono); font-variant-numeric: tabular-nums; }
.dd-y-axis, .dd-x-axis { color: #bbcabd; font-size: .75rem; line-height: 1; }
.dd-y-axis { display: flex; flex-direction: column; justify-content: space-between; padding-block: 0; }
.dd-x-axis { grid-column: 2; display: flex; justify-content: space-between; gap: .25rem; padding-inline: .18rem; }
.dd-plot { position: relative; min-width: 0; min-height: 8.6rem; }
.dd-graph { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
.dd-gridlines line { fill: none; stroke: #91a58d; opacity: .33; stroke-width: 1; stroke-dasharray: 2 5; vector-effect: non-scaling-stroke; }
.dd-trace { fill: none; stroke: var(--dd-acid); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.dd-vertex { fill: var(--dd-acid); }
.dd-guide { stroke: #d7eac4; stroke-width: 1; opacity: .65; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }
.dd-point-ring { fill: var(--dd-dark); stroke: var(--dd-acid); stroke-width: 1.35; vector-effect: non-scaling-stroke; }
.dd-point { fill: var(--dd-acid); }
.dd-scrubber { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: crosshair; }
.dd-plot:focus-within { outline: 2px solid var(--dd-acid); outline-offset: 3px; border-radius: 2px; }
.dd-readout { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .65rem; padding-top: .83rem; margin-top: 1.35rem; border-top: 1px solid #9fb09c42; font-size: .78rem; }
.dd-cursor-label { display: flex; align-items: center; gap: .45rem; color: #c2d0c0; }
.dd-cursor-label svg { height: 1rem; width: 1rem; stroke: var(--dd-acid); stroke-width: 1.5; fill: none; }
.dd-reading { color: var(--dd-acid); font: inherit; }
.dd-note { display: flex; flex-direction: column; align-items: start; padding: clamp(.4rem,1.3vw,1.45rem) clamp(.3rem,1.2vw,1.4rem) clamp(.45rem,1.1vw,1.1rem) 0; }
.drive-demo .dd-caption { margin: 0 0 .62rem; font-size: .745rem; }
.dd-note h3, .dd-report h3, .dd-narrative h3 { margin: 0; font-size: clamp(1.8rem, 2.7vw, 2.9rem); font-weight: 550; line-height: 1.04; letter-spacing: -.055em; color: var(--dd-ink); }
.dd-note h4, .dd-chapter h4 { margin: 0 0 .4rem; font-size: 1rem; line-height: 1.3; font-weight: 650; letter-spacing: -.02em; }
.dd-note p:not(.dd-caption), .dd-chapter p { margin: .6rem 0 0; font-size: 1rem; line-height: 1.55; }
.dd-note p:not(.dd-caption) { color: var(--dd-text); }
.dd-note-detail { padding: 1.15rem 0; border-top: 1px solid var(--dd-line); width: 100%; margin-top: 1.25rem; }
.dd-note-detail h4 + p, .dd-chapter h4 + p { margin: 0; }
.dd-stats { display: flex; gap: clamp(1.75rem,4.5vw,4rem); width: 100%; margin: 1.25rem 0 0; }
.dd-stats div { display: flex; flex-direction: column-reverse; align-items: start; gap: .35rem; }
.dd-stats dt { font-size: .85rem; color: var(--dd-text); line-height: 1.3; }
.dd-stats dd { margin: 0; font-size: clamp(1.9rem,2.8vw,2.8rem); line-height: 1.04; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.dd-note .dd-action { margin-top: auto; padding: .6rem .95rem; border: 1px solid #bbcbb3; border-radius: 2rem; background: transparent; color: #25452c; font-weight: 600; font-size: .91rem; line-height: 1.3; min-height: 2.7rem; transition: background-color .15s ease; }
.dd-note .dd-action:hover { background: #e6efdc; }
.dd-ledger { margin: 1.2rem 0 0; width: 100%; }
.dd-ledger div { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; padding: .72rem 0; border-top: 1px solid var(--dd-line); line-height: 1.35; }
.dd-ledger dt, .dd-ledger dd { font-size: .95rem; }
.dd-ledger dt { color: var(--dd-text); }
.dd-ledger dd { margin: 0; color: var(--dd-ink); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.dd-note > p + .dd-action { margin-top: 1.2rem; }
.dd-narrative { background-image: linear-gradient(120deg, #112b24 28%, #214435); }
.drive-demo .dd-narrative .dd-caption { color: #c4d5ba; }
.dd-narrative h3 { color: var(--dd-acid); font-size: clamp(2rem,3.8vw,3.6rem); margin-bottom: 1.35rem; }
.dd-chapter { padding: .95rem 0 0; margin-top: 1rem; border-top: 1px solid #9fb09c50; }
.dd-chapter h4 { color: #edf4e9; }
.dd-chapter p { color: #c8d5c7; }
.dd-report { background: #edf1e8; border: 1px solid #d4dece; }
.dd-report h3 { font-size: clamp(2rem,3.5vw,3.3rem); }
.dd-report-sub, .dd-report-foot { margin: .65rem 0 0; font-size: .85rem; color: var(--dd-text); line-height: 1.45; }
.dd-report-foot { font-size: .78rem; }
.dd-footnote { margin: 0; display: flex; justify-content: space-between; gap: .35rem 1rem; flex-wrap: wrap; border-top: 1px solid var(--dd-line); padding-block: .78rem; font-size: .78rem; color: #536758; line-height: 1.3; }
.dd-footnote span:first-child { font-weight: 600; }
@media (prefers-reduced-motion: no-preference) {
  .dd-trace { animation: dd-trace-in .55s ease-out both; }
  .dd-view:not([hidden]) > .dd-note, .dd-narrative, .dd-report { animation: dd-note-in .23s ease-out both; }
  @keyframes dd-trace-in { from { stroke-dasharray: 1; stroke-dashoffset: 1; } to { stroke-dasharray: 1; stroke-dashoffset: 0; } }
  @keyframes dd-note-in { from { opacity: .35; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
}
@media (max-width: 850px) {
  .dd-toolbar { align-items: start; }
  .dd-intro { align-items: start; gap: 1rem; }
  .dd-intro > p { max-width: 19rem; }
  .dd-tabs button { padding-inline: .67rem; }
  .dd-view { grid-template-columns: minmax(0, 1.22fr) minmax(14rem, .9fr); gap: 1.2rem; }
  .dd-chart-card, .dd-report, .dd-narrative { padding: 1.25rem; }
  .dd-note { padding-right: .2rem; }
}
@media (max-width: 680px) {
  .dd-intro { flex-direction: column; gap: 1rem; }
  .dd-intro > p { max-width: 33rem; }
  .dd-toolbar { gap: .7rem; display: grid; padding-block: 1rem .65rem; }
  .dd-tabs { display: grid; grid-template-columns: 1fr .84fr 1.38fr .82fr; width: 100%; gap: .15rem; }
  .dd-tabs button { font-size: .86rem; padding-inline: .2rem; }
  .dd-periodbar { display: block; padding-block: .8rem; }
  .dd-period-label { display: block; margin-bottom: .4rem; }
  .dd-periods { display: grid; grid-template-columns: 1.25fr repeat(4,minmax(0,1fr)); }
  .dd-periods button { padding-inline: .18rem; font-size: .83rem; }
  .dd-view { grid-template-columns: minmax(0,1fr); gap: 1rem; }
  .dd-chart-body { grid-template-rows: 9rem auto; }
  .dd-note { padding: .3rem .45rem .5rem; }
  .dd-stats { gap: 3rem; margin-top: 1rem; }
  .dd-note-detail { margin-top: 1rem; }
  .dd-readout { font-size: .75rem; }
  .dd-footnote { flex-direction: column; }
}
@media (max-width: 380px) {
  .dd-container { width: calc(100% - 1.5rem); }
  .dd-tabs button { font-size: .8rem; }
  .dd-toolbar, .dd-periodbar, .dd-footnote { padding-inline: .75rem; }
  .dd-chart-card, .dd-report, .dd-narrative { padding: 1rem; }
  .dd-chart-metric { gap: .5rem; }
  .dd-chart-metric > span { font-size: .8rem; }
}

/* The same five owner questions select the case across all journal views. */
.drive-demo { scroll-margin-top: 0; padding-top: clamp(3rem, 5.5vw, 5.75rem); }
.dd-casebook { margin-bottom: 1.05rem; }
.dd-cases { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: .6rem; }
.dd-case {
  min-width: 0; appearance: none; display: flex; flex-direction: column;
  gap: .7rem; padding: 1.05rem .9rem; text-align: left; font: inherit;
  border: 1px solid #becbb9; border-radius: .75rem;
  background: #f8faf4; color: #213c2f; scroll-margin-block-start: 1.15rem;
  transition: background-color .18s, border-color .18s, box-shadow .18s;
}
.dd-case:hover { border-color: #5d8059; background: #f1f6e9; }
.dd-case[aria-pressed="true"] { border-color: #203f31; background: #223e32; color: #f5faed; box-shadow: inset 0 -3px 0 #c5f476; }
.dd-case-head { display: flex; align-items: center; gap: .5rem; font-size: .98rem; font-weight: 650; line-height: 1.22; }
.dd-case-head svg { width: 1.35rem; height: 1.35rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.dd-case[aria-pressed="true"] .dd-case-head svg { color: #cefa8c; }
.dd-case-question { font-size: .88rem; line-height: 1.35; color: #4a6051; }
.dd-case[aria-pressed="true"] .dd-case-question { color: #d8e7d1; }
.dd-chart-body { grid-template-columns: 2.8rem minmax(0,1fr); }
.dd-plot { touch-action: pan-y; }
.dd-note .dd-ledger { margin-block: .85rem 1.15rem; }
.dd-chart-empty { justify-content: center; min-height: 19rem; gap: 1rem; }
.drive-demo .dd-chart-empty .dd-caption, .dd-gap-note { color: #c3d4bf; }
.dd-chart-empty h3 { font-size: clamp(1.65rem, 2.9vw, 2.65rem); color: var(--dd-acid); }
.dd-chart-empty p { max-width: 43ch; }
.dd-chart-empty .dd-empty-count { font-family: var(--dd-mono); color: var(--dd-acid); font-size: .84rem; }
.dd-gap-note { font-size: .82rem; margin-top: .7rem; }
.dd-sr { position: absolute; overflow: hidden; width: 1px; height: 1px; margin: -1px; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 900px) {
  .dd-cases { gap: .45rem; }
  .dd-case { padding: .8rem .65rem; }
  .dd-case-head { flex-wrap: wrap; gap: .4rem; font-size: .92rem; }
}
@media (max-width: 680px) {
  .dd-cases { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dd-case { flex-direction: row; align-items: center; padding: .68rem .6rem; min-height: 46px; }
  .dd-case-question { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .dd-case-head { flex-wrap: nowrap; font-size: .925rem; }
  .dd-chart-empty { min-height: 13rem; }
}

.dd-note .dd-related { display: inline-block; margin: .7rem .3rem .3rem 0; font-size: .93rem; }
