/* NINE'S 勤怠・日報 — 黒と白が基調。赤は使わない
   黒ベタは「次に押すもの」「要対応（確認待ち）」だけに使う。デモ用の帯は生成り色＋破線で、製品の画面と分ける */
:root {
  --ink: #0b0a09;
  --ink-2: #1e1a17;
  --ink-3: #3a3530;
  --mid: #5f5850;      /* 13px でも白地でコントラスト比 4.5 以上 */
  --line: #d8d0c4;
  --line-2: #ebe6de;
  --bone: #ede8e0;
  --paper: #f6f4f0;
  --white: #ffffff;
  --f-display: "Arial Black", "Arial Bold", Impact, "Helvetica Neue", Helvetica, sans-serif;
  --f-jp: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", YuGothic, Meiryo, sans-serif;
  --f-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --fs-xs: 13px; --fs-sm: 14px; --fs-base: 16px; --fs-lg: 18px; --fs-xl: 22px; --fs-status: 30px;
  --tap: 48px; --tap-lg: 56px; --tap-xl: 72px; --tap-gap: 8px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;
  --radius: 12px; --radius-sm: 8px; --attn-bar: 4px;
  --maxw-staff: 560px; --maxw-admin: 1180px;
  --gutter: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body { margin: 0; font-family: var(--f-jp); color: var(--ink); background: var(--paper); line-height: 1.6; font-size: var(--fs-base); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.mono { font-family: var(--f-mono); }
.muted { color: var(--mid); }
.small { font-size: var(--fs-xs); }
.center { text-align: center; }
.grow { flex: 1; }
.empty { color: var(--mid); margin: var(--sp-2) 0; }
.loading { color: var(--mid); }
.eyebrow { font-family: var(--f-display); font-size: 11px; letter-spacing: .18em; color: var(--mid); text-transform: uppercase; }

/* ---------- 上部（製品のヘッダー） ---------- */
.topbar { background: var(--ink); color: var(--bone); position: sticky; top: 0; z-index: 30; }
.topbar-inner { max-width: var(--maxw-admin); margin: 0 auto; padding: 10px var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; }
.brand-logo { height: 22px; width: auto; filter: invert(1) brightness(1.1); }
.brand-sub { font-weight: 700; font-size: var(--fs-sm); letter-spacing: .08em; white-space: nowrap; }
.who { font-size: var(--fs-xs); display: flex; align-items: center; gap: 8px; }
.chip { display: inline-flex; align-items: center; font-size: 11px; line-height: 1; padding: 5px 8px; border-radius: 99px; font-weight: 700; letter-spacing: .08em; white-space: nowrap; }
.chip-demo { background: var(--ink); color: var(--bone); font-family: var(--f-display); }

/* ---------- デモの帯（製品の外側） ---------- */
.demo-bar { background: var(--bone); border-bottom: 2px dashed var(--ink); position: relative; }
.demo-bar-inner { max-width: var(--maxw-admin); margin: 0 auto; padding: var(--sp-3) var(--gutter); display: grid; gap: var(--sp-2); }
.demo-head { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); flex-wrap: wrap; }
.switcher { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 2px solid var(--ink); border-radius: var(--radius-sm); overflow: hidden; background: var(--white); }
.switch-btn { position: relative; border: 0; border-left: 1px solid var(--line); background: transparent; min-height: var(--tap); padding: 6px 4px; cursor: pointer; line-height: 1.25; display: grid; place-items: center; align-content: center; }
.switch-btn:first-child { border-left: 0; }
.switch-btn span { font-weight: 700; font-size: var(--fs-sm); }
.switch-btn small { font-size: 11px; color: var(--mid); }
.switch-btn:hover { background: var(--paper); }
.switch-btn[aria-pressed="true"] { background: var(--ink); color: var(--bone); }
.switch-btn[aria-pressed="true"] small { color: #cfc7bb; }
.switch-btn:disabled { cursor: wait; opacity: .6; }
.next-label { position: absolute; top: 2px; right: 4px; font-size: 10px; font-weight: 700; background: var(--ink); color: var(--bone); padding: 1px 5px; border-radius: 4px; }
.switch-note { margin: 0; background: var(--white); border-left: var(--attn-bar) solid var(--ink); padding: var(--sp-2) var(--sp-3); font-size: var(--fs-sm); font-weight: 700; }
.guide { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--sp-2) var(--sp-4); font-size: var(--fs-sm); }
.guide-line { display: flex; gap: var(--sp-3); align-items: flex-start; flex: 1 1 320px; }
.guide-num { font-family: var(--f-display); font-size: var(--fs-lg); line-height: 1.2; white-space: nowrap; }
.guide-num small { font-size: var(--fs-xs); color: var(--mid); }
.guide-text { line-height: 1.5; }
.guide-tools { display: flex; gap: var(--sp-3); align-items: center; font-size: var(--fs-xs); }
.guide-all summary { cursor: pointer; text-decoration: underline; }
.guide-all ol { position: absolute; z-index: 40; background: var(--white); border: 1px solid var(--ink); border-radius: var(--radius-sm); padding: var(--sp-3) var(--sp-3) var(--sp-3) 2em; margin: 6px 0 0; right: var(--gutter); max-width: 420px; box-shadow: 0 8px 24px rgba(0,0,0,.15); }
.guide-all li.done { color: var(--mid); text-decoration: line-through; }
.guide-all li.now { font-weight: 700; }
.link-btn { border: 0; background: transparent; padding: 6px 2px; cursor: pointer; text-decoration: underline; color: var(--ink-3); font-size: var(--fs-sm); min-height: 36px; }

/* 次に押すボタン */
.is-next { outline: 3px solid var(--ink) !important; outline-offset: 4px; animation: nextpulse 1.1s ease-in-out 2; position: relative; }
@keyframes nextpulse { 50% { outline-offset: 9px; } }
@media (prefers-reduced-motion: reduce) { .is-next { animation: none; } }
.card-dark .is-next, .attn-band .is-next { outline-color: var(--bone) !important; }
/* 切替ボタンは枠の外が切れるので、内側に描く */
.switch-btn.is-next { outline-offset: -5px; animation: none; }
.switch-btn[aria-pressed="true"].is-next { outline-color: var(--bone) !important; }

/* ---------- 本文 ---------- */
.app { max-width: var(--maxw-admin); margin: 0 auto; padding: var(--sp-5) var(--gutter) var(--sp-6); outline: none; }
.staff-wrap { max-width: var(--maxw-staff); margin: 0 auto; }
.page-head { margin: 0 0 var(--sp-4); }
.page-head h1 { margin: 2px 0 0; font-size: var(--fs-xl); line-height: 1.3; }
.page-head .sub { color: var(--mid); font-size: var(--fs-sm); margin: 2px 0 0; }
.stack { display: grid; gap: var(--sp-4); }
.narrow { max-width: 420px; margin-left: auto; margin-right: auto; }

.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-4); }
.card h2 { margin: 0 0 var(--sp-3); font-size: var(--fs-lg); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card h2 .count { font-size: var(--fs-xs); color: var(--mid); font-weight: 400; }
.card-dark { background: var(--ink); color: var(--bone); border-color: var(--ink); }
.label { font-size: var(--fs-sm); font-weight: 700; margin-bottom: var(--sp-2); }
.h3 { font-size: var(--fs-sm); margin: var(--sp-4) 0 var(--sp-2); }
.is-dim { opacity: .45; }
.dim-note { margin: -4px 0 var(--sp-3); font-weight: 700; font-size: var(--fs-sm); }

/* タブ（下線型。黒ベタは使わない） */
.tabs { display: flex; gap: var(--sp-5); border-bottom: 1px solid var(--line); margin-bottom: var(--sp-4); }
.tab { border: 0; background: transparent; padding: 10px 2px; min-height: var(--tap); cursor: pointer; font-weight: 700; color: var(--mid); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }

/* 今日の勤務 */
.status-card { display: grid; gap: var(--sp-3); padding: var(--sp-5) var(--sp-4); }
.status-label { font-size: var(--fs-status); font-weight: 800; line-height: 1.2; display: flex; align-items: center; gap: 10px; }
.status-sub { margin: 0; font-size: var(--fs-base); }
.status-working { border: 2px solid var(--ink); }
.status-done { background: var(--paper); }
.dot { width: 12px; height: 12px; border-radius: 50%; background: currentColor; display: inline-block; flex: none; }
.dot-live { animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .2; } }
@media (prefers-reduced-motion: reduce) { .dot-live { animation: none; } }

