/* Product DNA and the aliases consumed by existing screens and popup portals. */
html[data-theme="longmoney"] {
  font-size: 100%;
  --font-family-body: Nunito, system-ui, sans-serif;
  /* Optical weights for the bundled Nunito variable font on small displays. */
  --font-weight-normal: 600;
  --font-weight-medium: 675;
  --font-weight-semibold: 750;
  --font-weight-bold: 850;
  --background-interactive: var(--brand);
  --background-interactive-muted: var(--soft);
  --background-accent: var(--color-lime-700);
  --background-accent-muted: var(--color-lime-50);
  --background-accent-subtle: var(--color-lime-100);
  --background-accent-medium: var(--color-lime-200);
  --background-accent-emphasized: var(--color-lime-400);
  --object-interactive: var(--color-lime-800);
  --object-interactive-muted: var(--color-lime-700);
  --object-interactive-inverted: var(--color-lime-300);
  --object-on-interactive: var(--color-lime-950);
  --object-accent: var(--color-lime-800);
  --object-accent-muted: var(--color-lime-300);
  --object-accent-inverted: var(--color-lime-300);
  --border-interactive: var(--color-lime-700);
  --border-interactive-inverted: var(--color-lime-800);
  --border-subtle: var(--color-lime-200);
  --border-medium: var(--color-lime-300);
  --object-secondary: var(--text-secondary);
  --canvas: var(--background-surface);
  --surface: var(--background-surface);
  --table-head: var(--background-subtle);
  --control-track: var(--background-emphasized);
  --focus-ring: var(--border-interactive);
}
html[data-theme="longmoney"], html[data-theme="longmoney"] #app {
  --line: var(--border);
  --accent: var(--object-interactive);
  --muted: var(--object-secondary);
}
body { font-weight: var(--font-weight-normal); }

/* entry.css owns the calendar grid, clock layout and keyboard geometry. */
.entry-date-dialog .ed-tabs {
  background: var(--background-emphasized);
  border-radius: var(--radius-lg);
}
.entry-date-dialog .ed-tabs .ed-tab {
  border: 0;
  border-radius: var(--radius-base);
  font-weight: var(--font-weight-semibold);
}
.entry-date-dialog .ed-tabs .ed-tab[aria-selected=true] {
  color: var(--object-primary);
  background: var(--background-surface);
  box-shadow: var(--elevation-low);
}
.entry-date-dialog .ed-field input,
.gregorian-date-field .gregorian-date-button {
  border: var(--size-px) solid var(--border);
  border-radius: var(--field-radius);
  color: var(--object-primary);
  background: var(--background-surface);
  font-weight: var(--font-weight-semibold);
}
.entry-date-dialog :is(.ed-day,.ed-month,.ed-minute-presets button,.ed-quick-days button)[aria-pressed=true] {
  color: var(--object-on-interactive);
  background: var(--background-interactive);
  border-color: var(--border-interactive);
  font-weight: var(--font-weight-bold);
}

.icon-pack-tabs button[role=tab] {
  min-height: var(--control-height-base);
  background: var(--background-muted);
  border: var(--size-px) solid var(--border);
  border-radius: var(--radius-base);
  color: var(--object-secondary);
  font-weight: var(--font-weight-semibold);
}
.shared-icon-grid button[data-icon-choice] {
  background: var(--background-surface);
  border: var(--size-px) solid var(--border);
  border-radius: var(--radius-base);
  box-shadow: none;
}
.icon-pack-tabs button[aria-selected=true],
.shared-icon-grid button[data-icon-choice][aria-pressed=true] {
  background: var(--background-interactive-muted);
  color: var(--object-interactive);
  border-color: var(--border-interactive);
  box-shadow: inset 0 0 0 var(--size-px) var(--border-interactive);
}

