/* 猪野組ポータル — 配色は日報・備品アプリと同じロゴ実測値（#EB072A）＋落ち着いた地色 */
:root {
  --red: #EB072A;
  --red-dark: #C00622;
  --red-soft: #FDE7E9;
  --dark: #4F4F4F;
  --gray: #CACACA;
  --bg-soft: #F7F6F2;
  --text: #3A3A3A;
  --muted: #7A7A76;
  --white: #FFFFFF;
  --green: #2E7D32;
  --green-soft: #E6F4EA;
  --blue: #1D5A99;
  --blue-soft: #E3F0FA;
  --yellow: #F5C400;
  --warn-bg: #FFF6D9;
  --warn-fg: #8A6D00;
  --line: #E3E0D8;
  --radius: 12px;
  --shadow: 0 1px 4px rgba(0,0,0,.08);
  --nav-h: 60px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  background: var(--bg-soft); color: var(--text); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: 16px; }
a { color: var(--blue); }
img { max-width: 100%; }
h1, h2, h3 { margin: 0 0 8px; color: var(--dark); line-height: 1.3; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 16px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); font-size: 14px; }
.sub { color: var(--muted); font-size: 14px; }
.small { font-size: 13px; }
.right { text-align: right; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.mt { margin-top: 12px; } .mb { margin-bottom: 12px; }

/* ---------- ヘッダー ---------- */
header.app-header {
  position: sticky; top: 0; z-index: 30; background: var(--white);
  border-bottom: 3px solid var(--red); display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; box-shadow: var(--shadow); height: 56px;
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--dark); }
.brand-logo { height: 26px; width: auto; }
.brand-name { font-weight: 700; font-size: 15px; white-space: nowrap; }
@media (max-width: 520px) {
  .brand-name { display: none; }                  /* 狭い画面はロゴだけ（名前を出すと折り返して重なる） */
  .person-badge { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; }
}
.header-spacer { flex: 1; }
.person-badge { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; font-size: 13px; color: var(--dark); white-space: nowrap; }
.icon-btn { position: relative; background: none; border: none; font-size: 20px; cursor: pointer; padding: 4px 6px; text-decoration: none; color: var(--dark); line-height: 1; }
.badge { position: absolute; top: -4px; right: -6px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; min-width: 18px; height: 18px; line-height: 18px; text-align: center; padding: 0 5px; }
.badge.inline { position: static; display: inline-block; margin-left: 4px; }
.badge.dot { min-width: 10px; height: 10px; padding: 0; top: 0; right: -4px; }

/* ---------- レイアウト（PC＝左ナビ／スマホ＝下ナビ） ---------- */
.layout { display: flex; min-height: calc(100vh - 56px); }
.side-nav { display: none; }
.main { flex: 1; padding: 14px; padding-bottom: calc(var(--nav-h) + 20px); max-width: 1100px; width: 100%; margin: 0 auto; }
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--white); border-top: 1px solid var(--line);
  display: flex; height: var(--nav-h); padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--muted); text-decoration: none; }
.bottom-nav a .ic { font-size: 20px; position: relative; line-height: 1; }
.bottom-nav a.active { color: var(--red); font-weight: 700; }
@media (min-width: 900px) {
  .side-nav {
    display: flex; flex-direction: column; width: 220px; background: var(--white); border-right: 1px solid var(--line);
    padding: 12px 0; position: sticky; top: 56px; height: calc(100vh - 56px);
  }
  .side-nav a { display: block; padding: 10px 18px; color: var(--dark); text-decoration: none; font-size: 15px; border-left: 4px solid transparent; }
  .side-nav a:hover { background: var(--bg-soft); }
  .side-nav a.active { border-left-color: var(--red); background: var(--red-soft); font-weight: 700; }
  .side-foot { margin-top: auto; padding: 12px 18px; font-size: 13px; }
  .bottom-nav { display: none; }
  .main { padding: 24px; padding-bottom: 40px; }
}

