@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("assets/fonts/InterVariable.woff2") format("woff2");
}

:root {
    --paper: oklch(96.5% 0.011 86);
    --paper-quiet: oklch(93.5% 0.013 84);
    --panel: oklch(97.5% 0.008 82);
    --panel-warm: oklch(94.8% 0.012 78);
    --ink: oklch(28% 0.006 84);
    --muted: oklch(48% 0.016 105);
    --line: oklch(78% 0.014 82);
    --hardware: oklch(75% 0.012 82);
    --hardware-dark: oklch(36% 0.01 84);
    --crt: oklch(61% 0.055 145);
    --blue: oklch(52% 0.094 256);
    --amber: oklch(75% 0.128 78);
    --red: oklch(57% 0.154 27);
    --shadow: 0 18px 44px oklch(28% 0.006 84 / 0.11);
    --inner-shadow: inset 0 1px 0 oklch(99% 0.006 82 / 0.82);
    --radius-sm: 6px;
    --radius-md: 8px;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-6: 24px;
    --space-8: 32px;
    --space-12: 48px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--paper);
    color: var(--ink);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

body {
    min-height: 100%;
    margin: 0;
    background:
        linear-gradient(180deg, oklch(98% 0.008 84), var(--paper) 34%, oklch(94.5% 0.015 92));
    color: var(--ink);
    font-size: 1rem;
    line-height: 1.5;
    overflow-x: hidden;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    border: 0;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 3px solid oklch(74% 0.12 238);
    outline-offset: 3px;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select,
textarea {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    border: 1px solid oklch(72% 0.014 82);
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, oklch(98.5% 0.008 82), oklch(94.5% 0.012 82));
    color: var(--ink);
    padding: 10px 12px;
    box-shadow: var(--inner-shadow);
    transition: border-color 160ms ease-out, background-color 160ms ease-out, box-shadow 160ms ease-out;
}

input[type="checkbox"],
input[type="radio"] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    margin: 0;
    padding: 0;
    accent-color: var(--blue);
    box-shadow: none;
}

select {
    appearance: none;
    background:
        linear-gradient(45deg, transparent 50%, var(--muted) 50%) right 16px center / 6px 6px no-repeat,
        linear-gradient(135deg, var(--muted) 50%, transparent 50%) right 10px center / 6px 6px no-repeat,
        linear-gradient(180deg, oklch(98.5% 0.008 82), oklch(94.5% 0.012 82));
    padding-right: 34px;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):hover,
select:hover,
textarea:hover {
    border-color: oklch(64% 0.026 105);
}

textarea {
    resize: vertical;
}

main:focus {
    outline: none;
}

label {
    display: grid;
    gap: var(--space-2);
    color: var(--muted);
    font-size: 0.875rem;
    font-weight: 700;
}

h1,
h2,
p {
    margin: 0;
}

h1 {
    max-width: 12ch;
    font-size: 2.75rem;
    line-height: 1.04;
    letter-spacing: 0;
}

h2 {
    font-size: 1.25rem;
    line-height: 1.2;
}

.page {
    min-height: 100vh;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-8);
    color: var(--muted);
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--ink);
    text-decoration: none;
}

.brand-mark img {
    width: 42px;
    height: 58px;
    object-fit: contain;
    image-rendering: auto;
}

.nav-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
}

.auth-shell,
.app-shell,
.create-account-shell,
.account-shell,
.help-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: var(--space-12);
    align-items: center;
    padding: 8vh 0 var(--space-8);
}

.narrow-auth-shell {
    grid-template-columns: minmax(0, 0.9fr) minmax(320px, 420px);
}

.create-account-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-8);
    align-items: start;
    padding: 4vh 0 var(--space-12);
}

.auth-shell > *,
.app-shell > *,
.create-account-shell > *,
.account-shell > *,
.help-shell > *,
.auth-panel,
.mode-panel,
.plan-card,
.child-editor,
.account-panel {
    min-width: 0;
}

.auth-copy {
    display: grid;
    gap: var(--space-6);
    min-width: 0;
}

.auth-primer {
    display: grid;
    gap: var(--space-3);
    max-width: 640px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.auth-primer li {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr);
    gap: var(--space-3);
    align-items: start;
    color: var(--muted);
}

.auth-primer li::before {
    width: 10px;
    height: 10px;
    margin-top: 0.42rem;
    border: 1px solid oklch(70% 0.065 145);
    border-radius: 50%;
    background: oklch(83% 0.05 145);
    content: "";
}

.auth-primer strong,
.auth-primer span {
    grid-column: 2;
}

.auth-primer strong {
    color: var(--ink);
    font-size: 0.98rem;
    line-height: 1.2;
}

.auth-primer span {
    margin-top: calc(var(--space-2) * -1);
}

.lead {
    max-width: min(58ch, 100%);
    color: var(--muted);
    font-size: 1.125rem;
    overflow-wrap: anywhere;
}

.eyebrow,
.data-label {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-panel,
.activity-panel,
.child-editor,
.account-panel,
.money-dashboard {
    border: 1px solid oklch(76% 0.014 82);
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, oklch(98% 0.008 82 / 0.95), oklch(95.8% 0.012 82 / 0.95));
    box-shadow: var(--shadow);
}

.auth-panel {
    display: grid;
    gap: var(--space-4);
    padding: var(--space-6);
}

.plan-selector,
.account-shell {
    display: grid;
    gap: var(--space-6);
}

.help-shell {
    display: grid;
    gap: var(--space-8);
    padding: 4vh 0 var(--space-12);
}

.help-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-8);
    align-items: end;
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--line);
}

.help-hero h1 {
    max-width: none;
}

.help-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    justify-content: flex-end;
}

.help-section {
    display: grid;
    gap: var(--space-4);
    max-width: 920px;
}

.help-copy {
    max-width: 72ch;
    color: var(--muted);
    font-size: 1.05rem;
}

.help-steps {
    display: grid;
    gap: var(--space-3);
    margin: 0;
    padding: 0;
    counter-reset: help-step;
    list-style: none;
}

.help-steps li {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    column-gap: var(--space-4);
    row-gap: var(--space-1);
    align-items: start;
    min-height: 58px;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--line);
    counter-increment: help-step;
}

