/* ARP Tracer — design system. Light, dense, desktop-first (§12). */
:root {
  --navy: #1f3a5f; --navy-800: #16283f; --navy-100: #e8eef6;
  --accent: #2a78d6; --accent-dark: #1c5cab;
  --page: #f4f4f1; --surface: #fcfcfb; --surface-2: #f0efec;
  --ink: #16202b; --ink-2: #52514e; --muted: #77756e;
  --line: #e1e0d9; --line-2: #c9c8c0;
  --good: #0ca30c; --good-bg: #e7f5e7; --good-ink: #0a5c0a;
  --warn: #b97900; --warn-bg: #fdf3dc; --warn-ink: #7a5200;
  --bad: #d03b3b; --bad-bg: #fbe9e9; --bad-ink: #8f1f1f;
  --blue-bg: #e5effb; --blue-ink: #1c5083;
  --violet-bg: #ece9f9; --violet-ink: #43389c;
  --grey-bg: #eeeeea; --grey-ink: #5a5954;
  --shadow: 0 8px 28px rgba(22, 32, 43, .16);
  --r: 6px;
  font-size: 15px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--page); color: var(--ink);
  font-size: .875rem; line-height: 1.45;
}
#app { min-height: 100%; display: flex; flex-direction: column; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 3px; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; }
code { background: var(--surface-2); padding: 0 4px; border-radius: 3px; font-size: .85em; }

