/* KDS ONE STAY（KDSステイ管理システム）— 画面スタイル
 *
 * 部品の形はホテル売上（hotel-uriage）を引き継ぎ、色は KDS の共通テーマ（KDS PERFORMANCE と同じ
 * 濃紺 #132330・オレンジ #e96d2f・白）にそろえている（2026-10-08 所有者の指示「色合いも他のアプリと同じに」）。
 * 事務所の PC で毎日使うので、装飾より「読みやすいこと」を優先する。
 * 数字は等幅かつ tabular-nums で桁を揃える。
 */

:root {
  /* ブラウザが描く部品（チェック欄・選択の矢印・スクロールバーなど）もダーク表示に合わせる */
  color-scheme: light dark;
  --bg: #f4f6f7;
  --bg-tint: #eef2f4;
  --panel: #ffffff;
  --panel-raised: #ffffff;
  --border: #dfe5e9;
  --border-strong: #bcc8cf;
  --text: #17212a;
  --text-dim: #71808c;
  --accent: #e96d2f;
  --accent-hover: #d45b21;
  --accent-soft: #fff1e9;
  --accent-strong: #d45b21;
  --good: #24956a;
  --bad: #b02a37;
  --sat: #1a5fb4;
  --sun: #b02a37;
  --warn: #9a6700;
  --warn-bg: #fff8e5;
  --row-alt: #fafbfc;
  --today: #fff1e9;
  --derived: #f0f4f7;
  --topbar: #132330;
  --topbar-text: #f7fafb;
  --topbar-dim: #aebdc6;
  --chart-1: #e96d2f;
  --chart-2: #2563b0;
  --chart-3: #26996b;
  --chart-4: #8266bb;
  --chart-5: #c44958;
  --chart-6: #c99a24;
  --chart-7: #318db9;
  --chart-other: #7c8998;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .1);
  --shadow-lg: 0 24px 60px rgba(23, 35, 52, .16);
  --radius: 12px;
  --radius-lg: 18px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101820;
    --bg-tint: #14202a;
    --panel: #18232c;
    --panel-raised: #1c2933;
    --border: #2b3a45;
    --border-strong: #465762;
    --text: #edf2f4;
    --text-dim: #9baab4;
    --accent: #f1844d;
    --accent-hover: #ff9a66;
    --accent-soft: #3a261d;
    --accent-strong: #ff9a66;
    --good: #65c79a;
    --bad: #e5534b;
    --sat: #6aa5ef;
    --sun: #e5534b;
    --warn: #c69026;
    --warn-bg: #2b2416;
    --row-alt: #1b262f;
    --today: #3a261d;
    --derived: #1b2933;
    --topbar: #0c171f;
    --topbar-text: #f7fafb;
    --topbar-dim: #aebdc6;
    --chart-1: #f1844d;
    --chart-2: #5b9be6;
    --chart-3: #65c79a;
    --chart-4: #b5a0e2;
    --chart-5: #ef7b87;
    --chart-6: #e0b45d;
    --chart-7: #72b9df;
    --chart-other: #9dafba;
    --shadow: 0 1px 2px rgba(0, 0, 0, .18), 0 12px 28px rgba(0, 0, 0, .18);
    --shadow-lg: 0 28px 70px rgba(0, 0, 0, .38);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.num, input[type="number"], input[inputmode="numeric"], td.num, th.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* --- 全体レイアウト ------------------------------------------------------ */

header.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 24px;
  min-height: 64px;
  background: var(--topbar);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 8px 28px rgba(19, 35, 48, .22);
  position: sticky;
  top: 0;
  z-index: 20;
  overflow-x: auto;
}

