/* 溯档 · 集团数字档案与智能利用平台
 * 设计语言：档案纸本 / 松烟墨绿 / 朱砂印 / 铜褐
 * 布局语言：横向卷宗标签 + 三栏工作台（目录 / 原件 / 备考表），不使用深色大屏
 * 纯静态，无外部字体与依赖
 */
:root {
  --desk: #e9e1cf;
  --desk-2: #e2d8c3;
  --paper: #f6f0e1;
  --paper-2: #fbf7ec;
  --paper-3: #efe7d6;
  --paper-4: #e7ddc8;
  --ink: #1c2a23;
  --ink-2: #2f4137;
  --ink-3: #4a5a4f;
  --muted: #6f7468;
  --muted-2: #918f80;
  --line: #d5cbb5;
  --line-2: #e3dac7;
  --line-3: #eee7d8;
  --green: #2c5442;
  --green-2: #3d6b53;
  --green-3: #dfe8dc;
  --green-4: #eef3ea;
  --red: #a83a2c;
  --red-2: #c25543;
  --red-3: #f3e2dc;
  --amber: #a9792c;
  --amber-2: #c79a44;
  --amber-3: #f4ebd7;
  --blue: #35586b;
  --blue-3: #e3ebee;
  --ok: #3d6b4f;
  --warn: #a9792c;
  --danger: #a83a2c;
  --serif: "STZhongsong", "华文中宋", "Songti SC", "SimSun", serif;
  --sans: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  --mono: "Bahnschrift", "Consolas", "Cascadia Mono", "SFMono-Regular", monospace;
  --fangsong: "FangSong", "仿宋", "STFangsong", "SimSun", serif;
  --kai: "KaiTi", "楷体", "STKaiti", "SimSun", serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.5;
  background-color: var(--desk);
  background-image:
    radial-gradient(1100px 520px at 48% -8%, rgba(255, 252, 244, .72), transparent 64%),
    repeating-linear-gradient(0deg, rgba(92, 70, 38, .022) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(92, 70, 38, .014) 0 1px, transparent 1px 4px);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; color: inherit; font-size: inherit; }
button { cursor: pointer; }
b, strong { font-weight: 700; }
em { font-style: normal; }
::selection { background: rgba(168, 58, 44, .2); }
:focus-visible { outline: 1px dashed var(--red); outline-offset: 2px; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c9bda6; border: 2px solid var(--paper-2); }
::-webkit-scrollbar-thumb:hover { background: #b3a68d; }

.app { height: 100vh; display: flex; flex-direction: column; }

/* ============ MASTHEAD ============ */
.mast {
  position: relative;
  z-index: 30;
  flex: 0 0 66px;
  height: 66px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 18px;
  padding: 0 18px;
  color: #f2ebda;
  background-color: #172a22;
  background-image:
    linear-gradient(90deg, rgba(240, 228, 196, .035) 1px, transparent 1px),
    linear-gradient(rgba(240, 228, 196, .025) 1px, transparent 1px);
  background-size: 34px 34px;
  box-shadow: inset 0 -3px 0 #8f3227;
}
.mast::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: rgba(240, 228, 196, .18);
}
.mast-brand { display: flex; align-items: center; gap: 11px; padding-right: 4px; }
.seal-mark {
  width: 38px; height: 38px;
  flex: 0 0 38px;
  color: #f3e9d2;
  background: #a83a2c;
  border: 1px solid #c86a56;
  box-shadow: 0 0 0 3px rgba(243, 233, 210, .06), inset 0 0 0 3px rgba(23, 42, 34, .12);
  transform: rotate(-2deg);
}
.seal-mark svg { width: 100%; height: 100%; display: block; }
.brand-name {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .16em;
  color: #fbf4e2;
  white-space: nowrap;
}
.brand-name em {
  margin-left: 7px;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: .2em;
  color: #c79a44;
  vertical-align: 2px;
}
.brand-sub { margin-top: 5px; font-size: 9.5px; letter-spacing: .08em; color: rgba(242, 235, 218, .55); white-space: nowrap; }

.tabs { display: flex; align-items: flex-end; gap: 2px; min-width: 0; padding-left: 8px; }
.tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 56px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-bottom: 0;
  background: transparent;
  color: rgba(242, 235, 218, .58);
  text-align: left;
  transition: color .16s, background .16s;
}
.tab > i { font-family: var(--mono); font-size: 9px; letter-spacing: .06em; color: rgba(199, 154, 68, .6); }
.tab > span { display: flex; flex-direction: column; gap: 3px; }
.tab b { font-size: 12.5px; font-weight: 600; letter-spacing: .04em; }
.tab small { font-family: var(--mono); font-size: 7.5px; letter-spacing: .12em; color: rgba(242, 235, 218, .3); }
.tab:hover { color: #f7f0dc; background: rgba(242, 235, 218, .045); }
.tab.active {
  color: var(--ink);
  background: var(--paper-2);
  border-color: var(--line);
  border-top: 2px solid var(--red);
}
.tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--paper-2); }
.tab.active > i { color: var(--red); }
.tab.active small { color: var(--muted-2); }
.tab-badge {
  min-width: 16px; height: 16px;
  margin-left: 2px;
  padding: 0 4px;
  border: 1px solid rgba(199, 154, 68, .5);
  color: #c79a44;
  font-family: var(--mono);
  font-size: 8.5px;
  line-height: 14px;
  text-align: center;
}
.tab.active .tab-badge { background: var(--red); border-color: var(--red); color: #fff8e9; }
.tab-badge.zero { opacity: .3; }

.mast-right { display: flex; align-items: center; gap: 12px; }
.log-btn {
  display: flex; align-items: center; gap: 6px;
  height: 30px;
  padding: 0 9px;
  border: 1px solid rgba(242, 235, 218, .28);
  background: transparent;
  color: rgba(242, 235, 218, .78);
  font-size: 10px;
  letter-spacing: .06em;
}
.log-btn:hover { border-color: #c79a44; color: #f7f0dc; }
.log-btn b { min-width: 15px; font-family: var(--mono); font-size: 10px; color: #c79a44; text-align: center; }
.role-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  min-width: 232px;
  padding: 4px 9px 4px 6px;
  border: 1px solid rgba(242, 235, 218, .2);
  background: rgba(242, 235, 218, .045);
}
.role-box select {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
}
.role-avatar {
  width: 27px; height: 27px;
  flex: 0 0 27px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #efe4cb;
  color: #233b2e;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 700;
}
.role-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.role-txt small { font-size: 8px; letter-spacing: .08em; color: rgba(242, 235, 218, .42); }
.role-txt b { font-size: 11px; font-weight: 600; color: #f5eedb; white-space: nowrap; }
.role-box::after {
  content: "⌄";
  margin-left: auto;
  font-size: 12px;
  color: rgba(242, 235, 218, .45);
}

/* ============ SUBBAR ============ */
.subbar {
  flex: 0 0 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 18px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: .02em;
}
.sb-left, .sb-right { display: flex; align-items: center; gap: 14px; min-width: 0; }
.sb-left > span { white-space: nowrap; }
.sb-left b { color: var(--ink-2); font-family: var(--mono); font-size: 9.5px; font-weight: 600; }
.sb-fonds { padding-right: 14px; border-right: 1px solid var(--line); }
.sb-std { color: var(--muted-2); }
.sb-live { display: flex; align-items: center; gap: 5px; color: var(--green-2); }
.sb-live i { width: 5px; height: 5px; border-radius: 50%; background: var(--green-2); box-shadow: 0 0 0 3px rgba(61, 107, 83, .12); }
.sb-clock { font-family: var(--mono); color: var(--ink-2); letter-spacing: .06em; }

/* ============ STAGE / COMMON ============ */
.stage {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 13px 18px 10px;
  scrollbar-gutter: stable;
}
.view { height: 100%; display: flex; flex-direction: column; gap: 11px; min-height: 0; }
.view.enter > * { animation: rise .36s both; }
.view.enter > *:nth-child(2) { animation-delay: .04s; }
.view.enter > *:nth-child(3) { animation-delay: .08s; }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.static .view.enter > * { animation: none; }

.panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--paper-2);
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(50, 38, 20, .04), 0 8px 18px -16px rgba(40, 30, 12, .35);
}
.panel-h {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-2);
}
.panel-t {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--ink);
}
.panel-t small { font-family: var(--mono); font-size: 7.5px; font-weight: 400; letter-spacing: .14em; color: var(--muted-2); }
.panel-sub { font-size: 9px; color: var(--muted-2); letter-spacing: .03em; }
.panel-h .spacer { margin-left: auto; }
.panel-b { flex: 1 1 auto; min-height: 0; padding: 11px 12px; overflow: auto; }
.panel-f { flex: 0 0 auto; padding: 8px 12px; border-top: 1px solid var(--line-2); background: rgba(239, 231, 214, .38); }

