/* === Accent color override === */
:root {
    --accent-bg-color: #3a944a;
    --accent-color: #3a944a;
    --income-color: #2ec27e;
    --expense-color: #d4434e;
}

@media (prefers-color-scheme: dark) {
    :root {
        --income-color: #57e389;
        --expense-color: #f25d64;
    }
}

/* === Heading typography (Space Grotesk) === */
headerbar .title {
    font-family: "Space Grotesk", system-ui, sans-serif;
    font-weight: 600;
}

.sidebar-label {
    font-family: "Space Grotesk", system-ui, sans-serif;
    font-weight: 500;
    font-size: 14px;
}

/* === Section group titles (uppercase overline) === */
.section-overline,
preferencesgroup > box > clamp > box > box > label.title {
    font-family: "Space Grotesk", system-ui, sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 3px;
    opacity: 0.75;
}

/* === Month navigation (split treatment) === */
.month-nav {
    font-size: 24px;
}

.month-nav-label {
    font-family: "Space Grotesk", system-ui, sans-serif;
    font-size: 18px;
    font-weight: 600;
}

/* === Chart frame titles === */
.chart-title {
    font-family: "Space Grotesk", system-ui, sans-serif;
    font-size: 16px;
    font-weight: 600;
}

/* === Amount typography === */
.amount-display {
    font-family: "JetBrains Mono", monospace;
    font-feature-settings: "tnum" 1;
    letter-spacing: -0.3px;
}

.amount-hero {
    font-family: "JetBrains Mono", monospace;
    font-size: 76px;
    font-weight: 800;
    font-feature-settings: "tnum" 1;
    letter-spacing: -1px;
    border: none;
    box-shadow: none;
    background: transparent;
}

.amount-hero:focus {
    border: none;
    box-shadow: none;
    outline: none;
}

/* === Currency symbol next to hero amount === */
.currency-symbol {
    font-family: "Space Grotesk", system-ui, sans-serif;
    font-size: 44px;
    font-weight: 300;
    opacity: 0.60;
}

/* === Number keypad === */
.numpad-grid button {
    min-width: 72px;
    min-height: 56px;
    font-family: "JetBrains Mono", monospace;
    font-size: 22px;
    font-weight: 600;
    border-radius: 12px;
    transition: background-color 100ms ease;
}

.numpad-grid button.destructive-action {
    font-size: 18px;
}

.numpad-grid button.numpad-op {
    font-size: 20px;
    opacity: 0.85;
}

.numpad-grid button.suggested-action {
    font-size: 18px;
}

.amount-income {
    color: var(--income-color);
}

.amount-expense {
    color: var(--expense-color);
}

/* === Summary cards === */
.summary-card {
    padding: 14px 18px;
    border-radius: 12px;
    background-color: var(--card-bg-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: dark) {
    .summary-card {
        box-shadow: none;
    }
}

.summary-card-label {
    font-family: "Space Grotesk", system-ui, sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    opacity: 0.75;
}

.summary-card-amount {
    font-family: "JetBrains Mono", monospace;
    font-size: 24px;
    font-weight: 600;
    font-feature-settings: "tnum" 1;
}

/* === Sidebar refinements === */
list.navigation-sidebar > row {
    margin: 3px 8px;
    border-radius: 10px;
    padding: 4px 0;
    transition: background-color 150ms ease;
}

/* === Transaction rows in history === */
.transaction-card {
    border-radius: 12px;
    margin: 4px 0;
    padding: 4px 0;
    transition: background-color 150ms ease;
}

/* === Date headers (split day + date) === */
.date-header {
    font-family: "Space Grotesk", system-ui, sans-serif;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 2px;
    opacity: 0.75;
    padding: 24px 4px 2px 4px;
}

.date-header-detail {
    font-family: "Space Grotesk", system-ui, sans-serif;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.2px;
    padding: 0px 4px 10px 4px;
}

/* === Day net totals === */
.day-net {
    font-family: "JetBrains Mono", monospace;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: -0.2px;
    opacity: 0.75;
}

/* === Budget bars === */
levelbar > trough {
    border-radius: 6px;
    min-height: 10px;
}

levelbar > trough > block.filled {
    border-radius: 6px;
    background-color: var(--accent-bg-color);
}

levelbar.warning > trough > block.filled {
    background-color: var(--warning-bg-color);
}

levelbar.error > trough > block.filled {
    background-color: var(--error-bg-color);
}

/* === Buttons === */
button.suggested-action,
button.destructive-action {
    font-family: "Space Grotesk", system-ui, sans-serif;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: background-color 150ms ease, box-shadow 150ms ease;
}

button.pill {
    padding: 8px 24px;
}

/* === Interactive row hover === */
list > row.activatable {
    transition: background-color 100ms ease;
}

/* === Cards (general) === */
.card {
    transition: box-shadow 150ms ease;
}

/* === Icon picker === */
.icon-picker-grid > flowboxchild {
    padding: 2px;
}

.icon-picker-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 6px;
    border-radius: 8px;
}

/* === Save button emphasis === */
.save-button {
    padding: 12px 36px;
    font-weight: 600;
    font-size: 16px;
}

/* === Budget row typography === */
.budget-spent {
    font-family: "JetBrains Mono", monospace;
    font-size: 16px;
    font-weight: 700;
    font-feature-settings: "tnum" 1;
}

.budget-remaining {
    font-family: "JetBrains Mono", monospace;
    font-size: 13px;
    font-weight: 500;
    font-feature-settings: "tnum" 1;
    opacity: 0.75;
}

.budget-total {
    font-family: "JetBrains Mono", monospace;
    font-size: 13px;
    font-weight: 400;
    font-feature-settings: "tnum" 1;
    opacity: 0.75;
}

/* === Sidebar section labels === */
.sidebar-section-label {
    font-family: "Space Grotesk", system-ui, sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2.5px;
    opacity: 0.75;
    padding: 12px 16px 4px 16px;
}

/* === General spacing helpers === */
.spacious-group {
    margin-top: 8px;
    margin-bottom: 8px;
}

/* === View heading (for section titles inside views) === */
.view-heading {
    font-family: "Space Grotesk", system-ui, sans-serif;
    font-size: 18px;
    font-weight: 600;
}

/* === Receipt attachment drop zone === */
.attach-drop-zone {
    min-height: 80px;
    border: 1px dashed alpha(currentColor, 0.15);
    border-radius: 12px;
}

.attach-drop-zone:hover {
    border-color: alpha(currentColor, 0.3);
    background: alpha(currentColor, 0.03);
}

.attach-thumbnail {
    border-radius: 12px;
    background: alpha(currentColor, 0.05);
}

/* === Type toggle buttons === */
.type-toggle button {
    padding: 8px 24px;
    font-family: "Space Grotesk", system-ui, sans-serif;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: background-color 150ms ease;
}

/* === 7.3 High contrast mode compatibility === */
@media (prefers-contrast: more) {
    .date-header,
    .summary-card-label,
    .day-net,
    .section-overline,
    preferencesgroup > box > clamp > box > box > label.title,
    .sidebar-section-label,
    .budget-remaining,
    .budget-total {
        opacity: 1.0;
    }

    .currency-symbol {
        opacity: 1.0;
    }
}

/* === 7.4 Reduced motion support === */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.001ms !important;
        animation-duration: 0.001ms !important;
    }
}

/* === 7.5 Focus ring visibility === */
button:focus-visible,
row:focus-visible,
flowboxchild:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: -2px;
}
