/*
 * mockup-v4 shell — vendored from MESNEXT shell CSS (frozen copy)
 * Standalone package — assets owned by mockup-v4.
 */

:root {
  color-scheme: light;
  --primary: #ff6b00;
  --primary-dark: #cc5500;
  --secondary: #1976d2;
  --background: #f3f5f7;
  --surface: #ffffff;
  --surface-subtle: #f8f9fa;
  --text: #212121;
  --text-muted: #687079;
  --border: #d8dde3;
  --border-strong: #aeb7c0;
  --success: #2e7d32;
  --success-bg: #eaf5eb;
  --error: #c62828;
  --error-bg: #fdecec;
  --warning: #b05a00;
  --warning-bg: #fff2df;
  --info-bg: #eaf3fb;
  --nav: #1e242a;
  --nav-border: #35414b;
  --shadow: 0 6px 18px rgb(22 31 40 / 8%);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --primary-dark: #ffad70;
  --secondary: #64b5f6;
  --background: #14181c;
  --surface: #20262c;
  --surface-subtle: #282f36;
  --text: #f4f6f8;
  --text-muted: #aab2ba;
  --border: #3b454e;
  --border-strong: #596570;
  --success: #75c47d;
  --success-bg: #173c22;
  --error: #ff8a80;
  --error-bg: #4a2020;
  --warning: #ffb35c;
  --warning-bg: #462f15;
  --info-bg: #173249;
  --nav: #0e1114;
  --nav-border: #2d3842;
  --shadow: 0 8px 20px rgb(0 0 0 / 24%);
}

* { box-sizing: border-box; }

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

.login-shell {
  min-height: 100vh;
  background: radial-gradient(circle at 50% 0, var(--surface) 0, var(--background) 50%, var(--background) 100%);
}

.login-header {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--nav-border);
  background: var(--nav);
  color: #fff;
}

.login-main {
  display: grid;
  min-height: calc(100vh - 66px);
  align-content: center;
  gap: 18px;
  padding: 24px;
}

.login-intro {
  text-align: center;
}

.login-intro p,
.login-card .section-head p {
  margin: 0;
  color: var(--primary-dark);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
}

.login-intro h1 {
  margin: 4px 0;
  font-size: 34px;
}

.login-intro span {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.login-grid {
  display: grid;
  width: min(920px, calc(100vw - 48px));
  grid-template-columns: minmax(340px, 1fr) minmax(320px, .9fr);
  gap: 16px;
  margin: 0 auto;
}

.login-card,
.login-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-card {
  display: grid;
  gap: 10px;
  padding: 20px;
  border-top: 4px solid var(--primary);
  border-radius: 8px;
}

.login-card label {
  display: grid;
  gap: 5px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 900;
}

.login-card input {
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface-subtle);
}

.login-card small {
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.45;
}

.login-error {
  margin: 0;
  padding: 9px 10px;
  border-left: 4px solid var(--error);
  background: var(--error-bg);
  color: var(--error);
  font-size: 11px;
  font-weight: 900;
}

.login-chips {
  display: grid;
  align-content: center;
  gap: 8px;
}

.login-chip {
  display: grid;
  width: 100%;
  min-height: 72px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-left: 4px solid var(--secondary);
  border-radius: 7px;
  text-align: left;
}

.login-chip.role-supervisor {
  border-left-color: var(--primary);
}

.login-chip:hover,
.login-chip.is-selected {
  border-color: var(--primary);
  background: var(--warning-bg);
}

.login-chip strong,
.login-chip small {
  display: block;
}

.login-chip small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 10px;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--background);
  color: var(--text);
  font-family: "Roboto", "Noto Sans Thai", Arial, sans-serif;
}

button,
input {
  color: inherit;
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgb(25 118 210 / 32%);
  outline-offset: 2px;
}

.app {
  display: grid;
  height: 100vh;
  grid-template-columns: 258px minmax(0, 1fr);
  background: var(--background);
}

.app[data-sidebar="closed"] {
  grid-template-columns: 0 minmax(0, 1fr);
}

.sidebar {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--nav-border);
  background: var(--nav);
  color: #ffffff;
}

.app[data-sidebar="closed"] .sidebar {
  visibility: hidden;
  pointer-events: none;
}

.brand {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--nav-border);
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 6px;
  background: var(--primary);
  font-size: 20px;
  font-weight: 900;
}

.brand small,
.profile small,
.nav-group summary,
.search label {
  color: #aeb7c0;
}

.brand small {
  display: block;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .12em;
}

.brand strong {
  display: block;
  margin-top: 2px;
  font-size: 14px;
}

.profile {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 9px;
  margin: 10px;
  padding: 9px;
  border: 1px solid #3d4953;
  border-radius: 7px;
  background: #222b32;
}

.avatar {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 2px solid rgb(255 255 255 / 72%);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #b84400);
  box-shadow: 0 2px 8px rgb(18 32 45 / 18%);
  color: #fff;
  font-weight: 900;
}

.profile strong,
.profile span,
.profile small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile strong {
  font-size: 12px;
}

.profile span {
  margin-top: 2px;
  color: #ffb178;
  font-size: 9px;
  font-weight: 900;
}

.profile small {
  margin-top: 3px;
  font-size: 8px;
}

.profile dl {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: .7fr 1.3fr;
  gap: 1px;
  margin: 0;
  background: #3d4953;
}

.profile dl div {
  min-width: 0;
  padding: 6px;
  background: #1c242a;
}

.profile dt {
  color: #9eabb5;
  font-size: 8px;
  font-weight: 900;
}

.profile dd {
  margin: 3px 0 0;
  overflow: hidden;
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search {
  position: relative;
  margin: 10px;
}

.search label {
  display: block;
  margin-bottom: 4px;
  font-size: 8px;
  font-weight: 900;
}

.search-box {
  display: grid;
  min-height: 38px;
  grid-template-columns: 20px minmax(0, 1fr) 26px;
  align-items: center;
  gap: 4px;
  padding: 3px 4px 3px 8px;
  border: 1px solid #4b5862;
  border-radius: 5px;
  background: #12191e;
}

.search-box input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
}

.search-box button {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 0;
  background: transparent;
  color: #aeb7c0;
}

.search-results {
  position: absolute;
  z-index: 10;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  max-height: 230px;
  overflow-y: auto;
  border: 1px solid #4b5862;
  border-radius: 5px;
  background: #1c242a;
  box-shadow: 0 12px 28px rgb(0 0 0 / 36%);
}

.search-results button,
.search-results p {
  width: 100%;
  margin: 0;
  padding: 8px;
  border: 0;
  border-bottom: 1px solid #35414b;
  background: transparent;
  color: #fff;
  font-size: 9px;
  text-align: left;
}

.search-results small {
  display: block;
  margin-top: 2px;
  color: #aeb7c0;
}

.nav {
  display: block;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 0 10px 12px;
}

.nav-group {
  margin-top: 5px;
}

.nav-group summary {
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 900;
  list-style: none;
}

.nav-group summary::-webkit-details-marker {
  display: none;
}

