:root {
  --paper:#fbfaf6; --panel:#fff; --ink:#111214; --muted:#77777d; --soft:#efeee8;
  --line:#dedbd2; --line-strong:#111214; --black:#111214;
  --closed:#111214; --stage:#b66a16; --pending:#6f7177;
  --gus-soft:#f1efe8; --vendor-soft:#fff; --confirm:#fff2d5; --success:#0e6f45;
}
* { box-sizing:border-box; }
html { scroll-behavior:smooth; }
body {
  margin:0; background:var(--paper); color:var(--ink);
  font:14px/1.5 "Inter","Segoe UI","Microsoft JhengHei",Arial,sans-serif; letter-spacing:0;
  -webkit-font-smoothing:antialiased;
}
button,input,select,textarea { font:inherit; }
a { color:inherit; }
.page { max-width:1500px; margin:0 auto; padding:30px 34px 42px; }
.topbar {
  display:flex; align-items:center; justify-content:space-between; min-height:54px;
  border-bottom:1px solid var(--line); margin-bottom:54px;
}
.brand { font-weight:950; text-decoration:none; font-size:18px; }
.navlinks { display:flex; align-items:center; gap:24px; font-size:12px; color:#515258; }
.navlinks a { text-decoration:none; font-weight:750; }
.navlinks a:hover { color:var(--black); }
.live-pill { display:inline-flex; align-items:center; gap:8px; border:1px solid var(--line); padding:7px 10px; color:#33343a; background:#fff; font-weight:850; }
.dot { width:8px; height:8px; background:#a3a3a3; display:inline-block; border-radius:999px; }
.live-pill.online .dot { background:var(--success); }
.live-pill.offline .dot { background:#9b1c1c; }
.hero {
  display:grid; grid-template-columns:minmax(0,1fr) 420px; gap:46px; align-items:end;
  padding:10px 0 48px; border-bottom:1px solid var(--line);
}
.eyebrow { margin:0 0 20px; color:#303136; font-weight:900; font-size:13px; }
h1 { margin:0; font-size:clamp(54px,8vw,104px); line-height:.95; font-weight:950; text-wrap:balance; }
h1 span { color:#d7d5ce; }
.hero p { margin:34px 0 0; max-width:650px; color:#515258; font-size:18px; line-height:1.45; }
.quick-guide {
  margin:34px 0 0;
  max-width:760px;
  border:1px solid var(--line);
  border-left:4px solid var(--black);
  background:#fff;
  padding:14px 18px;
}
.quick-guide strong {
  display:block;
  margin-bottom:8px;
  font-size:13px;
  font-weight:950;
}
.quick-guide ol {
  margin:0;
  padding-left:19px;
  color:#33343a;
  font-size:15px;
  line-height:1.55;
}
.quick-guide li + li { margin-top:4px; }
.source-card { border:1px solid var(--line); background:#fff; padding:22px; }
.source-card b { display:block; margin-bottom:5px; }
.source-card .stacked { margin-top:16px; }
.source-card span { display:block; color:var(--muted); font-size:12px; overflow-wrap:anywhere; }
.metrics {
  display:grid; grid-template-columns:repeat(5,minmax(150px,1fr)); gap:0;
  margin:0 0 34px; border-bottom:1px solid var(--line); border-top:1px solid var(--line);
}
.metric { background:transparent; border-right:1px solid var(--line); padding:26px 20px 28px; }
.metric:last-child { border-right:0; }
.metric span { color:#77777d; font-size:11px; font-weight:800; text-transform:uppercase; }
.metric strong { display:block; margin-top:6px; font-size:34px; line-height:1; font-weight:950; font-variant-numeric:tabular-nums; }
.machine-strip { display:grid; grid-template-columns:repeat(8,1fr); gap:0; margin-bottom:32px; border-top:1px solid var(--line); border-left:1px solid var(--line); }
.machine-strip a {
  min-height:48px; border-right:1px solid var(--line); border-bottom:1px solid var(--line); background:#fff; text-decoration:none; padding:10px 12px;
  display:flex; align-items:center; justify-content:space-between; gap:10px; font-weight:850; font-size:12px;
}
.machine-strip a.gus { background:var(--gus-soft); color:var(--black); }
.machine-strip a.vendor { background:var(--vendor-soft); color:var(--black); }
.layout { display:grid; grid-template-columns:minmax(0,1fr) 392px; gap:24px; align-items:start; }
.main-column { display:grid; gap:24px; min-width:0; }
.panel { background:var(--panel); border:1px solid var(--line); }
.panel-head { display:flex; justify-content:space-between; gap:18px; align-items:flex-start; padding:24px 26px; border-bottom:1px solid var(--line); }
h2 { margin:0; font-size:25px; font-weight:950; }
.panel-head p { margin:4px 0 0; color:var(--muted); }
.range-pill,.small-link { border:1px solid var(--line); background:#fff; padding:6px 10px; color:var(--muted); font-size:12px; text-decoration:none; white-space:nowrap; }
.small-link { color:var(--black); font-weight:850; }
.gantt-axis { position:relative; height:34px; margin:0 18px 0 310px; border-bottom:1px solid var(--line); }
.gantt-axis span { position:absolute; bottom:8px; transform:translateX(-50%); color:var(--muted); font-size:11px; }
.gantt-grid { padding:8px 24px 22px; }
.gantt-row { display:grid; grid-template-columns:minmax(220px,290px) minmax(0,1fr); gap:16px; align-items:center; min-height:58px; border-bottom:1px solid var(--soft); }
.gantt-row:last-child { border-bottom:0; }
.gantt-label { display:flex; align-items:center; gap:10px; min-width:0; }
.item-no { width:31px; height:31px; display:inline-flex; align-items:center; justify-content:center; border:1px solid var(--line-strong); background:#fff; font-weight:950; flex:0 0 auto; }
.gantt-label strong { display:block; overflow-wrap:anywhere; }
.gantt-label small { color:var(--muted); }
.track { position:relative; min-width:0; height:28px; border:1px solid var(--line); overflow:hidden; background:repeating-linear-gradient(90deg,#fff 0,#fff 10%,#f3f2ed 10%,#f3f2ed 10.35%); }
.bar { position:absolute; top:4px; height:18px; min-width:0; max-width:100%; color:#fff; display:flex; align-items:center; padding:0 8px; font-size:11px; font-weight:900; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.bar.closed { background:var(--closed); }
.bar.stage { background:repeating-linear-gradient(135deg,var(--stage) 0,var(--stage) 7px,#d98b25 7px,#d98b25 12px); color:#fff; }
.bar.pending { background:var(--pending); }
.editor { position:sticky; top:18px; padding:22px; }
.editor h2 { margin-bottom:8px; }
.field { display:grid; grid-template-columns:92px 1fr; gap:8px; align-items:center; margin:9px 0; }
.field label { color:#55565c; font-weight:850; font-size:12px; }
.field input,.field select,.field textarea { width:100%; min-height:34px; border:1px solid var(--line); background:#fff; padding:7px 9px; color:var(--ink); }
.field textarea { min-height:118px; resize:vertical; }
.actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:12px; }
.btn { border:1px solid var(--black); min-height:38px; color:#fff; background:var(--black); font-weight:900; cursor:pointer; }
.btn.secondary { background:#2f3034; border-color:#2f3034; }
.btn.ghost { background:#fff; color:var(--black); border:1px solid var(--line); }
.btn:active { transform:scale(.98); }
.btn:disabled { opacity:.45; cursor:not-allowed; }
.hint { margin:8px 0 0; color:var(--muted); font-size:12px; }
.status-badge { display:inline-flex; align-items:center; min-height:25px; padding:3px 9px; font-size:12px; font-weight:900; border:1px solid transparent; white-space:nowrap; }
.status-badge.closed { background:var(--closed); color:#fff; }
.status-badge.stage { color:#794306; border-color:#d99b45; background:repeating-linear-gradient(135deg,#fff8ea 0,#fff8ea 6px,#ffe6bd 6px,#ffe6bd 10px); font-style:italic; }
.status-badge.pending { color:#4b5563; border-color:#c9d0d6; background:#f3f5f5; }
.matrix { overflow:auto; }
table { width:100%; border-collapse:collapse; }
th,td { padding:10px 11px; border-bottom:1px solid var(--line); text-align:left; vertical-align:top; }
th { background:#f4f3ee; color:#66666d; font-size:11px; position:sticky; top:0; text-transform:uppercase; }
.num { text-align:right; font-variant-numeric:tabular-nums; }
.row-link { text-decoration:none; font-weight:900; color:var(--black); }
.progress-cell { min-width:340px; max-width:540px; }
.progress-timeline { display:grid; gap:0; }
.progress-step { display:grid; grid-template-columns:90px minmax(0,1fr); gap:10px; align-items:start; padding:7px 0; border-bottom:1px solid var(--soft); }
.progress-step:last-child { border-bottom:0; }
.progress-date { display:inline-flex; width:max-content; max-width:90px; border:1px solid var(--line-strong); background:#fff; color:var(--black); padding:2px 6px; font-size:11px; line-height:1.35; font-weight:950; font-variant-numeric:tabular-nums; white-space:nowrap; }
.progress-date.summary { background:var(--black); color:#fff; }
.progress-date.latest { border-color:var(--stage); background:#fff2d5; color:#7a3f08; box-shadow:inset 0 -2px 0 rgba(182,106,22,.28); }
.progress-text { color:#33343a; line-height:1.45; overflow-wrap:anywhere; }
.cards { display:grid; gap:22px; margin-top:28px; }
.item-card { background:#fff; border:1px solid var(--line); border-left:8px solid var(--black); padding:22px; }
.item-card.gus { border-left-color:#9e9a8c; }
.item-top { display:flex; justify-content:space-between; gap:22px; border-bottom:1px solid var(--line); padding-bottom:16px; }
h3 { margin:4px 0; font-size:28px; line-height:1.15; font-weight:950; }
.item-top p { margin:0; color:var(--muted); }
.facts { display:grid; grid-template-columns:repeat(6,minmax(110px,1fr)); gap:9px; margin:13px 0; }
.fact { border:1px solid var(--line); background:#fbfaf6; padding:10px; }
.fact span { display:block; color:var(--muted); font-size:11px; text-transform:uppercase; font-weight:800; }
.fact strong { display:block; overflow-wrap:anywhere; }
.card-columns { display:grid; grid-template-columns:minmax(0,1fr) minmax(330px,.8fr); gap:14px; }
.purpose-grid { display:grid; gap:9px; margin:12px 0; }
.purpose-card { border:1px solid var(--line); background:#fff; }
.purpose-title { display:flex; justify-content:space-between; gap:10px; padding:11px 12px; background:#f4f3ee; border-bottom:1px solid var(--line); }
.purpose-title strong { color:var(--black); }
.purpose-title span { color:var(--muted); font-size:12px; }
.purpose-row { display:grid; grid-template-columns:132px 1fr; border-bottom:1px solid #edf1ed; }
.purpose-row:last-child { border-bottom:0; }
.purpose-term { padding:10px 12px; background:#fbfaf6; color:#33343a; font-weight:900; border-right:1px solid #edf1ed; }
.purpose-body { padding:10px 12px; color:#33343a; overflow-wrap:anywhere; }
.confirm-row { background:var(--confirm); }
.confirm-row .purpose-term { background:#ffe6ad; color:#7a4500; }
.confirm-row .purpose-body { color:#4d3920; font-weight:700; }
.report-list { display:grid; gap:8px; }
.report-card { display:grid; grid-template-columns:48px minmax(0,1fr) max-content; gap:12px; align-items:center; border:1px solid var(--line); background:#fff; padding:10px; }
.report-card:hover { border-color:var(--black); background:#fbfaf6; }
.file-type { display:inline-flex; height:31px; align-items:center; justify-content:center; border:1px solid var(--black); background:#fff; color:var(--black); font-size:11px; font-weight:950; text-transform:uppercase; }
.report-body { min-width:0; }
.report-body strong { display:block; overflow-wrap:anywhere; }
.report-body small { display:block; color:var(--muted); font-size:12px; }
.report-actions { display:flex; flex-wrap:nowrap; justify-content:flex-end; gap:7px; }
.report-action { display:inline-flex; align-items:center; justify-content:center; min-height:32px; border:1px solid var(--line); background:#fff; color:var(--black); padding:0 10px; text-decoration:none; font-size:12px; font-weight:950; cursor:pointer; }
.report-action.primary { background:var(--black); border-color:var(--black); color:#fff; }
.report-action.proxy { border-color:#d2a052; background:#fff2d5; color:#72430a; }
.report-action.ghost { background:#fff; color:#33343a; }
.report-action:hover { border-color:var(--black); }
.audit-panel { margin-top:28px; }
.audit-list { padding:0 24px 20px; display:grid; gap:0; }
.audit-row { display:grid; grid-template-columns:160px 90px minmax(118px,.34fr) minmax(260px,1fr); gap:14px; border-bottom:1px solid var(--soft); padding:13px 0; align-items:start; }
.audit-row > * { min-width:0; overflow-wrap:anywhere; }
.audit-row code { font-family:inherit; font-weight:900; }
.audit-time { color:#33343a; font-variant-numeric:tabular-nums; }
.audit-user { color:var(--black); }
.audit-action { display:inline-flex; flex-wrap:wrap; align-items:center; gap:6px; font-weight:900; color:#2f3034; }
.audit-action small { border:1px solid var(--line); background:#fbfaf6; padding:1px 6px; font-size:11px; color:var(--muted); }
.audit-summary { color:#33343a; line-height:1.45; }
.auth-split { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:12px; }
.users-panel { margin-top:28px; }
.users-admin { padding:0 24px 24px; }
.user-console { display:grid; grid-template-columns:360px minmax(0,1fr); gap:18px; align-items:start; }
.user-form { border:1px solid var(--line); background:#fbfaf6; padding:16px; }
.user-form h3 { margin:0 0 2px; font-size:20px; }
.user-table-wrap { overflow:auto; border:1px solid var(--line); background:#fff; }
.user-table th,.user-table td { white-space:nowrap; }
.user-table input,.user-table select { width:100%; min-height:34px; border:1px solid var(--line); background:#fff; padding:7px 9px; color:var(--ink); }
.user-table .btn { min-width:72px; }
.checkline { display:inline-flex; align-items:center; gap:7px; font-weight:850; color:#33343a; }
.checkline input { width:auto; min-height:auto; }
.toast { position:fixed; right:22px; bottom:22px; background:#10221a; color:#fff; padding:10px 13px; opacity:0; transform:translateY(8px); transition:opacity .18s, transform .18s; pointer-events:none; }
.toast.show { opacity:1; transform:translateY(0); }
@media (max-width:1100px) {
  .topbar { align-items:flex-start; gap:14px; }
  .navlinks { flex-wrap:wrap; justify-content:flex-end; gap:12px; }
  .hero,.layout,.card-columns { grid-template-columns:1fr; }
  .editor { position:static; }
  .metrics { grid-template-columns:repeat(2,1fr); }
  .machine-strip { grid-template-columns:repeat(2,1fr); }
  .gantt-axis { margin-left:18px; }
  .gantt-row { grid-template-columns:1fr; padding:10px 0; }
  .facts { grid-template-columns:repeat(2,1fr); }
  .user-console { grid-template-columns:1fr; }
}
@media (max-width:560px) {
  html,body { max-width:100%; overflow-x:hidden; }
  .page { width:100vw; max-width:100vw; padding:22px 18px 34px; overflow:hidden; }
  .hero,.source-card,.metrics,.machine-strip,.panel,.editor { width:100%; max-width:100%; min-width:0; }
  .topbar { display:block; min-height:auto; padding-bottom:14px; margin-bottom:44px; }
  .navlinks { justify-content:flex-start; gap:12px; margin-top:14px; }
  .live-pill { padding:7px 9px; }
  .hero { gap:26px; padding-bottom:34px; }
  .eyebrow { margin-bottom:14px; font-size:12px; }
  h1 { font-size:clamp(40px,13vw,48px); line-height:1; overflow-wrap:anywhere; }
  .hero p { margin-top:24px; font-size:16px; overflow-wrap:anywhere; word-break:break-word; }
  .source-card { padding:18px; min-width:0; max-width:100%; overflow-wrap:anywhere; }
  .source-card span,.hint,.panel-head p { overflow-wrap:anywhere; word-break:break-word; }
  .metrics { grid-template-columns:1fr; }
  .metric { border-right:0; border-bottom:1px solid var(--line); padding:22px 20px; }
  .metric:last-child { border-bottom:0; }
  .metric strong { font-size:32px; overflow-wrap:anywhere; }
  .machine-strip { grid-template-columns:1fr; }
  .machine-strip a { min-width:0; overflow-wrap:anywhere; }
  .panel-head { display:block; padding:20px; }
  .range-pill { display:inline-flex; margin-top:12px; }
  .gantt-axis { margin-left:20px; overflow:hidden; }
  .gantt-grid { overflow-x:hidden; padding:8px 20px 20px; }
  .gantt-row { min-width:0; grid-template-columns:1fr; }
  .track { min-width:0; }
  .editor { padding:20px; }
  .field { grid-template-columns:1fr; align-items:start; }
  .actions,.auth-split { grid-template-columns:1fr; }
  .matrix { overflow-x:auto; }
  th,td { overflow-wrap:anywhere; }
  .progress-cell { min-width:310px; max-width:none; }
  .progress-step { grid-template-columns:1fr; gap:4px; padding:9px 0; }
  .item-card { padding:18px; }
  .item-top { display:block; }
  .facts { grid-template-columns:1fr; }
  .purpose-row { grid-template-columns:1fr; }
  .purpose-term { border-right:0; border-bottom:1px solid #edf1ed; }
  .report-card { grid-template-columns:1fr; }
  .report-actions { justify-content:stretch; display:grid; grid-template-columns:1fr 1fr; }
  .audit-row { grid-template-columns:1fr; gap:2px; }
}
