:root {
  --bg: #eef3f7;
  --surface: #ffffff;
  --surface-2: #f7fafc;
  --surface-3: #e8eff4;
  --ink: #13293a;
  --muted: #6b7e8c;
  --line: #d6e0e7;
  --navy: #071c2d;
  --navy-2: #0b344b;
  --cyan: #2cb6bf;
  --run: #087a45;
  --run-dark: #045a32;
  --machine-stop: #e2870d;
  --machine-stop-dark: #9e4900;
  --stop: #b4212d;
  --stop-dark: #7e111a;
  --critical: #0d1014;
  --warning: #f2a93b;
  --long-wait: #d92d3b;
  --long-wait-dark: #8f1420;
  --long-wait-strong: #b71927;
  --long-wait-ink: #ffffff;
  --nav-production-accent: #0b6274;
  --nav-production-deep: #0a475d;
  --nav-production-label: #08687a;
  --nav-quality-accent: #6845a8;
  --nav-quality-deep: #47317d;
  --nav-quality-label: #55439f;
  --nav-management-accent: #8a4f0b;
  --nav-management-deep: #623706;
  --nav-management-label: #94500e;
  --shadow: 0 12px 32px rgba(14, 41, 59, 0.09);
  --radius: 16px;
  --account-warning-duration: 42s;
  --factory-layout-fit-height: 58dvh;
}

/* User permissions, audit history, and performance analytics */
.config-row-actions,.performance-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.user-access-card{grid-column:1/-1}.permission-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:14px 0}.permission-item{display:flex;gap:11px;align-items:flex-start;padding:13px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2)}.permission-item input{width:18px;height:18px;margin-top:2px;accent-color:var(--cyan)}.permission-item span{display:grid;gap:4px}.permission-item small{color:var(--muted);line-height:1.4}.user-activity-heading{display:flex;justify-content:space-between;gap:12px;align-items:flex-end;margin:22px 0 10px}.user-activity-heading>div:last-child{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.user-activity-heading input{min-height:38px;border:1px solid var(--line);border-radius:9px;background:var(--surface-2);color:var(--ink);padding:0 9px}.table-scroll{overflow:auto}.activity-table,.performance-table{width:100%;border-collapse:separate;border-spacing:0;font-size:12px}.activity-table th,.activity-table td,.performance-table th,.performance-table td{padding:10px 11px;border-bottom:1px solid var(--line);text-align:right;white-space:nowrap}.activity-table th:first-child,.activity-table td:first-child,.activity-table th:nth-child(2),.activity-table td:nth-child(2),.activity-table th:nth-child(3),.activity-table td:nth-child(3),.activity-table th:last-child,.activity-table td:last-child,.performance-table th:first-child,.performance-table td:first-child{text-align:left}.activity-table th,.performance-table th{position:sticky;top:0;background:var(--surface);color:var(--muted);z-index:1}.activity-table code{display:block;max-width:430px;overflow:hidden;text-overflow:ellipsis;color:var(--muted)}.performance-head{display:flex;justify-content:space-between;gap:20px;align-items:center;margin-bottom:12px}.performance-head h2{margin:4px 0}.performance-head p{margin:0;color:var(--muted)}.performance-generated{display:grid;gap:4px;text-align:right}.performance-generated span{color:var(--muted);font-size:11px}.performance-toolbar{align-items:flex-end}.performance-kpis{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin:12px 0}.performance-kpis article{display:grid;gap:8px;min-height:88px}.performance-kpis span{font-size:12px;color:var(--muted)}.performance-kpis b{font-size:22px}.performance-kpis .defect b{color:var(--stop)}.performance-note{margin:8px 0 14px;padding:11px 13px;border-left:3px solid var(--cyan);background:var(--surface-2);color:var(--muted);font-size:12px}.performance-tables{display:grid;gap:12px}.performance-table-card{min-width:0}.performance-table-card .table-scroll{max-height:420px}.performance-table td:nth-child(2){font-variant-numeric:tabular-nums}

@media (max-width: 1100px){.performance-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}.permission-grid{grid-template-columns:1fr}}
@media (max-width: 760px){.performance-head,.user-activity-heading{align-items:stretch;flex-direction:column}.performance-generated{text-align:left}.performance-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.performance-toolbar .filter-group,.performance-actions{width:100%}.performance-toolbar .field{width:100%}}

/* Performance view: keep Korean/Vietnamese labels and totals inside their cards. */
.performance-head > div,
.performance-head h2,
.performance-head p,
.performance-generated,
.performance-toolbar,
.performance-toolbar .filter-group,
.performance-kpis article,
.performance-kpis span,
.performance-kpis b,
.performance-table-card .card-heading,
.performance-table-card .card-heading h3 { min-width: 0; }
.performance-head h2,
.performance-head p,
.performance-kpis span,
.performance-note,
.performance-table-card .card-heading h3 { overflow-wrap: anywhere; }
.performance-head h2 { font-size: clamp(20px, 1.65vw, 28px); line-height: 1.2; }
.performance-head p { max-width: 920px; line-height: 1.55; }
.performance-head {
  padding: 18px 20px;
  background: linear-gradient(115deg, var(--surface), color-mix(in srgb, var(--cyan) 8%, var(--surface)));
}
.performance-head > div:first-child { flex: 1 1 auto; min-width: 0; }
.performance-head > div:first-child > small {
  color: var(--cyan);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .14em;
}
.performance-generated {
  max-width: min(100%, 340px);
  padding: 9px 0 9px 18px;
  flex: 0 1 340px;
  border-left: 1px solid var(--line);
}
.performance-generated b { overflow-wrap: anywhere; line-height: 1.35; }
.performance-toolbar { flex-wrap: wrap; }
.performance-toolbar .filter-group {
  flex: 1 1 720px;
  display: grid;
  grid-template-columns: repeat(4, minmax(128px, 1fr));
}
.performance-toolbar .field { min-width: 0; }
.performance-actions { flex: 0 0 auto; justify-content: flex-end; }
.performance-kpis article { min-height: 96px; padding: 13px 15px; align-content: space-between; overflow: hidden; }
.performance-kpis span { line-height: 1.35; }
.performance-kpis b {
  font-size: clamp(18px, 1.55vw, 24px);
  line-height: 1.15;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
}
.performance-table-card { overflow: hidden; }
.performance-table-card > .card-heading {
  min-height: 54px;
  margin: 0;
  padding: 12px 16px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, color-mix(in srgb, var(--cyan) 5%, var(--surface)), var(--surface));
}
.performance-table-card > .card-heading > h3 { font-size: 15px; }
.performance-count {
  min-width: 38px;
  padding: 5px 10px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--surface-3);
  text-align: center;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.performance-table-card .table-scroll {
  max-width: 100%;
  border: 0;
  border-radius: 0;
  scrollbar-gutter: stable;
  overscroll-behavior-inline: contain;
}
.performance-table { min-width: 800px; font-size: clamp(10px, .75vw, 12px); }
.performance-table th {
  min-width: 76px;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: bottom;
}
.performance-table td { white-space: nowrap; font-variant-numeric: tabular-nums; }
.performance-table th:first-child,
.performance-table td:first-child {
  width: 18%;
  min-width: 126px;
  position: sticky;
  left: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  background: var(--surface);
  box-shadow: 1px 0 0 var(--line);
}
.performance-table th:first-child { z-index: 3; }
.performance-table td:first-child { z-index: 1; }
.performance-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 68%, var(--surface)); }
.performance-table tbody tr:hover td { background: color-mix(in srgb, var(--cyan) 8%, var(--surface)); }

@media (max-width: 1180px) {
  .performance-toolbar .filter-group { flex-basis: 100%; }
  .performance-actions { width: 100%; }
  .performance-table { min-width: 760px; }
}

