:root {
  --bg: #f4f5f7; --panel: #fff; --line: #d9dde3; --text: #1f2933; --muted: #6b7684;
  --primary: #1f5fbf; --ok: #1a7f4b; --warn: #b26a00; --bad: #c0392b; --human: #6b3fa0;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 14px/1.5 "Segoe UI", "Yu Gothic UI", "Hiragino Sans", Meiryo, sans-serif; color: var(--text); background: var(--bg); display: flex; flex-direction: column; }
[hidden] { display: none !important; }
header { display: flex; align-items: center; gap: 12px; padding: 8px 14px; background: var(--panel); border-bottom: 1px solid var(--line); }
h1 { font-size: 16px; margin: 0 8px 0 0; white-space: nowrap; }
h1 small { color: var(--muted); font-weight: normal; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.pad { padding: 16px; }
.btn { font: inherit; padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text); cursor: pointer; white-space: nowrap; }
.btn:hover:not(:disabled) { background: #eef2f7; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover:not(:disabled) { background: #194f9f; }
.btn.small { padding: 0 6px; font-size: 12px; }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: #e8ebef; white-space: nowrap; }
.badge.ok { background: #e1f3e8; color: var(--ok); }
.badge.bad { background: #fbe4e1; color: var(--bad); }
.badge.warn { background: #fdf0d9; color: var(--warn); }
.banner { padding: 8px 14px; border-bottom: 1px solid var(--line); }
.banner.warn { background: #fdf0d9; color: #6b4300; }
.banner.error { background: #fbe4e1; color: #7a1f14; border: 1px solid #f0b8b0; border-radius: 6px; margin: 8px 12px; white-space: pre-wrap; }
main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
main > section { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--panel); }
#left { border-right: 1px solid var(--line); }
.toolbar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.toolbar.wrap { flex-wrap: wrap; }
.sep { width: 1px; height: 20px; background: var(--line); }
.check { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
select, input { font: inherit; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.chips:empty { display: none; }
.chip { border: 1px solid var(--line); border-radius: 12px; padding: 0 10px; background: #fff; cursor: pointer; font: inherit; font-size: 12px; }
.chip.current { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.chip.selected { background: #dfeafc; }
#viewer { flex: 1; overflow: auto; background: #6f7780; padding: 12px; }
#empty { color: #e3e6ea; text-align: center; margin-top: 30vh; }
#pageWrap { position: relative; margin: 0 auto; width: max-content; box-shadow: 0 2px 10px rgba(0,0,0,.4); background: #fff; }
#canvas { display: block; }
#highlight { position: absolute; border: 2px solid #e6007e; background: rgba(230, 0, 126, .12); pointer-events: none; }
#highlightLabel { position: absolute; left: -2px; bottom: 100%; background: #e6007e; color: #fff; font-size: 11px; padding: 0 6px; white-space: nowrap; }
#status { padding: 4px 12px; font-size: 12px; min-height: 22px; }
#results { flex: 1; overflow: auto; padding: 0 12px 24px; }
#results h2 { font-size: 14px; margin: 18px 0 6px; display: flex; align-items: center; gap: 8px; }
#results h2 .count { color: var(--muted); font-weight: normal; }
/* 狭い画面では列を潰さず、結果の欄を横にスクロールさせる */
table { border-collapse: collapse; width: max-content; min-width: 100%; font-size: 13px; }
th, td { border: 1px solid var(--line); padding: 3px 6px; text-align: left; vertical-align: top; }
th { background: #f0f2f5; font-weight: 600; white-space: nowrap; }
td.loc { color: var(--muted); font-size: 12px; min-width: 160px; max-width: 280px; }
td.loc:focus { outline: 2px solid var(--primary); color: var(--text); }
.cell { font: inherit; display: block; width: 100%; text-align: left; border: 0; background: none; padding: 1px 2px; cursor: pointer; border-left: 3px solid transparent; border-radius: 2px; }
.cell { min-width: 4.5em; max-width: 17em; }
.cell:hover { background: #eef2f7; }
.cell .ev { display: block; font-size: 11px; color: var(--muted); }
.cell.read { border-left-color: var(--ok); }
.cell.uncertain { border-left-color: var(--warn); background: #fff8ea; }
.cell.unreadable { border-left-color: var(--bad); background: #fdf1ef; color: var(--bad); }
.cell.confirmed, .cell.corrected { border-left-color: var(--human); background: #f4eefb; }
.tag { font-size: 10px; padding: 0 5px; border-radius: 8px; margin-left: 4px; white-space: nowrap; background: #e8ebef; }
.tag.uncertain { background: #fdf0d9; color: var(--warn); }
.tag.confirmed, .tag.corrected { background: #e9dff6; color: var(--human); }
.tag.mismatch { background: #fbe4e1; color: var(--bad); }
details { margin-bottom: 8px; }
summary { cursor: pointer; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
tr.deleted td { opacity: .45; text-decoration: line-through; }
tr.deleted td:last-child { opacity: 1; text-decoration: none; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted); margin: 8px 0; }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 3px; border-radius: 2px; }
.meta { font-size: 12px; color: var(--muted); margin: 8px 0; }
ul.list { margin: 0; padding-left: 0; list-style: none; }
ul.list li { border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; margin-bottom: 4px; display: flex; gap: 8px; align-items: baseline; }
ul.list li .grow { flex: 1; }
dialog { border: 1px solid var(--line); border-radius: 10px; padding: 16px; width: min(480px, 92vw); }
dialog::backdrop { background: rgba(0,0,0,.35); }
dialog h3 { margin: 0 0 10px; font-size: 15px; }
dialog label { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 8px; margin-bottom: 8px; }
dialog input, dialog select { padding: 4px 6px; border: 1px solid var(--line); border-radius: 4px; }
dialog dl { display: grid; grid-template-columns: 150px 1fr; gap: 4px 8px; font-size: 13px; background: #f6f7f9; padding: 8px; border-radius: 6px; margin: 8px 0; }
dialog dt { color: var(--muted); }
dialog dd { margin: 0; word-break: break-all; }
.actions { display: flex; gap: 8px; }
.err { color: var(--bad); min-height: 1em; margin: 4px 0; }
@media (max-width: 900px) { main { grid-template-columns: 1fr; grid-template-rows: 55vh auto; } #left { border-right: 0; border-bottom: 1px solid var(--line); } }

/* ---- 物件の突き合わせ */
body.scroll { display: block; height: auto; }
a.btn { text-decoration: none; display: inline-block; }
.page { max-width: 1200px; margin: 0 auto; padding: 12px 16px 48px; background: var(--panel); min-height: calc(100vh - 50px); }
.page h2 { font-size: 14px; margin: 22px 0 6px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.page h2 .count { color: var(--muted); font-weight: normal; font-size: 12px; }
.page table { width: 100%; }
.wrapcell { max-width: 520px; white-space: normal; }
ul.refs { margin: 2px 0; padding-left: 18px; font-size: 12px; }
ul.cards li.card { display: block; }
.cardhead { display: flex; align-items: baseline; gap: 8px; }
.cardhead .grow { flex: 1; }
.review { white-space: nowrap; }
.review .btn { margin-left: 4px; }
.btn.on-ok { background: #e1f3e8; border-color: var(--ok); color: var(--ok); }
.btn.on-ng { background: #fbe4e1; border-color: var(--bad); color: var(--bad); }
.small { font-size: 11px; }
.badge.cross { background: #dfeafc; color: var(--primary); }
.sheets { font-size: 12px; margin: 3px 0; }
.filterbar { border: 1px solid var(--line); border-radius: 6px; margin-bottom: 4px; }
details#manual { margin: 10px 0; border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; }
details#manual > summary { cursor: pointer; color: var(--muted, #667); }
#confirm > div { margin: 2px 0; }
#dirty { color: var(--warn); }

/* 物件の突き合わせ: 左に図面、右に結果 */
#pmain { display: block; }
body.scroll.with-viewer { display: flex; height: 100%; overflow: hidden; }
body.with-viewer #pmain { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
body.with-viewer #pleft { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--line); background: #6f7780; }
body.with-viewer .page { overflow: auto; min-height: 0; max-width: none; margin: 0; }
.vbar { padding: 5px 10px; background: var(--panel); border-bottom: 1px solid var(--line); font-size: 12px; }
#drawings { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 3px; }
.vpane { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--panel); }
.vhead { display: flex; align-items: center; gap: 6px; padding: 3px 8px; border-bottom: 1px solid var(--line); font-size: 12px; }
.vtitle { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vzoom { min-width: 40px; text-align: center; }
.vscroll { position: relative; flex: 1; min-height: 0; overflow: auto; background: #6f7780; padding: 12px; cursor: grab; }
.vscroll.dragging { cursor: grabbing; user-select: none; }
.vpage { position: relative; width: max-content; margin: 0 auto; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.4); }
.vpage canvas { display: block; }
.vmark { position: absolute; border: 2px solid #e6007e; background: rgba(230, 0, 126, .10); pointer-events: none; }
.vmarklabel { position: absolute; left: -2px; bottom: 100%; background: #e6007e; color: #fff; font-size: 11px; padding: 0 6px; white-space: nowrap; max-width: 460px; overflow: hidden; text-overflow: ellipsis; }
.vempty { color: #fff; padding: 16px; font-size: 13px; }
.vnote { color: #fff; background: #4b525a; padding: 4px 10px; font-size: 12px; }
ul.cards li.card.selected, tr.selected > * { outline: 2px solid #e6007e; outline-offset: -2px; }
ul.refs li.ref { cursor: pointer; }
ul.refs li.ref:hover { text-decoration: underline; color: var(--primary); }
@media (max-width: 1000px) { body.with-viewer #pmain { grid-template-columns: 1fr; grid-template-rows: 50vh minmax(0, 1fr); } }

/* 読み取った箇所を図面に重ねる */
#overlay { position: absolute; inset: 0; }
.ov { position: absolute; border: 1.5px solid var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); border-radius: 2px; cursor: pointer; }
.ov.approx { border-style: dashed; background: color-mix(in srgb, var(--c) 6%, transparent); }
.ov:hover { background: color-mix(in srgb, var(--c) 32%, transparent); z-index: 3; }
.ov:hover::after { content: attr(data-label); position: absolute; left: -1.5px; top: 100%; background: var(--c); color: #fff; font-size: 11px; line-height: 1.5; padding: 0 6px; white-space: nowrap; z-index: 4; }
#highlight { z-index: 5; }
.legendbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 4px 10px; border-bottom: 1px solid var(--line); font-size: 12px; }
.legendchip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 10px; padding: 0 8px; background: #fff; font: inherit; font-size: 12px; cursor: pointer; }
.legendchip i { width: 10px; height: 10px; border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 20%, transparent); border-radius: 2px; }
.legendchip.off { opacity: .4; text-decoration: line-through; }
@keyframes rowflash { from { background: #ffe1f1; } to { background: transparent; } }
tr.flash > td { animation: rowflash 1.6s ease-out; }

/* 画面の切り替え */
.nav { display: flex; gap: 2px; margin-right: 8px; }
.nav a { padding: 4px 12px; border-radius: 6px; color: var(--text); text-decoration: none; white-space: nowrap; }
.nav a:hover { background: var(--bg); }
.nav a.current { background: var(--primary); color: #fff; }

/* まとめの数字 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 10px 0 4px; }
.stat { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: #fff; display: flex; flex-direction: column; }
.stat b { font-size: 22px; line-height: 1.3; }
.stat span { font-size: 12px; color: var(--muted); }
.stat.ok b { color: var(--ok); }
.stat.warn b { color: var(--warn); }
details.reference { margin-top: 22px; border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px; }
details.reference > summary { cursor: pointer; color: var(--muted); }

/* 精度のまとめ */
.summary .hero { padding: 6px 0 2px; }
.summary .title { font-size: 24px; margin: 8px 0 6px; display: block; }
.summary .lead { font-size: 15px; max-width: 900px; margin: 0 0 4px; }
.cards4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 14px 0 6px; }
.bigcard { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: #fff; border-top: 4px solid var(--primary); }
.bigcard.ok { border-top-color: var(--ok); }
.biglabel { font-size: 13px; color: var(--muted); }
.bigvalue { font-size: 34px; font-weight: 700; line-height: 1.25; margin: 2px 0 4px; white-space: nowrap; }
.bigcard.ok .bigvalue { color: var(--ok); }
.bigdetail { font-size: 12.5px; color: var(--text); }
.summarytable th, .summarytable td { padding: 6px 10px; vertical-align: middle; }
.summarytable tbody th { text-align: left; font-size: 15px; }
.explain { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.explain > div { border: 1px solid var(--line); border-radius: 8px; padding: 4px 14px 8px; background: #fff; }
.explain h3 { font-size: 14px; margin: 10px 0 4px; }
.explain h3 small { font-weight: normal; color: var(--muted); }
.explain p { margin: 4px 0; font-size: 13px; }
.limits { margin: 4px 0; padding-left: 20px; font-size: 13px; }
.limits li { margin: 3px 0; }
ol.flow { list-style: none; padding: 0; margin: 6px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; counter-reset: step; }
ol.flow li { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; background: #fff; counter-increment: step; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
ol.flow li b::before { content: counter(step) ". "; color: var(--primary); }
ol.flow li b { font-size: 14px; }
@media print { header .badge, .nav, .btn { display: none !important; } body { background: #fff; } .page { max-width: none; } }
.vmark.approx { border-style: dashed; }

/* かんたん表示（最初の画面）: 図面を選ぶ → 読み取る → 図面の上で確かめる */
body.simple main { grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); }
.pickbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 8px 14px; background: var(--panel); border-bottom: 1px solid var(--line); }
.step { display: inline-flex; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.welcome { width: 100%; max-width: 1040px; margin: 36px auto; padding: 0 20px; }
.welcome h2 { font-size: 22px; margin: 0 0 16px; }
ol.steps3 { list-style: none; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; counter-reset: s; }
ol.steps3 li { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 6px; counter-increment: s; font-size: 13.5px; }
ol.steps3 li b { font-size: 16px; display: flex; align-items: center; gap: 8px; }
ol.steps3 li b::before { content: counter(s); display: inline-flex; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; align-items: center; justify-content: center; font-size: 14px; }
.chips.inline { display: flex; flex-wrap: wrap; gap: 4px; padding: 0; border: 0; }
body.simple #viewer { cursor: grab; }
body.simple #viewer.dragging { cursor: grabbing; user-select: none; }
.ov.on { background: color-mix(in srgb, var(--c) 30%, transparent); }
body.simple #status:empty { display: none; }
body.simple #status { padding: 8px 12px; }
.sumline { padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.sumline b { font-size: 18px; }
.readlist { flex: 1; min-height: 0; overflow: auto; padding: 4px 10px 30px; }
.readlist details.group { margin: 4px 0 8px; }
.readlist summary { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 5px 2px; position: sticky; top: 0; background: var(--panel); z-index: 1; }
.readlist summary i { width: 12px; height: 12px; border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 20%, transparent); border-radius: 3px; }
.readlist summary .count { color: var(--muted); font-size: 12px; flex: 1; }
.readlist ul { list-style: none; margin: 0; padding: 0; }
.readlist li { display: flex; gap: 8px; align-items: baseline; padding: 4px 8px; margin: 2px 0; border-left: 3px solid var(--c); border-radius: 0 4px 4px 0; cursor: pointer; }
.readlist li:hover { background: var(--bg); }
.readlist li.on { background: #ffe1f1; }
.readlist li .main { font-weight: 600; white-space: nowrap; }
.readlist li .sub { color: var(--muted); font-size: 12px; flex: 1; }
.readlist li.nomark { opacity: .65; }

/* 最初の画面: 図面どうしのつながり */
.tools { display: inline-flex; align-items: center; gap: 8px; }
.chip.whole { font-weight: 700; border-color: var(--primary); color: var(--primary); }
.chip.whole.current { background: var(--primary); color: #fff; }
.ov.linked { border-width: 2.5px; box-shadow: 0 0 0 2px color-mix(in srgb, var(--ok) 55%, transparent); }
.ov.linked.conflict { box-shadow: 0 0 0 2.5px var(--bad); }
.tag.linktag { background: #e1f3e8; color: var(--ok); }
.overview { flex: 1; min-height: 0; overflow: auto; padding: 14px 20px; background: #fff; display: flex; flex-direction: column; }
.overview .lead { font-size: 15px; margin: 0 0 4px; }
.relmap { flex: 1; min-height: 300px; width: 100%; max-height: 640px; }
.relmap .edge { cursor: pointer; }
.relmap .edge line { stroke: #9bb7a6; stroke-linecap: round; }
.relmap .edge rect { fill: #fff; stroke: #9bb7a6; }
.relmap .edge text { font-size: 13px; fill: var(--text); }
.relmap .edge.conflict line { stroke: var(--bad); }
.relmap .edge.conflict rect { stroke: var(--bad); }
.relmap .edge.conflict text { fill: var(--bad); font-weight: 700; }
.relmap .edge:hover line, .relmap .edge.on line { stroke: var(--primary); }
.relmap .edge.on rect { fill: #dfeafc; stroke: var(--primary); }
.relmap .node { cursor: pointer; }
.relmap .node rect { fill: #fff; stroke: var(--primary); stroke-width: 2; }
.relmap .node:hover rect { fill: #dfeafc; }
.relmap .node text { font-size: 15px; font-weight: 700; fill: var(--text); }
.relmap .node text.small { font-size: 11px; font-weight: 400; fill: var(--muted); }
.linkbox { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.linkbanner { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #fff; border-bottom: 1px solid var(--line); font-size: 15px; }
.linkbanner .spacer { flex: 1; }
.linkpanes { flex: 1; min-height: 0; display: flex; flex-direction: row; gap: 3px; background: #6f7780; }
.linkpanes .vpane { min-width: 0; }
.linkpanes .vnote { position: absolute; }
.readlist li.linkrow { flex-direction: column; align-items: stretch; gap: 2px; padding: 6px 10px; }
.readlist li.linkrow .head { display: flex; align-items: baseline; gap: 8px; }
.readlist li.linkrow .sub { flex: none; }
.readlist p.muted { margin: 4px 8px; }
.linkdetail { padding: 6px 4px; }
.linkdetail h3 { font-size: 17px; margin: 8px 0 4px; }
.linkdetail ul.places li { flex-wrap: wrap; cursor: default; padding: 8px 10px; }
.linkdetail ul.places li .sheet { width: 100%; font-size: 12px; color: var(--muted); }
.linkdetail ul.places li .main { font-size: 18px; }
.ainote { margin: 10px 4px; padding: 8px 10px; background: var(--bg); border-radius: 6px; font-size: 13px; }

/* 図面で確かめた結果（正しい / 誤り）とメモ */
.reviewbox { margin: 14px 4px 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; gap: 8px; }
.reviewbox .buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.reviewbox label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.reviewbox textarea, input.memo { font: inherit; font-size: 13px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; width: 100%; }
input.memo { margin-top: 4px; }
.btn.on-ng { background: #fbe4e1; border-color: var(--bad); color: var(--bad); }
.readlist li.linkrow .memo { color: var(--human); }

/* 最初の画面: 物件の読み取り */
.pickbar .spacer { flex: 1; }
.banner.jobbar { background: #dfeafc; color: #1a3f7a; font-size: 14px; }
.batchpanel { margin: 10px 8px; padding: 12px 14px; border: 1px solid var(--primary); border-radius: 8px; background: #f3f7fe; display: flex; flex-direction: column; gap: 6px; }
.batchpanel.compact { flex-direction: row; align-items: center; gap: 10px; margin: 8px 0 0; padding: 6px 10px; font-size: 13px; }
a.quiet { color: var(--muted); font-size: 12px; }
.howto { margin: 6px 0 14px; padding: 10px 16px; border: 1px dashed var(--line); border-radius: 8px; background: #fff; font-size: 13.5px; }
.howto ol { margin: 6px 0 0; padding-left: 22px; }
.howto li { margin: 2px 0; }

/* AWS 版の「物件の管理」（public/manage.js） */
.manage { display: flex; flex-direction: column; gap: 6px; padding: 8px 14px; background: var(--panel); border-bottom: 1px solid var(--line); }
.manage .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.manage input[type="text"] { font: inherit; padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px; min-width: 240px; }
.manage .pdflist { margin: 0; padding-left: 18px; }
.manage .pdflist li { display: flex; align-items: center; gap: 8px; }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.danger:hover:not(:disabled) { background: #fbe4e1; }
header a.btn { text-decoration: none; }

/* ---------------------------------------------------------------- 待ち時間の表示（progress.js） */
/* 画面の上端の細い帯: サーバーへの要求が長くかかっているあいだ流れる */
.progress-top { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1000; overflow: hidden; background: #dfeafc; }
.progress-top::before { content: ""; position: absolute; top: 0; bottom: 0; width: 35%; background: var(--primary); animation: progress-slide 1.1s ease-in-out infinite; }
/* 中央上の札: 名前のある待ち（物件を開く・PDF を送る・消す など） */
.progress-card { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 1001; width: min(440px, calc(100vw - 32px));
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: 8px;
  box-shadow: 0 6px 24px rgba(15, 30, 60, .18); padding: 12px 14px; display: grid; gap: 6px; }
.progress-label { font-weight: 600; color: var(--text); }
.progress-detail { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.progress-row { display: flex; align-items: center; gap: 8px; }
.progress-track { position: relative; flex: 1; height: 8px; border-radius: 4px; background: #e3e8ef; overflow: hidden; }
.progress-fill { height: 100%; width: 0; border-radius: 4px; background: var(--primary); transition: width .3s ease; }
.progress-pct { min-width: 3.2em; text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
/* 割合が分からないとき: 棒が左右に流れる */
.progress-track.indeterminate .progress-fill { position: absolute; width: 35%; animation: progress-slide 1.2s ease-in-out infinite; }
/* 割合は分かるが 1 段に時間がかかるとき（図面の読み取り）: 伸びた棒の上を斜めの模様が流れ、止まっていないことを示す */
.progress-track.live .progress-fill { background-image: linear-gradient(45deg, rgba(255,255,255,.28) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.28) 50%, rgba(255,255,255,.28) 75%, transparent 75%);
  background-size: 16px 16px; animation: progress-stripes 1s linear infinite; }
@keyframes progress-slide { 0% { left: -35%; } 100% { left: 100%; } }
@keyframes progress-stripes { from { background-position: 0 0; } to { background-position: 16px 0; } }
@media (prefers-reduced-motion: reduce) {
  .progress-top::before, .progress-track.indeterminate .progress-fill { animation-duration: 3s; }
  .progress-track.live .progress-fill { animation: none; }
}
/* 読み取りの帯（jobBar）の中の並び */
.banner.jobbar { display: grid; gap: 6px; }
.banner.jobbar .progress-track { background: #fff; }
.btn.disabled { opacity: .5; pointer-events: none; }

/* ---------------------------------------------------------------- 物件の一覧（最初の画面） */
.welcome { margin: 24px auto; }
.homehead { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.homehead h2 { margin: 0; }
.homehead .spacer { flex: 1; }
.homehead .btn.primary { font-size: 15px; padding: 8px 18px; }
.propgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 18px; }
.propcard { background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--muted); border-radius: 8px; padding: 12px 14px;
  display: grid; gap: 6px; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.propcard:hover, .propcard:focus-visible { box-shadow: 0 4px 16px rgba(15, 30, 60, .14); transform: translateY(-1px); outline: none; }
.propcard:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 45%, transparent); }
.propcard.done { border-left-color: var(--ok); }
.propcard.todo { border-left-color: var(--warn); }
.propcard.running { border-left-color: var(--primary); }
.propcard.empty { border-left-style: dashed; }
.pcname { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.pcstatus { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.pcstatus i { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.propcard.done .pcstatus i { background: var(--ok); }
.propcard.todo .pcstatus i { background: var(--warn); }
.propcard.running .pcstatus i { background: var(--primary); }
.pcnums { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; }
.pcactions { display: flex; gap: 6px; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 2px; }
.emptyhome { grid-column: 1 / -1; display: grid; gap: 4px; padding: 28px; text-align: center; border: 2px dashed var(--line); border-radius: 10px; background: var(--panel); }
.howtobox { margin-top: 8px; }
.howtobox > summary { cursor: pointer; color: var(--primary); font-weight: 600; padding: 4px 0; }
.propname { font-size: 16px; }

/* 新しい物件の画面 */
.newdialog { border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; width: min(520px, calc(100vw - 32px)); box-shadow: 0 12px 40px rgba(15, 30, 60, .25); }
.newdialog::backdrop { background: rgba(20, 30, 45, .35); }
.newdialog h3 { margin: 0 0 12px; }
.newdialog form { display: grid; gap: 12px; }
.newdialog .field { display: grid; gap: 4px; font-weight: 600; }
.newdialog .field input { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; }
.dropzone { display: grid; gap: 2px; place-items: center; padding: 22px 12px; border: 2px dashed var(--line); border-radius: 8px; background: var(--bg); cursor: pointer; text-align: center; }
.dropzone span { color: var(--muted); font-size: 13px; }
.dropzone.over, .dropzone:hover, .dropzone:focus-visible { border-color: var(--primary); background: #eef4fd; outline: none; }
.newfiles { margin: 0; padding-left: 20px; font-size: 13px; }
.newfiles:empty { display: none; }
.dialogerror { margin: 0; color: var(--bad); font-size: 13px; }
.dialogbtns { display: flex; justify-content: flex-end; gap: 8px; }

/* 右の一覧の絞り込み */
.listfilter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.listfilter .chip { font-size: 13px; padding: 2px 12px; }
.listfilter .chip.current { background: var(--primary); color: #fff; border-color: var(--primary); }
.listfilter .chip.bad:not(.current) { color: var(--bad); border-color: var(--bad); }
.listfilter .chip:disabled { opacity: .45; cursor: default; }
.sumline .help { cursor: help; }

/* 図面の枠と一覧の行: どちらかに触れると両方が光る */
.ov.hover { background: color-mix(in srgb, var(--c) 34%, transparent); outline: 2px solid var(--c); outline-offset: 1px; z-index: 3; }
.ov.hover::after { content: attr(data-label); position: absolute; left: -1.5px; top: 100%; background: var(--c); color: #fff; font-size: 11px; line-height: 1.5; padding: 0 6px; white-space: nowrap; z-index: 4; }
.readlist li.hover { background: #fff3c4; }

/* 確認の進み具合 */
.reviewprog { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); white-space: nowrap; }
.minibar { display: inline-block; width: 80px; height: 6px; border-radius: 3px; background: #e3e8ef; overflow: hidden; }
.minibar i { display: block; height: 100%; background: var(--ok); }
.reviewline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; }

/* 文字を大きく（会議の画面に映すとき）。図面（左側）は座標の計算があるので拡大しない */
body.bigtext header, body.bigtext .pickbar, body.bigtext .banner, body.bigtext #right, body.bigtext .welcome, body.bigtext .linkbanner, body.bigtext .progress-card { zoom: 1.25; }
.manage .spacer { flex: 1; }
/* AWS 版の物件の一覧では、上の帯（物件名・図面の追加）は空なので出さない */
body.home.cloud .pickbar { display: none; }
.dialogerror { white-space: pre-wrap; }
.newdialog .btn.primary:disabled { opacity: .45; cursor: not-allowed; }

/* メンバー管理 */
.page.members { max-width: 900px; margin: 20px auto; padding: 0 20px; }
.page.members section { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin: 14px 0; }
.page.members h3 { margin: 0 0 8px; font-size: 15px; }
.memberadd .row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.memberadd input[type=email] { flex: 1; min-width: 260px; font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; }
.membertable { width: 100%; border-collapse: collapse; font-size: 14px; }
.membertable th, .membertable td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.membertable td.actions { white-space: nowrap; text-align: right; }
.membertable td.actions .btn { margin-left: 6px; }
.membertable .tag { margin-left: 6px; }

/* メンバーでない人への案内画面（cloud.js の showNotMember） */
body.notmember-page { display: grid; place-items: center; min-height: 100vh; background: var(--bg); }
.notmember { width: min(560px, calc(100vw - 32px)); background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 8px 30px rgba(15, 30, 60, .12); padding: 32px 28px; text-align: center; display: grid; gap: 6px; }
.notmember .nmicon { font-size: 40px; }
.notmember h1 { font-size: 15px; color: var(--muted); font-weight: 600; margin: 0; }
.notmember h2 { font-size: 21px; margin: 4px 0 8px; }
.notmember p { margin: 4px 0; }
.notmember .nmemail { font-weight: 700; font-size: 16px; background: var(--bg); border-radius: 6px; padding: 8px; margin: 8px 0; overflow-wrap: anywhere; }
.notmember .nmbtns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.notmember .nmbtns a.btn { text-decoration: none; }
/* 画面全体の main の 2 列の並び（図面＋一覧）を、案内画面では使わない */
main.notmember { grid-template-columns: 1fr; flex: none; height: auto; min-height: 0; overflow: visible; }

/* 採光計算表: 行の下に検算の結果を出す */
.readlist li.dlrow { flex-wrap: wrap; }
.tag.dlok { background: #e1f3e8; color: var(--ok); }
.tag.dlnote { background: #fdf0d9; color: #6b4300; }
.readlist .dlchecks { flex: 0 0 100%; list-style: none; margin: 2px 0 4px; padding: 4px 8px; background: var(--bg); border-radius: 4px; font-size: 12px; }
.readlist .dlchecks li { display: block; padding: 1px 0; margin: 0; border: 0; border-radius: 0; cursor: inherit; color: var(--muted); }
.readlist .dlchecks li:hover { background: none; }
.readlist .dlchecks li b { font-weight: 600; }
.readlist .dlchecks li.ok b { color: var(--ok); }
.readlist .dlchecks li.note { color: #6b4300; }
.readlist .dlchecks li.ng { color: var(--bad); }
.linkbtn { background: none; border: 0; padding: 0; margin-left: 12px; font: inherit; cursor: pointer; text-decoration: underline; }
.readlist .dlchecks li.go { cursor: pointer; text-decoration: underline dotted; }
.readlist .dlchecks li.unknown { color: var(--muted); }
/* 採光計算表の行: 1 行目に室・窓と印、2 行目に値（D・H・係数・有効）、その下に照合と検算 */
.readlist li.dlrow .sub { order: 1; flex: 0 0 100%; }
.readlist li.dlrow .dlchecks { order: 2; }
/* 読み取り直すページを選ぶ画面 */
.redolist { display: grid; gap: 4px; max-height: 32vh; overflow: auto; padding: 4px 2px; }
.redopick { display: flex; gap: 6px; align-items: center; }
.notmember .nmdemo { background: #fdf0d9; color: #6b4300; border-radius: 6px; padding: 6px 10px; font-size: 13px; }
.redoscope { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line, #e5e7eb); }
/* 選ぶ項目の下に、説明を小さく折り返して出す（横にはみ出させない） */
.redoscope .check { display: block; white-space: normal; }
.redoscope .check .muted { display: block; margin: 1px 0 0 22px; font-size: 12.5px; line-height: 1.5; }
.batchpanel.stale { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: #fdf0d9; border-color: #e9c46a; color: #5b3b00; margin-top: 8px; }
