/* 只做淺色（LINE 內建瀏覽器大多淺色，跟卡費小幫手一致）；一種強調色（橘） */
:root {
  --bg: #F7F8FA; --card: #FFFFFF; --ink: #111827; --muted: #6B7280; --line: #E5E7EB;
  --accent: #C2410C; --accent-soft: #FFF7ED; --bad: #B91C1C; --warn: #B45309; --ok: #15803D;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", sans-serif;
  padding: 0 16px calc(24px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto;
  -webkit-text-size-adjust: 100%;
}
.top { position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 12px 0 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.top h1 { font-size: 18px; margin: 0; }
.tabs { display: flex; background: #EEF0F3; border-radius: 10px; padding: 3px; }
.tabs button { border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; font: inherit; font-size: 14px; color: var(--muted); min-height: 36px; }
.tabs button[aria-selected="true"] { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.summary { margin: 4px 0 10px; color: var(--muted); font-size: 13px; }
#q { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); margin-bottom: 10px; }
ul { list-style: none; margin: 0; padding: 0; }
.items li { margin-bottom: 8px; }
.items button {
  all: unset; box-sizing: border-box; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; width: 100%;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer;
}
.items .plat { font-size: 12px; color: var(--accent); font-weight: 600; }
.items .title { font-weight: 600; grid-column: 1; }
.items .acct { font-size: 13px; color: var(--muted); grid-column: 1; }
.items .due { grid-column: 2; grid-row: 1 / span 3; text-align: right; align-self: center; font-size: 13px; font-weight: 600; white-space: nowrap; }
.items .due small { display: block; color: var(--muted); font-weight: 400; }
.items li.done button { opacity: .6; }
.m-red { color: var(--bad); } .m-amber { color: var(--warn); } .m-gray { color: var(--muted); } .m-ok { color: var(--ok); }
.foot { color: var(--muted); font-size: 12px; text-align: center; margin-top: 20px; }
.foot a { color: var(--accent); }
.msg { text-align: center; color: var(--muted); padding: 48px 0; }
.msg.err { color: var(--bad); }
.muted { color: var(--muted); font-size: 13px; }
dialog { border: 0; padding: 0; width: 100%; max-width: 560px; max-height: 92vh; border-radius: 16px 16px 0 0; margin: auto auto 0; background: var(--card); }
dialog::backdrop { background: rgba(17,24,39,.45); }
.sheet { padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); position: relative; }
.close { position: absolute; right: 10px; top: 10px; width: 40px; height: 40px; border-radius: 20px; border: 0; background: #F3F4F6; font-size: 16px; }
.sheet h2 { font-size: 18px; margin: 4px 48px 4px 0; }
.d-due { margin: 0 0 8px; font-weight: 600; }
.d-kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 12px; font-size: 14px; }
.d-kv dt { color: var(--muted); }
.d-kv dd { margin: 0; word-break: break-all; }
#d-img { width: 100%; border: 1px solid var(--line); border-radius: 12px; display: block; background: #F3F4F6; min-height: 120px; }
.primary { width: 100%; margin-top: 14px; min-height: 46px; border: 0; border-radius: 12px; background: var(--accent); color: #fff; font: inherit; font-weight: 600; }
.primary.secondary { background: #F3F4F6; color: var(--ink); }
.primary:disabled { opacity: .5; }