.topbar .brand {
  color: var(--topbar-text);
  font-weight: 750;
  font-size: 16px;
  letter-spacing: .01em;
  margin-right: 18px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.topbar .brand small { color: var(--topbar-dim); font-weight: 500; margin-left: 8px; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 9px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -.04em;
  box-shadow: inset 0 1px rgba(255, 255, 255, .12);
}

.topbar nav { display: flex; gap: 2px; }
.topbar nav a {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--topbar-dim);
  text-decoration: none;
  white-space: nowrap;
  font-weight: 600;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.topbar nav a:hover { background: rgba(255, 255, 255, .08); color: var(--topbar-text); }
.topbar nav a.active { background: rgba(255, 255, 255, .14); color: #fff; font-weight: 700; }

.topbar .spacer { flex: 1; }
.topbar .user {
  color: var(--topbar-dim);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.topbar .user button { color: var(--topbar-dim); }
.topbar .user button:hover { color: #fff; background: rgba(255, 255, 255, .09); border-color: transparent; }
/* ［使い方］はマニュアル（/guide/）を別タブで開くリンク。見た目はほかのボタンにそろえる */
.topbar .user a.ghost { color: var(--topbar-dim); text-decoration: none; padding: 7px 14px; border: 1px solid transparent; border-radius: 8px; font-weight: 600; line-height: 1; }
.topbar .user a.ghost:hover { color: #fff; background: rgba(255, 255, 255, .09); }

main { padding: 26px 28px 42px; max-width: 1540px; margin: 0 auto; }

.empty { padding: 60px 20px; text-align: center; color: var(--text-dim); }

/* --- 部品 ---------------------------------------------------------------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 20px;
}
.panel h2 { margin: 0 0 14px; font-size: 16px; letter-spacing: .01em; }
.panel h3 { margin: 18px 0 10px; font-size: 14px; color: var(--text-dim); }

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.toolbar .title { font-size: 20px; font-weight: 750; letter-spacing: -.01em; margin-right: 8px; }
.toolbar .hint { color: var(--text-dim); font-size: 12.5px; }

button, .btn {
  font: inherit;
  min-height: 36px;
  padding: 7px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
}
button:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
button:active { transform: translateY(1px); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 7px 18px rgba(233, 109, 47, .22); }
button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
button.ghost { border-color: transparent; color: var(--text-dim); }
button:disabled { opacity: .5; cursor: default; }

/* 型を書いていない入力欄（日報の表・目標・チャネル・権限の種類の名前など）も同じ色にする。前はダーク表示で
   ブラウザの既定の黒い字のままになり、暗い地の上で読めなかった（2026-09-28 所有者の指摘） */
select, input:not([type]), input[type="text"], input[type="password"], input[type="number"], input[type="search"], input[type="file"], textarea {
  font: inherit;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
}
input:focus, select:focus { outline: 3px solid color-mix(in srgb, var(--accent) 18%, transparent); border-color: var(--accent); }

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 650;
}

/* 目立つ断り書き（自動車学校のダッシュボードと同じ見た目） */
.notice { padding: 13px 16px; border-radius: 10px; margin-bottom: 14px; font-size: 13px; border-left: 4px solid currentColor; }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.error { background: #fdeaec; color: var(--bad); }
.notice.ok { background: var(--accent-soft); color: var(--accent); }
@media (prefers-color-scheme: dark) { .notice.error { background: #2b1a1c; } }

.msg { padding: 10px 13px; border-radius: 9px; margin: 8px 0; }
.msg.ok { background: var(--accent-soft); color: var(--accent); }
.msg.warn { background: var(--warn-bg); color: var(--warn); }
.msg.err { background: rgba(176, 42, 55, .1); color: var(--bad); }

/* --- 表 ------------------------------------------------------------------ */

.tablewrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  scrollbar-color: var(--border-strong) transparent;
  scrollbar-width: thin;
}
.tablewrap::-webkit-scrollbar { height: 10px; width: 10px; }
.tablewrap::-webkit-scrollbar-thumb { background: var(--border-strong); border: 3px solid transparent; border-radius: 999px; background-clip: padding-box; }

/* 見出しを貼り付けて表を内側で縦スクロールさせる（日報入力で使う）。
 * 月の後半の日を入力しても、上の項目欄が常に見えるようにする。 */
.tablewrap.sticky-head { max-height: 72vh; overflow: auto; }
.sticky-head thead th {
  position: sticky;
  z-index: 3;
  background: var(--panel-raised);
  box-shadow: inset 0 -1px var(--border);
}
.sticky-head thead tr:first-child th { top: 0; }
/* 2 段目は 1 段目の高さぶん下げる。既定 30px、JS が実測値で上書きする */
.sticky-head thead tr:nth-child(2) th { top: 30px; }
.sticky-head thead th.group { z-index: 4; }
/* いま入力している欄を分かりやすく */
.sticky-head tbody input:focus { outline: 2px solid var(--accent); outline-offset: -1px; background: var(--accent-soft); }

table.grid {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
  font-size: 13px;
}
table.grid th, table.grid td {
  border: 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 6px 9px;
  text-align: right;
  white-space: nowrap;
}
table.grid th {
  background: var(--derived);
  font-weight: 700;
  text-align: center;
  color: var(--text-dim);
}
table.grid th.group { border-bottom-width: 2px; color: var(--text); }
table.grid td.label, table.grid th.label { text-align: left; }
table.grid td.center { text-align: center; }
table.grid tr:nth-child(even) td { background: var(--row-alt); }
table.grid tbody tr:hover td { background: color-mix(in srgb, var(--accent-soft) 62%, var(--panel)); }
table.grid tr.today td { background: var(--today); box-shadow: inset 0 1px color-mix(in srgb, var(--warn) 32%, transparent), inset 0 -1px color-mix(in srgb, var(--warn) 32%, transparent); }
table.grid tr.today td:first-child { box-shadow: inset 4px 0 var(--warn), inset 0 1px color-mix(in srgb, var(--warn) 32%, transparent), inset 0 -1px color-mix(in srgb, var(--warn) 32%, transparent); }
table.grid tr.total td, table.grid td.total {
  font-weight: 700;
  background: var(--accent-soft);
  border-top: 2px solid var(--accent);
}
table.grid td.dim { color: var(--text-dim); }
table.grid td.derived { background: var(--derived) !important; color: var(--text-dim); }

.sat { color: var(--sat); }
.sun { color: var(--sun); }
.pos { color: var(--good); }
.neg { color: var(--bad); }

table.grid input {
  color: var(--text);
  width: 68px;
  min-height: 28px;
  padding: 3px 6px;
  text-align: right;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 4px;
}
table.grid input:hover { border-color: var(--border-strong); }
table.grid input:focus { border-color: var(--accent); background: var(--panel); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
table.grid input.dirty { background: var(--warn-bg); }
table.grid input.saved { background: color-mix(in srgb, var(--good) 15%, transparent); transition: background 1s; }

/* --- ダッシュボード ------------------------------------------------------ */

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.card {
  min-width: 150px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 17px 18px;
  position: relative;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--accent); }
.card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); box-shadow: 0 12px 30px rgba(23, 35, 52, .1); }
.card .k { color: var(--text-dim); font-size: 12px; font-weight: 650; letter-spacing: .02em; }
.card .v { font-size: 25px; font-weight: 750; line-height: 1.35; letter-spacing: -.02em; margin: 4px 0; }
.card .s { font-size: 12.5px; color: var(--text-dim); }

.chart-note { color: var(--text-dim); font-size: 12px; margin-top: 4px; }

.legend { display: flex; gap: 10px 18px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-dim); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { display: inline-block; width: 16px; height: 8px; border-radius: 999px; }
.legend svg { flex: none; }

/* --- ログイン ------------------------------------------------------------ */

.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  background: var(--panel);
}
.login-visual {
  position: relative;
  min-height: 100vh;
  padding: clamp(54px, 9vw, 150px);
  display: flex;
  align-items: center;
  overflow: hidden;
  color: #fff;
  background: #132330;
}
.login-grid {
  position: absolute;
  inset: 0;
  opacity: .16;
  background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to right, black, transparent);
  display: none;
}
.login-copy { position: relative; z-index: 2; }
.login-eyebrow { margin: 0; color: #f79561; font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.login-copy h1 { margin: 22px 0 24px; color: #fff; font-size: clamp(38px, 4.2vw, 66px); line-height: 1.27; letter-spacing: -.055em; }
.login-copy > p:not(.login-eyebrow) { margin: 0; color: #aebdc6; font-size: 15px; line-height: 2; }
.login-pills { margin-top: 48px; display: flex; flex-wrap: wrap; gap: 9px; }
.login-pills span { padding: 8px 12px; border: 1px solid rgba(255,255,255,.12); border-radius: 20px; color: #c7d1d7; background: rgba(255,255,255,.04); font-size: 13px; }
.login-orb { display: none; position: absolute; border-radius: 50%; filter: blur(2px); }
.login-orb.one { width: 430px; height: 430px; right: -250px; bottom: -170px; background: radial-gradient(circle at 30% 30%, rgba(233,109,47,.55), rgba(233,109,47,0) 68%); }
.login-orb.two { width: 180px; height: 180px; right: 10%; top: 9%; border: 1px solid rgba(255,255,255,.08); box-shadow: 0 0 90px rgba(233,109,47,.09); }
.login-panel { min-width: 0; padding: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--panel); }
.login {
  width: min(420px, 100%);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 54px; }
.login-brand-copy { display: flex; flex-direction: column; line-height: 1.1; }
.login-brand-copy strong { font-size: 17px; }
.login-brand-copy small { margin-top: 6px; color: var(--text-dim); font-size: 11px; letter-spacing: .18em; }
.login-secure { margin: 0 0 10px; color: var(--good); font-size: 13px; font-weight: 700; }
.login h1 { font-size: 28px; line-height: 1.45; letter-spacing: 0; margin: 0 0 7px; }
.login-brand .brand-mark {
  width: 40px;
  height: 40px;
  margin: 0;
  background: var(--accent);
  border-color: var(--accent);
}
.login .sub { color: var(--text-dim); font-size: 15px; margin-bottom: 29px; }
.login label { display: block; margin: 18px 0 8px; font-size: 14px; font-weight: 700; color: color-mix(in srgb, var(--text) 78%, var(--text-dim)); }
.login input { width: 100%; min-height: 48px; padding: 0 14px; border-radius: 10px; font-size: 15px; }
.login input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
.login button { width: 100%; min-height: 50px; margin-top: 22px; padding: 0 17px; display: flex; align-items: center; justify-content: space-between; border-radius: 10px; font-size: 15px; }
.login button::after { content: "\2192"; font-size: 19px; font-weight: 400; }
/* ログイン画面から使い方（マニュアル）へ。初めての人向けに目立たせすぎず中央に置く */
.login-guide { display: block; margin-top: 26px; color: var(--accent-strong); font-size: 13.5px; font-weight: 700; text-align: center; text-decoration: none; }
.login-guide:hover { text-decoration: underline; }
.login-build { margin-top: 42px; color: var(--text-dim); font-size: 12px; text-align: center; }
.login-guide ~ .login-build { margin-top: 16px; }
/* 「このパソコンにアイコンを作る」（2026-10-04。ブラウザが入れられると知らせたときだけ出る・app.js の installButtonHtml）。
   使い方の案内のすぐ下に、小さく真ん中に置く */
.login button.login-install { width: fit-content; min-height: 38px; margin: 12px auto 0; padding: 0 14px; justify-content: center; gap: 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 9px; background: var(--accent-soft);
  color: var(--accent-strong); font-size: 13.5px; font-weight: 700; max-width: 100%; }
.login button.login-install:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, var(--panel)); }
.login button.login-install::after { content: none; }
.login button.login-install svg { flex: none; }
.login button.login-install[hidden] { display: none; }
/* 名前を選ぶログイン（社内・会社の回線から。2026-09-28） */
.login input[type="search"] { margin-top: 4px; }
.login-names { display: grid; gap: 8px; margin-top: 14px; max-height: min(52vh, 460px); overflow-y: auto; padding: 2px; }
.login .login-names button { margin-top: 0; min-height: 48px; font-weight: 600; }
.login-none { margin: 8px 0; color: var(--text-dim); font-size: 14px; }
.login-chosen { margin-top: 4px; padding: 13px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong); font-size: 16px; }
.login button.login-alt { margin-top: 12px; border-color: transparent; background: transparent; color: var(--text-dim); justify-content: center; }
.login button.login-alt:hover { color: var(--accent-strong); background: var(--accent-soft); }
.login button.login-alt::after { content: none; }
.login-passkey-hint { margin: 14px 0 0; color: var(--text-dim); font-size: 12.5px; line-height: 1.7; text-align: center; overflow-wrap: anywhere; }
.login-passkey-hint a { color: var(--accent-strong); }

@media (max-width: 900px) {
  header.topbar { padding: 0 14px; }
  .topbar .brand small, .topbar .user > span { display: none; }
  main { padding: 18px 14px 32px; }
  .panel { padding: 16px; }
}

/*
 * 幅の狭い画面のログイン（2026-09-28 所有者の決定「全てのアプリを、上部にキャッチコピーを出す仕様に」。
 * 見本はグループウェアのスマホのログイン画面）。PC は左右2列のまま。
 *   iPad 縦（〜900px）… キャッチコピーの面を上に小さく積む（説明文・タグも出す）
 *   スマホ（〜600px）… 上に紺の帯：ホテル名（小さな金の字）＋キャッチコピー1行（後半に金の下線）。説明文とタグは隠す
 * ログイン前の画面（名前を選ぶ・ID 入力・2段目の本人確認・初回のパスワード変更）はどれもこの形（.login-wrap）。
 * 全画面のアニメーション（.lv-splash）は、この下の指定で PC と同じ大きさに戻す。
 */
@media (max-width: 900px) {
  /* 縦に積むときはグリッドにしない（行が縮んで紹介の面が切れるため。グループウェアと同じ） */
  .login-wrap { display: block; }
  .login-visual { min-height: auto; padding: 36px 24px 30px; }
  .login-copy h1 { margin: 12px 0 10px; font-size: 30px; }
  .login-copy > p:not(.login-eyebrow) { font-size: 13.5px; line-height: 1.9; }
  .login-pills { margin-top: 16px; }
  .login-panel { min-height: auto; padding: 32px 20px 40px; justify-content: flex-start; }
  .login-brand { margin-bottom: 32px; }
}
@media (max-width: 600px) {
  .login-visual { padding: 18px 20px 16px; }
  .login-eyebrow { font-size: 11px; }
  .login-copy h1 { margin: 6px 0 0; font-size: 20px; line-height: 1.4; letter-spacing: -.03em; }
  .login-copy h1 br { display: none; }
  .login-copy .lv-line { display: inline-block; vertical-align: top; }
  .login-copy > p:not(.login-eyebrow), .login-pills { display: none; }
  .login-panel { padding-top: 22px; }
  .login-brand { margin-bottom: 26px; }
  .login h1 { font-size: 24px; }
}

/* --- 管理 ---------------------------------------------------------------- */

/* 権限の種類（2026-09-28） */
.roles-table td, .roles-table th { white-space: nowrap; }
table.grid.roles-table input.role-name { width: 130px; text-align: left; }
table.grid.roles-table input[type="checkbox"] { width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0; accent-color: var(--accent); }
.roles-actions { display: flex; gap: 6px; }

/* 職員の一覧（見るだけ。追加・変更はグループウェア。2026-09-28） */
.staff-notice a { color: inherit; font-weight: 700; margin-left: 4px; white-space: nowrap; }
.staff-list td, .staff-list th { white-space: nowrap; }
.staff-status { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; }
.staff-status.ok { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.staff-status.stopped { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.staff-status.pending { background: var(--warn-bg); color: var(--warn); }
.staff-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 6px; font-size: 11px; font-weight: 700; background: var(--accent-soft); color: var(--accent-strong); }
.staff-dim { color: var(--text-dim); font-size: 12px; }
/* 非常用の管理者のパスワードを変える（2026-09-28） */
table.grid .staff-pw { margin-left: 8px; min-height: 26px; padding: 2px 10px; font-size: 12px; }
.epw-dialog { width: min(440px, calc(100vw - 32px)); }
.epw-lead { color: var(--text-dim); font-size: 13px; line-height: 1.7; }
.epw-dialog label { display: block; margin: 12px 0 6px; font-size: 13px; font-weight: 700; }
/* グループウェアの入場券を使うか・切り替えるかの確認（2026-10-02） */
.handoff-dialog { width: min(460px, calc(100vw - 32px)); }
.handoff-lead { margin: 10px 0 0; color: var(--text-dim); font-size: 13.5px; line-height: 1.8; }
.handoff-lead b { color: var(--text); }
.epw-field { position: relative; }
.epw-field input { width: 100%; padding-right: 44px; }
.epw-field .epw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); min-height: 28px; padding: 0 8px; border-color: transparent; background: transparent; font-size: 14px; }
.staff-remote { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; cursor: pointer; }
table.grid .staff-remote input { width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0; accent-color: var(--accent); }
@media (max-width: 600px) { .staff-list td, .staff-list th { padding-left: 8px; padding-right: 8px; } }
.staff-hint { margin-top: 12px; color: var(--text-dim); font-size: 12.5px; line-height: 1.8; }

