/* 本当の実質時給計算機
 *
 * ゆめかわパステル。地は「さくら白」の紙、時間の分類はマステみたいな6色。
 * 色は :root のトークンに集約してある。グラフもJS側からこのトークンを読むので、
 * 増やしたり変えたりするときはここだけ直せばよい。
 * コントラストは本文4.5:1以上を満たす値に調整済み（薄いピンクの上でも読める）。
 */

@font-face {
  font-family: 'M PLUS Rounded 1c';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/MPLUSRounded1c-400.subset.woff2') format('woff2');
}
@font-face {
  font-family: 'M PLUS Rounded 1c';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/MPLUSRounded1c-800.subset.woff2') format('woff2');
}

/* ---------------- トークン ---------------- */

:root {
  color-scheme: light dark;

  --paper:    #ffffff;   /* まっしろ */
  --panel:    #ffffff;
  --panel-2:  #fdf2f6;   /* シールの見出しだけ、ほんのり桜 */
  --slot:     #f6f6f8;   /* 入力欄の内側 */
  --rule:     #e8e8ec;
  --rule-hi:  #d6d6dd;

  --ink:      #2b2b31;   /* 無彩色の墨。紫を混ぜない */
  --ink-dim:  #5c5c66;
  --ink-faint:#75757f;

  --accent:      #ff8fa8; /* ピーチ */
  --accent-ink:  #bc3a5e; /* 文字に使える濃いピーチ */
  --accent-soft: #ffe3ea;

  --warn:     #c23350;
  --warn-bg:  #ffeff2;
  --ok:       #2e8060;
  --ok-bg:    #eaf7f1;

  /* 時間の6分類 — マステの色 */
  --c-paid:     #8fd9c4;  /* ミント */
  --c-commute:  #ffa6c1;  /* さくら */
  --c-prep:     #be9ce8;  /* ラベンダー */
  --c-unpaid:   #ffd98a;  /* レモン */
  --c-recovery: #9fd3f0;  /* あきぞら */
  --c-other:    #ffb894;  /* あんず */

  /* 文字に使える濃い版 */
  --c-paid-ink:    #2a7561;
  --c-commute-ink: #b93a5f;

  /* 明細の判定色。文字色として使うので鮮やかめ */
  --lv-safe:   #00a04a;
  --lv-warn:   #d18700;
  --lv-danger: #ff0000;

  --on-pastel:   #1f1f24;  /* パステルの帯の上に載せる文字 */
  --surface-bar: #dcdce2;  /* 表面時給のバー（中立） */

  --r-panel: 16px;
  --r-box:   10px;
  --r-pill:  999px;

  --sans: 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', 'HG丸ｺﾞｼｯｸM-PRO',
          'UD デジタル 教科書体 NK-R', 'Yu Gothic UI', Meiryo, sans-serif;
  --num:  'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:    #16181c;   /* ニュートラルな炭。紫を混ぜない */
    --panel:    #1e2026;
    --panel-2:  #262930;
    --slot:     #101216;
    --rule:     #2c2f36;
    --rule-hi:  #3d4149;

    --ink:      #f2f3f5;
    --ink-dim:  #c2c4c9;
    --ink-faint:#a0a2a9;

    --accent:      #ff9bb4;
    --accent-ink:  #ffb3c6;
    --accent-soft: #3a2730;

    --warn:     #ff8296;
    --warn-bg:  #3a2130;
    --ok:       #7fd6ae;
    --ok-bg:    #1f3a30;

    --c-paid:     #7acbb4;
    --c-commute:  #ff9bba;
    --c-prep:     #b79ce8;
    --c-unpaid:   #f5d083;
    --c-recovery: #93cbee;
    --c-other:    #ffae8a;

    --c-paid-ink:    #8fd9c4;
    --c-commute-ink: #ffa6c1;

    --lv-safe:   #2be08a;
    --lv-warn:   #ffc53d;
    --lv-danger: #ff3b3b;

    --on-pastel:   #14161a;
    --surface-bar: #3a3d45;
  }
}

