/* X-Check（クロスチェック）の見た目。濃紺を基調に、シアンをアクセントにした引き締まった配色。スマホを基準に作り、広い画面では横メニューにする */

:root {
  --primary: #14213d;            /* 濃紺。主ボタンや今日の印 */
  --primary-hover: #1f3157;
  --on-primary: #fff;
  --accent: #0e7490;             /* シアン。リンク・アイコン・選択中の印 */
  --accent-bright: #22d3ee;      /* 濃い背景の上で使う明るいシアン */
  --primary-container: #dcf1f6;
  --on-primary-container: #0b3a4a;
  --ink: #0e1730;                /* 上部バーとログイン画面の背景 */
  --on-ink: #e6ecf7;
  --bg: #f2f4f7;
  --surface: #fff;
  --surface-2: #f5f7fa;
  --surface-3: #e8ecf2;
  --text: #111827;
  --text-2: #4b5563;
  --outline: #c9d0db;
  --outline-soft: #e4e8ee;
  --ok: #146c2e;
  --ok-container: #c4eed0;
  --warn: #8a5300;
  --warn-container: #ffdf99;
  --err: #b3261e;
  --err-container: #f9dedc;
  --sun: #c5221f;
  --sat: #1d5fbf;
  --bar-h: 64px;
  --nav-h: 72px;
  --nav-w: 248px;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
h1, h2, p { margin: 0; }
[hidden] { display: none !important; }

.material-symbols-outlined {
  font-size: 20px;
  line-height: 1;
  width: 1em;
  height: 1em;
  overflow: hidden;
  flex: none;
  vertical-align: middle;
}

/* ---------- 上部バー ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px 0 16px;
  background: var(--surface);
  color: var(--text-2);
  border-top: 3px solid var(--accent);
  border-bottom: 1px solid var(--outline-soft);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); min-width: 0; }
/* ロゴマーク：2本の線が交わる「クロス」。濃紺の地に、片方の線だけシアンにして周りの配色になじませる */
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(145deg, #1d2f5c, var(--ink));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
  color: #fff;
  flex: none;
}
.brand-mark svg { width: 58%; height: 58%; display: block; }
.brand-mark svg path:first-child { stroke: var(--accent-bright); }
.brand-name { font-size: 19px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-kana { font-size: 10px; letter-spacing: .12em; color: var(--text-2); white-space: nowrap; }
.brand-name.is-org { font-size: 16px; letter-spacing: .04em; }
.brand-kana.is-product { font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.brand-tag {
  font-size: 11px;
  font-weight: 500;
  padding: 1px 8px;
  border-radius: 6px;
  border: 1px solid rgba(14, 116, 144, .4);
  color: var(--accent);
  white-space: nowrap;
}
.topbar .btn-text, .topbar .icon-btn { color: var(--text-2); }
.topbar .btn-text:hover, .topbar .icon-btn:hover { background: var(--surface-3); color: var(--text); }
.spacer { flex: 1; }

/* ---------- メニュー（スマホは下、広い画面は左） ---------- */
.nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1px solid var(--outline-soft);
}
.nav-item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 500;
}
.nav-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 30px;
  border-radius: 10px;
  transition: background .15s;
}
.nav-icon .material-symbols-outlined { font-size: 22px; }
.nav-label { white-space: nowrap; }
.nav-item.is-active { color: var(--accent); }
.nav-item.is-active .nav-icon { background: var(--primary-container); }

