/* Lily 旅遊分帳 — DORA 品牌系統（SSOT: dora-teach/brand-system.html）
   留白為主、白卡片、極淡陰影、四色當點綴 */
:root {
  --yellow: #FCE89A; --yellow-soft: #FEF4D0; --yellow-ink: #8A6B00;
  --blue: #8DD3E8; --blue-soft: #C9EBF5; --blue-ink: #1F5C73;
  --mint: #8FCFC8; --mint-soft: #CCE9E5; --mint-ink: #2D6660;
  --pink: #E89BAE; --pink-soft: #F4CFD9; --pink-ink: #8A2F47;
  --ink: #4A4A4A; --ink-soft: #8A8A8A; --bg: #FAF8F3; --paper: #FFFFFF; --line: #EAE6DC;
  --shadow: 0 4px 20px rgba(74, 74, 74, 0.06);
  --r: 16px; --r-sm: 8px;
  --font: "Noto Sans TC", -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.5; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue-ink); }
.wrap { max-width: 560px; margin: 0 auto; padding: 0 16px calc(120px + env(safe-area-inset-bottom)); }

/* header */
.top { position: sticky; top: 0; z-index: 10; background: rgba(250, 248, 243, 0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 560px; margin: 0 auto; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; display: flex; align-items: center; gap: 10px; }
.top img { width: 34px; height: 34px; }
.top h1 { font-size: 17px; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eyebrow { font-family: Cinzel, Georgia, serif; letter-spacing: 0.4em; font-size: 10px; color: var(--ink-soft); text-transform: uppercase; }

/* chips / pills */
.pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 3px 10px; font-size: 12px; white-space: nowrap; }
.pill.yellow { background: var(--yellow-soft); color: var(--yellow-ink); }
.pill.blue { background: var(--blue-soft); color: var(--blue-ink); }
.pill.mint { background: var(--mint-soft); color: var(--mint-ink); }
.pill.pink { background: var(--pink-soft); color: var(--pink-ink); }
.pill.gray { background: #F1EEE6; color: var(--ink-soft); }

/* buttons */
.btn { border: 0; border-radius: 999px; padding: 12px 20px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; }
.btn.primary { background: var(--pink); color: #fff; }
.btn.secondary { background: var(--blue); color: #fff; }
.btn.yellow { background: var(--yellow); color: var(--ink); }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); color: var(--ink); }
.btn.danger { background: transparent; color: var(--pink-ink); border: 1.5px solid var(--pink-soft); }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.sm { padding: 6px 14px; min-height: 34px; font-size: 14px; }

/* cards */
.card { background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; margin: 14px 0; }
.card h2 { font-size: 15px; margin: 0 0 10px; }
.muted { color: var(--ink-soft); font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* form */
label.f { display: block; font-size: 13px; color: var(--ink-soft); margin: 12px 0 6px; }
.input { width: 100%; border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 11px 12px; background: #fff; outline: none; }
.input:focus { border-color: var(--blue); }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px; cursor: pointer; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; }
.choice[aria-pressed="true"] { border-color: transparent; background: var(--ink); color: #fff; }
.choice.c-yellow[aria-pressed="true"] { background: var(--yellow); color: var(--ink); }
.choice.c-blue[aria-pressed="true"] { background: var(--blue); color: #fff; }
.choice.c-mint[aria-pressed="true"] { background: var(--mint); color: #fff; }
.choice.c-pink[aria-pressed="true"] { background: var(--pink); color: #fff; }

/* avatar */
.av { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.av.yellow { background: var(--yellow-soft); color: var(--yellow-ink); }
.av.blue { background: var(--blue-soft); color: var(--blue-ink); }
.av.mint { background: var(--mint-soft); color: var(--mint-ink); }
.av.pink { background: var(--pink-soft); color: var(--pink-ink); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* expense list */
.day { font-size: 12px; color: var(--ink-soft); margin: 18px 4px 6px; display: flex; justify-content: space-between; }
.exp { display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow); margin-bottom: 8px; cursor: pointer; }
.exp .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; flex: none; }
.exp .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exp .r { text-align: right; flex: none; }
.exp .r b { display: block; }
.exp.pending { opacity: 0.75; }

/* tabs */
.tabs { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); z-index: 20; padding-bottom: env(safe-area-inset-bottom); }
.tabs-in { max-width: 560px; margin: 0 auto; display: flex; }
.tab { flex: 1; border: 0; background: none; padding: 9px 0 10px; font-size: 12px; color: var(--ink-soft); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tab span { font-size: 21px; line-height: 1; }
.tab[aria-selected="true"] { color: var(--pink-ink); font-weight: 700; }
.fab { position: fixed; right: max(16px, calc(50vw - 264px)); bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 21; box-shadow: 0 6px 24px rgba(232, 155, 174, 0.45); font-size: 17px; padding: 14px 24px; }

/* sheet */
.scrim { position: fixed; inset: 0; background: rgba(74, 74, 74, 0.35); z-index: 40; display: none; }
.scrim.open { display: block; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: var(--bg); border-radius: 22px 22px 0 0; max-height: 92vh; overflow-y: auto; transform: translateY(105%); transition: transform 0.22s ease; padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); }
.sheet.open { transform: none; }
.sheet:not(.open) { visibility: hidden; transition: transform 0.22s ease, visibility 0s linear 0.22s; }
.sheet-in { max-width: 560px; margin: 0 auto; }
.grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 4px auto 12px; }
.amount { display: flex; align-items: baseline; gap: 8px; background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 16px; }
.amount .sym { font-size: 26px; color: var(--ink-soft); }
.amount input { border: 0; outline: 0; font-size: 40px; font-weight: 700; width: 100%; font-family: var(--mono); background: transparent; min-width: 0; }
.twd { font-size: 13px; color: var(--ink-soft); margin: 6px 4px 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rate { width: 96px; border: 1px dashed var(--line); border-radius: 6px; padding: 2px 6px; font-family: var(--mono); font-size: 13px; background: #fff; }
details summary { cursor: pointer; color: var(--ink-soft); font-size: 14px; margin: 14px 0 4px; }
.custom-row { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.custom-row input { width: 120px; }

/* settle */
.bal { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.bal:last-child { border: 0; }
.pos { color: var(--mint-ink); } .neg { color: var(--pink-ink); }
.xfer { display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: 12px; background: var(--yellow-soft); margin: 8px 0; }
.xfer .av { box-shadow: 0 0 0 2px #fff; }
.xfer .arrow { color: var(--yellow-ink); }
.xfer b { margin-left: auto; font-family: var(--mono); }

/* banners & toast */
.banner { border-radius: 12px; padding: 10px 12px; margin: 12px 0; font-size: 14px; }
.banner.warn { background: var(--pink-soft); color: var(--pink-ink); }
.banner.info { background: var(--blue-soft); color: var(--blue-ink); }
.toast { position: fixed; left: 50%; bottom: calc(150px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; z-index: 60; opacity: 0; pointer-events: none; transition: opacity 0.2s; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; }
.empty { text-align: center; padding: 48px 16px; color: var(--ink-soft); }
.empty img { width: 84px; opacity: 0.9; }
.audit { font-size: 13px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.audit:last-child { border: 0; }
.diff { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.hidden { display: none !important; }
.hero { text-align: center; padding: 28px 0 8px; }
.hero img { width: 88px; }
.hero h1 { font-size: 24px; margin: 8px 0 4px; }
