/* FEEL スタッフポータル — Apple風のミニマルデザイン */
:root {
  color-scheme: light dark;
  --bg: #f5f5f7;
  --card: #ffffff;
  --ink: #1d1d1f;
  --sub: #6e6e73;
  --line: #d2d2d7;
  --hair: rgba(0, 0, 0, .08);
  --fill: rgba(120, 120, 128, .08);
  --accent: #0071e3;
  --accent-ink: #ffffff;
  --accent-soft: rgba(0, 113, 227, .10);
  --ok: #1a7f37;
  --ok-soft: rgba(52, 199, 89, .15);
  --need: #c93400;
  --need-soft: rgba(255, 149, 0, .16);
  --blue: #0062c4;
  --blue-soft: rgba(0, 113, 227, .10);
  --amber: #8a5a00;
  --amber-soft: rgba(255, 204, 0, .22);
  --red: #d70015;
  --red-soft: rgba(255, 59, 48, .12);
  --gray-soft: rgba(120, 120, 128, .12);
  --bar: rgba(245, 245, 247, .78);
  --hero-grad: linear-gradient(100deg, #ff6a3d 0%, #e5397f 48%, #7a5cff 100%);
  --radius: 22px;
  --tabbar-h: 62px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Helvetica Neue", "Noto Sans JP", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1c1c1e;
    --ink: #f5f5f7;
    --sub: #98989d;
    --line: #3a3a3c;
    --hair: rgba(255, 255, 255, .10);
    --fill: rgba(120, 120, 128, .2);
    --accent: #2997ff;
    --accent-soft: rgba(41, 151, 255, .18);
    --ok: #30d158;
    --ok-soft: rgba(48, 209, 88, .18);
    --need: #ff9f0a;
    --need-soft: rgba(255, 159, 10, .18);
    --blue: #64a8ff;
    --blue-soft: rgba(41, 151, 255, .18);
    --amber: #ffd60a;
    --amber-soft: rgba(255, 214, 10, .16);
    --red: #ff453a;
    --red-soft: rgba(255, 69, 58, .18);
    --gray-soft: rgba(120, 120, 128, .24);
    --bar: rgba(22, 22, 23, .78);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- ヘッダー・タブバー（すりガラス） ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 8px) 20px 8px;
  min-height: calc(env(safe-area-inset-top) + 48px);
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: .5px solid var(--hair);
}
.brand { font-size: 19px; font-weight: 700; letter-spacing: .22em; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.mode-tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--fill); color: var(--sub); }
.mode-tag:empty { display: none; }
.me-chip { font-size: 14px; font-weight: 600; color: var(--accent); padding: 6px 2px; }

.app {
  max-width: 600px; margin: 0 auto;
  padding: 8px 20px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 32px);
}
body.no-nav .app { padding-bottom: calc(env(safe-area-inset-bottom) + 40px); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid var(--hair);
}
.tabbar a {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11px; font-weight: 600; color: var(--sub);
}
.tabbar svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.tabbar a.active { color: var(--accent); }
.nav-badge {
  position: absolute; top: 6px; left: calc(50% + 6px);
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: #ff3b30; color: #fff; font-size: 12px; line-height: 20px; text-align: center; font-weight: 700;
}

/* ---------- 見出し・文字 ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 20px 0 16px; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .06em; color: var(--sub); text-transform: uppercase; }
h1 { font-size: 34px; line-height: 1.18; font-weight: 700; letter-spacing: -.01em; margin: 2px 0 0; }
.article-title { font-size: 28px; line-height: 1.3; margin: 4px 0 16px; }
h2 { font-size: 20px; font-weight: 700; margin: 0 0 12px; letter-spacing: -.005em; }
.lead { font-size: 17px; color: var(--sub); margin: -4px 0 20px; }
.sub { color: var(--sub); margin: 0; }
.meta { font-size: 14px; color: var(--sub); }
.fine { font-size: 13px; color: var(--sub); margin: 12px 0; }
.center { text-align: center; }
.loading, .empty { color: var(--sub); text-align: center; padding: 48px 0; }
.err { color: var(--red); font-weight: 600; font-size: 15px; margin: 0 0 12px; }
.group-title { font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--sub); margin: 28px 4px 8px; }

/* ---------- カード・リスト ---------- */
.card {
  display: block; background: var(--card); border-radius: var(--radius);
  padding: 20px; margin-bottom: 12px;
}
.card.tap { transition: transform .15s ease; }
.card.tap:active { transform: scale(.985); }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card-title { font-size: 19px; font-weight: 700; line-height: 1.45; margin: 4px 0 2px; letter-spacing: -.005em; }