.help-steps li::before {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid oklch(79% 0.035 145);
    border-radius: var(--radius-sm);
    background: oklch(92% 0.024 145);
    color: oklch(36% 0.055 145);
    content: counter(help-step);
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.help-steps strong,
.help-steps span {
    grid-column: 2;
}

.help-steps strong {
    color: var(--ink);
}

.help-steps span {
    color: var(--muted);
}

.faq-list {
    display: grid;
    border-top: 1px solid var(--line);
}

.faq-item {
    border-bottom: 1px solid var(--line);
}

.faq-item summary {
    min-height: 56px;
    cursor: pointer;
    color: var(--ink);
    padding: var(--space-4) 0;
    font-weight: 850;
}

.faq-item summary::marker {
    color: var(--blue);
}

.faq-item p {
    max-width: 76ch;
    color: var(--muted);
    padding: 0 0 var(--space-4) 1.25rem;
}

.inline-text-link {
    display: inline;
    min-height: 0;
}

.create-account-shell .section-heading {
    align-items: end;
}

.create-account-shell h1 {
    max-width: none;
}

.create-account-lead {
    margin-top: var(--space-3);
}

.plan-row {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.12fr) minmax(0, 0.9fr);
    gap: var(--space-4);
    align-items: center;
}

.plan-option {
    position: relative;
    display: grid;
    gap: var(--space-3);
    width: 100%;
    min-height: 330px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, oklch(98% 0.008 82), var(--panel-warm));
    color: var(--ink);
    padding: var(--space-6);
    text-align: left;
    box-shadow: var(--shadow);
}

.plan-option.selected {
    border-color: oklch(68% 0.11 153);
    background: oklch(97% 0.018 145);
    box-shadow:
        var(--shadow),
        0 0 0 3px oklch(68% 0.11 153),
        inset 0 0 0 1px oklch(99% 0.008 84);
}

.plan-option-featured {
    border-color: oklch(73% 0.08 153);
    background:
        linear-gradient(180deg, oklch(99% 0.01 84), oklch(96% 0.024 145));
    padding: var(--space-8);
    transform: translateY(-10px);
}

.plan-option-premium-monthly {
    background:
        linear-gradient(180deg, oklch(99% 0.008 84), oklch(94% 0.014 88));
}

.plan-option-featured:hover {
    transform: translateY(-12px);
}

.plan-option-featured b {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    border: 1px solid oklch(72% 0.09 153);
    border-radius: 999px;
    background: oklch(93% 0.04 153);
    color: oklch(34% 0.08 153);
    padding: 5px 9px;
    font-size: 0.74rem;
    line-height: 1;
    text-transform: uppercase;
}

.plan-option span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
}

.plan-option strong {
    font-size: 1.6rem;
    line-height: 1.1;
}

.plan-option-featured strong {
    font-size: 2rem;
}

.plan-option small {
    color: var(--muted);
    font-size: 0.95rem;
}

.plan-option ul {
    display: grid;
    gap: var(--space-2);
    margin: 0;
    padding-left: 1.1rem;
    color: var(--muted);
}

.billing-upgrade-form {
    gap: var(--space-3);
}

.billing-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
}

.billing-choice {
    display: grid;
    gap: var(--space-1);
    min-height: 104px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
    color: var(--ink);
    padding: var(--space-4);
    text-align: left;
    transition: transform 180ms ease-out, background-color 180ms ease-out, border-color 180ms ease-out;
}

.billing-choice.selected {
    border-color: oklch(68% 0.11 153);
    background: oklch(97% 0.018 145);
}

.billing-choice span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.billing-choice strong {
    font-size: 1.25rem;
    line-height: 1.15;
}

.billing-choice small {
    color: var(--muted);
    font-size: 0.9rem;
}

.account-form-panel {
    width: min(760px, 100%);
    justify-self: center;
}

.auth-form {
    display: grid;
    gap: var(--space-4);
}

.auth-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    justify-content: space-between;
}

.inline-form {
    display: grid;
    gap: var(--space-3);
}

.panel-heading,
.section-heading,
.child-editor-top,
.app-header,
.header-actions,
.action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
}

.action-row {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.panel-heading span,
.tier-badge {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: oklch(91% 0.02 145);
    color: var(--muted);
    padding: 6px 10px;
    font-size: 0.78rem;
    font-weight: 800;
}

.primary-action,
.secondary-action,
.ghost-action,
.text-action,
.danger-action,
.back-link,
.nav-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border-radius: var(--radius-sm);
    padding: 0 16px;
    cursor: pointer;
    font-weight: 800;
    transition: transform 180ms ease-out, background-color 180ms ease-out, border-color 180ms ease-out;
}

.nav-action {
    text-decoration: none;
}

.primary-action {
    background: var(--blue);
    color: oklch(98% 0.008 84);
    box-shadow: inset 0 -2px 0 oklch(37% 0.07 256 / 0.42);
}

.secondary-action,
.ghost-action,
.back-link {
    border: 1px solid var(--line);
    background: linear-gradient(180deg, oklch(98% 0.008 82), oklch(93.5% 0.012 82));
    color: var(--ink);
    box-shadow: var(--inner-shadow);
}

.text-action {
    background: transparent;
    color: var(--blue);
}

.text-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--blue);
    font-weight: 800;
    text-decoration: none;
}

.text-link:hover {
    text-decoration: underline;
}

.danger-action {
    border: 1px solid oklch(75% 0.08 28);
    background: oklch(96% 0.026 28);
    color: var(--red);
}

.compact {
    min-height: 38px;
}

button:not(:disabled):hover {
    transform: translateY(-1px);
}

.plan-option.plan-option-featured:not(:disabled):hover {
    transform: translateY(-12px);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.plans-strip {
    display: grid;
    width: min(900px, calc(100% - 32px));
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
    margin: 0 auto var(--space-8);
}

.plan-card,
.mode-panel {
    display: grid;
    gap: var(--space-3);
    min-height: 170px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, oklch(98% 0.008 82), var(--panel-warm));
    color: var(--ink);
    padding: var(--space-6);
    text-align: left;
    box-shadow: var(--shadow);
}

.plan-card span,
.mode-panel span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
}

.plan-card strong,
.mode-panel strong {
    font-size: 1.65rem;
    line-height: 1.1;
}

.plan-card small,
.mode-panel small {
    color: var(--muted);
    font-size: 0.95rem;
}

.plan-card-paid {
    border-color: oklch(73% 0.08 153);
}

.app-shell {
    display: grid;
    gap: var(--space-8);
    padding: var(--space-4) 0 var(--space-12);
}

.app-header {
    align-items: flex-start;
}

.app-header h1 {
    max-width: none;
    font-size: 2.25rem;
}

.mode-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-6);
}

.parent-mode {
    border-color: oklch(80% 0.05 238);
}

.atm-mode {
    border-color: oklch(79% 0.05 153);
    background:
        linear-gradient(180deg, oklch(99% 0.008 84), oklch(97% 0.012 110));
}

.atm-mode span::after {
    content: " ATM";
    color: var(--crt);
}

.summary-band {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, oklch(98% 0.008 82), var(--panel-warm));
    padding: var(--space-6);
}

