.drv-demo {
  --ink: #1b2e26;
  --muted: #52645b;
  --green: #173e31;
  --line: #dce4dc;
  --paper: #fffdfa;
  --gold: #f2d497;
  margin: 0;
  color: var(--ink);
  background: #f4f3ed;
  font: 400 15px/1.55 "Segoe UI", system-ui, sans-serif;
}

.drv-demo *, .drv-demo *::before, .drv-demo *::after { box-sizing: border-box; }
.drv-demo [hidden] { display: none !important; }
.drv-demo button, .drv-demo select { font: inherit; }
.drv-demo a { color: var(--green); }
.drv-demo :focus-visible { outline: 3px solid #a36924; outline-offset: 3px; }
.demo-skip { position: fixed; z-index: 5; top: 8px; left: 12px; padding: 8px 12px; border-radius: 6px; background: var(--paper); transform: translateY(-150%); }
.demo-skip:focus { transform: translateY(0); }
.demo-header, .demo-main { width: min(1440px, 100% - 64px); margin-inline: auto; }
.demo-header { min-height: 72px; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.demo-brand, .demo-back { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; }
.demo-brand img { display: block; object-fit: contain; }
.demo-back { padding-block: 9px; font-size: .9rem; font-weight: 650; }
.demo-back:hover, .demo-footer a:hover { text-decoration: underline; text-underline-offset: 4px; }
.demo-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 245px;
  border-radius: 22px;
  background: #142b23;
  color: #fffbf0;
  box-shadow: 0 14px 35px #172c211a;
}
.demo-hero-copy { position: relative; max-width: 66%; padding: 32px 42px; }
.demo-overline { margin: 0 0 4px; color: var(--gold); font-weight: 750; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.demo-hero h1 { margin: 0; font: 500 clamp(2.8rem, 5.5vw, 5.6rem)/1.02 Georgia, serif; letter-spacing: -.055em; }
.demo-intro { max-width: 39ch; margin: 12px 0 17px; color: #e5ede5; font-size: clamp(1rem, 1.5vw, 1.18rem); }
.demo-fiction { margin: 0; color: #ecd4a3; font-size: .81rem; }
.demo-hero-art { position: absolute; z-index: -1; inset: 0 0 0 auto; width: 48%; }
.demo-hero-art::after { position: absolute; inset: 0; content: ""; background: linear-gradient(90deg, #142b23 1%, #142b23a0 24%, #142b2300 57%); }
.demo-hero-art img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 52% 34%; }

.demo-grid { display: grid; grid-template-columns: minmax(236px, .29fr) minmax(0, 1fr); gap: 18px; margin-block: 22px; align-items: start; }
.demo-panel { min-width: 0; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); box-shadow: 0 5px 20px #213e2f0a; }
.demo-sources, .demo-reports { padding: clamp(16px, 2.3vw, 29px); }
.demo-panel h2 { margin: 0; font: 600 clamp(1.45rem, 2vw, 1.95rem)/1.08 Georgia, serif; letter-spacing: -.027em; }
.demo-panel .demo-source-title { margin-bottom: 12px; }
.demo-field + .demo-field { margin-top: 10px; }
.demo-control-heading, .demo-heading-with-help, .demo-connect-row { display: flex; align-items: center; gap: 8px; }
.demo-control-heading { justify-content: space-between; }
.demo-connect-row .demo-connect { flex: 1; min-width: 0; }
.drv-demo .demo-help-trigger {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #a9bbae;
  border-radius: 50%;
  color: var(--green);
  background: #f0f5ee;
  font-weight: 750;
  cursor: pointer;
}
.drv-demo .demo-help-trigger:enabled:hover { background: #e2eee1; }
.demo-help-dialog {
  width: min(420px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: 21px 24px;
  border: 1px solid #c1d1c3;
  border-radius: 14px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 18px 54px #10291f42;
}
.demo-help-dialog::backdrop { background: #142b235e; }
.demo-help-dialog h2 { margin: 0 0 8px; color: var(--green); font: 600 1.4rem/1.25 Georgia, serif; }
.demo-help-dialog p { margin: 0 0 16px; }
.demo-help-dialog form { display: flex; justify-content: flex-end; }
.drv-demo .demo-help-close { border-color: #c5d4c7; background: #e9f2e7; color: var(--green); font-weight: 700; }
.drv-demo .demo-help-close:hover { background: #dceadc; }
.demo-sources label, .demo-year-label { display: block; color: var(--muted); font-size: .8rem; font-weight: 700; }
.demo-storage-note { margin: 5px 0 0; color: var(--muted); font-size: .78rem; }
.drv-demo select { width: 100%; min-height: 44px; margin-top: 4px; padding: 6px 9px; border: 1px solid #c2cec4; border-radius: 8px; color: var(--ink); background-color: #fbfcf9; }
.drv-demo select:disabled, .drv-demo button:disabled { opacity: .62; cursor: default; }
.demo-database-list { display: grid; gap: 7px; margin: 16px 0; }
.demo-database-list div { padding: 8px 11px; border: 1px solid #e1e9df; border-radius: 8px; background: #f2f6f0; }
.demo-database-list dt { color: var(--muted); font-size: .74rem; }
.demo-database-list dd { margin: 0; font: 620 .83rem/1.4 Consolas, ui-monospace, monospace; overflow-wrap: anywhere; }
.demo-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 9px 13px; border: 1px solid transparent; border-radius: 9px; font-size: .88rem; font-weight: 720; text-decoration: none; cursor: pointer; }
.drv-demo .demo-connect { width: 100%; justify-content: space-between; color: #fff; background: var(--green); font-weight: 720; }
.drv-demo .demo-connect:enabled:hover { background: #255642; }
.demo-status { margin: 10px 0 0; color: var(--muted); font-size: .82rem; }
.demo-status[data-loaded="true"] { color: #285b44; font-weight: 650; }
.demo-error { color: #8a3d2e; font-size: .83rem; }

.demo-report-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 18px; }
.demo-report-heading p { margin: 5px 0 0; color: var(--muted); font-size: .85rem; }
.demo-report-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.demo-export { border-color: #c5d4c7; background: #e9f2e7; }
.demo-export:hover { background: #daeada; }
.drv-demo .demo-order { color: #fff; background: var(--green); }
.drv-demo .demo-order:hover { background: #255642; }
.demo-empty {
  min-height: 285px;
  margin-top: 20px;
  padding: 34px 15px;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  border: 1px dashed #c8d2c9;
  border-radius: 12px;
  background: #f7f9f5;
}
.demo-empty p { margin: 0; color: var(--muted); }
.demo-empty p:first-of-type { margin-top: 12px; color: var(--ink); font-weight: 680; }
.demo-empty p + p { margin-top: 5px; font-size: .88rem; }
.demo-ledger-icon { display: grid; gap: 5px; width: 41px; aspect-ratio: 1; padding: 8px; border: 1px solid #91af9d; border-radius: 9px; background: #e7f0e7; }
.demo-ledger-icon i { border-top: 2px solid #5a7968; transform: translateY(2px); }
.demo-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 17px 0; }
.demo-metrics div { padding: 10px 12px; border: 1px solid #dde8db; border-radius: 9px; background: #f1f6f0; }
.demo-metrics dt { color: var(--muted); font-size: .8rem; }
.demo-metrics dd { margin: 2px 0 0; font-size: clamp(.96rem, 1.65vw, 1.22rem); font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.demo-metrics span { display: block; color: var(--muted); font-size: .74rem; margin-top: 3px; }
.demo-report-controls { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.demo-tabs { display: flex; flex-wrap: wrap; gap: 5px; }
.demo-tabs button { padding: 7px 10px; min-height: 38px; border: 1px solid transparent; border-radius: 7px; color: var(--muted); background: transparent; font-size: .82rem; font-weight: 690; cursor: pointer; }
.demo-tabs button:hover { background: #edf3eb; }
.demo-tabs [aria-selected="true"] { color: var(--green); background: #e8f0e6; border-color: #c6d7c6; }
.demo-year-label { display: inline-flex; align-items: center; gap: 6px; }
.drv-demo .demo-year-label select { width: auto; min-height: 38px; margin: 0; }
.demo-table-panel { margin-top: 12px; }
.demo-table-heading h3 { margin: 0; font-size: 1.05rem; }
.demo-table-heading p, .demo-table-note { margin: 2px 0 9px; color: var(--muted); font-size: .82rem; }
.demo-table-note { margin: 8px 0 0; }
.demo-table-scroll { min-width: 0; overflow-x: auto; border: 1px solid #dce5dc; border-radius: 9px; }
.demo-table-scroll table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.demo-table-scroll th, .demo-table-scroll td { padding: 8px 9px; text-align: left; line-height: 1.32; }
.demo-table-scroll thead { background: var(--green); color: #fff; }
.demo-table-scroll thead th { min-width: 92px; font-weight: 600; }
.demo-table-scroll td, .demo-table-scroll tbody th { border-bottom: 1px solid #e9ede7; }
.demo-table-scroll tbody th { white-space: nowrap; }
.demo-table-scroll tbody tr:nth-child(even) { background: #f7f9f5; }
.demo-table-scroll .demo-number { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.demo-table-scroll .demo-zero { color: #5b6d64; }
.demo-table-scroll tfoot { color: var(--ink); background: #e9f1e7; font-weight: 740; }
.demo-no-rows { margin: 0; padding: 17px; border-radius: 8px; background: #f1f6ef; color: var(--muted); }
.demo-result-status { display: inline-block; padding: 3px 6px; border-radius: 5px; white-space: nowrap; font-weight: 680; color: #285440; background: #e2f0e0; }
.demo-result-status[data-proof="true"] { color: #704919; background: #f6e8cc; }
.demo-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 0 0 25px; color: var(--muted); font-size: .85rem; }
.demo-footer a { font-weight: 680; text-decoration: none; }

@media (max-width: 860px) {
  .demo-header, .demo-main { width: min(100% - 36px, 690px); }
  .demo-grid { grid-template-columns: 1fr; gap: 12px; margin-block: 16px; }
  .demo-database-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 500px) {
  .demo-header, .demo-main { width: calc(100% - 24px); }
  .demo-header { min-height: 59px; }
  .demo-brand { gap: 5px; }
  .demo-brand img:first-child { width: 24px; }
  .demo-brand img:last-child { width: 97px; }
  .demo-back { font-size: .78rem; gap: 5px; }
  .demo-hero { min-height: 0; border-radius: 14px; }
  .demo-hero-copy { max-width: unset; padding: 20px 18px; }
  .demo-hero-art { width: 66%; opacity: .33; }
  .demo-intro { margin: 9px 0 11px; }
  .demo-metrics { gap: 4px; }
  .demo-metrics div { padding: 7px 5px; }
  .demo-metrics dt { font-size: .71rem; }
  .demo-metrics dd { font-size: .85rem; }
  .demo-tabs button { padding-inline: 7px; }
}