/* 閲覧者がテーマを切り替えたときは、こちらが必ず勝つ */
:root[data-theme="dark"] {
  --paper: #16181c; --panel: #1e2026; --panel-2: #262930; --slot: #101216;
  --rule: #2c2f36; --rule-hi: #3d4149;
  --ink: #f2f3f5; --ink-dim: #c2c4c9; --ink-faint: #a0a2a9;
  --accent: #ff9bb4; --accent-ink: #ffb3c6; --accent-soft: #3a2730;
  --warn: #ff8296; --warn-bg: #3a2130; --ok: #7fd6ae; --ok-bg: #1f3a30;
  --c-paid: #7acbb4; --c-commute: #ff9bba; --c-prep: #b79ce8;
  --c-unpaid: #f5d083; --c-recovery: #93cbee; --c-other: #ffae8a;
  --c-paid-ink: #8fd9c4; --c-commute-ink: #ffa6c1;
  --lv-safe: #2be08a; --lv-warn: #ffc53d; --lv-danger: #ff3b3b;
  --on-pastel: #14161a; --surface-bar: #3a3d45;
}
:root[data-theme="light"] {
  --paper: #ffffff; --panel: #ffffff; --panel-2: #fdf2f6; --slot: #f6f6f8;
  --rule: #e8e8ec; --rule-hi: #d6d6dd;
  --ink: #2b2b31; --ink-dim: #5c5c66; --ink-faint: #75757f;
  --accent: #ff8fa8; --accent-ink: #bc3a5e; --accent-soft: #ffe3ea;
  --warn: #c23350; --warn-bg: #ffeff2; --ok: #2e8060; --ok-bg: #eaf7f1;
  --c-paid: #8fd9c4; --c-commute: #ffa6c1; --c-prep: #be9ce8;
  --c-unpaid: #ffd98a; --c-recovery: #9fd3f0; --c-other: #ffb894;
  --c-paid-ink: #2a7561; --c-commute-ink: #b93a5f;
  --lv-safe: #00a04a; --lv-warn: #d18700; --lv-danger: #ff0000;
  --on-pastel: #1f1f24; --surface-bar: #dcdce2;
}

/* ---------------- 土台 ---------------- */

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  padding: 0 0 64px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

.wrap { max-width: 1320px; margin: 0 auto; padding: 0 16px; }

:where(a, button, input, select, summary):focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------------- ヘッダ ---------------- */

.head { background: var(--panel); border-bottom: 2px solid var(--rule); margin-bottom: 18px; }
.head-in { max-width: 1320px; margin: 0 auto; padding: 20px 16px 18px; }

.head h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: .01em;
  text-wrap: balance;
  display: flex;
  align-items: center;
  gap: 10px;
}
.head h1::before {
  content: "";
  width: 16px; height: 16px;
  border-radius: var(--r-pill);
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  flex: 0 0 auto;
}
.head p { margin: 10px 0 0; color: var(--ink-dim); font-size: 13px; max-width: 62ch; }

/* ---------------- 共通設定バー ---------------- */

.bar {
  border: 2px solid var(--rule);
  border-radius: var(--r-panel);
  background: var(--panel);
  padding: 14px 16px 16px;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px 22px;
}

.bar-title {
  width: 100%;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 2px;
}

.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 13px; font-weight: 800; color: var(--ink); }
.field > span small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-faint);
}

.seg { display: flex; gap: 6px; }
.seg button {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 800;
  background: var(--slot);
  color: var(--ink-dim);
  border: 2px solid var(--rule);
  border-radius: var(--r-pill);
  padding: 7px 16px;
  cursor: pointer;
}
.seg button:hover { border-color: var(--accent); color: var(--ink); }
.seg button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 800;
  background: var(--panel);
  color: var(--accent-ink);
  border: 2px solid var(--accent);
  border-radius: var(--r-pill);
  padding: 7px 16px;
  cursor: pointer;
  white-space: nowrap;   /* ピルの途中で改行させない */
}
.btn:hover { background: var(--accent-soft); }
.btn:active { transform: translateY(1px); }
.btn.small { font-size: 12px; padding: 5px 13px; }

.inrow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.unit { font-size: 12px; color: var(--ink-faint); flex: 0 0 auto; }

input[type="number"], input[type="text"], select {
  font-family: var(--num);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  background: var(--slot);
  color: var(--ink);
  border: 2px solid var(--rule);
  border-radius: var(--r-box);
  padding: 7px 10px;
  width: 84px;
  text-align: right;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--panel);
}
input.wide { width: 116px; }