.list-group { background: var(--card); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
.row {
  display: flex; align-items: center; gap: 14px;
  min-height: 64px; padding: 12px 16px; position: relative;
}
.row + .row::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; height: .5px; background: var(--hair); }
a.row:active { background: var(--fill); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 17px; font-weight: 600; line-height: 1.4; }
.chev { color: var(--line); font-size: 24px; line-height: 1; margin-left: -4px; }
.num {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%; background: var(--fill);
  font-size: 14px; font-weight: 700; color: var(--sub); font-variant-numeric: tabular-nums;
}
.detail { font-size: 13px; margin-top: 4px; }
.memo { font-size: 13px; color: var(--sub); margin-top: 6px; white-space: pre-wrap; word-break: break-word; background: var(--fill); border-radius: 10px; padding: 6px 10px; }
.cert-row { align-items: flex-start; }
.cert-row .num { margin-top: 2px; }
.cert-row .badge, .cert-row .chev { margin-top: 4px; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 24px; border-radius: 980px; border: 0;
  background: var(--fill); color: var(--accent);
  font-size: 17px; font-weight: 600; cursor: pointer; text-align: center;
  transition: opacity .15s ease, transform .15s ease;
}
.btn:active { transform: scale(.98); opacity: .85; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.big { display: flex; width: 100%; min-height: 56px; font-size: 18px; margin-top: 8px; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .4; cursor: default; transform: none; }
.danger-text { color: var(--red); }
.pill {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 16px; border-radius: 980px;
  border: 0; background: var(--fill); color: var(--accent); font-size: 15px; font-weight: 600; cursor: pointer;
}
.pill.danger { color: var(--red); }
.link-btn { background: none; border: 0; color: var(--accent); font-size: 17px; padding: 12px 0; cursor: pointer; }
.back { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); font-size: 17px; margin-top: 4px; }
.btn-row { display: flex; gap: 10px; margin-top: 14px; }
.btn-row .btn { flex: 1; }
.btn-row.end { justify-content: flex-end; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; }