.nav-group[open] summary {
  color: #fff;
  background: rgb(255 255 255 / 6%);
}

.nav-item {
  display: flex;
  width: 100%;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #bdc6cd;
  font-size: 10px;
  font-weight: 800;
  text-align: left;
}

.nav-item:hover,
.nav-item:focus-visible {
  background: rgb(255 255 255 / 8%);
  color: #fff;
}

.nav-item.is-active {
  background: rgb(255 107 0 / 18%);
  color: #ffb178;
}

.nav-item.is-muted {
  color: #6f7d87;
}

.nav-item em {
  display: block;
  margin-left: auto;
  color: #9eabb5;
  font-size: 8px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.nav-item.is-enabled em,
.nav-item.is-active em {
  color: #ffb178;
}

.station-links .nav-item {
  padding-left: 24px;
}

.workspace {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  color: var(--text);
}

.app[data-view="station"] .workspace {
  overflow: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  min-height: 66px;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.topbar small,
.section-head p,
.assign-modal header p {
  margin: 0;
  color: var(--primary-dark);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
}

.topbar h1,
.section-head h2,
.assign-modal h2 {
  margin: 2px 0 0;
}

.topbar h1 {
  font-size: 25px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button,
.theme-toggle,
.ghost-button,
.primary-button,
.danger-button {
  min-height: 44px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 900;
}

.icon-button {
  display: grid;
  width: 44px;
  place-items: center;
  border: 1px solid var(--border-strong);
  background: var(--surface-subtle);
}

.theme-toggle,
.ghost-button {
  border: 1px solid var(--border-strong);
  background: var(--surface-subtle);
  color: var(--text);
}

.theme-toggle,
.ghost-button,
.primary-button,
.danger-button {
  padding: 0 12px;
}

.primary-button {
  border: 0;
  background: var(--primary);
  color: #fff;
}

.danger-button {
  border: 1px solid var(--error);
  background: var(--error-bg);
  color: var(--error);
}

.scope-chip,
.status-chip {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 900;
}

.status-chip.running { border-color: var(--success); background: var(--success-bg); color: var(--success); }
.status-chip.blocked,
.status-chip.waiting,
.status-chip.unassigned { border-color: var(--warning); background: var(--warning-bg); color: var(--warning); }
.status-chip.hold,
.status-chip.offline { border-color: var(--error); background: var(--error-bg); color: var(--error); }
.status-chip.ready { border-color: var(--secondary); background: var(--info-bg); color: var(--secondary); }

.notice {
  position: fixed;
  z-index: 30;
  top: 82px;
  right: 18px;
  width: min(420px, calc(100vw - 36px));
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--warning);
  border-left-width: 4px;
  border-radius: 8px;
  background: var(--warning-bg);
  box-shadow: 0 14px 34px rgb(0 0 0 / 18%);
  color: var(--warning);
  font-size: 12px;
  font-weight: 800;
}

.notice span {
  margin-left: 8px;
  color: var(--text);
  font-weight: 700;
}

.view {
  display: none;
  padding: 16px 18px 22px;
}

.view.is-active {
  display: block;
}

.app[data-view="station"] #view-station {
  height: calc(100vh - 66px);
  padding: 10px 12px;
  overflow: hidden;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 13px;
}

.section-head h2 {
  font-size: 24px;
}

.section-head > span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 12px;
}

.kpi-card,
.station-card,
.utility-card,
.station-shell,
.assign-modal {
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.kpi-card {
  min-height: 72px;
  padding: 10px 12px;
  border-top: 4px solid var(--secondary);
}

.kpi-card.warning { border-top-color: var(--warning); }
.kpi-card.error { border-top-color: var(--error); }
.kpi-card.success { border-top-color: var(--success); }

.kpi-card small {
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 900;
}

.kpi-card strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.kpi-card span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
}

.station-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.performance-grid,
.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.performance-grid:empty {
  display: none;
}

.performance-card,
.summary-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.performance-card {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  padding: 0;
  background: var(--border);
}

.performance-card.running,
.summary-card.running {
  border-left-color: var(--success);
}

.performance-card.blocked,
.summary-card.blocked {
  border-left-color: var(--warning);
}

.performance-card.hold,
.summary-card.hold {
  border-left-color: var(--error);
}

.performance-card > div {
  min-width: 0;
  padding: 10px;
  background: var(--surface);
}

.performance-card small,
.summary-card small {
  display: block;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 900;
}

.performance-card strong,
.summary-card h3 {
  display: block;
  margin: 4px 0 2px;
  font-size: 19px;
}

.performance-card span,
.summary-card p {
  display: block;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
}

.summary-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 12px 0;
  background: var(--border);
}

.summary-card dl div {
  min-width: 0;
  padding: 8px;
  background: var(--surface-subtle);
}

.station-card {
  min-width: 0;
  padding: 14px;
  border-top: 4px solid var(--secondary);
}

.station-card.running { border-top-color: var(--success); }
.station-card.blocked { border-top-color: var(--warning); }
.station-card.hold,
.station-card.offline { border-top-color: var(--error); }

.station-card__top,
.station-card__actions,
.operator-line,
.job-bar,
.plan-strip,
.station-header,
.task-grid,
.pipeline,
.assignment-row {
  display: flex;
  align-items: center;
}

.station-card__top {
  gap: 8px;
}

.station-card__top strong {
  font-size: 23px;
}

.station-card h3 {
  margin: 8px 0 4px;
  font-size: 20px;
}

.station-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.station-card dl,
.job-bar {
  display: grid;
  gap: 1px;
  background: var(--border);
}

.station-card dl {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 12px 0;
}

.station-card dl div,
.job-bar div {
  min-width: 0;
  padding: 8px;
  background: var(--surface-subtle);
}

dt {
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 900;
}

dd {
  margin: 3px 0 0;
  overflow: hidden;
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operator-line {
  gap: 8px;
  margin: 10px 0 12px;
  padding: 9px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
}

.operator-line .avatar {
  width: 38px;
  height: 38px;
  color: #fff;
  font-size: 12px;
}

.operator-line strong,
.operator-line small {
  display: block;
}

.operator-line small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 800;
}

.machine-summary {
  display: grid;
  gap: 2px;
  margin: 10px 0 0;
  padding: 9px 10px;
  border-left: 4px solid var(--border-strong);
  background: var(--surface-subtle);
}

.machine-summary.running {
  border-left-color: var(--success);
  background: var(--success-bg);
}

.machine-summary.blocked {
  border-left-color: var(--warning);
  background: var(--warning-bg);
}

.machine-summary.hold {
  border-left-color: var(--error);
  background: var(--error-bg);
}

.machine-summary strong {
  font-size: 12px;
}

.machine-summary span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
}

.station-card__actions {
  justify-content: flex-end;
  gap: 8px;
}

.station-card__actions button {
  min-height: 38px;
}

.station-shell {
  min-height: calc(100vh - 108px);
  overflow: hidden;
}