.summary-band div {
    display: grid;
    gap: var(--space-1);
}

.metric-label-with-info {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.label-with-info {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.info-tooltip {
    position: relative;
    display: inline-grid;
    width: 20px;
    height: 20px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--paper);
    color: var(--blue);
    cursor: help;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: none;
}

.info-tooltip::after {
    position: absolute;
    z-index: 5;
    bottom: calc(100% + 8px);
    left: 50%;
    width: min(260px, 70vw);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--ink);
    color: var(--paper);
    content: attr(aria-label);
    opacity: 0;
    padding: var(--space-3);
    pointer-events: none;
    text-align: left;
    text-transform: none;
    transform: translate(-50%, 4px);
    transition: opacity 160ms ease-out, transform 160ms ease-out;
}

.info-tooltip:hover::after,
.info-tooltip:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

.summary-band strong,
.balance-card,
.amount-display,
.pin-display,
.money-table td,
.money-table tfoot {
    font-variant-numeric: tabular-nums;
}

.money-dashboard {
    display: grid;
    gap: var(--space-4);
    padding: var(--space-6);
}

.money-table {
    width: 100%;
    border-collapse: collapse;
}

.money-table th,
.money-table td {
    border-bottom: 1px solid var(--line);
    padding: var(--space-3);
    text-align: right;
}

.money-table th:first-child,
.money-table td:first-child {
    text-align: left;
}

.money-table thead th,
.money-table tfoot th,
.money-table tfoot td {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 850;
    text-transform: uppercase;
}

.row-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 36px;
    background: transparent;
    color: var(--ink);
    padding: 0;
    text-align: left;
    font-weight: 850;
}

.row-expander {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--paper);
}

.kid-avatar {
    --avatar-size: 40px;
    --avatar-inset: 5px;
    --avatar-grid-columns: 10;
    --avatar-grid-rows: 2;
    --avatar-cell-size: calc(var(--avatar-size) - (var(--avatar-inset) * 2));
    display: inline-block;
    width: var(--avatar-size);
    height: var(--avatar-size);
    min-width: var(--avatar-size);
    min-height: var(--avatar-size);
    aspect-ratio: 1;
    flex: 0 0 var(--avatar-size);
    overflow: hidden;
    border: 1px solid oklch(82% 0.018 145);
    border-radius: 50%;
    padding: var(--avatar-inset);
    background-color: oklch(91% 0.018 145);
    background-image: url("assets/images/kid-avatars.png");
    background-position:
        calc(var(--avatar-column) * var(--avatar-cell-size) * -1)
        calc(var(--avatar-row) * var(--avatar-cell-size) * -1);
    background-repeat: no-repeat;
    background-origin: content-box;
    background-clip: content-box;
    background-size:
        calc(var(--avatar-cell-size) * var(--avatar-grid-columns))
        calc(var(--avatar-cell-size) * var(--avatar-grid-rows));
    box-shadow:
        inset 0 0 0 2px oklch(96% 0.012 145 / 0.78),
        0 1px 2px oklch(28% 0.006 84 / 0.09);
    image-rendering: pixelated;
}

.kid-avatar-small {
    --avatar-size: 44px;
    --avatar-inset: 6px;
}

.kid-avatar-large {
    --avatar-size: 72px;
    --avatar-inset: 8px;
}

.kid-avatar-picker {
    --avatar-size: 52px;
    --avatar-inset: 6px;
}

.kid-avatar-crt {
    --avatar-size: 32px;
    --avatar-inset: 3px;
    border-color: oklch(68% 0.045 145);
    background-color: oklch(70% 0.045 145 / 0.36);
    box-shadow: none;
    filter: sepia(0.12) saturate(0.8);
}

.history-row td {
    background: var(--paper);
    padding: var(--space-4);
}

.money-chart {
    display: grid;
    gap: var(--space-3);
}

.money-chart svg {
    width: 100%;
    height: 210px;
}

.chart-axis {
    stroke: var(--line);
    stroke-width: 2;
}

.chart-line {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chart-line.spending,
.legend-dot.spending {
    stroke: var(--blue);
    background: var(--blue);
}

.chart-line.savings,
.legend-dot.savings {
    stroke: var(--crt);
    background: var(--crt);
}

.chart-line.total,
.legend-dot.total {
    stroke: var(--amber);
    background: var(--amber);
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 800;
}

.chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.manage-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    gap: var(--space-6);
    align-items: start;
}

.manage-main {
    display: grid;
    gap: var(--space-6);
}

.rules-grid,
.child-fields,
.override-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: var(--space-4);
}

.rules-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.allowance-rule-panel {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, oklch(98.5% 0.008 82), oklch(96.4% 0.01 82));
    box-shadow: var(--shadow);
}

.rule-summary-strip {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 0.9fr);
    min-height: 86px;
    border-bottom: 1px solid var(--line);
    background: oklch(98.5% 0.006 82);
}

.rule-summary-item {
    display: grid;
    position: relative;
    align-content: center;
    gap: var(--space-1);
    min-width: 0;
    padding: var(--space-4) var(--space-6);
}

.rule-summary-item + .rule-summary-item {
    border-left: 1px solid var(--line);
}

.rule-summary-item:first-child {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: var(--space-3);
}

.rule-summary-item span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.rule-summary-item strong {
    color: var(--ink);
    font-size: 0.95rem;
    font-weight: 650;
}

.rule-summary-icon.calendar {
    position: relative;
    width: 30px;
    height: 30px;
    border: 2px solid oklch(40% 0.01 84);
    border-radius: 4px;
    background: oklch(97% 0.008 82);
    box-shadow: var(--inner-shadow);
}

.rule-summary-icon.calendar::before {
    position: absolute;
    top: 7px;
    right: 0;
    left: 0;
    height: 2px;
    background: oklch(40% 0.01 84);
    content: "";
}

.rule-summary-icon.calendar::after {
    position: absolute;
    top: -5px;
    left: 7px;
    width: 12px;
    height: 8px;
    border-right: 2px solid oklch(40% 0.01 84);
    border-left: 2px solid oklch(40% 0.01 84);
    content: "";
}

.rule-status-toggle {
    position: absolute;
    right: var(--space-5, 20px);
    top: 50%;
    display: block;
    width: 50px;
    height: 28px;
    transform: translateY(-50%);
}

.rule-status-toggle input {
    position: absolute;
    opacity: 0;
}

.rule-status-toggle span {
    display: block;
    width: 100%;
    height: 100%;
    border: 1px solid oklch(72% 0.014 82);
    border-radius: 999px;
    background: oklch(83% 0.012 84);
    cursor: pointer;
    transition: background-color 160ms ease-out, border-color 160ms ease-out;
}

