/* =========================================================================
   建築設計 実務支援 — デザインの基本
   生成り色の紙、墨の文字、くすんだ深緑の差し色。余白を大きく、文字はゆったり。
   ========================================================================= */
:root {
  --paper: #f5f2ec;          /* 背景：生成り */
  --panel: #fffdf9;          /* カード */
  --panel-2: #f9f6f0;        /* 入れ子の面 */
  --ink: #2b2925;            /* 本文：墨 */
  --ink-2: #4a463f;
  --sub: #7b756b;            /* 補足 */
  --line: #e6e0d4;           /* 罫線 */
  --line-2: #d8d0c1;
  --accent: #3e6b5a;         /* 差し色：深緑 */
  --accent-2: #2f5446;
  --accent-bg: #e9f0ec;
  --brass: #a8814c;          /* 小さな強調：真鍮 */
  --warn: #b0543f;  --warn-bg: #f8e9e4;    /* 注意：テラコッタ */
  --check: #9a7121; --check-bg: #f7efdc;   /* 要確認：黄土 */
  --ok: #4d7757;    --ok-bg: #e7f0e8;      /* 良好：苔 */
  --info: #4b6883;  --info-bg: #e8eef4;    /* 情報：青鼠 */
  --radius: 14px;
  --radius-s: 9px;
  --shadow: 0 1px 2px rgba(43, 41, 37, .04), 0 6px 20px rgba(43, 41, 37, .05);
  --font: "Zen Kaku Gothic New", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-2); }
