:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --ink: #17212f;
  --muted: #6b7788;
  --line: #dce3ea;
  --accent: #0f766e;
  --accent-2: #b42318;
  --gold: #c28a2c;
  --blue: #2764c5;
  --shadow: 0 8px 24px rgba(20, 35, 55, 0.08);
}

/* Store analysis cockpit v1: selected visual direction 3 */
body.ui-layered #storeAnalysis-view {
  gap: 12px;
  color: #253943;
}

body.ui-layered #storeAnalysis-view .store-analysis-cockpit-shell {
  display: grid;
  gap: 12px;
}

body.ui-layered #storeAnalysis-view .store-analysis-cockpit-toolbar {
  display: grid;
  grid-template-columns: 132px 126px 138px 138px minmax(190px, 1fr) auto;
  align-items: end;
  gap: 10px;
  border: 1px solid #d8e1e6;
  border-radius: 8px;
  padding: 11px 12px;
  background: #ffffff;
  box-shadow: 0 5px 16px rgba(26, 46, 55, 0.045);
}

body.ui-layered #storeAnalysis-view .store-analysis-cockpit-toolbar label {
  min-width: 0;
  display: grid;
  gap: 5px;
}

body.ui-layered #storeAnalysis-view .store-analysis-cockpit-toolbar label > span {
  color: #64777f;
  font-size: 11px;
  font-weight: 720;
}

body.ui-layered #storeAnalysis-view .store-analysis-cockpit-toolbar input,
body.ui-layered #storeAnalysis-view .store-analysis-cockpit-toolbar select,
body.ui-layered #storeAnalysis-view .store-analysis-queue-footer select {
  width: 100%;
  height: 36px;
  border: 1px solid #ccd8de;
  border-radius: 6px;
  padding: 0 10px;
  color: #263d46;
  background: #ffffff;
}

body.ui-layered #storeAnalysis-view .store-analysis-cockpit-toolbar input:focus-visible,
body.ui-layered #storeAnalysis-view .store-analysis-cockpit-toolbar select:focus-visible,
body.ui-layered #storeAnalysis-view .store-analysis-queue-row:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.2);
  outline-offset: 1px;
}

body.ui-layered #storeAnalysis-view .store-analysis-cockpit-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
}

body.ui-layered #storeAnalysis-view .store-analysis-cockpit-actions button {
  min-height: 36px;
  white-space: nowrap;
}

body.ui-layered #storeAnalysis-view .store-analysis-batch-trigger {
  min-width: 176px;
  border: 1px solid #0f766e;
  border-radius: 7px;
  padding: 7px 12px;
  color: #ffffff;
  background: #0f766e;
  font-weight: 760;
  cursor: pointer;
}

body.ui-layered #storeAnalysis-view .store-analysis-batch-trigger:hover:not(:disabled) {
  background: #0c665f;
}

body.ui-layered #storeAnalysis-view .store-analysis-batch-trigger:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.22);
  outline-offset: 2px;
}

body.ui-layered #storeAnalysis-view .store-analysis-batch-trigger:disabled {
  border-color: #a9b8bc;
  color: #f7f9fa;
  background: #a9b8bc;
  cursor: not-allowed;
}

body.ui-layered #storeAnalysis-view .store-analysis-error-banner {
  border: 1px solid #efc8c4;
  border-radius: 7px;
  padding: 9px 12px;
  color: #a13b33;
  background: #fff7f5;
  font-size: 12px;
}

body.ui-layered #storeAnalysis-view .store-analysis-sync-banner {
  border: 1px solid #c9ddd9;
  border-radius: 7px;
  padding: 8px 12px;
  color: #35665f;
  background: #f4fbf9;
  font-size: 12px;
}

body.ui-layered #storeAnalysis-view .store-analysis-sync-banner.fallback {
  border-color: #ead5a7;
  color: #7a5b18;
  background: #fffaf0;
}

body.ui-layered #storeAnalysis-view .store-analysis-batch-banner {
  display: grid;
  gap: 8px;
  border: 1px solid #b9d9d4;
  border-radius: 8px;
  padding: 11px 13px;
  color: #294a50;
  background: #f3faf8;
  box-shadow: 0 5px 16px rgba(26, 46, 55, 0.04);
}

body.ui-layered #storeAnalysis-view .store-analysis-batch-banner.warn {
  border-color: #e4cf9d;
  background: #fffaf0;
}

body.ui-layered #storeAnalysis-view .store-analysis-batch-banner.error {
  border-color: #efc8c4;
  background: #fff7f5;
}

body.ui-layered #storeAnalysis-view .store-analysis-batch-banner.done {
  border-color: #b8dacb;
  background: #f2faf6;
}

body.ui-layered #storeAnalysis-view .store-analysis-batch-head,
body.ui-layered #storeAnalysis-view .store-analysis-batch-progress,
body.ui-layered #storeAnalysis-view .store-analysis-batch-stats {
  display: flex;
  align-items: center;
  gap: 10px;
}

body.ui-layered #storeAnalysis-view .store-analysis-batch-head {
  justify-content: space-between;
}

body.ui-layered #storeAnalysis-view .store-analysis-batch-head > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

body.ui-layered #storeAnalysis-view .store-analysis-batch-head strong {
  color: #17383d;
  font-size: 13px;
}

body.ui-layered #storeAnalysis-view .store-analysis-batch-head span,
body.ui-layered #storeAnalysis-view .store-analysis-batch-stats,
body.ui-layered #storeAnalysis-view .store-analysis-batch-banner p {
  color: #62777d;
  font-size: 11px;
}

body.ui-layered #storeAnalysis-view .store-analysis-batch-progress progress {
  width: 100%;
  height: 9px;
  accent-color: #0f766e;
}

body.ui-layered #storeAnalysis-view .store-analysis-batch-progress strong {
  min-width: 58px;
  color: #24454b;
  font-size: 12px;
  text-align: right;
}

body.ui-layered #storeAnalysis-view .store-analysis-batch-stats {
  flex-wrap: wrap;
}

body.ui-layered #storeAnalysis-view .store-analysis-batch-stats span {
  border-right: 1px solid #cfddda;
  padding-right: 10px;
}

body.ui-layered #storeAnalysis-view .store-analysis-batch-stats span:last-child {
  border-right: 0;
}

body.ui-layered #storeAnalysis-view .store-analysis-batch-stats .current {
  color: #0f6d66;
  font-weight: 760;
}

body.ui-layered #storeAnalysis-view .store-analysis-batch-banner p {
  margin: 0;
}

body.ui-layered #storeAnalysis-view .store-analysis-batch-actions button {
  min-height: 34px;
  padding: 6px 10px;
}

body.ui-layered #storeAnalysis-view .store-analysis-cockpit-counters {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) minmax(200px, 1.15fr);
  overflow: hidden;
  border: 1px solid #d9e2e6;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 5px 16px rgba(26, 46, 55, 0.04);
}

body.ui-layered #storeAnalysis-view .store-analysis-cockpit-counters article {
  min-height: 86px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-right: 1px solid #e2e8eb;
  padding: 13px 16px;
}

body.ui-layered #storeAnalysis-view .store-analysis-cockpit-counters article:last-child {
  border-right: 0;
}

body.ui-layered #storeAnalysis-view .store-analysis-cockpit-counters article > div {
  min-width: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  column-gap: 7px;
}

body.ui-layered #storeAnalysis-view .store-analysis-cockpit-counters strong {
  color: #162d36;
  font-size: 25px;
  line-height: 1;
}

body.ui-layered #storeAnalysis-view .store-analysis-cockpit-counters span:not(.store-analysis-status-dot) {
  color: #374f58;
  font-size: 12px;
  font-weight: 760;
}

body.ui-layered #storeAnalysis-view .store-analysis-cockpit-counters small {
  grid-column: 1 / -1;
  margin-top: 9px;
  color: #7b8c92;
  font-size: 10px;
  line-height: 1.45;
}

body.ui-layered #storeAnalysis-view .store-analysis-status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  display: inline-block;
  border-radius: 50%;
  margin-top: 5px;
  background: #9aa7ac;
}

body.ui-layered #storeAnalysis-view .store-analysis-status-dot.focus { background: #d74b43; }
body.ui-layered #storeAnalysis-view .store-analysis-status-dot.watch { background: #d99a1d; }
body.ui-layered #storeAnalysis-view .store-analysis-status-dot.stable { background: #1d8b68; }
body.ui-layered #storeAnalysis-view .store-analysis-status-dot.incomparable { background: #5c7c8a; }
body.ui-layered #storeAnalysis-view .store-analysis-status-dot.pending { background: #9aa7ac; }
body.ui-layered #storeAnalysis-view .store-analysis-status-dot.running {
  background: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

body.ui-layered #storeAnalysis-view .store-analysis-cockpit-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(560px, 1.25fr) minmax(440px, 1fr);
  align-items: start;
  gap: 10px;
}

body.ui-layered #storeAnalysis-view .store-analysis-queue-panel,
body.ui-layered #storeAnalysis-view .store-analysis-inspector {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d9e2e6;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(26, 46, 55, 0.045);
}

body.ui-layered #storeAnalysis-view .store-analysis-queue-head,
body.ui-layered #storeAnalysis-view .store-analysis-inspector-head,
body.ui-layered #storeAnalysis-view .store-analysis-inspector-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

body.ui-layered #storeAnalysis-view .store-analysis-queue-head {
  min-height: 60px;
  align-items: center;
  border-bottom: 1px solid #dfe6e9;
  padding: 10px 13px;
}

body.ui-layered #storeAnalysis-view .store-analysis-queue-head h2,
body.ui-layered #storeAnalysis-view .store-analysis-inspector-head h2,
body.ui-layered #storeAnalysis-view .store-analysis-inspector-section-head h3 {
  margin: 0;
  color: #1e343d;
}

body.ui-layered #storeAnalysis-view .store-analysis-queue-head h2 {
  font-size: 15px;
}

body.ui-layered #storeAnalysis-view .store-analysis-queue-head p,
body.ui-layered #storeAnalysis-view .store-analysis-inspector-head p {
  margin: 3px 0 0;
  color: #7a8b91;
  font-size: 10px;
}

body.ui-layered #storeAnalysis-view .store-analysis-queue-head > span {
  color: #74868c;
  font-size: 10px;
  white-space: nowrap;
}

body.ui-layered #storeAnalysis-view .store-analysis-queue-table {
  max-height: calc(100vh - 322px);
  min-height: 470px;
  overflow: auto;
}

body.ui-layered #storeAnalysis-view .store-analysis-queue-table table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

body.ui-layered #storeAnalysis-view .store-analysis-queue-table th:nth-child(1) { width: 62px; }
body.ui-layered #storeAnalysis-view .store-analysis-queue-table th:nth-child(2) { width: 98px; }
body.ui-layered #storeAnalysis-view .store-analysis-queue-table th:nth-child(3) { width: 62px; }
body.ui-layered #storeAnalysis-view .store-analysis-queue-table th:nth-child(4) { width: 78px; }
body.ui-layered #storeAnalysis-view .store-analysis-queue-table th:nth-child(5) { width: 58px; }
body.ui-layered #storeAnalysis-view .store-analysis-queue-table th:nth-child(6) { width: 72px; }
body.ui-layered #storeAnalysis-view .store-analysis-queue-table th:nth-child(7) { width: 58px; }
body.ui-layered #storeAnalysis-view .store-analysis-queue-table th:nth-child(9) { width: 48px; }

body.ui-layered #storeAnalysis-view .store-analysis-queue-table thead {
  position: sticky;
  top: 0;
  z-index: 3;
}

body.ui-layered #storeAnalysis-view .store-analysis-queue-table th,
body.ui-layered #storeAnalysis-view .store-analysis-queue-table td {
  border-bottom: 1px solid #e4e9ec;
  padding: 9px 6px;
  color: #344b54;
  font-size: 11px;
  text-align: left;
  white-space: nowrap;
}

body.ui-layered #storeAnalysis-view .store-analysis-queue-table thead th {
  color: #60747c;
  background: #f6f8f9;
  font-size: 10px;
  font-weight: 780;
}

body.ui-layered #storeAnalysis-view .store-analysis-queue-group-row th {
  padding: 8px 12px;
  color: #324952;
  background: #fafbfb;
  font-size: 11px;
}

body.ui-layered #storeAnalysis-view .store-analysis-queue-group-row .store-analysis-status-dot {
  margin: 0 8px 1px 0;
}

body.ui-layered #storeAnalysis-view .store-analysis-queue-row {
  cursor: pointer;
  transition: background-color 0.14s ease, box-shadow 0.14s ease;
}

body.ui-layered #storeAnalysis-view .store-analysis-queue-row:hover {
  background: #f4f9f8;
}

body.ui-layered #storeAnalysis-view .store-analysis-queue-row.selected {
  position: relative;
  z-index: 1;
  background: #eef7f6;
  box-shadow: inset 0 0 0 1px #24857d;
}

body.ui-layered #storeAnalysis-view .store-analysis-queue-row.batch-current:not(.selected) {
  background: #f1f9f7;
  box-shadow: inset 3px 0 0 #0f766e;
}

body.ui-layered #storeAnalysis-view .store-analysis-queue-row td:nth-child(2) strong,
body.ui-layered #storeAnalysis-view .store-analysis-queue-row td:nth-child(2) small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.ui-layered #storeAnalysis-view .store-analysis-queue-row td:nth-child(2) strong {
  color: #263e47;
  font-size: 11px;
}

body.ui-layered #storeAnalysis-view .store-analysis-queue-row td:nth-child(2) small,
body.ui-layered #storeAnalysis-view .store-analysis-queue-row .muted {
  margin-top: 2px;
  color: #829198;
  font-size: 9px;
}

body.ui-layered #storeAnalysis-view .store-analysis-queue-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #425860;
  font-size: 10px;
  font-weight: 760;
}

body.ui-layered #storeAnalysis-view .store-analysis-queue-status .store-analysis-status-dot {
  margin: 0;
}

body.ui-layered #storeAnalysis-view .store-analysis-queue-issue {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.ui-layered #storeAnalysis-view .store-analysis-queue-footer {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #e0e6e9;
  padding: 8px 12px;
  color: #65777e;
  font-size: 10px;
}

body.ui-layered #storeAnalysis-view .store-analysis-queue-footer > div {
  display: flex;
  align-items: center;
  gap: 7px;
}

body.ui-layered #storeAnalysis-view .store-analysis-queue-footer button {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 10px;
}

body.ui-layered #storeAnalysis-view .store-analysis-queue-footer select {
  width: auto;
  height: 30px;
  padding-right: 24px;
  font-size: 10px;
}

body.ui-layered #storeAnalysis-view .store-analysis-inspector {
  position: sticky;
  top: -10px;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
}

body.ui-layered #storeAnalysis-view .store-analysis-inspector-head {
  border-bottom: 1px solid #e0e6e9;
  padding: 13px 14px 11px;
}

body.ui-layered #storeAnalysis-view .store-analysis-inspector-head h2 {
  font-size: 18px;
}

body.ui-layered #storeAnalysis-view .store-analysis-inspector-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

body.ui-layered #storeAnalysis-view .store-analysis-inspector-head > small {
  color: #75878e;
  font-size: 9px;
  white-space: nowrap;
}

body.ui-layered #storeAnalysis-view .store-analysis-inspector-notice {
  margin: 10px 12px 0;
  border: 1px solid #edc9c5;
  border-radius: 7px;
  padding: 9px 10px;
  color: #a13f38;
  background: #fff7f5;
  font-size: 10px;
  line-height: 1.55;
}

body.ui-layered #storeAnalysis-view .store-analysis-inspector-notice.pending {
  border-color: #d6dfe3;
  color: #65777f;
  background: #f7f9fa;
}

body.ui-layered #storeAnalysis-view .store-analysis-inspector-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  padding: 10px 12px;
}

body.ui-layered #storeAnalysis-view .store-analysis-inspector-metric {
  min-width: 0;
  min-height: 88px;
  display: grid;
  align-content: center;
  gap: 5px;
  border: 1px solid #dfe6e9;
  border-radius: 7px;
  padding: 8px 6px;
  background: #ffffff;
}

body.ui-layered #storeAnalysis-view .store-analysis-inspector-metric span,
body.ui-layered #storeAnalysis-view .store-analysis-inspector-metric small {
  color: #74868d;
  font-size: 9px;
}

body.ui-layered #storeAnalysis-view .store-analysis-inspector-metric strong {
  min-width: 0;
  white-space: nowrap;
  color: #1b3039;
  font-size: clamp(14px, 1.1vw, 16px);
  line-height: 1.05;
}

body.ui-layered #storeAnalysis-view .store-analysis-inspector-section {
  display: grid;
  gap: 9px;
  border-top: 1px solid #e3e8eb;
  padding: 11px 12px;
}

body.ui-layered #storeAnalysis-view .store-analysis-inspector-section-head {
  align-items: baseline;
}

body.ui-layered #storeAnalysis-view .store-analysis-inspector-section-head h3 {
  font-size: 12px;
}

body.ui-layered #storeAnalysis-view .store-analysis-inspector-section-head span {
  color: #7b8b92;
  font-size: 9px;
  text-align: right;
}

body.ui-layered #storeAnalysis-view .store-analysis-peer-list {
  display: grid;
  gap: 8px;
}

body.ui-layered #storeAnalysis-view .store-analysis-peer-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 8px;
  color: #566b73;
  font-size: 9px;
}

body.ui-layered #storeAnalysis-view .store-analysis-peer-band {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: #cfd7dc;
}

body.ui-layered #storeAnalysis-view .store-analysis-peer-band i {
  position: absolute;
  top: 50%;
  left: var(--peer-percentile);
  width: 8px;
  height: 8px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: #0f766e;
  box-shadow: 0 0 0 1px #0f766e;
  transform: translate(-50%, -50%);
}

body.ui-layered #storeAnalysis-view .store-analysis-peer-unavailable {
  grid-column: 2 / 4;
  border-bottom: 1px dashed #d2dadd;
  padding-bottom: 3px;
  color: #8a989d;
}

body.ui-layered #storeAnalysis-view .store-analysis-period-trend-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

body.ui-layered #storeAnalysis-view .store-analysis-period-trend-metric {
  min-width: 0;
  display: grid;
  gap: 7px;
  border: 1px solid #dfe6e9;
  border-radius: 7px;
  padding: 8px;
  background: #fbfcfc;
}

body.ui-layered #storeAnalysis-view .store-analysis-period-trend-metric header {
  min-width: 0;
  display: grid;
  gap: 2px;
}

body.ui-layered #storeAnalysis-view .store-analysis-period-trend-metric header strong {
  color: #304750;
  font-size: 10px;
}

body.ui-layered #storeAnalysis-view .store-analysis-period-trend-metric header span {
  overflow: hidden;
  color: #708189;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.ui-layered #storeAnalysis-view .store-analysis-period-trend-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(22px, 1fr) 58px;
  align-items: center;
  gap: 5px;
  color: #71838a;
  font-size: 9px;
}

body.ui-layered #storeAnalysis-view .store-analysis-period-trend-row b {
  overflow: hidden;
  color: #344b54;
  font-size: 9px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.ui-layered #storeAnalysis-view .store-analysis-period-trend-row.current b {
  color: #0f766e;
}

body.ui-layered #storeAnalysis-view .store-analysis-period-trend-row progress {
  width: 100%;
  height: 6px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #dce4e7;
  accent-color: #0f766e;
}

body.ui-layered #storeAnalysis-view .store-analysis-period-trend-row progress::-webkit-progress-bar {
  border-radius: 999px;
  background: #dce4e7;
}

body.ui-layered #storeAnalysis-view .store-analysis-period-trend-row progress::-webkit-progress-value {
  border-radius: 999px;
  background: #0f766e;
}

body.ui-layered #storeAnalysis-view .store-analysis-period-trend-metric.inverse .store-analysis-period-trend-row progress {
  accent-color: #c36a16;
}

body.ui-layered #storeAnalysis-view .store-analysis-period-trend-metric.inverse .store-analysis-period-trend-row progress::-webkit-progress-value {
  background: #c36a16;
}

body.ui-layered #storeAnalysis-view .store-analysis-period-trend-empty {
  border: 1px dashed #d4dde1;
  border-radius: 6px;
  padding: 8px;
  color: #7e8e94;
  background: #fafbfb;
  font-size: 9px;
  line-height: 1.45;
}

body.ui-layered #storeAnalysis-view .store-analysis-evidence-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

body.ui-layered #storeAnalysis-view .store-analysis-evidence-list li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  border: 1px solid #e0e6e9;
  border-radius: 6px;
  padding: 7px 8px;
  background: #fbfcfc;
}

body.ui-layered #storeAnalysis-view .store-analysis-evidence-list li > i {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: #16776f;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

body.ui-layered #storeAnalysis-view .store-analysis-evidence-list strong {
  color: #304750;
  font-size: 10px;
}

body.ui-layered #storeAnalysis-view .store-analysis-evidence-list p {
  margin: 2px 0 0;
  color: #6f8087;
  font-size: 9px;
  line-height: 1.5;
}

body.ui-layered #storeAnalysis-view .store-analysis-inspector-actions {
  display: grid;
  grid-template-columns: 1.25fr 1fr 0.8fr;
  gap: 7px;
  border-top: 1px solid #e3e8eb;
  padding: 10px 12px;
}

body.ui-layered #storeAnalysis-view .store-analysis-inspector-actions form,
body.ui-layered #storeAnalysis-view .store-analysis-inspector-actions button {
  min-width: 0;
  width: 100%;
}

body.ui-layered #storeAnalysis-view .store-analysis-inspector-actions button {
  min-height: 36px;
  padding: 7px 9px;
  font-size: 10px;
}

body.ui-layered #storeAnalysis-view .store-analysis-inspector-actions .store-analysis-primary-action {
  border: 1px solid var(--accent);
  border-radius: 7px;
  color: #ffffff;
  background: var(--accent);
  box-shadow: var(--shadow-soft);
  font-weight: 720;
}

body.ui-layered #storeAnalysis-view .store-analysis-inspector-actions .store-analysis-primary-action:hover {
  filter: brightness(0.96);
  transform: translateY(-1px);
}

body.ui-layered #storeAnalysis-view .store-analysis-freshness-compact {
  display: grid;
  gap: 8px;
  border-top: 1px solid #e3e8eb;
  padding: 10px 12px 12px;
}

body.ui-layered #storeAnalysis-view .store-analysis-freshness-compact > div:last-child {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #dfe6e9;
  border-radius: 6px;
}

body.ui-layered #storeAnalysis-view .store-analysis-freshness-compact > div:last-child > span {
  min-width: 0;
  display: grid;
  gap: 2px;
  border-right: 1px solid #e3e8eb;
  padding: 7px;
  color: #65777e;
  font-size: 8px;
}

body.ui-layered #storeAnalysis-view .store-analysis-freshness-compact > div:last-child > span:last-child {
  border-right: 0;
}

body.ui-layered #storeAnalysis-view .store-analysis-freshness-compact strong {
  color: #344b54;
  font-size: 9px;
}

body.ui-layered #storeAnalysis-view .store-analysis-freshness-compact small {
  color: #8a989d;
  font-size: 7px;
}

body.ui-layered #storeAnalysis-view .store-analysis-cockpit-empty {
  min-height: 250px;
  display: grid;
  place-content: center;
  gap: 5px;
  padding: 28px;
  color: #7d8c92;
  text-align: center;
}

body.ui-layered #storeAnalysis-view .store-analysis-cockpit-empty strong {
  color: #3e555e;
}

body.ui-layered #storeAnalysis-view .store-analysis-detail-toolbar {
  position: sticky;
  top: -22px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #d8e1e5;
  border-radius: 8px;
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 6px 18px rgba(26, 46, 55, 0.07);
}

body.ui-layered #storeAnalysis-view .store-analysis-detail-toolbar > div {
  display: grid;
  justify-items: center;
}

body.ui-layered #storeAnalysis-view .store-analysis-detail-toolbar span {
  color: #7a8b91;
  font-size: 10px;
}

@media (max-width: 1240px) {
  body.ui-layered #storeAnalysis-view .store-analysis-cockpit-toolbar {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
  }

  body.ui-layered #storeAnalysis-view .store-analysis-cockpit-toolbar .search {
    grid-column: span 2;
  }

  body.ui-layered #storeAnalysis-view .store-analysis-cockpit-actions {
    grid-column: span 2;
  }

  body.ui-layered #storeAnalysis-view .store-analysis-cockpit-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body.ui-layered #storeAnalysis-view .store-analysis-inspector {
    position: static;
    max-height: none;
  }
}

@media (max-width: 820px) {
  body.ui-layered #storeAnalysis-view .store-analysis-cockpit-toolbar,
  body.ui-layered #storeAnalysis-view .store-analysis-cockpit-counters,
  body.ui-layered #storeAnalysis-view .store-analysis-inspector-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.ui-layered #storeAnalysis-view .store-analysis-cockpit-toolbar .search {
    grid-column: span 2;
  }

  body.ui-layered #storeAnalysis-view .store-analysis-cockpit-actions {
    grid-column: span 2;
    justify-content: stretch;
  }

  body.ui-layered #storeAnalysis-view .store-analysis-cockpit-actions button {
    flex: 1 1 0;
    min-width: 0;
  }

  body.ui-layered #storeAnalysis-view .store-analysis-batch-head,
  body.ui-layered #storeAnalysis-view .store-analysis-batch-stats {
    align-items: flex-start;
  }

  body.ui-layered #storeAnalysis-view .store-analysis-cockpit-counters article:nth-child(2n) {
    border-right: 0;
  }

  body.ui-layered #storeAnalysis-view .store-analysis-inspector-actions,
  body.ui-layered #storeAnalysis-view .store-analysis-freshness-compact > div:last-child {
    grid-template-columns: minmax(0, 1fr);
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 Geist, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible),
summary:focus:not(:focus-visible) {
  outline: none;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  padding: 24px;
  background: #eef2f5;
}

.auth-lock .auth-screen {
  display: grid;
}

.auth-lock .shell {
  display: none;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-brand {
  padding: 0 0 10px;
  color: var(--ink);
}

.login-card button {
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  padding: 10px 14px;
}

#login-result {
  color: var(--accent-2);
  min-height: 20px;
}

.shell {
  display: grid;
  grid-template-columns: 232px 1fr;
  height: 100vh;
  overflow: hidden;
  transition: grid-template-columns 0.2s ease;
}

.shell.sidebar-collapsed {
  grid-template-columns: 76px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  background: #18202b;
  color: #f8fafc;
  padding: 20px 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 24px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--gold);
  color: #111827;
  font-weight: 800;
}

.brand-logo {
  width: 64px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 8px;
  object-fit: contain;
  background: var(--gold);
}

.login-brand .brand-logo {
  width: 72px;
  height: 54px;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: #aeb8c5;
  margin-top: 3px;
}

.brand-text {
  min-width: 0;
  white-space: nowrap;
}

.sidebar-toggle {
  width: 100%;
  border: 1px solid rgba(200, 209, 220, 0.18);
  border-radius: 6px;
  padding: 7px 10px;
  background: #222d3a;
  color: #d8e0ea;
  text-align: center;
  align-self: end;
}

.sidebar-toggle:hover {
  background: #2c3948;
  color: #ffffff;
}

nav {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.nav {
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  border-radius: 6px;
  background: transparent;
  color: #c8d1dc;
}

.nav.active,
.nav:hover {
  background: #263241;
  color: #ffffff;
}

.main {
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 22px;
}

.site-footer {
  padding: 18px 0 4px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.shell.sidebar-collapsed .sidebar {
  padding: 16px 10px;
}

.shell.sidebar-collapsed .brand {
  justify-content: center;
  padding: 4px 0 10px;
}

.shell.sidebar-collapsed .brand-logo {
  width: 44px;
  height: 44px;
}

.shell.sidebar-collapsed .brand-text {
  display: none;
}

.shell.sidebar-collapsed .sidebar-toggle {
  padding: 7px 0;
}

.shell.sidebar-collapsed .nav {
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  white-space: nowrap;
  font-size: 0;
}

.shell.sidebar-collapsed .nav::after {
  content: attr(data-short);
  font-size: 13px;
  font-weight: 700;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  line-height: 1.25;
}

h2 {
  font-size: 15px;
}

.topbar p {
  color: var(--muted);
  margin-top: 6px;
}

.actions,
.inline-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--muted);
  background: var(--surface);
}

.pill.ok {
  color: var(--accent);
  border-color: #8fd6ca;
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 14px;
}

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

.metric,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 16px;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  font-size: 26px;
  margin-top: 10px;
}

.grid.two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.filter-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfd;
}

.filter-wide {
  grid-column: span 2;
}

#operation-filters .filter-item:nth-child(1) {
  grid-column: 1 / span 2;
}

#operation-filters .filter-item:nth-child(2) {
  grid-column: 3 / span 2;
}

#operation-filters .filter-item:nth-child(3) {
  grid-column: 5 / span 2;
}

#operation-filters .filter-item:nth-child(4) {
  grid-column: 1 / span 2;
}

#operation-filters .filter-item:nth-child(5) {
  grid-column: 3 / span 2;
}

#operation-filters .filter-item:nth-child(6) {
  grid-column: 5 / span 2;
}

.operation-weather {
  padding: 14px 18px;
}

.weather-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.weather-header strong {
  color: var(--ink);
  font-size: 16px;
}

.weather-header span {
  color: var(--muted);
  font-size: 12px;
}

.weather-city-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  max-height: 520px;
  overflow: auto;
  padding-right: 3px;
}

.weather-city-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: stretch;
  min-height: 148px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 10px;
}

.weather-city-main {
  display: grid;
  align-content: start;
  gap: 3px;
  min-width: 0;
}

.weather-city-main strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weather-city-main span {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.1;
}

.weather-city-main small {
  color: var(--muted);
  font-size: 12px;
}

