/* ============================================================
   津渡 · 港口生产智能调度平台
   设计语言：浅色航海图 / 调度台 · 海图青 + 墨蓝 + 信号橙
   离线运行，无外部字体与 CDN
   ============================================================ */

:root {
  --paper: #edf2ef;
  --paper-2: #e4ece8;
  --paper-3: #f6f8f3;
  --card: #fbfcf8;
  --card-2: #f5f8f3;
  --ink: #0f2d3a;
  --ink-2: #33525e;
  --muted: #72888e;
  --muted-2: #8fa1a4;
  --line: #c7d7d3;
  --line-2: #dde8e3;
  --line-dark: #9fb7b4;
  --sea: #0e6270;
  --sea-2: #2a8591;
  --sea-3: #d7e8e6;
  --signal: #cf5a37;
  --signal-2: #a94627;
  --amber: #b57c1d;
  --green: #2c7a60;
  --red: #b64032;
  --navy: #0c2a38;
  --ore: #1b6b78;
  --coal: #5c6570;
  --grain: #a9761c;
  --other: #6d7f86;
  --sans: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", sans-serif;
  --mono: "Cascadia Mono", "Consolas", "Courier New", monospace;
  --display: "Bahnschrift SemiCondensed", "Bahnschrift", "Microsoft YaHei", sans-serif;
  --shadow: 0 8px 22px rgba(15, 45, 58, .07);
  --shadow-lg: 0 20px 60px rgba(9, 35, 45, .22);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(ellipse at 8% -10%, rgba(255, 255, 255, .86), transparent 42%),
    radial-gradient(ellipse at 96% 0%, rgba(214, 232, 228, .5), transparent 38%),
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(15, 45, 58, .033) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(15, 45, 58, .033) 39px 40px),
    var(--paper);
  font-size: 13px;
  line-height: 1.5;
  overflow: hidden;
}

button, input, select, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--sea); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { display: block; }
.ic { width: 16px; height: 16px; flex: 0 0 auto; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--ink); color: #fff; padding: 8px 14px; font-size: 12px;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

/* ---------- App shell ---------- */
.app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  min-width: 1180px;
}