.rule-status-toggle span::after {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: oklch(98% 0.008 84);
    box-shadow: 0 1px 3px oklch(28% 0.006 84 / 0.22);
    content: "";
    transition: transform 160ms ease-out;
}

.rule-status-toggle input:checked + span {
    border-color: oklch(58% 0.05 145);
    background: oklch(63% 0.052 145);
}

.rule-status-toggle input:checked + span::after {
    transform: translateX(22px);
}

.rule-status-toggle input:focus-visible + span {
    outline: 3px solid oklch(74% 0.12 238);
    outline-offset: 3px;
}

.rule-editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.88fr) minmax(360px, 1.12fr);
    gap: var(--space-8);
    padding: var(--space-6);
}

.rule-calculation,
.allocation-defaults {
    display: grid;
    gap: var(--space-4);
    align-content: start;
}

.rule-calculation .rules-grid {
    grid-template-columns: 1fr;
}

.weekday-select {
    display: block;
    width: 100%;
    min-height: 44px;
    border: 1px solid oklch(72% 0.014 82);
    border-radius: var(--radius-sm);
    background:
        linear-gradient(45deg, transparent 50%, var(--muted) 50%) right 16px center / 6px 6px no-repeat,
        linear-gradient(135deg, var(--muted) 50%, transparent 50%) right 10px center / 6px 6px no-repeat,
        linear-gradient(180deg, oklch(98.5% 0.008 82), oklch(94.5% 0.012 82));
    color: var(--ink);
    padding: 10px 34px 10px 12px;
    text-align: left;
    box-shadow: var(--inner-shadow);
    font-weight: 700;
}

.allocation-copy {
    display: grid;
    gap: var(--space-3);
}

.allocation-copy > p:last-child {
    color: var(--muted);
    font-size: 0.95rem;
}

.allocation-list {
    display: grid;
    gap: var(--space-4);
}

.allocation-row {
    display: grid;
    grid-template-columns: 34px minmax(76px, 0.42fr) 88px minmax(120px, 1fr);
    align-items: center;
    column-gap: var(--space-3);
    color: var(--ink);
    font-size: 0.93rem;
    font-weight: 700;
}

.allocation-name {
    min-width: 0;
}

.allocation-icon {
    position: relative;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    color: oklch(31% 0.016 145);
}

.allocation-icon.spending {
    border: 2px solid currentColor;
    border-radius: 50%;
    background: oklch(94% 0.018 82);
}

.allocation-icon.spending::before {
    position: absolute;
    top: 7px;
    left: 6px;
    width: 18px;
    height: 12px;
    border: 2px solid currentColor;
    border-radius: 3px;
    content: "";
}

.allocation-icon.spending::after {
    position: absolute;
    right: 6px;
    bottom: 9px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    content: "";
}

.allocation-icon.savings {
    border: 2px solid currentColor;
    border-radius: 50%;
    background: oklch(91% 0.026 145);
}

.allocation-icon.savings::before {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-radius: 50%;
    content: "";
}

.allocation-icon.savings::after {
    position: absolute;
    top: 14px;
    right: 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    content: "";
}

.allocation-icon.tithe {
    border: 2px solid currentColor;
    border-radius: 4px;
    background: oklch(84% 0.052 88);
    box-shadow: inset 0 0 0 1px oklch(96% 0.012 86 / 0.72);
}

.allocation-icon.tithe::before,
.allocation-icon.tithe::after {
    position: absolute;
    background: currentColor;
    content: "";
}

.allocation-icon.tithe::before {
    top: 2px;
    left: 13px;
    width: 3px;
    height: 24px;
}

.allocation-icon.tithe::after {
    top: 12px;
    left: 4px;
    width: 22px;
    height: 3px;
}

.allocation-percent {
    width: 88px;
}

.allocation-percent input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) {
    min-height: 36px;
    padding: 7px 40px 7px 12px;
    text-align: left;
}

.allocation-percent.percent-field::after {
    right: 14px;
    font-size: 0.78rem;
}

.allocation-track {
    display: block;
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: oklch(90.5% 0.008 82);
    box-shadow: inset 0 1px 2px oklch(28% 0.006 84 / 0.08);
}

.allocation-track span {
    display: block;
    width: calc(var(--allocation-percent) * 1%);
    height: 100%;
    border-radius: inherit;
    background: oklch(55% 0.046 145);
    box-shadow: inset 0 1px 0 oklch(91% 0.025 145 / 0.34);
    transition: width 180ms ease-out;
}

.allocation-total {
    border-top: 1px solid var(--line);
    padding-top: var(--space-3);
    color: var(--muted);
    font-size: 0.9rem;
}

.input-adornment {
    position: relative;
    display: block;
}

.input-adornment::before,
.input-adornment::after {
    position: absolute;
    top: 50%;
    z-index: 1;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 850;
    pointer-events: none;
}

.currency-field::before {
    left: 12px;
    content: "$";
}

.currency-field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) {
    padding-left: 34px;
}

.percent-field::after {
    right: 12px;
    content: "%";
}

.percent-field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) {
    padding-right: 32px;
}

.toggle-row {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: var(--space-3);
    color: var(--ink);
}

.toggle-row input {
    width: 20px;
    min-height: 20px;
}

.remember-row,
.schedule-toggle {
    justify-content: flex-start;
}

.schedule-toggle {
    grid-column: 1 / -1;
}

.confirm-popover {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    border: 1px solid oklch(78% 0.08 78);
    border-radius: var(--radius-md);
    background: oklch(96% 0.035 82);
    padding: var(--space-4);
}

.confirm-popover div:first-child {
    display: grid;
    gap: var(--space-1);
}

.confirm-popover span {
    color: var(--muted);
    font-size: 0.9rem;
}

.child-heading {
    margin-top: var(--space-3);
}

.notice {
    border: 1px solid oklch(78% 0.08 78);
    border-radius: var(--radius-sm);
    background: oklch(95% 0.045 82);
    color: oklch(39% 0.06 78);
    padding: var(--space-3) var(--space-4);
}

.child-stack {
    display: grid;
    gap: var(--space-3);
}

.child-editor {
    display: grid;
    overflow: hidden;
    padding: 0;
}

.child-editor.expanded {
    gap: 0;
}

.child-summary-toggle {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    min-height: 72px;
    background: transparent;
    color: var(--ink);
    padding: var(--space-4);
    text-align: left;
    cursor: pointer;
}

.child-summary-toggle:hover {
    background: oklch(94.5% 0.012 82 / 0.7);
}

.child-summary-copy {
    display: grid;
    min-width: 0;
    gap: var(--space-1);
}