.app[data-view="station"] .station-shell {
  display: grid;
  height: 100%;
  min-height: 0;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  border: 1px solid var(--border);
  background: var(--border);
}

.station-header {
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.station-header--compact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 76px;
  padding: 10px 14px;
}

.station-header h2 {
  margin: 2px 0;
  font-size: 28px;
}

.station-header--compact h2 {
  font-size: clamp(22px, 2vw, 30px);
}

.station-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.station-header--compact p {
  max-width: 920px;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.station-header__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.feedback {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-subtle);
}

.feedback strong {
  font-size: 18px;
}

.feedback span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.feedback--compact {
  min-height: 44px;
  padding: 8px 14px;
}

.feedback--compact strong {
  flex: 0 0 auto;
  font-size: 18px;
}

.feedback--compact span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-strip {
  display: grid;
  grid-template-columns: 180px 140px minmax(180px, 1fr) 120px;
  gap: 1px;
  background: var(--border);
}

.station-kpi-strip {
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

.plan-strip > div {
  min-height: 58px;
  padding: 10px 14px;
  background: var(--surface);
}

.station-kpi-strip > div {
  min-height: 56px;
  padding: 8px 10px;
}

.plan-strip small,
.job-bar small,
.task-panel small,
.action-panel small,
.machine-panel small {
  display: block;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 900;
}

.plan-strip strong {
  display: block;
  margin-top: 2px;
  font-size: 19px;
}

.station-kpi-strip strong {
  overflow: hidden;
  font-size: clamp(15px, 1.4vw, 20px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.station-kpi-strip span {
  display: block;
  margin-top: 1px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 850;
}

.progress-track {
  height: 9px;
  margin-top: 10px;
  overflow: hidden;
  background: var(--border);
}

.progress-track span {
  display: block;
  height: 100%;
  background: var(--primary);
}

.job-bar {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
}

.station-job-bar {
  display: grid;
  min-height: 54px;
  gap: 1px;
  background: var(--border);
}

.station-job-bar > div {
  min-width: 0;
  padding: 8px 10px;
  background: var(--surface-subtle);
}

.station-job-bar strong {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  font-size: clamp(13px, 1.2vw, 18px);
  text-overflow: ellipsis;
}

.station-shell .performance-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border-top: 1px solid var(--border);
  background: var(--border);
}

.station-shell .performance-grid article {
  min-width: 0;
  padding: 10px 12px;
  background: var(--surface);
}

.station-shell .performance-grid small,
.machine-panel small {
  display: block;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 900;
}

.station-shell .performance-grid strong {
  display: block;
  margin-top: 3px;
  font-size: 19px;
}

.task-grid {
  display: grid;
  min-height: 250px;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  align-items: stretch;
  gap: 1px;
  background: var(--border);
}

.station-workbench {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: 1px;
  background: var(--border);
}

.checkpoint-workspace {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto;
  background: var(--surface);
}

.station-flow-panel {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto auto;
  background: var(--surface);
}

.current-step-card {
  display: grid;
  align-content: center;
  gap: 10px;
  min-width: 0;
  padding: clamp(16px, 2vw, 28px);
}

.current-step-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.current-step-card__head > span {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 900;
  text-align: right;
}

.current-step-card > small,
.current-step-card dt {
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 900;
}

.current-step-card h3 {
  margin: 0;
  font-size: clamp(28px, 3vw, 48px);
}

.current-step-card p {
  max-width: 920px;
  margin: 0;
  color: var(--text-muted);
  font-size: clamp(12px, 1vw, 15px);
  font-weight: 800;
  line-height: 1.45;
}

.current-step-card dl {
  display: grid;
  max-width: 880px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 4px 0 0;
  background: var(--border);
}

.current-step-card dl div {
  min-width: 0;
  padding: 9px;
  background: var(--surface-subtle);
}

.current-step-card dd {
  font-size: 12px;
}

.step-data-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
  gap: 10px;
}

.step-data-group {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
}

.step-data-group header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.step-data-group header small {
  color: var(--primary-dark);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
}

.step-data-group header strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkpoint-values--inline {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.monosashi-values {
  display: grid;
  gap: 6px;
}

.monosashi-values article {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  background: var(--surface);
}

.monosashi-values article.pass {
  border-left-color: var(--success);
  background: var(--success-bg);
}

.monosashi-values small,
.monosashi-values span {
  display: block;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 900;
}

.monosashi-values strong {
  display: block;
  margin: 3px 0;
  font-size: 18px;
}

.task-panel,
.action-panel {
  min-width: 0;
  padding: 18px;
  background: var(--surface);
}

.task-panel h3 {
  margin: 6px 0 8px;
  font-size: 31px;
}

.task-panel p,
.action-panel p,
.machine-panel p,
.utility-card p,
.utility-card li {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.55;
}

.machine-card {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 14px;
  margin-top: 18px;
  padding: 16px;
  border: 2px dashed var(--secondary);
  background: var(--info-bg);
}

.machine-icon {
  display: grid;
  min-height: 72px;
  place-items: center;
  border-radius: 8px;
  background: rgb(25 118 210 / 16%);
  color: var(--secondary);
  font-size: 34px;
}

.action-panel {
  display: grid;
  align-content: start;
  gap: 10px;
}

.machine-panel {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 18px;
  border-left: 4px solid var(--border-strong);
  background: var(--surface);
}

.machine-panel--compact {
  min-height: 0;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 8px;
  padding: 12px;
}

.machine-panel.running {
  border-left-color: var(--success);
}

.machine-panel.blocked {
  border-left-color: var(--warning);
}

.machine-panel.hold {
  border-left-color: var(--error);
}

.machine-panel h3 {
  margin: 0;
  font-size: 22px;
}

.machine-panel--compact h3 {
  overflow: hidden;
  font-size: clamp(18px, 1.6vw, 23px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.machine-panel p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.machine-panel--compact p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.machine-panel dl {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  margin: 2px 0;
  background: var(--border);
}

.machine-panel--compact dl {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.machine-panel dl div {
  min-width: 0;
  padding: 8px;
  background: var(--surface-subtle);
}

.machine-panel--compact dl div {
  padding: 7px;
}

.machine-panel--compact dt,
.machine-panel--compact dd {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.machine-panel__actions {
  display: grid;
  gap: 8px;
}

.machine-panel__actions button {
  min-height: 42px;
}

.action-panel button {
  min-height: 44px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 900;
}

.action-danger {
  border: 1px solid var(--error);
  background: var(--error-bg);
  color: var(--error);
}

.action-warning {
  border: 1px solid var(--warning);
  background: var(--warning-bg);
  color: var(--warning);
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(var(--step-count), minmax(0, 1fr));
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
  list-style: none;
}

.pipeline--compact {
  min-height: 86px;
}

.pipeline li {
  border-right: 1px solid var(--border);
  background: var(--surface-subtle);
}

.pipeline button {
  display: block;
  width: 100%;
  min-height: 78px;
  padding: 10px 8px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.pipeline--compact button {
  min-height: 86px;
  padding: 9px 8px;
}

.pipeline li.is-current {
  box-shadow: inset 0 -5px 0 var(--primary);
  background: var(--warning-bg);
}

.pipeline li.is-selected {
  outline: 3px solid rgb(255 107 0 / 24%);
  outline-offset: -3px;
}

.pipeline li.is-done {
  background: var(--success-bg);
}

.pipeline span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 900;
}

.pipeline li.is-current span {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.pipeline li.is-done span {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}

.pipeline strong {
  display: block;
  margin-top: 7px;
  font-size: 10px;
}

.pipeline small {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 850;
  line-height: 1.25;
}

.checkpoint-panel {
  padding: 13px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.checkpoint-panel--compact {
  display: grid;
  min-height: 0;
  align-content: center;
  padding: clamp(12px, 1.6vw, 20px);
  border-top: 0;
}

.checkpoint-panel__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.checkpoint-panel--compact .checkpoint-panel__heading {
  margin-bottom: clamp(8px, 1vw, 14px);
}

.checkpoint-panel__heading small,
.checkpoint-panel__heading > span {
  color: var(--primary-dark);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
}

.checkpoint-panel__heading h3 {
  margin: 3px 0 2px;
  font-size: 18px;
}

.checkpoint-panel--compact .checkpoint-panel__heading h3 {
  font-size: clamp(20px, 2.2vw, 34px);
}

.checkpoint-panel__heading p {
  margin: 0;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 750;
}

.checkpoint-panel--compact .checkpoint-panel__heading p {
  max-width: 860px;
  overflow: hidden;
  font-size: clamp(11px, 1vw, 14px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkpoint-panel__heading > span {
  flex: 0 0 auto;
  color: var(--text-muted);
  letter-spacing: 0;
}

.checkpoint-values {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.checkpoint-panel--compact .checkpoint-values {
  gap: 10px;
}

.checkpoint-panel--side .checkpoint-values {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.checkpoint-values article {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--secondary);
  background: var(--surface-subtle);
}

.checkpoint-panel--compact .checkpoint-values article {
  min-height: 76px;
  padding: clamp(9px, 1vw, 13px);
}

.checkpoint-values small,
.checkpoint-values span {
  display: block;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 900;
}

.checkpoint-values strong {
  display: block;
  margin: 4px 0 2px;
  overflow: hidden;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkpoint-panel--compact .checkpoint-values strong {
  font-size: clamp(18px, 1.9vw, 28px);
}

.checkpoint-panel--side .checkpoint-values strong {
  font-size: clamp(16px, 1.5vw, 22px);
}

.checkpoint-values span {
  color: var(--success);
}

.action-log {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.action-log--compact {
  min-height: 0;
  padding: 0;
  border-top: 0;
}

.action-log small {
  display: block;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 900;
}

.action-log ul {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.action-log--compact ul {
  grid-template-columns: 1fr;
  gap: 5px;
  margin-top: 6px;
}

.action-log li {
  min-height: 36px;
  padding: 7px 8px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
}

.action-log--compact li {
  min-height: 0;
  padding: 6px 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.utility-view {
  max-width: 980px;
}

.team-view {
  max-width: none;
}

.workforce-view {
  max-width: none;
}

.team-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.team-summary-card {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left: 5px solid var(--secondary);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.team-summary-card.success {
  border-left-color: var(--success);
  background: var(--success-bg);
}

.team-summary-card small,
.team-card small {
  display: block;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 900;
}

.team-summary-card strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

.team-summary-card span {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.team-card {
  display: grid;
  min-width: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 1px solid var(--border);
  border-top: 4px solid var(--border-strong);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.team-card.is-assigned {
  border-top-color: var(--secondary);
}

.team-card.is-available {
  border-top-color: var(--success);
}

.team-card__avatar {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 18px 12px 14px;
  background: var(--surface-subtle);
}

.team-card__avatar .avatar {
  width: 72px;
  height: 72px;
  font-size: 18px;
}

.team-card__body {
  min-width: 0;
  padding: 12px;
}

.team-card__body h3 {
  margin: 4px 0;
  font-size: 20px;
}

.team-card__body p {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
}

.team-card dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 10px;
  background: var(--border);
}

.team-card dl div {
  min-width: 0;
  padding: 8px;
  background: var(--surface-subtle);
}

.team-card__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
}

.team-card__actions button {
  min-height: 40px;
}

.utility-card {
  padding: 18px;
  border-top: 4px solid var(--secondary);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgb(8 14 19 / 62%);
}

.assign-modal {
  display: grid;
  width: min(940px, calc(100vw - 48px));
  height: min(620px, calc(100vh - 48px));
  max-height: min(620px, calc(100vh - 48px));
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.assign-modal header,
.assign-modal footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.assign-modal footer {
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  border-bottom: 0;
}

.assign-layout {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
}

.assign-list {
  padding: 14px;
  overflow: auto;
  border-right: 1px solid var(--border);
  background: var(--surface-subtle);
}

.assign-list label {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 900;
}

.assign-list input {
  width: 100%;
  min-height: 42px;
  margin: 5px 0 10px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface);
}

.operator-option {
  display: grid;
  width: 100%;
  min-height: 68px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
  padding: 9px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--secondary);
  border-radius: 5px;
  background: var(--surface);
  text-align: left;
}

.operator-option.is-selected {
  border-color: var(--primary);
  border-left-color: var(--primary);
  background: var(--warning-bg);
}

.operator-option .avatar {
  width: 40px;
  height: 40px;
  font-size: 12px;
}

.operator-option strong,
.operator-option small {
  display: block;
}

.operator-option small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 9px;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.skill-tags span {
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--text-muted);
  font-size: 8px;
  font-weight: 900;
}

.assign-preview {
  padding: 16px;
  overflow: auto;
  background: var(--surface);
}

.assign-preview h3 {
  margin: 8px 0 4px;
  font-size: 22px;
}

.assignment-warning {
  margin-top: 14px;
  padding: 10px;
  border-left: 4px solid var(--warning);
  background: var(--warning-bg);
  color: var(--warning);
  font-size: 11px;
  font-weight: 900;
}

.capacity-choice {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.capacity-choice header strong,
.capacity-choice header small,
.choice-button strong,
.choice-button small,
.replacement-option strong,
.replacement-option small {
  display: block;
}

.capacity-choice header small,
.choice-button small,
.replacement-option small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 9px;
}

.capacity-choice__modes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.choice-button,
.replacement-option {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--secondary);
  border-radius: 5px;
  background: var(--surface-subtle);
  color: var(--text);
  text-align: left;
}

.choice-button.is-selected,
.replacement-option.is-selected {
  border-color: var(--primary);
  border-left-color: var(--primary);
  background: var(--warning-bg);
}

.replacement-list {
  display: grid;
  gap: 5px;
}

.replacement-option {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
}

.replacement-option .avatar {
  width: 30px;
  height: 30px;
  font-size: 9px;
}

/* Desktop compact station view: fit all station information in one viewport. */
.workspace {
  overflow: hidden;
}

.view {
  height: calc(100vh - 66px);
  overflow: auto;
}

#view-station {
  overflow: hidden;
  padding: 8px 10px;
}

#view-station .station-shell {
  display: grid;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
}

#view-station .station-header {
  min-height: 58px;
  gap: 10px;
  padding: 8px 12px;
}

#view-station .station-header h2 {
  font-size: 22px;
}

#view-station .station-header p,
#view-station .feedback span,
#view-station .task-panel p,
#view-station .machine-panel p {
  font-size: 10px;
}

#view-station .feedback {
  min-height: 36px;
  padding: 6px 12px;
}

#view-station .feedback strong {
  flex: 0 0 auto;
  font-size: 13px;
}

#view-station .feedback span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#view-station .plan-strip,
#view-station .station-kpi-strip {
  grid-template-columns: 130px 100px minmax(140px, 1fr) 120px 105px;
}

#view-station .plan-strip > div,
#view-station .job-bar div {
  min-height: 38px;
  padding: 5px 8px;
}

#view-station .plan-strip strong,
#view-station .station-shell .performance-grid strong,
#view-station .plan-strip span {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#view-station .plan-strip span {
  display: block;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 800;
}

#view-station .job-bar dd {
  font-size: 10px;
}

#view-station .station-shell .performance-grid {
  margin: 0;
}

#view-station .station-shell .performance-grid article {
  min-height: 42px;
  padding: 6px 9px;
}

