* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: #f1f5f9;
  color: #0f172a;
  line-height: 1.45;
}
#login-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
}
html.signed-in #login-screen { display: none; }
html:not(.signed-in) header,
html:not(.signed-in) main,
html:not(.signed-in) footer,
html:not(.signed-in) #scroll-top-btn,
html:not(.signed-in) #workbook-loading {
  display: none;
}
.login-card {
  width: min(100%, 22rem);
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  background: #fff;
  color: #0f172a;
  border-radius: 12px;
  padding: 1.35rem 1.25rem 1.2rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
}
.login-card h1 { margin: 0; font-size: 1.35rem; }
.login-card .hint { margin: 0; }
.login-card label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
}
.login-card input {
  padding: 0.7rem 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 400;
  color: #111827;
  background: #fff;
}
.login-error { margin: 0; color: #b91c1c; font-size: 0.85rem; font-weight: 600; }
header {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
  color: #fff;
  padding: 0.45rem 1.25rem;
}
.panel-title { margin: 0 0 0.5rem; font-size: 1.2rem; }
.panel-files .loaders { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.75rem; }
.loaders { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.75rem; }
.file-btn {
  display: inline-block;
  background: #2563eb;
  color: #fff;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
}
.file-btn.secondary { background: #475569; }
.file-btn input { display: none; }
.file-btn.loaded { background: #059669; }
.file-btn.linked { box-shadow: 0 0 0 2px #34d399; }
.panel-files .link-btn { border: 1px dashed #94a3b8; background: #f8fafc; color: #0f172a; }
.panel-files .link-btn.linked-active { background: #047857; color: #fff; border-style: solid; border-color: #047857; }
.link-hint { font-size: 0.85rem; margin: 0 0 0.75rem; color: #64748b; max-width: 52rem; }
.data-status-line {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.panel-files .freshness-panel { margin-top: 0; }
.panel-files .freshness-panel.hidden { display: none; }
.panel-files .freshness-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.panel-files .freshness-card.freshness-warn { border-color: #f59e0b; background: #fffbeb; }
.panel-files .freshness-note { color: #64748b; }
#tabs button[data-alert]::after {
  content: " ●";
  color: #fbbf24;
  font-weight: 700;
}
.update-banner {
  background: #fef3c7;
  color: #78350f;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.update-banner.hidden { display: none; }
.update-banner strong { color: #92400e; }
.update-banner .banner-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-left: auto; }
.update-banner button {
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 600;
}
.update-banner .reload-now { background: #b45309; color: #fff; }
.update-banner .dismiss-banner { background: rgba(0,0,0,0.08); color: #78350f; }
.workbook-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.5);
  padding: 1rem;
}
.workbook-loading-overlay.hidden { display: none; }
.workbook-loading-box {
  background: #fff;
  color: #0f172a;
  border-radius: 12px;
  padding: 1.35rem 1.6rem;
  width: min(28rem, 92vw);
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}
.workbook-loading-spinner {
  width: 2.15rem;
  height: 2.15rem;
  margin: 0 auto 0.85rem;
  border: 3px solid #e2e8f0;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: workbook-spin 0.75s linear infinite;
}
@keyframes workbook-spin {
  to { transform: rotate(360deg); }
}
.workbook-loading-msg {
  margin: 0 0 0.4rem;
  font-weight: 600;
  font-size: 1rem;
}
body.workbook-loading { cursor: wait; }
.freshness-card {
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.5rem;
  font-size: 0.82rem;
}
.freshness-card ul { margin: 0.35rem 0 0; padding-left: 1.1rem; }
.freshness-card li { margin-bottom: 0.2rem; }
.freshness-label { opacity: 0.85; }
.freshness-note { margin: 0.5rem 0 0; font-size: 0.78rem; opacity: 0.9; line-height: 1.35; }
.freshness-card em { opacity: 0.85; font-style: normal; }
.hint { font-size: 0.85rem; color: #64748b; margin: 0 0 0.75rem; }
#tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: flex-start; align-items: center; }
#tabs button {
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  padding: 0.45rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}
#tabs button.active { background: #fff; color: #0f172a; }
#tabs button:disabled { opacity: 0.4; cursor: not-allowed; }
#tabs button.tab-utility {
  background: rgba(255,255,255,0.08);
  font-size: 0.78rem;
  opacity: 0.82;
}
#tabs button[data-tab="files"] { margin-left: auto; }
#tabs button.tab-utility.active { background: #fff; color: #0f172a; opacity: 1; }
main { max-width: 1100px; margin: 0 auto; padding: 1rem 1.25rem 2rem; }
.panel { display: none; }
.panel.active { display: block; }
form { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; flex-wrap: wrap; align-items: center; }
input[type="search"],
input[type="text"],
input[type="date"],
input[type="number"] {
  color: #111827;
  background-color: #fff;
  caret-color: #111827;
  color-scheme: light;
}
input[type="search"]::placeholder,
input[type="text"]::placeholder,
input[type="number"]::placeholder {
  color: #6b7280;
  opacity: 1;
}
input[type="search"] {
  flex: 1;
  min-width: 220px;
  padding: 0.7rem 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 1rem;
}
button, .secondary-btn {
  padding: 0.7rem 1rem;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
}
.secondary-btn { background: #64748b; }
.card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.card h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-left: 0.25rem;
  vertical-align: middle;
}
.badge.blocked { background: #fef3c7; color: #92400e; }
.badge.ready { background: #d1fae5; color: #065f46; }
.badge.in_process { background: #dbeafe; color: #1e40af; }
.badge.not_started, .badge.open { background: #f1f5f9; color: #475569; }
.badge.complete { background: #d1fae5; color: #065f46; }
.badge.unknown { background: #fee2e2; color: #991b1b; }
.badge.waiting { background: #ffedd5; color: #c2410c; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  background: #fff;
}
th, td {
  border: 1px solid #e2e8f0;
  padding: 0.45rem 0.55rem;
  text-align: left;
}
th { background: #f8fafc; position: sticky; top: 0; z-index: 1; }
tr.row-complete { background: #ecfdf5; }
tr.row-in_progress { background: #eff6ff; }
tr.row-open { background: #fff; }
tr.row-waiting { background: #fff7ed; }
tr.upstream-done td { color: #065f46; }
tr.upstream-done .badge.complete { font-weight: 700; }
.upstream-summary { font-weight: 600; color: #334155 !important; }
.upstream-table .badge.complete { min-width: 5.5rem; text-align: center; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: #e0f2fe !important; }
.grid {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  margin-bottom: 1rem;
}
.grid button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.75rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.grid button:hover { border-color: #2563eb; }
.grid button.selected { border-color: #2563eb; background: #eff6ff; }
.suggestions {
  background: #fff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  max-height: 280px;
  overflow-y: auto;
}
.suggestions.hidden { display: none; }
#lookup-suggestions button.suggestion-item,
button.suggestion-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.85rem;
  border: none;
  border-radius: 0;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
  color: #0f172a;
  cursor: pointer;
  font: inherit;
  font-weight: 400;
}
#lookup-suggestions button.suggestion-item:hover,
#lookup-suggestions button.suggestion-item:focus,
button.suggestion-item:hover,
button.suggestion-item:focus {
  background: #eff6ff;
  color: #0f172a;
}
#lookup-suggestions button.suggestion-item strong,
button.suggestion-item strong {
  color: #0f172a;
}
#lookup-suggestions button.suggestion-item .meta,
button.suggestion-item .meta {
  font-size: 0.8rem;
  color: #475569;
  margin-top: 0.15rem;
}
.waiting-list { margin: 0; padding-left: 1.1rem; }
.waiting-list li { margin-bottom: 0.35rem; }
.mos-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.5rem 0; }
.mos-chips button {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #7dd3fc;
  border-radius: 6px;
  cursor: pointer;
}
.mos-chips button:hover { background: #bae6fd; }
.detail-header { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.detail-header strong { font-size: 1.15rem; }
.back-btn {
  background: transparent;
  color: #2563eb;
  border: 1px solid #2563eb;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}
.error { color: #b91c1c; background: #fef2f2; padding: 0.75rem; border-radius: 8px; }
.warn { color: #92400e; background: #fffbeb; padding: 0.75rem; border-radius: 8px; margin-bottom: 0.75rem; }
footer {
  text-align: center;
  font-size: 0.8rem;
  color: #64748b;
  padding: 1rem;
  border-top: 1px solid #e2e8f0;
}
footer #system-updated { margin: 0; }
footer .app-version { margin: 0.35rem 0 0; font-size: 0.72rem; opacity: 0.85; }
.schedule-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}
.schedule-form label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; font-weight: 600; color: #475569; }
.schedule-form select {
  min-width: 200px;
  padding: 0.55rem 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.95rem;
  color: #0f172a;
  background-color: #fff;
  color-scheme: light;
}
.lookup-q-label {
  flex: 1 1 16rem;
  min-width: 14rem;
}
#lookup-print-mode,
#escape-print-mode { min-width: 16rem; }
.lookup-form #lookup-q.lookup-q-input,
.lookup-form #escape-q.lookup-q-input,
#lookup-q.lookup-q-input,
#escape-q.lookup-q-input,
#lookup-q.lookup-q-input:focus,
#escape-q.lookup-q-input:focus,
#lookup-q.lookup-q-input:hover,
#escape-q.lookup-q-input:hover,
#lookup-q.lookup-q-input:active,
#escape-q.lookup-q-input:active {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.25;
  padding: 0.55rem 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  opacity: 1 !important;
  color: #0f172a !important;
  background-color: #fff !important;
  background-image: none !important;
  caret-color: #0f172a !important;
  color-scheme: light;
}
.lookup-form button[type="submit"] {
  padding: 0.55rem 1rem;
  font-size: 0.95rem;
}
.lookup-form #lookup-q.lookup-q-input::placeholder,
.lookup-form #escape-q.lookup-q-input::placeholder,
#lookup-q.lookup-q-input::placeholder,
#escape-q.lookup-q-input::placeholder {
  color: #64748b !important;
  opacity: 1 !important;
}
#lookup-q.lookup-q-input:-webkit-autofill,
#escape-q.lookup-q-input:-webkit-autofill,
#lookup-q.lookup-q-input:-webkit-autofill:hover,
#escape-q.lookup-q-input:-webkit-autofill:hover,
#lookup-q.lookup-q-input:-webkit-autofill:focus,
#escape-q.lookup-q-input:-webkit-autofill:focus {
  -webkit-text-fill-color: #0f172a !important;
  caret-color: #0f172a !important;
  box-shadow: inset 0 0 0 1px #ffffff;
}
.lookup-date-range {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: flex-end;
}
.lookup-date-range.hidden { display: none; }
#lookup-print-batch-wrap.hidden,
#escape-print-batch-wrap.hidden { display: none; }
.lookup-date-field {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.lookup-date-range input[type="text"] {
  width: 7.5rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.95rem;
  color: #0f172a;
  background: #fff;
}
.lookup-cal-btn {
  padding: 0.4rem 0.45rem;
  background: #e2e8f0;
  color: #0f172a;
  font-size: 0.95rem;
  line-height: 1;
  min-width: 0;
}
.lookup-cal-btn:hover { background: #cbd5e1; }
.lookup-cal-pop {
  position: fixed;
  z-index: 95;
  width: 15.5rem;
  padding: 0.5rem;
  background: #fff;
  color: #0f172a;
  border: 1px solid #94a3b8;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.2);
}
.lookup-cal-pop.hidden { display: none; }
.lookup-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}
.lookup-cal-nav button {
  padding: 0.2rem 0.5rem;
  background: #e2e8f0;
  color: #0f172a;
  font-size: 0.85rem;
}
.lookup-cal-title { font-size: 0.85rem; font-weight: 700; }
.lookup-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.lookup-cal-grid span,
.lookup-cal-grid button {
  padding: 0.28rem 0;
  text-align: center;
  font-size: 0.72rem;
  background: transparent;
  color: #0f172a;
  border-radius: 4px;
}
.lookup-cal-grid span { font-weight: 700; color: #64748b; }
.lookup-cal-grid button:hover { background: #e0f2fe; }
.lookup-cal-grid button.is-today { outline: 1px solid #2563eb; }
.lookup-cal-grid button.is-selected { background: #2563eb; color: #fff; }
.lookup-cal-grid button.muted { color: #94a3b8; }
.lookup-so-modal {
  position: fixed;
  inset: 0;
  z-index: 96;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 5rem 1rem 1rem;
}
.lookup-so-modal.hidden { display: none; }
.lookup-so-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
}
.lookup-so-modal-box {
  position: relative;
  width: min(22rem, 100%);
  background: #fff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.2);
}
.lookup-so-modal-box input {
  width: 100%;
  margin: 0.5rem 0 0.75rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #0f172a;
  background: #fff;
}
.lookup-so-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
}
.table-wrap.lookup-table-wrap { max-height: min(70vh, 720px); }
.table-wrap.escape-order-wrap { max-height: none; overflow: visible; border: none; }
.escape-order-table { width: 100%; }
.escape-order-row td { cursor: pointer; }
.escape-order-row.is-open { background: #eff6ff; }
.escape-order-caret { width: 1.5rem; color: #64748b; text-align: center; }
.escape-order-detail > td { background: #f8fafc; padding: 0.75rem; }
.escape-note-th, .escape-note-cell { min-width: 16rem; vertical-align: top; }
.escape-note-log { max-height: 7.5rem; overflow: auto; margin-bottom: 0.35rem; }
.escape-note-entry { margin: 0 0 0.4rem; color: #0f172a; font-size: 0.82rem; white-space: pre-wrap; }
.escape-note-when { display: block; color: #64748b; font-size: 0.72rem; }
.escape-note-empty { margin: 0 0 0.35rem; }
.escape-note-form { display: flex; flex-direction: column; gap: 0.35rem; align-items: stretch; }
.escape-note-input {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 0.85rem;
  color: #0f172a;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.35rem 0.45rem;
  resize: vertical;
}
body:has(#panel-escape.active) main { max-width: 1440px; }
.lookup-scroll-sentinel { height: 1px; }
.lookup-th-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
}
.lookup-th-label { min-width: 0; }
.lookup-table .lookup-filter-btn {
  flex: 0 0 auto;
  padding: 0.05rem 0.3rem;
  min-width: 0;
  background: #e2e8f0;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 0.68rem;
  line-height: 1.2;
  font-weight: 700;
}
.lookup-table .lookup-filter-btn:hover { background: #cbd5e1; }
.lookup-table .lookup-filter-btn.active,
.lookup-th-filter.is-filtered .lookup-filter-btn {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
.lookup-filter-pop {
  position: fixed;
  z-index: 90;
  width: 16.5rem;
  max-height: 22rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.5rem;
  background: #fff;
  color: #111827;
  border: 1px solid #94a3b8;
  border-radius: 6px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.2);
}
.lookup-filter-pop.hidden { display: none; }
.lookup-filter-pop .lookup-filter-sort,
.lookup-filter-pop .lookup-filter-clear {
  display: block;
  width: 100%;
  text-align: left;
  background: #fff;
  color: #111827;
  padding: 0.35rem 0.5rem;
  font-size: 0.82rem;
  border: none;
  border-radius: 4px;
}
.lookup-filter-pop .lookup-filter-sort:hover,
.lookup-filter-pop .lookup-filter-clear:hover { background: #f1f5f9; }
.lookup-filter-pop input[type="text"] {
  width: 100%;
  padding: 0.35rem 0.45rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  color: #111827;
  background: #fff;
  font-size: 0.82rem;
}
.lookup-filter-values {
  overflow: auto;
  max-height: 11rem;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 0.25rem 0.4rem;
  font-size: 0.78rem;
}
.lookup-filter-values label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
  color: #111827;
  padding: 0.12rem 0;
}
.lookup-filter-pop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.35rem;
}
.lookup-filter-pop-actions button {
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
}
.scroll-top-btn {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 40;
  padding: 0.65rem 1.15rem;
  background: #0f172a;
  color: #fff;
  border: none;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.28);
}
.scroll-top-btn:hover { background: #1e293b; }
.week-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.week-label { font-weight: 600; color: #0f172a; margin-left: 0.35rem; font-size: 0.95rem; }
.schedule-check { flex-direction: row !important; align-items: center; font-weight: 500 !important; }
.schedule-check input { margin-right: 0.35rem; }
.schedule-output { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 1rem 1.25rem; }
.optimize-diagnostics { margin-bottom: 1rem; }
.optimize-diagnostics h3 { margin: 0 0 0.5rem; font-size: 0.95rem; }
.optimize-reason { font-size: 0.8rem; color: #64748b; max-width: 28rem; white-space: normal; }
.optimize-summary { margin-bottom: 1rem; }
.optimize-batch { margin-bottom: 1.25rem; }
.optimize-batch h4 { margin: 0.75rem 0 0.35rem; font-size: 0.9rem; color: #334155; }
.optimize-batch-meta { font-weight: 500; font-size: 0.85rem; color: #64748b; }
.optimize-singletons,
.optimize-nopick { margin-top: 1rem; }
.optimize-singletons summary,
.optimize-nopick summary { cursor: pointer; font-weight: 600; }
.optimize-pick-table .num { text-align: right; }
.optimize-mo-barcode-cell { width: 2.15in; vertical-align: middle; }
.optimize-mo-barcode {
  display: block;
  width: 2.05in;
  max-width: 100%;
  height: auto;
}
.optimize-mo-barcode-ph {
  font-family: monospace;
  font-size: 0.75rem;
  font-weight: 700;
}
.table-wrap.optimize-table-wrap { max-height: none; overflow: visible; }
.optimize-print-area { display: none; }
.optimize-print-area.hidden { display: none; }
.lookup-table-print { display: none; }
.lookup-table-print.hidden { display: none; }
.report-print-area { display: none; }
.report-print-area.hidden { display: none; }
body.printing-optimize .optimize-toolbar,
body.printing-optimize #optimize-output { display: none !important; }
body.printing-optimize .optimize-print-area,
body.printing-lookup-table .lookup-table-print {
  display: block !important;
  padding: 0;
}
body.printing-optimize .optimize-print-header {
  border-bottom: 2px solid #0f172a;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
}
body.printing-optimize .optimize-print-batch {
  margin-bottom: 1.25rem;
}
body.printing-optimize .optimize-batch-pick-page {
  break-inside: avoid;
  page-break-inside: avoid;
  page-break-after: always;
  break-after: page;
}
body.printing-optimize .optimize-batch-run-page {
  break-inside: auto;
  page-break-inside: auto;
}
.schedule-traveler-print { display: none; }
.schedule-traveler-print.hidden { display: none; }
body.printing-travelers .schedule-output { display: none !important; }
body.printing-travelers .schedule-traveler-print {
  display: block !important;
}
.traveler-page {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.5rem;
  border: 1px solid #cbd5e1;
  background: #fff;
  min-height: 11in;
}
.traveler-sheet-top {
  flex: 1 1 50%;
  padding: 0.2in 0.25in 0.15in;
  overflow: hidden;
  font-size: 7.5pt;
  line-height: 1.25;
}
.traveler-sheet-bottom {
  flex: 0 0 50%;
  border-top: 2px solid #0f172a;
  padding: 0.1in;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 0;
}
.traveler-rpt-topline {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 0.25rem;
  margin-bottom: 0.12in;
  font-size: 7pt;
}
.traveler-rpt-topline > :first-child { justify-self: start; }
.traveler-rpt-topline > :last-child { justify-self: end; text-align: right; }
.traveler-rpt-title-block { text-align: center; }
.traveler-rpt-title {
  font-size: 12pt;
  letter-spacing: 0.02em;
}
.traveler-mo-band {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.2in;
  margin-bottom: 0.1in;
}
.traveler-mo-left { flex: 1; min-width: 0; }
.traveler-mo-right { flex-shrink: 0; text-align: right; padding-top: 0.05in; }
.traveler-field-label {
  font-weight: 600;
  font-size: 7pt;
  margin-bottom: 0.04in;
}
.traveler-mo-barcode {
  display: block;
  width: 2.8in;
  max-width: 100%;
  min-height: 0.85in;
  height: auto;
}
.traveler-mo-barcode-ph {
  font-family: monospace;
  font-size: 10pt;
  font-weight: 700;
  padding: 0.15in 0;
}
.traveler-due { margin-bottom: 0.06in; }
.traveler-due strong { font-size: 10pt; }
.traveler-meta-grid {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0.08in;
}
.traveler-meta-grid td {
  padding: 0.03in 0.08in 0.03in 0;
  vertical-align: top;
  border: none;
  background: transparent;
}
.traveler-meta-grid td.lbl {
  font-weight: 600;
  white-space: nowrap;
  width: 1.1in;
}
.traveler-meta-grid td.num { text-align: right; width: 0.7in; }
.traveler-summary-box {
  display: flex;
  justify-content: space-between;
  gap: 0.15in;
  border: 1px solid #334155;
  padding: 0.05in 0.1in;
  margin-bottom: 0.1in;
  font-size: 7pt;
}
.traveler-section-title {
  margin: 0.08in 0 0.04in;
  font-size: 8pt;
  font-weight: 700;
  text-transform: none;
}
.traveler-wait-title {
  color: #9a3412;
  border-left: 3px solid #ea580c;
  padding-left: 0.08in;
}
.traveler-wait-table th {
  background: #ffedd5 !important;
}
.traveler-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 6.5pt;
  margin-bottom: 0.08in;
}
.traveler-data-table th,
.traveler-data-table td {
  border: 1px solid #64748b;
  padding: 0.02in 0.04in;
  vertical-align: top;
}
.traveler-data-table th {
  background: #e2e8f0;
  font-weight: 700;
  text-align: left;
}
.traveler-data-table td.num { text-align: right; }
.traveler-pick-desc td {
  font-style: italic;
  border-top: none;
  padding-top: 0;
}
.traveler-pick-row td { border-bottom: none; }

.traveler-pick-ref {
  font-size: 7pt;
  color: #444;
  margin: 0 0 0.08in;
  font-style: italic;
}

.traveler-page-pick-only {
  display: block;
  min-height: auto;
}
.traveler-pick-sheet {
  padding: 0.2in 0.25in;
  font-size: 8pt;
  line-height: 1.3;
}
.traveler-pick-continued {
  font-size: 8pt;
  color: #555;
  margin: 0.12in 0 0;
  font-style: italic;
}

.traveler-pick-shrink-3 .traveler-pick-table th,
.traveler-pick-shrink-3 .traveler-pick-table td {
  font-size: 6pt;
  padding: 0.015in 0.03in;
  line-height: 1.1;
}
.traveler-pick-shrink-3 .traveler-section-title {
  margin: 0.05in 0 0.03in;
  font-size: 7pt;
}

.traveler-pick-shrink-5 .traveler-pick-table th,
.traveler-pick-shrink-5 .traveler-pick-table td {
  font-size: 5.5pt;
  padding: 0.01in 0.025in;
  line-height: 1.05;
}
.traveler-pick-shrink-5 .traveler-section-title {
  margin: 0.04in 0 0.02in;
  font-size: 6.5pt;
}

.traveler-pick-shrink-7 .traveler-pick-table th,
.traveler-pick-shrink-7 .traveler-pick-table td {
  font-size: 5pt;
  padding: 0.008in 0.02in;
  line-height: 1;
}
.traveler-pick-shrink-7 .traveler-section-title {
  margin: 0.03in 0 0.015in;
  font-size: 6pt;
}

.traveler-pull-line,
td.pull-line {
  min-width: 0.55in;
  border-bottom: 1px solid #334155 !important;
}
.traveler-route-signoff td {
  border: none;
  padding: 0.03in 0.04in 0.06in;
  font-size: 6.5pt;
}
.traveler-empty-note {
  font-style: italic;
  color: #64748b;
  text-align: center;
}
.traveler-drawing-wrap {
  width: 100%;
  height: 100%;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
.traveler-drawing {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.traveler-missing {
  border: 1px dashed #94a3b8;
  padding: 1rem;
  color: #64748b;
  text-align: center;
  font-size: 0.85rem;
}
.traveler-loading {
  padding: 1rem;
  color: #475569;
  font-style: italic;
}

.schedule-print-header {
  border-bottom: 2px solid #0f172a;
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
}
.schedule-print-header h2 { margin: 0 0 0.35rem; font-size: 1.35rem; }
.schedule-print-header .sub { margin: 0; font-size: 0.88rem; color: #475569; }
.schedule-day { margin-bottom: 1.25rem; }
.schedule-day h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  background: #f1f5f9;
  padding: 0.35rem 0.5rem;
  border-left: 4px solid #2563eb;
}
.schedule-day.empty-day h3 { border-left-color: #94a3b8; opacity: 0.85; }
.schedule-table { font-size: 0.8rem; }
.schedule-table th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.02em; }
.schedule-table .col-pick { width: 2.25rem; text-align: center; }
.lookup-table .col-pick.lookup-pick-th { width: 3.1rem; vertical-align: middle; }
.col-printed { width: 4.2rem; text-align: center; white-space: nowrap; }
.print-search-row { cursor: pointer; }
.printed-mark.is-printed { color: #059669; font-weight: 700; }
.detail-printed { margin-left: 0.5rem; font-size: 0.85rem; font-weight: 600; color: #334155; }
.lookup-pick-all-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12rem;
  cursor: pointer;
  color: #0f172a;
  -webkit-text-fill-color: #0f172a;
  user-select: none;
}
.lookup-pick-all-wrap .lookup-pick-all-text {
  color: #0f172a;
  -webkit-text-fill-color: #0f172a;
  line-height: 1;
}
.lookup-pick-all-wrap .lookup-pick-all {
  accent-color: #2563eb;
}
.schedule-table .schedule-pick-cb {
  width: 1rem;
  height: 1rem;
  margin: 0;
  vertical-align: middle;
  cursor: pointer;
  accent-color: #2563eb;
}
.schedule-table tr.row-complete td { color: #64748b; }
.schedule-summary { font-size: 0.85rem; color: #64748b; margin: 0 0 0.75rem; }
.schedule-backlog { margin-top: 1.5rem; padding-top: 0.75rem; border-top: 1px dashed #cbd5e1; }
.schedule-mo-row.clickable { cursor: pointer; }
.schedule-mo-row.clickable:hover { background: #e0f2fe !important; }
.schedule-mo-row.selected { outline: 2px solid #2563eb; outline-offset: -2px; }
.schedule-wait-col { font-size: 0.78rem; max-width: 14rem; }
.schedule-hours-col { white-space: nowrap; font-variant-numeric: tabular-nums; }
.schedule-job-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.schedule-job-modal.hidden { display: none; }
.schedule-job-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}
.schedule-job-modal-box {
  position: relative;
  background: #fff;
  border-radius: 10px;
  width: min(920px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  overflow: hidden;
}
.schedule-job-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.schedule-job-modal-x {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
  padding: 0 0.35rem;
}
.schedule-job-modal-body {
  flex: 1;
  overflow: auto;
  padding: 0.75rem 1rem;
  min-height: 200px;
}
.schedule-job-modal-footer {
  display: flex;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border-top: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.schedule-check.is-disabled { opacity: 0.55; }
.wc-mo-row.clickable { cursor: pointer; }
.wc-mo-row.clickable:hover { background: #e0f2fe !important; }
#panel-workcenters .escape-note-cell { min-width: 14rem; }
.wc-mo-row.selected { outline: 2px solid #2563eb; outline-offset: -2px; }
.wc-queue-summary { margin: 0.5rem 0 0; font-size: 0.9rem; color: #475569; }
.pdf-dir-loaders { margin-top: 0.5rem; }
.part-pdf-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: #2563eb;
  cursor: pointer;
  text-decoration: underline;
  font-weight: 600;
}
.part-pdf-link:hover { color: #1d4ed8; }
.part-with-inv { white-space: nowrap; }
.inv-chip {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  font-size: 0.68rem;
  font-weight: 600;
  border-radius: 4px;
  background: #e0f2fe;
  color: #0369a1;
  vertical-align: middle;
}
.inv-chip.inv-short, .inv-short, .inv-cell.inv-short { color: #b91c1c; background: #fee2e2; }
.inv-chip.inv-short { background: #fee2e2; }
.inv-detail { font-size: 0.88rem; }
.inv-title { margin: 0 0 0.4rem; }
.inv-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.85rem;
}
.inv-card h3, .kit-bom-card h3 { margin: 0 0 0.5rem; font-size: 0.95rem; }
.inv-open-mo { background: #f8fafc; }
.inv-open-mo p { margin: 0; font-size: 0.88rem; }
.inv-components-table { font-size: 0.82rem; }
.inv-cell { font-size: 0.78rem; white-space: nowrap; }
.oh-search-panel {
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.oh-search-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}
.oh-search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 0.75rem;
}
.oh-search-form input[type="search"] {
  flex: 1 1 14rem;
  min-width: 0;
}
.oh-search-table { font-size: 0.84rem; }
.buy-sell-ytd { margin-top: 0.35rem; }
.pdf-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
}
.pdf-modal.hidden { display: none; }
.pdf-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}
.pdf-modal-box {
  position: relative;
  background: #fff;
  border-radius: 10px;
  width: 96vw;
  height: 92vh;
  max-width: 96vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  overflow: hidden;
}
.pdf-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}
.pdf-modal-x {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
  padding: 0 0.35rem;
}
#pdf-modal-frame {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: #f1f5f9;
}
#pdf-modal-frame.pdf-modal-frame-hidden { display: none; }
.pdf-modal-message {
  margin: 0;
  padding: 2rem 1.25rem;
  font-size: 1rem;
  line-height: 1.45;
  color: #334155;
}
.pdf-modal-message.hidden { display: none; }
#pdf-modal-print.hidden { display: none; }
.pdf-modal-footer {
  display: flex;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border-top: 1px solid #e2e8f0;
}

.hours-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
  margin-bottom: 0.75rem;
}
.hours-controls label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
}
.hours-controls select {
  min-width: 200px;
  padding: 0.55rem 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.95rem;
}
.hours-controls .analytics-date-field #analytics-day {
  width: 7.5rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.95rem;
  color: #0f172a;
  background: #fff;
}
.hours-controls #analytics-day-all.is-selected {
  background: #2563eb;
  color: #fff;
}
.hours-controls .week-nav { align-self: flex-end; }
.hours-controls #hours-view { min-width: 12rem; }
.hours-summary { margin-bottom: 0.75rem; }
.hours-summary .card { text-align: center; padding: 0.65rem; font-size: 0.85rem; }
.hours-summary strong { font-size: 1.15rem; display: block; }
.hours-meta { font-size: 0.85rem; color: #64748b; margin: 0 0 0.5rem; }
.table-wrap.hours-table-wrap { max-height: none; overflow: visible; }
.hours-table th.hours-sort { cursor: pointer; user-select: none; }
.hours-table th.hours-sort:hover { background: #e2e8f0; }
.hours-table tr.hours-row.row-overloaded { background: #fef2f2; }
.hours-table tr.hours-row.row-tight { background: #fffbeb; }
.hours-table tr.hours-row.row-ok { background: #fff; }
.hours-table tr.hours-totals { background: #f1f5f9; font-weight: 600; }
.hours-left.negative { color: #b91c1c; }
.hours-bar {
  display: flex;
  width: 100%;
  min-width: 88px;
  height: 12px;
  border-radius: 4px;
  overflow: hidden;
  background: #e2e8f0;
}
.hours-bar-sched { background: #2563eb; }
.hours-bar-sched.over { background: #dc2626; }
.hours-bar-remain { background: #bbf7d0; }
.hours-bar-na { color: #94a3b8; font-size: 0.75rem; }
.hours-table td.hours-completed { color: #047857; }

/* Analytics tab */
.analytics-section-title { margin: 1.1rem 0 0.4rem; font-size: 1rem; }
.table-wrap.analytics-table-wrap { max-height: 420px; overflow: auto; }
.analytics-summary .card strong { color: #0f172a; }
.analytics-bar {
  width: 100%;
  min-width: 90px;
  height: 12px;
  border-radius: 4px;
  overflow: hidden;
  background: #e2e8f0;
}
.analytics-bar-fill { height: 100%; background: #2563eb; }
.hours-capacity {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.5rem 0.85rem;
  margin-bottom: 0.75rem;
}
.hours-capacity > summary {
  cursor: pointer;
  font-weight: 600;
  color: #334155;
  font-size: 0.9rem;
}
.hours-capacity .hint { margin: 0.5rem 0 0.75rem; }
.hours-capacity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
}
.hours-capacity-field {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
}
.hours-capacity-field.custom { color: #1d4ed8; }
.hours-capacity-field input {
  padding: 0.4rem 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.9rem;
}
.hours-capacity-field.custom input { border-color: #93c5fd; background: #eff6ff; }

@media print {
  @page { size: landscape; margin: 0.45in; }
  body { background: #fff; color: #000; font-size: 9pt; }
  header, footer, .no-print, #tabs, #panel-files, .update-banner, .workbook-loading-overlay, #login-screen,
  .schedule-job-modal, .pdf-modal, .history-timeline-modal,
  .lookup-filter-pop, .lookup-cal-pop, .lookup-so-modal, .scroll-top-btn { display: none !important; }
  tr.schedule-print-skip { display: none !important; }
  main { max-width: none; padding: 0; }
  .panel { display: none !important; }
  #panel-schedule.panel.active,
  #panel-optimize.panel.active,
  #panel-hours.panel.active,
  #panel-analytics.panel.active,
  #panel-history.panel.active { display: block !important; }
  body.printing-report header,
  body.printing-report footer,
  body.printing-report #tabs,
  body.printing-report .panel,
  body.printing-report #panel-schedule.panel.active,
  body.printing-report #panel-optimize.panel.active,
  body.printing-report #panel-hours.panel.active,
  body.printing-report #panel-history.panel.active,
  body.printing-report #panel-analytics.panel.active { display: none !important; }
  body.printing-report .report-print-area {
    display: block !important;
    border: none;
    padding: 0;
  }
  .table-wrap.history-table-wrap,
  .table-wrap.analytics-table-wrap,
  .table-wrap.report-print-table-wrap {
    max-height: none !important;
    overflow: visible !important;
    height: auto !important;
    border: none;
  }
  #panel-history th,
  #panel-analytics th,
  body.printing-report th { position: static !important; }
  body.printing-report .analytics-bar-fill {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  body.printing-optimize header,
  body.printing-optimize footer,
  body.printing-optimize #tabs,
  body.printing-optimize .panel,
  body.printing-optimize #panel-schedule.panel.active,
  body.printing-optimize #panel-optimize.panel.active,
  body.printing-optimize #panel-hours.panel.active,
  body.printing-optimize #panel-history.panel.active,
  body.printing-optimize #panel-analytics.panel.active { display: none !important; }
  body.printing-optimize .optimize-print-area {
    display: block !important;
    border: none;
    padding: 0;
  }
  body.printing-lookup-table header,
  body.printing-lookup-table footer,
  body.printing-lookup-table #tabs,
  body.printing-lookup-table .panel,
  body.printing-lookup-table #panel-schedule.panel.active,
  body.printing-lookup-table #panel-optimize.panel.active,
  body.printing-lookup-table #panel-hours.panel.active,
  body.printing-lookup-table #panel-history.panel.active,
  body.printing-lookup-table #panel-analytics.panel.active { display: none !important; }
  body.printing-lookup-table .lookup-table-print {
    display: block !important;
    border: none;
    padding: 0;
  }
  .table-wrap.lookup-print-table-wrap {
    max-height: none !important;
    overflow: visible !important;
    height: auto !important;
    border: none;
  }
  body.printing-lookup-table th { position: static !important; }
  .schedule-output { border: none; padding: 0; }
  .schedule-day { break-inside: avoid; page-break-inside: avoid; margin-bottom: 0.65rem; }
  .schedule-day h3 { background: #eee; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  tr { break-inside: avoid; }
  .badge { border: 1px solid #999; }

  /* Hours report: table-wrap caps height + overflow:auto clip to scroll position when printing */
  .table-wrap.hours-table-wrap {
    max-height: none !important;
    overflow: visible !important;
    height: auto !important;
  }
  #panel-hours th { position: static !important; }

  /* Optimize batch: same scroll-clip fix + pick list on page 1 */
  .table-wrap.optimize-table-wrap {
    max-height: none !important;
    overflow: visible !important;
    height: auto !important;
  }
  #panel-optimize th,
  body.printing-optimize th { position: static !important; }
  #optimize-output .optimize-batch-pick-page,
  body.printing-optimize .optimize-batch-pick-page {
    page-break-after: always;
    break-after: page;
  }
  body.printing-optimize .optimize-mo-barcode,
  #optimize-output .optimize-mo-barcode {
    width: 2.05in !important;
    min-height: 0.65in;
  }

  body.printing-travelers {
    font-size: 10pt;
  }
  body.printing-travelers header,
  body.printing-travelers footer,
  body.printing-travelers #tabs,
  body.printing-travelers .panel,
  body.printing-travelers .no-print,
  body.printing-travelers .lookup-so-modal,
  body.printing-travelers .lookup-cal-pop { display: none !important; }
  body.printing-travelers .schedule-output { display: none !important; }
  body.printing-travelers .schedule-traveler-print {
    display: block !important;
    border: none;
    padding: 0;
  }
  body.printing-travelers .traveler-page {
    break-inside: avoid;
    page-break-inside: avoid;
    page-break-after: always;
    break-after: page;
    margin: 0;
    padding: 0;
    border: none;
    min-height: 10.2in;
    height: 10.2in;
    max-height: 10.2in;
  }
  body.printing-travelers .traveler-page:last-child {
    page-break-after: auto;
    break-after: auto;
  }
  body.printing-travelers .traveler-sheet-top {
    flex: 0 0 50%;
    max-height: 50%;
    padding: 0.12in 0.18in 0.08in;
    font-size: 6.5pt;
  }
  body.printing-travelers .traveler-sheet-bottom {
    flex: 0 0 50%;
    max-height: 50%;
    padding: 0.06in;
  }
  body.printing-travelers .traveler-mo-barcode {
    width: 2.6in !important;
    min-height: 0.8in;
  }
  body.printing-travelers .traveler-data-table th {
    background: #ddd !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  body.printing-travelers .traveler-wait-table th {
    background: #ffedd5 !important;
  }
  body.printing-travelers .traveler-meta-grid td {
    background: transparent !important;
  }
  body.printing-travelers .traveler-drawing {
    max-width: 100%;
    max-height: 4.9in;
    object-fit: contain;
  }

  body.printing-travelers .traveler-page-pick-only {
    display: block;
    height: auto;
    max-height: none;
    min-height: 10.2in;
  }
  body.printing-travelers .traveler-page-pick-only .traveler-pick-sheet {
    padding: 0.15in 0.2in;
  }
  body.printing-travelers .traveler-page-pick-only .traveler-pick-table th,
  body.printing-travelers .traveler-page-pick-only .traveler-pick-table td {
    font-size: 7.5pt;
    padding: 0.03in 0.05in;
    line-height: 1.2;
  }
  body.printing-travelers .traveler-pick-ref {
    font-size: 6.5pt;
    margin-bottom: 0.06in;
  }
}

@page portrait-traveler {
  size: portrait;
  margin: 0.4in;
}

@media print {
  body.printing-travelers {
    page: portrait-traveler;
  }
}

.table-wrap { max-height: 480px; overflow: auto; border: 1px solid #e2e8f0; border-radius: 8px; margin-top: 0.5rem; }
.progress-bar {
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  margin: 0.5rem 0;
  max-width: 240px;
}
.progress-bar span {
  display: block;
  height: 100%;
  background: #059669;
}

/* Setup tab */
.setup-data-hint {
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  background: #eff6ff;
  border-color: #93c5fd;
}
.setup-tab-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: #2563eb;
  cursor: pointer;
  text-decoration: underline;
}
.setup-tab-link:hover { color: #1d4ed8; }
.panel-setup .setup-progress {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.setup-progress-step {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  background: #e2e8f0;
  color: #64748b;
}
.setup-progress-step-active {
  box-shadow: 0 0 0 2px #2563eb;
  color: #0f172a;
}
.setup-progress-done { background: #d1fae5; color: #047857; }
.setup-progress-optional { background: #f1f5f9; color: #475569; }
.setup-progress-pending { background: #e2e8f0; color: #64748b; }
.setup-step-body { margin-bottom: 1rem; }
.setup-step-card h3 { margin: 0 0 0.5rem; font-size: 1.05rem; }
.setup-list { margin: 0.5rem 0 0; padding-left: 1.25rem; }
.setup-list li { margin-bottom: 0.35rem; }
.setup-checklist { list-style: none; margin: 0.75rem 0 0; padding: 0; }
.setup-checklist li {
  padding: 0.65rem 0;
  border-bottom: 1px solid #e2e8f0;
}
.setup-checklist li:last-child { border-bottom: none; }
.setup-check-done { background: #f0fdf4; margin: 0 -0.5rem; padding-left: 0.5rem !important; padding-right: 0.5rem !important; border-radius: 6px; }
.setup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  align-items: center;
}
.setup-actions-inline {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-left: 0.5rem;
}
.setup-action-load {
  display: inline-block;
  cursor: pointer;
}
.setup-action-load input { display: none; }
.setup-status-ok { color: #047857; font-weight: 600; margin: 0.5rem 0 0; }
.setup-data-folder {
  margin-top: 1rem;
  padding: 0.75rem 0.85rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.setup-data-folder h4 { margin: 0 0 0.35rem; font-size: 0.95rem; }
.setup-optional-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.setup-file-meta {
  margin: 0.45rem 0 0.35rem;
  padding: 0.5rem 0.65rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.88rem;
}
.setup-meta-row { margin-bottom: 0.25rem; }
.setup-meta-row:last-child { margin-bottom: 0; }
.setup-meta-label {
  display: inline-block;
  min-width: 6.5rem;
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.setup-filename { font-size: 0.85rem; word-break: break-all; }
.setup-meta-linked strong { color: #047857; }
.setup-meta-missing .hint { font-size: 0.88rem; }
.setup-workbook-actions { margin-top: 0.5rem; }
.setup-checklist .setup-workbook-actions { margin-top: 0.35rem; }
.setup-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.badge.ok { background: #d1fae5; color: #047857; }

.history-status-line { margin-top: 0.5rem; }
.history-share-chip {
  display: inline-block;
  margin: 0 0 0.75rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid #d97706;
  background: #fffbeb;
  color: #92400e;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}
.history-share-chip.hidden { display: none; }
.history-share-chip:hover { background: #fef3c7; }
.history-toolbar { margin: 0.5rem 0 0.75rem; }
.history-throughput-toolbar .hours-controls { margin-top: 0.35rem; }
.history-lookup-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.history-lookup-form input[type="search"] {
  flex: 1 1 16rem;
  min-width: 12rem;
  padding: 0.45rem 0.65rem;
}
.history-table { width: 100%; border-collapse: collapse; }
.history-table th, .history-table td { padding: 0.4rem 0.5rem; text-align: left; }
.history-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.history-timeline-item {
  padding: 0.45rem 0.55rem;
  border-left: 3px solid #94a3b8;
  margin: 0 0 0.45rem 0.2rem;
  background: #f8fafc;
}
.history-event-appeared { border-left-color: #2563eb; }
.history-event-closed { border-left-color: #059669; }
.history-event-reopened, .history-event-false_close { border-left-color: #d97706; }
.history-event-voided { opacity: 0.7; }
.history-review-card ul { margin: 0.35rem 0 0.65rem 1.1rem; }
#setup-history-pc-name {
  min-width: 12rem;
  padding: 0.3rem 0.45rem;
}