/* ---------- 部品 ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 14px; }
.card h2 { display: flex; align-items: center; gap: 8px; }
.card h2 .more { margin-left: auto; font-size: 13px; font-weight: 400; }
.btn { border: 1px solid var(--line); background: var(--white); color: var(--dark); border-radius: 10px; padding: 9px 16px; cursor: pointer; font-weight: 600; line-height: 1.3; }
.btn:hover { background: var(--bg-soft); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-danger { color: var(--red-dark); border-color: var(--red-soft); background: var(--red-soft); }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; display: block; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--blue); }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field input[type=text], .field input[type=date], .field input[type=email], .field input[type=tel], .field input[type=number], .field input[type=url], .field select, .field textarea {
  width: 100%; border: 1px solid var(--gray); border-radius: 8px; padding: 9px 10px; background: #fff;
}
.field textarea { min-height: 120px; resize: vertical; }
.field .check { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--text); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 600px) { .grid2 { grid-template-columns: 1fr; } }
.chip { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; background: var(--bg-soft); color: var(--dark); border: 1px solid var(--line); }
.chip.urgent { background: var(--red); color: #fff; border-color: var(--red); }
.chip.award { background: var(--yellow); color: #5A4500; border-color: var(--yellow); }
.chip.general { background: var(--blue-soft); color: var(--blue); border-color: var(--blue-soft); }
.chip.good { background: var(--green-soft); color: var(--green); border-color: var(--green-soft); }
.chip.hiyari { background: var(--warn-bg); color: var(--warn-fg); border-color: var(--warn-bg); }
.chip.done { background: var(--green-soft); color: var(--green); }
.chip.open { background: var(--red-soft); color: var(--red-dark); }
.chip.pin { background: var(--dark); color: #fff; border-color: var(--dark); }
.chip.new { background: var(--red); color: #fff; border-color: var(--red); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: 14px; }
.tabs button.active { background: var(--dark); color: #fff; border-color: var(--dark); }
.empty { color: var(--muted); text-align: center; padding: 20px 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: none; }
.list a.item { display: block; color: inherit; text-decoration: none; }
.list a.item:hover .t { color: var(--red-dark); }
.list .t { font-weight: 600; }
.list .m { font-size: 13px; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table.tbl { border-collapse: collapse; width: 100%; font-size: 14px; }
table.tbl th, table.tbl td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; vertical-align: top; white-space: nowrap; }
table.tbl th { color: var(--muted); font-weight: 600; font-size: 12px; background: var(--bg-soft); }
.alert { border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; }
.alert.urgent { background: var(--red); color: #fff; font-weight: 700; }
.alert.urgent a { color: #fff; }
.alert.warn { background: var(--warn-bg); color: var(--warn-fg); }
.alert.info { background: var(--blue-soft); color: var(--blue); }

/* Markdown 本文 */
.md h1 { font-size: 20px; margin: 18px 0 8px; border-left: 5px solid var(--red); padding-left: 10px; }
.md h2 { font-size: 17px; margin: 16px 0 6px; }
.md h3 { font-size: 15px; margin: 12px 0 4px; }
.md ul, .md ol { padding-left: 22px; margin: 6px 0 10px; }
.md p { margin: 0 0 10px; }
.md hr { border: none; border-top: 1px solid var(--line); margin: 14px 0; }
.md blockquote { border-left: 4px solid var(--gray); margin: 8px 0; padding: 4px 12px; color: var(--muted); }
.md img { border-radius: 8px; }