input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

/* ---------------- A / B の2列 ---------------- */

.jobs, .results { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
body.mode-single .jobs,
body.mode-single .results { grid-template-columns: 1fr; }
body.mode-single .job-b,
body.mode-single .res-b { display: none; }
/* 単独モードでは「くらべた結果」だけ消す。円グラフの箱は .compare を共有しているので id で指す */
body.mode-single #compare { display: none; }

/* ---- 画面の切り替え（入力 ⇄ 結果） ---- */

.gobar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 22px 0 8px;
}
.gobar.top { align-items: flex-start; margin: 0 0 16px; }

/* 入力を書き終えたところで「くらべる？」と聞く */
.modeask {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  border: 2px solid var(--rule);
  border-radius: var(--r-panel);
  background: var(--panel);
  padding: 16px;
  margin-top: 4px;
}
.modeask-q { font-size: 15px; font-weight: 800; color: var(--ink); }
.modeask .ref { flex: 1 0 100%; margin: 0; text-align: center; }

/* 入替は2つ並べているときだけ意味がある */
body.mode-single #btnSwap { display: none; }

.btn.go {
  font-size: 18px;
  padding: 15px 48px;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.go:hover { background: var(--accent-ink); border-color: var(--accent-ink); }

/* ---- シフトの行 ---- */

.shiftrow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  padding: 8px 10px;
  margin-bottom: 6px;
  background: var(--slot);
  border-radius: var(--r-box);
}
.shiftlab { font-size: 13.5px; font-weight: 800; color: var(--ink); white-space: nowrap; }
.shiftno {
  font-family: var(--num);
  font-weight: 800;
  font-size: 12px;
  color: var(--accent-ink);
  min-width: 12px;
}
.shiftrow input[type="number"] { background: var(--panel); }
.shiftrow .segdel { margin-left: auto; }

/* ---- 例から選ぶ ---- */

select.preset {
  flex: 1 1 auto;
  min-width: 140px;
  width: auto;
  text-align: left;
  font-family: var(--sans);
  font-size: 13.5px;
}

/* ---- 年間の円グラフ ---- */

.donutwrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 30px;
}
.donutwrap > div { flex: 0 1 260px; }
.donutwrap svg { display: block; width: 100%; height: auto; }
.donutwrap > div[hidden] { display: none; }

.donutbox { margin-bottom: 16px; }

.job {
  border: 2px solid var(--rule);
  border-radius: var(--r-panel);
  background: var(--panel);
  overflow: hidden;
}

.job-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--panel-2);
  border-bottom: 2px solid var(--rule);
}

.badge {
  font-family: var(--num);
  font-weight: 800;
  font-size: 14px;
  width: 28px; height: 28px;
  line-height: 26px;
  text-align: center;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: #fff;
  flex: 0 0 auto;
}

.job-head h2 { margin: 0; font-size: 16px; font-weight: 800; }

/* input[type="text"] の一括指定と詳細度が並ぶよう、要素名まで書く */
input.jobname {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 800;
  text-align: left;
  background: transparent;
  border: 2px solid transparent;
  border-radius: var(--r-box);
  color: var(--ink);
  padding: 4px 8px;
  width: 100%;
  min-width: 0;
}
input.jobname:hover { border-color: var(--rule-hi); }
input.jobname:focus { background: var(--panel); border-color: var(--accent); }

/* ---------------- セクション ---------------- */

.sec { padding: 14px; border-bottom: 2px solid var(--rule); }
.sec:last-child { border-bottom: 0; }

/* 見出しはシールみたいなピル */
.sec-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 800;
}
.sec-title > span:first-child {
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-radius: var(--r-pill);
  padding: 5px 14px;
}

.grp-total {
  font-family: var(--num);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 800;
  color: var(--c-commute-ink);
  white-space: nowrap;
}

/* ---------------- 大きな質問ブロック ---------------- */

.q {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--rule);
}
.q:last-child { border-bottom: 0; }
.q.off { display: none; }

.q-l { font-size: 16px; font-weight: 800; color: var(--ink); line-height: 1.4; }
.q-l i { font-style: normal; color: var(--ink-faint); margin-left: 1px; }