.child-summary-copy strong {
    overflow: hidden;
    font-size: 1rem;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.child-summary-copy span {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.86rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dirty-pill {
    border: 1px solid oklch(78% 0.08 78);
    border-radius: 999px;
    background: oklch(95% 0.045 82);
    color: oklch(39% 0.06 78);
    padding: 2px var(--space-2);
    font-size: 0.72rem;
    font-weight: 850;
    white-space: nowrap;
}

.child-chevron {
    width: 10px;
    height: 10px;
    border-top: 2px solid var(--muted);
    border-right: 2px solid var(--muted);
    transform: rotate(45deg);
    transition: transform 180ms ease-out;
}

.child-summary-toggle[aria-expanded="true"] .child-chevron {
    transform: rotate(135deg);
}

.child-details {
    display: grid;
    gap: var(--space-4);
    border-top: 1px solid var(--line);
    padding: 20px var(--space-6) var(--space-6);
}

.child-editor-top > div:not(.action-row) span:not(.kid-avatar),
.child-identity span:not(.kid-avatar) {
    display: block;
    color: var(--muted);
    font-size: 0.88rem;
}

.child-identity {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: var(--space-3);
}

.child-identity > div {
    min-width: 0;
}

.name-input {
    min-height: 40px;
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--ink);
    font-size: 1.35rem;
    font-weight: 850;
}

.pin-editor {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-2);
}

.pin-editor input {
    min-width: 0;
}

.masked-pin {
    display: flex;
    min-height: 44px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: oklch(97.4% 0.008 82);
    color: var(--ink);
    font-size: 1.15rem;
    font-weight: 850;
    font-variant-numeric: tabular-nums;
    padding: 0 var(--space-3);
}

.add-child-tile {
    display: flex;
    min-height: 56px;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    border: 1px dashed oklch(70% 0.014 82);
    border-radius: var(--radius-md);
    background: oklch(97.2% 0.008 82 / 0.72);
    color: var(--ink);
    font-weight: 850;
    cursor: pointer;
}

.add-child-tile:hover:not(:disabled) {
    border-color: var(--blue);
    background: oklch(94.5% 0.03 238);
    color: oklch(34% 0.09 238);
}

.add-child-tile:disabled {
    cursor: not-allowed;
    opacity: 0.62;
}

.add-child-tile span {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: var(--radius-sm);
    background: oklch(50% 0.006 84);
    color: var(--paper);
    font-size: 1.3rem;
    line-height: 1;
}

.child-limit-note {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--muted);
    font-size: 0.88rem;
}

.child-limit-note a {
    color: var(--blue);
    font-weight: 800;
    text-decoration: none;
}

.child-limit-note a:hover {
    text-decoration: underline;
}

.avatar-field {
    display: grid;
    gap: var(--space-2);
}

.field-label {
    color: var(--muted);
    font-size: 0.875rem;
    font-weight: 700;
}

.avatar-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
    gap: var(--space-2);
}

.avatar-choice {
    display: grid;
    min-width: 0;
    min-height: 64px;
    aspect-ratio: 1;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, oklch(97.5% 0.01 82), oklch(92.5% 0.014 82));
    cursor: pointer;
    padding: var(--space-1);
    box-shadow: var(--inner-shadow);
}

.avatar-choice.selected {
    border-color: var(--crt);
    background: oklch(91% 0.035 145);
    box-shadow:
        var(--inner-shadow),
        0 0 0 2px oklch(69% 0.06 145);
}

.balance-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-3);
}

.balance-card {
    display: grid;
    gap: var(--space-1);
    align-content: start;
    min-height: 78px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--paper);
    padding: var(--space-3);
    font-weight: 850;
}

.balance-card small {
    display: flex;
    align-items: center;
    min-height: 28px;
    color: var(--muted);
    font-size: 0.78rem;
}

.balance-card strong {
    font-size: 1rem;
}

.balance-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    min-height: 28px;
}

.mini-action {
    min-height: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
    color: var(--blue);
    padding: 0 var(--space-2);
    font-size: 0.72rem;
    font-weight: 850;
}

.compact-money-field input {
    min-height: 34px;
    padding-top: var(--space-1);
    padding-bottom: var(--space-1);
}

.override-box {
    display: grid;
    gap: var(--space-3);
    margin: 0;
    border: 1px dashed var(--hardware);
    border-radius: var(--radius-sm);
    padding: var(--space-4);
}

.override-box legend {
    float: none;
    width: auto;
    margin: 0;
    padding: 0 var(--space-2);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.activity-panel {
    display: grid;
    gap: var(--space-4);
    padding: var(--space-6);
    position: sticky;
    top: var(--space-4);
}

.activity-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.activity-panel-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--space-2);
}

.activity-panel-controls select,
.activity-date-input {
    min-height: 42px;
}

.account-shell {
    padding: var(--space-4) 0 var(--space-12);
}

.account-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-6);
    align-items: start;
}

.account-panel {
    display: grid;
    gap: var(--space-4);
    padding: var(--space-6);
}

.subscription-panel {
    grid-column: 1 / -1;
}

.danger-panel {
    border-color: oklch(79% 0.07 28);
}

.account-delete-trigger {
    justify-self: start;
    min-height: 34px;
    padding: 0 12px;
    font-size: 0.875rem;
}

.panel-copy {
    max-width: 68ch;
    color: var(--muted);
}

.disabled-panel {
    display: grid;
    gap: var(--space-4);
    opacity: 0.72;
}

.account-action-row {
    justify-content: flex-start;
}

.referral-share {
    display: grid;
    gap: var(--space-3);
    border-top: 1px solid var(--line);
    padding-top: var(--space-4);
}

.referral-share h3 {
    margin: 0 0 var(--space-2);
    color: var(--ink);
    font-size: 1rem;
    font-weight: 850;
}

.referral-link-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-2);
    align-items: center;
}

.referral-link-row input {
    min-width: 0;
    font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.84rem;
    text-overflow: ellipsis;
}

.referral-link-row button {
    min-width: 110px;
}

.inline-status {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.linked-parent-list {
    display: grid;
    gap: var(--space-3);
    margin: 0;
    padding: 0;
    list-style: none;
}

.linked-parent-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-3);
    align-items: center;
    border-bottom: 1px solid var(--line);
    padding-bottom: var(--space-3);
}

.linked-parent-list strong,
.linked-parent-list span {
    display: block;
}

.linked-parent-list strong {
    overflow-wrap: anywhere;
}

.linked-parent-list span {
    color: var(--muted);
    font-size: 0.86rem;
}

.danger-confirm {
    border-color: oklch(75% 0.08 28);
    background: oklch(96% 0.026 28);
}