.weather-forecast {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.weather-day {
  display: grid;
  align-content: center;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 7px;
  background: #ffffff;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  min-width: 0;
}

.weather-day.weather-day-alert {
  border-color: #fecdd3;
  background: #fff1f2;
}

.weather-day.weather-day-alert b,
.weather-day.weather-day-alert span,
.weather-day.weather-day-alert small {
  color: #9f1239;
}

.weather-day b {
  color: var(--ink);
}

.weather-day span,
.weather-day small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1280px) {
  .weather-city-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

.date-presets button {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 7px;
  color: var(--ink);
  background: #ffffff;
  font-size: 13px;
}

.date-presets button.active {
  color: #ffffff;
  border-color: var(--accent);
  background: var(--accent);
}

.filter-item span,
.op-metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.filter-item strong {
  display: block;
  margin-top: 7px;
  font-size: 15px;
}

.source-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

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

.source-details summary span {
  color: var(--muted);
  font-size: 13px;
}

.source-details[open] .source-list {
  margin-top: 12px;
}

.source-table {
  margin-top: 12px;
}

.operation-modules {
  display: grid;
  gap: 14px;
}

.op-module .panel-title p {
  color: var(--muted);
  margin-top: 5px;
}

.op-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.op-metric {
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: #fbfcfd;
}

.op-metric.clickable {
  cursor: pointer;
}

.op-metric strong {
  display: block;
  margin-top: 7px;
  font-size: 18px;
  line-height: 1.2;
}

.trend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.trend {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  background: #eef2f6;
  color: var(--muted);
  font-size: 11px;
}

.trend.up {
  background: #e7f5f3;
  color: var(--accent);
}

.trend.down {
  background: #fff1f0;
  color: var(--accent-2);
}

.trend.flat {
  background: #f1f4f7;
  color: var(--muted);
}

.op-metric small {
  display: block;
  color: var(--blue);
  margin-top: 7px;
}

.op-metric p {
  color: var(--muted);
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.45;
}

.metric-toggle {
  margin-top: 8px;
  border-radius: 6px;
  padding: 7px 9px;
  background: #eef7f6;
  color: var(--accent);
  font-size: 12px;
}

.metric-drilldown {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.metric-drilldown-wide {
  grid-column: 1 / -1;
  margin-top: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.full-row {
  grid-column: 1 / -1;
  width: 100%;
}

.metric-drilldown h4 {
  margin: 0 0 8px;
  font-size: 13px;
}

.op-metric.missing {
  background: #fffafa;
  border-color: #f0c6c2;
}

.op-metric.partial {
  background: #fffdf4;
  border-color: #ead595;
}

.op-group {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.op-group h3 {
  margin: 0;
  font-size: 15px;
}

.op-conclusion {
  margin-top: 14px;
  border-left: 3px solid var(--accent);
  background: #f3faf8;
  padding: 11px 12px;
  color: #28443e;
  line-height: 1.55;
}

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

.brief-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.brief-card h3 {
  margin: 0 0 7px;
  font-size: 14px;
}

.brief-card p {
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}

.tone-good {
  color: var(--accent);
  font-weight: 700;
}

.tone-bad {
  color: var(--accent-2);
  font-weight: 700;
}

.op-visual {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.op-visual h3 {
  margin: 0 0 12px;
  font-size: 14px;
}

.funnel-model {
  display: grid;
  grid-template-columns: 70px minmax(520px, 1fr);
  gap: 16px;
  align-items: stretch;
}

.funnel-axis {
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  color: var(--muted);
  font-weight: 700;
}

.funnel-axis i {
  width: 14px;
  min-height: 180px;
  border-radius: 999px;
  background: linear-gradient(180deg, #c92c50 0%, #2764c5 100%);
  position: relative;
}

.funnel-axis i::before,
.funnel-axis i::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
}

.funnel-axis i::before {
  top: -10px;
  border-bottom: 18px solid #c92c50;
}

.funnel-axis i::after {
  bottom: -10px;
  border-top: 18px solid #2764c5;
}

.funnel-stack {
  display: grid;
  grid-template-columns: minmax(280px, 56%) minmax(220px, 1fr);
  align-items: center;
  row-gap: 0;
  column-gap: 24px;
}

.funnel-band {
  width: var(--band-width);
  min-width: 130px;
  height: 72px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(70px, 1fr) auto;
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 2px 10px;
  padding: 10px 20px;
  color: #ffffff;
  background: var(--band-color);
  clip-path: polygon(8% 0, 92% 0, 100% 100%, 0 100%);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.24);
}

.funnel-band + .funnel-note + .funnel-band {
  margin-top: -1px;
}

.funnel-band span,
.funnel-band strong,
.funnel-band em {
  position: relative;
  z-index: 1;
}

.funnel-band span {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.funnel-band strong {
  justify-self: end;
  font-size: 18px;
}

.funnel-band em {
  grid-column: 1 / -1;
  font-size: 11px;
  font-style: normal;
  opacity: 0.9;
}

.funnel-note {
  display: grid;
  gap: 4px;
  min-height: 72px;
  align-content: center;
  border-top: 1px dashed #c9d5e4;
  color: var(--muted);
  font-size: 12px;
}

.funnel-note b {
  color: var(--text);
  font-size: 13px;
}

.funnel-note em {
  font-style: normal;
  color: var(--accent);
}

.flow-chart {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  align-items: center;
}

.flow-node {
  min-height: 74px;
  border: 1px solid #bdd7d3;
  border-radius: 8px;
  padding: 10px;
  background: #f3faf8;
}

.flow-node span,
.flow-node strong {
  display: block;
}

.flow-node span {
  color: var(--muted);
  font-size: 13px;
}

.flow-node strong {
  margin-top: 7px;
  font-size: 16px;
}

.flow-node em {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.flow-node.clickable {
  cursor: pointer;
}

.pie-wrap {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.pie-chart {
  width: 132px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--line);
}

.pie-legend {
  display: grid;
  gap: 8px;
}

.pie-item {
  display: grid;
  grid-template-columns: 10px minmax(70px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.pie-item i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.pie-item em {
  color: var(--muted);
  font-style: normal;
}

.flow-arrow {
  display: none;
}

.op-bars {
  display: grid;
  gap: 10px;
}

.op-bar-row {
  display: grid;
  grid-template-columns: 92px minmax(120px, 1fr) 132px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.op-bar-track {
  height: 11px;
  border-radius: 999px;
  overflow: hidden;
  background: #edf1f5;
}

.op-bar-fill {
  height: 100%;
  background: var(--accent);
}

.op-bar-row strong {
  font-size: 13px;
  text-align: right;
}

.op-bar-row em {
  grid-column: 2 / 4;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.action-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 20px;
  line-height: 1.55;
}

.action-list li {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.action-list li::marker {
  color: var(--accent);
  font-weight: 700;
}

.action-list strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--text);
}

.action-list p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.action-list b {
  margin-right: 8px;
  color: var(--text);
}

.table.compact table {
  min-width: 560px;
}

.table.compact th,
.table.compact td {
  white-space: normal;
  vertical-align: top;
}

.panel {
  padding: 14px;
  min-width: 0;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-title h2 {
  margin: 0;
}

.panel-title span {
  color: var(--muted);
  font-size: 13px;
}

.collapsible-panel.collapsed .panel-title {
  margin-bottom: 0;
}

.collapse-toggle {
  width: auto;
  min-width: 58px;
  border-radius: 6px;
  padding: 7px 10px;
  background: #f4f7f7;
  color: var(--muted);
  white-space: nowrap;
}

.collapse-toggle.primary {
  background: #0f766e;
  color: #ffffff;
}

.collapse-toggle[aria-expanded="true"] {
  background: #eef7f6;
  color: var(--accent);
}

.bar-list,
.rank-list {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 86px 1fr 70px;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #eef2f6;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--accent);
}

.rank-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.rank-item:last-child {
  border-bottom: 0;
}

.workflow-detail {
  min-height: 280px;
}

.workflow-category-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.workflow-category-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
  min-height: 150px;
}

.workflow-category-card span {
  display: block;
  min-height: 54px;
  color: var(--muted);
  font-size: 12px;
  white-space: normal;
}

.workflow-category-card strong {
  display: block;
  font-size: 16px;
}

.workflow-category-card b {
  color: var(--accent);
  font-size: 24px;
}

.workflow-category-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.workflow-template-box {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.workflow-template-box pre {
  max-height: 180px;
  overflow: auto;
  margin: 0;
  white-space: pre-wrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
  color: var(--muted);
  font: inherit;
}

.file-button {
  width: auto;
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 8px 10px;
  background: #eef7f6;
  color: var(--accent);
  cursor: pointer;
}

.file-button input {
  display: none;
}

.workflow-doc-card {
  display: grid;
  gap: 10px;
}

.workflow-doc-card h2 {
  margin: 0;
  font-size: 18px;
}

.workflow-doc-card span,
.workflow-doc-card small {
  color: var(--muted);
}

.workflow-doc-card p {
  margin: 0;
  color: var(--ink);
}

.workflow-doc-card pre {
  margin: 4px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafb;
  color: var(--ink);
  font: inherit;
  line-height: 1.7;
}

.table {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

th,
td {
  text-align: left;
  padding: 9px 9px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.tag {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e7f5f3;
  color: var(--accent);
  font-size: 12px;
}

.tag.warn {
  background: #fff1f0;
  color: var(--accent-2);
}

.tag.review {
  background: #fff7df;
  color: #946200;
}

.tag.doing {
  background: #eaf2ff;
  color: var(--blue);
}

.competitor-upload-button {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.competitor-upload-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.competitor-image-dropzone {
  display: grid;
  gap: 6px;
  min-height: 96px;
  align-content: center;
  border: 1px dashed #b8d8d3;
  border-radius: 8px;
  background: #f7fbfa;
  color: var(--muted);
  padding: 18px;
}

.competitor-image-dropzone strong {
  color: var(--ink);
}

.competitor-frame-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.competitor-frame-grid figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.competitor-frame-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #f4f7f7;
}

.competitor-frame-grid figcaption {
  padding: 7px 8px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.competitor-analysis-progress {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid #cfe9e5;
  border-radius: 8px;
  background: #f7fbfa;
}

.competitor-analysis-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.competitor-analysis-progress-head strong {
  color: var(--ink);
  font-weight: 700;
}

.competitor-analysis-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4efed;
}

.competitor-analysis-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.25s ease;
}

.prep-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.prep-hero h2 {
  font-size: 18px;
  margin-bottom: 6px;
}

.prep-hero p,
.metric p {
  color: var(--muted);
}

.prep-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  margin-right: 5px;
  background: var(--accent);
}

.dot.risk {
  background: var(--gold);
}

.dot.warn {
  background: var(--accent-2);
}

.prep-metrics .metric strong {
  font-size: 24px;
}

.prep-create .form-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#new-store-create-result {
  color: var(--muted);
}

.stage-track {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.stage-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  min-height: 126px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.stage-card.active {
  border-color: #bdd7d3;
  background: #f5fbfa;
}

.stage-card.current-day {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px #8fd6ca;
}

.stage-card span,
.module-card span,
.prep-store-head span,
.prep-open-card span,
.prep-task-main span,
.prep-today-item span,
.opening-item span,
.swimlane span {
  color: var(--muted);
  font-size: 12px;
}

.stage-card strong,
.module-card strong,
.risk-item strong,
.prep-task-main strong,
.prep-store-head h2 {
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.stage-card p,
.module-card p,
.risk-item p,
.prep-store-head p,
.prep-task-main p,
.prep-task-main small,
.prep-today-item p,
.opening-item p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.prep-task-main b {
  display: inline-block;
  min-width: 58px;
  margin-right: 8px;
  color: var(--ink);
}

.prep-progress {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  background: #edf1f5;
}

.prep-progress div {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.module-grid {
  display: grid;
  gap: 10px;
}

.module-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.module-card .prep-progress,
.module-card p {
  grid-column: 1 / -1;
}

.module-card b,
.prep-module .panel-title strong {
  color: var(--accent);
  font-size: 20px;
}

.risk-list {
  display: grid;
  gap: 9px;
}

.prep-today-list,
.opening-grid,
.swimlane-grid {
  display: grid;
  gap: 9px;
}

.opening-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.prep-today-item,
.opening-item,
.swimlane {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfd;
}

.prep-today-item.overdue,
.opening-item.blocked {
  border-color: #f0c6c2;
  background: #fffafa;
}

.opening-item.done {
  border-color: #bdd7d3;
  background: #f3faf8;
}

.opening-item.risk,
.opening-item.pending {
  border-color: #ead595;
  background: #fffdf4;
}

.prep-today-item strong,
.opening-item strong,
.swimlane strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.swimlane {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px;
}

.swimlane-tasks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.swimlane-tasks span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 4px 8px;
  background: #eef2f6;
  color: var(--muted);
}

.swimlane-tasks span.done {
  background: #e7f5f3;
  color: var(--accent);
}

.swimlane-tasks span.overdue,
.swimlane-tasks span.blocked {
  background: #fff1f0;
  color: var(--accent-2);
}

.risk-item {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfd;
}

.risk-item.strong {
  border-color: #f0c6c2;
  background: #fffafa;
}

.risk-item div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.risk-item span {
  color: var(--accent-2);
  font-size: 12px;
  white-space: nowrap;
}

.risk-item small {
  color: var(--muted);
}

.progress-cell {
  min-width: 132px;
}

.progress-cell .prep-progress {
  display: inline-block;
  width: 86px;
  margin-right: 8px;
  vertical-align: middle;
}

.selected-row {
  background: #f3faf8;
}

.prep-detail,
.prep-module-list {
  display: grid;
  gap: 14px;
}

.prep-store-head {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 16px;
}

.prep-store-head h2 {
  margin: 6px 0;
  font-size: 19px;
}

.prep-head-actions {
  margin-top: 12px;
}

.prep-edit-panel {
  border-color: #cfe5e2;
}

.prep-open-card {
  min-width: 180px;
  display: grid;
  align-content: center;
  gap: 7px;
  border-left: 1px solid var(--line);
  padding-left: 16px;
}

.prep-open-card strong {
  font-size: 20px;
}

.prep-timeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.prep-timeline article {
  position: relative;
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfd;
}

.prep-timeline article.done,
.prep-timeline article.current {
  border-color: #bdd7d3;
  background: #f3faf8;
}

.prep-timeline article.blocked {
  border-color: #f0c6c2;
  background: #fffafa;
}

.prep-timeline article.current {
  box-shadow: inset 0 0 0 2px #8fd6ca;
}

.prep-timeline span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  margin-bottom: 8px;
  background: #eef2f6;
  color: var(--muted);
  font-weight: 700;
}

.prep-timeline article.done span,
.prep-timeline article.current span {
  background: var(--accent);
  color: #ffffff;
}

.prep-task-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.prep-task {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.prep-task.blocked {
  border-color: #f0c6c2;
  background: #fffafa;
}

.prep-task-main {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.prep-task-main strong,
.prep-task-main p,
.prep-task-main small {
  display: block;
  margin-top: 5px;
}

.prep-task-edit {
  display: grid;
  grid-template-columns: 150px minmax(180px, 1fr) minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.form {
  display: grid;
  gap: 12px;
}

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

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  color: var(--ink);
  background: #fbfcfd;
}

.table-action {
  border-radius: 6px;
  background: #eef7f6;
  color: var(--accent);
  padding: 7px 10px;
  white-space: nowrap;
}

.table-action.danger {
  background: #fff1f0;
  color: var(--accent-2);
}

.table-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
}

textarea {
  min-height: 220px;
  resize: vertical;
  font-family: "SFMono-Regular", Consolas, monospace;
  line-height: 1.5;
}

.form button,
.inline-actions button {
  justify-self: start;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  padding: 10px 14px;
}

.multi-select {
  position: relative;
}

.form .multi-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 34px 9px 10px;
  background: #fbfcfd;
  color: var(--ink);
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-select-trigger::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.multi-select.open .multi-select-trigger::after {
  transform: translateY(-35%) rotate(225deg);
}

.multi-select-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: none;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.multi-select.open .multi-select-menu {
  display: grid;
  gap: 2px;
}

.multi-select-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border-radius: 5px;
  padding: 7px 8px;
  color: var(--ink);
  cursor: pointer;
}

.multi-select-option:hover {
  background: #eef7f6;
}

.multi-select-option input {
  width: auto;
  margin: 0;
}

.secondary-button {
  border-radius: 6px;
  background: #eef2f6;
  color: var(--ink);
  padding: 8px 12px;
}

#import-result {
  color: var(--muted);
}

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

  .shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    height: auto;
    display: block;
    overflow: visible;
    padding: 12px;
  }

  .shell.sidebar-collapsed .sidebar {
    padding: 12px;
  }

  .sidebar-toggle {
    display: none;
  }

  .brand,
  .shell.sidebar-collapsed .brand {
    justify-content: flex-start;
    padding-bottom: 12px;
  }

  .shell.sidebar-collapsed .brand-logo {
    width: 64px;
    height: 48px;
  }

  .shell.sidebar-collapsed .brand-text {
    display: block;
  }

  nav {
    grid-template-columns: repeat(10, minmax(108px, 1fr));
    overflow-x: auto;
    overflow-y: hidden;
  }

  .nav,
  .shell.sidebar-collapsed .nav {
    height: auto;
    padding: 11px 12px;
    display: block;
    text-align: center;
    font-size: 14px;
  }

  .shell.sidebar-collapsed .nav::after {
    content: none;
  }

  .main {
    height: auto;
    overflow: visible;
  }

  .metrics,
  .grid.two,
  .form-row,
  .filter-grid,
  .op-metrics,
  .brief-grid,
  .flow-chart,
  .op-bar-row,
  .stage-track,
  .prep-timeline,
  .prep-task-edit,
  .opening-grid,
  .workflow-category-grid,
  .swimlane {
    grid-template-columns: 1fr;
  }

  .prep-hero,
  .prep-store-head,
  .prep-task-main {
    display: grid;
  }

  .prep-open-card {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 12px;
  }

  .filter-wide,
  #operation-filters .filter-item:nth-child(n) {
    grid-column: span 1;
  }

  .weather-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .weather-city-grid {
    grid-template-columns: 1fr;
    max-height: 360px;
  }

  .weather-city-card {
    grid-template-columns: 1fr;
  }

  .pie-wrap {
    grid-template-columns: 1fr;
  }

  .funnel-model {
    grid-template-columns: 1fr;
  }

  .funnel-axis {
    display: none;
  }

  .funnel-stack {
    grid-template-columns: 1fr;
  }

  .funnel-band {
    width: var(--band-width);
    min-width: min(180px, 100%);
  }

  .funnel-note {
    min-height: auto;
    margin-bottom: 8px;
  }

  .topbar {
    align-items: flex-start;
  }
}

/* Scheme B: calm SaaS console refresh */
:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #f9fbfd;
  --ink: #111827;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #0d9488;
  --accent-strong: #0f766e;
  --accent-soft: #e6f7f5;
  --accent-2: #dc2626;
  --gold: #d8a441;
  --blue: #2563eb;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.07);
  --shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.05);
}

body {
  background:
    radial-gradient(circle at 12% -8%, rgba(13, 148, 136, 0.13), transparent 32%),
    radial-gradient(circle at 90% 8%, rgba(37, 99, 235, 0.08), transparent 28%),
    var(--bg);
  color: var(--ink);
  font-family: Geist, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

.auth-screen {
  background:
    radial-gradient(circle at 24% 18%, rgba(13, 148, 136, 0.18), transparent 30%),
    linear-gradient(135deg, #f8fafc 0%, #eef5f4 100%);
}

.login-card {
  gap: 16px;
  border-color: rgba(226, 232, 240, 0.9);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.12);
}

.shell {
  grid-template-columns: 248px 1fr;
  background: transparent;
}

.shell.sidebar-collapsed {
  grid-template-columns: 84px 1fr;
}

.sidebar {
  margin: 14px 0 14px 14px;
  height: calc(100vh - 28px);
  border: 1px solid rgba(226, 232, 240, 0.14);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(17, 24, 39, 0.98)),
    #111827;
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.18);
}

.brand {
  padding: 4px 8px 20px;
}

.brand-logo {
  width: 54px;
  height: 42px;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.brand strong {
  letter-spacing: 0;
}

.brand small {
  color: #94a3b8;
}

nav {
  gap: 5px;
  padding-right: 0;
}

.nav {
  position: relative;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 12px 11px 14px;
  color: #cbd5e1;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.nav:hover {
  transform: translateX(2px);
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.07);
}

.nav.active {
  border-color: rgba(45, 212, 191, 0.28);
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.92), rgba(15, 118, 110, 0.72));
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(13, 148, 136, 0.22);
}

.nav.active::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 50%;
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: #ffffff;
  transform: translateY(-50%);
  opacity: 0.86;
}

.sidebar-toggle {
  border-radius: 12px;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
}

.main {
  padding: 18px 24px 28px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 72px;
  margin: 0 0 18px;
  border: 1px solid rgba(226, 232, 240, 0.82);
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

h1 {
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 780;
  letter-spacing: 0;
}

h2 {
  color: #172033;
  font-size: 16px;
  letter-spacing: 0;
}

.topbar p {
  color: var(--muted);
  font-size: 13px;
}

.actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.icon-button,
.secondary-button,
.collapse-toggle,
.table-action,
.form button,
.inline-actions button,
.file-button {
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.icon-button {
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.icon-button:hover,
.secondary-button:hover,
.collapse-toggle:hover,
.table-action:hover,
.form button:hover,
.inline-actions button:hover,
.file-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.09);
}

.pill {
  border-color: rgba(226, 232, 240, 0.95);
  background: #ffffff;
  color: #475569;
  box-shadow: var(--shadow-soft);
}

.pill.ok {
  border-color: rgba(13, 148, 136, 0.22);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.view.active {
  gap: 16px;
  animation: view-enter 0.32s ease both;
}

.main.view-switching .view.active {
  animation: view-enter 0.26s ease both;
}

@keyframes view-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel,
.metric,
.op-metric,
.brief-card,
.op-visual,
.filter-item,
.action-list li,
.workflow-doc-card pre {
  border-color: rgba(226, 232, 240, 0.92);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
}

.panel {
  padding: 16px;
}

.panel-title {
  align-items: flex-start;
}

.panel-title h2 {
  font-weight: 760;
}

.panel-title span,
.filter-item span,
.op-metric span,
th,
label {
  color: var(--muted);
}

.metrics,
.op-metrics,
.brief-grid,
.grid.two {
  gap: 12px;
}

.metric,
.op-metric,
.brief-card,
.task-card {
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.metric:hover,
.op-metric:hover,
.brief-card:hover,
.task-card:hover {
  transform: translateY(-2px);
  border-color: rgba(13, 148, 136, 0.2);
  box-shadow: var(--shadow);
}

.filter-grid {
  gap: 12px;
}

.date-presets button,
input,
select,
textarea,
.form .multi-select-trigger {
  min-height: 40px;
  border-radius: 10px;
  border-color: #d9e2ec;
  background: #ffffff;
}

input:focus,
select:focus,
textarea:focus,
.form .multi-select-trigger:focus {
  outline: 3px solid rgba(13, 148, 136, 0.12);
  border-color: rgba(13, 148, 136, 0.62);
}

.date-presets button.active,
.collapse-toggle.primary,
.form button,
.inline-actions button {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #ffffff;
}

.secondary-button,
.collapse-toggle,
.table-action,
.file-button {
  border: 1px solid rgba(226, 232, 240, 0.96);
  border-radius: 10px;
  background: #f8fafc;
  color: #334155;
}

.table-action {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.table-action.danger {
  background: #fef2f2;
  color: var(--accent-2);
}

.table {
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

th {
  background: #f8fafc;
  font-weight: 700;
}

td {
  color: #243041;
}

th,
td {
  padding: 11px 12px;
}

tbody tr {
  transition: background 0.16s ease;
}

tbody tr:hover {
  background: #f8fbfb;
}

.tag {
  border: 1px solid rgba(13, 148, 136, 0.16);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 650;
}

.prep-hero {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(240, 253, 250, 0.9)),
    #ffffff;
}

.prep-hero::after {
  content: "";
  position: absolute;
  right: -90px;
  top: -120px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(13, 148, 136, 0.16), transparent 66%);
  pointer-events: none;
}

.prep-hero h2 {
  font-size: clamp(20px, 2.4vw, 30px);
}

.task-hero {
  position: relative;
  min-height: 280px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 22px;
  align-items: end;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 22px;
  padding: clamp(24px, 4vw, 46px);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.96) 0%, rgba(240, 253, 250, 0.88) 55%, rgba(239, 246, 255, 0.84) 100%),
    url("https://picsum.photos/seed/msjd-operations-console/1920/1080") center/cover;
  box-shadow: var(--shadow);
}

.task-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 74% 18%, rgba(13, 148, 136, 0.16), transparent 34%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.72));
  pointer-events: none;
}

.task-hero > * {
  position: relative;
  z-index: 1;
}

.task-hero-copy {
  max-width: 1120px;
}

.task-hero-copy h2 {
  max-width: 980px;
  margin: 0;
  color: #0f172a;
  font-size: clamp(34px, 4.8vw, 66px);
  line-height: 1.02;
  letter-spacing: 0;
}

.task-hero-copy p {
  max-width: 720px;
  margin-top: 18px;
  color: #475569;
  font-size: 15px;
  line-height: 1.8;
}

.task-hero-panel {
  min-height: 190px;
  display: grid;
  align-content: end;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  padding: 20px;
  background: rgba(15, 23, 42, 0.86);
  color: #ffffff;
  box-shadow: 0 26px 60px rgba(15, 23, 42, 0.24);
}

.task-hero-panel span {
  color: #99f6e4;
  font-size: 13px;
}

.task-hero-panel strong {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1;
}

.task-hero-panel p {
  color: #cbd5e1;
  line-height: 1.6;
}

.task-bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 14px;
}

.task-card {
  min-height: 174px;
  grid-column: span 4;
  display: grid;
  align-content: space-between;
  gap: 18px;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 18px;
  padding: 20px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.task-card-wide {
  grid-column: span 6;
  background:
    linear-gradient(135deg, rgba(13, 148, 136, 0.1), rgba(255, 255, 255, 0.98)),
    #ffffff;
}

.task-card:nth-child(2),
.task-card:nth-child(3) {
  grid-column: span 3;
}

.task-card h3 {
  margin: 0;
  color: #172033;
  font-size: 18px;
}

.task-card p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.65;
}

.task-card span {
  justify-self: start;
  border-radius: 999px;
  padding: 6px 10px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.task-card-image {
  position: relative;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(15, 118, 110, 0.72)),
    url("https://picsum.photos/seed/msjd-task-board/960/720") center/cover;
}

.task-card-image h3,
.task-card-image p {
  color: #ffffff;
}

.task-card-image span {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

@media (max-width: 920px) {
  .sidebar {
    margin: 0;
    border-radius: 0 0 18px 18px;
  }

  .main {
    padding: 14px;
  }

  .topbar {
    position: relative;
    display: grid;
    border-radius: 16px;
  }

  .task-hero,
  .task-bento {
    grid-template-columns: 1fr;
  }

  .task-card,
  .task-card-wide,
  .task-card:nth-child(2),
  .task-card:nth-child(3) {
    grid-column: span 1;
  }
}

/* Logo refresh: square brand asset */
.brand-logo {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 12px;
  object-fit: cover;
}

.login-brand .brand-logo {
  width: 72px;
  height: 72px;
}

.shell.sidebar-collapsed .brand-logo {
  width: 48px;
  height: 48px;
}

@media (max-width: 920px) {
  .shell.sidebar-collapsed .brand-logo {
    width: 48px;
    height: 48px;
  }
}

/* Keep primary collapse button labels readable on brand fill */
.collapse-toggle.primary,
.collapse-toggle.primary[aria-expanded="true"],
.collapse-toggle.primary [data-collapse-label] {
  color: #ffffff;
}


/* Order Center 1.0 */
.view.active > .panel,
.view.active > .operation-modules {
  min-width: 0;
}

#order-modules {
  grid-template-columns: 1fr;
}

#orders-view {
  gap: 14px;
}

#order-filters .filter-item:nth-child(1) {
  grid-column: 1 / span 2;
}

#order-filters .filter-item:nth-child(2) {
  grid-column: 3 / span 2;
}

#order-filters .filter-item:nth-child(3) {
  grid-column: 5 / span 2;
}

#order-filters .filter-item:nth-child(4) {
  grid-column: 1 / span 2;
}

#order-filters .filter-item:nth-child(5) {
  grid-column: 3 / span 2;
}

.order-section-note {
  color: var(--muted);
}

.maiyatian-live {
  border-left: 4px solid #0f766e;
}

.live-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.live-metric {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.live-metric span,
.live-store-head span {
  color: var(--muted);
  font-size: 12px;
}

.live-metric strong {
  display: block;
  margin: 6px 0;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.15;
  word-break: break-word;
}

.live-metric small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.4;
}

.live-combined-trends {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.live-store-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  margin-bottom: 8px;
}

.live-store-head h3 {
  margin: 0;
  font-size: 16px;
}

.live-store-table {
  max-height: 420px;
  overflow: auto;
}

/* Keep the seven-column store monitor readable across the available workspace.
   The shared table rule below intentionally uses max-content for dense reports;
   this monitor is a summary table and should instead consume its panel width. */
.maiyatian-live .live-store-table > table {
  width: 100%;
  min-width: 100%;
}

.live-table-metric {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.live-table-metric strong {
  font-weight: 600;
  color: var(--ink);
}

.live-table-metric small {
  font-size: 12px;
  font-weight: 600;
}

.maiyatian-live .live-store-table th:not(:first-child),
.maiyatian-live .live-store-table td:not(:first-child) {
  text-align: right;
}

.live-error {
  margin: 10px 0 0;
  color: #b42318;
}

@media (max-width: 920px) {
  #order-filters .filter-item:nth-child(n) {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .live-metrics {
    grid-template-columns: 1fr;
  }
}

/* Console UI polish 2026-06-17 */
:root {
  --bg: #eef3f4;
  --surface: #ffffff;
  --surface-soft: #f8fbfb;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #dbe5ea;
  --accent: #12877d;
  --accent-strong: #0b6f67;
  --accent-soft: #e8f7f4;
  --danger-soft: #fff3f2;
  --radius-card: 8px;
  --shadow: 0 16px 34px rgba(15, 23, 42, 0.07);
  --shadow-soft: 0 7px 18px rgba(15, 23, 42, 0.045);
}

body {
  background: linear-gradient(180deg, #eef5f4 0%, #f6f8fb 58%, #f3f6f8 100%);
}

.shell {
  grid-template-columns: 236px minmax(0, 1fr);
}

.shell.sidebar-collapsed {
  grid-template-columns: 78px minmax(0, 1fr);
}

.sidebar {
  margin: 12px 0 12px 12px;
  height: calc(100vh - 24px);
  border-radius: 12px;
  padding: 18px 12px;
}

.brand {
  padding: 2px 6px 18px;
}

.brand-logo,
.shell.sidebar-collapsed .brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 8px;
}

.nav {
  min-height: 40px;
  border-radius: 8px;
  padding: 10px 12px 10px 14px;
}

.nav.active {
  background: linear-gradient(135deg, #168f83, #0b6f67);
}

.main {
  padding: 16px 20px 28px;
}

.topbar {
  min-height: 66px;
  margin-bottom: 14px;
  border-radius: 12px;
  padding: 12px 14px;
}

.topbar > div:first-child {
  min-width: 0;
}

h1 {
  font-size: 26px;
  line-height: 1.12;
}

h2 {
  font-size: 16px;
}

.view.active {
  gap: 12px;
}

.panel,
.metric,
.op-metric,
.brief-card,
.task-card,
.workflow-category-card,
.workflow-doc-card,
.filter-item,
.prep-open-card,
.module-card,
.stage-card,
.marketing-summary-card,
.marketing-search-result-card {
  border-radius: var(--radius-card) !important;
  box-shadow: var(--shadow-soft);
}

.panel {
  padding: 14px;
}

.panel-title {
  gap: 10px;
  margin-bottom: 12px;
}

.panel-title h2 {
  line-height: 1.25;
}

.panel-title p {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.55;
}

.metrics,
.op-metrics,
.brief-grid,
.grid.two,
.form-row,
.filter-grid {
  gap: 10px;
}

.metric,
.op-metric,
.brief-card {
  min-width: 0;
  padding: 14px;
}

.metric strong,
.op-metric strong {
  overflow-wrap: anywhere;
}

.form {
  gap: 10px;
}

label {
  min-width: 0;
  font-weight: 650;
}

input,
select,
textarea,
.form .multi-select-trigger {
  min-height: 38px;
  border-radius: 8px;
  background: #ffffff;
}

button,
.secondary-button,
.collapse-toggle,
.table-action,
.form button,
.inline-actions button,
.file-button,
.icon-button {
  border-radius: 8px;
}

button:disabled,
.secondary-button:disabled,
.table-action:disabled,
.form button:disabled,
.inline-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
  box-shadow: none;
}

.inline-actions,
.actions {
  gap: 8px;
}

.inline-actions {
  min-width: 0;
}

.inline-actions span,
.panel-title span,
.empty {
  line-height: 1.55;
}

.pill {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
}

.table {
  overflow: auto;
  border-radius: var(--radius-card);
}

.table.compact {
  max-height: min(66vh, 760px);
}

table {
  min-width: 880px;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f6faf9;
}

th,
td {
  vertical-align: top;
}

tbody tr:nth-child(even) {
  background: #fbfdfd;
}

tbody tr:hover {
  background: #effaf7;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
}

.collapse-toggle {
  min-width: 60px;
}

.collapsible-panel.collapsed .panel-title {
  margin-bottom: 0;
}

#view-subtitle {
  max-width: 100%;
}

.marketing-control-overview {
  border: 1px solid #d6e4e8;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
  padding: 18px;
}

#view-subtitle .marketing-control-overview {
  grid-template-columns: minmax(230px, 0.9fr) minmax(450px, 1.55fr) minmax(220px, 0.7fr) !important;
  gap: 14px !important;
  align-items: center !important;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

#view-subtitle .marketing-control-copy {
  gap: 5px !important;
}

#view-subtitle .marketing-control-copy strong {
  font-size: 24px !important;
  line-height: 1.12 !important;
}

#view-subtitle .marketing-control-copy p {
  max-width: 520px;
  line-height: 1.55;
}

#view-subtitle .marketing-control-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 10px !important;
}

#view-subtitle .marketing-control-metrics > div,
.marketing-summary-card {
  border-radius: var(--radius-card) !important;
  background: #f8fbfb !important;
}

#view-subtitle .marketing-control-metrics > div {
  min-height: 88px !important;
  padding: 12px 14px !important;
}

#view-subtitle .marketing-control-metrics strong {
  font-size: 28px !important;
  line-height: 1 !important;
}

#view-subtitle .marketing-control-actions {
  min-width: 210px !important;
}

#view-subtitle .marketing-control-actions button,
#marketing-activity-monitor .inline-actions button,
#marketing-activity-monitor .secondary-button {
  min-height: 38px;
}

#view-subtitle .marketing-refresh-progress {
  width: 100%;
  min-width: 0 !important;
  border-radius: var(--radius-card) !important;
}

#marketing-activity-monitor {
  display: grid;
  gap: 16px;
}

#marketing-activity-monitor .marketing-subnav-panel {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#marketing-activity-monitor .module-subnav {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-soft);
}

#marketing-activity-monitor .module-subnav button {
  min-width: 108px;
  padding: 10px 18px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 760;
  box-shadow: none;
}

#marketing-activity-monitor .module-subnav button.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(18, 135, 125, 0.18);
}

#marketing-activity-monitor .module-subnav button:not(.active):hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.product-image-helper-panel {
  display: grid;
  gap: 10px;
  min-height: calc(100vh - 156px);
}

.product-image-helper-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.product-image-helper-status-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.product-image-helper-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.product-image-helper-notice {
  min-height: 52px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-wrap: anywhere;
}

.product-image-helper-notice[data-type="ok"] {
  border-color: rgba(18, 135, 125, 0.28);
  background: rgba(231, 247, 244, 0.95);
  color: var(--accent-strong);
}

.product-image-helper-notice[data-type="error"] {
  border-color: rgba(194, 65, 12, 0.26);
  background: rgba(255, 247, 237, 0.95);
  color: #9a3412;
}

.product-image-helper-shell {
  display: grid;
  grid-template-rows: auto minmax(620px, 1fr);
  gap: 10px;
  min-height: calc(100vh - 160px);
}

.product-image-helper-frame-wrap {
  position: relative;
  min-width: 0;
}

.product-image-helper-frame-state {
  position: absolute;
  inset: 12px auto auto 12px;
  z-index: 2;
  max-width: min(640px, calc(100% - 24px));
  padding: 9px 12px;
  border: 1px solid rgba(18, 135, 125, 0.24);
  border-radius: 10px;
  background: rgba(231, 247, 244, 0.96);
  color: var(--accent-strong);
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.product-image-helper-frame-state[data-type="error"] {
  border-color: rgba(194, 65, 12, 0.28);
  background: rgba(255, 247, 237, 0.96);
  color: #9a3412;
}

.product-image-helper-subnav {
  display: inline-flex;
  width: fit-content;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-soft);
}

.product-image-helper-subnav button {
  min-width: 88px;
  padding: 9px 16px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 760;
  cursor: pointer;
  box-shadow: none;
}

.product-image-helper-subnav button.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(18, 135, 125, 0.18);
}

.product-image-helper-subnav button:not(.active):hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.product-image-helper-frame {
  width: 100%;
  min-height: 680px;
  height: calc(100vh - 214px);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f7f8f4;
  box-shadow: var(--shadow-soft);
}

#marketing-activity-monitor .marketing-empty-subview {
  min-height: 220px;
}

#marketing-activity-monitor .panel {
  overflow: hidden;
}

#marketing-activity-monitor > .panel:not(.marketing-subnav-panel) {
  border: 1px solid #d6e4e8;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
}

#marketing-activity-monitor > .panel:not(.marketing-subnav-panel) > .panel-title:first-child {
  border-bottom: 1px solid #e6eef1;
  margin: -2px 0 14px;
  padding-bottom: 12px;
}

#marketing-activity-monitor .marketing-search-panel > .panel-title:first-child {
  margin-bottom: 10px;
}

#marketing-activity-monitor .marketing-section-divider {
  height: 1px;
  margin: 16px -2px 14px;
  background: #e6eef1;
}

#marketing-activity-monitor .marketing-result-title {
  margin-bottom: 12px !important;
  padding-bottom: 0 !important;
  border-bottom: 0 !important;
}

#marketing-activity-monitor .form-row {
  grid-template-columns: minmax(220px, 0.8fr) minmax(280px, 1.25fr) minmax(180px, 0.7fr);
}

#marketing-activity-monitor .marketing-activity-search-filter-row {
  grid-template-columns: minmax(260px, 0.8fr) minmax(340px, 1.2fr) !important;
}

#marketing-activity-monitor .marketing-search-mode {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
}

#marketing-activity-monitor .marketing-search-mode label {
  border-radius: var(--radius-card) !important;
  padding: 9px 11px !important;
}

#marketing-activity-monitor .marketing-store-discount-filter-row {
  grid-template-columns: minmax(260px, 0.8fr) minmax(340px, 1.2fr) !important;
}

#marketing-activity-monitor .marketing-assistant-filter-row {
  grid-template-columns: minmax(360px, 520px) !important;
}

#marketing-activity-monitor .marketing-assistant-activity-select {
  width: 100%;
}

#marketing-activity-monitor .marketing-store-select {
  position: relative;
  min-width: 0;
}

#marketing-activity-monitor .marketing-store-select summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

#marketing-activity-monitor .marketing-store-select-menu {
  position: static;
  width: 100%;
  max-height: min(56vh, 520px);
  overflow: auto;
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid #d6e4e8;
  border-radius: var(--radius-card);
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.02);
}

#marketing-activity-monitor .marketing-store-select-menu label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 8px;
}

#marketing-activity-monitor .marketing-store-select-menu label:hover {
  background: #f3faf8;
}

#marketing-activity-monitor .marketing-store-select-all {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

#marketing-activity-monitor .marketing-store-select-menu small {
  color: var(--muted);
  white-space: nowrap;
}

#marketing-activity-monitor .marketing-store-discount-table table {
  min-width: 1180px;
}

