/* RUNFI 共通の色と部品（2026年11月23日のデザインの決まり）
   ・白が中心の業務システム風。ボタンは黒
   ・ピンクは目印だけ：ロゴの鳥・進み具合のバー（#F2547D）、今いる画面・「あと3日」（#C93A63）、「期限が近い」「まだ」の目印の背景（#FDE8EE）
   ・広い背景や見出しにはピンクを使わない
   ・スマホが暗い表示（ダークモード）でも、ロゴと色の見え方をそろえるため白の画面で出す */
:root {
  --bg: #F6F8F9; --surface: #FFFFFF; --sunken: #EFF2F4; --hover: #F2F4F6;
  --ink: #1F2328; --on-ink: #FFFFFF; --muted: #5E6670; --line: #D9DEE3; --line-soft: #E9ECEF;
  --bird: #F2547D; --mark: #C93A63; --mark-soft: #FDE8EE;
  /* うすいピンクの上の小さい文字だけ、読みやすさ（4.5:1以上）のため少し濃くする */
  --mark-strong: #B02E55;
  --dev: #FFF4D6; --on-dev: #6B4A00;
  --r-card: 12px; --r-ctl: 8px;
  --sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "BIZ UDPGothic", "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans JP", system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.6; -webkit-text-size-adjust: 100%; font-feature-settings: "tnum"; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; touch-action: manipulation; }