#view-station .station-shell .performance-grid article span {
  display: block;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#view-station .station-workbench {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 1px;
  overflow: hidden;
  background: var(--border);
}

#view-station .station-flow-panel {
  grid-template-rows: minmax(0, 1fr) auto auto;
  align-content: start;
}

#view-station .current-step-card {
  align-content: start;
  gap: 8px;
  padding: 12px 14px;
}

#view-station .current-step-card h3 {
  font-size: 22px;
}

#view-station .current-step-card p {
  max-width: none;
  font-size: 12px;
  line-height: 1.35;
}

#view-station .current-step-card dl {
  max-width: none;
  margin-top: 2px;
}

#view-station .current-step-card dl div {
  padding: 7px 8px;
}

#view-station .step-data-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(230px, .75fr);
  gap: 8px;
}

#view-station .step-data-group {
  padding: 8px;
}

#view-station .checkpoint-values--inline {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#view-station .monosashi-values strong {
  font-size: 15px;
}

#view-station .checkpoint-panel--side {
  align-self: start;
}

#view-station .checkpoint-workspace {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  background: var(--surface);
}

#view-station .task-panel,
#view-station .machine-panel {
  padding: 9px 10px;
}

#view-station .task-panel h3 {
  margin: 3px 0 4px;
  font-size: 20px;
}