#marketing-activity-monitor .marketing-infrastructure-matrix-table table {
  min-width: 1320px;
  table-layout: fixed;
}

#marketing-activity-monitor .marketing-infrastructure-matrix-table th,
#marketing-activity-monitor .marketing-infrastructure-matrix-table td {
  padding: 10px 12px;
  vertical-align: top;
}

#marketing-activity-monitor .marketing-infrastructure-matrix-table th:nth-child(1),
#marketing-activity-monitor .marketing-infrastructure-matrix-table td:nth-child(1) {
  width: 220px;
}

#marketing-activity-monitor .marketing-infrastructure-matrix-table th:nth-child(2),
#marketing-activity-monitor .marketing-infrastructure-matrix-table td:nth-child(2) {
  width: 92px;
}

#marketing-activity-monitor .marketing-infrastructure-matrix-table th:nth-child(n + 3),
#marketing-activity-monitor .marketing-infrastructure-matrix-table td:nth-child(n + 3) {
  width: calc((100% - 312px) / 3);
}

#marketing-activity-monitor .marketing-infrastructure-matrix-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #f6faf9;
  box-shadow: inset 0 -1px 0 var(--line);
}

#marketing-activity-monitor .marketing-infrastructure-matrix-table th:last-child {
  right: auto;
  background: #f6faf9;
  box-shadow: inset 0 -1px 0 var(--line);
}

#marketing-activity-monitor .marketing-infrastructure-matrix-table td:last-child {
  position: static;
  right: auto;
  z-index: auto;
  background: inherit;
  box-shadow: none;
}

#marketing-activity-monitor .marketing-infrastructure-matrix-table tbody tr:nth-child(even) td:last-child {
  background: inherit;
}

#marketing-activity-monitor .marketing-infrastructure-matrix-table tbody tr:hover td:last-child {
  background: inherit;
}

#marketing-activity-monitor .marketing-infrastructure-matrix-table td:first-child {
  font-weight: 650;
  color: var(--text);
}

#marketing-activity-monitor .marketing-infrastructure-matrix-table td:first-child small {
  display: block;
  margin-top: 3px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

#marketing-activity-monitor .marketing-matrix-cell {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid #dcefeb;
  border-radius: 6px;
  background: #f8fcfb;
}

#marketing-activity-monitor .marketing-matrix-cell + .marketing-matrix-cell {
  margin-top: 6px;
}

#marketing-activity-monitor .marketing-matrix-cell strong {
  font-size: 13px;
  line-height: 1.35;
  color: var(--text);
  word-break: break-word;
}

#marketing-activity-monitor .marketing-matrix-cell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

#marketing-activity-monitor .marketing-matrix-cell-head .tag {
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.35;
}

#marketing-activity-monitor .marketing-matrix-cell-head small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

#marketing-activity-monitor .marketing-matrix-cell small,
#marketing-activity-monitor .muted {
  color: var(--muted);
}

/* Marketing result tables are summary-oriented by default. Fill their panel on
   wide screens; specialised activity-detail tables keep their larger min-width
   declarations and remain horizontally scrollable when necessary. */
#marketing-activity-monitor .table > table {
  width: 100%;
}

#marketing-activity-monitor .warning-row {
  background: #fffaf0 !important;
}

#marketing-activity-monitor .marketing-summary-row {
  grid-template-columns: repeat(3, minmax(180px, 1fr)) !important;
  gap: 10px !important;
  margin: 12px 0 !important;
}

#marketing-activity-monitor .marketing-summary-row-four {
  grid-template-columns: repeat(4, minmax(160px, 1fr)) !important;
}

#marketing-activity-monitor .marketing-assistant-summary-row {
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  gap: 10px !important;
}

#marketing-activity-monitor .marketing-summary-card {
  min-height: 82px !important;
  padding: 12px 14px !important;
}

#marketing-activity-monitor .marketing-summary-card strong {
  font-size: 26px !important;
}

#marketing-activity-monitor .marketing-summary-card.active {
  background: #e8f7f4 !important;
  border-color: rgba(18, 135, 125, 0.5) !important;
  box-shadow: inset 0 0 0 1px rgba(18, 135, 125, 0.45);
}

#marketing-activity-monitor .marketing-rule-row {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px !important;
}

#marketing-activity-monitor .marketing-rule-chip {
  border-radius: var(--radius-card) !important;
  padding: 9px 10px !important;
}

#marketing-activity-monitor .marketing-pagination {
  flex-wrap: wrap;
  justify-content: flex-end !important;
  gap: 8px !important;
}

#marketing-activity-monitor .marketing-pagination label {
  width: auto;
  display: inline-flex;
  align-items: center;
  grid-auto-flow: column;
  gap: 6px;
}

#marketing-activity-monitor .marketing-pagination select {
  width: auto;
  min-width: 104px;
}

#marketing-activity-monitor .marketing-search-grid {
  gap: 10px !important;
}

#marketing-activity-monitor .marketing-search-result-card {
  border-color: rgba(219, 229, 234, 0.95) !important;
}

#marketing-activity-monitor .marketing-search-result-head {
  background: #f6faf9 !important;
  padding: 11px 13px !important;
}

#marketing-activity-monitor .marketing-search-empty {
  border-radius: var(--radius-card) !important;
  background: #fbfdfd;
}

.task-hero,
.prep-hero {
  border-radius: 12px;
}

.prep-hero::after {
  display: none;
}

.task-card,
.task-card h3,
.task-card strong,
.task-card p,
.op-metric,
.op-metric strong,
.metric,
.metric strong,
.panel-title,
.panel-title h2,
.panel-title p {
  min-width: 0;
  overflow-wrap: anywhere;
}

.task-card {
  min-height: 150px;
}

.wechat-config-panel .task-bento {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.wechat-config-panel .task-card,
.wechat-config-panel .task-card:nth-child(2),
.wechat-config-panel .task-card:nth-child(3),
.wechat-config-panel .task-card-wide {
  grid-column: auto;
}

.wechat-config-panel .form-row,
#org-view .form-row,
#workflow-view .form-row,
#database-view .form-row {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.date-presets {
  flex-wrap: wrap;
}

.date-presets button,
.metric-toggle,
.table-action {
  min-height: 32px;
}

.table-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
}

.table-actions {
  flex-wrap: wrap;
}

.table table {
  width: max-content;
  min-width: 100%;
}

.table th:last-child,
.table td:last-child {
  position: sticky;
  right: 0;
  z-index: 3;
  background: #ffffff;
  box-shadow: -10px 0 18px rgba(15, 23, 42, 0.06);
}

.table th:last-child {
  z-index: 4;
  background: #f6faf9;
}

.table tbody tr:nth-child(even) td:last-child {
  background: #fbfdfd;
}

.table tbody tr:hover td:last-child {
  background: #effaf7;
}

.topbar:has(#view-subtitle .marketing-control-overview) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.topbar:has(#view-subtitle .marketing-control-overview) > div:first-child {
  display: contents;
}

.topbar:has(#view-subtitle .marketing-control-overview) #view-title {
  grid-column: 1;
  grid-row: 1;
}

.topbar:has(#view-subtitle .marketing-control-overview) .actions {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
}

.topbar:has(#view-subtitle .marketing-control-overview) #view-subtitle {
  grid-column: 1 / -1;
  grid-row: 2;
  margin-top: 8px;
}

.topbar:has(#view-subtitle .marketing-control-overview) #view-subtitle .marketing-control-overview {
  grid-template-columns: minmax(200px, 0.9fr) minmax(380px, 1.55fr) minmax(170px, 0.65fr) !important;
  align-items: stretch !important;
}

.topbar:has(#view-subtitle .marketing-control-overview) #view-subtitle .marketing-control-copy p {
  max-width: 560px;
}

.topbar:has(#view-subtitle .marketing-control-overview) #view-subtitle .marketing-control-actions {
  justify-items: stretch !important;
}

.topbar:has(#view-subtitle .marketing-control-overview) #view-subtitle .marketing-control-actions button {
  width: 100%;
}

@media (max-width: 1280px) {
  .topbar {
    align-items: stretch;
  }
}

@media (min-width: 1121px) {
  #marketing-activity-monitor .marketing-summary-row {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  #marketing-activity-monitor .marketing-summary-row-four {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  #marketing-activity-monitor .marketing-assistant-summary-row {
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 1120px) {
  #view-subtitle .marketing-control-overview,
  .topbar:has(#view-subtitle .marketing-control-overview) #view-subtitle .marketing-control-overview {
    grid-template-columns: 1fr !important;
  }

  #view-subtitle .marketing-control-actions,
  .topbar:has(#view-subtitle .marketing-control-overview) #view-subtitle .marketing-control-actions {
    justify-items: start !important;
  }
}

@media (max-width: 920px) {
  .shell,
  .shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    height: auto;
    margin: 0;
    border-radius: 0;
  }

  .main {
    padding: 12px;
  }

  .topbar {
    position: relative;
    gap: 12px;
  }

  .actions {
    justify-content: flex-start;
  }

  .form-row,
  .filter-grid,
  #marketing-activity-monitor .form-row {
    grid-template-columns: 1fr;
  }

  #view-subtitle .marketing-control-metrics,
  #marketing-activity-monitor .marketing-summary-row,
  #marketing-activity-monitor .marketing-summary-row-four,
  #marketing-activity-monitor .marketing-assistant-summary-row {
    grid-template-columns: 1fr !important;
  }

  table {
    min-width: 760px;
  }
}

/* UI fixes: collapse states, marketing result tables, task board structure */
.collapse-toggle,
.collapse-toggle[aria-expanded="false"] {
  min-width: 62px;
  border: 1px solid rgba(18, 135, 125, 0.18);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 750;
}

.collapse-toggle[aria-expanded="true"],
.collapse-toggle.primary {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #ffffff;
}

.collapse-toggle [data-collapse-label],
.collapse-toggle.primary [data-collapse-label],
.collapse-toggle[aria-expanded="true"] [data-collapse-label] {
  color: inherit;
}

#marketing-activity-monitor .marketing-search-result-card .table {
  max-height: none;
}

#marketing-activity-monitor .marketing-search-result-card .table table {
  width: 100%;
  min-width: 100%;
  table-layout: auto;
}

#marketing-activity-monitor .marketing-search-result-card .table th,
#marketing-activity-monitor .marketing-search-result-card .table td {
  overflow-wrap: anywhere;
}

#marketing-activity-monitor .marketing-search-result-card .table th:last-child,
#marketing-activity-monitor .marketing-search-result-card .table td:last-child {
  position: static;
  right: auto;
  z-index: auto;
  min-width: 120px;
  background: inherit;
  box-shadow: none;
}

#marketing-activity-monitor .marketing-search-result-card .table th:last-child {
  background: #f6faf9;
}

#marketing-activity-monitor .marketing-search-result-card .table tbody tr:nth-child(even) td:last-child {
  background: #fbfdfd;
}

#marketing-activity-monitor .marketing-search-result-card .table tbody tr:hover td:last-child {
  background: #effaf7;
}

#marketing-activity-monitor .marketing-activity-items-table table {
  min-width: 1480px;
}

#marketing-activity-monitor .marketing-activity-items-table th:nth-child(5),
#marketing-activity-monitor .marketing-activity-items-table td:nth-child(5),
#marketing-activity-monitor .marketing-activity-items-table th:nth-child(15),
#marketing-activity-monitor .marketing-activity-items-table td:nth-child(15) {
  max-width: 280px;
}

#marketing-activity-monitor .marketing-activity-items-table th:nth-child(15),
#marketing-activity-monitor .marketing-activity-items-table td:nth-child(15) {
  white-space: normal;
  line-height: 1.45;
}

#marketing-activity-monitor .marketing-diff-panel {
  border-color: rgba(17, 24, 39, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
}

#marketing-activity-monitor .marketing-diff-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

#marketing-activity-monitor .marketing-diff-toolbar .secondary-button.active {
  background: #111827;
  border-color: #111827;
  color: #fff;
}

#marketing-activity-monitor .marketing-diff-baseline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 14px;
}

#marketing-activity-monitor .marketing-diff-baseline-card {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.82);
}

#marketing-activity-monitor .marketing-diff-baseline-card.is-empty {
  background: rgba(248, 250, 252, 0.82);
}

#marketing-activity-monitor .marketing-diff-baseline-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

#marketing-activity-monitor .marketing-diff-baseline-card strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.3;
}

#marketing-activity-monitor .marketing-diff-baseline-card p {
  margin: 4px 0 10px;
  color: var(--muted);
  font-size: 12px;
}

#marketing-activity-monitor .marketing-diff-baseline-card small {
  display: block;
  margin: -4px 0 10px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.45;
}

#marketing-activity-monitor .marketing-diff-baseline-card dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

#marketing-activity-monitor .marketing-diff-baseline-card dl div {
  min-width: 0;
}

#marketing-activity-monitor .marketing-diff-baseline-card dt {
  color: var(--muted);
  font-size: 11px;
}

#marketing-activity-monitor .marketing-diff-baseline-card dd {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
}

#marketing-activity-monitor .marketing-diff-table table {
  min-width: 980px;
}

#marketing-activity-monitor .marketing-diff-table td:nth-child(5) {
  min-width: 260px;
}

@media (max-width: 760px) {
  #marketing-activity-monitor .marketing-diff-baseline-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.task-center-hero {
  min-height: 180px;
  grid-template-columns: minmax(0, 1.25fr) minmax(220px, 0.55fr);
  padding: 24px;
}

.task-center-hero .eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 750;
}

.task-center-hero .task-hero-copy h2 {
  max-width: 760px;
  font-size: clamp(30px, 3.4vw, 46px);
}

.task-center-hero .task-hero-copy p {
  max-width: 760px;
  margin-top: 12px;
}

.task-center-hero .task-hero-panel {
  min-height: 126px;
  border-radius: var(--radius-card);
}

.task-rebuild-hero {
  border: 1px dashed rgba(107, 114, 128, 0.45);
  background: #f8fafc;
}

.task-rebuild-panel {
  border: 1px solid rgba(107, 114, 128, 0.22);
  background: #ffffff;
}

.task-rebuild-panel strong {
  color: #4b5563;
}

.task-rebuild-empty {
  min-height: 180px;
}

.xinjiang-zone-hero {
  border-color: rgba(20, 184, 166, 0.28);
}

.xinjiang-module {
  display: grid;
  gap: 14px;
}

.xinjiang-matrix-table {
  max-height: 620px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.xinjiang-matrix-table table {
  min-width: 100%;
}

.xinjiang-matrix-table th,
.xinjiang-matrix-table td {
  min-width: 92px;
  max-width: 128px;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.28;
  vertical-align: top;
}

.xinjiang-matrix-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.xinjiang-matrix-table.table th:last-child {
  right: auto;
  box-shadow: none;
}

.xinjiang-matrix-table.table td:last-child {
  position: static;
  right: auto;
  box-shadow: none;
  background: inherit;
}

.xinjiang-matrix-table .matrix-first-col {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 220px;
  max-width: 260px;
  background: #ffffff;
}

.xinjiang-matrix-table th.matrix-first-col {
  background: #f8fafc;
}

.xinjiang-matrix-table .matrix-first-col strong,
.xinjiang-matrix-table .matrix-first-col small {
  display: block;
}

.xinjiang-matrix-table .matrix-first-col small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.xinjiang-matrix-table .matrix-hit {
  color: var(--accent-strong);
  font-weight: 750;
  background: #effaf7;
}

.xinjiang-matrix-table .matrix-empty {
  background: #fbfcfd;
}

.task-board-panel {
  display: grid;
  gap: 12px;
}

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

.task-board-card {
  min-height: 118px;
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface-soft);
}

.task-board-card span {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef2f6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.task-board-card.active {
  border-color: rgba(18, 135, 125, 0.28);
  background: linear-gradient(135deg, #eefaf8, #ffffff);
}

.task-board-card.active span {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.task-board-card strong {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.35;
}

.task-board-card p {
  color: var(--muted);
  line-height: 1.55;
}

@media (max-width: 920px) {
  .task-center-hero,
  .task-board-grid {
    grid-template-columns: 1fr;
  }
}

#promotion-center-live {
  display: grid;
  gap: 16px;
}

.promotion-summary-panel .marketing-summary-card strong {
  font-size: 22px;
  line-height: 1.2;
}

.promotion-filter-panel .promotion-filter-row {
  grid-template-columns: minmax(320px, 520px);
  align-items: start;
}

.promotion-filter-panel .promotion-filter-row > label {
  max-width: 520px;
}

.promotion-filter-panel .marketing-store-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

.promotion-filter-panel .marketing-store-select summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.promotion-filter-panel .marketing-store-select-menu {
  position: static;
  width: 100%;
  max-height: min(52vh, 420px);
  overflow: auto;
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid #d6e4e8;
  border-radius: var(--radius-card);
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.02);
}

.promotion-filter-panel .marketing-store-select-menu label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 8px;
}

.promotion-filter-panel .marketing-store-select-menu label:hover {
  background: #f3faf8;
}

.promotion-filter-panel .marketing-store-select-menu input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

.promotion-filter-panel .marketing-store-select-menu span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.promotion-filter-panel .marketing-store-select-menu small {
  color: var(--muted);
  white-space: nowrap;
}

.promotion-filter-panel .marketing-store-select-all {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.promotion-live-table {
  max-height: calc(100vh - 260px);
  min-height: 360px;
  overflow: auto;
}

.promotion-live-table table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.promotion-live-table th,
.promotion-live-table td {
  vertical-align: middle;
}

.promotion-live-table td:last-child {
  position: static;
  right: auto;
  z-index: auto;
  box-shadow: none;
}

.promotion-live-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #f8fbfb;
  box-shadow: inset 0 -1px 0 var(--line);
}

.promotion-live-table thead th:last-child {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #f8fbfb;
}

.promotion-live-table th:nth-child(n+4),
.promotion-live-table td:nth-child(n+4) {
  text-align: center;
  white-space: nowrap;
}

.promotion-live-table th:nth-child(2),
.promotion-live-table td:nth-child(2),
.promotion-live-table th:nth-child(3),
.promotion-live-table td:nth-child(3) {
  text-align: center;
}

.promotion-live-table th:nth-child(1),
.promotion-live-table td:nth-child(1) {
  width: 22%;
}

.promotion-live-table th:nth-child(2),
.promotion-live-table td:nth-child(2) {
  width: 12%;
}

.promotion-live-table th:nth-child(3),
.promotion-live-table td:nth-child(3) {
  width: 14%;
}

.promotion-live-table th:nth-child(n+4),
.promotion-live-table td:nth-child(n+4) {
  width: 10.4%;
}

.promotion-live-table small {
  color: var(--muted);
  line-height: 1.5;
}

.promotion-live-table .muted-row td {
  color: var(--muted);
  background: #fbfcfd;
}

/* UI refresh v2: dense operations console baseline */
:root {
  --bg: #eef3f6;
  --surface: #ffffff;
  --surface-soft: #f7fafb;
  --surface-tint: #edf7f5;
  --ink: #111827;
  --text: #111827;
  --muted: #607085;
  --line: #d8e2e8;
  --border: #d8e2e8;
  --accent: #087f78;
  --accent-strong: #055f59;
  --accent-soft: #e4f4f1;
  --accent-2: #c24135;
  --gold: #b98322;
  --blue: #285faa;
  --radius-card: 8px;
  --radius-control: 7px;
  --shadow: 0 16px 40px rgba(19, 32, 50, 0.1);
  --shadow-soft: 0 5px 18px rgba(19, 32, 50, 0.065);
}

html {
  background: var(--bg);
}

body {
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(238, 243, 246, 0.88) 38%, #eef3f6),
    var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

.auth-screen {
  background:
    linear-gradient(135deg, #edf4f6 0%, #f8fbfb 56%, #eef2f7 100%),
    var(--bg);
}

.login-card {
  border-radius: var(--radius-card);
  border-color: rgba(190, 204, 214, 0.82);
  box-shadow: 0 24px 70px rgba(19, 32, 50, 0.16);
}

.shell {
  grid-template-columns: 236px minmax(0, 1fr);
  background: transparent;
}

.shell.sidebar-collapsed {
  grid-template-columns: 72px minmax(0, 1fr);
}

.sidebar {
  margin: 10px 0 10px 10px;
  height: calc(100vh - 20px);
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-card);
  padding: 16px 10px 12px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(20, 28, 40, 0.98)),
    #111827;
  box-shadow: 12px 0 38px rgba(19, 32, 50, 0.14);
}

.brand {
  min-height: 54px;
  padding: 0 8px 12px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.11);
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-control);
  background: #ffffff;
  box-shadow: none;
}

.brand strong {
  color: #ffffff;
  font-size: 16px;
}

.brand small {
  color: #93a4b7;
}

nav {
  gap: 4px;
  padding: 2px 2px 2px 0;
}

.nav {
  min-height: 38px;
  border-radius: var(--radius-control);
  padding: 9px 10px;
  color: #c7d0dc;
  font-weight: 650;
  letter-spacing: 0;
}

.nav::before {
  content: "";
  width: 6px;
  height: 6px;
  display: inline-block;
  margin-right: 8px;
  border-radius: 999px;
  background: rgba(199, 208, 220, 0.42);
  vertical-align: 1px;
}

.nav:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.075);
  color: #ffffff;
}

.nav.active {
  border-color: rgba(45, 212, 191, 0.26);
  background: #0f766e;
  color: #ffffff;
  box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.74), 0 10px 26px rgba(8, 127, 120, 0.18);
}

.nav.active::before {
  position: static;
  width: 6px;
  height: 6px;
  background: #ffffff;
  opacity: 1;
  transform: none;
}

.sidebar-toggle {
  min-height: 34px;
  border-radius: var(--radius-control);
}

.main {
  padding: 10px 18px 24px;
  scroll-behavior: smooth;
}

.topbar {
  min-height: 68px;
  margin-bottom: 14px;
  border-radius: var(--radius-card);
  border-color: rgba(203, 216, 225, 0.88);
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

h1 {
  max-width: 980px;
  color: #0f172a;
  font-size: clamp(21px, 1.7vw, 26px);
  line-height: 1.16;
}

h2 {
  color: #162033;
  font-size: 15px;
  line-height: 1.25;
}

.topbar p {
  max-width: 1120px;
  color: var(--muted);
}

.view.active {
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
  animation: view-enter 0.22s ease both;
}

.panel,
.metric,
.op-metric,
.brief-card,
.op-visual,
.filter-item,
.action-list li,
.workflow-category-card,
.workflow-template-box,
.stage-card,
.module-card,
.prep-open-card,
.task-card,
.marketing-summary-card,
.marketing-search-result-card {
  border-radius: var(--radius-card) !important;
  border-color: rgba(204, 218, 227, 0.86);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.panel {
  padding: 13px;
}

.panel-title {
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(216, 226, 232, 0.72);
}

.collapsible-panel.collapsed .panel-title {
  padding-bottom: 0;
  border-bottom: 0;
}

.panel-title > div {
  min-width: 0;
}

.panel-title h2 {
  font-weight: 760;
}

.panel-title span,
.panel-title p,
.empty,
.filter-item span,
.op-metric span,
.metric span {
  color: var(--muted);
}

.metrics,
.op-metrics,
.brief-grid,
.grid.two,
.filter-grid,
.form-row,
.workflow-category-grid,
.stage-track {
  gap: 10px;
}

.metrics,
.op-metrics {
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
}

.metric,
.op-metric,
.brief-card,
.filter-item {
  min-width: 0;
  padding: 12px;
}

.metric strong {
  margin-top: 8px;
  color: #0f172a;
  font-size: clamp(21px, 2.2vw, 28px);
  line-height: 1.08;
}

.op-metric strong {
  color: #0f172a;
}

.metric:hover,
.op-metric:hover,
.brief-card:hover,
.task-card:hover,
.marketing-summary-card:hover,
.marketing-search-result-card:hover {
  transform: translateY(-1px);
  border-color: rgba(8, 127, 120, 0.28);
  box-shadow: 0 12px 28px rgba(19, 32, 50, 0.09);
}

.prep-hero,
.task-hero,
.xinjiang-zone-hero {
  border-radius: var(--radius-card) !important;
  border-color: rgba(204, 218, 227, 0.86);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(238, 247, 245, 0.94)),
    #ffffff !important;
  box-shadow: var(--shadow-soft);
}

.prep-hero {
  padding: 16px;
}

.prep-hero h2 {
  font-size: clamp(19px, 2vw, 24px);
}

.task-hero {
  min-height: 220px;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.62fr);
}

.task-hero::before,
.prep-hero::after {
  display: none;
}

.task-hero-copy h2 {
  max-width: 1080px;
  font-size: clamp(32px, 4vw, 54px);
  line-height: 1.04;
}

.task-hero-copy p {
  max-width: 820px;
}

.task-hero-panel {
  min-height: 156px;
  border-radius: var(--radius-card);
  background: #172033;
  box-shadow: none;
}

.task-bento,
.task-board-grid {
  grid-auto-flow: dense;
}

.task-card {
  min-height: 138px;
  padding: 16px;
}

.form {
  gap: 10px;
}

label {
  color: #314155;
  font-weight: 680;
}

input,
select,
textarea,
.form .multi-select-trigger,
.promotion-filter-panel .marketing-store-select summary,
#marketing-activity-monitor .marketing-store-select summary {
  min-height: 38px;
  border-radius: var(--radius-control);
  border-color: var(--line);
  background: #ffffff;
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus,
.form .multi-select-trigger:focus {
  outline: 3px solid rgba(8, 127, 120, 0.14);
  border-color: rgba(8, 127, 120, 0.64);
}

.icon-button,
.secondary-button,
.collapse-toggle,
.table-action,
.form button,
.inline-actions button,
.file-button {
  min-height: 36px;
  border-radius: var(--radius-control);
  font-weight: 720;
}

.form button,
.inline-actions button,
.date-presets button.active,
.collapse-toggle.primary {
  background: #087f78;
  color: #ffffff;
  box-shadow: none;
}

.form button:hover,
.inline-actions button:hover,
.date-presets button.active:hover,
.collapse-toggle.primary:hover {
  background: #066a64;
}

.secondary-button,
.collapse-toggle,
.table-action,
.file-button,
.icon-button {
  border: 1px solid rgba(204, 218, 227, 0.9);
  background: #f8fbfb;
  color: #263549;
}

.icon-button:hover,
.secondary-button:hover,
.collapse-toggle:hover,
.table-action:hover,
.form button:hover,
.inline-actions button:hover,
.file-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 9px 20px rgba(19, 32, 50, 0.09);
}

.nav:focus-visible,
.icon-button:focus-visible,
.secondary-button:focus-visible,
.collapse-toggle:focus-visible,
.table-action:focus-visible,
.form button:focus-visible,
.inline-actions button:focus-visible,
.file-button:focus-visible,
.module-subnav button:focus-visible,
.product-image-helper-subnav button:focus-visible {
  outline: 3px solid rgba(8, 127, 120, 0.28);
  outline-offset: 2px;
}

.sidebar .nav:focus-visible {
  outline-color: rgba(94, 234, 212, 0.44);
}

.sidebar-toggle:focus,
.sidebar-toggle:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(8, 127, 120, 0.28);
  outline-offset: 2px;
}

.sidebar .sidebar-toggle:focus,
.sidebar .sidebar-toggle:focus-visible {
  outline-color: rgba(94, 234, 212, 0.44);
}

.pill,
.tag,
.trend {
  border-radius: 999px;
}

.tag {
  border-color: rgba(8, 127, 120, 0.18);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.tag.warn {
  border-color: rgba(194, 65, 53, 0.18);
}

.tag.doing {
  border-color: rgba(40, 95, 170, 0.18);
}

.table {
  border: 1px solid rgba(204, 218, 227, 0.82);
  border-radius: var(--radius-card);
  background: #ffffff;
  box-shadow: none;
}

.table table {
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table th,
.table td {
  padding: 10px 11px;
  border-bottom-color: rgba(216, 226, 232, 0.82);
  vertical-align: middle;
}

.table th {
  color: #5d6b7d;
  background: #f3f8f8;
  font-weight: 760;
}

.table td {
  color: #233045;
}

.table tbody tr:hover td {
  background: #f7fbfa;
}

.table th:last-child,
.table td:last-child {
  box-shadow: -8px 0 16px rgba(19, 32, 50, 0.045);
}

.module-subnav,
.product-image-helper-subnav {
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(204, 218, 227, 0.82);
  border-radius: var(--radius-card);
  background: #edf4f5;
}

.module-subnav button,
.product-image-helper-subnav button {
  min-height: 34px;
  border-radius: var(--radius-control);
  color: #435066;
}

.module-subnav button.active,
.product-image-helper-subnav button.active {
  background: #ffffff;
  color: var(--accent-strong);
  box-shadow: 0 4px 12px rgba(19, 32, 50, 0.08);
}

#marketing-activity-monitor,
#promotion-center-live,
#product-image-helper-view,
#operation-modules,
.operation-modules {
  gap: 12px;
}

#marketing-activity-monitor > .panel:not(.marketing-subnav-panel),
.promotion-summary-panel,
.promotion-filter-panel,
.promotion-table-panel {
  border-radius: var(--radius-card) !important;
}

#view-subtitle .marketing-control-overview {
  border-radius: var(--radius-card);
  border-color: rgba(204, 218, 227, 0.84);
  background: #ffffff;
  box-shadow: none;
}

.weather-city-card,
.weather-day,
.flow-node,
.action-list li,
.workflow-template-box pre,
.workflow-doc-card pre {
  border-radius: var(--radius-control);
}

.shell.sidebar-collapsed .sidebar {
  padding: 12px 8px;
}

.shell.sidebar-collapsed .brand {
  justify-content: center;
  padding: 0 0 10px;
}

.shell.sidebar-collapsed .brand-logo {
  width: 40px;
  height: 40px;
}

.shell.sidebar-collapsed .nav {
  min-height: 40px;
  border-radius: var(--radius-control);
}

.shell.sidebar-collapsed .nav::before {
  display: none;
}

@media (max-width: 1120px) {
  .shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .main {
    padding: 10px 12px 20px;
  }

  .filter-grid,
  #operation-filters .filter-item:nth-child(n),
  .prep-create .form-row,
  .workflow-category-grid,
  .stage-track {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    grid-column: auto;
  }
}

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

  .shell,
  .shell.sidebar-collapsed {
    min-height: 100vh;
    height: auto;
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    margin: 0;
    border-radius: 0;
  }

  nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
  }

  .shell.sidebar-collapsed .nav {
    font-size: 13px;
  }

  .shell.sidebar-collapsed .nav::after {
    content: none;
  }

  .topbar,
  .panel-title,
  .prep-hero,
  .task-hero {
    display: grid;
    grid-template-columns: 1fr;
  }

  .topbar {
    position: relative;
  }

  .actions,
  .inline-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .metrics,
  .op-metrics,
  .brief-grid,
  .grid.two,
  .weather-city-grid,
  .funnel-model,
  .funnel-stack,
  .pie-wrap {
    grid-template-columns: 1fr;
  }

  .task-hero {
    min-height: 0;
  }

  .task-hero-copy h2 {
    font-size: clamp(28px, 10vw, 42px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Database import records: five-source grouped view */
#database-import-records.table {
  overflow: visible;
}

.database-source-overview {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}

.database-source-summary,
.database-source-module {
  --source-accent: #0f8c84;
  --source-tint: #eef9f7;
}

.database-source-merchant {
  --source-accent: #2563a8;
  --source-tint: #eff6fb;
}

.database-source-maiyatian {
  --source-accent: #b66a18;
  --source-tint: #fff7e9;
}

.database-source-promotion {
  --source-accent: #7452a3;
  --source-tint: #f6f1fb;
}

.database-source-manual {
  --source-accent: #657487;
  --source-tint: #f3f6f8;
}

.database-source-summary {
  min-width: 0;
  min-height: 112px;
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 13px 14px;
  border: 1px solid color-mix(in srgb, var(--source-accent) 24%, #d8e2e8);
  border-top: 3px solid var(--source-accent);
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, #ffffff 0%, var(--source-tint) 100%);
}

.database-source-summary span {
  color: var(--source-accent);
  font-size: 12px;
  font-weight: 780;
}

.database-source-summary strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.2;
}

.database-source-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.database-source-modules {
  display: grid;
  gap: 14px;
}

.database-source-module {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(204, 218, 227, 0.92);
  border-radius: var(--radius-card);
  background: #ffffff;
}

.database-source-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(216, 226, 232, 0.9);
  border-left: 4px solid var(--source-accent);
  background: linear-gradient(90deg, var(--source-tint) 0%, #ffffff 68%);
}

.database-source-heading {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.database-source-index {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--source-accent);
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.database-source-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.3;
}

.database-source-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.database-source-header > strong {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid color-mix(in srgb, var(--source-accent) 25%, #d8e2e8);
  border-radius: 999px;
  color: var(--source-accent);
  background: #ffffff;
  font-size: 12px;
  font-weight: 780;
}

.database-source-table {
  max-width: 100%;
  overflow-x: auto;
}

#database-view .database-source-table table {
  min-width: 1080px;
}

.database-source-empty {
  min-height: 76px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1280px) {
  .database-source-overview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .database-source-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .database-source-overview {
    grid-template-columns: minmax(0, 1fr);
  }

  .database-source-summary {
    min-height: auto;
  }

  .database-source-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Store operation analysis v2: objective six-module operating report */
#storeAnalysis-view {
  gap: 14px;
}

#storeAnalysis-view > .panel:first-child {
  border-top: 3px solid var(--accent);
}

.store-analysis-executive {
  overflow: hidden;
  border: 1px solid #cddbdc;
  border-radius: var(--radius-card, 10px);
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(20, 47, 56, 0.07);
}

.store-analysis-executive-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  min-height: 102px;
  padding: 19px 22px;
  color: #eef8f7;
  background: #17343b;
}

.store-analysis-executive-head span,
.store-analysis-eyebrow {
  display: block;
  margin-bottom: 5px;
  color: #198a82;
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.store-analysis-executive-head span {
  color: #7ed0c8;
}

.store-analysis-executive-head h2 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.2;
}

.store-analysis-executive-head p {
  max-width: 48ch;
  margin: 0;
  color: #b8cccf;
  font-size: 12px;
  text-align: right;
}

.store-analysis-executive-grid {
  display: grid;
  grid-template-columns: 1.25fr repeat(7, minmax(125px, 1fr));
  min-width: 0;
}

.store-analysis-summary-card {
  min-width: 0;
  min-height: 116px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 15px 16px;
  border-right: 1px solid #e1e8e9;
  background: #ffffff;
}

.store-analysis-summary-card:last-child {
  border-right: 0;
}

.store-analysis-summary-main {
  background: #f1f8f7;
}

.store-analysis-summary-card span,
.store-analysis-kpi span {
  color: #64757b;
  font-size: 12px;
  font-weight: 700;
}

.store-analysis-summary-card strong {
  overflow-wrap: anywhere;
  color: #162c34;
  font-size: clamp(19px, 1.55vw, 26px);
  line-height: 1.15;
}

.store-analysis-summary-card p,
.store-analysis-kpi p {
  margin: 0;
  color: #829096;
  font-size: 11px;
  line-height: 1.45;
}