.invoice-visibility-options,
.feature-shortcut-settings .feature-shortcut-options {
  border: var(--size-px) solid var(--border);
  border-radius: var(--radius-lg);
}
.invoice-visibility-options > button,
.feature-shortcut-settings .feature-shortcut-option {
  min-height: var(--list-min-height);
  padding: var(--list-padding-y) var(--list-padding-x);
  font-weight: var(--font-weight-semibold);
  border-bottom-color: var(--border-muted);
}
.invoice-visibility-options > button:first-child,
.feature-shortcut-options > label:first-of-type { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.invoice-visibility-options > button:last-child,
.feature-shortcut-options > label:last-child { border-radius: 0 0 var(--radius-lg) var(--radius-lg); border-bottom: 0; }
.invoice-visibility-options > button[aria-pressed=true],
.feature-shortcut-options > label:has(input:checked) {
  color: var(--object-interactive);
  background: var(--background-interactive-muted);
}
.undo-changes .card, .outbox-item,
.ledger-transfer-dialog :is(.card, .ledger-transfer-side) {
  padding: var(--card-padding);
  border: var(--size-px) solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--background-surface);
  box-shadow: none;
}
.outbox-item + .outbox-item { margin-top: var(--gap-2); }
.ledger-transfer-dialog .capital-summary-values strong {
  font-weight: var(--font-weight-bold);
  font-variant-numeric: tabular-nums;
}
dialog .dialog-body > input[type=file] {
  min-height: var(--field-height);
  background: var(--background-muted);
  border: var(--size-px) solid var(--border);
  border-radius: var(--field-radius);
  font: inherit;
}
dialog .dialog-body > input[type=file]::file-selector-button {
  padding: var(--gap-1) var(--gap-2);
  margin-inline-end: var(--gap-2);
  border: var(--size-px) solid var(--border);
  border-radius: var(--radius-base);
  background: var(--background-surface);
  color: var(--object-interactive);
  font: inherit;
  font-weight: var(--font-weight-semibold);
}
dialog .error:not(:empty) {
  color: var(--object-negative);
  background: var(--background-negative-muted);
  border-radius: var(--radius-base);
  font-weight: var(--font-weight-semibold);
}

/* Entry points share one solid icon-button treatment; their owners keep position. */
.app-footer > :is(.fab.invoice-entry-icon, .primary.tag-analysis-fab) {
  width: var(--control-height-base);
  min-width: var(--control-height-base);
  height: var(--control-height-base);
  min-height: var(--control-height-base);
  border: 0;
  border-radius: var(--rounded-4xl);
  background: var(--background-interactive);
  color: var(--object-on-interactive);
  box-shadow: var(--elevation-low);
  transform: none;
}
.app-footer > :is(.fab, .tag-analysis-fab)::after,
.more-feature-grid .more-feature::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: currentColor;
  opacity: 0;
}
@media (hover: hover) and (pointer: fine) {
  .app-footer > :is(.fab, .tag-analysis-fab):enabled:hover::after { opacity: var(--opacity-20); }
  .more-feature-grid .more-feature:enabled:hover::after { opacity: var(--opacity-5); }
}
.app-footer > :is(.fab, .tag-analysis-fab):enabled:active::after { opacity: var(--opacity-40); }
.more-feature-grid .more-feature:enabled:active::after { opacity: var(--opacity-10); }

.more-feature-grid .more-feature {
  padding: var(--card-padding);
  gap: var(--gap-2);
  background: var(--background-surface);
  color: var(--object-primary);
  border: var(--size-px) solid var(--border);
  border-radius: var(--radius-lg);
}
.more-feature-grid .settings-icon {
  width: var(--size-10);
  height: var(--size-10);
  border-radius: var(--rounded-circle);
  background: var(--background-accent-muted);
  color: var(--object-accent);
}
.more-feature-grid .more-feature > strong {
  font-size: var(--text-title-base-font-size);
  line-height: var(--text-title-base-line-height);
  font-weight: var(--font-weight-semibold);
}
.more-feature-grid .more-feature > small,
.more-panel .settings-list .settings-row small {
  font-size: var(--text-caption-font-size);
  line-height: var(--text-caption-line-height);
  font-weight: var(--font-weight-normal);
  color: var(--object-secondary);
}
.more-panel .settings-list.more-danger-zone { border-color: var(--border-negative); }
.settings-row .admin-switch {
  display: flex;
  align-items: center;
  width: var(--switch-width);
  height: var(--switch-height);
  flex: 0 0 var(--switch-width);
  border: var(--size-0-5) solid var(--border);
  border-radius: var(--rounded-circle);
  background: var(--background-surface);
  padding: 0 var(--gap-1-5);
}
.admin-switch-thumb {
  display: grid;
  place-items: center;
  width: var(--switch-handle-off);
  height: var(--switch-handle-off);
  background: var(--object-secondary);
  border-radius: var(--rounded-circle);
}
.settings-row[aria-checked=true] .admin-switch {
  justify-content: flex-end;
  padding-inline: var(--gap-0-5);
  border: 0;
  background: var(--background-interactive);
}
.settings-row[aria-checked=true] .admin-switch-thumb {
  width: var(--switch-handle-on);
  height: var(--switch-handle-on);
  color: var(--object-interactive);
  background: var(--background-surface);
}
.admin-switch-thumb .app-icon { width: var(--switch-handle-icon); height: var(--switch-handle-icon); color: inherit; }