/* ---------- Masthead ---------- */
.masthead {
  flex: 0 0 76px;
  height: 76px;
  display: grid;
  grid-template-columns: minmax(430px, 1.15fr) minmax(360px, .9fr) minmax(480px, 1fr);
  align-items: center;
  gap: 20px;
  padding: 0 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .7), rgba(250, 252, 246, .92)),
    var(--card);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 20;
}
.masthead::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -4px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(15, 45, 58, .22), transparent);
}
.mh-brand { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-seal {
  width: 46px; height: 46px; flex: 0 0 46px;
  display: grid; place-items: center;
  color: #f5f1e3;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .15), transparent 55%),
    var(--navy);
  border: 1px solid var(--navy);
  box-shadow: inset 0 0 0 4px rgba(245, 241, 227, .12);
  font-family: "Songti SC", "SimSun", Georgia, serif;
  font-size: 27px;
  font-weight: 700;
  line-height: 1;
}
.brand-copy { min-width: 0; }
.brand-line { display: flex; align-items: baseline; gap: 9px; }
.brand-line strong {
  font-size: 25px; line-height: 1.05; letter-spacing: .12em; font-weight: 700;
  color: var(--ink);
}
.brand-line span {
  font-family: var(--display); font-size: 11px; letter-spacing: .32em; color: var(--sea);
}
.brand-sub {
  margin-top: 3px; font-size: 11px; letter-spacing: .13em; color: var(--ink-2);
}
.org-line {
  margin-left: 14px; padding-left: 14px; border-left: 1px solid var(--line);
  display: flex; align-items: center; gap: 7px; font-size: 10.5px; color: var(--muted);
  white-space: nowrap;
}
.org-line b { color: var(--ink-2); font-size: 11.5px; letter-spacing: .03em; }
.org-line i { font-style: normal; color: var(--line-dark); }
.mh-center { min-width: 0; text-align: center; }
.port-id {
  font-size: 14px; font-weight: 600; letter-spacing: .05em; color: var(--ink);
  display: flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
}
.port-dot {
  width: 6px; height: 6px; background: var(--signal); border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(207, 90, 55, .13);
}
.shift-line {
  margin-top: 5px; display: flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 10px; color: var(--muted); letter-spacing: .06em; white-space: nowrap;
}
.shift-line i { font-style: normal; color: var(--line-dark); }
.live {
  color: var(--green); display: inline-flex; align-items: center; gap: 5px; font-weight: 600;
}
.live::before {
  content: ""; width: 5px; height: 5px; background: var(--green); border-radius: 50%;
  animation: pulse 2.4s infinite;
}
.mh-right { display: flex; align-items: center; justify-content: flex-end; gap: 18px; min-width: 0; }
.env-line {
  display: flex; flex-direction: column; gap: 1px;
  font-size: 9px; color: var(--muted); text-align: right; white-space: nowrap;
  letter-spacing: .04em;
}
.clock-box { text-align: right; padding-left: 16px; border-left: 1px solid var(--line); }
.clock-box b {
  display: block; font-family: var(--display); font-size: 25px; line-height: 1;
  letter-spacing: .05em; color: var(--ink); font-variant-numeric: tabular-nums;
}
.clock-box span { font-size: 8.5px; color: var(--muted); letter-spacing: .1em; display: block; margin-top: 3px; }
.role-picker { display: flex; flex-direction: column; gap: 3px; min-width: 158px; }
.role-picker > span {
  font-family: var(--mono); font-size: 8px; letter-spacing: .16em; color: var(--muted);
}
.role-picker select {
  height: 30px; border: 1px solid var(--line-dark); background: var(--card); color: var(--ink);
  font-size: 11.5px; font-weight: 600; padding: 0 26px 0 9px; border-radius: 1px;
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 13px) 13px, calc(100% - 8px) 13px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* ---------- KPI strip ---------- */
.kpi-strip {
  flex: 0 0 80px;
  height: 80px;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(42, 133, 145, .22), transparent 35%),
    linear-gradient(90deg, #0b2835, #0e3140 55%, #0b2835);
  color: #f2f0e5;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 3px solid var(--signal);
  position: relative;
  z-index: 10;
}
.kpi-cell {
  padding: 11px 17px 9px;
  border-right: 1px solid rgba(242, 240, 229, .11);
  min-width: 0;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative;
}
.kpi-cell:last-child { border-right: 0; }
.kpi-label {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  font-size: 9px; letter-spacing: .13em; color: rgba(242, 240, 229, .62);
  text-transform: uppercase; white-space: nowrap;
}
.kpi-label em { font-style: normal; font-family: var(--mono); font-size: 8px; color: rgba(242, 240, 229, .35); }
.kpi-value-row { display: flex; align-items: baseline; gap: 5px; margin-top: 1px; }
.kpi-value {
  font-family: var(--display); font-size: 26px; font-weight: 600; line-height: 1;
  letter-spacing: .015em; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.kpi-value small { font-family: var(--sans); font-size: 10px; font-weight: 400; letter-spacing: .04em; margin-left: 2px; color: rgba(242, 240, 229, .62); }
.kpi-foot { display: flex; align-items: center; gap: 6px; font-size: 8.5px; color: rgba(242, 240, 229, .45); white-space: nowrap; }
.kpi-delta {
  font-family: var(--mono); font-size: 8.5px; padding: 1px 4px; border: 1px solid rgba(242, 240, 229, .18);
  color: rgba(242, 240, 229, .8);
}
.kpi-delta.up { color: #8fd3bd; border-color: rgba(143, 211, 189, .35); }
.kpi-delta.down { color: #f0a58e; border-color: rgba(240, 165, 142, .35); }
.kpi-delta.flat { color: rgba(242, 240, 229, .5); }
.kpi-bar {
  height: 2px; background: rgba(242, 240, 229, .12); margin-top: 5px; position: relative; overflow: hidden;
}
.kpi-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--sea-2); }
.kpi-cell.hot .kpi-bar i { background: var(--signal); }
.kpi-cell.hot .kpi-value { color: #f0a58e; }

/* ---------- Workbench / rail ---------- */
.workbench {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
}
.rail {
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .5), rgba(237, 242, 239, .3)),
    rgba(246, 249, 244, .6);
  display: flex; flex-direction: column;
  padding: 16px 12px 12px;
  overflow-y: auto;
}
.rail-head {
  padding: 0 9px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line-2);
  display: flex; flex-direction: column; gap: 2px;
}
.rail-head span { font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.rail-head b { font-family: var(--mono); font-size: 7.5px; letter-spacing: .24em; color: var(--muted); font-weight: 400; }
.rail-item {
  position: relative;
  display: flex; align-items: center; gap: 9px;
  width: 100%; min-height: 52px; padding: 8px 9px;
  border: 0; border-bottom: 1px solid rgba(199, 215, 211, .55);
  background: transparent; text-align: left; color: var(--ink-2);
  transition: background .16s, color .16s;
}
.rail-item::before {
  content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 2px;
  background: transparent;
}
.rail-item:hover { background: rgba(255, 255, 255, .65); }
.rail-item.active { background: var(--ink); color: #f4f1e6; }
.rail-item.active::before { background: var(--signal); }
.ri-no {
  font-family: var(--display); font-size: 17px; font-weight: 600; color: var(--muted-2);
  width: 22px; flex: 0 0 22px; line-height: 1;
}
.rail-item.active .ri-no { color: var(--signal); }
.ri-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.ri-copy b { font-size: 12.5px; font-weight: 600; letter-spacing: .04em; white-space: nowrap; }
.ri-copy i { font-family: var(--mono); font-style: normal; font-size: 7.5px; letter-spacing: .16em; color: var(--muted); }
.rail-item.active .ri-copy i { color: rgba(244, 241, 230, .55); }
.ri-badge {
  min-width: 18px; height: 18px; padding: 0 4px; display: grid; place-items: center;
  background: var(--signal); color: #fff; font-family: var(--mono); font-size: 9px;
}
.rail-item.active .ri-badge { background: var(--signal); }
.ri-mark { width: 5px; height: 5px; border: 1px solid var(--line-dark); border-radius: 50%; }
.rail-item.active .ri-mark { background: var(--signal); border-color: var(--signal); }
.rail-tide {
  margin-top: auto; padding: 12px 9px 10px; border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .35);
}
.rt-head {
  display: flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 700;
  letter-spacing: .08em; margin-bottom: 8px; color: var(--ink-2);
}
.rt-head .ic { width: 14px; height: 14px; color: var(--sea); }
.rt-row { display: flex; justify-content: space-between; gap: 6px; font-size: 9.5px; color: var(--muted); padding: 2px 0; }
.rt-row b { font-family: var(--mono); font-weight: 500; color: var(--ink-2); font-size: 9px; }
.rt-note { margin-top: 7px; padding-top: 6px; border-top: 1px dotted var(--line); font-size: 8.5px; color: var(--muted); line-height: 1.5; }
.rail-foot {
  display: flex; align-items: center; gap: 8px; padding: 10px 9px 0; margin-top: 10px;
  border-top: 1px solid var(--line-2); color: var(--muted); font-size: 8.5px; line-height: 1.4;
}
.rail-foot .ic { width: 15px; height: 15px; color: var(--sea); }
.rail-foot b { font-family: var(--mono); color: var(--ink-2); font-weight: 500; font-size: 8.5px; }

/* ---------- Content baseline ---------- */
.content {
  min-width: 0;
  overflow-y: auto;
  padding: 16px 20px 20px;
  scroll-behavior: smooth;
}
.content::-webkit-scrollbar, .rail::-webkit-scrollbar, .order-list::-webkit-scrollbar,
.order-detail::-webkit-scrollbar, .queue-list::-webkit-scrollbar, .drawer::-webkit-scrollbar {
  width: 6px; height: 6px;
}
.content::-webkit-scrollbar-thumb, .rail::-webkit-scrollbar-thumb, .order-list::-webkit-scrollbar-thumb,
.order-detail::-webkit-scrollbar-thumb, .queue-list::-webkit-scrollbar-thumb, .drawer::-webkit-scrollbar-thumb {
  background: var(--line-dark); border-radius: 0;
}
.site-foot {
  flex: 0 0 36px; height: 36px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 0 24px; border-top: 1px solid var(--line);
  background: rgba(251, 252, 248, .9);
  font-size: 8.5px; color: var(--muted); letter-spacing: .05em;
}
.site-foot .foot-mid { color: var(--ink-2); letter-spacing: .1em; }
.site-foot a { color: var(--sea); }

.no-script { position: fixed; inset: 0; display: grid; place-items: center; background: var(--paper); z-index: 999; font-size: 15px; }

/* ---------- Common view / panel / buttons ---------- */
.view-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  min-height: 50px; margin-bottom: 12px;
}
.view-eyebrow {
  font-family: var(--mono); font-size: 8.5px; letter-spacing: .24em; color: var(--sea);
  text-transform: uppercase; display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
}
.view-eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--signal); }
.view-title {
  margin: 0; font-size: 23px; line-height: 1.1; letter-spacing: .04em; font-weight: 700;
  display: flex; align-items: baseline; gap: 10px;
}
.view-title em {
  font-style: normal; font-family: var(--display); font-size: 11px; letter-spacing: .18em;
  color: var(--muted); font-weight: 400;
}
.view-sub { margin: 5px 0 0; font-size: 10.5px; color: var(--muted); letter-spacing: .03em; }
.view-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; padding-bottom: 2px; }
.vessel-tabs { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; max-width: 820px; }
.vbtn {
  height: 27px; padding: 0 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, .55);
  font-family: var(--mono); font-size: 8px; color: var(--ink-2); white-space: nowrap;
}
.vbtn:hover { border-color: var(--ink); background: var(--card); }
.vbtn.active { background: var(--ink); border-color: var(--ink); color: #f4f1e6; }

.btn {
  height: 31px; padding: 0 12px; border: 1px solid var(--ink); background: var(--ink);
  color: #f6f2e5; font-size: 11.5px; font-weight: 600; letter-spacing: .03em;
  border-radius: 1px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .15s, color .15s, border-color .15s; white-space: nowrap;
}
.btn:hover { background: #173f50; border-color: #173f50; }
.btn:active { transform: translateY(1px); }
.btn .ic { width: 13px; height: 13px; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-dark); }
.btn.ghost:hover { background: rgba(255, 255, 255, .7); border-color: var(--ink); }
.btn.ai { background: var(--signal); border-color: var(--signal); color: #fff; }
.btn.ai:hover { background: var(--signal-2); border-color: var(--signal-2); }
.btn.small { height: 25px; padding: 0 8px; font-size: 10px; gap: 4px; }
.btn.small .ic { width: 11px; height: 11px; }
.btn.locked, .btn:disabled {
  background: var(--card-2); color: var(--muted-2); border-color: var(--line); cursor: not-allowed;
  transform: none;
}
.btn.locked:hover { background: var(--card-2); border-color: var(--line); }
.btn.block { width: 100%; }
.btn.ghost-light { border-color: rgba(246, 242, 229, .35); color: #f6f2e5; background: transparent; }
.btn.ghost-light:hover { background: rgba(246, 242, 229, .1); }

.panel {
  background: linear-gradient(180deg, #fdfefb, #f8faf5);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 2px;
  min-width: 0;
  position: relative;
}
.panel::before, .panel::after {
  content: ""; position: absolute; width: 7px; height: 7px; pointer-events: none; z-index: 2;
}
.panel::before { top: -1px; left: -1px; border-top: 1px solid var(--ink); border-left: 1px solid var(--ink); }
.panel::after { bottom: -1px; right: -1px; border-bottom: 1px solid var(--ink); border-right: 1px solid var(--ink); }
.p-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border-bottom: 1px solid var(--line-2); min-height: 41px;
}
.p-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.p-title b { font-size: 12.5px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
.p-title .en { font-family: var(--mono); font-size: 7.5px; letter-spacing: .16em; color: var(--muted); white-space: nowrap; }
.p-tools { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; }
.p-body { padding: 13px 14px; }
.p-sub { font-size: 9.5px; color: var(--muted); letter-spacing: .04em; }
.p-count {
  font-family: var(--mono); font-size: 9px; color: var(--muted);
  border: 1px solid var(--line); padding: 1px 5px; background: var(--card-2);
}

.chip {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 6px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .55);
  font-family: var(--mono); font-size: 8.5px; color: var(--ink-2); white-space: nowrap;
}
.chip.hot { color: var(--signal); border-color: rgba(207, 90, 55, .4); background: rgba(207, 90, 55, .06); }
.chip.ok { color: var(--green); border-color: rgba(44, 122, 96, .35); background: rgba(44, 122, 96, .05); }
.chip.dark { background: var(--ink); color: #f4f1e6; border-color: var(--ink); }
.chip.amber { color: var(--amber); border-color: rgba(181, 124, 29, .4); background: rgba(181, 124, 29, .07); }
.dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: 0 0 5px; }

.section-label {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 8px; letter-spacing: .17em; color: var(--muted);
  text-transform: uppercase; margin-bottom: 8px;
}
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }

.kv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.kv {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  padding: 4px 0; border-bottom: 1px dotted var(--line-2); font-size: 10px;
}
.kv span { color: var(--muted); white-space: nowrap; }
.kv b { font-family: var(--mono); font-size: 10px; font-weight: 500; color: var(--ink); text-align: right; }
.kv b em { font-style: normal; color: var(--muted); font-weight: 400; }

.empty { padding: 26px 12px; text-align: center; color: var(--muted); font-size: 11px; }

/* ---------- Overview ---------- */
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 398px;
  gap: 13px;
  margin-bottom: 13px;
}
.chart-panel { display: flex; flex-direction: column; min-height: 520px; overflow: hidden; }
.chart-head { flex: 0 0 42px; }
.chart-wrap {
  position: relative; flex: 1 1 auto; min-height: 0;
  background:
    radial-gradient(ellipse at 70% 20%, rgba(255, 255, 255, .45), transparent 50%),
    #dfeceb;
  overflow: hidden;
}
.chart-svg { width: 100%; height: 100%; }
.chart-legend {
  position: absolute; left: 13px; top: 11px; z-index: 3;
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  background: rgba(251, 252, 248, .86); border: 1px solid var(--line);
  padding: 5px 8px; font-size: 8.5px; color: var(--ink-2);
}
.legend-item { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; }
.legend-line { width: 12px; height: 0; border-top: 1px dashed var(--sea); }
.chart-note {
  position: absolute; right: 12px; bottom: 10px; z-index: 3;
  font-family: var(--mono); font-size: 7.5px; letter-spacing: .08em; color: rgba(15, 45, 58, .55);
  text-align: right; line-height: 1.6;
}
.map-callout {
  position: absolute; z-index: 4; background: rgba(251, 252, 248, .95);
  border: 1px solid var(--line-dark); box-shadow: 0 5px 16px rgba(15, 45, 58, .12);
  padding: 7px 9px; min-width: 112px; pointer-events: none;
}
.map-callout::before {
  content: ""; position: absolute; left: -1px; top: -1px; width: 3px; height: 14px; background: var(--signal);
}
.mc-title { font-size: 8.5px; color: var(--muted); letter-spacing: .08em; }
.mc-value { font-family: var(--display); font-size: 17px; line-height: 1.1; color: var(--ink); }
.mc-sub { font-size: 8px; color: var(--muted); margin-top: 1px; }
.map-callout.anchorage { right: 14%; top: 56%; }
.map-callout.berth { left: 34%; top: 45%; }

.map-ship { cursor: pointer; }
.map-ship .ship-hull {
  fill: var(--navy); stroke: #f6f2e5; stroke-width: 1;
  transition: fill .15s;
}
.map-ship:hover .ship-hull { fill: var(--sea); }
.map-ship.waiting .ship-hull { fill: #7e8f8e; }
.map-ship .ship-cargo { fill: var(--signal); }
.map-ship .ship-label {
  font-family: var(--mono); font-size: 10.2px; fill: var(--ink); letter-spacing: .02em;
  paint-order: stroke; stroke: #dfeceb; stroke-width: 2.6px; stroke-linejoin: round;
}
.map-ship .ship-meta {
  font-family: var(--mono); font-size: 7.6px; fill: var(--muted);
  paint-order: stroke; stroke: #dfeceb; stroke-width: 2px; stroke-linejoin: round;
}
.map-ship .ship-ring {
  fill: none; stroke: var(--signal); stroke-width: .8; opacity: .5;
  animation: ring 3s infinite; transform-origin: center;
}
.map-ship.waiting .ship-ring { stroke: var(--amber); }
.map-berth { cursor: pointer; }
.map-berth .berth-deck { fill: #f2efe2; stroke: var(--ink); stroke-width: .8; }
.map-berth .berth-stripe { fill: var(--signal); opacity: .8; }
.map-berth .berth-label { font-family: var(--mono); font-size: 9.6px; fill: var(--ink); font-weight: 700; }
.map-berth.busy .berth-deck { fill: #e7e2d0; }
.map-berth:hover .berth-deck { fill: #fffdf3; }
.map-grid-line { stroke: rgba(15, 45, 58, .075); stroke-width: .5; }
.map-depth-line { fill: none; stroke: #b7cfcd; stroke-width: .7; stroke-dasharray: 2 4; }
.map-sounding { font-family: var(--mono); font-size: 6px; fill: #7c9c9b; letter-spacing: .06em; }
.map-land { fill: #f0eee1; stroke: #c5cdc2; stroke-width: .8; }
.map-land-hatch { fill: url(#hatch); }
.map-quay { stroke: var(--navy); stroke-width: 2.2; }
.map-breakwater { fill: none; stroke: #7f9998; stroke-width: 4; stroke-linecap: round; }
.map-breakwater-inner { fill: none; stroke: #f0eee1; stroke-width: 1; stroke-dasharray: 3 5; }
.map-channel { fill: none; stroke: rgba(15, 45, 58, .3); stroke-width: 1; stroke-dasharray: 7 5; }
.map-buoy { fill: var(--signal); }
.map-compass text { font-family: var(--mono); font-size: 6px; fill: var(--ink-2); }
.map-scale text { font-family: var(--mono); font-size: 5.5px; fill: var(--ink-2); }
.map-title-block { background: rgba(251, 252, 248, .8); border: 1px solid var(--line); }
.map-title-block text { font-family: var(--mono); fill: var(--ink); }
.map-title-block .mtb-en { fill: var(--muted); letter-spacing: .1em; }

/* Brief / tide / alerts */
.side-stack { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.brief-card { overflow: hidden; }
.brief-card .p-body { padding: 12px 14px 13px; }
.brief-eyebrow {
  display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 8px;
  letter-spacing: .15em; color: var(--signal); margin-bottom: 5px;
}
.brief-eyebrow .ic { width: 12px; height: 12px; }
.brief-title {
  margin: 0 0 5px; font-size: 15.5px; line-height: 1.45; letter-spacing: .02em; font-weight: 700;
}
.brief-title b { color: var(--signal); font-weight: 700; }
.brief-body { margin: 0; font-size: 10.5px; line-height: 1.65; color: var(--ink-2); }
.brief-metrics {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 10px 0 11px;
  border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2);
}
.brief-metric { padding: 7px 7px 7px 0; border-right: 1px solid var(--line-2); }
.brief-metric:last-child { border-right: 0; padding-right: 0; }
.brief-metric span { display: block; font-size: 8px; color: var(--muted); letter-spacing: .05em; white-space: nowrap; }
.brief-metric b {
  display: block; margin-top: 2px; font-family: var(--display); font-size: 17px; line-height: 1.1;
  font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums;
}
.brief-metric b.good { color: var(--green); }
.brief-metric b.warn { color: var(--signal); }
.brief-actions { display: flex; gap: 7px; align-items: center; }
.brief-rule {
  margin-top: 9px; padding-top: 8px; border-top: 1px dotted var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-family: var(--mono); font-size: 8px; color: var(--muted);
}
.brief-rule a { color: var(--sea); }

.tide-card { overflow: hidden; }
.tide-scroll { padding: 9px 12px 8px; }
.tide-svg { width: 100%; height: 92px; }
.tide-axis-label { font-family: var(--mono); font-size: 6.5px; fill: var(--muted); }
.tide-now-line { stroke: var(--signal); stroke-width: 1; stroke-dasharray: 3 2; }
.tide-now-dot { fill: var(--signal); }
.tide-window { fill: rgba(207, 90, 55, .1); }
.tide-meta { display: flex; justify-content: space-between; gap: 10px; padding: 6px 12px 9px; border-top: 1px solid var(--line-2); font-size: 8.5px; color: var(--muted); }
.tide-meta b { color: var(--ink-2); font-family: var(--mono); font-size: 8.5px; font-weight: 500; }

.alert-list { padding: 4px 0; }
.alert-item {
  display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 8px; align-items: start;
  padding: 7px 13px; border-bottom: 1px solid var(--line-2); cursor: pointer;
  transition: background .15s;
}
.alert-item:last-child { border-bottom: 0; }
.alert-item:hover { background: rgba(255, 255, 255, .6); }
.alert-dot { width: 6px; height: 6px; border-radius: 50%; margin-top: 5px; background: var(--amber); }
.alert-dot.high { background: var(--signal); box-shadow: 0 0 0 3px rgba(207, 90, 55, .1); }
.alert-dot.low { background: var(--sea-2); }
.alert-copy b { display: block; font-size: 10px; font-weight: 600; line-height: 1.4; color: var(--ink); }
.alert-copy span { display: block; font-size: 8.5px; color: var(--muted); margin-top: 1px; }
.alert-go { font-family: var(--mono); font-size: 8px; color: var(--muted); padding-top: 2px; }

.overview-bottom {
  display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 13px;
}
.berth-mini-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.berth-mini {
  padding: 9px 11px 10px; border-right: 1px solid var(--line-2); min-width: 0; cursor: pointer;
  transition: background .15s;
}
.berth-mini:last-child { border-right: 0; }
.berth-mini:hover { background: rgba(255, 255, 255, .6); }
.bm-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.bm-code { font-family: var(--display); font-size: 14px; font-weight: 700; color: var(--ink); }
.bm-state { font-family: var(--mono); font-size: 7.5px; letter-spacing: .08em; color: var(--green); }
.bm-state.idle { color: var(--amber); }
.bm-name { font-size: 9px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-util-row { display: flex; align-items: baseline; gap: 4px; margin-top: 8px; }
.bm-util { font-family: var(--display); font-size: 20px; line-height: 1; color: var(--ink); }
.bm-util small { font-size: 8px; color: var(--muted); }
.bm-bar { height: 3px; background: var(--line-2); margin: 5px 0 6px; position: relative; overflow: hidden; }
.bm-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--sea); }
.bm-bar i.hot { background: var(--signal); }
.bm-detail { font-size: 8px; color: var(--muted); line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-detail b { font-family: var(--mono); color: var(--ink-2); font-weight: 500; }

.queue-mini { padding: 0; }
.qm-row {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 7px; align-items: center;
  padding: 7px 12px; border-bottom: 1px solid var(--line-2); font-size: 9.5px; cursor: pointer;
}
.qm-row:last-child { border-bottom: 0; }
.qm-row:hover { background: rgba(255, 255, 255, .6); }
.qm-rank { font-family: var(--display); color: var(--muted-2); font-size: 12px; }
.qm-name b { font-weight: 600; color: var(--ink); }
.qm-name span { color: var(--muted); font-size: 8px; margin-left: 4px; }
.qm-meta { text-align: right; color: var(--muted); font-family: var(--mono); font-size: 8px; }
.qm-meta b { color: var(--signal); }
.qm-empty { padding: 18px 12px; text-align: center; font-size: 9.5px; color: var(--muted); }

.order-mini { padding: 0; }
.om-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center;
  padding: 7px 12px; border-bottom: 1px solid var(--line-2); cursor: pointer;
}
.om-row:last-child { border-bottom: 0; }
.om-row:hover { background: rgba(255, 255, 255, .6); }
.om-title { font-size: 9.5px; color: var(--ink); line-height: 1.35; }
.om-title span { display: block; font-family: var(--mono); font-size: 7.5px; color: var(--muted); }
.om-stage { font-family: var(--mono); font-size: 7.5px; padding: 2px 4px; border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.om-stage.s1 { color: var(--amber); border-color: rgba(181, 124, 29, .4); }
.om-stage.s2 { color: var(--signal); border-color: rgba(207, 90, 55, .4); }
.om-stage.ok { color: var(--green); border-color: rgba(44, 122, 96, .4); }

/* ---------- Planning ---------- */
.plan-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 10px 14px; border: 1px solid var(--line); background: rgba(251, 252, 248, .86);
  margin-bottom: 12px; box-shadow: var(--shadow); flex-wrap: wrap;
}
.plan-status { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.plan-status .ps-label { font-family: var(--mono); font-size: 8px; letter-spacing: .16em; color: var(--muted); }
.plan-status .ps-value { font-size: 12px; font-weight: 700; letter-spacing: .03em; }
.plan-status .ps-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }
.plan-status .ps-dot.published { background: var(--green); }
.plan-status .ps-sep { width: 1px; height: 18px; background: var(--line); }
.plan-tools { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.plan-kpis { display: flex; gap: 0; border: 1px solid var(--line); background: var(--card); margin-bottom: 12px; box-shadow: var(--shadow); }
.plan-kpi { flex: 1; padding: 8px 13px; border-right: 1px solid var(--line-2); }
.plan-kpi:last-child { border-right: 0; }
.plan-kpi span { display: block; font-size: 8px; color: var(--muted); letter-spacing: .06em; }
.plan-kpi b { display: block; font-family: var(--display); font-size: 18px; line-height: 1.15; font-weight: 600; margin-top: 1px; }
.plan-kpi b small { font-size: 8px; color: var(--muted); font-family: var(--sans); font-weight: 400; }
.plan-kpi b.good { color: var(--green); }
.plan-kpi b.warn { color: var(--signal); }

.plan-stage { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 13px; align-items: start; }
.plan-left { display: flex; flex-direction: column; gap: 13px; min-width: 0; }
.plan-summary .p-body { padding: 11px 14px 12px; }
.mix-bar { display: flex; height: 9px; background: var(--line-2); overflow: hidden; }
.mix-seg { height: 100%; min-width: 2px; border-right: 1px solid rgba(251, 252, 248, .7); }
.mix-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 8px; color: var(--muted); }
.mix-legend span { display: inline-flex; align-items: center; gap: 4px; }
.mix-legend i { width: 6px; height: 6px; display: inline-block; }
.mix-legend b { font-family: var(--mono); font-weight: 500; color: var(--ink-2); }
.plan-facts { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 9px; border-top: 1px solid var(--line-2); }
.plan-fact { padding: 7px 10px 0 0; border-right: 1px solid var(--line-2); min-width: 0; }
.plan-fact:last-child { border-right: 0; }
.plan-fact span { display: block; font-size: 7.5px; color: var(--muted); }
.plan-fact b { display: block; font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--ink); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-fact b.hot { color: var(--signal); }
.plan-fact b.ok { color: var(--green); }
.plan-fact em { display: block; font-style: normal; font-size: 7px; color: var(--muted-2); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt-panel { overflow: hidden; }
.gantt-panel .p-head { flex-wrap: wrap; }
.gantt-scroll { overflow-x: auto; }
.gantt {
  min-width: 900px;
  display: grid;
  grid-template-columns: 178px minmax(0, 1fr);
  position: relative;
}
.gantt-axis-row { grid-column: 1 / -1; display: grid; grid-template-columns: 178px minmax(0, 1fr); border-bottom: 1px solid var(--line); }
.gantt-corner {
  padding: 8px 12px; font-family: var(--mono); font-size: 7.5px; letter-spacing: .1em;
  color: var(--muted); border-right: 1px solid var(--line); background: var(--card-2);
}
.axis-hours { position: relative; height: 30px; background: var(--card-2); }
.axis-hour {
  position: absolute; top: 0; bottom: 0; border-left: 1px solid rgba(15, 45, 58, .08);
  font-family: var(--mono); font-size: 7px; color: var(--muted); padding: 8px 0 0 4px;
  white-space: nowrap;
}
.axis-hour.major { border-left-color: rgba(15, 45, 58, .2); color: var(--ink-2); }
.axis-hour.night { background: rgba(15, 45, 58, .035); }
.gantt-row { display: contents; }
.gantt-info {
  padding: 9px 11px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line-2);
  background: rgba(251, 252, 248, .9); min-width: 0;
}
.gantt-info-top { display: flex; align-items: baseline; gap: 5px; }
.gantt-info-top b { font-family: var(--display); font-size: 15px; font-weight: 700; }
.gantt-info-top span { font-family: var(--mono); font-size: 7px; color: var(--muted); letter-spacing: .06em; }
.gantt-info-name { font-size: 9.5px; color: var(--ink-2); margin-top: 1px; }
.gantt-info-meta { font-size: 7.5px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.gantt-info-meta b { font-family: var(--mono); color: var(--sea); font-weight: 500; }
.lane {
  position: relative; height: 82px; border-bottom: 1px solid var(--line-2);
  background-color: rgba(238, 244, 240, .55);
  background-image:
    linear-gradient(90deg, rgba(15, 45, 58, .1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 45, 58, .045) 1px, transparent 1px);
  background-size: calc(100% / 12) 100%, calc(100% / 24) 100%;
  cursor: crosshair;
  overflow: hidden;
}
.lane.night {
  background-color: rgba(221, 232, 228, .6);
  background-image:
    linear-gradient(90deg, rgba(15, 45, 58, .12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 45, 58, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 45, 58, .05), rgba(15, 45, 58, .05));
  background-size: calc(100% / 12) 100%, calc(100% / 24) 100%, 25% 100%;
  background-position: 0 0, 0 0, 75% 0;
  background-repeat: no-repeat;
}
.lane:hover { background-color: rgba(231, 240, 236, .9); }
.lane.locked { cursor: not-allowed; }
.gantt-bar {
  position: absolute; top: 20px; height: 43px;
  border: 1px solid rgba(15, 45, 58, .55); border-left: 3px solid var(--cargo-color, var(--sea));
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(240, 246, 242, .92)),
    linear-gradient(180deg, var(--cargo-color, var(--sea)), rgba(255, 255, 255, 0));
  background-blend-mode: normal;
  box-shadow: 0 2px 5px rgba(15, 45, 58, .1);
  padding: 4px 7px; overflow: hidden; cursor: pointer; z-index: 3;
  min-width: 34px;
}
.gantt-bar::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: var(--cargo-color, var(--sea)); opacity: .75;
}
.gantt-bar:hover { background: #fffef8; border-color: var(--ink); z-index: 5; }
.gantt-bar.pending { border-style: dashed; }
.gantt-bar.selected { outline: 2px solid var(--signal); outline-offset: 1px; }
.gantt-bar .gb-name {
  font-size: 10px; font-weight: 700; color: var(--ink); line-height: 1.15;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gantt-bar .gb-meta {
  font-family: var(--mono); font-size: 7.2px; color: var(--muted); line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px;
}
.gantt-bar .gb-time { font-family: var(--mono); font-size: 6.8px; color: var(--sea); position: absolute; left: 7px; bottom: 3px; }
.gantt-bar.clip-right::after {
  content: "›"; position: absolute; right: 1px; top: 50%; transform: translateY(-55%);
  font-size: 20px; color: var(--signal); line-height: 1;
}
.gantt-bar .gb-progress {
  position: absolute; left: 0; bottom: 0; height: 2px; background: var(--green); opacity: .65;
}
.eta-mark {
  position: absolute; top: 8px; bottom: 8px; width: 0; border-left: 1px dashed rgba(207, 90, 55, .65);
  z-index: 2; pointer-events: none;
}
.eta-mark span {
  position: absolute; top: -1px; left: 2px; font-family: var(--mono); font-size: 5.5px;
  color: var(--signal); background: rgba(251, 252, 248, .8); padding: 0 2px; white-space: nowrap;
}
.now-line {
  position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid var(--signal);
  z-index: 4; pointer-events: none; opacity: .7;
}
.now-line span {
  position: absolute; top: 1px; left: 2px; font-family: var(--mono); font-size: 5.5px;
  color: var(--signal); background: rgba(251, 252, 248, .85); padding: 0 2px;
}
.hour-ghost { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(207, 90, 55, .5); display: none; z-index: 4; }
.lane.armed .hour-ghost { display: block; }
.selected-hint {
  margin: 0 0 10px; padding: 8px 11px; border: 1px dashed rgba(207, 90, 55, .45);
  background: rgba(207, 90, 55, .05); font-size: 9.5px; color: var(--ink-2);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.selected-hint b { color: var(--signal); }
.selected-hint .chip { background: rgba(255, 255, 255, .7); }

.queue-panel { display: flex; flex-direction: column; max-height: 575px; overflow: hidden; }
.queue-list { overflow-y: auto; padding: 0; max-height: 440px; }
.qship {
  padding: 7px 11px; border-bottom: 1px solid var(--line-2); cursor: pointer;
  position: relative; transition: background .15s;
}
.qship:hover { background: rgba(255, 255, 255, .65); }
.qship.selected { background: rgba(207, 90, 55, .07); box-shadow: inset 3px 0 0 var(--signal); }
.qship.ineligible { opacity: .58; }
.qs-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.qs-name { font-size: 11.5px; font-weight: 700; }
.qs-name span { font-family: var(--mono); font-size: 7.5px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.qs-pri { font-family: var(--mono); font-size: 7px; letter-spacing: .06em; padding: 1px 3px; border: 1px solid var(--line); color: var(--muted); }
.qs-pri.high { color: var(--signal); border-color: rgba(207, 90, 55, .4); }
.qs-meta { margin-top: 3px; display: flex; flex-wrap: wrap; gap: 3px 9px; font-size: 8px; color: var(--muted); }
.qs-meta b { font-family: var(--mono); color: var(--ink-2); font-weight: 500; }
.qs-window { margin-top: 5px; display: flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 7.5px; color: var(--muted); }
.qs-window .chip { height: 17px; font-size: 7px; }
.qs-note { margin-top: 4px; font-size: 7.5px; color: var(--muted-2); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qs-action {
  position: absolute; right: 10px; bottom: 9px; font-family: var(--mono); font-size: 7px; color: var(--sea);
}
.plan-insight { margin-top: 12px; }
.plan-insight .p-body { padding: 10px 13px; }
.constraint-row { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.ai-line { display: flex; gap: 7px; align-items: flex-start; font-size: 9.5px; color: var(--ink-2); line-height: 1.55; }
.ai-line .ic { width: 13px; height: 13px; color: var(--signal); margin-top: 1px; }
.ai-line b { color: var(--signal); }

/* ---------- Ops ---------- */
.ops-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr) 368px; gap: 13px; align-items: start; }
.vessel-card .p-body { padding: 13px 15px; }
.vessel-id { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.vessel-name { font-size: 25px; line-height: 1.05; letter-spacing: .04em; font-weight: 700; }
.vessel-en { font-family: var(--display); font-size: 10px; letter-spacing: .18em; color: var(--muted); margin-top: 3px; }
.vessel-flag { text-align: right; font-family: var(--mono); font-size: 7.5px; color: var(--muted); line-height: 1.6; }
.vessel-flag b { display: block; color: var(--ink-2); font-weight: 500; }
.vessel-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 9px 0 10px; }
.vessel-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.fact { padding: 5px 0; border-bottom: 1px dotted var(--line-2); }
.fact span { display: block; font-size: 8px; color: var(--muted); letter-spacing: .05em; }
.fact b { display: block; font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--ink); margin-top: 1px; }
.fact b small { font-family: var(--sans); font-size: 8px; color: var(--muted); font-weight: 400; }
.vessel-progress { margin-top: 11px; }
.vp-head { display: flex; justify-content: space-between; font-size: 8.5px; color: var(--muted); margin-bottom: 4px; }
.vp-head b { font-family: var(--mono); color: var(--ink); font-weight: 500; }
.vp-bar { height: 6px; background: var(--line-2); position: relative; overflow: hidden; }
.vp-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, var(--sea), var(--sea-2)); }
.vp-scale { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 6.5px; color: var(--muted-2); margin-top: 2px; }
.vessel-timeline { margin-top: 11px; border-top: 1px solid var(--line-2); padding-top: 9px; }
.tl-row { display: grid; grid-template-columns: 44px 10px minmax(0, 1fr); gap: 7px; align-items: start; padding: 3px 0; }
.tl-time { font-family: var(--mono); font-size: 7.5px; color: var(--muted); padding-top: 1px; }
.tl-dot { width: 6px; height: 6px; border: 1px solid var(--line-dark); border-radius: 50%; margin-top: 3px; background: var(--card); }
.tl-row.done .tl-dot { background: var(--green); border-color: var(--green); }
.tl-row.now .tl-dot { background: var(--signal); border-color: var(--signal); box-shadow: 0 0 0 3px rgba(207, 90, 55, .12); }
.tl-copy b { display: block; font-size: 9px; font-weight: 600; }
.tl-copy span { font-size: 7.5px; color: var(--muted); }

.ops-main { display: flex; flex-direction: column; gap: 13px; min-width: 0; }
.chain-panel .p-body { padding: 15px 16px 13px; }
.chain {
  display: grid; grid-template-columns: 1fr 26px 1fr 26px 1fr; align-items: stretch; gap: 0;
}
.chain-node {
  border: 1px solid var(--line); background: var(--card-2); padding: 10px 11px; min-width: 0;
  position: relative;
}
.chain-node.highlight { border-color: var(--sea); background: rgba(42, 133, 145, .06); }
.cn-label { font-family: var(--mono); font-size: 7px; letter-spacing: .12em; color: var(--muted); }
.cn-title { font-size: 11px; font-weight: 700; margin-top: 2px; }
.cn-value { font-family: var(--display); font-size: 23px; line-height: 1.1; color: var(--ink); margin-top: 5px; }
.cn-value small { font-size: 8px; font-family: var(--sans); color: var(--muted); }
.cn-sub { font-size: 7.5px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.chain-arrow { display: grid; place-items: center; color: var(--line-dark); }
.chain-arrow .ic { width: 13px; height: 13px; }
.chain-note {
  margin-top: 10px; padding-top: 9px; border-top: 1px dotted var(--line);
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  font-size: 8px; color: var(--muted);
}
.chain-note b { font-family: var(--mono); color: var(--ink-2); font-weight: 500; }

.cost-panel .p-body { padding: 12px 14px; }
.cost-bars { display: flex; flex-direction: column; gap: 8px; }
.cost-row { display: grid; grid-template-columns: 88px minmax(0, 1fr) 76px; gap: 8px; align-items: center; font-size: 9px; }
.cost-row span { color: var(--muted); white-space: nowrap; }
.cost-track { height: 8px; background: var(--line-2); position: relative; overflow: hidden; }
.cost-track i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--sea); }
.cost-track i.op { background: var(--sea); }
.cost-track i.berth { background: var(--amber); }
.cost-track i.dem { background: var(--signal); }
.cost-track i.total { background: var(--ink); }
.cost-row b { font-family: var(--mono); font-size: 9px; text-align: right; font-weight: 500; color: var(--ink); }
.cost-total { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; }
.cost-total span { font-size: 9px; color: var(--muted); }
.cost-total b { font-family: var(--display); font-size: 22px; color: var(--ink); }

.sandbox .p-body { padding: 13px 15px; }
.crane-big { display: flex; align-items: baseline; gap: 6px; }
.crane-big b { font-family: var(--display); font-size: 44px; line-height: .9; font-weight: 600; color: var(--ink); }
.crane-big span { font-size: 10px; color: var(--muted); }
.crane-big em { margin-left: auto; font-style: normal; font-family: var(--mono); font-size: 8px; color: var(--muted); }
.range-wrap { margin: 14px 0 5px; }
input[type="range"] {
  width: 100%; height: 22px; appearance: none; -webkit-appearance: none; background: transparent;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 3px; background: linear-gradient(90deg, var(--sea) var(--fill, 50%), var(--line-2) var(--fill, 50%));
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6.5px;
  background: var(--card); border: 2px solid var(--sea); border-radius: 50%; box-shadow: 0 1px 3px rgba(15, 45, 58, .2);
}
input[type="range"]::-moz-range-track { height: 3px; background: var(--line-2); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; background: var(--card); border: 2px solid var(--sea); }
.range-ticks { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 6.5px; color: var(--muted); margin-top: 2px; }
.preview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; margin-top: 9px; border-top: 1px solid var(--line-2); padding-top: 7px; }
.preview-item { padding: 3px 0; }
.preview-item span { display: block; font-size: 7.5px; color: var(--muted); }
.preview-item b { font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--ink); }
.preview-item b.good { color: var(--green); }
.preview-item b.warn { color: var(--signal); }
.sandbox-actions { display: flex; gap: 6px; margin-top: 10px; }
.sandbox-actions .btn { flex: 1; }
.opt-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.opt-table th { font-family: var(--mono); font-size: 6.5px; letter-spacing: .06em; color: var(--muted); text-align: right; padding: 3px 3px; border-bottom: 1px solid var(--line); font-weight: 400; }
.opt-table th:first-child, .opt-table td:first-child { text-align: left; }
.opt-table td { font-family: var(--mono); font-size: 7.5px; text-align: right; padding: 3px; border-bottom: 1px solid var(--line-2); color: var(--ink-2); }
.opt-table tr.best td { background: rgba(44, 122, 96, .07); color: var(--ink); }
.opt-table tr.best td:first-child { font-weight: 700; color: var(--green); }
.opt-table tr.current td:first-child::after { content: " ●"; color: var(--sea); font-size: 5px; vertical-align: middle; }
.reco-box {
  margin-top: 10px; padding: 9px 10px; border: 1px solid rgba(207, 90, 55, .35);
  background: rgba(207, 90, 55, .045); font-size: 9px; line-height: 1.55; color: var(--ink-2);
}
.reco-box b { color: var(--signal); }
.reco-box .reco-head { display: flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 7.5px; letter-spacing: .1em; color: var(--signal); margin-bottom: 3px; }
.reco-box .reco-head .ic { width: 11px; height: 11px; }
.reco-actions { display: flex; gap: 6px; margin-top: 8px; }
.reco-actions .btn { flex: 1; }
.ops-note { margin-top: 9px; font-size: 8px; color: var(--muted); line-height: 1.55; }
.ops-bottom { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 13px; margin-top: 13px; }
.shift-track-wrap { padding: 15px 16px 12px; }
.shift-track { position: relative; height: 54px; margin: 8px 2px 0; border-top: 1px solid var(--line); }
.st-rail { position: absolute; left: 0; right: 0; top: 9px; height: 3px; background: var(--line-2); }
.st-fill { position: absolute; left: 0; top: 9px; height: 3px; background: linear-gradient(90deg, var(--sea), var(--sea-2)); }
.st-now { position: absolute; top: 2px; bottom: 0; width: 0; border-left: 1px dashed var(--signal); }
.st-now span { position: absolute; top: 0; left: 3px; font-family: var(--mono); font-size: 6.5px; color: var(--signal); background: var(--card); padding: 0 2px; }
.st-marker { position: absolute; top: 3px; transform: translateX(-50%); text-align: center; }
.st-marker i { display: block; width: 7px; height: 7px; margin: 5px auto 0; border-radius: 50%; background: var(--card); border: 1.5px solid var(--sea); }
.st-marker.done i { background: var(--sea); }
.st-marker.hot i { background: var(--signal); border-color: var(--signal); }
.st-marker span { display: block; font-family: var(--mono); font-size: 6.5px; color: var(--muted); white-space: nowrap; }
.st-marker b { display: block; font-size: 8px; font-weight: 600; color: var(--ink-2); white-space: nowrap; margin-top: 2px; }
.st-marker.above b { margin-top: 1px; }
.st-marker.above i { display: none; }
.shift-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 8px; border-top: 1px solid var(--line-2); }
.shift-stat { padding: 7px 9px 0 0; border-right: 1px solid var(--line-2); }
.shift-stat:last-child { border-right: 0; }
.shift-stat span { display: block; font-size: 7.5px; color: var(--muted); }
.shift-stat b { display: block; font-family: var(--mono); font-size: 12px; font-weight: 500; margin-top: 1px; color: var(--ink); }
.shift-stat b.warn { color: var(--signal); }
.shift-stat b.good { color: var(--green); }
.ops-orders { padding: 0; }
.ops-order-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.ops-order-row:last-child { border-bottom: 0; }
.ops-order-row:hover { background: rgba(255, 255, 255, .6); }
.ops-order-row b { display: block; font-size: 9.5px; font-weight: 600; line-height: 1.35; }
.ops-order-row span { display: block; font-family: var(--mono); font-size: 7px; color: var(--muted); margin-top: 1px; }

.data-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.data-table th { font-family: var(--mono); font-size: 7px; letter-spacing: .06em; color: var(--muted); text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); background: var(--card-2); font-weight: 400; }
.data-table td { font-size: 8.5px; padding: 4px 8px; border-bottom: 1px solid var(--line-2); color: var(--ink-2); }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr.clickable { cursor: pointer; }
.data-table tr.clickable:hover td { background: rgba(42, 133, 145, .04); }
.data-table .num { font-family: var(--mono); text-align: right; }
.data-table .hot { color: var(--signal); font-weight: 700; }
.data-table .ok { color: var(--green); }
.data-table .cell-strong { color: var(--ink); font-weight: 600; }

/* ---------- Yard ---------- */
.yard-layout { display: grid; grid-template-columns: minmax(0, 1fr) 388px; gap: 13px; align-items: start; }
.yard-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.yard-card { padding: 9px 11px 9px; cursor: pointer; transition: border-color .15s, transform .15s; }
.yard-card:hover { border-color: var(--sea); }
.yard-card.selected { border-color: var(--signal); box-shadow: 0 0 0 1px var(--signal), var(--shadow); }
.yc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.yc-name { font-size: 11.5px; font-weight: 700; }
.yc-code { font-family: var(--mono); font-size: 7px; color: var(--muted); margin-top: 1px; }
.yc-pct { font-family: var(--display); font-size: 24px; line-height: 1; color: var(--ink); }
.yc-pct.hot { color: var(--signal); }
.yc-pct small { font-size: 9px; color: var(--muted); }
.yc-gauge { height: 6px; background: var(--line-2); margin: 7px 0 4px; position: relative; overflow: hidden; }
.yc-gauge i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--sea); }
.yc-gauge i.hot { background: var(--signal); }
.yc-gauge .alert-line { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--amber); left: 85%; }
.yc-meta { display: flex; justify-content: space-between; font-size: 8px; color: var(--muted); gap: 6px; }
.yc-meta b { font-family: var(--mono); color: var(--ink-2); font-weight: 500; }
.yc-foot { margin-top: 4px; padding-top: 4px; border-top: 1px dotted var(--line-2); display: flex; justify-content: space-between; font-size: 7.5px; color: var(--muted); }
.yard-side { display: flex; flex-direction: column; gap: 13px; }
.yard-detail .p-body { padding: 12px 14px; }
.yd-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.yd-title b { font-size: 16px; }
.yd-title span { font-family: var(--mono); font-size: 8px; color: var(--muted); }
.yd-numbers { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; margin-top: 7px; }
.flow-bars { display: flex; align-items: flex-end; gap: 8px; height: 62px; margin-top: 9px; padding-top: 4px; border-top: 1px solid var(--line-2); }
.fb-day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; height: 100%; justify-content: flex-end; }
.fb-pair { display: flex; align-items: flex-end; gap: 2px; height: 44px; }
.fb-pair i { width: 6px; background: var(--sea); min-height: 1px; }
.fb-pair i.out { background: var(--signal); }
.fb-day span { font-family: var(--mono); font-size: 5.5px; color: var(--muted); }
.fb-legend { display: flex; gap: 9px; font-size: 7.5px; color: var(--muted); margin-top: 2px; }
.fb-legend em { font-style: normal; display: inline-flex; align-items: center; gap: 3px; }
.fb-legend i { width: 6px; height: 6px; display: inline-block; }
.evac-controls { margin-top: 9px; border-top: 1px solid var(--line-2); padding-top: 9px; }
.evac-big { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 3px; }
.evac-big b { font-family: var(--display); font-size: 30px; line-height: 1; }
.evac-big span { font-size: 9px; color: var(--muted); }
.evac-preview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-top: 8px; }
.evac-preview .preview-item { background: var(--card-2); padding: 5px 6px; border: 1px solid var(--line-2); }
.yard-note { font-size: 8px; color: var(--muted); line-height: 1.55; margin-top: 7px; }

/* ---------- Approval ---------- */
.approval-layout { display: grid; grid-template-columns: 410px minmax(0, 1fr); gap: 13px; align-items: start; }
.order-list { max-height: calc(100vh - 230px); overflow-y: auto; padding: 0; }
.order-card { padding: 11px 13px; border-bottom: 1px solid var(--line-2); cursor: pointer; position: relative; }
.order-card:hover { background: rgba(255, 255, 255, .6); }
.order-card.selected { background: rgba(207, 90, 55, .055); box-shadow: inset 3px 0 0 var(--signal); }
.order-card.rejected { opacity: .75; }
.oc-top { display: flex; align-items: center; justify-content: space-between; gap: 7px; margin-bottom: 4px; }
.oc-id { font-family: var(--mono); font-size: 7.5px; color: var(--muted); letter-spacing: .04em; }
.oc-type { font-family: var(--mono); font-size: 6.5px; letter-spacing: .08em; padding: 1px 4px; border: 1px solid var(--line); color: var(--ink-2); }
.oc-title { font-size: 11.5px; font-weight: 700; line-height: 1.4; }
.oc-impact { margin-top: 3px; font-size: 8.5px; color: var(--muted); line-height: 1.45; }
.oc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 5px; }
.oc-by { font-size: 7.5px; color: var(--muted); }
.oc-stage { display: flex; align-items: center; gap: 3px; }
.oc-stage i { width: 13px; height: 3px; background: var(--line-2); }
.oc-stage i.done { background: var(--green); }
.oc-stage i.current { background: var(--signal); }
.oc-stage i.reject { background: var(--red); }
.oc-stage span { font-family: var(--mono); font-size: 6.5px; color: var(--muted); margin-left: 3px; white-space: nowrap; }