.store-analysis-water-panel .panel-title {
  align-items: flex-end;
}

.store-analysis-water-panel .panel-title h2,
.store-analysis-boundary .panel-title h2 {
  margin: 0;
}

.store-analysis-modules {
  display: grid;
  gap: 10px;
}

.store-analysis-module {
  overflow: hidden;
  border: 1px solid #d6e0e2;
  border-radius: var(--radius-card, 10px);
  background: #ffffff;
  box-shadow: 0 7px 20px rgba(23, 52, 59, 0.045);
}

.store-analysis-module > summary {
  min-height: 76px;
  display: grid;
  grid-template-columns: 42px minmax(260px, 1fr) minmax(160px, auto) 64px;
  align-items: center;
  gap: 14px;
  padding: 13px 17px;
  cursor: pointer;
  list-style: none;
  background: #fbfcfc;
  transition: background-color 0.16s ease;
}

.store-analysis-module > summary::-webkit-details-marker {
  display: none;
}

.store-analysis-module > summary:hover {
  background: #f3f8f7;
}

.store-analysis-module > summary:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.28);
  outline-offset: -3px;
}

.store-analysis-module[open] > summary {
  border-bottom: 1px solid #dbe5e6;
  background: #f1f7f6;
}

.store-analysis-module-index {
  display: grid;
  place-items: center;
  width: 38px;
  aspect-ratio: 1;
  border: 1px solid #b9d5d2;
  border-radius: 8px;
  color: #0f766e;
  background: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.store-analysis-module-heading {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.store-analysis-module-heading strong {
  color: #183038;
  font-size: 17px;
}

.store-analysis-module-heading small,
.store-analysis-module-water small {
  color: #75868c;
  font-size: 11px;
  line-height: 1.45;
}

.store-analysis-module-water {
  min-width: 0;
  display: grid;
  justify-items: end;
  gap: 2px;
  text-align: right;
}

.store-analysis-module-water strong {
  max-width: 280px;
  overflow-wrap: anywhere;
  color: #28464d;
  font-size: 12px;
}

.store-analysis-module-toggle {
  justify-self: end;
  min-width: 56px;
  border: 1px solid #c8d8d9;
  border-radius: 6px;
  padding: 6px 8px;
  color: #4b656b;
  background: #ffffff;
  font-size: 0;
  text-align: center;
}

.store-analysis-module-toggle::after {
  content: "展开";
  font-size: 12px;
}

.store-analysis-module[open] .store-analysis-module-toggle::after {
  content: "收起";
}

.store-analysis-module-body {
  display: grid;
  gap: 15px;
  padding: 17px;
}

.store-analysis-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(135px, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid #dce5e6;
  border-radius: 8px;
  background: #ffffff;
}

.store-analysis-kpi {
  min-width: 0;
  min-height: 102px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 14px;
  border-right: 1px solid #e3e9ea;
  background: #ffffff;
}

.store-analysis-kpi:last-child {
  border-right: 0;
}

.store-analysis-kpi.attention {
  box-shadow: inset 0 3px 0 #d18b24;
  background: #fffaf1;
}

.store-analysis-kpi strong {
  overflow-wrap: anywhere;
  color: #173039;
  font-size: clamp(18px, 1.45vw, 24px);
  line-height: 1.18;
}

.store-analysis-kpi-grid-four {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.store-analysis-kpi-grid-seven {
  grid-template-columns: repeat(7, minmax(125px, 1fr));
}

.store-analysis-kpi-grid-eight {
  grid-template-columns: repeat(4, minmax(145px, 1fr));
}

.store-analysis-kpi-grid-eight .store-analysis-kpi:nth-child(4n) {
  border-right: 0;
}

.store-analysis-kpi-grid-eight .store-analysis-kpi:nth-child(n + 5) {
  border-top: 1px solid #e3e9ea;
}

.store-analysis-two-column,
.store-analysis-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.store-analysis-subsection {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid #e0e7e8;
  border-radius: 8px;
  background: #fcfdfd;
}

.store-analysis-subhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.store-analysis-subhead h3 {
  margin: 0;
  color: #203840;
  font-size: 14px;
}

.store-analysis-subhead span {
  color: #74858b;
  font-size: 11px;
  text-align: right;
}

.store-analysis-table {
  max-width: 100%;
  border-radius: 6px;
  background: #ffffff;
}

.store-analysis-table table {
  min-width: 620px;
}

.store-analysis-table th {
  color: #536970;
  background: #f3f7f7;
  font-size: 11px;
  white-space: nowrap;
}

.store-analysis-table td {
  color: #2d444b;
  font-size: 12px;
  line-height: 1.5;
}

.store-analysis-table td small {
  display: block;
  margin-top: 2px;
  color: #71848a;
  font-size: 10px;
}

.store-analysis-table td:first-child small {
  margin-top: 3px;
}

.store-analysis-funnel {
  display: grid;
  grid-template-columns: repeat(4, minmax(135px, 1fr));
  gap: 8px;
  padding: 12px;
  border: 1px solid #d8e3e3;
  border-radius: 8px;
  background: #f8fbfa;
}

.store-analysis-funnel article {
  position: relative;
  min-height: 88px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px 18px;
  border-left: 4px solid #0f766e;
  background: #ffffff;
}

.store-analysis-funnel article:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -7px;
  z-index: 1;
  width: 11px;
  height: 11px;
  border-top: 2px solid #9eb6b5;
  border-right: 2px solid #9eb6b5;
  transform: translateY(-50%) rotate(45deg);
  background: #f8fbfa;
}

.store-analysis-funnel span {
  color: #60767c;
  font-size: 12px;
  font-weight: 700;
}

.store-analysis-funnel strong {
  color: #163038;
  font-size: 24px;
}

.store-analysis-funnel small {
  color: #89979c;
  font-size: 10px;
}

.store-analysis-reference {
  display: grid;
  grid-template-columns: minmax(180px, 0.35fr) minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 13px 15px;
  border-left: 3px solid #0f766e;
  background: #f1f8f7;
}

.store-analysis-reference div {
  display: grid;
  gap: 3px;
}

.store-analysis-reference span {
  color: #5e747a;
  font-size: 11px;
}

.store-analysis-reference strong {
  color: #17363c;
  font-size: 15px;
}

.store-analysis-reference p,
.store-analysis-rule {
  margin: 0;
  color: #5f747a;
  font-size: 11px;
  line-height: 1.65;
}

.store-analysis-rule {
  padding: 9px 11px;
  border: 1px dashed #cad9da;
  border-radius: 6px;
  background: #f8fbfb;
}

.store-analysis-empty {
  min-height: 74px;
  display: grid;
  place-items: center;
  padding: 14px;
  border: 1px dashed #cad6d8;
  border-radius: 6px;
  color: #78898e;
  background: #fafcfc;
  font-size: 12px;
  text-align: center;
}

.store-analysis-boundary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid #dde5e6;
  border-radius: 8px;
}

.store-analysis-boundary-grid p {
  margin: 0;
  padding: 13px 15px;
  border-right: 1px solid #e1e8e9;
  color: #64767b;
  font-size: 11px;
  line-height: 1.65;
}

.store-analysis-boundary-grid p:last-child {
  border-right: 0;
}

.store-analysis-boundary-grid strong {
  display: block;
  margin-bottom: 4px;
  color: #203940;
  font-size: 12px;
}

@media (max-width: 1450px) {
  .store-analysis-executive-grid {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
  }

  .store-analysis-summary-card:nth-child(4n) {
    border-right: 0;
  }

  .store-analysis-summary-card:nth-child(n + 5) {
    border-top: 1px solid #e1e8e9;
  }

  .store-analysis-kpi-grid,
  .store-analysis-kpi-grid-seven {
    grid-template-columns: repeat(3, minmax(145px, 1fr));
  }

  .store-analysis-kpi-grid .store-analysis-kpi {
    border-top: 1px solid #e3e9ea;
  }

  .store-analysis-kpi-grid .store-analysis-kpi:nth-child(-n + 3) {
    border-top: 0;
  }

  .store-analysis-kpi-grid .store-analysis-kpi:nth-child(3n) {
    border-right: 0;
  }
}

@media (max-width: 980px) {
  .store-analysis-executive-head,
  .store-analysis-subhead {
    align-items: flex-start;
    flex-direction: column;
  }

  .store-analysis-executive-head p,
  .store-analysis-subhead span {
    text-align: left;
  }

  .store-analysis-module > summary {
    grid-template-columns: 42px minmax(0, 1fr) 58px;
  }

  .store-analysis-module-water {
    grid-column: 2 / 3;
    grid-row: 2;
    justify-items: start;
    text-align: left;
  }

  .store-analysis-module-toggle {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .store-analysis-two-column,
  .store-analysis-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .store-analysis-boundary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .store-analysis-boundary-grid p:nth-child(2n) {
    border-right: 0;
  }

  .store-analysis-boundary-grid p:nth-child(n + 3) {
    border-top: 1px solid #e1e8e9;
  }
}

@media (max-width: 700px) {
  .store-analysis-executive-grid,
  .store-analysis-kpi-grid,
  .store-analysis-kpi-grid-four,
  .store-analysis-kpi-grid-seven,
  .store-analysis-kpi-grid-eight,
  .store-analysis-funnel,
  .store-analysis-boundary-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .store-analysis-summary-card,
  .store-analysis-kpi,
  .store-analysis-boundary-grid p {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid #e1e8e9;
  }

  .store-analysis-summary-card:last-child,
  .store-analysis-kpi:last-child,
  .store-analysis-boundary-grid p:last-child {
    border-bottom: 0;
  }

  .store-analysis-module > summary {
    grid-template-columns: 36px minmax(0, 1fr);
    padding: 12px;
  }

  .store-analysis-module-index {
    width: 34px;
  }

  .store-analysis-module-water {
    grid-column: 2;
  }

  .store-analysis-module-toggle {
    display: none;
  }

  .store-analysis-module-body {
    padding: 12px;
  }

  .store-analysis-reference {
    grid-template-columns: minmax(0, 1fr);
  }

  .store-analysis-funnel article:not(:last-child)::after {
    display: none;
  }
}

/* UI refresh v3: module coverage and long-form clarity */
.module-overview-panel {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(239, 248, 246, 0.94)),
    var(--surface);
}

.module-metrics {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.module-table td strong {
  color: #172033;
  font-weight: 760;
}

.module-empty-state {
  min-height: 132px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  border: 1px dashed rgba(147, 163, 184, 0.7);
  border-radius: var(--radius-card);
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(248, 251, 251, 0.98), rgba(239, 248, 246, 0.8)),
    #ffffff;
  color: var(--muted);
  text-align: center;
}

.module-empty-state strong {
  color: #172033;
  font-size: 16px;
}

.module-empty-state span {
  max-width: 720px;
  line-height: 1.65;
}

.module-empty-state-split {
  min-height: 180px;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.6fr);
  justify-items: stretch;
  text-align: left;
}

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

.module-next-grid span {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid rgba(204, 218, 227, 0.9);
  border-radius: var(--radius-control);
  background: #ffffff;
  color: #263549;
  font-weight: 720;
}

#products-view,
#inventory-view,
#finance-view {
  gap: 12px;
}

#order-live-monitor {
  min-width: 0;
  max-width: 100%;
}

#org-view .panel,
#workflow-view .panel,
#database-view .panel {
  overflow: visible;
}

#org-view .form,
#workflow-view .form,
#database-view .form {
  display: grid;
  gap: 12px;
}

#org-view .form-row,
#workflow-view .form-row,
#database-view .form-row {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

#org-view label,
#workflow-view label,
#database-view label {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
}

#org-view .multi-select,
#workflow-view .workflow-template-box,
#database-view textarea {
  min-width: 0;
}

#org-view .multi-select-menu {
  border-radius: var(--radius-card);
  border-color: rgba(204, 218, 227, 0.95);
  box-shadow: 0 16px 34px rgba(19, 32, 50, 0.14);
}

#org-view .panel:nth-of-type(1),
#org-view .panel:nth-of-type(3),
#workflow-view .panel:nth-of-type(4),
#database-view .panel:nth-of-type(1) {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 252, 252, 0.98)),
    var(--surface);
}

.workflow-category-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  grid-auto-flow: dense;
}

.workflow-category-card {
  min-height: 128px;
}

.workflow-category-card span {
  min-height: 0;
}

.workflow-template-box {
  background: #f8fbfb;
}

.workflow-template-box .panel-title {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.workflow-template-box [data-collapse-body] {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(216, 226, 232, 0.72);
}

#database-view textarea#import-raw,
#workflow-view textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.65;
}

#database-import-records:empty::before,
#workflow-doc-table:empty::before,
#accounts-table:empty::before,
#personnel-table:empty::before,
#store-mapping-table:empty::before {
  content: "暂无记录";
  min-height: 88px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed rgba(147, 163, 184, 0.65);
  border-radius: var(--radius-card);
  background: #fbfdfd;
}

.finance-placeholder-panel {
  min-height: 260px;
}

button:focus:not(:focus-visible),
.nav:focus:not(:focus-visible),
.sidebar-toggle:focus:not(:focus-visible) {
  outline: none;
}

body[data-input-mode="pointer"] button:focus,
body[data-input-mode="pointer"] .nav:focus,
body[data-input-mode="pointer"] .sidebar-toggle:focus {
  outline: none;
}

@media (max-width: 920px) {
  .module-empty-state-split {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .module-next-grid {
    grid-template-columns: 1fr;
  }
}

/* UI refresh v5: high-traffic module refinement */
.maiyatian-live {
  border-left: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(239, 248, 246, 0.94)),
    var(--surface);
}

.maiyatian-live > .panel-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.maiyatian-live .live-metrics {
  grid-template-columns: minmax(240px, 1.18fr) repeat(3, minmax(160px, 1fr));
  grid-auto-flow: dense;
}

.maiyatian-live .live-metric {
  background: #ffffff;
}

.maiyatian-live .live-metric:first-child {
  border-color: rgba(8, 127, 120, 0.28);
  background:
    linear-gradient(135deg, rgba(8, 127, 120, 0.11), rgba(255, 255, 255, 0.98)),
    #ffffff;
}

.maiyatian-live .live-metric:first-child strong {
  font-size: clamp(28px, 3vw, 38px);
  letter-spacing: 0;
}

.maiyatian-live .live-store-head {
  position: sticky;
  top: 86px;
  z-index: 5;
  margin: 14px -2px 8px;
  padding: 10px 2px;
  background: linear-gradient(180deg, rgba(247, 250, 251, 0.96), rgba(247, 250, 251, 0.88));
  backdrop-filter: blur(10px);
}

.maiyatian-live .live-store-table {
  max-height: min(58vh, 560px);
  border-radius: var(--radius-card);
}

.maiyatian-live .live-store-table th:first-child,
.maiyatian-live .live-store-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  background: inherit;
  box-shadow: 8px 0 14px rgba(19, 32, 50, 0.04);
}

.maiyatian-live .live-store-table th:first-child {
  z-index: 5;
  background: #f3f8f8;
}

#marketing-activity-monitor .marketing-subnav-panel {
  position: sticky;
  top: 86px;
  z-index: 20;
  padding: 0 0 2px;
}

#marketing-activity-monitor .module-subnav {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

#marketing-activity-monitor .module-subnav button {
  min-width: 0;
  padding-inline: 10px;
  white-space: nowrap;
}

#marketing-activity-monitor .marketing-search-panel .form-row {
  align-items: end;
}

#marketing-activity-monitor .marketing-search-empty,
#marketing-activity-monitor .marketing-empty-subview {
  border: 1px dashed rgba(147, 163, 184, 0.65);
  border-radius: var(--radius-card);
  background: #fbfdfd;
}

#database-view input[type="file"] {
  min-height: 42px;
  padding: 6px;
  cursor: pointer;
}

#database-view input[type="file"]::file-selector-button {
  min-height: 30px;
  margin-right: 10px;
  border: 1px solid rgba(204, 218, 227, 0.9);
  border-radius: var(--radius-control);
  padding: 0 12px;
  background: #f8fbfb;
  color: #263549;
  font: inherit;
  font-weight: 720;
  cursor: pointer;
}

#database-view input[type="file"]::file-selector-button:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

#database-import-records .module-empty-state {
  min-height: 112px;
}

@media (max-width: 1120px) {
  .maiyatian-live .live-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #marketing-activity-monitor .module-subnav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .maiyatian-live > .panel-title,
  #marketing-activity-monitor .module-subnav {
    grid-template-columns: 1fr;
  }

  .maiyatian-live,
  .maiyatian-live .live-metrics,
  .maiyatian-live .live-metric {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .maiyatian-live .live-metrics {
    grid-template-columns: minmax(0, 1fr);
  }

  .maiyatian-live .live-metric strong {
    font-size: clamp(24px, 8vw, 32px);
    overflow-wrap: anywhere;
  }

  .maiyatian-live .live-store-table {
    max-width: 100%;
  }

  .maiyatian-live .live-store-head,
  #marketing-activity-monitor .marketing-subnav-panel {
    position: static;
  }
}

/* UI refresh v6: workflow, finance, database and promotion clarity */
.finance-readiness {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.25fr);
  gap: 16px;
  align-items: stretch;
}

.finance-readiness-copy,
.finance-readiness-grid article {
  border: 1px solid rgba(216, 226, 232, 0.9);
  border-radius: var(--radius-card);
  background: #fbfdfd;
}

.finance-readiness-copy {
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 18px;
}

.finance-readiness-copy span,
.finance-readiness-grid span,
.workflow-doc-meta span,
.workflow-doc-tags span,
.promotion-table-toolbar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.finance-readiness-copy strong {
  font-size: clamp(22px, 2.4vw, 34px);
  letter-spacing: 0;
}

.finance-readiness-copy p,
.finance-readiness-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.finance-readiness-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  grid-auto-flow: dense;
  gap: 10px;
}

.finance-readiness-grid article {
  display: grid;
  gap: 8px;
  padding: 14px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.finance-readiness-grid article:hover,
.workflow-category-card:hover,
.workflow-doc-card:hover {
  transform: translateY(-1px);
  border-color: rgba(8, 127, 120, 0.24);
  box-shadow: 0 12px 28px rgba(19, 32, 50, 0.08);
}

.finance-readiness-grid strong {
  color: var(--ink);
  font-size: 17px;
}

.workflow-authoring-panel .form,
.database-import-panel .form {
  max-width: 1180px;
}

.workflow-list-panel .table,
.database-record-panel .table {
  border-radius: var(--radius-card);
  overflow: auto;
}

.workflow-reader-panel {
  border-color: rgba(8, 127, 120, 0.22);
}

.workflow-detail {
  min-height: 0;
}

.workflow-doc-card {
  max-width: 980px;
  gap: 14px;
  padding: 4px 0;
}

.workflow-doc-meta,
.workflow-doc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.workflow-doc-meta span,
.workflow-doc-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid rgba(216, 226, 232, 0.9);
  border-radius: 999px;
  padding: 0 10px;
  background: #f8fbfb;
}

.workflow-doc-card h2 {
  max-width: 860px;
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.22;
  letter-spacing: 0;
}

.workflow-doc-scenario {
  max-width: 880px;
  border-left: 3px solid var(--accent);
  padding-left: 12px;
  color: #263549;
  line-height: 1.65;
}

.workflow-doc-card pre {
  max-height: min(62vh, 720px);
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 251, 0.98)),
    #ffffff;
  color: #243247;
  font-size: 14px;
  line-height: 1.85;
}

.database-record-panel .section-note {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-weight: 760;
}

.promotion-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -2px 0 12px;
}

.promotion-table-toolbar span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid rgba(216, 226, 232, 0.9);
  border-radius: 999px;
  padding: 0 11px;
  background: #fbfdfd;
}

.promotion-table-toolbar b {
  margin-right: 5px;
  color: var(--ink);
}

.promotion-live-table tbody tr:hover td {
  background: #f3faf9;
}

.promotion-live-table td:first-child strong,
.workflow-list-panel td:first-child {
  color: var(--ink);
  font-weight: 760;
}

@media (max-width: 1120px) {
  .finance-readiness {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .finance-readiness,
  .finance-readiness-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .workflow-doc-card h2 {
    font-size: 22px;
  }

  .workflow-doc-card pre {
    max-height: none;
    padding: 14px;
  }

  .promotion-table-toolbar span {
    width: 100%;
    justify-content: space-between;
  }
}

/* UI refresh v7: admin dense module control surfaces */
.prep-focus-strip {
  min-width: 0;
}

.prep-focus-card {
  display: grid;
  grid-template-columns: minmax(260px, 1.35fr) minmax(180px, 0.55fr) minmax(160px, 0.45fr);
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(216, 226, 232, 0.92);
  border-radius: var(--radius-card);
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(243, 250, 249, 0.94)),
    var(--surface);
}

.prep-focus-card.empty {
  grid-template-columns: minmax(0, 1fr);
}

.prep-focus-card span,
.prep-focus-card p {
  color: var(--muted);
  font-size: 12px;
}

.prep-focus-card strong {
  display: block;
  margin: 4px 0;
  font-size: clamp(18px, 1.9vw, 28px);
  letter-spacing: 0;
}

.prep-focus-card p {
  margin: 0;
  line-height: 1.55;
}

.prep-focus-progress {
  display: grid;
  gap: 7px;
}

.prep-focus-risk {
  display: grid;
  justify-items: end;
  gap: 7px;
  text-align: right;
}

.org-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.org-summary .metric strong {
  font-size: clamp(18px, 1.8vw, 28px);
  overflow-wrap: anywhere;
}

#org-view > .panel[data-admin-only]:not([hidden]) {
  border-color: rgba(216, 226, 232, 0.9);
}

#accounts-table,
#personnel-table,
#store-mapping-table {
  border-radius: var(--radius-card);
  overflow: auto;
}

#accounts-table table,
#personnel-table table,
#store-mapping-table table {
  min-width: 860px;
}

#accounts-table td:first-child,
#personnel-table td:first-child,
#store-mapping-table td:first-child,
#store-mapping-table td:nth-child(3) {
  color: var(--ink);
  font-weight: 760;
}

.product-image-helper-panel {
  overflow: hidden;
}

.product-image-helper-toolbar {
  grid-template-columns: minmax(260px, 0.78fr) minmax(0, 1fr);
  align-items: stretch;
}

.product-image-helper-actions {
  justify-content: end;
}

.product-image-helper-actions button {
  white-space: nowrap;
}

.product-image-helper-frame {
  min-height: min(68vh, 760px);
  background: #ffffff;
}

@media (max-width: 1120px) {
  .prep-focus-card,
  .org-summary,
  .product-image-helper-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .prep-focus-risk {
    justify-items: start;
    text-align: left;
  }
}

@media (max-width: 760px) {
  .prep-focus-card,
  .org-summary,
  .product-image-helper-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-image-helper-actions {
    justify-content: stretch;
  }

  .product-image-helper-status-strip {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-image-helper-actions button {
    width: 100%;
  }

  .product-image-helper-frame {
    min-height: 620px;
  }
}

/* UI refresh v8: operation and order command surfaces */
.op-command-strip {
  display: grid;
  grid-template-columns: minmax(240px, 1.25fr) repeat(4, minmax(150px, 1fr));
  grid-auto-flow: dense;
  gap: 10px;
  min-width: 0;
}

.op-command-card {
  min-width: 0;
  min-height: 110px;
  display: grid;
  align-content: start;
  gap: 7px;
  border: 1px solid rgba(216, 226, 232, 0.9);
  border-radius: var(--radius-card);
  padding: 13px;
  background: #fbfdfd;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.op-command-card:hover {
  transform: translateY(-1px);
  border-color: rgba(8, 127, 120, 0.24);
  box-shadow: 0 12px 28px rgba(19, 32, 50, 0.08);
}

.op-command-card-main {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(237, 247, 245, 0.94)),
    var(--surface);
}

.op-command-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.op-command-card strong {
  color: var(--ink);
  font-size: clamp(18px, 1.7vw, 26px);
  line-height: 1.22;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.op-command-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

#operation-view > .panel,
#orders-view > .panel,
.op-module,
.maiyatian-live {
  border-radius: var(--radius-card);
}

#operation-view .source-table,
#orders-view .source-table,
.op-visual .table,
.metric-drilldown .table {
  max-width: 100%;
  overflow: auto;
  border-radius: var(--radius-control);
}

.op-visual .table table,
.metric-drilldown .table table {
  min-width: 720px;
}

.op-module .panel-title {
  align-items: start;
}

.op-metrics {
  grid-auto-flow: dense;
}

.op-metric {
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.op-metric:hover {
  transform: translateY(-1px);
  border-color: rgba(8, 127, 120, 0.22);
  box-shadow: 0 10px 22px rgba(19, 32, 50, 0.07);
}

.op-metric p,
.op-conclusion,
.action-list p {
  line-height: 1.65;
}

@media (max-width: 1280px) {
  .op-command-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .op-command-strip,
  .op-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .op-command-strip,
  .op-metrics {
    grid-template-columns: minmax(0, 1fr);
  }

  .op-command-card {
    min-height: auto;
  }
}

/* UI refresh v9: marketing command surfaces */
.marketing-command-strip {
  display: grid;
  grid-template-columns: minmax(250px, 1.25fr) repeat(4, minmax(150px, 1fr));
  grid-auto-flow: dense;
  gap: 10px;
  min-width: 0;
}

.marketing-command-card {
  min-width: 0;
  min-height: 108px;
  display: grid;
  align-content: start;
  gap: 7px;
  border: 1px solid rgba(216, 226, 232, 0.92);
  border-radius: var(--radius-card);
  padding: 13px;
  background: #fbfdfd;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.marketing-command-card:hover {
  transform: translateY(-1px);
  border-color: rgba(8, 127, 120, 0.24);
  box-shadow: 0 12px 28px rgba(19, 32, 50, 0.08);
}

.marketing-command-main {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(236, 247, 245, 0.94)),
    var(--surface);
}

.marketing-command-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.marketing-command-card strong {
  color: var(--ink);
  font-size: clamp(18px, 1.65vw, 25px);
  line-height: 1.22;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.marketing-command-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

#marketing-view > .marketing-command-strip + .panel,
#marketing-activity-monitor > .marketing-command-strip + .panel {
  margin-top: 10px;
}

#marketing-activity-monitor .marketing-subnav-panel {
  z-index: 7;
}

@media (max-width: 1280px) {
  .marketing-command-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .marketing-command-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .marketing-command-strip {
    grid-template-columns: minmax(0, 1fr);
  }

  .marketing-command-card {
    min-height: auto;
  }
}

/* UI refresh v10: product and inventory command surfaces */
.module-command-strip {
  display: grid;
  grid-template-columns: minmax(250px, 1.25fr) repeat(4, minmax(150px, 1fr));
  grid-auto-flow: dense;
  gap: 10px;
  min-width: 0;
}

.module-command-card {
  min-width: 0;
  min-height: 108px;
  display: grid;
  align-content: start;
  gap: 7px;
  border: 1px solid rgba(216, 226, 232, 0.92);
  border-radius: var(--radius-card);
  padding: 13px;
  background: #fbfdfd;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.module-command-card:hover {
  transform: translateY(-1px);
  border-color: rgba(8, 127, 120, 0.24);
  box-shadow: 0 12px 28px rgba(19, 32, 50, 0.08);
}

.module-command-main {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(242, 248, 246, 0.94)),
    var(--surface);
}

.module-command-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.module-command-card strong {
  color: var(--ink);
  font-size: clamp(18px, 1.65vw, 25px);
  line-height: 1.22;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.module-command-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

#products-view > .panel,
#inventory-view > .panel {
  border-radius: var(--radius-card);
}

#products-view .module-table,
#inventory-view .module-table {
  max-width: 100%;
  overflow: auto;
  border-radius: var(--radius-control);
}

#products-view .module-table table,
#inventory-view .module-table table {
  min-width: 820px;
}

#products-view .module-table td:nth-child(2),
#inventory-view .module-table td:nth-child(2) {
  color: var(--ink);
  font-weight: 760;
}

#products-view .module-empty-state,
#inventory-view .module-empty-state {
  min-height: 128px;
}

#products-view .product-center-subnav-panel {
  padding: 10px;
}

#products-view .product-center-subnav {
  margin: 0;
}

#products-view .product-center-section {
  display: grid;
  gap: 14px;
}

#products-view .product-center-split,
#products-view .product-center-two-tables {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.72fr);
  gap: 12px;
  align-items: start;
}

#products-view .product-center-two-tables {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#products-view .product-center-note {
  border: 1px solid rgba(216, 226, 232, 0.92);
  border-radius: var(--radius-card);
  padding: 14px;
  background: #fbfdfd;
  color: var(--muted);
}

#products-view .product-center-note strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
}

#products-view .product-center-note p {
  margin: 0;
  line-height: 1.7;
}

#products-view .product-center-detail-table {
  max-height: 560px;
  overflow: auto;
  border-radius: var(--radius-control);
}

#products-view .product-center-store-table {
  max-height: 520px;
  overflow: auto;
  border-radius: var(--radius-control);
}

#products-view .product-center-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 12px;
  background: #fff;
}

#products-view .product-center-toolbar h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

#products-view .product-center-toolbar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

#products-view .table-action.active {
  border-color: rgba(8, 127, 120, 0.35);
  background: rgba(8, 127, 120, 0.1);
  color: var(--brand);
}

#products-view .product-center-detail-table h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

#products-view .product-center-detail-table table {
  min-width: 980px;
}

@media (max-width: 1280px) {
  .module-command-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .module-command-strip,
  #products-view .module-metrics,
  #inventory-view .module-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .module-command-strip,
  #products-view .module-metrics,
  #inventory-view .module-metrics {
    grid-template-columns: minmax(0, 1fr);
  }

  .module-command-card {
    min-height: auto;
  }
}

@media (max-width: 900px) {
  #products-view .product-center-split,
  #products-view .product-center-two-tables {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* UI refresh v11: task and finance readiness surfaces */
.task-command-strip,
.finance-command-strip {
  margin-bottom: 12px;
}

.task-readiness-panel,
.finance-placeholder-panel {
  border-radius: var(--radius-card);
}

.task-readiness-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 10px;
}

.task-readiness-grid article {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid rgba(216, 226, 232, 0.9);
  border-radius: var(--radius-card);
  padding: 14px;
  background: #fbfdfd;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.task-readiness-grid article:hover {
  transform: translateY(-1px);
  border-color: rgba(8, 127, 120, 0.24);
  box-shadow: 0 12px 28px rgba(19, 32, 50, 0.08);
}

.task-readiness-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.task-readiness-grid strong {
  color: var(--ink);
  font-size: 17px;
  overflow-wrap: anywhere;
}

.task-readiness-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

#finance-view .finance-placeholder-panel {
  margin-top: 0;
}

@media (max-width: 920px) {
  .task-readiness-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .task-readiness-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* UI refresh v12: workflow and database command surfaces */
.workflow-command-strip,
.database-command-strip {
  margin-bottom: 12px;
}

#workflow-view > .prep-hero {
  margin-top: 0;
}

#workflow-view .workflow-list-panel .table,
#database-view .database-record-panel .table {
  max-width: 100%;
  overflow: auto;
  border-radius: var(--radius-control);
}

#workflow-view .workflow-list-panel table,
#database-view .database-record-panel table {
  min-width: 860px;
}

#database-view .database-record-panel table {
  min-width: 920px;
}

#workflow-view .workflow-list-panel td:first-child,
#database-view .database-record-panel td:nth-child(2) {
  color: var(--ink);
  font-weight: 760;
}

#database-view .database-record-panel th:first-child,
#database-view .database-record-panel td:first-child {
  width: 74px;
  min-width: 74px;
  text-align: center;
}

.database-record-bulk-bar {
  position: sticky;
  left: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(204, 218, 227, 0.9);
  border-radius: var(--radius-control);
  background: #f8fbfb;
}

.database-record-bulk-bar > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.database-record-bulk-bar strong {
  color: var(--ink);
  white-space: nowrap;
}

.database-record-bulk-bar span,
.database-record-select-all span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.database-record-select-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}

.database-record-checkbox {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

#database-view .database-record-panel tbody tr.is-selected td {
  background: rgba(15, 136, 124, 0.07);
}

@media (max-width: 640px) {
  .database-record-bulk-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .database-record-bulk-bar > div {
    justify-content: space-between;
  }
}

#workflow-view .workflow-category-grid {
  min-width: 0;
}

#workflow-view .workflow-authoring-panel,
#database-view .database-import-panel {
  border-radius: var(--radius-card);
}

/* UI refresh v13: organization command surface */
.org-command-strip {
  margin-bottom: 12px;
}

#org-view .org-summary {
  margin-bottom: 12px;
}

#org-view > .panel,
#org-view #org-summary {
  min-width: 0;
}

#org-view .panel[data-admin-only],
#org-view > .panel:last-child {
  border-radius: var(--radius-card);
}

#org-view #accounts-table,
#org-view #personnel-table,
#org-view #store-mapping-table {
  max-width: 100%;
  overflow: auto;
  border-radius: var(--radius-control);
}

/* UI refresh v14: promotion command surface */
.promotion-command-strip {
  margin-bottom: 12px;
}

#promotionCenter-view .promotion-summary-panel,
#promotionCenter-view .promotion-filter-panel,
#promotionCenter-view .promotion-table-panel {
  border-radius: var(--radius-card);
}

#promotionCenter-view .promotion-live-table {
  max-width: 100%;
  border-radius: var(--radius-control);
}

#promotionCenter-view .promotion-live-table td:first-child {
  color: var(--ink);
  font-weight: 760;
}

.product-image-helper-panel > *,
.product-image-helper-shell,
.product-image-helper-toolbar,
.product-image-helper-frame {
  min-width: 0;
  max-width: 100%;
}

/* UI refresh v16: task hub command cockpit */
.task-hub-panel {
  overflow: hidden;
}

.task-hub-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
  gap: 12px;
  align-items: stretch;
  min-width: 0;
}

.task-hub-copy {
  display: grid;
  align-content: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid rgba(216, 226, 232, 0.92);
  border-radius: var(--radius-card);
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(242, 248, 246, 0.94)),
    var(--surface);
}

.task-hub-copy span,
.task-hub-grid span {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.task-hub-copy strong {
  max-width: 520px;
  color: var(--ink);
  font-size: clamp(22px, 2.1vw, 32px);
  line-height: 1.18;
  letter-spacing: 0;
}

.task-hub-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.task-hub-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.task-hub-grid article {
  grid-template-rows: auto auto minmax(44px, 1fr);
}

.task-hub-control-panel {
  overflow: visible;
}

.task-perspective-tabs {
  display: inline-flex;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  border: 1px solid rgba(216, 226, 232, 0.95);
  border-radius: 8px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.96);
}

.task-perspective-tabs button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 760;
  cursor: pointer;
}

.task-perspective-tabs button.active {
  background: var(--ink);
  color: #fff;
}

.task-personal-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.task-personal-tabs button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  min-height: 54px;
  border: 1px solid rgba(216, 226, 232, 0.95);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.task-personal-tabs button.active {
  border-color: rgba(24, 120, 94, 0.5);
  box-shadow: 0 0 0 2px rgba(24, 120, 94, 0.08);
}

