:root {
    --ink: #142235;
    --muted: #687385;
    --line: #dfe5e8;
    --canvas: #f4f6f4;
    --paper: #ffffff;
    --navy: #163451;
    --navy-deep: #0e253b;
    --mint: #16a77b;
    --mint-soft: #dff5ed;
    --amber: #d98324;
    --amber-soft: #fff0da;
    --red: #c45252;
    --red-soft: #fde8e8;
    --shadow: 0 18px 50px rgba(25, 43, 58, 0.08);
    font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--canvas);
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--canvas);
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--canvas);
}

button,
input,
select {
    font: inherit;
}

button,
select {
    cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(22, 167, 123, 0.28);
    outline-offset: 2px;
}

[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--mint);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.17em;
}

.brand-mark {
    display: inline-flex;
    align-items: end;
    gap: 4px;
    width: 49px;
    height: 49px;
    padding: 10px;
    border-radius: 15px;
    background: var(--mint);
    box-shadow: 0 12px 28px rgba(22, 167, 123, 0.22);
}

.brand-mark span {
    width: 7px;
    border-radius: 3px 3px 1px 1px;
    background: white;
}

.brand-mark span:nth-child(1) { height: 13px; opacity: 0.7; }
.brand-mark span:nth-child(2) { height: 22px; }
.brand-mark span:nth-child(3) { height: 17px; opacity: 0.85; }

.primary-button,
.ghost-button {
    min-height: 44px;
    border-radius: 10px;
    border: 0;
    font-weight: 750;
    transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.primary-button {
    padding: 0 21px;
    color: white;
    background: var(--navy);
    box-shadow: 0 8px 20px rgba(22, 52, 81, 0.16);
}

.primary-button:hover {
    transform: translateY(-1px);
    background: var(--navy-deep);
    box-shadow: 0 10px 26px rgba(22, 52, 81, 0.22);
}

.ghost-button {
    min-height: 38px;
    padding: 0 15px;
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--line);
}

.ghost-button:hover {
    color: var(--ink);
    background: #f7f9f8;
}

/* Login */
.login-page {
    display: grid;
    place-items: center;
    padding: 34px;
    color: white;
    background:
        radial-gradient(circle at 10% 20%, rgba(25, 181, 136, 0.16), transparent 30%),
        linear-gradient(135deg, #0d2237 0%, #173a58 58%, #194a62 100%);
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.72fr);
    gap: clamp(40px, 8vw, 120px);
    align-items: center;
    width: min(1080px, 100%);
}

.login-intro h1 {
    max-width: 650px;
    margin: 24px 0 20px;
    font-size: clamp(42px, 6.2vw, 74px);
    line-height: 1.08;
    letter-spacing: -0.055em;
}

.login-intro .eyebrow {
    margin-top: 34px;
    color: #66dfba;
}

.login-lead {
    max-width: 560px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 17px;
    line-height: 1.75;
}

.security-note {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
}

.security-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #5be0b6;
    box-shadow: 0 0 0 6px rgba(91, 224, 182, 0.11);
}

.login-card {
    padding: clamp(30px, 4vw, 48px);
    color: var(--ink);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 30px 80px rgba(3, 18, 31, 0.25);
}

.login-card-heading h2 {
    margin: 0;
    font-size: 28px;
    letter-spacing: -0.04em;
}

.login-card-heading > p:last-child {
    margin: 9px 0 30px;
    color: var(--muted);
    font-size: 14px;
}

.field-label {
    display: block;
    margin: 18px 0 8px;
    font-size: 13px;
    font-weight: 750;
}

.text-input,
.query-controls select,
.table-toolbar input,
.table-toolbar select {
    width: 100%;
    min-height: 46px;
    color: var(--ink);
    border: 1px solid #d9e0e3;
    border-radius: 10px;
    background: white;
}

.text-input {
    padding: 0 14px;
}

.text-input:hover,
.text-input:focus,
.query-controls select:focus,
.table-toolbar input:focus,
.table-toolbar select:focus {
    border-color: var(--mint);
}

.login-button {
    width: 100%;
    min-height: 50px;
    margin-top: 26px;
}