.formrow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.formrow label { color: var(--text-dim); font-size: 13px; font-weight: 600; }

dialog {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  padding: 24px;
  min-width: 300px;
  box-shadow: var(--shadow-lg);
}
dialog::backdrop { background: rgba(8, 21, 30, .58); backdrop-filter: blur(3px); }

/* --- 自動ログアウトの知らせ・書きかけの復元（右下の小窓。入力を邪魔しない） --- */

.session-notice {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  width: min(380px, calc(100vw - 32px));
  padding: 18px 20px;
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}
.session-notice.warn { border-left-color: var(--warn); }
.session-notice h2 { margin: 0 0 6px; font-size: 15px; }
.session-notice p { margin: 0; color: var(--text-dim); font-size: 13.5px; line-height: 1.7; }
.session-notice .count { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.session-notice .formrow { justify-content: flex-end; margin: 14px 0 0; }
@media (max-width: 640px) {
  .session-notice { right: 16px; bottom: 16px; }
}

/* --- 構成比の積み上げ横棒 ------------------------------------------------ */

.stackrow { display: flex; align-items: center; gap: 10px; margin: 4px 0; }
.stackrow .yl { width: 44px; text-align: right; color: var(--text-dim); font-size: 12.5px; flex: none; }
.stack { display: flex; flex: 1; height: 26px; border-radius: 7px; overflow: hidden; background: var(--row-alt); box-shadow: inset 0 0 0 1px var(--border); }
.stack .seg {
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11px; font-weight: 600;
  min-width: 0; white-space: nowrap; overflow: hidden;
}

@media (max-width: 640px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card { min-width: 0; padding: 14px; }
  .card .v { font-size: 21px; }
  .toolbar .title { flex-basis: 100%; }
}

/* --- 印刷 ---------------------------------------------------------------- */

@media print {
  header.topbar, .toolbar button, .toolbar select, .toolbar input, .toolbar label,
  button, .legend, .msg, .notice, .session-notice { display: none !important; }
  body { background: #fff; color: #000; }
  .panel { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .tablewrap { overflow: visible; }
  table.grid { font-size: 11px; }
  table.grid th, table.grid td { padding: 2px 5px; }
}

/* 全社共通ログイン（2026-09-26）：顔・指紋・暗証番号でログイン／2段目の「戻る」 */
.login button.login-passkey {
  justify-content: center;
  min-height: 46px;
  margin-top: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}
.login button.login-passkey::after { content: none; }

/*
 * ログインのキャッチコピー（2026-09-26 所有者の依頼「印象付けたい」。入校・売上などとそろえる）。
 * ログイン画面を開くたびに、キャッチコピーの面を全画面（.lv-splash。app.js の playLoginSplash が写しを作る）で
 * 流してから、ログイン画面に切り替える。流れ方:
 *   上の小見出し → 見出しが 1 行ずつ下からせり上がる → 「次の一手へ。」に金の下線が引かれ、光が 1 回走る
 *   → 説明文 → タグが順に出る → 約 3 秒で消えてログイン画面（押す・キーを打つと飛ばせる）
 * 画面の中（PC の左の面）のキャッチコピーは、止まった完成形で出す（同じ動きを二度見せない）。
 * スマホ・iPad では同じ面を上に帯として小さくまとめる（下の「幅の狭い画面のログイン」。2026-09-28〜）。
 * 動きを減らす設定の端末では全画面を出さない（app.js）。
 */
.lv-line { display: block; overflow: hidden; padding-bottom: .14em; margin-bottom: -.14em; }
.lv-line > span { display: inline-block; }
.lv-accent { position: relative; }
.lv-accent::after {
  content: "";
  position: absolute;
  left: .02em;
  right: .5em;
  bottom: .02em;
  height: .08em;
  border-radius: 2px;
  background: #f79561;
}

/* 全画面。左の面の写しなので見た目の指定はそのまま使い、画面いっぱいに広げて真ん中に置く */
.login-visual.lv-splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex !important;
  justify-content: center;
  min-height: 100dvh;
  padding: 32px clamp(28px, 9vw, 150px);
  cursor: pointer;
  animation: lv-leave .5s ease 3.1s forwards;
}
.login-visual.lv-splash.lv-leave-now { animation: lv-leave-now .35s ease forwards; }
.lv-splash .login-copy { width: min(760px, 100%); }
.lv-splash .login-copy h1 { margin: 22px 0 24px; font-size: clamp(32px, 9vw, 72px); line-height: 1.27; letter-spacing: -.055em; }
/* スマホ・iPad で小さくまとめた面も、全画面のときは PC と同じ大きさで見せる */
.lv-splash .login-eyebrow { font-size: 12px; }
.lv-splash .login-copy .lv-line { display: block; }
.lv-splash .login-copy > p:not(.login-eyebrow) { display: block; font-size: 15px; line-height: 2; }
.lv-splash .login-pills { display: flex; margin-top: 40px; }

.lv-splash .lv-line > span {
  transform: translateY(110%);
  animation: lv-rise .95s cubic-bezier(.2, .8, .2, 1) .25s forwards;
}
/* せり上がる span そのものなので、上の .lv-line > span より強い書き方にして光の動きも足す */
.lv-splash .lv-line > span.lv-accent {
  /* 光が走るぶんの帯。文字の色（白）は帯の両端と同じにしてあるので、止まっていれば白のまま */
  background: linear-gradient(100deg, #fff 38%, #fbc4a6 46%, #f79561 50%, #fbc4a6 54%, #fff 62%) 100% 0 / 260% 100% no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: lv-rise .95s cubic-bezier(.2, .8, .2, 1) .43s forwards, lv-shine 1.3s ease-in-out 1.75s forwards;
}
.lv-splash .lv-accent::after {
  transform: scaleX(0);
  transform-origin: left center;
  animation: lv-draw .75s cubic-bezier(.65, 0, .25, 1) 1.2s forwards;
}
.lv-splash .login-eyebrow { animation: lv-fade .7s ease .05s both; }
.lv-splash .login-copy > p:not(.login-eyebrow) { animation: lv-fade .8s ease 1.0s both; }
.lv-splash .login-pills span { animation: lv-fade .6s ease both; }
.lv-splash .login-pills span:nth-child(1) { animation-delay: 1.25s; }
.lv-splash .login-pills span:nth-child(2) { animation-delay: 1.35s; }
.lv-splash .login-pills span:nth-child(3) { animation-delay: 1.45s; }
.lv-splash .login-pills span:nth-child(4) { animation-delay: 1.55s; }

@keyframes lv-rise { to { transform: translateY(0); } }
@keyframes lv-draw { to { transform: scaleX(1); } }
@keyframes lv-shine { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes lv-fade {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes lv-leave { to { opacity: 0; visibility: hidden; } }
/* 押して飛ばすとき。名前を分けて、途中からでも必ず新しく始まるようにする */
@keyframes lv-leave-now { to { opacity: 0; visibility: hidden; } }

/* ---- 使い方ツアー（2026-10-03）。画面を暗くして、説明する所だけを光らせ、吹き出しで案内する ---- */
.toolbar .tour-btn { margin-left: auto; }
.tour-layer { position: fixed; inset: 0; z-index: 9999; }
.tour-layer.is-center { background: rgba(9, 18, 24, .58); }
.tour-spot {
  position: fixed; border-radius: 10px; pointer-events: none;
  box-shadow: 0 0 0 3px var(--accent), 0 0 0 6px rgba(233, 109, 47, .35), 0 0 0 9999px rgba(9, 18, 24, .58);
  transition: left .2s ease, top .2s ease, width .2s ease, height .2s ease;
}
.tour-spot[hidden] { display: none; }
.tour-pop {
  position: fixed; width: min(342px, calc(100vw - 32px));
  background: var(--panel-raised); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: 16px 16px 12px;
}
.tour-pop:focus { outline: none; }
.tour-pop-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-dim); }
.tour-pop-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.tour-pop-count { flex: none; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--accent-strong); }
.tour-pop-bar { height: 4px; border-radius: 999px; background: var(--bg-tint); overflow: hidden; margin-top: 6px; }
.tour-pop-bar-fill { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .25s ease; }
.tour-pop-title { margin: 11px 0 5px; font-size: 17px; line-height: 1.4; font-weight: 800; }
.tour-pop-text { margin: 0; font-size: 14.5px; line-height: 1.8; }
.tour-pop-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.tour-pop-actions .spacer { flex: 1; }
.tour-pop-actions button { min-height: 38px; }
.tour-pop-actions .tour-next { min-width: 84px; }
.tour-quit { color: var(--text-dim); }
.tour-pop.is-in { animation: tour-in .22s ease; }
@keyframes tour-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .tour-spot { transition: none; }
  .tour-pop.is-in { animation: none; }
}

/* ======================================================================
 * KDS ONE STAY の画面（2026-10-08）。設計案 docs/design-mockup.html の見た目
 * ====================================================================== */

/* アプリの印は画像（紺の角丸にオレンジの K・白の S）。ホテルの文字の印の枠は消す */
img.brand-mark { width: 30px; height: 30px; padding: 0; border: 0; background: none; box-shadow: none; border-radius: 8px; }
.login-brand img.brand-mark { width: 40px; height: 40px; background: none; border: 0; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; margin: 0 0 16px; }
.page-head h1 { margin: 0; font-size: 22px; letter-spacing: -.01em; }
.page-head .sub { color: var(--text-dim); font-size: 13px; }
.page-head .spacer, .formrow .spacer, .choice-row .spacer { flex: 1; }
.small-note { font-size: 12px; }
.muted { color: var(--text-dim); }
.toolbar-slim:empty { display: none; }
.toolbar-slim { margin: -6px 0 12px; }
.hint { color: var(--text-dim); font-size: 12.5px; }
.empty-line { color: var(--text-dim); margin: 8px 0; }
button.small { padding: 4px 10px; font-size: 12px; }
button.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--border)); }
button.danger:hover { background: color-mix(in srgb, var(--bad) 10%, transparent); color: var(--bad); border-color: var(--bad); }
.pos { color: var(--good); font-weight: 700; }
.neg { color: var(--bad); font-weight: 700; }
.dim { color: var(--text-dim); }