/* ---------- ホーム上部：社長のイラスト＋吹き出し ---------- */
.boss-banner { display: flex; align-items: flex-end; gap: 10px; margin: 0 0 14px; padding: 0 4px; }
.boss-img {
  height: 164px; width: auto; flex: none; transform-origin: 50% 100%;
  animation: boss-in .7s cubic-bezier(.2,.9,.3,1.2) both, boss-bounce 6s ease-in-out 2s infinite;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,.18));
}
.boss-side { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 26px; min-width: 0; flex: 1 1 auto; }
.boss-date { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--dark); }
/* 日付ブロック：西暦（小）＋ 月日（大）＋ 曜日（丸札）。すべてロゴの赤で統一（2026-09-15 後藤さん指定） */
.bd-datebox { display: inline-flex; align-items: baseline; gap: 8px; padding: 2px 0; }
.bd-year { font-size: 14px; font-weight: 800; letter-spacing: .06em; color: #2C2C2A; font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif; }   /* 西暦も黒（2026-09-16 後藤さん指定＝日付は全部黒） */
.bd-year .bd-unit { font-size: 12px; margin-left: 1px; }
.bd-md { display: inline-flex; align-items: baseline; line-height: 1; color: #2C2C2A; }   /* 月日の数字＝黒（2026-09-15 後藤さん指定） */
.bd-m, .bd-d { font-size: 30px; font-weight: 900; letter-spacing: -.02em; font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif; }
.bd-unit { font-size: 14px; font-weight: 800; margin: 0 4px 0 1px; }
.bd-dow { font-size: 12px; font-weight: 800; color: #fff; background: #2C2C2A; border-radius: 999px; padding: 3px 10px; position: relative; top: -3px; }   /* 曜日の札＝黒 */
@media (max-width: 600px) { .bd-m, .bd-d { font-size: 24px; } .bd-year { font-size: 11px; } .bd-dow { font-size: 11px; padding: 2px 8px; } }
.bd-tag { border-radius: 999px; padding: 1px 9px; font-size: 12px; font-weight: 700; background: var(--bg-soft); border: 1px solid var(--line); }
.bd-tag.hol { background: var(--blue-soft); color: var(--blue); border-color: var(--blue-soft); }
.bd-tag.day { background: var(--warn-bg); color: var(--warn-fg); border-color: var(--warn-bg); }
.bd-tag.birthday { background: #FFE4EC; color: #A8134A; border-color: #FFE4EC; }
.bd-tag.hire { background: var(--green-soft); color: var(--green); border-color: var(--green-soft); }
.bd-tag.service { background: var(--yellow); color: #5A4500; border-color: var(--yellow); }
.bd-tag.fun { background: #EEF2FF; color: #3730A3; border-color: #EEF2FF; cursor: help; }
.fun-block { flex-basis: 100%; display: flex; flex-direction: column; gap: 3px; }   /* 日付の行の下に、札の行→出典の行 */
.fun-row { display: flex; flex-wrap: wrap; gap: 6px; }
.bd-src { font-size: 10px; color: var(--muted); }
.boss-bubble {
  position: relative; background: var(--white); border: 2px solid var(--red); border-radius: 16px;
  padding: 10px 14px; font-weight: 700; font-size: 16px; color: var(--dark); line-height: 1.4;
  animation: bubble-in .5s ease-out .45s both;
}
.boss-bubble::before, .boss-bubble::after { content: ''; position: absolute; left: -14px; bottom: 16px; border: 7px solid transparent; }
.boss-bubble::before { border-right-color: var(--red); }
.boss-bubble::after { left: -10px; border-right-color: var(--white); }
.boss-label { font-size: 12px; font-weight: 700; color: var(--red); padding-left: 6px; margin-bottom: -2px; }   /* 吹き出しの上の見出し（2026-10-14 後藤さん要望） */
.boss-slogan { font-size: 12px; font-weight: 700; color: var(--red); margin-top: 2px; padding-left: 6px; }   /* 常時表記（期のスローガン）＝ひとことがあるときは吹き出しの下に小さく */
.boss-edit { margin-top: 2px; font-size: 12px; }
.safety-note { margin: 6px 0 0; font-size: 11px; }
@keyframes boss-in { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes bubble-in { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: scale(1); } }
@keyframes boss-bounce {                 /* 6秒に1回、軽く弾む */
  0%, 6%, 100% { transform: translateY(0) scaleY(1); }
  2% { transform: translateY(-8px) scaleY(1.03); }
  4% { transform: translateY(0) scaleY(.97); }
}
@media (max-width: 600px) { .boss-img { height: 116px; } .boss-side { margin-bottom: 12px; } .boss-bubble { font-size: 14px; padding: 8px 12px; } .bd-tag { font-size: 11px; } }
@media (prefers-reduced-motion: reduce) { .boss-img, .boss-bubble { animation: none; } }

/* ---------- ホーム上段：社長＋天気（PC は横並び・スマホは縦） ---------- */
.top-row { display: flex; flex-direction: column; gap: 0; }
.wx-body { display: flex; flex-direction: column; }
.wx-src { font-size: 11px; margin-top: 6px; }
@media (min-width: 900px) {
  /* PC＝社長は内容ぶんの幅だけ、天気は残りの幅いっぱいに横長・低めで並べる */
  .top-row { flex-direction: row; align-items: flex-end; gap: 14px; }
  .top-row .boss-banner { flex: 1 1 380px; min-width: 0; max-width: 560px; }   /* 記念日の札が多い日は中で折り返す（幅を取りすぎない） */
  .top-row .weather-card { flex: 1 1 360px; min-width: 0; padding: 10px 14px; }
  .weather-card h2 { font-size: 14px; margin-bottom: 6px; }
  .wx-day { padding: 6px 10px; }
  .wx-icon { font-size: 24px; }
  .wx-src { margin-top: 4px; }
}
@media (min-width: 1200px) {
  /* 十分に広い画面だけ、天気の中身を「左＝きょう・あすを2段の横長」「右＝熱中症・警報」に */
  .wx-body { flex-direction: row; gap: 12px; align-items: stretch; }
  .wx-days { flex: 2; margin-bottom: 0; min-width: 0; flex-direction: column; gap: 6px; }
  .wx-day { flex: 1 1 auto; padding: 6px 12px; gap: 10px; overflow: visible; }
  .wx-main { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 12px; flex: 1; min-width: 0; }
  .wx-label { flex: 0 0 auto; flex-wrap: nowrap; white-space: nowrap; }
  .wx-nums { margin-top: 0; margin-left: auto; white-space: nowrap; }
  .wx-side { flex: 1.1; min-width: 200px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
  .wx-wbgt { margin-bottom: 0; }
  .wx-warn { margin-bottom: 0; }
}
.weather-card h2 { font-size: 16px; }
.wx-days { display: flex; gap: 8px; margin-bottom: 8px; }
.wx-day { flex: 1 1 0; background: var(--bg-soft); border-radius: 10px; padding: 6px 10px; display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; }
.wx-main { min-width: 0; flex: 1; }
.wx-label { font-size: 12px; color: var(--muted); font-weight: 700; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; }
.wx-brief { color: var(--dark); font-size: 13px; font-weight: 700; }
.wx-icon { font-size: 28px; line-height: 1; flex: none; }
.wx-nums { font-size: 13px; display: flex; gap: 8px; margin-top: 2px; flex-wrap: wrap; }
.wx-nums .hi { color: var(--red-dark); font-weight: 700; } .wx-nums .lo { color: var(--blue); font-weight: 700; } .wx-nums .pop { color: var(--muted); }
.wx-obs { font-size: 10px; color: var(--muted); align-self: center; }
.wx-wbgt { color: #fff; border-radius: 8px; padding: 6px 10px; font-size: 13px; margin-bottom: 6px; line-height: 1.4; }
.wx-wbgt .small { display: block; font-size: 11px; opacity: .95; }
.wx-wbgt.off { background: var(--bg-soft); color: var(--muted); }
.wx-warn { margin-bottom: 4px; }

/* ---------- ホーム ---------- */
.home-grid { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 900px) { .home-grid { grid-template-columns: 1fr 1fr; gap: 0 14px; } .home-grid .span2 { grid-column: 1 / -1; } }
.links-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.link-tile { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; padding: 14px 8px 12px; text-decoration: none; color: var(--dark); text-align: center; min-height: 92px; }   /* 上詰め＝説明の行数が違ってもアイコンの高さをそろえる */
.link-tile:hover { background: var(--white); border-color: var(--red); }
.link-tile .ic { font-size: 28px; line-height: 1; }
.link-tile .t { font-weight: 700; font-size: 14px; }
.link-tile .d { font-size: 11px; color: var(--muted); }
.link-tile.off { opacity: .5; }

/* ---------- 無事故カウンター ---------- */
.safety-hero { text-align: center; padding: 8px 0 4px; }
.safety-days { font-size: 64px; font-weight: 800; color: var(--red); line-height: 1; letter-spacing: -1px; }
.safety-days small { font-size: 22px; color: var(--dark); margin-left: 4px; font-weight: 700; }
.safety-sub { color: var(--muted); font-size: 14px; }
.progress { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; height: 16px; overflow: hidden; margin: 8px 0 4px; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--red), #FF6B3D); border-radius: 999px; transition: width .5s; }
.milestones { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.ms { border-radius: 999px; padding: 4px 12px; font-size: 13px; border: 1px solid var(--line); background: #fff; color: var(--muted); }
.ms.done { background: var(--green-soft); color: var(--green); border-color: var(--green-soft); font-weight: 700; }
.ms.next { background: var(--red-soft); color: var(--red-dark); border-color: var(--red-soft); font-weight: 700; }
.stat-row { display: flex; gap: 10px; flex-wrap: wrap; }
.stat { flex: 1; min-width: 120px; background: var(--bg-soft); border-radius: 10px; padding: 10px 12px; text-align: center; }
.stat .n { font-size: 26px; font-weight: 800; color: var(--dark); line-height: 1.1; }
.stat .l { font-size: 12px; color: var(--muted); }
.stat.good .n { color: var(--green); }
.stat.hiyari .n { color: var(--warn-fg); }

/* ---------- カレンダー ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }   /* minmax(0,…)＝長い札があっても列がはみ出さない（2026-09-18） */
.cal-cell { min-width: 0; }
.cal-dow { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.cal-dow.sat { color: var(--blue); } .cal-dow.sun { color: var(--red-dark); }
.cal-cell { min-height: 64px; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 3px 4px; font-size: 12px; }
.cal-cell.off { background: var(--blue-soft); }
.cal-cell.other { opacity: .35; }
.cal-cell.today { outline: 2px solid var(--red); }
.cal-cell .d { font-weight: 700; font-size: 13px; }
.cal-cell.off .d { color: var(--blue); }
.cal-cell .hol { font-size: 10px; color: var(--blue); }
.cal-ev { display: block; font-size: 11px; line-height: 1.3; margin-top: 2px; padding: 1px 4px; border-radius: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev.birthday { background: #FFE4EC; color: #A8134A; }
.cal-ev.hire { background: var(--green-soft); color: var(--green); }
.cal-ev.service { background: var(--yellow); color: #5A4500; font-weight: 700; }
.cal-ev.cd-event { background: #FFE9D6; color: #9A3F00; font-weight: 700; }        /* 行事・予定 */
.cal-ev.cd-recommend { background: var(--green-soft); color: var(--green); font-weight: 700; }   /* 有給取得推奨日 */
.cal-ev.cd-work { background: #EEE; color: var(--dark); }                          /* 出勤日 */
.cal-ev.cd-flag { background: #FDE7E9; color: #C62828; font-weight: 700; }            /* 旗当番 */
.cal-ev.cd-off { background: var(--blue-soft); color: var(--blue); }
.cal-cell.editable { cursor: pointer; }
.cal-cell.editable:hover { outline: 2px solid var(--gray); }
.bd-tag.cd-event { background: #FFE9D6; color: #9A3F00; border-color: #FFE9D6; }
.bd-tag.cd-recommend { background: var(--green-soft); color: var(--green); border-color: var(--green-soft); }
.bd-tag.cd-flag { background: #FDE7E9; color: #C62828; border-color: #FDE7E9; }
.bd-tag.cd-work { background: #EEE; color: var(--dark); border-color: #EEE; }
@media (max-width: 600px) { .cal-cell { min-height: 52px; padding: 2px; } .cal-ev { font-size: 10px; padding: 0 2px; } }
.ev-list li { display: flex; gap: 10px; align-items: center; }
.ev-list .date { min-width: 64px; font-weight: 700; color: var(--dark); }
.cal-ev.duty { background: #E8F1FF; color: #1D4ED8; text-decoration: none; }            /* 当番（2026-09-18） */
.cal-ev.room { background: #F3E8FF; color: #6B21A8; text-decoration: none; }            /* 会議室の予約 */
.bd-tag.cd-duty { background: #E8F1FF; color: #1D4ED8; border-color: #E8F1FF; }

/* ---------- 当番（トイレ掃除・2026-09-18） ---------- */
.duty-now { text-align: center; padding: 6px 0 2px; }
.duty-week { font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.duty-pair { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.duty-box { flex: 1 1 160px; max-width: 260px; border-radius: 14px; padding: 12px 14px; background: var(--bg-soft); border: 2px solid var(--line); }
.duty-box .l { font-size: 12px; font-weight: 700; color: var(--muted); }
.duty-box .n { font-size: 24px; font-weight: 800; color: var(--dark); line-height: 1.2; }
.duty-box.male { border-color: #BFDBFE; background: #EFF6FF; }
.duty-box.female { border-color: #FBCFE8; background: #FDF2F8; }
.duty-tbl tr.now td { background: #FFF7E6; font-weight: 700; }
.duty-tbl tr.past td { color: var(--muted); }
.duty-order { margin: 0 0 8px; padding-left: 22px; }
.duty-order li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.duty-strip { display: block; background: #EFF6FF; color: #1D4ED8; border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; text-decoration: none; font-size: 14px; }
.duty-strip:hover { background: #DBEAFE; }

/* ---------- 会議室予約（2026-09-18） ---------- */
.room-week { display: flex; flex-direction: column; gap: 8px; }
.room-day { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fff; }
.room-day.off { background: var(--bg-soft); }
.room-day.today { border-color: var(--red); box-shadow: 0 0 0 2px var(--red-soft); }
.room-date { display: flex; justify-content: space-between; align-items: center; font-weight: 700; margin-bottom: 4px; }
.room-item { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 6px 8px; border-radius: 8px; background: #F3E8FF; margin-top: 4px; }
.room-item.mine { background: #FCE7F3; }
.room-time { font-weight: 800; color: #6B21A8; white-space: nowrap; }
.room-title { font-weight: 700; }
.room-empty { padding: 2px 0 0; }
.list .room-item { border-bottom: 0; }

/* ---------- ヒヤリハットの見える化（人別・月別グラフ・2026-09-18） ---------- */
.stat.zero .n { color: var(--red-dark); }
.my-hiyari { display: block; margin-top: 10px; padding: 8px 12px; border-radius: 10px; background: var(--bg-soft); color: var(--dark); text-decoration: none; font-size: 14px; }
.my-hiyari.zero { background: var(--red-soft); color: var(--red-dark); border: 1px solid #F5B5B5; font-weight: 700; }
/* 人別グラフ＝PCは1行に2人・棒は細く短く（2026-09-18 後藤さん指定＝場所を取りすぎない）。スマホは1列 */
.bar-sum { font-size: 13px; margin: 0 0 6px; }
.bar-sum .ok { color: var(--green); } .bar-sum .ng { color: var(--red-dark); }
.bars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px 18px; }
.bar-dept { grid-column: 1 / -1; font-size: 11px; font-weight: 700; color: var(--muted); margin: 5px 0 1px; padding: 0 4px; border-bottom: 1px solid var(--line); }
.bar-row { display: grid; grid-template-columns: 104px minmax(0, 1fr) 52px; gap: 6px; align-items: center; padding: 1px 4px; border-radius: 6px; min-width: 0; }
.bar-row.me { background: #FFF7E6; }
.bar-row.zero .bar-name { color: var(--red-dark); font-weight: 700; }
.bar-name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-name .you { font-size: 10px; margin-left: 4px; padding: 0 5px; border-radius: 999px; background: var(--yellow); color: #5A4500; font-weight: 700; }
.bar-track { display: flex; height: 8px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.bar-row.zero .bar-track { background: repeating-linear-gradient(45deg, #FDE7E9, #FDE7E9 4px, #fff 4px, #fff 8px); }
.bar { height: 100%; }
.bar.hiyari { background: #F59E0B; }
.bar.good { background: var(--green); }
.bar-num { font-size: 12px; white-space: nowrap; text-align: right; }
.bar-num strong { font-size: 14px; }
.bar-num .chip { font-size: 10px; padding: 0 6px; }
.legend { display: flex; gap: 14px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.lg::before { content: ''; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.lg.hiyari::before { background: #F59E0B; }
.lg.good::before { background: var(--green); }
.mbars { display: flex; gap: 4px; align-items: flex-end; height: 96px; padding-top: 4px; }
.mbar { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; min-width: 0; }
.mbar-n { font-size: 11px; font-weight: 700; color: var(--dark); height: 14px; line-height: 14px; }
.mbar-col { flex: 1; width: 70%; display: flex; flex-direction: column-reverse; background: var(--bg-soft); border-radius: 4px 4px 0 0; overflow: hidden; }
.mbar-col .seg.hiyari { background: #F59E0B; }
.mbar-col .seg.good { background: var(--green); }
.mbar-l { font-size: 11px; color: var(--muted); margin-top: 3px; white-space: nowrap; }
.mbar.future { opacity: .4; }
.mbar.now .mbar-l { color: var(--red-dark); font-weight: 700; }
@media (max-width: 600px) {
  .bars { grid-template-columns: minmax(0, 1fr); }
  .mbar-l { font-size: 9px; }
}

/* ---------- ヒヤリハットの入力：目安の字数・下書き（2026-10-02） ---------- */
.cnt { text-align: right; font-size: 12px; color: var(--muted); margin-top: 2px; }
.cnt.over { color: var(--red-dark); font-weight: 700; }
.chip.draft { background: #FFF1B8; color: #5A4500; border-color: #FFF1B8; }
.draft-card { border-left: 4px solid var(--yellow); }

/* ---------- 管理画面の利用状況（2026-10-27） ---------- */
.usage-tbl tr.no-pin td:first-child { color: var(--red-dark); font-weight: 700; }
.usage-tbl tr.stale td { color: var(--muted); }
.usage-tbl .dots { white-space: nowrap; }
.usage-tbl .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--bg-soft); border: 1px solid var(--line); margin-right: 2px; }
.usage-tbl .dot.on { background: var(--green); border-color: var(--green); }

/* ---------- ヒヤリハットのコメント（2026-10-02） ---------- */
.cm-item { border-left: 3px solid var(--blue); background: var(--blue-soft); border-radius: 0 8px 8px 0; padding: 8px 12px; margin-bottom: 8px; }
.cm-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.cm-head .cm-date { margin-left: auto; }
.cm-body { margin-top: 4px; white-space: normal; word-break: break-word; }

/* ---------- 写真 ---------- */
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.album-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; text-decoration: none; color: inherit; display: block; }
.album-card .cover { aspect-ratio: 4/3; background: var(--bg-soft) center/cover no-repeat; display: flex; align-items: center; justify-content: center; font-size: 36px; color: var(--gray); }
.album-card .body { padding: 8px 10px; }
.album-card .t { font-weight: 700; font-size: 14px; }
.album-card .m { font-size: 12px; color: var(--muted); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.photo-grid .ph { aspect-ratio: 1; background: var(--bg-soft) center/cover no-repeat; border-radius: 8px; cursor: pointer; position: relative; }
.photo-grid .ph .cap { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.5); color: #fff; font-size: 11px; padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload-zone { border: 2px dashed var(--gray); border-radius: 12px; padding: 18px; text-align: center; color: var(--muted); cursor: pointer; }
.upload-zone:hover { border-color: var(--red); color: var(--dark); }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 60; display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 96vw; max-height: 86vh; object-fit: contain; }
.lightbox button { position: absolute; background: rgba(255,255,255,.15); color: #fff; border: none; font-size: 28px; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; }
.lb-close { top: 12px; right: 12px; } .lb-prev { left: 8px; top: 50%; } .lb-next { right: 8px; top: 50%; }
.lb-cap { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; color: #fff; font-size: 14px; }

/* ---------- Q&A ---------- */
.faq-item { border-bottom: 1px solid var(--line); padding: 10px 0; }
.faq-q { font-weight: 700; cursor: pointer; display: flex; gap: 8px; align-items: flex-start; }
.faq-q::before { content: 'Q'; color: var(--red); font-weight: 800; }
.faq-a { margin: 6px 0 0 22px; }
.secret { background: var(--dark); color: var(--dark); border-radius: 6px; padding: 2px 8px; cursor: pointer; user-select: none; }
.secret.show { background: var(--warn-bg); color: var(--text); font-family: ui-monospace, Menlo, Consolas, monospace; }

/* ---------- 書類 ---------- */
.doc-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.doc-row .ic { font-size: 24px; }
.doc-row .t { font-weight: 600; }
.doc-row .m { font-size: 12px; color: var(--muted); }

/* ---------- 名簿 ---------- */
.member-card { display: flex; gap: 12px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; }
.member-card .av { width: 44px; height: 44px; border-radius: 50%; background: var(--red-soft); color: var(--red-dark); font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; }
.member-card .n { font-weight: 700; }
.member-card .r { font-size: 13px; color: var(--muted); }
.member-card .c { font-size: 13px; margin-top: 4px; }
.member-card .c a { margin-right: 10px; }

/* ---------- モーダル・トースト ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal-box { background: #fff; width: 100%; max-width: 640px; max-height: 92vh; border-radius: 16px 16px 0 0; display: flex; flex-direction: column; }
@media (min-width: 700px) { .modal-wrap { align-items: center; } .modal-box { border-radius: 16px; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 14px 16px; overflow-y: auto; }
.toast { position: fixed; bottom: calc(var(--nav-h) + 14px); left: 50%; transform: translateX(-50%); background: var(--dark); color: #fff; padding: 10px 18px; border-radius: 999px; z-index: 70; font-size: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.3); max-width: 90vw; }
.toast.error { background: var(--red-dark); }
@media (min-width: 900px) { .toast { bottom: 24px; } }

/* ---------- 入れないとき ---------- */
.blocked-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.blocked-box { background: #fff; border-radius: 16px; padding: 28px 24px; max-width: 420px; width: 100%; text-align: center; box-shadow: var(--shadow); }
.blocked-logo { height: 40px; margin-bottom: 12px; }

/* ---------- メニュー画面（スマホ） ---------- */
.menu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.menu-grid a { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 12px; text-decoration: none; color: var(--dark); font-weight: 700; display: flex; gap: 8px; align-items: center; }

/* ===== 備品台帳・物品購入申請（2026-10-27） ===== */
.stat.ng .n { color: var(--red-dark); }
.eq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.eq-card { display: flex; gap: 10px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; text-decoration: none; color: inherit; box-shadow: var(--shadow); }
.eq-card:hover { border-color: var(--red); }
.eq-card.off { opacity: .55; }
.eq-thumb { flex: 0 0 76px; height: 76px; border-radius: 8px; background: var(--bg-soft) center/cover no-repeat; display: flex; align-items: center; justify-content: center; font-size: 28px; }
.eq-body { min-width: 0; flex: 1; }
.eq-code { font-weight: 800; color: var(--red-dark); font-size: 13px; letter-spacing: .02em; }
.eq-name { font-weight: 700; line-height: 1.3; }
.eq-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin-top: 4px; }
.eq-photo { border-radius: 8px; max-height: 320px; cursor: zoom-in; }
.tbl.kv th { width: 9em; text-align: left; color: var(--muted); font-weight: 600; white-space: nowrap; vertical-align: top; }
.tbl.kv td { white-space: normal; }
.pfig { margin: 0; max-width: 220px; text-align: center; }
.pfig img { border-radius: 8px; max-height: 200px; cursor: zoom-in; }
.route { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.rstep { border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 13px; background: var(--bg-soft); display: inline-flex; flex-direction: column; align-items: center; line-height: 1.2; }
.rstep small { font-size: 10px; color: var(--muted); }
.rstep.done { background: var(--green-soft); border-color: var(--green-soft); color: var(--green); }
.rstep.now { background: var(--warn-bg); border-color: var(--warn-bg); color: var(--warn-fg); font-weight: 700; }
.rarrow { color: var(--muted); }
a.chip { text-decoration: none; }
/* ラベル（画面の確認用と印刷用で同じ部品） */
.label-preview { padding: 8px; }
.label-cell { display: inline-block; vertical-align: top; overflow: hidden; box-sizing: border-box; }
.label { display: flex; gap: 1.5mm; align-items: center; height: 100%; padding: 1.2mm 1.5mm; box-sizing: border-box; }
.label-qr { flex: 0 0 auto; height: 100%; aspect-ratio: 1 / 1; }
.label-qr svg { width: 100%; height: 100%; display: block; }
.label-txt { min-width: 0; flex: 1; line-height: 1.15; color: #000; }
.label-co { font-size: 7pt; color: #333; }
.label-code { font-size: 11pt; font-weight: 800; letter-spacing: .03em; }
.label-name { font-size: 7pt; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
#label-print, #form-print { display: none; }
/* 物品購入申請書（紙）の印刷 */
/* 1枚に収める仕組み＝用紙の高さ 297mm に固定し、縦に並べた部品のうち「領収書の貼付欄」だけが余った高さを吸収する（内容が長いと貼付欄が縮む）。はみ出しは切る＝2枚目を作らない */
.pf { width: 210mm; height: 297mm; box-sizing: border-box; padding: 12mm 15mm 10mm; font-family: 'Yu Gothic UI', 'Meiryo', sans-serif; color: #000; font-size: 10.5pt; background: #fff; display: flex; flex-direction: column; overflow: hidden; page-break-after: avoid; break-after: avoid; page-break-inside: avoid; break-inside: avoid; }
.pf > * { flex: 0 0 auto; }
.pf-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid #000; padding-bottom: 3mm; margin-bottom: 5mm; }
.pf-head h1 { font-size: 20pt; margin: 0; letter-spacing: .1em; }
.pf-co { font-size: 10pt; }
.pf-no { text-align: right; font-size: 11pt; }
.pf-no small { font-size: 8pt; color: #333; }
.pf-kv { width: 100%; border-collapse: collapse; margin-bottom: 5mm; }
.pf-kv th, .pf-kv td { border: 1px solid #000; padding: 1.5mm 3mm; text-align: left; vertical-align: top; }
.pf-kv .pf-long { max-height: 22mm; overflow: hidden; }   /* 目的・備考が長くても 5行ほどで止める（全文は INO NAVI の画面で見る） */
.pf-kv th { width: 34mm; background: #f0f0f0; font-weight: 600; }
.pf-yen { font-size: 14pt; }
.pf-approve { width: 100%; border-collapse: collapse; margin-bottom: 5mm; table-layout: fixed; }
.pf-approve th { border: 1px solid #000; background: #f0f0f0; padding: 1.5mm; font-size: 9pt; font-weight: 600; }
.pf-approve td { border: 1px solid #000; height: 24mm; text-align: center; vertical-align: middle; padding: 1mm; }
.pf-stamp { height: 12mm; display: flex; align-items: center; justify-content: center; font-size: 12pt; font-weight: 700; color: #b00020; }
.pf-stamp.ok { border: 2px solid #b00020; border-radius: 50%; width: 12mm; margin: 0 auto; }
.pf-sig { font-size: 9.5pt; margin-top: 1mm; }
.pf-date { font-size: 8pt; color: #333; }
.pf-receipt { border: 1.5px dashed #000; flex: 1 1 60mm; min-height: 60mm; position: relative; margin-bottom: 4mm; }
.pf-receipt-label { position: absolute; top: 2mm; left: 3mm; font-size: 9pt; color: #555; }
.pf-foot { font-size: 9pt; border-top: 1px solid #000; padding-top: 2mm; }
@media print {
  @page { size: A4; margin: 0; }
  body.print-labels { background: #fff; }
  body.print-labels > *:not(#label-print) { display: none !important; }
  body.print-labels #label-print { display: block; }
  body.print-form { background: #fff; }
  body.print-form > *:not(#form-print) { display: none !important; }
  body.print-form #form-print { display: block; }
  body.print-form, body.print-form #form-print { margin: 0; padding: 0; height: auto; overflow: visible; }
  .label-sheet { width: 210mm; height: 297mm; box-sizing: border-box; page-break-after: always; break-after: page; font-family: "Yu Gothic UI", "Meiryo", sans-serif; }
  .label-sheet:last-child { page-break-after: auto; break-after: auto; }
  .label-cell { float: left; }
}
/* 申請の入口＝種類のカード（1列・縦に並べる） */
.menu-grid a.req-kind { grid-column: 1 / -1; flex-direction: column; align-items: flex-start; gap: 6px; }
.menu-grid a.req-kind .t { font-size: 1.05em; }
.menu-grid a.req-kind .muted { font-weight: 400; }