.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-2); }
.flow button { width: 100%; min-height: var(--tap); border: 1px solid var(--line); background: var(--white); border-radius: var(--radius-sm); font-size: var(--fs-xs); font-weight: 700; color: var(--mid); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px 2px; }
.flow .flow-n { width: 22px; height: 22px; border-radius: 50%; border: 1px solid currentColor; display: grid; place-items: center; font-size: 12px; }
.flow button.done { color: var(--ink); border-color: var(--ink); }
.flow button.done .flow-n { background: var(--ink); color: var(--bone); border-color: var(--ink); }

/* ボタン */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex-direction: column; border: 2px solid var(--ink); background: var(--white); color: var(--ink); border-radius: var(--radius-sm); padding: 8px 16px; font-weight: 700; cursor: pointer; min-height: var(--tap); text-decoration: none; line-height: 1.3; }
.btn:hover { background: var(--line-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--ink); color: var(--bone); }
.btn-primary:hover { background: var(--ink-3); }
.btn-invert { background: var(--bone); color: var(--ink); border-color: var(--bone); }
.btn-invert:hover { background: var(--white); }
.btn-ghost { border-color: var(--line); background: transparent; border-width: 1px; }
.btn-sm { min-height: 40px; padding: 4px 12px; font-size: var(--fs-sm); border-width: 1px; }
.btn-lg { min-height: var(--tap-lg); font-size: var(--fs-lg); }
.btn-xl { min-height: var(--tap-xl); font-size: 24px; letter-spacing: .12em; }
.btn-block { width: 100%; }
.btn-sub { font-size: 11px; font-weight: 400; color: var(--mid); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--tap-gap); margin-top: var(--sp-2); }
.btn-row .btn { flex: 1 1 auto; }