h1, h2, h3, p { margin: 0; }
a { color: var(--ink); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--mark); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.ic { display: block; flex: none; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.brand { display: inline-flex; align-items: center; }

/* 小さな目印（状態）。ピンクは「まだ」「期限が近い」「見てほしい」だけ */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; line-height: 1.6; }
.pill.ok { background: var(--sunken); color: var(--ink); }
.pill.warn { background: var(--mark-soft); color: var(--mark-strong); }
.pill.bad { background: var(--mark-soft); color: var(--mark-strong); box-shadow: inset 0 0 0 1px var(--mark); }
.pill.bad::before { content: "!"; width: 14px; height: 14px; border-radius: 50%; background: var(--mark); color: #FFFFFF; font-size: 10px; line-height: 14px; text-align: center; flex: none; }
.pill.idle { background: var(--surface); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }

/* ボタン：黒が主役。ほかは白に細い線 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-ctl); padding: 9px 16px; font-weight: 700; min-height: 44px; text-decoration: none; color: var(--ink); transition: background-color .12s; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.btn.danger { color: var(--mark-strong); }
.btn.block { width: 100%; }
.btn.tall { min-height: 52px; }
.btn.mini { min-height: 36px; padding: 5px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
@media (hover: hover) {
  .btn:not(:disabled):hover { background: var(--hover); }
  .btn.primary:not(:disabled):hover { background: #3A3F45; border-color: #3A3F45; }
}

.field { display: grid; gap: 6px; min-width: 0; }
.field label, .field .lab { font-size: 13px; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 10px 12px; background: var(--surface); min-height: 46px; font-size: 16px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); }
.field .hint { font-size: 12px; color: var(--muted); }
.err { color: var(--mark-strong); font-size: 13px; font-weight: 700; }
.info { color: var(--ink); font-size: 13px; font-weight: 700; }

/* 下から出るシート */
.sheet-back { position: fixed; inset: 0; background: rgba(31, 35, 40, .45); z-index: 40; }
.sheet { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 480px; max-height: 88dvh; overflow-y: auto; background: var(--surface); border-radius: 16px 16px 0 0; padding: 10px 18px calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 41; display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-rows: max-content; align-content: start; gap: 14px; animation: rise .22s ease-out; }
.sheet::before { content: ""; width: 40px; height: 4px; border-radius: 2px; background: var(--line); justify-self: center; }
.sheet h2 { font-size: 18px; font-weight: 700; }
@keyframes rise { from { transform: translate(-50%, 24px); opacity: 0; } }

/* 切り替え：灰色の溝の中で、選んでいるものだけ白く浮かせる */
.seg { display: flex; gap: 2px; padding: 3px; background: var(--sunken); border-radius: 10px; }
.seg button { flex: 1; padding: 8px 4px; font-size: 13px; min-height: 42px; color: var(--muted); border-radius: 8px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(31, 35, 40, .12), 0 0 0 1px var(--line); }

.spin { width: 26px; height: 26px; border-radius: 50%; border: 3px solid currentColor; border-right-color: transparent; animation: sp .8s linear infinite; }
.spin.sm { width: 18px; height: 18px; border-width: 2px; }
@keyframes sp { to { transform: rotate(360deg); } }
.devbar { background: var(--dev); color: var(--on-dev); font-size: 12px; font-weight: 700; text-align: center; padding: 4px 10px; }

/* 知らせ（画面の下に少しだけ出る） */
.snack { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(176px + env(safe-area-inset-bottom, 0px)); width: calc(100% - 28px); max-width: 452px; background: var(--ink); color: var(--on-ink); border-radius: 10px; padding: 11px 14px; z-index: 50; font-size: 14px; box-shadow: 0 6px 20px rgba(31, 35, 40, .18); }
.snack.low { bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
.snack.bad { box-shadow: inset 4px 0 0 var(--bird), 0 6px 20px rgba(31, 35, 40, .18); padding-left: 18px; }
/* 記録できたとき：白い札に2羽 */
.snack.done { background: var(--surface); color: var(--ink); border: 1px solid var(--line); padding: 10px 14px; }
.snack.done .scene { border: 0; padding: 0; background: none; box-shadow: none; flex: 1; min-width: 0; }
/* 取り消せるとき（外回り）：1行目に何を記録したか、2行目に時刻と「取り消す」 */
.snack.done .scene-t { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 8px; flex: 1; }
.snack.done .scene-t b { grid-column: 1 / -1; }
.snack.done .undo-btn { color: var(--ink); min-height: 40px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* RUNFI のロゴ。周りに2羽の高さの半分以上の余白をとり、形は変えない */
.logo { display: inline-flex; align-items: center; gap: 12px; line-height: 1; vertical-align: middle; }
.logo img, .logo-v, .birds { display: block; flex: none; user-select: none; -webkit-user-select: none; }
.logo .sub { font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: .04em; padding-left: 12px; border-left: 1px solid var(--line); line-height: 1.4; }

/* 2羽の場面（記録できた／何もない／はじめてのログイン）。毎回の画面には出さない */
.scene { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px 16px; min-width: 0; }
.scene-t { display: grid; gap: 2px; min-width: 0; }
.scene-t b { font-size: 15px; }
.scene-t span { color: var(--muted); font-size: 13px; }
.scene.none { flex-direction: column; text-align: center; background: none; border: 0; padding: 28px 16px 20px; gap: 12px; }
.scene.none .scene-t { justify-items: center; }
.scene.hello { align-items: flex-start; }
.scene.hello .birds { margin-top: 4px; }
.scene.hello .scene-t { gap: 6px; }
.scene.hello .btn { justify-self: start; margin-top: 4px; }

/* ログイン（スタッフ・外回り・管理者で共通）：縦のロゴとキャッチを中央に */
.auth { min-height: 100dvh; display: flex; flex-direction: column; background: var(--surface); }
.auth-hero { display: grid; justify-items: center; gap: 12px; padding: 44px 16px 6px; text-align: center; }
.auth-hero .catch { font-size: 13px; color: var(--muted); letter-spacing: .12em; }
.auth-hero .where { font-size: 12px; font-weight: 700; color: var(--ink); padding: 3px 12px; border: 1px solid var(--line); border-radius: 999px; letter-spacing: .04em; }
.auth-body { width: 100%; max-width: 420px; margin: 0 auto; padding: 24px max(20px, env(safe-area-inset-right, 0px)) 24px max(20px, env(safe-area-inset-left, 0px)); display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.auth h1 { font-size: 18px; font-weight: 700; }
.auth .links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.auth .link { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; min-height: 40px; font-size: 14px; }
.auth .note { background: var(--sunken); border-radius: 10px; padding: 10px 12px; font-size: 13px; color: var(--muted); }
.auth-foot { margin-top: auto; padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px)); text-align: center; font-size: 12px; color: var(--muted); }
.keep { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; font-weight: 700; cursor: pointer; }
.keep input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--ink); }
.keep small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.code-input { letter-spacing: .3em; font-size: 22px !important; text-align: center; }
.qr { display: grid; justify-items: center; gap: 8px; background: #FFFFFF; border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.qr img { width: 200px; height: 200px; image-rendering: pixelated; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px; letter-spacing: .08em; color: var(--ink); word-break: break-all; text-align: center; }
.steps-list { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; font-size: 14px; }