.login-footnote {
    margin: 25px 0 0;
    padding-top: 22px;
    color: #8a929d;
    border-top: 1px solid #edf0f1;
    font-size: 12px;
    line-height: 1.65;
}

.form-error {
    margin-bottom: 18px;
    padding: 12px 14px;
    color: #9e3535;
    border: 1px solid #f3caca;
    border-radius: 9px;
    background: #fff1f1;
    font-size: 13px;
}

/* App shell */
.topbar {
    position: sticky;
    z-index: 20;
    top: 0;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 18px;
    height: 74px;
    padding: 0 max(24px, calc((100vw - 1240px) / 2));
    border-bottom: 1px solid rgba(214, 222, 225, 0.8);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(18px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    width: fit-content;
    color: var(--ink);
    text-decoration: none;
}

.brand-mark-small {
    gap: 2px;
    width: 35px;
    height: 35px;
    padding: 8px;
    border-radius: 10px;
    box-shadow: none;
}

.brand-mark-small span { width: 5px; }
.brand-mark-small span:nth-child(1) { height: 9px; }
.brand-mark-small span:nth-child(2) { height: 17px; }
.brand-mark-small span:nth-child(3) { height: 13px; }

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 15px;
    letter-spacing: -0.025em;
}

.brand small {
    margin-top: 2px;
    color: #8a939d;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.account-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #f8faf9;
    font-size: 12px;
}

.account-bank {
    color: var(--muted);
}

.app-shell {
    width: min(1240px, calc(100% - 48px));
    margin: 0 auto;
    padding: 54px 0 80px;
}

.hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 42px;
}

.hero h1 {
    margin: 0 0 16px;
    font-size: clamp(34px, 4.2vw, 54px);
    line-height: 1.16;
    letter-spacing: -0.052em;
}

.hero > div > p:last-child {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.hero-status {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 158px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--paper);
}

.mobile-account-chip,
.mobile-data-list {
    display: none;
}

.hero-status small,
.hero-status strong {
    display: block;
}

.hero-status small {
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 10px;
}

.hero-status strong {
    font-size: 13px;
}

.status-pulse {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--mint);
    box-shadow: 0 0 0 6px var(--mint-soft);
}

.tabs {
    display: flex;
    gap: 5px;
    width: fit-content;
    margin-bottom: 30px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #e9edeb;
}

.tab-button {
    min-height: 42px;
    padding: 0 20px;
    color: var(--muted);
    border: 0;
    border-radius: 9px;
    background: transparent;
    font-size: 13px;
    font-weight: 750;
}

.tab-button.is-active {
    color: var(--ink);
    background: white;
    box-shadow: 0 3px 12px rgba(30, 48, 61, 0.08);
}

.panel-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 35px;
    margin-bottom: 24px;
}

.panel-heading h2 {
    margin: 0 0 8px;
    font-size: 26px;
    letter-spacing: -0.04em;
}

.panel-heading > div > p:last-child {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.query-controls {
    display: flex;
    align-items: end;
    gap: 10px;
}

.query-controls label > span {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.query-controls select {
    min-width: 150px;
    padding: 0 34px 0 13px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.summary-card {
    min-height: 142px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--paper);
}

.summary-card > span,
.summary-card > strong,
.summary-card > small {
    display: block;
}

.summary-card > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.summary-card > strong {
    margin: 13px 0 9px;
    font-size: 24px;
    line-height: 1;
    letter-spacing: -0.04em;
}

.summary-card > small {
    color: #929ba4;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.summary-card.accent-card {
    color: white;
    border-color: var(--navy);
    background: linear-gradient(145deg, #173b59, #102a42);
    box-shadow: 0 16px 36px rgba(18, 44, 67, 0.16);
}

.summary-card.accent-card > span,
.summary-card.accent-card > small {
    color: rgba(255, 255, 255, 0.64);
}

.warning-card > strong {
    color: var(--amber);
}

.money-in {
    color: var(--mint) !important;
}

.data-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--paper);
    box-shadow: var(--shadow);
}

.table-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 70px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--line);
}

.search-field {
    flex: 1;
}

.table-toolbar input,
.table-toolbar select {
    min-height: 40px;
    padding: 0 12px;
    font-size: 13px;
}