.q-in { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.q-in input { font-size: 16px; padding: 8px 11px; width: 122px; }

.q-hint {
  flex: 1 0 100%;
  margin: 0;
  font-size: 12px;
  color: var(--ink-faint);
  line-height: 1.6;
}

.q-lead { margin: 0 0 11px; font-size: 13px; color: var(--ink-dim); line-height: 1.7; }

.hmpair { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.hmpair input { width: 74px; }

.modesel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 0 0 12px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}
.modesel label { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.modesel input { width: auto; accent-color: var(--accent); }

/* ---------------- チェックリスト ---------------- */

.chk {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 9px 12px;
  margin-bottom: 5px;
  border: 2px solid transparent;
  border-radius: var(--r-box);
  background: var(--slot);
  cursor: pointer;
}
.chk:hover { border-color: var(--rule-hi); }
.chk.on { background: var(--accent-soft); border-color: var(--accent); }
.chk.on .chk-l > span { color: var(--ink); font-weight: 800; }

.chk input[type="checkbox"] {
  width: 19px; height: 19px;
  margin: 1px 0 0;
  flex: 0 0 auto;
  accent-color: var(--accent);
  cursor: pointer;
  border-radius: var(--r-pill);
}

.chk-l { flex: 1 1 auto; min-width: 0; font-size: 14px; color: var(--ink-dim); line-height: 1.5; }
.chk-l small { display: block; font-size: 11px; color: var(--ink-faint); }

.chk-in {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 5px;
  visibility: hidden;
  cursor: default;
}
.chk.on .chk-in { visibility: visible; }
.chk-in input { width: 74px; background: var(--panel); }

/* ---------------- 通勤の区間 ---------------- */

.segrow { display: flex; align-items: center; gap: 6px; padding: 5px 0; }
.segrow select {
  font-family: var(--sans);
  font-size: 13px;
  text-align: left;
  width: auto;
  padding: 7px 8px;
  flex: 0 0 auto;
}
.segrow input.memo {
  flex: 1 1 auto;
  min-width: 60px;
  width: auto;
  text-align: left;
  font-family: var(--sans);
  font-size: 13px;
}
.segrow input[type="number"] { width: 74px; flex: 0 0 auto; }

.segdel {
  flex: 0 0 auto;
  background: var(--panel);
  border: 2px solid var(--rule);
  border-radius: var(--r-pill);
  color: var(--ink-faint);
  font-size: 14px;
  line-height: 1;
  width: 30px; height: 30px;
  cursor: pointer;
}
.segdel:hover { border-color: var(--warn); color: var(--warn); }

.segfoot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* ---------------- 結果 ---------------- */

.res { padding: 14px; }

.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }

.hero > div {
  background: var(--panel-2);
  border: 2px solid var(--rule);
  border-radius: var(--r-box);
  padding: 12px 14px;
}

.hero .k { font-size: 12px; font-weight: 800; color: var(--ink-dim); }

.hero .v {
  font-family: var(--num);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 30px;
  line-height: 1.2;
  margin-top: 4px;
  color: var(--ink);
  word-break: break-all;
}
.hero .v small { font-size: 13px; margin-left: 3px; color: var(--ink-dim); }
.hero .v.amber { color: var(--c-commute-ink); }
.hero .v.steel { color: var(--c-paid-ink); }
.hero .sub { font-size: 11.5px; color: var(--ink-faint); margin-top: 5px; line-height: 1.55; }

/* 明細テーブル */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { border-bottom: 1px solid var(--rule); padding: 7px 8px; font-size: 13px; }
.tbl th { text-align: left; font-weight: 400; color: var(--ink-dim); }
.tbl td {
  text-align: right;
  font-family: var(--num);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}
.tbl tr:last-child th, .tbl tr:last-child td { border-bottom: 0; }

.note {
  font-size: 13px;
  color: var(--ink-dim);
  line-height: 1.85;
  background: var(--slot);
  border-radius: var(--r-box);
  padding: 11px 14px;
  margin: 12px 0 0;
}
.note b { color: var(--ink); font-weight: 800; }
.note .amber { color: var(--c-commute-ink); }

.warn {
  border: 2px solid var(--warn);
  border-radius: var(--r-box);
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 13px;
  font-weight: 800;
  padding: 9px 12px;
  margin: 0 0 12px;
}
.warn:empty { display: none; }

.ref { font-size: 11.5px; color: var(--ink-faint); margin-top: 6px; line-height: 1.6; }

/* ---------------- グラフ ---------------- */

.chart { margin-top: 18px; }

.chart-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-dim);
  margin-bottom: 10px;
}
.chart-title::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: var(--r-pill);
  background: var(--accent);
  flex: 0 0 auto;
}