/* ---------- top bar ---------- */
.topbar {
  background: var(--navy-800); color: #fff; display: flex; align-items: center;
  gap: 16px; padding: 0 16px; height: 48px; flex: none; position: sticky; top: 0; z-index: 40;
}
.topbar .brand { font-weight: 750; letter-spacing: .4px; font-size: .95rem; color: #fff; display: flex; align-items: center; gap: 8px; }
.topbar .brand .logo { width: 26px; height: 26px; border-radius: 6px; display: block; }
.topbar nav { display: flex; gap: 2px; margin-left: 8px; }
.topbar nav a, .topbar .userbtn {
  color: #cfd9e6; padding: 5px 10px; border-radius: 5px; font-weight: 550; font-size: .84rem; background: none; border: 0; cursor: pointer;
}
.topbar nav a:hover, .topbar .userbtn:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.topbar nav a[aria-current="true"] { background: rgba(255,255,255,.16); color: #fff; }
.topbar .spacer { flex: 1; }
.topbar .whoami { text-align: right; line-height: 1.15; }
.topbar .whoami .n { font-weight: 600; font-size: .84rem; }
.topbar .whoami .r { font-size: .7rem; color: #9fb1c6; }

/* ---------- project header + tab strip ---------- */
.projhead { background: var(--navy); color: #fff; padding: 14px 20px 0; }
.projhead .row1 { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.projhead h1 { font-size: 1.12rem; }
.projhead .code { background: rgba(255,255,255,.14); padding: 2px 8px; border-radius: 4px; font-size: .74rem; font-weight: 700; letter-spacing: .5px; }
.projhead .sub { color: #b9c7d9; font-size: .8rem; margin-top: 2px; }
.projhead .offnote { margin-top: 8px; font-size: .76rem; color: #ffd58a; }
.tabstrip { display: flex; gap: 2px; margin-top: 10px; overflow-x: auto; }
.tabstrip a {
  color: #c2cfdf; padding: 8px 13px; font-size: .84rem; font-weight: 570; border-radius: 6px 6px 0 0;
  white-space: nowrap; border: 0; background: none; cursor: pointer;
}
.tabstrip a:hover { background: rgba(255,255,255,.09); color: #fff; text-decoration: none; }
.tabstrip a[aria-current="true"] { background: var(--page); color: var(--navy-800); font-weight: 700; }

.main { flex: 1; padding: 18px 20px 60px; max-width: 1440px; width: 100%; margin: 0 auto; }
.main.narrow { max-width: 980px; }

/* ---------- cards, panels ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.card + .card { margin-top: 14px; }
.card .chead { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card .chead h2 { font-size: .92rem; }
.card .chead .sub { color: var(--muted); font-size: .78rem; }
.card .cbody { padding: 14px; }
.card .cbody.flush { padding: 0; }
.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: 1fr 1fr; }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .grid.c4 { grid-template-columns: 1fr 1fr; } .grid.c3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; } }

.stat { padding: 12px 14px; }
.stat .v { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.stat .l { color: var(--ink-2); font-size: .76rem; margin-top: 2px; }
.stat .d { color: var(--muted); font-size: .72rem; }
.stat.bad .v { color: var(--bad); }
.stat.good .v { color: var(--good-ink); }
.stat.warn .v { color: var(--warn); }

/* ---------- tables ---------- */
table.data { width: 100%; border-collapse: collapse; font-size: .82rem; }
table.data th {
  text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); font-weight: 650; padding: 8px 10px; border-bottom: 1px solid var(--line-2);
  position: sticky; top: 0; background: var(--surface); z-index: 2;
}
table.data td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr.rowlink { cursor: pointer; }
table.data tbody tr.rowlink:hover { background: var(--navy-100); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tablewrap { overflow: auto; max-height: 70vh; }

/* ---------- chips & badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 999px;
  font-size: .72rem; font-weight: 650; white-space: nowrap; border: 1px solid transparent;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.chip.s-draft { background: var(--grey-bg); color: var(--grey-ink); }
.chip.s-submitted { background: #e2ecf3; color: #29566f; }
.chip.s-scheduled { background: var(--blue-bg); color: var(--blue-ink); }
.chip.s-inspected { background: var(--violet-bg); color: var(--violet-ink); }
.chip.s-approved, .chip.s-closed, .chip.s-good { background: var(--good-bg); color: var(--good-ink); }
.chip.s-awc, .chip.s-evidence, .chip.s-warn { background: var(--warn-bg); color: var(--warn-ink); }
.chip.s-rejected, .chip.s-overdue, .chip.s-bad, .chip.s-critical { background: var(--bad-bg); color: var(--bad-ink); }
.chip.s-cancelled { background: var(--grey-bg); color: var(--grey-ink); text-decoration: line-through; }
.chip.s-void { background: #3a3a37; color: #e6e5df; }
.chip.s-na { background: transparent; color: var(--muted); border-color: var(--line-2); }
.chip.s-ready { background: #dff0fb; color: #14567e; }
.chip.s-open { background: #e2ecf3; color: #29566f; }
.chip.s-progress { background: var(--blue-bg); color: var(--blue-ink); }
.chip.s-high { background: var(--warn-bg); color: var(--warn-ink); }
.chip.s-low, .chip.s-medium { background: var(--grey-bg); color: var(--grey-ink); }
.chip.outline { background: transparent; border-color: var(--line-2); color: var(--ink-2); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); border-radius: 5px; padding: 4px 12px;
  font-size: .82rem; font-weight: 600; cursor: pointer; min-height: 29px;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-800); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.accent:hover { background: var(--accent-dark); }
.btn.danger { background: #fff; border-color: #e4b6b6; color: var(--bad-ink); }
.btn.danger:hover { background: var(--bad-bg); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--accent-dark); }
.btn.ghost:hover { background: var(--navy-100); }
.btn.sm { padding: 2px 9px; font-size: .76rem; min-height: 25px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btnrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* result buttons — no fill until selected (§7.9.5) */
.resbtn { border: 1.5px solid var(--line-2); background: transparent; color: var(--ink-2); border-radius: 5px; padding: 3px 10px; font-size: .78rem; font-weight: 650; cursor: pointer; }
.resbtn:hover { border-color: var(--ink-2); }
.resbtn.on-approved { background: var(--good); border-color: var(--good); color: #fff; }
.resbtn.on-awc { background: #eda100; border-color: #eda100; color: #3b2900; }
.resbtn.on-rejected { background: var(--bad); border-color: var(--bad); color: #fff; }
.resbtn.on-ready { background: var(--accent); border-color: var(--accent); color: #fff; }
.resbtn.on-neutral { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }
.resbtn:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 3px; margin-bottom: 11px; }
.field > span { font-size: .74rem; font-weight: 650; color: var(--ink-2); }
.field .req { color: var(--bad); }
.field input, .field select, .field textarea, .search input {
  border: 1px solid var(--line-2); border-radius: 5px; padding: 6px 9px; background: #fff; font-size: .84rem;
}
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: 2px solid rgba(42,120,214,.25); }
.field .hint { font-size: .72rem; color: var(--muted); }
.formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.formgrid .wide { grid-column: 1 / -1; }
fieldset { border: 1px solid var(--line); border-radius: var(--r); margin: 0 0 12px; padding: 10px 12px; }
legend { font-size: .74rem; font-weight: 700; color: var(--ink-2); padding: 0 4px; }
label.check { display: flex; gap: 7px; align-items: center; font-size: .82rem; cursor: pointer; margin: 3px 0; }

/* ---------- toolbar / filters ---------- */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .search input { min-width: 220px; }
.toolbar select { border: 1px solid var(--line-2); border-radius: 5px; padding: 5px 8px; background: #fff; font-size: .8rem; }
.toolbar .gap { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 4px 12px; font-size: .8rem; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button[aria-pressed="true"] { background: var(--navy); color: #fff; }

/* ---------- drawer / modal ---------- */
.scrim { position: fixed; inset: 0; background: rgba(22,32,43,.45); z-index: 60; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(780px, 96vw); background: var(--page);
  z-index: 61; box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.drawer.narrow { width: min(560px, 96vw); }
.drawer .dhead { background: var(--surface); border-bottom: 1px solid var(--line); padding: 12px 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.drawer .dhead h2 { font-size: 1rem; }
.drawer .dhead .sub { color: var(--muted); font-size: .76rem; width: 100%; }
.drawer .dbody { flex: 1; overflow: auto; padding: 16px 18px; }
.drawer .dfoot { border-top: 1px solid var(--line); background: var(--surface); padding: 10px 18px; display: flex; gap: 8px; align-items: center; }
.drawer .dfoot .gap { flex: 1; }
.modal {
  position: fixed; z-index: 61; top: 50%; left: 50%; transform: translate(-50%,-50%);
  background: var(--surface); border-radius: 8px; box-shadow: var(--shadow); width: min(540px, 94vw);
  max-height: 88vh; display: flex; flex-direction: column;
}
.modal.wide { width: min(760px, 94vw); }
.modal .dhead { padding: 13px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal .dhead h2 { font-size: .96rem; }
.modal .dbody { padding: 16px 18px; overflow: auto; }
.modal .dfoot { padding: 11px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.xbtn { margin-left: auto; border: 0; background: none; font-size: 1.15rem; color: var(--muted); cursor: pointer; padding: 2px 8px; border-radius: 4px; }
.xbtn:hover { background: var(--surface-2); color: var(--ink); }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--navy-800); color: #fff; padding: 9px 16px; border-radius: 7px; font-size: .82rem;
  box-shadow: var(--shadow); max-width: 620px; display: flex; gap: 10px; align-items: baseline;
}
.toast.err { background: #7c2222; }
.toast.warn { background: #7a5200; }

/* ---------- misc ---------- */
.refusal { font-size: .76rem; color: var(--muted); background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: 5px; padding: 6px 10px; }
.notebox { font-size: .78rem; background: var(--warn-bg); color: var(--warn-ink); border-radius: 5px; padding: 8px 12px; border: 1px solid #f0dfb2; }
.notebox.info { background: var(--blue-bg); color: var(--blue-ink); border-color: #c8dcf2; }
.notebox.bad { background: var(--bad-bg); color: var(--bad-ink); border-color: #eec6c6; }
.empty { text-align: center; color: var(--muted); padding: 34px 10px; font-size: .84rem; }
.kv { display: grid; grid-template-columns: 190px 1fr; gap: 4px 14px; font-size: .82rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.section-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 700; margin: 20px 0 8px; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.filechip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 3px 9px; font-size: .76rem; margin: 2px 4px 2px 0; }
.filechip button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: .85rem; padding: 0 1px; }
.filechip button:hover { color: var(--bad); }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--navy-100); color: var(--navy); display: inline-grid; place-items: center; font-size: .66rem; font-weight: 750; flex: none; }
.warncount { background: var(--warn-bg); color: var(--warn-ink); font-size: .72rem; padding: 2px 9px; border-radius: 999px; font-weight: 700; }

/* audit foot (§11) */
.audit { margin-top: 22px; border-top: 2px solid var(--line-2); padding-top: 10px; }
.audit h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.audit .arow { display: grid; grid-template-columns: 138px 130px 1fr; gap: 10px; font-size: .74rem; padding: 5px 0; border-bottom: 1px solid var(--line); }
.audit .arow .t { color: var(--muted); font-variant-numeric: tabular-nums; }
.audit .arow .who { font-weight: 600; }
.audit .diff { color: var(--ink-2); }
.audit .diff .b { text-decoration: line-through; color: var(--bad-ink); }
.audit .diff .a { color: var(--good-ink); font-weight: 600; }

/* ---------- calendar (§7.8) ---------- */
.calwrap { display: grid; grid-template-columns: 1fr 270px; gap: 14px; align-items: start; }
@media (max-width: 1000px) { .calwrap { grid-template-columns: 1fr; } }
.calgrid { position: relative; user-select: none; }
.calgrid .headrow { display: grid; margin-left: 52px; }
.calgrid .dayhead { padding: 6px 8px 7px; border-left: 1px solid var(--line); font-size: .74rem; }
.calgrid .dayhead .dname { font-weight: 700; }
.calgrid .dayhead.today .dname { color: var(--accent-dark); }
.calgrid .dayhead .dstats { color: var(--muted); font-size: .68rem; }
.calbody { position: relative; display: flex; border-top: 1px solid var(--line-2); max-height: 66vh; overflow-y: auto; }
.hourcol { width: 52px; flex: none; }
.hourcol .hr { height: 44px; font-size: .66rem; color: var(--muted); text-align: right; padding-right: 6px; transform: translateY(-7px); font-variant-numeric: tabular-nums; }
.daycols { flex: 1; display: grid; position: relative; }
.daycol { position: relative; border-left: 1px solid var(--line); }
.daycol.today { background: #f7fafe; }
.daycol.past { background: repeating-linear-gradient(135deg, transparent 0 14px, rgba(0,0,0,.014) 14px 15px); }
.daycol .hline { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.calev {
  position: absolute; border-radius: 5px; padding: 3px 6px; font-size: .7rem; overflow: hidden;
  border: 1px solid; border-left-width: 4px; cursor: pointer; background: #fff; line-height: 1.25;
}
.calev .t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calev .s { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calev.c-blue { border-color: #9dc3ee; border-left-color: var(--accent); background: #f3f8fe; }
.calev.c-green { border-color: #b5dcb5; border-left-color: var(--good); background: #f2faf2; }
.calev.c-amber { border-color: #ecd39a; border-left-color: #eda100; background: #fdf8ec; }
.calev.c-red { border-color: #eab8b8; border-left-color: var(--bad); background: #fdf3f3; }
.calev.c-grey { border-color: var(--line-2); border-left-color: var(--muted); background: var(--surface-2); color: var(--muted); }
.calev.dragging { opacity: .65; box-shadow: var(--shadow); z-index: 10; }
.calev .grip { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; }
.calev:focus-visible { outline: 2px solid var(--accent); }
.drop-invalid { cursor: not-allowed !important; }
.daycol.droptarget { background: #eef6ee; }
.daycol.dropbad { background: var(--bad-bg); }
.queue .qitem {
  border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 5px;
  background: #fff; padding: 6px 9px; margin-bottom: 7px; font-size: .76rem; cursor: grab;
}
.queue .qitem.room { border-left-color: #7a5fd0; }
.queue .qitem .l { font-weight: 700; }
.queue .qitem .s { color: var(--muted); font-size: .7rem; }
.ghostbar { position: absolute; border-radius: 5px; border: 1.5px dashed var(--accent); background: rgba(42,120,214,.12); z-index: 9; pointer-events: none; font-size: .68rem; color: var(--accent-dark); padding: 2px 6px; font-weight: 700; }
.ghostbar.bad { border-color: var(--bad); background: rgba(208,59,59,.1); color: var(--bad-ink); }

/* ---------- room readiness ---------- */
.roomsum table.data td { padding: 5px 10px; }
.stagecell { display: inline-flex; align-items: center; gap: 6px; }
.progressbar { height: 7px; border-radius: 4px; background: var(--surface-2); overflow: hidden; min-width: 90px; }
.progressbar > div { height: 100%; background: var(--good); border-radius: 4px; }
.roomwin .stage { border: 1px solid var(--line); border-radius: 7px; background: #fff; padding: 11px 13px; margin-bottom: 10px; }
.roomwin .stage.changed { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(42,120,214,.14); }
.roomwin .stage .shead { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.roomwin .stage .shead h4 { font-size: .86rem; }
.roomwin .stage .why { font-size: .73rem; color: var(--warn-ink); background: var(--warn-bg); border-radius: 4px; padding: 4px 8px; margin-top: 7px; }
.roomwin .stage .resrow { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.unsaved { background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 2px 10px; }

/* ---------- charts ---------- */
.chart { width: 100%; }
.chart svg { display: block; width: 100%; }
.chart .legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .72rem; color: var(--ink-2); margin: 4px 2px 0; }
.chart .legend .li { display: inline-flex; gap: 6px; align-items: center; }
.chart .legend .sw { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.chart .legend .swline { width: 16px; height: 0; border-top: 2px dashed var(--navy-800); flex: none; }
.chart .legend .swhollow { width: 11px; height: 11px; border-radius: 3px; border: 1.6px solid var(--accent); background: transparent; flex: none; }
.viztip {
  position: fixed; z-index: 90; background: var(--navy-800); color: #fff; font-size: .72rem;
  border-radius: 5px; padding: 5px 9px; pointer-events: none; box-shadow: var(--shadow); max-width: 260px;
}
.viztip .tt { font-weight: 700; }
.sparkline { display: block; }

/* login */
.loginpage { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, var(--navy-800), var(--navy) 60%, #2c4a74); padding: 20px; }
.loginbox { background: var(--surface); border-radius: 10px; box-shadow: var(--shadow); width: 380px; max-width: 94vw; padding: 28px; }
.loginbox .logo2 { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.loginbox .logo2 .logo { width: 38px; height: 38px; border-radius: 7px; display: block; }
.loginbox .loginlogo { width: 300px; max-width: 100%; height: auto; display: block; margin: 4px auto 2px; }
.loginbox h1 { font-size: 1.05rem; }
.loginbox .sub2 { color: var(--muted); font-size: .78rem; }

.skeleton { color: var(--muted); padding: 30px; text-align: center; }
@media print { .topbar, .tabstrip, .toolbar, .btn { display: none !important; } }

/* ==================== v2.5 Floor Plans ==================== */
.planwrap { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.plancanvas { display: block; width: 100%; height: calc(100vh - 235px); min-height: 420px; background: #fff; touch-action: none; cursor: grab; }
.plancanvas:active { cursor: grabbing; }
.planshape { cursor: pointer; transition: fill-opacity .12s; }
.planshape:hover { fill-opacity: .5; }
.planshape.sel { stroke-dasharray: 6 3; }
.planlabel { fill: #16324e; font-weight: 700; paint-order: stroke; stroke: rgba(255,255,255,.85); stroke-width: 3px; }
.planvertex { fill: #fff; stroke: #16324e; stroke-width: 1.5px; cursor: move; }
.planzoom { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 6px; background: rgba(255,255,255,.9); padding: 5px; border-radius: 7px; border: 1px solid var(--line); }
.plantip { position: fixed; z-index: 95; background: var(--navy-800, #16324e); color: #fff; font-size: .74rem; padding: 4px 9px; border-radius: 5px; pointer-events: none; max-width: 260px; }
.plancard { position: fixed; z-index: 80; background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow); width: min(400px, 92vw); font-size: .8rem; }
.plancard .pchead { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--surface); border-radius: 9px 9px 0 0; }
.plancard .pchead .sub { color: var(--muted); font-size: .72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.plancard .pcbody { padding: 9px 12px; display: flex; flex-direction: column; gap: 7px; }
.plancard .pcrow { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.plancard .pcstage { display: inline-flex; align-items: center; gap: 3px; font-size: .72rem; color: var(--ink-2); }
.plancard .pcstat strong { font-size: .9rem; }
.plancard .pcirs { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.plancard .pcir { font-size: .74rem; text-decoration: none; border: 1px solid var(--line); border-radius: 5px; padding: 2px 7px; display: inline-flex; align-items: center; gap: 4px; }
.planmenu { position: fixed; z-index: 96; background: #fff; border: 1px solid var(--line); border-radius: 7px; box-shadow: var(--shadow); display: flex; flex-direction: column; min-width: 190px; padding: 4px; }
.planmenu button { text-align: left; border: 0; background: none; padding: 7px 10px; font-size: .8rem; border-radius: 5px; cursor: pointer; }
.planmenu button:hover { background: var(--surface); }
.planmenu button.danger { color: #b3261e; }
.plandock { position: fixed; z-index: 70; top: 130px; right: 24px; width: 250px; max-height: 62vh; background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow); display: flex; flex-direction: column; resize: both; overflow: auto; min-width: 200px; min-height: 160px; }
.plandock .dockhead { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--surface); cursor: move; border-radius: 9px 9px 0 0; position: sticky; top: 0; }
.plandock .dockfilters { display: flex; gap: 6px; padding: 7px 8px 0; }
.plandock .dockfilters select { flex: 1; min-width: 0; }
.plandock .docklist { padding: 7px 8px; display: flex; flex-direction: column; gap: 6px; overflow: auto; }
.plandock .dockitem { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 6px; padding: 6px 9px; background: #fff; cursor: grab; display: flex; flex-direction: column; font-size: .78rem; }
.plandock .dockitem .sub { color: var(--muted); font-size: .7rem; }
.planlegend { display: flex; gap: 10px; align-items: center; font-size: .72rem; color: var(--ink-2); flex-wrap: wrap; }
.planlegend .sw { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; opacity: .75; }
.plangrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.plantile { border: 1px solid var(--line); border-radius: 9px; padding: 18px 14px; background: var(--surface); cursor: pointer; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; font-size: .9rem; }
.plantile:hover { border-color: var(--accent); background: #fff; }
.plantile .sub { color: var(--muted); font-size: .74rem; }
.orderrow { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .82rem; }

/* v2.7 — expandable card lists + scrolling body */
.plancard .pcbody { max-height: 62vh; overflow: auto; }
.pcmore { border: 1px dashed var(--line); background: none; border-radius: 5px; padding: 2px 8px; font-size: .72rem; color: var(--accent-dark, #1d5fae); cursor: pointer; }
.pcmore:hover { border-color: var(--accent); background: var(--surface); }
