/* The CalTransact panel's screens, in the app's own design units. .popover is a
   container whose width is the panel's 332 design px, so --u = one design
   pixel: a 12pt label is calc(12 * var(--u)) at every mockup size. Colours and
   measures are ported from the app's Tokens.swift. */

.app {
    --u: 0.3012cqw;
    height: 100%;
    display: flex;
    flex-direction: column;
    color: var(--text-primary);
    font-size: calc(12 * var(--u));
}

.route {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    animation: route-in 200ms ease;
}

/* The tracker's screens fill the panel above the bottom bar. */
.app-main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.app-main .route {
    flex: 1;
}

/* MenuBarPanelView's bottom bar: icon, the app's name, and the panel's
   controls. The demo's copies are dressing, sized to the real one. */
.panel-footer {
    display: flex;
    align-items: center;
    gap: calc(8 * var(--u));
    padding: calc(8 * var(--u)) calc(12 * var(--u));
    flex: none;
}

.panel-footer-icon {
    width: calc(18 * var(--u));
    height: calc(18 * var(--u));
    border-radius: calc(4 * var(--u));
}

.panel-footer-name {
    font-size: calc(12 * var(--u));
    font-weight: 500;
}

.icon-button.is-footer {
    width: calc(22 * var(--u));
    height: calc(22 * var(--u));
    cursor: default;
}

.icon-button.has-dot {
    position: relative;
}

/* The budget warning dot: plain red, no notification — the owner's choice. */
.hdr-dot {
    position: absolute;
    top: calc(2 * var(--u));
    right: calc(2 * var(--u));
    width: calc(6 * var(--u));
    height: calc(6 * var(--u));
    border-radius: 50%;
    background: var(--accent-red);
}

/* The day header's person filter chip, in its resting "All" state. */
.person-chip {
    display: inline-flex;
    align-items: center;
    gap: calc(4 * var(--u));
    margin-right: calc(6 * var(--u));
    padding: calc(4 * var(--u)) calc(8 * var(--u));
    border-radius: calc(7 * var(--u));
    background: var(--fill-field);
    color: var(--text-secondary);
    font-size: calc(11 * var(--u));
    font-weight: 500;
}

@keyframes route-in {
    from { opacity: 0; transform: translateX(3cqw); }
    to { opacity: 1; transform: none; }
}

.divider {
    height: 1px;
    background: var(--divider);
    flex: none;
}

/* ---------- shared chrome ---------- */

.screen-header {
    display: flex;
    align-items: center;
    padding: calc(10 * var(--u)) calc(12 * var(--u));
    flex: none;
}

.screen-header-title {
    font-size: calc(13 * var(--u));
    font-weight: 600;
}

.screen-header-twin {
    visibility: hidden;
}

.header-spacer,
.list-row-spacer {
    flex: 1;
    min-width: calc(4 * var(--u));
}

.back-button {
    display: inline-flex;
    align-items: center;
    border: 0;
    background: none;
    color: var(--text-primary);
    padding: 0;
    cursor: pointer;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: calc(24 * var(--u));
    height: calc(24 * var(--u));
    border: 0;
    border-radius: calc(6 * var(--u));
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    flex: none;
}

.icon-button:hover {
    background: var(--row-hover);
    color: var(--text-primary);
}

.icon-button.is-accented {
    color: var(--accent-blue);
}

.icon-button.is-danger {
    color: var(--accent-red);
}

.icon-button.is-danger .delete-label {
    display: none;
}

.icon-button.is-danger.is-armed {
    background: var(--accent-red);
    color: #fff;
    border-radius: calc(14 * var(--u));
    padding: 0 calc(9 * var(--u));
    font-size: calc(11 * var(--u));
    font-weight: 600;
}

.icon-button.is-danger.is-armed .delete-label {
    display: inline;
}

.icon-button.is-danger.is-armed svg {
    display: none;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: calc(4 * var(--u));
    border: 0;
    border-radius: calc(7 * var(--u));
    font-size: calc(12 * var(--u));
    font-weight: 500;
    padding: calc(6 * var(--u)) calc(14 * var(--u));
    cursor: pointer;
    color: #fff;
    white-space: nowrap;
}

.btn-small {
    font-size: calc(11 * var(--u));
    padding: calc(4 * var(--u)) calc(10 * var(--u));
}