.inline-delete-form {
    min-width: min(360px, 100%);
}

.activity-list {
    display: grid;
    gap: var(--space-5, 20px);
    margin: 0;
    padding: 0;
}

.activity-day {
    display: grid;
    gap: var(--space-3);
}

.activity-day h3 {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 650;
}

.activity-day ol {
    overflow: hidden;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: oklch(98% 0.008 82);
    padding: 0;
    list-style: none;
}

.activity-list li {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: var(--space-4);
    align-items: center;
    min-height: 82px;
    padding: var(--space-4);
}

.activity-list li + li {
    border-top: 1px solid var(--line);
}

.activity-list.compact li {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    min-height: 48px;
    gap: var(--space-2);
    border-color: oklch(43% 0.045 153);
    padding: var(--space-2) 0;
}

.activity-list.compact .activity-day ol {
    border: 0;
    background: transparent;
}

.activity-list.compact .activity-day h3 {
    color: oklch(75% 0.055 145);
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
}

.activity-badge {
    position: relative;
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 50%;
    color: oklch(36% 0.016 145);
    font-size: 1.05rem;
    font-weight: 900;
    padding-top: 7px;
    padding-left: 1px;
}

.activity-badge::before {
    display: block;
    width: 19px;
    height: 19px;
    background: currentColor;
    content: "";
    mask: var(--activity-icon) center / contain no-repeat;
    transform: translateY(2px);
    -webkit-mask: var(--activity-icon) center / contain no-repeat;
}

.activity-list.compact .activity-badge {
    width: 24px;
    height: 24px;
    font-size: 0.74rem;
}

.activity-badge.allowance,
.activity-badge.deposit {
    --activity-icon: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2024%2024%27%20fill=%27none%27%20stroke=%27black%27%20stroke-width=%272.4%27%20stroke-linecap=%27round%27%20stroke-linejoin=%27round%27%3E%3Ccircle%20cx=%2712%27%20cy=%2712%27%20r=%279%27/%3E%3Cpath%20d=%27M12%208v8M8%2012h8%27/%3E%3C/svg%3E");
    border-color: oklch(80% 0.035 145);
    background: oklch(91% 0.026 145);
}

.activity-badge.savings,
.activity-badge.transfer {
    border-color: oklch(82% 0.038 145);
    background: oklch(90% 0.03 145);
}

.activity-badge.savings {
    --activity-icon: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2024%2024%27%20fill=%27none%27%20stroke=%27black%27%20stroke-width=%272.4%27%20stroke-linecap=%27round%27%20stroke-linejoin=%27round%27%3E%3Cpath%20d=%27M19%205H5a2%202%200%200%200-2%202v10a2%202%200%200%200%202%202h14a2%202%200%200%200%202-2V7a2%202%200%200%200-2-2Z%27/%3E%3Cpath%20d=%27M16%2012h.01M3%209h18%27/%3E%3C/svg%3E");
}

.activity-badge.transfer {
    --activity-icon: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2024%2024%27%20fill=%27none%27%20stroke=%27black%27%20stroke-width=%272.4%27%20stroke-linecap=%27round%27%20stroke-linejoin=%27round%27%3E%3Cpath%20d=%27M7%207h11l-4-4M17%2017H6l4%204%27/%3E%3C/svg%3E");
}

.activity-badge.withdrawal {
    --activity-icon: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2024%2024%27%20fill=%27none%27%20stroke=%27black%27%20stroke-width=%272.4%27%20stroke-linecap=%27round%27%20stroke-linejoin=%27round%27%3E%3Cpath%20d=%27M4%206h16v12H4z%27/%3E%3Cpath%20d=%27M8%2010h8M8%2014h5%27/%3E%3C/svg%3E");
    border-color: oklch(84% 0.06 72);
    background: oklch(94% 0.04 76);
    color: oklch(49% 0.09 62);
}

.activity-badge.wire-transfer {
    --activity-icon: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2024%2024%27%20fill=%27none%27%20stroke=%27black%27%20stroke-width=%272.4%27%20stroke-linecap=%27round%27%20stroke-linejoin=%27round%27%3E%3Cpath%20d=%27M5%2012h14M13%206l6%206-6%206%27/%3E%3C/svg%3E");
    border-color: oklch(80% 0.05 238);
    background: oklch(93% 0.026 238);
    color: oklch(40% 0.07 238);
}

.activity-badge.update {
    --activity-icon: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2024%2024%27%20fill=%27none%27%20stroke=%27black%27%20stroke-width=%272.4%27%20stroke-linecap=%27round%27%20stroke-linejoin=%27round%27%3E%3Cpath%20d=%27M4%207h16M4%2012h16M4%2017h16%27/%3E%3Cpath%20d=%27M8%205v4M15%2010v4M11%2015v4%27/%3E%3C/svg%3E");
    border-color: oklch(80% 0.018 82);
    background: oklch(93% 0.012 82);
    color: var(--muted);
}

.activity-list.compact .activity-badge::before {
    width: 13px;
    height: 13px;
    transform: translateY(1px);
}

.activity-list strong,
.activity-list span {
    display: block;
}