.main { padding: 4px 16px calc(var(--nav-h) + 96px + env(safe-area-inset-bottom)); }
.area-plain .main { padding-bottom: 32px; }
.container { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.area-admin .container { max-width: 1120px; }

@media (min-width: 900px) {
  .nav {
    top: var(--bar-h);
    right: auto;
    width: var(--nav-w);
    height: auto;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    background: var(--bg);
    border-top: 0;
  }
  .nav-item {
    flex: none;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    height: 52px;
    padding: 0 16px;
    border-radius: 10px;
    font-size: 14px;
  }
  .nav-item:hover { background: var(--surface-3); }
  .nav-item.is-active { background: var(--surface); color: var(--text); box-shadow: inset 3px 0 0 var(--accent), 0 1px 2px rgba(16, 24, 40, .06); }
  .nav-item.is-active .nav-icon { color: var(--accent); }
  .nav-icon { width: auto; height: auto; background: none !important; }
  .area-staff .main, .area-admin .main { margin-left: var(--nav-w); padding-bottom: 48px; }
  .main { padding-left: 24px; padding-right: 24px; }
}

/* ---------- 見出しと文字 ---------- */
.page-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 700; letter-spacing: .02em; }
.hello { color: var(--text-2); margin-bottom: -14px; }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.section-title > .material-symbols-outlined { color: var(--accent); }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.empty { color: var(--text-2); padding: 8px 0; }
.count {
  min-width: 22px;
  padding: 0 7px;
  border-radius: 11px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 12px;
  text-align: center;
}