.table-toolbar input:disabled,
.table-toolbar select:disabled {
    cursor: not-allowed;
    color: #a2abb3;
    background: #f5f7f6;
}

.table-toolbar select {
    min-width: 130px;
}

.result-count {
    min-width: 76px;
    color: var(--muted);
    font-size: 12px;
    text-align: right;
}

.table-wrap {
    position: relative;
    min-height: 310px;
    overflow-x: auto;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 16px 20px 18px;
    border-top: 1px solid var(--line);
}

.pagination[hidden] {
    display: none;
}

.pagination-button {
    min-width: 68px;
    padding: 8px 13px;
    border: 1px solid #d9dfdd;
    border-radius: 8px;
    color: var(--ink);
    background: #fff;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.pagination-button:hover:not(:disabled) {
    border-color: var(--mint);
    color: #087252;
    background: var(--mint-soft);
}

.pagination-button:disabled {
    color: #aeb5b3;
    background: #f4f6f5;
    cursor: not-allowed;
}

.pagination-status {
    min-width: 90px;
    color: var(--muted);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th,
.data-table td {
    height: 58px;
    padding: 0 18px;
    border-bottom: 1px solid #edf0f1;
    white-space: nowrap;
    text-align: left;
}

.data-table th {
    height: 45px;
    color: #78838d;
    background: #f8faf9;
    font-size: 11px;
    font-weight: 750;
}

.data-table tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr:hover {
    background: #fbfcfb;
}

.data-table .numeric {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.empty-state {
    position: absolute;
    inset: 45px 0 0;
    display: grid;
    place-content: center;
    justify-items: center;
    color: var(--muted);
    text-align: center;
}

.empty-state strong {
    margin: 13px 0 7px;
    color: var(--ink);
    font-size: 14px;
}

.empty-state p {
    margin: 0;
    font-size: 12px;
}

.empty-icon {
    display: grid;
    place-items: center;
    width: 43px;
    height: 43px;
    color: var(--mint);
    border-radius: 50%;
    background: var(--mint-soft);
    font-size: 18px;
    font-weight: 800;
}

.rent-controls select {
    min-width: 126px;
}

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

.rent-toolbar > div:first-child {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.rent-toolbar strong {
    font-size: 14px;
}

.rent-toolbar > div:first-child span {
    color: var(--muted);
    font-size: 11px;
}

.legend {
    display: flex;
    gap: 14px;
    color: var(--muted);
    font-size: 11px;
}

.legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.legend-dot.paid { background: var(--mint); }
.legend-dot.check { background: var(--amber); }

.rent-table {
    min-width: 1320px;
}

.tenant-name {
    font-weight: 750;
}

.expected-rent {
    color: var(--navy);
    font-weight: 700;
}

.payment-cell {
    color: #a7aeb4;
}

.payment-cell strong,
.payment-cell small {
    display: block;
}

.payment-cell.has-payment strong {
    color: var(--ink);
    font-size: 12px;
}

.payment-cell.has-payment small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 9px;
}

.payment-cell.adjusted {
    background: #fff1df;
    color: #b45b12;
}

.payment-cell.adjusted strong,
.payment-cell.adjusted small {
    color: #b45b12;
}

.status-badge {
    display: inline-block;
    padding: 6px 9px;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 750;
}

.status-badge.paid {
    color: #087252;
    background: var(--mint-soft);
}

.status-badge.paid.icon-only {
    display: inline-grid;
    width: 28px;
    height: 28px;
    padding: 0;
    place-items: center;
    border-radius: 50%;
    font-size: 17px;
    line-height: 1;
}

.status-badge.missing {
    color: #a43c3c;
    background: var(--red-soft);
}

.status-badge.check {
    color: #9b5a13;
    background: var(--amber-soft);
}

.analysis-note {
    margin-top: 16px;
    padding: 18px 21px;
    color: #79511f;
    border: 1px solid #f1d9b5;
    border-radius: 13px;
    background: #fff9ef;
    font-size: 12px;
    line-height: 1.65;
}

.analysis-note ul {
    margin: 8px 0 0;
    padding-left: 18px;
}

.toast {
    position: fixed;
    z-index: 60;
    right: 24px;
    bottom: 24px;
    max-width: min(390px, calc(100vw - 48px));
    padding: 14px 18px;
    color: white;
    border-radius: 11px;
    background: #972f2f;
    box-shadow: 0 14px 40px rgba(19, 35, 48, 0.24);
    font-size: 13px;
}

.toast.success {
    background: #147958;
}

.toast.warning {
    background: #a45d14;
}

.loading-overlay {
    position: fixed;
    z-index: 50;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(8, 25, 39, 0.44);
    backdrop-filter: blur(5px);
}

.loading-card {
    width: min(390px, 100%);
    padding: 34px;
    border-radius: 18px;
    background: white;
    box-shadow: 0 24px 80px rgba(5, 21, 34, 0.28);
    text-align: center;
}

.loading-card strong {
    display: block;
    margin: 20px 0 8px;
    font-size: 16px;
}

.loading-card p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.spinner {
    display: inline-block;
    width: 34px;
    height: 34px;
    border: 3px solid var(--mint-soft);
    border-top-color: var(--mint);
    border-radius: 50%;
    animation: spin 800ms linear infinite;
}

body.is-loading {
    overflow: hidden;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 960px) {
    .login-shell {
        grid-template-columns: 1fr;
        gap: 36px;
        max-width: 560px;
    }

    .login-intro h1 {
        font-size: clamp(42px, 10vw, 62px);
    }

    .security-note {
        margin-top: 24px;
    }

    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .panel-heading {
        align-items: stretch;
        flex-direction: column;
        gap: 20px;
    }

    .query-controls {
        justify-content: flex-start;
    }
}

@media (max-width: 680px) {
    .login-page {
        display: block;
        padding: 25px 18px;
    }

    .login-intro .brand-mark {
        width: 42px;
        height: 42px;
    }

    .login-intro h1 {
        margin-top: 18px;
        font-size: 38px;
    }

    .login-lead {
        font-size: 15px;
    }

    .login-card {
        padding: 28px 22px;
        border-radius: 19px;
    }

    .topbar {
        grid-template-columns: 1fr auto;
        height: 65px;
        padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
    }

    .account-chip {
        display: none;
    }

    .ghost-button {
        padding: 0 11px;
    }

    .app-shell {
        width: min(100% - 28px, 1240px);
        padding: 30px 0 calc(72px + env(safe-area-inset-bottom));
    }

    .hero {
        align-items: stretch;
        flex-direction: column;
        gap: 22px;
        margin-bottom: 31px;
    }

    .hero h1 {
        font-size: clamp(31px, 9.4vw, 38px);
        line-height: 1.18;
    }

    .hero-status {
        display: none;
    }

    .mobile-account-chip {
        display: flex;
        align-items: center;
        gap: 8px;
        width: fit-content;
        margin-top: 19px;
        padding: 10px 13px;
        color: var(--muted);
        border: 1px solid var(--line);
        border-radius: 10px;
        background: var(--paper);
        font-size: 11px;
    }

    .mobile-account-chip span {
        color: var(--ink);
        font-weight: 750;
    }

    .mobile-account-chip strong {
        font-variant-numeric: tabular-nums;
    }

    .mobile-account-chip i {
        width: 6px;
        height: 6px;
        margin-left: 3px;
        border-radius: 50%;
        background: var(--mint);
    }

    .tabs {
        position: sticky;
        z-index: 15;
        top: 73px;
        width: 100%;
        margin-bottom: 25px;
        box-shadow: 0 8px 22px rgba(24, 42, 55, 0.08);
    }

    .tab-button {
        flex: 1;
        min-height: 45px;
        padding: 0 10px;
        font-size: 12px;
    }

    .panel-heading h2 {
        font-size: 23px;
    }

    .query-controls,
    .rent-controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 11px 9px;
    }

    .query-controls .primary-button {
        grid-column: 1 / -1;
        min-height: 50px;
        margin-top: 2px;
    }

    .query-controls select,
    .table-toolbar input,
    .table-toolbar select {
        min-height: 48px;
        font-size: 16px;
    }

    .summary-grid {
        grid-template-columns: 1fr 1fr;
        gap: 9px;
    }

    .summary-card {
        min-height: 126px;
        padding: 17px;
    }

    .summary-card:first-child {
        grid-column: 1 / -1;
        min-height: 118px;
    }

    .summary-card > strong {
        font-size: 20px;
    }

    .table-toolbar {
        align-items: stretch;
        flex-wrap: wrap;
        min-height: auto;
        padding: 13px;
    }

    .search-field {
        flex-basis: 100%;
    }

    .table-toolbar label:not(.search-field) {
        flex: 1;
    }

    .result-count {
        align-self: center;
    }

    .data-table {
        display: none;
    }

    .table-wrap {
        min-height: 270px;
        overflow: visible;
    }

    .mobile-data-list {
        display: block;
    }

    .mobile-transaction-card {
        padding: 17px 15px;
        border-bottom: 1px solid #edf0f1;
    }

    .mobile-transaction-card:last-child,
    .mobile-rent-card:last-child {
        border-bottom: 0;
    }

    .mobile-card-top,
    .mobile-card-bottom {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
    }

    .mobile-card-top > strong:first-child {
        min-width: 0;
        overflow: hidden;
        font-size: 14px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-amount {
        flex: none;
        font-size: 14px;
        font-variant-numeric: tabular-nums;
    }

    .mobile-amount.deposit {
        color: var(--mint);
    }

    .mobile-amount.withdrawal {
        color: var(--ink);
    }

    .mobile-card-bottom {
        margin-top: 8px;
        color: var(--muted);
        font-size: 10px;
        font-variant-numeric: tabular-nums;
    }

    .empty-state {
        inset: 0;
        min-height: 270px;
    }

    .rent-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .legend {
        width: 100%;
    }

    .rent-table-wrap {
        background: #f7f9f8;
    }

    .rent-mobile-list {
        padding: 10px;
    }

    .mobile-rent-card {
        margin-bottom: 10px;
        padding: 16px;
        border: 1px solid var(--line);
        border-radius: 13px;
        background: var(--paper);
        box-shadow: 0 5px 14px rgba(25, 43, 58, 0.04);
    }

    .mobile-rent-card:last-child {
        margin-bottom: 0;
    }

    .mobile-rent-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        padding-bottom: 14px;
        border-bottom: 1px solid #edf0f1;
    }

    .mobile-rent-header > div > strong,
    .mobile-rent-header > div > small {
        display: block;
    }

    .mobile-rent-header > div > strong {
        font-size: 15px;
    }

    .mobile-rent-header > div > small {
        margin-top: 5px;
        color: var(--muted);
        font-size: 10px;
    }

    .mobile-rent-header .status-badge {
        max-width: 130px;
        white-space: normal;
        text-align: center;
    }

    .mobile-month-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;
        margin-top: 13px;
    }

    .mobile-month {
        min-width: 0;
        padding: 10px 7px;
        border: 1px solid #e5e9e8;
        border-radius: 9px;
        background: #fafbfa;
        text-align: center;
    }

    .mobile-month small,
    .mobile-month strong,
    .mobile-month span {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-month small {
        color: var(--muted);
        font-size: 9px;
    }

    .mobile-month strong {
        margin: 6px 0 4px;
        font-size: 11px;
    }

    .mobile-month span {
        color: var(--muted);
        font-size: 8px;
        font-variant-numeric: tabular-nums;
    }

    .mobile-month.has-payment {
        border-color: #cce9df;
        background: #f2fbf8;
    }

    .mobile-month.has-payment strong {
        color: #087252;
    }

    .mobile-month.adjusted {
        border-color: #f1c58d;
        background: #fff1df;
    }

    .mobile-month.adjusted strong,
    .mobile-month.adjusted span {
        color: #b45b12;
    }

.mobile-month.no-payment strong {
        color: #a15c5c;
    }

    .analysis-note {
        padding: 16px;
    }

    .toast {
        right: 14px;
        bottom: calc(14px + env(safe-area-inset-bottom));
        max-width: calc(100vw - 28px);
    }

    .loading-overlay {
        align-items: end;
        padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
    }

    .loading-card {
        padding: 30px 22px;
        border-radius: 20px;
    }
}

@media (max-width: 380px) {
    .app-shell {
        width: calc(100% - 20px);
    }

    .brand small {
        display: none;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .summary-card:first-child {
        grid-column: auto;
    }

    .mobile-month-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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