/* ============================================================
   勝寳アプリ  —  赤 × 金 × 墨。和モダン。
   HP（katsuho.co.jp）と同じ色・書体の考え方で組んでいる。
   ============================================================ */
:root {
  --red: #CC0000;
  --red-d: #a50000;
  --red-bg: #fbeceb;
  --gold: #C9A84C;
  --gold-l: #e8c96a;
  --gold-d: #8B6810;
  --ink: #110e0a;
  --ink-2: #2c2520;
  --sub: #6b6156;
  --mute: #9e9488;
  --line: #e7dfd2;
  --line-2: #f0e9dd;
  --bg: #f6f1e8;
  --card: #fffdf9;
  --cream: #f9f4eb;
  --ok: #1e7a52;
  --ok-bg: #e4f2ea;
  --warn: #9a5a00;
  --warn-bg: #fbf0da;

  --r: 20px;
  --r-s: 13px;
  --shadow: 0 1px 2px rgba(44, 30, 10, .05), 0 8px 28px rgba(44, 30, 10, .07);
  --shadow-l: 0 18px 50px rgba(17, 14, 10, .22);

  --sans: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  --serif: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  --num: "Montserrat", var(--sans);

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tab-h: 62px;
  --ease: cubic-bezier(.22, .8, .26, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  font-family: var(--sans); color: var(--ink); background: var(--bg);
  line-height: 1.6; font-size: 16px; -webkit-font-smoothing: antialiased;
  min-height: 100dvh; overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; touch-action: manipulation; }
a { color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
:focus-visible { outline: 2px solid var(--gold-d); outline-offset: 2px; border-radius: 6px; }

/* ---------- 起動画面 ---------- */
.splash { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 14px; background: var(--ink); }
.splash img { background: #fff; border-radius: 50%; padding: 14px; width: 96px; height: 96px; object-fit: contain; animation: pop .6s var(--ease) both; }
.splash-name, .brand-name {
  font-family: var(--serif); font-weight: 800; letter-spacing: .18em;
  background: linear-gradient(135deg, #f3dc8e 0%, var(--gold) 45%, #a07a1e 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.splash-name { font-size: 34px; padding-left: .18em; }
@keyframes pop { from { opacity: 0; transform: scale(.86); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- 全体の骨組み ---------- */
.shell { min-height: 100dvh; padding-bottom: calc(var(--tab-h) + var(--safe-b) + 18px); }
.view { max-width: 560px; margin: 0 auto; animation: rise .35s var(--ease) both; }
.view--wide { max-width: 1120px; }
.pad { padding: 0 16px; }
.stack { display: grid; gap: 14px; }
.stack-s { display: grid; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.muted { color: var(--sub); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.nowrap { white-space: nowrap; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: center;
  padding: 0 8px var(--safe-b);
  background: rgba(255, 253, 249, .92); backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px);
  border-top: 1px solid var(--line);
}
.tabbar-in { display: flex; width: 100%; max-width: 560px; }
.tab {
  flex: 1; height: var(--tab-h); display: grid; place-content: center; justify-items: center; gap: 2px;
  color: var(--mute); font-size: 10.5px; font-weight: 600; letter-spacing: .04em; position: relative; text-decoration: none;
  transition: color .2s;
}
.tab svg { width: 24px; height: 24px; }
.tab.is-on { color: var(--red); }
.tab.is-on::before { content: ""; position: absolute; top: 0; left: 50%; width: 26px; height: 3px; margin-left: -13px; border-radius: 0 0 3px 3px; background: var(--red); }

/* PCでは左の縦メニューにする */
@media (min-width: 900px) {
  .shell { padding: 0 0 40px 92px; }
  .tabbar { top: 0; right: auto; width: 92px; padding: 18px 0; border-top: 0; border-right: 1px solid var(--line); background: var(--ink); align-items: flex-start; }
  .tabbar-in { flex-direction: column; gap: 6px; }
  .tabbar-in::before { content: ""; display: block; width: 46px; height: 46px; margin: 0 auto 18px; border-radius: 50%; background: #fff url(/img/emblem.png) center / 62% no-repeat; }
  .tab { flex: none; height: 64px; color: #a89f92; }
  .tab.is-on { color: var(--gold-l); }
  .tab.is-on::before { top: 50%; left: 0; width: 3px; height: 30px; margin: -15px 0 0; border-radius: 0 3px 3px 0; background: var(--gold); }
}

/* ---------- 見出し ---------- */
.page-head { padding: calc(var(--safe-t) + 18px) 16px 12px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.page-title { font-family: var(--serif); font-weight: 800; font-size: 26px; letter-spacing: .08em; line-height: 1.25; }
.page-title small { display: block; font-family: var(--num); font-weight: 700; font-size: 10.5px; letter-spacing: .26em; color: var(--gold-d); margin-bottom: 2px; }
.sec-title { font-size: 13px; font-weight: 700; color: var(--sub); letter-spacing: .08em; display: flex; align-items: center; gap: 8px; margin: 6px 2px 0; }
.sec-title::before { content: ""; width: 14px; height: 2px; background: var(--gold); border-radius: 2px; }

/* ---------- カード ---------- */
.card { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; }
.card--flat { box-shadow: none; border-color: var(--line); }
.card--ink { background: var(--ink); color: #fff; border-color: #2a241d; }
.card-tap { display: block; width: 100%; text-align: left; transition: transform .15s var(--ease), box-shadow .2s; }
.card-tap:active { transform: scale(.98); }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 22px; border-radius: 14px; font-weight: 700; font-size: 16px; letter-spacing: .04em;
  background: var(--ink); color: #fff; transition: transform .12s var(--ease), opacity .2s, background .2s; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn--red { background: linear-gradient(180deg, #dc1010, var(--red) 60%, #b40000); box-shadow: 0 8px 20px rgba(204, 0, 0, .28); }
.btn--gold { background: linear-gradient(180deg, var(--gold-l), var(--gold)); color: var(--ink); }
.btn--ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn--soft { background: var(--cream); color: var(--ink); border: 1px solid var(--line); }
.btn--danger { background: transparent; color: var(--red); border: 1.5px solid #efc9c6; }
.btn--block { display: flex; width: 100%; }
.btn--s { min-height: 38px; padding: 0 14px; font-size: 13.5px; border-radius: 10px; }
.btn svg { width: 19px; height: 19px; flex: none; }
.link { color: var(--gold-d); font-weight: 700; font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px; padding: 6px 2px; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-content: center; color: var(--sub); }
.icon-btn:active { background: var(--line-2); }
.icon-btn svg { width: 22px; height: 22px; }

/* ---------- 小さな札 ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; background: var(--line-2); color: var(--sub); white-space: nowrap; }
.chip--ok { background: var(--ok-bg); color: var(--ok); }
.chip--red { background: var(--red-bg); color: var(--red-d); }
.chip--gold { background: #f7edcf; color: var(--gold-d); }
.chip--warn { background: var(--warn-bg); color: var(--warn); }
.chip--ink { background: var(--ink); color: var(--gold-l); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.dot--live { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* ============================================================
   ログイン
   ============================================================ */
.auth {
  min-height: 100dvh; color: #fff; display: flex; flex-direction: column; align-items: center;
  padding: calc(var(--safe-t) + 44px) 22px calc(var(--safe-b) + 28px);
  background: linear-gradient(180deg, rgba(17, 14, 10, .78), rgba(17, 14, 10, .94) 46%, var(--ink) 70%), url(/img/hero.jpg) top center / cover no-repeat, var(--ink);
}
.auth-brand { display: grid; justify-items: center; gap: 12px; animation: rise .5s var(--ease) both; }
.auth-emblem { width: 84px; height: 84px; border-radius: 50%; background: #fff; display: grid; place-content: center; box-shadow: 0 0 0 1px rgba(201, 168, 76, .5), 0 0 0 6px rgba(201, 168, 76, .12), 0 16px 40px rgba(0, 0, 0, .4); }
.auth-emblem img { width: 52px; }
.auth-brand .brand-name { font-size: 40px; padding-left: .18em; line-height: 1.1; }
.auth-brand .brand-en { font-family: var(--num); font-weight: 700; font-size: 10.5px; letter-spacing: .42em; color: #b9ae9c; padding-left: .42em; }
.auth-body { width: 100%; max-width: 400px; margin-top: 34px; animation: rise .5s .08s var(--ease) both; }
.auth-lead { text-align: center; font-size: 15px; color: #d8cfc0; margin-bottom: 18px; }
.auth-lead b { color: #fff; font-size: 19px; display: block; margin-bottom: 2px; font-family: var(--serif); letter-spacing: .08em; }
.auth-foot { margin-top: auto; padding-top: 26px; font-size: 11.5px; color: #8d8375; text-align: center; }
.auth-input {
  width: 100%; height: 58px; border-radius: 16px; border: 1.5px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .07);
  color: #fff; text-align: center; font-family: var(--num); font-weight: 700; font-size: 24px; letter-spacing: .3em; outline: none;
}
.auth-input:focus { border-color: var(--gold); background: rgba(255, 255, 255, .1); }
.auth-input::placeholder { color: rgba(255, 255, 255, .25); letter-spacing: .1em; font-size: 15px; font-family: var(--sans); font-weight: 500; }
.auth .btn--gold { margin-top: 14px; }
.auth-err { min-height: 22px; margin-top: 12px; text-align: center; font-size: 13.5px; color: #ff9d94; font-weight: 600; }
.auth-back { color: #b9ae9c; font-size: 13.5px; display: inline-flex; align-items: center; gap: 4px; padding: 8px; margin: 14px auto 0; }
.auth-back svg { width: 16px; height: 16px; }

.roster { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.roster-btn {
  min-height: 62px; border-radius: 16px; padding: 8px 12px; color: #fff; font-weight: 700; font-size: 16.5px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14);
  display: flex; align-items: center; gap: 10px; text-align: left; transition: transform .12s var(--ease), background .2s;
}
.roster-btn:active { transform: scale(.97); background: rgba(201, 168, 76, .22); }
.avatar {
  flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-content: center;
  font-family: var(--serif); font-weight: 800; font-size: 16px; color: var(--ink);
  background: linear-gradient(135deg, #f3dc8e, var(--gold) 55%, #a8842a);
}
.avatar--l { width: 56px; height: 56px; font-size: 24px; }

.pin-dots { display: flex; justify-content: center; gap: 16px; margin: 6px 0 22px; height: 18px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .4); transition: all .15s; }
.pin-dots i.on { background: var(--gold); border-color: var(--gold); transform: scale(1.12); }
.pin-dots.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.key {
  height: 62px; border-radius: 16px; font-family: var(--num); font-weight: 600; font-size: 26px;
  display: grid; place-content: center; transition: transform .1s, background .15s; user-select: none; -webkit-user-select: none;
}
.key:active { transform: scale(.94); }
.key svg { width: 26px; height: 26px; }
.auth .key { color: #fff; background: rgba(255, 255, 255, .08); }
.auth .key:active { background: rgba(201, 168, 76, .3); }
.auth .key--fn { background: transparent; color: #b9ae9c; font-size: 14px; font-family: var(--sans); }
.sheet .key { background: var(--cream); border: 1px solid var(--line); color: var(--ink); height: 58px; }
.sheet .key:active { background: #efe5d2; }
.sheet .key--fn { background: transparent; border-color: transparent; color: var(--sub); }

/* ============================================================
   ホーム
   ============================================================ */
.hero {
  position: relative; color: #fff; padding: calc(var(--safe-t) + 16px) 20px 92px; overflow: hidden;
  background: linear-gradient(180deg, rgba(17, 14, 10, .62) 0%, rgba(17, 14, 10, .5) 36%, rgba(17, 14, 10, .93) 100%), url(/img/hero.jpg) center 38% / cover no-repeat, var(--ink);
}
@media (min-width: 600px) { .hero { border-radius: 0 0 28px 28px; } }
.hero-top { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 38px; height: 38px; border-radius: 50%; background: #fff; display: grid; place-content: center; box-shadow: 0 0 0 1px rgba(201, 168, 76, .6); }
.brand-mark img { width: 24px; }
.brand .brand-name { font-size: 23px; line-height: 1; }
.brand-en { font-family: var(--num); font-weight: 700; font-size: 8.5px; letter-spacing: .34em; color: #cfc4b0; margin-top: 3px; }
.hero-user { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #e6ddce; padding: 4px 4px 4px 12px; border-radius: 99px; background: rgba(255, 255, 255, .1); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.hero-user .avatar { width: 30px; height: 30px; font-size: 14px; }
.hero-main { margin-top: 30px; }
.hero-greet { font-size: 14px; color: #e6ddce; }
.hero-date { font-size: 15px; font-weight: 600; margin-top: 2px; }
.hero-clock { font-family: var(--num); font-weight: 700; font-size: 62px; line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 4px; text-shadow: 0 2px 24px rgba(0, 0, 0, .4); }
.hero-clock span { font-size: 26px; font-weight: 600; color: var(--gold-l); margin-left: 4px; }

.punch-card { margin: -72px 16px 0; position: relative; z-index: 2; padding: 20px 18px 22px; text-align: center; }
.punch-state { display: flex; justify-content: center; }
.punch-wrap { display: grid; place-items: center; margin: 18px 0 14px; }
.punch {
  position: relative; width: 196px; height: 196px; border-radius: 50%; color: #fff;
  display: grid; place-content: center; justify-items: center; gap: 2px;
  background: radial-gradient(circle at 34% 26%, #ff4a3d 0%, #dc0d0d 34%, var(--red) 62%, #9c0000 100%);
  box-shadow: 0 18px 38px rgba(204, 0, 0, .34), 0 2px 0 rgba(255, 255, 255, .28) inset, 0 -10px 24px rgba(90, 0, 0, .35) inset;
  transition: transform .18s var(--ease), box-shadow .2s; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none;
}
.punch--out {
  background: radial-gradient(circle at 34% 26%, #4d4338 0%, #2a231c 40%, var(--ink) 75%);
  box-shadow: 0 18px 38px rgba(17, 14, 10, .34), 0 0 0 2px var(--gold) inset, 0 0 0 7px rgba(201, 168, 76, .16) inset;
}
.punch.is-hold { transform: scale(.955); }
.punch.is-done { animation: done .6s var(--ease); }
@keyframes done { 30% { transform: scale(1.07); } 100% { transform: none; } }
.punch-label { font-family: var(--serif); font-weight: 800; font-size: 46px; letter-spacing: .14em; padding-left: .14em; line-height: 1.15; text-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.punch--out .punch-label { background: linear-gradient(135deg, #f3dc8e, var(--gold) 60%, #b08a2a); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; }
.punch-hint { font-size: 12px; font-weight: 600; letter-spacing: .1em; opacity: .85; }
.punch-ring { position: absolute; inset: -11px; width: calc(100% + 22px); height: calc(100% + 22px); transform: rotate(-90deg); pointer-events: none; }
.punch-ring circle { fill: none; stroke-width: 3.5; }
.punch-ring .trk { stroke: var(--line); }
.punch-ring .prg { stroke: var(--red); stroke-linecap: round; stroke-dasharray: 339.3; stroke-dashoffset: 339.3; transition: stroke-dashoffset .25s ease-out; }
.punch--out .punch-ring .prg { stroke: var(--gold); }
.punch.is-hold .punch-ring .prg { stroke-dashoffset: 0; transition: stroke-dashoffset var(--hold, .7s) linear; }
.punch-note { font-size: 13px; color: var(--sub); min-height: 20px; }
.punch-note b { color: var(--ink); font-family: var(--num); font-weight: 700; }

.done-card { padding: 4px 0 2px; }
.done-times { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 16px 0 14px; }
.done-times div { text-align: center; }
.done-times .lbl { font-size: 11.5px; color: var(--sub); font-weight: 700; letter-spacing: .1em; }
.done-times .val { font-family: var(--num); font-weight: 700; font-size: 34px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.done-times .arrow { color: var(--gold); width: 26px; height: 26px; margin-top: 14px; }
.done-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.done-sum > div { background: var(--cream); border-radius: var(--r-s); padding: 11px 8px; }
.done-sum .lbl { font-size: 11.5px; color: var(--sub); font-weight: 700; }
.done-sum .val { font-family: var(--num); font-weight: 700; font-size: 22px; font-variant-numeric: tabular-nums; }
.done-sum .is-gold { background: linear-gradient(135deg, #fbf3d9, #f4e6b8); }
.done-sum .is-gold .lbl { color: var(--gold-d); }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { padding: 16px; min-height: 124px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.tile-ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-content: center; background: var(--red-bg); color: var(--red); }
.tile-ico svg { width: 24px; height: 24px; }
.tile--gold .tile-ico { background: #f7edcf; color: var(--gold-d); }
.tile-name { font-family: var(--serif); font-weight: 800; font-size: 19px; letter-spacing: .08em; margin-top: 12px; }
.tile-sub { font-size: 12px; color: var(--sub); }
.tile::after { content: ""; position: absolute; right: 14px; top: 16px; width: 8px; height: 8px; border-top: 2px solid var(--mute); border-right: 2px solid var(--mute); transform: rotate(45deg); }

.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-s); font-size: 13.5px; background: var(--warn-bg); color: #6f4100; border: 1px solid #f0dcb4; }
.banner svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.banner--info { background: #f2ecdf; color: var(--ink-2); border-color: var(--line); }
.banner--ok { background: var(--ok-bg); color: #14573a; border-color: #c4e2d1; }

/* ============================================================
   月の切り替え・数字のまとめ
   ============================================================ */
.month-nav { display: flex; align-items: center; justify-content: space-between; background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 3px; }
.month-nav b { font-family: var(--num); font-weight: 700; font-size: 17px; letter-spacing: .02em; }
.month-nav b small { font-family: var(--sans); font-size: 13px; font-weight: 700; margin: 0 1px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stats--2 { grid-template-columns: 1fr 1fr; }
.stats--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 599px) { .stats--4 { grid-template-columns: 1fr 1fr; } }
.stat { background: var(--card); border: 1px solid var(--line-2); border-radius: 16px; padding: 12px 12px 11px; box-shadow: var(--shadow); min-width: 0; }
.stat .lbl { font-size: 11.5px; font-weight: 700; color: var(--sub); letter-spacing: .04em; white-space: nowrap; }
.stat .val { font-family: var(--num); font-weight: 700; font-size: 25px; line-height: 1.25; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat .val small { font-family: var(--sans); font-size: 12px; font-weight: 700; color: var(--sub); margin-left: 2px; }
.stat--gold { background: linear-gradient(135deg, #fffaf0, #f8ecc6); border-color: #eedfae; }
.stat--gold .lbl { color: var(--gold-d); }
.stat--ink { background: var(--ink); border-color: var(--ink); color: #fff; }
.stat--ink .lbl { color: var(--gold-l); }
.stat--ink .val small { color: #cfc4b0; }

/* ---------- 一覧 ---------- */
.list { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 13px 16px; width: 100%; text-align: left; border-bottom: 1px solid var(--line-2); min-height: 60px; }
.item:last-child { border-bottom: 0; }
button.item:active { background: var(--cream); }
.item-date { flex: none; width: 44px; text-align: center; line-height: 1.15; }
.item-date b { font-family: var(--num); font-weight: 700; font-size: 21px; display: block; }
.item-date span { font-size: 11px; font-weight: 700; color: var(--sub); }
.item-date.is-sun b, .item-date.is-sun span { color: var(--red); }
.item-date.is-sat b, .item-date.is-sat span { color: #2c5c9e; }
.item-main { flex: 1; min-width: 0; }
.item-title { font-weight: 700; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-title .num { font-size: 17px; font-weight: 600; }
.item-sub { font-size: 12px; color: var(--sub); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin-top: 1px; }
.item-end { flex: none; text-align: right; line-height: 1.25; }
.item-end .num { font-weight: 700; font-size: 18px; }
.item-end small { display: block; font-size: 11px; color: var(--sub); font-weight: 600; }
.chev { flex: none; width: 8px; height: 8px; border-top: 2px solid var(--mute); border-right: 2px solid var(--mute); transform: rotate(45deg); margin-right: 2px; }
.empty { padding: 34px 16px; text-align: center; color: var(--sub); font-size: 14px; }
.empty svg { width: 38px; height: 38px; color: var(--line); margin: 0 auto 8px; display: block; }

/* ---------- 切り替えスイッチ ---------- */
.seg { display: flex; background: #ebe3d5; border-radius: 13px; padding: 3px; }
.seg button { flex: 1; height: 38px; border-radius: 10px; font-size: 14px; font-weight: 700; color: var(--sub); transition: all .2s; white-space: nowrap; padding: 0 12px; }
.seg button.is-on { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(44, 30, 10, .14); }
.subnav { display: flex; gap: 6px; overflow-x: auto; padding: 2px 16px 10px; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav button { flex: none; height: 38px; padding: 0 16px; border-radius: 99px; font-size: 14px; font-weight: 700; color: var(--sub); background: var(--card); border: 1px solid var(--line); white-space: nowrap; }
.subnav button.is-on { background: var(--ink); color: var(--gold-l); border-color: var(--ink); }

/* ============================================================
   ゴミ計量
   ============================================================ */
.date-pill { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); font-weight: 700; font-size: 14.5px; position: relative; }
.date-pill svg { width: 18px; height: 18px; color: var(--gold-d); }
.date-pill input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; }
.sites { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 700px) { .sites { grid-template-columns: repeat(3, 1fr); } }
.site { padding: 14px; min-height: 104px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; border-radius: 18px; background: var(--card); border: 1.5px solid var(--line-2); box-shadow: var(--shadow); text-align: left; transition: transform .14s var(--ease), border-color .2s; }
.site:active { transform: scale(.97); border-color: var(--gold); }
.site-name { font-weight: 800; font-size: 16px; line-height: 1.35; }
.site-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; }
.site-val { font-family: var(--num); font-weight: 700; font-size: 20px; line-height: 1; }
.site-val small { font-size: 12px; margin-left: 1px; color: var(--sub); }
.site.is-done { border-color: #cfe6d9; background: linear-gradient(180deg, #fffdf9, #f3faf6); }
.site-plus { width: 30px; height: 30px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-content: center; flex: none; }
.site-plus svg { width: 17px; height: 17px; }
.site.is-done .site-plus { background: var(--ok); }

.w-display { display: flex; align-items: baseline; justify-content: center; gap: 6px; padding: 8px 0 14px; border-bottom: 2px solid var(--ink); margin-bottom: 16px; }
.w-display b { font-family: var(--num); font-weight: 700; font-size: 60px; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.w-display b.is-zero { color: var(--line); }
.w-display span { font-family: var(--num); font-weight: 700; font-size: 22px; color: var(--sub); }
.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick button { height: 40px; padding: 0 16px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--card); font-weight: 700; font-size: 14px; color: var(--sub); }
.pick button.is-on { background: var(--ink); border-color: var(--ink); color: var(--gold-l); }

.bars { display: grid; gap: 14px; }
.bar-row .row-between { margin-bottom: 5px; }
.bar-name { font-weight: 700; font-size: 14.5px; }
.bar-val { font-family: var(--num); font-weight: 700; font-size: 16px; white-space: nowrap; }
.bar-val small { font-size: 11.5px; color: var(--sub); margin-left: 2px; font-family: var(--sans); }
.bar { height: 10px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--red), #e2382c); transform-origin: left; animation: grow .7s var(--ease) both; }
.bar--gold i { background: linear-gradient(90deg, var(--gold-d), var(--gold)); }
@keyframes grow { from { transform: scaleX(0); } }
.cols { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding-top: 6px; }
.col { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; }
.col i { display: block; width: 100%; max-width: 30px; min-height: 2px; border-radius: 4px 4px 1px 1px; background: var(--line); transform-origin: bottom; animation: growY .7s var(--ease) both; }
.col.has i { background: linear-gradient(180deg, #e2382c, var(--red)); }
.col.is-now i { background: linear-gradient(180deg, var(--gold-l), var(--gold-d)); }
.col span { font-family: var(--num); font-size: 9.5px; font-weight: 600; color: var(--mute); line-height: 1; }
.col em { font-style: normal; font-family: var(--num); font-size: 10.5px; font-weight: 700; color: var(--sub); line-height: 1; white-space: nowrap; }
@keyframes growY { from { transform: scaleY(0); } }
.big-total { text-align: center; padding: 6px 0 2px; }
.big-total .lbl { font-size: 12px; font-weight: 700; color: var(--gold-l); letter-spacing: .14em; }
.big-total .val { font-family: var(--num); font-weight: 700; font-size: 54px; line-height: 1.1; letter-spacing: -.02em; }
.big-total .val small { font-size: 20px; color: #cfc4b0; margin-left: 4px; }
.big-total .sub { font-size: 12.5px; color: #cfc4b0; }

/* ============================================================
   下から出るシート・お知らせ
   ============================================================ */
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(17, 14, 10, .5); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s both; }
.sheet {
  width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto; background: var(--card);
  border-radius: 26px 26px 0 0; padding: 10px 18px calc(var(--safe-b) + 20px); box-shadow: var(--shadow-l);
  animation: up .32s var(--ease) both; overscroll-behavior: contain;
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 12px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.sheet-title { font-family: var(--serif); font-weight: 800; font-size: 21px; letter-spacing: .06em; line-height: 1.3; }
.sheet-title small { display: block; font-family: var(--sans); font-size: 12.5px; font-weight: 600; color: var(--sub); letter-spacing: 0; }
.sheet-actions { display: grid; gap: 10px; margin-top: 18px; }
.sheet-actions--2 { grid-template-columns: 1fr 1.4fr; }
@media (min-width: 700px) {
  .backdrop { align-items: center; padding: 20px; }
  .sheet { border-radius: 26px; padding-top: 22px; }
  .sheet::before { display: none; }
  .sheet--wide { max-width: 720px; }
}
.toasts { position: fixed; left: 0; right: 0; top: calc(var(--safe-t) + 12px); z-index: 80; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { max-width: 480px; padding: 12px 18px; border-radius: 14px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-l); display: flex; align-items: center; gap: 10px; animation: toastIn .35s var(--ease) both; border: 1px solid rgba(201, 168, 76, .4); }
.toast svg { width: 20px; height: 20px; flex: none; color: var(--gold-l); }
.toast--err { background: #8a0d0d; border-color: #b33; }
.toast--err svg { color: #fff; }
.toast.out { animation: toastOut .3s ease-in both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px); } }
.offline-bar { position: sticky; top: 0; z-index: 40; padding: calc(var(--safe-t) + 6px) 14px 6px; background: #3a2f22; color: #f3dc8e; font-size: 12.5px; font-weight: 700; text-align: center; }

/* ============================================================
   入力欄
   ============================================================ */
.field { display: grid; gap: 6px; }
.field > span, .label { font-size: 12.5px; font-weight: 700; color: var(--sub); letter-spacing: .03em; }
.field small { font-size: 12px; color: var(--mute); line-height: 1.5; }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-size: 16px; outline: none; transition: border-color .2s;
  -webkit-appearance: none; appearance: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--gold); }
.textarea { min-height: 76px; resize: vertical; }
.select { background-image: linear-gradient(45deg, transparent 50%, var(--sub) 50%), linear-gradient(135deg, var(--sub) 50%, transparent 50%); background-position: calc(100% - 19px) 21px, calc(100% - 14px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.input.num { font-weight: 600; font-size: 18px; }
.form-grid { display: grid; gap: 14px; }
.form-grid--2 { grid-template-columns: 1fr 1fr; }
.form-grid--3 { grid-template-columns: 1fr 1fr 1fr; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 4px 0; }
.switch-txt b { display: block; font-size: 15px; }
.switch-txt small { font-size: 12px; color: var(--sub); line-height: 1.5; display: block; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i { flex: none; width: 50px; height: 30px; border-radius: 99px; background: var(--line); position: relative; transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s var(--ease); }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(20px); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14.5px; }
.kv dt { color: var(--sub); font-size: 13px; font-weight: 600; }
.kv dd { text-align: right; font-weight: 700; }
.hr { height: 1px; background: var(--line-2); margin: 4px 0; }

/* ============================================================
   管理画面（PCでも使う）
   ============================================================ */
.table-wrap { min-width: 0; overflow-x: auto; background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow); -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { position: sticky; top: 0; background: var(--cream); font-size: 11.5px; font-weight: 700; color: var(--sub); letter-spacing: .04em; text-align: right; padding: 10px 12px; white-space: nowrap; border-bottom: 1px solid var(--line); }
.table td { padding: 11px 12px; text-align: right; border-bottom: 1px solid var(--line-2); white-space: nowrap; font-family: var(--num); font-variant-numeric: tabular-nums; font-weight: 600; }
.table th:first-child, .table td:first-child { text-align: left; position: sticky; left: 0; background: var(--card); z-index: 1; font-family: var(--sans); font-weight: 700; }
.table th:first-child { background: var(--cream); z-index: 2; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.is-tap { cursor: pointer; }
.table tbody tr.is-tap:hover td { background: #fbf6ec; }
.table tfoot td { background: var(--ink); color: #fff; font-weight: 700; border: 0; }
.table tfoot td:first-child { background: var(--ink); color: var(--gold-l); }
.table .is-gold { color: var(--gold-d); }
.table .is-red { color: var(--red); }
.table .is-mute { color: var(--mute); font-weight: 500; }
.table--dense th, .table--dense td { padding: 7px 8px; font-size: 12.5px; }
.table .t-left { text-align: left; font-family: var(--sans); }

.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.person { padding: 14px; border-radius: 18px; background: var(--card); border: 1.5px solid var(--line-2); box-shadow: var(--shadow); display: grid; gap: 8px; text-align: left; }
.person-name { min-width: 0; font-weight: 800; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-time { font-family: var(--num); font-weight: 700; font-size: 20px; line-height: 1.1; }
.person-time small { font-family: var(--sans); font-size: 11.5px; color: var(--sub); font-weight: 600; display: block; margin-top: 3px; }
.person.is-in { border-color: #bfe0cf; background: linear-gradient(180deg, #fffdf9, #f1f9f4); }
.person.is-none { opacity: .72; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.toolbar .month-nav { min-width: 210px; }
.admin-grid { display: grid; gap: 14px; }
@media (min-width: 900px) { .admin-grid--2 { grid-template-columns: 1fr 1fr; align-items: start; } }
.log { font-size: 13px; }
.log .item { align-items: flex-start; min-height: 0; padding: 10px 14px; }
.log time { flex: none; width: 86px; font-family: var(--num); font-size: 12px; color: var(--sub); font-weight: 600; padding-top: 1px; }

/* ---------- 読み込み中 ---------- */
.skel { border-radius: 14px; background: linear-gradient(90deg, #ece4d6 0%, #f6f0e4 50%, #ece4d6 100%); background-size: 200% 100%; animation: sk 1.2s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- 印刷（月報） ---------- */
@media print {
  body { background: #fff; font-size: 11px; }
  .tabbar, .subnav, .toolbar .btn, .no-print, .toasts, .offline-bar, #layer { display: none !important; }
  .shell { padding: 0; }
  .view { max-width: none; animation: none; }
  .card, .list, .table-wrap, .stat { box-shadow: none; border-color: #bbb; }
  .table-wrap { overflow: visible; }
  .table th, .table td { padding: 4px 5px; font-size: 9.5px; position: static; }
  .table tfoot td { background: #eee !important; color: #000 !important; }
  .card--ink, .stat--ink { background: #fff !important; color: #000 !important; border-color: #bbb !important; }
  .card--ink *, .stat--ink * { color: #000 !important; }
  .print-head { display: block !important; }
  @page { size: A4 landscape; margin: 10mm; }
}
.print-head { display: none; margin: 0 16px 10px; }
.print-head h1 { font-family: var(--serif); font-size: 18px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