#view-station .machine-card {
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px;
  margin-top: 7px;
  padding: 8px;
}

#view-station .machine-icon {
  min-height: 42px;
  font-size: 22px;
}

#view-station .machine-panel {
  gap: 5px;
  overflow: hidden;
}

#view-station .machine-panel h3 {
  font-size: 16px;
}

#view-station .machine-panel dl {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#view-station .machine-panel dl div {
  padding: 5px 6px;
}

.readonly-note {
  display: grid;
  gap: 2px;
  padding: 6px 8px;
  border-left: 4px solid var(--secondary);
  background: var(--info-bg);
}

.readonly-note strong {
  font-size: 10px;
}

.readonly-note span {
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.25;
}

#view-station .checkpoint-panel {
  min-height: 0;
  padding: 8px 10px;
  overflow: hidden;
}

#view-station .checkpoint-panel__heading {
  gap: 10px;
  margin-bottom: 6px;
}

#view-station .checkpoint-panel__heading h3 {
  display: -webkit-box;
  overflow: hidden;
  font-size: 14px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

#view-station .checkpoint-panel__heading p {
  display: -webkit-box;
  overflow: hidden;
  font-size: 9px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

#view-station .checkpoint-values {
  gap: 5px;
}

#view-station .checkpoint-values article {
  min-height: 54px;
  padding: 5px 6px;
}

#view-station .checkpoint-values strong {
  font-size: 13px;
}

#view-station .pipeline button {
  min-height: 58px;
  padding: 5px 7px;
}

#view-station .pipeline span {
  width: 22px;
  height: 22px;
  font-size: 10px;
}

#view-station .pipeline strong {
  margin-top: 4px;
  font-size: 9px;
}

#view-station .pipeline small {
  display: block;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 8px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#view-station .action-log {
  display: grid;
  min-height: 30px;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 5px;
  padding: 6px 0 0;
  border-top: 0;
  background: transparent;
}

#view-station .action-log ul {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin: 0;
  overflow: hidden;
}

#view-station .action-log li {
  min-height: 24px;
  min-width: 0;
  padding: 4px 6px;
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Rough functional Production Dashboard v2. Visual polish is intentionally secondary. */
#view-dashboard.is-active {
  display: grid;
  height: calc(100vh - 66px);
  grid-template-rows: auto 82px 184px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 10px 10px;
  overflow: hidden;
}

.dashboard-context {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  background: var(--surface);
}