.activity-copy {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.activity-copy strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 760;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-list span {
    color: var(--muted);
    font-size: 0.8rem;
}

.activity-meta {
    display: grid;
    gap: 2px;
    justify-items: end;
    text-align: right;
}

.activity-list data {
    font-weight: 850;
    font-variant-numeric: tabular-nums;
}

.activity-list data.positive {
    color: oklch(42% 0.052 145);
}

.activity-list data.negative {
    color: var(--red);
}

.activity-meta time {
    color: var(--muted);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.activity-list.compact .activity-copy strong,
.activity-list.compact data,
.activity-list.compact time,
.activity-list.compact span {
    color: oklch(82% 0.055 145);
    font-size: 0.68rem;
    line-height: 1.1;
}

.activity-list.compact .activity-copy span {
    opacity: 0.78;
}

.empty-state {
    color: var(--muted);
}

.back-link {
    justify-self: start;
}

.view-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.atm-stage {
    display: grid;
    place-items: center;
}

.atm-shell {
    position: relative;
    display: block;
    width: min(606px, 100%);
    aspect-ratio: 606 / 884;
    filter: drop-shadow(0 26px 44px oklch(24% 0.006 84 / 0.24));
}

.atm-hardware {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
}

.crt-screen {
    position: absolute;
    z-index: 2;
    top: 16.3%;
    left: 20%;
    width: 59.8%;
    height: 44.9%;
    overflow: hidden;
    pointer-events: none;
    min-height: 0;
    border: 7px solid oklch(24% 0.012 145);
    border-radius: 7%;
    background:
        linear-gradient(oklch(27% 0.045 153 / 0.22) 50%, transparent 50%),
        radial-gradient(circle at 50% 35%, oklch(38% 0.035 145), oklch(23% 0.035 145));
    background-size: 100% 4px, auto;
    color: oklch(84% 0.075 145);
    padding: var(--space-4);
    text-shadow: 0 0 10px oklch(76% 0.09 145 / 0.34);
}

.crt-screen h2 {
    margin: var(--space-3) 0;
    color: oklch(88% 0.075 145);
    font-size: 1.25rem;
    line-height: 1.15;
    text-transform: uppercase;
}

.crt-status {
    display: inline-block;
    border: 1px solid oklch(57% 0.06 145);
    border-radius: var(--radius-sm);
    padding: 3px 7px;
    font-size: 0.68rem;
    font-weight: 900;
}

.screen-option {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    min-height: 44px;
    margin: var(--space-2) 0;
    border: 1px solid oklch(58% 0.06 145);
    border-radius: var(--radius-sm);
    background: oklch(67% 0.055 145 / 0.26);
    color: oklch(88% 0.075 145);
    text-align: left;
    padding: 0 var(--space-3);
    font-weight: 850;
}

.atm-screen-rows {
    position: absolute;
    top: 21.8%;
    right: var(--space-4);
    bottom: 16.5%;
    left: var(--space-4);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--space-4);
}

.atm-screen-side {
    display: grid;
    grid-template-rows: repeat(4, minmax(0, 1fr));
    align-items: center;
}

.screen-row-label {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: var(--space-2);
    border-top: 1px dashed oklch(68% 0.06 145 / 0.6);
    padding-top: var(--space-1);
    color: oklch(86% 0.075 145);
    font-size: 0.83rem;
    font-weight: 850;
    line-height: 1.1;
    text-transform: uppercase;
}

.atm-screen-side.right .screen-row-label {
    justify-content: flex-end;
    text-align: right;
}

.screen-row-label.empty {
    visibility: hidden;
}

.pin-display,
.amount-display {
    font-size: 2.55rem;
    font-weight: 900;
    line-height: 1.08;
}

.crt-screen-amount > p:not(.amount-display):not(.atm-notification) {
    max-width: 18ch;
    color: oklch(82% 0.06 145);
    font-size: 0.95rem;
    line-height: 1.18;
}

.screen-message {
    color: oklch(84% 0.12 78);
}

.atm-notification {
    position: absolute;
    z-index: 2;
    top: var(--space-4);
    right: var(--space-4);
    max-width: 23ch;
    padding-left: var(--space-3);
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1.08;
    text-align: right;
    text-transform: uppercase;
}

.atm-balance-readout {
    position: absolute;
    right: var(--space-4);
    bottom: 7.5%;
    left: var(--space-4);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--space-2);
    color: oklch(82% 0.06 145);
    font-size: 0.76rem;
    font-weight: 850;
    text-transform: uppercase;
}

.atm-history {
    max-height: 190px;
    overflow: hidden;
    padding-right: var(--space-2);
}

.crt-screen-history {
    display: flex;
    flex-direction: column;
}

.crt-screen-history h2 {
    margin-bottom: var(--space-2);
}

.crt-screen-history .atm-history {
    flex: 1 1 auto;
    max-height: none;
    min-height: 0;
    overflow: hidden;
    padding-right: 0;
    padding-bottom: 46px;
}

.atm-history .activity-list {
    gap: var(--space-2);
}

.atm-history .activity-day {
    gap: 6px;
}

.atm-history .activity-list.compact li {
    grid-template-columns: 22px minmax(0, 1fr) minmax(54px, auto);
    min-height: 32px;
    gap: 6px;
    padding: 4px 0;
}

.atm-history .activity-list.compact .activity-day h3 {
    font-size: 0.62rem;
    line-height: 1;
}

.atm-history .activity-list.compact .activity-badge {
    width: 20px;
    height: 20px;
}

.atm-history .activity-list.compact .activity-badge::before {
    width: 11px;
    height: 11px;
}

.atm-history .activity-list.compact .activity-copy strong,
.atm-history .activity-list.compact data,
.atm-history .activity-list.compact time,
.atm-history .activity-list.compact span {
    font-size: 0.64rem;
}

.crt-screen-history .atm-screen-rows.compact {
    top: auto;
    bottom: 11%;
    height: 36px;
}

.crt-screen-history .atm-screen-side {
    grid-template-rows: 1fr;
}

.crt-screen-history .screen-row-label:not(.empty) {
    align-self: end;
}

.atm-page-status {
    position: absolute;
    right: var(--space-4);
    bottom: 7.5%;
    left: var(--space-4);
    color: oklch(82% 0.06 145);
    font-size: 0.72rem;
    font-weight: 900;
    text-align: center;
    text-transform: uppercase;
}

.atm-buttons {
    position: absolute;
    z-index: 3;
    display: grid;
    grid-template-rows: repeat(4, minmax(0, 1fr));
    gap: 10.8%;
    top: 24%;
    width: 7.7%;
    height: 28%;
}

.atm-buttons.left {
    left: 4.95%;
}

.atm-buttons.right {
    right: 4.95%;
}

.atm-buttons button,
.numpad button {
    min-height: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: transparent;
    box-shadow: none;
    font-size: 0;
    font-weight: 900;
}

.atm-buttons button:not(:disabled):hover,
.numpad button:hover {
    background: oklch(88% 0.025 82 / 0.2);
    transform: none;
}

.atm-buttons button:disabled {
    cursor: default;
    visibility: hidden;
}

.atm-buttons button:disabled:hover {
    transform: none;
}

.numpad {
    position: absolute;
    z-index: 3;
    display: grid;
    left: 15.9%;
    top: 70.1%;
    width: 30.2%;
    height: 22.1%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(4, minmax(0, 1fr));
    gap: 5.4% 6.4%;
}

.numpad button:last-child {
    grid-column: auto;
}

.loading-shell {
    width: min(960px, calc(100% - 32px));
    margin: 10vh auto;
}

.skeleton-line,
.skeleton-panel {
    border-radius: var(--radius-md);
    background: linear-gradient(90deg, var(--paper-quiet), var(--panel), var(--paper-quiet));
}

.skeleton-line {
    width: 45%;
    height: 42px;
    margin-bottom: var(--space-4);
}

.skeleton-panel {
    height: 320px;
}

#blazor-error-ui {
    display: none;
}

