/* FuelDash R223 — Tankbuch uses the same flat OLED hierarchy as Preisalarm. */
:root {
  --fd-r223-page: #000000;
  --fd-r223-card: #0c0c0c;
  --fd-r223-control: #080808;
  --fd-r223-border: #1e1e1e;
  --fd-r223-border-strong: #2a2a2e;
  --fd-r223-text: #f5f5f7;
  --fd-r223-muted: #92929a;
  --fd-r223-red: #ff3b30;
}

html[data-fd-theme="dark"] body .fd-feature-page[data-fd-feature-view="tankbook"],
html[data-fd-theme="dark"] body .fd-feature-page[data-fd-feature-view="tankbook"] .fd-feature-shell,
html[data-fd-theme="dark"] body .fd-feature-page[data-fd-feature-view="tankbook"] :is(.fd-feature-header, .fd-feature-content) {
  background: var(--fd-r223-page) !important;
  background-color: var(--fd-r223-page) !important;
  background-image: none !important;
  color: var(--fd-r223-text) !important;
  box-shadow: none !important;
}

html[data-fd-theme="dark"] body .fd-feature-page[data-fd-feature-view="tankbook"] {
  color-scheme: dark !important;
}

/* Primary content blocks match the Preisalarm content cards. */
html[data-fd-theme="dark"] body .fd-feature-page[data-fd-feature-view="tankbook"] :is(
  .fd-feature-card,
  .fd-overall-card,
  .fd-tank-form-card,
  .fd-tank-history,
  .fd-month-card,
  .fd-backup-card,
  .fd-account-card
) {
  border-color: var(--fd-r223-border) !important;
  background: var(--fd-r223-card) !important;
  background-color: var(--fd-r223-card) !important;
  background-image: none !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

html[data-fd-theme="dark"] body .fd-feature-page[data-fd-feature-view="tankbook"] :is(
  .fd-feature-card__head > span,
  .fd-tank-history__head > span
) {
  border-color: var(--fd-r223-border) !important;
  background: var(--fd-r223-control) !important;
  background-image: none !important;
  color: var(--fd-r223-muted) !important;
  box-shadow: none !important;
}

/* Every editable control uses the exact dark Preisalarm material. */
html[data-fd-theme="dark"] body .fd-feature-page[data-fd-feature-view="tankbook"] .fd-tank-form :is(
  .fd-field > input,
  .fd-field > select,
  .fd-field > textarea,
  .fd-field-affix
) {
  border-color: var(--fd-r223-border) !important;
  background: var(--fd-r223-control) !important;
  background-color: var(--fd-r223-control) !important;
  background-image: none !important;
  color: var(--fd-r223-text) !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  color-scheme: dark !important;
}

html[data-fd-theme="dark"] body .fd-feature-page[data-fd-feature-view="tankbook"] .fd-tank-form .fd-field-affix > input {
  border-color: transparent !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

html[data-fd-theme="dark"] body .fd-feature-page[data-fd-feature-view="tankbook"] .fd-tank-form .fd-field > :is(input, select, textarea):focus,
html[data-fd-theme="dark"] body .fd-feature-page[data-fd-feature-view="tankbook"] .fd-tank-form .fd-field-affix:focus-within {
  border-color: var(--fd-r223-red) !important;
  outline: 0 !important;
  box-shadow: inset 0 0 0 1px var(--fd-r223-red) !important;
}

html[data-fd-theme="dark"] body .fd-feature-page[data-fd-feature-view="tankbook"] .fd-tank-form :is(input, textarea)::placeholder {
  color: #68686f !important;
  opacity: 1 !important;
}

html[data-fd-theme="dark"] body .fd-feature-page[data-fd-feature-view="tankbook"] .fd-tank-form :is(input[type="date"], input[type="datetime-local"])::-webkit-calendar-picker-indicator {
  opacity: .68 !important;
  filter: invert(1) !important;
}

/* Optional fields become one coherent dark disclosure block. */
html[data-fd-theme="dark"] body .fd-feature-page[data-fd-feature-view="tankbook"] .fd-tank-extras {
  box-sizing: border-box !important;
  border: 1px solid var(--fd-r223-border) !important;
  border-radius: 15px !important;
  padding: 0 12px !important;
  background: var(--fd-r223-control) !important;
  background-color: var(--fd-r223-control) !important;
  background-image: none !important;
  box-shadow: none !important;
}

html[data-fd-theme="dark"] body .fd-feature-page[data-fd-feature-view="tankbook"] .fd-tank-extras summary {
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

html[data-fd-theme="dark"] body .fd-feature-page[data-fd-feature-view="tankbook"] .fd-tank-extras > div {
  padding: 4px 0 12px !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

/* Statistics, entries and file actions use quiet inset surfaces. */
html[data-fd-theme="dark"] body .fd-feature-page[data-fd-feature-view="tankbook"] :is(
  .fd-tank-summary > article,
  .fd-month-grid > article,
  .fd-tank-entry,
  .fd-tank-entry__values > span,
  .fd-tank-empty,
  .fd-backup-actions > button,
  .fd-statistics-date__control
) {
  border-color: var(--fd-r223-border) !important;
  background: var(--fd-r223-control) !important;
  background-color: var(--fd-r223-control) !important;
  background-image: none !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}


html[data-fd-theme="dark"] body .fd-feature-page[data-fd-feature-view="tankbook"] .fd-tank-entry__values > span {
  background: var(--fd-r223-card) !important;
  background-color: var(--fd-r223-card) !important;
}

html[data-fd-theme="dark"] body .fd-feature-page[data-fd-feature-view="tankbook"] .fd-statistics-date__control {
  color: var(--fd-r223-text) !important;
}

html[data-fd-theme="dark"] body .fd-feature-page[data-fd-feature-view="tankbook"] .fd-statistics-date__control :is(svg, .fd-statistics-date__label, input) {
  color: var(--fd-r223-text) !important;
}

html[data-fd-theme="dark"] body .fd-feature-page[data-fd-feature-view="tankbook"] .fd-statistics-date__control input::-webkit-calendar-picker-indicator {
  opacity: 0 !important;
}

html[data-fd-theme="dark"] body .fd-feature-page[data-fd-feature-view="tankbook"] :is(
  .fd-field > span:first-child,
  .fd-statistics-date > span:first-child,
  .fd-feature-card > p,
  .fd-backup-card > p,
  .fd-tank-entry > p,
  .fd-tank-empty p
) {
  color: var(--fd-r223-muted) !important;
}

html[data-fd-theme="dark"] body .fd-feature-page[data-fd-feature-view="tankbook"] .fd-backup-actions > button:active {
  border-color: var(--fd-r223-border-strong) !important;
  transform: scale(.985);
}

html[data-fd-theme="dark"] body .fd-feature-page[data-fd-feature-view="tankbook"] .fd-tank-submit {
  border-color: var(--fd-r223-red) !important;
  background: var(--fd-r223-red) !important;
  background-image: none !important;
  color: #ffffff !important;
  box-shadow: none !important;
}