.order-detail { min-height: 620px; }
.od-head { padding: 12px 16px 10px; border-bottom: 1px solid var(--line); }
.od-eyebrow { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.od-eyebrow .oc-type { font-size: 7px; }
.od-title { font-size: 19px; line-height: 1.25; font-weight: 700; letter-spacing: .02em; }
.od-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; font-size: 8.5px; color: var(--muted); }
.od-meta b { font-family: var(--mono); color: var(--ink-2); font-weight: 500; }
.od-body { padding: 10px 16px 14px; }
.od-section { margin-bottom: 10px; }
.od-section:last-child { margin-bottom: 0; }
.stagebar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--line); }
.stage-step { padding: 8px 9px; border-right: 1px solid var(--line-2); position: relative; background: var(--card-2); min-width: 0; }
.stage-step:last-child { border-right: 0; }
.stage-step.done { background: rgba(44, 122, 96, .06); }
.stage-step.current { background: rgba(207, 90, 55, .07); }
.stage-step.reject { background: rgba(182, 64, 50, .07); }
.ss-label { font-family: var(--mono); font-size: 6.5px; letter-spacing: .1em; color: var(--muted); }
.ss-actor { font-size: 9px; font-weight: 600; margin-top: 3px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-time { font-family: var(--mono); font-size: 6.5px; color: var(--muted); margin-top: 1px; }
.ss-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--line-2); }
.stage-step.done .ss-bar { background: var(--green); }
.stage-step.current .ss-bar { background: var(--signal); }
.stage-step.reject .ss-bar { background: var(--red); }