.task-personal-tabs span {
  min-width: 0;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-personal-tabs strong {
  min-width: 32px;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(238, 246, 243, 0.96);
  color: var(--accent-strong);
  font-size: 13px;
  line-height: 1.2;
}

.daily-checklist {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.daily-checklist article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  border: 1px solid rgba(216, 226, 232, 0.88);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(248, 251, 250, 0.9);
}

.daily-checklist strong {
  display: block;
  color: var(--ink);
  line-height: 1.35;
}

.daily-checklist p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.task-hub-control-panel .panel-title {
  gap: 12px;
}

.task-hub-control-panel .inline-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.task-hub-control-panel select,
.task-work-update select,
.task-create-form select,
.task-generate-form select {
  min-height: 38px;
  border: 1px solid rgba(196, 207, 214, 0.95);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.task-role-grid,
.task-source-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.task-source-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.task-role-grid article,
.task-source-grid article {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid rgba(216, 226, 232, 0.92);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.96);
  cursor: pointer;
}

.task-source-grid article {
  cursor: default;
}

.task-role-grid article.active {
  border-color: rgba(24, 120, 94, 0.5);
  box-shadow: 0 0 0 2px rgba(24, 120, 94, 0.08);
}

.task-role-grid span,
.task-source-grid span {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.task-role-grid strong,
.task-source-grid strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
}

.task-role-grid p,
.task-source-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.task-workbench-grid {
  align-items: start;
}

.task-create-form textarea {
  width: 100%;
  min-height: 74px;
  resize: vertical;
  border: 1px solid rgba(196, 207, 214, 0.95);
  border-radius: 8px;
  padding: 10px;
  font: inherit;
}

.task-work-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.task-work-list.compact {
  max-height: 640px;
  overflow: auto;
  padding-right: 2px;
}

.task-work-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.46fr);
  gap: 12px;
  min-width: 0;
  border: 1px solid rgba(216, 226, 232, 0.92);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.96);
}

.task-work-card.overdue {
  border-color: rgba(190, 93, 65, 0.42);
  background: rgba(255, 250, 247, 0.96);
}

.task-work-card.personal {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.42fr);
}

.task-work-list.compact .task-work-card {
  grid-template-columns: minmax(0, 1fr);
}

.task-work-main,
.task-work-update {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.task-work-head {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 0;
}

.task-work-head strong {
  min-width: 0;
  color: var(--ink);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.task-work-main p,
.task-work-main small {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.task-work-main .task-work-blocker {
  color: #a4482f;
  font-weight: 760;
}

.task-work-history {
  display: grid;
  gap: 4px;
  border-top: 1px dashed rgba(196, 207, 214, 0.85);
  padding-top: 6px;
}

.task-work-history summary {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.task-work-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.task-work-meta span {
  border: 1px solid rgba(216, 226, 232, 0.9);
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  background: rgba(248, 251, 250, 0.9);
}

.task-work-meta .warn {
  color: #a4482f;
  border-color: rgba(190, 93, 65, 0.35);
}

.task-work-meta .review {
  color: #8c641f;
  border-color: rgba(196, 149, 53, 0.35);
}

.task-work-meta .muted {
  color: var(--muted);
}

.task-work-update input {
  min-width: 0;
  min-height: 38px;
  border: 1px solid rgba(196, 207, 214, 0.95);
  border-radius: 8px;
  padding: 0 10px;
  font: inherit;
}

.task-pool-table {
  overflow-x: auto;
}

.task-pool-table table small {
  color: var(--muted);
}

.status-tag.doing {
  background: rgba(223, 240, 255, 0.95);
  color: #235d86;
}

.status-tag.review {
  background: rgba(255, 246, 221, 0.95);
  color: #7a571b;
}

@media (max-width: 1180px) {
  .task-hub-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .task-hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-role-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-personal-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-work-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .task-work-card.personal {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .task-hub-grid {
    grid-template-columns: minmax(0, 1fr);
  }

.task-hub-copy {
    padding: 14px;
  }

  .task-role-grid,
  .task-source-grid,
  .task-personal-tabs {
    grid-template-columns: minmax(0, 1fr);
  }

  .daily-checklist article {
    grid-template-columns: minmax(0, 1fr);
  }

  .task-hub-control-panel .inline-actions {
    width: 100%;
  }

  .task-hub-control-panel select,
  .task-hub-control-panel .secondary-button {
    width: 100%;
  }
}

/* UI refresh v17: finance control cockpit */
#finance-view .finance-readiness {
  grid-template-columns: minmax(280px, 0.68fr) minmax(0, 1.32fr);
  gap: 12px;
  min-width: 0;
}

#finance-view .finance-readiness-copy {
  border-color: rgba(8, 127, 120, 0.18);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(240, 248, 247, 0.95)),
    var(--surface);
}

#finance-view .finance-readiness-copy span,
#finance-view .finance-readiness-grid span {
  color: var(--accent-strong);
  font-weight: 800;
}

#finance-view .finance-readiness-copy strong {
  max-width: 520px;
  color: var(--ink);
  font-size: clamp(22px, 2.2vw, 32px);
  line-height: 1.18;
}

#finance-view .finance-readiness-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#finance-view .finance-readiness-grid article {
  min-width: 0;
  grid-template-rows: auto auto minmax(44px, 1fr);
}

#finance-view .finance-readiness-grid strong {
  font-size: 18px;
}

@media (max-width: 1180px) {
  #finance-view .finance-readiness {
    grid-template-columns: minmax(0, 1fr);
  }

  #finance-view .finance-readiness-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
#finance-view .finance-readiness-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* UI refresh v18: product and inventory empty data readiness */
.product-inventory-empty {
  align-items: stretch;
  gap: 14px;
  min-height: 210px;
}

.module-empty-copy {
  display: grid;
  align-content: center;
  gap: 9px;
  min-width: 0;
}

.module-empty-copy span,
.module-next-grid span {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.module-empty-copy strong {
  color: var(--ink);
  font-size: clamp(22px, 2.1vw, 31px);
  line-height: 1.18;
  letter-spacing: 0;
}

.module-empty-copy p,
.module-next-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.62;
}

.module-next-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-flow: dense;
  align-content: stretch;
}

.module-next-grid article {
  display: grid;
  grid-template-rows: auto auto minmax(48px, 1fr);
  gap: 8px;
  min-width: 0;
  border: 1px solid rgba(216, 226, 232, 0.92);
  border-radius: var(--radius-card);
  padding: 13px;
  background: rgba(255, 255, 255, 0.86);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.module-next-grid article:hover {
  transform: translateY(-1px);
  border-color: rgba(8, 127, 120, 0.24);
  box-shadow: 0 12px 28px rgba(19, 32, 50, 0.08);
}

.module-next-grid strong {
  color: var(--ink);
  font-size: 17px;
  letter-spacing: 0;
}

@media (max-width: 1180px) {
  .product-inventory-empty {
    grid-template-columns: minmax(0, 1fr);
  }

  .module-next-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .module-next-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.refresh-status {
  min-width: 48px;
  color: #5f7187;
  font-size: 12px;
  font-weight: 720;
  line-height: 1;
  white-space: nowrap;
}

.refresh-status[data-tone="loading"] {
  color: #087f78;
}

.refresh-status[data-tone="done"] {
  color: #087f78;
}

.refresh-status[data-tone="error"] {
  color: #d94841;
}

#refresh-btn[data-loading="1"] {
  color: #087f78;
  pointer-events: none;
}

/* UI refresh v19: clean middle-platform shell */
:root {
  --bg: #eef2f5;
  --surface: #ffffff;
  --surface-soft: #f7f9fb;
  --ink: #182230;
  --muted: #667085;
  --line: #d8e0e8;
  --line-soft: #e8edf2;
  --accent: #11796f;
  --accent-strong: #0b635c;
  --accent-soft: #e7f4f2;
  --accent-2: #c93a2f;
  --gold: #b78935;
  --blue: #2567b8;
  --radius-card: 8px;
  --shadow: 0 10px 26px rgba(18, 31, 46, 0.06);
  --shadow-soft: 0 1px 2px rgba(18, 31, 46, 0.05);
}

body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 "Inter", Geist, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

button,
input,
select,
textarea {
  letter-spacing: 0;
}

button:disabled,
.table-action:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.shell {
  grid-template-columns: 220px minmax(0, 1fr);
  background: var(--bg);
}

.sidebar {
  gap: 12px;
  padding: 18px 12px;
  background: #17212d;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.brand {
  min-height: 72px;
  padding: 2px 8px 18px;
}

.brand-logo {
  width: 54px;
  height: 42px;
  border-radius: 6px;
  background: #f4f0e8;
}

.brand strong {
  font-size: 15px;
  letter-spacing: 0;
}

.brand small {
  color: #9aa8b7;
  font-size: 12px;
}

nav {
  gap: 4px;
  padding-right: 4px;
}

.nav {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 9px 11px;
  color: #b9c5d2;
  font-weight: 650;
  line-height: 1.25;
}

.nav.active {
  border-color: rgba(255, 255, 255, 0.08);
  background: #243140;
  color: #ffffff;
  box-shadow: inset 3px 0 0 var(--gold);
}

.nav:hover {
  background: #22303f;
  color: #ffffff;
}

.sidebar-toggle {
  border-radius: 7px;
  background: #202b38;
}

.shell.sidebar-collapsed {
  grid-template-columns: 72px minmax(0, 1fr);
}

.shell.sidebar-collapsed .brand-logo {
  width: 40px;
  height: 40px;
}

.main {
  padding: 18px 20px 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0) 148px),
    var(--bg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 18;
  min-height: 70px;
  margin: -18px -20px 16px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(216, 224, 232, 0.88);
  background: rgba(247, 250, 252, 0.94);
  backdrop-filter: blur(12px);
}

.topbar > div:first-child {
  min-width: 0;
}

h1 {
  color: var(--ink);
  font-size: 21px;
  font-weight: 760;
  line-height: 1.22;
  letter-spacing: 0;
}

h2 {
  color: var(--ink);
  font-size: 15px;
  font-weight: 760;
  letter-spacing: 0;
}

.topbar p,
.panel-title p {
  color: var(--muted);
  line-height: 1.5;
}

.actions,
.inline-actions {
  gap: 8px;
  flex-wrap: wrap;
}

.icon-button,
.secondary-button,
.table-action,
.collapse-toggle,
form button,
.date-presets button,
.metric-toggle {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
  font-weight: 680;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.icon-button:hover,
.secondary-button:hover,
.table-action:hover,
.collapse-toggle:hover,
form button:hover,
.date-presets button:hover,
.metric-toggle:hover {
  border-color: #b9c7d4;
  background: #f8fafc;
  transform: translateY(-1px);
}

form button:not(.secondary-button),
.collapse-toggle.primary,
.table-action.active,
.date-presets button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.table-action.danger {
  border-color: #f2c4bf;
  background: #fff7f6;
  color: var(--accent-2);
}

.pill,
.tag,
.status-tag,
.trend {
  border-radius: 999px;
  letter-spacing: 0;
  white-space: nowrap;
}

.pill {
  min-height: 34px;
  border-color: var(--line);
  background: #ffffff;
  color: #596779;
  font-weight: 660;
}

.pill.ok,
.tag.review,
.trend.up {
  border-color: #b7dcd6;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.tag.warn,
.trend.down {
  border-color: #f0c8bf;
  background: #fff2ef;
  color: #a3382a;
}

.panel,
.metric,
.filter-item,
.marketing-summary-card,
.brief-card,
.op-metric,
.task-work-card,
.task-role-grid article,
.task-source-grid article,
.module-next-grid article {
  border-color: var(--line-soft);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.panel {
  padding: 16px;
}

.view.active {
  gap: 12px;
}

.panel-title {
  gap: 12px;
  margin-bottom: 13px;
  padding-bottom: 0;
}

.panel-title > div {
  min-width: 0;
}

.panel-title h2 {
  line-height: 1.3;
}

.panel-title span,
.panel-title p,
.metric span,
.filter-item span,
.op-metric span,
.marketing-summary-card span {
  color: var(--muted);
  font-size: 12px;
}

.metrics,
.op-metrics,
.marketing-summary-row,
.task-hub-grid,
.finance-readiness-grid,
.module-next-grid {
  gap: 10px;
}

.metric {
  min-height: 104px;
  padding: 14px;
}

.metric strong,
.marketing-summary-card strong {
  color: var(--ink);
  font-weight: 780;
  letter-spacing: 0;
}

.metric strong {
  margin-top: 7px;
  font-size: 24px;
}

.metric p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.metric:hover,
.marketing-summary-card:hover,
.task-work-card:hover,
.module-next-grid article:hover {
  border-color: #cbd7e2;
  box-shadow: var(--shadow);
}

.filter-grid {
  gap: 9px;
}

.filter-item {
  padding: 10px 11px;
  background: var(--surface-soft);
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(17, 121, 111, 0.12);
  outline: none;
}

.table {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.table table {
  border-collapse: separate;
  border-spacing: 0;
}

.table th,
.table td {
  border-bottom: 1px solid #edf1f5;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.48;
  vertical-align: top;
}

.table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f7f9fb;
  color: #5f6f82;
  font-weight: 760;
}

.table td {
  color: #243142;
}

.table tbody tr:hover td {
  background: #f8fbfb;
}

.table.compact th,
.table.compact td {
  padding: 9px 10px;
}

.empty {
  border: 1px dashed #cbd6e1;
  border-radius: var(--radius-card);
  background: #f8fafc;
  color: var(--muted);
}

.task-hub-layout,
.finance-readiness,
.product-inventory-empty {
  gap: 12px;
}

.task-hub-copy,
#finance-view .finance-readiness-copy {
  background: #ffffff;
  border-color: var(--line-soft);
}

.task-hub-copy strong,
#finance-view .finance-readiness-copy strong,
.module-empty-copy strong {
  font-size: clamp(22px, 2vw, 30px);
  letter-spacing: 0;
}

.task-perspective-tabs,
.task-personal-tabs button {
  border-color: var(--line);
  background: #ffffff;
}

.task-perspective-tabs button.active {
  background: var(--accent);
}

.task-work-list.compact {
  max-height: 560px;
}

.task-work-card {
  padding: 12px;
}

.task-work-meta span {
  border-color: var(--line-soft);
  background: #f8fafc;
}

.marketing-control-overview {
  border-radius: var(--radius-card) !important;
  box-shadow: var(--shadow-soft) !important;
}

.marketing-summary-card {
  min-height: 84px;
  padding: 13px 14px;
}

.marketing-summary-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(17, 121, 111, 0.18);
}

.marketing-summary-card strong {
  font-size: 24px;
}

.wechat-status-item,
.wechat-summary-row,
.wechat-rule-list article,
.marketing-search-result-card,
.marketing-rule-chip {
  border-radius: var(--radius-card) !important;
}

.refresh-status {
  color: var(--muted);
}

.display-deduped {
  display: none !important;
}

@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 200px minmax(0, 1fr);
  }

  .metrics,
  .op-metrics,
  .marketing-summary-row,
  .marketing-summary-row-four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .shell,
  .shell.sidebar-collapsed {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
  }

  .sidebar {
    position: relative;
    height: auto;
    grid-template-rows: auto auto;
  }

  .sidebar nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: none;
  }

  .sidebar-toggle {
    display: none;
  }

  .main {
    height: auto;
    overflow: visible;
  }

  .topbar {
    position: static;
  }
}

@media (max-width: 720px) {
  .main {
    padding: 14px;
  }

  .topbar {
    margin: -14px -14px 14px;
    padding: 14px;
  }

  .metrics,
  .op-metrics,
  .marketing-summary-row,
  .marketing-summary-row-four {
    grid-template-columns: minmax(0, 1fr);
  }

  .actions,
  .inline-actions,
  .panel-title {
    align-items: stretch;
  }

  .actions > *,
  .inline-actions > * {
    max-width: 100%;
  }
}

@media (max-width: 720px) {
  .sidebar {
    padding: 12px;
  }

  .sidebar .brand {
    min-height: 52px;
    gap: 10px;
    padding: 0 4px 10px;
  }

  .sidebar .brand-logo {
    width: 44px;
    height: 34px;
  }

  .sidebar .brand strong {
    font-size: 14px;
  }

  .sidebar .brand small {
    font-size: 11px;
  }

  .sidebar nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding-right: 0;
  }

  .sidebar .nav {
    display: flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    padding: 7px 8px;
    font-size: 13px;
    line-height: 1.2;
    text-align: center;
  }

  .task-perspective-tabs,
  .marketing-subnav,
  .product-center-tabs {
    display: flex;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .task-perspective-tabs::-webkit-scrollbar,
  .marketing-subnav::-webkit-scrollbar,
  .product-center-tabs::-webkit-scrollbar {
    display: none;
  }

  .task-perspective-tabs button,
  .marketing-subnav button,
  .product-center-tabs button {
    flex: 0 0 auto;
    min-width: max-content;
    white-space: nowrap;
  }
}

/* Activity assistant fixed layout overrides. Keep these at the end because
   earlier responsive rules also target generic marketing summary/subnav grids. */
#marketing-activity-monitor > .marketing-subnav-panel {
  width: 100% !important;
  max-width: none !important;
  justify-self: stretch !important;
  overflow: visible !important;
}

#marketing-activity-monitor > .marketing-subnav-panel .module-subnav {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow: visible !important;
}

#marketing-activity-monitor > .marketing-subnav-panel .module-subnav button {
  min-width: 0 !important;
  width: 100% !important;
  padding-inline: 10px !important;
  white-space: nowrap !important;
}

#marketing-activity-monitor .marketing-assistant-summary-row {
  display: grid !important;
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

#marketing-activity-monitor .marketing-assistant-summary-row .marketing-summary-card {
  min-width: 0 !important;
  min-height: 78px !important;
  padding: 10px 12px !important;
}

#marketing-activity-monitor .marketing-assistant-summary-row .marketing-summary-card strong {
  font-size: 22px !important;
}

#marketing-activity-monitor .marketing-assistant-summary-row .marketing-summary-card span,
#marketing-activity-monitor .marketing-assistant-summary-row .marketing-summary-card p {
  overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
  #marketing-activity-monitor .marketing-assistant-summary-row {
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 1120px) {
  #marketing-activity-monitor > .marketing-subnav-panel .module-subnav {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  }
}

/* UI refresh v20: layered workbench */
body.ui-layered {
  --bg: #f3f5f6;
  --surface: #ffffff;
  --surface-soft: #f7f9f9;
  --surface-tint: #eef6f4;
  --ink: #17212f;
  --text: var(--ink);
  --muted: #697586;
  --line: #dbe2e6;
  --border: var(--line);
  --line-soft: #e8edef;
  --accent: #0f887c;
  --accent-strong: #086a62;
  --accent-soft: #e6f3f0;
  --brand: var(--accent);
  --gold: #d5a329;
  --radius-card: 8px;
  --radius-control: 6px;
  --shadow: 0 12px 28px rgba(23, 33, 47, 0.06);
  --shadow-soft: 0 1px 2px rgba(23, 33, 47, 0.04);
  background: var(--bg);
  color: var(--ink);
  font-family: "Cabinet Grotesk", Satoshi, Geist, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.ui-layered .skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 80;
  padding: 8px 12px;
  border-radius: var(--radius-control);
  background: var(--ink);
  color: #ffffff;
  transform: translateY(-160%);
  transition: transform 0.18s ease;
}

body.ui-layered .skip-link:focus {
  transform: translateY(0);
}

body.ui-layered .shell {
  grid-template-columns: 204px minmax(0, 1fr);
  min-height: 100dvh;
  height: 100dvh;
  background: var(--bg);
}

body.ui-layered .sidebar {
  gap: 10px;
  padding: 16px 12px 12px;
  background: #172330;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

body.ui-layered .brand {
  min-height: 64px;
  gap: 10px;
  padding: 2px 7px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body.ui-layered .brand-logo {
  width: 48px;
  height: 38px;
  border-radius: 7px;
  background: #f4b719;
}

body.ui-layered .brand strong {
  font-size: 15px;
  font-weight: 760;
}

body.ui-layered .brand small {
  color: #9eacba;
  font-size: 11px;
}

body.ui-layered .sidebar nav {
  gap: 2px;
  padding: 0 2px 2px;
}

body.ui-layered .nav-group-label {
  display: block;
  margin: 10px 9px 4px;
  color: #7e8c9c;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.3;
}

body.ui-layered .nav {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 8px 10px;
  background: transparent;
  color: #b9c5d1;
  font-size: 13px;
  font-weight: 620;
  line-height: 1.2;
  box-shadow: none;
}

body.ui-layered .nav:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

body.ui-layered .nav.active {
  background: #185b57;
  color: #ffffff;
  box-shadow: inset 3px 0 0 #3cc1b3;
}

body.ui-layered .sidebar-toggle {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

body.ui-layered .shell.sidebar-collapsed {
  grid-template-columns: 68px minmax(0, 1fr);
}

body.ui-layered .shell.sidebar-collapsed .nav-group-label {
  display: none;
}

body.ui-layered .main {
  min-width: 0;
  padding: 0 18px 28px;
  background: var(--bg);
}

body.ui-layered .topbar {
  position: sticky;
  top: 0;
  z-index: 24;
  min-height: 76px;
  margin: 0 -18px 14px;
  padding: 13px 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: none;
  backdrop-filter: blur(14px);
}

body.ui-layered .topbar > div:first-child {
  max-width: 72rem;
}

body.ui-layered h1 {
  max-width: 72rem;
  font-size: 22px;
  font-weight: 780;
  line-height: 1.2;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

body.ui-layered h2 {
  font-weight: 740;
  letter-spacing: -0.01em;
}

body.ui-layered .topbar p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

body.ui-layered .topbar-date {
  color: #445064;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

body.ui-layered .actions {
  gap: 7px;
  align-items: center;
}

body.ui-layered :is(.icon-button, .secondary-button, .table-action, .collapse-toggle, form button, .date-presets button, .metric-toggle) {
  min-height: 34px;
  border-radius: var(--radius-control);
  box-shadow: none;
  font-weight: 680;
  transition: transform 0.16s ease, border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

body.ui-layered :is(.icon-button, .secondary-button, .table-action, .collapse-toggle, form button, .date-presets button, .metric-toggle):active {
  transform: translateY(1px) scale(0.99);
}

body.ui-layered :is(button, input, select, textarea):focus-visible {
  outline: 2px solid rgba(15, 136, 124, 0.42);
  outline-offset: 2px;
}

body.ui-layered .pill {
  min-height: 32px;
  border-radius: 999px;
  box-shadow: none;
}

body.ui-layered .view.active {
  display: grid;
  grid-auto-flow: dense;
  gap: 14px;
  min-width: 0;
  align-content: start;
  animation: layered-view-in 0.2s ease both;
}

@keyframes layered-view-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

body.ui-layered .panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 14px;
  background: var(--surface);
  box-shadow: none;
}

body.ui-layered .panel > .panel-title:first-child {
  min-height: 46px;
  margin: -14px -14px 13px;
  padding: 10px 14px;
  border-bottom: 1px solid #dce7e4;
  background: var(--surface-tint);
  align-items: center;
}

body.ui-layered .panel > .panel-title:first-child h2 {
  position: relative;
  padding-left: 12px;
  font-size: 15px;
  line-height: 1.3;
}

body.ui-layered .panel > .panel-title:first-child h2::before {
  content: "";
  position: absolute;
  top: 0.12em;
  bottom: 0.12em;
  left: 0;
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
}

body.ui-layered .panel-title span,
body.ui-layered .panel-title p {
  color: var(--muted);
  font-size: 12px;
}

body.ui-layered .collapsible-panel.collapsed > .panel-title:first-child {
  margin-bottom: -14px;
  border-bottom: 0;
}

body.ui-layered :is(.module-command-strip, .op-command-strip, .marketing-command-strip) {
  display: grid;
  grid-auto-flow: dense;
  gap: 0;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: none;
}

body.ui-layered :is(.module-command-strip, .op-command-strip, .marketing-command-strip):has(> :nth-child(4):last-child) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.ui-layered :is(.module-command-strip, .op-command-strip, .marketing-command-strip):has(> :nth-child(5):last-child) {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

body.ui-layered :is(.module-command-strip, .op-command-strip, .marketing-command-strip):has(> :nth-child(6):last-child) {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

body.ui-layered :is(.module-command-card, .op-command-card, .marketing-command-card) {
  min-width: 0;
  min-height: 88px;
  border: 0;
  border-right: 1px solid var(--line-soft);
  border-radius: 0;
  padding: 12px 14px;
  background: var(--surface);
  box-shadow: none;
  transform: none;
}

body.ui-layered :is(.module-command-card, .op-command-card, .marketing-command-card):last-child {
  border-right: 0;
}

body.ui-layered :is(.module-command-card, .op-command-card, .marketing-command-card):hover {
  border-color: var(--line-soft);
  background: #f9fbfb;
  box-shadow: none;
  transform: none;
}

body.ui-layered :is(.module-command-card, .op-command-card, .marketing-command-card) span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

body.ui-layered :is(.module-command-card, .op-command-card, .marketing-command-card) strong {
  margin-top: 5px;
  color: var(--ink);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

body.ui-layered :is(.module-command-card, .op-command-card, .marketing-command-card) p {
  display: -webkit-box;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body.ui-layered :is(.metrics, .live-metrics, .marketing-summary-row) {
  display: grid;
  grid-auto-flow: dense;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
}

body.ui-layered :is(.metric, .live-metric, .marketing-summary-card) {
  min-height: 82px;
  border: 0;
  border-right: 1px solid var(--line-soft);
  border-radius: 0;
  padding: 12px 14px;
  background: transparent;
  box-shadow: none;
}

body.ui-layered :is(.metric, .live-metric, .marketing-summary-card):last-child {
  border-right: 0;
}

body.ui-layered :is(.metric, .live-metric, .marketing-summary-card):hover {
  background: #f9fbfb;
  box-shadow: none;
}

body.ui-layered :is(.metric, .live-metric, .marketing-summary-card) strong {
  font-variant-numeric: tabular-nums;
}

body.ui-layered :is(.module-subnav, .product-center-subnav, .product-image-helper-subnav, .task-perspective-tabs) {
  display: flex;
  gap: 22px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 0 2px;
  background: transparent;
  box-shadow: none;
  scrollbar-width: none;
}

body.ui-layered :is(.module-subnav, .product-center-subnav, .product-image-helper-subnav, .task-perspective-tabs)::-webkit-scrollbar {
  display: none;
}

body.ui-layered :is(.module-subnav, .product-center-subnav, .product-image-helper-subnav, .task-perspective-tabs) button {
  flex: 0 0 auto;
  min-width: max-content;
  min-height: 42px;
  border: 0;
  border-radius: 0;
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  font-weight: 680;
  white-space: nowrap;
}

body.ui-layered :is(.module-subnav, .product-center-subnav, .product-image-helper-subnav, .task-perspective-tabs) button:hover {
  background: transparent;
  color: var(--accent-strong);
}

body.ui-layered :is(.module-subnav, .product-center-subnav, .product-image-helper-subnav, .task-perspective-tabs) button.active {
  background: transparent;
  color: var(--accent-strong);
  box-shadow: inset 0 -2px 0 var(--accent);
}

body.ui-layered .filter-grid {
  gap: 8px;
}

body.ui-layered .filter-item {
  border-color: var(--line-soft);
  border-radius: var(--radius-control);
  padding: 9px 10px;
  background: var(--surface-soft);
  box-shadow: none;
}

body.ui-layered :is(input, select, textarea) {
  border-radius: var(--radius-control);
  box-shadow: none;
}

body.ui-layered :is(input, select, textarea):focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 136, 124, 0.1);
}

body.ui-layered .table {
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: none;
}

body.ui-layered .table table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
}

body.ui-layered .table th,
body.ui-layered .table td {
  height: 42px;
  border-bottom: 1px solid var(--line-soft);
  padding: 9px 11px;
  font-size: 12px;
  line-height: 1.45;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}

body.ui-layered .table th {
  top: 0;
  background: #f4f7f7;
  color: #586779;
  font-weight: 720;
  white-space: nowrap;
}

body.ui-layered .table td {
  color: #253244;
}

body.ui-layered .table tbody tr:last-child td {
  border-bottom: 0;
}

body.ui-layered .table tbody tr:hover td {
  background: #f7fbfa;
}

body.ui-layered .table th:last-child,
body.ui-layered .table td:last-child {
  position: static;
  right: auto;
  box-shadow: none;
}

body.ui-layered .table tbody tr:nth-child(even) td:last-child,
body.ui-layered .table tbody tr:hover td:last-child {
  background: inherit;
}

body.ui-layered .empty {
  border-color: #cad6d8;
  border-radius: var(--radius-control);
  background: #f7faf9;
}

body.ui-layered .task-hub-chapter {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
}

body.ui-layered .task-chapter-title {
  min-height: 48px;
  padding: 10px 14px;
  border-bottom: 1px solid #dce7e4;
  background: var(--surface-tint);
}

body.ui-layered .task-chapter-title h2 {
  position: relative;
  margin: 0;
  padding-left: 12px;
  font-size: 15px;
}

body.ui-layered .task-chapter-title h2::before {
  content: "";
  position: absolute;
  top: 0.12em;
  bottom: 0.12em;
  left: 0;
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
}

body.ui-layered .task-chapter-title span {
  display: block;
  margin: 3px 0 0 12px;
  color: var(--muted);
  font-size: 11px;
}

body.ui-layered .task-today-strip {
  border: 0;
  border-radius: 0;
}

body.ui-layered .task-summary-item {
  min-height: 104px;
  padding: 16px 18px;
}

body.ui-layered .task-summary-item strong {
  color: var(--accent-strong);
  font-size: 29px;
  line-height: 1.15;
}

body.ui-layered .task-headquarters-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 14px;
  min-width: 0;
  align-items: start;
}

body.ui-layered .task-role-progress-panel {
  grid-column: span 7;
}

body.ui-layered .task-management-attention {
  grid-column: span 5;
}

body.ui-layered .task-role-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  overflow: hidden;
}

body.ui-layered .task-role-grid article {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(80px, auto) minmax(210px, 1.3fr);
  gap: 12px;
  align-items: center;
  min-height: 44px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  padding: 8px 11px;
  background: #ffffff;
  box-shadow: none;
}

body.ui-layered .task-role-grid article:last-child {
  border-bottom: 0;
}

body.ui-layered .task-role-grid article:hover,
body.ui-layered .task-role-grid article.active {
  background: #f1f8f6;
  box-shadow: inset 3px 0 0 var(--accent);
}

body.ui-layered .task-role-grid span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

body.ui-layered .task-role-grid strong {
  color: var(--accent-strong);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

body.ui-layered .task-role-grid p {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

body.ui-layered .task-attention-list {
  display: grid;
  gap: 0;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  overflow: hidden;
}

body.ui-layered .task-attention-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  border-bottom: 1px solid var(--line-soft);
  padding: 9px 12px 9px 20px;
  background: #ffffff;
}

body.ui-layered .task-attention-row:last-child {
  border-bottom: 0;
}

body.ui-layered .task-attention-row::before {
  content: "";
  position: absolute;
  left: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3a74c9;
}

body.ui-layered .task-attention-row[data-tone="danger"]::before { background: #cf4237; }
body.ui-layered .task-attention-row[data-tone="warning"]::before { background: #e67a28; }
body.ui-layered .task-attention-row[data-tone="review"]::before { background: #d6a125; }

body.ui-layered .task-attention-row strong,
body.ui-layered .task-attention-row span {
  display: block;
}

body.ui-layered .task-attention-row strong {
  color: var(--ink);
  font-size: 13px;
}

body.ui-layered .task-attention-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

body.ui-layered .task-attention-row b {
  color: var(--accent-strong);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

body.ui-layered .task-attention-row[data-tone="danger"] b { color: #b52f29; }
body.ui-layered .task-attention-row[data-tone="warning"] b { color: #b95b18; }

body.ui-layered .task-people-execution .panel-title {
  margin-bottom: 0;
}

body.ui-layered .task-people-execution .inline-actions {
  width: auto;
  margin-left: auto;
  flex-wrap: nowrap;
}

body.ui-layered .task-people-execution .inline-actions select {
  width: 160px;
  min-height: 34px;
}

body.ui-layered .task-table-caption {
  margin-left: auto;
  white-space: nowrap;
}

body.ui-layered #taskHub-view .task-pool-table .table {
  border-top: 0;
  border-radius: 0 0 7px 7px;
}

body.ui-layered #taskHub-view .task-pool-table th:nth-child(n + 3):nth-child(-n + 6),
body.ui-layered #taskHub-view .task-pool-table td:nth-child(n + 3):nth-child(-n + 6) {
  text-align: right;
}

body.ui-layered #taskHub-view .task-pool-table th:last-child,
body.ui-layered #taskHub-view .task-pool-table td:last-child {
  text-align: left;
}

body.ui-layered .task-work-card,
body.ui-layered .task-source-grid article,
body.ui-layered .task-personal-tabs button {
  border-color: var(--line);
  border-radius: 7px;
  box-shadow: none;
}

body.ui-layered .task-work-card:hover,
body.ui-layered .task-source-grid article:hover,
body.ui-layered .task-personal-tabs button:hover {
  border-color: #bdd2ce;
  box-shadow: none;
}

body.ui-layered #marketing-activity-monitor > .panel:not(.marketing-subnav-panel),
body.ui-layered #org-view .panel,
body.ui-layered #workflow-view .panel,
body.ui-layered #database-view .panel {
  overflow: visible;
}

/* Database history backfill: compact operator workspace */
#database-view [hidden] {
  display: none !important;
}

#database-view .database-subnav-panel {
  display: flex;
  align-items: center;
  min-height: 42px;
  margin-bottom: -2px;
}

#database-view .database-subnav {
  width: fit-content;
  min-width: 280px;
  padding: 3px;
}

#database-view .database-subnav button {
  min-height: 34px;
  padding: 0 18px;
  white-space: nowrap;
}

#database-view .history-backfill-form-panel,
#database-view .history-backfill-batches-panel {
  padding: 16px 18px;
}

#database-view .history-backfill-form-panel > .panel-title,
#database-view .history-backfill-batches-panel > .panel-title {
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
}

#database-view .history-backfill-form-panel > .panel-title > div,
#database-view .history-backfill-batches-panel > .panel-title > div {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 12px;
}

#database-view .history-backfill-form {
  gap: 10px;
  max-width: none;
}

#database-view .history-backfill-rule {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  border: 1px solid rgba(8, 127, 120, 0.2);
  border-radius: var(--radius-control);
  padding: 7px 10px;
  background: rgba(8, 127, 120, 0.055);
  color: var(--muted);
  font-size: 13px;
}

#database-view .history-backfill-rule strong {
  flex: 0 0 auto;
  color: var(--accent-strong);
}

#database-view .history-backfill-main-fields,
#database-view .history-backfill-file-fields,
#database-view .history-backfill-period-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
}

#database-view .history-backfill-form label {
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

#database-view .history-backfill-form :is(input, select) {
  min-height: 38px;
  font-size: 13px;
}