/* ---------- カード ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--outline-soft);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card-flush { padding: 12px 8px; gap: 4px; }
.card-warn { background: #fff8e6; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 12px; }
.self-start { align-self: flex-start; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 720px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 24px;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: box-shadow .15s, background .15s;
}
.btn-filled { background: var(--primary); color: var(--on-primary); }
.btn-filled:hover { background: var(--primary-hover); }
.btn-tonal { background: var(--surface-3); color: var(--primary); }
.btn-tonal:hover { background: #dde3ec; }
.btn-text { background: none; color: var(--accent); padding: 0 12px; }
.btn-text:hover { background: var(--surface-2); }
.btn-danger { color: var(--err); }
.btn-sm { height: 36px; padding: 0 16px; font-size: 13px; }
.btn-text.btn-sm { padding: 0 10px; }
.btn-lg { height: 52px; border-radius: 12px; font-size: 16px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--text-2);
  cursor: pointer;
  flex: none;
}
.icon-btn:hover { background: var(--surface-3); }
.icon-btn .material-symbols-outlined { font-size: 22px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.fab {
  position: fixed;
  right: 16px;
  bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom));
  z-index: 15;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 20px 0 16px;
  border-radius: 14px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 500;
  box-shadow: 0 6px 16px rgba(14, 23, 48, .28);
}
.fab .material-symbols-outlined { font-size: 24px; }
@media (min-width: 900px) { .fab { right: 32px; bottom: 32px; } }

.actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.actions-start { justify-content: flex-start; }
.actions .btn-lg { flex: 1; }
.row-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.danger-zone { display: flex; justify-content: center; }

/* ---------- 入力欄 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 500; color: var(--text-2); }
.field input, .field select, .field textarea, .inline-form input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--outline);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px; /* 16px未満だと iPhone が入力時に拡大してしまう */
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .inline-form input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}
.inline-form input { width: auto; min-height: 40px; padding: 6px 12px; font-size: 14px; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.filters { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 16px; padding: 16px 20px; }
.filters .field { flex: 1 1 180px; }

/* ---------- 一覧 ---------- */
.list { display: flex; flex-direction: column; }
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 8px 4px;
  color: var(--text);
  border-top: 1px solid var(--outline-soft);
}
.list > .list-item:first-child, .list > .list-details:first-child > .list-item { border-top: 0; }
a.list-item:hover, summary.list-item:hover { background: var(--surface-2); border-radius: 10px; }
.list-item > .material-symbols-outlined { color: var(--text-2); }
.list-item-wrap { flex-wrap: wrap; }
.list-lead {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary-container);
  color: var(--accent);
  flex: none;
}
.list-lead.is-done { background: var(--ok-container); color: var(--ok); }
.list-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list-title { font-weight: 500; overflow-wrap: anywhere; }
.list-sub { font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.list-details > summary { list-style: none; cursor: pointer; }
.list-details > summary::-webkit-details-marker { display: none; }
.list-details[open] > summary > .material-symbols-outlined:last-child { transform: rotate(180deg); }
.details-body { padding: 8px 4px 20px; }

.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  flex: none;
}
.badge-ok { background: var(--ok-container); color: var(--ok); }
.badge-warn { background: var(--warn-container); color: var(--warn); }
.badge-err { background: var(--err-container); color: var(--err); }
.badge-info { background: var(--primary-container); color: var(--on-primary-container); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 4px 14px;
  border: 1px solid var(--outline);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.chip:hover { background: var(--surface-2); }
.chip.is-active { background: var(--primary-container); border-color: transparent; color: var(--on-primary-container); }
.chip .material-symbols-outlined { font-size: 18px; color: var(--accent); }

/* ---------- お知らせ ---------- */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--surface-3);
  overflow-wrap: anywhere;
}
.notice .material-symbols-outlined { margin-top: 2px; }
.notice-ok { background: var(--ok-container); color: #0a3818; }
.notice-err { background: var(--err-container); color: #601410; }
.notice-info { background: var(--primary-container); color: var(--on-primary-container); }

/* ---------- 月の切り替えとカレンダー ---------- */
.month-switch { display: flex; align-items: center; gap: 4px; }
.month-switch strong { min-width: 7.5em; text-align: center; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.cal-head { font-size: 12px; color: var(--text-2); text-align: center; padding-bottom: 4px; }
.cal-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 68px;
  padding: 4px 2px;
  border-radius: 10px;
  color: var(--text);
}
a.cal-cell:hover { background: var(--surface-2); }
.cal-cell.is-selected { background: var(--surface-3); }
.cal-num { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; font-size: 13px; font-weight: 500; }
.dow-0 { color: var(--sun); }
.dow-6 { color: var(--sat); }
.cal-cell.is-today .cal-num { background: var(--primary); color: var(--on-primary); }
.cal-chip {
  max-width: 100%;
  padding: 0 4px;
  border-radius: 5px;
  font-size: 10px;
  line-height: 16px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}
.cal-cell .cal-chip { width: 100%; text-align: center; }
.cal-chip.is-plan { background: var(--primary-container); color: var(--on-primary-container); }
.cal-chip.is-done { background: var(--ok-container); color: var(--ok); }
.cal-chip.is-leave { background: var(--warn-container); color: var(--warn); }
.cal-more { font-size: 10px; color: var(--text-2); line-height: 1; }
.legend { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 4px; margin-top: -8px; }
.legend .cal-chip { padding: 1px 8px; font-size: 11px; }

/* ---------- 移動経路 ---------- */
.leg { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--outline-soft); border-radius: 12px; background: var(--surface-2); }
.leg-places { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: end; }
.leg-arrow { height: 48px; display: grid; place-items: center; color: var(--text-2); }
.leg-cost { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.leg-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.leg-sub { font-size: 16px; margin-left: auto; }
.total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--outline-soft);
  font-weight: 500;
}
.total-row strong { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- 表（管理画面） ---------- */
.table-wrap { overflow-x: auto; margin: 0 -8px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 8px; text-align: left; vertical-align: top; border-top: 1px solid var(--outline-soft); }
.table thead th { border-top: 0; border-bottom: 1px solid var(--outline); font-size: 12px; font-weight: 500; color: var(--text-2); white-space: nowrap; letter-spacing: .04em; }
.table tfoot th { font-weight: 700; border-top: 2px solid var(--outline); }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table tbody tr:hover { background: var(--surface-2); }
.table td .material-symbols-outlined { font-size: 15px; margin-right: 2px; }

/* ---------- 数字のカード（管理者ホーム） ---------- */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px;
  border: 1px solid var(--outline-soft);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.stat:hover { border-color: var(--accent); box-shadow: 0 4px 12px rgba(14, 23, 48, .08); }
.stat-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 4px;
  border-radius: 10px;
  background: var(--primary-container);
  color: var(--accent);
}
.stat-icon.tone-warn { background: var(--warn-container); color: var(--warn); }
.stat-icon.tone-err { background: var(--err-container); color: var(--err); }
.stat-icon.tone-ok { background: var(--ok-container); color: var(--ok); }
.stat-label { font-size: 13px; color: var(--text-2); }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 14px; margin-left: 2px; color: var(--text-2); }

