/* ラクニ — 業務画面のスタイル
   日本語主体のため、行間は広め(1.7)、禁則は strict、和欧混植の字間を少し開ける。 */

/* 色はラクル合同会社の公式サイト(rakuru-llc.com)に合わせている。
   ブランドはオレンジ + 緑のアクセント。
   ただし業務画面は長時間見るものなので、明るいオレンジは面では使わず、
   ボタン・リンク・選択状態だけに使う。文字に使う方は白地で 4.5:1 を満たす濃さにしてある。 */
:root {
  --bg: #f7f5f2;
  --panel: #ffffff;
  --line: #e6e1da;
  --line-strong: #cdc5ba;
  --text: #23201c;
  --muted: #6a635a;
  --faint: #968f85;

  --brand: #ee7c00;        /* ロゴ・見出しの飾り。面や大きな文字に使う */
  --brand-deep: #b85e06;   /* ボタンの地・リンクの文字。白との対比 4.6:1 */
  --brand-hover: #9c4f04;
  --accent: var(--brand-deep);
  --accent-bg: #fdf1e4;
  --accent-line: #f3d3ae;

  --warn: #a35c00;
  --warn-bg: #fdf2e0;
  --danger: #b3261e;
  --danger-bg: #fdeceb;
  --ok: #4f7a28;           /* 公式サイトの下線マーカーの緑 */
  --ok-bg: #eff6e6;
  --radius: 6px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", "Yu Gothic Medium", "Meiryo", sans-serif;
  font-size: 14px;
  line-height: 1.7;
  letter-spacing: 0.02em;
  line-break: strict;
  word-break: normal;
  overflow-wrap: break-word;   /* 収まらない長い英数字だけ折る。日本語は禁則にまかせる */
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- ヘッダ ---------- */
header.top {
  background: var(--panel);
  color: var(--text);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 56px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(35,32,28,0.03);
}
/* 公式サイトのワードマークに合わせた組み方（太い大文字 + 下に社名） */
header.top .brand { line-height: 1.15; padding: 6px 0; }
header.top .brand b {
  display: block; color: var(--brand); font-weight: 800;
  font-size: 17px; letter-spacing: 0.08em;
}
header.top .brand span { display: block; color: var(--muted); font-size: 10px; letter-spacing: 0.08em; }
header.top nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
header.top nav a {
  color: var(--muted); padding: 8px 12px; font-size: 13px;
  border-bottom: 2px solid transparent;
}
header.top nav a:hover { color: var(--text); text-decoration: none; }
header.top nav a.on { color: var(--brand-deep); font-weight: 700; border-bottom-color: var(--brand); }
header.top .me { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 10px; }
header.top .me form { margin: 0; }
header.top .me button {
  background: #fff; border: 1px solid var(--line-strong); color: var(--muted);
  padding: 4px 10px; border-radius: var(--radius); cursor: pointer; font: inherit; font-size: 12px;
}
header.top .me button:hover { background: #f2efeb; }
header.top .rolechip {
  background: var(--accent-bg); color: var(--brand-deep); border: 1px solid var(--accent-line);
  border-radius: 10px; padding: 1px 9px; font-size: 11px; font-weight: 600; white-space: nowrap;
}

/* ---------- レイアウト ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 24px 20px 60px; }
h1 { font-size: 20px; margin: 0 0 4px; letter-spacing: 0.03em; }
h2 { font-size: 15px; margin: 0 0 12px; letter-spacing: 0.03em; }
.lead { color: var(--muted); font-size: 13px; margin: 0 0 20px; }

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px;
}
.panel > h2 { padding-bottom: 10px; border-bottom: 1px solid var(--line); }

.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.c4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 26px; font-weight: 700; line-height: 1.3; font-feature-settings: "tnum"; }
.stat.warn .v { color: var(--warn); }
.stat.danger .v { color: var(--danger); }

/* ---------- 表 ---------- */
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #faf8f5; color: var(--muted); font-weight: 600; white-space: nowrap; font-size: 12px; }
td:last-child { white-space: nowrap; }
td.num, th.num { text-align: right; font-feature-settings: "tnum"; white-space: nowrap; }
td.date { white-space: nowrap; font-feature-settings: "tnum"; }
tbody tr:hover { background: #fdfbf8; }
.empty { color: var(--faint); padding: 22px 4px; font-size: 13px; }

/* ---------- 定義リスト(詳細表示) ---------- */
dl.kv { display: grid; grid-template-columns: 160px 1fr; gap: 0; margin: 0; font-size: 13px; }
dl.kv dt { color: var(--muted); padding: 7px 10px 7px 0; border-bottom: 1px solid var(--line); }
dl.kv dd { margin: 0; padding: 7px 0; border-bottom: 1px solid var(--line); }
dl.kv dd:empty::after { content: "—"; color: var(--faint); }

/* ---------- バッジ ---------- */
.badge {
  display: inline-block; padding: 1px 8px; border-radius: 10px;
  font-size: 11px; line-height: 1.8; white-space: nowrap; border: 1px solid transparent;
}
.badge.info { background: var(--accent-bg); color: var(--brand-deep); border-color: var(--accent-line); }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: #eed6ac; }
.badge.danger { background: var(--danger-bg); color: var(--danger); border-color: #f2c4c1; }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: #cde3b4; }
.badge.plain { background: #f2efeb; color: var(--muted); border-color: var(--line); }

/* ---------- フォーム ---------- */
form.stack { display: grid; gap: 14px; }
.field { display: grid; gap: 4px; }
.field > label { font-size: 12px; color: var(--muted); font-weight: 600; }
.field .hint { font-size: 11px; color: var(--faint); }
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=number], select, textarea {
  font: inherit; font-size: 13px; padding: 8px 10px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: #fff; color: var(--text); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-bg); border-color: var(--accent); }
textarea { min-height: 78px; resize: vertical; }
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }

button, .btn {
  font: inherit; font-size: 13px; padding: 8px 18px; border-radius: var(--radius);
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
  cursor: pointer; display: inline-block; text-align: center;
  /* body の overflow-wrap:anywhere がボタン内の日本語まで折り返してしまうため打ち消す */
  white-space: nowrap; overflow-wrap: normal;
}
button:hover, .btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); text-decoration: none; }
button.sub, .btn.sub { background: #fff; color: var(--accent); }
button.sub:hover, .btn.sub:hover { background: var(--accent-bg); }
button.quiet, .btn.quiet { background: #fff; color: var(--muted); border-color: var(--line-strong); }
button.quiet:hover, .btn.quiet:hover { background: #f2efeb; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- 通知 ---------- */
.notice { padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; }
.notice.err { background: var(--danger-bg); color: var(--danger); border: 1px solid #f2c4c1; }
.notice.ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #cde3b4; }

.alertrow.escalated td:first-child { box-shadow: inset 3px 0 0 var(--danger); }

/* ---------- ログイン ---------- */
/* ---------- ログイン ---------- */
body.loginpage { background: var(--bg); }
.login { max-width: 400px; margin: 7vh auto 0; padding: 0 20px 40px; }
.login .mark { text-align: center; margin-bottom: 22px; }
.login .mark b {
  display: block; color: var(--brand); font-weight: 800;
  font-size: 34px; letter-spacing: 0.08em; line-height: 1.1;
}
.login .mark span { display: block; color: var(--muted); font-size: 12px; letter-spacing: 0.14em; margin-top: 4px; }
.login .mark i {
  display: block; width: 66px; height: 4px; margin: 12px auto 0;
  background: var(--ok); border-radius: 2px;
}
.login .panel { padding: 26px 24px; border-radius: 8px; }
.login h1 { font-size: 16px; margin-bottom: 2px; }
.login .lead { margin-bottom: 20px; font-size: 12px; }
.login button { width: 100%; padding: 11px; font-size: 14px; }
.login .foot {
  margin-top: 18px; text-align: center; color: var(--faint);
  font-size: 11px; line-height: 1.9;
}

/* ---------- スキャン ---------- */
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.shot {
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  aspect-ratio: 8 / 5; display: grid; place-items: center; background: #fdfbf8;
  color: var(--faint); font-size: 12px; overflow: hidden; position: relative;
}
.shot img { width: 100%; height: 100%; object-fit: contain; }
.shot input[type=file] { display: none; }
.shot label { position: absolute; inset: 0; display: grid; place-items: center; cursor: pointer; text-align: center; padding: 8px; }

footer.foot { color: var(--faint); font-size: 11px; text-align: center; padding: 24px 0 40px; }

@media (max-width: 600px) {
  dl.kv { grid-template-columns: 1fr; }
  dl.kv dt { border-bottom: none; padding-bottom: 0; }
  main { padding: 16px 12px 40px; }
}

/* ---------- 追加フォームは畳んでおく ----------
   常に出しっぱなしにすると、見るための画面なのか入れるための画面なのか分からなくなる。
   ボタンを押したときだけ開く。JSは使わない。 */
details.adder { margin-top: 18px; }
details.adder > summary {
  list-style: none; cursor: pointer; display: inline-block;
  font: inherit; font-size: 13px; padding: 8px 18px; border-radius: var(--radius);
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
  white-space: nowrap; user-select: none;
}
details.adder > summary::-webkit-details-marker { display: none; }
details.adder > summary::before { content: "＋ "; }
details.adder > summary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
details.adder[open] > summary { background: #fff; color: var(--muted); border-color: var(--line-strong); }
details.adder[open] > summary::before { content: "× "; }
details.adder[open] > summary:hover { background: #f2efeb; }
details.adder > .body { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }

/* 小さい方の折りたたみ（表の中で使う） */
details.mini > summary {
  list-style: none; cursor: pointer; display: inline-block;
  font-size: 12px; padding: 4px 12px; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: #fff; color: var(--muted); white-space: nowrap;
}
details.mini > summary::-webkit-details-marker { display: none; }
details.mini > summary:hover { background: #f2efeb; }
details.mini > .body { margin-top: 8px; }

/* ---------- 対象者ごとのまとまり ---------- */
details.group {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); margin-bottom: 10px; overflow: hidden;
}
details.group > summary {
  list-style: none; cursor: pointer; padding: 12px 16px;
  display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap;
}
details.group > summary::-webkit-details-marker { display: none; }
details.group > summary::before { content: "▸"; color: var(--faint); font-size: 11px; }
details.group[open] > summary::before { content: "▾"; }
details.group > summary:hover { background: #faf8f5; }
details.group .gname { font-weight: 700; font-size: 14px; }
details.group .gmeta { color: var(--muted); font-size: 12px; }
details.group .gcount { margin-left: auto; color: var(--muted); font-size: 12px; }
details.group .gbody { border-top: 1px solid var(--line); }
details.group .gbody table { font-size: 13px; }
details.group .gbody th { background: #faf8f5; }
details.group.overdue { border-color: #e8b4b0; }
details.group.overdue > summary { background: var(--danger-bg); }

/* 誰の話なのかを最初に読ませる */
.who { font-weight: 600; }
.who a { color: var(--text); }
.who a:hover { color: var(--accent); }
.subtle { color: var(--muted); font-size: 12px; }

/* ---------- 求職者むけ（大きく・少なく） ---------- */
.big-list { display: grid; gap: 10px; }
.big-item {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  padding: 16px 18px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
}
.big-item .t { font-size: 15px; font-weight: 600; flex: 1; min-width: 200px; }
.big-item .d { font-size: 13px; color: var(--muted); font-feature-settings: "tnum"; white-space: nowrap; }
.big-item.warn { border-color: #eed6ac; background: var(--warn-bg); }
.big-item.danger { border-color: #f2c4c1; background: var(--danger-bg); }
.due-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.due-card .k { font-size: 12px; color: var(--muted); }
.due-card .v { font-size: 20px; font-weight: 700; font-feature-settings: "tnum"; line-height: 1.5; }
.due-card .r { font-size: 12px; }
.due-card.warn { border-color: #eed6ac; }
.due-card.warn .v { color: var(--warn); }
.due-card.danger { border-color: #f2c4c1; }
.due-card.danger .v { color: var(--danger); }

/* ブラウザの自動入力で青くならないようにする（Chrome/Safari） */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  caret-color: var(--text);
  transition: background-color 9999s ease-out 0s;
}

/* 通知の表: 誰の話かが折り返しで潰れないだけの幅を持たせる */
.alertrow td:first-child { min-width: 160px; }
.alertrow td:nth-child(3) { min-width: 130px; }
.alertrow td:nth-child(4) { min-width: 130px; }

/* ---------- カレンダー ----------
   1画面で1か月ぶんが見渡せることを優先する。縦に伸ばさない。 */
.calbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px;
}
.calbar .ym { font-size: 17px; font-weight: 700; font-feature-settings: "tnum"; min-width: 130px; }
.calbar .nav { display: flex; gap: 6px; }
.calbar .nav a {
  border: 1px solid var(--line-strong); background: #fff; color: var(--muted);
  border-radius: var(--radius); padding: 5px 11px; font-size: 13px; white-space: nowrap;
}
.calbar .nav a:hover { background: #f2efeb; text-decoration: none; }
.calbar .nav a.now { border-color: var(--brand-deep); color: var(--brand-deep); font-weight: 600; }

.legend { display: flex; gap: 13px; flex-wrap: wrap; font-size: 11px; color: var(--muted); margin-left: auto; }
.legend span { white-space: nowrap; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; vertical-align: 0; }

.cal { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.cal table { table-layout: fixed; width: 100%; border-collapse: collapse; }
.cal th {
  text-align: center; padding: 7px 0; font-size: 12px; font-weight: 600;
  background: #faf8f5; border-bottom: 1px solid var(--line); color: var(--muted);
}
.cal th.sun { color: #b3261e; }
.cal th.sat { color: #1f6f9e; }
.cal td {
  border: 1px solid var(--line); vertical-align: top; height: 96px; padding: 3px 4px 5px;
  overflow: hidden;
}
.cal td.out { background: #faf8f5; }
.cal td.sun { background: #fefafa; }
.cal td.sat { background: #fafcfe; }
.cal td.out.sun, .cal td.out.sat { background: #faf8f5; }
.cal td.today { box-shadow: inset 0 0 0 2px var(--brand); background: #fff8ef; }
.cal .dnum { font-size: 12px; font-feature-settings: "tnum"; color: var(--muted); padding: 0 2px; }
.cal td.out .dnum { color: #c3bcb2; }
.cal td.today .dnum { color: var(--brand-deep); font-weight: 700; }
.cal .chip {
  display: block; font-size: 11px; line-height: 1.55; padding: 1px 4px 1px 5px;
  border-radius: 3px; margin-top: 2px; background: #f4f1ec;
  border-left: 3px solid var(--c, var(--line-strong)); color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal .chip:hover { background: #e9e4dc; text-decoration: none; }
.cal .chip b { font-weight: 600; }
.cal .more { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; padding-left: 5px; }
.cal .more:hover { color: var(--brand-deep); }

/* 1画面に収めるための入れ物。中だけスクロールさせて、ページ自体は伸ばさない。 */
.scrollbox { max-height: 300px; overflow-y: auto; }
.scrollbox table { font-size: 12.5px; }
.panel.tight { padding: 14px 16px; }
.panel.tight > h2 { padding-bottom: 8px; margin-bottom: 10px; }
.grid.c4.compact .stat { padding: 10px 14px; }
.grid.c4.compact .stat .v { font-size: 22px; }

.daylist { display: grid; gap: 0; }
.daylist .d {
  display: flex; gap: 10px; align-items: baseline; padding: 6px 2px;
  border-bottom: 1px solid var(--line); font-size: 13px;
}
.daylist .d:last-child { border-bottom: none; }
.daylist .d .dt {
  width: 82px; flex: none; color: var(--muted); font-size: 12px;
  font-feature-settings: "tnum"; white-space: nowrap;
}
.daylist .d.is-today .dt { color: var(--brand-deep); font-weight: 700; }
.daylist .d .bd { flex: 1; min-width: 0; }
.daylist .d .tag {
  display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 0;
}

/* ---------- スキャン ---------- */
.scanstatus { color: var(--muted); font-size: 13px; }
.scanstatus.busy::after {
  content: ""; display: inline-block; width: 10px; height: 10px; margin-left: 8px;
  border: 2px solid var(--line-strong); border-top-color: var(--brand);
  border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -1px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.shot.filled { border-style: solid; background: #fff; }
.shot .retake {
  position: absolute; right: 6px; bottom: 6px; padding: 3px 10px; font-size: 11px;
  background: rgba(255,255,255,0.94); color: var(--muted); border: 1px solid var(--line-strong);
}
.shot .retake:hover { background: #fff; }
.facewrap { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.facewrap img {
  width: 76px; height: 96px; object-fit: cover;
  border: 1px solid var(--line); border-radius: 4px; background: #fff;
}
.facethumb {
  width: 30px; height: 38px; object-fit: cover;
  border: 1px solid var(--line); border-radius: 3px; vertical-align: middle;
}

/* ---------- 画面幅への対応 ---------- */
.narrowonly { display: none; }

@media (max-width: 820px) {
  header.top { gap: 10px; padding: 0 14px; min-height: 0; padding-bottom: 0; }
  header.top .brand { padding: 8px 0 4px; }
  header.top nav {
    /* flex:1 が残っていると横に並んでしまうので、基準幅ごと上書きする */
    order: 3; flex: 0 0 100%; flex-wrap: nowrap; overflow-x: auto;
    border-top: 1px solid var(--line); margin: 0 -14px; padding: 0 14px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  header.top nav::-webkit-scrollbar { display: none; }
  header.top nav a { padding: 9px 11px; white-space: nowrap; }
  header.top .me { margin-left: auto; }
  main { padding: 16px 14px 48px; }
}

@media (max-width: 760px) {
  /* カレンダーのマス目は狭い画面だと読めないので、日付ごとの一覧に切り替える */
  .wideonly { display: none; }
  .narrowonly { display: block; }
  .calbar .ym { font-size: 16px; min-width: 0; }
  .calbar .nav { width: 100%; }
  .calbar .nav a { flex: 1; text-align: center; padding: 7px 6px; }
  .legend { margin-left: 0; width: 100%; gap: 10px; }
  .scrollbox { max-height: none; }
}

@media (max-width: 620px) {
  h1 { font-size: 18px; }
  .panel { padding: 14px 14px; }
  .shots { grid-template-columns: 1fr; }
  .shot { aspect-ratio: 3 / 2; }
  .grid.c4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 10px 12px; }
  .stat .k { font-size: 11px; }
  .stat .v { font-size: 20px; }
  .actions { gap: 8px; }
  .actions > form, .actions > button, .actions > .btn { flex: 1 1 auto; }
  details.adder > summary { display: block; text-align: center; }
  .daylist .d { display: block; }
  .daylist .d .dt { width: auto; margin-bottom: 3px; font-weight: 600; }
  table { font-size: 12.5px; }
  th, td { padding: 8px 8px; }
  .facewrap img { width: 64px; height: 80px; }
  header.top .brand b { font-size: 15px; }
  header.top .me span:not(.rolechip) { display: none; }
  footer.foot { padding: 20px 12px 32px; }
}

@media (max-width: 420px) {
  .login { padding: 0 14px 32px; }
  .login .mark b { font-size: 28px; }
}

/* 在留カード・パスポート・指定書がそろっているかの一覧 */
.doccheck { display: grid; gap: 8px; margin-bottom: 16px; }
.dc {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 9px 13px; background: #fdfbf8; font-size: 13px;
}
.dc.got { background: var(--ok-bg); border-color: #cde3b4; }
.dc .mark { width: 18px; text-align: center; color: var(--faint); font-weight: 700; }
.dc.got .mark { color: var(--ok); }
.dc .nm { font-weight: 600; min-width: 92px; }
.dc .btn { margin-left: auto; padding: 4px 14px; font-size: 12px; }
@media (min-width: 620px) { .doccheck { grid-template-columns: repeat(3, 1fr); } .dc .btn { margin-left: 0; } }

/* ---------- タブ ----------
   縦に長い画面を分ける。JSは使わずラジオで切り替える。 */
.tabs > input[type=radio] {
  position: absolute; width: 1px; height: 1px; opacity: 0;
  clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden;
}
.tabs > label {
  display: inline-block; padding: 8px 16px; font-size: 13px; cursor: pointer;
  color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: 14px;
  user-select: none;
}
.tabs > label:hover { color: var(--text); }
.tabs > .tabpanes > section { display: none; }
.tabs > input:nth-of-type(1):checked ~ .tabpanes > section:nth-of-type(1),
.tabs > input:nth-of-type(2):checked ~ .tabpanes > section:nth-of-type(2),
.tabs > input:nth-of-type(3):checked ~ .tabpanes > section:nth-of-type(3),
.tabs > input:nth-of-type(4):checked ~ .tabpanes > section:nth-of-type(4) { display: block; }
.tabs > input:nth-of-type(1):checked ~ label:nth-of-type(1),
.tabs > input:nth-of-type(2):checked ~ label:nth-of-type(2),
.tabs > input:nth-of-type(3):checked ~ label:nth-of-type(3),
.tabs > input:nth-of-type(4):checked ~ label:nth-of-type(4) {
  color: var(--brand-deep); font-weight: 700; border-bottom-color: var(--brand);
}
/* キーボードで移動したときに、どのタブにいるか分かるようにする */
.tabs > input:focus-visible + label { outline: 2px solid var(--accent-line); outline-offset: 2px; }

@media (max-width: 620px) {
  .tabs > label { padding: 8px 10px; font-size: 12.5px; }
}

/* 表は狭い画面だと列が潰れて1文字ずつ折り返される。最低幅を持たせて横に流す。 */
@media (max-width: 620px) {
  .tablewrap { -webkit-overflow-scrolling: touch; }
  .tablewrap table { min-width: 540px; }
  .scrollbox .tablewrap table { min-width: 480px; }
  td, th { word-break: normal; overflow-wrap: normal; }
  /* 横に流れていることが分かるように、右端に影を出す */
  .tablewrap {
    background:
      linear-gradient(to right, var(--panel) 30%, rgba(255,255,255,0)) left / 24px 100% no-repeat,
      linear-gradient(to left, var(--panel) 30%, rgba(255,255,255,0)) right / 24px 100% no-repeat,
      radial-gradient(farthest-side at 0 50%, rgba(35,32,28,.10), rgba(0,0,0,0)) left / 10px 100% no-repeat,
      radial-gradient(farthest-side at 100% 50%, rgba(35,32,28,.10), rgba(0,0,0,0)) right / 10px 100% no-repeat;
    background-attachment: local, local, scroll, scroll;
  }
}