#database-view .history-backfill-actions {
  min-height: 38px;
  padding-top: 1px;
}

#database-view .history-backfill-actions button {
  min-height: 36px;
}

#database-view .history-backfill-feedback {
  color: var(--muted);
  font-size: 13px;
}

#database-view .history-backfill-list-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0 8px;
  color: var(--ink);
}

#database-view .history-backfill-list-title span {
  color: var(--muted);
  font-size: 12px;
}

#database-view :is(#history-backfill-jobs, #history-backfill-unified, #history-backfill-batches) {
  max-width: 100%;
  overflow: auto;
  border-radius: var(--radius-control);
}

#database-view #history-backfill-batches {
  max-height: min(52vh, 620px);
}

#database-view #history-backfill-jobs {
  max-height: 220px;
}

#database-view :is(#history-backfill-jobs, #history-backfill-unified) table {
  min-width: 820px;
}

#database-view #history-backfill-batches table {
  min-width: 1180px;
}

#database-view #history-backfill-batches :is(th, td),
#database-view #history-backfill-unified :is(th, td),
#database-view #history-backfill-jobs :is(th, td) {
  padding: 9px 10px;
  vertical-align: middle;
}

#database-view #history-backfill-batches td strong,
#database-view #history-backfill-batches td small {
  display: block;
}

#database-view #history-backfill-batches td small {
  max-width: 260px;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#database-view .history-backfill-validation {
  max-width: 320px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

#database-view .history-backfill-validation.has-error {
  color: #a33b32;
}

#database-view .history-backfill-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

#database-view .history-backfill-row-actions .table-action {
  min-height: 30px;
  padding: 0 10px;
}

#database-view .history-backfill-unified .module-empty-state,
#database-view #history-backfill-batches .module-empty-state {
  min-height: 96px;
}

@media (max-width: 900px) {
  #database-view .history-backfill-main-fields,
  #database-view .history-backfill-file-fields,
  #database-view .history-backfill-period-fields {
    grid-template-columns: 1fr;
  }

  #database-view .history-backfill-rule,
  #database-view .history-backfill-list-title {
    align-items: flex-start;
    flex-direction: column;
  }
}

body.ui-layered #productImageHelper-view .product-image-helper-frame {
  min-width: 0;
  border-color: var(--line);
  border-radius: 7px;
  box-shadow: none;
}

@media (max-width: 1180px) {
  body.ui-layered .shell {
    grid-template-columns: 188px minmax(0, 1fr);
  }

  body.ui-layered :is(.module-command-strip, .op-command-strip, .marketing-command-strip) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.ui-layered .task-headquarters-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body.ui-layered .task-role-progress-panel,
  body.ui-layered .task-management-attention {
    grid-column: auto;
  }

  body.ui-layered #marketing-activity-monitor > .marketing-subnav-panel .module-subnav {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  body.ui-layered #marketing-activity-monitor .marketing-assistant-summary-row {
    grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
  }

  body.ui-layered #marketing-activity-monitor .marketing-assistant-summary-row > .marketing-summary-card {
    grid-column: span 3;
  }

  body.ui-layered #marketing-activity-monitor .marketing-assistant-summary-row > .marketing-summary-card:nth-child(n + 5) {
    grid-column: span 4;
  }
}

@media (max-width: 920px) {
  body.ui-layered {
    overflow: auto;
  }

  body.ui-layered .shell,
  body.ui-layered .shell.sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    min-height: 100dvh;
    height: auto;
  }

  body.ui-layered .sidebar {
    position: sticky;
    top: 0;
    z-index: 42;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto;
    gap: 10px;
    height: auto;
    padding: 9px 10px;
    box-shadow: 0 8px 24px rgba(23, 33, 47, 0.16);
  }

  body.ui-layered .sidebar .brand {
    min-width: max-content;
    min-height: 44px;
    height: 44px;
    max-height: 44px;
    align-self: start;
    border: 0;
    padding: 0;
  }

  body.ui-layered .sidebar .brand-logo {
    width: 42px;
    height: 34px;
  }

  body.ui-layered .sidebar .brand-text {
    display: none;
  }

  body.ui-layered .sidebar nav {
    display: flex;
    flex-direction: row;
    align-content: flex-start;
    align-items: flex-start;
    align-self: start;
    gap: 5px;
    min-width: 0;
    height: 40px;
    max-height: 40px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 0 3px;
    scrollbar-width: none;
  }

  body.ui-layered .sidebar nav::-webkit-scrollbar {
    display: none;
  }

  body.ui-layered .sidebar .nav-group-label {
    display: none;
  }

  body.ui-layered .sidebar .nav {
    flex: 0 0 auto;
    width: auto;
    min-width: max-content;
    min-height: 36px;
    height: 36px;
    max-height: 36px;
    justify-content: center;
    padding: 8px 12px;
    text-align: center;
  }

  body.ui-layered .sidebar-toggle {
    display: none;
  }

  body.ui-layered .main {
    height: auto;
    overflow: visible;
    padding: 0 12px 22px;
  }

  body.ui-layered .topbar {
    position: static;
    margin: 0 -12px 12px;
    padding: 12px;
  }

  body.ui-layered .topbar-date {
    display: none;
  }

  body.ui-layered :is(.metrics, .live-metrics, .marketing-summary-row) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.ui-layered .task-role-grid article {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  body.ui-layered .task-role-grid article p {
    grid-column: 1 / -1;
    text-align: left;
  }

  body.ui-layered #marketing-activity-monitor > .marketing-subnav-panel .module-subnav {
    display: flex !important;
    grid-template-columns: none !important;
    overflow-x: auto !important;
  }

  body.ui-layered #marketing-activity-monitor > .marketing-subnav-panel .module-subnav button {
    width: auto !important;
    min-width: max-content !important;
  }

  body.ui-layered #marketing-activity-monitor .marketing-assistant-summary-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.ui-layered #marketing-activity-monitor .marketing-assistant-summary-row > .marketing-summary-card {
    grid-column: auto;
  }

  body.ui-layered #marketing-activity-monitor .marketing-assistant-summary-row > .marketing-summary-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  body.ui-layered #marketing-activity-monitor .marketing-activity-search-filter-row,
  body.ui-layered #marketing-activity-monitor .marketing-search-panel .form-row {
    grid-template-columns: minmax(0, 1fr) !important;
    min-width: 0;
  }

  body.ui-layered #marketing-activity-monitor .marketing-search-panel,
  body.ui-layered #marketing-activity-monitor .marketing-search-panel form,
  body.ui-layered #marketing-activity-monitor .marketing-search-panel label,
  body.ui-layered #marketing-activity-monitor .marketing-search-panel .inline-actions {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 640px) {
  body.ui-layered .topbar {
    align-items: flex-start;
  }

  body.ui-layered .topbar h1 {
    font-size: 20px;
  }

  body.ui-layered .topbar .actions {
    width: 100%;
    justify-content: flex-start;
  }

  body.ui-layered :is(.module-command-strip, .op-command-strip, .marketing-command-strip),
  body.ui-layered :is(.metrics, .live-metrics, .marketing-summary-row) {
    grid-template-columns: minmax(0, 1fr);
  }

  body.ui-layered :is(.module-command-card, .op-command-card, .marketing-command-card),
  body.ui-layered :is(.metric, .live-metric, .marketing-summary-card) {
    min-height: 76px;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  body.ui-layered :is(.module-command-card, .op-command-card, .marketing-command-card):last-child,
  body.ui-layered :is(.metric, .live-metric, .marketing-summary-card):last-child {
    border-bottom: 0;
  }

  body.ui-layered .task-summary-item {
    min-height: 82px;
    padding: 12px 14px;
  }

  body.ui-layered .task-summary-item strong {
    font-size: 25px;
  }

  body.ui-layered .task-attention-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  body.ui-layered .panel > .panel-title:first-child {
    align-items: flex-start;
  }

  body.ui-layered .task-people-execution .inline-actions {
    width: 100%;
    margin-left: 0;
    flex-wrap: wrap;
  }

  body.ui-layered .task-people-execution .inline-actions select {
    width: min(100%, 220px);
  }

  body.ui-layered #marketing-activity-monitor .marketing-assistant-summary-row {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.ui-layered :is(.module-command-strip, .op-command-strip, .marketing-command-strip),
  body.ui-layered :is(.module-command-strip, .op-command-strip, .marketing-command-strip):has(> :nth-child(4):last-child),
  body.ui-layered :is(.module-command-strip, .op-command-strip, .marketing-command-strip):has(> :nth-child(5):last-child),
  body.ui-layered :is(.module-command-strip, .op-command-strip, .marketing-command-strip):has(> :nth-child(6):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.ui-layered :is(.module-command-strip, .op-command-strip, .marketing-command-strip):has(> :nth-child(odd):last-child) > :last-child {
    grid-column: 1 / -1;
  }

  body.ui-layered :is(.module-command-card, .op-command-card, .marketing-command-card) {
    min-height: 84px;
    border-right: 1px solid var(--line-soft);
  }

  body.ui-layered :is(.module-command-card, .op-command-card, .marketing-command-card):nth-child(2n),
  body.ui-layered :is(.module-command-card, .op-command-card, .marketing-command-card):last-child {
    border-right: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.ui-layered .view.active {
    animation: none;
  }

  body.ui-layered *,
  body.ui-layered *::before,
  body.ui-layered *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Marketing Center · persistent Meituan session queue */
body.marketing-queue-open {
  overflow: hidden;
}

#marketing-activity-monitor > .marketing-subnav-panel .marketing-subnav-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  align-items: stretch;
  gap: 12px;
  width: 100%;
}

#marketing-activity-monitor > .marketing-subnav-panel .marketing-subnav-toolbar > .module-subnav {
  min-width: 0;
}

.marketing-queue-trigger {
  min-width: 0;
  min-height: 52px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 10px 7px 13px;
  border: 1px solid rgba(13, 116, 106, 0.2);
  border-radius: 13px;
  background: #ffffff;
  color: #183332;
  box-shadow: 0 8px 24px rgba(17, 70, 66, 0.08);
  text-align: left;
}

.marketing-queue-trigger:hover {
  border-color: rgba(13, 116, 106, 0.42);
  background: #f7fbfa;
  transform: translateY(-1px);
}

.marketing-queue-trigger:focus-visible {
  outline: 3px solid rgba(18, 135, 125, 0.2);
  outline-offset: 2px;
}

.marketing-queue-trigger-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #1a9a83;
  box-shadow: 0 0 0 5px rgba(26, 154, 131, 0.1);
}

.marketing-queue-trigger.busy .marketing-queue-trigger-dot {
  background: #d99b2b;
  box-shadow: 0 0 0 5px rgba(217, 155, 43, 0.12);
}

.marketing-queue-trigger.auth .marketing-queue-trigger-dot,
.marketing-queue-trigger.offline .marketing-queue-trigger-dot {
  background: #d75b56;
  box-shadow: 0 0 0 5px rgba(215, 91, 86, 0.12);
}

.marketing-queue-trigger-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.marketing-queue-trigger-copy strong {
  overflow: hidden;
  color: #173331;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.marketing-queue-trigger-copy small {
  overflow: hidden;
  color: #71817f;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.marketing-queue-trigger.auth .marketing-queue-trigger-copy small,
.marketing-queue-trigger.offline .marketing-queue-trigger-copy small {
  color: #b54743;
}

.marketing-queue-trigger-badge {
  min-width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  padding: 0 7px;
  border-radius: 999px;
  background: #12877d;
  color: #ffffff;
  font-size: 12px;
  font-weight: 850;
}

.marketing-queue-trigger.auth .marketing-queue-trigger-badge,
.marketing-queue-trigger.offline .marketing-queue-trigger-badge {
  background: #c94f4b;
}

.marketing-queue-trigger-badge[hidden] {
  display: none;
}

.marketing-queue-backdrop {
  position: fixed;
  inset: 0;
  z-index: 520;
  display: flex;
  justify-content: flex-end;
  background: rgba(18, 28, 35, 0.32);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: marketing-queue-fade 160ms ease-out both;
}

.marketing-queue-drawer {
  width: min(470px, 94vw);
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border-left: 1px solid rgba(151, 170, 168, 0.34);
  background: #f7f9f9;
  box-shadow: -26px 0 70px rgba(20, 40, 47, 0.2);
  animation: marketing-queue-slide 210ms cubic-bezier(0.22, 0.78, 0.24, 1) both;
}

.marketing-queue-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid #e0e8e7;
  background: rgba(255, 255, 255, 0.96);
}

.marketing-queue-drawer-head > div {
  min-width: 0;
}

.marketing-queue-drawer-head span {
  display: block;
  margin-bottom: 3px;
  color: #6f817e;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.marketing-queue-drawer-head h2 {
  margin: 0;
  color: #142d2b;
  font-size: 23px;
  line-height: 1.2;
}

.marketing-queue-close {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0 0 2px;
  border: 1px solid #d7e1df;
  border-radius: 11px;
  background: #f7faf9;
  color: #50625f;
  font-size: 25px;
  font-weight: 400;
  line-height: 1;
}

.marketing-queue-close:hover {
  border-color: #b9cdca;
  background: #edf5f3;
  color: #183f3b;
}

.marketing-queue-drawer-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 18px 28px;
}

.marketing-queue-session {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 17px 18px;
  border: 1px solid #d6e8e4;
  border-radius: 15px;
  background: #eef8f5;
}

.marketing-queue-session.auth,
.marketing-queue-session.offline {
  border-color: #efd5d2;
  background: #fff4f2;
}

.marketing-queue-session.busy {
  border-color: #eadfbe;
  background: #fff9ea;
}

.marketing-queue-session-kicker {
  display: block;
  margin-bottom: 4px;
  color: #627a76;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.05em;
}

.marketing-queue-session strong {
  display: block;
  color: #153e39;
  font-size: 18px;
  line-height: 1.35;
}

.marketing-queue-session.auth strong,
.marketing-queue-session.offline strong {
  color: #9f3936;
}

.marketing-queue-session p {
  margin: 5px 0 0;
  color: #657572;
  font-size: 12px;
  line-height: 1.55;
}

.marketing-queue-session-pulse {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #1a9a83;
  box-shadow: 0 0 0 8px rgba(26, 154, 131, 0.12);
}

.marketing-queue-session.busy .marketing-queue-session-pulse {
  background: #d99b2b;
  box-shadow: 0 0 0 8px rgba(217, 155, 43, 0.13);
}

.marketing-queue-session.auth .marketing-queue-session-pulse,
.marketing-queue-session.offline .marketing-queue-session-pulse {
  background: #d75b56;
  box-shadow: 0 0 0 8px rgba(215, 91, 86, 0.13);
}

.marketing-queue-alert {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #efceca;
  border-radius: 11px;
  background: #fff4f2;
  color: #a23d39;
  font-size: 12px;
  line-height: 1.5;
}

.marketing-queue-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.marketing-queue-metrics article {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #e0e8e7;
  border-radius: 12px;
  background: #ffffff;
}

.marketing-queue-metrics span {
  color: #7a8a88;
  font-size: 11px;
  font-weight: 700;
}

.marketing-queue-metrics strong {
  color: #1c3835;
  font-size: 22px;
  line-height: 1;
}

.marketing-queue-section {
  margin-top: 22px;
}

.marketing-queue-section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.marketing-queue-section-title > div {
  display: grid;
  gap: 2px;
}

.marketing-queue-section-title span {
  color: #768683;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.05em;
}

.marketing-queue-section-title strong {
  color: #203b38;
  font-size: 16px;
}

.marketing-queue-section-title .secondary-button {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 9px;
  font-size: 12px;
}

.marketing-queue-job-list {
  display: grid;
  gap: 8px;
}

.marketing-queue-job {
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr);
  gap: 12px;
  padding: 13px 14px 13px 11px;
  border: 1px solid #e0e8e7;
  border-radius: 13px;
  background: #ffffff;
  box-shadow: 0 5px 18px rgba(30, 65, 61, 0.035);
}

.marketing-queue-job-status {
  width: 4px;
  min-height: 100%;
  border-radius: 999px;
  background: #a8b8b6;
}

.marketing-queue-job.running .marketing-queue-job-status,
.marketing-queue-job.leased .marketing-queue-job-status {
  background: #168c7d;
}

.marketing-queue-job.queued .marketing-queue-job-status {
  background: #d99b2b;
}

.marketing-queue-job.completed .marketing-queue-job-status {
  background: #77a79e;
}

.marketing-queue-job.failed .marketing-queue-job-status {
  background: #d75b56;
}

.marketing-queue-job-body {
  min-width: 0;
}

.marketing-queue-job-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.marketing-queue-job-head strong {
  min-width: 0;
  overflow: hidden;
  color: #1b3734;
  font-size: 14px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.marketing-queue-status {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: #eef3f2;
  color: #657673;
  font-size: 10px;
  font-weight: 800;
}

.marketing-queue-status.running,
.marketing-queue-status.leased {
  background: #e6f5f1;
  color: #087365;
}

.marketing-queue-status.queued {
  background: #fff4d8;
  color: #966613;
}

.marketing-queue-status.failed {
  background: #fdecea;
  color: #ac3f3b;
}

.marketing-queue-job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 7px;
  color: #7b8987;
  font-size: 11px;
  line-height: 1.4;
}

.marketing-queue-job-error {
  margin: 8px 0 0;
  padding: 8px 9px;
  border-radius: 8px;
  background: #fff4f2;
  color: #a84440;
  font-size: 11px;
  line-height: 1.5;
}

.marketing-queue-empty {
  padding: 24px 16px;
  border: 1px dashed #cddbd9;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.7);
  text-align: center;
}

.marketing-queue-empty strong {
  display: block;
  color: #36524e;
  font-size: 14px;
}

.marketing-queue-empty p {
  margin: 5px 0 0;
  color: #7b8b88;
  font-size: 12px;
}

.marketing-queue-empty.compact {
  padding: 14px;
}

.marketing-queue-recent .marketing-queue-job {
  box-shadow: none;
}

.marketing-queue-drawer-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid #e0e8e7;
  background: rgba(255, 255, 255, 0.96);
  color: #7c8b88;
  font-size: 10px;
  line-height: 1.4;
}

@keyframes marketing-queue-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes marketing-queue-slide {
  from { opacity: 0; transform: translateX(28px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 980px) {
  #marketing-activity-monitor > .marketing-subnav-panel .marketing-subnav-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .marketing-queue-trigger {
    width: 100%;
  }
}

@media (max-width: 620px) {
  .marketing-queue-drawer {
    width: 100%;
  }

  .marketing-queue-drawer-head {
    padding: 17px 16px 14px;
  }

  .marketing-queue-drawer-body {
    padding: 14px 12px 24px;
  }

  .marketing-queue-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .marketing-queue-drawer-foot {
    flex-direction: column;
    gap: 2px;
  }
}

/* Mobile workbench v1: phone-only navigation and interaction layer.
   Desktop rules above remain the authoritative desktop presentation. */
.mobile-workbench {
  display: none;
}

@media (max-width: 920px) {
  body.mobile-workbench-enabled {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  body.mobile-nav-sheet-open {
    overflow: hidden;
    overscroll-behavior: none;
  }

  body.mobile-workbench-enabled.ui-layered .shell,
  body.mobile-workbench-enabled.ui-layered .shell.sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  body.mobile-workbench-enabled.ui-layered .sidebar {
    display: none !important;
  }

  body.mobile-workbench-enabled.ui-layered .main {
    min-width: 0;
    padding: 0 12px calc(90px + env(safe-area-inset-bottom, 0px));
  }

  body.mobile-workbench-enabled.ui-layered .topbar {
    position: sticky;
    top: 0;
    z-index: 36;
    min-height: 64px;
    margin: 0 -12px 12px;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px;
    align-items: center;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 1px 0 rgba(215, 225, 232, 0.92);
    backdrop-filter: blur(18px) saturate(155%);
  }

  body.mobile-workbench-enabled.ui-layered .topbar > div:first-child {
    min-width: 0;
  }

  body.mobile-workbench-enabled.ui-layered .topbar h1 {
    overflow: hidden;
    font-size: 20px;
    line-height: 1.2;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  body.mobile-workbench-enabled.ui-layered .topbar p {
    display: -webkit-box;
    margin-top: 3px;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
  }

  body.mobile-workbench-enabled.ui-layered .topbar .actions {
    flex: 0 0 auto;
    width: auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
  }

  body.mobile-workbench-enabled.ui-layered :is(#topbar-date, #user-pill, #logout-btn, #refresh-status) {
    display: none !important;
  }

  body.mobile-workbench-enabled.ui-layered :is(#refresh-btn, #health-pill) {
    min-height: 44px;
  }

  body.mobile-workbench-enabled.ui-layered #refresh-btn {
    width: 44px;
    min-width: 44px;
    padding: 0;
    border-radius: 12px;
  }

  body.mobile-workbench-enabled.ui-layered #health-pill {
    max-width: 92px;
    overflow: hidden;
    padding-inline: 10px;
    text-overflow: ellipsis;
  }

  body.mobile-workbench-enabled.ui-layered :is(button, input:not([type="checkbox"]):not([type="radio"]), select, textarea, .multi-select-trigger) {
    min-height: 44px;
  }

  body.mobile-workbench-enabled.ui-layered :is(.view.active, .main.view-switching .view.active) {
    animation: none !important;
  }

  body.mobile-workbench-enabled.ui-layered .panel {
    padding: 12px;
  }

  body.mobile-workbench-enabled.ui-layered .panel > .panel-title:first-child {
    min-height: 48px;
    margin: -12px -12px 12px;
    padding: 10px 12px;
  }

  body.mobile-workbench-enabled.ui-layered .table {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-behavior: smooth;
    touch-action: pan-x pan-y;
    -webkit-overflow-scrolling: touch;
  }

  body.mobile-workbench-enabled.ui-layered :is(.module-subnav, .product-center-subnav, .product-image-helper-subnav, .task-perspective-tabs, .database-subnav) button {
    min-height: 44px;
  }

  body.mobile-workbench-enabled .mobile-workbench {
    display: block;
  }

  body.mobile-workbench-enabled.auth-lock .mobile-workbench {
    display: none;
  }

  .mobile-bottom-nav {
    --mobile-bottom-items: 5;
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 58;
    display: grid;
    grid-template-columns: repeat(var(--mobile-bottom-items), minmax(0, 1fr));
    min-height: calc(62px + env(safe-area-inset-bottom, 0px));
    padding: 5px 8px calc(5px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(214, 224, 231, 0.94);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -10px 28px rgba(24, 34, 48, 0.1);
    backdrop-filter: blur(20px) saturate(165%);
  }

  .mobile-bottom-item {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 52px;
    place-items: center;
    align-content: center;
    gap: 3px;
    border: 0;
    border-radius: 12px;
    padding: 4px 2px;
    background: transparent;
    color: #6c7887;
    box-shadow: none;
    font-size: 10px;
    font-weight: 680;
    line-height: 1;
    transition: transform 140ms cubic-bezier(0.23, 1, 0.32, 1), color 140ms ease-out, background-color 140ms ease-out;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-bottom-item::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 50%;
    width: 34px;
    height: 26px;
    border-radius: 999px;
    background: transparent;
    transform: translateX(-50%);
    transition: background-color 140ms ease-out;
  }

  .mobile-bottom-item:active {
    transform: scale(0.96);
  }

  .mobile-bottom-item.active {
    color: #0c7168;
  }

  .mobile-bottom-item.active::before {
    background: #e6f4f2;
  }

  .mobile-bottom-item svg {
    position: relative;
    z-index: 1;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
  }

  .mobile-bottom-item span {
    position: relative;
    z-index: 1;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .mobile-module-layer {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: grid;
    align-items: end;
    pointer-events: none;
    visibility: hidden;
    transition: visibility 0s linear 240ms;
  }

  .mobile-module-layer.is-open {
    pointer-events: auto;
    visibility: visible;
    transition-delay: 0s;
  }

  .mobile-module-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: rgba(15, 24, 36, 0.46);
    opacity: 0;
    transition: opacity 180ms ease-out;
  }

  .mobile-module-layer.is-open .mobile-module-backdrop {
    opacity: 1;
  }

  .mobile-module-sheet {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    width: 100%;
    max-height: min(84dvh, 760px);
    overflow: hidden;
    border: 1px solid rgba(219, 227, 233, 0.96);
    border-bottom: 0;
    border-radius: 22px 22px 0 0;
    background: #f7f9fb;
    box-shadow: 0 -24px 60px rgba(15, 24, 36, 0.2);
    transform: translateY(100%);
    transition: transform 240ms cubic-bezier(0.23, 1, 0.32, 1);
  }

  .mobile-module-layer.is-open .mobile-module-sheet {
    transform: translateY(0);
  }

  .mobile-module-handle {
    width: 38px;
    height: 4px;
    margin: 8px auto 3px;
    border-radius: 999px;
    background: #c8d1d9;
  }

  .mobile-module-header {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 16px 12px;
    border-bottom: 1px solid #e1e7ec;
    background: rgba(255, 255, 255, 0.92);
  }

  .mobile-module-header h2 {
    margin: 0;
    color: #192433;
    font-size: 18px;
    line-height: 1.2;
  }

  .mobile-module-header p {
    margin: 4px 0 0;
    color: #718092;
    font-size: 11px;
    line-height: 1.35;
  }

  .mobile-module-close {
    flex: 0 0 44px;
    width: 44px;
    min-height: 44px;
    border: 1px solid #d8e1e8;
    border-radius: 12px;
    padding: 0;
    background: #ffffff;
    color: #425063;
    box-shadow: none;
    font-size: 22px;
    line-height: 1;
  }

  .mobile-module-groups {
    min-height: 0;
    overflow-y: auto;
    padding: 14px 14px 18px;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-module-group + .mobile-module-group {
    margin-top: 18px;
  }

  .mobile-module-group h3 {
    margin: 0 2px 8px;
    color: #7a8796;
    font-size: 11px;
    font-weight: 760;
    letter-spacing: 0.08em;
  }

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

  .mobile-module-item {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 52px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid #dfe6eb;
    border-radius: 12px;
    padding: 10px 12px;
    background: #ffffff;
    color: #293647;
    box-shadow: none;
    font-size: 13px;
    font-weight: 680;
    line-height: 1.25;
    text-align: left;
    transition: transform 140ms cubic-bezier(0.23, 1, 0.32, 1), border-color 140ms ease-out, background-color 140ms ease-out;
  }

  .mobile-module-item:active {
    transform: scale(0.97);
  }

  .mobile-module-item.active {
    border-color: #8ecac3;
    background: #e8f5f3;
    color: #0b655e;
  }

  .mobile-module-item > span:first-child {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .mobile-module-current {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 3px 6px;
    background: rgba(15, 118, 110, 0.12);
    color: #0b655e;
    font-size: 9px;
    font-weight: 760;
  }

  .mobile-module-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #e0e7ec;
    background: #ffffff;
  }

  .mobile-module-account {
    min-width: 0;
  }

  .mobile-module-account strong,
  .mobile-module-account small {
    display: block;
    max-width: 210px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .mobile-module-account strong {
    color: #243143;
    font-size: 12px;
  }

  .mobile-module-account small {
    margin-top: 2px;
    color: #748294;
    font-size: 10px;
  }

  .mobile-sheet-logout {
    flex: 0 0 auto;
    min-height: 44px;
    border: 1px solid #e6c4bf;
    border-radius: 11px;
    padding: 0 14px;
    background: #fff7f5;
    color: #a53d33;
    box-shadow: none;
    font-weight: 700;
  }
}

@media (max-width: 480px) {
  body.mobile-workbench-enabled.ui-layered #health-pill {
    width: 10px;
    min-width: 10px;
    max-width: 10px;
    height: 10px;
    min-height: 10px;
    overflow: hidden;
    border: 0;
    border-radius: 999px;
    padding: 0;
    background: #2aa078;
    color: transparent;
  }

  body.mobile-workbench-enabled.ui-layered :is(.metrics, .live-metrics, .marketing-summary-row) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.mobile-workbench-enabled.ui-layered #marketing-activity-monitor .marketing-assistant-summary-row {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

@media (max-width: 920px) and (prefers-reduced-motion: reduce) {
  .mobile-module-layer,
  .mobile-bottom-item,
  .mobile-bottom-item::before,
  .mobile-module-backdrop,
  .mobile-module-sheet,
  .mobile-module-item {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}

/* Daily refresh progress center v1 */
#automationTasks-view > .daily-refresh-progress-panel {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  border-color: rgba(24, 74, 65, 0.14);
  border-radius: 16px;
  padding: 18px;
  background: #ffffff;
  box-shadow: 0 12px 34px rgba(31, 49, 45, 0.055);
  writing-mode: horizontal-tb;
}

#automationTasks-view .daily-refresh-progress-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 0;
  gap: 24px;
}

#automationTasks-view .daily-refresh-progress-heading > div:first-child {
  min-width: 0;
}

#automationTasks-view .daily-refresh-progress-kicker {
  display: block;
  margin-bottom: 6px;
  color: #788681;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.12em;
}

#automationTasks-view .daily-refresh-progress-heading h2 {
  margin: 0;
  color: var(--automation-ink);
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 650;
  letter-spacing: -0.035em;
}

#automationTasks-view .daily-refresh-progress-heading p {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--automation-muted);
  font-size: 12px;
  line-height: 1.65;
}

#automationTasks-view .daily-refresh-progress-meta {
  display: grid;
  min-width: 172px;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: end;
  gap: 5px 10px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#automationTasks-view .daily-refresh-progress-meta > :is(strong, time, small) {
  min-width: 0;
}

#automationTasks-view .daily-refresh-progress-meta strong {
  color: var(--automation-ink);
  font-size: 12px;
}

#automationTasks-view .daily-refresh-progress-meta time,
#automationTasks-view .daily-refresh-progress-meta small {
  color: #77827f;
  font-size: 10px;
}

#automationTasks-view .daily-refresh-progress-meta small {
  grid-column: 1 / -1;
}

#automationTasks-view .daily-refresh-freshness {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 10px;
  font-style: normal;
  font-weight: 760;
}

#automationTasks-view .daily-refresh-freshness-fresh {
  border-color: rgba(16, 135, 120, 0.2);
  color: #08786c;
  background: rgba(16, 135, 120, 0.08);
}

#automationTasks-view .daily-refresh-freshness-stale {
  border-color: rgba(209, 154, 51, 0.24);
  color: #8a5c08;
  background: rgba(209, 154, 51, 0.1);
}

#automationTasks-view .daily-refresh-freshness-offline {
  border-color: rgba(201, 90, 70, 0.22);
  color: #a33f2d;
  background: rgba(201, 90, 70, 0.08);
}

#automationTasks-view .daily-refresh-progress-notice {
  margin: 13px 0 0;
  border-radius: 9px;
  padding: 8px 11px;
  color: #53615e;
  background: #f5f8f7;
  font-size: 10px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

#automationTasks-view .daily-refresh-progress-notice-stale {
  color: #7a550f;
  background: #fff9e9;
}

#automationTasks-view .daily-refresh-progress-notice-offline {
  color: #974332;
  background: #fff3f0;
}

#automationTasks-view .daily-refresh-stage-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

#automationTasks-view .daily-refresh-stage {
  --daily-stage-color: #81908c;
  display: grid;
  min-width: 0;
  grid-template-rows: auto minmax(30px, auto) auto auto;
  align-content: start;
  gap: 8px;
  border: 1px solid rgba(33, 62, 56, 0.11);
  border-radius: 11px;
  padding: 11px;
  background: #fbfcfc;
}

#automationTasks-view .daily-refresh-stage-running {
  --daily-stage-color: #297fbd;
  border-color: rgba(41, 127, 189, 0.18);
  background: #f7fbfe;
}

#automationTasks-view .daily-refresh-stage-retry_wait {
  --daily-stage-color: #c0871c;
  border-color: rgba(192, 135, 28, 0.2);
  background: #fffbf1;
}

#automationTasks-view .daily-refresh-stage-completed {
  --daily-stage-color: #108778;
}

#automationTasks-view .daily-refresh-stage-failed,
#automationTasks-view .daily-refresh-stage-blocked {
  --daily-stage-color: #c95a46;
  border-color: rgba(201, 90, 70, 0.2);
  background: #fff8f6;
}

#automationTasks-view .daily-refresh-stage-heading {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
}

#automationTasks-view .daily-refresh-stage-heading span {
  color: #9aa5a2;
  font-size: 9px;
  font-weight: 720;
}

#automationTasks-view .daily-refresh-stage-heading strong {
  min-width: 0;
  overflow: hidden;
  color: var(--automation-ink);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#automationTasks-view .daily-refresh-stage-heading i {
  color: var(--daily-stage-color);
  font-size: 9px;
  font-style: normal;
  font-weight: 760;
  white-space: nowrap;
}

#automationTasks-view .daily-refresh-stage > p {
  margin: 0;
  color: #697672;
  font-size: 9px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

#automationTasks-view .daily-refresh-stage-bar {
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(70, 93, 87, 0.1);
}

#automationTasks-view .daily-refresh-stage-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--daily-stage-color);
  transition: width 220ms ease;
}

#automationTasks-view .daily-refresh-stage > small {
  min-width: 0;
  overflow: hidden;
  color: #a04a39;
  font-size: 8px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#automationTasks-view .daily-refresh-table-details {
  min-width: 0;
  margin-top: 11px;
  border-top: 1px solid rgba(35, 60, 55, 0.1);
  padding-top: 10px;
}

#automationTasks-view .daily-refresh-table-details > summary {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--automation-ink);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  list-style-position: inside;
}

#automationTasks-view .daily-refresh-table-details > summary small {
  min-width: 0;
  color: #7d8985;
  font-size: 9px;
  font-weight: 500;
  text-align: right;
  overflow-wrap: anywhere;
}

#automationTasks-view .daily-refresh-table-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 9px;
}

#automationTasks-view .daily-refresh-table {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(35, 60, 55, 0.09);
  border-radius: 9px;
  padding: 8px 9px;
  background: #fbfcfc;
}

#automationTasks-view .daily-refresh-table > i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9aa5a2;
}

#automationTasks-view .daily-refresh-table-running > i {
  background: #297fbd;
}

#automationTasks-view .daily-refresh-table-retry_wait > i {
  background: #c0871c;
}

#automationTasks-view .daily-refresh-table-completed > i {
  background: #108778;
}

#automationTasks-view :is(.daily-refresh-table-failed, .daily-refresh-table-blocked) > i {
  background: #c95a46;
}

#automationTasks-view .daily-refresh-table > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

#automationTasks-view .daily-refresh-table strong,
#automationTasks-view .daily-refresh-table span,
#automationTasks-view .daily-refresh-table small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#automationTasks-view .daily-refresh-table strong {
  color: #283b37;
  font-size: 10px;
}

#automationTasks-view .daily-refresh-table span,
#automationTasks-view .daily-refresh-table small {
  color: #7a8783;
  font-size: 8px;
}

#automationTasks-view .daily-refresh-table small {
  color: #a04a39;
}