.btn-secondary {
    background: var(--fill-field);
    border: 1px solid var(--border-chip);
}

.btn-secondary:hover {
    background: var(--row-hover);
}

.btn-primary {
    background: linear-gradient(180deg, color-mix(in srgb, var(--tint, var(--accent-blue)) 82%, #fff), var(--tint, var(--accent-blue)));
    color: #fff;
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: default;
}

.section-title {
    font-size: calc(10 * var(--u));
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: calc(6 * var(--u));
}

.quiet-note {
    font-size: calc(11 * var(--u));
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ---------- calendar ---------- */

.month-header {
    display: flex;
    align-items: center;
    gap: calc(4 * var(--u));
    padding: calc(10 * var(--u)) calc(12 * var(--u)) calc(6 * var(--u));
    flex: none;
}

.month-title {
    font-size: calc(13 * var(--u));
    font-weight: 600;
}

.calendar {
    padding: 0 calc(26 * var(--u));
    flex: none;
}

.weekday-row {
    display: flex;
    height: calc(16 * var(--u));
}

.weekday-letter {
    flex: 1;
    text-align: center;
    font-size: calc(9 * var(--u));
    font-weight: 500;
    color: var(--text-muted);
}

.cal-row {
    display: flex;
    height: calc(34 * var(--u));
}

.cal-cell {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 0;
    background: none;
    padding: 0;
    cursor: pointer;
    color: var(--text-primary);
    font-family: inherit;
}

.cal-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(22 * var(--u));
    height: calc(22 * var(--u));
    border-radius: 50%;
    font-size: calc(11 * var(--u));
}

.cal-cell.is-muted {
    color: var(--text-muted);
}

.cal-cell.is-today .cal-number {
    color: var(--accent-blue);
    font-weight: 600;
    box-shadow: inset 0 0 0 calc(1.5 * var(--u)) var(--accent-blue);
}

.cal-cell.is-selected .cal-number {
    background: var(--accent-blue);
    color: #fff;
    font-weight: 600;
}

.cal-dots {
    display: flex;
    gap: calc(3 * var(--u));
    height: calc(4 * var(--u));
    margin-top: calc(1 * var(--u));
}

.dot {
    width: calc(4 * var(--u));
    height: calc(4 * var(--u));
    border-radius: 50%;
}

.dot-income { background: var(--accent-green); }
.dot-expense { background: var(--accent-red); }

.day-section {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.day-title-row {
    display: flex;
    align-items: center;
    padding: calc(6 * var(--u)) calc(16 * var(--u));
    flex: none;
}

.day-title {
    font-size: calc(12 * var(--u));
    font-weight: 600;
}

.day-totals {
    display: flex;
    gap: calc(6 * var(--u));
    align-items: center;
    padding: 0 calc(16 * var(--u)) calc(4 * var(--u));
    flex: none;
}

.total-expense {
    font-size: calc(11 * var(--u));
    font-weight: 500;
    color: var(--accent-red);
}

.total-income {
    font-size: calc(11 * var(--u));
    font-weight: 500;
    color: var(--accent-green);
}

.day-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: calc(4 * var(--u)) calc(2 * var(--u)) calc(6 * var(--u));
    scrollbar-width: none;
}

.day-list::-webkit-scrollbar {
    display: none;
}

.empty-state {
    flex: 1;
    min-height: calc(120 * var(--u));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: calc(8 * var(--u));
    color: var(--text-muted);
    font-size: calc(11 * var(--u));
}

.empty-state span:last-child {
    color: var(--text-secondary);
}

.month-footer {
    padding: calc(8 * var(--u)) calc(12 * var(--u));
    flex: none;
}

.footer-controls {
    display: flex;
    align-items: center;
    margin-bottom: calc(4 * var(--u));
}

.footer-select,
.text-input,
.segment {
    font-family: inherit;
}

.footer-select {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    background: var(--fill-field);
    border-radius: calc(7 * var(--u));
    color: var(--text-secondary);
    font-size: calc(11 * var(--u));
    padding: calc(4 * var(--u)) calc(14 * var(--u)) calc(4 * var(--u)) calc(8 * var(--u));
    background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position: calc(100% - 10 * var(--u)) 55%, calc(100% - 6 * var(--u)) 55%;
    background-size: calc(4 * var(--u)) calc(4 * var(--u));
    background-repeat: no-repeat;
    cursor: pointer;
}

.footer-select:hover {
    color: #fff;
}

.footer-select option {
    background: #1c1e24;
    color: #fff;
}

.popover[data-mode="light"] .footer-select option {
    background: #ffffff;
    color: #111111;
}

.summary-cells,
.report-stats {
    display: flex;
}

.summary-cell {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: calc(2 * var(--u));
    align-items: center;
    min-width: 0;
}

.summary-title {
    font-size: calc(10 * var(--u));
    color: var(--text-secondary);
}

.summary-value {
    font-size: calc(12 * var(--u));
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.value-income {
    color: var(--accent-green);
}

.summary-cell.is-bold .summary-value {
    font-weight: 700;
}

/* ---------- rows ---------- */

.list-row {
    display: flex;
    align-items: center;
    gap: calc(10 * var(--u));
    height: calc(44 * var(--u));
    padding: 0 calc(14 * var(--u));
    border-radius: calc(6 * var(--u));
}

.list-row.is-compact {
    height: calc(30 * var(--u));
}

.list-row:hover {
    background: var(--row-hover);
}

.list-row.is-tappable {
    cursor: pointer;
}

.list-row-text {
    min-width: 0;
}

.list-row-title {
    font-size: calc(12 * var(--u));
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-row-subtitle {
    font-size: calc(10 * var(--u));
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tinted-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: calc(28 * var(--u));
    height: calc(28 * var(--u));
    border-radius: 50%;
    color: var(--tint, var(--text-secondary));
    background: color-mix(in srgb, var(--tint, #868E96) 15%, transparent);
    font-size: calc(12 * var(--u));
    flex: none;
}

.tx-amount {
    font-size: calc(12 * var(--u));
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.tx-income { color: var(--accent-green); }
.tx-expense { color: var(--accent-red); }
.tx-transfer { color: var(--accent-blue); }

.search-amount {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: calc(1 * var(--u));
}

.search-date {
    font-size: calc(10 * var(--u));
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* ---------- chips ---------- */

.chip-flow {
    display: flex;
    flex-wrap: wrap;
    gap: calc(6 * var(--u));
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: calc(4 * var(--u));
    border: 0;
    border-radius: calc(8 * var(--u));
    padding: calc(5 * var(--u)) calc(9 * var(--u));
    font-size: calc(11 * var(--u));
    background: color-mix(in srgb, var(--chip) 10%, transparent);
    color: var(--chip);
    cursor: pointer;
    font-family: inherit;
}

.chip:hover {
    background: color-mix(in srgb, var(--chip) 18%, transparent);
}

.chip-pill {
    border-radius: calc(14 * var(--u));
}

.chip.is-selected {
    background: var(--chip-selected);
    color: var(--chip-on);
}

.chip-dot {
    width: calc(6 * var(--u));
    height: calc(6 * var(--u));
    border-radius: 50%;
    background: var(--chip);
    flex: none;
}

.chip.is-selected .chip-dot {
    background: var(--chip-on);
}

.chip-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: calc(14 * var(--u));
    height: calc(14 * var(--u));
    border-radius: 50%;
    font-size: calc(8 * var(--u));
    font-weight: 600;
    background: color-mix(in srgb, var(--chip) 20%, transparent);
    flex: none;
}

.chip.is-selected .chip-avatar {
    background: rgba(255, 255, 255, 0.25);
}

.chip-label {
    line-height: 1.2;
    white-space: nowrap;
}

/* ---------- editor ---------- */

.editor-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: calc(12 * var(--u)) calc(16 * var(--u));
    display: flex;
    flex-direction: column;
    gap: calc(14 * var(--u));
    scrollbar-width: none;
}

.editor-scroll::-webkit-scrollbar {
    display: none;
}

.segmented {
    display: flex;
    height: calc(30 * var(--u));
    border-radius: calc(9 * var(--u));
    background: var(--fill-subtle);
    padding: calc(2 * var(--u));
    gap: calc(2 * var(--u));
    flex: none;
}

.segment {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: calc(6 * var(--u));
    border: 0;
    border-radius: calc(7 * var(--u));
    background: none;
    color: var(--text-secondary);
    font-size: calc(12 * var(--u));
    font-weight: 500;
    cursor: pointer;
}

.segment.is-selected {
    background: linear-gradient(180deg, color-mix(in srgb, var(--tint, var(--accent-blue)) 82%, #fff), var(--tint, var(--accent-blue)));
    color: #fff;
    font-weight: 600;
}

.segmented.is-small {
    height: calc(24 * var(--u));
    display: inline-flex;
    width: auto;
}

.segmented.is-small .segment {
    font-size: calc(11 * var(--u));
    padding: 0 calc(12 * var(--u));
}

.amount-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: calc(10 * var(--u)) 0;
    flex: none;
}

.amount-code {
    font-size: calc(10 * var(--u));
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: calc(2 * var(--u));
}

.amount-line {
    display: flex;
    align-items: center;
    gap: calc(4 * var(--u));
}

.amount-symbol {
    font-size: calc(20 * var(--u));
    font-weight: 600;
    color: var(--text-secondary);
}

.amount-symbol.ghost {
    visibility: hidden;
}

.amount-input {
    width: calc(130 * var(--u));
    border: 0;
    background: none;
    color: var(--text-primary);
    font-size: calc(34 * var(--u));
    font-weight: 700;
    text-align: center;
    font-family: inherit;
    outline: none;
}

.amount-input.is-invalid {
    color: var(--accent-red);
}

.amount-caption {
    font-size: calc(10 * var(--u));
    color: var(--text-secondary);
    margin-top: calc(2 * var(--u));
}

.editor-row {
    display: flex;
    align-items: center;
    gap: calc(8 * var(--u));
    padding: calc(7 * var(--u)) calc(16 * var(--u));
    background: var(--fill-field);
    border-radius: calc(12 * var(--u));
    flex: none;
}

.editor-row-icon {
    display: inline-flex;
    width: calc(18 * var(--u));
    color: var(--text-secondary);
    flex: none;
}

.text-input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: none;
    color: var(--text-primary);
    font-size: calc(13 * var(--u));
    outline: none;
    font-family: inherit;
}

.text-input::placeholder {
    color: var(--text-muted);
}

.text-input.is-narrow {
    flex: none;
    width: calc(90 * var(--u));
}

.text-input.is-date {
    color-scheme: dark;
}

.popover[data-mode="light"] .text-input.is-date {
    color-scheme: light;
}

.date-row {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.date-weekday {
    font-size: calc(11 * var(--u));
    color: var(--text-secondary);
}

.editor-section {
    flex: none;
}

.inline-form {
    display: flex;
    gap: calc(6 * var(--u));
    align-items: center;
    padding: calc(8 * var(--u)) calc(14 * var(--u));
    background: var(--fill-field);
    border-radius: calc(12 * var(--u));
}

.editor-footer {
    display: flex;
    align-items: center;
    gap: calc(8 * var(--u));
    padding: calc(10 * var(--u)) calc(16 * var(--u));
    flex: none;
}

.validation-hint {
    font-size: calc(10 * var(--u));
    color: var(--text-muted);
    flex: 1;
    line-height: 1.3;
}

/* ---------- search ---------- */

.search-header {
    display: flex;
    align-items: center;
    gap: calc(6 * var(--u));
    padding: calc(10 * var(--u)) calc(12 * var(--u)) 0;
    flex: none;
}

.search-field {
    flex: 1;
    display: flex;
    align-items: center;
    gap: calc(4 * var(--u));
    padding: calc(5 * var(--u)) calc(8 * var(--u));
    background: var(--fill-field);
    border-radius: calc(8 * var(--u));
    color: var(--text-secondary);
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: calc(8 * var(--u));
    padding: calc(12 * var(--u)) calc(12 * var(--u)) calc(6 * var(--u));
    flex: none;
}

.filter-bar .footer-select,
.filter-bar .text-input {
    flex: 1;
    min-width: 0;
}

.amount-range {
    display: flex;
    align-items: center;
    gap: calc(6 * var(--u));
    flex: 1;
}

.range-dash {
    color: var(--text-secondary);
    font-size: calc(11 * var(--u));
}

/* ---------- manage and reports ---------- */

.manage-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: calc(4 * var(--u)) calc(16 * var(--u)) calc(16 * var(--u));
    scrollbar-width: none;
}

.manage-scroll::-webkit-scrollbar {
    display: none;
}

.manage-section {
    margin-bottom: calc(20 * var(--u));
}

.compact-row {
    display: flex;
    align-items: center;
    gap: calc(10 * var(--u));
    height: calc(30 * var(--u));
    padding: 0 calc(14 * var(--u));
    border-radius: calc(6 * var(--u));
}

.compact-row:hover {
    background: var(--row-hover);
}

.compact-row .icon-button {
    width: calc(20 * var(--u));
    height: calc(20 * var(--u));
}

.hue-dot {
    width: calc(6 * var(--u));
    height: calc(6 * var(--u));
    border-radius: 50%;
    background: var(--tint, #868E96);
    flex: none;
}

.compact-title {
    font-size: calc(12 * var(--u));
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compact-subtitle {
    font-size: calc(10 * var(--u));
    color: var(--text-muted);
    white-space: nowrap;
}

.compact-amount {
    font-size: calc(11 * var(--u));
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.budget-row {
    display: flex;
    align-items: center;
    gap: calc(8 * var(--u));
    margin-bottom: calc(4 * var(--u));
}

.budget-row .cat-bar {
    flex: 1;
    min-width: 0;
}

.budget-over {
    font-size: calc(10 * var(--u));
    font-weight: 600;
    color: var(--accent-red);
    flex: none;
}

.report-block {
    margin-bottom: calc(20 * var(--u));
}

.report-title {
    font-size: calc(13 * var(--u));
    font-weight: 600;
    margin-bottom: calc(10 * var(--u));
}

.chart-wrap {
    width: 100%;
}

.bar-chart {
    width: 100%;
    height: auto;
    display: block;
}

.bar-label {
    fill: var(--text-secondary);
    font-size: 9px;
}

/* ---------- manage screen (ManageView) ---------- */

.manage-section-title {
    font-size: calc(13 * var(--u));
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: calc(8 * var(--u));
}

.row-trailing {
    display: inline-flex;
    align-items: center;
    gap: calc(6 * var(--u));
}

.row-pencil {
    color: var(--text-muted);
    display: inline-flex;
}

.row-count {
    font-size: calc(10 * var(--u));
    color: var(--text-secondary);
}

.row-count.is-income {
    color: var(--accent-green);
}

.compact-amount.is-negative {
    color: var(--accent-red);
}

.compact-amount.is-income {
    color: var(--accent-green);
}

/* The app's inline form cards: labeled fields, actions right-aligned below. */
.form-card {
    background: var(--fill-subtle);
    border-radius: calc(12 * var(--u));
    padding: calc(14 * var(--u));
    display: flex;
    flex-direction: column;
    gap: calc(8 * var(--u));
}

.form-fields {
    display: flex;
    gap: calc(8 * var(--u));
    align-items: flex-end;
}

.form-fields > * {
    flex: 1;
    min-width: 0;
}

/* The rule card's armed delete rides the first fields row: it neither
   stretches (that rule above is unqualified) nor drops to the inputs' base —
   the card's top-right corner is where it lives, like the app's. */
.form-fields > .icon-button {
    flex: none;
    align-self: flex-start;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: calc(8 * var(--u));
}

/* The app's LabeledTextField: the label line floats in once the field holds
   text or focus; until then it doubles as the placeholder. */
.labeled-field {
    display: flex;
    flex-direction: column;
    gap: calc(3 * var(--u));
}

.labeled-field-label {
    font-size: calc(9 * var(--u));
    font-weight: 500;
    color: var(--text-muted);
    opacity: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.labeled-field.is-filled .labeled-field-label {
    opacity: 1;
}

.text-input.is-rounded {
    background: var(--fill-field);
    border: 1px solid var(--border-chip);
    border-radius: calc(6 * var(--u));
    padding: calc(4 * var(--u)) calc(8 * var(--u));
    font-size: calc(12 * var(--u));
}

.inline-form {
    display: flex;
    gap: calc(6 * var(--u));
    align-items: center;
}

.inline-form .text-input.is-rounded {
    flex: 1;
}

/* The edit card, in the account card's shape: name + cancel above, the
   carry-over checkbox beside the limit field and Save below. */
.budget-edit {
    display: flex;
    flex-direction: column;
    gap: calc(6 * var(--u));
    padding: calc(4 * var(--u)) calc(14 * var(--u));
}

.budget-edit-top {
    display: flex;
    align-items: center;
    gap: calc(6 * var(--u));
}

.budget-edit-name {
    font-size: calc(12 * var(--u));
    font-weight: 500;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.budget-edit-fields {
    display: flex;
    align-items: flex-end;
    gap: calc(6 * var(--u));
}

.carry-toggle {
    display: flex;
    align-items: center;
    gap: calc(5 * var(--u));
    font-size: calc(11 * var(--u));
    cursor: pointer;
    user-select: none;
}

.carry-toggle input {
    margin: 0;
    accent-color: var(--accent-blue);
}

.budget-edit .labeled-field {
    flex: none;
    width: calc(110 * var(--u));
}

.new-budget {
    display: flex;
    flex-direction: column;
    gap: calc(6 * var(--u));
    margin-top: calc(8 * var(--u));
}

.manage-subtitle {
    font-size: calc(10 * var(--u));
    font-weight: 500;
    color: var(--text-secondary);
}

.quiet-note.is-spent:empty {
    display: none;
}

.quiet-note.is-spent {
    font-size: calc(10 * var(--u));
    padding: 0 calc(14 * var(--u));
    margin-top: calc(-2 * var(--u));
    margin-bottom: calc(2 * var(--u));
}

.data-grid {
    display: flex;
    gap: calc(6 * var(--u));
    margin-bottom: calc(20 * var(--u));
}

.data-grid .btn {
    flex: 1;
    justify-content: center;
}

.danger-rule {
    height: 1px;
    background: color-mix(in srgb, var(--accent-red) 25%, transparent);
}

.btn-danger {
    background: color-mix(in srgb, var(--accent-red) 14%, transparent);
    color: var(--accent-red);
    margin-top: calc(10 * var(--u));
}

.btn-danger:hover {
    background: color-mix(in srgb, var(--accent-red) 22%, transparent);
}

/* The panel's context menu — where the real app keeps Edit…, Pause, Delete. */
.context-menu {
    position: fixed;
    z-index: 1000;
    min-width: 170px;
    padding: 4px;
    border-radius: 9px;
    background: rgba(38, 40, 46, 0.96);
    -webkit-backdrop-filter: blur(18px) saturate(1.5);
    backdrop-filter: blur(18px) saturate(1.5);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.context-item {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: none;
    color: rgba(255, 255, 255, 0.92);
    font-size: 13px;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-family: inherit;
}

.context-item:hover {
    background: var(--accent-blue);
    color: #fff;
}

.context-item.is-danger {
    color: #ff6961;
}

.context-item.is-danger:hover {
    background: var(--accent-red);
    color: #fff;
}

/* The app's CategoryProgressBar: label, dot and amount over a capsule track,
   the fill carrying the category's hue. (--bar is set inline per row.) */
.cat-bar {
    display: flex;
    flex-direction: column;
    gap: calc(4 * var(--u));
    padding: calc(3 * var(--u)) 0;
}

.cat-bar-head {
    display: flex;
    align-items: center;
    gap: calc(6 * var(--u));
}

.cat-bar-dot {
    width: calc(6 * var(--u));
    height: calc(6 * var(--u));
    border-radius: 50%;
    background: var(--bar, #868E96);
    flex: none;
}

.cat-bar-label {
    font-size: calc(12 * var(--u));
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cat-bar-amount {
    font-size: calc(11 * var(--u));
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--text-primary);
}

.cat-bar-percent {
    font-size: calc(11 * var(--u));
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.cat-bar-track {
    height: calc(8 * var(--u));
    border-radius: calc(4 * var(--u));
    background: var(--bar-track);
    overflow: hidden;
}

.cat-bar-fill {
    height: 100%;
    border-radius: calc(4 * var(--u));
    background: var(--bar, #868E96);
}

.panel-footer button.icon-button.is-footer {
    cursor: pointer;
}

/* ---------- budgets screen (BudgetsView) ---------- */

.budgets-scroll {
    display: flex;
    flex-direction: column;
    gap: calc(12 * var(--u));
    padding-top: calc(16 * var(--u));
}

.budget-block {
    display: flex;
    flex-direction: column;
    gap: calc(4 * var(--u));
    padding: calc(4 * var(--u)) 0;
}

.budget-note {
    font-size: calc(10 * var(--u));
    color: var(--text-muted);
}

.budget-note.is-over {
    color: var(--accent-red);
    font-weight: 500;
}

.budgets-empty .empty-title {
    font-size: calc(12 * var(--u));
    font-weight: 500;
    color: var(--text-primary);
}
