:root {
  --ink: #1a1a1a;
  --muted: rgba(0, 0, 0, .48);
  --paper: #f6f3ee;
  --card: #fff;
  --line: rgba(0, 0, 0, .1);
  --brand: #2860a8;
  --logo-blue: #2860a8;
  --logo-orange: #f86018;
  --ok: #1a7f4b;
  --bad: #c43c3c;
  --s: #7fb3d4;
  --p: #e2c15a;
  --plus: #88c08a;
  --minus: #e08a92;
  --m: #7b4ea3;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--paper); color: var(--ink); font: 15px/1.45 var(--font); overflow-x: hidden; }
button, input, select, textarea { font: inherit; }
#app { max-width: 720px; margin: 0 auto; min-height: 100dvh; padding: 0 16px calc(88px + env(safe-area-inset-bottom, 0px)); overflow-x: hidden; }
body.is-swiping { overflow: hidden; }
.stage { position: relative; overflow: hidden; }
.pane-in {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: min(720px, 100%);
  margin: 0 auto;
  height: 100dvh;
  padding: 0 16px calc(88px + env(safe-area-inset-bottom, 0px));
  overflow: hidden;
  background: var(--paper);
  z-index: 12;
  pointer-events: none;
  box-sizing: border-box;
}
.top { display: flex; align-items: center; gap: 12px; padding: 16px 64px 10px 0; position: relative; }
.top img { position: absolute; right: 0; top: 8px; height: 52px; width: auto; object-fit: contain; z-index: 50; pointer-events: none; }
.top .who { flex: 1; font-weight: 700; font-size: 22px; line-height: 26px; min-width: 0; }
.top .who .muted { font-size: 13px; font-weight: 500; line-height: 1.3; margin-top: 2px; }
.bell { position: relative; appearance: none; border: 0; background: transparent; font-size: 16px; padding: 2px 4px; line-height: 1; }
.bell .dot { position: absolute; top: 0; right: 0; min-width: 14px; height: 14px; border-radius: 7px; background: var(--bad); color: #fff; font-size: 9px; line-height: 14px; text-align: center; padding: 0 3px; }
.hello { font-size: 17px; font-weight: 600; margin: 8px 0 10px; }
.hello-row { display: flex; align-items: center; justify-content: flex-start; gap: 6px; margin: 8px 0 10px; }
.hello-row .hello { margin: 0; display: flex; align-items: center; gap: 6px; flex: 0 1 auto; }
.sec-title { font-size: 16px; font-weight: 600; margin: 0 0 8px; color: var(--ink); }
.sec-title.is-strong { font-weight: 700; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 8px; }
.sec-head .sec-title { margin: 0; display: flex; align-items: center; gap: 6px; }
.leave-q {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 1px solid var(--muted);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 0;
}
.leave-help-body p { margin: 0 0 1em; }
.leave-help-body p:last-child { margin: 0 0 16px; }
.leave-help-body b { font-weight: 700; }
.month-pick { appearance: none; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 4px 8px; font-size: 13px; color: var(--ink); max-width: 46%; }
.muted { color: var(--muted); font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 0 0 12px; }
.remain-row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); }
.remain-row:last-child { border-bottom: 0; }
.remain-row b { font-size: 15px; font-weight: 600; }
.consume-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.consume-row:last-child { border-bottom: 0; }
.consume-when { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.consume-date { font-weight: 600; }
.consume-time { font-size: 13px; color: var(--muted); }
.consume-row b { font-size: 15px; font-weight: 600; white-space: nowrap; }
.cash { font-size: 17px; font-weight: 600; }
.week-item, .inbox-row, .hit { display: block; width: 100%; text-align: left; appearance: none; border: 0; background: transparent; padding: 10px 0; border-bottom: 1px solid var(--line); color: inherit; }
.inbox-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.inbox-row .inbox-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.inbox-row .read-tag { flex: 0 0 auto; color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.inbox-row.is-unread b::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 4px; background: var(--brand); margin-right: 6px; }
.notice-tip { display: block; width: 100%; text-align: left; appearance: none; border: 1px solid #e6d48a; background: #fff6d8; color: #5a4a10; border-radius: 12px; padding: 12px 14px; margin: 0 0 12px; }
.notice-tip b { display: block; }
.notice-tip span { font-size: 13px; opacity: .8; }
.leave-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.leave-row:last-child { border-bottom: 0; }
.leave-when { display: flex; flex-direction: column; gap: 2px; flex: 0 0 auto; white-space: nowrap; }
.leave-date { font-weight: 600; }
.leave-time { font-size: 13px; color: var(--muted); }
.leave-kind { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 0; }
.leave-kind b, .leave-kind span { white-space: nowrap; }
.leave-kind span { font-size: 13px; color: var(--muted); }
.back { appearance: none; border: 0; background: transparent; color: var(--brand); padding: 4px 0 10px; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; gap: 6px; background: var(--card); border-top: 1px solid var(--line); padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px)); }
.tabbar button { flex: 1; appearance: none; border: 1px solid var(--line); background: #f3f3f3; color: var(--muted); padding: 8px 2px; font-size: 13px; font-weight: 600; border-radius: 10px; }
.tabbar button.on { background: var(--logo-blue); border-color: var(--logo-blue); color: #fff; }
.sheet { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.sheet th, .sheet td { border: 1px solid var(--line); padding: 6px 8px; text-align: center; vertical-align: middle; }
.sheet th.day, .sheet td.tick { white-space: nowrap; font-size: 12px; font-weight: 600; padding: 6px 2px; }
.sheet td.tick { white-space: normal; line-height: 1.15; }
.sheet .tick-v, .sheet .tick-by { display: block; }
.sheet .tick-by { font-size: 10px; font-weight: 500; opacity: .85; }
.sheet tr.is-head td.goal { font-weight: 700; }
.sheet th.goal, .sheet td.goal { text-align: left; width: 33.333%; white-space: normal; word-break: break-word; font-weight: 500; }
.sheet td.is-empty { background: #f4f1ec; color: transparent; }
.mark-S { background: var(--s); color: #fff; }
.mark-P { background: var(--p); color: #fff; }
.mark-plus { background: var(--plus); color: #fff; }
.mark-minus { background: var(--minus); color: #fff; }
.mark-M { background: var(--m); color: #fff; }
.next .when { font-weight: 600; }
.more { appearance: none; border: 0; background: transparent; color: var(--brand); padding: 10px 0 0; width: 100%; text-align: left; font-weight: 600; }
.hit span, .inbox-row span { color: var(--muted); font-size: 13px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; flex: 0 0 12px; }
.legend i.is-empty { background: #f4f1ec; border: 1px solid var(--line); }
.sheet-card { overflow-x: hidden; }
.sheet-meta p { margin: 0 0 12px; white-space: pre-wrap; }
.sheet-meta .sec-title { margin-top: 10px; }
.sheet-meta .sec-title:first-child { margin-top: 0; }
.sheet-meta > .mp-toggle .sec-title { margin-top: 0; }
.sheet-meta-fold {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .28s ease;
}
.sheet-meta-fold.is-open { grid-template-rows: 1fr; }
.sheet-meta-inner { overflow: hidden; min-height: 0; }
.sheet-meta-inner .sec-title:first-child { margin-top: 8px; }
.pcard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 12px;
}
.pcard {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--card);
  color: inherit;
  min-width: 0;
}
.pcard-ring {
  --p: 0;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 50%;
  background: conic-gradient(#34c759 calc(var(--p) * 1%), #e5e5ea 0);
  display: grid;
  place-items: center;
}
.pcard-ring::after {
  content: attr(data-pct);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
}
.pcard-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pcard-name { font-size: 15px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.pcard-cap { font-size: 12px; color: var(--muted); }
.fb-body { margin: 8px 0 0; white-space: pre-wrap; }
.mp-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  color: inherit;
  text-align: left;
}
.mp-toggle .sec-title { margin: 0; flex: 1; min-width: 0; }
.mp-toggle .muted { flex: 0 0 auto; }
.mp-toggle .chev { margin-left: 4px; flex: 0 0 auto; }
.mp-body { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-toggle { display: flex; width: 100%; align-items: center; justify-content: space-between; appearance: none; border: 0; background: transparent; padding: 10px 0; margin: 0 0 8px; color: inherit; font-weight: 600; }
.chev { display: inline-block; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; margin-right: 4px; }
.chev.is-open { transform: rotate(45deg); }
.ipad-today { display: block; }
@media (min-width: 768px) {
  #app { max-width: 980px; }
  .pane-in { width: min(980px, 100%); }
  .ipad-today { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .tabbar { left: 50%; right: auto; transform: translateX(-50%); width: min(980px, 100%); }
}
@media (orientation: landscape) {
  #app { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .pane-in { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
}
.login-body { display: grid; place-items: center; min-height: 100dvh; padding: 24px; }
.login-card { width: min(420px, 100%); background: var(--card); border-radius: 16px; padding: 28px 22px; border: 1px solid var(--line); }
.login-logo { width: 48px; height: 48px; display: block; margin: 0 auto 12px; }
.login-card h1 { text-align: center; font-size: 20px; margin: 0 0 16px; }
.login-card label { display: block; margin: 0 0 12px; font-size: 14px; }
.login-card input { width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.btn { appearance: none; border: 0; background: var(--logo-blue); color: #fff; width: 100%; padding: 12px; border-radius: 10px; font-weight: 600; }
.login-tabs { display: flex; gap: 8px; margin: 0 0 16px; }
.login-tabs button { flex: 1; appearance: none; border: 1px solid var(--logo-orange); background: transparent; border-radius: 999px; padding: 8px; color: var(--logo-orange); }
.login-tabs button.on { background: var(--logo-blue); color: #fff; border-color: var(--logo-blue); }
.remember { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.remember input { width: auto; margin: 0; }
.flash { color: var(--bad); }
.ok { color: var(--ok); }
.hint { color: var(--muted); font-size: 13px; margin: 14px 0 0; }
.ghost { background: transparent; color: var(--logo-orange); border: 1px solid var(--logo-orange); }
a.btn { display: block; text-align: center; text-decoration: none; }
.demo-link { margin-top: 14px; }
#a2hs-btn { margin-top: 10px; }
.me-btn { margin: 0 0 10px; }
#forgot-btn { margin-top: 14px; }
.pw-form label { display: block; margin: 0 0 12px; font-size: 14px; }
.pw-form input { width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.pw-form .btn { margin-top: 4px; }
.demo-mark { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 15; pointer-events: none; user-select: none; font-size: 88px; font-weight: 700; letter-spacing: 0.18em; color: rgba(0, 0, 0, .06); line-height: 1; }
.view-as-bar {
  background: #fff4e5;
  color: #9a6700;
  padding: 10px 16px;
  font-size: 14px;
  line-height: 1.4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -16px 8px;
}
.view-as-bar form { margin: 0; flex: 0 0 auto; }
.view-as-bar button.view-as-exit {
  appearance: none;
  border: 1px solid rgba(154, 103, 0, .35);
  background: transparent;
  color: inherit;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 13px;
  width: auto;
  font-weight: 600;
}
html.is-standalone [data-a2hs], html.is-standalone #a2hs-btn { display: none; }
.a2hs-scrim { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, .4); display: flex; align-items: flex-end; justify-content: center; }
.a2hs-sheet { background: #fff; width: 100%; max-width: 720px; border-radius: 16px 16px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px)); }
.a2hs-title { margin: 0 0 8px; font-size: 18px; font-weight: 700; }
.a2hs-sheet .muted { margin: 0 0 12px; }
.a2hs-sheet ol { margin: 0 0 16px; padding-left: 1.2em; }
.a2hs-sheet li { margin: 0 0 6px; }
.a2hs-warn { margin: 0 0 12px; color: var(--bad); }