.chart svg { display: block; width: 100%; height: auto; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-dim);
}
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i, .sw {
  width: 12px; height: 12px;
  border-radius: 4px;
  display: inline-block;
  flex: 0 0 auto;
}
.legend em { font-style: normal; font-family: var(--num); color: var(--ink-faint); }

/* 凡例の色チップ（HTMLに色を直書きしない） */
.sw-paid     { background: var(--c-paid); }
.sw-commute  { background: var(--c-commute); }
.sw-prep     { background: var(--c-prep); }
.sw-unpaid   { background: var(--c-unpaid); }
.sw-recovery { background: var(--c-recovery); }
.sw-other    { background: var(--c-other); }

/* ---------------- 比較サマリー ---------------- */

.compare {
  border: 2px solid var(--rule);
  border-radius: var(--r-panel);
  background: var(--panel);
  overflow: hidden;
}
.compare > .sec-title {
  margin: 0;
  padding: 12px 14px;
  background: var(--panel-2);
  border-bottom: 2px solid var(--rule);
}
.cmp-body { padding: 14px; }

/* 横に長い表は、それ自身の中でだけ横スクロールさせる */
.scroll-x { overflow-x: auto; margin-bottom: 16px; }
.scroll-x .cmp-tbl { margin-bottom: 0; min-width: 400px; }