/* ---------- ログインなどの1枚画面 ---------- */
/* ログイン前の画面は、濃紺の地に細い交差線を重ねて、白いカードを浮かせる */
body.area-plain {
  min-height: 100vh;
  background:
    linear-gradient(115deg, transparent 49.9%, rgba(34, 211, 238, .12) 50%, transparent 50.1%),
    linear-gradient(65deg, transparent 49.9%, rgba(96, 165, 250, .12) 50%, transparent 50.1%),
    radial-gradient(900px 500px at 50% -10%, #1c3160, transparent 70%),
    var(--ink);
  background-attachment: fixed;
}
.area-plain .topbar { background: transparent; border: 0; color: var(--on-ink); }
.area-plain .brand { color: #fff; }
.area-plain .brand-kana { color: rgba(230, 236, 247, .7); }
.auth-card { width: 100%; max-width: 400px; margin: 0 auto; padding: 36px 28px; gap: 16px; border: 0; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.auth-card.wide { max-width: 520px; }
/* ログイン画面のロゴ：マークと名前を横に並べて1つのまとまりにする。上部バーのロゴは重なるので出さない */
body.area-plain:has(.auth-brand) .topbar { display: none; }
/* ログイン前の画面は、カードを画面の中央（少し上寄り）に置く */
.area-plain .main { display: flex; flex-direction: column; justify-content: center; min-height: calc(100vh - var(--bar-h)); min-height: calc(100dvh - var(--bar-h)); padding-top: 24px; padding-bottom: 48px; }
.area-plain .container { width: 100%; }
body.area-plain:has(.auth-brand) .main { min-height: 100vh; min-height: 100dvh; padding-bottom: 9vh; }
/* 利用する会社の名前（config.php の org_name）。副題の上に出す */
.auth-brand.is-org { flex-direction: column; gap: 10px; }
.auth-brand.is-org .auth-title { font-size: 22px; line-height: 1.35; text-align: center; overflow-wrap: anywhere; }
.auth-product { display: flex; align-items: baseline; gap: 8px; font-size: 12px; color: var(--text-2); }
.auth-product strong { font-size: 13px; font-weight: 700; letter-spacing: .04em; color: var(--text); }
.auth-product span { font-size: 10px; letter-spacing: .2em; color: var(--accent); }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 14px; }
.auth-brand-text { display: flex; flex-direction: column; gap: 4px; }
.auth-mark { width: 48px; height: 48px; border-radius: 12px; }
.auth-title { font-size: 24px; font-weight: 700; letter-spacing: .02em; line-height: 1.2; text-align: center; }
.auth-brand .auth-title { font-size: 30px; line-height: 1; text-align: left; }
.auth-kana { font-size: 10px; font-weight: 500; letter-spacing: .3em; color: var(--accent); }
.auth-tagline { text-align: center; font-size: 13px; color: var(--text-2); padding-bottom: 14px; border-bottom: 1px solid var(--outline-soft); }

@media (max-width: 599px) {
  .hide-sm { display: none; }
  .btn-text.btn-sm { padding: 0 8px; }
  .card { padding: 16px; }
  .card-flush { padding: 12px 6px; }
  .page-title { font-size: 24px; }
}

/* ---------- 確認の印・月末締め・クライアント用URL ---------- */
.marks { display: inline-flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.btn:disabled { background: var(--surface-3); color: #9aa0a6; box-shadow: none; cursor: not-allowed; }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--outline);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
}
.sub-title { font-size: 14px; font-weight: 500; color: var(--text-2); padding-top: 12px; border-top: 1px solid var(--outline-soft); }
.area-client .main { padding-bottom: 32px; }
.area-client .container { max-width: 880px; }

/* ---------- マスタ画面の追加フォーム（横に並べ、狭い画面では折り返す） ---------- */
.inline-add { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.inline-add .field { flex: 1 1 200px; }
.inline-add .btn { height: 48px; }

/* ---------- まとめて登録（カレンダーで日付を複数選ぶ）・実績のまとめ入力 ---------- */
.multi-hint { display: flex; align-items: center; gap: 8px; padding: 4px 8px 8px; font-size: 13px; color: var(--text-2); }
.multi-hint .material-symbols-outlined { color: var(--accent); }
.is-picking .cal-dow { cursor: pointer; border-radius: 8px; padding: 4px 0; background: var(--surface-3); transition: background .15s, transform .12s; }
.is-picking .cal-dow:hover { background: var(--primary-container); }
.is-picking .cal-dow:active { transform: scale(.92); }
.is-picking .cal-cell { cursor: pointer; user-select: none; }
.is-picking .cal-cell.is-selected { background: none; }
.cal-cell.is-picked, .is-picking .cal-cell.is-picked { background: var(--primary-container); box-shadow: inset 0 0 0 2px var(--accent); }
.cal-cell.is-picked .cal-num { background: var(--accent); color: #fff; animation: pop .25s ease-out both; }
.multi-bar {
  position: sticky;
  bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom));
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 10px 18px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 10px 28px rgba(14, 23, 48, .35);
}
@media (min-width: 900px) { .multi-bar { bottom: 20px; } }
.multi-count { font-weight: 700; font-variant-numeric: tabular-nums; }
.multi-bar .btn-text { color: var(--on-ink); }
.multi-bar .btn-text:hover { background: rgba(255, 255, 255, .1); }
.multi-bar .btn-filled { background: var(--accent-bright); color: var(--ink); }
.multi-bar .btn-filled:hover { background: #67e8f9; }
.multi-bar .btn:disabled { background: rgba(255, 255, 255, .14); color: rgba(255, 255, 255, .5); }
.page-head .count { margin-left: 2px; }

/* 勤務予定の追加画面の、日付を選ぶカレンダー */
.datepick { display: flex; flex-direction: column; gap: 10px; }
.datepick .cal-cell { min-height: 46px; justify-content: center; }
button.cal-cell { border: 0; background: none; font: inherit; }
.datepick-summary { font-size: 13px; font-weight: 500; color: var(--accent); }

.bulk-row { display: flex; flex-direction: column; gap: 10px; padding: 14px 4px; border-top: 1px solid var(--outline-soft); }
.list > .bulk-row:first-child { border-top: 0; }
.bulk-check { align-items: flex-start; }
.bulk-check input { margin-top: 2px; flex: none; }
.bulk-check > span { display: flex; flex-direction: column; }
.bulk-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; transition: opacity .2s; }
@media (min-width: 720px) { .bulk-fields { grid-template-columns: 1fr 1fr 1fr 2fr; } }
.bulk-row:has([data-bulk-on]:not(:checked)) .bulk-fields { opacity: .35; }

/* ---------- 動き ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes draw { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, .45); } 50% { box-shadow: 0 0 0 10px rgba(34, 211, 238, 0); } }
@keyframes drift { from { background-position: 0 0, 0 0, 0 0, 0 0; } to { background-position: 140px 0, -140px 0, 0 0, 0 0; } }
@keyframes spin-in { from { transform: rotate(-270deg) scale(.4); } to { transform: none; } }
@keyframes sheen { from { transform: translateX(-120%) skewX(-20deg); } to { transform: translateX(320%) skewX(-20deg); } }

/* 画面を開いたとき、中身が上から順にふわっと現れる */
.container > * { animation: rise .45s cubic-bezier(.2, .7, .2, 1) both; }
.container > *:nth-child(2) { animation-delay: .05s; }
.container > *:nth-child(3) { animation-delay: .1s; }
.container > *:nth-child(4) { animation-delay: .15s; }
.container > *:nth-child(5) { animation-delay: .2s; }
.container > *:nth-child(n+6) { animation-delay: .25s; }
.stats > .stat { animation: rise .45s cubic-bezier(.2, .7, .2, 1) both; }
.stats > .stat:nth-child(2) { animation-delay: .06s; }
.stats > .stat:nth-child(3) { animation-delay: .12s; }
.stats > .stat:nth-child(4) { animation-delay: .18s; }
.container > .notice { animation: drop .35s ease-out both; }
.table tbody tr { animation: fade .4s ease-out both; }
.badge-warn, .badge-ok, .badge-info { animation: pop .35s ease-out both; animation-delay: .2s; }

/* ロゴマーク：線が描かれて交わる */
.brand-mark svg path { stroke-dasharray: 24; animation: draw .6s ease-out both; }
.brand-mark svg path:nth-child(2) { animation-delay: .25s; }
.brand-mark svg path:nth-child(3) { animation-delay: .4s; }
.brand-mark svg { transition: transform .45s cubic-bezier(.2, .7, .2, 1); }
.brand:hover .brand-mark svg, .auth-card:hover .brand-mark svg, .brand-mark:active svg { transform: rotate(180deg); }
.auth-mark svg { animation: spin-in .9s cubic-bezier(.2, .7, .2, 1) .3s backwards; }

/* ログイン画面：背景の交差線がゆっくり流れ、カードが浮かび上がる */
body.area-plain { animation: drift 40s linear infinite alternate; }
.auth-card { animation: rise .6s cubic-bezier(.2, .7, .2, 1) both; }
.auth-card > * { animation: fade .5s ease-out both; animation-delay: .25s; }
.auth-mark { animation: pop .5s cubic-bezier(.2, .7, .2, 1) both; }
.auth-title { animation: rise .5s ease-out both; animation-delay: .15s; }

/* 押せるものの手ごたえ */
.btn { position: relative; overflow: hidden; transition: background .15s, box-shadow .15s, transform .12s; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn-filled::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .22), transparent);
  transform: translateX(-120%) skewX(-20deg);
  pointer-events: none;
}
.btn-filled:hover:not(:disabled)::after { animation: sheen .7s ease-out; }
.icon-btn { transition: background .15s, transform .12s; }
.icon-btn:active { transform: scale(.9); }
.btn .material-symbols-outlined, .list-item > .material-symbols-outlined:last-child { transition: transform .2s; }
.btn:hover .material-symbols-outlined { transform: translateX(1px) scale(1.08); }
a.list-item, summary.list-item { transition: background .15s, padding-left .2s; }
a.list-item:hover { padding-left: 8px; }
a.list-item:hover > .material-symbols-outlined:last-child { transform: translateX(3px); }
.list-lead { transition: transform .2s; }
.list-item:hover .list-lead { transform: scale(1.06); }
.stat { transition: border-color .15s, box-shadow .15s, transform .2s; }
.stat:hover { transform: translateY(-3px); }
.stat-icon { transition: transform .25s cubic-bezier(.2, .7, .2, 1); }
.stat:hover .stat-icon { transform: rotate(-8deg) scale(1.08); }
.chip { transition: background .15s, border-color .15s, transform .12s; }
.chip:active { transform: scale(.96); }
.cal-cell { transition: background .15s, transform .12s; }
a.cal-cell:active { transform: scale(.94); }
.cal-cell.is-today .cal-num { animation: pop .45s ease-out both; }
.fab { transition: transform .2s cubic-bezier(.2, .7, .2, 1), box-shadow .2s; animation: pop .45s cubic-bezier(.2, .7, .2, 1) both; animation-delay: .3s; }
.fab:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(14, 23, 48, .32); }
.fab:active { transform: scale(.96); }

/* メニュー：選んでいる項目の印がすっと入る */
.nav-item { transition: color .15s, background .2s, box-shadow .2s; }
.nav-item.is-active .nav-icon { animation: pop .35s ease-out both; }
.nav-item:active .nav-icon { transform: scale(.9); }

/* 入力欄：選ぶと枠がやわらかく光る */
.field input, .field select, .field textarea { transition: border-color .15s, box-shadow .2s; }
.field input:focus, .field select:focus, .field textarea:focus { box-shadow: 0 0 0 4px rgba(14, 116, 144, .14); }

/* 開く・増える */
.list-details > summary > .material-symbols-outlined:last-child { transition: transform .25s; }
.list-details[open] > .details-body { animation: drop .3s ease-out both; }
.leg { animation: rise .3s ease-out both; }
.month-switch strong { animation: fade .4s ease-out both; }

/* 動きを減らす設定の端末では、すべて止める */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