b, strong { font-weight: 700; }
::selection { background: #d9e6df; }

/* ---- アプリの骨格：左サイドメニュー＋本文 ---------------------------------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: #2f2d29; color: #e9e4da; padding: 26px 16px 18px;
  display: flex; flex-direction: column; gap: 6px;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 0 8px 18px; border-bottom: 1px solid #45423c; margin-bottom: 10px; }
.brand .mark {
  width: 38px; height: 38px; border-radius: 11px; background: #e9e4da; color: #2f2d29;
  display: grid; place-items: center; flex: none;
}
.brand .name { font-weight: 700; font-size: 17px; letter-spacing: .12em; line-height: 1.35; }
.brand .name small { display: block; font-weight: 400; font-size: 10.5px; letter-spacing: .14em; color: #a9a295; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group { font-size: 11px; letter-spacing: .16em; color: #948d80; padding: 16px 12px 6px; }
.sidebar nav button {
  display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: center; text-align: left;
  width: 100%; border: 0; background: transparent; color: #d9d3c7; cursor: pointer;
  padding: 9px 12px; border-radius: 10px; font: inherit; font-size: 14px; line-height: 1.35;
}
.sidebar nav button small { display: block; font-size: 11px; color: #9c958a; margin-top: 1px; }
.sidebar nav button svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sidebar nav button:hover { background: #3a3833; color: #fff; }
.sidebar nav button.active { background: #e9e4da; color: #2b2925; font-weight: 700; }
.sidebar nav button.active small { color: #6f695f; }
.side-foot { margin-top: auto; padding: 16px 8px 0; border-top: 1px solid #45423c; font-size: 12.5px; color: #b8b1a4; }
.side-foot .who { color: #e9e4da; font-weight: 700; margin-bottom: 8px; line-height: 1.5; }
.side-foot button { background: transparent; color: #cfc8bb; border: 1px solid #56524b; border-radius: 8px; padding: 5px 12px; font: inherit; font-size: 12px; cursor: pointer; }
.side-foot button:hover { color: #fff; border-color: #8a8478; }
.side-foot .ver { margin-top: 10px; font-size: 10.5px; color: #8a8478; line-height: 1.6; }

.content { min-width: 0; }
.pagehead { padding: 34px 40px 6px; max-width: 1360px; }
.pagehead .eyebrow { font-size: 11.5px; letter-spacing: .2em; color: var(--brass); font-weight: 700; }
.pagehead h1 { font-size: 26px; margin: 4px 0 6px; letter-spacing: .02em; font-weight: 700; }
.pagehead p { margin: 0; color: var(--sub); max-width: 760px; font-size: 14.5px; }
main { padding: 22px 40px 60px; max-width: 1360px; }

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 14px 12px; }
  .brand { border: 0; padding-bottom: 6px; margin: 0; }
  .sidebar nav { flex-direction: row; overflow-x: auto; gap: 4px; }
  .nav-group { display: none; }
  .sidebar nav button { grid-template-columns: 18px auto; white-space: nowrap; width: auto; }
  .sidebar nav button small { display: none; }
  .side-foot { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
  .side-foot .who { margin: 0; }
  .pagehead, main { padding-left: 16px; padding-right: 16px; }
  .side-foot .ver { display: none; }
}

/* ---- タブ・カード・レイアウト ---------------------------------------------- */
.tab { display: none; }
.tab.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.cols { display: grid; grid-template-columns: 400px 1fr; gap: 22px; align-items: start; }
@media (max-width: 1100px) { .cols { grid-template-columns: 1fr !important; } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 20px; }
.panel h2 { font-size: 17px; margin: 0 0 14px; letter-spacing: .02em; display: flex; align-items: center; gap: 10px; }
.panel h3 {
  font-size: 13px; margin: 22px 0 10px; color: var(--ink-2); letter-spacing: .06em;
  display: flex; align-items: center; gap: 8px;
}
.panel h3::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.hint { font-size: 12.5px; color: var(--sub); line-height: 1.7; }
.lead { color: var(--sub); font-size: 13.5px; margin: -6px 0 14px; }

/* ステップ見出し（①②③） */
.step { display: flex; align-items: center; gap: 10px; margin: 24px 0 12px; font-weight: 700; font-size: 14px; color: var(--ink); }
.step:first-of-type { margin-top: 8px; }
.step .n {
  width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none;
}
.step small { font-weight: 400; color: var(--sub); font-size: 12px; }
details.more { margin: 6px 0 4px; border: 1px dashed var(--line-2); border-radius: var(--radius-s); padding: 2px 14px; background: var(--panel-2); }
details.more > summary { cursor: pointer; padding: 9px 0; font-size: 13px; color: var(--ink-2); list-style: none; }
details.more > summary::before { content: "＋"; color: var(--accent); margin-right: 8px; font-weight: 700; }
details.more[open] > summary::before { content: "－"; }
details.more[open] { padding-bottom: 10px; }

/* ---- フォーム ------------------------------------------------------------- */
label.f { display: block; margin-bottom: 12px; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
label.f > span { display: block; margin-bottom: 5px; }
label.f.inline { display: flex; gap: 8px; align-items: center; font-weight: 400; }
label.f.inline > span { display: inline; margin: 0; }
input, select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-s);
  font: inherit; font-size: 14px; color: var(--ink); background: #fff; line-height: 1.5;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(62, 107, 90, .15); }
input::placeholder, textarea::placeholder { color: #b3ab9d; }
textarea { min-height: 72px; resize: vertical; }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237b756b' stroke-width='2.2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.inline { display: flex; gap: 8px; align-items: center; }
input.from-gis, select.from-gis { background-color: #fbf5e6; border-color: #dcc48e; }

button, .btn {
  font: inherit; font-size: 13.5px; padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line-2);
  background: #fff; color: var(--ink); cursor: pointer; white-space: nowrap; transition: all .15s;
}
button:hover { border-color: var(--ink-2); }
button.primary { background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 700; padding: 10px 22px; }
button.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
button.small { padding: 4px 12px; font-size: 12px; }
button:disabled { opacity: .45; cursor: default; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; align-items: center; }

/* ---- 表示の部品 ----------------------------------------------------------- */
.badge { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: #efebe3; color: var(--sub); line-height: 1.9; white-space: nowrap; }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.check { background: var(--check-bg); color: var(--check); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.info { background: var(--info-bg); color: var(--info); }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.summary .kpi { background: var(--panel-2); border: 1px solid var(--line); padding: 12px 16px; border-radius: 12px; min-width: 0; }
.summary .kpi-wide { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 14px; }
.summary .kpi .kpi-text { font-size: 16px; }
.summary .kpi .kpi-of { font-size: 14px; color: var(--sub); font-weight: 400; }
.summary .kpi b { display: block; font-size: 22px; letter-spacing: .01em; font-variant-numeric: tabular-nums; line-height: 1.4; }
.summary .kpi small { color: var(--sub); font-size: 11.5px; letter-spacing: .04em; }
.empty { color: var(--sub); padding: 40px 20px; text-align: center; font-size: 14px; background: var(--panel-2); border-radius: 12px; border: 1px dashed var(--line-2); }

/* 判定結果のカード */
.item { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px 14px; margin-bottom: 12px; background: #fff; position: relative; }
.item::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--line-2); }
.item.lv-warn::before { background: var(--warn); }
.item.lv-check::before { background: #d4a940; }
.item.lv-info::before { background: var(--accent); }
.item.na { opacity: .55; }
.item .head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.item .head .cat { font-size: 11px; color: var(--sub); letter-spacing: .08em; }
.item .head .title { font-weight: 700; font-size: 15px; }
.item .result { margin: 6px 0 4px; font-size: 14.5px; line-height: 1.7; }
.item ul.detail { margin: 6px 0; padding-left: 18px; color: var(--sub); font-size: 13px; }
ul.detail li { margin-bottom: 2px; }
details.cites { margin-top: 8px; }
details.cites > summary { cursor: pointer; font-size: 12.5px; color: var(--accent); list-style: none; display: inline-flex; gap: 6px; align-items: center; }
details.cites > summary::before { content: "›"; display: inline-block; transition: transform .15s; font-weight: 700; }
details.cites[open] > summary::before { transform: rotate(90deg); }
.cite { font-size: 13px; padding: 9px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; margin-top: 6px; }
.cite .lbl { font-weight: 700; }
.cite details summary { cursor: pointer; color: var(--sub); font-size: 12px; margin-top: 3px; }
.cite .ex { color: var(--sub); font-size: 12.5px; line-height: 1.75; margin-top: 4px; }
.cite.office { background: var(--ok-bg); border-color: #cfe0d2; }
.cite.local { background: #fbf6ea; border-color: #ecdfbf; }
.learn { margin-top: 10px; font-size: 13px; background: var(--ok-bg); padding: 10px 14px; border-radius: 10px; }
.learn.past { background: var(--check-bg); }
.review { margin-top: 10px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.review .done { font-size: 12.5px; }
.fixform { margin-top: 10px; padding: 14px; border: 1px dashed var(--line-2); border-radius: 12px; background: var(--panel-2); }

table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th, table.t td { border-bottom: 1px solid var(--line); padding: 10px 10px; text-align: left; vertical-align: top; }
table.t th { font-size: 12px; color: var(--sub); font-weight: 700; background: var(--panel-2); letter-spacing: .04em; }
table.t td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.clickable { cursor: pointer; transition: background .12s; }
tr.clickable:hover { background: var(--accent-bg); }

.ua-big { font-size: 46px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.ua-big small { font-size: 13.5px; color: var(--sub); font-weight: 400; letter-spacing: 0; }
.bar { height: 8px; background: #eee9df; border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.part { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; background: #fff; }
.part .ph { display: grid; grid-template-columns: 1.3fr 1fr .8fr .6fr auto; gap: 8px; align-items: end; }
.layers { margin-top: 8px; }
.layer { display: grid; grid-template-columns: 22px 1fr 90px 64px auto; gap: 6px; align-items: center; margin-bottom: 5px; font-size: 12.5px; }
.layer input, .layer select { padding: 6px 10px; font-size: 13px; }
.layer .n { color: var(--sub); text-align: center; font-size: 11px; }
.layer .r { color: var(--sub); font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; }
.frame { display: grid; grid-template-columns: auto 80px auto 1fr; gap: 8px; align-items: center; font-size: 12.5px; margin-top: 8px; color: var(--sub); }
.frame input, .frame select { padding: 6px 10px; font-size: 13px; }
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px; font-size: 13.5px; opacity: 0; transform: translateY(8px); transition: all .2s; pointer-events: none; z-index: 50; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: none; }
.disclaimer { font-size: 12px; color: var(--sub); border-top: 1px solid var(--line); margin-top: 16px; padding-top: 10px; line-height: 1.75; }

/* ---- ホーム ------------------------------------------------------------- */
.home-hero { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 34px 38px; margin-bottom: 22px; box-shadow: var(--shadow);
  background-image: radial-gradient(circle at 92% 20%, #efe7d6 0, transparent 38%), linear-gradient(135deg, #fffdf9, #f8f4ec); }
.home-hero h2 { font-size: 24px; margin: 0 0 10px; letter-spacing: .02em; line-height: 1.55; }
.home-hero p { margin: 0; color: var(--sub); max-width: 680px; }
.home-hero .actions { margin-top: 20px; }
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 1100px) { .pillars { grid-template-columns: 1fr; } }
.pillar { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s, border-color .15s; }
.pillar:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: 0 2px 4px rgba(43,41,37,.05), 0 12px 28px rgba(43,41,37,.08); }
.pillar .icon { width: 46px; height: 46px; border-radius: 13px; background: var(--accent-bg); color: var(--accent); display: grid; place-items: center; }
.pillar .icon svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.pillar .pn { font-size: 11px; letter-spacing: .2em; color: var(--brass); font-weight: 700; }
.pillar h3 { margin: 0; font-size: 19px; }
.pillar h3::after { display: none; }
.pillar p { margin: 0; font-size: 13.5px; line-height: 1.85; color: var(--ink-2); flex: 1; }
.pillar .stats { font-size: 12px; color: var(--sub); border-top: 1px solid var(--line); padding-top: 10px; }
.pillar .go { font-size: 13px; font-weight: 700; color: var(--accent); }
.arrow { display: none; }
.extra { padding: 14px 4px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13.5px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.extra:last-of-type { border-bottom: 0; }
.extra b { font-size: 14.5px; }
.extra:hover b { color: var(--accent); }

/* ---- ターム比較 ----------------------------------------------------------- */
.term-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; background: #fff; }
.term-card.locked { border-left: 3px solid var(--accent); }
.term-card .head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.term-card .head b { font-size: 15px; }
.term-card .nums { font-size: 12.5px; color: var(--sub); margin: 6px 0; }
.dec-row { display: grid; grid-template-columns: 130px 1fr 1fr 1fr 28px; gap: 6px; margin-bottom: 6px; }
.dec-row input, .dec-row select { font-size: 12.5px; padding: 6px 9px; }
td.chg { background: #fbf4e2; }
td.chg .d { color: var(--check); font-size: 11px; display: block; }
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 16px; }
@media (max-width: 1000px) { .charts { grid-template-columns: 1fr; } }
.chart { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.chart h4 { font-size: 12.5px; margin: 0 0 6px; color: var(--ink-2); font-weight: 700; }
.chart svg { width: 100%; height: auto; display: block; }
.impact { border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin-top: 16px; background: #fff; }
.impact.lv-2 { border-left: 3px solid #d4a940; } .impact.lv-3 { border-left: 3px solid var(--warn); }
.impact .big { font-size: 20px; font-weight: 700; }
.impact .talk { background: var(--accent-bg); padding: 14px 16px; border-radius: 12px; line-height: 1.95; margin-top: 8px; font-size: 14px; }

/* ---- スケジュール --------------------------------------------------------- */
.gantt { position: relative; margin: 8px 0 4px; }
.gantt .row { display: grid; grid-template-columns: 96px 1fr; align-items: center; height: 32px; }
.gantt .lbl { font-size: 12.5px; color: var(--ink-2); }
.gantt .track { position: relative; height: 14px; background: #efeae1; border-radius: 99px; }
.gantt .bar { position: absolute; top: 0; height: 14px; border-radius: 99px; background: #c9c1b2; }
.gantt .bar.cur { background: var(--accent); }
.gantt .today { position: absolute; top: -5px; bottom: -5px; width: 2px; background: var(--warn); border-radius: 2px; }
.gantt .ms { position: absolute; top: 1px; width: 12px; height: 12px; transform: translateX(-6px) rotate(45deg); background: var(--ink); border: 2px solid var(--panel); }
.gantt .axis { display: grid; grid-template-columns: 96px 1fr; font-size: 11px; color: var(--sub); margin-top: 4px; }
.gantt .axis .ticks { position: relative; height: 16px; }
.gantt .axis .ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.task-row td { vertical-align: middle; }
.task-row.done { opacity: .5; }
.part-row { display: grid; grid-template-columns: minmax(0, 1fr) 62px 62px 32px; gap: 6px; margin-bottom: 6px; align-items: center; }
.part-row .p-del { padding: 0; width: 32px; height: 32px; }
.part-row input { font-size: 13px; padding: 7px 10px; }

/* ---- 印刷（協議用チェックシート・工程表・説明シート） -------------------------- */
#print-area { display: none; }
@media print {
  @page { size: A4 portrait; margin: 12mm; }
  body { background: #fff; }
  .app { display: none !important; }
  #print-area { display: block; font-size: 10.5px; font-family: var(--font); }
  #print-area h1 { font-size: 16px; margin: 0 0 4px; }
  #print-area .meta { font-size: 10px; color: #444; margin-bottom: 8px; }
  #print-area table { width: 100%; border-collapse: collapse; }
  #print-area th, #print-area td { border: 1px solid #999; padding: 4px 5px; vertical-align: top; }
  #print-area th { background: #eee; }
  #print-area tr { page-break-inside: avoid; }
  #print-area .u { font-size: 9px; color: #444; word-break: break-all; }
  #print-area .chk { width: 70px; }
  #print-area h2 { font-size: 12px; margin: 12px 0 4px; }
  #print-area .no { width: 22px; text-align: center; }
  #print-area td.ans { height: 40px; }
}

/* ---- 上部の案件バー・ホーム（今日の確認） ------------------------------------------ */
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.pagehead-main { flex: 1 1 420px; min-width: 0; }
.projbar { display: flex; gap: 10px; align-items: flex-end; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow); }
.projbar label { display: block; }
.projbar label span { display: block; font-size: 11px; color: var(--sub); letter-spacing: .06em; margin-bottom: 2px; }
.projbar select { min-width: 150px; max-width: 280px; padding: 7px 30px 7px 10px; font-size: 14px; font-weight: 700; }
.projbar #g-stage { min-width: 120px; font-weight: 500; }
.proj-local { display: none !important; }
.proj-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.proj-head h2 { margin: 0 0 2px; font-size: 21px; }
.stages { display: flex; gap: 0; }
.stage { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 66px; font-size: 11.5px; color: var(--sub); position: relative; }
.stage i { width: 11px; height: 11px; border-radius: 50%; background: var(--line-2); z-index: 1; }
.stage::before { content: ""; position: absolute; top: 5px; left: -50%; width: 100%; height: 2px; background: var(--line-2); }
.stage:first-child::before { display: none; }
.stage.past i, .stage.past::before, .stage.now::before { background: var(--accent); }
.stage.now i { background: var(--accent); box-shadow: 0 0 0 4px rgba(62, 107, 90, .18); }
.stage.now span { color: var(--ink); font-weight: 700; }
.work { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 1100px) { .work { grid-template-columns: 1fr; } }
.work-card { display: flex; flex-direction: column; margin: 0 !important; }
.work-card .actions { margin-top: auto; padding-top: 12px; }
.work-head { display: flex; justify-content: space-between; align-items: baseline; }
.work-head h3 { margin: 0; font-size: 15px; }
.work-head b { font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; color: var(--accent); }
.work-row { display: flex; flex-direction: column; gap: 1px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; line-height: 1.6; }
.work-row b { font-weight: 600; }
.work-row.check { flex-direction: row; gap: 10px; align-items: flex-start; cursor: pointer; }
.work-row.check input { width: auto; margin-top: 5px; flex: none; }
tr.sel td { background: var(--panel-2); }

/* ---- 提出書類 --------------------------------------------------------------------- */
.fd-docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 14px; }
.fd-doc { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 14px 16px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); cursor: pointer; }
.fd-doc:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.fd-doc-t { font-weight: 700; font-size: 14.5px; color: var(--ink); }
.fd-doc .bar { width: 100%; margin: 6px 0 2px; }
.fd-miss { color: #b3261e; font-size: 12.5px; font-weight: 700; }
.fd-ok { color: var(--accent); font-size: 12.5px; font-weight: 700; }
.fd-check { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.fd-check:first-child { border-top: 0; }
.fd-check .badge { flex: none; margin-top: 2px; }
table.fd-rec td { vertical-align: top; }
table.fd-rec select, table.fd-rec input { font-size: 12.5px; padding: 4px 6px; }
table.fd-rec .fr-st { min-width: 92px; }
.fd-dates input[type=date] { width: 140px; margin: 2px 0; }
.fd-dates .fr-no { width: 100%; margin-top: 3px; }
tr.fd-note td { padding-top: 0; border-top: 0; }
details.fd-sec { border: 1px solid var(--line); border-radius: 12px; margin-top: 10px; background: var(--panel); }
details.fd-sec > summary { padding: 12px 16px; cursor: pointer; font-weight: 700; display: flex; gap: 10px; align-items: center; }
details.fd-sec[open] > summary { border-bottom: 1px solid var(--line); }
details.fd-sec > :not(summary) { margin: 12px 16px; }
.fd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 12px; }
.fd-f.wide { grid-column: span 2; }
.fd-f textarea { min-height: 52px; }
.fd-item { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.fd-item-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
table.fd-uses input { padding: 5px 8px; font-size: 13px; }
.fd-derived { background: #eef3ef; border-radius: 10px; padding: 10px 14px; font-size: 13.5px; }
.fd-chg { font-size: 13px; }
.fd-preview { position: fixed; inset: 0; z-index: 150; background: rgba(43, 41, 37, .78); overflow: auto; padding: 0 0 40px; }
.fd-pv-bar { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 24px; background: var(--panel); border-bottom: 1px solid var(--line); }
.fd-pv-miss { margin: 14px auto 0; max-width: 820px; background: #fdecea; color: #8c1d18; border-radius: 10px; padding: 10px 14px; font-size: 13px; }
.fd-pages { display: flex; flex-direction: column; align-items: center; gap: 18px; padding-top: 18px; }
.doc-page { width: 794px; min-height: 1123px; background: #fff; color: #111; padding: 64px 70px; box-shadow: 0 6px 24px rgba(0,0,0,.3);
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; font-size: 12.5px; line-height: 1.9; }
.doc-page .doc-form { font-size: 11px; color: #333; }
.doc-page .doc-title { text-align: center; font-size: 20px; letter-spacing: .3em; margin: 18px 0 4px; font-weight: 600; }
.doc-page .doc-h { font-size: 14px; margin: 18px 0 2px; font-weight: 600; }
.doc-page .doc-h:first-child { margin-top: 0; }
.doc-page .doc-sub { text-align: center; margin-bottom: 8px; }
.doc-page .doc-lead { margin: 16px 0; }
.doc-page .doc-to { margin: 18px 0 6px; font-size: 14px; }
.doc-page .doc-date { text-align: right; margin: 6px 0 14px; }
.doc-page .dl { padding: 1px 0; }
.doc-page .dl.sub { margin-top: 6px; color: #333; }
.doc-page .dl.pre { white-space: pre-wrap; }
.doc-page .miss { background: #fdecea; color: #b3261e; border: 1px dashed #e0695f; border-radius: 3px; padding: 0 4px; font-family: var(--font); font-size: 11.5px; }
.doc-page .calc { background: #eef3ef; border-radius: 3px; padding: 0 3px; }
.doc-page .doc-kikan { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid #555; margin-top: 30px; }
.doc-page .doc-kikan span { border-right: 1px solid #555; height: 90px; padding: 4px 6px; font-size: 11px; }
.doc-page .doc-kikan span:last-child { border-right: 0; }
.doc-page .note-doc { margin-top: 18px; font-family: var(--font); font-size: 11px; color: #555; border-top: 1px dashed #bbb; padding-top: 8px; }
.doc-page .hint-doc { font-size: 11px; color: #777; }
@media print {
  #print-area.docs .doc-page { box-shadow: none; width: auto; min-height: 0; padding: 0; page-break-after: always; font-size: 10.5px; }
  #print-area.docs .doc-page .calc { background: none; }
  #print-area.docs { font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; }
  .fd-preview { display: none !important; }
}

.cd-upload { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin: 14px 0 6px; }
.cd-upload select { min-width: 260px; }
.cd-drop { display: inline-flex; align-items: center; padding: 10px 18px; border: 1.5px dashed var(--accent); border-radius: 12px; color: var(--accent); font-weight: 700; cursor: pointer; background: #eef3ef; }
.cd-drop input { display: none; }
.cd-doc { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-top: 12px; background: var(--panel); }
.cd-doc-h { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.cd-read { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.cd-read .chip { cursor: default; }
.cd-doc .cd-tg { font-size: 12.5px; padding: 4px 8px; max-width: 260px; }
details.cd-ok > summary { cursor: pointer; color: var(--sub); font-size: 13px; padding: 6px 0; }

/* ---- 図面ライブラリ ------------------------------------------------------------- */
.dw-search input { font-size: 16px; padding: 12px 16px; }
.dw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; margin-top: 20px; }
.dw-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.dw-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(43, 41, 37, .12); }
.dw-thumb { aspect-ratio: 1.414; background: #fff; border-bottom: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.dw-thumb img { width: 100%; height: 100%; object-fit: contain; }
.dw-body { padding: 14px 16px 16px; }
.dw-body h3 { margin: 2px 0 4px; font-size: 15.5px; }
.dw-place { font-size: 13px; color: var(--sub); }
.dw-tagline { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.dw-detail { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 24px; align-items: start; }
@media (max-width: 1100px) { .dw-detail { grid-template-columns: 1fr; } }
.dw-view { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: auto; max-height: 76vh; }
.dw-view img { display: block; width: 100%; }
.dw-text { white-space: pre-wrap; margin: 4px 0; font-size: 14px; }
table.dw-meta th { width: 96px; font-weight: 500; color: var(--sub); text-align: left; white-space: nowrap; }
#dw-form input[type=file] { padding: 8px; font-size: 12.5px; }
a.chip { text-decoration: none; }
.dw-view img { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(30, 28, 25, .9); display: flex; }
.lb-scroll { flex: 1; overflow: auto; display: flex; padding: 44px 24px 24px; }
.lb-scroll img { margin: auto; max-width: 100%; max-height: 100%; background: #fff; border-radius: 6px; cursor: zoom-in; box-shadow: 0 10px 40px rgba(0, 0, 0, .4); }
.lightbox.zoomed .lb-scroll { display: block; }
.lightbox.zoomed .lb-scroll img { max-width: none; max-height: none; width: 240vw; cursor: zoom-out; }
.lb-close { position: fixed; top: 10px; right: 16px; z-index: 201; width: 38px; height: 38px; padding: 0; border-radius: 50%; font-size: 20px; background: #fffdf9; }
.lb-hint { position: fixed; top: 16px; left: 24px; z-index: 201; color: #e9e4da; font-size: 12.5px; letter-spacing: .04em; }
@media print { .lightbox { display: none; } }

/* ---- 宿題・変更の影響確認 ------------------------------------------------------- */
.act-add { display: grid; grid-template-columns: minmax(0, 1fr) 110px 150px auto; gap: 8px; margin-top: 12px; }
@media (max-width: 760px) { .act-add { grid-template-columns: 1fr 1fr; } }
table.act tr.done td { opacity: .5; }
table.act input[type=checkbox] { width: auto; }
.memo-edit { display: grid; grid-template-columns: 1fr; gap: 4px; margin-top: 4px; }
.memo-edit input { font-size: 12.5px; padding: 4px 8px; min-width: 0; width: 100%; margin: 0; }
.steps-flow { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: stretch; margin-bottom: 6px; }
.flow-box { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.flow-box small { font-size: 11.5px; color: var(--sub); letter-spacing: .06em; }
.flow-box b { font-size: 15px; line-height: 1.6; }
.flow-arrow { align-self: center; color: var(--sub); font-size: 18px; }
@media (max-width: 760px) { .steps-flow { grid-template-columns: 1fr; } .flow-arrow { display: none; } }

/* ---- 確認状況の絞り込み --------------------------------------------------------- */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 14px; }
.chip { padding: 4px 12px; border-radius: 999px; font-size: 12.5px; background: var(--panel); border: 1px solid var(--line-2); color: var(--sub); }
.chip b { margin-left: 6px; font-variant-numeric: tabular-nums; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.legend { margin: -6px 0 10px; }
.item.done { opacity: .78; }
.review .rv-evidence { flex: 1 1 220px; min-width: 0; font-size: 12.5px; padding: 5px 10px; }

/* ---- 窓口で確認すること --------------------------------------------------------- */
.ask { margin: 8px 0 4px; padding: 8px 12px 8px 14px; border-radius: 10px; background: #f3efe4; border-left: 3px solid var(--brass); }
.ask-h { font-size: 11.5px; font-weight: 700; color: var(--brass); letter-spacing: .06em; }
.ask ul { margin: 2px 0 0; padding-left: 1.1em; font-size: 13.5px; }

/* ---- 打合せメモから取り込む ------------------------------------------------------ */
.memo-panel textarea { min-height: 120px; margin-top: 12px; }
.memo-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.memo-col { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.memo-row { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; line-height: 1.7; padding: 6px 0; border-bottom: 1px dashed var(--line); cursor: pointer; }
.memo-row input { margin-top: 5px; flex: none; width: auto; }
.memo-row > span { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.memo-col .small.primary { margin-top: 10px; }

/* ---- 立ち戻り判定の影響範囲 ---------------------------------------------------- */
.scope { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 6px 0 4px; }
.scope-col { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.scope-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; color: var(--sub); letter-spacing: .04em; margin-bottom: 4px; }
.scope-head b { font-size: 22px; color: var(--ink); font-variant-numeric: tabular-nums; }
.scope-col ul { margin: 0; padding-left: 1.1em; font-size: 13.5px; line-height: 1.8; }
details.internal { margin-top: 14px; }

/* ---- スマートフォン幅（後ろに置いて各部品の指定を上書き） --------------------- */
@media (max-width: 960px) {
  .home-hero { padding: 24px 20px; }
  .home-hero h2 { font-size: 19px; }
  .home-hero h2 br { display: none; }
  .panel { padding: 20px 18px; }
  .projbar { width: 100%; }
  .projbar label { flex: 1; min-width: 0; }
  .projbar select { min-width: 0; width: 100%; }
  .stages { width: 100%; overflow-x: auto; }
}