/* History views, report filters and period dialogs use the same selection
   language. Embedded compact segments retain their host's type and height. */
:is(dialog[open], .feature-screen) .segment {
  padding: var(--gap-1);
  gap: var(--gap-0-5);
  border-radius: var(--radius-lg);
  background: var(--background-emphasized);
}
:is(dialog[open], .feature-screen) .segment > button {
  position: relative;
  border-radius: var(--radius-base);
  background: var(--background-transparent);
  color: var(--object-secondary);
  font-weight: var(--font-weight-semibold);
}
:is(dialog[open], .feature-screen) .segment > button:is(.active, [aria-pressed=true]) {
  color: var(--object-primary);
  background: var(--background-surface);
  box-shadow: var(--elevation-low);
  font-weight: var(--font-weight-bold);
}
:is(dialog[open], .feature-screen) .segment > button::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: var(--object-primary);
  opacity: 0;
}
@media (hover: hover) and (pointer: fine) {
  :is(dialog[open], .feature-screen) .segment > button:enabled:hover::after { opacity: var(--opacity-5); }
}
:is(dialog[open], .feature-screen) .segment > button:enabled:active::after { opacity: var(--opacity-10); }

/* Keep reorder handles, swipe backplanes and user-assigned icons in place. */
:is(.metadata-manager, .ledger-manager, .category-reference, .wallet-dialog)
  :is(.metadata-open, .ledger-open, .category-item-open, .organizer-edit) {
  min-height: var(--list-min-height);
  padding-block: var(--gap-2);
  color: var(--ink);
  font-size: var(--text-body-font-size);
  line-height: var(--text-body-line-height);
}
:is(.metadata-open, .ledger-open, .category-item-open, .organizer-edit) small {
  color: var(--object-secondary);
  font-size: var(--text-caption-font-size);
  line-height: var(--text-caption-line-height);
}
:is(.metadata-open, .ledger-open, .category-item-open) :is(.metadata-symbol, .ledger-symbol, .category-symbol) {
  border-radius: var(--rounded-circle);
}
dialog .backup-counts {
  background: var(--background-subtle);
  padding: var(--card-padding);
  border-radius: var(--radius-lg);
}
.tag-analysis-dialog .tag-analysis-summary,
.entity-history .entity-summary,
.fx-controls {
  padding: var(--card-padding);
  background: var(--background-surface);
  border: var(--size-px) solid var(--border);
  border-radius: var(--radius-lg);
}
.tag-analysis-summary strong, .entity-summary .net {
  font-variant-numeric: tabular-nums;
  font-size: var(--text-heading-base-font-size);
  line-height: var(--text-heading-base-line-height);
}
.tag-ranking .tag-comparison-scale {
  background: var(--background-subtle);
  color: var(--object-secondary);
  font-size: var(--text-caption-font-size);
  line-height: var(--text-caption-line-height);
}
#toast {
  background: var(--background-inverted);
  color: var(--object-primary-inverted);
  border-radius: var(--radius-base);
  box-shadow: var(--elevation-medium);
  padding: var(--gap-3) var(--gap-4);
  font-size: var(--text-body-font-size);
  line-height: var(--text-body-line-height);
  font-weight: var(--font-weight-normal);
  overflow-wrap: anywhere;
}
