[hidden] { display: none !important; }
.flush { margin-top: 0; }
.card { margin-bottom: 20px; }
.top-gap { margin-top: 12px; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 10px; }
.field { min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 4px; overflow-wrap: anywhere; }

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  max-width: 100%;
  white-space: normal;
  text-align: center;
}
button[disabled] { opacity: 0.45; cursor: not-allowed; }
input:not([type="file"]):not(.sr), select, textarea {
  min-height: 44px;
  min-width: 44px;
  max-width: 100%;
}

.manifest-head { display: flex; flex-direction: column; gap: 2px; margin: 6px 0 12px; min-width: 0; }
.rc-head { font-weight: 700; font-size: 18px; overflow-wrap: anywhere; }

.kpi-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 8px; margin: 12px 0 16px; }
.kpi-box { background: var(--chip); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.kpi-box span { display: block; overflow-wrap: anywhere; }
.kpi-val { display: block; font-family: var(--mono); font-size: 18px; margin-top: 2px; overflow-wrap: anywhere; }

.chart-wrap { margin: 12px 0 16px; }
.chart-h { margin: 0 0 8px; font-weight: 600; }
#chart svg { width: 100%; max-width: 100%; height: auto; display: block; border-radius: 8px; }
.bar-track { fill: var(--line); }
.seg-ontime { fill: #0b6e4f; }
.seg-late { fill: #b86b00; }
.seg-pending { fill: #5c6670; }
.seg-exc { fill: #b3361f; }
.seg-stroke { stroke: var(--surface); stroke-width: 1.5; }
@media (prefers-color-scheme: dark) {
  .seg-ontime { fill: #3fb98c; }
  .seg-late { fill: #e69d35; }
  .seg-pending { fill: #8b96a3; }
  .seg-exc { fill: #e0634c; }
}

.chart-legend { list-style: none; padding: 0; margin: 10px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 175px), 1fr)); gap: 8px; }
.chart-legend li { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 0; }
.swatch-svg { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 2px; display: block; }
.leg-text { min-width: 0; overflow-wrap: anywhere; }
.leg-name { font-weight: 600; display: block; }
.leg-val { display: block; font-family: var(--mono); color: var(--muted); }

.list { list-style: none; padding: 0; margin: 12px 0 0; }
.stop-list { display: flex; flex-direction: column; gap: 10px; }
.stop-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.stop-card.is-urgent { border-left: 4px solid var(--warn); }
.stop-card.is-done { border-left: 4px solid var(--accent); }
.stop-card.is-exc { border-left: 4px solid var(--warn); }

.stop-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; min-width: 0; }
.stop-title-wrap { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; flex: 1 1 180px; }
.stop-seq { font-family: var(--mono); font-weight: 700; font-size: 14px; color: var(--accent); }
.stop-title { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.stop-badges { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.pill.status-ontime { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.pill.status-late { border: 1px solid var(--warn); color: var(--warn); font-weight: 600; }
.pill.status-exc { border: 1px solid var(--warn); color: var(--warn); font-weight: 700; }
.pill.pri-urgent { border: 1px solid var(--warn); color: var(--warn); font-weight: 600; }

.stop-meta { font-size: 14px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; overflow-wrap: anywhere; }
.stop-window { font-family: var(--mono); font-weight: 600; color: var(--ink); }
.stop-outcome { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.stop-outcome.is-warn { color: var(--warn); }

.triage-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin-top: 4px;
  min-width: 0;
}

.archive-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.archive-grid li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.archive-grid .title { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.archive-grid .meta { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; line-height: 1.45; }
.archive-grid .arch-stats { font-family: var(--mono); font-size: 13px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; overflow-wrap: anywhere; }

.err-msg { color: var(--warn); font-weight: 600; margin: 10px 0; overflow-wrap: anywhere; }
.warn-box { background: var(--chip); border: 1px solid var(--warn); color: var(--warn); padding: 10px 12px; border-radius: 8px; overflow-wrap: anywhere; }
code { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }

@media print {
  .no-print, header.top, footer { display: none !important; }
  body { background: #fff; color: #000; }
  .wrap { padding: 0; max-width: 100%; }
  .card { border: 1px solid #ccc; margin-bottom: 12px; }
  .stop-card { background: #fff; border: 1px solid #bbb; break-inside: avoid; }
}
