:root {
    --bg: #f5f7fc;
    --surface: #ffffff;
    --surface-soft: #f7f9fe;
    --ink: #152238;
    --muted: #68748b;
    --line: #e4e9f3;
    --primary: #315bea;
    --primary-dark: #2348cf;
    --primary-soft: #eaf0ff;
    --success: #078864;
    --success-dark: #047453;
    --danger: #cb334d;
    --warning: #9c5a00;
    --radius-lg: 24px;
    --radius-md: 16px;
    --shadow: 0 16px 38px rgba(25, 39, 69, .07);
    --font: "Inter", "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.hidden { display: none !important; }
.eyebrow {
    color: var(--primary);
    font-size: .7rem;
    font-weight: 750;
    letter-spacing: .16em;
    margin: 0 0 .55rem;
}
.brand {
    align-items: center;
    display: inline-flex;
    gap: .7rem;
}
.brand-mark {
    align-items: center;
    background: linear-gradient(140deg, #3764f1, #1fc1b2);
    border-radius: 13px;
    box-shadow: 0 9px 22px rgba(49, 91, 234, .23);
    color: white;
    display: inline-flex;
    font-size: 1.16rem;
    font-weight: 800;
    height: 43px;
    justify-content: center;
    width: 43px;
}
.brand strong {
    display: block;
    font-size: 1rem;
    letter-spacing: -.02em;
}
.brand small {
    color: var(--muted);
    display: block;
    font-size: .72rem;
    margin-top: .05rem;
}

.button {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 12px;
    display: inline-flex;
    font-size: .9rem;
    font-weight: 700;
    gap: .45rem;
    height: 43px;
    justify-content: center;
    padding: 0 1.1rem;
    transition: background .18s ease, border .18s ease, box-shadow .18s ease, color .18s ease;
}
.button-primary {
    background: var(--primary);
    box-shadow: 0 8px 20px rgba(49, 91, 234, .22);
    color: white;
}
.button-primary:hover { background: var(--primary-dark); }
.button-success { background: var(--success); color: white; }
.button-success:hover { background: var(--success-dark); }
.button-danger {
    background: #fff1f3;
    border-color: #ffd2da;
    color: var(--danger);
}
.button-danger:hover { background: #ffe6ea; }
.button-secondary {
    background: var(--primary-soft);
    border-color: #d7e2ff;
    color: var(--primary);
}
.button-secondary:hover { background: #dee8ff; }
.button-quiet {
    background: var(--surface);
    border-color: var(--line);
    color: var(--muted);
}
.button-quiet:hover { border-color: #cdd6e7; color: var(--ink); }
.button-large { height: 51px; width: 100%; }

/* Application shell */
.app-page {
    background: var(--bg);
    min-height: 100vh;
}
.app-header {
    backdrop-filter: blur(18px);
    background: rgba(255, 255, 255, .86);
    border-bottom: 1px solid rgba(228, 233, 243, .85);
    position: sticky;
    top: 0;
    z-index: 20;
}
.app-header-inner {
    align-items: center;
    display: flex;
    height: 72px;
    justify-content: space-between;
    margin: 0 auto;
    max-width: 1200px;
    padding: 0 24px;
}
.header-actions {
    align-items: center;
    display: flex;
    gap: 10px;
}
.account-name {
    color: var(--muted);
    font-size: .88rem;
    margin-right: 8px;
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.icon-button {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--muted);
    display: inline-flex;
    font-size: 1.45rem;
    height: 43px;
    justify-content: center;
    width: 43px;
}
.icon-button:hover { border-color: #ccd6e8; color: var(--ink); }
.icon-button svg { height: 20px; width: 20px; }
.dashboard {
    margin: 0 auto;
    max-width: 1200px;
    padding: 35px 24px 48px;
}
.hero {
    align-items: end;
    display: flex;
    gap: 22px;
    justify-content: space-between;
    margin-bottom: 27px;
}
.hero h1 {
    font-size: clamp(1.7rem, 3vw, 2.25rem);
    letter-spacing: -.055em;
    line-height: 1.18;
    margin: 0 0 .55rem;
}
.hero-copy {
    color: var(--muted);
    font-size: .93rem;
    margin: 0;
}
.hero-action { flex-shrink: 0; }
.hero-buttons {
    display: flex;
    flex-shrink: 0;
    gap: 10px;
}
.summary-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 20px;
}
.summary-grid-wide { grid-template-columns: repeat(4, 1fr); }
.summary-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(25, 39, 69, .03);
    min-height: 126px;
    padding: 20px 22px;
}
.summary-card.accent {
    background: linear-gradient(135deg, #315bea, #426cf4);
    border-color: transparent;
    color: white;
}
.summary-card span {
    color: var(--muted);
    display: block;
    font-size: .8rem;
    font-weight: 650;
    margin-bottom: 13px;
}
.summary-card.accent span, .summary-card.accent small { color: rgba(255, 255, 255, .77); }
.summary-card strong {
    display: block;
    font-size: clamp(1.45rem, 2vw, 1.75rem);
    letter-spacing: -.05em;
    line-height: 1.15;
}
.summary-card small {
    color: var(--muted);
    display: block;
    font-size: .77rem;
    margin-top: 7px;
}
.category-summary { font-size: 1.3rem !important; }
.work-grid {
    align-items: start;
    display: grid;
    gap: 20px;
    grid-template-columns: 370px 1fr;
    margin-bottom: 20px;
}
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
}
.priority-slot .capture-panel { margin-bottom: 20px; }
.capture-panel { grid-row: span 2; }
.result-panel, .chart-panel, .pie-panel { grid-column: 2; }
.panel-heading {
    align-items: start;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin-bottom: 21px;
}
.panel-heading h2 {
    font-size: 1.12rem;
    letter-spacing: -.035em;
    margin: 0;
}
.panel-heading.compact { margin-bottom: 14px; }
.muted { color: var(--muted); font-size: .78rem; }
.chart-heading { align-items: end; }
.compact-select {
    color: var(--muted);
    display: grid;
    font-size: .7rem;
    font-weight: 700;
    gap: 5px;
}
.compact-select select {
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--ink);
    height: 36px;
    padding: 0 10px;
}
.chart-note {
    color: var(--muted);
    font-size: .76rem;
    margin: -7px 0 2px;
}
.stack { display: grid; gap: 17px; }
.dropzone {
    align-items: center;
    background: var(--surface-soft);
    border: 1.5px dashed #cdd8eb;
    border-radius: 17px;
    display: flex;
    justify-content: center;
    min-height: 222px;
    padding: 16px;
    transition: border-color .18s ease, background .18s ease;
}
.dropzone.dragover {
    background: #f0f4ff;
    border-color: var(--primary);
}
.drop-content {
    align-items: center;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    font-size: .9rem;
    gap: 9px;
    text-align: center;
}
.drop-content strong { color: var(--ink); font-size: .92rem; }
.drop-content small { color: var(--muted); font-size: .76rem; }
.upload-icon {
    align-items: center;
    background: #edf2ff;
    border-radius: 50%;
    color: var(--primary);
    display: flex;
    height: 54px;
    justify-content: center;
    margin-bottom: 5px;
    width: 54px;
}
.upload-icon svg { height: 29px; width: 29px; }
.preview {
    align-items: center;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    font-size: .76rem;
    gap: 9px;
}
.preview img {
    border-radius: 12px;
    display: block;
    max-height: 178px;
    max-width: 100%;
    object-fit: contain;
}
.receipt-source-actions {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.source-button {
    cursor: pointer;
    position: relative;
    width: 100%;
}
.source-button:focus-visible {
    box-shadow: 0 0 0 3px rgba(49, 91, 234, .16);
}
.source-input {
    height: 1px;
    opacity: 0;
    position: absolute;
    width: 1px;
}
.provider-switch {
    border: 0;
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
}
.provider-switch legend {
    color: var(--ink);
    font-size: .84rem;
    font-weight: 650;
    padding: 0;
}
.provider-switch label {
    cursor: pointer;
}
.provider-switch input {
    height: 1px;
    opacity: 0;
    position: absolute;
    width: 1px;
}
.provider-switch {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.provider-switch legend {
    grid-column: 1 / -1;
}
.provider-switch span {
    align-items: center;
    background: var(--surface);
    border: 1px solid #d7dfec;
    border-radius: 11px;
    color: var(--muted);
    display: flex;
    font-size: .82rem;
    font-weight: 750;
    height: 42px;
    justify-content: center;
}
.provider-switch input:checked + span {
    background: var(--primary-soft);
    border-color: #cfdcff;
    color: var(--primary);
}
.field {
    color: var(--ink);
    display: grid;
    font-size: .84rem;
    font-weight: 650;
    gap: 7px;
}
.field small { color: var(--muted); font-size: .72rem; font-weight: 500; }
.field input, .field select {
    background: var(--surface);
    border: 1px solid #d7dfec;
    border-radius: 11px;
    color: var(--ink);
    height: 47px;
    min-width: 0;
    outline: none;
    padding: 0 13px;
    transition: border-color .16s ease, box-shadow .16s ease;
}
.field input:focus, .field select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(49, 91, 234, .13);
}
.field input::placeholder { color: #9aa5b9; font-weight: 450; }
.status-chip {
    background: #e8f7f1;
    border-radius: 20px;
    color: var(--success);
    font-size: .72rem;
    font-weight: 700;
    padding: 6px 10px;
}
.form-grid {
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.field-wide { grid-column: span 2; }
.money-field {
    align-items: center;
    background: var(--surface);
    border: 1px solid #d7dfec;
    border-radius: 11px;
    color: var(--muted);
    display: flex;
    gap: 4px;
    height: 47px;
    padding-left: 13px;
}
.money-field:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(49, 91, 234, .13);
}
.money-field input {
    border: 0;
    box-shadow: none !important;
    height: 100%;
    padding-left: 3px;
    text-align: right;
    width: 100%;
}
.panel-actions {
    display: flex;
    gap: 10px;
    justify-content: end;
    margin-top: 22px;
}
.spinner {
    animation: spin .7s linear infinite;
    border: 2px solid rgba(255,255,255,.35);
    border-radius: 50%;
    border-top-color: white;
    height: 17px;
    width: 17px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.bar-chart {
    align-items: end;
    display: flex;
    gap: clamp(10px, 3vw, 30px);
    height: 205px;
    justify-content: flex-start;
    overflow-x: auto;
    padding: 18px 8px 0;
}
.bar-chart.short { justify-content: center; }
.bar-chart.short .bar-column { flex: 1; }
.bar-chart.compact {
    gap: 8px;
}
.bar-chart.compact .bar-column {
    flex: 1 1 42px;
    min-width: 40px;
}
.bar-chart.compact .bar-value {
    font-size: .64rem;
}
.bar-column {
    align-items: center;
    display: flex;
    flex: 0 0 66px;
    flex-direction: column;
    height: 100%;
    justify-content: end;
    max-width: 82px;
    min-width: 38px;
}
.bar-value {
    color: var(--muted);
    font-size: .7rem;
    margin-bottom: 7px;
    white-space: nowrap;
}
.bar {
    background: linear-gradient(180deg, #5279f5, #315bea);
    border-radius: 8px 8px 4px 4px;
    min-height: 3px;
    width: min(100%, 58px);
}
.bar-level-1 { height: 12px; }
.bar-level-2 { height: 23px; }
.bar-level-3 { height: 34px; }
.bar-level-4 { height: 45px; }
.bar-level-5 { height: 56px; }
.bar-level-6 { height: 67px; }
.bar-level-7 { height: 78px; }
.bar-level-8 { height: 89px; }
.bar-level-9 { height: 100px; }
.bar-level-10 { height: 112px; }
.bar-label {
    color: var(--muted);
    font-size: .72rem;
    margin-top: 10px;
}
.chart-empty {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-size: .86rem;
    height: 100%;
}
.pie-layout {
    align-items: center;
    display: grid;
    gap: 24px;
    grid-template-columns: 190px minmax(0, 1fr);
    min-height: 213px;
    padding-top: 12px;
}
.donut-wrap {
    display: grid;
    height: 190px;
    place-items: center;
    position: relative;
    width: 190px;
}
.donut-chart {
    height: 190px;
    transform: rotate(-90deg);
    width: 190px;
}
.donut-base, .donut-segment {
    fill: none;
    stroke-linecap: butt;
    stroke-width: 28;
}
.donut-base { stroke: #edf1f9; }
.donut-center {
    display: grid;
    gap: 4px;
    inset: 0;
    place-content: center;
    position: absolute;
    text-align: center;
}
.donut-center span {
    color: var(--muted);
    font-size: .73rem;
    font-weight: 650;
}
.donut-center strong {
    font-size: 1.05rem;
    letter-spacing: -.04em;
}
.pie-legend {
    display: grid;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.legend-item {
    align-items: center;
    display: grid;
    font-size: .78rem;
    gap: 8px;
    grid-template-columns: 10px minmax(72px, 1fr) auto;
}
.legend-dot {
    border-radius: 50%;
    display: block;
    height: 10px;
    width: 10px;
}
.legend-value {
    color: var(--muted);
    white-space: nowrap;
}
.category-color-0 { background: #315bea; stroke: #315bea; }
.category-color-1 { background: #0f9f87; stroke: #0f9f87; }
.category-color-2 { background: #f19c38; stroke: #f19c38; }
.category-color-3 { background: #8d61df; stroke: #8d61df; }
.category-color-4 { background: #e34c6b; stroke: #e34c6b; }
.category-color-5 { background: #248fc4; stroke: #248fc4; }
.category-color-6 { background: #7bb248; stroke: #7bb248; }
.category-color-7 { background: #d37032; stroke: #d37032; }
.history-panel { padding-bottom: 18px; }
.history-heading { align-items: center; }
.filter-panel {
    background: var(--surface-soft);
    border: 1px solid #edf1f8;
    border-radius: 16px;
    margin-bottom: 17px;
    padding: 16px;
}
.quick-filters {
    display: flex;
    gap: 7px;
    margin-bottom: 14px;
}
.quick-filter {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 21px;
    color: var(--muted);
    font-size: .77rem;
    font-weight: 700;
    height: 34px;
    padding: 0 15px;
}
.quick-filter:hover, .quick-filter.active {
    background: var(--primary-soft);
    border-color: #cfdcff;
    color: var(--primary);
}
.filter-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(210px, 2fr) minmax(150px, 1fr) minmax(148px, 1fr) minmax(148px, 1fr);
}
.filter-grid-small {
    grid-template-columns: repeat(3, minmax(140px, 190px));
    margin-top: 13px;
}
.more-filters {
    color: var(--primary);
    font-size: .8rem;
    font-weight: 650;
    margin-top: 12px;
}
.more-filters summary {
    cursor: pointer;
    display: inline-flex;
    list-style: none;
}
.more-filters summary::-webkit-details-marker { display: none; }
.more-filters summary::after {
    content: "+";
    margin-left: 7px;
}
.more-filters[open] summary::after { content: "-"; }
.filter-actions {
    align-items: center;
    border-top: 1px solid #e8edf7;
    display: flex;
    gap: 9px;
    justify-content: end;
    margin-top: 14px;
    padding-top: 14px;
}
.filter-result {
    color: var(--muted);
    flex: 1;
    font-size: .8rem;
    margin: 0;
}
.desktop-table {
    border: 1px solid var(--line);
    border-radius: 15px;
    overflow: hidden;
}
table {
    border-collapse: collapse;
    font-size: .87rem;
    width: 100%;
}
thead { background: #f8faff; color: var(--muted); }
th {
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .04em;
    padding: 14px 17px;
    text-align: left;
}
td {
    border-top: 1px solid #eef2f8;
    padding: 15px 17px;
}
.payee-purpose {
    color: var(--muted);
    display: block;
    font-size: .74rem;
    margin-top: 4px;
}
.amount-breakdown {
    color: var(--muted);
    display: block;
    font-size: .72rem;
    font-weight: 650;
    margin-top: 4px;
}
td.amount, th.amount { text-align: right; }
.record-category {
    background: var(--surface-soft);
    border-radius: 20px;
    color: #59667b;
    display: inline-flex;
    font-size: .75rem;
    font-weight: 650;
    padding: 5px 10px;
}
.receipt-link { color: var(--primary); font-size: .82rem; font-weight: 700; }
.receipt-link:hover { text-decoration: underline; }
.table-actions {
    display: flex;
    gap: 6px;
}
.text-button {
    background: transparent;
    border: 0;
    color: var(--primary);
    font-size: .79rem;
    font-weight: 700;
    padding: 5px;
}
.text-button:hover { text-decoration: underline; }
.mobile-cards { display: none; }
.empty-state {
    color: var(--muted);
    font-size: .9rem;
    padding: 36px 0;
    text-align: center;
}
.pagination {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-size: .84rem;
    gap: 12px;
    justify-content: end;
    margin-top: 15px;
}

/* Modal and notifications */
.modal {
    align-items: center;
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 18px;
    position: fixed;
    z-index: 50;
}
.modal-backdrop {
    background: rgba(14, 23, 40, .46);
    inset: 0;
    position: absolute;
}
.modal-card {
    background: var(--surface);
    border-radius: 22px;
    box-shadow: 0 24px 70px rgba(14, 23, 40, .2);
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    padding: 25px;
    position: relative;
    width: min(440px, 100%);
}
.modal-card-wide { width: min(620px, 100%); }
.record-document {
    align-items: center;
    background: var(--surface-soft);
    border-radius: 11px;
    color: var(--muted);
    display: flex;
    font-size: .82rem;
    justify-content: space-between;
    min-height: 44px;
    padding: 0 13px;
}
.spread-actions { justify-content: space-between; }
.action-group { display: flex; gap: 10px; }
.modal-heading {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}
.modal-heading h2 { font-size: 1.18rem; letter-spacing: -.04em; margin: 0; }
.preference-zone {
    background: var(--surface-soft);
    border: 1px solid #edf1f8;
    border-radius: 15px;
    margin-bottom: 23px;
    padding: 16px;
}
.preference-zone h3, .settings-subheading {
    font-size: .91rem;
    margin: 0 0 14px;
}
.settings-subheading { margin-bottom: 16px; }
.toggle-row {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 15px;
    justify-content: space-between;
}
.toggle-row strong {
    display: block;
    font-size: .86rem;
    margin-bottom: 5px;
}
.toggle-row small {
    color: var(--muted);
    display: block;
    font-size: .73rem;
    font-weight: 500;
    line-height: 1.45;
}
.toggle-control {
    display: block;
    flex-shrink: 0;
    height: 28px;
    position: relative;
    width: 49px;
}
.toggle-control input {
    height: 1px;
    opacity: 0;
    position: absolute;
    width: 1px;
}
.toggle-track {
    background: #c9d2e3;
    border-radius: 20px;
    display: block;
    height: 28px;
    position: relative;
    transition: background .18s ease;
    width: 49px;
}
.toggle-track::after {
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(19, 31, 54, .2);
    content: "";
    height: 22px;
    left: 3px;
    position: absolute;
    top: 3px;
    transition: transform .18s ease;
    width: 22px;
}
.toggle-control input:checked + .toggle-track { background: var(--primary); }
.toggle-control input:checked + .toggle-track::after { transform: translateX(21px); }
.toggle-control input:focus-visible + .toggle-track {
    box-shadow: 0 0 0 3px rgba(49, 91, 234, .18);
}
.danger-zone {
    border-top: 1px solid var(--line);
    margin-top: 25px;
    padding-top: 21px;
}
.danger-zone h3 {
    color: var(--danger);
    font-size: .94rem;
    margin: 0 0 7px;
}
.danger-zone p {
    color: var(--muted);
    font-size: .79rem;
    line-height: 1.55;
    margin: 0 0 15px;
}
.toast {
    background: #1c283e;
    border-radius: 13px;
    bottom: 24px;
    box-shadow: 0 14px 38px rgba(16, 25, 42, .22);
    color: white;
    font-size: .88rem;
    left: 50%;
    max-width: min(450px, calc(100vw - 32px));
    padding: 13px 18px;
    position: fixed;
    transform: translateX(-50%);
    z-index: 60;
}
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }

/* Login */
.auth-page {
    background: #f5f7fc;
    min-height: 100vh;
}
.auth-layout {
    display: grid;
    grid-template-columns: minmax(390px, 47%) 1fr;
    min-height: 100vh;
}
.auth-intro {
    background: linear-gradient(142deg, #243fd0 0%, #315bea 48%, #29bba9 120%);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(42px, 8vw, 94px);
}
.brand-light { color: white; margin-bottom: clamp(55px, 12vh, 105px); }
.brand-light .brand-mark {
    background: rgba(255,255,255,.18);
    box-shadow: none;
}
.auth-intro .eyebrow { color: rgba(255,255,255,.7); }
.auth-intro h1 {
    font-size: clamp(2rem, 3.5vw, 2.75rem);
    letter-spacing: -.065em;
    line-height: 1.27;
    margin: 0 0 20px;
}
.auth-copy {
    color: rgba(255,255,255,.82);
    font-size: .95rem;
    line-height: 1.85;
    margin: 0 0 39px;
    max-width: 370px;
}
.feature-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.feature-pills span {
    background: rgba(255,255,255,.13);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 30px;
    font-size: .78rem;
    padding: 9px 16px;
}
.auth-panel {
    align-items: center;
    display: flex;
    justify-content: center;
    padding: 32px;
}
.auth-card { width: min(390px, 100%); }
.auth-card-heading { margin-bottom: 29px; }
.auth-card-heading h2 {
    font-size: 1.9rem;
    letter-spacing: -.055em;
    margin: 0 0 10px;
}
.auth-card-heading > p:last-child { color: var(--muted); font-size: .9rem; margin: 0; }
.auth-form { display: grid; gap: 19px; }
.auth-form .button { margin-top: 12px; }
.password-field { position: relative; }
.password-field input { padding-right: 59px; width: 100%; }
.text-action {
    background: transparent;
    border: 0;
    color: var(--primary);
    font-size: .78rem;
    font-weight: 700;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}
.notice {
    border: 1px solid;
    border-radius: 11px;
    font-size: .82rem;
    line-height: 1.5;
    margin-bottom: 20px;
    padding: 11px 13px;
}
.notice-error { background: #fff1f3; border-color: #ffd3db; color: var(--danger); }
.notice-warning { background: #fff8e9; border-color: #f3ddb3; color: var(--warning); }

@media (max-width: 900px) {
    .dashboard { padding: 25px 18px 34px; }
    .work-grid { grid-template-columns: 1fr; }
    .capture-panel { grid-row: auto; }
    .result-panel, .chart-panel, .pie-panel { grid-column: auto; }
    .auth-layout { grid-template-columns: 1fr; }
    .auth-intro {
        display: block;
        padding: 30px 26px 34px;
    }
    .brand-light { margin-bottom: 28px; }
    .auth-intro h1 { font-size: 1.8rem; }
    .auth-copy { margin-bottom: 20px; }
    .auth-panel { padding: 35px 24px 48px; }
    .summary-grid-wide { grid-template-columns: repeat(2, 1fr); }
    .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .app-header-inner { height: 64px; padding: 0 16px; }
    .brand strong { font-size: .93rem; }
    .brand small, .account-name { display: none; }
    .brand-mark { height: 39px; width: 39px; }
    .header-actions .button { font-size: .8rem; padding: 0 .8rem; }
    .hero { align-items: start; flex-direction: column; margin-bottom: 22px; }
    .hero-buttons { width: 100%; }
    .hero-buttons .button { flex: 1; padding: 0 .65rem; }
    .summary-grid {
        gap: 10px;
        grid-template-columns: repeat(2, 1fr);
    }
    .summary-card {
        min-height: 106px;
        padding: 15px;
    }
    .summary-card:first-child { grid-column: span 2; }
    .summary-grid-wide .summary-card:last-child { grid-column: span 2; }
    .panel { border-radius: 19px; padding: 18px; }
    .dropzone { min-height: 194px; }
    .app-page.input-priority .hero { margin-top: 4px; }
    .app-page.input-priority .priority-slot .capture-panel { border-color: #d9e3ff; }
    .form-grid { grid-template-columns: 1fr; }
    .field-wide { grid-column: auto; }
    .panel-actions .button { flex: 1; }
    .desktop-table { display: none; }
    .filter-grid, .filter-grid-small { grid-template-columns: 1fr; }
    .filter-actions { flex-wrap: wrap; }
    .filter-result { flex-basis: 100%; margin-bottom: 4px; }
    .mobile-cards { display: grid; gap: 10px; }
    .record-card {
        background: var(--surface-soft);
        border: 1px solid #edf1f7;
        border-radius: 13px;
        padding: 14px;
    }
    .record-card-top, .record-card-bottom {
        align-items: center;
        display: flex;
        justify-content: space-between;
    }
    .record-card-top { margin-bottom: 10px; }
    .record-card-date { color: var(--muted); font-size: .77rem; }
    .record-card-payee {
        font-size: .91rem;
        font-weight: 700;
        margin: 0 0 12px;
    }
    .record-card-purpose {
        color: var(--muted);
        font-size: .78rem;
        margin: -7px 0 12px;
    }
    .record-card-amount { font-size: 1rem; font-weight: 750; }
    .record-card-actions {
        border-top: 1px solid #e9eef7;
        display: flex;
        gap: 12px;
        margin-top: 12px;
        padding-top: 9px;
    }
    .pagination { justify-content: space-between; }
    .pie-layout { grid-template-columns: 1fr; }
    .donut-wrap { margin: 0 auto; }
    .spread-actions { align-items: stretch; flex-direction: column-reverse; }
    .action-group .button { flex: 1; }
    .spread-actions > .button { width: 100%; }
}