.dashboard-context small,
.dashboard-panel__head small {
  display: block;
  color: var(--primary-dark);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.dashboard-context h2 {
  margin: 1px 0 0;
  font-size: 18px;
}

.dashboard-context > div > span,
.dashboard-panel__head span {
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 800;
}

.dashboard-context__status {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.demo-badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 4px 8px;
  border: 1px dashed var(--secondary);
  border-radius: 999px;
  background: var(--info-bg);
  color: var(--secondary);
  font-size: 9px;
  font-weight: 900;
}

.dashboard-performance {
  display: grid;
  min-width: 0;
  grid-template-columns: 1.15fr repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.dashboard-metric {
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-top: 4px solid var(--secondary);
  border-radius: 0;
  background: var(--surface);
  text-align: left;
  box-shadow: var(--shadow);
}

.dashboard-metric:hover,
.dashboard-metric:focus-visible {
  border-color: var(--secondary);
  background: var(--info-bg);
}

.dashboard-metric.success { border-top-color: var(--success); }
.dashboard-metric.warning { border-top-color: var(--warning); }
.dashboard-metric.is-hero { border-top-width: 5px; }

.dashboard-metric small,
.dashboard-metric strong,
.dashboard-metric span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-metric small {
  color: var(--text-muted);
  font-size: 8px;
  font-weight: 900;
}

.dashboard-metric strong {
  margin: 3px 0 1px;
  font-size: 18px;
}

.dashboard-metric.is-hero strong { font-size: 23px; }

.dashboard-metric span {
  color: var(--text-muted);
  font-size: 8px;
  font-weight: 800;
}

.dashboard-middle,
.dashboard-bottom {
  display: grid;
  min-width: 0;
  min-height: 0;
  gap: 8px;
}

.dashboard-middle { grid-template-columns: minmax(0, 1.55fr) minmax(360px, .95fr); }
.dashboard-bottom { grid-template-columns: minmax(0, 1.7fr) minmax(300px, .8fr); }

.dashboard-panel {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.dashboard-panel__head {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 9px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-subtle);
}

.dashboard-panel__head strong {
  display: block;
  margin-top: 1px;
  font-size: 12px;
}

.progress-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.progress-chart {
  min-height: 0;
  padding: 5px 9px 0;
}

.progress-chart svg {
  display: block;
  width: 100%;
  height: 102px;
}

.chart-axis {
  stroke: var(--border-strong);
  stroke-width: 1;
}

.chart-plan,
.chart-actual {
  fill: none;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-plan {
  stroke: var(--border-strong);
  stroke-width: 2;
  stroke-dasharray: 6 5;
}

.chart-actual {
  stroke: var(--secondary);
  stroke-width: 3;
}

.chart-labels {
  display: flex;
  justify-content: space-between;
  margin-top: -2px;
  color: var(--text-muted);
  font-size: 7px;
  font-weight: 800;
}

.chart-legend {
  display: flex;
  min-height: 28px;
  align-items: center;
  gap: 14px;
  padding: 4px 9px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 8px;
  font-weight: 900;
}

.chart-legend span { display: inline-flex; align-items: center; gap: 4px; }
.chart-legend i { width: 14px; height: 3px; background: var(--border-strong); }
.chart-legend i.actual { background: var(--secondary); }

.line-flow {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.line-flow__track {
  display: flex;
  min-width: 0;
  min-height: 0;
  align-items: stretch;
  gap: 4px;
  padding: 8px;
}

.line-flow__node {
  display: grid;
  min-width: 0;
  flex: 1 1 0;
  align-content: center;
  gap: 3px;
  padding: 6px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  border-radius: 0;
  background: var(--surface-subtle);
  text-align: left;
}

button.line-flow__node:hover { border-color: var(--secondary); background: var(--info-bg); }
.line-flow__node.running { border-left-color: var(--success); }
.line-flow__node.blocked,
.line-flow__node.waiting { border-left-color: var(--warning); }
.line-flow__node.hold,
.line-flow__node.offline { border-left-color: var(--error); }
.line-flow__node.ready { border-left-color: var(--secondary); }

.line-flow__node small,
.line-flow__node strong,
.line-flow__node span,
.line-flow__node em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.line-flow__node small { color: var(--text-muted); font-size: 8px; font-weight: 900; }
.line-flow__node strong { font-size: 10px; }
.line-flow__node span { color: var(--text-muted); font-size: 8px; font-weight: 800; }
.line-flow__node em { color: var(--warning); font-size: 7px; font-style: normal; font-weight: 900; }
.line-flow__arrow { align-self: center; color: var(--text-muted); font-size: 13px; font-weight: 900; }

.station-matrix-panel,
.exception-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.station-matrix {
  min-width: 0;
  overflow: hidden;
}

.station-matrix__row {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  grid-template-columns: 58px 105px 64px 58px 50px 50px 50px 78px minmax(112px, 1fr);
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  text-align: left;
}

button.station-matrix__row:hover { background: var(--info-bg); }

.station-matrix__row > * {
  min-width: 0;
  padding: 5px 7px;
  overflow: hidden;
  font-size: 8px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.station-matrix__head {
  min-height: 26px;
  background: var(--surface-subtle);
  color: var(--text-muted);
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--border-strong);
}

.status-dot.running { background: var(--success); }
.status-dot.blocked,
.status-dot.waiting { background: var(--warning); }
.status-dot.hold,
.status-dot.offline { background: var(--error); }

.exception-list {
  display: grid;
  min-height: 0;
  align-content: start;
  gap: 5px;
  padding: 7px;
  overflow: auto;
}

.exception-item {
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--secondary);
  border-radius: 0;
  background: var(--surface-subtle);
  text-align: left;
}

.exception-item.warning { border-left-color: var(--warning); }
.exception-item.error { border-left-color: var(--error); }
.exception-item:hover { background: var(--info-bg); }
.exception-item strong { font-size: 9px; }
.exception-item span { color: var(--text-muted); font-size: 8px; font-weight: 800; }

.empty-state {
  display: grid;
  gap: 3px;
  padding: 14px;
  color: var(--text-muted);
  text-align: center;
}

.empty-state strong { font-size: 11px; }
.empty-state span { font-size: 9px; font-weight: 800; }

[hidden] {
  display: none !important;
}

@media (max-width: 1100px) {
  #view-dashboard.is-active {
    display: block;
    height: auto;
    overflow: auto;
  }
  .dashboard-context,
  .dashboard-performance,
  .dashboard-middle,
  .dashboard-bottom { margin-bottom: 8px; }
  .dashboard-performance { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-middle,
  .dashboard-bottom { grid-template-columns: 1fr; }
  .progress-panel { min-height: 190px; }
  .line-flow { min-height: 180px; }
  .station-matrix-panel,
  .exception-panel { min-height: 150px; }
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .performance-card,
  .station-shell .performance-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .station-grid { grid-template-columns: 1fr; }
  .job-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .task-grid { grid-template-columns: 1fr; }
  .checkpoint-values,
  .action-log ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .workspace,
  .view,
  #view-station {
    overflow: auto;
  }

  .view,
  #view-station .station-shell {
    height: auto;
  }

  #view-station .station-workbench,
  .station-workbench {
    grid-template-columns: 1fr;
  }

  #view-station .station-kpi-strip,
  .station-kpi-strip,
  #view-station .job-bar,
  .station-job-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #view-station .pipeline,
  .pipeline {
    grid-template-columns: 1fr;
  }

  .team-summary,
  .team-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-context { align-items: flex-start; flex-direction: column; }
  .dashboard-performance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .line-flow__track { flex-direction: column; }
  .line-flow__arrow { transform: rotate(90deg); }
  .station-matrix__head { display: none; }
  .station-matrix__row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 6px;
  }
}

/* Station operations and workforce: rough v2 information hierarchy. */
.app[data-role="operator"] .supervisor-only {
  display: none !important;
}

#view-station .station-shell {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 8px;
  border: 0;
  background: transparent;
}

#view-station .station-context-header,
.station-summary-card,
.current-step-card,
.station-pipeline-card,
.station-detail-disclosure,
.operator-tracking,
.staffing-board,
.available-roster {
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

#view-station .station-context-header {
  min-height: 58px;
  border-left: 4px solid var(--secondary);
  border-bottom: 1px solid var(--border);
}

.station-summary-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: 1.12fr 1fr .92fr;
  gap: 8px;
}

.station-summary-card {
  display: grid;
  min-width: 0;
  min-height: 82px;
  align-content: start;
  gap: 7px;
  padding: 8px 10px;
  border-left: 4px solid var(--secondary);
}

.station-summary-card.performance-summary-card { border-left-color: var(--primary); }
.station-summary-card.crew-summary-card.is-ready { border-left-color: var(--success); }
.station-summary-card.crew-summary-card.is-short { border-left-color: var(--warning); }