.eyebrow {
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: .18em;
  color: var(--muted-2);
  text-transform: uppercase;
}
.h-serif { font-family: var(--serif); font-weight: 700; letter-spacing: .06em; }
.muted { color: var(--muted); }
.tiny { font-size: 9px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.red { color: var(--red); }
.green { color: var(--green-2); }
.amber { color: var(--amber); }
.nowrap { white-space: nowrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 28px;
  padding: 0 11px;
  border: 1px solid var(--ink-2);
  background: transparent;
  color: var(--ink-2);
  font-size: 10.5px;
  letter-spacing: .03em;
  white-space: nowrap;
  transition: background .14s, color .14s, border-color .14s;
}
.btn:hover { background: rgba(28, 42, 35, .06); }
.btn.primary { background: var(--green); border-color: var(--green); color: #fbf5e6; }
.btn.primary:hover { background: #234735; }
.btn.red { background: var(--red); border-color: var(--red); color: #fff7e8; }
.btn.red:hover { background: #923125; }
.btn.ghost { border-color: var(--line); color: var(--muted); }
.btn.ghost:hover { border-color: var(--ink-3); color: var(--ink); }
.btn.soft { background: var(--paper-3); border-color: var(--line); color: var(--ink-2); }
.btn.soft:hover { background: var(--paper-4); }
.btn.sm { height: 23px; padding: 0 8px; font-size: 9.5px; }
.btn.block { width: 100%; }
.btn:disabled, .btn.disabled { opacity: .38; cursor: not-allowed; background: transparent; color: var(--muted); border-color: var(--line); }
.btn.primary:disabled { background: var(--muted-2); border-color: var(--muted-2); color: #f7f2e6; opacity: .5; }
.btn .ico { font-family: var(--mono); font-size: 11px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 19px;
  padding: 0 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .35);
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .02em;
  white-space: nowrap;
}
.chip b { font-family: var(--mono); font-weight: 600; }
.chip.red { color: var(--red); border-color: rgba(168, 58, 44, .34); background: rgba(168, 58, 44, .055); }
.chip.green { color: var(--green-2); border-color: rgba(61, 107, 83, .32); background: rgba(61, 107, 83, .065); }
.chip.amber { color: var(--amber); border-color: rgba(169, 121, 44, .34); background: rgba(169, 121, 44, .07); }
.chip.blue { color: var(--blue); border-color: rgba(53, 88, 107, .3); background: rgba(53, 88, 107, .06); }
.chip.mute { color: var(--muted-2); background: transparent; }
.chip.solid-red { color: #fff8e9; background: var(--red); border-color: var(--red); }
.chip.solid-green { color: #f8f4e8; background: var(--green); border-color: var(--green); }

.dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--muted-2); vertical-align: 1px; }
.dot.red { background: var(--red); }
.dot.green { background: var(--green-2); }
.dot.amber { background: var(--amber); }
.dot.blue { background: var(--blue); }

.bar { position: relative; height: 5px; background: var(--paper-4); overflow: hidden; }
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--green-2); }
.bar-fill.red { background: var(--red); }
.bar-fill.amber { background: var(--amber-2); }

.acc-ring {
  --p: 0;
  position: relative;
  width: 46px; height: 46px;
  flex: 0 0 46px;
  border-radius: 50%;
  background: conic-gradient(var(--green-2) calc(var(--p) * 1%), var(--paper-4) 0);
  display: grid; place-items: center;
}
.acc-ring::before { content: ""; position: absolute; inset: 5px; background: var(--paper-2); border-radius: 50%; }
.acc-ring b { position: relative; font-family: var(--mono); font-size: 11px; color: var(--ink); }
.acc-ring.warn { background: conic-gradient(var(--amber) calc(var(--p) * 1%), var(--paper-4) 0); }
.acc-ring.bad { background: conic-gradient(var(--red) calc(var(--p) * 1%), var(--paper-4) 0); }

.empty { display: grid; place-items: center; height: 100%; min-height: 100px; color: var(--muted-2); font-size: 10px; letter-spacing: .05em; }

/* ============ OVERVIEW ============ */
.ov-top {
  flex: 0 0 132px;
  display: grid;
  grid-template-columns: 352px minmax(0, 1fr);
  gap: 11px;
}
.ov-title {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12px 15px 11px 18px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  overflow: hidden;
}
.ov-title::before {
  content: "全宗 XX-001";
  position: absolute;
  right: 10px; top: 9px;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: .12em;
  color: var(--muted-2);
}
.ov-title::after {
  content: "";
  position: absolute;
  right: -26px; bottom: -34px;
  width: 118px; height: 118px;
  border: 1px solid rgba(168, 58, 44, .22);
  border-radius: 50%;
  box-shadow: inset 0 0 0 6px rgba(168, 58, 44, .05);
}
.ov-kicker { font-family: var(--mono); font-size: 8px; letter-spacing: .18em; color: var(--muted-2); }
.ov-h1 {
  margin: 3px 0 3px;
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: .05em;
  color: var(--ink);
}
.ov-h1 em { color: var(--red); font-style: normal; }
.ov-lead { font-size: 9.5px; line-height: 1.6; color: var(--muted); max-width: 300px; }
.ov-lead b { color: var(--ink-2); }

.kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 7px; }
.kpi {
  position: relative;
  min-width: 0;
  padding: 7px 10px 6px 12px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--green-2);
  overflow: hidden;
}
.kpi.red { border-left-color: var(--red); }
.kpi.amber { border-left-color: var(--amber-2); }
.kpi.blue { border-left-color: var(--blue); }
.kpi-l { display: flex; align-items: center; gap: 5px; font-size: 9px; color: var(--muted); letter-spacing: .03em; }
.kpi-l .dot { width: 4px; height: 4px; }
.kpi-v { margin-top: 1px; font-family: var(--mono); font-size: 21px; font-weight: 600; line-height: 1.1; letter-spacing: -.02em; color: var(--ink); }
.kpi-v small { margin-left: 3px; font-family: var(--sans); font-size: 8.5px; font-weight: 400; color: var(--muted-2); letter-spacing: 0; }
.kpi-s { margin-top: 1px; font-size: 8.5px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-s b { color: var(--green-2); font-weight: 600; }
.kpi-s b.red { color: var(--red); }
.kpi-s b.amber { color: var(--amber); }

.ov-main { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 366px; gap: 11px; }
.rooms-panel .panel-b { padding: 4px 8px 0; overflow: hidden; }
.room-svg { width: 100%; height: 100%; display: block; }
.room-legend {
  display: flex; align-items: center; gap: 14px;
  padding: 0 12px;
  min-height: 40px;
  border-top: 1px solid var(--line-2);
  font-size: 8.5px;
  color: var(--muted);
  flex-wrap: wrap;
}
.room-legend .lg { display: flex; align-items: center; gap: 5px; }
.room-legend .sw { width: 9px; height: 9px; border: 1px solid rgba(0, 0, 0, .12); }
.room-legend .lg-note { margin-left: auto; color: var(--muted-2); }

/* SVG room wall */
.cab { cursor: pointer; }
.cab-frame { fill: #f3ecdc; stroke: #c9bda6; stroke-width: 1; }
.cab-frame.on { stroke: var(--red); stroke-width: 1.8; }
.cab-head { fill: #3a3125; }
.cab-plate { fill: #f8f3e6; stroke: #b9aa8d; stroke-width: .8; }
.cab-title { font-family: var(--sans); font-size: 10.5px; fill: #24352c; letter-spacing: .04em; }
.cab-id { font-family: var(--mono); font-size: 8.5px; fill: #8c3b33; letter-spacing: .08em; }
.cab-pct { font-family: var(--mono); font-size: 9px; fill: #4d5b50; }
.cab-vol { font-family: var(--mono); font-size: 8px; fill: #7c7a6b; }
.shelf-board { stroke: #b8ab91; stroke-width: 1.1; }
.shelf-back { fill: #eae1cf; opacity: .55; }
.spine { shape-rendering: crispEdges; }
.slot { fill: none; stroke: #d6cab3; stroke-width: .5; opacity: .55; }
.cab-warn { fill: var(--red); }
.cab-warn-ring { fill: none; stroke: var(--red); stroke-width: 1; opacity: .35; }
.cab-hit { fill: transparent; }
.room-axis { stroke: #c9bda6; stroke-width: .7; stroke-dasharray: 3 4; }
.room-axis-t { font-family: var(--mono); font-size: 7px; fill: #a29a88; letter-spacing: .1em; }

.room-detail .panel-b { padding: 11px 13px; }
.rd-name { display: flex; align-items: flex-start; gap: 10px; }
.rd-name h3 { margin: 0; font-family: var(--serif); font-size: 17px; letter-spacing: .05em; }
.rd-name .eyebrow { display: block; margin-bottom: 2px; }
.rd-cap { margin-left: auto; text-align: right; }
.rd-cap b { display: block; font-family: var(--mono); font-size: 14px; color: var(--green-2); }
.rd-cap small { font-size: 8px; color: var(--muted-2); }
.rd-occ { margin-top: 10px; }
.rd-occ-line { display: flex; justify-content: space-between; font-size: 8.5px; color: var(--muted); margin-bottom: 3px; }
.rd-occ-line b { font-family: var(--mono); color: var(--ink-2); }
.rd-occ .bar { height: 7px; }
.rd-env { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.env-cell { padding: 6px 8px; background: var(--paper-3); border: 1px solid var(--line-2); }
.env-cell .el { font-size: 8px; color: var(--muted-2); letter-spacing: .04em; }
.env-cell .ev { margin-top: 1px; font-family: var(--mono); font-size: 15px; color: var(--ink-2); }
.env-cell .ev small { font-size: 8px; color: var(--muted-2); }
.env-scale { position: relative; height: 3px; margin-top: 5px; background: var(--paper-4); }
.env-scale i { position: absolute; top: 0; bottom: 0; background: rgba(61, 107, 83, .3); }
.env-scale b { position: absolute; top: -2px; width: 1.5px; height: 7px; background: var(--ink-2); }
.env-scale b.bad { background: var(--red); }
.rd-warn {
  display: flex; gap: 6px; margin-top: 9px; padding: 6px 8px;
  border-left: 2px solid var(--red); background: var(--red-3);
  font-size: 8.5px; line-height: 1.5; color: #7b3025;
}
.rd-comp { margin-top: 11px; }
.rd-comp .eyebrow { margin-bottom: 5px; }
.comp-row { display: grid; grid-template-columns: 52px 1fr 34px; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 8.5px; color: var(--muted); }
.comp-row .bar { height: 4px; }
.comp-row b { font-family: var(--mono); font-size: 8.5px; color: var(--ink-2); text-align: right; }
.rd-foot { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 8px; color: var(--muted-2); line-height: 1.6; }
.rd-digital { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: 10px; background: var(--line-2); border: 1px solid var(--line-2); }
.rd-digital div { padding: 5px 7px; background: var(--paper-3); }
.rd-digital span { display: block; font-size: 7.5px; color: var(--muted-2); }
.rd-digital b { display: block; margin-top: 1px; font-family: var(--mono); font-size: 10px; color: var(--ink-2); font-weight: 600; }
.rd-ai {
  margin-top: 9px; padding: 7px 8px;
  border: 1px solid rgba(169, 121, 44, .32);
  background: var(--amber-3);
  font-size: 8.5px; line-height: 1.55; color: #6c531f;
}
.rd-ai b { color: #5b4417; }
.rd-ai button { margin-top: 3px; }

.ov-lower { flex: 0 0 250px; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.04fr) minmax(0, .78fr); gap: 11px; }
.cat-panel .panel-b { padding: 7px 12px 6px; }
.cat-row { display: grid; grid-template-columns: 58px minmax(0, 1fr) 70px 52px; align-items: center; gap: 8px; height: 18.5px; font-size: 9px; }
.cat-row .cn { color: var(--ink-3); letter-spacing: .02em; white-space: nowrap; }
.cat-row .cn i { display: inline-block; width: 5px; height: 5px; margin-right: 5px; vertical-align: 1px; }
.cat-bar2 { position: relative; height: 7px; background: var(--paper-4); }
.cat-bar2 .tot { position: absolute; left: 0; top: 0; bottom: 0; opacity: .3; }
.cat-bar2 .dig { position: absolute; left: 0; top: 0; bottom: 0; opacity: .85; }
.cat-bar2 .opn { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--red); opacity: .8; }
.cat-row .cv { font-family: var(--mono); font-size: 8.5px; color: var(--ink-2); text-align: right; }
.cat-row .cp { font-family: var(--mono); font-size: 8px; color: var(--muted-2); text-align: right; }
.cat-foot { display: flex; justify-content: space-between; gap: 8px; padding-top: 4px; border-top: 1px solid var(--line-2); font-size: 8px; color: var(--muted-2); }

.ai-panel .panel-b { padding: 8px 10px; }
.ai-card {
  position: relative;
  padding: 6px 7px 6px 9px;
  margin-bottom: 6px;
  border-left: 2px solid var(--amber-2);
  background: rgba(244, 235, 215, .45);
}
.ai-card:last-child { margin-bottom: 0; }
.ai-card .ac-h { display: flex; align-items: center; gap: 5px; font-size: 9.5px; font-weight: 600; color: var(--ink-2); }
.ai-card .ac-h .rule { margin-left: auto; font-family: var(--mono); font-size: 7.5px; font-weight: 400; color: var(--amber); }
.ai-card p { margin: 2px 0 0; font-size: 8.5px; line-height: 1.5; color: var(--muted); }
.ai-card p b { color: var(--ink-2); }
.ai-card .ac-link { display: inline-block; margin-top: 2px; border: 0; background: none; padding: 0; font-size: 8px; color: var(--red); border-bottom: 1px dotted rgba(168, 58, 44, .45); }

.todo-panel .panel-b { padding: 5px 8px 4px; }
.todo-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 47px;
  padding: 5px 2px;
  border-bottom: 1px dotted var(--line);
  cursor: pointer;
}
.todo-row:last-child { border-bottom: 0; }
.todo-row:hover { background: rgba(28, 42, 35, .035); }
.todo-ico {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  background: var(--paper-3);
  font-family: var(--serif);
  font-size: 11px;
  color: var(--ink-3);
}
.todo-row.red .todo-ico { color: var(--red); border-color: rgba(168, 58, 44, .32); background: var(--red-3); }
.todo-main b { display: block; font-size: 9.5px; font-weight: 600; color: var(--ink-2); }
.todo-main small { display: block; margin-top: 1px; font-size: 8px; color: var(--muted-2); }
.todo-n { font-family: var(--mono); font-size: 14px; color: var(--ink); }
.todo-row.red .todo-n { color: var(--red); }

/* ============ CATALOG ============ */
.cat-bar { flex: 0 0 44px; display: flex; align-items: center; gap: 12px; padding: 0 12px; background: var(--paper-2); border: 1px solid var(--line); }
.cat-bar .batch { display: flex; align-items: baseline; gap: 7px; }
.cat-bar .batch b { font-family: var(--mono); font-size: 11px; color: var(--ink); }
.cat-bar .batch span { font-size: 9px; color: var(--muted); }
.batch-progress { display: flex; align-items: center; gap: 7px; min-width: 220px; }
.batch-progress .bar { width: 105px; height: 5px; }
.batch-progress b { font-family: var(--mono); font-size: 9px; color: var(--green-2); }
.cat-bar .spacer { margin-left: auto; }
.cat-bar .legend { display: flex; align-items: center; gap: 10px; font-size: 8.5px; color: var(--muted); }
.cat-bar .legend span { display: flex; align-items: center; gap: 4px; }

.cat-grid { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 338px minmax(0, 1fr) 398px; gap: 11px; }

.arch-list .panel-h { gap: 6px; }
.arch-filter { display: flex; gap: 3px; }
.arch-filter button {
  height: 20px; padding: 0 7px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 8.5px;
}
.arch-filter button.on { background: var(--green); border-color: var(--green); color: #f8f3e4; }
.arch-rows { flex: 1 1 auto; min-height: 0; overflow: auto; }
.arch-row {
  position: relative;
  display: block;
  width: 100%;
  padding: 8px 10px 7px 13px;
  border: 0;
  border-bottom: 1px solid var(--line-2);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.arch-row:hover { background: rgba(44, 84, 66, .045); }
.arch-row.active { background: #f1ebdb; }
.arch-row.active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--red); }
.ar-top { display: flex; align-items: center; gap: 6px; }
.ar-no { font-family: var(--mono); font-size: 8px; letter-spacing: .03em; color: var(--muted-2); }
.ar-acc { margin-left: auto; font-family: var(--mono); font-size: 9px; color: var(--green-2); }
.ar-acc.bad { color: var(--red); }
.ar-acc.mid { color: var(--amber); }
.ar-title { display: block; margin-top: 2px; font-size: 10.5px; line-height: 1.4; color: var(--ink-2); font-weight: 600; }
.ar-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.ar-meta .chip { height: 15px; font-size: 7.5px; padding: 0 4px; }

.doc-panel { min-width: 0; }
.doc-tools { flex: 0 0 38px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border-bottom: 1px solid var(--line-2); background: var(--paper-3); }
.doc-tools .pg { display: flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 9px; color: var(--muted); }
.doc-tools .pg b { color: var(--ink); }
.doc-tools .spacer { margin-left: auto; }
.toggle { display: inline-flex; align-items: center; gap: 5px; font-size: 8.5px; color: var(--muted); cursor: pointer; }
.toggle input { appearance: none; width: 22px; height: 11px; border: 1px solid var(--line); background: var(--paper-4); position: relative; cursor: pointer; }
.toggle input::after { content: ""; position: absolute; left: 1px; top: 1px; width: 7px; height: 7px; background: var(--muted-2); transition: all .14s; }
.toggle input:checked { background: var(--green-3); border-color: var(--green-2); }
.toggle input:checked::after { left: 12px; background: var(--green); }

.doc-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 12px;
  overflow: hidden;
  background-color: #dfd5c1;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, .16) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, .16) 75%),
    linear-gradient(45deg, rgba(255, 255, 255, .16) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, .16) 75%);
  background-size: 18px 18px;
  background-position: 0 0, 9px 9px;
}
.doc-page {
  position: relative;
  width: min(100%, 548px);
  aspect-ratio: 210 / 297;
  max-height: 100%;
  background: #fbf6e8;
  background-image: repeating-linear-gradient(0deg, rgba(115, 90, 48, .02) 0 1px, transparent 1px 5px);
  border: 1px solid #e4d8bf;
  box-shadow: 0 2px 3px rgba(40, 30, 12, .12), 0 18px 40px -22px rgba(40, 30, 12, .5);
  overflow: hidden;
}
.doc-page.hand { background: #f6edda; }
.page-body { position: absolute; inset: 0; padding: 5.4% 7.4% 4%; }
.doc-star { color: #b03a2c; font-size: 12px; text-align: center; line-height: 1; letter-spacing: .4em; margin-left: .4em; }
.doc-head {
  margin-top: 3px;
  padding-bottom: 5px;
  border-bottom: 2px solid #b03a2c;
  color: #a8342a;
  font-family: var(--fangsong);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .16em;
  text-align: center;
  white-space: nowrap;
}
.doc-no-row { display: flex; justify-content: space-between; margin-top: 5px; font-family: var(--fangsong); font-size: 8.5px; color: #4b3d2e; }
.doc-secret { color: #a8342a; border: 1px solid rgba(168, 52, 42, .6); padding: 0 3px; font-size: 7.5px; }
.doc-title {
  margin: 8% 0 4%;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: .05em;
  text-align: center;
  color: #241f18;
}
.doc-recipient { font-family: var(--fangsong); font-size: 10.5px; color: #2f271d; line-height: 1.9; }
.doc-body { margin-top: 2px; font-family: var(--fangsong); font-size: 9.2px; line-height: 1.95; color: #2f271d; text-align: justify; }
.doc-body p { margin: 0 0 1px; text-indent: 2em; }
.doc-hand .doc-body { font-family: var(--kai); font-size: 10.5px; line-height: 2.1; color: #43392c; }
.doc-hand .doc-title { font-family: var(--kai); }
.doc-sign { margin-top: 7%; text-align: right; font-family: var(--fangsong); font-size: 9.5px; line-height: 1.9; color: #2f271d; }
.doc-cc { margin-top: 5%; padding-top: 3px; border-top: 1px solid rgba(90, 70, 40, .18); font-family: var(--fangsong); font-size: 8px; color: #5f5140; line-height: 1.6; }
.doc-foot { position: absolute; left: 0; right: 0; bottom: 2.6%; text-align: center; font-family: var(--mono); font-size: 7px; color: #8d8069; letter-spacing: .1em; }
.doc-seal {
  position: absolute;
  right: 16%; bottom: 13%;
  width: 22%;
  aspect-ratio: 1;
  opacity: .86;
  transform: rotate(-11deg);
  color: #b03a2c;
  pointer-events: none;
}
.doc-seal svg { width: 100%; height: 100%; display: block; }
.doc-watermark {
  position: absolute;
  right: -8%;
  top: 30%;
  font-family: var(--serif);
  font-size: 52px;
  letter-spacing: .2em;
  color: rgba(168, 52, 42, .045);
  transform: rotate(-18deg);
  pointer-events: none;
  white-space: nowrap;
}

.doc-boxes { position: absolute; inset: 0; pointer-events: none; }
.pbox {
  position: absolute;
  border: 1px dashed rgba(169, 121, 44, 0);
  background: transparent;
  transition: border-color .15s, background .15s;
  pointer-events: none;
}
.doc-page.show-boxes .pbox { border-color: rgba(169, 121, 44, .38); background: rgba(199, 154, 68, .035); pointer-events: auto; cursor: pointer; }
.doc-page.show-boxes .pbox:hover { border-color: var(--amber); background: rgba(199, 154, 68, .09); }
.doc-page.show-boxes .pbox.on { border-color: var(--red); border-style: solid; background: rgba(168, 58, 44, .07); box-shadow: 0 0 0 2px rgba(168, 58, 44, .12); }
.pbox span {
  position: absolute;
  left: -1px; top: -13px;
  display: none;
  padding: 0 3px;
  background: var(--red);
  color: #fff8e9;
  font-family: var(--mono);
  font-size: 6.5px;
  line-height: 12px;
  white-space: nowrap;
}
.doc-page.show-boxes .pbox.on span { display: block; }

.catalog-side .panel-b { padding: 0; overflow: auto; }
.side-sec { padding: 9px 12px; border-bottom: 1px solid var(--line-2); }
.side-sec:last-child { border-bottom: 0; }
.side-h { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.side-h .t { font-family: var(--serif); font-size: 12.5px; font-weight: 700; letter-spacing: .05em; }
.side-h .spacer { margin-left: auto; }
.side-h .rule { font-family: var(--mono); font-size: 7.5px; color: var(--amber); }
.side-arch { display: flex; gap: 9px; align-items: flex-start; }
.side-arch .sa-main { min-width: 0; flex: 1 1 auto; }
.side-arch .sa-no { font-family: var(--mono); font-size: 8px; color: var(--muted-2); letter-spacing: .04em; }
.side-arch .sa-title { margin-top: 2px; font-size: 11px; font-weight: 600; line-height: 1.45; color: var(--ink); }
.side-arch .sa-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }

.field-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 39px;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  border-bottom: 1px dotted var(--line);
}
.field-row:last-child { border-bottom: 0; }
.field-row.on { background: rgba(168, 58, 44, .035); }
.field-label { font-size: 8.5px; color: var(--muted); }
.field-label i { color: var(--red); font-style: normal; margin-left: 2px; }
.field-input {
  width: 100%;
  height: 23px;
  padding: 0 5px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, .45);
  font-size: 9.5px;
  color: var(--ink-2);
}
.field-input:hover { border-color: var(--line); }
.field-input:focus { border-color: var(--amber); background: #fffdf7; outline: none; }
.field-input:disabled { background: transparent; border-color: transparent; color: var(--ink-2); padding-left: 0; }
.field-input.changed { border-color: rgba(61, 107, 83, .45); background: var(--green-4); }
.conf { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.conf b { font-family: var(--mono); font-size: 8.5px; color: var(--green-2); }
.conf b.mid { color: var(--amber); }
.conf b.bad { color: var(--red); }
.conf small { font-size: 6.5px; color: var(--muted-2); }
.conf .mini { width: 30px; height: 2px; background: var(--paper-4); }
.conf .mini i { display: block; height: 100%; background: var(--green-2); }
.conf .mini i.mid { background: var(--amber-2); }
.conf .mini i.bad { background: var(--red); }

.ai-hint {
  padding: 7px 8px;
  border: 1px solid rgba(169, 121, 44, .28);
  background: var(--amber-3);
}
.ai-hint .ah-h { display: flex; align-items: center; gap: 5px; font-size: 9px; font-weight: 600; color: #6a4f1a; }
.ai-hint .ah-h .v { margin-left: auto; font-family: var(--mono); font-size: 10px; color: #5b4417; }
.ai-hint p { margin: 3px 0 0; font-size: 8.2px; line-height: 1.55; color: #77602e; }
.ai-hint .ah-f { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.ai-hint .ah-f .rule { font-family: var(--mono); font-size: 7px; color: #8a6c2f; }

.four-list { display: flex; flex-direction: column; gap: 4px; }
.four-row {
  display: grid;
  grid-template-columns: 17px 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  padding: 4px 5px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, .28);
  font-size: 8px;
}
.four-row.fail { border-color: rgba(168, 58, 44, .32); background: var(--red-3); }
.four-ic { width: 15px; height: 15px; display: grid; place-items: center; border: 1px solid var(--green-2); color: var(--green-2); font-size: 8px; }
.four-row.fail .four-ic { border-color: var(--red); color: var(--red); }
.four-k { font-weight: 600; color: var(--ink-2); }
.four-n { color: var(--muted); line-height: 1.4; }
.four-row.fail .four-n { color: #7e3328; }

.side-foot { flex: 0 0 auto; padding: 8px 12px; border-top: 1px solid var(--line); background: var(--paper-3); }
.sf-line { display: flex; align-items: center; gap: 8px; }
.sf-line .acc-ring { width: 38px; height: 38px; flex: 0 0 38px; }
.sf-line .acc-ring::before { inset: 4px; }
.sf-line .acc-ring b { font-size: 9px; }
.sf-txt { min-width: 0; flex: 1 1 auto; }
.sf-txt b { display: block; font-family: var(--mono); font-size: 9px; color: var(--ink-2); }
.sf-txt small { display: block; font-size: 7.5px; color: var(--muted-2); }
.sf-gate { margin-top: 5px; font-size: 7.5px; line-height: 1.45; color: var(--muted-2); }
.sf-gate b { color: var(--red); }
.sf-actions { display: flex; gap: 5px; margin-top: 6px; }
.sf-actions .btn { flex: 1; }

/* ============ ACCESS ============ */
.access-bar { flex: 0 0 52px; display: flex; align-items: center; gap: 9px; padding: 0 11px; background: var(--paper-2); border: 1px solid var(--line); }
.search-wrap { position: relative; flex: 1 1 auto; display: flex; align-items: center; gap: 0; height: 34px; border: 1px solid var(--ink-3); background: #fffdf7; }
.search-wrap .s-ico { width: 30px; text-align: center; color: var(--red); font-size: 13px; }
.search-input { flex: 1 1 auto; height: 100%; border: 0; background: transparent; font-size: 12px; letter-spacing: .03em; outline: none; }
.search-input::placeholder { color: #a8a08f; }
.search-wrap .s-clear { border: 0; background: none; color: var(--muted-2); padding: 0 6px; font-size: 12px; }
.seg { display: flex; border: 1px solid var(--line); height: 28px; }
.seg button { height: 100%; padding: 0 9px; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 9px; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--ink); color: #f8f2e2; }
.access-bar .hint { font-size: 8px; color: var(--muted-2); white-space: nowrap; }

.access-grid { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 186px 574px minmax(0, 1fr); gap: 11px; }
.filter-panel .panel-b { padding: 9px 10px; }
.filter-group { margin-bottom: 12px; }
.filter-group:last-child { margin-bottom: 0; }
.fg-h { display: flex; align-items: center; gap: 5px; margin-bottom: 5px; font-size: 8px; font-weight: 600; letter-spacing: .06em; color: var(--muted-2); }
.fg-h .spacer { margin-left: auto; }
.check-row {
  display: flex; align-items: center; gap: 5px;
  width: 100%; height: 22px; padding: 0 4px;
  border: 0; background: transparent;
  color: var(--muted); font-size: 9px; text-align: left; cursor: pointer;
}
.check-row:hover { background: rgba(44, 84, 66, .04); }
.check-row.on { background: var(--green-4); color: var(--ink); }
.check-row .bx { width: 9px; height: 9px; border: 1px solid var(--line); background: #fffdf7; }
.check-row.on .bx { background: var(--green); border-color: var(--green); box-shadow: inset 0 0 0 2px #fffdf7; }
.check-row .n { margin-left: auto; font-family: var(--mono); font-size: 7.5px; color: var(--muted-2); }
.filter-tip { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 7.5px; line-height: 1.55; color: var(--muted-2); }

.results-panel .panel-h { min-height: 36px; }
.result-tags { flex: 0 0 auto; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; padding: 5px 10px; border-bottom: 1px solid var(--line-2); background: var(--blue-3); font-size: 8px; color: var(--blue); }
.result-tags b { font-weight: 600; }
.result-tags button { margin-left: auto; border: 0; background: none; padding: 0; color: var(--red); font-size: 7.5px; border-bottom: 1px dotted rgba(168, 58, 44, .5); }
.results-list { flex: 1 1 auto; min-height: 0; overflow: auto; }
.search-insight { flex: 0 0 auto; padding: 7px 11px; border-top: 1px solid var(--line); background: var(--paper-3); }
.search-insight .si-h { display: flex; align-items: center; gap: 5px; font-size: 8px; font-weight: 600; color: var(--ink-2); }
.search-insight .si-h .spacer { margin-left: auto; }
.search-insight p { margin: 2px 0 0; font-size: 7.8px; line-height: 1.5; color: var(--muted); }
.search-insight .si-link { border: 0; background: none; padding: 0; color: var(--red); font-size: 7.5px; border-bottom: 1px dotted rgba(168, 58, 44, .45); }
.result {
  position: relative;
  display: block; width: 100%;
  padding: 9px 11px 8px;
  border: 0; border-bottom: 1px solid var(--line-2);
  background: transparent; text-align: left; cursor: pointer;
}
.result:hover { background: rgba(44, 84, 66, .04); }
.result.active { background: #f1ebdb; }
.result.active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--green); }
.result-top { display: flex; align-items: center; gap: 5px; }
.result-no { font-family: var(--mono); font-size: 8px; color: var(--muted-2); }
.result-score { margin-left: auto; font-family: var(--mono); font-size: 8px; color: var(--amber); }
.result-title { display: block; margin-top: 2px; font-size: 11px; font-weight: 600; line-height: 1.45; color: var(--ink-2); }
.result-snip { display: block; margin-top: 3px; font-size: 8.5px; line-height: 1.55; color: var(--muted); }
.result-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.result-meta .chip { height: 15px; padding: 0 4px; font-size: 7.5px; }
mark { background: rgba(199, 154, 68, .3); color: inherit; padding: 0 1px; }

.reader-panel { flex: 0 0 330px; }
.reader-panel .panel-b { padding: 9px 12px; }
.reader-h { display: flex; align-items: flex-start; gap: 8px; }
.reader-h .r-no { font-family: var(--mono); font-size: 7.5px; color: var(--muted-2); }
.reader-h h3 { margin: 1px 0 0; font-family: var(--serif); font-size: 13.5px; line-height: 1.45; letter-spacing: .03em; }
.reader-h .acc-ring { width: 38px; height: 38px; flex: 0 0 38px; }
.reader-h .acc-ring::before { inset: 4px; }
.reader-h .acc-ring b { font-size: 8.5px; }
.reader-body { display: grid; grid-template-columns: minmax(0, 1fr) 142px; gap: 10px; margin-top: 7px; }
.reader-sum { font-size: 9px; line-height: 1.65; color: var(--muted); }
.reader-sum b { color: var(--ink-2); }
.entity-list { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 6px; }
.entity { display: inline-flex; align-items: center; gap: 3px; height: 17px; padding: 0 4px; border: 1px solid var(--line); background: rgba(255, 255, 255, .4); font-size: 7.5px; color: var(--muted); }
.entity b { color: var(--ink-3); font-weight: 600; }
.reader-side { border-left: 1px solid var(--line-2); padding-left: 9px; }
.reader-side .rs-h { font-size: 7.5px; letter-spacing: .08em; color: var(--muted-2); }
.reader-side .rs-v { margin-top: 2px; font-family: var(--mono); font-size: 9px; color: var(--ink-2); }
.reader-side .rs-v small { font-family: var(--sans); font-size: 7.5px; color: var(--muted-2); }
.reader-actions { display: flex; gap: 5px; margin-top: 7px; }
.reader-excerpt { margin-top: 7px; padding: 5px 8px; border-left: 2px solid var(--line); background: rgba(239, 231, 214, .45); }
.reader-excerpt span { font-size: 7.5px; letter-spacing: .06em; color: var(--muted-2); }
.reader-excerpt p { margin: 2px 0 0; font-family: var(--fangsong); font-size: 8.5px; line-height: 1.6; color: var(--ink-3); }
.reader-excerpt .rx { display: flex; gap: 8px; margin-top: 3px; font-size: 7.2px; color: var(--muted-2); }
.reader-excerpt .rx b { color: var(--green-2); font-weight: 600; }

.queue-panel { flex: 1 1 auto; min-height: 0; }
.queue-tabs { display: flex; gap: 2px; padding: 0 10px; border-bottom: 1px solid var(--line-2); }
.queue-tabs button {
  position: relative;
  height: 34px; padding: 0 10px;
  border: 0; border-bottom: 2px solid transparent;
  background: transparent; color: var(--muted); font-size: 9.5px;
}
.queue-tabs button.on { color: var(--ink); border-bottom-color: var(--red); font-weight: 600; }
.queue-tabs button .n { margin-left: 4px; font-family: var(--mono); font-size: 8px; color: var(--red); }
.queue-tabs .spacer { margin-left: auto; }
.queue-tabs .perm-note { display: flex; align-items: center; font-size: 8px; color: var(--muted-2); }
.queue-list { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 3px 10px 6px; }
.queue-rule { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-top: 1px solid var(--line); background: var(--paper-3); font-size: 7.8px; color: var(--muted); }
.queue-tips { flex: 0 0 auto; margin: 6px 10px 2px; padding: 6px 8px; border: 1px solid var(--line-2); background: var(--paper-3); }
.qt-h { margin-bottom: 3px; font-size: 7.5px; letter-spacing: .05em; color: var(--muted-2); }
.qt { display: flex; align-items: baseline; gap: 5px; font-size: 7.6px; line-height: 1.55; color: var(--muted); }
.qt b { color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.queue-rule b { color: var(--ink-2); white-space: nowrap; font-weight: 600; }
.queue-rule span { line-height: 1.45; }
.queue-rule button { margin-left: auto; flex: 0 0 auto; border: 0; background: none; padding: 0; color: var(--red); font-size: 7.5px; border-bottom: 1px dotted rgba(168, 58, 44, .45); }
.borrow-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 7px; align-items: center; padding: 6px 0; border-bottom: 1px dotted var(--line); }
.borrow-id { font-family: var(--mono); font-size: 8px; color: var(--ink-2); }
.borrow-id small { display: block; margin-top: 1px; font-family: var(--sans); font-size: 7.5px; color: var(--muted-2); }
.borrow-main { min-width: 0; }
.borrow-main b { display: block; font-size: 9.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.borrow-main span { display: block; margin-top: 1px; font-size: 8px; color: var(--muted-2); }
.borrow-act { display: flex; gap: 3px; }
.borrow-act .btn { height: 22px; padding: 0 6px; font-size: 8.5px; }
.stage-chip { height: 16px; padding: 0 4px; font-size: 7.5px; }
.queue-empty { padding: 18px 6px; text-align: center; font-size: 8.5px; color: var(--muted-2); }

/* ============ APPRAISAL ============ */
.appr-bar { flex: 0 0 58px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) 1.7fr; gap: 0; background: var(--paper-2); border: 1px solid var(--line); }
.appr-stat { display: flex; flex-direction: column; justify-content: center; padding: 0 13px; border-right: 1px solid var(--line-2); }
.appr-stat .l { font-size: 8px; color: var(--muted-2); letter-spacing: .04em; }
.appr-stat .v { font-family: var(--mono); font-size: 19px; line-height: 1.2; color: var(--ink); }
.appr-stat .v small { margin-left: 3px; font-family: var(--sans); font-size: 8px; color: var(--muted-2); }
.appr-stat .v.red { color: var(--red); }
.appr-note { display: flex; align-items: center; gap: 8px; padding: 0 13px; font-size: 8.2px; line-height: 1.55; color: var(--muted); }
.appr-note b { color: var(--ink-2); }

.appr-grid { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 452px minmax(0, 1fr); gap: 11px; }
.due-list .panel-b { padding: 0; overflow: auto; display: flex; flex-direction: column; }
.due-summary { margin-top: auto; flex: 0 0 auto; padding: 9px 11px; border-top: 1px solid var(--line); background: var(--paper-3); }
.ds-h { display: flex; align-items: center; gap: 5px; margin-bottom: 4px; font-size: 8px; letter-spacing: .05em; color: var(--muted-2); }
.ds-h b { color: var(--ink-2); }
.ds-row { display: flex; align-items: center; gap: 6px; height: 17px; font-size: 8px; color: var(--muted); }
.ds-row i { width: 5px; height: 5px; border-radius: 50%; }
.ds-row span { min-width: 56px; }
.ds-row b { font-family: var(--mono); font-weight: 600; color: var(--ink-2); }
.ds-row small { margin-left: auto; font-family: var(--mono); font-size: 7.5px; color: var(--muted-2); }
.ds-note { margin-top: 4px; padding-top: 4px; border-top: 1px dashed var(--line); font-size: 7.5px; line-height: 1.5; color: var(--muted-2); }
.due-row {
  position: relative;
  display: block; width: 100%;
  padding: 9px 11px 8px 13px;
  border: 0; border-bottom: 1px solid var(--line-2);
  background: transparent; text-align: left; cursor: pointer;
}
.due-row:hover { background: rgba(44, 84, 66, .04); }
.due-row.active { background: #f1ebdb; }
.due-row.active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--red); }
.due-top { display: flex; align-items: center; gap: 5px; }
.due-no { font-family: var(--mono); font-size: 7.5px; color: var(--muted-2); }
.due-days { margin-left: auto; font-family: var(--mono); font-size: 8px; color: var(--muted-2); }
.due-days.warn { color: var(--amber); }
.due-days.bad { color: var(--red); }
.due-ai { display: block; margin-top: 4px; font-family: var(--mono); font-size: 7px; letter-spacing: .02em; color: var(--muted-2); }
.due-guide { margin: 8px 10px 0; padding: 7px 8px; border: 1px solid var(--line-2); background: var(--paper-3); }
.dg-h { display: flex; align-items: center; gap: 5px; margin-bottom: 3px; font-size: 7.5px; letter-spacing: .05em; color: var(--muted-2); }
.dg-row { font-size: 7.2px; line-height: 1.55; color: var(--muted); }
.dg-row b { font-family: var(--mono); font-weight: 600; color: var(--ink-3); margin-right: 2px; }
.dg-row.on { color: var(--red); }
.dg-row.on b { color: var(--red); }
.flow-guide { margin: 9px 0 0; }
.due-timeline { margin: 8px 10px 0; padding: 6px 8px; border: 1px dashed var(--line); }
.dt-h { margin-bottom: 2px; font-size: 7.5px; letter-spacing: .05em; color: var(--muted-2); }
.dt-row { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 5px; align-items: center; height: 15px; font-size: 7.2px; color: var(--muted); }
.dt-row span { font-family: var(--mono); color: var(--muted-2); }
.dt-row b { font-weight: 600; color: var(--ink-3); }
.dt-row:last-child b { color: var(--red); }
.rule-mini { margin-top: 8px; padding: 5px 7px; border-left: 2px solid var(--amber-2); background: var(--amber-3); font-size: 7.2px; line-height: 1.55; color: #6c531f; }
.deadline-card { margin-top: 9px; padding: 6px 8px; border: 1px solid var(--line-2); background: rgba(239, 231, 214, .4); }
.dl-h { display: flex; align-items: center; gap: 5px; margin-bottom: 3px; font-size: 7.5px; letter-spacing: .05em; color: var(--muted-2); }
.dl-row { display: flex; align-items: center; justify-content: space-between; height: 15px; font-size: 7.4px; color: var(--muted); }
.dl-row b { font-family: var(--mono); font-weight: 600; color: var(--ink-3); }
.dl-note { margin-top: 3px; padding-top: 3px; border-top: 1px dashed var(--line); font-size: 7.3px; line-height: 1.45; color: var(--muted-2); }
.dl-note b { font-family: var(--mono); color: var(--red); }
.rule-mini b { color: #5b4417; }
.sign-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); }
.sign-cell { padding: 4px 6px; background: var(--paper-2); }
.sign-cell span { display: block; font-size: 7px; color: var(--muted-2); }
.sign-cell b { display: block; margin-top: 1px; font-size: 8.5px; color: var(--ink-2); }
.sign-cell i { display: block; margin-top: 1px; font-style: normal; font-size: 7px; color: var(--muted-2); }
.sign-cell i.done { color: var(--green-2); }
.due-title { display: block; margin-top: 2px; font-size: 10.5px; font-weight: 600; line-height: 1.4; color: var(--ink-2); }
.due-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.due-meta .chip { height: 15px; padding: 0 4px; font-size: 7.5px; }
.due-status { font-family: var(--mono); font-size: 7.5px; color: var(--amber); }
.due-status.done { color: var(--green-2); }

.appr-main { min-width: 0; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 11px; }
.appr-detail .panel-b { padding: 10px 12px; display: flex; flex-direction: column; }
.appr-block { margin-top: 9px; padding-top: 7px; border-top: 1px dashed var(--line); }
.appr-block .ab-h { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-family: var(--serif); font-size: 10px; font-weight: 700; letter-spacing: .05em; color: var(--ink-2); }
.appr-block .ab-h span { margin-left: auto; font-family: var(--mono); font-size: 7px; font-weight: 400; color: var(--muted-2); }
.mini-table { width: 100%; border-collapse: collapse; font-size: 7.8px; }
.mini-table td { padding: 3px 4px; border-bottom: 1px dotted var(--line); color: var(--muted); }
.mini-table td:first-child { width: 80px; color: var(--ink-3); }
.mini-table td.n { font-family: var(--mono); text-align: right; color: var(--ink-2); }
.impact-line { display: flex; align-items: center; gap: 7px; padding: 4px 6px; background: var(--paper-3); border: 1px solid var(--line-2); font-size: 8px; color: var(--muted); }
.impact-line b { font-family: var(--mono); font-size: 9px; color: var(--red); }
.impact-line em { color: var(--muted-2); }
.impact-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); }
.impact-grid div { padding: 4px 6px; background: var(--paper-2); }
.impact-grid span { display: block; font-size: 7.2px; color: var(--muted-2); }
.impact-grid b { display: block; margin-top: 1px; font-family: var(--mono); font-size: 9px; color: var(--ink-2); }
.appr-title { display: flex; align-items: flex-start; gap: 8px; }
.appr-title h3 { margin: 1px 0 0; font-family: var(--serif); font-size: 16px; line-height: 1.45; letter-spacing: .03em; }
.meta-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-top: 8px; background: var(--line-2); border: 1px solid var(--line-2); }
.meta-cell { padding: 5px 7px; background: var(--paper-2); }
.meta-cell .k { font-size: 7.5px; color: var(--muted-2); }
.meta-cell .v { margin-top: 1px; font-size: 9px; color: var(--ink-2); font-weight: 600; }
.meta-cell .v.mono { font-family: var(--mono); font-size: 8.5px; }
.rule-quote { margin-top: 8px; padding: 7px 9px; border-left: 2px solid var(--amber-2); background: var(--amber-3); font-size: 8.2px; line-height: 1.55; color: #6c531f; }
.rule-quote b { color: #5b4417; }
.use-log { display: flex; gap: 12px; margin-top: 8px; padding: 6px 8px; background: var(--paper-3); border: 1px solid var(--line-2); }
.use-log div { display: flex; flex-direction: column; gap: 1px; }
.use-log .k { font-size: 7.5px; color: var(--muted-2); }
.use-log .v { font-family: var(--mono); font-size: 10px; color: var(--ink-2); }
.ai-opinion { margin-top: 8px; border: 1px solid rgba(53, 88, 107, .28); background: var(--blue-3); }
.ai-opinion .ao-h { display: flex; align-items: center; gap: 5px; padding: 5px 8px; border-bottom: 1px solid rgba(53, 88, 107, .18); font-size: 8.5px; color: var(--blue); font-weight: 600; }
.ai-opinion .ao-h .v { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--blue); }
.ai-opinion .ao-h .rule { font-family: var(--mono); font-size: 7px; color: var(--muted-2); }
.ai-opinion p { margin: 0; padding: 6px 8px 7px; font-size: 8.2px; line-height: 1.6; color: #3d5663; }
.opinion-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin-top: 8px; }
.opinion-card {
  padding: 6px 7px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .35);
  text-align: left;
  cursor: pointer;
}
.opinion-card:hover { border-color: var(--ink-3); }
.opinion-card.on { border-color: var(--green); background: var(--green-4); box-shadow: inset 0 0 0 1px var(--green); }
.opinion-card b { display: block; font-size: 9px; color: var(--ink-2); }
.opinion-card small { display: block; margin-top: 2px; font-size: 7.2px; line-height: 1.4; color: var(--muted-2); }
.opinion-card .ai-mark { display: inline-block; margin-top: 2px; font-family: var(--mono); font-size: 6.5px; color: var(--blue); }
.reason-box { margin-top: 7px; }
.reason-box label { display: flex; align-items: center; gap: 5px; margin-bottom: 3px; font-size: 8px; color: var(--muted); }
.reason-box textarea {
  width: 100%;
  min-height: 48px;
  resize: vertical;
  padding: 5px 7px;
  border: 1px solid var(--line);
  background: #fffdf7;
  font-size: 8.5px;
  line-height: 1.55;
  color: var(--ink-2);
}
.reason-box textarea:focus { outline: none; border-color: var(--amber); }
.appr-actions { display: flex; align-items: center; gap: 6px; margin-top: 7px; }
.appr-actions .spacer { margin-left: auto; }
.appr-actions .hint { font-size: 7.5px; color: var(--muted-2); }

.flow-panel .panel-b { padding: 10px 12px; }
.flow { display: flex; flex-direction: column; gap: 0; }
.flow-step { position: relative; display: grid; grid-template-columns: 21px minmax(0, 1fr) auto; gap: 7px; padding: 0 0 12px; }
.flow-step:last-child { padding-bottom: 0; }
.flow-step::before { content: ""; position: absolute; left: 10px; top: 19px; bottom: 0; width: 1px; background: var(--line); }
.flow-step:last-child::before { display: none; }
.flow-dot { width: 19px; height: 19px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--paper-2); font-family: var(--mono); font-size: 7px; color: var(--muted-2); z-index: 1; }
.flow-step.done .flow-dot { border-color: var(--green); background: var(--green); color: #f8f3e4; }
.flow-step.curr .flow-dot { border-color: var(--red); color: var(--red); box-shadow: 0 0 0 3px rgba(168, 58, 44, .1); }
.flow-tx b { display: block; font-size: 9px; color: var(--ink-2); }
.flow-tx small { display: block; margin-top: 1px; font-size: 7.5px; line-height: 1.45; color: var(--muted-2); }
.flow-st { align-self: start; font-family: var(--mono); font-size: 7px; color: var(--muted-2); }
.flow-step.done .flow-st { color: var(--green-2); }
.flow-step.curr .flow-st { color: var(--red); }
.flow-panel .panel-b { padding: 10px 12px; display: flex; flex-direction: column; }
.flow-actions { display: flex; flex-direction: column; gap: 5px; margin-top: 4px; }
.approval-log { margin-top: 9px; padding-top: 7px; border-top: 1px dashed var(--line); }
.approval-log .al-h { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; font-size: 8px; letter-spacing: .05em; color: var(--muted-2); }
.approval-log .al-h .spacer { margin-left: auto; }
.al-row { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 6px; padding: 3px 0; border-bottom: 1px dotted var(--line); font-size: 7.5px; }
.al-row .at { font-family: var(--mono); color: var(--muted-2); }
.al-row .ax { color: var(--ink-3); line-height: 1.45; }
.al-row .ax b { color: var(--ink-2); }
.al-empty { padding: 5px 0; font-size: 7.8px; color: var(--muted-2); }
.checklist { margin-top: 9px; padding-top: 7px; border-top: 1px dashed var(--line); }
.cl-h { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; font-size: 8px; letter-spacing: .05em; color: var(--muted-2); }
.cl-h .spacer { margin-left: auto; }
.cl-h span:last-child { font-family: var(--mono); color: var(--green-2); }
.cl-row { display: flex; align-items: center; gap: 5px; height: 16px; font-size: 7.6px; color: var(--muted-2); }
.cl-row i { width: 11px; height: 11px; display: grid; place-items: center; border: 1px solid var(--line); font-style: normal; font-size: 6.5px; }
.cl-row.done { color: var(--ink-3); }
.cl-row.done i { border-color: var(--green-2); color: var(--green-2); }
.flow-actions .btn { width: 100%; }
.flow-role-hint { margin-top: 6px; padding: 5px 7px; border: 1px dashed var(--line); font-size: 7.8px; line-height: 1.5; color: var(--muted); }
.flow-role-hint b { color: var(--red); }
.execute-box { margin-top: 8px; padding: 8px; border: 1px solid rgba(168, 58, 44, .3); background: var(--red-3); }
.execute-box .eb-h { font-size: 8.5px; font-weight: 600; color: #7b3025; }
.execute-box p { margin: 2px 0 5px; font-size: 7.8px; line-height: 1.5; color: #84463b; }
.execute-box label { display: flex; align-items: flex-start; gap: 5px; font-size: 7.8px; line-height: 1.45; color: #6f3a30; cursor: pointer; }
.execute-box input { margin-top: 1px; accent-color: var(--red); }
.execute-box .btn { margin-top: 6px; }

.ledger-box { margin-top: 9px; }
.flow-panel .ledger-box { margin-top: 9px; padding-top: 0; }
.ledger-h { display: flex; align-items: center; gap: 5px; margin-bottom: 4px; font-size: 8px; letter-spacing: .05em; color: var(--muted-2); }
.ledger-h .spacer { margin-left: auto; }
.ledger-row { display: grid; grid-template-columns: 60px minmax(0, 1fr) 30px; gap: 5px; padding: 4px 0; border-bottom: 1px dotted var(--line); font-size: 7.5px; }
.ledger-row .lid { font-family: var(--mono); color: var(--red); }
.ledger-row .lt { color: var(--ink-3); line-height: 1.35; min-width: 0; overflow: hidden; }
.ledger-row .lt i { display: block; font-family: var(--mono); font-size: 6.5px; font-style: normal; color: var(--muted-2); }
.ledger-row .lv { font-family: var(--mono); text-align: right; color: var(--muted); }
.ledger-meta { margin-top: 3px; font-size: 7px; line-height: 1.45; color: var(--muted-2); }

/* ============ SHEET / MODAL / TOAST ============ */
.overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(23, 34, 28, .38);
  opacity: 0; visibility: hidden;
  transition: opacity .18s, visibility .18s;
}
.overlay.open { opacity: 1; visibility: visible; }
.sheet {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 90;
  width: 468px;
  display: flex; flex-direction: column;
  background: var(--paper-2);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 50px -24px rgba(20, 30, 22, .6);
  transform: translateX(102%);
  transition: transform .22s;
  visibility: hidden;
}
.sheet.open { transform: none; visibility: visible; }
.sheet-h { flex: 0 0 auto; display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px 11px; border-bottom: 1px solid var(--line); background: var(--paper-3); }
.sheet-h .sh-main { min-width: 0; flex: 1 1 auto; }
.sheet-h h3 { margin: 2px 0 0; font-family: var(--serif); font-size: 17px; letter-spacing: .04em; }
.sheet-h p { margin: 3px 0 0; font-size: 8.5px; color: var(--muted); }
.sheet-close { width: 26px; height: 26px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 14px; line-height: 1; }
.sheet-close:hover { border-color: var(--red); color: var(--red); }
.sheet-b { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 13px 16px 18px; }
.sheet-f { flex: 0 0 auto; padding: 9px 16px; border-top: 1px solid var(--line); background: var(--paper-3); display: flex; gap: 7px; align-items: center; }
.sheet-f .spacer { margin-left: auto; }

.ev-block { margin-bottom: 12px; }
.ev-block h4 { margin: 0 0 5px; font-family: var(--serif); font-size: 12px; letter-spacing: .05em; color: var(--ink-2); }
.ev-block p { margin: 0; font-size: 9px; line-height: 1.65; color: var(--muted); }
.ev-rule { padding: 7px 9px; border-left: 2px solid var(--amber-2); background: var(--amber-3); font-size: 8.5px; line-height: 1.6; color: #6c531f; }
.ev-rule b { color: #5b4417; }
.ev-table { width: 100%; border-collapse: collapse; font-size: 8.5px; }
.ev-table th { padding: 5px 4px; border-bottom: 1px solid var(--line); font-size: 7.5px; font-weight: 600; color: var(--muted-2); text-align: left; background: var(--paper-3); }
.ev-table td { padding: 4px; border-bottom: 1px dotted var(--line); color: var(--ink-3); }
.ev-table td.n { font-family: var(--mono); text-align: right; }
.ev-formula { padding: 7px 9px; background: #24382d; color: #e9e2cf; font-family: var(--mono); font-size: 8.5px; line-height: 1.7; white-space: pre-wrap; }
.ev-kv { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); }
.ev-kv div { padding: 5px 7px; background: var(--paper-2); font-size: 8.5px; }
.ev-kv .k { color: var(--muted-2); }
.ev-kv .v { color: var(--ink-2); }

.log-list { display: flex; flex-direction: column; }
.log-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; padding: 7px 0; border-bottom: 1px dotted var(--line); }
.log-t { font-family: var(--mono); font-size: 7.5px; line-height: 1.5; color: var(--muted-2); }
.log-t b { display: block; font-family: var(--sans); font-size: 8.5px; color: var(--ink-2); font-weight: 600; }
.log-main b { font-size: 9px; color: var(--ink-2); }
.log-main span { display: block; margin-top: 1px; font-size: 8px; line-height: 1.5; color: var(--muted); }
.log-main .lr { margin-top: 2px; font-family: var(--mono); font-size: 7px; color: var(--amber); }
.log-filter { display: flex; gap: 4px; margin-bottom: 9px; flex-wrap: wrap; }

.modal {
  position: fixed; inset: 0; z-index: 100;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(23, 34, 28, .45);
}
.modal.open { display: grid; }
.modal-card {
  width: min(520px, 100%);
  max-height: 88vh;
  display: flex; flex-direction: column;
  background: var(--paper-2);
  border: 1px solid var(--line);
  box-shadow: 0 26px 70px -20px rgba(18, 28, 20, .65);
  animation: modalIn .18s both;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(6px) scale(.995); } to { opacity: 1; transform: none; } }
.static .modal-card { animation: none; }
.modal-h { display: flex; align-items: flex-start; gap: 10px; padding: 13px 15px 10px; border-bottom: 1px solid var(--line); background: var(--paper-3); }
.modal-h h3 { margin: 1px 0 0; font-family: var(--serif); font-size: 16px; letter-spacing: .04em; }
.modal-h p { margin: 2px 0 0; font-size: 8.5px; color: var(--muted); }
.modal-h .sheet-close { margin-left: auto; }
.modal-b { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 13px 15px; }
.modal-f { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; padding: 9px 15px; border-top: 1px solid var(--line); background: var(--paper-3); }
.modal-f .spacer { margin-left: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.form-row { display: flex; flex-direction: column; gap: 3px; }
.form-row.full { grid-column: 1 / -1; }
.form-row label { font-size: 8.5px; color: var(--muted); }
.form-row label i { color: var(--red); font-style: normal; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; height: 29px; padding: 0 7px;
  border: 1px solid var(--line); background: #fffdf7;
  font-size: 9.5px; color: var(--ink-2);
}
.form-row textarea { height: 56px; padding: 5px 7px; resize: vertical; line-height: 1.5; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { outline: none; border-color: var(--amber); }
.form-note { margin-top: 8px; padding: 6px 8px; border: 1px dashed var(--line); font-size: 8px; line-height: 1.55; color: var(--muted); }
.form-note b { color: var(--red); }
.radio-row { display: flex; gap: 5px; }
.radio-row button { flex: 1; height: 27px; border: 1px solid var(--line); background: transparent; font-size: 9px; color: var(--muted); }
.radio-row button.on { border-color: var(--green); background: var(--green-4); color: var(--ink); box-shadow: inset 0 0 0 1px var(--green); }

.toast {
  position: fixed; left: 50%; bottom: 42px; z-index: 120;
  display: flex; align-items: center; gap: 8px;
  min-width: 220px; max-width: 560px;
  padding: 9px 13px;
  background: #1d3228;
  color: #f5eeda;
  border-left: 3px solid #c79a44;
  box-shadow: 0 12px 34px -10px rgba(15, 25, 18, .65);
  font-size: 10px; line-height: 1.5;
  opacity: 0; visibility: hidden;
  transform: translate(-50%, 8px);
  transition: all .2s;
}
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.toast i { width: 5px; height: 5px; border-radius: 50%; background: #c79a44; flex: 0 0 5px; }
.toast.err { border-left-color: var(--red-2); }
.toast.err i { background: var(--red-2); }
.toast.ok { border-left-color: #7aa488; }
.toast.ok i { background: #7aa488; }

/* ============ FOOTER ============ */
.foot {
  flex: 0 0 26px;
  height: 26px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  background: #1a2c23;
  color: rgba(242, 235, 218, .42);
  font-size: 8px;
  letter-spacing: .04em;
}
.foot b { font-family: var(--mono); color: rgba(199, 154, 68, .8); font-weight: 400; }
.foot-mid { color: rgba(242, 235, 218, .28); }

/* ============ RESPONSIVE / THUMB ============ */
@media (max-width: 1420px) {
  .mast { gap: 10px; padding: 0 13px; }
  .brand-sub { display: none; }
  .tab { padding: 0 9px; }
  .tab small { display: none; }
  .tabs { padding-left: 2px; }
  .stage { padding: 10px 13px 8px; }
  .ov-top { grid-template-columns: 312px minmax(0, 1fr); }
  .ov-h1 { font-size: 20px; }
  .ov-main { grid-template-columns: minmax(0, 1fr) 330px; }
  .ov-lower { grid-template-columns: minmax(0, 1.42fr) minmax(0, 1.1fr) minmax(0, .8fr); }
  .cat-grid { grid-template-columns: 306px minmax(0, 1fr) 368px; }
  .access-grid { grid-template-columns: 170px 520px minmax(0, 1fr); }
  .appr-grid { grid-template-columns: 400px minmax(0, 1fr); }
  .appr-main { grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); }
  .kpi-v { font-size: 19px; }
}

@media (max-width: 1260px) {
  .role-txt small { display: none; }
  .role-box { min-width: 190px; }
  .sb-std { display: none; }
  .tab-badge { display: none; }
  .ov-top { grid-template-columns: 280px minmax(0, 1fr); }
  .ov-lead { font-size: 8.5px; }
  .kpi-v { font-size: 17px; }
  .kpi-s { font-size: 7.5px; }
  .ov-main { grid-template-columns: minmax(0, 1fr) 300px; }
  .ov-lower { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1.1fr) minmax(0, .85fr); }
  .cat-row { grid-template-columns: 52px minmax(0, 1fr) 58px 44px; gap: 5px; }
  .cat-grid { grid-template-columns: 286px minmax(0, 1fr) 346px; }
  .access-grid { grid-template-columns: 160px 470px minmax(0, 1fr); }
  .appr-grid { grid-template-columns: 360px minmax(0, 1fr); }
  .reader-body { grid-template-columns: 1fr; }
  .reader-side { border-left: 0; padding-left: 0; display: flex; gap: 12px; }
}

/* 1200×675 案例缩略图：保留卷宗标签与库房墙 */
@media (max-width: 1210px) {
  .mast { height: 60px; flex-basis: 60px; }
  .brand-name { font-size: 22px; }
  .seal-mark { width: 33px; height: 33px; flex-basis: 33px; }
  .tab { height: 50px; }
  .subbar { font-size: 8.5px; }
  .sb-left > span:nth-child(3), .sb-left > span:nth-child(4) { display: none; }
  .stage { padding: 8px 10px 6px; }
  .ov-top { flex-basis: 118px; grid-template-columns: 250px minmax(0, 1fr); gap: 7px; }
  .ov-h1 { font-size: 17px; }
  .ov-lead { display: none; }
  .kpi { padding: 5px 7px 4px 9px; }
  .kpi-v { font-size: 15px; }
  .kpi-s { display: none; }
  .kpi-grid { gap: 5px; }
  .ov-main { grid-template-columns: minmax(0, 1fr) 268px; gap: 7px; }
  .ov-lower { display: none; }
  .room-detail .panel-b { overflow: hidden; }
  .rd-comp { display: none; }
  .rd-foot { display: none; }
  .rd-ai { display: none; }
  .ov-title::after { display: none; }
  .foot { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}


/* ============================================================
   TECH SKIN v2 · ARCHIVE INTELLIGENCE CONSOLE
   深色 HUD / 青蓝光效 / 玻璃面板 / 冷光扫描件
   仅覆盖视觉，不改动布局与交互
   ============================================================ */
:root {
  color-scheme: dark;
  --desk: #050b12;
  --desk-2: #07121b;
  --paper: #08131d;
  --paper-2: #0a1823;
  --paper-3: #0d1f2d;
  --paper-4: #122a3a;
  --ink: #e3f2fb;
  --ink-2: #c7dfef;
  --ink-3: #b0cada;
  --muted: #91adc0;
  --muted-2: #6e8a9e;
  --line: #17384a;
  --line-2: #102b3b;
  --line-3: #0d2331;
  --green: #2fe0cf;
  --green-2: #5cf2e3;
  --green-3: #0b3a3c;
  --green-4: #082a2d;
  --red: #ff5f73;
  --red-2: #ff7d8e;
  --red-3: #33131c;
  --amber: #ffc857;
  --amber-2: #ffd166;
  --amber-3: #2c240f;
  --blue: #5aa9ff;
  --blue-3: #0b2238;
  --ok: #2fe0cf;
  --warn: #ffc857;
  --danger: #ff5f73;
  --display: "Bahnschrift", "DIN Alternate", "Microsoft YaHei UI", "PingFang SC", sans-serif;
}

body {
  color: var(--ink);
  background-color: #050b12;
  background-image:
    radial-gradient(1000px 560px at 16% -12%, rgba(47, 224, 207, .10), transparent 62%),
    radial-gradient(900px 540px at 86% -6%, rgba(90, 169, 255, .10), transparent 60%),
    radial-gradient(1200px 700px at 50% 118%, rgba(128, 96, 255, .055), transparent 64%),
    linear-gradient(rgba(47, 224, 207, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 224, 207, .035) 1px, transparent 1px);
  background-size: auto, auto, auto, 56px 56px, 56px 56px;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .02) 0 1px, transparent 1px 4px);
  opacity: .45;
  mix-blend-mode: screen;
}
::selection { background: rgba(47, 224, 207, .28); color: #f2fdff; }
:focus-visible { outline: 1px dashed var(--green); outline-offset: 2px; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #050e16; }
::-webkit-scrollbar-thumb { background: #1b4356; border: 2px solid #050e16; }
::-webkit-scrollbar-thumb:hover { background: #2a6078; }

/* ---------- masthead ---------- */
.mast {
  background-color: #050e16;
  background-image:
    linear-gradient(90deg, rgba(47, 224, 207, .045) 1px, transparent 1px),
    linear-gradient(rgba(47, 224, 207, .03) 1px, transparent 1px);
  background-size: 28px 28px;
  box-shadow: inset 0 -1px 0 rgba(47, 224, 207, .32), 0 10px 30px rgba(0, 0, 0, .55);
}
.mast::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(47, 224, 207, .7), rgba(90, 169, 255, .45), transparent);
}
.mast::after {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(47, 224, 207, .28) 18%, rgba(47, 224, 207, .08) 60%, transparent);
  box-shadow: 0 0 18px rgba(47, 224, 207, .18);
}
.seal-mark {
  color: #8ff8ee;
  background: linear-gradient(145deg, rgba(47, 224, 207, .14), rgba(90, 169, 255, .06));
  border: 1px solid rgba(47, 224, 207, .6);
  box-shadow: 0 0 18px rgba(47, 224, 207, .18), inset 0 0 16px rgba(47, 224, 207, .08);
  transform: none;
}
.brand-name {
  font-family: var(--display);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: .18em;
  color: transparent;
  background: linear-gradient(100deg, #f2fdff 0%, #b9fbf5 52%, #2fe0cf 100%);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: 0 0 24px rgba(47, 224, 207, .18);
}
.brand-name::before {
  content: "// ";
  color: var(--green);
  -webkit-text-fill-color: var(--green);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0;
  vertical-align: 7px;
  opacity: .8;
}
.brand-name em {
  color: var(--green);
  -webkit-text-fill-color: var(--green);
  font-size: 8px;
  letter-spacing: .24em;
}
.brand-sub { color: rgba(178, 210, 226, .68); font-family: var(--mono); font-size: 8px; letter-spacing: .14em; }

.tabs { gap: 3px; }
.tab {
  color: rgba(190, 220, 235, .68);
  border: 1px solid transparent;
  border-bottom: 0;
}
.tab > i { color: rgba(47, 224, 207, .55); }
.tab small { color: rgba(190, 220, 235, .42); }
.tab:hover { color: #eafcff; background: rgba(47, 224, 207, .05); }
.tab.active {
  color: #effdff;
  background: #07141e;
  border-color: #17465a;
  border-top: 2px solid var(--green);
  box-shadow: inset 0 10px 24px rgba(47, 224, 207, .045), 0 -2px 16px rgba(47, 224, 207, .1);
}
.tab.active::after { background: #07141e; }
.tab.active > i { color: var(--green); }
.tab.active small { color: var(--muted); }
.tab-badge { border-color: rgba(47, 224, 207, .4); color: var(--green); }
.tab.active .tab-badge { background: var(--green); border-color: var(--green); color: #031215; }
.tab-badge.zero { opacity: .35; }

.mast-sys {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 9px;
  border: 1px solid rgba(47, 224, 207, .18);
  background: rgba(47, 224, 207, .035);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: .12em;
  color: var(--muted);
  white-space: nowrap;
}
.mast-sys i { width: 5px; height: 5px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.mast-sys b { color: var(--green); font-weight: 400; }
.log-btn { border-color: rgba(47, 224, 207, .22); color: rgba(207, 232, 243, .8); }
.log-btn:hover { border-color: var(--green); color: #effdff; box-shadow: 0 0 14px rgba(47, 224, 207, .14); }
.log-btn b { color: var(--green); }
.role-box { border-color: rgba(47, 224, 207, .18); background: rgba(47, 224, 207, .035); }
.role-box::after { color: rgba(47, 224, 207, .55); }
.role-avatar {
  background: linear-gradient(145deg, #5cf2e3, #2fa9c9);
  color: #04171c;
  box-shadow: 0 0 14px rgba(47, 224, 207, .28);
}
.role-txt small { color: rgba(178, 210, 226, .58); }
.role-txt b { color: #eaf9ff; }

/* ---------- subbar / footer ---------- */
.subbar {
  background: #06121b;
  border-bottom: 1px solid #123445;
  color: var(--muted);
  box-shadow: inset 0 -1px 0 rgba(47, 224, 207, .05);
}
.sb-left b { color: var(--ink-2); }
.sb-fonds { border-right-color: #14384a; }
.sb-std { color: var(--muted-2); }
.sb-live { color: var(--green); }
.sb-live i { background: var(--green); box-shadow: 0 0 10px rgba(47, 224, 207, .7); }
.sb-clock { color: var(--green); text-shadow: 0 0 10px rgba(47, 224, 207, .3); }
.foot {
  background: #040b11;
  color: rgba(178, 210, 226, .52);
  border-top: 1px solid rgba(47, 224, 207, .12);
}
.foot b { color: rgba(47, 224, 207, .72); }

/* ---------- panels & shared ---------- */
.panel {
  background: linear-gradient(180deg, rgba(11, 26, 38, .94), rgba(6, 17, 27, .95));
  border: 1px solid #14384a;
  box-shadow: 0 0 0 1px rgba(47, 224, 207, .018), 0 22px 44px -30px rgba(0, 0, 0, .95);
}
.panel::before {
  content: "";
  position: absolute;
  left: -1px; top: -1px;
  width: 14px; height: 14px;
  border-left: 1px solid rgba(47, 224, 207, .62);
  border-top: 1px solid rgba(47, 224, 207, .62);
  pointer-events: none;
  z-index: 2;
}
.panel::after {
  content: "";
  position: absolute;
  right: -1px; bottom: -1px;
  width: 14px; height: 14px;
  border-right: 1px solid rgba(47, 224, 207, .3);
  border-bottom: 1px solid rgba(47, 224, 207, .3);
  pointer-events: none;
  z-index: 2;
}
.panel-h {
  border-bottom: 1px solid #103041;
  background: linear-gradient(90deg, rgba(47, 224, 207, .055), rgba(47, 224, 207, .008) 58%, transparent);
}
.panel-t {
  font-family: var(--display);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .1em;
  color: #eaf9ff;
}
.panel-t::before {
  content: "";
  width: 3px;
  height: 12px;
  background: var(--green);
  box-shadow: 0 0 10px rgba(47, 224, 207, .7);
}
.panel-t small { color: var(--green); opacity: .58; }
.panel-sub { color: var(--muted); }
.panel-b { scrollbar-gutter: stable; }
.panel-f { background: #081722; border-top-color: #123445; }
.eyebrow { color: var(--green); opacity: .68; }
.muted { color: var(--muted); }
.empty { color: var(--muted-2); }

.btn {
  border-color: #1b4356;
  background: rgba(9, 24, 36, .55);
  color: #bcdcec;
}
.btn:hover { border-color: var(--green); color: #effdff; background: rgba(47, 224, 207, .08); box-shadow: 0 0 14px rgba(47, 224, 207, .14); }
.btn.primary {
  background: linear-gradient(100deg, #17a99f, #35e0cf 62%, #67f2e4);
  border-color: #63f2e4;
  color: #031416;
  font-weight: 600;
  box-shadow: 0 0 18px rgba(47, 224, 207, .2);
}
.btn.primary:hover { background: linear-gradient(100deg, #1cc0b3, #4af0e0); color: #031416; }
.btn.red { background: rgba(255, 95, 115, .1); border-color: rgba(255, 95, 115, .65); color: #ff8d9c; }
.btn.red:hover { background: rgba(255, 95, 115, .18); color: #ffd3d9; }
.btn.ghost { border-color: #183e50; color: var(--muted); }
.btn.ghost:hover { border-color: var(--green); color: #e9fbff; }
.btn.soft { background: rgba(47, 224, 207, .06); border-color: #1b4356; color: #bcdcec; }
.btn.soft:hover { background: rgba(47, 224, 207, .11); }
.btn:disabled, .btn.disabled { background: transparent; color: var(--muted-2); border-color: #14303f; opacity: .55; }
.btn.primary:disabled { background: #123240; border-color: #17465a; color: var(--muted); opacity: .55; }

.chip {
  background: rgba(8, 22, 34, .62);
  border-color: #1a4052;
  color: var(--muted);
}
.chip.red { color: #ff8d9c; border-color: rgba(255, 95, 115, .42); background: rgba(255, 95, 115, .08); }
.chip.green { color: #6ff5e7; border-color: rgba(47, 224, 207, .34); background: rgba(47, 224, 207, .07); }
.chip.amber { color: #ffd166; border-color: rgba(255, 200, 87, .36); background: rgba(255, 200, 87, .07); }
.chip.blue { color: #8bc4ff; border-color: rgba(90, 169, 255, .34); background: rgba(90, 169, 255, .08); }
.chip.mute { color: var(--muted-2); background: transparent; }
.chip.solid-red { color: #19070b; background: var(--red); border-color: var(--red); }
.chip.solid-green { color: #031416; background: var(--green); border-color: var(--green); }
.dot.red { background: var(--red); box-shadow: 0 0 7px rgba(255, 95, 115, .6); }
.dot.green { background: var(--green); box-shadow: 0 0 7px rgba(47, 224, 207, .6); }
.dot.amber { background: var(--amber); box-shadow: 0 0 7px rgba(255, 200, 87, .5); }
.dot.blue { background: var(--blue); box-shadow: 0 0 7px rgba(90, 169, 255, .5); }
.dot { background: var(--muted-2); }
.bar { background: #0a2230; }
.bar-fill { background: var(--green); box-shadow: 0 0 8px rgba(47, 224, 207, .4); }
.bar-fill.red { background: var(--red); box-shadow: 0 0 8px rgba(255, 95, 115, .4); }
.bar-fill.amber { background: var(--amber); box-shadow: 0 0 8px rgba(255, 200, 87, .35); }
.acc-ring { background: conic-gradient(var(--green) calc(var(--p) * 1%), #0f2b39 0); }
.acc-ring::before { background: #0a1823; }
.acc-ring b { color: #eaffff; }
.acc-ring.warn { background: conic-gradient(var(--amber) calc(var(--p) * 1%), #0f2b39 0); }
.acc-ring.bad { background: conic-gradient(var(--red) calc(var(--p) * 1%), #0f2b39 0); }

/* ---------- overview ---------- */
.ov-title {
  background: linear-gradient(135deg, rgba(12, 31, 44, .96), rgba(5, 15, 24, .97));
  border-color: #14384a;
  border-left: 2px solid var(--green);
  box-shadow: inset 0 0 42px rgba(47, 224, 207, .025);
}
.ov-title::before { color: var(--green); opacity: .55; }
.ov-title::after {
  border-color: rgba(47, 224, 207, .18);
  box-shadow: inset 0 0 0 6px rgba(47, 224, 207, .035), 0 0 30px rgba(47, 224, 207, .05);
}
.ov-kicker { color: var(--green); opacity: .7; }
.ov-h1 {
  font-family: var(--display);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: .06em;
  color: #f0fcff;
  text-shadow: 0 0 24px rgba(47, 224, 207, .12);
}
.ov-h1 em { color: var(--green); text-shadow: 0 0 18px rgba(47, 224, 207, .4); }
.ov-lead { color: var(--muted); }
.ov-lead b { color: var(--ink-2); }

.kpi {
  background: linear-gradient(180deg, rgba(11, 28, 41, .94), rgba(6, 17, 26, .95));
  border-color: #14384a;
  border-left: 2px solid var(--green);
  box-shadow: inset 0 0 26px rgba(47, 224, 207, .025);
}
.kpi.red { border-left-color: var(--red); }
.kpi.amber { border-left-color: var(--amber); }
.kpi.blue { border-left-color: var(--blue); }
.kpi-l { color: var(--muted); }
.kpi-v { color: #f0fcff; text-shadow: 0 0 16px rgba(47, 224, 207, .16); }
.kpi-v span { color: var(--green); font-size: .55em; }
.kpi-v small { color: var(--muted); }
.kpi-s { color: var(--muted-2); }
.kpi-s b { color: var(--green); }
.kpi-s b.red { color: var(--red); }
.kpi-s b.amber { color: var(--amber); }

.rooms-panel .panel-b {
  background-image:
    linear-gradient(rgba(47, 224, 207, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 224, 207, .035) 1px, transparent 1px);
  background-size: 22px 22px;
}
.room-legend { border-top-color: #103041; color: #8faec2; }
.room-legend .lg-note { color: var(--muted-2); }

.cab-frame { fill: #091925; stroke: #1b4256; }
.cab-frame.on { stroke: var(--green); stroke-width: 1.8; filter: drop-shadow(0 0 6px rgba(47, 224, 207, .45)); }
.cab-plate { fill: #0c2230; stroke: #2a5a70; }
.cab-title { fill: #d9f1fb; }
.cab-id { fill: var(--green); }
.cab-pct { fill: #8fb3c8; }
.cab-vol { fill: #5f7d90; }
.shelf-back { fill: #06131c; opacity: .85; }
.shelf-board { stroke: #1a3a4b; }
.slot { stroke: #1b4052; opacity: .75; }
.cab-warn { fill: var(--red); }
.cab-warn-ring { stroke: var(--red); opacity: .5; }
.cab:hover .cab-frame { stroke: #3fe9db; }
.room-axis { stroke: #1a3a4b; }
.room-axis-t { fill: #4f6d80; }

.room-detail .panel-b { background: linear-gradient(180deg, rgba(47, 224, 207, .018), transparent 40%); }
.rd-name h3 { font-family: var(--display); font-size: 18px; color: #effdff; }
.rd-cap b { color: var(--green); }
.rd-cap small { color: var(--muted-2); }
.rd-occ-line { color: var(--muted); }
.rd-occ-line b { color: var(--ink-2); }
.env-cell { background: #0a1d2a; border-color: #14384a; }
.env-cell .el { color: var(--muted-2); }
.env-cell .ev { color: #e6f8ff; }
.env-cell .ev small { color: var(--muted); }
.env-scale { background: #0b2635; }
.env-scale i { background: rgba(47, 224, 207, .22); }
.env-scale b { background: var(--green); box-shadow: 0 0 6px rgba(47, 224, 207, .7); }
.env-scale b.bad { background: var(--red); box-shadow: 0 0 6px rgba(255, 95, 115, .7); }
.rd-warn { background: rgba(255, 95, 115, .08); border-left-color: var(--red); color: #ffafba; }
.rd-comp .eyebrow { color: var(--green); }
.comp-row { color: var(--muted); }
.comp-row b { color: var(--ink-2); }
.rd-foot { border-top-color: #103041; color: var(--muted-2); }
.rd-digital { background: #102b3b; border-color: #14384a; }
.rd-digital div { background: #0a1d2a; }
.rd-digital span { color: var(--muted-2); }
.rd-digital b { color: var(--ink-2); }
.rd-ai { background: rgba(255, 200, 87, .07); border-color: rgba(255, 200, 87, .3); color: #e7d39b; }
.rd-ai b { color: #ffd166; }

.cat-row .cn { color: #c2d9e8; }
.cat-row .cv { color: #d8eaf4; }
.cat-row .cp { color: #7f9bb0; }
.cat-bar2 { background: #0a2230; }
.cat-bar2 .tot { opacity: .22; }
.cat-bar2 .dig { opacity: .95; box-shadow: 0 0 8px rgba(47, 224, 207, .16); }
.cat-bar2 .opn { background: var(--red); box-shadow: 0 0 6px rgba(255, 95, 115, .4); }
.cat-foot { border-top-color: #103041; color: var(--muted-2); }
.cat-foot b { color: var(--green); }

.ai-card {
  background: rgba(10, 28, 42, .62);
  border-left: 2px solid var(--amber);
}
.ai-card:nth-child(1) { border-left-color: var(--red); }
.ai-card:nth-child(2) { border-left-color: var(--amber); }
.ai-card:nth-child(3) { border-left-color: var(--green); }
.ai-card:nth-child(4) { border-left-color: var(--blue); }
.ai-card .ac-h { color: #e8faff; }
.ai-card .ac-h .rule { color: var(--muted-2); }
.ai-card p { color: #a9c3d5; }
.ai-card p b { color: var(--ink-2); }
.ai-card .ac-link { color: var(--green); border-bottom-color: rgba(47, 224, 207, .4); }

.todo-row { border-bottom-color: #103041; }
.todo-row:hover { background: rgba(47, 224, 207, .045); }
.todo-ico { background: #0a1d2a; border-color: #14384a; color: var(--ink-3); }
.todo-row.red .todo-ico { color: var(--red); border-color: rgba(255, 95, 115, .35); background: rgba(255, 95, 115, .08); }
.todo-main b { color: var(--ink-2); }
.todo-main small { color: #7f9bb0; }
.todo-n { color: var(--green); }
.todo-row.red .todo-n { color: var(--red); }

/* ---------- catalog ---------- */
.cat-bar {
  background: linear-gradient(90deg, rgba(11, 28, 41, .96), rgba(6, 17, 26, .96));
  border-color: #14384a;
}
.cat-bar .batch b { color: var(--green); }
.cat-bar .batch span { color: var(--muted); }
.batch-progress b { color: var(--green); }
.arch-filter button { border-color: #1a4052; color: var(--muted); background: transparent; }
.arch-filter button.on { background: var(--green); border-color: var(--green); color: #031416; }
.arch-row { border-bottom-color: #0f2a39; }
.arch-row:hover { background: rgba(47, 224, 207, .045); }
.arch-row.active { background: rgba(47, 224, 207, .075); }
.arch-row.active::before { background: var(--green); box-shadow: 0 0 10px rgba(47, 224, 207, .6); }
.ar-no { color: var(--muted-2); }
.ar-acc { color: var(--green); }
.ar-acc.bad { color: var(--red); }
.ar-acc.mid { color: var(--amber); }
.ar-title { color: var(--ink-2); }
.ar-meta .chip { color: var(--muted); }

.doc-tools { background: #081824; border-bottom-color: #103041; }
.doc-tools .pg { color: var(--muted); }
.doc-tools .pg b { color: var(--green); }
.toggle { color: var(--muted); }
.toggle input { background: #0a2230; border-color: #1a4052; }
.toggle input::after { background: var(--muted-2); }
.toggle input:checked { background: rgba(47, 224, 207, .16); border-color: var(--green); }
.toggle input:checked::after { background: var(--green); box-shadow: 0 0 6px var(--green); }

.doc-stage {
  background-color: #040d15;
  background-image:
    radial-gradient(circle at 50% 46%, rgba(47, 224, 207, .075), transparent 58%),
    linear-gradient(rgba(47, 224, 207, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 224, 207, .04) 1px, transparent 1px);
  background-size: auto, 24px 24px, 24px 24px;
}
.doc-stage::before {
  content: "DIGITAL SURROGATE // A4 · 300DPI";
  position: absolute;
  left: 11px; top: 8px;
  z-index: 3;
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: .12em;
  color: rgba(47, 224, 207, .55);
  pointer-events: none;
}
.doc-stage::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(47, 224, 207, .13);
  pointer-events: none;
}
.doc-page {
  border: 1px solid rgba(47, 224, 207, .35);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .45), 0 0 40px rgba(47, 224, 207, .14), 0 30px 70px rgba(0, 0, 0, .65);
  filter: saturate(.94) brightness(.98);
}
.doc-page::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(47, 224, 207, .05) 0 1px, transparent 1px 3px);
  opacity: .28;
  mix-blend-mode: multiply;
}
.doc-watermark { color: rgba(24, 150, 160, .13); }
.pbox { border-color: rgba(47, 224, 207, 0); }
.doc-page.show-boxes .pbox { border-color: rgba(47, 224, 207, .52); background: rgba(47, 224, 207, .035); }
.doc-page.show-boxes .pbox:hover { border-color: var(--green); background: rgba(47, 224, 207, .1); }
.doc-page.show-boxes .pbox.on { border-color: var(--amber); background: rgba(255, 200, 87, .1); box-shadow: 0 0 0 2px rgba(255, 200, 87, .16); }
.pbox span { background: var(--amber); color: #1a1304; }

.catalog-side .panel-b { background: transparent; }
.side-sec { border-bottom-color: #103041; }
.side-h .t { font-family: var(--display); color: #eaf9ff; }
.side-h .rule { color: var(--green); opacity: .6; }
.side-arch .sa-no { color: var(--muted-2); }
.side-arch .sa-title { color: #eaf9ff; }
.field-row { border-bottom-color: #103041; }
.field-row.on { background: rgba(47, 224, 207, .035); }
.field-label { color: var(--muted); }
.field-input {
  background: rgba(6, 19, 29, .9);
  border-color: #1a4052;
  color: var(--ink-2);
}
.field-input:hover { border-color: #2b627a; }
.field-input:focus { border-color: var(--green); background: #071b28; box-shadow: 0 0 0 2px rgba(47, 224, 207, .08); }
.field-input:disabled { background: transparent; border-color: transparent; color: var(--ink-2); }
.field-input.changed { border-color: rgba(47, 224, 207, .45); background: rgba(47, 224, 207, .06); }
.conf b { color: var(--green); }
.conf b.mid { color: var(--amber); }
.conf b.bad { color: var(--red); }
.conf small { color: var(--muted-2); }
.conf .mini { background: #0a2230; }
.conf .mini i { background: var(--green); }
.conf .mini i.mid { background: var(--amber); }
.conf .mini i.bad { background: var(--red); }

.ai-hint { background: rgba(255, 200, 87, .055); border-color: rgba(255, 200, 87, .24); }
.ai-hint .ah-h { color: #ffe6a6; }
.ai-hint .ah-h .v { color: var(--amber); }
.ai-hint p { color: #dcc48e; }
.ai-hint .ah-f .rule { color: #9c8754; }
.four-row { background: rgba(8, 22, 34, .55); border-color: #14384a; }
.four-row.fail { background: rgba(255, 95, 115, .07); border-color: rgba(255, 95, 115, .32); }
.four-ic { border-color: var(--green); color: var(--green); }
.four-row.fail .four-ic { border-color: var(--red); color: var(--red); }
.four-k { color: var(--ink-2); }
.four-n { color: var(--muted); }
.four-row.fail .four-n { color: #ff9aa7; }
.side-foot { background: #081722; border-top-color: #14384a; }
.sf-txt b { color: var(--ink-2); }
.sf-txt small { color: var(--muted-2); }
.sf-gate { color: var(--muted-2); }
.sf-gate b { color: var(--red); }

/* ---------- access ---------- */
.access-bar {
  background: linear-gradient(90deg, rgba(11, 28, 41, .96), rgba(6, 17, 26, .96));
  border-color: #14384a;
}
.search-wrap { background: #06131d; border-color: #2a6278; box-shadow: inset 0 0 22px rgba(47, 224, 207, .035); }
.search-wrap:focus-within { border-color: var(--green); box-shadow: 0 0 18px rgba(47, 224, 207, .14), inset 0 0 22px rgba(47, 224, 207, .04); }
.search-wrap .s-ico { color: var(--green); }
.search-input { color: #eaf9ff; }
.search-input::placeholder { color: #557183; }
.seg { border-color: #1a4052; }
.seg button { border-right-color: #1a4052; color: var(--muted); }
.seg button.on { background: var(--green); color: #031416; font-weight: 600; }
.access-bar .hint { color: var(--muted-2); }
.filter-group { border-bottom-color: #0f2a39; }
.fg-h { color: var(--muted-2); }
.check-row { color: var(--muted); }
.check-row:hover { background: rgba(47, 224, 207, .045); }
.check-row.on { background: rgba(47, 224, 207, .08); color: #eaf9ff; }
.check-row .bx { background: #06131d; border-color: #1a4052; }
.check-row.on .bx { background: var(--green); border-color: var(--green); box-shadow: inset 0 0 0 2px #06131d; }
.check-row .n { color: var(--muted-2); }
.filter-tip { border-top-color: #103041; color: var(--muted-2); }
.result-tags { background: rgba(90, 169, 255, .07); border-bottom-color: #14384a; color: #9dc9ff; }
.result-tags b { color: #c7e4ff; }
.result-tags button { color: var(--green); border-bottom-color: rgba(47, 224, 207, .4); }
.search-insight { background: #081722; border-top-color: #123445; }
.search-insight .si-h { color: var(--ink-2); }
.search-insight p { color: var(--muted); }
.search-insight .si-link { color: var(--green); border-bottom-color: rgba(47, 224, 207, .4); }
.result { border-bottom-color: #0f2a39; }
.result:hover { background: rgba(47, 224, 207, .045); }
.result.active { background: rgba(47, 224, 207, .075); }
.result.active::before { background: var(--green); box-shadow: 0 0 10px rgba(47, 224, 207, .6); }
.result-no { color: var(--muted-2); }
.result-score { color: var(--green); }
.result-title { color: var(--ink-2); }
.result-snip { color: var(--muted); }
mark { background: rgba(255, 200, 87, .28); color: #fff3cf; }
.reader-panel { background: linear-gradient(180deg, rgba(10, 27, 40, .95), rgba(6, 18, 27, .95)); }
.reader-h .r-no { color: var(--muted-2); }
.reader-h h3 { font-family: var(--display); color: #eaf9ff; }
.reader-sum { color: var(--muted); }
.reader-sum b { color: var(--ink-2); }
.entity { background: rgba(8, 24, 36, .7); border-color: #1a4052; color: var(--muted); }
.entity b { color: var(--ink-2); }
.reader-side { border-left-color: #103041; }
.reader-side .rs-h { color: var(--muted-2); }
.reader-side .rs-v { color: var(--ink-2); }
.reader-side .rs-v small { color: var(--muted-2); }
.reader-excerpt { background: rgba(8, 24, 36, .55); border-left-color: rgba(47, 224, 207, .45); }
.reader-excerpt span { color: var(--muted-2); }
.reader-excerpt p { color: var(--ink-3); }
.reader-excerpt .rx { color: var(--muted-2); }
.reader-excerpt .rx b { color: var(--green); }

.queue-tabs { border-bottom-color: #103041; }
.queue-tabs button { color: var(--muted); }
.queue-tabs button.on { color: #eaf9ff; border-bottom-color: var(--green); }
.queue-tabs button .n { color: var(--green); }
.queue-tabs .perm-note { color: var(--muted-2); }
.borrow-row { border-bottom-color: #0f2a39; }
.borrow-id { color: var(--ink-2); }
.borrow-id small { color: var(--muted-2); }
.borrow-main b { color: var(--ink-2); }
.borrow-main span { color: var(--muted-2); }
.queue-tips { background: #081722; border-color: #14384a; }
.qt-h { color: var(--muted-2); }
.qt { color: var(--muted); }
.qt b { color: var(--ink-2); }
.queue-rule { background: #081722; border-top-color: #123445; color: var(--muted); }
.queue-rule b { color: var(--ink-2); }
.queue-rule button { color: var(--green); border-bottom-color: rgba(47, 224, 207, .4); }

/* ---------- appraisal ---------- */
.appr-bar {
  background: linear-gradient(90deg, rgba(11, 28, 41, .96), rgba(6, 17, 26, .96));
  border-color: #14384a;
}
.appr-stat { border-right-color: #103041; }
.appr-stat .l { color: var(--muted-2); }
.appr-stat .v { color: #eaf9ff; }
.appr-stat .v small { color: var(--muted-2); }
.appr-stat .v.red { color: var(--red); }
.appr-note { color: var(--muted); }
.appr-note b { color: var(--ink-2); }
.due-row { border-bottom-color: #0f2a39; }
.due-row:hover { background: rgba(47, 224, 207, .045); }
.due-row.active { background: rgba(47, 224, 207, .075); }
.due-row.active::before { background: var(--green); box-shadow: 0 0 10px rgba(47, 224, 207, .6); }
.due-no { color: var(--muted-2); }
.due-title { color: var(--ink-2); }
.due-ai { color: var(--muted-2); }
.due-days { color: var(--muted-2); }
.due-guide, .due-timeline, .deadline-card { background: #081722; border-color: #14384a; }
.dg-h, .dt-h, .dl-h { color: var(--muted-2); }
.dg-row { color: var(--muted); }
.dg-row b { color: var(--ink-3); }
.dg-row.on { color: #ff9aa7; }
.dg-row.on b { color: var(--red); }
.dt-row { color: var(--muted); }
.dt-row span { color: var(--muted-2); }
.dt-row b { color: var(--ink-3); }
.dt-row:last-child b { color: var(--green); }
.due-summary { background: #081722; border-top-color: #123445; }
.ds-h { color: var(--muted-2); }
.ds-h b { color: var(--ink-2); }
.ds-row { color: var(--muted); }
.ds-row b { color: var(--ink-2); }
.ds-row small { color: var(--muted-2); }
.ds-note { border-top-color: #103041; color: var(--muted-2); }
.rule-mini { background: rgba(255, 200, 87, .055); border-left-color: var(--amber); color: #bda878; }
.rule-mini b { color: #ffd166; }
.dl-row { color: var(--muted); }
.dl-row b { color: var(--ink-3); }
.dl-note { border-top-color: #103041; color: var(--muted-2); }
.dl-note b { color: var(--red); }

.appr-title h3 { font-family: var(--display); color: #eaf9ff; }
.meta-grid { background: #102b3b; border-color: #14384a; }
.meta-cell { background: #0a1d2a; }
.meta-cell .k { color: var(--muted-2); }
.meta-cell .v { color: var(--ink-2); }
.rule-quote { background: rgba(255, 200, 87, .06); border-left-color: var(--amber); color: #e8d7a8; }
.rule-quote b { color: #ffd166; }
.use-log { background: #0a1d2a; border-color: #14384a; }
.use-log .k { color: var(--muted-2); }
.use-log .v { color: var(--ink-2); }
.ai-opinion { background: rgba(90, 169, 255, .065); border-color: rgba(90, 169, 255, .3); }
.ai-opinion .ao-h { border-bottom-color: rgba(90, 169, 255, .2); color: #9dc9ff; }
.ai-opinion .ao-h .v { color: #c7e4ff; }
.ai-opinion .ao-h .rule { color: var(--muted-2); }
.ai-opinion p { color: #c6dbf0; }
.opinion-card { background: rgba(8, 24, 36, .6); border-color: #1a4052; }
.opinion-card:hover { border-color: #2e6a84; }
.opinion-card.on { background: rgba(47, 224, 207, .075); border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.opinion-card b { color: var(--ink-2); }
.opinion-card small { color: var(--muted-2); }
.opinion-card .ai-mark { color: #8bc4ff; }
.reason-box label { color: var(--muted); }
.reason-box textarea { background: #06131d; border-color: #1a4052; color: var(--ink-2); }
.reason-box textarea:focus { border-color: var(--green); box-shadow: 0 0 0 2px rgba(47, 224, 207, .08); }
.appr-actions .hint { color: var(--muted-2); }
.appr-block { border-top-color: #103041; }
.appr-block .ab-h { font-family: var(--display); color: var(--ink-2); }
.appr-block .ab-h span { color: var(--muted-2); }
.mini-table td { border-bottom-color: #103041; color: var(--muted); }
.mini-table td:first-child { color: var(--ink-3); }
.mini-table td.n { color: var(--ink-2); }
.impact-line { background: #0a1d2a; border-color: #14384a; color: var(--muted); }
.impact-line b { color: var(--red); }
.impact-line em { color: var(--muted-2); }
.impact-grid { background: #102b3b; border-color: #14384a; }
.impact-grid div { background: #0a1d2a; }
.impact-grid span { color: var(--muted-2); }
.impact-grid b { color: var(--ink-2); }

.flow-step::before { background: #123445; }
.flow-dot { background: #081722; border-color: #1a4052; color: var(--muted-2); }
.flow-step.done .flow-dot { background: var(--green); border-color: var(--green); color: #031416; box-shadow: 0 0 10px rgba(47, 224, 207, .35); }
.flow-step.curr .flow-dot { border-color: var(--red); color: var(--red); box-shadow: 0 0 0 3px rgba(255, 95, 115, .12); }
.flow-tx b { color: var(--ink-2); }
.flow-tx small { color: var(--muted-2); }
.flow-st { color: var(--muted-2); }
.flow-step.done .flow-st { color: var(--green); }
.flow-step.curr .flow-st { color: var(--red); }
.flow-role-hint { border-color: #1a4052; color: var(--muted); background: rgba(8, 22, 34, .5); }
.flow-role-hint b { color: var(--red); }
.approval-log { border-top-color: #103041; }
.approval-log .al-h { color: var(--muted-2); }
.al-row { border-bottom-color: #103041; }
.al-row .at { color: var(--muted-2); }
.al-row .ax { color: var(--muted); }
.al-row .ax b { color: var(--ink-2); }
.al-empty { color: var(--muted-2); }
.checklist { border-top-color: #103041; }
.cl-h { color: var(--muted-2); }
.cl-row { color: var(--muted-2); }
.cl-row i { border-color: #1a4052; }
.cl-row.done { color: var(--ink-3); }
.cl-row.done i { border-color: var(--green); color: var(--green); }
.execute-box { background: rgba(255, 95, 115, .06); border-color: rgba(255, 95, 115, .34); }
.execute-box .eb-h { color: #ff9aa7; }
.execute-box p { color: #d29aa2; }
.execute-box label { color: #c9959d; }
.execute-box input { accent-color: var(--red); }
.ledger-box { border-top-color: #103041; }
.ledger-h { color: var(--muted-2); }
.ledger-row { border-bottom-color: #103041; }
.ledger-row .lid { color: var(--red); }
.ledger-row .lt { color: var(--ink-3); }
.ledger-row .lt i { color: var(--muted-2); }
.ledger-row .lv { color: var(--muted); }
.ledger-meta { color: var(--muted-2); }

/* ---------- sheet / modal / toast ---------- */
.overlay { background: rgba(1, 5, 9, .72); }
.sheet {
  background: #07131d;
  border-left: 1px solid #1a4a5e;
  box-shadow: -24px 0 70px -28px rgba(0, 0, 0, .95), -1px 0 0 rgba(47, 224, 207, .18);
}
.sheet-h { background: #0a1a26; border-bottom-color: #14384a; }
.sheet-h h3 { font-family: var(--display); color: #eaf9ff; }
.sheet-h p { color: var(--muted); }
.sheet-close { background: rgba(8, 22, 34, .6); border-color: #1a4052; color: var(--muted); }
.sheet-close:hover { border-color: var(--red); color: var(--red); }
.sheet-b { background: #07131d; }
.sheet-f { background: #081722; border-top-color: #14384a; }
.ev-block h4 { font-family: var(--display); color: var(--ink-2); }
.ev-block p { color: var(--muted); }
.ev-rule { background: rgba(255, 200, 87, .06); border-left-color: var(--amber); color: #cdb982; }
.ev-rule b { color: #ffd166; }
.ev-table th { background: #0a1d2a; border-bottom-color: #14384a; color: var(--muted-2); }
.ev-table td { border-bottom-color: #103041; color: var(--ink-3); }
.ev-formula { background: #040f17; color: #a9f5ed; border: 1px solid #123445; }
.ev-kv { background: #102b3b; border-color: #14384a; }
.ev-kv div { background: #0a1d2a; }
.ev-kv .k { color: var(--muted-2); }
.ev-kv .v { color: var(--ink-2); }
.log-row { border-bottom-color: #103041; }
.log-t { color: var(--muted-2); }
.log-t b { color: var(--ink-2); }
.log-main b { color: var(--ink-2); }
.log-main span { color: var(--muted); }
.log-main .lr { color: var(--green); opacity: .7; }
.modal { background: rgba(1, 5, 9, .78); }
.modal-card { background: #07131d; border-color: #1a4a5e; box-shadow: 0 30px 80px -24px rgba(0, 0, 0, .95), 0 0 0 1px rgba(47, 224, 207, .1); }
.modal-h { background: #0a1a26; border-bottom-color: #14384a; }
.modal-h h3 { font-family: var(--display); color: #eaf9ff; }
.modal-h p { color: var(--muted); }
.modal-f { background: #081722; border-top-color: #14384a; }
.form-row label { color: var(--muted); }
.form-row input, .form-row select, .form-row textarea { background: #06131d; border-color: #1a4052; color: var(--ink-2); }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: var(--green); box-shadow: 0 0 0 2px rgba(47, 224, 207, .08); }
.form-note { border-color: #1a4052; color: var(--muted); background: rgba(8, 22, 34, .5); }
.form-note b { color: var(--red); }
.radio-row button { border-color: #1a4052; color: var(--muted); background: transparent; }
.radio-row button.on { border-color: var(--green); background: rgba(47, 224, 207, .08); color: #eaf9ff; box-shadow: inset 0 0 0 1px var(--green); }
.toast { background: #06141e; color: #dff8ff; border-left-color: var(--green); box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .9), 0 0 24px rgba(47, 224, 207, .12); }
.toast i { background: var(--green); box-shadow: 0 0 8px var(--green); }
.toast.err { border-left-color: var(--red); }
.toast.err i { background: var(--red); }
.toast.ok { border-left-color: var(--green); }
.toast.ok i { background: var(--green); }

/* ---------- responsive ---------- */
@media (max-width: 1420px) {
  .mast-sys { display: none; }
  .ov-h1 { font-size: 22px; }
}
@media (max-width: 1260px) {
  .brand-name { font-size: 22px; }
  .doc-stage::before { display: none; }
}