#automationTasks-view .daily-refresh-table > b {
  color: #697672;
  font-size: 9px;
  font-weight: 680;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  #automationTasks-view .daily-refresh-stage-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  #automationTasks-view > .daily-refresh-progress-panel {
    border-radius: 12px;
    padding: 12px;
  }

  #automationTasks-view .daily-refresh-progress-heading {
    display: grid;
    gap: 12px;
  }

  #automationTasks-view .daily-refresh-progress-meta {
    width: 100%;
    min-width: 0;
    justify-content: start;
    text-align: left;
  }

  #automationTasks-view .daily-refresh-stage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #automationTasks-view .daily-refresh-table-details > summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  #automationTasks-view .daily-refresh-table-details > summary small {
    text-align: left;
  }

  #automationTasks-view .daily-refresh-table-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 390px) {
  #automationTasks-view .daily-refresh-stage-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  #automationTasks-view .daily-refresh-stage-bar span {
    transition: none;
  }
}

body.ui-layered #storeAnalysis-view .store-analysis-daily-overview {
  position: relative;
  gap: 8px;
  background: #fbfcfc;
  box-shadow: inset 3px 0 0 #8ba0a7;
}

body.ui-layered #storeAnalysis-view .store-analysis-daily-overview.red {
  background: #fff9f8;
  box-shadow: inset 3px 0 0 #d74b43;
}

body.ui-layered #storeAnalysis-view .store-analysis-daily-overview.warn {
  background: #fffbf3;
  box-shadow: inset 3px 0 0 #d99a1d;
}

body.ui-layered #storeAnalysis-view .store-analysis-daily-overview.clear {
  background: #f7fbfa;
  box-shadow: inset 3px 0 0 #1d8b68;
}

body.ui-layered #storeAnalysis-view .store-analysis-daily-overview.pending,
body.ui-layered #storeAnalysis-view .store-analysis-daily-overview.loading {
  color: #65777f;
  background: #f7f9fa;
}

body.ui-layered #storeAnalysis-view .store-analysis-daily-overview.error {
  background: #fff8f6;
  box-shadow: inset 3px 0 0 #b95a4e;
}

body.ui-layered #storeAnalysis-view .store-analysis-daily-overview-tools {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

body.ui-layered #storeAnalysis-view .store-analysis-daily-overview-tools > span {
  min-width: 0;
  line-height: 1.4;
}

body.ui-layered #storeAnalysis-view .store-analysis-daily-overview-tools .secondary-button {
  min-height: 25px;
  flex: 0 0 auto;
  border: 1px solid #cddade;
  padding: 4px 8px;
  color: #315761;
  background: #f3f7f7;
  font-size: 9px;
  line-height: 1;
  white-space: nowrap;
}

body.ui-layered #storeAnalysis-view .store-analysis-daily-overview-tools .secondary-button[data-copy-state="success"] {
  border-color: #91cbb8;
  color: #14684f;
  background: #eaf7f2;
}

body.ui-layered #storeAnalysis-view .store-analysis-daily-overview-tools .secondary-button[data-copy-state="error"] {
  border-color: #e2aaa4;
  color: #9c3e37;
  background: #fff3f1;
}

body.ui-layered #storeAnalysis-view .store-analysis-daily-overview-state {
  margin: 0;
  border: 1px dashed #d5dfe2;
  border-radius: 6px;
  padding: 9px 10px;
  color: #6c7e85;
  background: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  line-height: 1.55;
}

body.ui-layered #storeAnalysis-view .store-analysis-daily-overview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #dfe6e9;
  border-radius: 7px;
  padding: 9px 10px;
  background: #ffffff;
}

body.ui-layered #storeAnalysis-view .store-analysis-daily-overview-head strong {
  color: #263e47;
  font-size: 11px;
  line-height: 1.55;
}

body.ui-layered #storeAnalysis-view .store-analysis-daily-overview-head small {
  flex: 0 0 auto;
  color: #76888f;
  font-size: 9px;
  white-space: nowrap;
}

body.ui-layered #storeAnalysis-view .store-analysis-daily-alerts,
body.ui-layered #storeAnalysis-view .store-analysis-daily-overview-copy {
  display: grid;
  gap: 6px;
}

body.ui-layered #storeAnalysis-view .store-analysis-daily-alerts article,
body.ui-layered #storeAnalysis-view .store-analysis-daily-overview-copy p {
  margin: 0;
  border: 1px solid #e0e6e9;
  border-radius: 6px;
  padding: 7px 8px;
  background: rgba(255, 255, 255, 0.88);
}

body.ui-layered #storeAnalysis-view .store-analysis-daily-alerts article {
  display: grid;
  gap: 2px;
}

body.ui-layered #storeAnalysis-view .store-analysis-daily-alerts article.red {
  border-color: #edc9c5;
  color: #9f413a;
  background: #fff7f5;
}

body.ui-layered #storeAnalysis-view .store-analysis-daily-alerts article.warn {
  border-color: #ead8ab;
  color: #8b6316;
  background: #fffaf0;
}

body.ui-layered #storeAnalysis-view .store-analysis-daily-alerts strong,
body.ui-layered #storeAnalysis-view .store-analysis-daily-overview-copy strong {
  color: #304750;
  font-size: 10px;
}

body.ui-layered #storeAnalysis-view .store-analysis-daily-alerts span,
body.ui-layered #storeAnalysis-view .store-analysis-daily-overview-copy span {
  color: #667981;
  font-size: 9px;
  line-height: 1.55;
}

body.ui-layered #storeAnalysis-view .store-analysis-daily-overview-copy p {
  display: grid;
  gap: 3px;
}

body.ui-layered #storeAnalysis-view .store-analysis-daily-dates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #dfe6e9;
  border-radius: 6px;
  background: #ffffff;
}

body.ui-layered #storeAnalysis-view .store-analysis-daily-dates span {
  min-width: 0;
  display: grid;
  gap: 2px;
  border-right: 1px solid #e3e8eb;
  padding: 6px 7px;
  color: #72848b;
  font-size: 8px;
}

body.ui-layered #storeAnalysis-view .store-analysis-daily-dates span:nth-child(3n) {
  border-right: 0;
}

body.ui-layered #storeAnalysis-view .store-analysis-daily-dates strong {
  overflow: hidden;
  color: #3b525b;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.ui-layered #storeAnalysis-view .store-analysis-daily-boundary {
  color: #6d7f86;
  font-size: 9px;
}

body.ui-layered #storeAnalysis-view .store-analysis-daily-boundary summary {
  cursor: pointer;
  color: #536970;
  font-weight: 720;
}

body.ui-layered #storeAnalysis-view .store-analysis-daily-boundary ul {
  display: grid;
  gap: 3px;
  margin: 6px 0 0;
  padding-left: 18px;
}

@media (max-width: 820px) {
  body.ui-layered #storeAnalysis-view .store-analysis-daily-overview > .store-analysis-inspector-section-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  body.ui-layered #storeAnalysis-view .store-analysis-daily-overview-tools {
    width: 100%;
    align-items: flex-start;
    justify-content: space-between;
  }

  body.ui-layered #storeAnalysis-view .store-analysis-daily-overview-tools > span {
    flex: 1 1 auto;
    text-align: left;
  }

  body.ui-layered #storeAnalysis-view .store-analysis-daily-overview-head {
    display: grid;
  }

  body.ui-layered #storeAnalysis-view .store-analysis-daily-overview-head small {
    white-space: normal;
  }

  body.ui-layered #storeAnalysis-view .store-analysis-daily-dates {
    grid-template-columns: minmax(0, 1fr);
  }

  body.ui-layered #storeAnalysis-view .store-analysis-daily-dates span {
    border-right: 0;
    border-bottom: 1px solid #e3e8eb;
  }

  body.ui-layered #storeAnalysis-view .store-analysis-daily-dates span:last-child {
    border-bottom: 0;
  }
}

/* Automation task control room UI v2 */
#automationTasks-view {
  --automation-ink: #10201d;
  --automation-muted: #64716e;
  --automation-line: rgba(35, 60, 55, 0.14);
  --automation-mint: #83e5ce;
  --automation-teal: #087c72;
  --automation-night: #0d211f;
  --automation-cream: #f2f0e8;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  font-family: Geist, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.ui-layered #automationTasks-view.view.active,
body.ui-layered .main.view-switching #automationTasks-view.view.active {
  animation: none;
  transform: none;
}

#automationTasks-view .automation-task-cockpit {
  position: relative;
  isolation: isolate;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid rgba(126, 229, 204, 0.18);
  border-radius: 24px;
  padding: clamp(34px, 5vw, 64px) clamp(20px, 5.6vw, 74px) 26px;
  background:
    radial-gradient(circle at 14% 20%, rgba(74, 205, 176, 0.24), transparent 34%),
    radial-gradient(circle at 83% 6%, rgba(240, 215, 145, 0.13), transparent 28%),
    linear-gradient(145deg, #0b1d1b 0%, #112d28 50%, #0a1918 100%);
  box-shadow: 0 24px 60px rgba(17, 42, 38, 0.18);
  color: #f8fbfa;
}

#automationTasks-view .automation-task-cockpit::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: 0.2;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
  content: "";
  pointer-events: none;
}

#automationTasks-view .automation-task-cockpit-glow {
  position: absolute;
  z-index: -1;
  top: -120px;
  left: 50%;
  width: min(780px, 86vw);
  height: 330px;
  border-radius: 50%;
  background: rgba(55, 211, 175, 0.13);
  filter: blur(70px);
  transform: translateX(-50%);
  pointer-events: none;
}

#automationTasks-view .automation-task-cockpit-copy {
  display: grid;
  justify-items: center;
  width: min(100%, 1280px);
  margin: 0 auto;
  text-align: center;
}

#automationTasks-view .automation-task-cockpit-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 18px;
  color: rgba(232, 246, 241, 0.74);
  font-size: 12px;
  font-weight: 620;
  letter-spacing: 0.08em;
}

#automationTasks-view .automation-task-cockpit-kicker i {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--automation-mint);
  box-shadow: 0 0 0 5px rgba(131, 229, 206, 0.12);
}

#automationTasks-view .automation-task-cockpit-kicker i::after {
  position: absolute;
  inset: -5px;
  border: 1px solid rgba(131, 229, 206, 0.48);
  border-radius: inherit;
  animation: automation-signal-pulse 2.2s ease-out infinite;
  content: "";
}

@keyframes automation-signal-pulse {
  0% { opacity: 0.8; transform: scale(0.65); }
  72%, 100% { opacity: 0; transform: scale(1.7); }
}

#automationTasks-view .automation-task-hero-title {
  width: 100%;
  max-width: 78rem;
  margin: 0;
  color: #ffffff;
  font-size: clamp(2rem, 3.8vw, 4.6rem);
  font-weight: 620;
  line-height: 1.04;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

#automationTasks-view .automation-task-title-image {
  display: inline-flex;
  width: clamp(62px, 7vw, 108px);
  height: clamp(30px, 3.5vw, 52px);
  margin: 0 0.14em;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  vertical-align: 0.02em;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

#automationTasks-view .automation-task-title-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.72) contrast(1.08);
  transition: transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

#automationTasks-view .automation-task-title-image:hover img {
  transform: scale(1.08);
}

#automationTasks-view .automation-task-cockpit-lead {
  max-width: 810px;
  margin: 20px auto 0;
  color: rgba(231, 243, 240, 0.72);
  font-size: clamp(13px, 1.15vw, 16px);
  line-height: 1.75;
}

#automationTasks-view .automation-task-cockpit-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

#automationTasks-view :is(.automation-task-primary-action, .automation-task-secondary-action) {
  min-height: 44px;
  border-radius: 12px;
  padding: 0 20px;
  font: inherit;
  font-size: 13px;
  font-weight: 740;
  cursor: pointer;
  transition:
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease;
}

#automationTasks-view .automation-task-primary-action {
  border: 1px solid var(--automation-mint);
  background: var(--automation-mint);
  color: #0a231f;
  box-shadow: 0 12px 32px rgba(71, 213, 181, 0.18);
}

#automationTasks-view .automation-task-secondary-action {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  backdrop-filter: blur(12px);
}

#automationTasks-view :is(.automation-task-primary-action, .automation-task-secondary-action):hover {
  transform: translateY(-2px);
}

#automationTasks-view .automation-task-primary-action:hover {
  background: #a0efd9;
  box-shadow: 0 16px 36px rgba(71, 213, 181, 0.24);
}

#automationTasks-view .automation-task-secondary-action:hover {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.14);
}

#automationTasks-view .automation-task-cockpit-status {
  min-height: 18px;
  margin: 10px 0 0;
  color: rgba(220, 237, 232, 0.56);
  font-size: 11px;
}

#automationTasks-view .automation-task-route-marquee {
  position: relative;
  margin: 34px calc(clamp(20px, 5.6vw, 74px) * -1) -26px;
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(2, 15, 13, 0.28);
  mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
}

#automationTasks-view .automation-task-route-track {
  display: flex;
  width: max-content;
  animation: automation-route-loop 30s linear infinite;
}

#automationTasks-view .automation-task-route-track > div {
  display: flex;
  align-items: center;
  flex: none;
  min-height: 50px;
}

#automationTasks-view .automation-task-route-track span {
  display: inline-flex;
  align-items: center;
  color: rgba(237, 247, 244, 0.72);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

#automationTasks-view .automation-task-route-track span::after {
  width: 42px;
  height: 1px;
  margin: 0 18px;
  background: linear-gradient(90deg, rgba(131, 229, 206, 0.72), rgba(131, 229, 206, 0.06));
  content: "";
}

@keyframes automation-route-loop {
  to { transform: translateX(-50%); }
}

#automationTasks-view .automation-task-signal-grid {
  display: grid;
  grid-auto-flow: dense;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--automation-line);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(31, 49, 45, 0.06);
}

#automationTasks-view .automation-task-signal {
  position: relative;
  min-width: 0;
  min-height: 132px;
  border-right: 1px solid var(--automation-line);
  padding: 20px 22px;
  background: #ffffff;
  transition:
    background-color 300ms ease,
    transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

#automationTasks-view .automation-task-signal:last-child {
  border-right: 0;
}

#automationTasks-view .automation-task-signal::before {
  position: absolute;
  top: 21px;
  right: 21px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #80918d;
  box-shadow: 0 0 0 6px rgba(73, 96, 90, 0.08);
  content: "";
}

#automationTasks-view .automation-task-signal-active::before {
  background: #d19a33;
  box-shadow: 0 0 0 6px rgba(209, 154, 51, 0.1);
}

#automationTasks-view .automation-task-signal-attention::before,
#automationTasks-view .automation-task-signal-failed::before {
  background: #c95a46;
  box-shadow: 0 0 0 6px rgba(201, 90, 70, 0.1);
}

#automationTasks-view .automation-task-signal-completed::before {
  background: #108778;
  box-shadow: 0 0 0 6px rgba(16, 135, 120, 0.1);
}

#automationTasks-view .automation-task-signal:hover {
  z-index: 1;
  background: #f8fbfa;
  transform: translateY(-2px);
}

#automationTasks-view .automation-task-signal > span {
  color: var(--automation-muted);
  font-size: 12px;
  font-weight: 680;
}

#automationTasks-view .automation-task-signal > strong {
  display: block;
  margin-top: 12px;
  color: var(--automation-ink);
  font-size: clamp(28px, 3vw, 44px);
  font-weight: 620;
  line-height: 1;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}

#automationTasks-view .automation-task-signal > p {
  margin: 10px 0 0;
  color: #77827f;
  font-size: 11px;
  line-height: 1.5;
}

#automationTasks-view .automation-task-focus {
  display: grid;
  grid-template-columns: minmax(180px, 0.34fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 24px;
  min-width: 0;
  border: 1px solid var(--automation-line);
  border-radius: 20px;
  padding: 24px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(242, 240, 232, 0.74), rgba(255, 255, 255, 0.95)),
    #ffffff;
}

#automationTasks-view .automation-task-focus > header {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 4px 0;
}

#automationTasks-view .automation-task-focus > header h2 {
  max-width: 210px;
  margin: 0;
  color: var(--automation-ink);
  font-size: clamp(22px, 2.5vw, 34px);
  font-weight: 620;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

#automationTasks-view .automation-task-focus > header p {
  max-width: 230px;
  margin: 12px 0 0;
  color: var(--automation-muted);
  font-size: 12px;
  line-height: 1.65;
}

#automationTasks-view .automation-task-focus > header > span {
  color: #82908c;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

#automationTasks-view .automation-task-focus-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(235px, 1fr);
  align-items: stretch;
  min-width: 0;
  overflow-x: auto;
  padding: 4px 20px 8px 4px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: rgba(18, 73, 63, 0.2) transparent;
}

#automationTasks-view .automation-task-focus-card {
  position: relative;
  z-index: calc(10 - var(--focus-index));
  display: grid;
  grid-template-rows: auto auto auto auto 1fr auto;
  min-width: 0;
  min-height: 230px;
  margin-left: -18px;
  overflow: hidden;
  border: 1px solid rgba(25, 61, 54, 0.13);
  border-radius: 17px;
  padding: 18px;
  scroll-snap-align: start;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 36px rgba(27, 49, 45, 0.1);
  transition:
    border-color 400ms ease,
    transform 700ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 400ms ease;
}

#automationTasks-view .automation-task-focus-card:first-child {
  margin-left: 0;
}

#automationTasks-view .automation-task-focus-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: #9aa7a4;
  content: "";
}

#automationTasks-view .automation-task-focus-running::before,
#automationTasks-view .automation-task-focus-queued::before {
  background: #d19a33;
}

#automationTasks-view .automation-task-focus-attention::before,
#automationTasks-view .automation-task-focus-failed::before {
  background: #c95a46;
}

#automationTasks-view .automation-task-focus-completed::before {
  background: #108778;
}

#automationTasks-view .automation-task-focus-card:hover {
  z-index: 20;
  border-color: rgba(8, 124, 114, 0.32);
  transform: translateY(-5px) scale(1.015);
  box-shadow: 0 24px 46px rgba(27, 49, 45, 0.15);
}

#automationTasks-view .automation-task-focus-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#automationTasks-view .automation-task-focus-card-head span {
  color: #37554f;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.05em;
}

#automationTasks-view .automation-task-focus-card-head time {
  color: #84918e;
  font-size: 10px;
  white-space: nowrap;
}

#automationTasks-view .automation-task-focus-card h3 {
  margin: 16px 0 0;
  color: var(--automation-ink);
  font-size: 17px;
  line-height: 1.3;
}

#automationTasks-view .automation-task-focus-card > p {
  margin: 7px 0 0;
  overflow: hidden;
  color: var(--automation-muted);
  font-size: 11px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#automationTasks-view .automation-task-focus-progress {
  height: 4px;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9eeec;
}

#automationTasks-view .automation-task-focus-progress span {
  display: block;
  width: var(--task-progress);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0a766c, #55c7ae);
}

#automationTasks-view .automation-task-focus-result {
  display: grid;
  align-content: start;
  gap: 5px;
  margin: 13px 0 14px;
}

#automationTasks-view .automation-task-focus-result small {
  color: #8a9793;
  font-size: 10px;
}

#automationTasks-view .automation-task-focus-result strong {
  display: -webkit-box;
  overflow: hidden;
  color: #334943;
  font-size: 11px;
  font-weight: 620;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

#automationTasks-view .automation-task-focus-card .table-action {
  justify-self: start;
  min-height: 34px;
  border-color: rgba(8, 124, 114, 0.2);
  background: #edf7f4;
  color: #086c64;
}

#automationTasks-view .automation-control-task-panel {
  border-color: var(--automation-line);
  border-radius: 20px;
  padding: 16px;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(31, 49, 45, 0.06);
}

body.ui-layered #automationTasks-view .automation-control-task-panel > .automation-task-workspace-heading:first-child {
  z-index: 8;
  min-height: 66px;
  margin: -16px -16px 16px;
  border-bottom-color: rgba(39, 72, 65, 0.12);
  border-radius: 20px 20px 0 0;
  padding: 12px 16px;
  background: rgba(247, 250, 249, 0.94);
  box-shadow: 0 10px 26px rgba(27, 49, 45, 0.04);
  backdrop-filter: blur(16px);
}

#automationTasks-view .automation-task-workspace-heading h2 {
  font-size: 17px;
}

#automationTasks-view .automation-task-toolbar {
  position: sticky;
  z-index: 6;
  top: 0;
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.15fr);
  align-items: center;
  gap: 16px;
  margin: 0 0 12px;
  border: 1px solid rgba(35, 60, 55, 0.1);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

#automationTasks-view .automation-task-search {
  width: 100%;
  gap: 7px;
}

#automationTasks-view .automation-task-search input {
  min-height: 42px;
  border-color: rgba(35, 60, 55, 0.16);
  border-radius: 10px;
  padding-inline: 13px;
  background: #f8faf9;
}

#automationTasks-view .automation-task-search button {
  min-height: 42px;
  border: 1px solid #0b756c;
  border-radius: 10px;
  background: #0b756c;
  color: #ffffff;
  font-weight: 720;
}

#automationTasks-view .automation-task-status-filters {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(78px, 1fr);
  justify-content: stretch;
  gap: 4px;
}

#automationTasks-view .automation-task-status-filters button {
  min-height: 38px;
  border-color: transparent;
  border-radius: 9px;
  padding-inline: 9px;
  background: transparent;
  color: #5f6e6a;
  font-size: 11px;
  font-weight: 680;
}

#automationTasks-view .automation-task-status-filters button:hover {
  background: #f0f5f3;
}

#automationTasks-view .automation-task-status-filters button.active {
  border-color: #0b756c;
  background: #0b756c;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(11, 117, 108, 0.16);
}

#automationTasks-view .automation-task-list-table {
  max-height: min(64vh, 780px);
  overflow: auto;
  border: 1px solid rgba(35, 60, 55, 0.12);
  border-radius: 14px;
  background: #ffffff;
  scrollbar-width: thin;
  scrollbar-color: rgba(24, 84, 73, 0.25) transparent;
}

#automationTasks-view .automation-task-list-table table {
  min-width: 1360px;
  border-collapse: separate;
  border-spacing: 0;
}

#automationTasks-view .automation-task-list-table thead {
  position: sticky;
  z-index: 4;
  top: 0;
}

#automationTasks-view .automation-task-list-table th {
  border-bottom: 1px solid rgba(35, 60, 55, 0.14);
  padding: 12px 13px;
  background: #f3f7f5;
  color: #54645f;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

#automationTasks-view .automation-task-list-table td {
  position: relative;
  border-bottom: 1px solid rgba(35, 60, 55, 0.08);
  padding: 14px 13px;
  color: #34443f;
  font-size: 12px;
  line-height: 1.55;
  vertical-align: top;
  transition: background-color 220ms ease;
}

#automationTasks-view .automation-task-list-table tbody tr:nth-child(even) td {
  background: rgba(247, 250, 249, 0.52);
}

#automationTasks-view .automation-task-list-table tbody tr:hover td {
  background: #f1f8f6;
}

#automationTasks-view .automation-task-list-table tbody tr:last-child td {
  border-bottom: 0;
}

#automationTasks-view .automation-task-row td:first-child {
  padding-left: 17px;
}

#automationTasks-view .automation-task-row td:first-child::before {
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #a8b2af;
  content: "";
}

#automationTasks-view .automation-task-row-running td:first-child::before,
#automationTasks-view .automation-task-row-queued td:first-child::before {
  background: #d19a33;
}

#automationTasks-view .automation-task-row-attention td:first-child::before,
#automationTasks-view .automation-task-row-failed td:first-child::before {
  background: #c95a46;
}

#automationTasks-view .automation-task-row-completed td:first-child::before {
  background: #108778;
}

#automationTasks-view .automation-task-product-name {
  max-width: 340px;
  color: #1f3631;
  font-weight: 700;
}

#automationTasks-view .automation-task-problem {
  display: inline-block;
  border-left: 2px solid #d76b57;
  padding-left: 8px;
  color: #ad4736;
}

#automationTasks-view .automation-task-list-meta {
  color: #7d8a86;
  font-variant-numeric: tabular-nums;
}

#automationTasks-view .automation-task-drawer-backdrop {
  background: rgba(6, 20, 18, 0.54);
  backdrop-filter: blur(8px);
}

#automationTasks-view .automation-task-drawer {
  width: min(820px, calc(100vw - 32px));
  border-left: 1px solid rgba(116, 161, 150, 0.18);
  padding: 0 26px 36px;
  background:
    radial-gradient(circle at 80% 0, rgba(84, 198, 171, 0.1), transparent 24%),
    #f3f6f4;
  box-shadow: -28px 0 80px rgba(4, 25, 21, 0.24);
}

#automationTasks-view .automation-task-drawer > header {
  margin: 0 -26px 20px;
  padding: 20px 26px;
  border-bottom-color: rgba(255, 255, 255, 0.1);
  background: rgba(12, 37, 33, 0.96);
  color: #ffffff;
}

#automationTasks-view .automation-task-drawer > header span {
  color: rgba(228, 243, 239, 0.62);
}

#automationTasks-view .automation-task-drawer > header h3 {
  color: #ffffff;
  font-size: 1.3rem;
}

#automationTasks-view .automation-task-drawer > header button {
  background: rgba(255, 255, 255, 0.11);
  color: #ffffff;
  transition: transform 220ms ease, background-color 220ms ease;
}

#automationTasks-view .automation-task-drawer > header button:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: rotate(5deg) scale(1.05);
}

#automationTasks-view .automation-task-intake-card,
#automationTasks-view .automation-task-detail-card {
  border-color: rgba(35, 60, 55, 0.12);
  border-radius: 17px;
  padding: 20px;
  box-shadow: 0 14px 34px rgba(26, 47, 43, 0.06);
}

#automationTasks-view .automation-task-detail-facts {
  grid-auto-flow: dense;
  gap: 8px;
}

#automationTasks-view .automation-task-detail-facts div {
  border: 1px solid rgba(35, 60, 55, 0.07);
  border-radius: 11px;
  background: #f6f8f7;
}

#automationTasks-view .automation-task-detail-product,
#automationTasks-view .automation-task-detail-ids,
#automationTasks-view .automation-task-evidence,
#automationTasks-view .automation-task-detail-error {
  border: 1px solid rgba(35, 60, 55, 0.08);
  border-radius: 11px;
  background: #f6f8f7;
}

#automationTasks-view .automation-task-step {
  min-height: 66px;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 12px;
}

#automationTasks-view .automation-task-step > i {
  width: 16px;
  height: 16px;
  border-width: 4px;
}

#automationTasks-view .automation-task-step:not(:last-child)::before {
  top: 18px;
  left: 7px;
  background: linear-gradient(#cbd8d4, #e6edeb);
}

@media (max-width: 1180px) {
  #automationTasks-view .automation-task-signal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #automationTasks-view .automation-task-signal {
    border-bottom: 1px solid var(--automation-line);
  }

  #automationTasks-view .automation-task-signal:nth-child(2n) {
    border-right: 0;
  }

  #automationTasks-view .automation-task-signal:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  #automationTasks-view .automation-task-focus {
    grid-template-columns: 1fr;
  }

  #automationTasks-view .automation-task-focus > header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  #automationTasks-view .automation-task-focus > header h2,
  #automationTasks-view .automation-task-focus > header p {
    max-width: 680px;
  }

  #automationTasks-view .automation-task-focus > header > span {
    align-self: end;
  }

  #automationTasks-view .automation-task-toolbar {
    position: static;
    grid-template-columns: 1fr;
  }

  #automationTasks-view .automation-task-status-filters {
    grid-auto-flow: column;
    overflow-x: auto;
  }
}

@media (max-width: 680px) {
  #automationTasks-view .automation-task-cockpit {
    min-height: 0;
    border-radius: 18px;
    padding: 30px 18px 22px;
  }

  #automationTasks-view .automation-task-cockpit-kicker {
    align-items: flex-start;
    text-align: left;
  }

  #automationTasks-view .automation-task-hero-title {
    max-width: 100%;
    font-size: clamp(1.75rem, 7.5vw, 2.35rem);
    line-height: 1.07;
    letter-spacing: -0.045em;
  }

  #automationTasks-view .automation-task-title-image {
    width: 52px;
    height: 26px;
  }

  #automationTasks-view .automation-task-cockpit-lead {
    font-size: 12px;
  }

  #automationTasks-view .automation-task-cockpit-actions {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  #automationTasks-view :is(.automation-task-primary-action, .automation-task-secondary-action) {
    min-width: 0;
    padding-inline: 10px;
  }

  #automationTasks-view .automation-task-route-marquee {
    margin-right: -18px;
    margin-bottom: -22px;
    margin-left: -18px;
  }

  #automationTasks-view .automation-task-signal-grid {
    grid-template-columns: 1fr;
  }

  #automationTasks-view .automation-task-signal {
    min-height: 112px;
    border-right: 0;
    border-bottom: 1px solid var(--automation-line);
    padding: 17px 18px;
  }

  #automationTasks-view .automation-task-signal:nth-last-child(-n + 2) {
    border-bottom: 1px solid var(--automation-line);
  }

  #automationTasks-view .automation-task-signal:last-child {
    border-bottom: 0;
  }

  #automationTasks-view .automation-task-focus {
    border-radius: 16px;
    padding: 18px 14px;
  }

  #automationTasks-view .automation-task-focus > header {
    grid-template-columns: 1fr;
  }

  #automationTasks-view .automation-task-focus-track {
    grid-auto-columns: minmax(252px, 86vw);
    padding-right: 8px;
  }

  #automationTasks-view .automation-task-focus-card {
    margin-left: -12px;
  }

  #automationTasks-view .automation-control-task-panel {
    border-radius: 16px;
    padding: 12px;
  }

  body.ui-layered #automationTasks-view .automation-control-task-panel > .automation-task-workspace-heading:first-child {
    margin: -12px -12px 12px;
    border-radius: 16px 16px 0 0;
    padding: 12px;
  }

  #automationTasks-view .automation-task-workspace-heading {
    align-items: stretch;
    flex-direction: column;
  }

  #automationTasks-view .automation-task-workspace-heading .inline-actions {
    justify-content: space-between;
  }

  #automationTasks-view .automation-task-status-filters {
    grid-auto-columns: minmax(86px, 1fr);
  }

  #automationTasks-view .automation-task-list-table {
    max-height: 66vh;
  }

  #automationTasks-view .automation-task-drawer {
    right: 0;
    left: 0;
    width: auto;
    max-width: none;
    padding-right: 16px;
    padding-left: 16px;
  }

  #automationTasks-view .automation-task-drawer > header {
    margin-right: -16px;
    margin-left: -16px;
    padding-right: 16px;
    padding-left: 16px;
  }

  #automationTasks-view .automation-task-intake-card,
  #automationTasks-view .automation-task-detail-card {
    padding: 16px;
  }

  #automationTasks-view .automation-task-step {
    grid-template-columns: 20px minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  #automationTasks-view *,
  #automationTasks-view *::before,
  #automationTasks-view *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  #automationTasks-view .automation-task-route-track {
    transform: none !important;
  }
}

/* Automation task compact workspace v3 */
body.ui-layered #automationTasks-view.view.active {
  gap: 10px;
}

#automationTasks-view .automation-task-signal-grid {
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(31, 49, 45, 0.045);
}

#automationTasks-view .automation-task-signal {
  display: grid;
  min-height: 94px;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-content: center;
  gap: 7px 14px;
  padding: 13px 17px;
  transition: background-color 180ms ease;
}

#automationTasks-view .automation-task-signal::before {
  top: 16px;
  right: 16px;
  width: 7px;
  height: 7px;
  box-shadow: 0 0 0 4px rgba(73, 96, 90, 0.07);
}

#automationTasks-view .automation-task-signal:hover {
  transform: none;
}

#automationTasks-view .automation-task-signal > span {
  align-self: end;
  padding-right: 14px;
  font-size: 11px;
}

#automationTasks-view .automation-task-signal > strong {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  margin: 0;
  padding-right: 14px;
  font-size: clamp(27px, 2.25vw, 36px);
}

#automationTasks-view .automation-task-signal > p {
  align-self: start;
  margin: 0;
  overflow: hidden;
  font-size: 10px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#automationTasks-view .automation-control-task-panel {
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 10px 28px rgba(31, 49, 45, 0.045);
}

body.ui-layered #automationTasks-view .automation-control-task-panel > .automation-task-workspace-heading:first-child {
  min-height: 56px;
  margin: -12px -12px 10px;
  border-radius: 14px 14px 0 0;
  padding: 10px 12px;
}

#automationTasks-view .automation-task-workspace-heading h2 {
  font-size: 16px;
}

#automationTasks-view .automation-task-workspace-heading p {
  margin-top: 3px;
  font-size: 10px;
  line-height: 1.4;
}

#automationTasks-view .automation-task-toolbar {
  gap: 10px;
  margin-bottom: 9px;
  border-radius: 11px;
  padding: 7px;
}

#automationTasks-view .automation-task-search input,
#automationTasks-view .automation-task-search button {
  min-height: 38px;
}

#automationTasks-view .automation-task-status-filters button {
  min-height: 34px;
}

#automationTasks-view .automation-task-list-table {
  max-height: min(68vh, calc(100dvh - 330px));
  border-radius: 11px;
}

#automationTasks-view .automation-task-list-table th {
  padding: 9px 11px;
}

#automationTasks-view .automation-task-list-table td {
  padding: 10px 11px;
  line-height: 1.45;
}

#automationTasks-view .automation-task-row td:first-child {
  padding-left: 15px;
}

#automationTasks-view .automation-task-row td:first-child::before {
  top: 10px;
  bottom: 10px;
}

#automationTasks-view .automation-task-list-meta {
  margin: 8px 2px 0;
  font-size: 10px;
}

@media (max-width: 680px) {
  body.ui-layered #automationTasks-view.view.active {
    gap: 8px;
  }

  #automationTasks-view .automation-task-signal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #automationTasks-view .automation-task-signal {
    min-height: 86px;
    border-right: 1px solid var(--automation-line);
    border-bottom: 1px solid var(--automation-line);
    padding: 12px 13px;
  }

  #automationTasks-view .automation-task-signal:nth-child(2n) {
    border-right: 0;
  }

  #automationTasks-view .automation-task-signal:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  #automationTasks-view .automation-task-signal > strong {
    padding-right: 6px;
    font-size: 27px;
  }

  #automationTasks-view .automation-task-signal > p {
    white-space: normal;
  }

  #automationTasks-view .automation-control-task-panel {
    border-radius: 12px;
    padding: 9px;
  }

  body.ui-layered #automationTasks-view .automation-control-task-panel > .automation-task-workspace-heading:first-child {
    margin: -9px -9px 9px;
    border-radius: 12px 12px 0 0;
    padding: 9px;
  }

  #automationTasks-view .automation-task-list-table {
    max-height: calc(100dvh - 390px);
  }
}

/* Automation control task list and execution trace */
.automation-control-task-panel {
  border-color: rgba(19, 124, 115, 0.18);
  background:
    linear-gradient(180deg, rgba(232, 248, 246, 0.72) 0, rgba(255, 255, 255, 0) 155px),
    #fff;
}

.automation-task-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.automation-task-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0 12px;
}