.station-summary-card header {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.station-summary-card header small,
.station-summary-card dt,
.station-pipeline-card header small,
.station-pipeline-card header span,
.station-detail-disclosure dt {
  color: var(--text-muted);
  font-size: 8px;
  font-weight: 900;
}

.station-summary-card header strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.station-summary-card dl,
.summary-metrics-inline {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  background: var(--border);
}

.station-summary-card dl > div {
  min-width: 0;
  padding: 5px 7px;
  background: var(--surface-subtle);
}

.station-summary-card dd {
  overflow: hidden;
  margin: 2px 0 0;
  font-size: 10px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-metrics-inline {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.station-crew-list,
.staffing-card__crew {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 5px;
}

.crew-chip {
  display: inline-grid;
  min-width: 0;
  grid-template-columns: 26px minmax(0, 1fr);
  grid-template-areas: "avatar name" "avatar meta";
  align-items: center;
  gap: 0 6px;
  padding: 3px 7px 3px 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-subtle);
}

.crew-chip.running { border-color: var(--success); background: var(--success-bg); }
.crew-chip.waiting { border-color: var(--warning); background: var(--warning-bg); }
.crew-chip.hold,
.crew-chip.offline { border-color: var(--error); background: var(--error-bg); }

.crew-chip i {
  display: grid;
  width: 24px;
  height: 24px;
  grid-area: avatar;
  place-items: center;
  border-radius: 50%;
  background: var(--secondary);
  color: #fff;
  font-size: 8px;
  font-style: normal;
  font-weight: 900;
}

.crew-chip b {
  grid-area: name;
  overflow: hidden;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crew-chip small {
  grid-area: meta;
  color: var(--text-muted);
  font-size: 7px;
  font-weight: 800;
}

.text-button {
  min-height: 28px;
  justify-self: end;
  padding: 2px 8px;
  border: 0;
  background: transparent;
  color: var(--secondary);
  font-size: 9px;
  font-weight: 900;
}

.text-button:hover,
.text-button:focus-visible { background: var(--info-bg); }

.empty-inline,
.readonly-action {
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 800;
}

.station-operation-grid {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) minmax(225px, .3fr);
  gap: 8px;
  overflow: hidden;
}

#view-station .station-step-card {
  min-height: 0;
  align-content: start;
  gap: 8px;
  padding: 10px 12px;
  overflow: hidden;
  border-left: 4px solid var(--secondary);
}

#view-station .station-step-card .current-step-card__head h3 {
  margin-top: 2px;
  font-size: 20px;
}

#view-station .station-step-card .current-step-card__head small,
#view-station .station-step-card .current-step-card__head p {
  display: block;
  overflow: hidden;
  max-width: 690px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#view-station .station-step-card .current-step-card__head small {
  color: var(--primary-dark);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .04em;
}

#view-station .station-step-card .current-step-card__head p {
  font-size: 10px;
}

.step-group-grid {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-columns: minmax(0, 1.25fr) minmax(220px, .75fr);
  gap: 8px;
}

#view-station .step-data-group {
  min-height: 0;
  padding: 7px;
  overflow: hidden;
}

#view-station .step-data-group header {
  margin-bottom: 6px;
}

#view-station .step-data-group header span {
  color: var(--success);
  font-size: 8px;
  font-weight: 900;
}

#view-station .checkpoint-values--inline {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#view-station .checkpoint-values--inline article,
#view-station .monosashi-values article {
  min-height: 48px;
  padding: 5px 7px;
}

#view-station .monosashi-values {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

#view-station .checkpoint-values--inline strong,
#view-station .monosashi-values strong {
  font-size: 12px;
}

.station-pipeline-card {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.station-pipeline-card > header {
  display: grid;
  gap: 2px;
  padding: 8px 9px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-subtle);
}

.station-pipeline-card > header strong { font-size: 11px; }

#view-station .station-pipeline-list {
  display: grid;
  min-height: 0;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(var(--step-count), minmax(42px, 1fr));
  gap: 1px;
  overflow: hidden;
  background: var(--border);
}

#view-station .station-pipeline-list li {
  min-width: 0;
  min-height: 0;
}

#view-station .station-pipeline-list button {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 42px;
  grid-template-columns: 26px 54px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 4px 7px;
  border: 0;
  border-left: 4px solid transparent;
  background: var(--surface);
  text-align: left;
}

#view-station .station-pipeline-list li.is-done button { background: var(--success-bg); }
#view-station .station-pipeline-list li.is-current button { border-left-color: var(--primary); background: var(--warning-bg); }
#view-station .station-pipeline-list li.is-selected button { outline: 2px solid var(--secondary); outline-offset: -2px; }

#view-station .station-pipeline-list button span {
  width: 24px;
  height: 24px;
  margin: 0;
}

#view-station .station-pipeline-list button strong {
  margin: 0;
  font-size: 9px;
}

#view-station .station-pipeline-list button small {
  font-size: 8px;
}

.station-detail-disclosure {
  min-height: 34px;
  overflow: hidden;
}

.station-detail-disclosure > summary {
  min-height: 34px;
  padding: 8px 10px;
  background: var(--surface-subtle);
  color: var(--secondary);
  cursor: pointer;
  font-size: 9px;
  font-weight: 900;
}

.station-detail-disclosure > summary:focus-visible {
  outline: 3px solid rgb(25 118 210 / 32%);
  outline-offset: -3px;
}

.station-detail-disclosure[open] {
  max-height: 125px;
  overflow: auto;
}

.station-detail-disclosure__content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, .7fr);
  gap: 8px;
  padding: 7px 9px;
  border-top: 1px solid var(--border);
}

.station-detail-disclosure__content dl,
.station-detail-disclosure__content ul {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  background: var(--border);
}