/* 状態の印（全画面で共通） */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 700; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--ink); white-space: nowrap; background: var(--white); color: var(--ink); }
.pill-solid { background: var(--ink); color: var(--bone); }
.pill-live { border-width: 2px; }
.pill-live .dot { width: 8px; height: 8px; }
.pill-soft { background: var(--line-2); border-color: var(--line-2); color: var(--ink-3); }
.pill-dash { border-style: dashed; border-color: var(--mid); color: var(--mid); }
.pill-line { border-color: var(--mid); color: var(--ink-3); font-weight: 400; }

/* 業務 */
.chips { display: flex; flex-wrap: wrap; gap: var(--tap-gap); margin-bottom: var(--sp-4); }
.chip-task { min-height: var(--tap); padding: 0 14px; border: 2px solid var(--ink); background: var(--white); border-radius: 99px; font-size: 15px; font-weight: 700; cursor: pointer; }
.chip-task:hover { background: var(--line-2); }
.task-list { list-style: none; padding: 0; margin: 0 0 var(--sp-3); display: grid; gap: var(--sp-3); }
.task { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--sp-3); display: grid; gap: var(--sp-2); position: relative; }
.task-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; padding-right: 28px; }
.task-title { font-weight: 700; word-break: break-word; }
.task-cat { font-size: 11px; color: var(--mid); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; white-space: nowrap; }
.bar { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--ink); border-radius: 99px; transition: width .25s; }
.bar-row { display: flex; align-items: center; gap: 8px; }
.bar-row .bar { flex: 1; }
.bar-row b { font-family: var(--f-mono); font-size: var(--fs-xs); min-width: 3.4em; text-align: right; }
.prog-btns { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.prog-btns button { border: 1px solid var(--line); background: var(--white); border-radius: 6px; font-size: var(--fs-sm); cursor: pointer; min-height: var(--tap); padding: 0; }
.prog-btns button[aria-pressed="true"] { background: var(--ink); color: var(--bone); border-color: var(--ink); font-weight: 700; }
.task-more { position: absolute; top: 6px; right: 6px; }
.task-more summary { list-style: none; cursor: pointer; width: 32px; height: 28px; display: grid; place-items: center; border-radius: 6px; font-weight: 700; color: var(--mid); }
.task-more summary::-webkit-details-marker { display: none; }
.task-more[open] { background: var(--white); border: 1px solid var(--line); border-radius: 6px; padding: 0 8px 4px; z-index: 2; }

.more-box { border-top: 1px dashed var(--line); padding-top: var(--sp-3); margin-top: var(--sp-3); }
.more-box summary { cursor: pointer; font-weight: 700; min-height: 40px; display: flex; align-items: center; }
.more-box[open] summary { margin-bottom: var(--sp-3); }

/* フォーム */
.field { display: grid; gap: 4px; margin: var(--sp-3) 0; }
.field label { font-size: var(--fs-sm); font-weight: 700; }
input[type="text"], input[type="password"], input[type="time"], input[type="date"], select, textarea {
  width: 100%; border: 1px solid var(--mid); border-radius: var(--radius-sm); padding: 12px; background: var(--white); min-height: 52px; font-size: var(--fs-base);
}
textarea { min-height: 110px; resize: vertical; }

/* コメント */
.comment { border-left: 3px solid var(--ink); padding: 6px 0 6px 12px; margin: 0 0 var(--sp-3); }
.comment p { margin: 2px 0 0; white-space: pre-wrap; word-break: break-word; }
.comment .meta { font-size: var(--fs-xs); color: var(--mid); }
.card-dark .comment { border-color: var(--bone); }
.card-dark .comment .meta { color: #cfc7bb; }
.card-dark h2 { color: var(--bone); }
.notice-new { animation: pop .4s ease-out; }
@keyframes pop { from { transform: scale(.98); opacity: .4; } }

.report-view { margin: 0; }
.report-view dt { font-size: var(--fs-xs); color: var(--mid); font-weight: 700; margin-top: var(--sp-3); }
.report-view dd { margin: 2px 0 0; white-space: pre-wrap; word-break: break-word; }

/* 勤務履歴（1日1枚） */
.days { list-style: none; margin: 0 0 var(--sp-3); padding: 0; display: grid; gap: var(--sp-2); }
.day { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--sp-3); display: grid; gap: 4px; }
.day.today { border: 2px solid var(--ink); }
.day-date { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.today-tag { font-size: 11px; background: var(--ink); color: var(--bone); padding: 1px 6px; border-radius: 4px; }
.day-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }

/* 管理者 */
.attn-band { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); background: var(--ink); color: var(--bone); border-radius: var(--radius); padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-3); font-weight: 700; }
.attn-band.calm { background: var(--white); color: var(--ink-3); border: 1px solid var(--line); font-weight: 400; }
.attn-item { border: 1px solid var(--bone); background: transparent; color: var(--bone); border-radius: 99px; min-height: 40px; padding: 0 16px; cursor: pointer; font-weight: 700; }
.attn-item b { font-family: var(--f-display); font-size: var(--fs-lg); margin: 0 2px; }
.attn-item:hover { background: var(--ink-3); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-2); margin-bottom: var(--sp-4); }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--sp-2) var(--sp-3); display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.stat span { font-size: var(--fs-xs); color: var(--mid); font-weight: 700; flex-basis: 100%; }
.stat b { font-family: var(--f-display); font-size: 26px; line-height: 1.1; }
.stat small { font-size: var(--fs-xs); color: var(--mid); }