.automation-task-search {
  display: flex;
  align-items: center;
  width: min(480px, 100%);
  gap: 8px;
}

.automation-task-search input {
  min-width: 0;
  flex: 1;
}

.automation-task-search button,
.automation-task-status-filters button {
  min-height: 38px;
  border: 1px solid #d9e2e1;
  border-radius: 9px;
  padding: 0 14px;
  background: #fff;
  color: #4a5b5a;
  cursor: pointer;
}

.automation-task-status-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.automation-task-status-filters button.active {
  border-color: #087c72;
  background: #087c72;
  color: #fff;
}

.automation-task-status-filters small {
  margin-left: 4px;
  color: inherit;
  opacity: 0.74;
}

.automation-task-list-table {
  overflow-x: auto;
}

.automation-task-list-table table {
  min-width: 1280px;
}

.automation-task-product-name {
  display: inline-block;
  max-width: 310px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.automation-task-problem,
.automation-task-detail-error {
  color: #bc4d3c;
}

.automation-task-list-meta {
  margin: 10px 0 0;
  color: #7a8887;
  font-size: 0.78rem;
  text-align: right;
}

.automation-task-drawer-backdrop {
  position: fixed;
  z-index: 1190;
  inset: 0;
  background: rgba(15, 28, 31, 0.35);
  backdrop-filter: blur(2px);
}

.automation-task-drawer {
  position: fixed;
  z-index: 1200;
  top: 0;
  right: 0;
  width: min(720px, calc(100vw - 40px));
  height: 100dvh;
  padding: 0 22px 28px;
  overflow-y: auto;
  border-left: 1px solid #dce6e5;
  background: #f5f8f8;
  box-shadow: -18px 0 48px rgba(31, 50, 53, 0.18);
}

.automation-task-drawer > header {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 -22px 18px;
  padding: 18px 22px;
  border-bottom: 1px solid #dce6e5;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.automation-task-drawer > header span {
  color: #748280;
  font-size: 0.76rem;
}

.automation-task-drawer > header h3 {
  margin: 3px 0 0;
  font-size: 1.15rem;
}

.automation-task-drawer > header button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #e8efee;
  color: #556462;
  font-size: 1.45rem;
  cursor: pointer;
}

.automation-task-intake-card,
.automation-task-detail-card {
  margin-bottom: 14px;
  border: 1px solid #dce6e5;
  border-radius: 14px;
  padding: 18px;
  background: #fff;
}

.automation-task-intake-card h4,
.automation-task-attempts h4 {
  margin: 0 0 14px;
}

.automation-task-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.automation-task-detail-heading div {
  display: grid;
  gap: 3px;
}

.automation-task-detail-heading span:not(.tag) {
  color: #788683;
  font-size: 0.76rem;
}

.automation-task-detail-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.automation-task-detail-facts div {
  min-width: 0;
  border-radius: 9px;
  padding: 10px 11px;
  background: #f4f7f7;
}

.automation-task-detail-facts dt {
  margin-bottom: 3px;
  color: #7a8785;
  font-size: 0.72rem;
}

.automation-task-detail-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: #243331;
  font-size: 0.86rem;
}

.automation-task-detail-product,
.automation-task-detail-ids,
.automation-task-evidence,
.automation-task-detail-error {
  margin: 12px 0 0;
  border-radius: 9px;
  padding: 10px 11px;
  background: #f4f7f7;
  overflow-wrap: anywhere;
}

.automation-task-detail-product {
  display: grid;
  gap: 5px;
}

.automation-task-detail-product strong,
.automation-task-detail-ids,
.automation-task-evidence {
  color: #697775;
  font-size: 0.76rem;
}

.automation-task-step-list {
  display: grid;
  gap: 0;
  margin-top: 16px;
}

.automation-task-step {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 58px;
  padding-bottom: 12px;
}

.automation-task-step:not(:last-child)::before {
  position: absolute;
  top: 17px;
  bottom: 0;
  left: 6px;
  width: 2px;
  background: #dce6e5;
  content: "";
}

.automation-task-step > i {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  margin-top: 2px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #a5b2b0;
  box-shadow: 0 0 0 1px #cfdad8;
}

.automation-task-step.succeeded > i,
.automation-task-step.completed > i {
  background: #087c72;
}

.automation-task-step.failed > i {
  background: #d0604e;
}

.automation-task-step.running > i,
.automation-task-step.verifying > i {
  background: #d49b2d;
}

.automation-task-step div {
  display: grid;
  align-content: start;
  gap: 3px;
}

.automation-task-step span,
.automation-task-step small,
.automation-task-step time,
.automation-task-event-count,
.automation-task-attempts p {
  color: #75827f;
  font-size: 0.75rem;
}

.automation-task-step time {
  white-space: nowrap;
}

.automation-task-attempts {
  margin-top: 8px;
  border-top: 1px solid #e2e9e8;
  padding-top: 14px;
}

.automation-task-attempts p,
.automation-task-event-count {
  margin: 7px 0 0;
}

.automation-task-detail-loading {
  margin-bottom: 14px;
  border-radius: 10px;
  padding: 13px;
  background: #e7f3f1;
  color: #087c72;
}

@media (max-width: 1180px) {
  .automation-task-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .automation-task-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .automation-task-status-filters {
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  .automation-task-metrics,
  .automation-task-detail-facts {
    grid-template-columns: 1fr;
  }

  .automation-task-drawer {
    width: 100vw;
    padding-right: 16px;
    padding-left: 16px;
  }

  .automation-task-drawer > header {
    margin-right: -16px;
    margin-left: -16px;
    padding-right: 16px;
    padding-left: 16px;
  }

  .automation-task-step {
    grid-template-columns: 18px minmax(0, 1fr);
  }

  .automation-task-step time {
    grid-column: 2;
  }
}

/* 场景管理：只读运维控制台 */
#sceneManagement-view {
  color: var(--ink, #17212f);
}

#sceneManagement-view .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;
}

#sceneManagement-view button {
  font: inherit;
}

.scene-management-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 292px;
  gap: 14px;
  align-items: start;
}

.scene-category-rail,
.scene-health-rail,
.scene-management-workspace {
  min-width: 0;
  border: 1px solid var(--line, #dce3ea);
  border-radius: 12px;
  background: var(--surface, #ffffff);
  box-shadow: 0 7px 20px rgba(15, 23, 42, 0.035);
}

.scene-category-rail,
.scene-health-rail {
  position: sticky;
  top: 10px;
}

.scene-category-rail {
  padding: 18px 12px;
}

.scene-category-rail > h2,
.scene-health-rail > h2 {
  margin: 0;
  color: #17212f;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 720;
}

.scene-category-list {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.scene-category-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #425066;
  text-align: left;
  cursor: pointer;
}

.scene-category-list button:hover {
  background: #f5f8f9;
  color: #17212f;
}

.scene-category-list button.active {
  border-color: #cfe5e2;
  background: #eaf5f3;
  color: #0f766e;
}

.scene-category-list button strong {
  color: inherit;
  font-size: 13px;
  font-weight: 700;
}

.scene-risk-legend {
  display: grid;
  gap: 10px;
  margin-top: 24px;
  padding: 18px 8px 2px;
  border-top: 1px solid #e5eaf0;
}

.scene-risk-legend h3 {
  margin: 0 0 2px;
  color: #1f2937;
  font-size: 14px;
  font-weight: 700;
}

.scene-risk-legend > span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #667085;
  font-size: 13px;
}

.risk-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 24px;
  padding: 0 7px;
  border: 1px solid #cad5e2;
  border-radius: 7px;
  background: #f5f7fa;
  color: #425066;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
}

.risk-badge.risk-l0 {
  border-color: #bfe1dc;
  background: #edf8f6;
  color: #0f766e;
}

.risk-badge.risk-l1 {
  border-color: #f0cf91;
  background: #fff7e8;
  color: #a46100;
}

.risk-badge.risk-l2,
.risk-badge.risk-l3 {
  border-color: #efc2bc;
  background: #fff1ef;
  color: #b42318;
}

.scene-management-workspace {
  padding: 14px;
}

.scene-control-summary {
  display: grid;
  grid-template-columns: minmax(190px, 1.35fr) minmax(320px, 2fr);
  min-height: 84px;
  overflow: hidden;
  border: 1px solid #dfe7ee;
  border-radius: 10px;
  background: #fbfcfd;
}

.scene-control-health {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 16px 20px;
  border-right: 1px solid #dfe7ee;
  box-shadow: inset 3px 0 0 #0f766e;
}

.scene-control-health.warn {
  box-shadow: inset 3px 0 0 #c16a00;
}

.scene-control-health strong {
  color: #0f766e;
  font-size: 15px;
  font-weight: 720;
}

.scene-control-health.warn strong {
  color: #9a5500;
}

.scene-control-health small {
  margin-top: 5px;
  color: #9a5500;
  font-size: 12px;
}

.scene-control-summary > dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(65px, 1fr));
  margin: 0;
}

.scene-control-summary > dl > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 12px 15px;
  border-left: 1px solid #e3e8ee;
}

.scene-control-summary dt {
  color: #6b7788;
  font-size: 12px;
}

.scene-control-summary dd {
  margin: 5px 0 0;
  color: #17212f;
  font-size: 23px;
  line-height: 1;
  font-weight: 740;
}

.scene-control-summary dd.danger,
.scene-health-rail dd.danger {
  color: #b42318;
}

.scene-management-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  margin: 14px 0 10px;
}

.scene-search {
  display: block;
  min-width: 0;
}

.scene-search input {
  width: 100%;
  height: 40px;
  padding: 0 13px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #ffffff;
  color: #17212f;
  outline: none;
}

.scene-search input:focus {
  border-color: #75bdb4;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.scene-status-filter {
  display: inline-flex;
  gap: 5px;
}

.scene-status-filter button,
.scene-refresh-button {
  min-height: 38px;
  border: 1px solid #d9e2ec;
  border-radius: 999px;
  background: #ffffff;
  color: #526075;
  cursor: pointer;
}

.scene-status-filter button {
  padding: 0 14px;
}

.scene-status-filter button.active {
  border-color: #c6e3df;
  background: #eaf5f3;
  color: #0f766e;
  font-weight: 700;
}

.scene-refresh-button {
  padding: 0 15px;
  border-radius: 8px;
}

.scene-refresh-button:hover {
  border-color: #8fc8c0;
  color: #0f766e;
}

.scene-refresh-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.scene-list-table {
  overflow: hidden;
  border: 1px solid #dfe6ed;
  border-radius: 9px;
  background: #ffffff;
}

.scene-list-header,
.scene-list-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.6fr) 54px minmax(105px, 1fr) 92px 105px 108px;
  gap: 8px;
  align-items: center;
}

.scene-list-header {
  min-height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid #dfe6ed;
  background: #f5f7f9;
  color: #637083;
  font-size: 12px;
  font-weight: 650;
}

.scene-list-row {
  width: 100%;
  min-height: 68px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid #e7ebf0;
  border-radius: 0;
  background: #ffffff;
  color: #344054;
  text-align: left;
  cursor: pointer;
}

.scene-list-row:last-child {
  border-bottom: 0;
}

.scene-list-row:hover {
  background: #f8fbfb;
}

.scene-list-row.selected {
  background: #edf7f5;
  box-shadow: inset 3px 0 0 #0f766e;
}

.scene-list-row > span {
  min-width: 0;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.scene-name-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.scene-name-cell strong {
  color: #17212f;
  font-size: 13px;
  font-weight: 700;
}

.scene-name-cell small {
  color: #7b8798;
  font-size: 11px;
}

.scene-status-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.scene-status-cell small {
  color: #a46100;
  font-size: 10px;
}

.scene-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid #d4dce5;
  border-radius: 999px;
  background: #f5f7f9;
  color: #556274;
  font-size: 11px;
  font-style: normal;
  line-height: 1;
  white-space: nowrap;
}

.scene-status.online {
  border-color: #bfe1dc;
  background: #eaf6f4;
  color: #0f766e;
}

.scene-status.idle {
  border-color: #cbd8e6;
  background: #f0f5fa;
  color: #4f6580;
}

.scene-status.unavailable {
  border-color: #efc2bc;
  background: #fff2f0;
  color: #b42318;
}

.scene-status.disabled {
  border-color: #d7dee7;
  background: #f5f6f8;
  color: #687386;
}

.scene-management-empty,
.scene-management-loading {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: 280px;
  padding: 72px 24px;
  border: 1px solid var(--line, #dce3ea);
  border-radius: 12px;
  background: #ffffff;
  color: #6b7788;
  text-align: center;
}

.scene-management-empty strong,
.scene-management-loading strong {
  color: #243041;
  font-size: 16px;
}

.scene-management-loading.error strong {
  color: #9f2d24;
}

.scene-management-loading button {
  margin-top: 8px;
}

.scene-management-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 10px;
  color: #7b8798;
  font-size: 11px;
}

.scene-health-rail {
  padding: 18px 13px;
}

.scene-health-rail > section {
  margin-top: 13px;
  padding: 14px 12px;
  border: 1px solid #e0e6ec;
  border-radius: 9px;
  background: #ffffff;
}

.scene-health-rail section h3 {
  margin: 0 0 11px;
  color: #0f766e;
  font-size: 13px;
  font-weight: 720;
}

.scene-health-rail dl {
  display: grid;
  gap: 9px;
  margin: 0;
}

.scene-health-rail dl > div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.scene-health-rail dt {
  color: #697689;
  font-size: 12px;
}

.scene-health-rail dd {
  margin: 0;
  color: #243041;
  font-size: 12px;
  font-weight: 650;
  text-align: right;
}

.scene-health-rail dd.online {
  color: #0f766e;
}

.scene-health-rail dd.offline,
.scene-health-rail dd.busy {
  color: #b42318;
}

.scene-health-rail dd.unregistered {
  color: #7b8798;
  font-weight: 500;
}

.scene-current-detail {
  background: #fbfcfd !important;
}

.scene-detail-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e3e8ee;
}

.scene-detail-title > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.scene-detail-title h3 {
  margin-bottom: 2px !important;
}

.scene-detail-title strong {
  color: #17212f;
  font-size: 13px;
  line-height: 1.4;
}

.scene-detail-title small {
  color: #7b8798;
  font-size: 10px;
  overflow-wrap: anywhere;
}

.scene-detail-list {
  margin-top: 12px !important;
}

.scene-detail-list dd {
  max-width: 160px;
  overflow-wrap: anywhere;
}

.scene-detail-error {
  color: #b42318 !important;
}

.scene-current-detail > p {
  margin: 12px 0 0;
  color: #657286;
  font-size: 11px;
  line-height: 1.65;
}

.scene-capabilities {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid #e3e8ee;
}

.scene-capabilities > span {
  color: #697689;
  font-size: 11px;
}

.scene-capabilities > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.scene-capabilities i {
  padding: 3px 6px;
  border-radius: 5px;
  background: #eef3f6;
  color: #4f5f73;
  font-size: 9px;
  font-style: normal;
  overflow-wrap: anywhere;
}

.scene-detail-empty {
  padding: 12px 0 4px;
  color: #7b8798;
  font-size: 12px;
}

.scene-management-stale {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px 13px;
  border: 1px solid #edcf99;
  border-radius: 8px;
  background: #fff9ed;
  color: #84510b;
  font-size: 12px;
}

.scene-management-stale strong {
  color: #744306;
}

.scene-management-stale span {
  flex: 1;
}

.scene-management-stale button {
  border: 0;
  background: transparent;
  color: #0f766e;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 1280px) {
  .scene-management-layout {
    grid-template-columns: 170px minmax(0, 1fr);
  }

  .scene-health-rail {
    position: static;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }

  .scene-health-rail > h2 {
    grid-column: 1 / -1;
  }

  .scene-health-rail > section {
    margin-top: 0;
  }
}

@media (max-width: 920px) {
  .scene-management-layout {
    grid-template-columns: 1fr;
  }

  .scene-category-rail,
  .scene-health-rail {
    position: static;
  }

  .scene-category-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scene-risk-legend {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .scene-risk-legend h3 {
    grid-column: 1 / -1;
  }

  .scene-control-summary {
    grid-template-columns: 1fr;
  }

  .scene-control-health {
    border-right: 0;
    border-bottom: 1px solid #dfe7ee;
  }

  .scene-management-toolbar {
    grid-template-columns: 1fr;
  }

  .scene-status-filter {
    overflow-x: auto;
  }

  .scene-list-table {
    overflow-x: auto;
  }

  .scene-list-header,
  .scene-list-row {
    min-width: 720px;
  }

  .scene-health-rail {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .scene-management-stale {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Apple glass mobile v2: mobile-only visual system and physical sheet layer. */
@media (max-width: 920px) {
  body.apple-mobile-enabled {
    --apple-bg: #f2f2f7;
    --apple-bg-elevated: rgba(255, 255, 255, 0.88);
    --apple-surface: rgba(255, 255, 255, 0.82);
    --apple-surface-solid: #ffffff;
    --apple-fill: rgba(118, 118, 128, 0.12);
    --apple-fill-strong: rgba(118, 118, 128, 0.18);
    --apple-label: #1c1c1e;
    --apple-secondary: #6e6e73;
    --apple-tertiary: #8e8e93;
    --apple-separator: rgba(60, 60, 67, 0.16);
    --apple-separator-soft: rgba(60, 60, 67, 0.09);
    --apple-accent: #087c72;
    --apple-accent-soft: rgba(8, 124, 114, 0.12);
    --apple-danger: #ff3b30;
    min-width: 0;
    background:
      radial-gradient(circle at 18% -8%, rgba(123, 211, 201, 0.2), transparent 32rem),
      var(--apple-bg);
    color: var(--apple-label);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
    font-optical-sizing: auto;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
  }

  body.apple-mobile-enabled .auth-screen {
    padding: max(20px, env(safe-area-inset-top, 0px)) 18px max(20px, env(safe-area-inset-bottom, 0px));
    background:
      radial-gradient(circle at 20% 4%, rgba(91, 205, 191, 0.3), transparent 23rem),
      linear-gradient(180deg, #f8fafb 0%, #eef2f5 100%);
  }

  body.apple-mobile-enabled .login-card {
    width: min(100%, 390px);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 26px;
    padding: 22px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 24px 70px rgba(31, 43, 57, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(28px) saturate(165%);
    backdrop-filter: blur(28px) saturate(165%);
  }

  body.apple-mobile-enabled .login-card label {
    color: var(--apple-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.015em;
  }

  body.apple-mobile-enabled .shell,
  body.apple-mobile-enabled .shell.sidebar-collapsed {
    background: transparent;
    transform: translate3d(0, var(--apple-content-y, 0), 0) scale(var(--apple-content-scale, 1));
    transform-origin: 50% 12%;
    will-change: transform;
  }

  body.apple-mobile-enabled.mobile-workbench-enabled.ui-layered .main {
    padding: 0 12px calc(104px + env(safe-area-inset-bottom, 0px));
    background: transparent;
  }

  body.apple-mobile-enabled.mobile-workbench-enabled.ui-layered .topbar {
    min-height: 82px;
    margin: 0 -12px 14px;
    padding: calc(13px + env(safe-area-inset-top, 0px)) 14px 12px;
    align-items: flex-end;
    border: 0;
    background: rgba(247, 249, 250, 0.7);
    box-shadow: none;
    -webkit-backdrop-filter: blur(26px) saturate(180%);
    backdrop-filter: blur(26px) saturate(180%);
  }

  body.apple-mobile-enabled.mobile-workbench-enabled.ui-layered .topbar::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -10px;
    left: 0;
    height: 12px;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(44, 55, 66, 0.08), transparent);
    opacity: 0.42;
    -webkit-mask-image: linear-gradient(180deg, #000, transparent);
    mask-image: linear-gradient(180deg, #000, transparent);
  }

  body.apple-mobile-enabled.mobile-workbench-enabled.ui-layered .topbar h1 {
    color: var(--apple-label);
    font-size: clamp(1.55rem, 7vw, 1.85rem);
    font-weight: 730;
    letter-spacing: -0.035em;
    line-height: 1.05;
  }

  body.apple-mobile-enabled.mobile-workbench-enabled.ui-layered .topbar p {
    margin-top: 5px;
    color: var(--apple-secondary);
    font-size: 0.72rem;
    font-weight: 480;
    letter-spacing: 0.012em;
    line-height: 1.35;
  }

  body.apple-mobile-enabled.mobile-workbench-enabled.ui-layered #refresh-btn {
    border: 1px solid rgba(255, 255, 255, 0.82);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.64);
    color: var(--apple-accent);
    box-shadow: 0 5px 16px rgba(22, 40, 50, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    backdrop-filter: blur(18px) saturate(180%);
  }

  body.apple-mobile-enabled.mobile-workbench-enabled.ui-layered #refresh-btn:active {
    transform: scale(0.9);
  }

  body.apple-mobile-enabled.mobile-workbench-enabled.ui-layered .view.active {
    min-width: 0;
  }

  body.apple-mobile-enabled.mobile-workbench-enabled.ui-layered .panel {
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 20px;
    padding: 15px;
    background: var(--apple-surface);
    box-shadow: 0 10px 30px rgba(31, 43, 57, 0.055), inset 0 1px 0 rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(18px) saturate(145%);
    backdrop-filter: blur(18px) saturate(145%);
  }

  body.apple-mobile-enabled.mobile-workbench-enabled.ui-layered .panel > .panel-title:first-child {
    min-height: 50px;
    margin: -15px -15px 14px;
    padding: 13px 15px 11px;
    border-bottom: 1px solid var(--apple-separator-soft);
    border-radius: 20px 20px 0 0;
    background: rgba(255, 255, 255, 0.28);
  }

  body.apple-mobile-enabled.mobile-workbench-enabled.ui-layered .panel-title h2,
  body.apple-mobile-enabled.mobile-workbench-enabled.ui-layered .panel-title h3 {
    color: var(--apple-label);
    font-weight: 690;
    letter-spacing: -0.018em;
  }

  body.apple-mobile-enabled.mobile-workbench-enabled.ui-layered .panel-title span,
  body.apple-mobile-enabled.mobile-workbench-enabled.ui-layered .muted,
  body.apple-mobile-enabled.mobile-workbench-enabled.ui-layered small {
    color: var(--apple-secondary);
  }

  body.apple-mobile-enabled.mobile-workbench-enabled.ui-layered :is(.metrics, .live-metrics, .marketing-summary-row, .module-command-strip, .op-command-strip, .marketing-command-strip) {
    gap: 10px !important;
  }

  body.apple-mobile-enabled.mobile-workbench-enabled.ui-layered :is(.metric, .live-metric, .marketing-summary-card, .module-command-card, .op-command-card, .marketing-command-card) {
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.74) !important;
    border-radius: 18px !important;
    background: rgba(255, 255, 255, 0.74) !important;
    box-shadow: 0 8px 24px rgba(31, 43, 57, 0.045), inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
  }

  body.apple-mobile-enabled.mobile-workbench-enabled.ui-layered :is(.metric, .live-metric, .marketing-summary-card) strong {
    color: var(--apple-label);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.025em;
  }

  body.apple-mobile-enabled.mobile-workbench-enabled.ui-layered label {
    color: var(--apple-secondary);
    font-size: 0.75rem;
    font-weight: 590;
    letter-spacing: 0.012em;
  }

  body.apple-mobile-enabled.mobile-workbench-enabled.ui-layered :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea, .multi-select-trigger) {
    border: 1px solid transparent;
    border-radius: 12px;
    background: var(--apple-fill);
    color: var(--apple-label);
    box-shadow: inset 0 0 0 0.5px rgba(60, 60, 67, 0.05);
    outline: none;
    transition: background-color 120ms ease-out, box-shadow 120ms ease-out;
  }

  body.apple-mobile-enabled.mobile-workbench-enabled.ui-layered :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea, .multi-select-trigger):focus {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 3px rgba(8, 124, 114, 0.16), inset 0 0 0 1px rgba(8, 124, 114, 0.48);
  }

  body.apple-mobile-enabled.mobile-workbench-enabled.ui-layered input::placeholder,
  body.apple-mobile-enabled.mobile-workbench-enabled.ui-layered textarea::placeholder {
    color: var(--apple-tertiary);
  }

  body.apple-mobile-enabled.mobile-workbench-enabled.ui-layered button,
  body.apple-mobile-enabled .login-card button {
    border-radius: 12px;
    touch-action: manipulation;
    transition: transform 90ms ease-out, filter 120ms ease-out, background-color 120ms ease-out, color 120ms ease-out;
  }

  body.apple-mobile-enabled.mobile-workbench-enabled.ui-layered button:active,
  body.apple-mobile-enabled .login-card button:active {
    transform: scale(0.96);
    filter: brightness(0.96);
  }

  body.apple-mobile-enabled.mobile-workbench-enabled.ui-layered :is(button:not(.secondary-button):not(.icon-button):not(.table-action):not(.mobile-bottom-item):not(.mobile-module-item):not(.mobile-module-close):not(.mobile-module-backdrop):not(.mobile-sheet-logout), .primary-button),
  body.apple-mobile-enabled .login-card > button {
    background: var(--apple-accent);
    color: #ffffff;
    box-shadow: 0 7px 18px rgba(8, 124, 114, 0.2);
  }

  body.apple-mobile-enabled.mobile-workbench-enabled.ui-layered :is(.secondary-button, .table-action, .file-button) {
    border: 1px solid rgba(255, 255, 255, 0.68);
    background: rgba(255, 255, 255, 0.72);
    color: var(--apple-accent);
    box-shadow: 0 4px 12px rgba(31, 43, 57, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.88);
  }

  body.apple-mobile-enabled.mobile-workbench-enabled.ui-layered :is(.module-subnav, .product-center-subnav, .product-image-helper-subnav, .task-perspective-tabs, .task-personal-tabs, .database-subnav) {
    gap: 3px !important;
    border: 0 !important;
    border-radius: 13px !important;
    padding: 3px !important;
    background: var(--apple-fill) !important;
    box-shadow: none !important;
  }

  body.apple-mobile-enabled.mobile-workbench-enabled.ui-layered :is(.module-subnav, .product-center-subnav, .product-image-helper-subnav, .task-perspective-tabs, .task-personal-tabs, .database-subnav) button {
    min-height: 38px;
    border: 0 !important;
    border-radius: 10px !important;
    background: transparent !important;
    color: var(--apple-secondary) !important;
    box-shadow: none !important;
    font-weight: 620;
  }

  body.apple-mobile-enabled.mobile-workbench-enabled.ui-layered :is(.module-subnav, .product-center-subnav, .product-image-helper-subnav, .task-perspective-tabs, .task-personal-tabs, .database-subnav) button.active {
    background: rgba(255, 255, 255, 0.9) !important;
    color: var(--apple-label) !important;
    box-shadow: 0 2px 7px rgba(31, 43, 57, 0.12), inset 0 0 0 0.5px rgba(60, 60, 67, 0.08) !important;
  }

  body.apple-mobile-enabled.mobile-workbench-enabled.ui-layered .table {
    border: 1px solid var(--apple-separator-soft);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.58);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  }

  body.apple-mobile-enabled.mobile-workbench-enabled.ui-layered .table table {
    border-collapse: separate;
    border-spacing: 0;
  }

  body.apple-mobile-enabled.mobile-workbench-enabled.ui-layered .table th {
    background: rgba(242, 242, 247, 0.88);
    color: var(--apple-secondary);
    font-size: 0.68rem;
    font-weight: 650;
    letter-spacing: 0.025em;
  }

  body.apple-mobile-enabled.mobile-workbench-enabled.ui-layered .table td {
    border-color: var(--apple-separator-soft);
    color: var(--apple-label);
  }

  body.apple-mobile-enabled.mobile-workbench-enabled {
    padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px));
  }

  body.apple-mobile-enabled .mobile-bottom-nav {
    right: 10px;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    left: 10px;
    min-height: 64px;
    padding: 5px 6px;
    border: 1px solid rgba(255, 255, 255, 0.76);
    border-radius: 22px;
    background: rgba(248, 249, 250, 0.74);
    box-shadow: 0 14px 34px rgba(22, 34, 46, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.98);
    -webkit-backdrop-filter: blur(28px) saturate(190%);
    backdrop-filter: blur(28px) saturate(190%);
  }

  body.apple-mobile-enabled .mobile-bottom-item {
    min-height: 52px;
    border-radius: 16px;
    color: var(--apple-secondary);
    font-size: 0.625rem;
    font-weight: 590;
    letter-spacing: 0.012em;
    transition: transform 90ms ease-out, color 150ms ease-out, background-color 150ms ease-out;
  }

  body.apple-mobile-enabled .mobile-bottom-item::before {
    top: 2px;
    width: 38px;
    height: 29px;
    background: transparent;
  }

  body.apple-mobile-enabled .mobile-bottom-item:active {
    transform: scale(0.91);
  }

  body.apple-mobile-enabled .mobile-bottom-item.active {
    color: var(--apple-accent);
  }

  body.apple-mobile-enabled .mobile-bottom-item.active::before {
    background: var(--apple-accent-soft);
    box-shadow: inset 0 0 0 0.5px rgba(8, 124, 114, 0.08);
  }

  body.apple-mobile-enabled .mobile-bottom-item svg {
    width: 21px;
    height: 21px;
    stroke-width: 1.9;
  }

  body.apple-mobile-enabled .mobile-module-layer {
    --apple-sheet-progress: 0;
  }

  body.apple-mobile-enabled .mobile-module-backdrop,
  body.apple-mobile-enabled .mobile-module-layer.is-open .mobile-module-backdrop {
    background: rgba(12, 18, 26, 0.34);
    opacity: var(--apple-sheet-progress, 0);
    transition: none;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
  }

  body.apple-mobile-enabled .mobile-module-sheet,
  body.apple-mobile-enabled .mobile-module-layer.is-open .mobile-module-sheet {
    max-height: min(88dvh, 800px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-bottom: 0;
    border-radius: 28px 28px 0 0;
    background: rgba(246, 247, 249, 0.9);
    box-shadow: 0 -28px 70px rgba(15, 24, 36, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.96);
    opacity: var(--apple-sheet-opacity, 1);
    transform: translate3d(0, var(--apple-sheet-y, 100%), 0);
    transition: none;
    will-change: transform;
    -webkit-backdrop-filter: blur(34px) saturate(185%);
    backdrop-filter: blur(34px) saturate(185%);
  }

  body.apple-mobile-enabled .mobile-module-handle {
    width: 38px;
    height: 5px;
    margin-top: 8px;
    background: rgba(60, 60, 67, 0.25);
    touch-action: none;
  }

  body.apple-mobile-enabled .mobile-module-header {
    padding: 10px 18px 13px;
    border-bottom: 0;
    background: transparent;
    touch-action: none;
    user-select: none;
  }

  body.apple-mobile-enabled .mobile-module-header h2 {
    color: var(--apple-label);
    font-size: 1.35rem;
    font-weight: 720;
    letter-spacing: -0.03em;
  }

  body.apple-mobile-enabled .mobile-module-header p {
    color: var(--apple-secondary);
    font-size: 0.7rem;
    letter-spacing: 0.01em;
  }

  body.apple-mobile-enabled .mobile-module-close {
    border: 0;
    border-radius: 50%;
    background: var(--apple-fill-strong);
    color: var(--apple-secondary);
    font-size: 1.3rem;
    font-weight: 520;
  }

  body.apple-mobile-enabled .mobile-module-groups {
    padding: 10px 14px 20px;
    scrollbar-width: none;
  }

  body.apple-mobile-enabled .mobile-module-groups::-webkit-scrollbar {
    display: none;
  }

  body.apple-mobile-enabled .mobile-module-group + .mobile-module-group {
    margin-top: 20px;
  }

  body.apple-mobile-enabled .mobile-module-group h3 {
    margin: 0 4px 8px;
    color: var(--apple-secondary);
    font-size: 0.69rem;
    font-weight: 610;
    letter-spacing: 0.035em;
  }

  body.apple-mobile-enabled .mobile-module-grid {
    gap: 8px;
  }

  body.apple-mobile-enabled .mobile-module-item {
    min-height: 54px;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 15px;
    padding: 11px 13px;
    background: rgba(255, 255, 255, 0.7);
    color: var(--apple-label);
    box-shadow: 0 5px 16px rgba(31, 43, 57, 0.045), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    font-size: 0.82rem;
    font-weight: 620;
    letter-spacing: -0.005em;
  }

  body.apple-mobile-enabled .mobile-module-item:active {
    transform: scale(0.955);
    background: rgba(255, 255, 255, 0.94);
  }

  body.apple-mobile-enabled .mobile-module-item.active {
    border-color: rgba(8, 124, 114, 0.2);
    background: var(--apple-accent-soft);
    color: var(--apple-accent);
    box-shadow: inset 0 0 0 0.5px rgba(8, 124, 114, 0.12);
  }

  body.apple-mobile-enabled .mobile-module-current {
    background: rgba(8, 124, 114, 0.14);
    color: var(--apple-accent);
  }

  body.apple-mobile-enabled .mobile-module-footer {
    padding: 11px 16px calc(11px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--apple-separator-soft);
    background: rgba(255, 255, 255, 0.54);
  }

  body.apple-mobile-enabled .mobile-module-account strong {
    color: var(--apple-label);
    font-weight: 650;
  }

  body.apple-mobile-enabled .mobile-module-account small {
    color: var(--apple-secondary);
  }

  body.apple-mobile-enabled .mobile-sheet-logout {
    border: 0;
    border-radius: 12px;
    background: rgba(255, 59, 48, 0.1);
    color: var(--apple-danger);
  }

  body.apple-mobile-enabled .mobile-module-layer.apple-sheet-dragging .mobile-module-sheet,
  body.apple-mobile-enabled .mobile-module-layer.apple-sheet-dragging .mobile-module-backdrop {
    user-select: none;
    cursor: grabbing;
  }
}

@media (max-width: 920px) and (prefers-reduced-transparency: reduce) {
  body.apple-mobile-enabled .topbar,
  body.apple-mobile-enabled .mobile-bottom-nav,
  body.apple-mobile-enabled .mobile-module-sheet,
  body.apple-mobile-enabled .login-card,
  body.apple-mobile-enabled .panel {
    background: #ffffff !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
}

@media (max-width: 920px) and (prefers-contrast: more) {
  body.apple-mobile-enabled {
    --apple-separator: rgba(0, 0, 0, 0.48);
    --apple-separator-soft: rgba(0, 0, 0, 0.3);
    --apple-secondary: #444446;
  }

  body.apple-mobile-enabled :is(.panel, .mobile-bottom-nav, .mobile-module-sheet, input, select, textarea, button) {
    border-color: var(--apple-separator) !important;
  }
}

@media (max-width: 920px) and (prefers-reduced-motion: reduce) {
  body.apple-mobile-enabled .shell {
    transform: none !important;
  }

  body.apple-mobile-enabled .mobile-module-sheet,
  body.apple-mobile-enabled .mobile-module-layer.is-open .mobile-module-sheet {
    transform: none !important;
  }

  body.apple-mobile-enabled .mobile-module-backdrop,
  body.apple-mobile-enabled .mobile-module-layer.is-open .mobile-module-backdrop {
    transition: opacity 160ms ease-out !important;
  }
}