/* 印（状態・知らせ） */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; line-height: 1.7; }
.tag.bad { background: color-mix(in srgb, var(--bad) 13%, transparent); color: var(--bad); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.good { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.tag.info { background: color-mix(in srgb, var(--sat) 13%, transparent); color: var(--sat); }
.tag.done { background: color-mix(in srgb, var(--text-dim) 14%, transparent); color: var(--text-dim); }
.tag.mute { background: var(--bg-tint); color: var(--text-dim); border: 1px solid var(--border); }

/* 切り替えの並びボタン */
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 9px; overflow: hidden; background: var(--panel); flex-wrap: wrap; }
.seg button { border: 0; border-right: 1px solid var(--border); border-radius: 0; background: transparent; color: var(--text-dim); font-size: 13px; padding: 7px 13px; box-shadow: none; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent-soft); color: var(--accent-strong); }

/* ホームのカードと知らせ */
.stay-cards .card .v small { font-size: 13px; color: var(--text-dim); margin-left: 3px; font-weight: 600; }
.stay-cards .card .note { font-size: 12px; color: var(--text-dim); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1050px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
.panel h2 .sub { font-weight: 500; color: var(--text-dim); font-size: 12px; margin-left: 6px; }
.panel h2 .right { float: right; display: inline-flex; gap: 6px; }
ul.alerts { list-style: none; margin: 0 -22px -20px; padding: 0; }
ul.alerts li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 11px 22px; border-top: 1px solid var(--border); cursor: pointer; }
ul.alerts li:hover, ul.alerts li:focus-visible { background: var(--accent-soft); outline: none; }
ul.alerts .what { font-weight: 600; overflow-wrap: anywhere; }
ul.alerts .who2 { color: var(--text-dim); font-size: 12px; }
ul.alerts .go { color: var(--text-dim); font-size: 12px; white-space: nowrap; }

