:root {
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-primary-soft: #eff6ff;
  --color-success: #15803d;
  --color-success-soft: #f0fdf4;
  --color-warning: #d97706;
  --color-warning-soft: #fffbeb;
  --color-danger: #dc2626;
  --color-danger-soft: #fef2f2;
  --color-purple: #7c3aed;
  --color-bg: #f6f7f9;
  --color-surface: #ffffff;
  --color-text: #1f2937;
  --color-text-secondary: #6b7280;
  --color-text-weak: #9ca3af;
  --color-border: #e5e7eb;
  --color-divider: #eef0f3;
  --radius-sm: 6px;
  --radius-md: 8px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --shadow-soft: 0 1px 2px rgba(15, 23, 42, .04);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--color-bg); }
body { margin: 0; color: var(--color-text); background: var(--color-bg); font: 14px/1.55 Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", Arial, sans-serif; letter-spacing: 0; }
@view-transition {
  navigation: auto;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: .18s;
  animation-timing-function: ease;
}
html.sfs-soft-refresh-restoring,
html.sfs-soft-refresh-leaving {
  background: var(--color-bg);
}
html.sfs-soft-refresh-restoring body,
html.sfs-soft-refresh-leaving body {
  background: var(--color-bg);
}
html.sfs-soft-refresh-restoring body::before,
html.sfs-soft-refresh-leaving body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  pointer-events: none;
  background: rgba(246, 247, 249, .82);
  backdrop-filter: blur(1.5px);
}
html.sfs-soft-refresh-leaving body::before {
  opacity: 0;
  animation: sfs-soft-refresh-in .12s ease forwards;
}
html.sfs-soft-refresh-restoring body::before {
  opacity: 1;
  transition: opacity .16s ease;
}
html.sfs-soft-refresh-finished body::before {
  opacity: 0;
}
html.sfs-soft-refresh-restoring body::after,
html.sfs-soft-refresh-leaving body::after {
  content: "正在更新…";
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 2147483001;
  transform: translate(-50%, -50%);
  padding: 9px 14px;
  border: 1px solid rgba(37, 99, 235, .16);
  border-radius: 999px;
  background: rgba(var(--theme-surface-rgb, 255, 255, 255), .9);
  color: var(--color-text-secondary);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .12);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  pointer-events: none;
}
html.sfs-soft-refresh-finished body::after {
  opacity: 0;
  transition: opacity .16s ease;
}
@keyframes sfs-soft-refresh-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
/* Keep page fixed while modal dialogs are open; dialogs themselves still scroll. */
html.dialog-open {
  overflow: hidden;
  overscroll-behavior: none;
  padding-right: var(--dialog-scrollbar-compensation, 0px);
}
html.dialog-open body {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  padding-right: var(--dialog-scrollbar-compensation, 0px);
}
dialog {
  overscroll-behavior: contain;
}
dialog[open] {
  overscroll-behavior: contain;
}
button, input, select, textarea { font: inherit; letter-spacing: 0; }
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
:focus-visible { outline: 3px solid rgba(37, 99, 235, .22); outline-offset: 2px; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 1000; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--color-text); color: white; }
.skip-link:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* 整站：左侧导航壳 */
:root {
  --sidebar-width: 208px;
  --sidebar-collapsed-width: 72px;
  --sidebar-motion: 320ms cubic-bezier(.22, 1, .36, 1);
}
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  transition: grid-template-columns var(--sidebar-motion);
}
html.sidebar-collapsed .app-shell {
  grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr);
}
.app-sidebar {
  position: sticky;
  top: 0;
  z-index: 50;
  width: var(--sidebar-width);
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 12px 16px;
  border-right: 1px solid var(--theme-border, #e8ecf2);
  background:
    linear-gradient(180deg, var(--theme-surface-muted, #fbfcfe) 0%, var(--theme-surface-muted, #f7f9fc) 48%, var(--theme-surface-muted, #f4f7fb) 100%);
  box-shadow: 1px 0 0 rgba(15, 23, 42, .02);
  transition: width var(--sidebar-motion), padding var(--sidebar-motion);
  overflow: hidden;
}
html.sidebar-collapsed .app-sidebar {
  width: var(--sidebar-collapsed-width);
  padding-left: 10px;
  padding-right: 10px;
}
.sidebar-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 2px 2px 8px;
  transition: min-height var(--sidebar-motion), padding var(--sidebar-motion);
}
.sidebar-brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
  padding: 4px 6px 4px 4px;
  border-radius: 12px;
  color: var(--color-text);
  text-decoration: none;
  overflow: hidden;
  transition: opacity var(--sidebar-motion), max-width var(--sidebar-motion), padding var(--sidebar-motion);
}
.sidebar-brand-text {
  display: grid;
  gap: 1px;
  min-width: 0;
  line-height: 1.2;
  opacity: 1;
  max-width: 180px;
  transition: opacity 220ms ease, max-width var(--sidebar-motion);
}
.sidebar-brand-text strong {
  font-size: 15px;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-brand-text small {
  color: var(--color-text-secondary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.sidebar-toggle {
  position: absolute;
  top: 6px;
  right: 2px;
  z-index: 2;
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--theme-border, #e2e8f0);
  border-radius: 9px;
  background: var(--theme-surface, #fff);
  color: var(--theme-text-secondary, #64748b);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
  transition:
    background-color 150ms ease,
    color 150ms ease,
    border-color 150ms ease,
    transform var(--sidebar-motion),
    margin var(--sidebar-motion);
}
.sidebar-toggle:hover {
  color: var(--color-primary);
  border-color: var(--theme-blue-border, #bfdbfe);
  background: var(--color-primary-soft);
}
.sidebar-toggle-icon {
  width: 16px;
  height: 16px;
  transition: transform var(--sidebar-motion);
}
html.sidebar-collapsed .sidebar-toggle-icon {
  transform: rotate(180deg);
}
html.sidebar-collapsed .sidebar-toggle {
  position: static;
  margin: 0 auto;
}
html.sidebar-collapsed .sidebar-head {
  justify-content: center;
  padding-bottom: 4px;
}
html.sidebar-collapsed .sidebar-brand {
  max-width: 0;
  opacity: 0;
  padding: 0;
  pointer-events: none;
}
html.sidebar-collapsed .sidebar-brand-text {
  opacity: 0;
  max-width: 0;
}
.sidebar-nav {
  display: grid;
  gap: 4px;
  align-content: start;
  flex: 1 1 auto;
  overflow: auto;
  padding: 4px 2px 8px;
}
.sidebar-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--theme-text-secondary, #5b6575);
  font-weight: 650;
  transition:
    background-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    width var(--sidebar-motion),
    padding var(--sidebar-motion),
    margin var(--sidebar-motion),
    gap var(--sidebar-motion),
    justify-content var(--sidebar-motion);
}
.sidebar-nav a .nav-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  color: var(--theme-text-secondary, #7b8798);
  transition: color 180ms ease;
}
.sidebar-nav a .nav-icon svg {
  width: 18px;
  height: 18px;
}
.sidebar-nav a .nav-label {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 1;
  max-width: 160px;
  transition: opacity 200ms ease, max-width var(--sidebar-motion);
}
.sidebar-nav a:hover {
  color: var(--color-primary);
  background: rgba(37, 99, 235, .08);
}
.sidebar-nav a:hover .nav-icon {
  color: var(--color-primary);
}
.sidebar-nav a.active {
  color: var(--color-primary);
  background: linear-gradient(90deg, rgba(37, 99, 235, .14), rgba(37, 99, 235, .06));
  box-shadow: inset 3px 0 0 var(--color-primary);
}
.sidebar-nav a.active .nav-icon {
  color: var(--color-primary);
}
html.sidebar-collapsed .sidebar-nav a {
  justify-content: center;
  gap: 0;
  padding: 0;
  width: 48px;
  margin: 0 auto;
}
html.sidebar-collapsed .sidebar-nav a .nav-label {
  opacity: 0;
  max-width: 0;
}
html.sidebar-collapsed .sidebar-nav a.active {
  box-shadow: none;
  background: rgba(37, 99, 235, .12);
}
.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--theme-border, #e8ecf2);
}
.sidebar-user-menu {
  width: 100%;
  margin-left: 0;
}
.sidebar-user-menu .user-menu-trigger {
  width: 100%;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  transition: padding var(--sidebar-motion), justify-content var(--sidebar-motion);
}
.sidebar-account-icon {
  display: none;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: var(--theme-text-secondary, #64748b);
}
.sidebar-account-icon svg {
  width: 20px;
  height: 20px;
}
.sidebar-user-menu .user-copy {
  text-align: left;
  min-width: 0;
  flex: 1 1 auto;
  opacity: 1;
  max-width: 180px;
  transition: opacity 200ms ease, max-width var(--sidebar-motion);
}
.sidebar-user-menu .user-copy strong,
.sidebar-user-menu .user-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-user-menu .user-menu-caret {
  transition: opacity 180ms ease;
}
.sidebar-user-menu .user-menu-dropdown {
  left: 0;
  right: auto;
  top: auto;
  bottom: calc(100% + 8px);
  min-width: 200px;
}
html.sidebar-collapsed .sidebar-user-menu .user-menu-trigger {
  justify-content: center;
  padding: 10px 0;
}
html.sidebar-collapsed .sidebar-user-menu .user-copy,
html.sidebar-collapsed .sidebar-user-menu .user-menu-caret {
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  pointer-events: none;
}
html.sidebar-collapsed .sidebar-account-icon {
  display: inline-grid;
  place-items: center;
}
html.sidebar-collapsed .sidebar-user-menu .user-menu-dropdown {
  left: calc(100% + 10px);
  bottom: 0;
}
.app-content {
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  transition: none;
}
.mobile-topbar {
  display: none;
}
.brand { display: inline-flex; align-items: center; gap: 11px; min-width: 140px; font-size: 16px; font-weight: 700; }
.brand-mark { display: none; }
.topbar, .desktop-nav { display: none; }
.user-menu { position: relative; margin-left: auto; display: flex; align-items: center; }
.user-menu-trigger {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}
.user-menu-trigger:hover,
.user-menu.is-open .user-menu-trigger {
  border-color: var(--color-border);
  background: var(--theme-surface-muted, #f8fafc);
}
.user-copy { display: grid; text-align: right; line-height: 1.35; }
.user-copy strong { font-size: 14px; color: var(--color-text); }
.user-copy span { max-width: 240px; color: var(--color-text-secondary); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-caret {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--theme-border, #94a3b8);
  border-bottom: 1.5px solid var(--theme-border, #94a3b8);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 150ms ease;
}
.user-menu.is-open .user-menu-caret {
  transform: rotate(225deg) translateY(-1px);
}
.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  min-width: 200px;
  padding: 8px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--theme-surface, white);
  box-shadow: 0 16px 40px rgba(15, 23, 42, .12);
}
.user-menu-panel-head {
  display: grid;
  gap: 2px;
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--color-divider);
  margin-bottom: 6px;
}
.user-menu-panel-head strong { font-size: 14px; }
.user-menu-panel-head span { color: var(--color-text-secondary); font-size: 12px; }
.user-menu-item {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text);
  font-weight: 650;
  cursor: pointer;
  text-align: left;
}
.user-menu-item:hover { background: var(--theme-surface-muted, #f8fafc); }
.user-menu-logout { color: var(--color-danger); }
.user-menu-logout:hover { background: var(--color-danger-soft); }
.avatar { display: none; }

.page-shell { width: min(1600px, 100%); margin: 0 auto; padding: 28px 32px 48px; flex: 1 1 auto; }
body:not(.app-shell) .page-shell { width: min(1600px, 100%); }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 6px 0 24px; }
.page-heading h1 { margin: 2px 0 4px; font-size: 24px; line-height: 1.3; }
.page-heading p { margin: 0; color: var(--color-text-secondary); }
.page-heading-actions { align-items: center; }
.eyebrow, .section-kicker { margin: 0; color: var(--color-primary); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.breadcrumb { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; color: var(--color-text-secondary); font-size: 13px; }
.breadcrumb a:hover { color: var(--color-primary); }

.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 16px; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; font-weight: 650; cursor: pointer; transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 150ms ease; }
.button:active:not(:disabled) { transform: translateY(1px); }
.button:disabled { opacity: .58; cursor: wait; }
.button-primary { color: white; background: var(--color-primary); border-color: var(--color-primary); }
.button-primary:hover { background: var(--color-primary-dark); border-color: var(--color-primary-dark); }
.button-secondary { color: var(--color-text); background: var(--theme-surface, white); border-color: var(--color-border); }
.button-secondary:hover { border-color: var(--theme-border, #cbd5e1); background: var(--theme-surface-muted, #f8fafc); }
.button-danger { color: white; background: var(--color-danger); }
.button-danger-quiet { color: var(--color-danger); }
.button-danger-quiet:hover { background: var(--color-danger-soft); }
.button-quiet { color: var(--color-text-secondary); padding-left: 10px; padding-right: 10px; }
.button-quiet:hover { color: var(--color-primary); background: var(--color-primary-soft); }
.button-small { min-height: 34px; padding: 0 10px; font-size: 13px; }
.button-block { width: 100%; }
.icon-button { width: 36px; height: 36px; border: 0; border-radius: var(--radius-sm); background: transparent; font-size: 22px; cursor: pointer; }
.icon-button:hover { background: var(--color-bg); }

.dashboard-heading { align-items: center; }
.date-chip, .count-badge { padding: 6px 10px; border: 1px solid var(--color-border); border-radius: 999px; color: var(--color-text-secondary); background: var(--color-surface); font-size: 12px; font-weight: 650; }
.dashboard-grid { display: grid; grid-template-columns: minmax(220px, 24fr) minmax(380px, 52fr) minmax(220px, 24fr); gap: 20px; align-items: stretch; }
.panel { min-width: 0; min-height: 480px; display: flex; flex-direction: column; padding: 20px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); box-shadow: var(--shadow-soft); }
.tracking-panel { min-height: 540px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--color-divider); }
.panel-header h2 { margin: 2px 0 0; font-size: 18px; }
.metric-list { margin-top: 4px; }
.metric-list button { width: 100%; min-height: 62px; display: flex; align-items: center; justify-content: space-between; padding: 0 4px; border: 0; border-bottom: 1px solid var(--color-divider); background: transparent; cursor: pointer; }
.metric-list button:hover span { color: var(--color-primary); }
.metric-list strong, .warning-metrics strong { min-width: 34px; text-align: right; font-size: 24px; }
.metric-purple { color: var(--color-purple); }
.metric-danger { color: var(--color-danger); }
.metric-warning { color: var(--color-warning); }
.panel-note { margin-top: auto; padding-top: 18px; color: var(--color-text-secondary); font-size: 13px; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--color-text-weak); }
.status-success { background: var(--color-success); }.status-primary { background: var(--color-primary); }.status-neutral { background: var(--color-text-weak); }
.empty-state { flex: 1; min-height: 280px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px 16px; text-align: center; }
.empty-state h3 { margin: 18px 0 6px; font-size: 16px; }
.empty-state p { max-width: 360px; margin: 0; color: var(--color-text-secondary); font-size: 13px; }
.empty-state.compact { min-height: 300px; }
.empty-symbol { width: 62px; height: 52px; display: flex; align-items: flex-end; justify-content: center; gap: 5px; padding: 12px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--theme-surface-muted, #fafbfc); }
.empty-symbol span { width: 8px; border-radius: 2px 2px 0 0; background: var(--theme-surface-muted, #cbd5e1); }
.empty-symbol span:nth-child(1) { height: 14px; }.empty-symbol span:nth-child(2) { height: 27px; background: #93c5fd; }.empty-symbol span:nth-child(3) { height: 20px; }
.tracking-footer { display: flex; justify-content: center; flex-wrap: wrap; gap: 22px; padding-top: 16px; border-top: 1px solid var(--color-divider); color: var(--color-text-secondary); font-size: 12px; }
.warning-metrics { padding: 8px 0; }
.warning-metrics button { width: 100%; min-height: 72px; display: flex; align-items: center; justify-content: space-between; border: 0; border-bottom: 1px solid var(--color-divider); background: transparent; cursor: pointer; }
.warning-metrics button span { display: flex; align-items: center; }
.status-line { width: 3px; height: 24px; display: inline-block; margin-right: 10px; border-radius: 3px; }.status-line.warning { background: var(--color-warning); }.status-line.danger { background: var(--color-danger); }
.notice-group { padding: 18px 2px; border-bottom: 1px solid var(--color-divider); }
.notice-heading { display: flex; justify-content: space-between; align-items: center; }.notice-heading h3 { margin: 0; font-size: 14px; }.notice-heading span { color: var(--color-text-weak); }
.notice-group p { margin: 8px 0 0; color: var(--color-text-secondary); font-size: 13px; }
.mobile-user-summary { display: none; }

.admin-nav { display: flex; gap: 4px; margin: -8px 0 26px; padding-bottom: 10px; border-bottom: 1px solid var(--color-border); overflow-x: auto; }
.admin-nav a { flex: 0 0 auto; padding: 9px 14px; border-radius: var(--radius-sm); color: var(--color-text-secondary); font-weight: 600; }
.admin-nav a:hover, .admin-nav a.active { color: var(--color-primary); background: var(--color-primary-soft); }
.cost-visibility-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--color-divider); background: var(--theme-surface-muted, #fafbfc); }
.cost-visibility-toolbar-copy { display: flex; align-items: baseline; gap: 10px; color: var(--color-text-secondary); font-size: 13px; }
.cost-visibility-toolbar-copy strong { color: var(--color-text); font-size: 14px; }
.cost-visibility-select-column, .cost-visibility-select-cell { width: 52px; text-align: center; }
.cost-visibility-select-cell input, .cost-visibility-select-column input { width: 17px; min-height: 17px; padding: 0; accent-color: var(--color-primary); cursor: pointer; }
.filter-bar { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 16px; padding: 16px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--theme-surface, white); }
.filter-bar .field { min-width: 150px; }.filter-bar .field-grow { flex: 1; min-width: 240px; }.filter-submit, .filter-reset { flex: 0 0 auto; }.filter-bar-wide { flex-wrap: wrap; }
.field { display: grid; gap: 7px; min-width: 0; }
.field label { color: var(--theme-text, #374151); font-size: 13px; font-weight: 650; }
.field label span { color: var(--color-danger); }
input, select, textarea { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--theme-border, #d7dce2); border-radius: var(--radius-sm); color: var(--color-text); background: var(--theme-surface, white); transition: border-color 180ms ease, box-shadow 180ms ease; }
textarea { resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--theme-border, #b8c0cc); }
input:focus, select:focus, textarea:focus { border-color: var(--color-primary); outline: none; box-shadow: 0 0 0 3px rgba(37, 99, 235, .11); }
input:disabled { color: var(--color-text-secondary); background: var(--theme-surface-muted, #f3f4f6); cursor: not-allowed; }
/* Make the whole date field open the picker, not only the trailing calendar icon. */
input[type="date"],
input[type="datetime-local"],
input[type="time"],
input[type="month"],
input[type="week"] {
  position: relative;
  cursor: pointer;
}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator,
input[type="week"]::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  color: transparent;
  background: transparent;
  cursor: pointer;
}
.password-field { position: relative; }.password-field input { padding-right: 64px; }.password-toggle { position: absolute; right: 5px; top: 5px; min-width: 50px; height: 32px; border: 0; border-radius: var(--radius-sm); color: var(--color-primary); background: transparent; font-size: 13px; cursor: pointer; }.password-toggle:hover { background: var(--color-primary-soft); }
.stack-form { display: grid; gap: 18px; }
.alert { margin: 0 0 18px; padding: 12px 14px; border: 1px solid; border-radius: var(--radius-sm); }
.alert-error { color: var(--theme-red-text, #991b1b); border-color: var(--theme-red-border, #fecaca); background: var(--color-danger-soft); }
.alert-info { color: var(--theme-blue-text, #1e3a8a); border-color: var(--theme-blue-border, #bfdbfe); background: var(--color-primary-soft); }

.table-panel, .form-panel { border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--theme-surface, white); box-shadow: var(--shadow-soft); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { height: 46px; padding: 0 16px; color: var(--color-text-secondary); background: var(--theme-surface-muted, #fafbfc); text-align: left; font-size: 12px; font-weight: 650; white-space: nowrap; }
td { min-height: 60px; padding: 14px 16px; border-top: 1px solid var(--color-divider); vertical-align: middle; }
tbody tr { transition: background-color 160ms ease; } tbody tr:hover { background: var(--theme-surface-muted, #fafcff); }
td strong { display: block; }.cell-secondary { display: block; margin-top: 2px; color: var(--color-text-secondary); font-size: 12px; }
.long-cell { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions-column { text-align: right; }.row-actions { display: flex; justify-content: flex-end; align-items: center; gap: 2px; white-space: nowrap; }.row-actions form { display: inline-flex; }
.tag-list { display: flex; flex-wrap: wrap; gap: 5px; }.tag { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 8px; border-radius: 999px; color: var(--theme-text-secondary, #4b5563); background: var(--theme-surface-muted, #f3f4f6); font-size: 12px; }.tag-primary { color: var(--theme-blue-text, #1d4ed8); background: var(--theme-blue-soft, #eff6ff); }
.status-tag { display: inline-flex; align-items: center; gap: 7px; min-height: 26px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }.status-tag i { width: 7px; height: 7px; border-radius: 50%; }.status-tag-success { color: var(--theme-green-text, #166534); background: var(--color-success-soft); }.status-tag-success i { background: var(--color-success); }.status-tag-neutral { color: var(--theme-text-secondary, #4b5563); background: var(--theme-surface-muted, #f3f4f6); }.status-tag-neutral i { background: var(--color-text-weak); }
code { padding: 2px 5px; border-radius: 4px; color: var(--theme-text, #334155); background: var(--theme-surface-muted, #f1f5f9); font: 12px/1.5 Consolas, "SFMono-Regular", monospace; }
.pagination { min-height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-top: 1px solid var(--color-divider); color: var(--color-text-secondary); font-size: 13px; }.pagination div { display: flex; gap: 8px; }
.pagination .pagination-disabled { opacity: .45; pointer-events: none; }

.form-panel { max-width: 1040px; }.form-panel-narrow { max-width: 620px; }
.form-section { padding: 24px; border-bottom: 1px solid var(--color-divider); }.form-section > header { margin-bottom: 20px; }.form-section > header h2 { margin: 0 0 4px; font-size: 16px; }.form-section > header p { margin: 0; color: var(--color-text-secondary); font-size: 13px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }.form-grid-wide { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 24px; }
.role-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 22px; padding: 0; border: 0; }
.role-option { position: relative; min-height: 64px; display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); cursor: pointer; transition: border-color 180ms ease, background-color 180ms ease; }.role-option:hover { border-color: var(--theme-blue-border, #bfdbfe); background: var(--theme-surface-muted, #fafcff); }.role-option:has(input:checked) { border-color: var(--color-primary); background: var(--color-primary-soft); }.role-option input { flex: 0 0 auto; width: 18px; min-height: 18px; accent-color: var(--color-primary); }.role-option span { min-width: 0; display: grid; }.role-option small { color: var(--color-text-secondary); font-size: 11px; overflow: hidden; text-overflow: ellipsis; }.role-option-admin:has(input:checked) { border-color: var(--color-purple); background: var(--theme-purple-soft, #f5f3ff); }
.switch-row { max-width: 420px; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 18px; cursor: pointer; }.switch-row span { display: grid; }.switch-row small { color: var(--color-text-secondary); font-size: 12px; }.switch-row input { position: absolute; opacity: 0; pointer-events: none; }.switch-row i { position: relative; flex: 0 0 auto; width: 44px; height: 24px; border-radius: 999px; background: var(--theme-surface-muted, #cbd5e1); transition: background 180ms ease; }.switch-row i::after { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: var(--theme-surface, white); box-shadow: 0 1px 2px rgba(0,0,0,.18); transition: transform 180ms ease; }.switch-row input:checked + i { background: var(--color-primary); }.switch-row input:checked + i::after { transform: translateX(20px); }.switch-row input:focus-visible + i { outline: 3px solid rgba(37, 99, 235, .22); outline-offset: 2px; }
.permission-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--color-border); border-radius: var(--radius-sm); overflow: hidden; }.permission-row { min-height: 80px; display: flex; gap: 12px; padding: 14px; border-bottom: 1px solid var(--color-divider); cursor: pointer; }.permission-row:nth-child(odd) { border-right: 1px solid var(--color-divider); }.permission-row:hover { background: var(--theme-surface-muted, #fafcff); }.permission-row input { flex: 0 0 auto; width: 18px; min-height: 18px; accent-color: var(--color-primary); }.permission-row span { display: grid; align-content: start; gap: 3px; }.permission-row code { width: fit-content; }.permission-row small { color: var(--color-text-secondary); font-size: 12px; }
.inline-edit input { min-width: 180px; }

.toast-region { position: fixed; top: 82px; right: 22px; z-index: 100; width: min(360px, calc(100vw - 32px)); display: grid; gap: 8px; }
.toast-region { left: auto; bottom: auto; margin: 0; padding: 0; border: 0; overflow: auto; color: var(--color-text); background: transparent; }
.toast-region[popover]:not(:popover-open) { display: none; }
.toast-region::backdrop { background: transparent; pointer-events: none; }
.toast > span { min-width: 0; overflow-wrap: anywhere; }
.toast strong { font-weight: 700; }
.toast > button { flex-shrink: 0; }
.toast { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px 11px 14px; border: 1px solid var(--color-border); border-left: 3px solid var(--color-primary); border-radius: var(--radius-sm); background: var(--theme-surface, white); box-shadow: 0 10px 24px rgba(15, 23, 42, .12); animation: toast-in 200ms ease-out; }.toast-success { border-left-color: var(--color-success); }.toast-error { border-left-color: var(--color-danger); }.toast-warning { border-left-color: var(--color-warning); }.toast button { width: 30px; height: 30px; border: 0; border-radius: var(--radius-sm); color: var(--color-text-secondary); background: transparent; cursor: pointer; font-size: 18px; }.toast button:hover { background: var(--color-bg); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.confirm-dialog { width: min(440px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--radius-md); color: var(--color-text); box-shadow: 0 24px 70px rgba(15, 23, 42, .25); }.confirm-dialog::backdrop { background: rgba(15, 23, 42, .42); }.confirm-dialog form { padding: 20px; }.dialog-heading { display: flex; justify-content: space-between; align-items: center; }.dialog-heading h2 { margin: 0; font-size: 18px; }.confirm-dialog p { margin: 14px 0 22px; color: var(--color-text-secondary); }.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }

.error-page { min-height: calc(100vh - 170px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }.error-code { color: #cbd5e1; font-size: 72px; line-height: 1; font-weight: 800; }.error-page h1 { margin: 18px 0 8px; font-size: 24px; }.error-page p { max-width: 460px; margin: 0 0 24px; color: var(--color-text-secondary); }

body:has(.mobile-nav a[href="/daily-report"]) .mobile-nav { grid-template-columns: repeat(6, 1fr); }
.mobile-nav, .order-mobile-sample-no { display: none; }

@media (max-width: 1100px) {
  :root {
    --sidebar-width: 196px;
  }
  .page-shell { padding-left: 20px; padding-right: 20px; }
  .dashboard-grid { grid-template-columns: minmax(190px, 26fr) minmax(340px, 48fr) minmax(190px, 26fr); gap: 14px; }.panel { padding: 16px; }
  .role-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  body { padding-bottom: 72px; }
  .app-shell {
    display: block;
    min-height: 100vh;
  }
  html.sidebar-collapsed .app-shell {
    grid-template-columns: none;
  }
  .app-sidebar { display: none !important; }
  .mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: 60px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    border-bottom: 1px solid var(--color-border);
    background: rgba(var(--theme-surface-rgb, 255, 255, 255), .97);
  }
  .brand { min-width: 0; }
  .brand > span { font-size: 14px; }
  .user-menu { display: flex; }
  .user-menu-trigger { min-height: 38px; padding: 2px 6px; }
  .user-menu .user-copy span { display: none; }
  .user-menu-dropdown { min-width: 160px; }
  .page-shell { padding: 20px 16px 32px; }
  .dashboard-heading { margin-bottom: 14px; }
  .dashboard-heading h1 { font-size: 22px; }
  .date-chip { display: none; }
  .mobile-user-summary { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding: 14px 16px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--theme-surface, white); }.mobile-user-summary div { display: grid; }.mobile-user-summary span { color: var(--color-text-secondary); font-size: 12px; }
  .dashboard-grid { display: flex; flex-direction: column; }.work-panel { order: 1; }.warning-panel { order: 2; }.tracking-panel { order: 3; }.panel, .tracking-panel { min-height: auto; }.empty-state { min-height: 260px; }
  .mobile-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; height: 66px; display: grid; grid-template-columns: repeat(5, 1fr); padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--color-border); background: rgba(var(--theme-surface-rgb, 255, 255, 255),.98); }.mobile-nav a, .mobile-nav button { min-width: 0; min-height: 48px; display: flex; align-items: center; justify-content: center; padding: 0 4px; border: 0; color: var(--color-text-secondary); background: transparent; font-size: 14px; font-weight: 700; line-height: 1; letter-spacing: 0; }.mobile-nav .active { color: var(--color-primary); font-weight: 800; }
  .admin-nav { margin-top: -4px; gap: 2px; }.admin-nav a { padding-left: 10px; padding-right: 10px; font-size: 13px; }.page-heading-actions { align-items: center; }.filter-bar { flex-wrap: wrap; }.filter-bar .field, .filter-bar .field-grow { min-width: calc(50% - 6px); flex: 1 1 calc(50% - 6px); }
  .toast-region { top: 12px; right: 16px; }
}

@media (max-width: 700px) {
  .page-heading { align-items: flex-start; }.page-heading h1 { font-size: 22px; }.page-heading-actions { flex-direction: column; align-items: stretch; }.page-heading-actions > .button { width: 100%; }
  .filter-bar .field, .filter-bar .field-grow { min-width: 100%; flex-basis: 100%; }.filter-submit { flex: 1; }.filter-reset { flex: 1; }
  .table-panel { border-left: 0; border-right: 0; border-radius: 0; margin-left: -16px; margin-right: -16px; }.table-scroll { overflow: visible; } table, thead, tbody, tr, th, td { display: block; } thead { display: none; } tbody { display: grid; gap: 10px; padding: 10px 16px; } tbody tr { padding: 8px 14px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--theme-surface, white); } tbody tr:hover { background: var(--theme-surface, white); } td { min-height: 42px; display: grid; grid-template-columns: 120px minmax(0, 1fr); align-items: center; padding: 9px 0; border-top: 1px solid var(--color-divider); overflow-wrap: anywhere; } td:first-child { border-top: 0; } td::before { content: attr(data-label); color: var(--color-text-secondary); font-size: 12px; }.row-actions { display: flex; justify-content: flex-start; flex-wrap: wrap; padding-top: 12px; }.row-actions::before { width: 110px; }.long-cell { max-width: none; white-space: normal; }.pagination { margin: 0 16px; }
  .form-panel { margin-left: -16px; margin-right: -16px; border-left: 0; border-right: 0; border-radius: 0; }.form-section { padding: 20px 16px; }.form-grid, .role-options, .permission-list { grid-template-columns: 1fr; }.form-grid-wide { grid-column: auto; }.permission-row:nth-child(odd) { border-right: 0; }.form-actions { position: sticky; bottom: 66px; z-index: 20; padding: 12px 16px; border-top: 1px solid var(--color-border); background: rgba(var(--theme-surface-rgb, 255, 255, 255),.98); }.form-actions .button { min-height: 44px; flex: 1; }
  .inline-edit input { min-width: 0; }
  .button { min-height: 44px; }.button-small { min-height: 38px; }.confirm-dialog form { padding: 18px; }.dialog-actions .button { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Phase 2 task surfaces */
.status-tag-warning { color: var(--theme-amber-text, #9a4d08); background: var(--color-warning-soft); }.status-tag-warning i { background: var(--color-warning); }
.status-tag-current { color: var(--theme-purple-text, #5b21b6); background: var(--theme-purple-soft, #f5f3ff); }.status-tag-current i { background: var(--color-purple); }
.status-tag-single { color: var(--theme-green-text, #0f766e); background: var(--theme-green-soft, #ecfdf5); }.status-tag-single i { background: #14b8a6; }
.status-tag-combination { color: var(--theme-amber-text, #9a3412); background: var(--theme-amber-soft, #fff7ed); }.status-tag-combination i { background: #f97316; }
.text-danger { color: var(--color-danger) !important; }
.numeric-cell { text-align: right; font-variant-numeric: tabular-nums; }
.empty-action { margin-top: 20px; }

.order-type-fieldset { margin: 0 0 20px; padding: 0; border: 0; min-width: 0; }
.order-type-fieldset legend { margin: 0 0 10px; color: var(--color-text); font-size: 13px; font-weight: 650; }
.order-type-fieldset legend span { color: var(--color-danger); }
.order-type-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.order-type-card { position: relative; min-width: 0; cursor: pointer; }
.order-type-card input { position: absolute; opacity: 0; pointer-events: none; }
.order-type-card-body { min-height: 84px; display: grid; align-content: center; gap: 4px; padding: 14px 16px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--theme-surface-muted, #fafcff); transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease; }
.order-type-card-body strong { font-size: 15px; }
.order-type-card-body small { color: var(--color-text-secondary); font-size: 12px; line-height: 1.45; }
.order-type-card:hover .order-type-card-body { border-color: var(--theme-blue-border, #93c5fd); background: var(--theme-surface-muted, #f8fbff); }
.order-type-card input:checked + .order-type-card-body { border-color: var(--color-primary); background: var(--color-primary-soft); box-shadow: inset 0 0 0 1px var(--color-primary); }
.order-type-card input:focus-visible + .order-type-card-body { outline: 2px solid var(--color-primary); outline-offset: 2px; }

.metric-list a, .warning-metrics a { width: 100%; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--color-divider); }
.metric-list a { min-height: 62px; padding: 0 4px; }.metric-list a:hover span, .warning-metrics a:hover span { color: var(--color-primary); }
.metric-list a strong, .warning-metrics a strong { min-width: 34px; text-align: right; font-size: 24px; }
.warning-metrics a { min-height: 72px; }
.dashboard-task-list { flex: 1; display: grid; align-content: start; }
.dashboard-task-item { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 14px; min-height: 72px; padding: 10px 2px; border-bottom: 1px solid var(--color-divider); transition: background-color 180ms ease; }
.dashboard-task-item:hover { background: var(--theme-surface-muted, #fafcff); }.dashboard-task-item > div { min-width: 0; display: grid; }.dashboard-task-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.dashboard-task-item span, .task-item-deadline { color: var(--color-text-secondary); font-size: 12px; }.task-item-deadline { text-align: right; }
.dashboard-task-item { grid-template-columns: minmax(0, 1fr) auto; }
.dashboard-task-link { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 14px; }
.dashboard-task-link > div { min-width: 0; display: grid; }
.dashboard-task-item > .print-upload-button { align-self: start; }
.print-upload-button { position: relative; flex: 0 0 auto; white-space: nowrap; }
.print-upload-button .print-file-badge { position: absolute; top: -9px; right: -9px; display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 5px; border: 2px solid #fff; border-radius: 12px; background: #dc2626; color: #fff; font-size: 12px; font-weight: 800; line-height: 1; box-shadow: 0 2px 5px rgb(185 28 28 / 30%); pointer-events: none; }
.print-upload-button:disabled { cursor: not-allowed; }
.order-right-badges > .print-upload-button { margin-left: auto; min-height: 26px; padding: 3px 8px; font-size: 10px; }
.print-upload-dialog { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 20px; }
.print-upload-dialog .dialog-heading p { margin: 5px 0 0; color: var(--color-text-secondary); font-size: 13px; overflow-wrap: anywhere; }
.print-upload-hint { color: var(--color-text-secondary); font-size: 13px; line-height: 1.7; }
.print-upload-dialog .upload-list { max-height: 45vh; overflow-y: auto; }
.print-upload-dialog .dialog-actions { margin-top: 18px; }
@media (max-width: 640px) {
  .dashboard-task-item, .dashboard-task-link { gap: 8px; }
  .dashboard-task-link { grid-template-columns: minmax(0, 1fr) auto; }
  .dashboard-task-link > .status-tag { display: none; }
}
@media (max-width: 760px) {
  .order-mobile-sample-no:has(> .print-upload-button) { position: relative; padding-right: 78px; }
  .order-mobile-sample-no .print-upload-button { position: absolute; top: 50%; right: 9px; transform: translateY(-50%); min-height: 22px; padding: 2px 6px; font-size: 10px; }
}

.task-create-heading { align-items: flex-start; }
.task-create-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(390px, .95fr); gap: 20px; align-items: start; }
.task-form-column, .task-upload-column { min-width: 0; display: grid; gap: 16px; }
.task-section { min-width: 0; padding: 24px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); box-shadow: var(--shadow-soft); }
.task-section > header { display: flex; gap: 12px; margin-bottom: 22px; }.task-section > header h2 { margin: 0 0 3px; font-size: 16px; }.task-section > header p { margin: 0; color: var(--color-text-secondary); font-size: 13px; }
.section-number { flex: 0 0 auto; display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--theme-blue-border, #bfdbfe); border-radius: var(--radius-sm); color: var(--color-primary); background: var(--color-primary-soft); font-size: 12px; font-weight: 750; }
.required-chip, .optional-chip { display: inline-flex; margin-left: 5px; padding: 1px 6px; border-radius: 999px; font-size: 11px; vertical-align: 2px; }.required-chip { color: var(--theme-red-text, #991b1b); background: var(--color-danger-soft); }.optional-chip { color: var(--color-text-secondary); background: var(--theme-surface-muted, #f3f4f6); }
.upload-section { padding-bottom: 18px; }
.upload-dropzone { width: 100%; min-height: 112px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 18px; border: 1px dashed var(--theme-border, #b8c5d6); border-radius: var(--radius-sm); color: var(--color-text); background: var(--theme-surface-muted, #fafcff); cursor: pointer; transition: border-color 180ms ease, background-color 180ms ease; }.upload-dropzone.compact { min-height: 88px; }.upload-dropzone span { color: var(--color-text-secondary); font-size: 12px; }.upload-dropzone:hover, .upload-dropzone.dragging { border-color: var(--color-primary); background: var(--color-primary-soft); }
.upload-list { display: grid; gap: 8px; margin-top: 12px; }
.upload-item { min-width: 0; min-height: 62px; display: flex; align-items: center; gap: 11px; padding: 9px 10px; border: 1px solid var(--color-divider); border-radius: var(--radius-sm); background: var(--theme-surface, #fff); }
.upload-item.is-error { border-color: var(--theme-red-border, #fecaca); background: var(--color-danger-soft); }.upload-item.is-uploading { border-color: var(--theme-blue-border, #bfdbfe); }
.file-type-mark { flex: 0 0 auto; width: 42px; height: 38px; display: grid; place-items: center; border-radius: 5px; color: var(--theme-text-secondary, #475569); background: var(--theme-surface-muted, #f1f5f9); font-size: 10px; font-weight: 800; }
.upload-item-copy { min-width: 0; flex: 1; display: grid; }.upload-item-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }.upload-item-copy span { color: var(--color-text-secondary); font-size: 11px; }
.upload-progress { height: 3px; margin-top: 6px; overflow: hidden; border-radius: 3px; background: var(--theme-surface-muted, #e5e7eb); }.upload-progress i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--color-primary); transition: width 150ms ease; }.is-error .upload-progress i { background: var(--color-danger); }
.upload-remove, .image-order-actions button, .upload-retry { flex: 0 0 auto; width: 32px; height: 32px; border: 0; border-radius: var(--radius-sm); color: var(--color-text-secondary); background: transparent; cursor: pointer; }.upload-remove { font-size: 19px; }.upload-remove:hover { color: var(--color-danger); background: var(--color-danger-soft); }.upload-retry { width: auto; padding: 0 8px; color: var(--color-primary); font-size: 12px; }.upload-retry:hover, .image-order-actions button:hover { background: var(--color-primary-soft); }
.upload-image-item { cursor: grab; }.upload-image-item.drag-over { border-color: var(--color-primary); }.upload-thumb { flex: 0 0 auto; width: 54px; height: 46px; padding: 0; overflow: hidden; border: 1px solid var(--color-border); border-radius: 5px; background: var(--theme-surface-muted, #f3f4f6); cursor: zoom-in; }.upload-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; }.image-order-actions { flex: 0 0 auto; display: flex; gap: 2px; }
.upload-named-item { align-items: flex-start; min-height: 86px; padding-top: 10px; padding-bottom: 10px; }
.upload-named-item .upload-thumb { margin-top: 2px; }
.upload-named-item .image-order-actions,
.upload-named-item .upload-remove { margin-top: 2px; }
.upload-display-name-field {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  cursor: default;
}
.upload-display-name-field > span {
  color: var(--color-text-weak);
  font-size: 11px;
  font-weight: 650;
}
.upload-display-name-field input {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  background: var(--theme-surface, white);
  font-size: 13px;
}
.upload-display-name-field input:focus {
  outline: 3px solid rgba(37, 99, 235, .18);
  outline-offset: 1px;
  border-color: var(--theme-blue-border, #93c5fd);
}
.upload-display-name-field input:disabled {
  color: var(--color-text-weak);
  background: var(--theme-surface-muted, #f8fafc);
}
.publish-summary { padding: 20px 22px; border-left: 3px solid var(--color-primary); border-radius: 0 var(--radius-md) var(--radius-md) 0; background: var(--theme-surface-muted, #f8fafc); }.publish-summary h2 { margin: 2px 0 14px; font-size: 16px; }.publish-summary > p { margin: 14px 0 0; color: var(--color-text-secondary); font-size: 12px; }.publish-summary dl { margin: 0; }.publish-summary dl div { min-height: 38px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--color-divider); }.publish-summary dt { color: var(--color-text-secondary); }.publish-summary dd { margin: 0; font-weight: 700; }
.task-publish-actions { position: sticky; z-index: 20; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; margin: 22px -32px -48px; padding: 14px 32px; border-top: 1px solid var(--color-border); background: rgba(var(--theme-surface-rgb, 255, 255, 255), .97); }

.task-table { min-width: 1440px; }.task-table tbody tr[data-row-link] { cursor: pointer; }.task-table tbody tr[data-row-link]:focus-visible { outline-offset: -3px; }
.task-table tbody tr.task-is-paused { cursor: default; background: var(--theme-surface-muted, #f1f3f5); color: var(--theme-text-secondary, #7b828a); }
.task-table tbody tr.task-is-paused td:not(.actions-column) { opacity: .58; filter: grayscale(1); }
.task-table tbody tr.task-is-paused .row-actions > :not(:has(.task-resume-button)):not(:has(.task-delete-button)) { opacity: .5; pointer-events: none; }
.pool-task-card > header > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pool-task-card > header h2 { width: 100%; }
.phase-notice { min-height: 62px; display: flex; align-items: center; gap: 14px; margin-bottom: 20px; padding: 14px 16px; border: 1px solid var(--theme-amber-border, #fde68a); border-radius: var(--radius-md); background: var(--color-warning-soft); }.phase-notice strong { color: var(--theme-amber-text, #92400e); }.phase-notice span { color: var(--theme-amber-text, #6b5b38); font-size: 13px; }
.phase-notice-info { border-color: var(--theme-blue-border, #bfdbfe); background: var(--theme-blue-soft, #eff6ff); }.phase-notice-info strong { color: var(--theme-blue-text, #1d4ed8); }.phase-notice-info span { color: var(--theme-text, #334155); }
.pool-card-actions { align-items: center !important; }.pool-card-actions .action-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.task-action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.action-card { min-width: 0; display: grid; gap: 10px; align-content: start; padding: 16px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--theme-surface-muted, #f8fafc); }
.action-card h3 { margin: 0; font-size: 15px; }.action-card > p { margin: 0; color: var(--color-text-secondary); font-size: 13px; line-height: 1.55; }
.action-card .field { margin: 0; }.action-card .button { justify-self: start; margin-top: 4px; }
.action-card-warn { border-color: var(--theme-red-border, #fecaca); background: var(--theme-red-soft, #fff7f7); }
.inline-callout { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border: 1px solid var(--theme-purple-border, #c4b5fd); border-radius: var(--radius-md); background: #faf5ff; }
.inline-callout > div { display: grid; gap: 4px; min-width: 0; }.inline-callout strong { font-size: 14px; }.inline-callout span { color: var(--color-text-secondary); font-size: 13px; overflow-wrap: anywhere; }
.inline-callout-warn { border-color: #fcd34d; background: var(--theme-amber-soft, #fffbeb); }
.form-error-banner { margin-bottom: 16px; padding: 12px 14px; border: 1px solid var(--theme-red-border, #fecaca); border-radius: var(--radius-md); color: var(--theme-red-text, #991b1b); background: var(--theme-red-soft, #fef2f2); }
.fieldset-inline { border: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.fieldset-inline legend { width: 100%; margin-bottom: 8px; color: var(--color-text-secondary); font-size: 12px; }
.choice-pill, .choice-card { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px; border: 1px solid var(--color-border); border-radius: 999px; background: var(--theme-surface, white); cursor: pointer; }
.choice-pill input, .choice-card input { accent-color: var(--color-primary); }
.choice-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.choice-card { border-radius: var(--radius-md); min-height: 52px; justify-content: center; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.field-hint { display: block; margin-top: 6px; font-size: 12px; }
.task-pool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.pool-task-card { min-width: 0; padding: 20px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--theme-surface, white); box-shadow: var(--shadow-soft); }.pool-task-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--color-divider); }.pool-task-card h2 { margin: 9px 0 0; font-size: 17px; overflow-wrap: anywhere; }.task-card-facts { display: grid; grid-template-columns: 1fr 1fr; margin: 0; }.task-card-facts > div { min-width: 0; padding: 13px 4px; border-bottom: 1px solid var(--color-divider); }.task-card-facts dt { color: var(--color-text-secondary); font-size: 11px; }.task-card-facts dd { margin: 3px 0 0; overflow-wrap: anywhere; }.task-card-facts small { display: block; color: var(--color-text-secondary); }.pool-task-card > footer { min-height: 54px; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; color: var(--color-text-secondary); font-size: 12px; }
.pool-task-card.task-is-paused { background: var(--theme-surface-muted, #f1f3f5); border-color: #d5d9dd; box-shadow: none; }
.pool-task-card.task-is-paused > header,
.pool-task-card.task-is-paused > dl,
.pool-task-card.task-is-paused > footer > span { opacity: .5; filter: grayscale(1); pointer-events: none; }
.status-tag-paused { border-color: #c5cbd1 !important; color: #68717a !important; background: var(--theme-surface-muted, #e5e7eb) !important; }
.status-tag-paused i { background: #8b949e !important; }
.paused-action-label { color: var(--theme-text-secondary, #737b84); font-size: 12px; font-weight: 700; }
.task-paused-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; padding: 14px 16px; border: 1px solid #cbd0d5; border-radius: var(--radius-md); background: #eceff1; }
.task-paused-banner > div { display: grid; gap: 3px; }
.task-paused-banner > .task-paused-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.task-paused-banner strong { color: #49515a; }
.task-paused-banner span { color: #6d747c; font-size: 12px; }
.task-admin-pause-action { display: flex; justify-content: flex-end; margin: -2px 0 10px; }
.task-detail-paused .page-shell > :not(.task-paused-banner):not(.detail-breadcrumb) { opacity: .46; filter: grayscale(1); pointer-events: none; user-select: none; }
.task-detail-paused .page-shell > .task-paused-banner { position: relative; z-index: 2; opacity: 1; filter: none; pointer-events: auto; }
.dashboard-task-item.task-is-paused { background: #eef0f2; color: var(--theme-text-secondary, #7b828a); opacity: .62; filter: grayscale(1); cursor: default; pointer-events: none; }

.task-detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; margin-bottom: 20px; }.task-detail-header h1 { margin: 0; font-size: 24px; overflow-wrap: anywhere; }.task-detail-header p { margin: 7px 0 0; color: var(--color-text-secondary); }.detail-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }.deadline-block { flex: 0 0 auto; display: grid; min-width: 190px; text-align: right; }.deadline-block span, .deadline-block small { color: var(--color-text-secondary); font-size: 12px; }.deadline-block strong { font-size: 16px; }
.current-stage-panel { min-height: 154px; display: flex; align-items: center; gap: 22px; margin-bottom: 18px; padding: 24px; border: 1px solid var(--theme-purple-border, #c4b5fd); border-left: 4px solid var(--color-purple); border-radius: var(--radius-md); background: #faf9ff; }.stage-marker { position: relative; flex: 0 0 auto; width: 62px; height: 62px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--color-purple); font-weight: 800; }.stage-marker i { position: absolute; inset: -7px; border: 1px solid var(--theme-purple-border, #ddd6fe); border-radius: 50%; }.current-stage-panel h2 { margin: 3px 0 15px; font-size: 20px; }.current-stage-panel dl { display: flex; flex-wrap: wrap; gap: 14px 30px; margin: 0; }.current-stage-panel dl div { display: flex; gap: 8px; }.current-stage-panel dt { color: var(--color-text-secondary); }.current-stage-panel dd { margin: 0; font-weight: 650; }
.detail-section { min-width: 0; margin-bottom: 18px; padding: 22px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--theme-surface, white); box-shadow: var(--shadow-soft); }.detail-section > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--color-divider); }.detail-section > header h2 { margin: 2px 0 0; font-size: 17px; }.detail-section > header > span { color: var(--color-text-secondary); font-size: 12px; }

/* 订单详情：紧凑双栏工作台 */
.task-detail-page .page-shell { width: min(1540px, 100%); padding-top: 16px; padding-bottom: 24px; }
.detail-breadcrumb { margin-bottom: 8px; font-size: 12px; }
.detail-overview-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(390px, .8fr);
  align-items: center;
  gap: 18px;
  margin-bottom: 10px;
  padding: 14px 16px;
  border: 1px solid var(--theme-border, #e2e8f0);
  border-radius: 12px;
  background: var(--theme-surface, white);
  box-shadow: 0 4px 18px rgba(15, 23, 42, .045);
}
.detail-overview-main { min-width: 0; }
.mobile-task-brief { display: none; }
.detail-progress-back { margin-bottom: 8px; }
.detail-overview-card .detail-title-row { gap: 7px; }
.detail-overview-card h1 { margin: 0 6px 0 0; font-size: 23px; line-height: 1.25; overflow-wrap: anywhere; }
.detail-overview-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 7px; color: var(--color-text-secondary); font-size: 12px; }
.detail-overview-meta strong { color: var(--theme-text, #334155); font-weight: 650; }
.proxy-note { color: var(--color-primary); }
.detail-deadline { min-width: 178px; display: grid; padding: 0 18px; border-left: 1px solid var(--color-divider); border-right: 1px solid var(--color-divider); }
.detail-deadline span, .detail-deadline small { color: var(--color-text-secondary); font-size: 11px; }
.detail-deadline strong { font-size: 15px; }
.detail-quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.detail-quick-actions button, .detail-summary-links button {
  min-width: 0;
  min-height: 42px;
  display: grid;
  align-content: center;
  padding: 6px 10px;
  border: 1px solid var(--theme-border, #e2e8f0);
  border-radius: 8px;
  color: var(--theme-text, #334155);
  background: var(--theme-surface-muted, #f8fafc);
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}
.detail-quick-actions button:hover, .detail-summary-links button:hover { border-color: var(--theme-blue-border, #bfdbfe); color: var(--color-primary); background: var(--color-primary-soft); }
.detail-quick-actions span { font-size: 12px; font-weight: 700; }
.detail-quick-actions small { color: var(--color-text-secondary); font-size: 10px; }
.compact-stage-panel { min-height: 82px; display: grid; grid-template-columns: auto minmax(210px, .55fr) minmax(0, 1.45fr); gap: 18px; margin-bottom: 10px; padding: 12px 16px; }
.compact-stage-panel .stage-marker { width: 46px; height: 46px; font-size: 12px; }
.compact-stage-panel .stage-marker i { inset: -4px; }
.compact-stage-primary { min-width: 0; }
.compact-stage-panel h2 { margin: 1px 0 0; font-size: 17px; }
.compact-stage-panel dl { min-width: 0; display: grid; grid-template-columns: minmax(150px, .6fr) minmax(0, 1.4fr); gap: 8px 18px; }
.compact-stage-panel dl div { min-width: 0; display: grid; gap: 1px; }
.compact-stage-panel dt { font-size: 11px; }
.compact-stage-panel dd { overflow-wrap: anywhere; font-size: 13px; }
.detail-workbench { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(280px, .7fr); gap: 10px; align-items: stretch; margin-bottom: 10px; }
.detail-workbench-readonly { grid-template-columns: minmax(280px, 380px); justify-content: end; }
.task-detail-page .detail-section { margin-bottom: 10px; padding: 14px 16px; border-radius: 10px; }
.task-detail-page .detail-section > header { margin-bottom: 12px; padding-bottom: 10px; }
.task-detail-page .detail-section > header h2 { font-size: 16px; }
.task-detail-page .action-section { margin-bottom: 0; }
.task-detail-page .action-card { gap: 7px; padding: 12px; }
.task-detail-page .task-action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.task-detail-page .task-action-grid-single { grid-template-columns: minmax(0, 1fr); }
.task-detail-page .action-card textarea { min-height: 56px; }
.task-detail-page .action-card .button { margin-top: 2px; }
.detail-summary-card { min-width: 0; padding: 14px; border: 1px solid var(--theme-border, #e2e8f0); border-radius: 10px; background: var(--theme-surface, white); box-shadow: var(--shadow-soft); }
.detail-summary-card > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.detail-summary-card h2 { margin: 1px 0 0; font-size: 16px; }
.detail-text-button { padding: 0; border: 0; color: var(--color-primary); background: transparent; font-size: 12px; font-weight: 650; cursor: pointer; }
.detail-text-button:hover { color: var(--color-primary-dark); text-decoration: underline; }
.detail-summary-facts { display: grid; grid-template-columns: 1fr 1fr; margin: 0; }
.detail-summary-facts > div { min-width: 0; display: grid; gap: 1px; padding: 7px 4px; border-top: 1px solid var(--color-divider); }
.detail-summary-facts dt { color: var(--color-text-secondary); font-size: 10px; }
.detail-summary-facts dd { margin: 0; overflow-wrap: anywhere; font-size: 12px; font-weight: 650; }
.summary-state { display: inline-flex; align-items: center; min-height: 20px; padding: 0 7px; border-radius: 999px; color: var(--theme-amber-text, #92400e); background: var(--theme-amber-soft, #fffbeb); font-size: 10px; }
.summary-state.is-ready { color: var(--theme-green-text, #166534); background: var(--theme-green-soft, #f0fdf4); }
.detail-summary-links { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.detail-summary-links button { min-height: 34px; display: flex; align-items: center; justify-content: space-between; font-size: 11px; }
.detail-summary-links strong { color: var(--color-primary); }
.detail-return-section { margin-bottom: 10px; }
.detail-return-section .order-return-summary { margin-bottom: 0; }
.task-detail-completed .compact-stage-panel {
  border-color: var(--theme-green-border, #bbf7d0);
  border-left-color: var(--color-success);
  background: var(--theme-green-soft, #f0fdf4);
}
.task-detail-completed .compact-stage-panel .stage-marker {
  background: var(--color-success);
}
.task-detail-completed .compact-stage-panel .stage-marker i { border-color: var(--theme-green-border, #bbf7d0); }
.task-detail-completed .compact-stage-panel .section-kicker,
.task-detail-completed .compact-stage-panel h2 { color: var(--theme-green-text, #166534); }
.task-detail-completed .detail-workbench-readonly {
  display: block;
  margin-bottom: 10px;
}
.task-detail-completed .detail-summary-card {
  display: grid;
  grid-template-columns: minmax(150px, .45fr) minmax(0, 2fr) minmax(150px, .45fr);
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
}
.task-detail-completed .detail-summary-card > header { margin: 0; }
.task-detail-completed .detail-summary-facts {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.task-detail-completed .detail-summary-facts > div { padding: 6px 7px; }
.task-detail-completed .detail-summary-links { margin: 0; }
.task-detail-completed .compact-process-section { margin-top: 0; }

@media (max-width: 1100px) {
  .task-detail-completed .detail-summary-card {
    grid-template-columns: 1fr auto;
  }
  .task-detail-completed .detail-summary-facts {
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .task-detail-completed .detail-summary-links { min-width: 180px; }
}

@media (max-width: 700px) {
  .task-detail-completed .detail-summary-card { grid-template-columns: 1fr; }
  .task-detail-completed .detail-summary-facts {
    grid-column: auto;
    grid-row: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .task-detail-completed .detail-summary-links { min-width: 0; }
}
.compact-process-section { margin-bottom: 0 !important; }
.compact-process-section > header { margin-bottom: 7px !important; padding-bottom: 7px !important; }
.compact-process-actions { display: flex; align-items: center; gap: 12px; color: var(--color-text-secondary); font-size: 11px; }
.compact-process-track { overflow: hidden; padding: 2px 0 0; }
.compact-process-track li { min-width: 0; gap: 4px; }
.compact-process-track li::after { left: calc(50% + 13px); right: calc(-50% + 13px); top: 13px; }
.compact-process-track li > span { width: 26px; height: 26px; font-size: 10px; }
.compact-process-track strong { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compact-process-track small { display: none; }
.compact-process-track li.current > span { box-shadow: 0 0 0 3px #f3e8ff; }
.detail-drawer { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; overflow: hidden; }
.detail-drawer[open] { display: flex; justify-content: flex-end; }
.detail-drawer::backdrop { background: rgba(15, 23, 42, .38); backdrop-filter: blur(2px); }
.detail-drawer-panel { width: min(660px, 92vw); height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); background: var(--theme-surface, white); box-shadow: -20px 0 60px rgba(15, 23, 42, .18); }
.detail-drawer-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; padding: 13px 18px; border-bottom: 1px solid var(--color-divider); }
.detail-drawer-panel > header h2 { margin: 1px 0 0; font-size: 18px; }
.detail-drawer-body { min-height: 0; overflow-y: auto; padding: 16px 18px 24px; overscroll-behavior: contain; }
.detail-drawer-body .detail-facts { grid-template-columns: 1fr 1fr; }
.drawer-people-section, .drawer-gallery-section { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--color-divider); }
.drawer-people-section > h3, .drawer-gallery-section > h3 { margin: 0 0 8px; font-size: 14px; }
.drawer-gallery-section > h3 span { margin-left: 5px; color: var(--color-text-secondary); font-size: 11px; font-weight: 500; }
.drawer-count { margin-bottom: 12px; color: var(--color-text-secondary); font-size: 12px; }
.drawer-process-summary { display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px; padding: 12px 14px; border-radius: 9px; color: var(--color-primary); background: var(--color-primary-soft); }
.drawer-process-summary strong { font-size: 22px; }
.drawer-process-summary span { color: var(--color-text-secondary); font-size: 12px; }
.drawer-process-track { margin: 0; padding: 0; list-style: none; }
.drawer-process-track li { position: relative; min-height: 58px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; }
.drawer-process-track li::after { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--theme-surface-muted, #e5e7eb); }
.drawer-process-track li:last-child::after { display: none; }
.drawer-process-track li > span { position: relative; z-index: 1; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--theme-border, #d1d5db); border-radius: 50%; color: var(--color-text-secondary); background: var(--theme-surface, white); font-size: 10px; font-weight: 700; }
.drawer-process-track li div { display: grid; align-content: start; padding-top: 2px; }
.drawer-process-track li small { color: var(--color-text-secondary); font-size: 11px; }
.drawer-process-track li.done > span { color: white; border-color: var(--color-success); background: var(--color-success); }
.drawer-process-track li.current > span { color: white; border-color: var(--color-purple); background: var(--color-purple); box-shadow: 0 0 0 4px #f3e8ff; }
.drawer-process-track li.skipped > span { color: var(--theme-text-secondary, #9ca3af); background: var(--theme-surface-muted, #f8fafc); }
.detail-drawer .event-section li { min-height: 68px; }
.detail-drawer .formal-file-list article { padding-top: 10px; padding-bottom: 10px; }
.attachment-image-thumb { width: 42px; height: 42px; display: block; padding: 0; overflow: hidden; border: 1px solid var(--color-border); border-radius: 8px; background: var(--theme-surface-muted, #f3f4f6); cursor: zoom-in; }
.attachment-image-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; }
.attachment-empty-state { margin: 0; padding: 14px; border: 1px dashed var(--theme-border, #d1d5db); border-radius: 9px; color: var(--color-text-secondary); background: var(--theme-surface-muted, #f8fafc); font-size: 12px; text-align: center; }
.process-track { display: grid; grid-template-columns: repeat(11, minmax(96px, 1fr)); margin: 0; padding: 6px 0 4px; list-style: none; overflow-x: auto; }.process-track li { position: relative; min-width: 128px; display: grid; justify-items: center; gap: 7px; text-align: center; }.process-track li::after { content: ""; position: absolute; left: calc(50% + 19px); right: calc(-50% + 19px); top: 18px; height: 2px; background: var(--theme-surface-muted, #e5e7eb); }.process-track li:last-child::after { display: none; }.process-track li > span { position: relative; z-index: 1; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--theme-border, #d1d5db); border-radius: 50%; color: var(--color-text-secondary); background: var(--theme-surface, white); font-size: 12px; font-weight: 700; }.process-track li div { display: grid; }.process-track strong { font-size: 12px; }.process-track small { color: var(--color-text-weak); font-size: 11px; }.process-track li.done > span { color: white; border-color: var(--color-success); background: var(--color-success); }.process-track li.done::after { background: #86efac; }.process-track li.done small { color: var(--color-success); }.process-track li.skipped > span { color: var(--theme-text-secondary, #9ca3af); border-color: var(--theme-border, #e5e7eb); background: var(--theme-surface-muted, #f9fafb); }.process-track li.skipped small { color: var(--theme-text-secondary, #9ca3af); }.process-track li.current > span { color: white; border-color: var(--color-purple); background: var(--color-purple); box-shadow: 0 0 0 5px #f3e8ff; }.process-track li.current small { color: var(--color-purple); font-weight: 700; }
.detail-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 18px; align-items: start; }.detail-grid .detail-section { margin-bottom: 0; }
.detail-facts { display: grid; grid-template-columns: 1fr 1fr; margin: 0; }.detail-facts > div { min-width: 0; padding: 12px 5px; border-bottom: 1px solid var(--color-divider); }.detail-facts .wide { grid-column: 1 / -1; border-bottom: 0; }.detail-facts dt { color: var(--color-text-secondary); font-size: 12px; }.detail-facts dd { margin: 4px 0 0; overflow-wrap: anywhere; }.craft-copy { white-space: pre-wrap; line-height: 1.75; }
.attachment-group + .attachment-group { margin-top: 20px; }.attachment-group h3 { display: flex; align-items: center; gap: 7px; margin: 0 0 8px; font-size: 14px; }.attachment-group h3 span { color: var(--color-text-secondary); font-size: 11px; }.formal-file-list { display: grid; }.formal-file-list article { min-width: 0; min-height: 62px; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--color-divider); }.formal-file-list article > div { min-width: 0; }.formal-file-list article > div:nth-child(2) { display: grid; }.formal-file-list strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }.formal-file-list small { color: var(--color-text-secondary); font-size: 11px; }.formal-file-list article > div:last-child { display: flex; }
.combination-gallery { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }.combination-gallery button { position: relative; aspect-ratio: 4 / 3; padding: 0; overflow: hidden; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--theme-surface-muted, #f3f4f6); cursor: zoom-in; }.combination-gallery img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform 180ms ease; }.combination-gallery button:hover img { transform: scale(1.025); }.combination-gallery button span { position: absolute; right: 6px; bottom: 6px; padding: 2px 6px; border-radius: 4px; color: white; background: rgba(17, 24, 39, .72); font-size: 10px; }
.event-section ol { margin: 0; padding: 0; list-style: none; }.event-section li { position: relative; display: flex; gap: 12px; min-height: 58px; }.event-section li::after { content: ""; position: absolute; left: 5px; top: 16px; bottom: -2px; width: 1px; background: var(--theme-surface-muted, #d1d5db); }.event-section li:last-child::after { display: none; }.event-section li > i { position: relative; z-index: 1; flex: 0 0 auto; width: 11px; height: 11px; margin-top: 4px; border: 2px solid white; border-radius: 50%; background: var(--color-success); box-shadow: 0 0 0 1px var(--color-success); }.event-section li.current > i { background: var(--color-purple); box-shadow: 0 0 0 1px var(--color-purple); }.event-section li div { display: grid; align-content: start; }.event-section li span { color: var(--color-text-secondary); font-size: 12px; }
.image-lightbox {
  width: min(920px, calc(100vw - 32px));
  height: min(88vh, 860px);
  max-height: min(88vh, 860px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  color: var(--color-text);
  background: var(--theme-surface, white);
  box-shadow: 0 28px 90px rgba(15, 23, 42, .22);
}
.image-lightbox[open] {
  display: flex;
  flex-direction: column;
}
.image-lightbox::backdrop {
  background: rgba(15, 23, 42, .48);
  backdrop-filter: blur(2px);
}
.lightbox-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-divider);
  background: var(--theme-surface, white);
}
.lightbox-header h2 {
  margin: 2px 0 0;
  max-width: min(620px, 70vw);
  overflow: hidden;
  font-size: 16px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lightbox-header .icon-button {
  flex: 0 0 auto;
  color: var(--color-text-secondary);
}
.lightbox-header .icon-button:hover {
  color: var(--color-text);
  background: var(--color-bg);
}
.lightbox-tabs {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--color-divider);
  background: var(--theme-surface-muted, #fafbfc);
}
.lightbox-tabs[hidden] { display: none !important; }
.lightbox-tab {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text-secondary);
  background: var(--theme-surface, white);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.lightbox-tab:hover {
  border-color: var(--theme-blue-border, #bfdbfe);
  color: var(--color-primary);
  background: var(--color-primary-soft);
}
.lightbox-tab.is-active {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-soft);
  box-shadow: inset 0 0 0 1px var(--color-primary);
}
.lightbox-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 8px;
  padding: 16px 14px;
  background: #f6f7f9;
}
.lightbox-frame {
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--theme-surface, white);
}
.lightbox-frame img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  background: var(--theme-surface, white);
}
.lightbox-nav {
  align-self: center;
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  color: var(--color-text);
  background: var(--theme-surface, white);
  box-shadow: var(--shadow-soft);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease;
}
.lightbox-nav:hover {
  border-color: var(--theme-blue-border, #bfdbfe);
  color: var(--color-primary);
  background: var(--color-primary-soft);
}
.lightbox-nav[hidden] { visibility: hidden; pointer-events: none; }
.lightbox-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-top: 1px solid var(--color-divider);
  color: var(--color-text-secondary);
  background: var(--theme-surface, white);
  font-size: 12px;
  font-weight: 600;
}

@media (max-width: 1180px) {
  .task-create-layout { grid-template-columns: minmax(0, 1fr) minmax(350px, .85fr); }
  .task-pool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .combination-gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .detail-overview-card { grid-template-columns: minmax(0, 1fr) auto; }
  .detail-quick-actions { grid-column: 1 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .detail-workbench { grid-template-columns: minmax(0, 1.55fr) minmax(260px, .7fr); }
  .compact-stage-panel { grid-template-columns: auto minmax(180px, .5fr) minmax(0, 1.5fr); }
}

@media (max-width: 940px) {
  .task-create-layout, .detail-grid { grid-template-columns: 1fr; }
  .task-upload-column { grid-template-columns: 1fr 1fr; }.task-upload-column .upload-section:first-child, .task-upload-column .publish-summary { grid-column: 1 / -1; }
  .task-publish-actions { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
  .combination-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .task-action-grid { grid-template-columns: 1fr 1fr; }
  .choice-grid { grid-template-columns: 1fr 1fr; }
  .detail-overview-card { grid-template-columns: 1fr auto; }
  .detail-deadline { padding-right: 0; border-right: 0; }
  .detail-workbench { grid-template-columns: 1fr; }
  .detail-workbench-readonly { justify-content: stretch; }
  .compact-stage-panel { grid-template-columns: auto minmax(0, 1fr); }
  .compact-stage-panel dl { grid-column: 1 / -1; }
  .compact-process-track { overflow-x: auto; }
  .compact-process-track li { min-width: 86px; }
}

@media (max-width: 700px) {
  .task-create-heading { margin-bottom: 16px; }.task-create-layout, .task-upload-column { display: grid; grid-template-columns: 1fr; gap: 12px; }.task-upload-column .upload-section:first-child, .task-upload-column .publish-summary { grid-column: auto; }
  .order-type-options { grid-template-columns: 1fr; }.order-type-card-body { min-height: 76px; }
  .task-section { margin-left: -16px; margin-right: -16px; padding: 20px 16px; border-left: 0; border-right: 0; border-radius: 0; }.task-section > header { margin-bottom: 18px; }
  .upload-dropzone { min-height: 96px; }.image-order-actions { display: flex; }.upload-item { gap: 8px; }.upload-thumb { width: 46px; }.file-type-mark { width: 38px; }.upload-remove { width: 30px; }
  .task-publish-actions { bottom: 66px; margin-bottom: -32px; }.task-publish-actions .button { min-height: 46px; flex: 1; padding-left: 10px; padding-right: 10px; }
  .task-table { min-width: 0; }.task-table-panel { overflow: visible; }.task-table .numeric-cell { text-align: left; }
  .task-list-page .page-heading { min-height: 48px; display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
  .task-list-page .page-heading .eyebrow,
  .task-list-page .page-heading h1 + p { display: none; }
  .task-list-page .progress-heading-actions > a[href="/progress"] { display: none; }
  .task-list-page .page-heading h1 { margin: 0; font-size: 20px; }
  .task-list-page .progress-heading-actions { width: auto; display: flex; flex: 0 0 auto; grid-template-columns: none; gap: 6px; }
  .task-list-page .progress-heading-actions .button { min-height: 36px; padding: 6px 9px; font-size: 12px; }
  .task-list-page .task-status-tabs { margin-bottom: 8px; }
  .task-list-page .task-status-tabs .filter-tab { flex: 1 1 0; min-width: 0; padding: 8px 6px; text-align: center; }
  .task-list-page .task-search-bar { display: flex; flex-wrap: nowrap; align-items: flex-end; gap: 6px; margin-bottom: 8px; padding: 8px; }
  .task-list-page .task-search-bar .field,
  .task-list-page .task-search-bar .field-grow { min-width: 0; flex: 1 1 auto; }
  .task-list-page .task-search-bar label { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .task-list-page .task-search-bar input { min-height: 38px; }
  .task-list-page .task-search-bar .button { flex: 0 0 auto; min-height: 38px; padding: 6px 12px; }
  .task-list-page .task-table-panel { margin: 0; border: 0; background: transparent; box-shadow: none; }
  .task-list-page .table-scroll { max-width: 100%; overflow: hidden; }
  .task-list-page .task-table tbody { gap: 7px; padding: 0 0 8px; }
  .task-list-page .task-table tbody tr { position: relative; display: grid; grid-template-columns: minmax(88px, 104px) auto minmax(0, auto) auto; gap: 6px 7px; align-items: center; padding: 11px 12px; border-radius: 7px; }
  .task-list-page .task-table td { min-height: 0; display: none; padding: 0; border: 0; }
  .task-list-page .task-table td::before { display: none; }
  .task-list-page .task-table td:nth-child(1),
  .task-list-page .task-table td:nth-child(3),
  .task-list-page .task-table td:nth-child(8),
  .task-list-page .task-table .actions-column { display: block; }
  .task-list-page .task-table td:nth-child(1) { min-width: 0; grid-column: 1; grid-row: 1; }
  .task-list-page .task-table td:nth-child(1) strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
  .task-list-page .task-table td:nth-child(1) .cell-secondary { display: none; }
  .task-list-page .task-table td:nth-child(3) { grid-column: 4; grid-row: 1; color: var(--color-text-secondary); font-size: 10px; text-align: right; white-space: nowrap; }
  .task-list-page .task-table td:nth-child(3) time { display: none; }
  .task-list-page .task-table td:nth-child(3) .cell-secondary { margin: 1px 0 0; font-size: 10px; }
  .task-list-page .task-table td:nth-child(8) { min-width: 0; grid-column: 2; grid-row: 1; justify-self: start; }
  .task-list-page .task-table td:nth-child(8) .status-tag { max-width: 100%; min-height: 21px; padding: 1px 7px; overflow: hidden; font-size: 10px; text-overflow: ellipsis; }
  .task-list-page .task-table td:nth-child(8) .status-tag i { width: 5px; height: 5px; }
  .task-list-page .task-table td:nth-child(9) { min-width: 0; display: block; grid-column: 3; grid-row: 1; max-width: 72px; overflow: hidden; color: var(--color-text-secondary); font-size: 10px; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
  .task-list-page .task-table .actions-column { grid-column: 1 / -1; grid-row: 2; }
  .task-list-page .row-actions { gap: 5px; padding-top: 7px; border-top: 1px solid var(--color-divider); }
  .task-list-page .row-actions::before { display: none; }
  .task-list-page .row-actions .button { min-height: 32px; padding: 4px 9px; font-size: 11px; }
  .task-list-page .row-actions > form:has(.task-delete-button) { margin-right: auto; }
  .task-list-page .row-actions > a:first-child { margin-right: auto; }
  .task-list-page .pagination { margin: 8px 0; }
  .phase-notice { align-items: flex-start; flex-direction: column; gap: 3px; }.task-pool-grid { grid-template-columns: 1fr; }.pool-task-card { padding: 16px; }.pool-task-card > header { flex-wrap: wrap; }.task-card-facts { grid-template-columns: 1fr 1fr; }
  .task-action-grid { grid-template-columns: 1fr; }.inline-callout { flex-direction: column; align-items: stretch; }.choice-grid { grid-template-columns: 1fr 1fr; }.form-actions .button { flex: 1; }
  .task-detail-header { display: grid; }.deadline-block { text-align: left; }.detail-title-row { align-items: flex-start; }.task-detail-header h1 { width: 100%; font-size: 22px; }
  .current-stage-panel { align-items: flex-start; min-height: auto; gap: 16px; margin-left: -16px; margin-right: -16px; padding: 20px 16px; border-left-width: 4px; border-right: 0; border-radius: 0; }.stage-marker { width: 48px; height: 48px; }.current-stage-panel h2 { font-size: 17px; }.current-stage-panel dl { display: grid; gap: 7px; }
  .detail-section { margin-left: -16px; margin-right: -16px; padding: 20px 16px; border-left: 0; border-right: 0; border-radius: 0; }.detail-grid { gap: 18px; }.detail-grid .detail-section { margin-bottom: 0; }
  .process-section { overflow: hidden; }.process-track { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; scroll-snap-type: x proximity; }.process-track li { scroll-snap-align: start; }
  .task-detail-page .page-shell { padding-top: 0; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .task-detail-page .detail-breadcrumb,
  .task-detail-page .detail-overview-card,
  .task-detail-page .compact-stage-panel,
  .task-detail-page .detail-return-section,
  .task-detail-page .detail-summary-card,
  .task-detail-page .compact-process-section { display: none; }
  .mobile-task-brief { display: block; margin: 0 -16px 8px; border-bottom: 1px solid var(--color-divider); background: var(--theme-surface, white); }
  .mobile-task-brief-header { min-height: 54px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 7px 12px; }
  .mobile-task-brief-header > div { min-width: 0; display: grid; gap: 1px; }
  .mobile-task-brief-header strong { overflow: hidden; font-size: 16px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-task-brief-header div span { overflow: hidden; color: var(--color-text-secondary); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-task-back { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 6px; color: var(--color-text); font-size: 30px; line-height: 1; text-decoration: none; }
  .mobile-task-back:active { background: var(--theme-surface-muted, #f1f5f9); }
  .mobile-task-state { min-height: 24px; display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; color: var(--theme-green-text, #166534); background: var(--theme-green-soft, #f0fdf4); font-size: 10px; font-weight: 700; white-space: nowrap; }
  .mobile-task-state.is-paused { color: #525960; background: var(--theme-surface-muted, #e5e7eb); }
  .mobile-task-state.is-cancelled { color: var(--theme-red-text, #991b1b); background: var(--theme-red-soft, #fef2f2); }
  .mobile-task-state.is-completed { color: var(--theme-green-text, #166534); background: var(--theme-green-soft, #dcfce7); }
  .mobile-task-cover { width: 100%; aspect-ratio: 4 / 3; display: block; padding: 0; overflow: hidden; border: 0; border-top: 1px solid var(--color-divider); border-bottom: 1px solid var(--color-divider); border-radius: 0; background: var(--theme-surface-muted, #f1f5f9); cursor: zoom-in; }
  .mobile-task-cover img { width: 100%; height: 100%; display: block; object-fit: contain; background: var(--theme-surface-muted, #f8fafc); }
  .mobile-task-cover-empty { display: grid; place-items: center; color: var(--color-text-weak); font-size: 12px; cursor: default; }
  .mobile-task-progress { display: grid; gap: 6px; padding: 11px 14px 10px; }
  .mobile-task-progress > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .mobile-task-progress strong { min-width: 0; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-task-progress div span { flex: 0 0 auto; color: var(--color-text-secondary); font-size: 11px; font-variant-numeric: tabular-nums; }
  .mobile-task-progress progress { width: 100%; height: 6px; overflow: hidden; border: 0; border-radius: 999px; background: var(--theme-surface-muted, #e5e7eb); accent-color: var(--color-primary); }
  .mobile-task-progress progress::-webkit-progress-bar { border-radius: 999px; background: var(--theme-surface-muted, #e5e7eb); }
  .mobile-task-progress progress::-webkit-progress-value { border-radius: 999px; background: var(--color-primary); }
  .mobile-task-progress progress::-moz-progress-bar { border-radius: 999px; background: var(--color-primary); }
  .mobile-task-progress p { margin: 0; overflow: hidden; color: var(--color-text-secondary); font-size: 11px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-task-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--color-divider); }
  .mobile-task-links button { min-width: 0; min-height: 42px; padding: 6px 4px; border: 0; border-right: 1px solid var(--color-divider); color: var(--theme-text, #334155); background: var(--theme-surface, white); font-size: 12px; font-weight: 650; cursor: pointer; }
  .mobile-task-links button:last-child { border-right: 0; }
  .mobile-task-links button:active { color: var(--color-primary); background: var(--color-primary-soft); }
  .mobile-task-links span { color: var(--color-text-secondary); font-size: 10px; font-weight: 500; }
  .task-detail-page .task-admin-pause-action { margin: 8px 0; }
  .task-detail-page .task-paused-banner { margin: 8px -8px; padding: 12px; }
  .task-detail-page .detail-workbench { display: block; margin: 0; }
  .task-detail-page .detail-workbench-readonly { display: none; }
  .task-detail-page .detail-section { margin: 0 -16px 8px; padding: 14px 16px; border-left: 0; border-right: 0; border-radius: 0; box-shadow: none; }
  .task-detail-page .action-section > header { margin-bottom: 10px; padding-bottom: 8px; }
  .task-detail-page .action-section > header .section-kicker { display: none; }
  .task-detail-page .action-card { padding: 12px; }
  .task-detail-page .action-card > p { display: none; }
  .task-detail-page .action-card .button { width: 100%; justify-content: center; min-height: 44px; }
  .task-detail-page .inline-callout { padding: 12px; }
  .task-detail-page .task-action-grid { grid-template-columns: 1fr; }
  .task-detail-page #suborders { margin-top: 0; }
  .task-detail-page .suborder-card { padding: 10px; }
  .detail-drawer-panel { width: 100vw; }
  .detail-drawer-body .detail-facts { grid-template-columns: 1fr; }
  .detail-drawer-body .detail-facts .wide { grid-column: auto; }
  .drawer-gallery-section .combination-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-facts { grid-template-columns: 1fr 1fr; }.formal-file-list article { grid-template-columns: 38px minmax(0, 1fr); }.formal-file-list article > div:last-child { grid-column: 1 / -1; padding-left: 48px; }.combination-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .image-lightbox {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }
  .lightbox-header { min-height: 60px; padding: 12px 14px; }
  .lightbox-header h2 { font-size: 15px; }
  .lightbox-tabs { padding: 10px 14px; gap: 6px; }
  .lightbox-stage { padding: 12px 8px; gap: 4px; }
  .lightbox-nav { width: 36px; height: 36px; font-size: 22px; }
  .lightbox-footer { min-height: 48px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
}

@media (max-width: 390px) {
  .upload-item-copy strong { max-width: 150px; }.task-card-facts, .detail-facts { grid-template-columns: 1fr; }.detail-facts .wide { grid-column: auto; }.combination-gallery { grid-template-columns: 1fr 1fr; gap: 7px; }
}

/* Progress board */
.panel-header-actions, .progress-heading-actions { display: flex; align-items: center; gap: 8px; }
.progress-page { overflow-x: clip; }
.progress-page .page-shell { width: min(1720px, 100%); max-width: 100%; padding-top: 16px; }
.progress-heading { align-items: center; margin: 0 0 8px; }
.progress-pause-filter { margin: 0; }
.progress-pause-option {
  height: 40px;
  min-height: 40px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  background: var(--color-surface);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}
.progress-pause-option:hover { border-color: var(--theme-border, #b9c4d3); color: var(--color-text); }
.progress-pause-option:has(input:checked) { border-color: var(--theme-blue-border, #93b4f5); color: var(--color-primary); background: var(--theme-blue-soft, #eff6ff); }
.progress-pause-option:has(input:focus-visible) { outline: 3px solid rgba(37, 99, 235, .18); outline-offset: 2px; }
.progress-pause-option input[type="checkbox"] { width: 16px; height: 16px; min-height: 16px; flex: 0 0 16px; box-sizing: border-box; margin: 0; padding: 0; accent-color: var(--color-primary); cursor: pointer; }
.progress-metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.progress-metric { position: relative; min-width: 0; min-height: 124px; display: grid; align-content: space-between; padding: 17px 18px 15px; overflow: hidden; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); box-shadow: var(--shadow-soft); }
.progress-metric::after { content: ""; position: absolute; width: 72px; height: 72px; right: -30px; bottom: -36px; border-radius: 50%; background: var(--theme-blue-soft, #eff6ff); }
.progress-metric > span { display: flex; align-items: center; gap: 8px; color: var(--color-text-secondary); font-size: 12px; font-weight: 650; }
.progress-metric > span i { width: 8px; height: 8px; border-radius: 50%; background: var(--color-primary); }
.progress-metric strong { position: relative; z-index: 1; margin: 5px 0 0; font-size: 30px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.progress-metric small { color: var(--color-text-weak); font-size: 11px; }
.progress-metric.metric-active > span i { background: var(--color-purple); }.progress-metric.metric-active::after { background: var(--theme-purple-soft, #f5f3ff); }
.progress-metric.metric-in-progress > span i { background: var(--color-primary); }.progress-metric.metric-in-progress::after { background: var(--color-primary-soft); }
.progress-metric.metric-due > span i { background: var(--color-warning); }.progress-metric.metric-due::after { background: var(--color-warning-soft); }
.progress-metric.metric-overdue > span i { background: var(--color-danger); }.progress-metric.metric-overdue::after { background: var(--color-danger-soft); }
.progress-metric.metric-finished > span i { background: var(--color-success); }.progress-metric.metric-finished::after { background: var(--color-success-soft); }

/* 「待我处理」有待办时持续红光脉冲提醒 */
@keyframes mine-alert-pulse {
  0%, 100% { border-color: var(--color-danger); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
  50% { border-color: var(--color-danger); box-shadow: 0 0 0 5px rgba(239, 68, 68, .16), 0 0 16px 1px rgba(239, 68, 68, .3); }
}
.progress-metric.metric-alert { border-color: var(--color-danger) !important; animation: mine-alert-pulse 1.6s ease-in-out infinite; }
.progress-metric.metric-alert > span i { background: var(--color-danger); }
.progress-metric.metric-alert strong { color: var(--color-danger); }
.progress-metric.metric-alert::after { background: var(--color-danger-soft); }
@keyframes mine-alert-row-pulse {
  0%, 100% { background-color: rgba(239, 68, 68, 0); }
  50% { background-color: rgba(239, 68, 68, .1); }
}
.metric-list a.metric-alert { border-bottom-color: rgba(239, 68, 68, .45); animation: mine-alert-row-pulse 1.6s ease-in-out infinite; }
.metric-list a.metric-alert span, .metric-list a.metric-alert strong { color: var(--color-danger); }

.progress-board-panel { min-width: 0; margin-bottom: 18px; overflow: hidden; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); box-shadow: var(--shadow-soft); }
.progress-section-header { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--color-divider); }
.progress-section-header h2 { margin: 2px 0 0; font-size: 17px; }
.progress-section-header > p { margin: 0; color: var(--color-text-secondary); font-size: 12px; }
.order-process-scroll { min-width: 0; overflow-x: auto; overflow-y: hidden; background: var(--theme-surface, white); scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
.order-process-scroll:focus-visible { outline-offset: -4px; }

.order-count-chip { flex: 0 0 auto; min-height: 28px; display: inline-flex; align-items: center; padding: 3px 10px; border: 1px solid var(--color-border); border-radius: 999px; color: var(--color-text-secondary); background: var(--theme-surface-muted, #fafbfc); font-size: 11px; font-weight: 650; }
.order-progress-list { display: grid; gap: 5px; padding: 5px; background: var(--theme-surface-muted, #f7f9fc); }
.order-progress-card {
  --order-left-column: 136px;
  --order-right-column: clamp(240px, 18vw, 300px);
  min-width: 0;
  display: grid;
  grid-template-columns: var(--order-left-column) minmax(0, 1fr) var(--order-right-column);
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--theme-surface, white);
  scroll-margin-top: 88px;
  transition: box-shadow 400ms ease, border-color 400ms ease;
}
.order-progress-card.task-is-paused { background: var(--theme-surface-muted, #eff1f3); border-color: var(--theme-border, #cfd4d9); box-shadow: none; }
.order-progress-card.task-is-paused > section,
.order-progress-card.task-is-paused .order-right-badges,
.order-progress-card.task-is-paused .order-card-status-facts { opacity: .46; filter: grayscale(1); pointer-events: none; user-select: none; }
.order-progress-card.task-is-paused .order-card-actions > :not(:has(.task-resume-button)) { opacity: .5; pointer-events: none; }
.order-status-badge.is-paused { border-color: #cbd0d5; color: #646d76; background: #e2e5e8; }
.order-progress-card.is-scroll-focus {
  animation: progress-order-focus 500ms ease-in-out 4;
  border-color: var(--theme-blue-border, #93c5fd);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .18), var(--shadow-soft);
}
@keyframes progress-order-focus {
  0%, 100% { border-color: var(--theme-blue-border, #93c5fd); box-shadow: 0 0 0 3px rgba(37, 99, 235, .18), var(--shadow-soft); }
  50% { border-color: var(--color-primary); box-shadow: 0 0 0 6px rgba(37, 99, 235, .3), var(--shadow-soft); }
}
.order-progress-card-compact {
  grid-template-columns: minmax(0, 1fr) 220px;
}
.progress-controls {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(700px, 1.14fr) minmax(640px, .86fr);
  align-items: stretch;
  gap: 9px;
  margin-bottom: 6px;
}
.progress-controls .progress-metrics {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}
.progress-controls .progress-metric {
  min-height: 54px;
  gap: 7px;
  padding: 7px 10px;
}
.progress-controls .progress-metric > span { white-space: nowrap; }
.progress-controls .progress-metric strong { font-size: 20px; }
.progress-controls .progress-search-inline {
  min-width: 0;
  align-self: stretch;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 5px;
}
.progress-controls .progress-search-inline .field {
  flex: 1 1 180px;
  margin: 0;
}
.progress-controls .progress-search-inline .field label { display: none; }
.progress-controls .progress-search-inline input,
.progress-controls .progress-search-inline .button { min-height: 40px; }
.progress-controls .progress-search-inline .button { padding-right: 12px; padding-left: 12px; }
.progress-controls .progress-search-inline .order-count-chip { margin-left: 0; }
.progress-controls .progress-search-inline .progress-pattern-filter { flex: 0 1 150px; min-width: 120px; }
.progress-pattern-filter select { width: 100%; min-height: 40px; }
.progress-controls .progress-search-inline .progress-task-type-filter { flex: 0 1 130px; min-width: 120px; }
.progress-task-type-filter select { width: 100%; min-height: 40px; }
.progress-controls .progress-search-inline .progress-acceptance-filter { flex: 0 1 130px; min-width: 120px; }
.progress-acceptance-filter select { width: 100%; min-height: 40px; }
.progress-controls .progress-search-inline .field-grow { min-width: 0; }
@media (max-width: 1600px) {
  .progress-controls { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .progress-controls .progress-search-inline { flex-wrap: wrap; }
  .progress-controls .progress-search-inline .progress-pattern-filter { flex: 1 1 130px; }
  .progress-controls .progress-search-inline .progress-task-type-filter { flex: 1 1 130px; }
  .progress-controls .progress-search-inline .progress-acceptance-filter { flex: 1 1 130px; }
}

@media (max-width: 1320px) {
  .progress-controls { grid-template-columns: minmax(0, 1fr); }
  .progress-controls .progress-metrics { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.order-process-track {
  --node-mark-size: 30px;
  --node-label-space: 30px;
  --process-node-count: 11;
  min-width: calc(var(--process-node-count) * 72px);
  width: max(100%, calc(var(--process-node-count) * 72px));
  display: grid;
  grid-template-columns: repeat(var(--process-node-count), minmax(0, 1fr));
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  align-items: center;
  margin: 0;
  padding: 4px 8px 2px;
  list-style: none;
  flex-wrap: nowrap;
}
.order-process-node {
  position: relative;
  min-width: 0;
  min-height: calc(var(--node-mark-size) + var(--node-label-space));
  display: grid;
  grid-template-rows: var(--node-mark-size) var(--node-label-space);
  justify-items: center;
  align-items: center;
  padding: 0 2px;
  text-align: center;
}
.order-process-node::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: calc(50% + (var(--node-mark-size) / 2) + 2px);
  right: calc(-50% + (var(--node-mark-size) / 2) + 2px);
  top: calc((var(--node-mark-size) / 2) - 1px);
  height: 2px;
  background: var(--theme-surface-muted, #e5e7eb);
}
.order-process-node:last-child::after { display: none; }
.order-process-node.done::after { background: #86efac; }
.order-process-node.returned::after { background: #fcd34d; }
.order-node-mark {
  position: relative;
  z-index: 1;
  grid-row: 1;
  width: var(--node-mark-size);
  height: var(--node-mark-size);
  display: grid;
  place-items: center;
  border: 2px solid var(--theme-border, #d1d5db);
  border-radius: 50%;
  color: var(--color-text-secondary);
  background: var(--theme-surface, white);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}
.order-process-node.done .order-node-mark { color: white; border-color: var(--color-success); background: var(--color-success); }
/* 蓝色：全员可见的「当前流程节点」 */
.order-process-node.current .order-node-mark { color: white; border-color: var(--color-primary); background: var(--color-primary); box-shadow: 0 0 0 5px var(--theme-blue-border, #dbeafe); }
.order-process-node.returned .order-node-mark { color: white; border-color: var(--color-warning); background: var(--color-warning); box-shadow: 0 0 0 5px var(--color-warning-soft); }
.order-process-node.skipped .order-node-mark { color: var(--theme-text-secondary, #9ca3af); border-color: var(--theme-border, #e5e7eb); background: var(--theme-surface-muted, #f9fafb); }
.order-process-node.upcoming .order-node-mark { color: var(--theme-text-secondary, #9ca3af); border-color: var(--theme-border, #d1d5db); background: var(--theme-surface, white); }
/* 橙色：仅「该你处理」的人看到（在蓝色当前节点上叠加） */
.order-process-node.current.is-mine-turn .order-node-mark {
  border-color: #ea580c;
  background: linear-gradient(145deg, #fb923c 0%, #ea580c 100%);
  box-shadow: 0 0 0 5px var(--theme-amber-border, #ffedd5), 0 4px 12px rgba(234, 88, 12, .35);
}
.order-process-node.returned.is-mine-turn .order-node-mark {
  border-color: #dc2626;
  background: linear-gradient(145deg, #f87171 0%, #dc2626 100%);
  box-shadow: 0 0 0 5px var(--theme-red-border, #fee2e2), 0 4px 12px rgba(220, 38, 38, .3);
}
.order-node-label {
  min-width: 0;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.35;
  color: var(--theme-text-secondary, #4b5563);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.order-process-node:nth-child(odd) .order-node-label,
.order-process-node:nth-child(even) .order-node-label {
  grid-row: 2;
  align-self: start;
  padding: 5px 2px 0;
}
.order-process-node.done .order-node-label { color: var(--color-success); }
.order-process-node.current .order-node-label { color: var(--color-primary); font-weight: 700; }
.order-process-node.returned .order-node-label { color: var(--color-warning); font-weight: 700; }
.order-process-node.skipped .order-node-label { color: var(--theme-text-secondary, #9ca3af); font-weight: 500; }
.order-process-node.upcoming .order-node-label { color: var(--theme-text-secondary, #6b7280); font-weight: 500; }
.order-process-node.current.is-mine-turn .order-node-label {
  color: var(--theme-amber-text, #c2410c);
  font-weight: 800;
}
.order-process-node.returned.is-mine-turn .order-node-label {
  color: var(--theme-red-text, #b91c1c);
  font-weight: 800;
}
.order-node-mine-hint {
  display: block;
  margin-top: 1px;
  color: #ea580c;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.2;
}
.order-process-node.returned.is-mine-turn .order-node-mine-hint {
  color: var(--theme-red-text, #dc2626);
}
.order-process-node.is-actionable,
.order-process-node.is-mine-turn,
.order-process-node[aria-current="step"] {
  cursor: pointer;
}
.order-process-node.is-mine-turn:hover .order-node-mark {
  transform: scale(1.08);
}
.order-process-node.is-mine-turn:hover .order-node-label {
  color: var(--theme-amber-text, #9a3412);
}
.order-node-mark { transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease; }

.stage-action-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: min(90vh, 760px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  color: var(--color-text);
  background: var(--theme-surface, white);
  box-shadow: 0 28px 90px rgba(15, 23, 42, .28);
}
.stage-action-dialog.is-assign {
  width: min(780px, calc(100vw - 24px));
  max-height: min(92dvh, 860px);
}
.stage-action-dialog.is-pattern-complete,
.stage-action-dialog.is-purchase-complete,
.stage-action-dialog.is-decoration-complete,
.stage-action-dialog.is-data-entry-complete,
.stage-action-dialog.is-assign-sample {
  width: min(640px, calc(100vw - 24px));
  max-height: min(92dvh, 860px);
}
.stage-action-dialog.is-production-complete {
  width: min(760px, calc(100vw - 24px));
  max-height: min(92dvh, 860px);
}
.stage-brief-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--theme-surface-muted, #f8fafc);
}
.stage-completion-layout {
  display: grid;
  grid-template-columns: minmax(210px, .72fr) minmax(330px, 1.28fr);
  gap: 14px;
  align-items: start;
}
.stage-completion-form {
  min-width: 0;
  display: grid;
  gap: 12px;
}
.stage-reference-compact {
  position: sticky;
  top: 0;
  align-content: start;
  border-radius: 8px;
  background: var(--theme-surface-muted, #f8fafc);
}
.stage-reference-compact .brief-file-item {
  gap: 7px;
  padding: 7px 8px;
  border-radius: 7px;
}
.stage-completion-assignee {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--theme-blue-border, #bfdbfe);
  border-radius: 8px;
  background: var(--theme-surface-muted, #f8fbff);
}
.stage-brief-panel > header h3 {
  margin: 2px 0 0;
  font-size: 15px;
}
.stage-brief-facts {
  display: grid;
  gap: 8px;
  margin: 0;
}
.stage-brief-facts > div {
  display: grid;
  gap: 2px;
}
.stage-brief-facts dt {
  color: var(--color-text-secondary);
  font-size: 12px;
}
.stage-brief-facts dd {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.45;
}
.stage-brief-empty {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 13px;
}
.brief-file-list {
  display: grid;
  gap: 8px;
}
.brief-file-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--theme-surface, white);
}
.brief-file-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stage-upload-section {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--theme-surface, white);
}
.stage-upload-section > header h3 {
  margin: 2px 0 0;
  font-size: 15px;
}
.stage-upload-section > header p {
  margin: 4px 0 0;
  color: var(--color-text-secondary);
  font-size: 12px;
}
.stage-upload-section .upload-dropzone {
  min-height: 72px;
}
.stage-upload-section .upload-list:empty {
  display: none;
}
.stage-upload-section.compact {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.action-card-pattern {
  grid-column: 1 / -1;
}
.stage-action-dialog[open] {
  display: grid;
}
.stage-action-dialog::backdrop {
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(3px);
}
.suborder-action-dialog {
  width: min(640px, calc(100vw - 24px));
  max-height: min(92dvh, 860px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  color: var(--color-text);
  background: var(--theme-surface, white);
  box-shadow: 0 28px 90px rgba(15, 23, 42, .28);
}
.suborder-action-dialog[open] { display: grid; }
.suborder-action-dialog::backdrop {
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(3px);
}
.suborder-action-panel {
  max-height: min(92dvh, 860px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--theme-surface, white);
}
.suborder-action-body {
  display: grid;
  gap: 12px;
}
.suborder-action-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 10px 12px;
  border: 1px solid var(--theme-blue-border, #bfdbfe);
  border-radius: var(--radius-sm);
  color: var(--theme-blue-text, #1e3a8a);
  background: var(--color-primary-soft);
  font-size: 12px;
  font-weight: 650;
}
.suborder-action-form,
.suborder-confirmation-actions {
  display: grid;
  gap: 12px;
}
.suborder-confirmation-tablist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--theme-surface-muted, #f8fafc);
}
.suborder-confirmation-tablist button {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  color: var(--color-text-secondary);
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}
.suborder-confirmation-tablist button:hover {
  color: var(--color-primary);
  background: var(--color-primary-soft);
}
.suborder-confirmation-tablist button.is-active {
  color: white;
  background: var(--color-primary);
  box-shadow: 0 1px 3px rgba(37, 99, 235, .22);
}
.suborder-confirmation-panel {
  display: grid;
  gap: 12px;
}
.suborder-action-pass {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--theme-blue-border, #bfdbfe);
  border-radius: 12px;
  background: var(--theme-surface, white);
}
.suborder-action-pass div {
  display: grid;
  gap: 3px;
}
.suborder-action-pass span {
  color: var(--color-text-secondary);
  font-size: 12px;
}
.suborder-action-footer {
  min-height: auto;
  margin: 0 -18px -18px;
}
.stage-action-dialog > form {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: min(92dvh, 860px);
}
.stage-action-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
  padding: 15px 22px;
  border-bottom: 1px solid var(--color-divider);
  background: var(--theme-surface, white);
}
.stage-action-header h2 {
  margin: 2px 0 0;
  font-size: 20px;
}
.stage-action-body {
  min-height: 0;
  overflow-y: auto;
  padding: 16px 18px 18px;
  background: var(--theme-surface-muted, #f7f9fc);
}
.stage-action-dialog.is-assign .stage-action-body {
  padding: 18px 22px 22px;
}
.stage-action-message {
  margin: 0 0 14px;
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: 1.55;
}
.stage-action-message:empty { display: none; }
.stage-action-dialog.is-assign .stage-action-message {
  margin: 0 0 16px;
  padding: 11px 14px;
  border: 1px solid var(--theme-blue-border, #bfdbfe);
  border-radius: var(--radius-sm);
  background: var(--color-primary-soft);
  color: var(--theme-blue-text, #1e3a8a);
  font-weight: 550;
}
.stage-action-fields {
  display: grid;
  gap: 12px;
}
.stage-action-fields .field {
  margin: 0;
}
.return-field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  margin-bottom: 12px;
}
.return-field-row > .field { min-width: 0; margin: 0; }
.return-field-row select { width: 100%; min-width: 0; }
.return-field-row[hidden] { display: none; }
.return-type-create { padding: 20px; margin-bottom: 20px; }
.return-type-create-form { display: flex; align-items: end; gap: 16px; flex-wrap: wrap; }
.return-type-create-form .field { margin: 0; flex: 1; min-width: 150px; }
.stats-return-note { margin: 0 0 16px; color: var(--color-text-secondary); font-size: 13px; }
.stats-return-reason { min-width: 180px; max-width: 360px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Return statistics: one expandable history per parent order. */
.return-stat-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 20px; }
.return-stat-columns > .stats-section { min-width: 0; margin: 0; }
.return-stat-classification > .stats-section-header, .return-stat-columns #return-type-details > .stats-section-header { flex-wrap: wrap; gap: 6px 12px; }
.return-stat-classification > .stats-section-header > span { margin-left: auto; text-align: right; color: var(--color-text-secondary); font-size: 12px; }
.return-stat-classification .stats-return-note { margin: 0; padding: 12px 14px; font-size: 12px; line-height: 1.7; }
.return-stat-columns .return-order-summary { grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; padding: 10px 14px; }
.return-stat-columns .return-order-pagination { flex-wrap: wrap; }
@media (min-width: 1101px) {
  .return-stat-classification .return-type-summary-table { width: 100%; min-width: 0; table-layout: fixed; }
  .return-stat-classification .return-type-summary-table th, .return-stat-classification .return-type-summary-table td { padding: 12px 8px; font-size: 12px; overflow-wrap: anywhere; }
  .return-stat-classification .return-type-summary-table th { white-space: normal; }
  .return-stat-classification .return-type-summary-table th:first-child { width: 31%; }
  .return-stat-classification .return-type-summary-table th:last-child { width: 60px; }
  .return-stat-classification .return-type-summary-table .button { min-height: 28px; padding: 3px 6px; font-size: 12px; white-space: nowrap; }
}
@media (max-width: 1100px) {
  .return-stat-columns { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
.return-empty-types { border-top: 1px solid var(--color-divider); }
.return-empty-types > summary { cursor: pointer; padding: 12px 16px; color: var(--color-text-secondary); font-size: 13px; }
.stats-toolbar.return-order-filters { flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.return-order-filters .field { display: flex; align-items: center; gap: 8px; }
.return-order-filters .field > span { flex: 0 0 auto; white-space: nowrap; font-size: 13px; }
.return-order-type-controls { min-width: 0; max-width: 100%; display: flex; align-items: center; gap: 8px; }
.return-order-type-controls .field { min-width: 0; }
.return-order-type-controls select { width: 138px; min-width: 0; }
.return-order-filters input, .return-order-filters select { min-height: 36px; font-size: 13px; }
.return-order-type-controls > .button { flex: 0 0 auto; min-height: 36px; }
#return-type-details { scroll-margin-top: 80px; }
.return-order-filters .return-order-search { flex: 1 1 240px; min-width: 0; max-width: none; }
.return-order-search input { flex: 1; min-width: 0; width: 100%; }
.return-order-help { margin: 0; padding: 0 16px 14px; color: var(--color-text-secondary); font-size: 12px; line-height: 1.6; }
.return-order-list { padding: 0 16px 12px; display: grid; gap: 8px; }
.return-order-group { min-width: 0; border: 1px solid var(--color-border); border-radius: 10px; background: var(--theme-surface, var(--color-surface)); overflow: hidden; }
.return-order-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; list-style: none; }
.return-order-summary::-webkit-details-marker { display: none; }
.return-order-summary:hover { background: var(--theme-surface-muted, var(--color-bg)); }
.return-order-summary:focus-visible, .return-empty-types > summary:focus-visible { outline: 2px solid var(--color-primary); outline-offset: -3px; }
.return-order-identity, .return-order-metrics { min-width: 0; display: grid; gap: 4px; }
.return-order-title-row { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.return-order-title-row > strong { min-width: 0; font-size: 15px; overflow-wrap: anywhere; }
.return-order-latest { color: var(--color-text-secondary); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.return-order-types { min-width: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.return-type-chip { min-width: 0; display: inline-flex; align-items: center; gap: 5px; padding: 2px 6px; border-radius: 5px; color: var(--color-text-secondary); background: var(--theme-surface-muted, var(--color-bg)); font-size: 12px; overflow-wrap: anywhere; }
.return-type-chip b { color: var(--color-text); font-variant-numeric: tabular-nums; }
.return-order-metrics { text-align: right; font-variant-numeric: tabular-nums; }
.return-order-metrics strong { color: var(--color-danger); font-size: 13px; }
.return-order-metrics time { color: var(--color-text-secondary); font-size: 12px; white-space: nowrap; }
.return-order-toggle { color: var(--color-primary); display: flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 12px; }
.return-order-collapse { display: none; }
.return-order-group[open] .return-order-collapse { display: inline; }
.return-order-group[open] .return-order-expand { display: none; }
.return-order-group[open] .return-order-chevron { transform: rotate(180deg); }
.return-order-group[open] > summary { border-bottom: 1px solid var(--color-divider); background: var(--theme-surface-muted, var(--color-bg)); }
.return-order-history { padding: 16px 20px 20px; }
.return-order-history-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; font-size: 12px; color: var(--color-text-secondary); }
.return-order-timeline { list-style: none; margin: 0; padding: 0; }
.return-order-event { display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: 20px; }
.return-event-time { display: flex; flex-direction: column; gap: 6px; padding: 3px 0 20px; font-size: 12px; font-variant-numeric: tabular-nums; }
.return-event-time span { color: var(--color-text-secondary); }
.return-event-content { position: relative; min-width: 0; padding: 0 0 22px 20px; border-left: 1px solid var(--color-border); }
.return-event-content::before { content: ''; position: absolute; width: 7px; height: 7px; left: -4px; top: 6px; border-radius: 50%; background: var(--color-primary); }
.return-order-event:last-child .return-event-content { padding-bottom: 0; border-left-color: transparent; }
.return-event-content > header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; line-height: 1.5; }
.return-event-type { font-size: 13px; overflow-wrap: anywhere; }
.return-event-editable-heading { padding-right: 84px; min-height: 20px; }
.return-classification-editor { min-width: 0; }
.return-classification-editor > summary { position: absolute; top: 0; right: 0; cursor: pointer; color: var(--color-primary); font-size: 12px; line-height: 1.5; white-space: nowrap; }
.return-classification-editor > form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; padding: 10px; margin-top: 6px; border: 1px solid var(--color-border); border-radius: 6px; background: var(--color-surface); }
.return-classification-editor .field { flex: 1 1 160px; min-width: 0; margin: 0; font-size: 12px; }
.return-classification-editor select { min-width: 0; width: 100%; min-height: 34px; font-size: 12px; }
.return-classification-editor button { min-height: 34px; }
.return-classification-editor p { flex-basis: 100%; margin: 0; color: var(--color-text-secondary); font-size: 12px; }
.return-event-flow { color: var(--color-text-secondary); font-size: 12px; }
.return-event-flow > span { color: var(--color-danger); margin: 0 5px; }
.return-event-child { display: block; font-size: 12px; margin-top: 8px; overflow-wrap: anywhere; color: var(--color-primary); }
.return-event-reason { margin: 9px 0 7px; font-size: 13px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.return-event-reason > span { color: var(--color-text-secondary); margin-right: 10px; font-size: 12px; }
.return-event-content > footer { color: var(--color-text-secondary); font-size: 12px; }
.return-order-pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-top: 1px solid var(--color-divider); color: var(--color-text-secondary); font-size: 12px; }
.return-order-pagination > div { display: flex; align-items: center; gap: 12px; }
.return-order-pagination [aria-disabled=true] { opacity: .45; }
@media (max-width: 1100px) {
  .return-order-summary { grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; }
}
@media (max-width: 640px) {
  #return-type-details > .stats-section-header { flex-direction: column; align-items: flex-start; gap: 6px; }
  #return-type-details > .stats-section-header > span { color: var(--color-text-secondary); font-size: 12px; }
  .return-order-filters .return-order-search { min-width: 0; max-width: none; flex-basis: 100%; }
  .return-order-list { padding: 0 12px 12px; }
  .return-order-summary { padding: 14px; grid-template-columns: minmax(0, 1fr) auto; }
  .return-order-identity { grid-column: 1 / -1; }
  .return-order-metrics { grid-row: 2; text-align: left; }
  .return-order-toggle { grid-row: 2; }
  .return-stat-columns .return-order-summary { grid-template-columns: minmax(0, 1fr) auto; padding: 10px 12px; gap: 8px 12px; }
  .return-order-history { padding: 14px; }
  .return-order-event { grid-template-columns: minmax(0, 1fr); gap: 8px; padding-bottom: 22px; }
  .return-order-event:last-child { padding-bottom: 0; }
  .return-event-time { flex-direction: row; flex-wrap: wrap; padding: 0; gap: 6px 12px; }
  .return-event-content { padding-bottom: 0; }
  .return-order-pagination { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .return-field-row { grid-template-columns: minmax(0, 1fr); }
}
.stage-action-fields .field > span,
.stage-action-fields .field > legend {
  display: block;
  margin-bottom: 6px;
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 650;
}
.stage-action-fields .field em {
  color: var(--color-danger);
  font-style: normal;
}
.stage-action-fields input[type="text"],
.stage-action-fields input:not([type]),
.stage-action-fields select,
.stage-action-fields textarea {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--theme-surface, white);
}
.stage-action-fields textarea { min-height: 88px; resize: vertical; }
.stage-action-fields textarea.is-invalid,
.field textarea.is-invalid,
.field input.is-invalid {
  border-color: #f87171;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .12);
}
.field > span em[data-fitting-required-mark] {
  color: var(--color-danger);
  font-style: normal;
}
.stage-action-fields .fieldset-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 0;
  padding: 0;
  margin: 0;
}
.stage-action-fields .choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* 试版 / 决策结果：双卡片选择 */
.outcome-choice-field {
  margin: 0;
  border: 0;
  padding: 0;
}
.outcome-choice-field > legend {
  display: block;
  margin-bottom: 8px;
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 650;
}
.outcome-choice-field > legend em {
  color: var(--color-danger);
  font-style: normal;
}
.outcome-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.outcome-choice {
  position: relative;
  min-width: 0;
  cursor: pointer;
}
.outcome-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.outcome-choice-body {
  position: relative;
  min-height: 88px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px 16px 14px 14px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--theme-surface, white);
  box-shadow: var(--shadow-soft);
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}
.outcome-choice-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--theme-text-secondary, #64748b);
  background: var(--theme-surface-muted, #f1f5f9);
  transition: color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}
.outcome-choice-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}
.outcome-choice-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.outcome-choice-copy strong {
  font-size: 15px;
  line-height: 1.25;
  font-weight: 700;
}
.outcome-choice-copy small {
  color: var(--color-text-secondary);
  font-size: 12px;
  line-height: 1.4;
}
.outcome-choice-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--theme-border, #cbd5e1);
  border-radius: 50%;
  background: var(--theme-surface, white);
  transition: border-color 150ms ease, background-color 150ms ease;
}
.outcome-choice-check::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  opacity: 0;
  transform: rotate(45deg);
}
.outcome-choice:hover .outcome-choice-body {
  border-color: var(--theme-border, #cbd5e1);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, .06);
}
.outcome-choice input:focus-visible + .outcome-choice-body {
  outline: 3px solid rgba(37, 99, 235, .2);
  outline-offset: 2px;
}
.outcome-choice:has(input:checked) .outcome-choice-check {
  border-color: currentColor;
  background: currentColor;
}
.outcome-choice:has(input:checked) .outcome-choice-check::after {
  opacity: 1;
}

/* 通过：绿色 */
.outcome-choice-pass:hover .outcome-choice-body {
  border-color: var(--theme-green-border, #86efac);
  background: var(--theme-green-soft, #f8fff9);
}
.outcome-choice-pass:has(input:checked) {
  color: var(--color-success);
}
.outcome-choice-pass:has(input:checked) .outcome-choice-body {
  border-color: #22c55e;
  background: var(--color-success-soft);
  box-shadow: inset 0 0 0 1px #22c55e, 0 6px 18px rgba(21, 128, 61, .08);
}
.outcome-choice-pass:has(input:checked) .outcome-choice-icon {
  color: white;
  background: var(--color-success);
  box-shadow: 0 4px 10px rgba(21, 128, 61, .22);
}
.outcome-choice-pass:has(input:checked) .outcome-choice-copy strong {
  color: var(--theme-green-text, #166534);
}
.outcome-choice-pass:has(input:checked) .outcome-choice-copy small {
  color: var(--theme-green-text, #3f7a4f);
}

/* 改版：琥珀色 */
.outcome-choice-rework:hover .outcome-choice-body {
  border-color: #fcd34d;
  background: var(--theme-amber-soft, #fffdf5);
}
.outcome-choice-rework:has(input:checked) {
  color: var(--theme-amber-text, #d97706);
}
.outcome-choice-rework:has(input:checked) .outcome-choice-body {
  border-color: #f59e0b;
  background: var(--color-warning-soft);
  box-shadow: inset 0 0 0 1px #f59e0b, 0 6px 18px rgba(217, 119, 6, .08);
}
.outcome-choice-rework:has(input:checked) .outcome-choice-icon {
  color: white;
  background: #d97706;
  box-shadow: 0 4px 10px rgba(217, 119, 6, .22);
}
.outcome-choice-rework:has(input:checked) .outcome-choice-copy strong {
  color: var(--theme-amber-text, #b45309);
}
.outcome-choice-rework:has(input:checked) .outcome-choice-copy small {
  color: var(--theme-amber-text, #a16207);
}

/* 不合格退回：红色 */
.outcome-choice-return:hover .outcome-choice-body {
  border-color: var(--theme-red-border, #fca5a5);
  background: var(--theme-red-soft, #fff8f8);
}
.outcome-choice-return:has(input:checked) {
  color: var(--color-danger);
}
.outcome-choice-return:has(input:checked) .outcome-choice-body {
  border-color: #ef4444;
  background: var(--color-danger-soft, #fef2f2);
  box-shadow: inset 0 0 0 1px #ef4444, 0 6px 18px rgba(220, 38, 38, .08);
}
.outcome-choice-return:has(input:checked) .outcome-choice-icon {
  color: white;
  background: var(--color-danger, #dc2626);
  box-shadow: 0 4px 10px rgba(220, 38, 38, .22);
}
.outcome-choice-return:has(input:checked) .outcome-choice-copy strong {
  color: var(--theme-red-text, #b91c1c);
}
.outcome-choice-return:has(input:checked) .outcome-choice-copy small {
  color: var(--theme-red-text, #9f1239);
}

.stage-action-fields .outcome-choice-field {
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--theme-surface-muted, #fafbfc);
}
.stage-action-fields .stage-mode-switch {
  padding: 0 0 14px;
  border: 0;
  border-bottom: 1px solid var(--color-divider);
  border-radius: 0;
  background: transparent;
}
.stage-mode-switch .outcome-choice-grid { gap: 8px; }
.stage-mode-switch .outcome-choice-body {
  min-height: 72px;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  padding: 11px 42px 11px 13px;
  border-radius: 8px;
  box-shadow: none;
}
.stage-mode-switch .outcome-choice-copy strong { font-size: 14px; }
.stage-mode-switch .outcome-choice-copy small { font-size: 11px; }
.stage-action-fields .outcome-choice-field > legend {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
}
.stage-action-dialog.is-review {
  width: min(640px, calc(100vw - 24px));
  max-height: min(92dvh, 860px);
}
.stage-action-dialog.is-review .outcome-choice-body {
  min-height: 96px;
}
.stage-action-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
  padding: 12px 18px;
  border-top: 1px solid var(--color-border);
  background: var(--theme-surface, white);
}
.stage-action-dialog.is-assign .stage-action-footer {
  padding: 12px 22px;
}
.stage-footer-hint {
  color: var(--color-text-secondary);
  font-size: 12px;
}
.stage-footer-assignee {
  flex: 1 1 380px;
  min-width: 280px;
  max-width: 440px;
}
.stage-footer-assignee-field {
  display: grid;
  gap: 4px;
  margin: 0;
}
.stage-footer-assignee-field > span {
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 700;
}
.stage-footer-assignee-field > span small,
.fitting-assignee-field > span small {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-left: 5px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--theme-blue-soft, #dbeafe);
  color: var(--theme-blue-text, #1d4ed8);
  font-size: 10px;
  font-weight: 700;
}
.fitting-assignee-field {
  position: relative;
  padding: 10px;
  border: 1px solid var(--theme-blue-border, #93c5fd);
  border-radius: 7px;
  background: var(--theme-blue-soft, #eff6ff);
}
.person-combobox { position: relative; min-width: 0; }
.person-search-control { position: relative; }
.person-search-control > svg {
  position: absolute;
  left: 11px;
  top: 50%;
  width: 16px;
  height: 16px;
  color: var(--theme-text-secondary, #64748b);
  transform: translateY(-50%);
  pointer-events: none;
}
.person-search-control > input {
  width: 100%;
  min-height: 42px;
  padding: 8px 38px 8px 36px;
  border: 1px solid #60a5fa;
  border-radius: 6px;
  background: var(--theme-surface, white);
  color: var(--color-text);
  font: inherit;
}
.person-search-control > input:focus {
  border-color: var(--color-primary);
  outline: 3px solid rgba(37, 99, 235, .14);
}
.person-search-control > button {
  position: absolute;
  right: 5px;
  top: 50%;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--theme-text-secondary, #64748b);
  font-size: 18px;
  cursor: pointer;
  transform: translateY(-50%);
}
.person-combobox:not(.has-selection) .person-search-control > button { opacity: .55; }
.person-options {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 5px);
  z-index: 120;
  max-height: 250px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--theme-blue-border, #93c5fd);
  border-radius: 6px;
  background: var(--theme-surface, white);
  box-shadow: 0 16px 38px rgba(15, 23, 42, .2);
}
.person-options > button {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--color-text);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.person-options > button:hover,
.person-options > button:focus-visible { background: var(--theme-blue-soft, #eff6ff); color: var(--theme-blue-text, #1d4ed8); }
.person-options > button small { color: var(--color-text-secondary); font-size: 11px; }
.person-options-empty { padding: 10px; color: var(--color-text-secondary); font-size: 12px; }
.stage-footer-assignee .person-options {
  top: auto;
  bottom: calc(100% + 5px);
}
.fitting-assignee-hint {
  display: block;
  margin-top: 5px;
  color: var(--theme-blue-text, #1e40af);
  font-size: 11px;
  line-height: 1.4;
}
.stage-footer-actions {
  display: flex;
  gap: 9px;
  margin-left: auto;
}
.stage-action-footer .button {
  min-width: 96px;
  white-space: nowrap;
}
.stage-action-dialog.is-production-complete .stage-action-footer .button-primary,
.stage-action-dialog.is-data-entry-complete .stage-action-footer .button-primary {
  min-width: 132px;
}

.assign-modal-layout {
  display: grid;
  gap: 14px;
}
.assign-modal-section,
.assign-section {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--theme-surface, white);
  box-shadow: none;
}
.assign-modal-section > header,
.assign-section > header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0;
}
.assign-modal-section > header h3,
.assign-section > header h2 {
  margin: 0 0 3px;
  font-size: 16px;
}
.assign-modal-section > header p,
.assign-section > header p {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 12px;
  line-height: 1.5;
}
.assign-section-hint {
  margin: 4px 0 0;
  color: var(--color-text-secondary);
  font-size: 12px;
}
.assign-modal-grid,
.assign-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}
/* 版师下拉与备注输入保持相同高度（全局控件高度 42px） */
.assign-maker-note-row select,
.assign-maker-note-row input[name="note"] {
  width: 100%;
  min-height: 42px;
  height: 42px;
  box-sizing: border-box;
  padding-top: 9px;
  padding-bottom: 9px;
  line-height: 1.35;
  resize: none;
}
.assign-modal-section .field > span,
.assign-section .field > span {
  display: block;
  margin-bottom: 6px;
  color: var(--theme-text, #374151);
  font-size: 13px;
  font-weight: 650;
}
.assign-modal-section .field em,
.assign-section .field em {
  color: var(--color-danger);
  font-style: normal;
}
.assign-sublabel {
  margin: 0 0 8px;
  color: var(--theme-text, #374151);
  font-size: 13px;
  font-weight: 650;
}
.assign-purchase-block {
  display: grid;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid var(--color-divider);
}
.assign-toggle-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}
.assign-toggle-card {
  position: relative;
  min-width: 0;
  cursor: pointer;
}
.assign-toggle-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.assign-toggle-card > span {
  min-height: 64px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--theme-surface-muted, #fafbfc);
  transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease, color 140ms ease;
}
.assign-toggle-card strong {
  font-size: 14px;
}
.assign-toggle-card small {
  color: var(--color-text-secondary);
  font-size: 12px;
}
.assign-toggle-card:hover > span {
  border-color: var(--theme-blue-border, #bfdbfe);
  background: var(--theme-surface-muted, #f8fbff);
}
.assign-toggle-card:has(input:checked) > span {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  box-shadow: inset 0 0 0 1px var(--color-primary);
}
.assign-toggle-card:has(input:checked) strong {
  color: var(--color-primary);
}
.assign-toggle-card input:focus-visible + span {
  outline: 3px solid rgba(37, 99, 235, .2);
  outline-offset: 2px;
}
.assign-purchaser-field,
.assign-worker-field {
  animation: assign-field-in 160ms ease-out;
}
@keyframes assign-field-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.craft-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.craft-picker-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.craft-card {
  position: relative;
  min-width: 0;
  cursor: pointer;
}
.craft-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.craft-card-body {
  position: relative;
  min-height: 108px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  padding: 14px 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--theme-surface-muted, #fafbfc);
  text-align: center;
  transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}
.craft-card-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  border-radius: 10px;
  color: var(--theme-text-secondary, #64748b);
  background: #eef2f7;
  font-style: normal;
  font-size: 13px;
  font-weight: 800;
}
.craft-card strong {
  font-size: 14px;
  line-height: 1.2;
}
.craft-card small {
  color: var(--color-text-secondary);
  font-size: 11px;
  line-height: 1.35;
}
.craft-card-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--theme-border, #cbd5e1);
  border-radius: 50%;
  background: var(--theme-surface, white);
  transition: border-color 140ms ease, background-color 140ms ease;
}
.craft-card-check::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  opacity: 0;
  transform: rotate(45deg);
}
.craft-card:hover .craft-card-body {
  border-color: var(--theme-blue-border, #bfdbfe);
  background: var(--theme-surface-muted, #f8fbff);
  transform: translateY(-1px);
}
.craft-card:has(input:checked) .craft-card-body {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  box-shadow: inset 0 0 0 1px var(--color-primary);
}
.craft-card:has(input:checked) .craft-card-mark {
  color: white;
  background: var(--color-primary);
}
.craft-card:has(input:checked) strong {
  color: var(--color-primary);
}
.craft-card:has(input:checked) .craft-card-check {
  border-color: var(--color-primary);
  background: var(--color-primary);
}
.craft-card:has(input:checked) .craft-card-check::after {
  opacity: 1;
}
.craft-card input:focus-visible + .craft-card-body {
  outline: 3px solid rgba(37, 99, 235, .2);
  outline-offset: 2px;
}
.craft-card-none:has(input:checked) .craft-card-body {
  border-color: var(--theme-border, #94a3b8);
  background: var(--theme-surface-muted, #f1f5f9);
  box-shadow: inset 0 0 0 1px var(--theme-border, #94a3b8);
}
.craft-card-none:has(input:checked) .craft-card-mark {
  color: var(--theme-text, #334155);
  background: var(--theme-surface-muted, #cbd5e1);
}
.craft-card-none:has(input:checked) strong {
  color: var(--theme-text, #334155);
}
.craft-card-none:has(input:checked) .craft-card-check {
  border-color: #64748b;
  background: #64748b;
}
.craft-card-print:has(input:checked) .craft-card-mark { background: #2563eb; }
.craft-card-embroidery:has(input:checked) .craft-card-mark { background: #7c3aed; }
.craft-card-heat_transfer:has(input:checked) .craft-card-mark { background: #ea580c; }
.craft-card-embroidery:has(input:checked) .craft-card-body {
  border-color: #7c3aed;
  background: var(--theme-purple-soft, #f5f3ff);
  box-shadow: inset 0 0 0 1px #7c3aed;
}
.craft-card-embroidery:has(input:checked) strong { color: var(--theme-purple-text, #6d28d9); }
.craft-card-embroidery:has(input:checked) .craft-card-check {
  border-color: #7c3aed;
  background: #7c3aed;
}
.craft-card-heat_transfer:has(input:checked) .craft-card-body {
  border-color: #ea580c;
  background: var(--theme-amber-soft, #fff7ed);
  box-shadow: inset 0 0 0 1px #ea580c;
}
.craft-card-heat_transfer:has(input:checked) strong { color: var(--theme-amber-text, #c2410c); }
.craft-card-heat_transfer:has(input:checked) .craft-card-check {
  border-color: #ea580c;
  background: #ea580c;
}

.craft-summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 10px 13px;
  border: 1px solid var(--theme-border, #e2e8f0);
  border-radius: 10px;
  background: var(--theme-surface-muted, #f8fafc);
  color: var(--color-text-secondary);
  font-size: 12px;
}
.craft-summary strong {
  color: var(--color-text);
  font-size: 13px;
}
.craft-summary em {
  margin-left: auto;
  color: var(--color-text-weak);
  font-style: normal;
  font-size: 11px;
}

.assign-form {
  max-width: 860px;
  overflow: hidden;
}
.assign-form .task-section {
  margin: 0;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  box-shadow: none;
}
.assign-form .task-section + .task-section {
  border-top: 1px solid var(--color-divider);
}
.assign-form-actions {
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  background: var(--theme-surface-muted, #fafbfc);
}
.assign-form-actions > div {
  display: flex;
  gap: 10px;
}

@media (max-width: 700px) {
  .assign-modal-grid,
  .assign-grid,
  .assign-toggle-group,
  .outcome-choice-grid { grid-template-columns: 1fr; }
  .craft-picker-cards { grid-template-columns: 1fr 1fr; }
  .stage-action-dialog.is-assign { width: calc(100vw - 12px); }
  .stage-action-dialog.is-production-complete,
  .stage-action-dialog.is-data-entry-complete { width: calc(100vw - 12px); }
  .stage-action-dialog.is-assign .stage-action-body,
  .stage-action-dialog.is-assign .stage-action-footer,
  .stage-action-header { padding-left: 14px; padding-right: 14px; }
  .assign-modal-section { padding: 14px; }
  .craft-summary em { margin-left: 0; width: 100%; }
  .assign-form-actions { flex-direction: column; align-items: stretch; gap: 10px; }
  .assign-form-actions > div { width: 100%; }
  .assign-form-actions .button { flex: 1; }
  .stage-action-footer { flex-wrap: wrap; }
  .stage-footer-assignee { flex-basis: 100%; width: 100%; min-width: 0; }
  .stage-footer-actions { width: 100%; }
  .stage-footer-actions .button { flex: 1; }
  .stage-completion-layout { grid-template-columns: 1fr; }
  .stage-reference-compact { position: static; }
  .stage-mode-switch .outcome-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage-mode-switch .outcome-choice-body { min-height: 74px; padding: 10px 32px 10px 11px; }
  .stage-mode-switch .outcome-choice-check { top: 8px; right: 8px; }
}

@media (max-width: 1180px) {
  .progress-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .progress-controls .progress-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .order-progress-card {
    --order-left-column: 128px;
    --order-right-column: 250px;
    grid-template-columns: var(--order-left-column) minmax(0, 1fr) var(--order-right-column);
  }
  .order-progress-card-compact { grid-template-columns: minmax(0, 1fr) 200px; }
  .order-process-track { min-width: calc(var(--process-node-count, 11) * 68px); }
}

@media (max-width: 860px) {
  .progress-heading-actions { flex-wrap: wrap; justify-content: flex-end; }
  .progress-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .progress-controls .progress-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .progress-metric.metric-total { grid-column: 1 / -1; }
  .progress-metric { min-height: 112px; }
}

@media (max-width: 700px) {
  .progress-heading { gap: 14px; }.progress-heading-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }.progress-pause-filter { grid-column: 1 / -1; }.progress-pause-option { width: 100%; justify-content: center; }.progress-heading-actions .button:only-child { grid-column: 1 / -1; }
  .progress-metrics { gap: 8px; margin-left: -4px; margin-right: -4px; }.progress-metric { min-height: 108px; padding: 14px 13px 12px; }.progress-metric strong { font-size: 26px; }.progress-metric small { font-size: 10px; }
  .progress-board-panel { margin-left: -16px; margin-right: -16px; border-left: 0; border-right: 0; border-radius: 0; }
  .progress-section-header { min-height: 70px; align-items: flex-start; padding: 14px 16px; }.progress-section-header > p { max-width: 145px; text-align: right; }
  .order-progress-list { gap: 10px; padding: 10px; }
}

/* Publish task modal */
[hidden] { display: none !important; }
.user-create-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: min(92dvh, 860px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  color: var(--color-text);
  background: var(--theme-surface, white);
  box-shadow: 0 28px 90px rgba(15, 23, 42, .28);
}
.user-create-dialog::backdrop { background: rgba(15, 23, 42, .58); backdrop-filter: blur(2px); }
.user-create-dialog > form {
  max-height: min(92dvh, 860px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.user-create-dialog .publish-dialog-body { overflow: auto; padding: 18px 22px 20px; }
.field-hint {
  display: block;
  margin-top: 4px;
  color: var(--color-text-secondary);
  font-size: 12px;
  line-height: 1.4;
}
.publish-task-dialog { width: min(1120px, calc(100vw - 32px)); max-width: none; max-height: min(92dvh, 900px); padding: 0; overflow: hidden; border: 0; border-radius: 12px; color: var(--color-text); background: var(--theme-surface, white); box-shadow: 0 28px 90px rgba(15, 23, 42, .28); }
.publish-task-dialog::backdrop { background: rgba(15, 23, 42, .58); backdrop-filter: blur(2px); }
.publish-task-dialog > form { max-height: min(92dvh, 900px); display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; }
.publish-dialog-header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 22px; border-bottom: 1px solid var(--color-divider); }
.publish-dialog-header h2 { margin: 1px 0 0; font-size: 20px; }
.publish-type-tabs { display: grid; grid-template-columns: 1fr 1fr; margin: 0; padding: 12px 22px; border: 0; border-bottom: 1px solid var(--color-divider); background: var(--theme-surface-muted, #fafbfc); }
.publish-type-tabs label { position: relative; min-width: 0; cursor: pointer; }
.publish-type-tabs input { position: absolute; opacity: 0; pointer-events: none; }
.publish-type-tabs label span { min-height: 54px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 16px; border: 1px solid var(--color-border); color: var(--color-text-secondary); background: var(--theme-surface, white); }
.publish-type-tabs label:first-of-type span { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.publish-type-tabs label:last-of-type span { margin-left: -1px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.publish-type-tabs label small { font-size: 11px; }
.publish-type-tabs input:checked + span { position: relative; z-index: 1; border-color: var(--color-primary); color: var(--color-primary); background: var(--color-primary-soft); box-shadow: inset 0 0 0 1px var(--color-primary); }
.publish-type-tabs input:focus-visible + span { outline: 3px solid rgba(37, 99, 235, .2); outline-offset: 2px; }
.publish-dialog-body { min-height: 0; overflow-y: auto; padding: 18px 22px 22px; background: var(--theme-surface-muted, #f7f9fc); }
.publish-dialog-body .task-create-layout { grid-template-columns: minmax(0, 1.12fr) minmax(340px, .88fr); align-items: stretch; gap: 14px; }
.publish-dialog-body .task-form-column, .publish-dialog-body .task-upload-column { gap: 12px; }
.publish-task-dialog .task-form-column,
.publish-task-dialog .task-upload-column { align-self: stretch; }
.publish-task-dialog .task-form-column > .task-section { height: 100%; }
.publish-task-dialog .task-upload-column {
  grid-template-rows: repeat(2, minmax(0, 1fr));
  align-content: stretch;
}
.publish-task-dialog .task-upload-column > .upload-section {
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.publish-task-dialog .task-upload-column .upload-dropzone {
  flex: 1 1 auto;
}
.publish-dialog-body .publish-suborder-section,
.publish-dialog-body .publish-image-summary { grid-column: 1 / -1; }
.publish-dialog-body .task-section { padding: 18px; box-shadow: none; }
.publish-dialog-body .task-section > header { margin-bottom: 16px; }
.publish-dialog-body .task-section > header h3 { margin: 0 0 2px; font-size: 15px; }
.publish-dialog-body .task-section > header p { margin: 0; color: var(--color-text-secondary); font-size: 12px; }
.publish-dialog-body .form-grid { gap: 13px 14px; }
.publish-dialog-body textarea { min-height: 108px; }
.publish-dialog-error { margin-bottom: 14px; }
.publish-image-section .upload-dropzone { min-height: 78px; }
.publish-image-section .upload-list:empty { display: none; }
.publish-image-summary { min-height: 42px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; padding: 9px 13px; border: 1px solid var(--theme-blue-border, #bfdbfe); border-radius: var(--radius-sm); color: var(--color-text-secondary); background: var(--color-primary-soft); font-size: 12px; }
.publish-image-summary b { color: var(--color-text); }
.publish-dialog-actions { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 22px; border-top: 1px solid var(--color-border); background: var(--theme-surface, white); }
.publish-dialog-actions > span { color: var(--color-text-secondary); font-size: 12px; }
.publish-dialog-actions > div { display: flex; gap: 9px; }

/* Compact progress filters and split order cards */
.progress-search-bar, .task-search-bar { margin-bottom: 12px; padding: 12px 14px; }
.progress-metrics { gap: 9px; margin-bottom: 14px; }
.progress-metric { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 15px; border-radius: 7px; }
.progress-metric::after { width: 42px; height: 42px; right: -22px; bottom: -24px; }
.progress-metric > span { position: relative; z-index: 1; font-size: 12px; }
.progress-metric strong { margin: 0; font-size: 23px; }
.progress-metric small { display: none; }
.progress-metric:hover { border-color: var(--theme-blue-border, #bfdbfe); background: var(--theme-surface-muted, #fbfdff); }
.progress-metric.is-active { border-color: var(--color-primary); background: var(--color-primary-soft); box-shadow: inset 0 0 0 1px var(--color-primary); }
.progress-metric.metric-urgent > span i { background: var(--color-danger); }
.progress-metric.metric-urgent::after { background: var(--color-danger-soft); }
.status-tag-urgent { color: var(--theme-red-text, #b91c1c); background: var(--color-danger-soft); }
.status-tag-urgent i { background: var(--color-danger); }

/* Three-column order progress card */
.order-card-left {
  min-width: 0;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 10px 8px;
  border-right: 1px solid var(--color-divider);
}
.order-card-head {
  min-width: 0;
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 7px;
}
.order-card-media {
  position: relative;
  width: 96px;
  height: 96px;
}
.order-main-thumb {
  position: relative;
  width: 96px;
  height: 96px;
  display: block;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--theme-surface-muted, #f3f4f6);
  cursor: zoom-in;
}
.order-main-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; }
.order-main-thumb > span {
  position: absolute;
  right: 5px;
  bottom: 5px;
  padding: 2px 6px;
  border-radius: 999px;
  color: white;
  background: rgba(17, 24, 39, .78);
  font-size: 10px;
  line-height: 1.2;
}
.order-image-placeholder {
  display: grid;
  place-items: center;
  color: var(--color-text-weak);
  cursor: default;
  background: var(--theme-surface-muted, #f8fafc);
}
.order-image-placeholder span { font-size: 12px; }
.order-card-head-meta {
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.order-card-head-meta > .status-tag {
  min-height: 20px;
  padding: 1px 5px;
  font-size: 10px;
  white-space: nowrap;
}
.order-task-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid var(--theme-blue-border, #bfdbfe);
  border-radius: 5px;
  color: var(--color-primary);
  background: var(--color-primary-soft);
  line-height: 1.4;
  white-space: nowrap;
}
.order-marker-tag { max-width: 100%; padding: 3px 5px; }
.order-card-overview > .order-marker-tag { flex: 0 0 auto; align-self: center; }
.order-mobile-sample-no .order-marker-tag { flex: 0 0 auto; padding: 0; border: 0; background: transparent; }
.order-mobile-sample-no .order-marker-tag > strong { display: inline-flex; align-items: center; gap: 2px; line-height: 1; }
.order-mobile-sample-no .order-marker-tag .deadline-edit-button { height: 15px; font-size: 11px; line-height: 1; }
.order-task-type > span { font-size: 9px; opacity: .8; }
.order-task-type > strong { font-size: 11px; font-weight: 650; }
.order-task-type.is-repeat_sample {
  color: var(--theme-purple-text, #6d28d9);
  border-color: var(--theme-purple-border, #ddd6fe);
  background: var(--theme-purple-soft, #f5f3ff);
}
.order-task-type.is-revised_sample {
  color: var(--theme-amber-text, #9a4d08);
  border-color: var(--theme-amber-border, #fde68a);
  background: var(--theme-amber-soft, #fffbeb);
}
.order-head-fact {
  min-width: 0;
  margin: 0;
}
.order-head-fact > div {
  min-width: 0;
  min-height: 20px;
  display: flex;
  align-items: baseline;
  gap: 2px;
  padding: 2px;
  border-radius: 5px;
  background: var(--theme-surface-muted, #f8fafc);
}
.order-head-fact dt {
  color: var(--color-text-weak);
  font-size: 9px;
  line-height: 1.2;
  white-space: nowrap;
}
.order-head-fact dd {
  margin: 0;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.order-card-overview {
  min-width: 0;
  display: flex;
  align-items: stretch;
  gap: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--color-divider);
}
.order-card-facts {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(0, .7fr) minmax(0, .8fr) minmax(0, .8fr) minmax(0, .7fr) minmax(0, 2.65fr);
  gap: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--theme-border, #eef2f7);
  border-radius: 6px;
  background: var(--theme-surface-muted, #f8fafc);
}
.order-card-facts.has-cost {
  grid-template-columns: minmax(0, .7fr) minmax(0, .8fr) minmax(0, .8fr) minmax(0, .7fr) minmax(0, 1.95fr) minmax(0, .9fr);
}
.order-card-facts.has-internal-no {
  grid-template-columns: minmax(0, .7fr) minmax(0, .7fr) minmax(0, .8fr) minmax(0, .8fr) minmax(0, .7fr) minmax(0, 1.95fr);
}
.order-card-facts.has-internal-no.has-cost {
  grid-template-columns: minmax(0, .7fr) minmax(0, .7fr) minmax(0, .8fr) minmax(0, .8fr) minmax(0, .7fr) minmax(0, 1.25fr) minmax(0, .9fr);
}
.order-card-facts > div {
  min-width: 0;
  min-height: 40px;
  padding: 4px 8px;
  border-right: 1px solid #e8edf3;
}
.order-card-facts > div:last-child { border-right: 0; }
.order-card-facts > .order-fact-full { grid-column: auto; }
.order-card-facts > .order-carrier-fact:last-child { grid-column: 4 / -1; }
.order-card-facts.has-internal-no > .order-carrier-fact:last-child { grid-column: 5 / -1; }
.order-card-facts dt,
.order-card-status-facts dt {
  color: var(--color-text-weak);
  font-size: 9px;
  line-height: 1.2;
}
.order-card-facts dt {
  min-height: 18px;
  display: flex;
  align-items: center;
}
.order-card-facts dd {
  min-width: 0;
  margin: 3px 0 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.order-card-facts .order-sample-link {
  color: inherit;
  font-weight: 650;
}
.order-card-facts .order-sample-link:hover { color: var(--color-primary); }
.order-sample-fact dt {
  display: flex;
  align-items: center;
  gap: 4px;
}
.order-deadline-fact dt {
  display: flex;
  align-items: center;
  gap: 4px;
}
.order-owner-fact dt {
  display: flex;
  align-items: center;
  gap: 4px;
}
.order-owner-fact dd {
  display: flex;
  align-items: center;
  gap: 5px;
}
.order-owner-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.owner-reassign-tag {
  min-height: 18px;
  flex: 0 0 auto;
  padding: 1px 5px;
  border: 1px solid var(--theme-blue-border, #93c5fd);
  border-radius: 4px;
  background: var(--theme-blue-soft, #eff6ff);
  color: var(--color-primary);
  font: inherit;
  font-size: 9px;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
}
.owner-reassign-tag:hover,
.owner-reassign-tag:focus-visible {
  border-color: var(--color-primary);
  background: var(--theme-blue-soft, #dbeafe);
}
.order-cost-fact dt { gap: 4px; }
.price-range-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}
.price-range-inputs > span {
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 650;
}
.price-range-inputs input { min-width: 0; }
.price-range-field > span,
.price-range-field > label { color: var(--theme-text, #374151); font-size: 13px; font-weight: 650; }
.price-range-field > span em,
.price-range-field > label span { color: var(--color-danger); font-style: normal; }
.deadline-edit-button {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--theme-blue-border, #bfdbfe);
  border-radius: 5px;
  background: var(--theme-blue-soft, #eff6ff);
  color: var(--color-primary);
  cursor: pointer;
}
.deadline-edit-button:hover,
.deadline-edit-button:focus-visible {
  border-color: var(--color-primary);
  background: var(--theme-blue-soft, #dbeafe);
}
.deadline-edit-button svg { width: 13px; height: 13px; }
.deadline-edit-button.order-main-edit {
  position: absolute;
  top: -5px;
  right: -5px;
  z-index: 1;
  width: 24px;
  height: 24px;
  background: var(--color-surface);
  box-shadow: 0 1px 4px rgba(15, 23, 42, .12);
}
.order-craft-fact dt {
  justify-content: space-between;
  gap: 4px;
}
.craft-detail-button {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--theme-border, #dbe4ee);
  border-radius: 5px;
  background: var(--theme-surface, white);
  color: var(--color-text-secondary);
  cursor: pointer;
}
.craft-detail-button:hover,
.craft-detail-button:focus-visible {
  border-color: var(--theme-blue-border, #93c5fd);
  background: var(--theme-blue-soft, #eff6ff);
  color: var(--color-primary);
}
.craft-detail-button svg { width: 12px; height: 12px; }
.order-card-workflow {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  align-content: start;
  gap: 6px;
  padding: 8px;
  overflow: hidden;
}
.order-card-workflow .order-process-scroll {
  min-width: 0;
  max-width: 100%;
  display: grid;
  align-content: end;
  overflow-x: auto;
  overflow-y: hidden;
  background: transparent;
}
.order-return-slot {
  min-width: 0;
  min-height: 40px;
  display: grid;
}
.order-return-summary-placeholder { min-height: 40px; }

.order-card-right {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 8px 10px;
  border-left: 1px solid var(--color-divider);
  background: var(--theme-surface-muted, #fafbfc);
}
.order-right-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.order-acceptance-verification {
  min-width: 0;
  display: flex;
  align-items: center;
  margin-left: auto;
}
.order-acceptance-verification-copy {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}
.order-acceptance-verification-badge {
  max-width: 100%;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.3;
  white-space: nowrap;
}
.order-acceptance-verification-badge i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  display: inline-block;
  border-radius: 50%;
  background: currentColor;
}
.order-acceptance-verification-badge.is-verified {
  position: relative;
  z-index: 30;
  color: var(--color-success);
  border-color: var(--theme-green-border, #bbf7d0);
  background: var(--color-success-soft);
  cursor: help;
}
.order-acceptance-verification-badge.is-verified::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  z-index: 40;
  width: max-content;
  max-width: 260px;
  padding: 7px 9px;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #f8fafc;
  background: rgba(15, 23, 42, .96);
  box-shadow: 0 8px 18px rgba(15, 23, 42, .2);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.order-acceptance-verification-badge.is-verified:hover::after,
.order-acceptance-verification-badge.is-verified:focus-visible::after {
  opacity: 1;
  visibility: visible;
}
.order-acceptance-verification-hint {
  min-width: 0;
  max-width: 180px;
  overflow: hidden;
  color: var(--color-text-secondary);
  font-size: 9px;
  font-weight: 500;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.order-acceptance-verification-hint { color: var(--theme-amber-text, #9a4d08); }
.order-acceptance-verification form { display: flex; }
.order-acceptance-verification .button {
  min-height: 26px;
  padding: 3px 8px;
  font-size: 10px;
  white-space: nowrap;
}
.order-mobile-sample-no .order-acceptance-verification { display: none; }
.order-suborder-toggle-row {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
}
.order-suborder-toggle-row .button {
  max-width: 100%;
  min-height: 40px;
  padding-left: 9px;
  padding-right: 9px;
  white-space: nowrap;
}
.order-right-badges .status-tag {
  min-height: 26px;
  padding: 2px 9px;
  font-size: 11px;
}
.order-status-badge {
  max-width: 100%;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.order-status-badge.is-pending {
  color: var(--theme-amber-text, #b45309);
  border-color: var(--theme-amber-border, #fde68a);
  background: var(--theme-amber-soft, #fffbeb);
}
.order-status-badge.is-urgent {
  color: var(--theme-red-text, #b91c1c);
  border-color: var(--theme-red-border, #fecaca);
  background: var(--color-danger-soft);
}
.order-status-badge.is-returned {
  color: var(--theme-amber-text, #b45309);
  border-color: #fcd34d;
  background: var(--color-warning-soft);
}
.order-status-badge.is-completed {
  color: var(--color-success);
  border-color: var(--theme-green-border, #bbf7d0);
  background: var(--color-success-soft);
}
.order-card-status-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
}
.order-card-status-facts > div,
.order-card-status-facts > .order-status-pair > div {
  min-width: 0;
  min-height: 36px;
  padding: 5px 6px;
  border-radius: 6px;
  background: var(--theme-surface, white);
  border: 1px solid var(--theme-border, #f1f5f9);
}
.order-card-status-facts > .order-status-pair {
  display: contents;
}
.order-card-status-facts dd {
  min-width: 0;
  margin: 2px 0 0;
  min-height: calc(12px * 1.35); /* 无人名时仍保持与有内容时相同行高 */
  overflow: hidden;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.order-card-status-facts dd:empty::before {
  content: "\00a0"; /* 占位，避免空 dd 被浏览器压扁 */
}
.order-card-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 5px;
  margin-top: 0;
}
.order-card-actions form,
.order-card-actions .button { width: 100%; }
.order-card-actions .button {
  min-height: 30px;
  padding: 4px 7px;
  font-size: 11px;
}
.deadline-copy.deadline-overdue { color: var(--color-danger); }
.deadline-copy.deadline-due_soon { color: var(--theme-amber-text, #9a4d08); }
.deadline-copy.deadline-completed { color: var(--color-success); }
.deadline-copy.deadline-on_track { color: var(--color-text); }

.deadline-edit-dialog {
  width: min(430px, calc(100vw - 24px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--theme-surface, white);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .24);
}
.deadline-edit-dialog::backdrop { background: rgba(15, 23, 42, .5); }
.deadline-edit-dialog > form { display: grid; }
.progress-scroll-sentinel { width: 1px; height: 1px; display: block; pointer-events: none; }
.progress-scroll-toggle {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 45;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--theme-blue-border, #bfdbfe);
  border-radius: 50%;
  color: white;
  background: var(--color-primary);
  box-shadow: 0 10px 28px rgba(37, 99, 235, .28);
  cursor: pointer;
  transition: transform 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}
.progress-scroll-toggle:hover { transform: translateY(-2px); background: var(--color-primary-dark); box-shadow: 0 14px 32px rgba(37, 99, 235, .34); }
.progress-scroll-toggle:focus-visible { outline: 3px solid rgba(37, 99, 235, .25); outline-offset: 3px; }
.progress-scroll-toggle[hidden] { display: none; }
.progress-scroll-toggle svg { width: 22px; height: 22px; transition: transform 160ms ease; }
.progress-scroll-toggle[data-direction="up"] svg { transform: rotate(180deg); }
html.dialog-open .progress-scroll-toggle { opacity: 0; pointer-events: none; }
@keyframes dialog-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(9px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(4px); }
}
.deadline-edit-dialog.is-shaking { animation: dialog-shake 380ms ease-in-out; }
.deadline-edit-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--color-divider);
}
.deadline-edit-header h2 { margin: 2px 0 3px; font-size: 19px; }
.deadline-edit-header [data-deadline-edit-sample] { color: var(--color-text-secondary); font-size: 12px; }
.deadline-edit-body { padding: 20px; background: var(--theme-surface-muted, #f8fafc); }
.dialog-field-error {
  display: block;
  margin-top: 7px;
  color: var(--color-danger);
  font-size: 12px;
  font-weight: 650;
}
.dialog-field-error[hidden] { display: none; }
.deadline-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 12px 20px;
  border-top: 1px solid var(--color-divider);
}

.craft-detail-dialog {
  width: min(640px, calc(100vw - 24px));
  max-height: min(86dvh, 720px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: var(--theme-surface, white);
  color: var(--color-text);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .24);
}
.craft-detail-dialog::backdrop { background: rgba(15, 23, 42, .5); }
.craft-detail-dialog-panel {
  max-height: min(86dvh, 720px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.craft-detail-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--color-divider);
}
.craft-detail-dialog-header > div { min-width: 0; }
.craft-detail-dialog-header h2 {
  margin: 2px 0 0;
  font-size: 19px;
  overflow-wrap: anywhere;
}
.craft-detail-dialog-body {
  min-height: 120px;
  overflow-y: auto;
  padding: 18px 20px;
  background: var(--theme-surface-muted, #f8fafc);
}
.craft-detail-dialog-body p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.7;
}
.craft-detail-dialog-footer {
  display: flex;
  justify-content: flex-end;
  padding: 12px 20px;
  border-top: 1px solid var(--color-divider);
}

@media (max-width: 480px) {
  .craft-detail-dialog-header { padding: 16px 16px 12px; }
  .craft-detail-dialog-header h2 { font-size: 17px; line-height: 1.35; }
  .craft-detail-dialog-body { padding: 16px; }
  .craft-detail-dialog-footer { padding: 10px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .progress-scroll-toggle { transition: none; }
  .progress-scroll-toggle:hover { transform: none; }
  .deadline-edit-dialog.is-shaking {
    animation: none;
    outline: 3px solid rgba(239, 68, 68, .25);
  }
}

@media (max-width: 700px) {
  .progress-scroll-toggle {
    right: 14px;
    bottom: max(14px, env(safe-area-inset-bottom));
    width: 42px;
    height: 42px;
  }
}

@media (max-width: 940px) {
  .publish-dialog-body .task-create-layout { grid-template-columns: 1fr; }
  .publish-dialog-body .publish-image-section { grid-column: 1 / -1; }
  .publish-task-dialog .task-upload-column { grid-template-rows: none; }
  .order-progress-card {
    --order-left-column: 124px;
    --order-right-column: 0px;
    grid-template-columns: var(--order-left-column) minmax(0, 1fr);
  }
  .order-progress-card-compact { grid-template-columns: minmax(0, 1fr) 170px; }
  .order-card-left { padding: 10px 8px; }
  .order-card-right {
    grid-column: 1 / -1;
    grid-template-columns: auto minmax(0, 1fr) minmax(180px, auto);
    align-items: center;
    padding: 8px 10px;
    border-top: 1px solid var(--color-divider);
    border-left: 0;
  }
  .order-card-status-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .order-process-track {
    --node-mark-size: 30px;
    --node-label-space: 30px;
    min-width: calc(var(--process-node-count, 11) * 68px);
  }
  .order-node-label { font-size: 11px; }
  .order-node-mark { font-size: 11px; }
}

@media (max-width: 760px) {
  .publish-task-dialog { width: 100vw; height: 100dvh; max-height: none; border-radius: 0; }
  .publish-task-dialog > form { height: 100dvh; max-height: none; }
  .publish-dialog-header { min-height: 64px; padding: 12px 16px; }
  .publish-type-tabs { padding: 10px 16px; }
  .publish-type-tabs label span { min-height: 50px; padding: 7px 10px; }
  .publish-type-tabs label small { display: none; }
  .publish-dialog-body { padding: 12px 16px 16px; }
  .publish-dialog-body .task-section { margin: 0; padding: 16px; border: 1px solid var(--color-border); border-radius: var(--radius-md); }
  .publish-dialog-body .form-grid { grid-template-columns: 1fr; }
  .publish-dialog-body .form-grid-wide { grid-column: auto; }
  .publish-dialog-actions { min-height: 70px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
  .publish-dialog-actions > span { display: none; }
  .publish-dialog-actions > div { width: 100%; }
  .publish-dialog-actions .button { flex: 1; }

  .progress-page .page-shell {
    padding: 7px 8px calc(78px + env(safe-area-inset-bottom));
  }
  .progress-page .progress-heading,
  .progress-page .progress-controls,
  .progress-page .progress-scroll-toggle {
    display: none !important;
  }
  .progress-page .progress-board-panel {
    margin: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .progress-page .order-progress-list {
    gap: 7px;
    padding: 0;
    background: transparent;
  }
  .order-progress-card {
    --order-left-column: 82px;
    --order-right-column: 0px;
    min-height: 88px;
    grid-template-columns: var(--order-left-column) minmax(0, 1fr);
    align-items: stretch;
    border-radius: 8px;
  }
  .order-mobile-sample-no {
    min-width: 0;
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
    padding: 7px 9px 5px;
    overflow: visible;
    border-bottom: 1px solid var(--color-divider);
    color: var(--theme-text, #1f2937);
    background: var(--theme-surface-muted, #fbfcfe);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .order-mobile-sample-no-copy {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .order-mobile-sample-no .order-acceptance-verification {
    min-width: 0;
    display: flex;
    flex: 0 0 auto;
    margin-left: auto;
  }
  .order-mobile-sample-no .order-acceptance-verification-copy {
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
  }
  .order-mobile-sample-no .order-acceptance-verification-badge {
    min-height: 22px;
    padding: 2px 7px;
    font-size: 9px;
  }
  .order-mobile-sample-no .order-acceptance-verification-badge.is-verified::after {
    right: -4px;
    max-width: 220px;
    font-size: 10px;
  }
  .order-mobile-sample-no .order-acceptance-verification-hint {
    max-width: 150px;
    font-size: 8px;
  }
  .order-mobile-sample-no .order-acceptance-verification .button {
    min-height: 22px;
    padding: 2px 6px;
    font-size: 9px;
  }
  .order-progress-card.task-is-paused .order-mobile-sample-no { color: var(--theme-text-secondary, #737b84); opacity: .58; filter: grayscale(1); }
  .order-card-left {
    grid-column: 1;
    padding: 7px;
    border-right: 1px solid var(--color-divider);
    border-bottom: 0;
  }
  .order-card-head {
    display: block;
  }
  .order-card-media,
  .order-main-thumb {
    width: 68px;
    height: 68px;
  }
  .order-card-head-meta,
  .order-card-overview,
  .order-return-slot,
  .order-card-right,
  .order-suborders {
    display: none !important;
  }
  .order-card-workflow {
    grid-column: 2;
    display: block;
    padding: 7px 0;
    border: 0;
  }
  .order-card-workflow .order-process-scroll {
    height: 72px;
    display: block;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    touch-action: pan-x;
  }
  .order-card-workflow .order-process-scroll::-webkit-scrollbar { display: none; }
  .order-process-track {
    --node-mark-size: 24px;
    --node-label-space: 34px;
    min-width: calc(var(--process-node-count, 11) * 54px);
    padding: 7px 8px 0;
  }
  .order-process-node {
    min-height: 58px;
    grid-template-rows: var(--node-mark-size) var(--node-label-space);
    cursor: default;
  }
  .order-process-node.is-actionable,
  .order-process-node[aria-current="step"] {
    cursor: pointer;
    touch-action: manipulation;
  }
  .order-process-node::after {
    left: calc(50% + (var(--node-mark-size) / 2) + 1px);
    right: calc(-50% + (var(--node-mark-size) / 2) + 1px);
  }
  .order-node-mark { border-width: 2px; font-size: 9px; }
  .order-process-node.current .order-node-mark,
  .order-process-node.returned .order-node-mark,
  .order-process-node.current.is-mine-turn .order-node-mark,
  .order-process-node.returned.is-mine-turn .order-node-mark {
    box-shadow: 0 0 0 3px var(--theme-blue-border, #dbeafe);
  }
  .order-process-node.current.is-mine-turn .order-node-mark { box-shadow: 0 0 0 3px var(--theme-amber-border, #ffedd5); }
  .order-process-node.returned.is-mine-turn .order-node-mark { box-shadow: 0 0 0 3px var(--theme-red-border, #fee2e2); }
  .order-node-label {
    padding-top: 4px !important;
    font-size: 9px;
    line-height: 1.25;
  }
  .order-node-mine-hint { display: none; }
  .progress-page .pagination {
    margin: 8px 0 0;
    padding: 8px;
    font-size: 10px;
  }
}

@media (max-width: 520px) {
  .progress-page .order-card-left { padding: 7px; }
}

/* 版师统计：汇总优先，逐单信息按需展开。 */
.pattern-report-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 24px 0 18px; }
.pattern-report-heading h2 { margin: 0 0 6px; font-size: 23px; }
.pattern-report-heading p { margin: 0; color: var(--color-text-secondary); font-size: 13px; }
.pattern-report .stats-kpi > strong small { font-size: 13px; font-weight: 400; color: var(--color-text-secondary); }
.pattern-report .stats-kpi:hover { box-shadow: var(--shadow-soft); }
.pattern-report a.stats-kpi { cursor: pointer; }
.pattern-report a.stats-kpi:hover, .pattern-report a.stats-kpi[aria-current="true"] { background: var(--theme-blue-soft, #eff6ff); border-color: var(--color-primary); }
.pattern-report a.stats-kpi:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; }
.pattern-person-grid { display: grid; grid-template-columns: minmax(120px, 1.2fr) repeat(2, minmax(92px, 1fr)) repeat(2, minmax(116px, 1.1fr)) minmax(100px, 1fr) 20px; gap: 12px; align-items: center; padding: 20px; }
.pattern-person-labels { padding-top: 12px; padding-bottom: 12px; background: var(--theme-surface-muted, #f8fafc); font-size: 12px; color: var(--color-text-secondary); }
.pattern-person { border-top: 1px solid var(--color-divider); }
.pattern-person > summary { cursor: pointer; list-style: none; font-size: 14px; }
.pattern-person > summary::-webkit-details-marker { display: none; }
.pattern-person > summary:hover { background: var(--theme-surface-muted, #f8fafc); }
.pattern-person > summary:focus-visible { outline: 2px solid var(--color-primary); outline-offset: -2px; }
.pattern-person[open] > summary { background: var(--theme-blue-soft, #f3f7ff); }
.pattern-person b { font-size: 20px; font-variant-numeric: tabular-nums; }
.pattern-person small { margin-left: 4px; font-size: 12px; color: var(--color-text-secondary); }
.pattern-person-name small, .pattern-person .pattern-subline { display: block; margin: 5px 0 0; }
.pattern-person-name strong { font-size: 15px; }
.pattern-alert { display: inline-block; padding: 3px 7px; border-radius: 5px; background: var(--theme-red-soft, #fff1f2); color: var(--theme-red-text, #b91c1c); font-size: 12px; font-style: normal; font-weight: 600; }
.pattern-alert-completed { background: var(--theme-amber-soft, #fff7ed); color: var(--theme-amber-text, #9a3412); }
.pattern-person-grid .pattern-alert { display: block; width: fit-content; margin-top: 5px; }
.pattern-expand { color: var(--color-text-secondary); font-size: 20px; transition: transform .15s ease; }
.pattern-person[open] .pattern-expand { transform: rotate(180deg); }
.pattern-person-body { padding: 16px 20px 20px; background: var(--theme-surface-muted, #f8fafc); }
.pattern-person-note { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; font-size: 13px; }
.pattern-person-note span { color: var(--color-text-secondary); }
.pattern-person-body .table-scroll { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 8px; }
.pattern-invalid-detail summary { cursor: pointer; color: var(--color-primary); }
.pattern-invalid-detail ul { padding-left: 18px; }
.pattern-invalid-detail li { margin-bottom: 8px; }
.pattern-report-help { padding: 16px; margin-bottom: 24px; border: 1px solid var(--color-border); border-radius: 8px; color: var(--color-text-secondary); font-size: 13px; }
.pattern-report-help summary { cursor: pointer; font-weight: 600; }
.pattern-report-help dl { display: grid; gap: 16px; margin-bottom: 0; max-width: 900px; }
.pattern-report-help dt { margin-bottom: 4px; color: var(--color-text); font-weight: 600; }
.pattern-report-help dd { margin: 0; line-height: 1.8; }
@media (max-width: 1100px) {
  .pattern-person-labels { display: none; }
  .pattern-person-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; position: relative; padding-right: 36px; }
  .pattern-person-grid [data-label]::before { content: attr(data-label); display: block; margin-bottom: 7px; font-size: 12px; color: var(--color-text-secondary); }
  .pattern-expand { position: absolute; top: 20px; right: 14px; }
}
@media (max-width: 600px) {
  .pattern-report-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .pattern-report .stats-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pattern-person-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pattern-person-body { padding: 12px; }
  .pattern-people .stats-section-header { align-items: flex-start; flex-direction: column; gap: 6px; }
}

/* 统计页 */
.stats-page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}
.stats-page-heading h1 { margin: 2px 0 0; font-size: 28px; }
.stats-page-heading > div:first-child { flex-shrink: 0; }
.stats-view-tabs,
.stats-range-tabs,
.stats-role-tabs,
.stats-task-type-tabs { display: inline-flex; align-items: center; gap: 3px; }
.stats-task-type-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.stats-task-type-toolbar > span { color: var(--color-text-secondary); font-size: 12px; font-weight: 700; }
.stats-task-type-tabs {
  padding: 3px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--theme-surface-muted, #eef1f5);
}
.stats-view-tabs {
  max-width: 100%;
  min-width: 0;
  padding: 3px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--theme-surface-muted, #eef1f5);
  overflow-x: auto;
}
.stats-view-tab,
.stats-range-tab,
.stats-role-tabs a,
.stats-task-type-tabs a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.stats-view-tab:hover,
.stats-range-tab:hover,
.stats-role-tabs a:hover,
.stats-task-type-tabs a:hover { color: var(--color-text); background: rgba(var(--theme-surface-rgb, 255, 255, 255), .7); }
.stats-view-tab.is-active,
.stats-range-tab.is-active,
.stats-role-tabs a.is-active,
.stats-task-type-tabs a.is-active {
  color: var(--color-text);
  background: var(--theme-surface, #fff);
  box-shadow: 0 1px 3px rgba(15, 23, 42, .1);
}
.stats-task-type-tabs a.is-active { color: var(--color-primary); }
.stats-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 18px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}
.stats-range-tabs {
  align-self: center;
  padding: 3px;
  border-radius: var(--radius-md);
  background: var(--theme-surface-muted, #f1f3f6);
}
.stats-custom-range { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.stats-custom-range label { display: grid; gap: 4px; }
.stats-custom-range label span { color: var(--color-text-secondary); font-size: 11px; font-weight: 700; }
.stats-custom-range input { min-width: 140px; min-height: 34px; }
.stats-date-separator { padding-bottom: 8px; color: var(--color-text-weak); font-size: 12px; }
.stats-range-label {
  margin-left: auto;
  align-self: center;
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 700;
}
.stats-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.stats-kpi {
  min-width: 0;
  min-height: 104px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 4px;
  padding: 13px 14px;
  border: 1px solid var(--color-border);
  border-top: 3px solid #64748b;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
}
.stats-kpi:hover { border-color: var(--theme-border, #94a3b8); box-shadow: 0 5px 16px rgba(15, 23, 42, .08); }
.stats-kpi > span { min-width: 0; color: var(--color-text-secondary); font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.stats-kpi > strong { align-self: center; font-size: 28px; line-height: 1; }
.stats-kpi > small { color: var(--color-text-weak); font-size: 11px; }
.stats-kpi-success { border-top-color: var(--color-success); }
.stats-kpi-warning { border-top-color: var(--color-warning); }
.stats-kpi-danger { border-top-color: var(--color-danger); }
.stats-section,
.stats-detail-panel,
.stats-cancellation-section {
  margin: 0 0 18px;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  scroll-margin-top: 20px;
}
.stats-detail-panel { border-top: 3px solid var(--color-primary); }
.stats-section-header {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-divider);
}
.stats-section-header > div:first-child { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.stats-section-header h2 { margin: 0; font-size: 17px; line-height: 1.25; }
.stats-section-index { color: var(--color-text-weak); font-size: 11px; font-weight: 800; }
.stats-section-meta { color: var(--color-text-secondary); font-size: 12px; }
.stats-legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--color-text-secondary); font-size: 12px; }
.stats-legend span { display: inline-flex; align-items: center; gap: 6px; }
.stats-legend i { width: 9px; height: 9px; border-radius: 2px; background: #0f766e; }
.stats-legend i.is-invalid { background: #dc2626; }
.stats-trend-scroll { overflow-x: auto; padding: 14px 16px 10px; }
.stats-trend-chart {
  min-width: max(100%, calc(var(--stats-day-count) * 54px));
  height: 190px;
  display: grid;
  grid-template-columns: repeat(var(--stats-day-count), minmax(44px, 1fr));
  align-items: end;
  gap: 8px;
  border-bottom: 1px solid var(--color-border);
}
.stats-trend-day { height: 176px; display: grid; grid-template-rows: 20px 132px 24px; min-width: 0; }
.stats-trend-values { display: flex; justify-content: center; gap: 7px; color: var(--color-text-secondary); font-size: 10px; font-weight: 700; }
.stats-trend-values span:last-child { color: var(--theme-red-text, #b91c1c); }
.stats-trend-bars { height: 132px; display: flex; align-items: end; justify-content: center; gap: 4px; }
.stats-trend-bar { width: 12px; min-height: 3px; border-radius: 2px 2px 0 0; background: #0f766e; }
.stats-trend-bar.is-invalid { background: #dc2626; }
.stats-trend-bar:hover { filter: brightness(.88); }
.stats-trend-day time { padding-top: 5px; color: var(--color-text-weak); font-size: 10px; text-align: center; white-space: nowrap; }
.stats-duration-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats-duration-group { min-width: 0; padding: 14px 16px 18px; }
.stats-duration-group + .stats-duration-group { border-left: 1px solid var(--color-divider); }
.stats-subsection-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.stats-subsection-heading h3 { margin: 0; font-size: 14px; }
.stats-subsection-heading strong { font-size: 13px; }
.stats-duration-list { display: grid; gap: 4px; }
.stats-duration-row {
  min-height: 36px;
  display: grid;
  grid-template-columns: 70px minmax(80px, 1fr) 34px 52px;
  align-items: center;
  gap: 9px;
  padding: 4px 7px;
  border-radius: var(--radius-sm);
}
.stats-duration-row:hover { background: var(--theme-surface-muted, #f6f8fa); }
.stats-duration-row > span { color: var(--color-text-secondary); font-size: 12px; font-weight: 700; }
.stats-duration-row > div { height: 7px; overflow: hidden; border-radius: 3px; background: var(--theme-surface-muted, #e8edf2); }
.stats-duration-row > div i { display: block; min-width: 2px; height: 100%; border-radius: inherit; background: #0f766e; }
.stats-duration-list.is-active .stats-duration-row > div i { background: #2563eb; }
.stats-duration-row.is-risk > div i { background: var(--color-danger); }
.stats-duration-row > strong { text-align: right; }
.stats-duration-row > small { color: var(--color-text-weak); font-size: 10px; text-align: right; }
.stats-team-header { flex-wrap: wrap; }
.stats-role-tabs { padding: 3px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--theme-surface-muted, #f1f3f6); }
.stats-person-table { min-width: 1080px; }
.stats-person-table th a { display: inline-flex; align-items: center; min-height: 26px; color: inherit; }
.stats-person-table th a:hover { color: var(--color-primary); }
.stats-person-table td:not(:first-child) > a { display: block; font-weight: 750; }
.stats-person-link { display: grid; gap: 2px; }
.stats-person-link:hover strong { color: var(--color-primary); }
.stats-person-link small,
.stats-account-name { display: block; margin-top: 2px; color: var(--color-text-secondary); font-size: 11px; }
.stats-node-average-table { min-width: 820px; }
.stats-daily-activity-table { min-width: 1380px; }
.stats-activity-summary { max-width: 270px; white-space: normal; line-height: 1.45; }
.stats-order-list { max-width: 260px; }
.stats-order-list a {
  display: inline-flex;
  margin: 2px 4px 2px 0;
  padding: 2px 6px;
  border: 1px solid var(--color-divider);
  border-radius: 4px;
  background: var(--theme-surface-muted, #f8fafc);
  font-size: 11px;
  font-weight: 700;
}
.stats-order-list a:hover { color: var(--color-primary); border-color: var(--theme-blue-border, #bfdbfe); }
.stats-person-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0;
  border-bottom: 1px solid var(--color-divider);
}
.stats-person-summary > div { min-width: 0; padding: 14px 16px; border-right: 1px solid var(--color-divider); }
.stats-person-summary > div:last-child { border-right: 0; }
.stats-person-summary dt { color: var(--color-text-secondary); font-size: 11px; }
.stats-person-summary dd { margin: 5px 0 0; font-size: 20px; font-weight: 800; overflow-wrap: anywhere; }
.stats-person-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats-person-detail-grid > div { min-width: 0; padding-top: 12px; }
.stats-person-detail-grid > div + div { border-left: 1px solid var(--color-divider); }
.stats-person-detail-grid h3 { margin: 0; padding: 0 16px 10px; font-size: 14px; }
.stats-detail-table { min-width: 920px; }
.stats-cancel-toolbar { margin: 0; padding: 16px; border-bottom: 1px solid var(--color-divider); }
.stats-cancel-toolbar-main { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 24px; }
.stats-cancel-select-field { display: grid; gap: 6px; min-width: min(260px, 100%); }
.stats-cancel-select-field > span { color: var(--color-text-secondary); font-size: 12px; font-weight: 700; }
.stats-cancel-select-field select { min-width: 240px; }
.stats-cancel-summary-inline { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px 0; margin: 0; flex: 1 1 320px; }
.stats-cancel-summary-inline > div { display: grid; gap: 4px; min-width: 110px; padding: 0 18px; border-left: 1px solid var(--color-divider); }
.stats-cancel-summary-inline dt { color: var(--color-text-secondary); font-size: 12px; }
.stats-cancel-summary-inline dd { margin: 0; font-size: 14px; font-weight: 700; }
.stats-cancel-summary-inline dd small { display: block; color: var(--color-text-secondary); font-size: 11px; font-weight: 500; }
.stats-cancel-toolbar-hint { margin: 0; align-self: center; color: var(--color-text-secondary); }
.text-danger { color: var(--theme-red-text, #b91c1c); }

@media (max-width: 980px) {
  .stats-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-duration-columns,
  .stats-person-detail-grid { grid-template-columns: 1fr; }
  .stats-duration-group + .stats-duration-group,
  .stats-person-detail-grid > div + div { border-left: 0; border-top: 1px solid var(--color-divider); }
  .stats-person-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats-person-summary > div:nth-child(3n) { border-right: 0; }
  .stats-person-summary > div:nth-child(n + 4) { border-top: 1px solid var(--color-divider); }
}

@media (max-width: 680px) {
  .stats-page-heading { align-items: stretch; flex-direction: column; gap: 12px; }
  .stats-view-tabs { align-self: stretch; }
  .stats-view-tab { flex: 0 0 auto; padding: 0 11px; }
  .stats-toolbar { align-items: stretch; padding: 10px; }
  .stats-range-tabs { width: 100%; }
  .stats-range-tab { flex: 1 1 0; }
  .stats-custom-range { display: grid; grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr); width: 100%; }
  .stats-custom-range label { min-width: 0; }
  .stats-custom-range input { width: 100%; min-width: 0; }
  .stats-custom-range .button { grid-column: 1 / -1; }
  .stats-date-separator { align-self: end; text-align: center; }
  .stats-range-label { display: none; }
  .stats-kpi { min-height: 98px; padding: 11px 12px; }
  .stats-kpi > strong { font-size: 24px; }
  .stats-section-header { align-items: flex-start; }
  .stats-section-header > div:first-child { align-items: baseline; }
  .stats-section-meta { text-align: right; }
  .stats-trend-scroll { padding-left: 10px; padding-right: 10px; }
  .stats-duration-group { padding: 12px 10px 16px; }
  .stats-duration-row { grid-template-columns: 62px minmax(60px, 1fr) 28px 44px; gap: 6px; padding-left: 4px; padding-right: 4px; }
  .stats-team-header { align-items: stretch; }
  .stats-team-header > div:first-child { width: 100%; }
  .stats-role-tabs { width: 100%; }
  .stats-role-tabs a { flex: 1 1 0; }
  .stats-person-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-person-summary > div:nth-child(3n) { border-right: 1px solid var(--color-divider); }
  .stats-person-summary > div:nth-child(2n) { border-right: 0; }
  .stats-person-summary > div:nth-child(n + 3) { border-top: 1px solid var(--color-divider); }
  .stats-cancel-summary-inline > div { width: 50%; padding: 8px 10px; border-left: 0; border-top: 1px solid var(--color-divider); }
  .stats-section .task-table,
  .stats-detail-panel .task-table,
  .stats-cancellation-section .task-table { width: 100%; min-width: 0; }
  .stats-section .table-scroll,
  .stats-detail-panel .table-scroll,
  .stats-cancellation-section .table-scroll { max-width: 100%; overflow: visible; }
}

.order-return-summary {
  position: relative;
  display: grid;
  grid-template-columns: max-content minmax(120px, 1fr) max-content auto;
  gap: 8px;
  align-items: center;
  margin: 0;
  padding: 5px 7px 5px 10px;
  border: 1px solid var(--theme-amber-border, #fed7aa);
  border-left: 3px solid #f97316;
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(255, 247, 237, .98), rgba(255, 251, 235, .94)),
    var(--theme-amber-soft, #fff7ed);
  box-shadow: none;
}
.order-return-summary::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 10px 0 0 10px;
  background: linear-gradient(180deg, #f97316, #dc2626);
}
.order-return-summary-count {
  display: flex;
  gap: 4px;
  align-items: baseline;
  min-width: 0;
  min-height: 26px;
  padding: 4px 6px;
  border-radius: 5px;
  background: rgba(var(--theme-surface-rgb, 255, 255, 255), .78);
}
.order-return-summary-count span {
  margin: 0;
  color: var(--theme-amber-text, #9a3412);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: 0;
}
.order-return-summary-count strong {
  color: var(--theme-red-text, #b91c1c);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
  white-space: nowrap;
}
.order-return-summary-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 24px;
}
.order-return-summary-type {
  flex: 0 1 auto;
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--theme-amber-text, #7c2d12);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
}
.order-return-summary-main strong {
  flex: 1 1 0;
  min-width: 0;
  display: block;
  color: var(--theme-amber-text, #7c2d12);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.order-return-summary-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0;
}
.order-return-summary-meta > div {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 3px;
  padding: 0;
  border: 0;
  background: transparent;
}
.order-return-summary dt { color: var(--theme-amber-text, #9a3412); font-size: 12px; font-weight: 700; line-height: 1.25; }
.order-return-summary dd { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--theme-amber-text, #451a03); font-weight: 700; line-height: 1.25; }
.order-return-summary > .button {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 12px;
  white-space: nowrap;
}
.order-return-summary .return-time,
.order-return-history .return-time {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}
@media (min-width: 761px) and (max-width: 1100px) {
  .order-return-summary { grid-template-columns: max-content minmax(0, 1fr); }
  .order-return-summary-meta { grid-column: 1 / -1; flex-wrap: wrap; }
  .order-return-summary > .button { grid-column: 2; justify-self: end; }
}
.return-history-dialog { width: min(760px, calc(100vw - 32px)); max-width: none; max-height: min(88dvh, 760px); padding: 0; overflow: hidden; border: 0; border-radius: 10px; color: var(--color-text); background: transparent; box-shadow: 0 28px 90px rgba(15, 23, 42, .28); }
.return-history-dialog::backdrop { background: rgba(15, 23, 42, .58); backdrop-filter: blur(2px); }
.return-history-dialog-panel { max-height: min(88dvh, 760px); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: var(--theme-surface, white); }
.return-history-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--color-divider); }
.return-history-dialog-header h2 { margin: 2px 0 0; font-size: 18px; }
.return-history-dialog-body { min-height: 0; overflow-y: auto; padding: 14px 18px; background: var(--theme-surface-muted, #f7f9fc); }
.return-history-dialog-footer { display: flex; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--color-divider); background: var(--theme-surface, white); }
.order-return-history { display: grid; gap: 10px; margin: 0; }
.order-return-history article { padding: 10px 12px; border: 1px solid var(--color-border); border-radius: 7px; background: var(--theme-surface, white); }
.order-return-history header { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.order-return-history p { display: grid; gap: 3px; margin: 10px 0 0; color: var(--color-text); }
.order-return-history p strong { color: var(--color-text-weak); font-size: 11px; }
.order-return-history p span { color: var(--color-text); font-size: 13px; }
.order-return-history dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; font-size: 12px; }
.order-return-history .return-record-meta { grid-template-columns: minmax(0, .85fr) minmax(0, .85fr) minmax(150px, 1.4fr) minmax(0, .85fr) minmax(0, 1.05fr); column-gap: 12px; }
.return-record-meta > div { min-width: 0; }
@media (max-width: 600px) {
  .order-return-history .return-record-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 12px; }
}
.order-return-history dt { color: var(--color-text-weak); font-size: 11px; }
.order-return-history dd { margin: 2px 0 0; overflow-wrap: anywhere; font-weight: 650; }
.return-image-strip { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; }
.return-image-strip button { width: 58px; height: 58px; padding: 0; border: 1px solid var(--color-border); border-radius: 6px; overflow: hidden; background: var(--theme-surface, white); }
.return-image-strip img { width: 100%; height: 100%; object-fit: cover; }
.attachment-file-download { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; padding: 6px; overflow: hidden; border: 1px solid var(--color-border); border-radius: 6px; color: var(--color-text-secondary); background: var(--theme-surface-muted, #f3f4f6); text-decoration: none; }
.attachment-file-download strong { font-size: 12px; }
.attachment-file-download span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.combination-gallery .attachment-file-download { aspect-ratio: 4 / 3; }
.return-image-strip .attachment-file-download { width: 58px; height: 58px; flex: 0 0 auto; }
.suborder-return-images .attachment-file-download { width: 40px; height: 40px; flex: 0 0 auto; padding: 3px; gap: 2px; }
.order-suborders, .suborder-detail-grid { grid-column: 1 / -1; display: grid; gap: 8px; padding: 10px; border-top: 1px solid var(--color-divider); background: var(--theme-surface-muted, #fbfdff); }
.suborder-card { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--color-border); border-radius: 7px; background: var(--theme-surface, white); }
.suborder-thumb { width: 64px; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; border-radius: 6px; background: var(--theme-surface-muted, #f1f5f9); color: var(--theme-text-secondary, #64748b); font-size: 12px; }
.suborder-thumb button { width: 100%; height: 100%; display: block; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.suborder-thumb button:focus-visible { outline: 2px solid var(--color-primary); outline-offset: -2px; }
.suborder-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.suborder-main strong { display: block; overflow-wrap: anywhere; }
.suborder-main span, .suborder-side span { display: block; color: var(--color-text-secondary); font-size: 12px; }
.suborder-name-repair { max-width: 480px; display: flex; gap: 8px; margin-top: 8px; }
.suborder-name-repair input:not([type="hidden"]) { min-width: 0; min-height: 34px; flex: 1 1 auto; }
.suborder-name-repair .button { flex: 0 0 auto; }
.suborder-side { display: grid; gap: 5px; justify-items: end; }
.suborder-mini-track { width: min(320px, 100%); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 8px 0 0; padding: 0; list-style: none; }
.suborder-mini-track li { position: relative; min-width: 0; display: grid; grid-template-rows: 17px 28px; justify-items: center; gap: 4px; color: var(--theme-text-secondary, #64748b); text-align: center; }
.suborder-mini-track li::after { content: ""; position: absolute; z-index: 0; top: 34px; left: calc(50% + 17px); right: calc(-50% + 17px); height: 2px; background: var(--theme-surface-muted, #e5e7eb); }
.suborder-mini-track li:last-child::after { display: none; }
.suborder-mini-track li.done::after { background: #86efac; }
.suborder-mini-track li strong { overflow: hidden; color: inherit; font-size: 11px; font-weight: 650; line-height: 17px; text-overflow: ellipsis; white-space: nowrap; }
.suborder-mini-track li > span { position: relative; z-index: 1; width: 28px; height: 28px; display: grid; place-items: center; border: 2px solid var(--theme-border, #d1d5db); border-radius: 50%; color: var(--theme-text-secondary, #94a3b8); background: var(--theme-surface, white); font-size: 10px; font-weight: 800; line-height: 1; }
.suborder-mini-track li.done { color: var(--color-success); }
.suborder-mini-track li.done > span { color: white; border-color: var(--color-success); background: var(--color-success); }
.suborder-mini-track li.current { color: var(--color-primary); }
.suborder-mini-track li.current > span { color: white; border-color: var(--color-primary); background: var(--color-primary); box-shadow: 0 0 0 4px var(--theme-blue-border, #dbeafe); }
.suborder-mini-track li.upcoming { color: var(--theme-text-secondary, #64748b); }
.order-suborders { gap: 6px; padding: 8px; }
.order-suborders .suborder-card {
  grid-template-columns: minmax(240px, .8fr) minmax(260px, .9fr) minmax(320px, 1.25fr) minmax(96px, .35fr);
  gap: 10px;
  min-height: 80px;
  padding: 8px 10px;
  align-items: center;
}
.order-suborders .suborder-card.no-suborder-return {
  grid-template-columns: minmax(240px, .8fr) minmax(260px, .9fr) minmax(320px, 1.25fr) minmax(96px, .35fr);
}
.order-suborders .suborder-info {
  min-width: 0;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  grid-column: 1;
}
.order-suborders .suborder-thumb {
  width: 64px;
  border-radius: 6px;
}
.order-suborders .suborder-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
  align-content: center;
}
.order-suborders .suborder-copy strong {
  overflow: visible;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.3;
  text-overflow: clip;
  white-space: normal;
}
.order-suborders .suborder-copy span {
  overflow: visible;
  overflow-wrap: anywhere;
  color: var(--color-text-secondary);
  font-size: 11px;
  line-height: 1.3;
  text-overflow: clip;
  white-space: normal;
}
.order-suborders .suborder-owner-line b {
  color: var(--color-text);
  font-weight: 750;
}
.order-suborders .suborder-flow {
  min-width: 0;
  display: grid;
  align-items: center;
  margin-left: 0;
  overflow-x: auto;
  padding: 2px 0;
  justify-items: center;
  grid-column: 2;
}
.order-suborders .suborder-mini-track {
  width: min(340px, 100%);
  margin: 0;
}
.order-suborders .suborder-mini-track li {
  grid-template-rows: 18px 30px;
  gap: 4px;
}
.order-suborders .suborder-mini-track li::after {
  top: 36px;
  left: calc(50% + 17px);
  right: calc(-50% + 17px);
}
.order-suborders .suborder-mini-track li strong {
  font-size: 11px;
  line-height: 18px;
}
.order-suborders .suborder-mini-track li > span {
  width: 30px;
  height: 30px;
  font-size: 10px;
}
.order-suborders .suborder-mini-track li.current > span {
  box-shadow: 0 0 0 4px var(--theme-blue-border, #dbeafe);
}
.suborder-mini-track li.is-actionable {
  cursor: pointer;
}
.suborder-mini-track li.is-actionable:hover > span {
  transform: scale(1.06);
}
.order-suborders .suborder-return-panel {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(110px, 1fr) auto minmax(112px, auto);
  gap: 8px;
  align-items: center;
  min-height: 64px;
  padding: 7px 8px;
  border: 1px dashed var(--theme-border, #e5e7eb);
  border-radius: 7px;
  background: var(--theme-surface-muted, #f8fafc);
  grid-column: 3;
}
.order-suborders .suborder-return-panel.has-return {
  border-style: solid;
  border-color: var(--theme-amber-border, #fed7aa);
  background: linear-gradient(135deg, rgba(255, 247, 237, .94), rgba(255, 251, 235, .86));
  box-shadow: inset 3px 0 0 #f97316;
}
.suborder-return-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.suborder-return-copy span {
  color: var(--theme-amber-text, #9a3412);
  font-size: 11px;
  font-weight: 800;
}
.suborder-return-copy strong {
  color: var(--theme-red-text, #b91c1c);
  font-size: 16px;
  line-height: 1.1;
}
.suborder-return-copy small,
.suborder-return-copy time {
  overflow: visible;
  overflow-wrap: anywhere;
  color: var(--color-text-secondary);
  font-size: 10px;
  line-height: 1.3;
  text-overflow: clip;
  white-space: normal;
}
.suborder-return-panel.has-return .suborder-return-copy small,
.suborder-return-panel.has-return .suborder-return-copy time {
  color: var(--theme-amber-text, #7c2d12);
}
.suborder-return-images {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  justify-content: center;
}
.suborder-return-images button {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid rgba(251, 146, 60, .32);
  border-radius: 6px;
  overflow: hidden;
  background: var(--theme-surface, white);
  cursor: pointer;
}
.suborder-return-images button:hover {
  border-color: #f97316;
  box-shadow: 0 4px 12px rgba(251, 146, 60, .2);
}
.suborder-return-images img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.suborder-return-empty {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--theme-surface, white);
  color: var(--color-text-weak);
  font-size: 12px;
  font-weight: 650;
}
.suborder-return-more {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--theme-amber-soft, #ffedd5);
  color: var(--theme-amber-text, #9a3412);
  font-size: 12px;
  font-weight: 800;
}
.suborder-return-history-button {
  justify-self: end;
  align-self: center;
  min-width: 112px;
  min-height: 30px;
}
.order-suborders .suborder-side {
  gap: 4px;
  align-content: center;
  justify-items: stretch;
  text-align: center;
  grid-column: 4;
}
.order-suborders .suborder-side span {
  font-size: 11px;
}
.order-suborders .suborder-side .button {
  min-width: 72px;
  min-height: 30px;
  padding: 4px 7px;
  font-size: 11px;
}
.suborder-detail-grid .suborder-card {
  scroll-margin-top: 88px;
}
.suborder-inline-action {
  width: fit-content;
  margin-top: 8px;
}
.suborder-editor-list { display: grid; gap: 10px; counter-reset: suborder-row; }
.suborder-edit-card { padding: 16px; border: 1px solid var(--color-border); border-radius: 10px; background: var(--theme-surface, #fff); counter-increment: suborder-row; transition: border-color 160ms ease, box-shadow 160ms ease; }
.suborder-edit-card:focus-within { border-color: var(--theme-blue-border, #bfdbfe); box-shadow: 0 0 0 3px var(--color-primary-soft); }
.publish-suborder-header { align-items: flex-start; }
.publish-suborder-header > div { min-width: 0; flex: 1; }
.publish-suborder-header [data-add-suborder] { flex: 0 0 auto; margin-left: auto; }
.publish-suborder-header [data-add-suborder] svg { width: 15px; height: 15px; }
.suborder-edit-grid { display: grid; grid-template-columns: 32px minmax(0, 1fr) 150px 32px; gap: 18px; align-items: center; }
.suborder-row-number { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: var(--color-primary); background: var(--color-primary-soft); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.suborder-row-number::before { content: counter(suborder-row, decimal-leading-zero); }
.suborder-edit-grid > .field > span:first-child { overflow: hidden; color: var(--theme-text, #374151); font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.suborder-edit-grid > .field > span em { color: var(--color-danger); font-style: normal; }
.suborder-owner-field { position: relative; }
.owner-combobox { position: relative; min-width: 0; }
.owner-search-input { padding-right: 30px; }
.owner-options {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 80;
  max-height: 220px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--theme-border, #cbd5e1);
  border-radius: var(--radius-sm);
  background: var(--theme-surface, white);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .16);
}
.owner-options button {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 6px 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--color-text);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.owner-options button:hover,
.owner-options button:focus-visible {
  color: var(--color-primary);
  background: var(--color-primary-soft);
}
.owner-options-empty {
  padding: 8px 9px;
  color: var(--color-text-secondary);
  font-size: 12px;
}
.suborder-image-control { min-width: 0; display: grid; }
.suborder-image-heading { min-height: 20px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 650; }
.suborder-image-heading em { color: var(--color-danger); font-style: normal; }
.suborder-image-remove { display: inline-flex; align-items: center; gap: 3px; min-height: 24px; margin: -2px 0; padding: 2px 5px; border: 0; border-radius: 4px; color: var(--color-text-secondary); background: transparent; font: inherit; font-size: 11px; font-weight: 500; cursor: pointer; }
.suborder-image-remove svg { width: 13px; height: 13px; }
.suborder-image-remove:hover:not(:disabled) { color: var(--color-danger); background: var(--color-danger-soft); }
.suborder-image-remove:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.suborder-image-remove:disabled { cursor: progress; opacity: .5; }
.suborder-image-dropzone { width: 100%; min-height: 86px; display: flex; flex-direction: row; justify-content: flex-start; gap: 14px; padding: 14px 16px; border-color: var(--theme-blue-border, #cbdaf0); border-radius: 8px; text-align: left; }
.suborder-upload-icon { width: 44px; height: 44px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--theme-blue-border, #dbe7fb); border-radius: 12px; background: var(--theme-surface, #fff); }
.suborder-upload-icon svg { width: 24px; height: 24px; color: var(--color-primary); }
.suborder-image-dropzone .suborder-upload-copy { min-width: 0; display: grid; gap: 5px; }
.suborder-upload-copy strong { color: var(--color-primary); font-size: 13px; font-weight: 600; line-height: 1.5; }
.suborder-image-dropzone .suborder-upload-action { display: grid; place-items: center; flex: 0 0 auto; margin-left: auto; color: var(--color-text-weak); }
.suborder-upload-action svg { width: 19px; height: 19px; }
.suborder-image-dropzone:hover .suborder-upload-action { color: var(--color-primary); }
.suborder-image-dropzone:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; }
.suborder-image-dropzone.dragging { border-color: var(--color-primary); background: var(--color-primary-soft); outline: 2px solid var(--color-primary); outline-offset: 2px; }
.suborder-image-dropzone:disabled { cursor: progress; opacity: .65; }
.suborder-image-preview { width: 54px; height: 54px; flex: 0 0 auto; object-fit: contain; border: 1px solid var(--color-border); border-radius: 7px; background: var(--theme-surface, white); }
.suborder-image-dropzone:has(.suborder-image-preview:not([hidden])) .suborder-upload-icon { display: none; }
.suborder-image-control [data-suborder-image-name] { overflow: hidden; color: var(--color-text-secondary); font-size: 11px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.suborder-quantity-control { display: flex; align-items: center; min-width: 0; overflow: hidden; border: 1px solid var(--theme-border, #d4dce8); border-radius: 7px; background: var(--theme-surface, white); }
.suborder-quantity-control:focus-within { border-color: var(--color-primary); outline: 3px solid var(--color-primary-soft); }
.suborder-quantity-control input { min-width: 0; width: 100%; height: 42px; border: 0; background: transparent; box-shadow: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.suborder-quantity-control input:focus { outline: none; box-shadow: none; }
.suborder-quantity-control > span { flex: 0 0 auto; padding: 0 12px; border-left: 1px solid var(--color-divider); color: var(--color-text-secondary); font-size: 12px; }
.suborder-edit-grid .suborder-remove-button { width: 32px; min-height: 32px; padding: 7px; margin-top: 24px; border-radius: 7px; color: var(--color-text-secondary); }
.suborder-remove-button svg { width: 18px; height: 18px; }
.suborder-edit-grid .suborder-remove-button:hover:not(:disabled) { color: var(--color-danger); background: var(--color-danger-soft); }
.suborder-edit-grid .suborder-remove-button:disabled { color: var(--color-text-weak); cursor: not-allowed; opacity: .45; }
.auto-sample-no-field label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.auto-sample-no-field label small {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--theme-green-soft, #dcfce7);
  color: var(--theme-green-text, #166534);
  font-size: 10px;
  font-weight: 700;
}
.auto-sample-no-field input[readonly] {
  border-color: var(--theme-green-border, #86efac);
  background: var(--theme-green-soft, #f0fdf4);
  color: var(--theme-green-text, #166534);
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  cursor: default;
}
.stats-range-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }

@media (max-width: 1000px) {
  .suborder-edit-grid { grid-template-columns: 28px minmax(0, 1fr) 120px 32px; gap: 12px; }
  .suborder-row-number { width: 28px; height: 28px; }
}

@media (max-width: 940px) and (min-width: 761px) {
  .order-suborders .suborder-card,
  .order-suborders .suborder-card.no-suborder-return {
    grid-template-columns: minmax(230px, .9fr) minmax(250px, 1fr) minmax(100px, .4fr);
  }
  .order-suborders .suborder-flow { margin-left: 0; }
  .order-suborders .suborder-info { grid-column: 1; }
  .order-suborders .suborder-flow { grid-column: 2; }
  .order-suborders .suborder-return-panel {
    grid-column: 1 / 3;
  }
  .order-suborders .suborder-side { grid-column: 3; }
}

@media (max-width: 760px) {
  .order-return-summary { grid-template-columns: 1fr; }
  .order-return-summary-meta { flex-wrap: wrap; }
  .order-return-summary > .button { width: 100%; }
  .order-return-summary dl,
  .order-return-history dl { grid-template-columns: 1fr 1fr; }
  .return-history-dialog { width: calc(100vw - 20px); max-height: 92dvh; }
  .return-history-dialog-panel { max-height: 92dvh; }
  .return-history-dialog-header,
  .return-history-dialog-body,
  .return-history-dialog-footer { padding-left: 14px; padding-right: 14px; }
  .suborder-card { grid-template-columns: 54px minmax(0, 1fr); }
  .suborder-name-repair { align-items: stretch; flex-direction: column; }
  .order-suborders .suborder-card {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .order-suborders .suborder-card.no-suborder-return {
    grid-template-columns: 1fr;
  }
  .order-suborders .suborder-info {
    grid-template-columns: 64px minmax(0, 1fr);
  }
  .order-suborders .suborder-thumb {
    width: 64px;
  }
  .order-suborders .suborder-return-panel {
    grid-template-columns: 1fr;
  }
  .suborder-return-history-button {
    justify-self: stretch;
  }
  .suborder-side { grid-column: 1 / -1; justify-items: stretch; }
  .order-suborders .suborder-side {
    grid-column: auto;
    justify-items: stretch;
  }
  .order-suborders .suborder-info,
  .order-suborders .suborder-flow,
  .order-suborders .suborder-return-panel { grid-column: auto; }
  .suborder-edit-card { padding: 14px; }
  .suborder-edit-grid { grid-template-columns: 28px minmax(0, 1fr) 32px; gap: 12px; }
  .suborder-row-number { grid-column: 1; grid-row: 1; }
  .suborder-image-field { grid-column: 2 / -1; grid-row: 1; }
  .suborder-quantity-field { grid-column: 2; grid-row: 2; }
  .suborder-edit-grid .suborder-remove-button { grid-column: 3; grid-row: 2; }
  .suborder-image-dropzone { gap: 10px; padding: 12px; }
  .suborder-image-dropzone .suborder-upload-action { display: none; }
  .suborder-upload-copy strong { font-size: 12px; }
  .suborder-upload-icon { width: 36px; height: 36px; border-radius: 9px; }
  .publish-suborder-header { flex-wrap: wrap; }
  .publish-suborder-header [data-add-suborder] { width: calc(100% - 44px); margin-left: 44px; }
}
.panel-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 0;
}
.panel-section-header h2,
.panel-section-header h3 { margin: 2px 0 4px; font-size: 18px; }
.panel-section-header p { margin: 0; color: var(--color-text-secondary); font-size: 13px; }
.compact-empty { padding: 28px 16px; }
@media (max-width: 720px) {
  .stats-fixed-overview {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    grid-template-columns: 1fr 1fr;
  }
  .stats-metric-row { grid-template-columns: 1fr 1fr; }
  .stats-cancel-summary-inline > div {
    min-width: calc(50% - 8px);
    padding: 8px 12px;
    border-left: 0;
    border-top: 1px solid var(--color-divider);
  }
  .stats-cancel-select-field,
  .stats-cancel-select-field select {
    width: 100%;
    min-width: 0;
  }
  .stats-duration-block {
    padding: 14px 16px 16px;
  }
  .stats-block-header {
    align-items: flex-start;
    padding-left: 16px;
    padding-right: 16px;
  }
  .stats-duration-block .stats-block-header {
    padding-left: 0;
    padding-right: 0;
  }
  .stats-duration-grid {
    grid-template-columns: 1fr 1fr;
  }
  .stats-duration-cell {
    min-height: 80px;
  }
  .stats-node-average-table,
  .stats-daily-activity-table {
    min-width: 0;
  }
  .stats-activity-summary,
  .stats-order-list {
    max-width: none;
  }
}

/* 任务列表状态切换 */
.task-status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.filter-tabs .filter-tab,
.task-status-tabs .filter-tab {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.filter-tabs .filter-tab:hover,
.task-status-tabs .filter-tab:hover {
  border-color: var(--theme-blue-border, #bfdbfe);
  color: var(--color-primary);
  background: var(--color-primary-soft);
}
.filter-tabs .filter-tab.is-active,
.task-status-tabs .filter-tab.is-active {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
}
.status-tag-danger {
  color: var(--color-danger);
  background: var(--color-danger-soft);
}
.status-tag-danger i { background: var(--color-danger); }

/* 任务发布信息编辑页 */
.task-edit-options {
  position: fixed;
  inset: auto;
  margin: 0;
  width: 200px;
  max-width: calc(100vw - 16px);
  max-height: min(480px, calc(100dvh - 24px));
  padding: 6px;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-soft);
}
.task-edit-options p { margin: 5px 10px 8px; color: var(--color-text-secondary); font-size: 12px; }
.task-edit-options button {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.task-edit-options button:hover, .task-edit-options button:focus-visible { background: var(--color-primary-soft); color: var(--color-primary); }
.task-edit-options button[hidden] { display: none; }
.task-edit-dialog {
  width: min(680px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-soft);
}
.task-edit-dialog::backdrop { background: rgba(15, 23, 42, .5); }
.task-edit-dialog [data-task-edit-content]:empty,
.task-edit-dialog [data-task-edit-content][aria-busy="true"] { padding: 24px; }
.task-edit-dialog .publish-edit-form { border: 0; border-radius: 0; box-shadow: none; }
[data-task-edit][data-edit-section]:not([data-edit-section=""]) .task-create-layout,
[data-task-edit][data-edit-section]:not([data-edit-section=""]) .form-grid { grid-template-columns: minmax(0, 1fr); }
[data-task-edit][data-edit-section]:not([data-edit-section=""]) .section-number { display: none; }
.task-edit-dialog .publish-edit-actions > span { display: none; }
.task-edit-dialog .publish-edit-actions { justify-content: flex-end; }
.publish-edit-form {
  display: grid;
  gap: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.publish-edit-form .publish-type-tabs { margin: 0 0 14px; }
.publish-edit-body {
  min-height: 0;
  padding: 18px 22px 22px;
  background: var(--theme-surface-muted, #f7f9fc);
}
.publish-edit-body .task-create-layout {
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, .88fr);
  gap: 14px;
}
.publish-edit-body .task-section {
  padding: 18px;
  box-shadow: none;
}
.publish-edit-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
}
@media (max-width: 980px) {
  .publish-edit-body .task-create-layout { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .publish-edit-body { padding: 12px 16px 16px; }
  .publish-edit-actions > span { display: none; }
  .publish-edit-actions > div { width: 100%; }
  .publish-edit-actions .button { flex: 1; }
}

/* Order detail: current step, focused action, and files in one workspace. */
.task-detail-page .page-shell { width: min(1320px, 100%); }
.task-detail-page .detail-breadcrumb { flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.detail-back-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 7px 12px; border: 1px solid var(--theme-blue-border, #bfdbfe); border-radius: 7px; color: var(--color-primary); background: var(--color-primary-soft); font-size: 13px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.detail-back-button:hover { border-color: var(--color-primary); background: var(--theme-blue-soft, #eff6ff); }
.detail-back-button:focus-visible, .mobile-task-back:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; }
.task-detail-page .detail-overview-card { grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; padding: 16px 18px; }
.task-detail-page .detail-overview-card h1 { font-size: 22px; }
.task-detail-page .detail-overview-meta { gap: 4px 12px; font-size: 11px; }
.task-detail-page .detail-quick-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; max-width: 360px; }
.task-detail-page .detail-quick-actions button { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 7px 12px; border: 1px solid var(--theme-blue-border, #bfdbfe); border-radius: 7px; color: var(--color-primary); background: var(--color-primary-soft); font-size: 13px; font-weight: 650; white-space: nowrap; }
.task-detail-page .detail-quick-actions button span { font-size: inherit; font-weight: inherit; }
.task-detail-page .detail-quick-actions button:hover { border-color: var(--color-primary); background: var(--theme-blue-soft, #eff6ff); }
.task-detail-page .detail-quick-actions button:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; }
.task-detail-page .detail-quick-actions .detail-quick-pause { margin-left: 4px; border-color: var(--theme-red-border, #fecaca); color: var(--theme-red-text, #b91c1c); background: var(--theme-red-soft, #fff7f7); }
.task-detail-page .detail-quick-actions .detail-quick-pause:hover { border-color: var(--color-danger); background: var(--color-danger-soft); }
.task-detail-page .detail-quick-actions small { display: none; }
.detail-quick-actions form { margin: 0; }
.detail-mobile-admin-action { display: none; }
.task-detail-page .compact-stage-panel { min-height: 88px; grid-template-columns: auto minmax(150px, .65fr) minmax(0, 1.5fr); gap: 18px; margin: 0 0 14px; padding: 16px 20px; border-color: var(--color-border); border-left-color: var(--color-primary); background: var(--color-surface); }
.task-detail-page .compact-stage-panel .stage-marker { width: 38px; height: 38px; background: var(--color-primary); }
.task-detail-page .compact-stage-panel .stage-marker i { display: none; }
.task-detail-page .compact-stage-panel h2 { margin: 3px 0 0; font-size: 21px; }
.task-detail-page .compact-stage-panel dl { display: grid; grid-template-columns: minmax(120px, .65fr) minmax(0, 1.35fr); gap: 18px; }
.task-detail-page .compact-stage-panel dl div { display: grid; gap: 5px; }
.task-detail-page .compact-stage-panel .stage-next-step { padding-left: 18px; border-left: 1px solid var(--color-divider); }
.task-detail-page .compact-stage-panel .stage-next-step dd { color: var(--color-primary); }
.task-detail-page .compact-stage-panel .stage-next-step dd:has(> strong) { display: grid; gap: 3px; }
.task-detail-page .compact-stage-panel .stage-next-step dd > strong { font-size: 16px; }
.task-detail-page .compact-stage-panel .stage-next-step dd > small { color: var(--color-text-secondary); font-size: 11px; font-weight: 400; }
.task-detail-page .detail-return-section { padding: 0 4px; margin-bottom: 12px; }
.detail-return-section > summary { padding: 5px 0; cursor: pointer; color: var(--color-text-secondary); font-size: 12px; }
.detail-return-section > summary span { margin-left: 12px; overflow-wrap: anywhere; }
.detail-return-section[open] > summary { margin-bottom: 6px; }
.task-detail-page .detail-workbench { grid-template-columns: minmax(340px, 490px) minmax(0, 1fr); align-items: start; gap: 16px; }
.task-detail-page .detail-workbench-readonly { grid-template-columns: minmax(0, 1fr); justify-content: stretch; }
.task-detail-page .detail-workbench > .detail-section { min-width: 0; padding: 18px; }
.task-detail-page .action-section > header .section-kicker, .detail-attachments > header .section-kicker { display: none; }
.task-detail-page .action-section > header h2, .task-detail-page .detail-attachments > header h2 { font-size: 17px; }
.task-detail-page .detail-workbench .action-card { padding: 0; border: 0; border-radius: 0; background: transparent; gap: 12px; }
.task-detail-page .detail-workbench .action-card > h3 { display: none; }
.task-detail-page .detail-workbench .action-card-warn { padding: 12px; border: 1px solid var(--theme-red-border, #fecaca); border-radius: 8px; background: var(--theme-red-soft, #fff7f7); }
.task-detail-page .detail-workbench .action-card-warn > h3 { display: block; }
.task-detail-page .detail-workbench .task-action-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
.task-detail-page .detail-workbench .upload-dropzone { min-height: 76px; padding: 14px; }
.detail-optional-fields { border-top: 1px solid var(--color-divider); border-bottom: 1px solid var(--color-divider); }
.detail-optional-fields > summary { padding: 12px 0; cursor: pointer; color: var(--color-text-secondary); font-size: 13px; }
.detail-optional-fields > summary small { margin-left: 6px; font-size: 11px; }
.detail-optional-fields[open] { display: grid; gap: 12px; padding-bottom: 12px; }
.task-detail-page .detail-optional-fields .fitting-assignee-field { padding: 0; border: 0; background: transparent; }
.task-detail-page .detail-workbench .action-card > .detail-next-owner { font-size: 12px; }
.detail-attachments > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.detail-attachments h2 span { margin-left: 5px; color: var(--color-text-secondary); font-size: 13px; font-weight: 500; }
.detail-attachment-groups { display: grid; gap: 20px; max-height: 620px; overflow-y: auto; scrollbar-gutter: stable; }
.detail-attachment-group { min-width: 0; }
.detail-attachment-group h3 { margin: 0 0 5px; color: var(--color-text-secondary); font-size: 12px; font-weight: 600; }
.detail-attachment-group h3 span { margin-left: 5px; font-weight: 400; }
.detail-attachment-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--color-divider); }
.detail-attachment-row .attachment-image-thumb { width: 40px; height: 40px; }
.detail-attachment-copy { min-width: 0; display: grid; gap: 4px; }
.detail-attachment-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.detail-attachment-copy small { color: var(--color-text-secondary); font-size: 11px; }
.detail-attachment-actions { display: flex; align-items: center; gap: 12px; }
.detail-attachment-actions a { color: var(--color-primary); font-size: 12px; white-space: nowrap; }
.detail-attachments-empty { padding: 38px 12px; text-align: center; color: var(--color-text-secondary); }
.detail-attachments-empty strong { font-size: 14px; }
.detail-attachments-empty p { margin: 8px 0 0; font-size: 12px; }
@media (max-width: 1100px) {
  .task-detail-page .detail-overview-card { grid-template-columns: minmax(0, 1fr) auto; }
  .task-detail-page .detail-quick-actions { grid-column: 1 / -1; max-width: none; justify-content: flex-start; }
  .task-detail-page .detail-workbench { grid-template-columns: minmax(300px, .9fr) minmax(0, 1fr); }
  .task-detail-page .detail-workbench-readonly { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .task-detail-page .detail-workbench { grid-template-columns: minmax(0, 1fr); display: grid; }
  .task-detail-page .compact-stage-panel { grid-template-columns: auto minmax(0, 1fr); }
  .task-detail-page .compact-stage-panel dl { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .task-detail-page .mobile-task-brief-header { grid-template-columns: 76px minmax(0, 1fr) auto; }
  .task-detail-page .mobile-task-back { width: auto; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 8px; border: 1px solid var(--theme-blue-border, #bfdbfe); color: var(--color-primary); background: var(--color-primary-soft); font-size: 13px; font-weight: 650; }
  .task-detail-page .mobile-task-back span { font-size: 18px; }
  .task-detail-page .mobile-task-cover { display: none; }
  .task-detail-page .mobile-task-progress { padding-top: 4px; }
  .task-detail-page .detail-mobile-admin-action { display: flex; }
  .task-detail-page .detail-workbench { gap: 8px; }
  .task-detail-page .detail-workbench > .detail-section { margin: 0 -16px; padding: 16px; }
  .task-detail-page .detail-workbench .action-card > p { display: block; }
  .task-detail-page .detail-workbench .action-card .button { width: auto; }
  .task-detail-page .detail-workbench .action-card > .button-primary { width: 100%; }
  .detail-attachment-actions { gap: 8px; }
  .detail-attachment-groups { max-height: none; }
}

/* Optional workflow nodes for repeat and revised sample orders. */
.workflow-selector { border: 1px solid var(--border, #dce3ee); border-radius: 8px; padding: 12px; background: var(--surface, #fff); }
.workflow-selector-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 10px; }
.workflow-selector-heading small, .workflow-selector-hint, .workflow-config-panel summary span { color: var(--text-muted, #64748b); font-size: 12px; }
.workflow-required-nodes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.workflow-required-nodes > span { border-radius: 4px; padding: 4px 7px; color: #2459c8; background: #eff5ff; font-size: 12px; }
.workflow-required-nodes small { opacity: .7; }
.workflow-node-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.workflow-node-option { display: flex; align-items: center; gap: 6px; min-height: 34px; border: 1px solid var(--border, #dce3ee); border-radius: 6px; padding: 6px 8px; font-size: 13px; cursor: pointer; }
.workflow-node-option:has(input:checked) { background: #eff5ff; border-color: #8eafff; color: #2459c8; }
.workflow-node-option input { width: 15px; height: 15px; margin: 0; accent-color: #2563eb; }
.workflow-node-option > span { color: var(--text, #1f2937); }
.workflow-node-option:has(input:checked) > span { color: #2459c8; }
.workflow-node-option.is-locked { opacity: .65; cursor: default; }
.workflow-selector-hint { margin: 10px 0 0; line-height: 1.6; }
.workflow-config-panel { margin: 16px 0; }
.workflow-config-panel summary { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 2px 0; cursor: pointer; }
.workflow-config-panel form { margin-top: 14px; }
.workflow-config-panel button[type=submit] { margin-top: 12px; }
.workflow-owner-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.workflow-assignment-summary { margin-top: 16px; padding: 12px; background: #eff5ff; border-radius: 8px; }
.order-workflow-config-button { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 5px; min-height: 26px; margin-left: auto; padding: 3px 7px; border: 1px solid var(--theme-blue-border, #d7e3fa); border-radius: 6px; background: var(--color-surface); color: var(--color-primary); font-size: 11px; font-weight: 550; line-height: 1.4; white-space: nowrap; cursor: pointer; transition: background .15s, border-color .15s; }
.order-workflow-config-button:hover { background: var(--color-primary-soft); border-color: var(--color-primary); }
.order-workflow-config-button:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.order-workflow-config-button.is-pending { border-color: #f59e0b; background: var(--theme-amber-soft, #fffbeb); color: var(--theme-amber-text, #9a4d08); box-shadow: 0 0 0 1px rgb(245 158 11 / 14%), 0 0 9px rgb(245 158 11 / 24%); animation: workflow-pending-glow 1.6s ease-in-out infinite; }
.order-workflow-config-button.is-pending:hover { border-color: #d97706; background: var(--theme-amber-soft, #fef3c7); }
@keyframes workflow-pending-glow {
  0%, 100% { box-shadow: 0 0 0 1px rgb(245 158 11 / 10%), 0 0 5px rgb(245 158 11 / 18%); }
  50% { box-shadow: 0 0 0 3px rgb(245 158 11 / 28%), 0 0 16px rgb(245 158 11 / 58%); }
}
@media (prefers-reduced-motion: reduce) { .order-workflow-config-button.is-pending { animation: none; } }
.order-workflow-config-button svg { width: 13px; height: 13px; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.workflow-pending-dot { display: inline-block; flex: 0 0 auto; width: 5px; height: 5px; border-radius: 50%; background: #f59e0b; }
.workflow-pending-label { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; color: var(--color-text-secondary); font-size: 11px; white-space: nowrap; }
.order-card-tools { display: inline-flex; flex: 0 0 auto; flex-wrap: nowrap; align-items: center; gap: 4px; margin-left: auto; }
.order-card-tools > .order-workflow-config-button, .order-card-tools > .workflow-pending-label, .order-card-tools > .print-upload-button { margin-left: 0; }
.order-card-tools > button { min-height: 26px; padding: 3px 6px; font-size: 10px; }
.workflow-config-dialog { width: min(1040px, calc(100vw - 32px)); height: min(620px, calc(100dvh - 48px)); max-height: calc(100dvh - 48px); padding: 0; border: 1px solid var(--color-divider); border-radius: 12px; background: var(--color-surface, #fff); color: var(--color-text, #17243b); box-shadow: 0 24px 80px #14244033; }
.workflow-config-dialog::backdrop { background: #15233b66; }
.workflow-config-dialog > form { display: flex; flex-direction: column; height: 100%; max-height: 100%; }
.workflow-config-dialog-body { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, 1fr); gap: 20px; flex: 1; padding: 20px; overflow: hidden; min-height: 0; }
.workflow-config-node-panel { min-width: 0; min-height: 0; overflow-y: auto; scrollbar-gutter: stable; }
.workflow-config-node-panel > .workflow-selector { display: flex; flex-direction: column; height: 100%; min-height: min-content; box-sizing: border-box; }
.workflow-config-node-panel .workflow-selector-heading, .workflow-config-node-panel .workflow-required-nodes, .workflow-config-node-panel .workflow-selector-hint { flex-shrink: 0; }
.workflow-config-node-panel .workflow-node-options { flex: 1; grid-template-rows: repeat(3, minmax(44px, 1fr)); }
.workflow-config-owner-panel { display: flex; flex-direction: column; min-height: 0; min-width: 0; padding: 16px; border: 1px solid var(--color-border); border-radius: 8px; background: var(--theme-surface-muted, #fafbfc); }
.workflow-config-owner-panel > header { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 10px; flex-shrink: 0; margin-bottom: 14px; font-size: 13px; }
.workflow-config-owner-panel > header small { color: var(--color-text-secondary); font-size: 12px; }
.workflow-config-owner-content { flex: 1; min-height: 0; overflow-y: auto; scrollbar-gutter: stable; }
.workflow-config-owner-panel .workflow-owner-fields { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 0; }
.workflow-owner-empty { display: flex; height: 100%; min-height: 100px; flex-direction: column; align-items: center; justify-content: center; color: var(--color-text-secondary); text-align: center; }
.workflow-owner-empty > span { display: grid; place-items: center; width: 38px; height: 38px; border: 1px dashed var(--color-border); border-radius: 10px; color: var(--color-primary); font-size: 22px; }
.workflow-owner-empty p { font-size: 13px; line-height: 1.8; }
.workflow-config-owner-content:has([data-workflow-owner-node]:not([hidden])) .workflow-owner-empty { display: none; }
.workflow-config-dialog .stage-action-header, .workflow-config-dialog .stage-action-footer { flex-shrink: 0; }
.workflow-config-dialog .stage-action-footer > div { display: flex; gap: 8px; }
@media (max-width: 820px) {
  .workflow-config-dialog { height: min(800px, calc(100dvh - 32px)); max-height: calc(100dvh - 32px); }
  .workflow-config-dialog-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1.15fr) minmax(0, 1fr); gap: 14px; padding: 16px; }
  .workflow-config-owner-panel { padding: 12px; }
  .workflow-config-owner-panel .workflow-owner-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workflow-config-owner-panel > header { margin-bottom: 10px; }
}
@media (max-width: 600px) {
  .workflow-node-options, .workflow-owner-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workflow-config-node-panel .workflow-node-options { grid-template-rows: repeat(5, minmax(44px, 1fr)); }
}

.order-marker-choices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.order-marker-choice { min-width: 0; min-height: 76px; padding: 12px 6px; border: 1px solid var(--color-border); border-radius: 8px; color: var(--color-text); background: var(--color-surface); font-size: 16px; font-weight: 650; cursor: pointer; }
.order-marker-choice:hover, .order-marker-choice:focus-visible, .order-marker-choice[aria-pressed="true"] { border-color: var(--color-primary); color: var(--color-primary); background: var(--color-primary-soft); }
.order-marker-choice:disabled { cursor: wait; opacity: .65; }

[data-order-marker="key_customer"] {
  --order-marker-text: var(--theme-amber-text, #9a4d08);
  --order-marker-soft: var(--theme-amber-soft, #fffbeb);
  --order-marker-border: var(--theme-amber-border, #fde68a);
}
[data-order-marker="company_style"] {
  --order-marker-text: var(--theme-purple-text, #6d28d9);
  --order-marker-soft: var(--theme-purple-soft, #f5f3ff);
  --order-marker-border: var(--theme-purple-border, #ddd6fe);
}
[data-order-marker="customer_style"] {
  --order-marker-text: var(--theme-blue-text, #1d4ed8);
  --order-marker-soft: var(--theme-blue-soft, #eff6ff);
  --order-marker-border: var(--theme-blue-border, #bfdbfe);
}
[data-order-marker="ordered"] {
  --order-marker-text: var(--theme-green-text, #166534);
  --order-marker-soft: var(--theme-green-soft, #f0fdf4);
  --order-marker-border: var(--theme-green-border, #bbf7d0);
}
.order-marker-label[data-order-marker]:not([data-order-marker=""]) { color: var(--order-marker-text); }
.order-marker-tag[data-order-marker]:not([data-order-marker=""]),
.order-marker-choice[data-order-marker] {
  color: var(--order-marker-text);
  background: var(--order-marker-soft);
  border-color: var(--order-marker-border);
}
.order-marker-choice[data-order-marker]:hover,
.order-marker-choice[data-order-marker]:focus-visible,
.order-marker-choice[data-order-marker][aria-pressed="true"] {
  border-color: var(--order-marker-text);
  box-shadow: inset 0 0 0 1px var(--order-marker-text);
}