@media (max-width: 860px) {
    .site-nav,
    .auth-shell,
    .app-header,
    .panel-heading,
    .section-heading,
    .child-editor-top {
        align-items: stretch;
        flex-direction: column;
    }

    .site-nav {
        padding: var(--space-4);
    }

    .create-account-shell .section-heading {
        align-items: flex-start;
    }

    .nav-actions {
        justify-content: flex-start;
    }

    h1 {
        max-width: 14ch;
        font-size: 2.1rem;
    }

    .auth-shell,
    .create-account-shell,
    .mode-grid,
    .plan-row,
    .plans-strip,
    .manage-layout,
    .account-grid,
    .summary-band,
    .rules-grid,
    .balance-row,
    .billing-choice-grid {
        grid-template-columns: 1fr;
    }

    .referral-link-row {
        grid-template-columns: 1fr;
    }

    .auth-shell,
    .app-shell,
    .create-account-shell,
    .account-shell,
    .help-shell {
        width: min(calc(100% - 48px), 520px);
    }

    .help-hero {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .help-actions {
        justify-content: flex-start;
    }

    .auth-primer span,
    .help-copy,
    .help-steps span,
    .faq-item p {
        font-size: 0.95rem;
    }

    .auth-panel,
    .account-panel,
    .money-dashboard {
        width: 100%;
        max-width: 100%;
        padding: var(--space-4);
        overflow-x: auto;
    }

    .money-table {
        min-width: 0;
    }

    .account-form-panel,
    .activity-panel {
        position: static;
    }

    .plan-option,
    .plan-option-featured {
        min-height: auto;
        padding: var(--space-4);
        transform: none;
    }

    .plan-option.plan-option-featured:not(:disabled):hover {
        transform: translateY(-1px);
    }

    .plan-option-featured b {
        position: static;
        justify-self: start;
    }

    .confirm-popover {
        align-items: stretch;
        flex-direction: column;
    }

    .rule-summary-strip,
    .rule-editor-grid {
        grid-template-columns: 1fr;
    }

    .rule-summary-item + .rule-summary-item {
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .rule-summary-item {
        min-height: 76px;
        padding: var(--space-4);
    }

    .rule-editor-grid {
        gap: var(--space-6);
        padding: var(--space-4);
    }

    .allocation-row {
        grid-template-columns: 34px minmax(68px, 1fr) 88px;
        row-gap: var(--space-2);
    }

    .allocation-track {
        grid-column: 2 / -1;
        width: 100%;
    }

    .linked-parent-list li {
        grid-template-columns: 1fr;
    }

    .money-table,
    .money-table thead,
    .money-table tbody,
    .money-table tfoot,
    .money-table tr,
    .money-table th,
    .money-table td {
        display: block;
    }

    .money-table {
        font-size: 0.9rem;
    }

    .money-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
    }

    .money-table tbody tr,
    .money-table tfoot tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--space-2);
        border-bottom: 1px solid var(--line);
        padding: var(--space-3) 0;
    }

    .money-table .history-row {
        display: block;
    }

    .money-table .history-row td {
        padding: var(--space-3) 0;
    }

    .money-table th,
    .money-table td,
    .money-table th:first-child,
    .money-table td:first-child {
        border-bottom: 0;
        padding: 0;
        text-align: left;
    }

    .money-table tbody th,
    .money-table tfoot th {
        grid-column: 1 / -1;
    }

    .money-table tbody td::before,
    .money-table tfoot td::before {
        display: block;
        color: var(--muted);
        font-size: 0.72rem;
        font-weight: 850;
        text-transform: uppercase;
    }

    .money-table tbody td:nth-of-type(1)::before,
    .money-table tfoot td:nth-of-type(1)::before {
        content: "Spending";
    }

    .money-table tbody td:nth-of-type(2)::before,
    .money-table tfoot td:nth-of-type(2)::before {
        content: "Savings";
    }

    .money-table tbody td:nth-of-type(3)::before,
    .money-table tfoot td:nth-of-type(3)::before {
        content: "Tithe";
    }

    .money-table tbody td:nth-of-type(4)::before,
    .money-table tfoot td:nth-of-type(4)::before {
        content: "Total";
    }

    .lead {
        max-width: 32ch;
        font-size: 1rem;
    }

    .header-actions {
        justify-content: flex-start;
    }

    .atm-stage {
        width: 100vw;
        margin-right: calc(50% - 50vw);
        margin-left: calc(50% - 50vw);
    }

    .atm-shell {
        width: min(100vw, 430px);
        border: 0;
        padding: 0;
    }

    .crt-screen {
        min-height: 0;
        border-width: 5px;
        padding: var(--space-3);
    }

    .crt-screen h2 {
        font-size: 1rem;
    }

    .screen-option {
        min-height: 36px;
        padding: 0 var(--space-2);
        font-size: 0.85rem;
    }

    .pin-display,
    .amount-display {
        font-size: 2rem;
    }

    .crt-screen-amount > p:not(.amount-display):not(.atm-notification) {
        max-width: 15ch;
        font-size: 0.82rem;
    }

    .crt-screen-history h2 {
        margin-top: var(--space-2);
        margin-bottom: 6px;
    }

    .crt-screen-history .atm-history {
        padding-bottom: 38px;
    }

    .atm-history .activity-list {
        gap: 6px;
    }

    .atm-history .activity-day {
        gap: 4px;
    }

    .atm-history .activity-list.compact li {
        grid-template-columns: 20px minmax(0, 1fr) minmax(50px, auto);
        min-height: 28px;
        gap: 5px;
        padding: 3px 0;
    }

    .atm-history .activity-list.compact .activity-badge {
        width: 18px;
        height: 18px;
    }

    .atm-history .activity-list.compact .activity-copy strong,
    .atm-history .activity-list.compact data,
    .atm-history .activity-list.compact time,
    .atm-history .activity-list.compact span {
        font-size: 0.6rem;
    }

    .atm-buttons button {
        padding: 0 4px;
    }

    .numpad {
        grid-column: auto;
    }
}

.atm-toolbar {
    justify-content: space-between;
}

.atm-toolbar-fullscreen {
    position: fixed;
    z-index: 31;
    top: var(--space-2);
    right: var(--space-2);
    left: var(--space-2);
}

.atm-toolbar-fullscreen .back-link,
.atm-toolbar-fullscreen .secondary-action {
    background: oklch(11% 0.004 84);
    color: oklch(94% 0.008 84);
    border-color: oklch(34% 0.008 84);
    box-shadow: none;
}

.atm-stage.fullscreen {
    position: fixed;
    z-index: 30;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    margin: 0;
    padding: 0;
    background: oklch(4% 0.004 84);
    place-items: center;
}

.atm-stage.fullscreen .atm-shell {
    width: min(100vw, calc(100dvh * 606 / 884));
    height: min(100dvh, calc(100vw * 884 / 606));
    max-width: none;
    border: 0;
    padding: 0;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