/* 一覧の表 */
table.list { width: 100%; border-collapse: collapse; font-size: 13px; }
table.list th { position: sticky; top: 0; background: var(--bg-tint); color: var(--text-dim); font-size: 12px; font-weight: 650; text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; z-index: 1; }
table.list td { padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: middle; }
table.list th.num, table.list td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.list tbody tr:nth-child(even) td { background: var(--row-alt); }
table.list tbody tr[data-id] { cursor: pointer; }
table.list tbody tr[data-id]:hover td, table.list tbody tr[data-id]:focus-visible td { background: var(--accent-soft); outline: none; }
table.list td.name b { display: block; }
table.list td.name small { color: var(--text-dim); font-size: 11.5px; }
table.list tfoot td { font-weight: 700; background: var(--bg-tint); border-top: 2px solid var(--border-strong); }
table.students td:last-child { white-space: normal; min-width: 140px; }
.panel > .tablewrap { margin: 0 -22px -20px; border-radius: 0 0 var(--radius) var(--radius); }
.panel > h2 + .tablewrap { border-top: 1px solid var(--border); }

/* 絞り込み */
.toolbar.filters { align-items: flex-end; gap: 10px 14px; }
.filters label, label.inline { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 650; color: var(--text-dim); }
label.inline { flex-direction: row; align-items: center; gap: 6px; }
.filters label.grow { flex: 1 1 220px; }
.filters label.grow input { width: 100%; }
.filters .range { display: inline-flex; align-items: center; gap: 4px; color: var(--text-dim); }
label.check { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; }
label.check input { width: auto; min-height: 0; margin: 0; }
input[type="date"] { font: inherit; padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--panel); color: var(--text); }
.formrow.wrap { flex-wrap: wrap; }

/* 詳細 */
.panel.detail { padding: 0; overflow: hidden; }
.panel.detail.dirty { box-shadow: 0 0 0 2px color-mix(in srgb, var(--warn) 40%, transparent), var(--shadow); }
.detail-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 20px 22px 14px; }
.detail-head .avatar { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); font-weight: 800; font-size: 21px; flex: none; }
.detail-head h2 { margin: 0; font-size: 23px; line-height: 1.3; }
.detail-head .kana { color: var(--text-dim); font-size: 12px; }
.detail-head .tags { display: flex; gap: 6px; flex-wrap: wrap; flex: 1 1 260px; justify-content: flex-end; }
.steps { display: flex; flex-wrap: wrap; margin: 0 22px 16px; }
.steps span { padding: 6px 14px; background: var(--bg-tint); color: var(--text-dim); font-size: 12px; font-weight: 650; border: 1px solid var(--border); margin-right: -1px; }
.steps span:first-child { border-radius: 8px 0 0 8px; }
.steps span:last-child { border-radius: 0 8px 8px 0; }
.steps span.done { background: color-mix(in srgb, var(--good) 13%, var(--panel)); color: var(--good); }
.steps span.now { background: var(--accent); color: #fff; border-color: var(--accent); }
.steps span.now.bad { background: var(--bad); border-color: var(--bad); }
.sec-tabs { display: flex; gap: 2px; padding: 0 14px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.sec-tabs button { border: 0; border-radius: 0; background: transparent; padding: 11px 13px; color: var(--text-dim); border-bottom: 2px solid transparent; white-space: nowrap; box-shadow: none; }
.sec-tabs button.on { color: var(--accent-strong); border-bottom-color: var(--accent); }
.sec { padding: 18px 22px 22px; }
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 18px; }
.form > label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 650; color: var(--text-dim); margin: 0; }
.form > label.wide { grid-column: 1 / -1; }
.form > label input, .form > label select, .form > label textarea { width: 100%; }
.form textarea { min-height: 64px; resize: vertical; font: inherit; }
.form [disabled] { background: var(--bg-tint); color: var(--text); opacity: 1; border-style: dashed; cursor: default; -webkit-text-fill-color: var(--text); }
.sec-note { margin: 0 0 14px; color: var(--text-dim); }
.sec-h { margin: 18px 0 10px !important; color: var(--text) !important; font-size: 15px !important; }
.sec-h:first-child { margin-top: 0 !important; }
table.legs { border-collapse: collapse; margin: 12px 0 14px; font-size: 13px; min-width: 860px; }
table.legs th { text-align: left; font-size: 11.5px; color: var(--text-dim); padding: 4px 6px; font-weight: 650; }
table.legs td { padding: 3px 4px; }
table.legs input, table.legs select { width: 100%; min-width: 70px; padding: 6px 8px; }
table.legs td:nth-child(3) input { min-width: 150px; }
.costs-wrap { margin-top: 20px; max-width: 560px; }
table.costs { width: 100%; border-collapse: collapse; font-size: 13px; }
table.costs td { padding: 7px 4px; border-bottom: 1px solid var(--border); }
table.costs td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.costs .formula { color: var(--text-dim); font-size: 11px; }
table.costs tr.total td { font-weight: 750; border-top: 2px solid var(--border-strong); }
table.costs tr.profit td { font-weight: 800; color: var(--good); font-size: 15px; }
table.costs tr.profit.minus td { color: var(--bad); }
.legacy { margin-top: 22px; padding: 14px 16px; border: 1px dashed var(--border-strong); border-radius: 10px; }
.legacy h3 { margin: 0 0 4px !important; }
.legacy dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 10px 0 0; font-size: 13px; }
.legacy dt { color: var(--text-dim); }
.legacy dd { margin: 0; }
.history .h-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.history .h-head { font-size: 13px; }
table.h-diff { margin-top: 6px; font-size: 12.5px; border-collapse: collapse; }
table.h-diff th { text-align: left; color: var(--text-dim); font-weight: 600; padding: 2px 12px 2px 0; white-space: nowrap; vertical-align: top; }
table.h-diff td { padding: 2px 6px; vertical-align: top; overflow-wrap: anywhere; }