.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--sp-4); align-items: start; }
.staff-rows { display: grid; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.srow { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--sp-3) var(--sp-4); display: grid; gap: var(--sp-2); }
.srow.needs { border-left: var(--attn-bar) solid var(--ink); }
.srow.flash { animation: flash 1.4s ease-out; }
@keyframes flash { from { background: var(--line); } to { background: transparent; } }
.srow-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.srow-name { font-size: var(--fs-lg); margin-right: 8px; }
.srow-dept { font-size: var(--fs-xs); color: var(--mid); }
.srow-time { font-size: var(--fs-sm); color: var(--ink-3); }
.srow-tasks { display: grid; gap: 6px; }
.mini-task { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 10px; align-items: center; font-size: var(--fs-sm); }
.mini-task .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); padding-top: var(--sp-2); border-top: 1px solid var(--line-2); }
.side-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-2); }
.side-list li { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--sp-3); font-size: var(--fs-sm); }
.reset-card { border: 2px dashed var(--ink); background: var(--bone); }

/* 人を選ぶ */
.pick { display: grid; grid-template-columns: 1.3fr 1fr; gap: var(--sp-4); margin-bottom: var(--sp-4); }
.pick-card { display: grid; gap: var(--sp-3); align-content: start; padding: var(--sp-5); }
.pick-card h2 { font-size: var(--fs-xl); margin: 0; }
.pick-card p { margin: 0; }