.checks { display: flex; flex-direction: column; gap: 4px; }
.check-row { display: flex; align-items: flex-start; gap: 7px; font-size: 9px; line-height: 1.45; color: var(--ink-2); }
.check-row .ck { width: 13px; height: 13px; flex: 0 0 13px; display: grid; place-items: center; margin-top: 1px; }
.check-row .ck .ic { width: 11px; height: 11px; }
.check-row.ok .ck { color: var(--green); }
.check-row.warn .ck { color: var(--amber); }
.check-row.bad .ck { color: var(--red); }
.check-row b { font-family: var(--mono); font-size: 7.5px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.diff-table { width: 100%; border-collapse: collapse; }
.diff-table th { font-family: var(--mono); font-size: 6.5px; letter-spacing: .08em; color: var(--muted); text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line); font-weight: 400; }
.diff-table td { font-size: 9px; padding: 4px 6px; border-bottom: 1px solid var(--line-2); color: var(--ink-2); }
.diff-table td.num { font-family: var(--mono); text-align: right; }
.diff-table td.after { color: var(--ink); font-weight: 600; }
.diff-table tr:last-child td { border-bottom: 0; }
.after-box {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line-2);
  border: 1px solid var(--line-2); margin-top: 6px;
}
.after-cell { background: var(--card); padding: 7px 8px; }
.after-cell span { display: block; font-size: 7px; color: var(--muted); }
.after-cell b { display: block; font-family: var(--mono); font-size: 11px; color: var(--ink); margin-top: 2px; }
.after-cell b em { font-style: normal; font-size: 8px; color: var(--muted); }
.after-cell b.good { color: var(--green); }
.after-cell b.warn { color: var(--signal); }
.comment-box { margin-top: 9px; }
.comment-box label { display: block; font-family: var(--mono); font-size: 7px; letter-spacing: .1em; color: var(--muted); margin-bottom: 4px; }
.comment-box textarea {
  width: 100%; min-height: 46px; resize: vertical; border: 1px solid var(--line); background: rgba(255, 255, 255, .6);
  padding: 7px 8px; font-size: 9.5px; line-height: 1.5; color: var(--ink);
}
.approval-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; padding-top: 9px; border-top: 1px solid var(--line); margin-top: 10px; }
.approval-actions .perm-note { margin-right: auto; font-size: 8px; color: var(--muted); line-height: 1.4; }
.approval-actions .perm-note b { color: var(--ink-2); }
.role-matrix { margin-top: 10px; }
.role-matrix table { width: 100%; border-collapse: collapse; }
.role-matrix th, .role-matrix td { font-size: 7.5px; padding: 4px 5px; border-bottom: 1px solid var(--line-2); text-align: left; color: var(--muted); }
.role-matrix th { font-family: var(--mono); font-weight: 400; letter-spacing: .06em; }
.role-matrix td b { color: var(--ink-2); font-weight: 500; }
.role-matrix .cur { color: var(--signal); font-weight: 700; }