.cmp-tbl { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.cmp-tbl th, .cmp-tbl td {
  border-bottom: 1px solid var(--rule);
  padding: 8px 10px;
  font-size: 13px;
  white-space: nowrap;
}
.cmp-tbl thead th {
  color: var(--accent-ink);
  font-weight: 800;
  border-bottom: 2px solid var(--rule-hi);
}
.cmp-tbl tbody th { text-align: left; font-weight: 400; color: var(--ink-dim); width: 34%; }
.cmp-tbl td {
  text-align: right;
  font-family: var(--num);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  width: 33%;
}

.big {
  border: 2px solid var(--rule);
  border-radius: var(--r-box);
  background: var(--panel-2);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.big .k { font-size: 12.5px; font-weight: 800; color: var(--ink-dim); }
.big .v {
  font-family: var(--num);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 36px;
  line-height: 1.2;
  margin-top: 4px;
  color: var(--c-commute-ink);
  word-break: break-all;
}
.big .v small { font-size: 14px; color: var(--ink-dim); margin-left: 4px; }
.big .conv { font-size: 12px; color: var(--ink-faint); margin-top: 8px; line-height: 1.8; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------------- セルフテスト(test.html) ---------------- */

.tt { width: 100%; border-collapse: collapse; font-size: 13px; }
.tt th, .tt td { border-bottom: 1px solid var(--rule); padding: 7px 10px; text-align: left; }
.tt thead th { color: var(--ink-dim); font-weight: 800; border-bottom: 2px solid var(--rule-hi); }
.tt td.mono { font-family: var(--num); font-variant-numeric: tabular-nums; }
.tt td.st { width: 66px; font-family: var(--num); font-weight: 800; }
.tt tr.pass td.st { color: var(--ok); }
.tt tr.fail td.st { color: var(--warn); }
.tt tr.fail { background: var(--warn-bg); }
.tt tr.grp th {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 800;
  border-bottom: 2px solid var(--rule-hi);
}

.summary {
  border: 2px solid var(--rule);
  border-radius: var(--r-box);
  background: var(--panel);
  padding: 14px 16px;
  margin-bottom: 16px;
  font-family: var(--num);
  font-weight: 800;
  font-size: 20px;
}
.summary.ok { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.summary.ng { background: var(--warn-bg); border-color: var(--warn); color: var(--warn); }

/* ---------------- 狭い画面 ---------------- */

@media (max-width: 940px) {
  .jobs { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .head h1 { font-size: 21px; }
  .hero { grid-template-columns: 1fr; }
  .hero .v { font-size: 26px; }
  .big .v { font-size: 28px; }
  .q-l { font-size: 15px; flex: 1 0 100%; }
  .q-in input { width: 108px; }
  .cmp-tbl tbody th { width: 44%; }
  .segrow { flex-wrap: wrap; }
  .segrow input.memo { flex: 1 0 100%; order: 3; }
  .segdel { order: 2; margin-left: auto; }
}

/* ================= 診断結果まわり ================= */

/* ---- 判定カード ---- */

.verdicts { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 16px; }
body.mode-compare .verdicts { grid-template-columns: 1fr 1fr; }

.verdict-card {
  border: 3px solid var(--rule-hi);
  border-radius: var(--r-panel);
  background: var(--panel);
  overflow: hidden;
}
.verdict-card.tier-white  { border-color: var(--c-paid); }
.verdict-card.tier-normal { border-color: var(--c-recovery); }
.verdict-card.tier-black  { border-color: var(--c-unpaid); }
.verdict-card.tier-doom   { border-color: var(--warn); }

.verdict-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--panel-2);
  border-bottom: 2px solid var(--rule);
}
.verdict-badge {
  font-family: var(--num); font-weight: 800; font-size: 13px;
  width: 26px; height: 26px; line-height: 24px; text-align: center;
  border-radius: var(--r-pill); background: var(--accent); color: #fff; flex: 0 0 auto;
}
.verdict-name { font-size: 16px; font-weight: 800; }

.verdict-main {
  display: flex; align-items: center; gap: 16px;
  flex-wrap: wrap; padding: 18px 16px 6px;
}
.verdict-figs { display: flex; align-items: flex-end; gap: 6px; flex: 0 0 auto; }
.verdict-figs img { width: 128px; height: auto; display: block; }
.verdict-figs img.reaper { width: 96px; }
.verdict-figs img[hidden] { display: none; }

.verdict-nums { flex: 1 1 220px; min-width: 0; }
.verdict-tier { font-size: 20px; font-weight: 800; letter-spacing: .02em; }
.tier-white  .verdict-tier { color: var(--c-paid-ink); }
.tier-normal .verdict-tier { color: var(--ink); }
.tier-black  .verdict-tier { color: var(--lv-warn); }
.tier-doom   .verdict-tier { color: var(--warn); }

.verdict-wage {
  font-family: var(--num); font-variant-numeric: tabular-nums;
  font-weight: 800; font-size: 46px; line-height: 1.1;
  color: var(--c-commute-ink); word-break: break-all; margin-top: 2px;
}
.verdict-wage small { font-size: 16px; color: var(--ink-dim); margin-left: 3px; }
.verdict-sub { font-size: 12px; color: var(--ink-faint); }

.verdict-bar {
  height: 14px; border-radius: var(--r-pill);
  background: var(--c-commute); margin-top: 10px; overflow: hidden;
}
.verdict-bar > span { display: block; height: 100%; background: var(--c-paid); border-radius: var(--r-pill); }
.verdict-drop { font-size: 12.5px; color: var(--ink-dim); margin-top: 6px; }
.verdict-drop b { color: var(--c-commute-ink); font-weight: 800; }

.verdict-lines {
  margin: 6px 16px 16px;
  padding: 12px 14px;
  background: var(--slot);
  border-radius: var(--r-box);
  font-size: 13.5px; line-height: 1.9; color: var(--ink);
}
.tier-doom .verdict-lines { background: var(--warn-bg); color: var(--warn); font-weight: 800; }

/* ---- 保存・シェア ---- */

.sharebox, .couldbox { margin-bottom: 16px; }
.btn.xshare { background: #14171a; border-color: #14171a; color: #fff; }
.btn.xshare:hover { background: #000; border-color: #000; }
.idline {
  text-align: center; font-size: 12px; color: var(--ink-faint); margin: 10px 0 4px;
}
.idline b { font-family: var(--num); font-size: 15px; color: var(--accent-ink); letter-spacing: .1em; }
input.sharelink { width: 100%; text-align: left; font-size: 11px; margin-top: 6px; }

/* ---- 何年ぶん ---- */

.yearsline {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  background: var(--slot); border-radius: var(--r-box);
  padding: 10px 14px; margin-bottom: 14px;
  font-size: 14px; font-weight: 800;
}
.yearsline input { width: 78px; background: var(--panel); }
.yearsline .ref { flex: 1 0 100%; margin: 0; font-weight: 400; }

/* ---- できたかもしれないこと ---- */

.couldlist { list-style: none; margin: 0; padding: 0; }
.couldlist li {
  display: flex; align-items: baseline; gap: 10px;
  padding: 9px 12px; margin-bottom: 6px;
  background: var(--slot); border-radius: var(--r-box);
  font-size: 13.5px; line-height: 1.55;
}
.couldlist .cnum {
  font-family: var(--num); font-variant-numeric: tabular-nums;
  font-weight: 800; font-size: 19px; color: var(--c-commute-ink);
  flex: 0 0 auto; min-width: 3.2em; text-align: right;
}

/* ---- 明細の色分け（囲みは付けず、文字色だけ変える） ---- */

.legendline { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 8px; }
.legendline .lv { font-weight: 800; font-size: 11.5px; }

.lv-safe,   td.lv-safe   { color: var(--lv-safe); }
.lv-normal, td.lv-normal { color: var(--ink); }
.lv-warn,   td.lv-warn   { color: var(--lv-warn); }
.lv-danger, td.lv-danger { color: var(--lv-danger); }
/* 囲みは付けない。警告ボックスの .warn と混ざらないよう lv- を前置している */
td.lv { background: none; border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; }

/* 立て替え拘束 */
.big.lock { border-color: var(--c-unpaid); background: var(--panel-2); margin-bottom: 0; }
.big.lock .v { color: #8a5209; }

/* シフト表の平均行 */
.avgrow th, .avgrow td { border-top: 2px solid var(--rule-hi); font-weight: 800; }
.avgrow th { color: var(--ink) !important; }
.cmp-tbl th small { display: block; font-weight: 400; font-size: 10.5px; color: var(--ink-faint); }

/* シフト行の手当 */
.shiftallow { display: flex; align-items: center; gap: 5px; }

@media (max-width: 940px) {
  body.mode-compare .verdicts { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .verdict-wage { font-size: 36px; }
  .verdict-figs img { width: 96px; }
  .verdict-figs img.reaper { width: 72px; }
  .couldlist .cnum { font-size: 17px; min-width: 2.8em; }
}

/* 何年ぶんの累積 */
.big.cum { border-color: var(--rule-hi); background: var(--slot); }
.big.cum .v { color: var(--c-commute-ink); }

/* 共有ボタンはリンク要素なので、見た目をボタンに揃える */
a.btn { display: inline-block; text-decoration: none; text-align: center; }

/* 死神は背景を抜いてあるので、そのまま重ねる */
.verdict-figs img.reaper { filter: drop-shadow(0 0 6px rgba(255,0,0,.35)); }

/* ---- 円グラフの下の「ひとこと」 ---- */

.impact { text-align: center; margin-top: 14px; }
.impact-cap { font-size: 13px; color: var(--ink-dim); font-weight: 800; }
.impact-cap.big {
  margin-top: 12px;
  font-size: 17px;
  color: var(--ink);
  line-height: 1.5;
}
.impact-cap.big em {
  font-style: normal;
  font-family: var(--num);
  font-size: 30px;
  font-weight: 800;
  color: var(--c-commute-ink);
  vertical-align: -2px;
}
.impact-row {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 10px 28px; margin-top: 8px;
}
.impact-cell { display: flex; flex-direction: column; align-items: center; }
.impact-cell b {
  font-family: var(--num);
  font-variant-numeric: tabular-nums;
  font-size: 42px; font-weight: 800; line-height: 1.05;
}
.impact-cell span { font-size: 12px; color: var(--ink-dim); font-weight: 800; }
.impact-cell.hot b  { color: var(--c-commute-ink); }
.impact-cell.cool b { color: var(--c-paid-ink); }
.impact + .note, .impact + .warn { margin-top: 12px; }

@media (max-width: 560px) {
  .impact-cell b { font-size: 34px; }
  .impact-cap.big { font-size: 15px; }
  .impact-cap.big em { font-size: 25px; }
}
