﻿/* One visual language for local and shared books. */
/* Visual tokens keep the soft palette consistent across every entry point. */
[hidden]{display:none!important}
.flow-nav,.app-nav{transform:none!important;box-sizing:border-box}
html{scroll-padding-bottom:110px}input,select,button,summary,a{scroll-margin-block:90px}main>*{min-width:0}button,a,summary{touch-action:manipulation}
.task-filter{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}.task-filter button[aria-pressed=true]{background:#e7dbf5;border-color:#a990c3;color:#44365a}
.skip-link{position:fixed;top:8px;left:12px;z-index:100;transform:translateY(-180%);padding:12px 18px;background:#fffefa;color:#30445a;border:2px solid #365f86;border-radius:12px}.skip-link:focus{transform:none}
#settle-next{background:#fff4da;border-color:#e7d6aa;color:#5b4e30;font-weight:650}
@media(max-width:560px){input,select,textarea{font-size:16px!important}.shared-grid>*{min-width:0}.page-options-body{align-items:stretch}.page-options-body>button{flex:1 1 140px}header{flex-wrap:wrap}.flow-nav a,.app-nav a,.app-nav button{min-width:0;white-space:normal}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation:none!important;transition:none!important}}
.page-options{margin:14px 0;padding:8px 12px;border:1px solid #d5e1ed;border-radius:16px;background:#f1f5fa}.page-options>summary{display:flex;align-items:center;gap:10px;min-height:44px;padding:8px 12px;cursor:pointer;font-weight:650;color:#435c73;list-style:none;border-radius:12px;background:#e6edf5}.page-options>summary::-webkit-details-marker{display:none}.page-options>summary:before{content:'•••';letter-spacing:2px}.page-options>summary:after{content:'展開';margin-left:auto;font-size:12px}.page-options[open]>summary:after{content:'收起'}.page-options-body{display:flex;gap:10px;flex-wrap:wrap;padding:12px 0 4px;align-items:center}.page-options-body>p,.page-options-body>.book-bar,.page-options-body>.backup-entry{width:100%}.account-line>.page-options{margin:0;margin-left:auto}
:root{--ui-blue:#e0effb;--ui-lilac:#eee3fa;--ui-mint:#e4f3eb;--ui-peach:#fff0e6;--ui-ink:#30445a;--ui-edge:#d5e1ed}
body{background:#f5f8fc;color:var(--ui-ink);font-family:system-ui,-apple-system,"Segoe UI","Microsoft JhengHei",sans-serif}main{padding-bottom:100px!important}h1,h2,h3{letter-spacing:.015em;color:var(--ui-ink)}
.card,.receipt,dialog{border:1px solid var(--ui-edge);border-radius:24px;background:#fffefa;box-shadow:0 5px 0 #e4ecf5}.heading,.shared-hero{background:linear-gradient(115deg,#e0effb,#eee7fa);border:1px solid #d8e5f0;border-radius:26px}
button,.primary,.quiet,.result-link,.back-link,.text-button,main a[href]:not(.book-tile),header a:not(.brand){box-sizing:border-box;min-height:44px;padding:11px 18px;border:1px solid #bdcede;border-radius:15px;font:inherit;font-weight:650;background:var(--ui-blue);color:var(--ui-ink);text-decoration:none;cursor:pointer;box-shadow:0 3px 0 #d2dfeb;display:inline-flex;align-items:center;justify-content:center;gap:8px;max-width:100%;overflow-wrap:anywhere}
button.primary,a.result-link,.shared-entry a{background:#e7dbf5;color:#44365a;border-color:#c6b1de;box-shadow:0 3px 0 #d2c0e5}.quiet,.back-link{background:#edf3f8}.shared-entry{background:linear-gradient(110deg,#e1effb,#efe4fa);padding:24px;gap:20px}.shared-entry a{min-height:60px;padding:16px 26px;font-size:18px;white-space:normal}
button:hover:not(:disabled),main a[href]:hover,header a:not(.brand):hover{filter:brightness(.97);border-color:#8da9c2}button:active:not(:disabled),main a[href]:active{transform:translateY(1px);box-shadow:none}button:disabled{opacity:.5;cursor:not-allowed;box-shadow:none}
button:focus-visible,a:focus-visible,summary:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #567fa3;outline-offset:3px}
[role=status]:not(:empty),.scope-note,.draft-note,.save-note,.hint:not(:empty),.footnote,.connection:not(:empty),#cash-saved:not(:empty),#settle-ready:not(:empty),#settle-snapshot:not(:empty){padding:12px 16px;border:1px solid #cfe1d7;border-radius:16px;background:var(--ui-mint);color:#355649;line-height:1.6;font-size:14px;overflow-wrap:anywhere}
[role=alert]:not(:empty),.error:not(:empty){padding:12px 16px;border:1px solid #e8c2b6;border-radius:16px;background:#fff0eb;color:#893f32;line-height:1.6;font-size:14px;overflow-wrap:anywhere}[role=status]:empty,[role=alert]:empty{display:none}
#change-result:not(:empty){background:#fff4da;border-color:#e7d6aa;color:#5b4e30}#change-result p{margin:8px 0}#settle-members li{border:1px solid #cfe1d7}.shared-main footer,main footer{color:#657587;font-size:12px;line-height:1.6}
.flow-nav,.app-nav{position:fixed;bottom:0;left:0;right:0;z-index:20;display:flex;justify-content:center;gap:6px;padding:8px 12px calc(8px + env(safe-area-inset-bottom));border:0;border-top:1px solid var(--ui-edge);border-radius:0;background:#fffefaf5;box-shadow:0 -4px 18px #30445a0c;max-width:none;width:auto;margin:0}
.flow-nav a,.app-nav a,.app-nav button{flex:1;max-width:180px;min-height:48px;padding:8px 10px;display:flex;align-items:center;justify-content:center;gap:6px;border:1px solid #d5e1ed;border-radius:14px;background:#eaf1f8;color:var(--ui-ink);text-decoration:none;box-shadow:0 2px 0 #dce5ef;font-size:14px;font-weight:650}.flow-nav [aria-current=page],.app-nav [aria-current=page]{background:#e7dbf5;border-color:#bea5d6;color:#493960;box-shadow:0 2px 0 #d2c0e5}
dialog::backdrop{background:#30445a66}input,select{border:1px solid #c4d4e2;border-radius:12px;background:#fff;color:var(--ui-ink);font:inherit}body header .brand{border-radius:14px}body header .pill{background:var(--ui-lilac);color:#59466e}
@media(max-width:560px){.shared-entry{padding:18px;display:flex;flex-direction:column;align-items:stretch}.shared-entry a{width:100%;font-size:17px}.flow-nav a,.app-nav a,.app-nav button{padding:8px 5px;font-size:13px}.heading{padding:20px}.heading h1{font-size:28px}.hero-buddy{display:none}.scope-note{font-size:13px}body header .pill{display:none}}

/* Refined hierarchy: one strong action, quiet supporting surfaces. */
.shared-main button.primary,.shared-main a.result-link{min-height:56px;padding:15px 22px;font-size:17px}
#cash-save,#cash-confirm,#settle-confirm,#settle-lock,#change-calculate{width:100%;margin-block:12px 4px}
.shared-main .page-options>summary,.shared-main details>summary{font-size:14px;min-height:44px}
.shared-main .page-options{box-shadow:none}.cash-shortcuts{margin:10px 0}
.shared-main .quiet{font-size:14px;min-height:44px}
#settle-status,#cash-status,#ledger-status{font-size:13px;background:#f1f5f8;border-color:#dbe4ec;color:#506478;padding:8px 12px}
#settle-next{font-size:16px;padding:14px 16px}
:root{--ui-primary:#dfcef3;--ui-primary-ink:#44325e;--ui-surface:#fffefa;--ui-muted:#586b7e}
body{background:linear-gradient(155deg,#f4f7fc 0%,#faf6fc 55%,#f3faf7 100%);background-attachment:fixed;line-height:1.55}
body header{border-bottom:1px solid #e1e7ef;background:#fffefa}
.card,.receipt,dialog{border-color:#dce4ee;box-shadow:0 6px 22px #30445a08;border-radius:22px}
.shared-hero,.heading{position:relative;border-color:#d8dfee;background:linear-gradient(110deg,#e5f1fc 0%,#eee4f8 75%,#f7e9ef 100%);box-shadow:none}
.shared-hero{padding:20px 24px;margin-bottom:18px;border-left:5px solid #baa2d5}
.shared-hero h1{font-size:clamp(24px,4vw,32px);font-weight:750;line-height:1.25;letter-spacing:.025em}
.shared-hero>p:not(.eyebrow){color:#506079;max-width:52ch;font-size:14px;margin-top:8px}
.shared-card h2{font-size:19px;font-weight:750;line-height:1.4}.shared-card h3{font-size:17px;line-height:1.45}
button,.quiet,main a[href]:not(.book-tile),header a:not(.brand){box-shadow:none;border-color:#c9d7e4}
button.primary,a.result-link,.shared-entry a{background:var(--ui-primary);color:var(--ui-primary-ink);border-color:#b49bcf;box-shadow:0 3px 0 #c3abdd;font-weight:750;min-height:48px}
button.primary:hover:not(:disabled),a.result-link:hover{background:#d6c1ed;border-color:#9273b5;filter:none}
button.quiet,.back-link,header a:not(.brand){background:#f2f6fa;color:#485f76}
button:disabled{opacity:.6}
input:not([type=checkbox]):not([type=radio]),select{box-sizing:border-box;max-width:100%;border-color:#cbd7e3;background:#fff;border-radius:12px;min-height:46px}
input:not([type=checkbox]):not([type=radio]):focus,select:focus{border-color:#9879b8;background:#fdfaff}
label{color:#40566b}input::placeholder{color:#5c7085;opacity:1}
#cash-fields{gap:10px}
#cash-fields label{display:flex;flex-direction:column;gap:4px;border:1px solid #dce5ef;border-radius:16px;padding:10px;background:#f3f8fc;font-weight:650;min-width:0}
#cash-fields label:nth-child(3n+2){background:#f5effb;border-color:#e4d8ee}
#cash-fields label:nth-child(3n){background:#eef7f1;border-color:#d8e9df}
#cash-fields input{font-size:20px;font-weight:750;text-align:center;margin:2px 0 0;padding:8px 4px;font-variant-numeric:tabular-nums}
#cash-total{padding:14px 16px;border-radius:16px;background:#eee4f8;color:#44325e;font-variant-numeric:tabular-nums;border:1px solid #dacbe9}
[role=status]:not(:empty),.scope-note,.draft-note,.save-note,.hint:not(:empty),.footnote,.connection:not(:empty),#cash-saved:not(:empty),#settle-ready:not(:empty),#settle-snapshot:not(:empty){box-shadow:none;border-radius:14px;padding:10px 14px}
.scope-note,.footnote{background:#f2f5f9;border-color:#dce4ec;color:var(--ui-muted)}
#settle-next{border-left:4px solid #c6a44f}
.page-options{background:#f5f7fa;border-color:#e0e6ed;padding:6px;border-radius:15px}.page-options>summary{background:transparent;color:#526579;box-shadow:none}
.page-options-body{padding:10px 8px 4px}
#shared-books button{min-height:66px;justify-content:flex-start;padding:16px 18px;background:#edf4fc;border-color:#cfdeee;font-weight:750}
#shared-books button:hover{background:#e5edf9}
.flow-nav,.app-nav{gap:8px;background:#fffefa;border-top-color:#dce4ee;box-shadow:0 -4px 20px #30445a08}
.flow-nav a,.app-nav a,.app-nav button{background:#f0f4f8;border-color:transparent;box-shadow:none;color:#53677c;border-radius:15px;position:relative;min-height:50px}
.flow-nav [aria-current=page],.app-nav [aria-current=page]{background:#e7d9f6;color:#44325e;border-color:#c6acde;box-shadow:inset 0 -3px 0 #b79bce;font-weight:800}
main{padding-bottom:calc(110px + env(safe-area-inset-bottom))!important}
@media(max-width:560px){.shared-hero{padding:16px;margin-bottom:14px}.shared-card{border-radius:20px}.shared-card h2{font-size:18px}#cash-fields label{padding:8px;font-size:13px}#cash-fields input{font-size:18px!important}.flow-nav,.app-nav{gap:5px;padding-inline:8px}.flow-nav a,.app-nav a,.app-nav button{font-size:12px;padding-inline:5px}}