.station-detail-disclosure__content dl > div,
.station-detail-disclosure__content li {
  min-width: 0;
  padding: 5px 6px;
  overflow: hidden;
  background: var(--surface);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.station-detail-disclosure__content dd {
  margin: 2px 0 0;
  font-weight: 900;
}

.station-detail-disclosure__content ul { grid-template-columns: 1fr; list-style: none; }

.team-view.is-active,
.workforce-view.is-active {
  display: grid;
  height: calc(100vh - 66px);
  min-height: 0;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 8px;
  padding: 10px 12px 12px;
  overflow: hidden;
}

.team-view .section-head,
.workforce-view .section-head {
  align-items: center;
  margin: 0;
}

.team-view .section-head h2,
.workforce-view .section-head h2 { font-size: 20px; }

.team-view .section-head > span,
.workforce-view .section-head > span {
  max-width: 460px;
  font-size: 9px;
  text-align: right;
}

.team-summary,
.attendance-summary {
  display: grid;
  min-width: 0;
  gap: 8px;
  margin: 0;
}

.team-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.attendance-summary { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.team-summary-card,
.attendance-summary-card {
  min-width: 0;
  min-height: 58px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--secondary);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.attendance-summary-card.success { border-left-color: var(--success); background: var(--success-bg); }
.attendance-summary-card.warning { border-left-color: var(--warning); background: var(--warning-bg); }

.attendance-summary-card small,
.attendance-summary-card span {
  display: block;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 8px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attendance-summary-card strong {
  display: block;
  margin: 2px 0;
  font-size: 18px;
}

.workforce-toolbar {
  display: grid;
  min-width: 0;
  min-height: 38px;
  grid-template-columns: auto minmax(220px, 360px) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.workforce-toolbar label,
.workforce-toolbar > span {
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 900;
}

.workforce-toolbar > span {
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workforce-toolbar input {
  width: 100%;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface-subtle);
  font-size: 10px;
}

.operator-tracking {
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.operator-tracking__head,
.operator-tracking__row {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(180px, 1.25fr) minmax(100px, .65fr) minmax(120px, .8fr) minmax(150px, 1fr) minmax(190px, 1.2fr);
  align-items: center;
}

.operator-tracking__head {
  position: sticky;
  z-index: 1;
  top: 0;
  min-height: 30px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-subtle);
}

.operator-tracking__head span {
  padding: 5px 8px;
  color: var(--text-muted);
  font-size: 8px;
  font-weight: 900;
}

.operator-tracking__row {
  min-height: 58px;
  border-bottom: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  background: var(--surface);
}

.operator-tracking__row.running,
.workforce-roster__row.running { border-left-color: var(--success); }
.operator-tracking__row.waiting,
.workforce-roster__row.waiting { border-left-color: var(--warning); }
.operator-tracking__row.hold,
.workforce-roster__row.hold,
.operator-tracking__row.offline,
.workforce-roster__row.offline { border-left-color: var(--error); }

.operator-tracking__row > div,
.workforce-roster__row > div {
  min-width: 0;
  padding: 6px 8px;
}

.operator-tracking__row strong,
.operator-tracking__row small,
.workforce-roster__row strong,
.workforce-roster__row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operator-tracking__row strong,
.workforce-roster__row strong { font-size: 10px; }
.operator-tracking__row small,
.workforce-roster__row small { margin-top: 2px; color: var(--text-muted); font-size: 8px; font-weight: 800; }

.operator-identity {
  display: grid;
  min-width: 0;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
}

.operator-identity .avatar {
  width: 32px;
  height: 32px;
  border-width: 1px;
  font-size: 9px;
}

.operator-tracking__actions {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.operator-tracking__actions .primary-button,
.operator-tracking__actions .ghost-button,
.operator-tracking__actions .danger-button {
  min-height: 30px;
  padding: 3px 8px;
  font-size: 8px;
}

.workforce-layout {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-columns: minmax(390px, .9fr) minmax(480px, 1.25fr);
  gap: 8px;
  overflow: hidden;
}

.staffing-board,
.available-roster {
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.workforce-section-head {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-subtle);
}

.workforce-section-head small,
.workforce-section-head strong { display: block; }
.workforce-section-head small { color: var(--primary-dark); font-size: 8px; font-weight: 900; }
.workforce-section-head strong { margin-top: 1px; font-size: 10px; }

.staffing-card {
  display: grid;
  gap: 7px;
  margin: 7px;
  padding: 8px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  background: var(--surface);
}

.staffing-card.is-ready { border-left-color: var(--success); }
.staffing-card.is-short { border-left-color: var(--warning); }

.staffing-card__head,
.staffing-card__footer {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.staffing-card__head small,
.staffing-card__head strong { display: block; }
.staffing-card__head small { color: var(--text-muted); font-size: 8px; font-weight: 900; }
.staffing-card__head strong { margin-top: 1px; font-size: 11px; }
.staffing-card__footer { padding-top: 5px; border-top: 1px solid var(--border); }
.staffing-card__footer > span { color: var(--text-muted); font-size: 8px; font-weight: 900; }
.staffing-card__footer .primary-button { min-height: 30px; padding: 3px 9px; font-size: 8px; }

.workforce-roster {
  min-width: 0;
}

.workforce-roster__row {
  display: grid;
  min-width: 0;
  min-height: 58px;
  grid-template-columns: minmax(170px, 1.2fr) minmax(105px, .7fr) minmax(145px, 1fr) minmax(170px, 1.15fr);
  align-items: center;
  border-bottom: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  background: var(--surface);
}

@media (pointer: coarse) {
  #view-station .station-pipeline-list button,
  .text-button,
  .operator-tracking__actions .primary-button,
  .operator-tracking__actions .ghost-button,
  .operator-tracking__actions .danger-button,
  .staffing-card__footer .primary-button {
    min-height: 44px;
  }
}

@media (max-width: 1100px) {
  #view-station,
  .team-view.is-active,
  .workforce-view.is-active {
    height: auto;
    overflow: auto;
  }

  #view-station .station-shell {
    height: auto;
    overflow: visible;
  }

  .station-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crew-summary-card { grid-column: 1 / -1; }
  .station-operation-grid { grid-template-columns: 1fr; overflow: visible; }
  .station-pipeline-card { min-height: 230px; }
  #view-station .station-pipeline-list {
    grid-template-columns: repeat(var(--step-count), minmax(120px, 1fr));
    grid-template-rows: 1fr;
    overflow-x: auto;
  }
  #view-station .station-pipeline-list button {
    grid-template-columns: 26px minmax(0, 1fr);
    grid-template-areas: "number short" "label label";
  }
  #view-station .station-pipeline-list button span { grid-area: number; }
  #view-station .station-pipeline-list button strong { grid-area: short; }
  #view-station .station-pipeline-list button small { grid-area: label; }

  .team-view.is-active,
  .workforce-view.is-active { display: block; }
  .team-view .section-head,
  .workforce-view .section-head,
  .team-summary,
  .attendance-summary,
  .workforce-toolbar,
  .workforce-layout { margin-bottom: 8px; }
  .attendance-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .workforce-layout { grid-template-columns: 1fr; overflow: visible; }
  .staffing-board,
  .available-roster { max-height: none; overflow: visible; }
}

@media (max-width: 760px) {
  .station-summary-grid,
  .step-group-grid,
  .team-summary,
  .attendance-summary { grid-template-columns: 1fr; }

  .crew-summary-card { grid-column: auto; }

  #view-station .station-context-header,
  #view-station .current-step-card__head,
  .station-summary-card header,
  .staffing-card__head,
  .staffing-card__footer,
  .team-view .section-head,
  .workforce-view .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  #view-station .station-context-header {
    display: flex;
  }

  #view-station .station-header__meta { justify-content: flex-start; }
  #view-station .checkpoint-values--inline,
  #view-station .monosashi-values,
  .station-detail-disclosure__content,
  .station-detail-disclosure__content dl { grid-template-columns: 1fr; }

  .workforce-toolbar { grid-template-columns: 1fr; }
  .workforce-toolbar > span,
  .team-view .section-head > span,
  .workforce-view .section-head > span { text-align: left; }

  .operator-tracking__head { display: none; }
  .operator-tracking__row,
  .workforce-roster__row {
    grid-template-columns: 1fr;
    padding: 7px;
  }
  .operator-tracking__row > div,
  .workforce-roster__row > div { padding: 5px 4px; }
  .operator-tracking__actions { justify-content: flex-start; }
}