/* 生活表 */
.legend-life { display: inline-flex; flex-wrap: wrap; gap: 14px; font-size: 12px; font-weight: 600; color: var(--text-dim); }
.legend-life i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 5px; }
.c-in { background: #2563b0; }
.c-mid { background: #24956a; }
.c-out { background: #e96d2f; }
.c-stay { background: #cfe0f3; }
@media (prefers-color-scheme: dark) { .c-stay { background: #233a52; } }
.life-wrap { max-height: 72vh; overflow: auto; }
table.life { border-collapse: separate; border-spacing: 0; font-size: 12px; }
table.life th, table.life td { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); text-align: center; min-width: 28px; height: 30px; padding: 0; }
table.life thead th { position: sticky; top: 0; background: var(--bg-tint); color: var(--text-dim); font-weight: 650; font-size: 11px; line-height: 1.2; z-index: 2; }
table.life thead th.sun { color: var(--sun); }
table.life thead th.sat { color: var(--sat); }
table.life thead th.today { background: var(--accent); color: #fff; }
table.life .who3 { position: sticky; left: 0; z-index: 1; min-width: 170px; max-width: 220px; text-align: left; padding: 0 10px; background: var(--panel); font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.life tbody .who3 { cursor: pointer; }
table.life tbody .who3:hover { color: var(--accent-strong); }
table.life thead .who3 { z-index: 3; background: var(--bg-tint); }
table.life .who3 small { color: var(--text-dim); font-weight: 500; margin-left: 5px; }
table.life td.c-in, table.life td.c-mid, table.life td.c-out { color: #fff; font-weight: 800; }
table.life tfoot td { font-weight: 750; font-variant-numeric: tabular-nums; background: var(--bg-tint); position: sticky; bottom: 0; }
table.life tfoot tr.rooms td { background: var(--accent-soft); color: var(--accent-strong); }
table.life tfoot .who3 { z-index: 3; }

/* 集計 */
.bars { display: grid; gap: 9px; }
.bar { display: grid; grid-template-columns: 130px minmax(0, 1fr) 64px; gap: 10px; align-items: center; font-size: 13px; }
.bar > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .track { height: 14px; background: var(--bg-tint); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.bar .fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-strong)); border-radius: 999px; }
.bar .num { text-align: right; font-variant-numeric: tabular-nums; }

/* 設定 */
.role-card h2 .role-name { font-size: 15px; font-weight: 700; width: 180px; }
.role-card .body { padding: 0; }
.role-tabs { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 12px; }
table.perm { border-collapse: collapse; font-size: 13px; min-width: 420px; }
table.perm th, table.perm td { padding: 6px 14px; border-bottom: 1px solid var(--border); text-align: center; }
table.perm th:first-child, table.perm td:first-child { text-align: left; }
table.perm th { color: var(--text-dim); font-size: 12px; background: var(--bg-tint); }
.choice-list { display: grid; gap: 4px; margin: 10px 0 14px; max-width: 560px; }
.choice-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); }
.choice-row .cv { font-weight: 600; }
.alert-kinds { display: grid; gap: 8px; margin: 12px 0 16px; }

/* 狭い画面 */
@media (max-width: 700px) {
  main { padding: 14px 12px 30px; }
  .panel { padding: 16px 14px; }
  ul.alerts { margin: 0 -14px -16px; }
  ul.alerts li { padding: 10px 14px; }
  .panel > .tablewrap { margin: 0 -14px -16px; }
  .sec { padding: 14px; }
  .detail-head { padding: 16px 14px 10px; }
  .steps { margin: 0 14px 12px; }
}

/* 印刷（生活表は A3 横・送迎・集計） */
@media print {
  @page { size: A3 landscape; margin: 10mm; }
  header.topbar, .toolbar, .page-head button, .tour-btn, .session-notice { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .panel { box-shadow: none; border: 0; padding: 0; }
  .life-wrap, .tablewrap { max-height: none !important; overflow: visible !important; }
  table.life th, table.life td { min-width: 0; height: 20px; font-size: 9px; }
  table.life .who3 { position: static; min-width: 110px; }
  table.life thead th, table.life tfoot td { position: static; }
  table.life td.c-in, table.life td.c-mid, table.life td.c-out, table.life td.c-stay { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* 詳細を 1 画面に（2026-10-08 所有者の指示「詳細画面は 1 画面にして入力しやすく」）
 * 区分をカードにして 2 列に並べる。欄は少し詰める。保存の帯は下に固定 */
.panel.detail.one-page { overflow: visible; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 0 18px 18px; }
.dcard { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px 14px; background: var(--panel); min-width: 0; }
.dcard h3 { margin: 0 0 10px !important; font-size: 13px !important; color: var(--accent-strong) !important; letter-spacing: .04em; display: flex; align-items: center; gap: 8px; }
.dcard h3::before { content: ""; width: 4px; height: 14px; border-radius: 2px; background: var(--accent); }
.dcard-basic { grid-row: span 2; }
.dcard-memo { grid-column: 1 / -1; }
@media (max-width: 1100px) { .detail-grid { grid-template-columns: minmax(0, 1fr); } .dcard-basic { grid-row: auto; } }
.form.compact { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 9px 12px; }
.form.compact > label { font-size: 11.5px; gap: 3px; }
.form.compact input, .form.compact select { min-height: 34px; padding: 5px 8px; font-size: 14px; }
.form.compact textarea { min-height: 56px; padding: 6px 8px; font-size: 14px; }
.dcard-memo .form.compact { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.dcard-memo .form.compact > label.wide { grid-column: auto; }
.dcard .sec-note { margin: -2px 0 10px; font-size: 12.5px; }
.form [data-key]:focus { background: var(--accent-soft); }
.steps.clickable button { font: inherit; font-size: 12px; font-weight: 650; padding: 6px 14px; margin: 0 -1px 0 0; border: 1px solid var(--border); border-radius: 0; background: var(--bg-tint); color: var(--text-dim); box-shadow: none; cursor: pointer; }
.steps.clickable button:first-child { border-radius: 8px 0 0 8px; }
.steps.clickable button:last-child { border-radius: 0 8px 8px 0; }
.steps.clickable button:hover { background: var(--accent-soft); color: var(--accent-strong); }
.steps.clickable button.done { background: color-mix(in srgb, var(--good) 13%, var(--panel)); color: var(--good); }
.steps.clickable button.now { background: var(--accent); color: #fff; border-color: var(--accent); }
.detail-more { padding: 0 18px 18px; display: grid; gap: 8px; }
.detail-more details { border: 1px solid var(--border); border-radius: 10px; padding: 8px 14px; }
.detail-more summary { cursor: pointer; font-weight: 650; color: var(--text-dim); font-size: 13px; }
.detail-more details[open] summary { margin-bottom: 8px; }
.legacy-dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 8px 0 4px; font-size: 13px; }
.legacy-dl dt { color: var(--text-dim); }
.legacy-dl dd { margin: 0; }
.save-bar { position: sticky; bottom: 0; z-index: 30; display: flex; align-items: center; gap: 12px; margin: 0 -28px -42px; padding: 10px 28px;
  background: color-mix(in srgb, var(--panel) 94%, transparent); backdrop-filter: blur(6px); border-top: 1px solid var(--border); box-shadow: 0 -8px 22px rgba(16, 24, 40, .08); }
.save-bar .save-state { flex: 1; color: var(--text-dim); font-size: 13px; font-weight: 600; }
.save-bar .save-state.on { color: var(--warn); }
.save-bar .save-state.ok { color: var(--good); }
.save-bar .save-state.err { color: var(--bad); }
.save-bar .save-hint { color: var(--text-dim); font-size: 11.5px; }
.save-bar button.primary { min-width: 140px; }
@media (max-width: 700px) { .save-bar { margin: 0 -12px -30px; padding: 10px 12px; } .save-bar .save-hint { display: none; } .detail-grid, .detail-more { padding: 0 10px 12px; } }
@media print { .save-bar, .detail-top { display: none !important; } }
.toolbar.tb-inline { margin: 0; padding: 0; background: none; border: 0; box-shadow: none; min-height: 0; }
.toolbar.tb-inline:empty { display: none; }
.one-page .detail-head { padding: 14px 18px 12px; gap: 8px 16px; }
.one-page .detail-head .avatar { width: 44px; height: 44px; font-size: 18px; }
.one-page .detail-head h2 { font-size: 21px; }
.one-page .detail-head .tags { flex: 1 1 200px; }
.one-page .detail-head .steps { margin: 0; flex-basis: 100%; }
.detail-top { margin-bottom: 10px; }
.form small.wareki { color: var(--text-dim); font-size: 11.5px; font-weight: 600; min-height: 1em; }
/* チェック欄は幅いっぱいにしない（「する」が折り返して崩れていた） */
.form > label input[type="checkbox"] { width: auto; min-height: 0; }
.form > label label.check { min-height: 34px; }

/* 前日入り・仮免日と卒検日の変更（2026-10-08） */
.c-pre { background: #9a6700; }
table.life td.c-pre { color: #fff; font-weight: 800; }
@media print { table.life td.c-pre { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.sched-row { display: flex; gap: 6px; align-items: center; }
.sched-row input { flex: 1; min-width: 0; }
.sched-row button { flex: none; }
ul.sched-log { list-style: none; margin: 4px 0 0; padding: 6px 8px; border-radius: 8px; background: var(--bg-tint); font-size: 12px; display: grid; gap: 4px; }
ul.sched-log li { color: var(--text); font-weight: 500; line-height: 1.5; }
ul.sched-log li small { display: block; color: var(--text-dim); font-size: 11px; }
dialog.sched-dialog { width: min(440px, calc(100vw - 32px)); border: 0; border-radius: 14px; padding: 22px; box-shadow: var(--shadow-lg); background: var(--panel); color: var(--text); }
dialog.sched-dialog .field { display: flex; flex-direction: column; gap: 4px; margin: 10px 0 0; font-size: 12px; font-weight: 650; color: var(--text-dim); }
dialog.sched-dialog .field input { width: 100%; }
.sd-reasons { display: flex; flex-wrap: wrap; gap: 6px 14px; padding-top: 2px; }
.form label.under-check { font-size: 12px; font-weight: 600; color: var(--text); min-height: 0 !important; margin-top: 2px; }
.sd-reasons label.check { white-space: nowrap; }
.sd-reasons input[type="radio"], dialog.sched-dialog input[type="radio"] { width: auto; min-height: 0; }
.c-post { background: #6b7a87; }
table.life td.c-post { color: #fff; font-weight: 800; }
@media print { table.life td.c-post { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* 入力の手助け（郵便番号の住所・電話とメールの確認・年齢の確認。2026-10-08） */
.form small.field-help { font-size: 11.5px; font-weight: 600; line-height: 1.5; }
.form small.field-help:empty { display: none; }
.form small.field-help.ok { color: var(--good); }
.form small.field-help.warn { color: var(--warn); }
.form small.field-help button { margin: 2px 4px 0 0; padding: 2px 8px; font-size: 11.5px; }

/* ======================================================================
 * 使いやすさの見直し（2026-10-09）
 * ====================================================================== */
kbd { display: inline-block; min-width: 18px; padding: 0 5px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px;
  font: 600 11px/16px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text-dim); background: var(--panel); text-align: center; }
button.primary kbd { background: rgba(255,255,255,.18); color: #fff; border-color: rgba(255,255,255,.35); margin-left: 4px; }

/* 上の帯の検索 */
.gsearch { position: relative; display: flex; align-items: center; gap: 6px; margin-left: 14px; padding: 0 10px; height: 34px; width: min(360px, 32vw);
  border-radius: 9px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); color: var(--topbar-dim); }
.gsearch:focus-within { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.35); }
.gsearch input { flex: 1; min-width: 0; border: 0 !important; background: transparent !important; color: #fff !important; outline: none !important; box-shadow: none !important; padding: 0; font-size: 13px; }
.gsearch input::placeholder { color: var(--topbar-dim); }
.gsearch kbd { background: transparent; color: var(--topbar-dim); border-color: rgba(255,255,255,.25); }
.gsearch-pop { position: absolute; top: 40px; left: 0; width: min(440px, 92vw); max-height: 70vh; overflow: auto; z-index: 60; padding: 6px;
  background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); }
.gs-item { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "n k" "s s"; gap: 0 8px; width: 100%; text-align: left; padding: 8px 10px;
  border: 0; border-radius: 8px; background: transparent; color: var(--text); box-shadow: none; }
.gs-item b { grid-area: n; } .gs-item small { grid-area: k; color: var(--text-dim); align-self: center; } .gs-item span { grid-area: s; font-size: 12px; color: var(--text-dim); font-weight: 500; }
.gs-item.on, .gs-item:hover { background: var(--accent-soft); color: var(--text); }
.gs-all { width: 100%; margin-top: 4px; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: transparent; color: var(--accent-strong); font-size: 12.5px; text-align: left; padding: 9px 10px; box-shadow: none; }
.gs-none { margin: 8px 10px; color: var(--text-dim); }
@media (max-width: 900px) { .gsearch { order: 3; width: 100%; margin: 6px 0 0; } .gsearch kbd { display: none; } }

/* 名前のメニュー */
.topbar .user { position: relative; }
.user-btn { display: inline-flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 999px; border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06); color: var(--topbar-text); box-shadow: none; }
.user-btn:hover { background: rgba(255,255,255,.12) !important; color: #fff !important; border-color: rgba(255,255,255,.25) !important; }
.user-ava { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 800; font-size: 13px; }
.user-name { display: flex; flex-direction: column; line-height: 1.15; text-align: left; font-size: 13px; }
.user-name small { color: var(--topbar-dim); font-size: 10.5px; margin: 0 !important; }
.user-menu { position: absolute; right: 0; top: 42px; z-index: 60; min-width: 210px; padding: 6px; display: grid; background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg); }
.user-menu > a, .user-menu > button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; border-radius: 8px; background: transparent;
  color: var(--text) !important; font: inherit; font-weight: 600; text-decoration: none; box-shadow: none; }
.user-menu > a:hover, .user-menu > button:hover { background: var(--accent-soft) !important; }
.user-menu .danger-item { color: var(--bad) !important; border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; margin-top: 4px; }
@media (max-width: 700px) { .user-name { display: none; } }

/* ホーム */
.card-link { text-align: left; cursor: pointer; font: inherit; color: inherit; }
.card-link .go { color: var(--accent-strong); font-weight: 700; white-space: nowrap; }
.card-link:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1150px) { .home-grid { grid-template-columns: minmax(0, 1fr); } }
table.week td { vertical-align: top; white-space: normal; }
table.week td.wd { white-space: nowrap; font-weight: 650; }
table.week tr.sun td.wd { color: var(--sun); } table.week tr.sat td.wd { color: var(--sat); }
table.week tr.today td { background: var(--today) !important; }
table.week td.chips { min-width: 90px; }
.name-chip { display: inline-block; margin: 1px 3px 2px 0; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 650; line-height: 1.7;
  border: 1px solid var(--border); background: var(--panel); color: var(--text); box-shadow: none; cursor: pointer; }
.name-chip.info { border-color: color-mix(in srgb, var(--sat) 45%, var(--border)); color: var(--sat); }
.name-chip.good { border-color: color-mix(in srgb, var(--good) 45%, var(--border)); color: var(--good); }
.name-chip.done { color: var(--text-dim); }
.name-chip.warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); color: var(--warn); }
.name-chip:hover { background: var(--accent-soft); }
td.rooms { position: relative; min-width: 90px; }
td.rooms .rbar { position: absolute; left: 6px; right: auto; top: 50%; height: 10px; width: calc((100% - 44px) * var(--w) / 100%); max-width: calc(100% - 44px); transform: translateY(-50%);
  border-radius: 999px; background: color-mix(in srgb, var(--accent) 30%, transparent); }
td.rooms b { position: relative; }
.more-btn { display: block; width: calc(100% + 44px); margin: 0 -22px -20px; padding: 10px; border: 0; border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius);
  background: transparent; color: var(--accent-strong); font-size: 13px; box-shadow: none; }
.more-btn:hover { background: var(--accent-soft); }

/* 一覧 */
.seg .cnt { display: inline-block; min-width: 18px; margin-left: 5px; padding: 0 5px; border-radius: 999px; background: var(--bg-tint); color: var(--text-dim); font-size: 11px; line-height: 16px; }
.seg .cnt:empty { display: none; }
.seg button.on .cnt { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent-strong); }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover, th.sortable:focus-visible { color: var(--text); outline: none; }
th.sortable .arrow { margin-left: 4px; font-size: 9px; opacity: .45; }
th.sortable.on { color: var(--accent-strong); } th.sortable.on .arrow { opacity: 1; }
table.list tbody tr[data-id]:focus { outline: none; }
table.list tbody tr[data-id]:focus td { background: color-mix(in srgb, var(--accent) 16%, var(--panel)) !important; box-shadow: inset 0 1px var(--accent), inset 0 -1px var(--accent); }
table.list tbody tr.st-done td { color: var(--text-dim); }
.empty-state { padding: 28px; text-align: center; color: var(--text-dim); }

/* 詳細の上の行（固定） */
.detail-top { position: sticky; top: 56px; z-index: 25; margin: -10px -28px 10px; padding: 8px 28px; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px); border-bottom: 1px solid var(--border); align-items: center; }
.detail-top .dt-name { font-size: 15px; margin-left: 4px; }
.dt-nav { display: inline-flex; align-items: center; gap: 4px; }
.dt-pos { font-size: 12px; color: var(--text-dim); min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .detail-top { top: 0; margin: -14px -12px 10px; padding: 8px 12px; } .detail-top .muted { display: none; } }
.form small.hint-sched { color: var(--info, var(--sat)); }

/* 生活表 */
.toolbar.life-filter { margin-top: -6px; }
.toolbar.life-filter input[type="search"] { width: 180px; }
table.life .who3 small.nights { color: var(--accent-strong); }
table.life tbody tr:hover td { box-shadow: inset 0 1px color-mix(in srgb, var(--accent) 45%, transparent), inset 0 -1px color-mix(in srgb, var(--accent) 45%, transparent); }
table.life .hl-col { box-shadow: inset 1px 0 color-mix(in srgb, var(--accent) 55%, transparent), inset -1px 0 color-mix(in srgb, var(--accent) 55%, transparent) !important; }

/* キーボードの使い方 */
dialog.keys-dialog { width: min(460px, calc(100vw - 32px)); border: 0; border-radius: 14px; padding: 22px; background: var(--panel); color: var(--text); box-shadow: var(--shadow-lg); }
table.keys { width: 100%; border-collapse: collapse; }
table.keys th { text-align: left; padding: 6px 12px 6px 0; white-space: nowrap; font-weight: 500; }
table.keys td { padding: 6px 0; border-bottom: 1px solid var(--border); }
.user-menu[hidden], .gsearch-pop[hidden] { display: none !important; }
.chip-n { display: inline-block; margin-right: 4px; font-size: 11px; font-weight: 800; }
.chip-n.info { color: var(--sat); } .chip-n.good { color: var(--good); } .chip-n.done { color: var(--text-dim); } .chip-n.warn { color: var(--warn); } .chip-n.mute { color: var(--text-dim); }
.chip-more { margin: 1px 0; padding: 1px 8px; border-radius: 999px; font-size: 12px; border: 1px dashed var(--border-strong); background: transparent; color: var(--text-dim); box-shadow: none; }
td.rooms { display: table-cell; }
td.rooms .rbar { left: 8px; }
/* ホームの並び：2 週間の表は横いっぱい、その下に「確認が必要な人」と「連絡事項」を 2 列 */
.home-grid { grid-template-columns: minmax(0, 1fr); }
.home-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.home-side > .panel { margin-bottom: 0; }
@media (max-width: 1000px) { .home-side { grid-template-columns: minmax(0, 1fr); } }
table.week td.chips { min-width: 0; }
td.rooms { width: 130px; }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--text-dim) 65%, transparent); font-weight: 400; }

/* スマホ（〜700px）：上の帯は折り返す（1 段目 アプリ名・名前／2 段目 タブ／3 段目 検索）。2 週間の表は 1 日ずつのカード */
@media (max-width: 700px) {
  header.topbar { flex-wrap: wrap !important; overflow: visible !important; height: auto !important; padding: 8px 12px 10px !important; gap: 8px 10px !important; }
  header.topbar .brand small { display: none; }
  header.topbar .spacer { display: none; }
  header.topbar .user { margin-left: auto; order: 2; }
  header.topbar nav { order: 3; flex: 1 1 100%; overflow-x: auto; display: flex; gap: 4px; }
  header.topbar .gsearch { order: 4; flex: 1 1 100%; width: 100%; margin: 0; }
  .user-menu { right: 0; }
  .detail-top { top: 0; }
  table.week, table.week tbody { display: block; }
  table.week thead { display: none; }
  table.week tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
  table.week td { display: block; padding: 0 !important; border: 0 !important; background: transparent !important; }
  table.week td.wd { grid-column: 1; font-size: 15px; }
  table.week td.rooms { grid-column: 2; grid-row: 1; width: auto; text-align: right; }
  table.week td.rooms .rbar { display: none; }
  table.week td.rooms::before { content: "必要室数 "; color: var(--text-dim); font-size: 11px; font-weight: 600; }
  table.week td[data-label="在籍"] { display: none; }
  table.week td.chips { grid-column: 1 / -1; }
  table.week td.chips.none { display: none; }
  table.week td.chips::before { content: attr(data-label); display: inline-block; min-width: 4.5em; color: var(--text-dim); font-size: 11px; font-weight: 700; }
  table.week tr.today { background: var(--today); }
}