@media (max-width: 860px) {
  .performance-toolbar .filter-group { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .performance-actions { justify-content: stretch; }
  .performance-actions .button { flex: 1 1 0; }
}

@media (max-width: 520px) {
  .performance-kpis { grid-template-columns: 1fr; }
  .performance-toolbar .filter-group { grid-template-columns: 1fr; }
  .performance-actions { flex-direction: column; align-items: stretch; }
  .performance-table { min-width: 720px; }
}

@media (max-width: 760px) {
  .performance-head { padding: 15px 16px; }
  .performance-generated {
    max-width: none;
    padding: 12px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
    text-align: left;
  }
  .performance-table-card > .card-heading { padding-inline: 14px; }
}

@media (min-width: 1600px) {
  .performance-kpis { gap: 14px; }
  .performance-kpis article { min-height: 104px; padding: 16px 18px; }
  .performance-table-card .table-scroll { max-height: min(520px, 52vh); }
}

html[data-theme="dark"] {
  --bg: #07141d;
  --surface: #0d202b;
  --surface-2: #102934;
  --surface-3: #183640;
  --ink: #edf7fa;
  --muted: #9eb2bc;
  --line: #26424e;
  --navy: #030b10;
  --navy-2: #0a2c3b;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
  --machine-stop: #ffad32;
  --machine-stop-dark: #ae5800;
  --long-wait: #ff5260;
  --long-wait-dark: #a81827;
  --long-wait-strong: #ff6673;
  --long-wait-ink: #ffffff;
  --nav-production-label: #6fd0df;
  --nav-quality-label: #b9aaff;
  --nav-management-label: #ffc06b;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 92% 0%, rgba(44, 182, 191, 0.12), transparent 26rem),
    var(--bg);
  font-family: "Pretendard", "Noto Sans KR", "Malgun Gothic", Arial, sans-serif;
  font-size: 14px;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; }

.topbar {
  min-height: 92px;
  padding: 12px clamp(18px, 3vw, 46px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #fff;
  background:
    linear-gradient(110deg, rgba(44, 182, 191, 0.16), transparent 45%),
    var(--navy);
  border-bottom: 3px solid var(--cyan);
}

.brand { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-mark {
  width: 104px; height: 68px; flex: 0 0 auto;
  display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.2); border-radius: 13px;
  padding: 7px 9px; overflow: hidden; isolation: isolate; background: #fff;
  box-shadow: 0 8px 22px rgba(0,0,0,.25);
}
.brand-mark img { width: 100%; height: 100%; display: block; object-fit: contain; object-position: center; }
.brand-copy { min-width: 0; }
.brand-copy small { color: #8adce0; font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.brand-copy h1 { margin: 2px 0 0; font-size: clamp(18px, 2vw, 26px); letter-spacing: -.035em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.header-order-search { width: min(310px, 26vw); height: 44px; display: flex; overflow: hidden; border: 1px solid rgba(91,211,219,.44); border-radius: 11px; background: rgba(255,255,255,.07); transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.header-order-search:focus-within { border-color: rgba(91,211,219,.9); background: rgba(255,255,255,.1); box-shadow: 0 0 0 3px rgba(44,182,191,.15); }
.header-order-search label { min-width: 0; padding: 4px 12px; flex: 1; display: grid; align-content: center; }
.header-order-search span { overflow: hidden; color: #9be1e5; font-size: 9px; font-weight: 900; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.header-order-search input { min-width: 0; padding: 0; border: 0; outline: 0; color: #fff; background: transparent; font-size: 13px; font-weight: 850; }
.header-order-search button { width: 44px; flex: 0 0 44px; border: 0; color: #fff; background: rgba(44,182,191,.24); font-size: 22px; cursor: pointer; transition: background .18s ease; }
.header-order-search button:hover { background: rgba(44,182,191,.4); }
.connection-pill, .clock-pill, .mode-pill {
  min-height: 37px; padding: 7px 11px;
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid rgba(255,255,255,.18); border-radius: 999px;
  background: rgba(255,255,255,.08); color: #dff7f7; font-size: 11px; font-weight: 800;
}
.mode-pill.server { border-color: rgba(44,182,191,.55); color: #aaf4f0; }
.mode-pill.viewer { border-color: rgba(242,169,59,.55); color: #ffd995; }
.auth-action { display: flex; align-items: center; gap: 6px; }
.unauth-actions { display: flex; align-items: center; gap: 6px; }
.admin-badge { max-width: 150px; padding: 6px 9px; overflow: hidden; border-radius: 999px; color: #092936; background: #aaf0e5; font-size: 10px; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.admin-login { color: #092936; border-color: #aaf0e5; background: #aaf0e5; }
.connection-dot { width: 8px; height: 8px; border-radius: 50%; background: #53e7a6; box-shadow: 0 0 0 4px rgba(83,231,166,.13); }
.connection-pill.offline .connection-dot { background: #ff5c65; box-shadow: 0 0 0 4px rgba(255,92,101,.14); }

.toggle-group { display: flex; gap: 3px; padding: 3px; border: 1px solid rgba(255,255,255,.17); border-radius: 9px; background: rgba(255,255,255,.07); }
.toggle-group button { min-height: 29px; min-width: 43px; padding: 4px 8px; border: 0; border-radius: 6px; color: #b9d5dc; background: transparent; font-size: 10px; font-weight: 900; }
.toggle-group button.selected { color: #07303c; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.18); }

.nav-shell {
  position: sticky; top: 0; z-index: 30;
  min-width: 0;
  padding: 8px clamp(18px, 3vw, 46px);
  display: flex; justify-content: space-between; gap: 12px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border-bottom: 1px solid var(--line); backdrop-filter: blur(12px);
}
.nav-tabs { min-width: 0; flex: 1 1 auto; display: flex; gap: 6px; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-color: var(--line) transparent; }
.nav-tab {
  --nav-group-accent: var(--nav-production-accent);
  --nav-group-deep: var(--nav-production-deep);
  --nav-group-label: var(--nav-production-label);
  min-width: 142px; min-height: 56px; padding: 8px 11px; position: relative; overflow: hidden;
  display: grid; grid-template-columns: 25px minmax(0,1fr); align-items: center; gap: 8px;
  border: 1px solid color-mix(in srgb,var(--nav-group-accent) 34%,var(--line)); border-radius: 10px;
  color: var(--muted); background: linear-gradient(180deg,color-mix(in srgb,var(--nav-group-accent) 5%,var(--surface-2)),var(--surface-2));
  box-shadow: inset 0 3px 0 var(--nav-group-accent); text-align: left; font-weight: 800;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.nav-tab--quality { --nav-group-accent: var(--nav-quality-accent); --nav-group-deep: var(--nav-quality-deep); --nav-group-label: var(--nav-quality-label); }
.nav-tab--management { --nav-group-accent: var(--nav-management-accent); --nav-group-deep: var(--nav-management-deep); --nav-group-label: var(--nav-management-label); }
.nav-tab:hover { border-color: var(--nav-group-accent); transform: translateY(-1px); }
.nav-tab i { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; background: color-mix(in srgb,var(--nav-group-accent) 12%,var(--surface-3)); color: var(--nav-group-label); font-size: 10px; font-style: normal; }
.nav-tab > span { min-width: 0; display: grid; gap: 1px; }
.nav-tab > span > b { overflow: hidden; display: -webkit-box; font-size: 11px; line-height: 1.18; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.nav-tab > span > small { overflow: hidden; color: var(--nav-group-label); font-size: 8px; font-weight: 950; line-height: 1.1; letter-spacing: .04em; text-overflow: ellipsis; white-space: nowrap; }
.nav-tab.selected { color: #fff; border-color: var(--nav-group-accent); background: linear-gradient(135deg,var(--nav-group-accent),var(--nav-group-deep)); box-shadow: inset 0 3px 0 rgba(255,255,255,.42),0 6px 15px color-mix(in srgb,var(--nav-group-accent) 26%,transparent); }
.nav-tab.selected i { color: #fff; background: rgba(255,255,255,.16); }
.nav-tab.selected > span > small { color: rgba(255,255,255,.82); }
html[lang="vi"] .nav-tab { min-width: 176px; }
.nav-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; }

.main { width: min(1760px, calc(100% - 28px)); min-width: 0; margin: 13px auto 30px; }
.view[hidden] { display: none !important; }

.toolbar, .card {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
}
.toolbar { margin-bottom: 11px; padding: 11px 13px; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.filter-group { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.field { min-width: 128px; display: grid; gap: 5px; }
.field.grow { min-width: 210px; flex: 1; }
.field span { color: var(--muted); font-size: 11px; font-weight: 900; line-height: 1.35; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 42px; padding: 8px 11px;
  border: 1px solid var(--line); border-radius: 10px;
  color: var(--ink); background: var(--surface-2); outline: none;
}
.field textarea { resize: vertical; line-height: 1.5; }
.field small { color: var(--muted); font-size: 9px; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(44,182,191,.14); }

.button { min-height: 42px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--surface-2); font-weight: 850; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.button:hover { transform: translateY(-1px); border-color: #7baeb7; }
.button:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--cyan) 30%, transparent); outline-offset: 2px; }
.button.primary { color: #fff; border-color: #0c7784; background: linear-gradient(135deg, #13a1a4, #0a6579); }
.button.danger { color: #fff; border-color: #bd2934; background: var(--stop); }
.button.success { color: #fff; border-color: #159151; background: linear-gradient(135deg, #179b58, #08723e); }
.button.warning { color: #fff; border-color: #d07a00; background: linear-gradient(135deg, #f6a208, #c66b00); }
.button.full { width: 100%; }
.button.compact { min-height: 34px; padding: 6px 10px; font-size: 11px; }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.disconnect-banner, .collector-warning { margin-bottom: 10px; padding: 10px 13px; border: 1px solid #b72b37; border-radius: 9px; color: #fff; background: #8e1f29; font-weight: 850; }
.offline .status-wall, .offline .critical-rail, .offline .kpi-grid { filter: grayscale(.9); opacity: .55; }

.kpi-grid { margin-bottom: 11px; display: grid; grid-template-columns: repeat(7, minmax(112px, 1fr)); gap: 9px; }
.kpi-card { min-height: 96px; padding: 13px 14px 11px; position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: 0 8px 22px rgba(12,43,58,.06); }
.kpi-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: #8094a0; }
.kpi-card.run::before { background: var(--run); }
.kpi-card.stop::before { background: var(--machine-stop); }
.kpi-card.wait::before { background: var(--long-wait); }
.kpi-card.wait strong { color: var(--long-wait-strong); }
.kpi-card.wait > span:not(.long-wait-icon) { display: block; padding-right: 25px; line-height: 1.3; }
.kpi-card.critical::before { background: #111; }
.kpi-card.util::before { background: var(--cyan); }
.kpi-card.received::before { background: var(--warning); }
.kpi-card span { color: var(--muted); font-size: 10px; font-weight: 900; }
.kpi-card strong { margin-top: 7px; display: block; font-size: clamp(21px, 2.1vw, 29px); line-height: 1; letter-spacing: -.04em; }
.kpi-card small { margin-top: 5px; display: block; color: var(--muted); font-size: 9px; }
.kpi-card.run strong { color: var(--run); }
.kpi-card.stop strong { color: var(--machine-stop); }
.utilization-kpi-content { margin-top: 4px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.utilization-kpi-content strong { margin-top: 0; }
.utilization-donut {
  --donut-value: 0deg;
  width: 42px; height: 42px; flex: 0 0 auto; position: relative; display: grid; place-items: center;
  border-radius: 50%; background: conic-gradient(var(--run) 0 var(--donut-value), var(--surface-3) var(--donut-value) 360deg);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--line) 78%, transparent), 0 3px 9px rgba(8,122,69,.14);
}
.utilization-donut::after { content: ""; width: 25px; height: 25px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.utilization-donut.no-data { background: repeating-conic-gradient(var(--surface-3) 0 18deg, var(--line) 18deg 36deg); box-shadow: none; }

.long-wait-icon {
  width: 30px; height: 30px; flex: 0 0 auto; display: inline-grid; place-items: center;
  border: 2px solid color-mix(in srgb, var(--long-wait) 78%, #ffffff); border-radius: 50%;
  color: var(--long-wait-ink); background: var(--long-wait);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--long-wait) 18%, transparent), 0 3px 8px rgba(0,0,0,.2);
  font-family: Arial, sans-serif; font-size: 20px; font-weight: 950; line-height: 1;
}
.long-wait-icon > span { color: inherit; font: inherit; line-height: 1; }
.long-wait-icon--kpi { width: 24px; height: 24px; position: absolute; top: 10px; right: 10px; border-width: 1.5px; font-size: 16px; }
.long-wait-icon--legend { width: 16px; height: 16px; border-width: 1px; box-shadow: none; font-size: 11px; }
.long-wait-icon--drawer { width: 42px; height: 42px; font-size: 28px; }
.long-wait-icon--operator { width: 28px; height: 28px; border-width: 1.5px; box-shadow: none; font-size: 18px; }

.overview-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 11px; align-items: start; }
.status-wall { min-width: 0; padding: 12px; }
.card-heading { min-height: 38px; margin-bottom: 8px; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-heading > div, .card-heading > h2, .card-heading > h3, .card-heading > p { min-width: 0; }
.card-heading h2, .card-heading h3 { margin: 0; font-size: 15px; letter-spacing: -.025em; }
.card-heading p { margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.status-wall-heading { align-items: center; }
.status-wall-title { flex: 0 0 auto; }
.notice-ticker { min-width: 0; max-width: 940px; flex: 1 1 500px; height: 48px; display: flex; align-items: center; overflow: hidden; border: 2px solid color-mix(in srgb, var(--warning) 70%, var(--line)); border-radius: 11px; background: color-mix(in srgb, var(--warning) 13%, var(--surface-2)); box-shadow: 0 5px 16px color-mix(in srgb, var(--warning) 15%, transparent); }
.notice-ticker > b { height: 100%; padding: 0 14px; flex: 0 0 auto; display: inline-flex; align-items: center; color: #fff; background: #a85f00; font-size: 14px; letter-spacing: .05em; }
.notice-window { min-width: 0; height: 100%; flex: 1; position: relative; overflow: hidden; white-space: nowrap; }
.notice-track { width: max-content;height: 100%; position: absolute; top: 0; left: 0; display: flex; align-items: center; color: var(--ink); font-size: 17px; font-weight: 900; line-height: 44px; animation: notice-marquee var(--ticker-duration, 22s) linear infinite; animation-delay: var(--ticker-delay, 0s); will-change: left,transform; }
@keyframes notice-marquee { from { left:100%;transform:translateX(0); } to { left:0;transform:translateX(-100%); } }
.legend { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.legend span { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 850; }
.legend i { width: 9px; height: 9px; border-radius: 3px; }
.legend .run { background: var(--run); } .legend .stop { background: var(--machine-stop); } .legend .critical { background: var(--critical); border: 1px solid #88949c; }
.legend .long-wait-icon { display: inline-grid; color: var(--long-wait-ink); font-size: 11px; font-weight: 950; }
.legend .long-wait-icon > span { display: block; color: var(--long-wait-ink); font-size: 11px; font-weight: 950; }

.line-band { padding: 3px 0; display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 6px; border-top: 1px solid var(--line); }
.line-band:first-of-type { border-top: 0; }
.line-label { min-height: 40px; display: grid; align-content: center; justify-items: center; border-radius: 9px; color: #fff; background: linear-gradient(145deg, var(--navy-2), #0d5c6b); }
.line-label strong { font-size: 15px; line-height: 1; }
.line-label small { margin-top: 3px; color: #bfe5e7; font-size: 8px; }
.equipment-grid { min-width: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 4px; }
.team-empty { grid-column: 1 / -1; min-height: 38px; display: grid; place-items: center; color: var(--muted); font-size: 9px; }
.equipment-tile {
  min-width: 0; min-height: 46px; padding: 1px 2px; position: relative;
  display: block; overflow: hidden; border: 0; border-radius: 8px; color: #fff; text-align: left;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 3px 8px rgba(0,0,0,.13);
}
.equipment-icon {
  width: 34px; height: 34px; margin: 6px auto 0; display: grid; place-items: center;
  color: #5ff0a5; filter: drop-shadow(0 2px 3px rgba(0,0,0,.3));
}
.equipment-icon svg { width: 100%; height: 100%; display: block; }
.equipment-icon circle { fill: color-mix(in srgb, currentColor 42%, #071118); stroke: currentColor; stroke-width: 2.5; }
.equipment-icon .icon-symbol { fill: #fff; stroke: none; }
.equipment-icon .icon-line { fill: none; stroke: #fff; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.equipment-tile[data-state="STOP"] .equipment-icon { color: color-mix(in srgb,var(--machine-stop) 22%,#ffffff); }
.equipment-tile[data-state="WAIT"] .equipment-icon { width: 22px; height: 22px; margin: 13px auto 0 5px; position: relative; z-index: 3; color: var(--long-wait); filter: none; }
.equipment-icon .long-wait-icon { width: 100%; height: 100%; border-width: 1.5px; box-shadow: 0 0 0 2px color-mix(in srgb,var(--long-wait) 22%,transparent), 0 2px 5px rgba(0,0,0,.32); font-size: 15px; }
.equipment-tile[data-state="LONG_STOP"] .equipment-icon,
.equipment-tile[data-state="NO_COMM"] .equipment-icon,
.equipment-tile[data-state="NO_DATA"] .equipment-icon { color: #aebac2; }
.equipment-code { position: absolute; inset: 1px 2px auto; z-index: 3; overflow: hidden; color: #fff; background: rgba(0,0,0,.24); border-radius: 3px; font-family: "Arial Narrow", "Malgun Gothic", sans-serif; font-size: 9px; font-stretch: condensed; font-weight: 950; line-height: 12px; letter-spacing: -.04em; text-align: center; text-overflow: clip; white-space: nowrap; }
.equipment-meta { position: absolute; inset: auto 2px 1px; z-index: 2; overflow: hidden; border-radius: 3px; color: #fff; background: rgba(0,0,0,.34); font-size: 8px; font-weight: 900; line-height: 12px; text-align: center; text-overflow: clip; white-space: nowrap; }
.equipment-state { white-space: nowrap; }
.equipment-duration { display: none; }
.equipment-tile[data-state="RUN"] { background: linear-gradient(145deg, var(--run), var(--run-dark)); }
.equipment-tile[data-state="STOP"] { background: linear-gradient(145deg, var(--machine-stop), var(--machine-stop-dark)); }
.equipment-tile[data-state="WAIT"] { background: linear-gradient(145deg, var(--long-wait), var(--long-wait-dark)); border: 1px solid color-mix(in srgb,var(--long-wait) 72%,#ffffff); box-shadow: inset 3px 0 0 color-mix(in srgb,var(--long-wait) 68%,#ffffff), 0 3px 8px rgba(0,0,0,.2); }
.equipment-tile[data-state="WAIT"] .equipment-meta { min-height: 10px; display: grid; place-items: center; color: #ffffff; background: rgba(67,4,12,.78); font-family: "Arial Narrow", "Malgun Gothic", sans-serif; font-size: 5.1px; line-height: 10px; letter-spacing: -.04em; white-space: nowrap; }
.equipment-tile[data-state="WAIT"] .equipment-state { max-width: 100%; display: block; white-space: nowrap; }
.equipment-tile[data-state="WAIT"] .equipment-order { max-width: calc(100% - 36px); }
.equipment-tile[data-state="LONG_STOP"], .equipment-tile[data-state="NO_COMM"], .equipment-tile[data-state="NO_DATA"] { background: linear-gradient(145deg, #1c2228, #050709); border: 1px solid #68757e; }
.equipment-tile:hover, .equipment-tile.selected { outline: 3px solid rgba(44,182,191,.32); outline-offset: 1px; transform: translateY(-1px); }
.equipment-order { position: absolute; z-index: 4; top: 14px; right: 2px; max-width: calc(100% - 4px); padding: 1px 3px; overflow: hidden; border-radius: 3px; color: #071c2d; background: #d8fbff; font-size: 7px; font-weight: 950; line-height: 10px; text-overflow: clip; white-space: nowrap; }
.equipment-tile.work-active .equipment-meta { color:#e8fbff; background:rgba(3,18,25,.78); }
.equipment-work-state { display:block; overflow:hidden; font-weight:950; text-overflow:clip; white-space:nowrap; }
.equipment-tile.work-waiting { box-shadow:inset 0 0 0 2px #ffc941,0 3px 8px rgba(0,0,0,.2); }
.equipment-tile.work-waiting .equipment-meta { color:#241700; background:#ffc941; }
.equipment-order.work-waiting { color:#241700; background:#ffe18a; }

.critical-rail { padding: 12px; position: sticky; top: 72px; }
.critical-list { display: grid; gap: 6px; max-height: 650px; overflow: auto; }
.critical-item { padding: 9px 10px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; border: 1px solid #39464f; border-radius: 9px; color: #fff; background: #10151a; }
.critical-item b { font-size: 11px; }
.critical-item small { display: block; margin-top: 3px; color: #b7c0c6; font-size: 8px; }
.critical-tag { align-self: center; padding: 4px 6px; border-radius: 999px; color: #111; background: #f5c15a; font-size: 8px; font-weight: 950; white-space: nowrap; }
.critical-tag.comm { color: #fff; background: #535f68; }

.analytics-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 11px; }
.analytics-card { min-width: 0; padding: 15px; }
.analytics-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mini-kpi { padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.mini-kpi span { color: var(--muted); font-size: 9px; font-weight: 850; }
.mini-kpi b { margin-top: 5px; display: block; font-size: 18px; }
.chart { min-height: 250px; margin-top: 14px; padding: 12px; display: flex; align-items: flex-end; gap: 5px; overflow-x: auto; border: 1px solid var(--line); border-radius: 11px; background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.chart-column { min-width: 35px; height: 215px; flex: 1 0 35px; display: grid; grid-template-rows: 1fr auto; gap: 5px; align-items: end; }
.chart-stack { height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.chart-bar { width: min(28px, 78%); min-height: 2px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #35c78a, #118558); box-shadow: 0 5px 10px rgba(17,133,88,.15); }
.chart-column small { color: var(--muted); font-size: 8px; text-align: center; white-space: nowrap; }
.chart-empty { width: 100%; align-self: center; color: var(--muted); text-align: center; }

.ranking-list, .timeline-list { display: grid; gap: 7px; }
.ranking-row { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.ranking-row > strong { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; color: #fff; background: var(--navy-2); font-size: 10px; }
.ranking-row b { font-size: 11px; }
.ranking-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; }
.ranking-row > span { color: var(--stop); font-weight: 950; }

.timeline { margin-top: 12px; }
.timeline-strip { height: 27px; display: flex; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-3); }
.timeline-segment { min-width: 1px; height: 100%; }
.timeline-segment.RUN { background: var(--run); }
.timeline-segment.STOP { background: var(--machine-stop); }
.timeline-segment.WAIT { background: var(--long-wait); }
.timeline-segment.NO_DATA, .timeline-segment.NO_COMM { background: repeating-linear-gradient(135deg, #30383e, #30383e 5px, #121619 5px, #121619 10px); }
.provisional-note { margin: 8px 0 0; color: var(--warning); font-size: 10px; font-weight: 850; }
.timeline-axis { margin-top: 4px; display: flex; justify-content: space-between; color: var(--muted); font-size: 8px; }

.collector-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(330px, .9fr); gap: 11px; }
.collector-card, .settings-card { padding: 16px; }
.folder-path { margin: 8px 0 12px; padding: 10px 12px; border: 1px dashed #8da9b4; border-radius: 9px; color: var(--ink); background: var(--surface-2); font-family: Consolas, monospace; font-size: 11px; word-break: break-all; }
.collector-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.collector-stat { padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.collector-stat b { display: block; margin-top: 4px; font-size: 18px; }
.file-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.file-table th { padding: 8px; color: #dff3f5; background: var(--navy-2); text-align: left; }
.file-table td { padding: 8px; border-bottom: 1px solid var(--line); color: var(--muted); }
.table-scroll { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: 9px; }
.ftp-runtime-panel { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.ftp-runtime-panel .section-heading { align-items: center; }
.ftp-runtime-panel .section-heading p { max-width: 250px; }
.ftp-state, .ftp-secret-state { flex: 0 0 auto; padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface-2); font-size: 9px; font-weight: 900; }
.ftp-state.connected, .ftp-secret-state.ready { border-color: color-mix(in srgb,var(--run) 70%,var(--line)); color: var(--run); background: color-mix(in srgb,var(--run) 9%,var(--surface-2)); }
.ftp-state.stale { border-color: color-mix(in srgb,var(--warning) 75%,var(--line)); color: var(--warning); background: color-mix(in srgb,var(--warning) 9%,var(--surface-2)); }
.ftp-state.error, .ftp-secret-state.missing { border-color: color-mix(in srgb,var(--stop) 70%,var(--line)); color: var(--stop); background: color-mix(in srgb,var(--stop) 9%,var(--surface-2)); }
.ftp-now-button { width: 100%; margin-top: 10px; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.settings-card { min-width: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.settings-card .form-grid > .field { min-width: 0; align-content: start; }
.setting-number-control { width: 100%; height: 42px; min-width: 0; position: relative; align-self: start; }
.setting-number-control input { width: 100%; height: 42px; min-height: 42px; padding-right: 64px; font-variant-numeric: tabular-nums; }
.setting-number-control .setting-unit-suffix {
  min-width: 52px; position: absolute; top: 1px; right: 1px; bottom: 1px;
  display: inline-grid; place-items: center; padding: 0 9px;
  border-left: 1px solid var(--line); border-radius: 0 9px 9px 0;
  color: var(--ink); background: var(--surface-3); font-size: 10px; line-height: 1;
  pointer-events: none;
}
.long-wait-setting { padding: 9px 10px; border: 1px solid color-mix(in srgb,var(--long-wait) 72%,var(--line)); border-radius: 10px; background: color-mix(in srgb,var(--long-wait) 9%,var(--surface-2)); }
.long-wait-setting > span { color: var(--ink); }
.long-wait-setting > span::before { content: "!"; width: 17px; height: 17px; margin-right: 6px; display: inline-grid; place-items: center; border-radius: 50%; color: var(--long-wait-ink); background: var(--long-wait); font-family: Arial,sans-serif; font-size: 11px; font-weight: 950; vertical-align: -1px; }
.long-wait-setting input { border-color: color-mix(in srgb,var(--long-wait) 72%,var(--line)); font-weight: 900; }
.compact-code-form { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.compact-code-form .button { min-width: 92px; }
.config-list { margin-top: 12px; display: grid; gap: 6px; max-height: 340px; overflow: auto; }
.config-row { padding: 8px 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.config-row b { font-size: 11px; } .config-row small { color: var(--muted); font-size: 8px; }
.config-row > span { min-width: 0; display: grid; gap: 2px; }
.config-row.deleted { opacity: .58; border-style: dashed; }
.equipment-config-list { max-height: 430px; }
.form-hint, .time-hint { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.time-hint { min-width: 220px; max-width: 430px; align-self: flex-end; padding: 7px 9px; border-left: 3px solid var(--cyan); }
.analysis-toolbar { flex-wrap: wrap; }
.analysis-toolbar .filter-group { min-width: 0; flex: 1 1 980px; }
.analysis-toolbar .time-hint { min-width: 100%; max-width: none; flex: 1 0 100%; }
.analysis-toolbar > .button { margin-left: auto; }
.ftp-settings-card { grid-column: 1 / -1; border-top: 3px solid color-mix(in srgb,var(--cyan) 70%,var(--line)); }
.ftp-settings-form { grid-template-columns: repeat(4,minmax(0,1fr)); }
.ftp-enabled-switch, .ftp-tls-switch { min-width: 0; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.ftp-enabled-switch input, .ftp-tls-switch input { width: 18px; height: 18px; flex: 0 0 18px; accent-color: var(--cyan); }
.ftp-enabled-switch span, .ftp-tls-switch span { min-width: 0; display: grid; gap: 3px; }
.ftp-enabled-switch b, .ftp-tls-switch b { color: var(--ink); font-size: 11px; }
.ftp-enabled-switch small, .ftp-tls-switch small { color: var(--muted); font-size: 9px; line-height: 1.45; }
.ftp-tls-switch { align-self: end; min-height: 67px; }
.ftp-mapping { min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.ftp-mapping legend { padding: 0 6px; color: var(--ink); font-size: 11px; font-weight: 900; }
.ftp-mapping > p { margin: 0 0 9px; color: var(--muted); font-size: 9px; }
.ftp-mapping > div { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.ftp-settings-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.ftp-clear-confirm { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid color-mix(in srgb,var(--stop) 70%,var(--line)); border-radius: 10px; color: var(--ink); background: color-mix(in srgb,var(--stop) 8%,var(--surface-2)); font-size: 10px; font-weight: 800; }
.ftp-clear-confirm > div { display: flex; gap: 7px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; background: rgba(1,9,14,.72); backdrop-filter: blur(5px); }
.auth-dialog { width: min(460px, 100%); padding: 24px; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: var(--surface); box-shadow: 0 26px 80px rgba(0,0,0,.38); }
.auth-gate-shell { min-height: 100vh; background: var(--bg); }
.auth-gate-page { min-height: 100vh; padding: clamp(22px,4vw,58px); display: grid; grid-template-columns: minmax(0,1.1fr) minmax(380px,520px); align-items: center; gap: clamp(28px,6vw,86px); position: relative; overflow: hidden; }
.auth-gate-page::before { content:""; width: 560px; height: 560px; position: absolute; right: -180px; top: -260px; border-radius: 50%; background: radial-gradient(circle,color-mix(in srgb,var(--cyan) 18%,transparent),transparent 70%); pointer-events: none; }
.auth-gate-hero { min-width: 0; position: relative; z-index: 1; }
.auth-gate-tools { margin-bottom: clamp(44px,8vh,92px); display: flex; flex-wrap: wrap; gap: 8px; }
.auth-gate-brand { display: flex; align-items: center; gap: 15px; }
.auth-gate-brand>span { width: 112px; height: 68px; display: grid; place-items: center; padding: 7px 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 14px 38px rgba(0,0,0,.13); }
.auth-gate-brand img { width: 100%; height: 100%; display: block; object-fit: contain; }
.auth-gate-brand small,.auth-gate-copy>small { color: var(--cyan); font-size: 9px; font-weight: 950; letter-spacing: .12em; }
.auth-gate-brand h1 { margin: 5px 0 0; font-size: clamp(21px,2.4vw,34px); }
.auth-gate-copy { max-width: 720px; margin-top: clamp(36px,7vh,74px); }
.auth-gate-copy h2 { max-width: 680px; margin: 10px 0 14px; font-size: clamp(32px,5vw,64px); line-height: 1.08; letter-spacing: -.045em; }
.auth-gate-copy p { max-width: 620px; margin: 0; color: var(--muted); font-size: clamp(12px,1.4vw,16px); line-height: 1.75; }
.auth-gate-security { max-width: 560px; margin-top: 28px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; border: 1px solid color-mix(in srgb,var(--cyan) 38%,var(--line)); border-radius: 12px; background: color-mix(in srgb,var(--cyan) 7%,var(--surface)); }
.auth-gate-security>i { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border-radius: 50%; color: #00161c; background: var(--cyan); font-style: normal; font-weight: 950; }
.auth-gate-security>span { min-width: 0; display: grid; gap: 4px; }
.auth-gate-security b { font-size: 11px; }
.auth-gate-security small { color: var(--muted); font-size: 9px; line-height: 1.45; }
.auth-gate-dialog { width: 100%; position: relative; z-index: 1; padding: clamp(24px,3vw,36px); box-shadow: 0 34px 100px rgba(0,0,0,.32); }
.auth-gate-dialog .button.primary { min-height: 46px; font-size: 12px; }
.auth-account-help { text-align: center; }
@media (max-width: 900px) {
  .auth-gate-page { grid-template-columns: 1fr; align-content: center; gap: 24px; }
  .auth-gate-tools { margin-bottom: 26px; }
  .auth-gate-copy { margin-top: 28px; }
  .auth-gate-copy h2 { font-size: clamp(30px,7vw,46px); }
  .auth-gate-dialog { justify-self: center; width: min(560px,100%); }
}
@media (max-width: 560px) {
  .auth-gate-page { padding: 16px; align-content: start; }
  .auth-gate-tools { margin-bottom: 20px; }
  .auth-gate-brand>span { width: 82px; height: 52px; }
  .auth-gate-brand h1 { font-size: 19px; }
  .auth-gate-copy { margin-top: 24px; }
  .auth-gate-copy h2 { margin-block: 8px 10px; font-size: 30px; }
  .auth-gate-security { margin-top: 18px; }
  .auth-gate-dialog { padding: 20px; }
  .auth-gate-dialog.signup-dialog { max-height: none; }
  .auth-gate-dialog .signup-form { grid-template-columns: 1fr; }
}
.modal-heading { margin-bottom: 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-heading h2 { margin: 0; font-size: 22px; }
.modal-heading p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.delete-dialog { width: min(520px, 100%); }
.delete-warning { margin-bottom: 14px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--stop) 70%, var(--line)); border-radius: 9px; color: #fff; background: color-mix(in srgb, var(--stop) 86%, #1a1012); font-size: 11px; font-weight: 850; line-height: 1.5; }
.delete-target { margin: 0 0 14px; padding: 11px 13px; display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.delete-target dt { color: var(--muted); font-size: 10px; font-weight: 900; }
.delete-target dd { margin: 0; overflow-wrap: anywhere; color: var(--stop); font-family: Consolas, monospace; font-size: 18px; font-weight: 950; text-align: right; }
.delete-match-hint { min-height: 15px; color: var(--stop); font-weight: 850; }
.delete-actions { display: flex; justify-content: flex-end; gap: 8px; }
.delete-actions .button { min-width: 110px; }
.performance-reset-button { margin-left: 2px; }
.performance-reset-dialog { width: min(760px, 100%); max-height: calc(100vh - 36px); overflow: auto; }
.performance-reset-dialog .modal-heading { margin-bottom: 14px; }
.performance-reset-dialog .modal-heading small { display: block; margin-bottom: 5px; color: var(--stop); font-size: 9px; font-weight: 950; letter-spacing: .08em; }
.performance-reset-warning { margin-bottom: 14px; padding: 11px 13px; border: 1px solid color-mix(in srgb,var(--warning) 65%,var(--line)); border-radius: 10px; color: color-mix(in srgb,var(--warning) 72%,var(--ink)); background: color-mix(in srgb,var(--warning) 10%,var(--surface-2)); font-size: 10px; font-weight: 850; line-height: 1.55; }
.performance-reset-preservation { margin-bottom: 12px; padding: 12px 14px; display: flex; align-items: center; gap: 11px; border: 1px solid color-mix(in srgb,var(--run) 48%,var(--line)); border-radius: 11px; background: color-mix(in srgb,var(--run) 7%,var(--surface-2)); }
.performance-reset-preservation i { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--run); font-style: normal; font-weight: 950; }
.performance-reset-preservation span { min-width: 0; display: grid; gap: 3px; }
.performance-reset-preservation b { font-size: 11px; }
.performance-reset-preservation small { color: var(--muted); font-size: 9px; line-height: 1.5; }
.performance-reset-preservation.unsafe { border-color: color-mix(in srgb,var(--stop) 58%,var(--line)); background: color-mix(in srgb,var(--stop) 8%,var(--surface-2)); }
.performance-reset-preservation.unsafe i { background: var(--stop); }
.performance-reset-preservation.unsafe b { color: var(--stop); }
.performance-reset-baseline { margin: 0 0 14px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); overflow: hidden; border: 1px solid var(--line); border-radius: 11px; }
.performance-reset-baseline > div { min-width: 0; padding: 11px 13px; background: var(--surface-2); }
.performance-reset-baseline > div + div { border-left: 1px solid var(--line); }
.performance-reset-baseline dt { color: var(--muted); font-size: 9px; font-weight: 900; }
.performance-reset-baseline dd { margin: 5px 0 0; overflow-wrap: anywhere; font-size: 12px; font-weight: 900; }
.performance-reset-impact-title { margin: 0 0 7px; color: var(--muted); font-size: 9px; font-weight: 900; }
.performance-reset-counts { margin-bottom: 16px; display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 7px; }
.performance-reset-count { min-width: 0; min-height: 72px; padding: 9px 10px; display: grid; align-content: space-between; gap: 7px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.performance-reset-count span { color: var(--muted); font-size: 9px; line-height: 1.35; overflow-wrap: anywhere; }
.performance-reset-count b { font-size: 18px; line-height: 1; font-variant-numeric: tabular-nums; }
.performance-reset-count.defect b { color: var(--stop); }
.performance-reset-form { padding-top: 15px; border-top: 1px solid var(--line); }
.performance-reset-form .field small { color: var(--muted); font-size: 9px; line-height: 1.45; }
.performance-reset-match-hint { min-height: 15px; color: var(--stop); font-weight: 850; }
.performance-reset-loading { min-height: 154px; display: grid; place-content: center; justify-items: center; gap: 11px; color: var(--muted); text-align: center; }
.performance-reset-loading span { width: 32px; height: 32px; border: 3px solid var(--line); border-top-color: var(--cyan); border-radius: 50%; animation: performance-reset-spin .8s linear infinite; }
.performance-reset-loading p { margin: 0; font-size: 10px; }
.performance-reset-error,.performance-reset-submit-error { padding: 12px 14px; border: 1px solid color-mix(in srgb,var(--stop) 56%,var(--line)); border-radius: 10px; background: color-mix(in srgb,var(--stop) 8%,var(--surface-2)); }
.performance-reset-error { min-height: 126px; display: grid; align-content: center; justify-items: start; gap: 7px; }
.performance-reset-error b { color: var(--stop); }
.performance-reset-error p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.performance-reset-submit-error { margin-bottom: 12px; color: var(--stop); font-size: 10px; font-weight: 850; line-height: 1.5; }
@keyframes performance-reset-spin { to { transform: rotate(360deg); } }
@media (max-width: 720px) {
  .performance-reset-counts { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .performance-reset-baseline { grid-template-columns: 1fr; }
  .performance-reset-baseline > div + div { border-top: 1px solid var(--line); border-left: 0; }
}
@media (max-width: 440px) {
  .performance-reset-counts { grid-template-columns: 1fr; }
  .performance-reset-count { min-height: 60px; }
  .performance-reset-dialog .delete-actions { flex-direction: column-reverse; }
  .performance-reset-dialog .delete-actions .button { width: 100%; }
}

/* User self-registration and account approval */
.signup-dialog { width: min(780px, 100%); max-height: calc(100vh - 36px); overflow: auto; }
.signup-form { display: grid; grid-template-columns: 210px minmax(0,1fr); gap: 18px; align-items: start; }
.signup-photo-panel { display: grid; gap: 9px; }
.signup-photo-preview { width: 100%; aspect-ratio: 4 / 5; padding: 0; overflow: hidden; border: 1px dashed #7b9ca7; border-radius: 15px; color: var(--muted); background: var(--surface-2); }
.signup-photo-preview:hover,.signup-photo-preview:focus-visible { border-color: var(--cyan); outline: 3px solid color-mix(in srgb,var(--cyan) 16%,transparent); }
.signup-photo-preview img { width: 100%; height: 100%; display: block; object-fit: cover; }
.signup-photo-preview span { height: 100%; padding: 20px; display: grid; place-content: center; justify-items: center; gap: 9px; text-align: center; }
.signup-photo-preview span[hidden] { display: none; }
.signup-photo-preview i { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 50%; color: var(--cyan); background: color-mix(in srgb,var(--cyan) 12%,var(--surface)); font-size: 36px; font-style: normal; }
.signup-photo-preview b { color: var(--ink); font-size: 14px; }
.signup-photo-preview small { font-size: 9px; line-height: 1.5; }
.signup-fields { align-self: stretch; }
.signup-privacy { margin: 0; padding: 9px 11px; border-left: 3px solid var(--cyan); color: var(--muted); background: var(--surface-2); font-size: 9px; line-height: 1.55; }
.signup-login-link { border-color: transparent; color: var(--cyan); background: transparent; }
.signup-complete-dialog { width: min(520px,100%); display: grid; justify-items: center; gap: 12px; text-align: center; }
.signup-complete-dialog h2 { margin: 0; }
.signup-complete-dialog p { max-width: 410px; margin: 0; color: var(--muted); line-height: 1.7; }
.signup-complete-icon { width: 68px; height: 68px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--run); box-shadow: 0 0 0 9px color-mix(in srgb,var(--run) 12%,transparent); font-size: 34px; font-weight: 900; }
.signup-complete-actions { margin-top: 8px; display: flex; gap: 8px; }
.signup-approval-head { margin-bottom: 11px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.signup-approval-head small { color: var(--cyan); font-size: 9px; font-weight: 950; letter-spacing: .1em; }
.signup-approval-head h2 { margin: 4px 0; }
.signup-approval-head p { margin: 0; color: var(--muted); font-size: 11px; }
.signup-pending-count { min-width: 92px; padding: 10px 14px; display: grid; justify-items: end; border-left: 3px solid var(--warning); }
.signup-pending-count b { font-size: 26px; }
.signup-pending-count span { color: var(--muted); font-size: 9px; }
.signup-approval-toolbar { margin-bottom: 11px; padding: 10px 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.signup-approval-toolbar p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.signup-application-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(520px,100%),1fr)); gap: 11px; }
.signup-application-card { min-width: 0; padding: 16px; }
.signup-applicant-profile { display: grid; grid-template-columns: 112px minmax(0,1fr); gap: 14px; align-items: center; }
.signup-applicant-profile img { width: 112px; height: 140px; display: block; object-fit: cover; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-3); }
.signup-applicant-profile h3 { margin: 7px 0 3px; font-size: 20px; }
.signup-applicant-profile p { margin: 0 0 5px; color: var(--muted); }
.signup-applicant-profile small { color: var(--muted); font-size: 9px; }
.pending-badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; color: #754100; background: #ffe4a8; font-size: 9px; font-weight: 950; }
.signup-applicant-meta { margin: 13px 0; display: grid; grid-template-columns: repeat(3,1fr); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.signup-applicant-meta div { padding: 9px 11px; border-right: 1px solid var(--line); background: var(--surface-2); }
.signup-applicant-meta div:last-child { border-right: 0; }
.signup-applicant-meta dt { color: var(--muted); font-size: 8px; font-weight: 900; }
.signup-applicant-meta dd { margin: 4px 0 0; font-size: 11px; font-weight: 900; }
.signup-approval-form { display: grid; gap: 11px; }
.signup-approval-form fieldset { min-width: 0; margin: 0; padding: 11px; border: 1px solid var(--line); border-radius: 11px; }
.signup-approval-form legend { padding: 0 6px; font-size: 11px; font-weight: 950; }
.signup-approval-form fieldset>p { margin: 0 0 8px; color: var(--muted); font-size: 9px; }
.signup-permission-grid { max-height: 260px; overflow: auto; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
.signup-permission-grid>label { min-width: 0; padding: 8px; display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.signup-permission-grid input { width: 16px; height: 16px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--cyan); }
.signup-permission-grid span { min-width: 0; display: grid; gap: 3px; }
.signup-permission-grid b { font-size: 10px; }
.signup-permission-grid small { color: var(--muted); font-size: 8px; line-height: 1.4; }
.signup-reject-form { margin-top: 11px; padding-top: 11px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: end; border-top: 1px solid var(--line); }
.signup-empty { min-height: 300px; display: grid; place-content: center; justify-items: center; text-align: center; }
.signup-empty i { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 50%; color: var(--run); background: color-mix(in srgb,var(--run) 12%,var(--surface)); font-size: 30px; font-style: normal; }
.signup-empty h3 { margin: 13px 0 4px; }
.signup-empty p { margin: 0; color: var(--muted); }

.drawer-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; justify-items: end; background: rgba(1,9,14,.54); }
.drawer-backdrop[hidden] { display: none; }
.drawer { width: min(460px, 100vw); height: 100%; padding: 18px; overflow: auto; color: var(--ink); background: var(--surface); box-shadow: -20px 0 50px rgba(0,0,0,.25); }
.drawer-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.drawer-header h2 { margin: 0; }
.drawer-status { margin: 16px 0; padding: 16px; display: flex; align-items: center; gap: 12px; border-radius: 12px; color: #fff; }
.drawer-status.RUN { background: var(--run); } .drawer-status.STOP { background: linear-gradient(135deg,var(--machine-stop),var(--machine-stop-dark)); } .drawer-status.LONG_STOP, .drawer-status.NO_COMM, .drawer-status.NO_DATA { background: #11161a; border: 1px solid #6c7880; }
.drawer-status.WAIT { color: var(--long-wait-strong); background: linear-gradient(135deg, color-mix(in srgb,var(--long-wait) 15%,var(--surface-2)), var(--surface)); border: 2px solid var(--long-wait); box-shadow: inset 5px 0 0 var(--long-wait); }
.drawer-status b { display: block; font-size: 22px; } .drawer-status small { margin-top: 5px; display: block; color: rgba(255,255,255,.8); }
.drawer-status.WAIT small { color: var(--muted); }
.drawer-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
.drawer-metrics .mini-kpi { min-width: 0; padding: 8px; }
.drawer-metrics .mini-kpi b { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.drawer-tabs { margin-top: 14px; display: grid; grid-template-columns: repeat(4,1fr); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.drawer-tabs button { min-width: 0; min-height: 42px; padding: 6px 4px; border: 0; border-right: 1px solid var(--line); color: var(--muted); background: var(--surface-2); font-size: 9px; font-weight: 900; }
.drawer-tabs button:last-child { border-right: 0; }
.drawer-tabs button.selected { color: #fff; background: #0d7481; }
.drawer-tabs em { margin-left: 3px; padding: 1px 4px; border-radius: 999px; color: #07313a; background: #a7eef1; font-size: 7px; font-style: normal; }
.drawer-tab-panel { padding-top: 12px; }
.drawer-active-work-state { margin-top:9px;padding:9px 12px;display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:9px;align-items:center;border:1px solid rgba(14,154,98,.28);border-radius:10px;color:#087549;background:rgba(14,154,98,.1); }
.drawer-active-work-state span { color:var(--muted);font-size:9px;font-weight:900; }
.drawer-active-work-state b { font-size:13px;font-weight:950; }
.drawer-active-work-state small { color:inherit;font-size:9px;font-weight:900; }
.drawer-active-work-state.waiting { border-color:rgba(255,201,65,.62);color:#8a5700;background:rgba(255,201,65,.16);box-shadow:inset 3px 0 0 #ffc941; }
.drawer-empty-work { padding: 34px 16px; border: 1px dashed var(--line); border-radius: 12px; text-align: center; }
.drawer-empty-work p { color: var(--muted); font-size: 10px; line-height: 1.6; }
.drawer-work-card { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.work-start-pending { display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 13px;border-bottom:1px solid rgba(225,130,0,.34);background:linear-gradient(90deg,rgba(225,130,0,.2),rgba(225,130,0,.06));color:#bd6800; }
.work-start-pending strong { font-size:12px;font-weight:950;white-space:nowrap; }
.work-start-pending span { font-size:9px;font-weight:850;text-align:right; }
.work-progress > strong.start-pending { color:#d67b00; }
.equipment-order.start-pending { background:#d67b00;color:#fff; }
.work-detail-grid { margin: 0; padding: 4px 13px; }
.work-detail-grid > div { min-height: 38px; display: grid; grid-template-columns: 115px minmax(0,1fr); align-items: center; border-bottom: 1px solid var(--line); }
.work-detail-grid > div:last-child { border-bottom: 0; }
.work-detail-grid dt { color: var(--muted); font-size: 9px; font-weight: 900; }
.work-detail-grid dd { margin: 0; overflow-wrap: anywhere; font-size: 12px; font-weight: 850; }
.work-detail-grid dd small { color: var(--muted); }
.work-progress { padding: 11px 13px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 5px 10px; align-items: center; background: var(--surface-2); }
.work-progress > span { grid-column: 1/-1; display: flex; justify-content: space-between; }
.work-progress em { font-style: normal; font-weight: 900; }
.work-progress > div { height: 11px; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.work-progress > div i { height: 100%; display: block; background: linear-gradient(90deg, #22c3c7, #24b37c); }
.work-progress > strong { color: var(--run); font-size: 10px; }
.drawer-work-actions { padding: 10px; display: grid; grid-template-columns: repeat(2,1fr); gap: 6px; border-top: 1px solid var(--line); }
.original-document-link { text-decoration:none; }.drawer-work-actions .original-document-link { display:inline-grid;place-items:center; }
.drawer-queue, .reason-history { display: grid; gap: 7px; }
.queue-card { min-height: 62px; padding: 8px 9px; display: grid; grid-template-columns: 22px minmax(0,1fr) auto auto; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }.queue-document-link { padding:5px 7px;border:1px solid var(--line);border-radius:6px;color:var(--cyan);font-size:8px;font-weight:900;text-decoration:none;white-space:nowrap; }
.queue-card b { display: block; font-size: 13px; }.queue-card small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.queue-handle { color: var(--muted); font-size: 18px; }
.queue-move { display: grid; grid-template-columns: repeat(2,28px); gap: 3px; }
.queue-move button { height: 28px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--surface); }
.reason-history article { padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.reason-history small { margin-top: 4px; display: block; color: var(--muted); font-size: 9px; }
.audit-list { margin: 0; padding: 0; list-style: none; }
.audit-list li { min-height: 48px; padding-left: 22px; position: relative; display: flex; align-items: center; border-left: 1px solid var(--line); }
.audit-list i { width: 9px; height: 9px; position: absolute; left: -5px; border: 2px solid var(--surface); border-radius: 50%; background: var(--cyan); }
.audit-list small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }

.toast { position: fixed; right: 18px; bottom: 18px; z-index: 70; max-width: 360px; padding: 12px 15px; border-radius: 10px; color: #fff; background: #133644; box-shadow: 0 12px 32px rgba(0,0,0,.3); font-weight: 800; }
.toast.error { background: #9f2630; }
.empty { padding: 24px; color: var(--muted); text-align: center; border: 1px dashed var(--line); border-radius: 10px; }

.work-management-head { margin-bottom: 10px; padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; gap: 18px; background: linear-gradient(115deg,var(--surface),color-mix(in srgb,var(--cyan) 8%,var(--surface))); }
.work-management-head small { color: var(--cyan); font-size: 9px; font-weight: 950; letter-spacing: .14em; }
.work-management-head h2 { margin: 3px 0; font-size: clamp(22px,2vw,28px); }.work-management-head p { margin: 0; color: var(--muted); font-size: 11px; line-height:1.5; }
.work-management-stats { display: flex; align-items: center; gap: 8px; }
.work-management-stats span { min-width: 78px; padding: 7px 10px; display: grid; border-left: 1px solid var(--line); color: var(--muted); font-size: 8px; }
.work-management-stats b { color: var(--ink); font-size: 18px; }
.work-toolbar { padding-block: 8px; }
.work-management-layout { display: grid; grid-template-columns: minmax(300px,.7fr) minmax(500px,1.3fr); gap: 10px; }
.completed-history-head { margin-bottom: 10px; padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; gap: 18px; background: linear-gradient(115deg,var(--surface),color-mix(in srgb,var(--cyan) 8%,var(--surface))); }
.completed-history-head small { color: var(--cyan); font-size: 9px; font-weight: 950; letter-spacing: .14em; }
.completed-history-head h2 { margin: 3px 0; font-size: clamp(22px,2vw,28px); }
.completed-history-head p { margin: 0; color: var(--muted); font-size: 11px; line-height:1.5; }
.completed-history-kpis { display: grid; grid-template-columns: repeat(4,minmax(92px,1fr)); min-width: min(510px,48vw); }
.completed-history-kpis span { min-width: 0; padding: 7px 12px; display: grid; border-left: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height:1.35; }
.completed-history-kpis b { color: var(--ink); font-size: 17px; white-space: nowrap; }
.completed-history-kpis .good b, .completed-summary .good dd, .completed-allocation-row .good dd, .completed-quantity-history .good dd { color: var(--run); }
.completed-history-kpis .defect b, .completed-summary .defect dd, .completed-allocation-row .defect dd, .completed-quantity-history .defect dd { color: var(--stop); }
.completed-history-toolbar { margin-bottom: 10px; }
.completed-history-toolbar .filter-group { flex: 1; }
.completed-history-layout { display: grid; grid-template-columns: minmax(300px,.72fr) minmax(610px,1.5fr); gap: 10px; align-items: start; }
.completed-order-list-card, .completed-detail-card { min-width: 0; padding: 14px; }
.completed-order-list { max-height: calc(100vh - 315px); overflow: auto; display: grid; align-content: start; gap: 6px; padding-right: 3px; }
.completed-order-row { width: 100%; min-width: 0; padding: 11px 10px; display: grid; grid-template-columns: minmax(0,1fr) auto 14px; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--ink); text-align: left; cursor: pointer; }
.completed-order-row:hover, .completed-order-row.selected { border-color: color-mix(in srgb,var(--cyan) 55%,var(--line)); background: color-mix(in srgb,var(--cyan) 9%,var(--surface-2)); }
.completed-order-row span { min-width: 0; display: grid; gap: 2px; }
.completed-order-row b { font-size: 12px; }
.completed-order-row strong { font-size: 10px; text-align: right; }
.completed-order-row small { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.completed-order-row i { color: var(--cyan); font-size: 20px; font-style: normal; }
.completed-detail-heading { align-items: flex-start; }
.completed-detail-heading h2 { margin: 5px 0 2px; font-size: 22px; }
.completed-detail-heading p { margin: 0; color: var(--muted); }
.completed-detail-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 7px; max-width: 420px; }
.completed-detail-actions small { flex-basis: 100%; color: var(--muted); font-size: 8px; text-align: right; }
.completed-summary { margin: 12px 0; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; }
.completed-summary div { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.completed-summary dt, .completed-allocation-row dt, .completed-quantity-history dt { color: var(--muted); font-size: 8px; }
.completed-summary dd, .completed-allocation-row dd, .completed-quantity-history dd { margin: 3px 0 0; color: var(--ink); font-size: 11px; font-weight: 850; }
.completed-master-note { margin-bottom: 12px; padding: 10px 12px; border-left: 3px solid var(--cyan); border-radius: 7px; background: color-mix(in srgb,var(--cyan) 8%,var(--surface-2)); }
.completed-master-note b { font-size: 9px; }
.completed-master-note p { margin: 4px 0 0; color: var(--muted); font-size: 10px; white-space: pre-wrap; }
.completed-allocation-section, .completed-note-section { margin-top: 12px; }
.completed-allocation-list, .completed-quantity-history { display: grid; gap: 7px; }
.completed-allocation-row { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.completed-allocation-row header { padding: 8px 10px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); background: color-mix(in srgb,var(--run) 7%,var(--surface-2)); }
.completed-allocation-row header strong { font-size: 13px; }
.completed-allocation-row header span { color: var(--muted); font-size: 9px; font-weight: 800; }
.completed-allocation-row dl { margin: 0; padding: 9px 10px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; }
.completed-allocation-row dl div { min-width: 0; }
.completed-quality-review { margin: 0 10px 10px; padding: 11px; border: 1px solid var(--line); border-left-width: 4px; border-radius: 10px; background: var(--surface); }
.completed-quality-review.PENDING { border-left-color: #c56b00; background: color-mix(in srgb,#c56b00 5%,var(--surface)); }
.completed-quality-review.APPROVED { border-left-color: var(--run); background: color-mix(in srgb,var(--run) 5%,var(--surface)); }
.completed-quality-review.REJECTED { border-color: color-mix(in srgb,var(--stop) 54%,var(--line)); border-left-color: var(--stop); background: color-mix(in srgb,var(--stop) 8%,var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--stop) 12%,transparent); }
.completed-quality-review-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.completed-quality-review-top > div { min-width: 0; display: grid; gap: 3px; }
.completed-quality-review-top small,.completed-quality-meta small { color: var(--muted); font-size: 8px; font-weight: 850; }
.completed-quality-review-top strong { color: var(--ink); font-size: 12px; }
.completed-quality-meta { margin-top: 9px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.completed-quality-meta > span { min-width: 0; padding: 8px 9px; display: grid; gap: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.completed-quality-meta b { overflow-wrap: anywhere; color: var(--ink); font-size: 10px; }
.completed-quality-note { margin-top: 8px; padding: 9px 10px; border-left: 3px solid var(--run); border-radius: 7px; background: color-mix(in srgb,var(--run) 7%,var(--surface-2)); }
.completed-quality-note b { color: var(--ink); font-size: 9px; }
.completed-quality-note p { margin: 4px 0 0; overflow-wrap: anywhere; color: var(--ink); font-size: 10px; font-weight: 750; line-height: 1.55; white-space: pre-wrap; }
.completed-quality-note.rejection { border: 1px solid color-mix(in srgb,var(--stop) 42%,var(--line)); border-left: 4px solid var(--stop); background: color-mix(in srgb,var(--stop) 12%,var(--surface-2)); }
.completed-quality-note.rejection b,.completed-quality-note.rejection p { color: color-mix(in srgb,var(--stop) 86%,var(--ink)); }
.completed-quality-note.rejection b { font-size: 11px; }
.completed-quality-pending { margin: 9px 0 0; padding: 9px 10px; border-radius: 7px; color: #8a4c00; background: color-mix(in srgb,#c56b00 11%,var(--surface-2)); font-size: 10px; font-weight: 850; line-height: 1.5; }
.completed-quantity-history article { padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.completed-quantity-history article header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.completed-quantity-history article header b { color: var(--cyan); font-size: 11px; }
.completed-quantity-history article time { color: var(--muted); font-size: 8px; }
.completed-quantity-history dl { margin: 8px 0; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.completed-quantity-history p { margin: 0; padding-top: 8px; border-top: 1px dashed var(--line); color: var(--ink); font-size: 9px; white-space: pre-wrap; }
.completed-audit-loading { padding: 18px; color: var(--muted); text-align: center; }

/* Final quality review */
.quality-review-head { margin-bottom: 10px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 22px; background: linear-gradient(115deg,var(--surface),color-mix(in srgb,var(--cyan) 8%,var(--surface))); }
.quality-review-head > div:first-child { min-width: 0; flex: 1 1 auto; }
.quality-review-head small { color: var(--cyan); font-size: 9px; font-weight: 950; letter-spacing: .14em; }
.quality-review-head h2 { margin: 4px 0; font-size: clamp(22px,2vw,28px); line-height: 1.2; }
.quality-review-head p { max-width: 820px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
.quality-review-kpis { min-width: min(430px,44vw); display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
.quality-review-kpis span { min-width: 0; padding: 7px 13px; display: grid; gap: 2px; border-left: 1px solid var(--line); color: var(--muted); font-size: 9px; font-weight: 850; line-height: 1.3; }
.quality-review-kpis b { color: var(--ink); font-size: 20px; font-variant-numeric: tabular-nums; }
.quality-review-kpis .PENDING b { color: #c56b00; }
.quality-review-kpis .APPROVED b { color: var(--run); }
.quality-review-kpis .REJECTED b { color: var(--stop); }
.quality-review-toolbar { padding-block: 9px; }
.quality-review-toolbar .filter-group { min-width: 0; flex: 1; flex-wrap: nowrap; }
.quality-review-toolbar .field.grow { min-width: 260px; }
.quality-review-toolbar .field:not(.grow) { min-width: 190px; }
.quality-review-layout { display: grid; grid-template-columns: minmax(320px,.72fr) minmax(540px,1.45fr); gap: 10px; align-items: start; }
.quality-review-list-card,.quality-review-detail-card { min-width: 0; padding: 15px; }
.quality-review-list-card .card-heading { align-items: center; }
.card-count { min-width: 34px; padding: 4px 8px; display: inline-grid; place-items: center; border-radius: 999px; color: #fff; background: var(--navy-2); font-size: 11px; }
.quality-review-list { max-height: calc(100vh - 320px); min-height: 180px; overflow: auto; display: grid; align-content: start; gap: 7px; padding-right: 3px; overscroll-behavior: contain; scrollbar-gutter: stable; }
.quality-review-row { width: 100%; min-width: 0; min-height: 68px; padding: 10px 11px; display: grid; grid-template-columns: minmax(0,1.25fr) minmax(88px,.55fr) auto 13px; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: var(--surface-2); text-align: left; transition: border-color .15s ease,background .15s ease,box-shadow .15s ease; }
.quality-review-row:hover,.quality-review-row:focus-visible,.quality-review-row.selected { border-color: color-mix(in srgb,var(--cyan) 62%,var(--line)); background: color-mix(in srgb,var(--cyan) 9%,var(--surface-2)); outline: 0; }
.quality-review-row.selected { box-shadow: inset 3px 0 var(--cyan); }
.quality-review-row > span { min-width: 0; }
.quality-review-row b,.quality-review-row strong { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.quality-review-row > span:nth-child(2) { text-align: right; }
.quality-review-row > span:nth-child(2) strong { color: var(--cyan); font-size: 14px; }
.quality-review-row small { margin-top: 4px; display: block; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.quality-review-row > i { color: var(--cyan); font-size: 20px; font-style: normal; }
.quality-status { width: max-content; max-width: 100%; min-height: 23px; padding: 3px 8px; display: inline-flex !important; align-items: center; justify-content: center; border-radius: 999px; color: #fff; font-size: 9px !important; font-style: normal; font-weight: 950; line-height: 1.2; text-align: center; white-space: normal; }
.quality-status.PENDING { background: #c56b00; }
.quality-status.APPROVED { background: var(--run); }
.quality-status.REJECTED { background: var(--stop); }
.quality-status.REREVIEW { background: #607581; }
.completed-order-row .quality-status { margin: 0 0 4px auto; }
.completed-allocation-row header .quality-status { margin-left: 8px; color: #fff; }
.quality-detail-heading { align-items: flex-start; }
.quality-detail-heading h2 { margin: 7px 0 2px; overflow-wrap: anywhere; font-size: 23px; }
.quality-detail-heading p { margin: 0; color: var(--muted); }
.quality-detail-actions { max-width: 470px; display: flex; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.quality-rereview-button { min-width: 112px; }
.quality-summary { margin: 13px 0; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; }
.quality-summary div { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.quality-summary dt,.quality-production-info dt,.quality-review-record dt { color: var(--muted); font-size: 9px; font-weight: 850; }
.quality-summary dd,.quality-production-info dd,.quality-review-record dd { margin: 5px 0 0; overflow-wrap: anywhere; color: var(--ink); font-size: 13px; font-weight: 900; }
.quality-summary .good dd { color: var(--run); }
.quality-summary .defect dd { color: var(--stop); }
.quality-production-info,.quality-review-record { margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.quality-production-info h3 { margin: 0 0 11px; font-size: 14px; }
.quality-production-info dl { margin: 0; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 0; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.quality-production-info dl > div { min-width: 0; padding: 10px 11px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.quality-production-info dl > div:nth-child(3n) { border-right: 0; }
.quality-production-info dl > div:nth-last-child(-n+3) { border-bottom: 0; }
.quality-review-record .card-heading { min-height: 0; margin-bottom: 10px; }
.quality-review-record dl { margin: 0; display: grid; grid-template-columns: minmax(150px,.55fr) minmax(180px,.65fr) minmax(220px,1.4fr); gap: 8px; }
.quality-review-record dl > div { min-width: 0; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.quality-review-record .note dd { white-space: pre-wrap; }
.quality-action-hint,.quality-readonly-hint { margin: 10px 0 0; padding: 9px 11px; border-left: 3px solid var(--cyan); color: var(--muted); background: var(--surface); font-size: 10px; line-height: 1.5; }
.quality-readonly-hint { border-left-color: #8797a1; }
.quality-review-dialog { width: min(900px,100%); max-height: calc(100vh - 28px); overflow: auto; scrollbar-gutter: stable; }
.quality-review-dialog .modal-heading h2 { margin-top: 8px; }
.quality-previous-review { margin: 0 0 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.quality-previous-review-heading { margin-bottom: 9px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.quality-previous-review-heading strong { font-size: 12px; }
.quality-previous-review dl { margin: 0; display: grid; grid-template-columns: minmax(130px,.55fr) minmax(170px,.7fr) minmax(220px,1.4fr); gap: 7px; }
.quality-previous-review dl > div { min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.quality-previous-review dt { color: var(--muted); font-size: 9px; font-weight: 850; }
.quality-previous-review dd { margin: 4px 0 0; overflow-wrap: anywhere; color: var(--ink); font-size: 11px; font-weight: 850; }
.quality-previous-review .note dd { white-space: pre-wrap; }
.quality-decision-picker { margin: 0 0 12px; padding: 11px 12px 12px; border: 1px solid color-mix(in srgb,var(--cyan) 42%,var(--line)); border-radius: 12px; background: color-mix(in srgb,var(--cyan) 5%,var(--surface)); }
.quality-decision-picker legend { padding: 0 6px; color: var(--muted); font-size: 9px; font-weight: 900; }
.quality-decision-picker > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quality-decision-picker .button { min-height: 42px; opacity: .62; }
.quality-decision-picker .button.selected { opacity: 1; box-shadow: 0 0 0 3px color-mix(in srgb,var(--cyan) 20%,transparent); }
.quality-decision-picker > p { margin: 9px 0 0; color: #c56b00; font-size: 10px; font-weight: 900; text-align: center; }
.quality-dialog-hint { margin: 0 0 13px; padding: 10px 12px; border-left: 3px solid var(--cyan); color: var(--muted); background: var(--surface-2); font-size: 11px; line-height: 1.55; }
.quality-dialog-hint.awaiting-decision { border-left-color: #c56b00; }
.quality-review-dialog textarea { min-height: 132px; }
.quality-dialog-actions { margin-top: 16px; display: flex; justify-content: flex-end; gap: 8px; }
.quality-dialog-actions .button { min-width: 130px; }
.quality-attachment-record { margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.quality-attachment-record .card-heading { min-height: 0; margin-bottom: 10px; align-items: center; }
.quality-attachment-editor { margin: 12px 0; padding: 13px; border: 1px solid color-mix(in srgb,var(--cyan) 45%,var(--line)); border-radius: 13px; background: var(--surface-2); }
.quality-attachment-editor-heading { margin-bottom: 10px; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.quality-attachment-editor-heading > div { min-width: 0; }
.quality-attachment-editor-heading h3 { margin: 0; font-size: 14px; }
.quality-attachment-editor-heading p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.quality-attachment-editor-heading > span { flex: 0 0 auto; padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface); font-size: 9px; font-weight: 900; white-space: nowrap; }
.quality-attachment-dropzone { min-height: 86px; padding: 13px 15px; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 12px; border: 2px dashed color-mix(in srgb,var(--cyan) 68%,var(--line)); border-radius: 12px; color: var(--ink); background: color-mix(in srgb,var(--cyan) 7%,var(--surface)); outline: 0; transition: border-color .16s ease,background .16s ease,box-shadow .16s ease; }
.quality-attachment-dropzone:hover,.quality-attachment-dropzone:focus-visible,.quality-attachment-dropzone.drag-active { border-color: var(--cyan); background: color-mix(in srgb,var(--cyan) 14%,var(--surface)); box-shadow: inset 0 0 0 3px color-mix(in srgb,var(--cyan) 13%,transparent); }
.quality-attachment-dropzone.busy { opacity: .72; pointer-events: none; }
.quality-attachment-dropzone > i { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(145deg,var(--cyan),#087287); font-size: 25px; font-style: normal; font-weight: 900; }
.quality-attachment-dropzone strong { display: block; overflow-wrap: anywhere; font-size: 12px; }
.quality-attachment-dropzone small { margin-top: 4px; display: block; color: var(--muted); font-size: 9px; line-height: 1.45; overflow-wrap: anywhere; }
.quality-attachment-source-actions { min-width: 150px; display: grid; grid-template-columns: 1fr; gap: 6px; }
.quality-attachment-source-actions .button { width: 100%; min-width: 0; white-space: normal; line-height: 1.25; }
.quality-screen-capture { border-color: color-mix(in srgb,var(--cyan) 65%,var(--line)); background: color-mix(in srgb,var(--cyan) 9%,var(--surface)); }
.quality-screen-capture:not(:disabled):hover,.quality-screen-capture:not(:disabled):focus-visible { color: #fff; background: linear-gradient(135deg,#119da5,#087287); }
.quality-screen-capture-hint,.quality-screen-capture-privacy { margin: 6px 1px 0; overflow-wrap: anywhere; font-size: 9px; line-height: 1.45; }
.quality-screen-capture-hint { color: var(--muted); }
.quality-screen-capture-privacy { color: color-mix(in srgb,var(--run) 82%,var(--muted)); font-weight: 800; }
.quality-attachment-error { margin: 8px 0 0; padding: 8px 10px; border-left: 3px solid var(--stop); color: var(--stop); background: color-mix(in srgb,var(--stop) 8%,var(--surface)); font-size: 10px; font-weight: 850; line-height: 1.45; }
.quality-attachment-subheading { margin: 12px 0 7px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.quality-attachment-subheading b { font-size: 11px; }
.quality-attachment-subheading small { color: var(--muted); font-size: 9px; text-align: right; }
.quality-attachment-list { min-width: 0; display: grid; gap: 6px; }
.quality-attachment-item { min-width: 0; padding: 8px 9px; display: grid; grid-template-columns: 34px minmax(0,1fr) auto auto; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.quality-attachment-item.finalized { background: color-mix(in srgb,var(--run) 4%,var(--surface)); }
.quality-attachment-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; color: #087987; background: color-mix(in srgb,var(--cyan) 13%,var(--surface-2)); font-size: 18px; font-weight: 950; }
.quality-attachment-copy { min-width: 0; }
.quality-attachment-copy b { display: block; overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.quality-attachment-copy small { margin-top: 3px; display: block; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.quality-attachment-state { min-width: 65px; padding: 3px 7px; border-radius: 999px; color: #fff; background: #c56b00; font-size: 8px; font-weight: 950; text-align: center; white-space: nowrap; }
.quality-attachment-state.finalized { background: var(--run); }
.quality-attachment-actions { min-width: 0; display: flex; justify-content: flex-end; gap: 5px; flex-wrap: wrap; }
.quality-attachment-actions .button { min-height: 30px; padding: 4px 7px; font-size: 9px; }
.quality-attachment-empty { min-height: 48px; padding: 12px; display: grid; place-items: center; border: 1px dashed var(--line); border-radius: 9px; color: var(--muted); background: var(--surface); font-size: 9px; text-align: center; }
.quality-upload-queue { margin-top: 8px; display: grid; gap: 5px; }
.quality-upload-item { min-width: 0; padding: 7px 9px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.quality-upload-item > div:first-child { min-width: 0; }
.quality-upload-item b { display: block; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.quality-upload-item small { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; }
.quality-upload-item > span { color: var(--muted); font-size: 9px; font-weight: 900; }
.quality-upload-item.complete > span { color: var(--run); }
.quality-upload-item.error > span,.quality-upload-item > p { color: var(--stop); }
.quality-upload-progress { grid-column: 1 / -1; height: 5px; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.quality-upload-progress i { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg,var(--cyan),var(--run)); transition: width .15s ease; }
.quality-upload-item.error .quality-upload-progress i { background: var(--stop); }
.quality-upload-item > p { grid-column: 1 / -1; margin: 1px 0 0; font-size: 9px; font-weight: 800; line-height: 1.4; }
.quality-finalized-details { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.quality-finalized-details summary { color: var(--ink); font-size: 10px; font-weight: 900; cursor: pointer; }
.quality-finalized-details summary b { margin-left: 5px; padding: 2px 6px; border-radius: 999px; color: #fff; background: var(--run); font-size: 8px; }
.quality-finalized-details[open] summary { margin-bottom: 9px; }
.quality-review-note-field { margin-top: 12px; }

.work-order-list-card,.work-plan-card { min-width: 0; padding: 14px; }
.work-order-list { max-height: 660px; display: grid; gap: 5px; overflow: auto; }
.work-order-row { min-height: 58px; padding: 7px 8px; display: grid; grid-template-columns: 8px minmax(0,1fr) minmax(82px,.5fr); align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--surface-2); text-align: left; }
.work-order-row.selected { border-color: var(--cyan); background: color-mix(in srgb,var(--cyan) 9%,var(--surface)); box-shadow: inset 3px 0 var(--cyan); }
.work-order-row small { margin-top: 3px; display: block; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.work-order-row > span:last-child { text-align: right; }.work-order-row > span:last-child strong { font-size: 10px; }
.work-order-status { width: 7px;height: 31px;border-radius: 4px;background:#8697a2; }.work-order-status.DRAFT { background:#8797a1; }.work-order-status.QUEUED { background:#1598ae; }.work-order-status.IN_PROGRESS,.work-order-status.RUNNING { background:var(--run); }.work-order-status.PAUSED,.work-order-status.WAITING,.work-order-status.WAIT { background:#f59e0b; }.work-order-status.CANCELLED { background:var(--stop); }.work-order-status.COMPLETED { background:var(--cyan); }
.work-plan-heading h2 { margin: 6px 0 2px; font-size: 24px; }.work-plan-heading > div:last-child { display:flex;gap:6px; }
.work-order-chip { padding: 4px 7px;border-radius:999px;color:#fff;background:#71838e;font-size:8px;font-weight:950; }.work-order-chip.DRAFT { background:#71838e; }.work-order-chip.QUEUED { background:#117f96; }.work-order-chip.IN_PROGRESS,.work-order-chip.RUNNING { background:var(--run); }.work-order-chip.PAUSED,.work-order-chip.WAITING,.work-order-chip.WAIT { background:#d67b00; }.work-order-chip.CANCELLED { background:var(--stop); }
.planning-summary { margin: 10px 0; display:grid;grid-template-columns:repeat(4,1fr);border:1px solid var(--line);border-radius:10px;overflow:hidden; }
.planning-summary div { padding:10px;border-right:1px solid var(--line); }.planning-summary div:last-child { border:0; }.planning-summary dt { color:var(--muted);font-size:8px;font-weight:900; }.planning-summary dd { margin:5px 0 0;font-size:12px;font-weight:900; }
.assignment-form { padding:13px;border:1px solid var(--line);border-radius:11px;background:var(--surface-2); }.assignment-form h3 { margin:0 0 10px; }
.planning-queue { margin-top:14px; }.management-queue { display:grid;gap:6px; }.management-queue-row { min-height:58px;padding:7px 9px;display:grid;grid-template-columns:30px minmax(0,1fr) 65px auto;align-items:center;gap:8px;border:1px solid var(--line);border-radius:9px;background:var(--surface-2); }.management-queue-row small { display:block;margin-top:3px;color:var(--muted);font-size:8px; }.queue-number { width:26px;height:26px;display:grid;place-items:center;border-radius:7px;color:#fff;background:var(--navy-2);font-weight:900; }.queue-machine { color:var(--cyan);font-weight:900;text-align:center; }
.work-order-dialog { width:min(680px,100%); }.reason-dialog { width:min(620px,100%); }.reason-grid { display:grid;grid-template-columns:repeat(3,1fr);gap:7px; }.reason-grid label { min-height:62px;position:relative;display:grid;place-items:center;border:1px solid var(--line);border-radius:9px;background:var(--surface-2);font-weight:850;text-align:center; }.reason-grid input { position:absolute;opacity:0; }.reason-grid label:has(input:checked) { border-color:#f59e0b;color:#c56b00;background:color-mix(in srgb,#f59e0b 12%,var(--surface));box-shadow:inset 0 0 0 2px rgba(245,158,11,.25); }.reason-note { margin:10px 0; }
.production-order-search-dialog { width:min(760px,100%);max-height:min(760px,calc(100vh - 36px));overflow:auto; }.production-order-search-list { display:grid;gap:8px;margin:14px 0; }.production-order-search-item { width:100%;min-height:68px;padding:10px 12px;display:grid;grid-template-columns:110px minmax(0,1fr) 150px 18px;align-items:center;gap:12px;border:1px solid var(--line);border-radius:11px;color:var(--ink);background:var(--surface-2);text-align:left; }.production-order-search-item:hover,.production-order-search-item:focus-visible { border-color:var(--cyan);box-shadow:0 0 0 2px color-mix(in srgb,var(--cyan) 18%,transparent);outline:0; }.production-order-search-item.unassigned { grid-template-columns:minmax(0,1fr) auto; }.production-order-search-item small { display:block;margin-top:4px;color:var(--muted);font-size:9px; }.search-machine-code { color:var(--cyan);font-size:18px;font-weight:950;white-space:nowrap; }.search-allocation-quantity { text-align:right; }.search-allocation-quantity b { font-size:13px; }.production-order-search-item>i { color:var(--cyan);font-size:24px;font-style:normal; }.production-order-manage { width:100%; }
@media (max-width:720px) { .production-order-search-item { grid-template-columns:82px minmax(0,1fr) 100px 14px;gap:7px;padding:9px; }.search-machine-code { font-size:14px; }.search-allocation-quantity b { font-size:11px; } }

.ocr-work-order-dialog { width:min(1280px,calc(100vw - 30px)); max-height:calc(100vh - 30px); overflow:auto; }
.section-title,.manual-entry-heading { display:flex;align-items:flex-start;justify-content:space-between;gap:12px; }
.section-title h3,.manual-entry-heading h3 { margin:0;font-size:15px; }.section-title p,.manual-entry-heading p { margin:4px 0 0;color:var(--muted);font-size:10px;line-height:1.5; }
.ocr-upload-section { padding:14px;border:1px solid var(--line);border-radius:13px;background:var(--surface-2); }
.ocr-ready-mark { padding:5px 8px;border-radius:999px;color:#fff;background:var(--run);font-size:9px;font-weight:900; }
.ocr-ready-mark.review-needed { color:#422800;background:#f3b13d; }
.original-viewer-backdrop { z-index:140; }.original-viewer-dialog { width:min(1380px,96vw);height:min(900px,94vh);padding:12px;display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:10px;border:1px solid var(--line);border-radius:16px;color:var(--ink);background:var(--surface);box-shadow:0 30px 100px rgba(0,0,0,.55); }.original-viewer-dialog>header { display:flex;align-items:center;justify-content:space-between;gap:12px;padding:2px 3px; }.original-viewer-dialog>header small { color:var(--muted);font-size:9px;font-weight:900; }.original-viewer-dialog>header h2 { max-width:min(1050px,75vw);margin:3px 0 0;overflow:hidden;font-size:17px;text-overflow:ellipsis;white-space:nowrap; }.original-viewer-frame { min-height:0;overflow:hidden;border:1px solid var(--line);border-radius:11px;background:#151d22; }.original-viewer-frame object,.original-viewer-frame iframe { width:100%;height:100%;display:block;border:0;background:#fff; }.original-viewer-frame object>p { padding:30px;color:#fff;text-align:center; }.original-viewer-dialog>footer { display:flex;justify-content:flex-end; }
.ocr-document-actions { display:flex;align-items:center;justify-content:flex-end;gap:7px;flex-wrap:wrap; }
.ocr-upload-layout { margin-top:10px;display:grid;grid-template-columns:minmax(320px,.9fr) minmax(360px,1.1fr);gap:12px; }.ocr-upload-layout.has-preview { grid-template-columns:minmax(220px,260px) minmax(560px,1fr); }
.work-order-dropzone { min-height:245px;padding:20px;display:grid;place-content:center;justify-items:center;gap:8px;border:2px dashed color-mix(in srgb,var(--cyan) 72%,var(--line));border-radius:13px;color:var(--ink);background:color-mix(in srgb,var(--cyan) 7%,var(--surface));text-align:center;outline:0;transition:.18s ease; }
.work-order-dropzone:hover,.work-order-dropzone:focus-visible,.work-order-dropzone.drag-active { border-color:var(--cyan);background:color-mix(in srgb,var(--cyan) 16%,var(--surface));box-shadow:inset 0 0 0 3px color-mix(in srgb,var(--cyan) 16%,transparent);transform:translateY(-1px); }
.work-order-dropzone.busy { opacity:.7;pointer-events:none; }.dropzone-icon { width:52px;height:52px;display:grid;place-items:center;border-radius:50%;color:#fff;background:linear-gradient(145deg,var(--cyan),#087287);font-size:29px;font-weight:900; }.work-order-dropzone strong { font-size:15px; }.work-order-dropzone small { color:var(--muted);font-size:10px; }.dropzone-actions { margin-top:5px;display:flex;gap:7px; }
.dropzone-actions { width:min(100%,420px);display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px; }
.dropzone-actions .button { min-width:0;justify-content:center;white-space:normal;line-height:1.25; }
.dropzone-actions .screen-capture-button { grid-column:1/-1;border-color:color-mix(in srgb,var(--cyan) 72%,var(--line));background:color-mix(in srgb,var(--cyan) 11%,var(--surface)); }
.dropzone-actions .screen-capture-button:not(:disabled):hover,.dropzone-actions .screen-capture-button:not(:disabled):focus-visible { color:#fff;background:linear-gradient(135deg,#119da5,#087287); }
.work-order-dropzone .screen-capture-hint,.work-order-dropzone .screen-capture-privacy { width:min(100%,460px);display:block;overflow-wrap:anywhere;line-height:1.45; }
.work-order-dropzone .screen-capture-privacy { color:color-mix(in srgb,var(--run) 82%,var(--muted));font-size:9px; }
.ocr-preview { min-width:0;height:245px;margin:0;position:relative;overflow:hidden;border:1px solid var(--line);border-radius:13px;background:#19252d; }.ocr-upload-layout.has-preview .work-order-dropzone,.ocr-upload-layout.has-preview .ocr-preview { min-height:440px;height:440px; }
.ocr-preview figcaption { min-height:42px;padding:6px 9px;display:flex;align-items:center;justify-content:space-between;gap:8px;color:#fff;background:#10191f;font-size:9px;font-weight:850; }.ocr-preview figcaption>span:first-child { min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }.ocr-preview-actions { display:flex;align-items:center;justify-content:flex-end;gap:4px;white-space:nowrap; }.ocr-preview-actions button,.ocr-preview-actions a { min-width:29px;height:29px;padding:0 7px;display:inline-grid;place-items:center;border:1px solid #41535e;border-radius:6px;color:#fff;background:#263640;font:inherit;text-decoration:none;cursor:pointer; }.ocr-preview-actions button:hover,.ocr-preview-actions button:focus-visible,.ocr-preview-actions a:hover,.ocr-preview-actions a:focus-visible { border-color:#61d8e7;background:#145c68;outline:0; }.ocr-preview-actions b { min-width:38px;text-align:center; }.ocr-preview-viewport { height:calc(100% - 42px);overflow:auto;display:grid;place-items:center;background:#111a20; }.ocr-preview-viewport embed { width:100%;height:100%;display:block;border:0; }.ocr-image-canvas { transition:width .15s ease,transform .15s ease;transform-origin:center; }.ocr-image-canvas img { width:100%;height:auto;display:block;object-fit:contain; }.ocr-preview.empty-preview { display:grid;place-items:center;padding:20px;color:var(--muted);background:var(--surface);text-align:center; }
.ocr-progress { margin-top:10px;display:grid;grid-template-columns:minmax(180px,auto) minmax(160px,1fr);align-items:center;gap:10px;color:var(--muted);font-size:10px;font-weight:850; }.ocr-progress>div { height:8px;overflow:hidden;border-radius:999px;background:var(--surface-3); }.ocr-progress i { height:100%;display:block;border-radius:inherit;background:linear-gradient(90deg,var(--cyan),var(--run));transition:width .2s ease; }.ocr-progress[data-ocr-status="recognizing"] i { width:38%!important;animation:ocr-indeterminate 1.3s ease-in-out infinite; }.ocr-progress[data-ocr-status="ready"] span { color:var(--run); }.ocr-progress[data-ocr-status="error"] span,.ocr-error { color:var(--stop); }
@keyframes ocr-indeterminate { 0% { transform:translateX(-110%); } 100% { transform:translateX(280%); } }
.ocr-error { margin:9px 0 0;font-size:10px;font-weight:850; }
.ocr-review-grid { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px; }
.ocr-field { min-width:0;padding:8px;border:1px solid var(--line);border-radius:9px;background:var(--surface-2); }.ocr-field[data-confidence-level="medium"] { border-color:#e9a31b;background:color-mix(in srgb,#f5b52a 9%,var(--surface)); }.ocr-field[data-confidence-level="low"] { border-color:#d43b47;background:color-mix(in srgb,var(--stop) 8%,var(--surface)); }.ocr-field>span { display:flex;align-items:center;justify-content:space-between;gap:5px; }.confidence-badge { flex:0 0 auto;padding:2px 5px;border-radius:999px;color:#fff;background:#80919b;font-size:8px;font-style:normal; }.confidence-badge.high { background:var(--run); }.confidence-badge.medium { background:#d78300; }.confidence-badge.low { background:var(--stop); }
.ocr-field-hint { min-height:29px;margin-top:5px;display:block;color:var(--muted);font-size:8px;line-height:1.4;overflow-wrap:anywhere; }
.manual-entry-heading { margin-top:5px;padding-top:13px;border-top:1px solid var(--line); }.estimated-duration { grid-column:1/-1;min-height:53px;padding:10px 13px;display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid color-mix(in srgb,var(--cyan) 65%,var(--line));border-radius:10px;background:color-mix(in srgb,var(--cyan) 9%,var(--surface)); }.estimated-duration span { color:var(--muted);font-size:10px;font-weight:900; }.estimated-duration strong { color:#087987;font-size:19px; }.estimated-duration.invalid { border-color:var(--stop);background:color-mix(in srgb,var(--stop) 8%,var(--surface)); }.estimated-duration.invalid strong { color:var(--stop);font-size:12px; }

/* Large, timezone-safe planning controls shared by create and assignment forms. */
.schedule-work-order-dialog { width:min(980px,calc(100vw - 30px));max-height:calc(100dvh - 30px);overflow:auto; }
.schedule-card,.manual-entry-grid>.schedule-card { grid-column:1/-1;min-width:0;padding:15px;border:1px solid color-mix(in srgb,var(--cyan) 45%,var(--line));border-radius:14px;background:linear-gradient(145deg,color-mix(in srgb,var(--cyan) 8%,var(--surface)),var(--surface-2));box-shadow:inset 0 1px 0 color-mix(in srgb,#fff 55%,transparent); }
.schedule-card-heading { margin-bottom:12px;display:flex;align-items:flex-start;justify-content:space-between;gap:12px; }.schedule-card-heading h4 { margin:0;color:var(--ink);font-size:16px; }.schedule-card-heading p { margin:4px 0 0;color:var(--muted);font-size:10px;line-height:1.5; }.schedule-timezone { flex:0 0 auto;padding:6px 9px;border:1px solid color-mix(in srgb,var(--cyan) 55%,var(--line));border-radius:999px;color:#087987;background:color-mix(in srgb,var(--cyan) 10%,var(--surface));font-size:10px;font-weight:950;white-space:nowrap; }
.schedule-date-time-grid { display:grid;grid-template-columns:minmax(0,1fr) 30px minmax(0,1fr);align-items:stretch;gap:10px; }.schedule-moment { min-width:0;margin:0;padding:11px;border:1px solid var(--line);border-radius:11px;background:var(--surface); }.schedule-moment legend { padding:0 5px;color:var(--ink);font-size:12px;font-weight:950; }.schedule-next-day { display:none;margin-left:7px;padding:2px 6px;border-radius:999px;color:#fff;background:#d78300;font-size:9px;vertical-align:middle; }.schedule-next-day.visible { display:inline-block; }
.schedule-input-pair { display:grid;grid-template-columns:minmax(145px,1.35fr) minmax(105px,.65fr);gap:8px; }.schedule-input-pair label { min-width:0;display:grid;gap:5px; }.schedule-input-pair label>span { color:var(--muted);font-size:9px;font-weight:900; }.schedule-input-pair input { width:100%;min-width:0;min-height:50px;padding:8px 11px;border:1px solid var(--line);border-radius:10px;color:var(--ink);background:var(--surface-2);font-size:16px;font-weight:850;outline:0;color-scheme:light; }.schedule-input-pair input:focus { border-color:var(--cyan);box-shadow:0 0 0 3px rgba(44,182,191,.14); }[data-theme="dark"] .schedule-input-pair input { color-scheme:dark; }
.schedule-shortcuts { margin-top:9px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px; }.schedule-shortcuts button { min-height:38px;padding:5px 7px;border:1px solid var(--line);border-radius:8px;color:var(--ink);background:var(--surface-2);font-size:9px;font-weight:900;line-height:1.25;cursor:pointer; }.schedule-shortcuts button:hover,.schedule-shortcuts button:focus-visible { border-color:var(--cyan);color:#087987;background:color-mix(in srgb,var(--cyan) 12%,var(--surface)); }.schedule-shortcuts .next-free { grid-column:1/-1; }.duration-shortcuts { grid-template-columns:repeat(5,minmax(0,1fr)); }.schedule-arrow { display:grid;place-items:center;color:var(--cyan);font-size:23px;font-weight:950; }
.schedule-card .estimated-duration { margin-top:11px;display:grid;grid-template-columns:auto 1fr;column-gap:14px;row-gap:3px; }.schedule-card .estimated-duration strong { justify-self:end; }.schedule-card .estimated-duration small { grid-column:1/-1;color:var(--muted);font-size:9px;text-align:right;overflow-wrap:anywhere; }

/* Queue reorder preview and optional schedule rescheduling. */
.queue-schedule-backdrop { z-index:125; }.queue-schedule-dialog { width:min(1060px,calc(100vw - 30px));max-height:calc(100dvh - 30px);overflow:auto;padding:22px; }.queue-machine-badge { display:inline-block;margin-bottom:5px;padding:4px 8px;border-radius:7px;color:#fff;background:linear-gradient(135deg,#149da5,#087287);font-size:10px;font-weight:950; }
.queue-schedule-policies { margin:0 0 13px;padding:0;border:0; }.queue-schedule-policies legend { margin-bottom:8px;color:var(--ink);font-size:13px;font-weight:950; }.queue-schedule-policies { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px; }.queue-schedule-policies legend { grid-column:1/-1; }.queue-schedule-policies>label { min-width:0;min-height:82px;padding:11px;display:grid;grid-template-columns:20px minmax(0,1fr);align-items:start;gap:8px;border:1px solid var(--line);border-radius:11px;background:var(--surface-2);cursor:pointer; }.queue-schedule-policies>label.selected { border-color:var(--cyan);background:color-mix(in srgb,var(--cyan) 11%,var(--surface));box-shadow:inset 0 0 0 2px color-mix(in srgb,var(--cyan) 20%,transparent); }.queue-schedule-policies input { width:18px;height:18px;margin:1px 0 0;accent-color:var(--cyan); }.queue-schedule-policies b,.queue-schedule-policies small { display:block; }.queue-schedule-policies b { font-size:11px; }.queue-schedule-policies small { margin-top:4px;color:var(--muted);font-size:9px;line-height:1.45; }
.queue-schedule-preview { padding:13px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2); }.queue-schedule-preview>header { margin-bottom:9px;display:flex;align-items:flex-start;justify-content:space-between;gap:10px; }.queue-schedule-preview h3,.queue-manual-editor h3 { margin:0;font-size:14px; }.queue-schedule-preview header p,.queue-manual-editor>div>p { margin:3px 0 0;color:var(--muted);font-size:9px; }.queue-preview-loading,.queue-preview-ready { padding:5px 8px;border-radius:999px;font-size:9px;font-weight:900;white-space:nowrap; }.queue-preview-loading { color:#7a4a00;background:#ffe3a6; }.queue-preview-ready { color:#fff;background:var(--run); }
.queue-preview-list { display:grid;gap:6px; }.queue-preview-row { min-width:0;padding:8px 9px;display:grid;grid-template-columns:76px minmax(0,1fr) auto;align-items:center;gap:9px;border:1px solid var(--line);border-radius:9px;background:var(--surface); }.queue-preview-row.changed { border-color:color-mix(in srgb,var(--cyan) 58%,var(--line)); }.queue-position-change { display:grid;grid-template-columns:25px 16px 25px;align-items:center;gap:3px; }.queue-position-change i { width:25px;height:25px;display:grid;place-items:center;border-radius:6px;color:var(--ink);background:var(--surface-3);font-style:normal;font-weight:950; }.queue-position-change b { color:var(--cyan);text-align:center; }.queue-preview-row strong,.queue-preview-row small { display:block; }.queue-preview-row strong { font-size:11px; }.queue-preview-row small { margin-top:3px;color:var(--muted);font-size:8px;line-height:1.4;overflow-wrap:anywhere; }.queue-preview-row small.after { color:color-mix(in srgb,var(--cyan) 82%,var(--ink));font-weight:850; }.queue-preview-row>em { padding:3px 6px;border-radius:999px;color:#fff;background:#0e8996;font-size:8px;font-style:normal;font-weight:900; }
.queue-schedule-notices,.queue-preview-error { margin:8px 0 0;padding:8px 10px;border-radius:8px;font-size:9px;line-height:1.45; }.queue-schedule-notices strong { display:block;margin-bottom:3px; }.queue-schedule-notices ul { margin:0;padding-left:17px; }.queue-schedule-notices.warnings { border:1px solid #d99219;color:#704300;background:#fff4d7; }.queue-schedule-notices.conflicts,.queue-preview-error { border:1px solid color-mix(in srgb,var(--stop) 70%,var(--line));color:var(--stop);background:color-mix(in srgb,var(--stop) 7%,var(--surface));font-weight:850; }
.queue-manual-editor { margin-top:12px;padding:13px;border:1px solid color-mix(in srgb,var(--cyan) 50%,var(--line));border-radius:12px;background:color-mix(in srgb,var(--cyan) 6%,var(--surface)); }.queue-manual-list { margin-top:9px;display:grid;gap:7px; }.queue-manual-row { padding:9px;border:1px solid var(--line);border-radius:9px;background:var(--surface); }.queue-manual-row>header { margin-bottom:7px;display:flex;align-items:center;justify-content:space-between;gap:8px; }.queue-manual-row>header span { color:var(--cyan);font-size:9px;font-weight:900; }.queue-manual-inputs { display:grid;grid-template-columns:minmax(0,1fr) 24px minmax(0,1fr);align-items:end;gap:7px; }.queue-manual-inputs>label { min-width:0;display:grid;grid-template-columns:minmax(130px,1.4fr) minmax(90px,.6fr);gap:6px; }.queue-manual-inputs>label>span { grid-column:1/-1;color:var(--muted);font-size:8px;font-weight:900; }.queue-manual-inputs input { width:100%;min-width:0;min-height:48px;padding:7px 9px;border:1px solid var(--line);border-radius:8px;color:var(--ink);background:var(--surface-2);font-size:13px;font-weight:850;color-scheme:light; }.queue-manual-inputs>i { min-height:48px;display:grid;place-items:center;color:var(--cyan);font-style:normal;font-weight:950; }[data-theme="dark"] .queue-manual-inputs input { color-scheme:dark; }
.queue-schedule-actions { position:sticky;bottom:-22px;margin:14px -22px -22px;padding:13px 22px;display:flex;justify-content:flex-end;gap:8px;border-top:1px solid var(--line);background:color-mix(in srgb,var(--surface) 94%,transparent);backdrop-filter:blur(8px); }.queue-schedule-actions .button { min-width:125px; }

/* Guided work-order entry: document -> identifiers -> assignment. */
.work-order-create-form { gap: 14px; }
.workflow-step > .section-title,
.workflow-step-heading {
  position: relative;
  justify-content: flex-start;
  padding-left: 44px;
}
.workflow-step > .section-title::before,
.workflow-step-heading::before {
  content: attr(data-step);
  width: 32px;
  height: 32px;
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(145deg, #13a1a4, #0a6579);
  box-shadow: 0 5px 12px color-mix(in srgb, var(--cyan) 28%, transparent);
  font-size: 13px;
  font-weight: 950;
}
.workflow-step-heading { min-height: 38px; align-items: flex-start; }
.manual-entry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}
.manual-entry-grid > * { min-width: 0; }
.manual-entry-grid .estimated-duration {
  grid-column: auto;
  min-height: 62px;
  align-self: end;
}
.work-form-actions {
  position: relative;
  z-index: 1;
  margin-top: 2px;
  padding: 14px 0 2px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.work-form-actions .button { min-width: 132px; }
.operator-document-create { white-space: normal; line-height: 1.25; }

/* Original image/document preview: viewport-aware sizing without distorting source ratios. */
.original-viewer-backdrop { padding: clamp(8px, 1.6vw, 22px); }
.original-viewer-dialog {
  width: min(1480px, calc(100vw - clamp(16px, 3.2vw, 44px)));
  height: min(960px, calc(100dvh - clamp(16px, 3.2vw, 44px)));
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
}
.original-viewer-dialog > header > div { min-width: 0; }
.original-viewer-dialog > header h2 { max-width: min(1120px, calc(100vw - 150px)); }
.original-viewer-dialog > header .button { min-width: 40px; min-height: 40px; flex: 0 0 auto; }
.original-viewer-frame {
  display: grid;
  place-items: center;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}
.original-viewer-frame object,
.original-viewer-frame iframe {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}
.original-viewer-image {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
}
.original-viewer-dialog > footer { padding-top: 1px; }
.original-viewer-dialog > footer .button { min-width: 96px; }

.ocr-upload-layout.has-preview .work-order-dropzone,
.ocr-upload-layout.has-preview .ocr-preview {
  min-height: clamp(340px, 48vh, 620px);
  height: clamp(340px, 48vh, 620px);
}
.ocr-preview { isolation: isolate; }
.ocr-preview figcaption {
  position: sticky;
  inset-block-start: 0;
  z-index: 2;
}
.ocr-preview-actions button,
.ocr-preview-actions a { min-width: 34px; min-height: 34px; height: 34px; touch-action: manipulation; }
.ocr-preview-actions button:focus-visible,
.ocr-preview-actions a:focus-visible { box-shadow: 0 0 0 3px rgba(97,216,231,.25); }
.ocr-preview-viewport {
  max-width: 100%;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}
.ocr-image-canvas {
  min-width: 0;
  flex: 0 0 auto;
  will-change: width, transform;
}
.ocr-image-canvas img { max-width: none; }
.ocr-image-canvas[style*="width:100%"],
.ocr-image-canvas[style*="width: 100%"] { height: 100%; }
.ocr-image-canvas[style*="width:100%"] img,
.ocr-image-canvas[style*="width: 100%"] img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

@media (max-width: 980px) {
  .manual-entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manual-entry-grid .manual-operator,
  .manual-entry-grid .estimated-duration { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .workflow-step > .section-title,
  .workflow-step-heading { padding-left: 40px; }
  .manual-entry-grid { grid-template-columns: 1fr; }
  .manual-entry-grid .manual-operator,
  .manual-entry-grid .estimated-duration { grid-column: auto; }
  .work-form-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .work-form-actions .button { min-width: 0; }
}

.allocation-summary { margin:10px 0;display:grid;grid-template-columns:repeat(4,1fr);border:1px solid var(--line);border-radius:10px;overflow:hidden; }.allocation-summary>div { padding:11px;border-right:1px solid var(--line);background:var(--surface-2); }.allocation-summary>div:last-child { border:0; }.allocation-summary dt { color:var(--muted);font-size:8px;font-weight:900; }.allocation-summary dd { margin:5px 0 0;font-size:16px;font-weight:950; }.allocation-summary .attention dd { color:#d27800; }.allocation-summary .complete dd { color:var(--run); }
.allocation-conflict { margin:9px 0;padding:9px 11px;border:1px solid #d97706;border-radius:8px;color:#fff;background:#b55e00;font-size:10px;font-weight:850; }.allocation-section { margin-top:13px;padding:12px;border:1px solid var(--line);border-radius:11px;background:var(--surface-2); }.allocation-list { display:grid;gap:8px; }.allocation-row { padding:10px;border:1px solid var(--line);border-radius:10px;background:var(--surface); }.allocation-row.has-conflict { border-color:#d97706;box-shadow:0 0 0 1px color-mix(in srgb,#d97706 35%,transparent); }.allocation-conflict-detail { margin:8px 0 0;padding:6px 8px;border-radius:7px;color:#8a4500;background:color-mix(in srgb,#d97706 13%,var(--surface));font-size:9px;font-weight:900; }.allocation-row header { display:flex;align-items:center;justify-content:space-between;gap:8px; }.allocation-row header>div { display:flex;align-items:center;gap:7px; }.allocation-row header strong { color:var(--cyan);font-size:15px; }.allocation-row dl { margin:9px 0;display:grid;grid-template-columns:repeat(3,1fr);border-block:1px solid var(--line); }.allocation-row dl div { padding:8px;border-right:1px solid var(--line); }.allocation-row dl div:last-child { border:0; }.allocation-row dt { color:var(--muted);font-size:8px;font-weight:850; }.allocation-row dd { margin:4px 0 0;font-size:13px;font-weight:900; }.allocation-row footer { display:grid;grid-template-columns:.8fr 1.4fr .8fr;gap:8px;color:var(--muted);font-size:9px; }.allocation-row footer span:last-child { text-align:right; }.allocation-row footer b { color:var(--ink); }.button.permanent { background:#711820;border-color:#711820; }
.user-config-list .config-row em { margin-left:4px;padding:2px 5px;border-radius:999px;color:#fff;background:var(--cyan);font-size:7px;font-style:normal; }
.user-profile-row>img { width: 42px; height: 52px; flex: 0 0 auto; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-3); }
.user-profile-row>span { flex: 1; }
.user-access-card .form-guidance { margin: 12px 0 0; padding: 10px 12px; border: 1px solid color-mix(in srgb,var(--warning) 42%,var(--line)); border-radius: 9px; color: var(--ink); background: color-mix(in srgb,var(--warning) 10%,var(--surface-2)); font-size: 11px; font-weight: 800; line-height: 1.55; }

.operator-shell { --touch:52px; }.operator-toolbar { margin-bottom:10px;padding:10px 14px;display:flex;justify-content:space-between;align-items:end;gap:12px; }.operator-toolbar form { min-width:0;flex:1;display:flex;align-items:end;gap:7px; }.operator-toolbar form label { min-width:0;flex:1;display:grid;gap:4px; }.operator-toolbar form label span { color:var(--muted);font-size:10px;font-weight:900; }.operator-toolbar form input { width:100%;height:var(--touch);padding:5px 12px;border:1px solid var(--line);border-radius:9px;color:var(--ink);background:var(--surface-2);font-size:22px;font-weight:950; }.qr-placeholder { width:var(--touch);height:var(--touch);display:grid;place-items:center;border:1px solid var(--cyan);border-radius:9px;color:var(--cyan);background:var(--surface-2); }.qr-placeholder span { font-size:21px; }.qr-placeholder small { font-size:7px; }.operator-toolbar form>.button { height:var(--touch); }.operator-machine-select { min-width:220px; }
.operator-document-create { min-height:var(--touch);white-space:normal;line-height:1.25; }
.operator-grid { display:grid;grid-template-columns:minmax(540px,1.5fr) minmax(340px,.9fr);gap:10px; }.operator-current { min-width:0;padding:16px; }.operator-machine-head { display:grid;grid-template-columns:minmax(170px,.7fr) 1fr 1fr;align-items:center;gap:14px; }.operator-machine-head>strong { font-size:clamp(42px,5vw,70px);letter-spacing:-.05em; }.operator-machine-head>div { padding-left:14px;border-left:1px solid var(--line); }.operator-machine-head span { display:block;color:var(--muted);font-size:10px;font-weight:900; }.operator-machine-head b { margin-top:6px;display:block;font-size:18px; }.operator-state { padding:8px;border-radius:8px;color:#fff;background:#20272c;text-align:center; }.operator-state.RUN { background:var(--run); }.operator-state.STOP { background:linear-gradient(135deg,var(--machine-stop),var(--machine-stop-dark)); }.operator-state.WAIT { display:flex;align-items:center;justify-content:center;gap:8px;color:var(--long-wait-strong);background:color-mix(in srgb,var(--long-wait) 14%,var(--surface-2));border:2px solid var(--long-wait); }.operator-machine-head .operator-state.WAIT .long-wait-icon { display:inline-grid;color:var(--long-wait-ink);font-size:18px; }.operator-machine-head .operator-state.WAIT .long-wait-icon span { display:block;color:var(--long-wait-ink);font-size:18px; }.operator-machine-head .operator-state-text { color:inherit;font-size:14px;line-height:1.25; }
.operator-current .work-start-pending { margin:14px 0 2px;border:1px solid rgba(225,130,0,.34);border-radius:10px; }
.operator-order-grid { margin:14px 0 0;padding:8px 14px;display:grid;grid-template-columns:repeat(2,1fr);gap:0;border:1px solid var(--line);border-radius:11px; }.operator-order-grid div { min-height:58px;padding:8px;border-bottom:1px solid var(--line); }.operator-order-grid dt { color:var(--muted);font-size:9px;font-weight:900; }.operator-order-grid dd { margin:5px 0 0;font-size:18px;font-weight:900; }.operator-order-grid .good { color:#22b766; }.operator-order-grid .defect { color:#e0444d; }
.operator-progress { margin:12px 0;display:grid;grid-template-columns:90px minmax(0,1fr);align-items:center;gap:8px;font-size:18px; }.operator-progress>div { height:35px;position:relative;overflow:hidden;border-radius:8px;background:var(--surface-3); }.operator-progress i { height:100%;display:block;background:linear-gradient(90deg,#29c6c9,#2ab47d); }.operator-progress strong { position:absolute;inset:0;display:grid;place-items:center;color:#fff;text-shadow:0 1px 3px #000;font-size:17px; }
.operator-actions { display:grid;grid-template-columns:repeat(4,1fr);gap:9px; }.operator-actions button { min-height:105px;padding:10px;border:1px solid #207e9c;border-radius:11px;color:#fff;background:linear-gradient(145deg,#0d6686,#0a3b56);font-size:15px;font-weight:900; }.operator-actions button span { margin-bottom:8px;display:block;font-size:31px; }.operator-actions .wait { border-color:#ee9c00;background:linear-gradient(145deg,#f39a00,#b55e00); }.operator-actions .complete { border-color:#1aae5b;background:linear-gradient(145deg,#16934f,#075d31); }.operator-actions button:disabled { filter:grayscale(1);opacity:.35; }
.operator-side { display:grid;gap:10px; }.operator-side>.card { padding:14px; }.operator-next>.next-work-card { width:100%;min-height:67px;margin-top:7px;padding:8px 38px 8px 12px;position:relative;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:8px;border:1px solid var(--line);border-radius:9px;color:var(--ink);background:var(--surface-2);text-align:left; }.operator-next>.next-work-card span { overflow:hidden;color:var(--muted);text-overflow:ellipsis;white-space:nowrap; }.operator-next>.next-work-card small { font-size:9px; }.operator-next>.next-work-card i { position:absolute;right:12px;color:var(--cyan);font-size:30px; }.operator-recent>div:not(.card-heading):not(.empty) { min-height:48px;padding:8px;display:grid;grid-template-columns:1fr auto auto;align-items:center;gap:10px;border-top:1px solid var(--line); }.operator-recent span,.operator-recent small { color:var(--muted);font-size:9px; }.operator-empty { min-height:350px;display:grid;place-content:center;text-align:center; }.operator-empty p { color:var(--muted); }

.wallboard .topbar { min-height: 58px; padding-block: 7px; }
.wallboard .nav-tabs, .wallboard .toolbar, .wallboard .critical-rail, .wallboard .nav-actions .primary { display: none; }
.wallboard .nav-shell { min-height: 42px; justify-content: flex-end; padding-block: 5px; }
.wallboard .main { width: calc(100% - 14px); margin-top: 7px; }
.wallboard .kpi-grid { grid-template-columns: repeat(7, 1fr); }
.wallboard .kpi-card { min-height: 75px; padding: 10px; }
.wallboard .overview-layout { grid-template-columns: 1fr; }
.wallboard .status-wall { padding: 8px; }
.wallboard .line-band { padding: 2px 0; }
.wallboard .equipment-tile { min-height: 45px; padding: 1px 2px; grid-template-columns: 36px minmax(0,1fr); grid-template-rows: 29px 13px; gap: 0 2px; }
.wallboard .equipment-icon { width: 36px; height: 36px; }
.wallboard .equipment-code { font-size: 9px; letter-spacing: -.04em; }
.wallboard .equipment-meta { font-size: 8px; line-height: 12px; }

@media (min-width: 761px) and (max-height: 800px) {
  .wallboard .kpi-grid { display: none; }
  .wallboard .main { margin-top: 3px; }
  .wallboard .status-wall { padding-block: 6px; }
  .wallboard .card-heading { min-height: 32px; margin-bottom: 4px; }
}

@media (min-width: 761px) and (max-width: 1100px) {
  .topbar { min-height: 74px; padding: 8px 12px; gap: 8px; }
  .topbar .brand-mark { width: 76px; height: 50px; padding: 4px 6px; }
  .topbar .brand-copy h1 { max-width: 180px; font-size: 16px; }
  .topbar .mode-pill { display: none; }
  .topbar .header-order-search { width: clamp(190px, 21vw, 220px); }
  .topbar .admin-badge { display: none; }
  .wallboard .topbar { min-height: 48px; padding: 4px 12px; }
  .wallboard .brand-mark { width: 70px; height: 44px; border-radius: 9px; padding: 4px 6px; }
  .wallboard .brand-copy h1 { font-size: 16px; }
  .wallboard .brand-copy small { font-size: 8px; }
  .wallboard .header-actions { flex-wrap: nowrap; }
  .wallboard .clock-pill { display: none; }
  .wallboard .mode-pill, .wallboard .auth-action, .wallboard .admin-login, .wallboard .unauth-actions { display: none; }
  .wallboard .nav-shell { min-height: 32px; padding: 2px 9px; }
  .wallboard .nav-actions .button { min-height: 26px; padding: 2px 7px; font-size: 9px; }
  .wallboard .main { margin-top: 3px; }
  .wallboard .kpi-grid { display: none; }
  .wallboard .kpi-grid { margin-bottom: 4px; gap: 4px; }
  .wallboard .kpi-card { min-height: 50px; padding: 6px 8px; }
  .wallboard .kpi-card strong { margin-top: 2px; font-size: 18px; }
  .wallboard .kpi-card small { margin-top: 2px; }
  .wallboard .status-wall { padding: 5px; }
  .wallboard .card-heading { min-height: 25px; margin-bottom: 2px; }
  .wallboard .card-heading p, .wallboard .legend { display: none; }
  .wallboard .status-wall-title { flex: 0 0 104px; }
  .wallboard .notice-ticker { height: 38px; flex-basis: 360px; }
  .wallboard .notice-ticker > b { padding-inline:10px;font-size:11px; }
  .wallboard .notice-track { font-size:14px;line-height:34px; }
  .wallboard .line-band { grid-template-columns: 40px minmax(0,1fr); gap: 3px; padding: 1px 0; }
  .wallboard .line-label { min-height: 28px; }
  .wallboard .line-label strong { font-size: 12px; }
  .wallboard .equipment-grid { grid-template-columns: repeat(13, minmax(0,1fr)); gap: 2px; }
  .wallboard .equipment-tile { height: 45px; min-height: 45px; padding: 1px 2px; }
  .wallboard .equipment-icon { width: 33px; height: 33px; }
  .wallboard .equipment-code { font-size: 8px; letter-spacing: -.05em; }
  .wallboard .equipment-meta { font-size: 8px; line-height: 12px; }
}

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .overview-layout { grid-template-columns: 1fr; }
  .critical-rail { position: static; }
  .critical-list { max-height: 250px; grid-template-columns: repeat(3, 1fr); }
  .collector-grid, .analytics-layout { grid-template-columns: 1fr; }
  .work-management-layout, .operator-grid { grid-template-columns: 1fr; }
  .completed-history-layout { grid-template-columns: 1fr; }
  .completed-order-list { max-height: 360px; }
  .quality-review-layout { grid-template-columns: 1fr; }
  .quality-review-list { max-height: 360px; }
  .operator-side { grid-template-columns: 1fr 1fr; }
  .ftp-settings-form, .ftp-mapping > div { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 1500px) and (min-width: 761px) {
  .topbar .clock-pill { display: none; }
  .topbar .header-actions { flex-wrap: nowrap; }
  .brand-copy h1 { font-size: 20px; }
  .header-order-search { width: clamp(220px, 18vw, 270px); }
}

@media (min-width: 1181px) and (max-width: 1500px) {
  .overview-layout { grid-template-columns: minmax(0, 1fr) 238px; gap: 8px; }
  .main { margin-top: 9px; }
  .toolbar { margin-bottom: 7px; padding: 8px 10px; }
  .kpi-grid { margin-bottom: 7px; gap: 6px; }
  .kpi-card { min-height: 66px; padding: 8px 10px; }
  .kpi-card strong { margin-top: 3px; font-size: 21px; }
  .kpi-card small { margin-top: 2px; }
  .utilization-kpi-content { margin-top: 1px; }
  .utilization-donut { width: 32px; height: 32px; }
  .utilization-donut::after { width: 19px; height: 19px; }
  .status-wall, .critical-rail { padding: 8px; }
  .card-heading { min-height: 31px; margin-bottom: 3px; }
  .line-band { grid-template-columns: 48px minmax(0,1fr); gap: 4px; padding: 2px 0; }
  .line-label { min-height: 34px; border-radius: 7px; }
  .line-label strong { font-size: 13px; }
  .equipment-grid { grid-template-columns: repeat(18, minmax(0,1fr)); gap: 3px; }
  .equipment-tile { height: 46px; min-height: 46px; padding: 1px 2px; }
  .equipment-icon { width: 34px; height: 34px; }
  .equipment-code { font-size: 9px; letter-spacing: -.04em; }
  .equipment-meta { font-size: 8px; line-height: 12px; }
}

@media (max-width: 760px) {
  .topbar { align-items: flex-start; padding: 10px 13px; }
  .brand-mark { width: 78px; height: 52px; padding: 5px 7px; }
  .brand-copy h1 { max-width: 210px; font-size: 16px; }
  .clock-pill { display: none; }
  .topbar { flex-direction: column; }
  .header-actions { width: 100%; justify-content: flex-start; }
  .header-order-search { width: 100%; order: -1; }
  .mode-pill { display: none; }
  .nav-shell { padding-inline: 10px; }
  .nav-tab { min-width: 126px; }
  html[lang="vi"] .nav-tab { min-width: 164px; }
  .nav-actions { display: none; }
  .main { width: calc(100% - 16px); }
  .status-wall-heading { flex-direction: column; align-items: stretch; }
  .status-wall-heading .notice-ticker { width: 100%; max-width: 100%; flex: 0 0 44px; }
  .status-wall-heading .legend { width: 100%; justify-content: flex-start; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .filter-group { display: grid; grid-template-columns: 1fr 1fr; }
  .field, .field.grow { min-width: 0; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .line-band { grid-template-columns: 45px minmax(0,1fr); }
  .equipment-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .equipment-tile[data-state="WAIT"] .equipment-icon { width: 22px; height: 22px; margin: 13px auto 0 5px; }
  .equipment-tile[data-state="WAIT"] .equipment-meta { min-height: 10px; font-size: 8px; line-height: 10px; white-space: nowrap; }
  .equipment-tile[data-state="WAIT"] .equipment-state { white-space: nowrap; overflow-wrap: normal; }
  .long-wait-icon--drawer { width: 36px; height: 36px; font-size: 24px; }
  .critical-list { grid-template-columns: 1fr; }
  .analytics-kpis, .collector-stats { grid-template-columns: repeat(2,1fr); }
  .settings-grid, .form-grid { grid-template-columns: 1fr; }
  .compact-code-form { grid-template-columns: minmax(0,1fr) auto; }
  .form-grid .span-2 { grid-column: auto; }
  .ftp-settings-card { grid-column: auto; }
  .ftp-settings-form, .ftp-mapping > div { grid-template-columns: 1fr; }
  .ftp-settings-form .span-2 { grid-column: auto; }
  .work-management-head { align-items: stretch; flex-direction: column; }
  .work-management-stats { flex-wrap: wrap; }
  .completed-history-head { align-items: stretch; flex-direction: column; }
  .completed-history-kpis { min-width: 0; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .completed-history-kpis span:nth-child(odd) { border-left: 0; }
  .completed-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .completed-allocation-row dl { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .completed-quantity-history dl { grid-template-columns: 1fr; }
  .completed-order-row { grid-template-columns: minmax(0,1fr) 14px; }
  .completed-order-row > span:nth-child(2) { grid-column: 1; }
  .completed-order-row > i { grid-column: 2; grid-row: 1 / span 2; }
  .quality-review-head { align-items: stretch; flex-direction: column; padding: 16px; }
  .quality-review-kpis { width: 100%; min-width: 0; }
  .quality-review-kpis span:first-child { border-left: 0; }
  .quality-review-toolbar .filter-group { grid-template-columns: minmax(0,1fr) minmax(150px,.55fr); }
  .quality-review-toolbar .field.grow,.quality-review-toolbar .field:not(.grow) { min-width: 0; }
  .quality-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .quality-production-info dl { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .quality-production-info dl > div:nth-child(3n) { border-right: 1px solid var(--line); }
  .quality-production-info dl > div:nth-child(2n) { border-right: 0; }
  .quality-production-info dl > div:nth-last-child(-n+3) { border-bottom: 1px solid var(--line); }
  .quality-production-info dl > div:nth-last-child(-n+2) { border-bottom: 0; }
  .quality-review-record dl { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .quality-review-record .note { grid-column: 1 / -1; }
  .quality-review-dialog { width: 100%; max-height: calc(100vh - 16px); padding: 17px; }
  .quality-previous-review dl { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .quality-previous-review .note { grid-column: 1 / -1; }
  .quality-attachment-editor-heading { align-items: stretch; flex-direction: column; gap: 7px; }
  .quality-attachment-editor-heading > span { width: max-content; max-width: 100%; white-space: normal; }
  .quality-attachment-dropzone { grid-template-columns: 38px minmax(0,1fr); }
  .quality-attachment-dropzone > i { width: 38px; height: 38px; }
  .quality-attachment-source-actions { grid-column: 1 / -1;width:100%;grid-template-columns:repeat(2,minmax(0,1fr)); }
  .quality-attachment-subheading { align-items: flex-start; flex-direction: column; gap: 3px; }
  .quality-attachment-subheading small { text-align: left; }
  .quality-attachment-item { grid-template-columns: 34px minmax(0,1fr) auto; }
  .quality-attachment-actions { grid-column: 2 / -1; justify-content: flex-start; }
  .work-plan-heading { flex-direction: column; }
  .planning-summary { grid-template-columns: repeat(2,1fr); }
  .allocation-summary { grid-template-columns:repeat(2,1fr); }
  .allocation-row footer { grid-template-columns:1fr; }.allocation-row footer span:last-child { text-align:left; }
  .ocr-upload-layout,.ocr-upload-layout.has-preview,.ocr-review-grid { grid-template-columns:1fr; }
  .ocr-upload-layout.has-preview .work-order-dropzone { min-height:180px;height:auto; }.ocr-upload-layout.has-preview .ocr-preview { min-height:420px;height:55vh; }
  .ocr-preview figcaption { align-items:flex-start;flex-direction:column; }.ocr-preview-viewport { height:calc(100% - 74px); }.ocr-preview-actions { width:100%;justify-content:flex-start;flex-wrap:wrap; }
  .operator-toolbar { align-items: stretch; flex-direction: column; }
  .operator-toolbar form { flex-wrap: wrap; }.operator-toolbar form label { flex-basis: calc(100% - 60px); }.operator-toolbar form>.button { width:100%; }
  .operator-machine-select { min-width:0; }
  .operator-machine-head { grid-template-columns:1fr 1fr; }.operator-machine-head>strong { grid-column:1/-1; }
  .operator-order-grid { grid-template-columns:1fr; }
  .operator-actions { grid-template-columns:repeat(2,1fr); }
  .operator-side { grid-template-columns:1fr; }
  .reason-grid { grid-template-columns:repeat(2,1fr); }
  .signup-dialog { padding: 18px; }
  .signup-form { grid-template-columns: 1fr; }
  .signup-photo-panel { width: min(240px,100%); margin-inline: auto; }
  .signup-approval-head { align-items: stretch; flex-direction: column; }
  .signup-pending-count { justify-items: start; border-left: 0; border-top: 3px solid var(--warning); }
  .signup-approval-toolbar { align-items: stretch; flex-direction: column; }
  .signup-applicant-profile { grid-template-columns: 86px minmax(0,1fr); }
  .signup-applicant-profile img { width: 86px; height: 108px; }
  .signup-applicant-meta { grid-template-columns: 1fr; }
  .signup-applicant-meta div { border-right: 0; border-bottom: 1px solid var(--line); }
  .signup-applicant-meta div:last-child { border-bottom: 0; }
  .signup-permission-grid { grid-template-columns: 1fr; }
  .signup-reject-form { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .dropzone-actions { grid-template-columns:1fr; }
  .dropzone-actions .screen-capture-button { grid-column:auto; }
  .quality-review-toolbar .filter-group { grid-template-columns: 1fr; }
  .quality-review-row { grid-template-columns: minmax(0,1fr) auto 12px; gap: 7px; }
  .quality-review-row > span:nth-child(2) { grid-column: 1; grid-row: 2; text-align: left; }
  .quality-review-row > .quality-status { grid-column: 2; grid-row: 1 / span 2; }
  .quality-review-row > i { grid-column: 3; grid-row: 1 / span 2; }
  .quality-detail-heading { align-items: stretch; flex-direction: column; }
  .quality-detail-actions { width: 100%; max-width: none; justify-content: stretch; }
  .quality-detail-actions .button { flex: 1 1 calc(50% - 4px); }
  .quality-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .quality-production-info dl,.quality-review-record dl { grid-template-columns: 1fr; }
  .quality-production-info dl > div,.quality-production-info dl > div:nth-child(2n),.quality-production-info dl > div:nth-child(3n) { border-right: 0; border-bottom: 1px solid var(--line); }
  .quality-production-info dl > div:last-child { border-bottom: 0; }
  .quality-review-record .note { grid-column: auto; }
  .completed-quality-meta { grid-template-columns: 1fr; }
  .completed-quality-review-top { align-items: flex-start; }
  .quality-previous-review dl { grid-template-columns: 1fr; }
  .quality-previous-review .note { grid-column: auto; }
  .quality-decision-picker > div { grid-template-columns: 1fr; }
  .quality-dialog-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .quality-dialog-actions .button { min-width: 0; }
  .quality-attachment-record,.quality-attachment-editor { padding: 10px; }
  .quality-attachment-dropzone { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .quality-attachment-source-actions { grid-column:auto;grid-template-columns:1fr; }
  .quality-attachment-item { grid-template-columns: 32px minmax(0,1fr); gap: 7px; }
  .quality-attachment-state { grid-column: 2; width: max-content; }
  .quality-attachment-actions { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .quality-attachment-actions .button { width: 100%; }
  .quality-attachment-actions .danger { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .quality-attachment-source-actions { grid-column: 1 / -1; width: 100%; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .quality-attachment-source-actions .button { width: 100%; }
  .schedule-card-heading { align-items:stretch;flex-direction:column; }
  .schedule-timezone { width:max-content;max-width:100%; }
  .schedule-date-time-grid { grid-template-columns:1fr; }
  .schedule-arrow { min-height:20px;transform:rotate(90deg); }
  .queue-schedule-policies { grid-template-columns:1fr; }
  .queue-schedule-policies legend { grid-column:auto; }
  .queue-manual-inputs { grid-template-columns:1fr; }
  .queue-manual-inputs>i { min-height:20px;transform:rotate(90deg); }
}

@media (max-width: 600px) {
  .quality-attachment-source-actions { grid-template-columns: 1fr; }
  .schedule-work-order-dialog,.queue-schedule-dialog { width:100%;max-height:calc(100dvh - 12px);padding:15px; }
  .schedule-card { padding:11px; }
  .schedule-input-pair,.queue-manual-inputs>label { grid-template-columns:1fr; }
  .schedule-shortcuts { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .schedule-shortcuts .next-free { grid-column:1/-1; }
  .duration-shortcuts { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .queue-preview-row { grid-template-columns:68px minmax(0,1fr); }
  .queue-preview-row>em { grid-column:2;width:max-content; }
  .queue-schedule-actions { bottom:-15px;margin:12px -15px -15px;padding:11px 15px;display:grid;grid-template-columns:1fr 1fr; }
  .queue-schedule-actions .button { min-width:0; }
  .queue-schedule-actions .primary { grid-column:1/-1;grid-row:1; }
}

/* Dense work-order live overview */
.header-work-overview { min-height: 38px; border-color: rgba(91,211,219,.48); color: #dfffff; background: rgba(44,182,191,.14); white-space: nowrap; }
.header-work-overview:hover { background: rgba(44,182,191,.28); }
.work-overview-backdrop { z-index: 170; padding: 12px; overflow: hidden; }
.work-overview-dialog { width: min(1740px,calc(100vw - 24px)); height: calc(100dvh - 24px); min-height: 560px; position: relative; display: grid; grid-template-rows: auto auto auto minmax(0,1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: var(--surface); box-shadow: 0 28px 90px rgba(0,0,0,.48); }
.work-overview-heading { min-width: 0; padding: 13px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); background: linear-gradient(110deg,color-mix(in srgb,var(--cyan) 10%,var(--surface)),var(--surface)); }
.work-overview-heading > div:first-child { min-width: 0; }
.work-overview-heading small { color: var(--cyan); font-size: 9px; font-weight: 900; letter-spacing: .13em; }
.work-overview-heading h2 { margin: 2px 0; font-size: clamp(20px,1.8vw,27px); line-height: 1.15; }
.work-overview-heading p { margin: 0; overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.work-overview-heading > div:last-child { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; }
.work-overview-live { min-height: 29px; padding: 5px 9px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid color-mix(in srgb,var(--run) 50%,var(--line)); border-radius: 999px; color: var(--run); background: color-mix(in srgb,var(--run) 8%,var(--surface)); font-size: 9px; font-weight: 900; }
.work-overview-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--run); box-shadow: 0 0 0 4px color-mix(in srgb,var(--run) 15%,transparent); }
.work-overview-toolbar { min-width: 0; padding: 7px 10px; display: grid; grid-template-columns: minmax(190px,1.7fr) repeat(4,minmax(105px,.78fr)) repeat(2,minmax(125px,.88fr)) minmax(128px,.9fr) minmax(170px,1.15fr) auto; align-items: end; gap: 6px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.work-overview-toolbar .field { min-width: 0; }
.work-overview-toolbar .field > span { font-size: 8px; }
.work-overview-toolbar input,.work-overview-toolbar select { min-width: 0; min-height: 34px; padding: 5px 8px; font-size: 10px; }
.work-overview-checks { min-height: 34px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.work-overview-checks label { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 9px; font-weight: 850; }
.work-overview-checks input { width: 15px; height: 15px; min-height: 0; margin: 0; accent-color: var(--cyan); }
.work-overview-result-bar { min-height: 31px; padding: 5px 11px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); color: var(--muted); background: var(--surface); font-size: 9px; }
.work-overview-result-bar b { color: var(--ink); font-size: 11px; }
.work-overview-result-bar em { margin-left: auto; color: var(--muted); font-style: normal; }
.work-overview-table-scroll { min-width: 0; min-height: 0; max-width: 100%; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.work-overview-table { width: 100%; min-width: 1240px; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 10px; }
.work-overview-table th { height: 34px; padding: 5px 8px; position: sticky; top: 0; z-index: 4; border-bottom: 1px solid var(--line); color: var(--muted); background: color-mix(in srgb,var(--surface-3) 80%,var(--surface)); font-size: 9px; font-weight: 900; text-align: left; white-space: nowrap; }
.work-overview-table th:nth-child(1) { width: 98px; }.work-overview-table th:nth-child(2) { width: 155px; }.work-overview-table th:nth-child(3) { width: 210px; }.work-overview-table th:nth-child(4) { width: 142px; }.work-overview-table th:nth-child(5) { width: 125px; }.work-overview-table th:nth-child(6) { width: 122px; }.work-overview-table th:nth-child(7) { width: 190px; }.work-overview-table th:nth-child(8) { width: 108px; }.work-overview-table th:nth-child(9) { width: 40px; }
.work-overview-row { height: 57px; outline: 0; cursor: pointer; }
.work-overview-table td { padding: 5px 8px; }
.work-overview-row td { min-width: 0; height: 57px; padding: 5px 8px; overflow: hidden; border-bottom: 1px solid var(--line); color: var(--ink); vertical-align: middle; font-variant-numeric: tabular-nums; }
.work-overview-row:nth-child(even) td { background: color-mix(in srgb,var(--surface-2) 72%,var(--surface)); }
.work-overview-row:hover td,.work-overview-row:focus-visible td { background: color-mix(in srgb,var(--cyan) 10%,var(--surface)); }
.work-overview-row.attention td:first-child { box-shadow: inset 3px 0 var(--warning); }
.work-overview-row td > b,.work-overview-row td > small { max-width: 100%; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-overview-row td > b { font-size: 11px; line-height: 1.3; }
.work-overview-row td > small { margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.25; }
.overview-status { max-width: 100%; min-height: 22px; padding: 3px 7px; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 999px; color: #fff; background: #607581; font-size: 8px; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.overview-status.IN_PROGRESS { background: var(--run); }.overview-status.PAUSED,.overview-status.WAITING { background: #a85f00; }.overview-status.QUEUED { background: #286987; }.overview-status.COMPLETED { background: #556a74; }.overview-status.DRAFT { color: var(--ink); background: var(--surface-3); }
.overview-attention { width: 17px; height: 17px; margin-left: 3px; display: inline-grid; place-items: center; border-radius: 50%; color: #6b3900; background: var(--warning); font-size: 9px; font-style: normal; font-weight: 950; }
.overview-quantity b { letter-spacing: -.02em; }.overview-quantity small em { color: var(--run); font-style: normal; }.overview-quantity small i { color: var(--stop); font-style: normal; }
.overview-schedule { font-size: 9px !important; font-weight: 850; white-space: normal !important; line-height: 1.32 !important; }
.work-overview-row .overdue { color: var(--stop); font-weight: 900; }
.work-overview-row .quality-status { min-height: 21px; padding: 3px 6px; font-size: 8px !important; white-space: nowrap; }
.overview-detail-button { width: 27px; height: 27px; padding: 0; border: 1px solid var(--line); border-radius: 8px; color: var(--cyan); background: var(--surface-2); font-size: 20px; line-height: 1; }
.work-overview-detail-panel { width: min(570px,100%); height: 100%; padding: 16px; position: absolute; top: 0; right: 0; z-index: 8; overflow: auto; border-left: 1px solid var(--line); color: var(--ink); background: var(--surface); box-shadow: -18px 0 50px rgba(0,0,0,.28); scrollbar-gutter: stable; }
.work-overview-detail-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.work-overview-detail-heading h3 { margin: 7px 0 2px; font-size: 23px; }.work-overview-detail-heading p { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.work-overview-master-info { margin: 14px 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.work-overview-master-info div { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }.work-overview-master-info dt { color: var(--muted); font-size: 8px; font-weight: 850; }.work-overview-master-info dd { margin: 4px 0 0; overflow-wrap: anywhere; font-size: 11px; font-weight: 900; }
.work-overview-detail-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.work-overview-allocation-detail { margin-top: 16px; }.work-overview-allocation-detail h4 { margin: 0 0 8px; }
.work-overview-allocation-detail article { margin-bottom: 8px; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.work-overview-allocation-detail article > header { min-height: 39px; padding: 7px 9px; display: flex; align-items: center; gap: 7px; border-bottom: 1px solid var(--line); }.work-overview-allocation-detail article > header b { margin-right: auto; }.work-overview-allocation-detail article > header > span:not(.quality-status) { color: var(--muted); font-size: 9px; }
.work-overview-allocation-detail article dl { margin: 0; padding: 9px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; }.work-overview-allocation-detail article dl div:last-child { grid-column: 1/-1; }.work-overview-allocation-detail dt { color: var(--muted); font-size: 8px; font-weight: 850; }.work-overview-allocation-detail dd { margin: 3px 0 0; overflow-wrap: anywhere; font-size: 10px; font-weight: 850; }
.overview-quality-detail,.overview-redacted { margin: 0 9px 9px; padding: 8px 9px; border-left: 3px solid var(--cyan); border-radius: 7px; background: var(--surface); }.overview-quality-detail b,.overview-quality-detail time { margin-right: 7px; font-size: 9px; }.overview-quality-detail time { color: var(--muted); }.overview-quality-detail p,.overview-redacted { color: var(--muted); font-size: 9px; line-height: 1.45; white-space: pre-wrap; }

/* Detailed announcements and per-account announcement management */
.notice-ticker { padding: 0; color: var(--ink); text-align: left; cursor: pointer; }
.notice-ticker > i { width: 30px; flex: 0 0 30px; color: #a85f00; font-size: 23px; font-style: normal; text-align: center; }
.notice-ticker:hover,.notice-ticker:focus-visible { outline: 0; border-color: var(--warning); box-shadow: 0 0 0 3px color-mix(in srgb,var(--warning) 18%,transparent); }
.notice-ticker[data-empty="true"] .notice-track { color: var(--muted); }
.announcement-backdrop { z-index: 180; }
.announcement-dialog { width: min(1180px,100%); max-height: calc(100dvh - 32px); padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: var(--surface); box-shadow: 0 28px 90px rgba(0,0,0,.46); scrollbar-gutter: stable; }
.announcement-heading { padding: 16px 18px; position: sticky; top: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); background: color-mix(in srgb,var(--surface) 94%,transparent); backdrop-filter: blur(12px); }
.announcement-heading > div:first-child { min-width: 0; }.announcement-heading small { color: var(--cyan); font-size: 9px; font-weight: 900; letter-spacing: .13em; }.announcement-heading h2 { margin: 3px 0; }.announcement-heading p { margin: 0; color: var(--muted); font-size: 10px; }.announcement-heading > div:last-child { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }.announcement-heading > div:last-child > span { color: var(--muted); font-size: 9px; font-weight: 850; }
.announcement-layout { min-height: 360px; padding: 12px; display: grid; grid-template-columns: minmax(0,1fr); gap: 12px; align-items: start; }.announcement-layout:has(.announcement-editor-panel) { grid-template-columns: minmax(0,1fr) minmax(390px,.72fr); }
.announcement-list { min-width: 0; display: grid; gap: 8px; }.announcement-item { padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }.announcement-item.main { border-left: 4px solid var(--warning); }.announcement-item.archived { opacity: .68; }.announcement-item header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }.announcement-item header > div { min-width: 0; }.announcement-item h3 { margin: 5px 0 0; overflow-wrap: anywhere; font-size: 15px; }.announcement-item p { margin: 10px 0; overflow-wrap: anywhere; color: var(--ink); font-size: 11px; line-height: 1.65; white-space: pre-wrap; }.announcement-item footer { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 8px; }.announcement-main-badge,.announcement-archive-badge { min-height: 20px; padding: 3px 7px; display: inline-flex; align-items: center; border-radius: 999px; color: #6b3900; background: color-mix(in srgb,var(--warning) 28%,var(--surface)); font-size: 8px; font-weight: 900; }.announcement-archive-badge { margin-left: 4px; color: var(--muted); background: var(--surface-3); }
.announcement-editor-panel { padding: 14px; position: sticky; top: 82px; border: 1px solid color-mix(in srgb,var(--cyan) 45%,var(--line)); border-radius: 13px; background: var(--surface-2); }.announcement-editor-heading { margin-bottom: 12px; display: flex; justify-content: space-between; gap: 10px; }.announcement-editor-heading small { color: var(--cyan); font-size: 8px; font-weight: 900; }.announcement-editor-heading h3 { margin: 3px 0 0; }.announcement-editor-panel form { display: grid; gap: 9px; }.announcement-editor-panel textarea { resize: vertical; }.announcement-editor-dates { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }.announcement-editor-checks { display: flex; gap: 14px; flex-wrap: wrap; }.announcement-editor-checks label { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-size: 10px; font-weight: 850; }.announcement-editor-checks input { width: 17px; height: 17px; accent-color: var(--cyan); }.announcement-editor-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.announcement-delete-confirm { padding: 9px 10px; display: grid; gap: 8px; border: 1px solid color-mix(in srgb,var(--stop) 45%,var(--line)); border-radius: 9px; color: var(--stop); background: color-mix(in srgb,var(--stop) 8%,var(--surface)); font-size: 9px; line-height: 1.45; }.announcement-delete-confirm > div { display: flex; gap: 7px; justify-content: flex-end; }

/* Server desktop start-after-sign-in setting */
.server-startup-card { min-width: 0; }.server-startup-status { min-height: 25px; padding: 4px 8px; border-radius: 999px; color: var(--muted); background: var(--surface-3); font-size: 9px; font-weight: 900; }.server-startup-status.enabled { color: #fff; background: var(--run); }.server-startup-control { padding: 13px; display: flex; justify-content: space-between; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }.server-startup-control > div { min-width: 0; display: grid; gap: 4px; }.server-startup-control b { font-size: 13px; }.server-startup-control small { color: var(--muted); font-size: 9px; line-height: 1.45; }.server-startup-control code { max-width: 100%; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }.server-startup-control em { color: var(--stop); font-size: 9px; font-style: normal; font-weight: 850; }.server-startup-switch { min-width: 112px; padding: 7px 10px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface); font-size: 9px; font-weight: 900; }.server-startup-switch i { width: 32px; height: 18px; position: relative; flex: 0 0 auto; border-radius: 999px; background: var(--surface-3); }.server-startup-switch i::after { content:""; width: 14px; height: 14px; position: absolute; top: 2px; left: 2px; border-radius: 50%; background: var(--muted); transition: transform .18s ease; }.server-startup-switch.on { color: var(--run); border-color: color-mix(in srgb,var(--run) 50%,var(--line)); }.server-startup-switch.on i { background: color-mix(in srgb,var(--run) 32%,var(--surface-3)); }.server-startup-switch.on i::after { background: var(--run); transform: translateX(14px); }.server-startup-switch:disabled { cursor: not-allowed; opacity: .56; }

@media (max-width: 1450px) {
  .work-overview-toolbar { grid-template-columns: minmax(210px,1.6fr) repeat(4,minmax(105px,.8fr)) repeat(2,minmax(128px,.88fr)); }
  .work-overview-toolbar .field:nth-of-type(8),.work-overview-checks,.work-overview-toolbar > .button { grid-row: 2; }
  .work-overview-toolbar .field:nth-of-type(8) { grid-column: 1 / span 2; }.work-overview-checks { grid-column: 3 / span 3; }.work-overview-toolbar > .button { grid-column: 7; }
}

@media (max-width: 900px) {
  .work-overview-backdrop,.announcement-backdrop { padding: 6px; }
  .work-overview-dialog { width: calc(100vw - 12px); height: calc(100dvh - 12px); border-radius: 12px; }
  .work-overview-heading { align-items: flex-start; padding: 10px 11px; }.work-overview-heading p,.work-overview-live { display: none; }.work-overview-heading > div:last-child { flex-wrap: wrap; justify-content: flex-end; }
  .work-overview-toolbar { max-height: 174px; padding: 7px; overflow: auto; grid-template-columns: repeat(3,minmax(135px,1fr)); }.work-overview-toolbar .field,.work-overview-toolbar .field:nth-of-type(8),.work-overview-checks,.work-overview-toolbar > .button { grid-row: auto; grid-column: auto; }.work-overview-search { grid-column: 1 / span 2 !important; }
  .work-overview-result-bar span { display: none; }
  .work-overview-table { min-width: 1190px; }
  .work-overview-detail-panel { width: min(520px,100%); padding: 13px; }
  .announcement-dialog { max-height: calc(100dvh - 12px); border-radius: 12px; }.announcement-heading { align-items: flex-start; padding: 12px; }.announcement-heading p { display: none; }.announcement-layout:has(.announcement-editor-panel) { grid-template-columns: 1fr; }.announcement-editor-panel { position: static; }
}

@media (max-width: 560px) {
  .header-work-overview { flex: 1 1 auto; }
  .work-overview-toolbar { grid-template-columns: repeat(2,minmax(130px,1fr)); }.work-overview-search { grid-column: 1/-1 !important; }.work-overview-checks { grid-column: 1/-1; }
  .work-overview-result-bar { align-items: flex-start; flex-direction: column; gap: 2px; }.work-overview-result-bar em { margin-left: 0; }
  .work-overview-master-info,.work-overview-allocation-detail article dl { grid-template-columns: repeat(2,minmax(0,1fr)); }.work-overview-allocation-detail article dl div:last-child { grid-column: 1/-1; }
  .announcement-heading { flex-direction: column; }.announcement-heading > div:last-child { width: 100%; justify-content: flex-start; }.announcement-editor-dates { grid-template-columns: 1fr; }
  .server-startup-control { align-items: stretch; flex-direction: column; }.server-startup-switch { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
  .notice-track { width: auto;max-width:100%;padding-left: 8px;left:0!important;overflow: hidden;animation: none !important;text-overflow: ellipsis;transform: none !important; }
  .ocr-progress i { animation:none!important; }
}

/* Factory-layout realtime overview. Coordinates stay normalized while the map scales. */
.realtime-view-switch {
  min-height: 42px;
  padding: 3px;
  display: inline-flex;
  align-items: stretch;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-3);
}
.realtime-view-switch button {
  min-width: 104px;
  padding: 7px 11px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
  cursor: pointer;
}
.realtime-view-switch button.selected {
  color: #fff;
  background: linear-gradient(135deg,var(--nav-production-accent),var(--cyan));
  box-shadow: 0 5px 13px color-mix(in srgb,var(--nav-production-accent) 25%,transparent);
}
.realtime-view-switch button:disabled { cursor: not-allowed; opacity: .58; }
.realtime-layout-screen { min-height: 0; }
.realtime-layout-screen .toolbar { margin-bottom: 6px; padding: 8px 10px; }
.realtime-layout-screen .kpi-grid { margin-bottom: 6px; grid-template-columns: repeat(7,minmax(84px,1fr)); gap: 5px; }
.realtime-layout-screen .kpi-card { min-height: 66px; padding: 7px 9px 6px; border-radius: 9px; }
.realtime-layout-screen .kpi-card strong { margin-top: 3px; font-size: clamp(18px,1.7vw,23px); }
.realtime-layout-screen .kpi-card small { margin-top: 2px; }
.factory-overview-layout { grid-template-columns: minmax(0,1fr); gap: 0; }
.factory-layout-card { min-width: 0; padding: 9px; overflow: hidden; }
.factory-layout-heading { align-items: center; gap: 12px; }
.factory-layout-heading > div:first-child { min-width: 0; }
.factory-layout-heading h2 { margin-bottom: 2px; }
.factory-layout-heading p { max-width: 780px; line-height: 1.35; }
.factory-layout-actions,.factory-layout-zoom { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.factory-layout-zoom {
  min-height: 32px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
}
.factory-layout-fit { min-width: 48px; min-height: 27px; padding: 2px 5px; border: 0; border-radius: 6px; color: var(--ink); background: transparent; font-size: 11px; font-weight: 950; text-align: center; cursor: pointer; font-variant-numeric: tabular-nums; }
.factory-layout-fit:hover,.factory-layout-fit:focus-visible { color: #fff; background: var(--nav-production-accent); outline: none; }
.factory-layout-zoom .button { min-width: 31px; padding-inline: 7px; border: 0; font-size: 17px; }
.factory-layout-edit-note {
  margin: 6px 0;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid color-mix(in srgb,var(--cyan) 62%,var(--line));
  border-radius: 10px;
  color: var(--ink);
  background: color-mix(in srgb,var(--cyan) 10%,var(--surface));
  font-size: 12px;
}
.factory-layout-edit-note b { color: color-mix(in srgb,var(--cyan) 72%,var(--ink)); white-space: nowrap; }
.factory-layout-viewport {
  height: var(--factory-layout-fit-height,min(58dvh,720px));
  min-height: 260px;
  padding: 5px;
  display: grid;
  place-items: center;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    radial-gradient(circle at 20% 16%,color-mix(in srgb,var(--cyan) 8%,transparent),transparent 35%),
    color-mix(in srgb,var(--surface-3) 70%,var(--surface));
  scrollbar-gutter: auto;
}
.factory-layout-viewport.zoomed { place-items: start; }
.factory-layout-stage {
  min-width: 0;
  min-height: 0;
  margin: auto;
  position: relative;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid color-mix(in srgb,var(--line) 78%,#fff);
  border-radius: 8px;
  background:
    linear-gradient(90deg,color-mix(in srgb,var(--cyan) 4%,transparent) 1px,transparent 1px),
    linear-gradient(color-mix(in srgb,var(--cyan) 4%,transparent) 1px,transparent 1px),
    color-mix(in srgb,#fff 88%,var(--surface));
  background-size: 4% 100%,100% 8%;
  box-shadow: 0 10px 28px rgba(4,28,45,.16);
  isolation: isolate;
}
.factory-layout-stage > img { width: 100%; height: 100%; position: absolute; inset: 0; z-index: 0; display: block; object-fit: fill; opacity: .2; filter: grayscale(1) contrast(.72); pointer-events: none; user-select: none; }
.factory-layout-stage.editing { outline: 3px solid color-mix(in srgb,var(--cyan) 50%,transparent); outline-offset: 3px; }
.factory-machine-marker.equipment-tile {
  width: clamp(36px,4.6dvh,50px);
  height: clamp(25px,3.4dvh,37px);
  min-height: 0;
  padding: 0;
  position: absolute;
  z-index: 2;
  display: block;
  transform: translate(-50%,-50%);
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.factory-machine-marker .equipment-icon { width: clamp(17px,2.35dvh,25px); height: clamp(17px,2.35dvh,25px); margin: clamp(4px,.55dvh,6px) auto 0; }
.factory-machine-marker.equipment-tile[data-state="WAIT"] .equipment-icon { width: clamp(14px,1.9dvh,21px); height: clamp(14px,1.9dvh,21px); margin: clamp(6px,.8dvh,9px) auto 0 clamp(3px,.5dvh,6px); }
.factory-machine-marker .equipment-icon .long-wait-icon { font-size: clamp(10px,1.35dvh,15px); }
.factory-machine-marker .equipment-code { inset: 1px 2px auto; font-size: clamp(6px,.74dvh,8px); line-height: clamp(8px,1.05dvh,11px); }
.factory-machine-marker .equipment-meta { inset: auto 2px 1px; min-height: 0; font-size: clamp(5px,.65dvh,7px); line-height: clamp(7px,.9dvh,10px); }
.factory-machine-marker.equipment-tile[data-state="WAIT"] .equipment-meta { min-height: 0; font-size: clamp(4.4px,.54dvh,5.8px); line-height: clamp(7px,.9dvh,10px); }
.factory-machine-marker .equipment-order { top: clamp(8px,1.1dvh,12px); right: 1px; max-width: calc(100% - 2px); padding: 0 2px; font-size: clamp(4.5px,.58dvh,6px); line-height: clamp(6px,.8dvh,9px); }
.factory-machine-marker.equipment-tile:hover,.factory-machine-marker.equipment-tile:focus-visible,.factory-machine-marker.equipment-tile.selected { z-index: 8; transform: translate(-50%,-50%) scale(1.14); border-color: var(--cyan); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb,var(--cyan) 28%,transparent),0 8px 18px rgba(5,29,44,.32); }
.factory-layout-stage.editing .factory-machine-marker { cursor: grab; outline: 1px dashed rgba(255,255,255,.92); outline-offset: -2px; }
.factory-machine-marker.dragging,.factory-machine-marker.equipment-tile.dragging { z-index: 20; cursor: grabbing; transform: translate(-50%,-50%) scale(1.18); box-shadow: 0 0 0 4px color-mix(in srgb,var(--cyan) 30%,transparent),0 14px 26px rgba(5,29,44,.34); }
.factory-layout-footer { padding: 5px 2px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 9px; line-height: 1.3; }
.factory-layout-footer span:last-child { text-align: right; }
.offline .factory-layout-card { filter: grayscale(.9); opacity: .55; }
.wallboard .factory-layout-viewport { height: var(--factory-layout-fit-height,calc(100dvh - 255px)); min-height: 260px; }

@media (max-width: 1100px) {
  .factory-layout-heading { align-items: flex-start; flex-direction: column; }
  .factory-layout-actions { width: 100%; justify-content: flex-start; }
}
@media (max-height: 820px) and (min-width: 701px) {
  .realtime-layout-screen .kpi-grid { display: none; }
  .factory-layout-heading p { display: none; }
}
@media (max-width: 700px) {
  .realtime-view-switch { width: 100%; }
  .realtime-view-switch button { min-width: 0; flex: 1; }
  .realtime-layout-screen .kpi-grid { display: none; }
  .factory-layout-card { padding: 8px; }
  .factory-layout-edit-note { align-items: flex-start; flex-direction: column; gap: 3px; }
  .factory-layout-viewport { min-height: 230px; padding: 4px; }
  .factory-layout-footer { align-items: flex-start; flex-direction: column; }
  .factory-layout-footer span:last-child { text-align: left; }
}

/* Logged-in account reminder: independent from the operational notice ticker. */
.account-session-warning {
  height: 46px;
  position: fixed;
  inset: auto 0 0;
  z-index: 45;
  overflow: hidden;
  display: flex;
  align-items: center;
  border-top: 2px solid color-mix(in srgb,var(--warning) 78%,var(--line));
  color: #fff;
  background: color-mix(in srgb,var(--navy) 94%,#000);
  box-shadow: 0 -9px 26px rgba(0,0,0,.28);
  pointer-events: none;
}
.account-session-warning::before {
  content: "!";
  height: 100%;
  padding: 0 14px;
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  color: #402300;
  background: var(--warning);
  font-size: 18px;
  font-weight: 950;
  letter-spacing: .12em;
}
.account-session-warning__track {
  width: max-content;
  max-width: none;
  position: absolute;
  left: 0;
  display: inline-block;
  flex: 0 0 auto;
  color: #fff;
  font-size: clamp(13px,1.1vw,16px);
  font-weight: 850;
  line-height: 44px;
  white-space: nowrap;
  will-change: transform;
  transform: translate3d(100vw,0,0);
}
.account-session-warning.is-running .account-session-warning__track {
  animation: account-warning-marquee var(--account-warning-duration,42s) linear 1 both;
}
.account-warning-document-hidden .account-session-warning__track { animation-play-state: paused !important; }
.account-warning-visible .toast { bottom: 62px; }
@keyframes account-warning-marquee {
  from { transform: translate3d(100vw,0,0); }
  to { transform: translate3d(calc(-100% - 24px),0,0); }
}

@media (max-width: 560px) {
  .account-session-warning { height: 42px; }
  .account-session-warning::before { padding-inline: 8px; font-size: 8px; letter-spacing: .06em; }
  .account-session-warning__track { font-size: 12px; line-height: 40px; }
  .account-warning-visible .toast { right: 8px; bottom: 52px; left: 8px; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .account-session-warning {
    height: auto;
    min-height: 58px;
    padding: 9px 12px;
    align-items: stretch;
    gap: 9px;
  }
  .account-session-warning::before { height: auto; min-height: 38px; border-radius: 7px; }
  .account-session-warning__track {
    width: auto;
    min-width: 0;
    position: static;
    display: block;
    flex: 1 1 auto;
    font-size: 12px;
    line-height: 1.5;
    white-space: normal;
    will-change: auto;
    transform: none;
  }
  .account-session-warning.is-running .account-session-warning__track {
    animation: account-warning-hold 16s linear 1 both;
  }
  .account-warning-visible .toast { bottom: 86px; }
  @keyframes account-warning-hold { from { opacity: 1; } to { opacity: 1; } }
}
