/* Shared presentation layer. Accounting and report behavior stays in index.html. */
@media screen {
    [hidden] { display: none !important; }
    .owner-only { display: none !important; }
    html.account-dialog-open, html.calendar-dialog-open { overflow: hidden; }
    .calendar-reminder-dialog > label, .calendar-reminder-fields > label { display: block; font-size: .8rem; font-weight: 650; color: #52637d; margin: 15px 0 7px; }
    .calendar-reminder-check { display: flex; align-items: center; gap: 10px; padding: 9px 0; font-size: .85rem; }
    .calendar-reminder-check input { width: 18px; height: 18px; min-height: 0; margin: 0; }
    .calendar-reminder-actions { display: flex; flex-direction: column; align-items: stretch; gap: 10px; margin-top: 20px; }
    .calendar-reminder-actions a { text-align: center; text-decoration: none; padding: 12px; }
    .calendar-reminder-actions button:disabled { opacity: .5; cursor: default; }
    .calendar-reminder-note { padding-top: 12px; border-top: 1px solid #e8edf4; }
    .calendar-event-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #e8edf4; flex-wrap: wrap; }
    .account-dialog { width: min(520px, calc(100% - 28px)); max-height: min(88dvh, 900px); padding: 24px; margin: auto; border: 1px solid #e2e8f2; border-radius: 22px; color: #192b46; background: #fff; box-shadow: 0 24px 100px #13274635; overscroll-behavior: contain; }
    .account-dialog::backdrop { background: #10213c80; backdrop-filter: blur(4px); }
    .settings-dialog { width: min(640px, calc(100% - 28px)); background: #f6f8fc; }
    .dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
    .dialog-heading h2 { margin: 5px 0 0; font-size: 1.35rem; letter-spacing: -.04em; }
    .dialog-eyebrow { font-size: .65rem; font-weight: 700; letter-spacing: .1em; color: #71809a; }
    .dialog-close { flex-shrink: 0; width: 38px; height: 38px; border: 1px solid #e1e7f0; border-radius: 12px; background: #fff; color: #617089; font-size: 1.6rem; line-height: 1; }
    .account-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; background: #f1f4f9; padding: 5px; border-radius: 12px; margin-bottom: 18px; }
    .account-tabs button { border: 0; border-radius: 9px; background: transparent; color: #617089; padding: 12px 6px; font-size: .85rem; font-weight: 650; }
    .account-tabs button[aria-selected="true"] { background: #fff; color: #2563eb; box-shadow: 0 2px 7px #172b4d0a; }
    .request-status-card { background: #f5f8ff; border: 1px solid #dde7f7; border-radius: 14px; margin-top: 20px; padding: 16px; }
    .account-trigger { background: #edf3ff; color: #2058c7; border-color: #dbe7ff; }
    .settings-trigger { display: inline-flex; align-items: center; gap: 7px; }
    .settings-trigger svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
    .settings-heading { font-size: 1rem; font-weight: 750; margin-bottom: 14px; }
    .settings-description { font-size: .82rem; line-height: 1.65; color: #617089; overflow-wrap: anywhere; margin: 8px 0 14px; }
    .settings-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
    .account-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: .85rem; overflow-wrap: anywhere; }
    .account-role { background: #edf3ff; color: #2058c7; border-radius: 7px; padding: 5px 9px; font-weight: 650; font-size: .75rem; }
    .access-message { margin-bottom: 18px; border-radius: 12px; padding: 14px 16px; background: #edf6ff; color: #2058a7; border: 1px solid #d4e5fb; font-size: .85rem; line-height: 1.6; }
    .access-message.error { background: #fff2f3; color: #b13045; border-color: #f4d5da; }
    #accountAccessRoot form label { display: block; font-size: .78rem; color: #52637d; margin: 12px 0 6px; }
    #accountAccessRoot form { max-width: 520px; }
    #accountAccessRoot button:disabled { cursor: wait; opacity: .55; }
    .access-request-row { padding: 18px 0; border-bottom: 1px solid #e8edf4; }
    .access-request-row:last-child { border-bottom: 0; }
    :root {
        --primary: #172b4d;
        --primary-grad: linear-gradient(110deg, #2463eb, #2463eb);
        --accent: #2563eb;
        --accent-grad: linear-gradient(110deg, #2563eb, #2563eb);
        --bg-color: #f3f5f9;
        --card-bg: #fff;
        --card-border: 1px solid #e8edf4;
        --shadow-soft: 0 3px 16px rgba(24, 43, 77, .035);
        --text-main: #192b46;
        --text-sub: #617089;
        --income: #2563eb;
        --expense: #d34857;
    }
    body { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
    button, input, select { font-family: inherit; }
    button { cursor: pointer; }
    button:focus-visible, [tabindex]:focus-visible, input:focus-visible, select:focus-visible {
        outline: 3px solid #7aa7ff; outline-offset: 3px;
    }
    .app-container { max-width: 880px; }
    header { margin: 24px 24px 0; padding: 26px; background: #fff; color: var(--text-main); border: var(--card-border); border-radius: 24px; box-shadow: var(--shadow-soft); overflow: visible; }
    header::before { display: none; }
    .header-top { gap: 20px; margin-bottom: 26px; }
    .club-title { gap: 10px; font-size: 1.2rem; text-shadow: none; letter-spacing: -.04em; }
    .brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: #2563eb; color: #fff; font-size: 18px; font-weight: 800; letter-spacing: -.06em; }
    .brand-copy { display: flex; flex-direction: column; line-height: 1.3; }
    .brand-copy small { margin-top: 3px; color: #71809a; font-size: .68rem; font-weight: 500; letter-spacing: .02em; }
    .ver-tag { background: #eef4ff; color: #2563eb; border: 0; border-radius: 6px; font-size: .6rem; padding: 4px 7px; transform: none; }
    .backup-btns { flex-wrap: wrap; gap: 6px; }
    .btn-backup, .admin-login-btn { background: #f4f6fa; color: #465774; border: 1px solid #e5eaf2; backdrop-filter: none; border-radius: 9px; min-height: 38px; }
    .btn-save-exit { background: #edf3ff; color: #2058c7; border: 1px solid #dbe7ff; box-shadow: none; min-height: 38px; margin-left: 0; }
    .admin-login-btn.logged-in { background: #edf3ff; color: #2058c7; border-color: #dbe7ff; box-shadow: none; }
    .total-asset-box { text-align: left; background: #172e52; color: #fff; padding: 25px 26px; border-radius: 18px; margin-bottom: 16px; }
    .balance-label { color: #c7d5eb; opacity: 1; font-weight: 500; font-size: .84rem; margin-bottom: 10px; }
    .balance-amount { font-size: clamp(1.8rem, 6vw, 2.7rem); font-weight: 750; letter-spacing: -.045em; text-shadow: none; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
    .balance-total-with-unpaid { color: #c1d6fc; opacity: 1; font-size: .8rem; font-weight: 500; margin-top: 12px; }
    #bankInfoArea { background: #f1f5fc !important; box-shadow: none !important; border: 1px solid #e5ebf5; padding: 13px 16px !important; text-align: left !important; margin: 0 0 16px !important; border-radius: 12px !important; }
    #bankInfoArea span { color: #526580 !important; font-weight: 500 !important; font-size: .75rem !important; }
    #dispBank { color: #243e64 !important; font-size: .94rem !important; overflow-wrap: anywhere; }
    .stats-row { gap: 0; background: #f8fafd; border: 1px solid #edf1f7; border-radius: 14px; padding: 16px 0; }
    .stat-card { min-width: 0; background: none; border: 0; border-radius: 0; border-right: 1px solid #e2e8f1; padding: 0 14px; text-align: left; box-shadow: none; backdrop-filter: none; }
    .stat-card:last-child { border-right: 0; }
    .stat-label, .stat-card .stat-label { color: #617089 !important; font-size: .75rem; font-weight: 500; opacity: 1; margin-bottom: 6px; }
    .stat-val { font-size: 1.08rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
    #dispInc { color: #2563eb !important; }
    #dispExp { color: #d34857 !important; }
    #dispDon { color: #137b76 !important; }
    .page { padding: 28px 24px; }
    .section-header { gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
    .section-title { font-size: 1.2rem; color: #192b46; font-weight: 750; }
    .card, .filter-container { border-radius: 18px; padding: 22px; backdrop-filter: none; }
    .btn-main { box-shadow: none; font-size: .96rem; border-radius: 11px; min-height: 48px; }
    .btn-sub { box-shadow: none; border-radius: 9px; min-height: 38px; }
    .btn-sub:hover { transform: none; background: #eef3fb; }
    input, select { border-color: #e1e7f0; background: #fafbfd; border-radius: 10px; min-height: 46px; }
    input:focus, select:focus { border-color: #2563eb; box-shadow: 0 0 0 3px #2563eb15; }
    input[type=checkbox], input[type=radio] { min-height: auto; accent-color: #2563eb; }
    .filter-label, .ti-date, .u-months { color: #68768e; }
    .filter-chip { background: #f1f4f9; color: #52637d; border-radius: 9px; padding: 9px 14px; }
    .filter-chip.active, .page-btn.active { background: #2563eb; color: #fff; box-shadow: none; transform: none; }
    .ledger-summary-box { background: #f7f9fd; box-shadow: none; border-color: #e5ebf4; }
    .monthly-overview-head { margin-bottom: 11px; }
    .monthly-overview-title { color: #40516c; font-size: .84rem; }
    .monthly-overview-period { color: #617089; }
    .monthly-overview-grid { gap: 10px; }
    .monthly-overview-card { text-align: left; padding: 16px; border-radius: 14px; box-shadow: none; border-color: #e5ebf4; }
    .monthly-overview-label { color: #617089; font-size: .73rem; margin-bottom: 9px; }
    .monthly-overview-value { font-size: 1.04rem; font-weight: 750; white-space: normal; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
    .monthly-overview-card.donation .monthly-overview-value { color: #137b76; }
    .trans-item { padding: 18px 0; }
    .ti-cat { background: #eef2f8; color: #52637d; font-weight: 500; }
    .ti-amt, .money-cell, .u-amt { font-variant-numeric: tabular-nums; }
    .dynamic-quick-box { background: #f6f8fd; border-color: #e3eaf5; }
    .dynamic-quick-title { color: #405a81; }
    .dynamic-quick-note { color: #617089; }
    .dynamic-quick-chip { border-color: #e0e7f1; box-shadow: none; }
    .member-table-wrap, .unpaid-card, .receipt-item { border-color: #e5ebf4; box-shadow: none; }
    .m-role { background: #eef3ff; color: #315ca5; box-shadow: none; text-shadow: none; }
    .nav-bar { max-width: 832px; padding: 10px 8px calc(10px + env(safe-area-inset-bottom)); background: #fff; border: 1px solid #e5ebf4; border-bottom: 0; border-radius: 20px 20px 0 0; box-shadow: 0 -4px 24px #172b4d06; }
    .nav-item { font-family: inherit; background: none; border: 0; border-radius: 12px; padding: 8px 0; color: #6d7b91; font-size: .73rem; font-weight: 500; min-width: 0; }
    .nav-item.active { background: #edf3ff; color: #2563eb; transform: none; font-weight: 700; }
    .nav-icon { display: block; width: 23px; height: 23px; margin: 0 auto 5px; filter: none; }
    .nav-icon svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
    .fab { right: max(20px, calc((100vw - 832px) / 2 + 16px)); border-radius: 18px; box-shadow: 0 6px 18px #2563eb30; }
    .modal { background: #fff; border-color: #e5ebf4; border-radius: 20px; }
    .modal-wrap { background: #14233d66; backdrop-filter: blur(3px); }
    @media (max-width: 600px) {
        .header-top .ver-tag { display: none; }
        .account-dialog { padding: 20px; max-height: 90dvh; }
        header { margin: 12px 12px 0; padding: 18px; border-radius: 20px; }
        .header-top { display: flex; align-items: center; margin-bottom: 20px; gap: 12px; }
        .club-title { font-size: 1.1rem; margin-bottom: 0; gap: 8px; }
        .backup-btns { display: flex; width: auto; flex: 1 1 auto; justify-content: flex-end; }
        .btn-backup, .btn-save-exit { width: auto; padding: 8px 10px; font-size: .7rem; }
        .admin-login-btn { width: 38px; padding: 0; flex-shrink: 0; font-size: 1rem; }
        .total-asset-box { padding: 22px 20px; margin-bottom: 14px; }
        .stats-row { gap: 0; padding: 14px 0; }
        .stat-card { padding: 0 10px; border-radius: 0; }
        .stat-val { font-size: .94rem; }
        .page { padding: 24px 14px; }
        .card, .filter-container { padding: 17px; }
        #page-ledger .section-header { align-items: flex-start; }
        #page-ledger .section-header > div:last-child { justify-content: flex-start !important; }
        .monthly-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        .monthly-overview-card { padding: 14px; }
        .nav-bar { width: 100%; border-radius: 18px 18px 0 0; }
    }
    @media (prefers-reduced-motion: reduce) {
        .page { animation: none; }
        *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
    }
}
