/* 工程表アプリ。色・形は画面イメージ(reference/design)を踏襲。目立たせるのは工程表だけ。 */
:root {
  --bg: #F4F6F3; --text: #1B2A24; --sub: #55615B; --sub2: #3F4A44;
  --line: #BAC3BD; --line2: #D5DAD6; --line3: #E4E8E5;
  --green: #2F5D50; --chip: #E7F0EC; --chip-text: #1F4A3F;
  --red: #B3261E; --blue: #2D5FA8; --orange: #A8520A; --purple: #7B4A8F;
  --today: #1C64F2;
  --joto-bg: #DCEBE3; /* 段階④:上棟だけに使う色(主色 #2F5D50 の薄い色) */
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 16px; line-height: 1.5;
  line-break: strict; overflow-wrap: anywhere; word-break: normal;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.num, time, .date { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--today); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }

/* ---------- 共通の部品 ---------- */
.btn { min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: 15px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; white-space: nowrap; }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; font-weight: 700; }
.btn-dark { background: var(--text); border-color: var(--text); color: #fff; font-weight: 700; }
.btn-danger-outline { border-color: #7A1A14; color: #7A1A14; font-weight: 700; }
.btn-big { width: 100%; min-height: 52px; border-radius: 14px; font-size: 17px; font-weight: 700; }
.btn:disabled { background: #C9D0CB; border-color: #C9D0CB; color: #3F4A44; cursor: not-allowed; }
.chip { display: inline-block; font-size: 14px; font-weight: 500; background: var(--chip); color: var(--chip-text); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.chip-gray { background: #EEF1EE; color: var(--sub2); }
.icon { width: 20px; height: 20px; flex: none; }
.muted { color: var(--sub); }
.msg { font-size: 14px; line-height: 1.6; }
.msg-error { color: #7A1A14; }
.toast { margin: 0 16px 8px; padding: 10px 12px; border-radius: 10px; background: var(--chip); color: var(--chip-text); font-size: 14px; }
.toast.err { background: #FDECEA; color: #7A1A14; }
.progress { display: flex; align-items: center; gap: 10px; }
.progress .bar { flex: 1; height: 8px; background: var(--line3); border-radius: 4px; overflow: hidden; }
.progress .bar > div { height: 8px; background: var(--green); }
.progress .pct { font-size: 14px; color: var(--sub); min-width: 40px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- ログイン ---------- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-box { width: 100%; max-width: 380px; }
.login h1 { font-size: 28px; margin: 0 0 4px; letter-spacing: .1em; }
.login .lead { color: var(--sub); font-size: 14px; margin: 0 0 24px; }
.field { display: block; margin-bottom: 18px; }
.field > span { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.field input { width: 100%; height: 48px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font-size: 16px; background: #fff; }
.field input.is-bad { border: 2px solid var(--red); }

/* ---------- 上の帯(PC)・見出し(スマホ) ---------- */
.topbar { height: 56px; background: var(--text); color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; flex: none; }
.topbar .brand { font-size: 20px; font-weight: 700; letter-spacing: .15em; color: #fff; text-decoration: none; }
.topbar .who { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.topbar .who .chip { background: #fff; color: var(--text); }
.topbar .btn-link { color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.4); border-radius: 8px; min-height: 36px; padding: 0 12px; font-size: 13px; }
.m-head { padding: 20px 16px 8px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.m-head h1 { font-size: 24px; margin: 0; }
.user-chip { font-size: 14px; background: #fff; border: 1px solid var(--line2); border-radius: 999px; padding: 0 14px; min-height: 44px; }
.user-menu { margin: 0 16px 8px; padding: 12px; background: #fff; border: 1px solid var(--line2); border-radius: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.back-head { padding: 12px 8px; display: flex; align-items: center; gap: 4px; }
.back-head h1 { font-size: 20px; margin: 0; }
.icon-btn { width: 44px; height: 44px; border: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; flex: none; color: var(--text); }

/* ---------- 一覧(Main) ---------- */
.list-page { padding-bottom: 100px; }
.search { margin: 4px 16px 8px; display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; height: 48px; padding: 0 12px; color: var(--sub); }
.search input { border: 0; outline: 0; font-size: 16px; flex: 1; min-width: 0; background: transparent; color: var(--text); }
.search:focus-within { outline: 3px solid var(--today); outline-offset: 2px; }
.seg { display: flex; gap: 8px; padding: 4px 16px 12px; }
.seg button { flex: 1; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 16px; font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: #fff; font-weight: 700; }
.cards { padding: 0 16px; display: flex; flex-direction: column; gap: 12px; }
.card { background: #fff; border: 1px solid var(--line2); border-radius: 14px; }
.card-main { display: flex; flex-direction: column; gap: 10px; padding: 16px 16px 10px; text-decoration: none; border-radius: 14px 14px 0 0; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.card-name { font-size: 18px; font-weight: 700; line-height: 1.3; margin: 0; }
.card-addr { font-size: 14px; color: var(--sub); margin-top: 2px; }
.card-now { font-size: 15px; font-weight: 500; }
.card-insp { display: flex; align-items: center; gap: 6px; font-size: 14px; color: #8E2019; font-weight: 500; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line3); margin: 0 16px; padding: 6px 0 8px; }
.card-meta { font-size: 13px; color: var(--sub); }
.btn-text { margin-left: auto; min-height: 44px; padding: 0 4px; border: 0; background: transparent; color: var(--green); font-size: 14px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.confirm { margin: 0 16px 14px; padding: 12px; border-radius: 10px; background: #FFF6E0; border: 1px solid #E8D49A; color: #5B4300; font-size: 14px; line-height: 1.6; }
.confirm-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.confirm-row .btn { flex: 1; }
.empty { margin: 8px 16px; padding: 24px 16px; text-align: center; color: var(--sub); background: #fff; border: 1px dashed var(--line); border-radius: 14px; font-size: 15px; }
.fab { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px 20px; background: linear-gradient(to top, var(--bg) 70%, rgba(244,246,243,0)); }

/* ---------- 登録(Register) ---------- */
.reg-page { min-height: 100vh; display: flex; flex-direction: column; }
.reg-body { padding: 8px 16px; display: flex; flex-direction: column; gap: 0; }
.reg-foot { margin-top: auto; padding: 12px 16px 24px; }
.reg-foot .hint { text-align: center; font-size: 13px; color: var(--sub); margin-top: 8px; }
.alert { border-radius: 12px; padding: 14px; display: flex; gap: 10px; margin-bottom: 18px; }
.alert .t { font-size: 16px; font-weight: 700; line-height: 1.5; }
.alert .d { font-size: 14px; margin-top: 4px; line-height: 1.6; }
.alert-red { background: #FDECEA; border: 1px solid #E5A6A1; color: #7A1A14; }
.alert-yellow { background: #FFF6E0; border: 1px solid #E8D49A; color: #5B4300; }
.alert-gray { background: #EEF1EE; border: 1px solid var(--line); color: var(--sub2); }
.alert-ok { background: var(--chip); border: 1px solid #B9D3C9; color: var(--chip-text); padding: 10px 14px; }
.alert-ok .t { font-size: 15px; }
.alert .sugg { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.alert .sugg .btn { border-color: #7A1A14; color: #7A1A14; font-weight: 700; }
.reg-note { font-size: 14px; line-height: 1.7; color: var(--sub); padding: 0 2px; margin: 0 0 12px; }

/* ---------- 工程表(スマホ。Schedule) ---------- */
.s-head { padding: 12px 8px 8px; display: flex; align-items: center; gap: 4px; background: #fff; }
.s-head .ttl { flex: 1; min-width: 0; }
.s-head .name { font-size: 18px; font-weight: 700; line-height: 1.3; margin: 0; }
.s-head .sub { font-size: 13px; color: var(--sub); }
.s-head .chip { font-size: 13px; margin-right: 8px; }
.tabs { display: flex; background: #fff; border-bottom: 1px solid var(--line2); }
.tabs button { flex: 1; min-height: 48px; border: 0; border-bottom: 3px solid transparent; background: #fff; font-size: 16px; color: var(--sub); }
.tabs button[aria-selected="true"] { border-bottom-color: var(--green); font-weight: 700; color: var(--text); }
.nowbox { padding: 12px 16px; background: #fff; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--line2); }
.nowbox .l1 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.nowbox .l1 b { font-size: 15px; }
.nowbox .l1 span { font-size: 13px; color: var(--sub); }
.today-line { font-size: 12px; color: var(--sub); padding: 8px 16px 0; }
.wk-head { padding: 14px 16px 6px; font-size: 14px; font-weight: 700; color: var(--sub2); scroll-margin-top: 8px; }
.wk-head .rng { font-weight: 400; color: var(--sub); margin-left: 6px; }
.wk-head.is-now { color: var(--today); }
.row { display: flex; gap: 12px; padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--line3); min-height: 44px; }
.row .d { width: 84px; flex: none; }
.row .d1 { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row .d2 { font-size: 13px; color: var(--sub); font-variant-numeric: tabular-nums; white-space: nowrap; }
.row .stripe { width: 6px; border-radius: 3px; flex: none; }
.row .b { flex: 1; min-width: 0; }
.row .n { font-size: 16px; font-weight: 500; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.row .x { font-size: 14px; color: var(--sub); }
.row.is-active { box-shadow: inset 4px 0 0 var(--today); }
.tag-now { font-size: 12px; font-weight: 700; color: #fff; background: var(--today); border-radius: 6px; padding: 1px 6px; }
.note-row { padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--line3); font-size: 14px; color: var(--sub2); line-height: 1.6; }
.log-list { padding: 8px 16px 24px; }
.log-item { padding: 12px 0; border-bottom: 1px solid var(--line3); font-size: 14px; line-height: 1.6; }
.log-item .at { color: var(--sub); font-size: 13px; font-variant-numeric: tabular-nums; }
.s-foot { padding: 16px; font-size: 13px; color: var(--sub); }

/* 全体の表(スマホ。重ねて出す) */
.sheet { position: fixed; inset: 0; background: var(--bg); display: flex; flex-direction: column; z-index: 10; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; background: #fff; border-bottom: 1px solid var(--line2); }
.sheet-head h2 { font-size: 17px; margin: 0; flex: 1; min-width: 0; }
.sheet-body { flex: 1; min-height: 0; overflow: auto; padding: 12px; }

/* ---------- 工程表の表(PC・スマホ共通) ---------- */
.chart { display: flex; border: 1px solid #B9C1BB; border-radius: 8px; overflow: hidden; background: #fff; max-width: 100%; }
.chart-labels { flex: none; position: relative; border-right: 1px solid #9AA39D; background: #fff; }
.chart-labels .lab { position: absolute; left: 0; right: 0; display: flex; align-items: center; padding: 0 8px 0 10px; font-weight: 700; line-height: 1.2; border-top: 1px solid #9AA39D; }
.chart-labels .lab-head { position: absolute; left: 10px; font-size: 13px; font-weight: 700; }
.chart-scroll { flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden; }
.chart-canvas { position: relative; }
.chart-canvas > div, .chart-canvas > button { position: absolute; }
.c-off { background: #E3E7E4; }
.c-hline { height: 0; border-top: 1px solid #9AA39D; left: 0; } /* 7つの直し:枠線で描く(拡大率が100%未満でも消えない) */
.c-vline { width: 0; border-left: 1px solid #CCD3CE; pointer-events: none; } /* 日の区切りの縦線(1本ずつ) */
.c-month { height: 20px; line-height: 20px; font-size: 13px; font-weight: 700; padding-left: 4px; border-left: 2px solid var(--text); white-space: nowrap; }
.c-mline { width: 1px; background: #7E8983; }
.c-day { text-align: center; font-size: 12px; line-height: 18px; font-variant-numeric: tabular-nums; }
.c-day.off { color: var(--red); font-weight: 700; }
.c-bar { border: 0; padding: 0; border-radius: 4px; overflow: hidden; color: #fff; font-size: 12px; font-weight: 700; line-height: 24px; text-align: left; white-space: nowrap; }
.c-bar span { padding-left: 4px; }
.c-bar.sel { outline: 2px solid var(--text); outline-offset: 1px; }
.c-blabel { font-size: 12px; font-weight: 700; white-space: nowrap; line-height: 34px; pointer-events: none; }
.c-today { width: 2px; background: var(--today); }
.c-todaypill { height: 17px; line-height: 17px; text-align: center; border-radius: 9px; background: var(--today); color: #fff; font-size: 12px; font-weight: 700; width: 38px; }
.legend { font-size: 13px; color: var(--sub2); display: flex; flex-wrap: wrap; gap: 6px 18px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend i { width: 18px; height: 12px; border-radius: 2px; display: inline-block; }
.chart-note { font-size: 13px; color: var(--sub); line-height: 1.6; }

/* ---------- PCの画面 ---------- */
.pc { height: 100vh; display: flex; flex-direction: column; }
.pc-body { display: flex; flex: 1; min-height: 0; }
.pc-left { width: 264px; flex: none; background: #fff; border-right: 1px solid var(--line2); padding: 16px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.pc-left .search { margin: 0; height: 40px; border-radius: 8px; }
.pc-left .search input { font-size: 14px; }
.pc-left .seg { padding: 0; gap: 6px; }
.pc-left .seg button { min-height: 40px; border-radius: 8px; font-size: 14px; }
.mini { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--line2); border-radius: 10px; text-decoration: none; background: #fff; }
.mini[aria-current="page"] { background: var(--chip); border: 2px solid var(--green); padding: 11px; }
.mini .h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.mini .h b { font-size: 15px; }
.mini .h span { font-size: 13px; color: var(--sub); white-space: nowrap; }
.mini .t { font-size: 13px; color: var(--sub2); }
.mini .progress .bar { height: 6px; }
.mini .progress .bar > div { height: 6px; }
.pc-left .new { margin-top: auto; }
.pc-center { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-y: auto; }
.pc-chead { background: #fff; border-bottom: 1px solid var(--line2); padding: 14px 24px 0; display: flex; flex-direction: column; gap: 10px; }
.pc-chead .t1 { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pc-chead h1 { font-size: 22px; margin: 0; }
.pc-chead .addr { font-size: 14px; color: var(--sub); }
.pc-chead .chips { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.pc-chead .chips .chip { font-size: 13px; padding: 3px 10px; }
.pc-tabs { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.pc-tabs [role=tablist] { display: flex; }
.pc-tabs [role=tab] { min-height: 44px; padding: 0 18px; border: 0; border-bottom: 3px solid transparent; background: #fff; font-size: 15px; color: var(--sub); }
.pc-tabs [role=tab][aria-selected="true"] { border-bottom-color: var(--green); font-weight: 700; color: var(--text); }
.pc-tabs .tools { display: flex; gap: 6px; padding-bottom: 6px; align-items: center; }
.pc-tabs .tools .btn { min-height: 36px; font-size: 13px; padding: 0 12px; border-radius: 6px; }
.pc-main { padding: 16px 24px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pc-right { width: 320px; flex: none; background: #fff; border-left: 1px solid var(--line2); padding: 16px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.det-head { display: flex; align-items: center; gap: 10px; }
.det-head .stripe { width: 6px; height: 34px; border-radius: 3px; flex: none; }
.det-head b { font-size: 18px; display: block; }
.det-head small { font-size: 12px; color: var(--sub); display: block; }
.det-field .k { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.det-field .v { min-height: 40px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line2); display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.det-info { font-size: 13px; background: var(--chip); border-radius: 8px; padding: 8px 10px; color: var(--chip-text); line-height: 1.6; }
.det-later { font-size: 12px; color: var(--sub); line-height: 1.6; }
.recent h2 { font-size: 14px; margin: 0 0 2px; }
.recent .log-item { font-size: 13px; padding: 8px 0; }
.pc-list { max-width: 1120px; width: 100%; margin: 0 auto; padding: 20px 24px 40px; }
.pc-list .bar1 { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.pc-list .bar1 h1 { font-size: 22px; margin: 0 12px 0 0; }
.pc-list .search { margin: 0; flex: 1; min-width: 240px; max-width: 420px; }
.pc-list .seg { padding: 0; min-width: 280px; }
.pc-list .cards { padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.pc-list .empty { margin: 8px 0; }
.pc-form { max-width: 560px; width: 100%; margin: 0 auto; }
.pc-form .reg-page { min-height: 0; }

/* ---------- 手修正(段階③) ---------- */
button.row { width: 100%; border: 0; border-bottom: 1px solid var(--line3); text-align: left; font: inherit; color: inherit; cursor: pointer; align-items: stretch; }
button.row > span { display: block; }
button.row .d1, button.row .d2, button.row .n, button.row .x { display: block; }
button.row .n { display: flex; }
button.row:hover { background: #FAFBFA; }
.row .chev { align-self: center; color: var(--sub); flex: none; display: flex; }
.c-bar { cursor: pointer; }
.edit-backdrop { position: fixed; inset: 0; background: rgba(27,42,36,.55); z-index: 20; }
.edit-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; background: #fff; border-radius: 20px 20px 0 0; padding: 12px 16px 24px; max-height: 92vh; overflow-y: auto; }
.edit-sheet #edit { display: flex; flex-direction: column; gap: 14px; }
.edit-sheet .handle { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.edit-sheet .det-head b { font-size: 20px; }
.edit-sheet .det-head small { font-size: 13px; }
.ed-field .k { font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 44px; height: 44px; flex: none; border-radius: 8px; border: 1px solid var(--line); background: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; line-height: 1; }
.stepper button:disabled { color: #A9B2AC; background: #F1F3F1; cursor: not-allowed; }
.stepper .v { flex: 1; min-width: 0; height: 44px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line2); display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; white-space: nowrap; }
.stepper.big button { width: 56px; height: 52px; border-radius: 12px; }
.stepper.big .v { height: 52px; border-radius: 12px; font-size: 18px; }
.stepper .flip { display: inline-flex; transform: scaleX(-1); }
.pick { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 6px; font-size: 13px; color: var(--sub); flex-wrap: wrap; }
.pick input { height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font-size: 15px; background: #fff; }
.ed-fixed { min-height: 44px; display: flex; align-items: center; font-size: 14px; color: var(--sub2); background: var(--bg); border-radius: 8px; padding: 0 12px; }
.ed-alert { margin-bottom: 0; padding: 12px; }
.ed-alert .t { font-size: 15px; }
.det-info .was { color: var(--sub); }
.ed-buttons { display: flex; gap: 8px; }
.ed-buttons .btn { flex: 1; min-height: 48px; }
.ed-buttons .btn-primary { flex: 2; }
.edit-sheet .ed-buttons .btn { min-height: 52px; border-radius: 12px; font-size: 16px; }
.pc-right .det-info { font-size: 13px; }

/* ================= 段階④ ================= */
/* ---------- ナビ(PC=上の帯、スマホ=☰) ---------- */
.topnav { display: flex; gap: 4px; margin-right: auto; margin-left: 28px; }
.topnav a { color: #fff; text-decoration: none; font-size: 15px; min-height: 44px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 8px; opacity: .85; }
.topnav a:hover { opacity: 1; background: rgba(255,255,255,.08); }
.topnav a[aria-current="page"] { opacity: 1; font-weight: 700; box-shadow: inset 0 -3px 0 #fff; border-radius: 0; }
.menu-btn { margin-left: auto; }
.m-nav-back { position: fixed; inset: 0; z-index: 40; background: rgba(27,42,36,.25); }
.m-nav { position: fixed; top: 8px; right: 8px; z-index: 41; width: min(280px, calc(100vw - 16px)); background: #fff; border: 1px solid var(--line2); border-radius: 14px; box-shadow: 0 8px 24px rgba(27,42,36,.18); padding: 8px; display: flex; flex-direction: column; }
.m-nav-who { font-size: 13px; color: var(--sub); padding: 8px 12px 10px; border-bottom: 1px solid var(--line3); margin-bottom: 4px; }
.m-nav a, .m-nav button { min-height: 48px; display: flex; align-items: center; padding: 0 12px; border-radius: 10px; text-decoration: none; font-size: 16px; border: 0; background: transparent; text-align: left; width: 100%; }
.m-nav a:hover, .m-nav button:hover { background: var(--bg); }
.m-nav a[aria-current="page"] { font-weight: 700; box-shadow: inset 4px 0 0 var(--green); }
.m-nav button { border-top: 1px solid var(--line3); border-radius: 0 0 10px 10px; margin-top: 4px; color: #7A1A14; }
.back-head h1 { flex: 1; min-width: 0; }
.m-head h1 { flex: 1; min-width: 0; }

/* ---------- 上棟(目立たせるのは上棟だけ) ---------- */
.joto-badge { flex: none; display: inline-flex; flex-direction: column; align-items: center; min-width: 92px; padding: 6px 10px; border-radius: 12px; background: var(--joto-bg); border: 1.5px solid var(--green); color: var(--chip-text); line-height: 1.25; text-align: center; }
.joto-badge .jb-l { font-size: 12px; font-weight: 700; letter-spacing: .2em; }
.joto-badge .jb-y { font-size: 11px; }
.joto-badge .jb-d { font-size: 17px; white-space: nowrap; color: var(--text); }
.joto-badge .jb-c { font-size: 12px; white-space: nowrap; margin-top: 2px; }
.card-ttl { min-width: 0; }
.mini .h .mini-joto { color: var(--green); font-weight: 700; }
.joto-strip { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 6px 16px; background: var(--joto-bg); border-top: 1px solid #C3D9CD; border-bottom: 1px solid #C3D9CD; color: var(--chip-text); }
.joto-strip .js-l { font-size: 13px; font-weight: 700; letter-spacing: .2em; background: var(--green); color: #fff; border-radius: 6px; padding: 1px 6px 1px 8px; align-self: center; }
.joto-strip .js-d { font-size: 18px; color: var(--text); white-space: nowrap; }
.joto-strip .js-c { font-size: 14px; font-weight: 700; white-space: nowrap; }
.wk-head.is-joto { background: var(--joto-bg); color: var(--chip-text); border-top: 2px solid var(--green); }
.wk-joto { margin-left: 8px; font-size: 12px; font-weight: 700; color: #fff; background: var(--green); border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
.row.is-joto { background: var(--joto-bg); box-shadow: inset 4px 0 0 var(--green); }
button.row.is-joto:hover { background: #D2E5DB; }
.row.is-joto .n { font-weight: 700; }
.row.is-joto .x { color: var(--chip-text); font-weight: 700; }
.row.is-joto.is-active { box-shadow: inset 4px 0 0 var(--today); }
.tag-joto { font-size: 12px; font-weight: 700; color: #fff; background: var(--green); border-radius: 6px; padding: 1px 6px; }
.c-joto { background: rgba(47,93,80,.16); border-left: 1.5px solid var(--green); border-right: 1.5px solid var(--green); pointer-events: none; }
.c-jotopill { height: 18px; line-height: 18px; width: 40px; text-align: center; border-radius: 9px; background: var(--green); color: #fff; font-size: 12px; font-weight: 700; z-index: 2; }
.c-day.joto { color: var(--green); font-weight: 700; }

/* ---------- スマホの固定表示(見出し・上棟・タブ・進み具合) ---------- */
.s-sticky { position: sticky; top: 0; z-index: 5; background: #fff; box-shadow: 0 1px 0 var(--line2), 0 2px 6px rgba(27,42,36,.08); }
.s-sticky .s-head { padding: 6px 4px; }
.s-sticky .s-head .name { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-sticky .s-head .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-sticky .s-head .chip { margin-right: 0; }
.s-sticky .tabs button { min-height: 44px; font-size: 15px; }
.nb-compact { padding: 6px 16px 8px; gap: 4px; border-bottom: 0; }
.nb-compact .l1 { flex-wrap: nowrap; overflow: hidden; }
.nb-compact .l1 b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.nb-compact .l1 span { white-space: nowrap; }
.nb2 { display: flex; align-items: center; gap: 10px; }
.nb2 .progress { flex: 1; min-width: 0; gap: 8px; }
.nb2 .progress .bar { height: 5px; }
.nb2 .progress .bar > div { height: 5px; }
.nb2 .progress .pct { min-width: 34px; font-size: 13px; }
.nb-btn { flex: none; min-height: 44px; padding: 0 12px; font-size: 14px; }
.wk-head { scroll-margin-top: calc(var(--stick-h, 0px) + 4px); }

/* ---------- 上棟日の入力補助(六曜) ---------- */
.flabel { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.joto-in-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.joto-in-row input { flex: 1 1 180px; min-width: 0; width: auto; }
.rk-chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 14px; font-weight: 700; white-space: nowrap; }
.rk-chip.is-bm { background: #E3E7E4; color: var(--sub2); border-style: dashed; }
.rk-chip.is-unsure { font-weight: 500; color: var(--sub); }
.jh { margin: 0 0 16px; }
.jh-k { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.jh-near { background: #fff; border: 1px solid var(--line2); border-radius: 12px; padding: 12px; margin-bottom: 14px; }
.jh-near-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-near { border-color: var(--green); color: var(--green); font-weight: 700; flex: 1 1 140px; }
.jh-none { font-size: 14px; color: var(--sub); margin: 0 0 12px; }
.jh-title { font-size: 15px; margin: 0 0 8px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.jh-sub { font-size: 12px; font-weight: 400; color: var(--sub); }
.rk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.rk { min-height: 52px; border-radius: 10px; border: 1px solid var(--line); background: #fff; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 4px 10px; text-align: left; line-height: 1.3; }
.rk .rk-d { font-size: 15px; font-weight: 700; white-space: nowrap; }
.rk .rk-r { font-size: 13px; color: var(--sub2); }
.rk.is-bm { background: #E3E7E4; border-style: dashed; color: var(--sub2); }
.rk.is-bm .rk-d { font-weight: 500; }
.rk.is-bm .rk-r { font-weight: 700; }
.rk.is-unsure .rk-r { font-size: 12px; color: var(--sub); }
.rk[aria-pressed="true"] { border: 2px solid var(--green); padding: 3px 9px; box-shadow: inset 0 0 0 1px var(--green); }
.rk[aria-pressed="true"]:not(.is-bm) { background: var(--joto-bg); }
.jh-note { font-size: 12px; color: var(--sub); margin: 8px 0 0; }
.pc-form .rk-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- 資料・業者 ---------- */
.lk-quick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 16px 0; }
.lk-quick .lk-k { font-size: 13px; color: var(--sub); font-weight: 700; }
.lk-btn { min-height: 44px; padding: 0 12px; font-size: 14px; border-color: var(--line); }
.lk-quick .lk-add { margin-left: 0; font-size: 13px; color: var(--sub2); }
.pc-row1 { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.pc-row1 .lk-quick { padding: 0; }
.info { padding: 4px 16px 32px; }
.info-sec { margin-top: 16px; }
.info-sec h2 { font-size: 17px; margin: 0 0 4px; }
.info-note { font-size: 13px; color: var(--sub); line-height: 1.6; margin: 0 0 10px; }
.lk-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line3); }
.lk-open { flex: 1 1 200px; justify-content: flex-start; min-width: 0; white-space: normal; text-align: left; font-weight: 700; border-color: var(--green); color: var(--green); }
.lk-open .lk-n { min-width: 0; }
.lk-url { flex-basis: 100%; font-size: 12px; color: var(--sub); overflow-wrap: anywhere; }
.lk-addbtn { margin-top: 12px; width: 100%; border-style: dashed; }
.lk-form { background: #fff; border: 1px solid var(--line2); border-radius: 12px; padding: 12px; margin: 10px 0; display: flex; flex-direction: column; gap: 6px; }
.lk-form .field { margin-bottom: 8px; }
.btn-sm { min-height: 44px; padding: 0 14px; font-size: 14px; }
.toast-btn { min-height: 36px; margin-left: 8px; font-size: 13px; padding: 0 10px; }
.pv-row { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line3); flex-wrap: wrap; }
.pv-t { width: 130px; flex: none; display: flex; align-items: flex-start; gap: 8px; font-size: 15px; font-weight: 500; }
.pv-t .stripe { width: 5px; height: 20px; border-radius: 3px; flex: none; margin-top: 2px; }
.pv-v { flex: 1 1 180px; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.vend { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line2); border-radius: 10px; }
.vend .k { font-size: 13px; font-weight: 500; color: var(--sub2); }
.vend-name { font-size: 16px; font-weight: 700; }
.vend-name.is-none { font-weight: 500; color: var(--sub); }
.vend-sub { font-size: 14px; color: var(--sub2); }
.vend-tel { border-color: var(--green); color: var(--green); font-weight: 700; }
.pv-pick { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.pv-k { font-size: 13px; font-weight: 500; }
.sel { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font-size: 16px; background: #fff; }

/* ---------- 設定・PDF出力(準備中) ---------- */
.m-page { padding-bottom: 40px; }
.m-body { padding: 0 16px; }
.pc-page { max-width: 960px; width: 100%; margin: 0 auto; padding: 20px 24px 48px; }
.pc-h1 { font-size: 22px; margin: 4px 0 14px; }
.back-link { display: inline-flex; align-items: center; gap: 2px; margin-left: 0; padding: 0; }
.soon { background: #fff; border: 1px dashed var(--line); border-radius: 14px; padding: 24px 16px; text-align: center; color: var(--sub2); margin-top: 8px; }
.soon-t { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.soon p { margin: 0; font-size: 14px; line-height: 1.7; }
/* 段階2D:タブが5つになったので、入る数だけ1段に並べる(スマホ390px幅は3つ+2つの2段。文字を途中で折り返さない) */
.set-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 6px; margin: 0 0 14px; }
.set-tabs a { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: 14px; text-decoration: none; text-align: center; line-height: 1.25; }
.set-tabs a[aria-current="page"] { background: var(--text); color: #fff; border-color: var(--text); font-weight: 700; }
.set-bar { display: flex; gap: 12px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
.set-bar .info-note { margin: 0; flex: 1 1 260px; }
.set-h2 { font-size: 16px; margin: 22px 0 8px; }
/* 段階2D:パスワードの画面 */
.pw-form { max-width: 440px; }
.pw-form .field input { font-family: inherit; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 10px; align-items: start; }
.vcard { background: #fff; border: 1px solid var(--line2); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.vcard.is-off { background: #F7F8F7; color: var(--sub2); }
.vc-h { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.vc-h h3 { font-size: 16px; margin: 0; }
.vc-t { font-size: 13px; color: var(--sub2); }
.vc-s { font-size: 13px; color: var(--sub2); }
.vc-m { font-size: 13px; color: var(--sub); white-space: pre-line; }
.vc-f { display: flex; justify-content: flex-end; margin-top: 4px; }
.def-list { background: #fff; border: 1px solid var(--line2); border-radius: 12px; padding: 0 12px; }
.def-row { display: flex; align-items: center; gap: 6px 10px; padding: 8px 0; border-bottom: 1px solid var(--line3); flex-wrap: wrap; }
.def-row:last-child { border-bottom: 0; }
.def-t { flex: 1 1 140px; display: flex; align-items: center; gap: 8px; font-size: 15px; }
.def-t .stripe { width: 5px; height: 20px; border-radius: 3px; flex: none; }
.def-c { flex: 1 1 220px; display: flex; gap: 8px; min-width: 0; }
.def-c .sel { flex: 1; min-width: 0; }
.vform { max-width: 640px; }
.vform textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 16px; background: #fff; resize: vertical; line-height: 1.6; }
.tk-group { border: 1px solid var(--line2); border-radius: 12px; padding: 6px 12px 10px; margin: 0 0 10px; background: #fff; min-width: 0; }
.tk-group legend { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; padding: 0 4px; }
.tk-group legend .stripe { width: 5px; height: 16px; border-radius: 3px; }
.tk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 8px; }
.tk { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 15px; cursor: pointer; }
.tk input { width: 22px; height: 22px; flex: none; accent-color: var(--green); }
.v-active { max-width: 640px; margin-top: 8px; }
@media (min-width: 1024px) { .tk-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* PCの表:行の名前の下に業者名 */
.chart-labels .lab { flex-direction: column; align-items: flex-start; justify-content: center; }
.chart-labels .lab .lab-n { line-height: 1.2; }
.chart-labels .lab .lab-v { font-size: 11px; font-weight: 400; color: var(--sub); max-width: 100%; line-height: 1.2;
  /* 7つの直し:長い会社名は2行までで省略(全体はカーソルを当てるか、棒を押したときの右の欄で見える) */
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; white-space: normal; }
.pc-chead-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.pc-chead-top .joto-strip { border: 1.5px solid var(--green); border-radius: 12px; padding: 6px 14px; }

/* ================= 区切りA(選択の解除・上棟の行・ドラッグ) ================= */
:root { --joto-strong: #E0A800; } /* 上棟の棒だけに使う強い色(工種の5色・赤・今日の青と別)。白黒でも太枠と「上棟」の文字で分かる */
.c-bar-joto { border: 2.5px solid var(--text); border-radius: 5px; box-shadow: 0 0 0 1px #fff inset; }
.c-bar-joto.sel { outline: 2px solid var(--today); outline-offset: 2px; }
.c-jlabel { height: 22px; line-height: 18px; padding: 0 7px; border-radius: 6px; background: var(--joto-strong); color: var(--text); border: 2px solid var(--text); font-size: 12px; font-weight: 800; letter-spacing: .1em; white-space: nowrap; pointer-events: none; }
.chart-labels .lab.lab-joto { background: #FFF6D6; }
.chart-labels .lab.lab-joto .lab-n { font-weight: 800; }
.legend i.lg-joto { border: 2px solid var(--text); }
.row.is-joto .stripe { width: 10px; border: 2px solid var(--text); }
.tag-joto { background: var(--joto-strong); color: var(--text); border: 1.5px solid var(--text); }
/* 直しかけの位置(点線の棒)と、元の棒(薄く) */
.c-bar.is-moved { opacity: .35; }
.c-ghost { border: 2px dashed var(--text); border-radius: 4px; background: repeating-linear-gradient(135deg, var(--gc) 0 6px, color-mix(in srgb, var(--gc) 55%, #fff) 6px 10px); box-shadow: 0 2px 6px rgba(27,42,36,.25); }
.c-ghost.is-joto { border-width: 2.5px; }
.c-dragtip { z-index: 4; height: 22px; line-height: 20px; padding: 0 8px; border-radius: 6px; background: var(--text); color: #fff; font-size: 12px; font-weight: 700; white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums; border: 1px solid var(--text); }
.c-dragtip.is-warn { background: #FFF4CC; color: #5C4300; border-color: #C79A00; }
/* つかめる棒(PCのマウスだけ)。端のつまみで工期を変える */
@media (pointer: fine) {
  .c-bar.can-drag, .c-ghost.can-drag { cursor: grab; }
  body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none; }
  body.is-dragging[data-drag-mode="left"], body.is-dragging[data-drag-mode="left"] *,
  body.is-dragging[data-drag-mode="right"], body.is-dragging[data-drag-mode="right"] * { cursor: ew-resize !important; }
  .c-grip { position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; z-index: 1; }
  .c-grip::after { content: ""; position: absolute; top: 25%; bottom: 25%; width: 3px; border-radius: 2px; background: #fff; box-shadow: 0 0 0 1px var(--text); }
  .c-grip-l { left: 0; } .c-grip-l::after { left: 2px; }
  .c-grip-r { right: 0; } .c-grip-r::after { right: 2px; }
}
@media not (pointer: fine) { .c-grip { display: none; } }
.c-bar .c-bt { padding-left: 4px; }
/* 右の欄・修正シートの小さな知らせ */
.ed-note { margin: 0; font-size: 13px; line-height: 1.6; padding: 8px 10px; border-radius: 8px; background: var(--chip); color: var(--chip-text); }
.ed-note.is-warn { background: #FFF4CC; color: #5C4300; }
.ed-nudge { margin: 0; font-size: 13px; font-weight: 700; color: #7A1A14; background: #FDECEA; border-radius: 8px; padding: 6px 10px; }
.ed-nudge.flash { animation: nudge .5s ease 1; }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* ================= 区切りB(条件セット・登録の2画面目・バージョン2の予定) ================= */
.chip-warn { background: #FFF4CC; color: #5C4300; border: 1px solid #E5C766; }
.cs-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 12px; }
.cs-card { background: #fff; border: 1px solid var(--line2); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.cs-card.is-off { background: #F7F8F7; color: var(--sub2); }
.cs-card-h { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; }
.cs-card-h h3 { font-size: 18px; margin: 0 4px 0 0; }
.cs-card-h .chip, .cs-meta .chip, .cs-th-c .chip { font-size: 12px; padding: 2px 8px; font-weight: 700; }
.cs-sum { font-size: 14px; color: var(--sub2); line-height: 1.6; }
.cs-sample { font-size: 14px; }
.cs-used { font-size: 13px; color: var(--sub); }
.cs-btns { display: flex; gap: 8px; }
.cs-btns .btn { flex: 1; }
.cs-edit { border-color: var(--green); color: var(--chip-text); font-weight: 700; }
.cs-note { font-size: 13px; color: var(--sub); line-height: 1.6; margin: 10px 0 0; }
/* PC:比べる表 */
.cs-table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line2); border-radius: 12px; max-width: 100%; }
.cs-table { border-collapse: collapse; font-size: 14px; min-width: 100%; }
.cs-table th, .cs-table td { border-bottom: 1px solid var(--line3); padding: 6px 10px; text-align: center; white-space: nowrap; }
.cs-table thead th { background: #FAFBFA; vertical-align: top; }
.cs-table .cs-rn { text-align: left; font-weight: 700; position: sticky; left: 0; background: #fff; z-index: 1; min-width: 170px; }
.cs-table thead .cs-rn { background: #FAFBFA; vertical-align: bottom; }
.cs-table .cs-rn small { display: block; font-size: 11px; font-weight: 400; color: var(--sub); }
.cs-table .cs-th { border-left: 1px solid var(--line2); min-width: 150px; }
.cs-th-n { font-size: 16px; font-weight: 700; }
.cs-th-c { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; min-height: 22px; margin: 2px 0; }
.cs-th-s { font-size: 12px; color: var(--sub2); font-weight: 400; }
.cs-th-b { display: flex; gap: 6px; justify-content: center; margin-top: 6px; }
.cs-th-b .btn { min-height: 36px; font-size: 13px; padding: 0 10px; }
.cs-table .cs-sub { font-size: 12px; font-weight: 500; color: var(--sub); }
.cs-table td { font-variant-numeric: tabular-nums; }
.cs-table td:nth-child(2n) { border-left: 1px solid var(--line2); }
.cs-table td.is-diff { background: #FFF1B8; font-weight: 700; }
.cs-table td.cs-na { color: #A9B2AC; }
/* 編集 */
.cs-form { max-width: 760px; }
.cs-meta { display: flex; gap: 6px 10px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--sub); margin: -6px 0 8px; }
.cs-prov { font-size: 13px; line-height: 1.6; background: #FFF4CC; color: #5C4300; border-radius: 10px; padding: 8px 12px; margin: 0 0 10px; }
.cs-legend { font-size: 12px; font-weight: 500; color: #5C4300; background: #FFF1B8; border-radius: 6px; padding: 1px 8px; margin-left: 8px; white-space: nowrap; }
.cs-rows { background: #fff; border: 1px solid var(--line2); border-radius: 12px; overflow: hidden; }
.cs-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 12px; border-bottom: 1px solid var(--line3); }
.cs-row:last-child { border-bottom: 0; }
.cs-row.is-diff { background: #FFF6D1; }
.cs-name { flex: 1 1 220px; min-width: 0; display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; }
.cs-name .stripe { width: 5px; height: 18px; border-radius: 3px; grid-row: 1; }
.cs-name b { font-size: 15px; grid-column: 2; }
.cs-row[data-kind="rule"] .cs-name b, .cs-row[data-kind="rule"] .cs-name small { grid-column: 1 / -1; }
.cs-name small { grid-column: 2; font-size: 12px; color: var(--sub); line-height: 1.5; }
.cs-ctrls { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.cs-ctl { display: flex; align-items: center; gap: 6px; }
.cs-k { font-size: 13px; color: var(--sub2); min-width: 2.5em; }
.cs-row[data-kind="rule"] .cs-k { min-width: 0; line-height: 1.3; }
.cs-u { white-space: nowrap; }
.cs-step { display: flex; align-items: center; gap: 4px; }
.cs-step button { width: 44px; height: 44px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 20px; font-weight: 700; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.cs-in { width: 58px; height: 44px; border: 1px solid var(--line); border-radius: 8px; text-align: center; font-size: 16px; font-weight: 700; background: #fff; -moz-appearance: textfield; }
.cs-in::-webkit-outer-spin-button, .cs-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cs-in.is-bad { border: 2px solid var(--red); background: #FDECEA; }
.cs-u { font-size: 13px; color: var(--sub2); }
.cs-foot { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; margin-top: 8px; display: flex; flex-direction: column; gap: 8px; z-index: 2; }
.cs-actions { max-width: 760px; }
.cs-act-list { display: flex; flex-wrap: wrap; gap: 8px; }
.cond-box { background: #fff; border: 1px solid var(--line2); border-radius: 12px; padding: 10px 12px; margin-bottom: 6px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.cond-box .cs-sum { flex-basis: 100%; }
/* 登録の2画面目 */
.rs-top { font-size: 15px; margin-bottom: 14px; }
.rs-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.rs-card { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 1.5px solid var(--line2); border-radius: 14px; padding: 12px 14px; cursor: pointer; }
.rs-card.is-sel { border: 2.5px solid var(--green); padding: 11px 13px; background: #F6FAF8; }
.rs-card input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--green); }
.rs-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.rs-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rs-n { font-size: 18px; }
.rs-h .chip { font-size: 12px; padding: 2px 8px; font-weight: 700; }
.rs-hope { font-size: 13px; font-weight: 700; color: #7A1A14; background: #FDECEA; border-radius: 6px; padding: 1px 8px; white-space: nowrap; }
.rs-hope.ok { color: var(--chip-text); background: var(--chip); }
.rs-f { font-size: 15px; }
.rs-f b { font-size: 18px; }
.rs-k { font-size: 13px; color: var(--sub); margin-left: 4px; white-space: nowrap; }
.rs-s { font-size: 13px; color: var(--sub2); line-height: 1.6; }
/* バージョン2の予定 */
.v2 { margin-top: 28px; padding-top: 4px; border-top: 1px dashed var(--line); }
.v2-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.v2-item { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border: 1px dashed var(--line); border-radius: 10px; background: #fff; color: var(--sub2); font-size: 14px; }
.v2-item:disabled { cursor: default; color: var(--sub2); background: #FAFBFA; }
.v2-item .chip { font-size: 12px; padding: 2px 8px; }
.cs-actions .confirm { margin: 12px 0 0; }

/* ================= 区切りC(PDF出力) ================= */
.pdf-form { max-width: 640px; }
.pdf-mode { border: 1px solid var(--line2); border-radius: 12px; background: #fff; padding: 6px 12px 10px; margin: 0 0 16px; min-width: 0; }
.pdf-mode legend { font-size: 14px; font-weight: 500; padding: 0 4px; }
.pdf-r { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; padding: 8px 0; cursor: pointer; border-bottom: 1px solid var(--line3); }
.pdf-r:last-child { border-bottom: 0; }
.pdf-r input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--green); }
.pdf-r span { display: flex; flex-direction: column; min-width: 0; }
.pdf-r b { font-size: 16px; }
.pdf-r small { font-size: 13px; color: var(--sub); line-height: 1.5; }
.pdf-open { text-decoration: none; margin-top: 4px; }
.pdf-notes { font-size: 13px; color: var(--sub); line-height: 1.6; padding-left: 1.2em; margin: 16px 0 0; }
.pdf-notes li { margin-bottom: 6px; }

/* ================= 7つの直し(2026-11-28) ================= */
/* 上棟:大工の行の中に、黄色+太い黒枠+「上棟」の文字(縦書き)。手前に重ねる */
.c-bar.c-bar-joto { z-index: 3; display: flex; align-items: center; justify-content: center; padding: 0; line-height: 1; }
.c-bar-joto .c-jt { writing-mode: vertical-rl; text-orientation: upright; color: var(--text); font-weight: 800; letter-spacing: 0; padding: 0; line-height: 1; white-space: nowrap; }
.c-bar-joto .c-jt.is-h { writing-mode: horizontal-tb; }
.c-blabel { line-height: normal; display: flex; align-items: center; }
/* PCの左右の欄を畳む */
.pc-left, .pc-right { position: relative; }
.pane-in { display: flex; flex-direction: column; gap: 12px; flex: 1; min-height: 0; }
.pc-left .pane-in .new { margin-top: auto; }
.pane-bar { display: flex; align-items: center; gap: 6px; }
.pane-bar-left { justify-content: flex-end; margin: -6px -6px 0 0; }
.pane-bar-right { justify-content: flex-start; margin: -6px 0 0 -6px; }
.pane-btn { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line2); background: #fff; color: var(--sub2); font-size: 13px; }
.pane-btn:hover { background: var(--bg); color: var(--text); }
.pane-v { writing-mode: vertical-rl; font-size: 13px; color: var(--sub2); letter-spacing: .15em; white-space: nowrap; }
.pc-body.left-closed .pc-left { width: 60px; padding: 12px 8px; align-items: center; }
.pc-body.right-closed .pc-right { width: 60px; padding: 12px 8px; align-items: center; }
.pc-body.left-closed .pane-bar-left, .pc-body.right-closed .pane-bar-right { flex-direction: column; margin: 0; gap: 10px; }
.pc-body.left-closed .pane-bar-left .pane-t, .pc-body.right-closed .pane-bar-right .pane-t { display: none; }
/* 業者:業種ごと・追加・削除 */
.set-add { margin: 0 0 10px; }
.btn-add { min-height: 52px; padding: 0 22px; font-size: 17px; border-radius: 12px; }
.vgroup { margin: 14px 0 6px; }
.vg-h { font-size: 15px; margin: 0 0 8px; display: flex; align-items: baseline; gap: 8px; padding-bottom: 4px; border-bottom: 2px solid var(--line2); }
.vg-n { font-size: 13px; font-weight: 500; color: var(--sub); }
.vc-f { gap: 8px; flex-wrap: wrap; }
.vc-confirm { margin: 6px 0 0; }
.vc-cannot { background: #F7F8F7; border-color: var(--line); color: var(--sub2); }
/* 物件の「業者」タブ:標準の業者を入れる */
.fill-box { margin: 4px 0 12px; }
.fill-btn { white-space: normal; text-align: left; line-height: 1.4; border-color: var(--green); color: var(--chip-text); font-weight: 700; }
.fill-btn:disabled { border-color: #C9D0CB; }
.fill-box .confirm { margin: 0; }
.fill-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.fill-list li { display: flex; gap: 10px; flex-wrap: wrap; padding: 4px 0; border-bottom: 1px dashed #E8D49A; }
.fill-list .fl-t { min-width: 9em; font-weight: 700; }
.fill-list .fl-v { min-width: 0; }
/* スマホ:タブ4つを1行に */
.tabs button { min-width: 0; padding: 0 2px; white-space: nowrap; }

/* ================= 追加3つ(2026-11-28) ================= */
/* 依頼2:ゴミ箱(一覧の3つめのボタン・カード・物件の上の帯・資料タブの下の「ゴミ箱に入れる」) */
.seg .seg-trash { flex: 0.8; }
.pc-left .seg { flex-wrap: wrap; }
.pc-left .seg button { padding: 0 6px; font-size: 13px; }
.card.is-trash { background: #F7F8F7; border-style: dashed; }
.card.is-trash .card-now { font-size: 14px; color: var(--sub2); }
.card-from { font-size: 13px; color: var(--sub); }
.trash-note { margin: 0 16px 10px; }
.pc-list .trash-note { margin: 0 0 12px; grid-column: 1 / -1; }
.chip-trash { background: #FDECEA; color: #7A1A14; }
.trash-banner { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin: 8px 16px 10px; padding: 12px; border-radius: 10px; background: #FDECEA; border: 1px solid #E8B4AE; color: #7A1A14; font-size: 14px; line-height: 1.6; }
.pc-main .trash-banner { margin: 0 0 4px; max-width: 760px; }
.trash-banner .tb-t { flex: 1 1 220px; min-width: 0; }
.trash-banner .tb-meta { font-size: 13px; }
.trash-banner .btn { flex: none; }
.trash-sec { margin-top: 28px; padding-top: 16px; border-top: 1px dashed var(--line); }
.trash-sec .confirm { margin: 8px 0 0; }
.trash-btn { margin-top: 4px; }
/* 依頼3:メモ(右の欄・修正シートの欄、PCの表の棒の下、スマホの週ごとのリスト) */
.ed-memo .k { display: block; }
.ed-memo-sub { font-size: 12px; font-weight: 400; color: var(--sub); }
.ed-memo textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 16px; line-height: 1.5; background: #fff; resize: vertical; min-height: 72px; }
.ed-memo textarea:disabled { background: #F1F3F1; color: var(--sub); }
.ed-memo-foot { display: flex; justify-content: space-between; gap: 4px 10px; flex-wrap: wrap; margin-top: 4px; font-size: 12px; color: var(--sub); }
.ed-memo-cnt { margin-left: auto; font-variant-numeric: tabular-nums; }
.ed-memo-cnt.is-over { color: #7A1A14; font-weight: 700; }
.ed-memo-ro .k { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.ed-memo-ro-t { white-space: pre-wrap; font-size: 14px; line-height: 1.6; background: var(--bg); border: 1px solid var(--line2); border-radius: 8px; padding: 8px 10px; overflow-wrap: anywhere; }
.c-memo { font-size: 11px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 3px; cursor: pointer; z-index: 2; }
.c-memo:hover { text-decoration: underline; }
.c-memo.is-sel { font-weight: 700; }
.wk-memo { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; margin-top: 2px; font-size: 13px; color: var(--sub2); line-height: 1.45; overflow-wrap: anywhere; }
button.row .wk-memo { display: -webkit-box; }
/* 選んだ棒(.c-bar.sel)が、選ぶ欄(select)の .sel の形(高さ44px以上・枠・文字16px)を受けて、行からはみ出していた(前からの不具合)。
   棒の形に戻す(追加3つで、棒の下のメモと重なったため見つけた) */
.c-bar.sel { min-height: 0; border: 0; padding: 0; font-size: 12px; border-radius: 4px; width: auto; }
.c-bar.c-bar-joto.sel { border: 2.5px solid var(--text); border-radius: 5px; }

/* ================= 試用7直し(2026-11-28) ================= */
/* 依頼1:見出しの札(上棟・今日)は札だけの段。月の見出しは、その下の段 */
.c-jotopill, .c-todaypill { z-index: 2; }
/* 依頼2:分かれた棒で、どこにも名前を出す所が無いときは、白い下地の札で重ねて出す */
.c-blabel.is-over { z-index: 2; }
.c-blabel.is-over span { background: #fff; border: 1px solid currentColor; border-radius: 4px; padding: 0 3px; line-height: 18px; }
/* 依頼3:ゴミ箱からの完全削除(管理者だけ)。画面の中の確認(物件名を入れる)・記録 */
.btn-danger { background: #9B1C14; border-color: #9B1C14; color: #fff; font-weight: 700; }
.btn-danger:disabled { background: #E9C9C5; border-color: #E9C9C5; color: #7A1A14; cursor: not-allowed; }
.card-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.trash-banner .tb-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.purge-confirm { background: #FDECEA; border-color: #E8B4AE; color: #5E140F; }
.purge-confirm .purge-q { display: block; font-size: 15px; margin-bottom: 4px; }
.purge-confirm .purge-name { overflow-wrap: anywhere; }
.purge-field { margin-top: 10px; }
.purge-field input { width: 100%; }
.purge-box { margin: 0 16px 10px; }
.purge-box .purge-confirm { margin: 0; }
.pc-main .purge-box { margin: 0 0 8px; max-width: 760px; }
.purge-log { margin: 16px 0 24px; padding: 14px 16px; background: #fff; border: 1px solid var(--line2); border-radius: 14px; }
.purge-log h2 { font-size: 16px; margin: 0 0 4px; }
.pl-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.pl-list li { display: flex; flex-wrap: wrap; gap: 2px 8px; border-top: 1px solid var(--line3); padding-top: 8px; }
.pl-list .pl-at { color: var(--sub); font-size: 13px; }
/* 依頼4:ホームのカードの「ゴミ箱へ」(PCの現場画面の左の一覧には置かない。SHOさんの回答 2026-11-28)。完了済みにする(右)とは反対側(左)に、小さく目立たない形。押せる広さは 44px 以上 */
.card-foot .card-meta { flex: 1 1 100%; }
.card-ops { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; }
.card-ops .btn-text { margin-left: auto; }
.btn-trash-sm { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; min-width: 44px; padding: 0 8px 0 2px; border: 0; background: transparent; color: var(--sub); font-size: 12px; font-weight: 500; white-space: nowrap; cursor: pointer; border-radius: 8px; }
.btn-trash-sm:hover { color: #7A1A14; background: #FDECEA; }
.btn-trash-sm:focus-visible { outline: 3px solid #1C64F2; outline-offset: 1px; }
.btn-trash-sm svg { flex: none; }
/* 依頼7:設定→業者の「すべての物件に、標準の業者を入れる」 */
.fillall { margin-top: 28px; padding-top: 4px; border-top: 1px solid var(--line2); max-width: 760px; }
.fillall .confirm { margin: 8px 0 0; }
.fillall .fa-n { flex: 1 1 auto; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.fillall .fa-c { flex: none; }
.fillall .fa-more { color: var(--sub); }
.cards .purge-log, .cards .trash-note { grid-column: 1 / -1; }
/* 段階2A(2026-11-30):予備日(灰色)と引渡し(目立つ色+太い黒の枠。白黒でも枠と「引渡し」の文字で分かる)。色は棒の style(工種のまとまりの色) */
.c-bar.g-yobi { color: var(--text); }
.c-bar.g-hiki, .c-bar.g-hiki.sel { border: 2.5px solid var(--text); border-radius: 5px; box-shadow: 0 0 0 1px #fff inset; }
.c-blabel[data-key="引渡し"] { font-weight: 800; }
.def-same { flex: 1 1 100%; margin: 2px 0 0; font-size: 12px; color: var(--sub); line-height: 1.5; }
.old-rule { border-left: 3px solid var(--line2); padding-left: 8px; }
.c-blabel[data-key="予備日"] { color: var(--sub) !important; } /* 灰色の棒の外の名前は、読みやすい濃さに */

/* ---------- 段階2B(2026-11-30):日付を押して休みにする ---------- */
/* 日付・曜日の見出しは押せる(透明のボタンを重ねる)。会社の休み・この現場の休みは、列に斜めの縞・見出しに薄い橙 */
.c-dayhit { border: 0; padding: 0; margin: 0; background: transparent; cursor: pointer; border-radius: 4px; z-index: 1; }
.c-dayhit:hover { background: rgba(28,100,242,.10); }
.c-dayhit:focus-visible { outline: 2px solid var(--today); outline-offset: -2px; }
.c-off.rest { background: repeating-linear-gradient(135deg, #F3E3CF 0 4px, #E3E7E4 4px 8px); }
.c-day.rest { background: #F6E2C8; color: #7A3E00; }
.dp-back { position: fixed; inset: 0; background: rgba(27,42,36,.55); z-index: 50; }
.dp { position: fixed; z-index: 51; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(460px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto;
  background: #fff; border-radius: 16px; padding: 12px 16px 16px; box-shadow: 0 12px 32px rgba(27,42,36,.25); }
.dp-head { display: flex; align-items: center; gap: 8px; margin: 0 -8px 4px 0; }
.dp-head h2 { flex: 1; min-width: 0; margin: 0; font-size: 19px; }
.dp-lead { font-size: 16px; font-weight: 700; margin: 4px 0 8px; }
.dp-state { font-size: 14px; margin: 0 0 4px; color: var(--sub2); }
.dp-set { border: 0; padding: 0; margin: 0 0 12px; }
.dp-set legend { font-size: 13px; font-weight: 700; color: var(--sub); padding: 0; margin-bottom: 6px; }
.dp-radio { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; cursor: pointer; }
.dp-radio.is-on { border: 2px solid var(--green); padding: 9px 11px; background: #F2F7F4; }
.dp-radio input { margin: 3px 0 0; width: 18px; height: 18px; flex: none; accent-color: var(--green); }
.dp-radio b { display: block; font-size: 15px; }
.dp-radio small { display: block; font-size: 13px; color: var(--sub2); line-height: 1.5; margin-top: 2px; }
.dp-quick { font-size: 14px; margin: 4px 0 12px; padding: 8px 10px; border-radius: 8px; background: var(--bg); line-height: 1.7; }
.dp-big { font-size: 17px; margin: 8px 0; line-height: 1.5; }
.dp-dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 10px; font-size: 14px; }
.dp-dl dt { color: var(--sub); }
.dp-dl dd { margin: 0; font-weight: 700; }
.dp-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 6px 0 10px; }
.dp-nums > div { background: var(--bg); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.dp-nums span { font-size: 12px; color: var(--sub); line-height: 1.3; }
.dp-nums b { font-size: 15px; line-height: 1.3; }
.dp-moved { list-style: none; margin: 4px 0 8px; padding: 0; border-top: 1px solid var(--line3); font-size: 13px; }
.dp-moved li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; padding: 6px 0; border-bottom: 1px solid var(--line3); }
.dp-moved li span { color: var(--sub2); }
.dp-more, .dp-note { font-size: 13px; color: var(--sub2); margin: 4px 0 8px; line-height: 1.6; }
.dp-alert { margin: 8px 0; }
.dp-buttons { display: flex; gap: 8px; margin-top: 12px; }
.dp-buttons .btn { flex: 1; }

/* ---------- 段階2C(2026-11-30):空白のドラッグで足した工程 ---------- */
/* 足した工程:白地+点線の枠+濃い文字(白黒でも、工種の工程=色の棒と見分けられる) */
.c-bar.g-custom, .c-bar.g-custom.sel { background: #fff; color: var(--text); border: 2px dashed var(--text); border-radius: 4px; line-height: normal !important; display: flex; align-items: center; }
.c-bar.g-custom .c-bt { padding-left: 3px; }
.c-bar.g-custom.sel { outline: 2px solid var(--today); outline-offset: 1px; }
.legend i.lg-custom { background: #fff; border: 2px dashed var(--text); }
.row .stripe.is-custom, .det-head .stripe.is-custom { background: repeating-linear-gradient(180deg, var(--text) 0 4px, #fff 4px 7px) !important; border: 1px solid var(--text); }
.tag-custom { display: inline-block; font-size: 12px; font-weight: 700; color: var(--text); border: 1.5px dashed var(--text); border-radius: 6px; padding: 0 5px; margin-left: 6px; line-height: 1.5; white-space: nowrap; }
/* ドラッグ中・入力中の「足す位置」(青い点線) */
.c-mk { border: 2px dashed var(--today); background: rgba(28,100,242,.12); border-radius: 4px; pointer-events: none; z-index: 3; }
body.is-making, body.is-making * { cursor: col-resize !important; user-select: none; }
/* 「工程を追加」の小さな入力欄(離した所の近く) */
.ad-back { position: fixed; inset: 0; z-index: 50; background: rgba(27,42,36,.18); }
.ad { position: fixed; z-index: 51; left: 8px; top: 8px; width: min(340px, calc(100vw - 16px)); max-height: calc(100dvh - 16px); overflow-y: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 14px; box-shadow: 0 12px 32px rgba(27,42,36,.28); }
.ad-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ad-head h2 { margin: 0; font-size: 17px; }
.ad-row { font-size: 13px; color: var(--sub); }
.ad-k { display: block; font-size: 13px; font-weight: 700; color: var(--sub2); margin: 10px 0 4px; }
.ad-k small { font-weight: 400; margin-left: 4px; }
.ad input, .ad textarea, .ed-cname .ed-text { width: 100%; min-height: 40px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 16px; }
.ad textarea { min-height: 56px; resize: vertical; }
.ad-2 { display: grid; grid-template-columns: minmax(0, 1fr) 92px; gap: 8px; }
.ad-cnt { font-size: 12px; color: var(--sub); margin-top: 2px; }
.ad-info { font-size: 13px; margin: 6px 0 0; line-height: 1.6; }
.ad-info.is-warn { color: #5C4300; }
.ad-hint { font-size: 12px; color: var(--sub); margin: 8px 0 0; line-height: 1.6; }
.ad .msg { margin: 8px 0 0; }
/* スマホの「+追加」(今日の行の右) */
.today-line { display: flex; align-items: center; gap: 8px; }
.today-line .add-btn { margin-left: auto; min-height: 40px; padding: 0 14px; font-weight: 700; border: 1.5px dashed var(--text); background: #fff; }
.ed-del { align-self: flex-start; }
.ed-del-ask { border: 1px solid #E9C9C5; background: #FFF6F5; border-radius: 10px; padding: 10px; }
.ed-del-t { margin: 0 0 8px; font-size: 14px; font-weight: 700; }
.c-bar.g-custom.can-drag .c-bt { padding-left: 9px; } /* 選んだときの左のつまみと、名前が重ならないように */

/* ---------- 段階2E:変更履歴(全体) ---------- */
/* PCの上の帯の時計のボタン(アカウント名とログアウトの間) */
.topbar .hist-btn { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: #fff; border: 1px solid rgba(255,255,255,.4); text-decoration: none; }
.topbar .hist-btn:hover { background: rgba(255,255,255,.1); }
.topbar .hist-btn[aria-current="page"] { background: #fff; color: var(--text); border-color: #fff; }
.topbar .hist-btn .icon { width: 22px; height: 22px; }
/* スマホの☰メニューの中 */
.m-nav a.m-nav-hist { gap: 10px; border-top: 1px solid var(--line3); border-radius: 0; margin-top: 4px; }
.m-nav a.m-nav-hist .icon { width: 22px; height: 22px; flex: none; }
.m-nav a.m-nav-hist + button { margin-top: 0; }
/* 絞り込み */
.hist-filter { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: end; background: #fff; border: 1px solid var(--line2); border-radius: 12px; padding: 12px; margin: 0 0 10px; }
.hist-f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hist-f > span { font-size: 13px; font-weight: 700; color: var(--sub2); }
.hist-f .sel { min-width: 0; text-overflow: ellipsis; }
.hist-clear { grid-column: 1 / -1; justify-self: start; min-height: 40px; font-size: 14px; }
@media (max-width: 640px) {
  .hist-filter { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .hist-f-p { grid-column: 1 / -1; }
}
/* 一覧 */
.hist-list { list-style: none; margin: 0; padding: 0; }
.hist-day h2 { font-size: 14px; color: var(--sub2); margin: 16px 2px 6px; font-variant-numeric: tabular-nums; }
.hist-list > li:first-child.hist-day h2 { margin-top: 6px; }
.hist-row { display: block; background: #fff; border: 1px solid var(--line2); border-radius: 12px; padding: 10px 12px; margin: 0 0 8px; color: var(--text); text-decoration: none; overflow-wrap: anywhere; line-break: strict; }
.hist-row.is-link:hover { border-color: var(--green); }
.hist-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; color: var(--sub); }
.hist-at { font-variant-numeric: tabular-nums; }
.hist-user { color: var(--text); font-size: 14px; }
.hist-type { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 6px; padding: 1px 7px; border: 1.5px solid currentColor; white-space: nowrap; background: #fff; }
.ht-project { color: var(--green); }
.ht-vendor { color: var(--blue); }
.ht-cset { color: var(--purple); }
.ht-holiday { color: var(--orange); }
.ht-account { color: var(--sub2); border-style: dashed; }
.hist-target { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 15px; font-weight: 700; min-width: 0; }
.hist-pname { min-width: 0; overflow-wrap: anywhere; }
.is-link .hist-pname { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.hist-go { margin-left: auto; font-size: 22px; line-height: 1; color: var(--sub); flex: none; }
.chip-trash { background: #FDECEA; color: #7A1A14; font-size: 12px; padding: 2px 8px; }
.hist-sum { margin-top: 4px; font-size: 14px; line-height: 1.6; color: var(--sub2); white-space: pre-line; }
.hist-note { margin-top: 4px; font-size: 12px; color: #7A1A14; }
.hist-more { display: flex; justify-content: center; margin: 12px 0 8px; }
.hist-more .btn { min-width: 200px; }
.hist-end { text-align: center; font-size: 13px; color: var(--sub); margin: 12px 0; }

/* ---------- 段階2F(2026-11-30):見た目の直し ---------- */
/* 足した工程:点線の枠と文字を、その行の工種のまとまりの色に(--rc。決まらない行は黒のまま)。地は白・点線のまま(白黒でも見分けられる) */
.c-bar.g-custom.has-rc { border-color: var(--rc, var(--text)); color: var(--rc, var(--text)); }
.row .stripe.is-custom, .det-head .stripe.is-custom { background: repeating-linear-gradient(180deg, var(--rc, var(--text)) 0 4px, #fff 4px 7px) !important; border-color: var(--rc, var(--text)); }
.tag-custom { color: var(--rc, var(--text)); border-color: var(--rc, var(--text)); }
/* 予備日・引渡しは、行ではなく「列の塗り」(列の札の段から表のいちばん下まで)。棒より後ろ。押しても何も起きない(下の空白の操作はそのまま)。
   日曜・祝日・休みの列(灰色・斜めの縞)の上に、すけて見える薄い色で重ねる。両わきの線と上の札(予備/引渡)で、日曜・祝日の灰色の列とも見分けられる */
.c-col { pointer-events: none; }
.c-col.g-yobi { background: rgba(154,161,157,.30); border-left: 1.5px dashed #6F7772; border-right: 1.5px dashed #6F7772; }
.c-col.g-hiki { background: rgba(194,24,91,.13); border-left: 2px solid #C2185B; border-right: 2px solid #C2185B; }
.c-col.is-sel { box-shadow: inset 0 0 0 2px var(--today); }
.c-col.is-moved, .c-collab.is-moved { opacity: .35; }
.c-day { z-index: 1; } /* 日付の数字は、列の塗りより手前 */
.c-collab { height: 15px; line-height: 13px; padding: 0; margin: 0; text-align: center; font-weight: 800; white-space: nowrap; overflow: hidden; border-radius: 3px; z-index: 2; cursor: pointer; letter-spacing: 0; font-family: inherit; }
.c-collab.g-yobi { background: #9AA19D; color: var(--text); border: 1px solid #6F7772; }
.c-collab.g-hiki { background: #C2185B; color: #fff; border: 1.5px solid var(--text); }
.c-collab.is-sel { outline: 2px solid var(--today); outline-offset: 1px; }
.c-collab:focus-visible { outline: 2px solid var(--today); outline-offset: 1px; }
@media (hover: hover) and (pointer: fine) { .c-collab.can-drag { cursor: grab; } }
/* 直しかけ(未保存)の位置:点線の列+点線の札 */
.c-ghostcol { pointer-events: none; border-left: 2px dashed var(--text); border-right: 2px dashed var(--text); background: color-mix(in srgb, var(--gc) 22%, transparent); z-index: 1; }
.c-ghost.is-col { border-width: 1.5px; border-radius: 3px; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; color: var(--text); z-index: 3; }
.c-ghost.is-col span { background: #fff; border-radius: 2px; padding: 0; line-height: 11px; white-space: nowrap; letter-spacing: 0; }
.legend i.lg-col { border-radius: 0; }
.legend i.lg-col.g-yobi { background: rgba(154,161,157,.45); border-left: 1.5px dashed #6F7772; border-right: 1.5px dashed #6F7772; }
.legend i.lg-col.g-hiki { background: rgba(194,24,91,.25); border-left: 2px solid #C2185B; border-right: 2px solid #C2185B; }

/* ---------- 段階2H(2026-11-30):設定 → 会社の休み ---------- */
.ch-list { list-style: none; margin: 0; padding: 0; max-width: 640px; }
.ch-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; background: #fff; border: 1px solid var(--line2); border-radius: 12px; padding: 12px; margin: 0 0 8px; overflow-wrap: anywhere; line-break: strict; }
.ch-row.is-past { background: #F7F8F7; }
.ch-row.is-open { border-color: var(--green); }
.ch-main { flex: 1 1 220px; min-width: 0; }
.ch-d { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 16px; }
.ch-who { margin-top: 4px; font-size: 13px; color: var(--sub2); }
.ch-who b { color: var(--text); margin-right: 4px; }
.ch-why { margin: 4px 0 0; font-size: 13px; color: var(--sub2); line-height: 1.6; }
.ch-act { flex: none; margin-left: auto; }
.ch-act .btn { min-height: 44px; }
.ch-panel { flex: 1 1 100%; min-width: 0; border-top: 1px solid var(--line3); padding-top: 10px; }