/* ---------- Audit ---------- */
.audit-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }
.audit-stat { padding: 11px 13px; }
.as-label { font-family: var(--mono); font-size: 7.5px; letter-spacing: .12em; color: var(--muted); }
.as-value { font-family: var(--display); font-size: 26px; line-height: 1.1; margin-top: 3px; color: var(--ink); font-variant-numeric: tabular-nums; }
.as-value small { font-size: 9px; color: var(--muted); font-family: var(--sans); }
.as-note { font-size: 7.5px; color: var(--muted); margin-top: 3px; }
.as-note.good { color: var(--green); }
.audit-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; border: 1px solid var(--line); border-bottom: 0; background: var(--card-2);
  flex-wrap: wrap;
}
.audit-filters { display: flex; gap: 5px; flex-wrap: wrap; }
.filter-btn {
  height: 24px; padding: 0 8px; border: 1px solid var(--line); background: transparent;
  font-family: var(--mono); font-size: 8px; color: var(--muted); letter-spacing: .04em;
}
.filter-btn.active { background: var(--ink); border-color: var(--ink); color: #f4f1e6; }
.audit-search { display: flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: #fff; height: 25px; padding: 0 7px; }
.audit-search .ic { width: 12px; height: 12px; color: var(--muted); }
.audit-search input { border: 0; background: transparent; outline: none; font-size: 9px; width: 150px; }
.audit-tools { display: flex; gap: 6px; }
.log-table-wrap { border: 1px solid var(--line); background: var(--card); overflow: hidden; }
.log-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.log-table th {
  font-family: var(--mono); font-size: 6.5px; letter-spacing: .08em; color: var(--muted);
  text-align: left; padding: 6px 7px; border-bottom: 1px solid var(--line); background: var(--card-2); font-weight: 400;
}
.log-table td { font-size: 8px; padding: 6px 7px; border-bottom: 1px solid var(--line-2); color: var(--ink-2); vertical-align: top; line-height: 1.4; }
.log-table tr:last-child td { border-bottom: 0; }
.log-table tr:hover td { background: rgba(42, 133, 145, .035); }
.log-table .lt-time { font-family: var(--mono); font-size: 7.5px; color: var(--muted); white-space: nowrap; }
.log-table .lt-actor b { display: block; font-size: 8.5px; color: var(--ink); font-weight: 600; }
.log-table .lt-actor span { font-size: 6.5px; color: var(--muted); }
.log-table .lt-action { font-weight: 600; color: var(--ink); }
.log-table .lt-action.deny { color: var(--red); }
.log-table .lt-rule { font-family: var(--mono); font-size: 6.5px; color: var(--sea); white-space: nowrap; }
.log-table .lt-hash { font-family: var(--mono); font-size: 6.5px; color: var(--muted); white-space: nowrap; }
.log-table .lt-detail { color: var(--muted); font-size: 7.5px; }
.hash-banner {
  display: flex; align-items: center; gap: 7px; padding: 7px 10px; margin-bottom: 9px;
  border: 1px solid rgba(44, 122, 96, .3); background: rgba(44, 122, 96, .05);
  font-size: 9px; color: var(--green);
}
.hash-banner.warn { border-color: rgba(207, 90, 55, .4); background: rgba(207, 90, 55, .06); color: var(--signal); }
.hash-banner .ic { width: 13px; height: 13px; }
.hash-banner b { font-family: var(--mono); font-size: 8px; }
.formula-panel { margin-top: 12px; }
.formula-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.formula-item { display: flex; gap: 7px; padding: 5px 0; border-bottom: 1px dotted var(--line-2); font-size: 8.5px; line-height: 1.5; color: var(--ink-2); }
.formula-item code { font-family: var(--mono); font-size: 7px; color: var(--sea); white-space: nowrap; flex: 0 0 auto; }
.formula-item b { color: var(--ink); font-weight: 600; }

/* ---------- Drawer / modal / toast ---------- */
.drawer-root { position: fixed; inset: 0; z-index: 90; }
.drawer-backdrop {
  position: absolute; inset: 0; background: rgba(8, 28, 36, .34);
  backdrop-filter: blur(1.5px);
}
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: 590px; max-width: 94vw;
  background: var(--card); border-left: 1px solid var(--ink);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  animation: slide-in .22s ease-out;
}
.drawer-head {
  flex: 0 0 auto; padding: 14px 18px 12px; border-bottom: 1px solid var(--line);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  background: linear-gradient(180deg, #fffef9, var(--card));
}
.dh-eyebrow { font-family: var(--mono); font-size: 7.5px; letter-spacing: .16em; color: var(--sea); margin-bottom: 4px; }
.dh-title { font-size: 18px; line-height: 1.3; font-weight: 700; letter-spacing: .02em; }
.dh-sub { margin-top: 4px; font-size: 9px; color: var(--muted); line-height: 1.5; }
.drawer-close {
  width: 28px; height: 28px; flex: 0 0 28px; border: 1px solid var(--line); background: transparent;
  display: grid; place-items: center; color: var(--ink-2);
}
.drawer-close:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.drawer-close .ic { width: 14px; height: 14px; }
.drawer-body { overflow-y: auto; padding: 14px 18px 22px; }
.dr-section { margin-bottom: 15px; }
.dr-section:last-child { margin-bottom: 0; }
.dr-conclusion {
  padding: 11px 12px; border: 1px solid rgba(207, 90, 55, .35); background: rgba(207, 90, 55, .05);
  font-size: 11px; line-height: 1.65; color: var(--ink); font-weight: 600;
}
.dr-conclusion b { color: var(--signal); }
.dr-calc { width: 100%; border-collapse: collapse; }
.dr-calc th { font-family: var(--mono); font-size: 6.5px; letter-spacing: .08em; color: var(--muted); text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line); font-weight: 400; }
.dr-calc td { font-size: 8.5px; padding: 5px 6px; border-bottom: 1px solid var(--line-2); color: var(--ink-2); }
.dr-calc td.num { font-family: var(--mono); text-align: right; }
.dr-calc tr.total td { font-weight: 700; color: var(--ink); border-top: 1px solid var(--line); }
.dr-rule { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; border-bottom: 1px dotted var(--line-2); font-size: 9px; line-height: 1.55; color: var(--ink-2); }
.dr-rule code { font-family: var(--mono); font-size: 7px; color: var(--sea); flex: 0 0 74px; }
.dr-source { font-size: 8px; color: var(--muted); line-height: 1.6; }
.dr-source b { color: var(--ink-2); font-weight: 500; }
.dr-actions { display: flex; gap: 7px; margin-top: 12px; }

.modal-root { position: fixed; inset: 0; z-index: 95; display: none; }
.modal-root.open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8, 28, 36, .4); }
.modal {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 520px; max-width: 92vw; background: var(--card); border: 1px solid var(--ink);
  box-shadow: var(--shadow-lg); padding: 18px 20px;
}
.modal h3 { margin: 0 0 6px; font-size: 18px; }
.modal p { margin: 0 0 12px; font-size: 10px; color: var(--muted); line-height: 1.6; }
.modal-actions { display: flex; justify-content: flex-end; gap: 7px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 18px);
  background: var(--ink); color: #f5f1e4; padding: 9px 15px; font-size: 11px;
  border-left: 3px solid var(--sea-2); box-shadow: var(--shadow-lg); z-index: 120;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  max-width: 620px; line-height: 1.5;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-left-color: var(--signal); }