/* フッター */
.footer { border-top: 1px solid var(--line); background: var(--white); }
.footer-inner { max-width: var(--maxw-admin); margin: 0 auto; padding: 10px var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: var(--fs-xs); color: var(--mid); }
.footer-note { max-width: var(--maxw-admin); margin: 0 auto; padding: 0 var(--gutter) 16px; font-size: var(--fs-xs); color: var(--mid); }

/* トースト（上部。次に押すボタンに被らないように） */
.toast { position: fixed; left: 50%; top: 60px; transform: translateX(-50%); background: var(--ink); color: var(--bone); padding: 12px 18px; border-radius: var(--radius-sm); z-index: 50; width: max-content; max-width: calc(100% - 32px); box-shadow: 0 6px 24px rgba(0,0,0,.25); font-weight: 700; }
.toast.err { background: var(--white); color: var(--ink); border: 2px solid var(--ink); }

/* モーダル */
.modal { border: 0; padding: 0; border-radius: 14px; width: min(680px, calc(100% - 24px)); max-height: calc(100% - 24px); }
.modal::backdrop { background: rgba(11,10,9,.6); }
.modal-inner { padding: var(--sp-5); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: var(--sp-3); }
.modal-head h2 { margin: 2px 0 0; font-size: var(--fs-xl); line-height: 1.3; }
.close-x { border: 0; background: transparent; font-size: 28px; line-height: 1; cursor: pointer; width: 44px; height: 44px; }
.reset-list { margin: 8px 0 14px; padding-left: 1.3em; }

/* 合言葉の入口 */
.gate-body { background: var(--ink); color: var(--bone); min-height: 100vh; display: grid; place-items: center; padding: var(--gutter); }
.gate { width: min(420px, 100%); }
.gate-logo { height: 30px; filter: invert(1) brightness(1.1); }
.gate h1 { font-size: 22px; margin: 18px 0 6px; display: flex; align-items: center; gap: 10px; }
.gate h1 span { font-family: var(--f-display); font-size: 11px; background: var(--bone); color: var(--ink); padding: 3px 8px; border-radius: 99px; letter-spacing: .1em; }
.gate label { display: block; font-size: 13px; font-weight: 700; margin: 14px 0 6px; }
.gate input { background: var(--ink-2); color: var(--bone); border-color: #5a534c; margin-bottom: 14px; }
.gate .btn-primary { background: var(--bone); color: var(--ink); border-color: var(--bone); }
.gate-error { border: 1px solid var(--bone); border-radius: 8px; padding: 8px 12px; font-weight: 700; }
.gate-note { font-size: 12px; color: #b9b1a6; margin-top: 18px; }

/* 画面幅ごと */
@media (max-width: 1020px) {
  .admin-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .pick { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .stat { padding: 6px 8px; }
  .stat b { font-size: 20px; }
  .mini-task { grid-template-columns: minmax(0, 1fr) 110px; }
  .brand-sub { display: none; }
  .switch-btn small { display: none; }
  .switch-btn span { font-size: var(--fs-xs); }
  .switch-btn { min-height: 54px; padding-bottom: 14px; }
  .next-label { top: auto; bottom: 4px; right: 50%; transform: translateX(50%); font-size: 9px; white-space: nowrap; }
  .guide-tools { width: 100%; justify-content: flex-end; }
  .modal-inner { padding: var(--sp-4); }
  .card { padding: var(--sp-4); }
  .toast { top: 56px; }
}
@media (min-width: 900px) {
  .card { padding: 20px; }
}