/* ---------- バッジ・チップ ---------- */
.badge { display: inline-block; flex: none; padding: 3px 10px; border-radius: 99px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.badge.need { background: var(--need-soft); color: var(--need); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.st0 { background: var(--gray-soft); color: var(--sub); }
.badge.st1 { background: var(--blue-soft); color: var(--blue); }
.badge.st2 { background: var(--amber-soft); color: var(--amber); }
.badge.st3 { background: var(--ok-soft); color: var(--ok); }
.badge.st4 { background: var(--red-soft); color: var(--red); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { padding: 4px 12px; border-radius: 99px; font-size: 14px; font-weight: 600; background: var(--fill); }
.chip.need { background: var(--need-soft); color: var(--need); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }

/* ---------- 試作中の表示 ---------- */
.proto {
  display: flex; gap: 12px; align-items: flex-start;
  margin: 12px 0 4px; padding: 12px 16px; border-radius: 16px;
  background: var(--amber-soft); font-size: 15px; line-height: 1.5;
}
.proto b { font-weight: 700; }
.proto small { display: block; font-size: 13px; color: var(--sub); }
.proto-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #ff9f0a; margin-top: 6px; box-shadow: 0 0 0 4px rgba(255, 159, 10, .2); }

/* ---------- ログイン・登録 ---------- */
.hero { text-align: center; padding: 48px 0 28px; }
.hero.small { padding: 64px 0 28px; }
.hero-mark {
  font-size: 64px; font-weight: 800; letter-spacing: .14em; line-height: 1;
  background: var(--hero-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-left: .14em;
}
.hero-icon { font-size: 56px; line-height: 1; }
.hero-title { font-size: 28px; font-weight: 700; margin: 16px 0 6px; letter-spacing: -.01em; }
.hero-sub { font-size: 17px; color: var(--sub); margin: 0; line-height: 1.6; }
.form-card { padding: 20px 20px 16px; }
.center-links { text-align: center; margin-top: 28px; }
.center-links .btn { margin-top: 8px; }
.stepper { display: flex; gap: 6px; margin: -4px 0 16px; }
.stepper span { flex: 1; height: 4px; border-radius: 2px; background: var(--fill); }
.stepper span.on { background: var(--accent); }
.picked { display: flex; flex-direction: column; gap: 2px; }
.picked b { font-size: 22px; }
.picked small { color: var(--sub); font-size: 14px; }

.name-list { display: grid; gap: 8px; margin-bottom: 12px; }
.name-btn {
  display: grid; grid-template-columns: 1fr auto; align-items: center; text-align: left;
  min-height: 64px; padding: 10px 18px; border-radius: 18px; border: 0;
  background: var(--card); cursor: pointer; color: inherit;
}
.name-btn:active { background: var(--fill); }
.name-btn .nm { font-size: 19px; font-weight: 600; }
.name-btn small { grid-column: 1; font-size: 14px; color: var(--sub); }
.name-btn .mark { grid-row: 1 / span 2; grid-column: 2; color: var(--line); font-size: 24px; }

/* ---------- フォーム ---------- */
label.field { display: block; font-size: 15px; font-weight: 600; margin-bottom: 16px; }
label.field input, label.field textarea {
  display: block; width: 100%; margin-top: 6px; padding: 14px 16px; min-height: 54px;
  font-size: 17px; font-weight: 400;
  border: 1px solid var(--line); border-radius: 14px; background: var(--card);
  -webkit-appearance: none; appearance: none;
}
label.field textarea { min-height: 150px; resize: vertical; line-height: 1.6; }
label.field input:focus, label.field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.check-row { display: flex; align-items: center; gap: 12px; min-height: 48px; font-size: 16px; font-weight: 500; margin-bottom: 8px; }
.check-row input { width: 24px; height: 24px; accent-color: var(--accent); }
.rule-note { background: var(--need-soft); color: var(--need); border-radius: 12px; padding: 10px 14px; font-size: 14px; font-weight: 500; margin-bottom: 16px; }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choices.one { grid-template-columns: 1fr; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 54px; padding: 6px 10px; border-radius: 14px;
  background: var(--fill); font-size: 17px; font-weight: 600; text-align: center; line-height: 1.3; cursor: pointer;
  border: 2px solid transparent; transition: background .15s ease;
}
.choice span small { font-size: 13px; font-weight: 500; color: var(--sub); }
.choice input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.choice input:checked + span small { color: var(--accent); }
.choice input:focus-visible + span { box-shadow: 0 0 0 4px var(--accent-soft); }

/* ---------- お知らせ ---------- */
.post-card .card-title { margin-top: 6px; }
.post-body { white-space: pre-wrap; word-break: break-word; font-size: 17px; line-height: 1.75; }
.ack-area { text-align: center; margin-top: 24px; }
.ack-done {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-top: 24px; padding: 18px; border-radius: var(--radius); background: var(--ok-soft); color: var(--ok);
}
.ack-done .check { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ok); color: #fff; font-weight: 800; }
.ack-done b { font-size: 18px; display: block; }
.ack-done small { font-size: 13px; }

/* ---------- 学習 ---------- */
.section ul { margin: 0; padding-left: 1.2em; }
.section li { margin-bottom: 6px; }
.criteria ul { list-style: none; padding-left: 0; }
.criteria li { position: relative; padding-left: 28px; }
.criteria li::before { content: "✓"; position: absolute; left: 2px; top: 0; font-weight: 800; color: var(--accent); }

/* ---------- 検定 ---------- */
.summary { display: flex; align-items: center; gap: 20px; }
.ring-wrap { position: relative; width: 104px; height: 104px; flex: none; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring-bg { stroke: var(--fill); }
.ring-fg { stroke: var(--ok); stroke-linecap: round; transition: stroke-dasharray .6s ease; }
.ring-num { position: absolute; inset: 0; display: flex; align-items: baseline; justify-content: center; padding-top: 34px; }
.ring-num b { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.ring-num small { font-size: 14px; color: var(--sub); }
.summary-label { font-size: 22px; font-weight: 700; }
.summary .chips { margin-top: 6px; }
.ov-pass { text-align: right; line-height: 1.1; }
.ov-pass b { font-size: 26px; font-weight: 700; color: var(--ok); font-variant-numeric: tabular-nums; }
.ov-pass small { display: block; font-size: 12px; color: var(--sub); }

/* ---------- 管理 ---------- */
.bar { height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; margin: 10px 0 6px; }
.bar i { display: block; height: 100%; background: var(--ok); border-radius: 3px; }
details { margin-top: 8px; }
summary { font-size: 15px; font-weight: 600; color: var(--accent); cursor: pointer; padding: 6px 0; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: " ›"; }
details[open] summary::after { content: " ⌄"; }
.approve-card { border: 2px solid var(--accent-soft); }

/* ---------- アカウント ---------- */
.profile { display: flex; align-items: center; gap: 16px; }
.profile b { display: block; font-size: 20px; }
.profile small { display: block; color: var(--sub); font-size: 14px; }
.avatar {
  flex: none; width: 60px; height: 60px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--hero-grad); color: #fff; font-size: 26px; font-weight: 700;
}

/* ---------- トースト ---------- */
.toast {
  position: fixed; left: 20px; right: 20px; z-index: 20;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
  max-width: 420px; margin: 0 auto; padding: 14px 20px; border-radius: 980px;
  background: rgba(29, 29, 31, .92); color: #fff; font-size: 16px; font-weight: 600; text-align: center;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: .3s ease;
}
.toast.show { opacity: 1; transform: none; }

/* ---------- 検定：わたし／みんな ---------- */
.segmented {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 3px; margin: 16px 0 0;
  background: var(--fill); border-radius: 12px;
}
.segmented a { text-align: center; padding: 9px 0; border-radius: 10px; font-size: 15px; font-weight: 600; color: var(--sub); }
.segmented a.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.cmp-card { padding: 18px 20px; }
.cmp-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.cmp-me span, .cmp-avg span { display: block; font-size: 13px; font-weight: 600; color: var(--sub); }
.cmp-me b { font-size: 44px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; color: var(--accent); }
.cmp-avg { text-align: right; margin-left: auto; }
.cmp-avg b { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.cmp-me small, .cmp-avg small { font-size: 14px; color: var(--sub); margin-left: 2px; }
.cmp-msg { margin: 4px 0 0; font-size: 15px; font-weight: 600; }
.filter { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 0; }
.filter button {
  min-height: 40px; padding: 0 16px; border-radius: 980px; border: 0; cursor: pointer;
  background: var(--fill); color: var(--ink); font-size: 15px; font-weight: 600;
}
.filter button.on { background: var(--ink); color: var(--bg); }
.hbar { position: relative; height: 6px; border-radius: 3px; background: var(--fill); margin: 8px 0 4px; }
.hbar i { display: block; height: 100%; border-radius: 3px; background: var(--ok); }
.hbar em { position: absolute; top: -4px; width: 2px; height: 14px; margin-left: -1px; border-radius: 1px; background: var(--sub); opacity: .7; }
.ov-row.is-me { background: var(--accent-soft); }
.ov-row.is-me .hbar i { background: var(--accent); }
.me-tag { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; vertical-align: 2px; }
.meta.small { font-size: 12px; }

/* ---------- 検定：項目ページ・引き継ぎ ---------- */
.is-top { display: flex; justify-content: space-between; align-items: center; }
.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 0; }
.kv div { background: var(--fill); border-radius: 12px; padding: 8px 10px; }
.kv dt { font-size: 12px; color: var(--sub); font-weight: 600; }
.kv dd { margin: 0; font-size: 14px; font-weight: 600; word-break: break-word; }
.note { padding: 14px 16px; position: relative; }
.note + .note::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; height: .5px; background: var(--hair); }
.note-head { display: flex; align-items: center; gap: 8px; }
.note-head .meta { margin-left: auto; font-size: 13px; }
.note-body { margin-top: 6px; white-space: pre-wrap; word-break: break-word; font-size: 16px; }
.avatar.sm { width: 28px; height: 28px; font-size: 13px; }
.note-snip {
  font-size: 13px; color: var(--sub); margin-top: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.note-snip b { color: var(--accent); font-weight: 700; }
.btn-row.end .pill { margin-left: auto; }

/* ---------- オーナー：メンバー・検定項目の編集 ---------- */
.edit-row { gap: 10px; padding-left: 8px; }
.edit-row .row-main { display: block; }
.sorter { display: flex; flex-direction: column; gap: 4px; flex: none; }
.arrow {
  width: 40px; height: 32px; border: 0; border-radius: 10px; background: var(--fill);
  color: var(--accent); font-size: 13px; cursor: pointer;
}
.arrow:disabled { opacity: .3; cursor: default; }
.arrow:active:not(:disabled) { background: var(--accent-soft); }
.owner-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 99px; background: var(--amber-soft); color: var(--amber); font-size: 11px; font-weight: 700; vertical-align: 2px; }
.chips.tight { margin-top: 4px; gap: 4px; }
.chips.tight .badge { font-size: 11px; padding: 1px 8px; }
.muted { color: var(--sub); }
.num-inline { display: inline-block; min-width: 26px; color: var(--sub); font-variant-numeric: tabular-nums; }
.fine.indent { margin: -6px 0 14px 36px; }

/* ---------- 日報・面談月報 ---------- */
label.field select {
  display: block; width: 100%; margin-top: 6px; padding: 12px 16px; min-height: 54px;
  font-size: 17px; font-weight: 400; color: var(--ink);
  border: 1px solid var(--line); border-radius: 14px; background: var(--card);
}
label.field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
label.field textarea.tall { min-height: 320px; }
.yen-input { position: relative; display: block; }
.yen-input > span { position: absolute; left: 16px; top: 50%; transform: translateY(calc(-50% + 3px)); color: var(--sub); font-weight: 600; pointer-events: none; }
label.field .yen-input input { padding-left: 36px; font-variant-numeric: tabular-nums; font-size: 20px; font-weight: 600; }
.date-nav { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; margin-bottom: 12px; }
.date-nav input { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font-size: 16px; text-align: center; }
.date-nav .pill { min-width: 44px; justify-content: center; font-size: 20px; }
.pill.disabled { opacity: .35; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-grid.one { grid-template-columns: 1fr; }
.stat-grid div { background: var(--fill); border-radius: 14px; padding: 10px 12px; }
.stat-grid span { display: block; font-size: 12px; font-weight: 600; color: var(--sub); }
.stat-grid b { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat-grid small { font-size: 13px; color: var(--sub); font-weight: 600; margin-left: 2px; }
.rep { padding: 14px 16px; position: relative; }
.rep + .rep::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; height: .5px; background: var(--hair); }
.rep-head { display: flex; align-items: baseline; gap: 8px; }
.rep-head b { font-size: 17px; }
.rep-head .chev { margin-left: auto; }
.rep-nums { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 13px; color: var(--sub); }
.rep-nums b { color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; }
.rep-work { margin-top: 8px; font-size: 15px; white-space: pre-wrap; word-break: break-word; background: var(--fill); border-radius: 12px; padding: 8px 12px; }

/* ---------- 在庫（材料の棚卸し） ---------- */
button.row { width: 100%; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
button.row:active { background: var(--fill); }
.qty { flex: none; text-align: right; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; }
.qty small { font-size: 13px; font-weight: 600; color: var(--sub); margin-left: 2px; }
.need-text { color: var(--need); }
.ok-text { color: var(--ok); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.meta.right { text-align: right; font-size: 13px; line-height: 1.4; }
.scan-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%;
  margin: 8px 0 4px; padding: 22px 16px; border: 0; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-ink); cursor: pointer; transition: transform .15s ease;
}
.scan-btn:active { transform: scale(.98); }
.scan-btn svg { width: 44px; height: 44px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.scan-btn b { font-size: 20px; }
.scan-btn small { font-size: 13px; opacity: .85; }

/* カメラ画面（全画面） */
body.scanning { overflow: hidden; }
.scanner { position: fixed; inset: 0; z-index: 30; background: #000; color: #fff; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-frame {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%);
  width: min(82vw, 420px); height: min(34vw, 170px); border-radius: 16px;
  border: 3px solid rgba(255, 255, 255, .9); box-shadow: 0 0 0 9999px rgba(0, 0, 0, .38);
}
.scan-top {
  position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; background: linear-gradient(rgba(0, 0, 0, .55), transparent);
}
.scan-top b { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-close { flex: none; min-height: 40px; padding: 0 18px; border: 0; border-radius: 980px; background: rgba(255, 255, 255, .92); color: #000; font-size: 16px; font-weight: 700; cursor: pointer; }
.scan-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; text-align: center;
  padding: 16px 16px calc(env(safe-area-inset-bottom) + 20px); background: linear-gradient(transparent, rgba(0, 0, 0, .65));
}
.scan-msg { margin: 0 0 12px; font-size: 16px; font-weight: 600; text-shadow: 0 1px 4px rgba(0, 0, 0, .6); }
.scan-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.scan-actions .pill { background: rgba(255, 255, 255, .2); color: #fff; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }

/* 下から出るシート */
.sheet-bg { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, .4); }
.sheet {
  width: 100%; max-width: 600px; max-height: 88%; overflow: auto; -webkit-overflow-scrolling: touch;
  background: var(--bg); border-radius: 22px 22px 0 0;
  padding: 22px 20px calc(env(safe-area-inset-bottom) + 16px);
}
.sheet .list-group, .sheet label.field input { background: var(--card); }
.sheet-title { font-size: 24px; margin: 2px 0 2px; line-height: 1.3; }
.sheet-list { max-height: 50vh; overflow: auto; }
.sheet .group-title { margin-top: 20px; }
.qty-stepper { display: grid; grid-template-columns: 64px 1fr 64px; gap: 10px; }
.qty-stepper button { min-height: 64px; border: 0; border-radius: 16px; background: var(--fill); color: var(--accent); font-size: 30px; font-weight: 600; cursor: pointer; }
.qty-stepper button:active { background: var(--accent-soft); }
.qty-stepper input {
  width: 100%; min-height: 64px; border: 1px solid var(--line); border-radius: 16px; background: var(--card);
  text-align: center; font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; -webkit-appearance: none; appearance: none;
}
.qty-stepper input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.sheet .segmented a { cursor: pointer; }

/* ラベル（店内用コード） */
.label-card { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px; border-radius: 12px; background: #fff; color: #000; margin-bottom: 16px; break-inside: avoid; }
.label-card svg { max-width: 100%; height: auto; }
.label-card b { font-size: 13px; text-align: center; line-height: 1.3; }
.label-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.label-sheet .label-card { margin: 0; border: 1px dashed #bbb; }
@media print {
  .topbar, .tabbar, .toast, .no-print, .page-head .pill { display: none !important; }
  body { background: #fff; }
  .app { max-width: none; padding: 0; }
  .page-head { margin: 0 0 8px; }
  .label-sheet { grid-template-columns: repeat(3, 1fr); gap: 4mm; }
}

/* ---------- 学習：参加記録 ---------- */
.segmented button {
  border: 0; background: transparent; font: inherit; text-align: center; padding: 9px 0; border-radius: 10px;
  font-size: 15px; font-weight: 600; color: var(--sub); cursor: pointer;
}
.segmented button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.segmented.small { margin: 12px 0 4px; }
.att-kind { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 4px 0 2px; font-size: 14px; }
.ok-txt { color: var(--ok); }
.no-txt { color: var(--red); }
.chip.no { background: var(--red-soft); color: var(--red); }
.field-label { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.att-panel { padding: 14px 16px; }
.att-panel .filter { margin: 0; }
.bulk { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.att-sum { margin: 8px 0 0; font-size: 15px; font-weight: 600; }
.att-row { display: flex; align-items: center; gap: 10px; min-height: 68px; padding: 8px 12px 8px 16px; position: relative; }
.att-row + .att-row::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; height: .5px; background: var(--hair); }
.att-row .row-main { min-width: 0; }
.att-toggle { display: flex; gap: 6px; flex: none; }
.att-toggle button {
  min-width: 66px; min-height: 46px; padding: 0 8px; border-radius: 12px; border: 2px solid transparent;
  background: var(--fill); color: var(--sub); font-size: 15px; font-weight: 700; cursor: pointer;
}
.att-toggle button.yes.on { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.att-toggle button.no.on { background: var(--red-soft); color: var(--red); border-color: var(--red); }
.sticky-save { position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px); z-index: 5; }
.sticky-save .btn { box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }

/* ---------- 追加機能：共通 ---------- */
.need-txt { color: var(--need); }
.pii-warn { margin: 6px 0 4px; padding: 8px 12px; border-radius: 10px; background: var(--need-soft); color: var(--need); font-size: 14px; font-weight: 600; line-height: 1.5; }
.rule-note.strong { font-weight: 700; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two-col .field { margin-bottom: 12px; }
.month-label { text-align: center; font-size: 18px; font-weight: 700; }
.unit-input { position: relative; display: block; }
.unit-input > span { position: absolute; right: 14px; top: 50%; transform: translateY(calc(-50% + 3px)); color: var(--sub); font-weight: 600; pointer-events: none; }
label.field .unit-input input { padding-right: 40px; font-variant-numeric: tabular-nums; font-size: 20px; font-weight: 600; }
.count-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.count-grid .field { margin-bottom: 14px; }
ul.plain { margin: 8px 0 0; padding-left: 1.2em; font-size: 14px; color: var(--sub); }
ul.plain li { margin-bottom: 4px; }
.danger-card { border: 2px solid var(--red); }
.file-btn { cursor: pointer; }

/* メニュー（iPhoneの設定画面風） */
.menu-row { gap: 14px; }
.menu-ic { flex: none; width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; color: #fff; }
.menu-ic svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.c-green { background: #34c759; } .c-orange { background: #ff9500; } .c-pink { background: #ff2d55; } .c-blue { background: #0a84ff; } .c-gray { background: #8e8e93; }
.count-badge { display: inline-block; margin-left: 8px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #ff3b30; color: #fff; font-size: 12px; line-height: 20px; text-align: center; vertical-align: 2px; }

/* 集客経路 */
.src-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.src-btn { min-height: 76px; border: 0; border-radius: 16px; background: var(--accent-soft); color: var(--accent); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 8px; }
.src-btn b { font-size: 18px; }
.src-btn small { font-size: 12px; color: var(--sub); }
.src-btn:active { transform: scale(.97); background: var(--accent); color: #fff; }
.src-bar { margin-bottom: 12px; }
.src-bar:last-child { margin-bottom: 0; }
.src-bar-head { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; }
.src-bar-head small { font-size: 12px; color: var(--sub); font-weight: 500; }
.src-bar .hbar { margin: 6px 0 0; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.sheet-list { max-height: 60vh; overflow-y: auto; }
.pick-row { width: 100%; border: 0; background: transparent; text-align: left; cursor: pointer; font: inherit; color: inherit; }

/* 売上・目標 */
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.metric-grid .card { margin: 0; padding: 14px; }
.metric-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 600; color: var(--sub); }
.metric-head b { font-size: 17px; }
.metric-val { font-size: 22px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.metric .hbar { margin: 8px 0 4px; }
.row.is-me { background: var(--accent-soft); }
.target-card { padding: 14px 16px; }
.target-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; margin-top: 10px; }
.target-grid .field { margin-bottom: 10px; font-size: 13px; }
.target-grid input { font-size: 17px !important; min-height: 48px !important; }

/* SNS */
.thumb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; border-radius: 16px; overflow: hidden; }
.thumb { position: relative; display: block; aspect-ratio: 1; background: var(--fill); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-memo { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 4px; font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.6)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb-badge { position: absolute; top: 4px; left: 4px; padding: 1px 6px; border-radius: 6px; background: rgba(52,199,89,.9); color: #fff; font-size: 10px; font-weight: 700; }
.asset-prev, .asset-big, .plan-img { display: block; width: 100%; border-radius: 16px; margin-top: 12px; }
.asset-big { margin: 4px 0 12px; }
.asset-pick { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; }
.asset-pick .pick { position: relative; flex: none; width: 72px; height: 72px; border-radius: 12px; overflow: hidden; background: var(--fill); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.asset-pick .pick img { width: 100%; height: 100%; object-fit: cover; }
.asset-pick .pick input { position: absolute; opacity: 0; }
.asset-pick .pick:has(input:checked) { box-shadow: inset 0 0 0 3px var(--accent); }
.asset-pick .pick:has(input:checked) img { opacity: .8; }

/* 会話ノート */
.note-card .note-text { margin: 10px 0 6px; }
.note-card .btn-row { margin-top: 10px; }

/* 取り込み */
.token { word-break: break-all; background: var(--fill); padding: 8px 12px; border-radius: 10px; font-size: 13px; }
.list-group.inner { background: var(--fill); }
.table-wrap { overflow-x: auto; padding: 8px; }
table.preview { border-collapse: collapse; font-size: 12px; white-space: nowrap; }
table.preview th, table.preview td { padding: 6px 8px; border-bottom: .5px solid var(--hair); text-align: left; }
table.preview th { color: var(--sub); font-weight: 600; }

/* ---------- 店舗日報・月報・数字データ ---------- */
:root { --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s-all: #6250d6; --s-py: #c7c7cc; --s-sel: #1d1d1f; }
@media (prefers-color-scheme: dark) { :root { --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s-all: #9085e9; --s-py: #5a5a5e; --s-sel: #f5f5f7; } }
.s-1 { --c: var(--s1); } .s-2 { --c: var(--s2); } .s-3 { --c: var(--s3); } .s-0, .s-all { --c: var(--s-all); } .s-py { --c: var(--s-py); }
.store-dot { flex: none; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--s-all)); margin-right: 8px; vertical-align: 1px; }
.hbar i[class^="s-"] { background: var(--c); }
.submit-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.submit-grid > div { background: var(--fill); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.submit-grid b { font-size: 15px; }
.ref { display: block; margin-top: 4px; font-size: 12px; font-weight: 500; color: var(--sub); }
table.mtable { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 10px; font-variant-numeric: tabular-nums; }
table.mtable th, table.mtable td { padding: 7px 6px; border-bottom: .5px solid var(--hair); text-align: right; white-space: nowrap; }
table.mtable th:first-child { text-align: left; color: var(--sub); font-weight: 600; }
table.mtable thead th { color: var(--sub); font-weight: 600; font-size: 12px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--c); }
.chart .bar.sel { stroke: var(--s-sel); stroke-width: 1.5; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .grid { stroke: var(--hair); stroke-width: 1; }
.chart .axis { fill: var(--sub); font-size: 9px; }
.chart-tip { min-height: 20px; margin-top: 6px; font-size: 14px; font-weight: 600; text-align: center; color: var(--ink); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 8px; font-size: 13px; color: var(--sub); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); margin-right: 5px; vertical-align: -1px; }
details.card > summary { color: var(--accent); }

/* ---------- 出勤 ---------- */
.att-today { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 12px; border-radius: var(--radius); background: var(--card); }
.att-today .att-text { flex: 1; min-width: 0; }
.att-today b { display: block; font-size: 16px; }
.att-today small { display: block; font-size: 13px; color: var(--sub); line-height: 1.4; }
.att-today .btn { min-height: 48px; padding: 0 28px; }
.att-today.done { background: var(--ok-soft); }
.att-today.done b { color: var(--ok); }
.att-today .check { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--ok); color: #fff; font-weight: 800; }
.onesta-box { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 12px; }
.onesta-box > div { background: var(--fill); border-radius: 14px; padding: 10px 12px; }
.onesta-box span { display: block; font-size: 12px; font-weight: 600; color: var(--sub); }
.onesta-box b { font-size: 20px; font-variant-numeric: tabular-nums; }
.onesta-box small { font-size: 13px; color: var(--sub); margin-left: 2px; }
.onesta-box a { display: block; font-size: 13px; color: var(--accent); margin-top: 2px; }
.att-toggle.work button.no.on { background: var(--fill); color: var(--sub); border-color: var(--line); }

/* ----- 検定のお手本（画像・動画） ----- */
.media-list { display: grid; gap: 14px; }
.media-item img, .media-item video { display: block; width: 100%; max-height: 70vh; object-fit: contain; border-radius: 12px; background: var(--fill); }
.media-embed { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--fill); }
.media-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.media-foot { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.media-cap { flex: 1; font-size: 14px; color: var(--sub); }

/* ----- 休みの届け出（公休・有給） ----- */
.lv-check { margin-top: 12px; padding: 10px 14px; border-radius: 12px; font-size: 15px; font-weight: 600; }
.lv-check.ok { background: var(--ok-soft); color: var(--ok); }
.lv-check.bad { background: var(--red-soft); color: var(--red); }
.lv-table th small, .lv-table td small { display: block; font-size: 11px; font-weight: 500; color: var(--sub); }
.lv-table td { text-align: center; }
.lv-table td.lv-yu { white-space: nowrap; }
.lv-table td.lv-none { color: var(--sub); opacity: .5; }
.lv-table td.lv-miss { color: var(--sub); font-size: 12px; }
.plain-list { margin: 10px 0 0; padding-left: 1.2em; display: grid; gap: 6px; font-size: 15px; line-height: 1.55; }
.lv-table td.lv-pend { color: var(--sub); }
.notice-link { display: flex; align-items: center; justify-content: space-between; color: var(--ink); background: var(--amber-soft); }
.pill.ok-pill { background: var(--ok-soft); color: var(--ok); }
.row .pill + .pill { margin-left: 6px; }