.toast.success { border-left-color: #69b99b; }
.toast.warn { border-left-color: var(--amber); }
.toast b { color: #fff; }

/* ---------- Motion ---------- */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes ring { 0% { transform: scale(.7); opacity: .65; } 100% { transform: scale(1.9); opacity: 0; } }
@keyframes slide-in { from { transform: translateX(30px); opacity: .4; } to { transform: translateX(0); opacity: 1; } }
body.static * { animation: none !important; transition: none !important; }
body.static .drawer { animation: none; }

/* ---------- Responsive fallbacks ---------- */
@media (max-width: 1500px) {
  .masthead { grid-template-columns: minmax(400px, 1.1fr) minmax(300px, .8fr) minmax(440px, 1fr); gap: 12px; }
  .env-line { display: none; }
  .overview-grid { grid-template-columns: minmax(0, 1fr) 360px; }
  .brief-title { font-size: 14.5px; }
  .ops-grid { grid-template-columns: 278px minmax(0, 1fr) 340px; }
  .yard-layout { grid-template-columns: minmax(0, 1fr) 352px; }
  .approval-layout { grid-template-columns: 380px minmax(0, 1fr); }
}
@media (max-width: 1320px) {
  .app { min-width: 1180px; }
  .org-line { display: none; }
  .masthead { grid-template-columns: 330px minmax(260px, .8fr) minmax(420px, 1fr); }
  .kpi-value { font-size: 22px; }
  .kpi-cell { padding: 10px 12px 8px; }
  .overview-grid { grid-template-columns: minmax(0, 1fr) 330px; }
  .brand-line strong { font-size: 22px; }
  .overview-bottom { grid-template-columns: 1.3fr 1fr 1fr; }
  .ops-grid { grid-template-columns: 258px minmax(0, 1fr) 320px; gap: 11px; }
  .chain { grid-template-columns: 1fr 18px 1fr 18px 1fr; }
  .cn-value { font-size: 20px; }
}
