/*
 * Qingyun AI Assistant - unified enterprise theme
 * Visual-only override layer. Business behavior remains in the existing app.
 */

:root {
  --qy-bg: #f5f7fa;
  --qy-surface: #ffffff;
  --qy-surface-soft: #f8fafc;
  --qy-surface-hover: #f1f5f9;
  --qy-border: #e2e8f0;
  --qy-border-strong: #cbd5e1;
  --qy-text: #172033;
  --qy-text-strong: #0f172a;
  --qy-muted: #64748b;
  --qy-blue: #2563eb;
  --qy-blue-hover: #1d4ed8;
  --qy-blue-soft: #eff6ff;
  --qy-green: #168a4a;
  --qy-green-soft: #ecfdf3;
  --qy-amber: #b45309;
  --qy-amber-soft: #fffbeb;
  --qy-red: #dc2626;
  --qy-red-soft: #fef2f2;
  --qy-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --qy-shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
  --qy-sidebar: 224px;
  --qy-radius: 8px;
  --qy-content: 1440px;
  --qy-chat: 1000px;
}

/* ==================== 个人报警消息中心 ==================== */
.message-center-nav-badge {
  min-width: 20px;
  height: 20px;
  margin-left: auto;
  padding: 0 6px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(239, 68, 68, .22);
}

.message-center-nav-badge[hidden] {
  display: none !important;
}

.nav-item[data-panel="messageCenterPanel"] {
  position: relative;
  grid-template-columns: 28px minmax(0, 1fr) auto !important;
}

body.sidebar-collapsed .nav-item[data-panel="messageCenterPanel"] {
  grid-template-columns: 1fr !important;
}

body.sidebar-collapsed .message-center-nav-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-width: 1px;
  line-height: 15px;
}

.message-center-panel {
  background:
    radial-gradient(circle at 90% 2%, rgba(59, 130, 246, .09), transparent 28%),
    linear-gradient(180deg, #f8fbff 0, #f4f7fc 240px, #f7f9fc 100%) !important;
}

.message-center-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.message-center-header .subtle {
  max-width: 760px;
  margin: 8px 0 0;
}

.message-center-title-line {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.message-center-title-line h1 {
  margin: 0;
}

.message-center-header-unread-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 5px 14px rgba(239, 68, 68, .22);
}

.message-center-header-unread-badge[hidden] {
  display: none !important;
}

.message-center-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.message-center-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #d7e5fa;
  border-radius: 999px;
  background: rgba(255, 255, 255, .84);
  color: #536987;
  font-size: 13px;
  font-weight: 700;
}

.message-center-live i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 5px rgba(34, 197, 94, .12);
}

.message-center-unread-banner {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 1px solid #cfe8da;
  border-radius: 16px;
  background: rgba(240, 253, 244, .9);
  color: #166534;
}

.message-center-unread-banner.is-alert {
  border-color: #fecaca;
  background: linear-gradient(90deg, #fff1f2, #fff7f7);
  color: #b42331;
  box-shadow: 0 8px 20px rgba(220, 38, 38, .07);
}

.message-center-unread-banner-icon {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #dcfce7;
  font-size: 15px;
  font-style: normal;
  font-weight: 900;
}

.message-center-unread-banner.is-alert .message-center-unread-banner-icon {
  background: #fee2e2;
  color: #dc2626;
}

.message-center-unread-banner strong,
.message-center-unread-banner small {
  display: block;
}

.message-center-unread-banner strong {
  font-size: 14px;
}

.message-center-unread-banner small {
  margin-top: 3px;
  color: #6b7b91;
  font-size: 12px;
}

.message-center-unread-banner .ghost-btn[hidden] {
  display: none !important;
}

.message-center-unread-banner.is-alert .ghost-btn {
  border-color: #fca5a5;
  color: #c52132;
  background: #fff;
}

.message-center-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.message-center-kpis > button {
  width: 100%;
  height: auto;
  min-width: 0;
  text-align: left;
  font: inherit;
  cursor: pointer;
  white-space: normal;
  min-height: 118px;
  padding: 18px 20px;
  border: 1px solid #dce6f4;
  border-radius: 20px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 10px 24px rgba(45, 71, 112, .06);
}

.message-center-kpis > button span,
.message-center-kpis > button small {
  display: block;
  color: #72829b;
  font-size: 13px;
  font-weight: 650;
}

.message-center-kpis > button strong {
  display: block;
  margin: 8px 0 3px;
  color: #16243d;
  font-size: 30px;
  line-height: 1;
}

.message-center-kpis > button.is-level1 { border-top: 3px solid #ef4444; }
.message-center-kpis > button.is-level2 { border-top: 3px solid #f59e0b; }
.message-center-kpis > button.is-level3 { border-top: 3px solid #eab308; }
.message-center-kpis > button.is-handled { border-top: 3px solid #22c55e; }
.message-center-kpis > button.is-level1 strong { color: #dc2626; }
.message-center-kpis > button.is-level2 strong { color: #d97706; }
.message-center-kpis > button.is-level3 strong { color: #a16207; }
.message-center-kpis > button.is-handled strong { color: #16834a; }
.message-center-kpis > button:hover { background: #f5f8ff; box-shadow: 0 6px 18px rgba(45,71,112,.1); }
.message-center-kpis > button[aria-pressed="true"] { background: #edf4ff; outline: 2px solid #3478ef; outline-offset: -2px; }
.message-center-kpis > button:focus-visible { outline: 3px solid #8db9ff; outline-offset: 3px; }

.message-center-toolbar {
  display: grid;
  grid-template-columns: minmax(150px, .8fr) minmax(150px, .8fr) minmax(150px, .8fr) minmax(150px, .8fr) minmax(240px, 1.5fr);
  gap: 12px;
  padding: 16px;
}

.message-center-toolbar > label {
  min-width: 0;
}

.message-center-toolbar > label > span {
  display: block;
  margin: 0 0 7px;
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
}

.message-center-toolbar input,
.message-center-toolbar select {
  width: 100%;
  min-height: 42px;
}

.message-center-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 18px 2px 10px;
}

.message-center-list-head > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.message-center-list-head strong {
  color: #17233a;
  font-size: 18px;
}

.message-center-list-head span {
  padding: 4px 9px;
  border-radius: 999px;
  background: #eaf1fb;
  color: #5d6f89;
  font-size: 12px;
  font-weight: 750;
}

.message-center-list-head small {
  color: #77869d;
}

.message-center-list {
  display: grid;
  gap: 8px;
  padding-bottom: 36px;
}

.message-center-card {
  position: relative;
  overflow: hidden;
  padding: 0;
  border: 1px solid #dbe5f2;
  border-left: 4px solid #d8e1ee;
  border-radius: 15px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 4px 14px rgba(28, 52, 90, .045);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.message-center-card:hover {
  border-color: #bfd3ee;
  box-shadow: 0 14px 34px rgba(35, 75, 130, .1);
  transform: translateY(-1px);
}

.message-center-card.severity-level1 { border-left-color: #ef4444; }
.message-center-card.severity-level2 { border-left-color: #f59e0b; }
.message-center-card.severity-level3 { border-left-color: #eab308; }
.message-center-card.severity-info { border-left-color: #7c3aed; }
.message-center-card.is-unread { background: linear-gradient(90deg, #fff5f5, #fff 34%); }
.message-center-card.is-handled { border-left-color: #22c55e; }
.message-center-card.is-recovered { border-left-color: #60a5fa; }
.message-center-card.is-notice { border-left-color: #7c3aed; }

.message-center-card-top,
.message-center-card-title,
.message-center-card-actions {
  display: flex;
  align-items: center;
}

.message-center-card-top {
  justify-content: space-between;
  gap: 18px;
}

.message-center-card-title {
  min-width: 0;
  flex-wrap: wrap;
  gap: 8px;
}

.message-center-card-title > strong {
  color: #13213a;
  font-size: 19px;
  overflow-wrap: anywhere;
}

.message-center-card-top time {
  color: #7a899e;
  font-size: 12px;
  white-space: nowrap;
}

.message-center-unread-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 5px rgba(239, 68, 68, .1);
}

.message-center-row {
  display: grid;
  grid-template-columns: minmax(178px, auto) minmax(270px, 1.55fr) minmax(82px, .48fr) minmax(180px, 1fr) minmax(92px, .58fr) 82px 64px 16px;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 11px 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.message-center-row::-webkit-details-marker {
  display: none;
}

/* Account metrics belong to daily-status notices only; alert/report layouts stay unchanged. */
.has-live-metrics { container-type: inline-size; container-name: message-notice; }
.has-live-metrics > .message-center-row {
  grid-template-columns: minmax(170px, auto) minmax(200px, 1fr) minmax(260px, 1.1fr) 90px minmax(120px, .6fr) 82px 82px 64px 16px;
}
.message-center-live-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px 12px; min-width: 0; }
.message-center-live-metrics > span { min-width: 0; }
.message-center-live-metrics small { display: block; color: #8491a5; font-size: 11px; line-height: 1.45; }
.message-center-live-metrics b { display: block; color: #24344f; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.message-center-live-metrics .is-positive b { color: #15803d; }
.message-center-live-metrics .is-low b { color: #cf2638; }
.message-center-live-metrics.is-unavailable b { color: #94a3b8; }
.message-center-live-updated { grid-column: 1 / -1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@container message-notice (max-width: 1350px) {
  .has-live-metrics > .message-center-row { grid-template-columns: minmax(170px, auto) minmax(180px, 1fr) minmax(240px, 1.1fr) 90px 82px 64px 16px; gap: 10px; }
  .has-live-metrics > .message-center-row > .is-money,
  .has-live-metrics > .message-center-row > .message-center-row-trend { display: none; }
}
@container message-notice (max-width: 1040px) {
  .has-live-metrics > .message-center-row { grid-template-columns: minmax(165px, auto) minmax(160px, 1fr) minmax(225px, 1.1fr) 86px 64px 16px; }
  .has-live-metrics > .message-center-row > time { display: none; }
}
@container message-notice (max-width: 940px) {
  .has-live-metrics > .message-center-row { grid-template-columns: minmax(0, 1fr) 64px 16px; }
  .has-live-metrics .message-center-row-badges,
  .has-live-metrics .message-center-row-main,
  .has-live-metrics .message-center-live-metrics { grid-column: 1 / -1; }
  .has-live-metrics .message-center-live-metrics { padding: 8px 0; border-top: 1px solid #edf1f7; }
  .has-live-metrics .message-center-row-metric.is-status { grid-column: 1; grid-row: 4; }
  .has-live-metrics .message-center-row-finished { grid-column: 2; grid-row: 4; }
  .has-live-metrics .message-center-row-chevron { grid-column: 3; grid-row: 4; }
}
@supports not (container-type: inline-size) {
  @media (max-width: 1450px) {
    .has-live-metrics > .message-center-row { grid-template-columns: minmax(0, 1fr) 64px 16px; }
    .has-live-metrics .message-center-row-badges,
    .has-live-metrics .message-center-row-main,
    .has-live-metrics .message-center-live-metrics { grid-column: 1 / -1; }
    .has-live-metrics > .message-center-row > .is-money,
    .has-live-metrics > .message-center-row > .message-center-row-trend,
    .has-live-metrics > .message-center-row > time { display: none; }
    .has-live-metrics .message-center-row-metric.is-status { grid-column: 1; grid-row: 4; }
    .has-live-metrics .message-center-row-finished { grid-column: 2; grid-row: 4; }
    .has-live-metrics .message-center-row-chevron { grid-column: 3; grid-row: 4; }
  }
}

.message-center-row:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .23);
  outline-offset: -3px;
}

.message-center-row-badges {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.message-center-row-main,
.message-center-row-metric,
.message-center-row-trend {
  min-width: 0;
}

.message-center-row-main strong,
.message-center-row-main small,
.message-center-row-metric small,
.message-center-row-metric b,
.message-center-row-trend small,
.message-center-row-trend b {
  display: block;
}

.message-center-row-main strong {
  overflow: hidden;
  color: #182641;
  font-size: 15px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-center-row-main small,
.message-center-row-metric small,
.message-center-row-trend small {
  overflow: hidden;
  color: #8491a5;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-center-row-main small {
  margin-top: 3px;
}

.message-center-row-metric b,
.message-center-row-trend b {
  overflow: hidden;
  margin-top: 2px;
  color: #24344f;
  font-size: 13px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-center-row-metric.is-roi b {
  color: #cf2638;
  font-size: 15px;
}

.message-center-row-metric.is-status b,
.message-center-analysis.is-daily-status b {
  color: #7e22ce;
}

.message-center-row time {
  color: #78879d;
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.message-center-row-handle,
.message-center-row-finished {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.message-center-row-handle {
  border: 1px solid #2563eb;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(37, 99, 235, .16);
}

.message-center-row-handle:hover {
  border-color: #1d4ed8;
  background: #1d4ed8;
}

.message-center-row-handle:disabled {
  opacity: .55;
  cursor: wait;
}

/* The real-drain action must remain readable/tappable instead of clipping in a 64px column. */
.has-drain-actions > .message-center-row { grid-template-columns: minmax(178px, auto) minmax(0, 1.55fr) minmax(82px, .48fr) minmax(140px, 1fr) minmax(92px, .58fr) 82px 132px 16px; }
.has-drain-actions .message-center-row-handle { box-sizing: border-box; width: 100%; min-width: 104px; min-height: 44px; padding: 8px 14px; white-space: nowrap; line-height: 1.4; flex-shrink: 0; overflow: visible; font-size: 13px; }
.has-drain-actions .message-center-row-handle:focus-visible { outline: 3px solid #93b4ff; outline-offset: 3px; }
@media (max-width: 1180px) {
  .has-drain-actions > .message-center-row { grid-template-columns: minmax(170px, auto) minmax(0, 1.5fr) 80px 90px 76px 132px 16px; }
}
@media (max-width: 920px) {
  .has-drain-actions > .message-center-row { grid-template-columns: minmax(165px, auto) minmax(0, 1fr) 86px 132px 16px; }
}
@media (max-width: 760px) {
  .has-drain-actions > .message-center-row { grid-template-columns: minmax(0, 1fr) 132px 16px; }
  .has-drain-actions .message-center-row-main small { white-space: normal; overflow-wrap: anywhere; }
}

.message-center-row-finished {
  background: #eaf8f0;
  color: #16834a;
}

.message-center-row-chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid #8a99ae;
  border-bottom: 2px solid #8a99ae;
  transform: rotate(45deg);
  transition: transform .18s ease;
}

.message-center-card[open] .message-center-row-chevron {
  transform: rotate(225deg);
}

.message-center-expanded {
  padding: 0 16px 16px;
  border-top: 1px solid #e7edf5;
  background: linear-gradient(180deg, #fbfcff, #fff);
}

.message-center-expanded .message-center-account-line {
  margin-top: 14px;
}

.message-center-analysis {
  margin-top: 11px;
  padding: 11px 13px;
  border: 1px solid #e2eaf5;
  border-radius: 12px;
  background: #f8faff;
  color: #53637b;
  font-size: 13px;
  line-height: 1.65;
}

.message-center-analysis p {
  margin: 4px 0;
}

.message-center-analysis.is-digest pre {
  margin: 0;
  color: #3f4f68;
  font: inherit;
  line-height: 1.75;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.message-center-severity,
.message-center-status {
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.severity-level1 .message-center-severity { background: #fff0f1; color: #d92d3f; }
.severity-level2 .message-center-severity { background: #fff6e8; color: #ba6c00; }
.severity-level3 .message-center-severity { background: #fff9d9; color: #967000; }
.severity-info .message-center-severity { background: #f3e8ff; color: #7e22ce; }
.message-center-status { background: #edf3fb; color: #5c6f8b; }
.is-active .message-center-status { background: #eef4ff; color: #2563eb; }
.is-handled .message-center-status { background: #eaf8f0; color: #16834a; }
.is-recovered .message-center-status { background: #eaf5ff; color: #2877bd; }
.is-notice .message-center-status { background: #f3e8ff; color: #7e22ce; }

.message-center-account-line {
  display: grid;
  grid-template-columns: minmax(120px, .75fr) minmax(220px, 1.5fr) minmax(120px, .75fr);
  gap: 12px;
  margin: 16px 0 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f6f8fc;
}

.message-center-account-line span,
.message-center-metrics span {
  min-width: 0;
}

.message-center-account-line small,
.message-center-account-line b,
.message-center-metrics small,
.message-center-metrics b,
.message-center-metrics em {
  display: block;
}

.message-center-account-line small,
.message-center-metrics small {
  color: #8390a4;
  font-size: 11px;
  font-weight: 700;
}

.message-center-account-line b {
  margin-top: 3px;
  color: #283852;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.message-center-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(112px, 1fr));
  gap: 10px;
}

.message-center-metrics span {
  padding: 12px 14px;
  border: 1px solid #e5ebf4;
  border-radius: 14px;
  background: #fff;
}

.message-center-metrics b {
  margin-top: 4px;
  color: #1c2b45;
  font-size: 18px;
}

.message-center-metrics em {
  margin-top: 2px;
  color: #8390a4;
  font-size: 11px;
  font-style: normal;
}

.message-center-detail {
  margin-top: 12px;
  border: 1px solid #deE7f3;
  border-radius: 14px;
  background: #fbfcff;
}

.message-center-detail summary {
  padding: 12px 14px;
  color: #245ba8;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.message-center-detail > div {
  padding: 0 14px 13px;
  color: #53637b;
  font-size: 13px;
  line-height: 1.7;
}

.message-center-detail p {
  margin: 5px 0;
}

.message-center-handled-copy {
  padding: 8px 10px;
  border-radius: 9px;
  background: #edf8f2;
  color: #28704b;
}

.message-center-card-actions {
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
}

.message-center-card-actions > span {
  color: #8491a4;
  font-size: 12px;
}

.message-center-card-actions .primary-btn {
  min-height: 38px;
  padding: 0 14px;
  white-space: nowrap;
}

.message-center-batch-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  padding: 12px 16px;
  border: 1px solid #dce6f3;
  border-radius: 14px;
  background: #fff;
  font-size: 13px;
  color: #64748b;
}
.message-center-batch-toolbar label { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.message-center-batch-toolbar input[type="checkbox"],
.message-center-select[type="checkbox"] { flex: 0 0 18px; width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0; accent-color: #2563eb; cursor: pointer; }
.message-center-batch-toolbar .secondary-btn { min-height: 34px; padding: 7px 12px; font-size: 13px; }
.message-center-batch-toolbar small { flex: 1 1 220px; line-height: 1.6; }
.message-center-product-accounts { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,240px),1fr)); gap: 12px; margin-top: 14px; }
.message-center-product-accounts section { min-width: 0; padding: 14px; background: #f7f9fc; border: 1px solid #e2e8f0; border-radius: 12px; }
.message-center-product-accounts h4 { margin: 0 0 10px; font-size: 13px; color: #475569; }
.message-center-product-accounts pre { max-height: 230px; overflow: auto; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.8; user-select: text; }

.message-center-empty {
  display: flex;
  min-height: 180px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  border: 1px dashed #cfdae9;
  border-radius: 20px;
  background: rgba(255, 255, 255, .7);
  color: #8090a6;
  text-align: center;
}

.message-center-empty b {
  color: #33445f;
  font-size: 16px;
}

/* 消息中心：经营报告使用独立信息密度，与 ROI 报警卡彻底区分。 */
.message-center-report-card {
  --report-accent: #2563eb;
  --report-accent-strong: #174ea6;
  --report-soft: #eff6ff;
  position: relative;
  overflow: hidden;
  border: 1px solid #d8e4f3;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(29, 61, 106, .08);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.message-center-report-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--report-accent), var(--report-accent-strong));
  content: "";
}

.message-center-report-card:hover {
  border-color: #b9cfea;
  box-shadow: 0 18px 42px rgba(29, 61, 106, .13);
  transform: translateY(-1px);
}

.message-center-report-card.is-unread {
  background: linear-gradient(110deg, var(--report-soft), #fff 36%);
}

.message-center-report-card.is-weekly {
  --report-accent: #0f766e;
  --report-accent-strong: #115e59;
  --report-soft: #ecfdf8;
}

.message-center-report-card.is-monthly {
  --report-accent: #7c3aed;
  --report-accent-strong: #5b21b6;
  --report-soft: #f6f1ff;
}

.message-center-report-card.is-risk-report {
  --report-accent: #d97706;
  --report-accent-strong: #b45309;
  --report-soft: #fff8e8;
}

.message-center-report-summary {
  display: grid;
  grid-template-columns: 48px minmax(280px, 1.65fr) minmax(145px, .65fr) minmax(90px, .38fr) auto 74px 14px;
  align-items: center;
  gap: 16px;
  min-height: 104px;
  padding: 17px 20px 17px 23px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.message-center-report-summary::-webkit-details-marker { display: none; }
.message-center-report-summary:focus-visible { outline: 3px solid rgba(37, 99, 235, .22); outline-offset: -3px; }

.message-center-report-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid #d8e4f3;
  border-color: color-mix(in srgb, var(--report-accent) 22%, white);
  border-radius: 15px;
  background: var(--report-soft);
  color: var(--report-accent-strong);
  font-size: 20px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.7);
}

.message-center-report-heading,
.message-center-report-heading strong,
.message-center-report-heading small,
.message-center-report-brief small,
.message-center-report-brief b {
  display: block;
  min-width: 0;
}

.message-center-report-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.message-center-report-kicker em {
  color: var(--report-accent-strong);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: .12em;
}

.message-center-report-kicker b {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--report-soft);
  color: var(--report-accent-strong);
  font-size: 11px;
}

.message-center-report-heading strong {
  overflow: hidden;
  color: #13233e;
  font-size: 19px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-center-report-heading small {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 4px;
  color: #6f7f96;
  font-size: 12px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.message-center-report-brief small {
  color: #8794a8;
  font-size: 10px;
  font-weight: 750;
}

.message-center-report-brief b {
  overflow: hidden;
  margin-top: 4px;
  color: #243650;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-center-report-delivery {
  padding: 7px 11px;
  border-radius: 999px;
  background: #eaf8f0;
  color: #16834a;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.message-center-report-summary time {
  color: #8491a5;
  font-size: 11px;
  text-align: right;
  white-space: nowrap;
}

.message-center-report-chevron {
  width: 9px;
  height: 9px;
  border-right: 2px solid #8a99ae;
  border-bottom: 2px solid #8a99ae;
  transform: rotate(45deg);
  transition: transform .18s ease;
}

.message-center-report-card[open] .message-center-report-chevron { transform: rotate(225deg); }

.message-center-report-body {
  padding: 18px 22px 20px 27px;
  border-top: 1px solid #e4ebf5;
  background: linear-gradient(180deg, #f8fbff 0, #fff 150px);
}

.message-center-report-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.message-center-report-facts span {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #e1eaf5;
  border-radius: 13px;
  background: rgba(255,255,255,.9);
}

.message-center-report-facts small,
.message-center-report-facts b {
  display: block;
}

.message-center-report-facts small {
  color: #8794a8;
  font-size: 10px;
  font-weight: 750;
}

.message-center-report-facts b {
  overflow: hidden;
  margin-top: 4px;
  color: #22344f;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-center-report-executive {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin-top: 12px;
  padding: 15px 16px;
  border-radius: 14px;
  background: linear-gradient(115deg, var(--report-soft), #f8fbff);
}

.message-center-report-executive > span {
  color: var(--report-accent-strong);
  font-size: 12px;
  font-weight: 900;
}

.message-center-report-executive p {
  margin: 0;
  color: #41536d;
  font-size: 13px;
  line-height: 1.7;
}

.message-center-report-content {
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid #dfe8f3;
  border-radius: 15px;
  background: #fff;
}

.message-center-report-content header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  border-bottom: 1px solid #e8eef6;
  background: #fbfcfe;
}

.message-center-report-content header span,
.message-center-report-content header small { display: block; }
.message-center-report-content header span { color: #253752; font-size: 13px; font-weight: 850; }
.message-center-report-content header small { margin-top: 2px; color: #8a97a9; font-size: 10px; }
.message-center-report-content header > b { color: var(--report-accent-strong); font-size: 11px; white-space: nowrap; }

.message-center-report-content pre {
  max-height: 520px;
  margin: 0;
  overflow: auto;
  padding: 18px 20px;
  color: #374a65;
  font: 13px/1.85 -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.message-center-report-body > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  color: #8491a4;
  font-size: 11px;
}

@media (max-width: 1180px) {
  .message-center-kpis { grid-template-columns: repeat(3, 1fr); }
  .message-center-toolbar { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .message-center-search { grid-column: 1 / -1; }
  .message-center-metrics { grid-template-columns: repeat(3, 1fr); }
  .message-center-row { grid-template-columns: minmax(170px, auto) minmax(250px, 1.5fr) 88px 100px 76px 64px 16px; }
  .message-center-row-metric.is-money { display: none; }
  .message-center-report-summary { grid-template-columns: 48px minmax(260px,1.5fr) minmax(130px,.6fr) 82px 14px; }
  .message-center-report-summary > .message-center-report-brief:nth-of-type(4),
  .message-center-report-delivery { display: none; }
}

@media (max-width: 920px) {
  .message-center-row { grid-template-columns: minmax(165px, auto) minmax(220px, 1fr) 86px 64px 16px; gap: 10px; }
  .message-center-row-trend,
  .message-center-row time { display: none; }
  .message-center-report-summary { grid-template-columns: 44px minmax(0,1fr) 74px 14px; }
  .message-center-report-icon { width: 44px; height: 44px; }
  .message-center-report-brief,
  .message-center-report-delivery { display: none; }
  .message-center-report-facts { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 760px) {
  .message-center-header { align-items: flex-start; flex-direction: column; }
  .message-center-header-actions { width: 100%; justify-content: space-between; }
  .message-center-live { min-height: 36px; padding: 0 10px; }
  .message-center-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .message-center-kpis > button { min-height: 96px; padding: 14px; border-radius: 16px; }
  .message-center-kpis > button strong { font-size: 25px; }
  .message-center-toolbar { grid-template-columns: 1fr; padding: 12px; }
  .message-center-search { grid-column: auto; }
  .message-center-list-head { align-items: flex-start; flex-direction: column; gap: 5px; }
  .message-center-unread-banner { grid-template-columns: 34px minmax(0, 1fr); }
  .message-center-unread-banner .ghost-btn { grid-column: 1 / -1; width: 100%; }
  .message-center-card { padding: 0; border-radius: 15px; }
  .message-center-row { grid-template-columns: minmax(0, 1fr) 58px 14px; gap: 9px; min-height: 0; padding: 12px; }
  .message-center-row-badges { grid-column: 1 / -1; }
  .message-center-row-main { grid-column: 1 / -1; }
  .message-center-row-metric.is-roi { grid-column: 1; }
  .message-center-row-handle,
  .message-center-row-finished { grid-column: 2; grid-row: 3; }
  .message-center-row-chevron { grid-column: 3; grid-row: 3; }
  .message-center-expanded { padding: 0 12px 12px; }
  .message-center-card-top { align-items: flex-start; }
  .message-center-account-line { grid-template-columns: 1fr; }
  .message-center-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .message-center-card-actions { align-items: stretch; flex-direction: column; }
  .message-center-card-actions .primary-btn { width: 100%; white-space: normal; }
  .message-center-report-card { border-radius: 16px; }
  .message-center-report-summary { grid-template-columns: 40px minmax(0,1fr) 14px; gap: 11px; min-height: 0; padding: 14px 14px 14px 18px; }
  .message-center-report-icon { width: 40px; height: 40px; border-radius: 12px; font-size: 17px; }
  .message-center-report-heading strong { font-size: 16px; }
  .message-center-report-heading small { -webkit-line-clamp: 2; }
  .message-center-report-summary time { display: none; }
  .message-center-report-body { padding: 13px 13px 16px 17px; }
  .message-center-report-facts { grid-template-columns: 1fr; }
  .message-center-report-executive { grid-template-columns: 1fr; gap: 5px; }
  .message-center-report-content pre { max-height: 420px; padding: 15px; }
  .message-center-report-body > footer { align-items: flex-start; flex-direction: column; gap: 4px; }
}

/* 2026-08-25 记录中心：定期周报 */
.periodic-report-type-tabs .module-tab:disabled {
    opacity: .48;
    cursor: not-allowed;
}

.periodic-report-toolbar-card {
    display: grid;
    grid-template-columns: minmax(320px, 1.2fr) minmax(320px, .8fr);
    gap: 12px 20px;
    align-items: end;
    align-content: start;
    min-height: 0 !important;
    margin-bottom: 12px;
    padding: 18px 22px;
    background:
        radial-gradient(circle at 91% 8%, rgba(61, 117, 255, .12), transparent 32%),
        linear-gradient(135deg, #fff 0%, #f7faff 100%);
    border-color: #dce7f7;
}

.periodic-report-toolbar-copy h2 {
    margin: 2px 0 4px;
    color: #173152;
    font-size: clamp(22px, 2vw, 30px);
}

.periodic-report-toolbar-copy > p:last-child {
    margin: 0;
    color: #71829a;
    line-height: 1.7;
}

.periodic-report-toolbar-controls,
.periodic-report-admin-actions {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.periodic-report-toolbar-controls label,
.periodic-report-admin-actions label {
    display: grid;
    gap: 6px;
    min-width: 190px;
    color: #647892;
    font-size: 13px;
    font-weight: 700;
}

.periodic-report-toolbar-controls select,
.periodic-report-admin-actions input {
    min-height: 42px;
}

.periodic-report-admin-actions {
    grid-column: 1 / -1;
    padding-top: 12px;
    border-top: 1px solid #e6edf7;
}

#periodicReportActionMsg {
    grid-column: 1 / -1;
    margin: -8px 0 0;
    text-align: right;
}

.periodic-report-progress-card {
    display: grid;
    gap: 13px;
    min-height: 0 !important;
    margin-bottom: 14px;
    padding: 20px 24px;
    border-color: #cfe0fb;
    background: linear-gradient(135deg, #fff, #f2f7ff);
}
.periodic-report-progress-card[hidden] { display: none !important; }
.periodic-report-progress-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.periodic-report-progress-head h2 { margin: 2px 0 0; color: #173b70; font-size: 20px; }
.periodic-report-progress-head strong { color: #2468d8; font-size: 24px; }
.periodic-report-progress-track { height: 10px; overflow: hidden; border-radius: 999px; background: #dce9fb; }
.periodic-report-progress-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2a77ef, #6a5cf2); transition: width .35s ease; }
.periodic-report-progress-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.periodic-report-progress-steps span { padding: 7px 9px; border-radius: 9px; background: #edf2f8; color: #8a98aa; text-align: center; font-size: 12px; font-weight: 750; }
.periodic-report-progress-steps span.done { background: #e9f3ff; color: #286bc5; }
.periodic-report-progress-steps span.active { box-shadow: inset 0 0 0 1px #8bb8f4; background: #dcebff; }
#periodicReportProgressMessage { margin: 0; color: #667a94; }

.periodic-report-status {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid #dbe5f2;
    border-radius: 999px;
    background: #f7f9fc;
    color: #61728a;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.periodic-report-status::before {
    width: 8px;
    height: 8px;
    margin-right: 7px;
    border-radius: 50%;
    background: currentColor;
    content: '';
}

.periodic-report-status.status-published { color: #118b63; background: #eefbf6; border-color: #cdeee1; }
.periodic-report-status.status-draft { color: #bd7414; background: #fff8eb; border-color: #f3dfb8; }
.periodic-report-status.status-generating,
.periodic-report-status.is-loading { color: #2872da; background: #eef5ff; border-color: #d5e5ff; }
.periodic-report-status.status-failed { color: #cc4256; background: #fff2f4; border-color: #f4ccd2; }

.periodic-report-settings {
    grid-column: 1 / -1;
    border: 1px solid #dfe8f4;
    border-radius: 16px;
    background: rgba(255, 255, 255, .82);
}

.periodic-report-settings > summary {
    padding: 14px 17px;
    color: #245a9d;
    font-weight: 800;
    cursor: pointer;
}

.periodic-report-settings form {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 14px;
    padding: 16px 18px 18px;
    border-top: 1px solid #e8eef6;
}

.periodic-report-settings form > label:not(.check-line) {
    display: grid;
    gap: 6px;
    color: #63758e;
    font-size: 13px;
    font-weight: 700;
}

.periodic-report-settings .check-line {
    min-height: 44px;
    align-self: end;
    padding: 10px 12px;
    border: 1px solid #e3eaf4;
    border-radius: 12px;
    background: #f9fbfe;
}

.periodic-report-settings .form-msg {
    align-self: center;
    margin: 0;
}

.periodic-report-empty {
    display: grid;
    place-items: center;
    min-height: 230px;
    padding: 34px 24px;
    text-align: center;
}

.periodic-report-empty[hidden] { display: none !important; }
.periodic-report-empty-icon {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    margin-bottom: 12px;
    border-radius: 24px;
    background: linear-gradient(145deg, #e9f2ff, #f6f1ff);
    color: #3e72df;
    font-size: 35px;
}
.periodic-report-empty h2 { margin: 0 0 8px; color: #243b5a; }
.periodic-report-empty p { max-width: 680px; margin: 0; color: #7a8ba2; line-height: 1.75; }

.periodic-report-content[hidden] { display: none !important; }
.periodic-report-content {
    display: grid;
    gap: 18px;
    padding-bottom: 40px;
}

.periodic-report-kpis {
    display: grid;
    grid-template-columns: repeat(6, minmax(135px, 1fr));
    gap: 12px;
}

.periodic-report-kpis > div {
    display: grid;
    gap: 5px;
    min-height: 116px;
    padding: 18px;
    border: 1px solid #dfe8f4;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(41, 75, 126, .055);
}

.periodic-report-kpis span { color: #718299; font-size: 13px; font-weight: 700; }
.periodic-report-kpis b { color: #173e73; font-size: 28px; line-height: 1.1; }
.periodic-report-kpis small { color: #9aa8ba; font-size: 12px; }

.periodic-report-score-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(110px, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid #dfe8f4;
    border-radius: 16px;
    background: #dfe8f4;
}
.periodic-report-score-strip > span {
    display: grid;
    gap: 4px;
    min-height: 76px;
    padding: 14px 16px;
    background: #fff;
}
.periodic-report-score-strip small { color: #8392a6; font-size: 12px; font-weight: 700; }
.periodic-report-score-strip b { color: #274c78; font-size: 19px; }

.periodic-report-conclusion-card,
.periodic-report-quadrant-card,
.periodic-report-operation-card,
.periodic-report-ranking-card { padding: 26px 28px; }

.periodic-report-quadrant-card[hidden] { display: none !important; }
.periodic-report-business-warnings {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: -4px 0 16px;
    padding: 11px 13px;
    border: 1px solid #f0d9a7;
    border-radius: 12px;
    background: #fff9ec;
    color: #916319;
    font-size: 13px;
    line-height: 1.55;
}
.periodic-report-business-warnings[hidden] { display: none !important; }
.periodic-report-business-warnings b { white-space: nowrap; }
.periodic-report-quadrants {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.periodic-quadrant {
    display: grid;
    gap: 9px;
    min-height: 158px;
    padding: 16px;
    border: 1px solid #dfe8f3;
    border-radius: 15px;
    background: linear-gradient(145deg, #fff, #f8fbff);
}
.periodic-quadrant header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.periodic-quadrant header > span { display: grid; gap: 3px; }
.periodic-quadrant header b { color: #2d4563; font-size: 16px; }
.periodic-quadrant header small { color: #8a99ac; }
.periodic-quadrant header em {
    padding: 4px 8px;
    border-radius: 999px;
    background: #edf3fb;
    color: #5c708a;
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
}
.periodic-quadrant-person { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 9px; background: rgba(255,255,255,.82); }
.periodic-quadrant-person b { color: #405671; }
.periodic-quadrant-person span { color: #687b92; font-size: 12px; }
.periodic-quadrant p.empty { margin: 5px 0; color: #a0adbd; }
.periodic-quadrant footer { align-self: end; color: #8190a3; font-size: 12px; }
.periodic-quadrant.is-healthy_scale { border-color: #cfe8dc; background: linear-gradient(145deg, #f4fcf8, #fff); }
.periodic-quadrant.is-healthy_scale header b { color: #0c7a53; }
.periodic-quadrant.is-priority_fix { border-color: #f0d3d7; background: linear-gradient(145deg, #fff6f7, #fff); }
.periodic-quadrant.is-priority_fix header b { color: #c34858; }
.periodic-quadrant.is-growth_opportunity { border-color: #d7e4f7; background: linear-gradient(145deg, #f4f8ff, #fff); }
.periodic-quadrant.is-growth_opportunity header b { color: #2466bc; }
.periodic-quadrant.is-observe_diagnose { border-color: #eadfc7; background: linear-gradient(145deg, #fffaf0, #fff); }
.periodic-quadrant.is-observe_diagnose header b { color: #a46d19; }

.periodic-report-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}
.periodic-report-section-head h2 { margin: 3px 0 0; color: #1c304d; }

.periodic-report-headline {
    margin-bottom: 10px;
    color: #174f98;
    font-size: clamp(20px, 2vw, 27px);
    font-weight: 900;
    letter-spacing: -.02em;
}
.periodic-report-conclusion {
    max-width: 1120px;
    margin: 0;
    color: #4e6078;
    font-size: 15px;
    line-height: 1.9;
    white-space: pre-wrap;
}

.periodic-report-insight-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 22px;
}
.periodic-report-insight-grid > div {
    padding: 18px 20px;
    border: 1px solid #dfe8f4;
    border-radius: 16px;
    background: #f9fbfe;
}
.periodic-report-insight-grid .is-positive { border-color: #d7ede5; background: #f5fcf9; }
.periodic-report-insight-grid .is-risk { border-color: #f0dfd4; background: #fffaf6; }
.periodic-report-insight-grid h3 { margin: 0 0 10px; color: #324963; font-size: 15px; }
.periodic-report-bullet-list ul { display: grid; gap: 8px; margin: 0; padding-left: 20px; color: #52647a; line-height: 1.65; }
.periodic-report-bullet-list.empty { color: #9aa8ba; }

.periodic-report-actions-block { margin-top: 22px; }
.periodic-report-actions-block h3 { margin: 0 0 12px; color: #324963; font-size: 16px; }
.periodic-report-next-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.periodic-report-next-actions article {
    display: flex;
    gap: 12px;
    min-height: 94px;
    padding: 15px;
    border: 1px solid #dce7f5;
    border-radius: 15px;
    background: linear-gradient(145deg, #f7faff, #fff);
}
.periodic-report-next-actions article > span {
    display: grid;
    place-items: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: #e8f1ff;
    color: #2b6dce;
    font-weight: 900;
}
.periodic-report-next-actions article div { display: grid; gap: 7px; }
.periodic-report-next-actions b { color: #2d435f; line-height: 1.55; }
.periodic-report-next-actions small { color: #8291a6; line-height: 1.45; }
.periodic-report-next-actions.empty { color: #9aa8ba; }

.periodic-report-operations { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 26px; }
.periodic-operation-row { display: grid; gap: 7px; }
.periodic-operation-row > div:first-child { display: flex; justify-content: space-between; gap: 14px; }
.periodic-operation-row b { color: #40546c; }
.periodic-operation-row span { color: #8190a4; font-size: 13px; }
.periodic-operation-track { height: 9px; overflow: hidden; border-radius: 999px; background: #edf2f8; }
.periodic-operation-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #3c78e8, #785be8); }

.periodic-report-ranking-head,
.periodic-member-card > summary {
    display: grid;
    grid-template-columns: 52px minmax(150px, 1.7fr) repeat(5, minmax(70px, .55fr)) minmax(82px, .6fr) minmax(76px, .55fr);
    gap: 10px;
    align-items: center;
}
.periodic-report-ranking-head {
    padding: 0 16px 10px;
    color: #8a99ac;
    font-size: 12px;
    font-weight: 700;
}
.periodic-report-ranking-head > span:first-child { grid-column: 1 / 3; }
.periodic-report-content.is-cost-v2 .periodic-report-ranking-head,
.periodic-report-content.is-cost-v2 .periodic-member-card > summary {
    grid-template-columns: 52px minmax(135px, 1.35fr) minmax(90px, .75fr) minmax(100px, .8fr) minmax(135px, 1fr) repeat(5, minmax(66px, .5fr));
}
.periodic-report-members { display: grid; gap: 10px; }
.periodic-member-card {
    overflow: hidden;
    border: 1px solid #dfe7f2;
    border-radius: 16px;
    background: #fff;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.periodic-member-card[open] { border-color: #bfd3ef; box-shadow: 0 12px 28px rgba(41, 77, 130, .08); }
.periodic-member-card > summary {
    min-height: 68px;
    padding: 12px 16px;
    list-style: none;
    cursor: pointer;
}
.periodic-member-card > summary::-webkit-details-marker { display: none; }
.periodic-member-card > summary::after { display: none; }
.periodic-member-rank {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #edf3fb;
    color: #4b6482;
    font-weight: 900;
}
.periodic-member-card.excellent .periodic-member-rank { background: #fff3d7; color: #a96a00; }
.periodic-member-card.stable .periodic-member-rank { background: #e9f8f1; color: #087b55; }
.periodic-member-card.insufficient .periodic-member-rank { background: #f1f3f6; color: #8a96a5; }
.periodic-member-name { display: grid; gap: 3px; min-width: 0; }
.periodic-member-name b { overflow: hidden; color: #243d5c; text-overflow: ellipsis; white-space: nowrap; }
.periodic-member-name small { color: #8a99ac; }
.periodic-member-card > summary > span:not(.periodic-member-rank):not(.periodic-member-name) { color: #5c6f86; text-align: center; }
.periodic-member-card > summary > strong { color: #175eae; font-size: 18px; text-align: center; }
.periodic-member-card > summary > em {
    justify-self: center;
    padding: 5px 9px;
    border-radius: 999px;
    background: #f1f4f8;
    color: #708098;
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
}
.periodic-member-card > summary > em.confidence-high { color: #087a55; background: #e9f8f1; }
.periodic-member-card > summary > em.confidence-medium { color: #aa6905; background: #fff5df; }

.periodic-member-detail {
    display: grid;
    gap: 16px;
    padding: 18px;
    border-top: 1px solid #e7edf5;
    background: #f9fbfe;
}
.periodic-score-group { display: grid; gap: 9px; }
.periodic-score-group h4 { margin: 0; color: #405873; font-size: 13px; }
.periodic-score-group.is-business h4 { color: #147555; }
.periodic-member-score-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.periodic-member-score-grid > div {
    display: grid;
    gap: 4px;
    padding: 13px;
    border: 1px solid #e1e9f4;
    border-radius: 12px;
    background: #fff;
}
.periodic-member-score-grid span { color: #8290a3; font-size: 12px; }
.periodic-member-score-grid b { color: #2b568e; font-size: 19px; }
.periodic-member-score-grid small { color: #9aa6b5; font-size: 11px; }
.periodic-score-group.is-business .periodic-member-score-grid > div { border-color: #d7e9e1; background: #fbfffd; }
.periodic-score-group.is-business .periodic-member-score-grid b { color: #147555; }
.periodic-member-ineligible { margin: 0; padding: 11px 13px; border: 1px solid #ecdcb8; border-radius: 11px; background: #fffaf0; color: #85601e; line-height: 1.55; }
.periodic-member-analysis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.periodic-member-analysis > div { padding: 14px; border: 1px solid #e0e8f3; border-radius: 13px; background: #fff; }
.periodic-member-analysis b { color: #3d536e; }
.periodic-member-analysis p { margin: 7px 0 0; color: #65758a; line-height: 1.6; }
.periodic-member-analysis .is-suggestion { border-color: #cee0f7; background: #f5f9ff; }
.periodic-member-categories { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: #485d76; }
.periodic-member-categories > b { margin-right: 4px; }
.periodic-member-categories > span { padding: 6px 10px; border: 1px solid #dce6f2; border-radius: 999px; background: #fff; color: #60728a; font-size: 12px; }
.periodic-member-categories em { margin-left: 6px; color: #2c6eca; font-style: normal; font-weight: 800; }
.periodic-member-evidence { display: grid; gap: 8px; }
.periodic-member-evidence > div:first-child { display: flex; justify-content: space-between; gap: 12px; color: #40536b; }
.periodic-member-evidence > div:first-child span { color: #8c9aab; font-size: 12px; }
.periodic-member-evidence article { padding: 11px 13px; border: 1px solid #e2e9f2; border-radius: 11px; background: #fff; }
.periodic-member-evidence article span { color: #3971bd; font-size: 12px; font-weight: 800; }
.periodic-member-evidence article p { margin: 5px 0 0; color: #586a7f; line-height: 1.6; white-space: pre-wrap; }
.periodic-report-method-note { margin: 16px 0 0; color: #8b99ab; font-size: 12px; line-height: 1.7; }

@media (max-width: 1180px) {
    .periodic-report-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .periodic-report-score-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .periodic-report-next-actions { grid-template-columns: 1fr; }
    .periodic-report-ranking-card { overflow-x: auto; }
    .periodic-report-ranking-head,
    .periodic-member-card { min-width: 940px; }
    .periodic-report-content.is-cost-v2 .periodic-report-ranking-head,
    .periodic-report-content.is-cost-v2 .periodic-member-card { min-width: 1120px; }
}

@media (max-width: 760px) {
    .periodic-report-toolbar-card { grid-template-columns: 1fr; padding: 18px; }
    .periodic-report-toolbar-controls,
    .periodic-report-admin-actions { justify-content: stretch; }
    .periodic-report-toolbar-controls label,
    .periodic-report-admin-actions label { width: 100%; min-width: 0; }
    .periodic-report-toolbar-controls select,
    .periodic-report-toolbar-controls button,
    .periodic-report-admin-actions button { flex: 1 1 auto; }
    .periodic-report-admin-actions { grid-column: auto; }
    #periodicReportActionMsg { grid-column: auto; text-align: left; }
    .periodic-report-settings { grid-column: auto; }
    .periodic-report-settings form { grid-template-columns: 1fr; }
    .periodic-report-progress-steps { grid-template-columns: 1fr 1fr; }
    .periodic-report-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .periodic-report-score-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .periodic-report-kpis > div { min-height: 98px; padding: 14px; }
    .periodic-report-kpis b { font-size: 23px; }
    .periodic-report-conclusion-card,
    .periodic-report-quadrant-card,
    .periodic-report-operation-card,
    .periodic-report-ranking-card { padding: 18px; }
    .periodic-report-section-head { align-items: flex-start; flex-direction: column; }
    .periodic-report-insight-grid,
    .periodic-report-quadrants,
    .periodic-report-operations { grid-template-columns: 1fr; }
    .periodic-report-ranking-card { overflow: visible; }
    .periodic-report-ranking-head { display: none; }
    .periodic-member-card { min-width: 0; }
    .periodic-report-content.is-cost-v2 .periodic-member-card { min-width: 0; }
    .periodic-member-card > summary {
        grid-template-columns: 52px minmax(0, 1fr);
        gap: 9px 12px;
        padding: 14px;
    }
    .periodic-member-card > summary > span[data-label],
    .periodic-member-card > summary > strong[data-label],
    .periodic-member-card > summary > em[data-label] {
        display: flex;
        align-items: center;
        justify-content: space-between;
        grid-column: auto;
        min-height: 34px;
        padding: 7px 9px;
        border-radius: 9px;
        background: #f5f8fc;
        text-align: right;
    }
    .periodic-member-card > summary > [data-label]::before {
        color: #8a99ac;
        font-size: 11px;
        font-weight: 700;
        content: attr(data-label);
    }
    .periodic-member-card > summary > em[data-label] { justify-self: stretch; }
    .periodic-member-score-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .periodic-member-analysis { grid-template-columns: 1fr; }
    .periodic-member-evidence > div:first-child { flex-direction: column; }
}

/* 20260814: delivery workspace keeps the main distribution page compact. */
.delivery-person-card.is-summary {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 12px;
}

.delivery-person-detail-launcher {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, auto) 26px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 9px 12px;
  border: 1px solid #dbe5f3;
  border-radius: 9px;
  background: linear-gradient(90deg, #f8fbff 0%, #f3f7fd 100%);
  color: #1f2937;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.delivery-person-detail-launcher:hover {
  border-color: #9fc1f6;
  background: #eef5ff;
  box-shadow: 0 7px 18px rgba(37, 99, 235, .08);
}

.delivery-person-detail-launcher-copy {
  display: grid;
  justify-items: end;
  gap: 2px;
  min-width: 0;
  text-align: right;
}

.delivery-person-detail-launcher-copy b {
  color: #195eae;
  font-size: 13px;
}

.delivery-person-detail-launcher-copy small {
  color: #7b8799;
  font-size: 10px;
  font-weight: 500;
}

.delivery-person-detail-launcher > i {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e4efff;
  color: #1d64c4;
  font-size: 15px;
  font-style: normal;
}

.delivery-workspace-backdrop {
  padding: 14px !important;
}

.delivery-workspace-modal {
  display: flex;
  flex-direction: column;
  width: min(1480px, calc(100vw - 28px)) !important;
  height: min(920px, calc(100dvh - 28px));
  max-height: calc(100dvh - 28px) !important;
  padding: 0 !important;
  overflow: hidden !important;
  border-radius: 16px !important;
}

.delivery-workspace-head {
  flex: 0 0 auto;
  margin: 0 !important;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #e5ebf3;
}

.delivery-workspace-head h2 {
  margin: 3px 0 4px;
}

.delivery-workspace-head .subtle {
  margin: 0;
  color: #748197;
  font-size: 12px;
}

.delivery-workspace-tabs {
  display: flex;
  flex: 0 0 auto;
  gap: 5px;
  padding: 12px 24px;
  border-bottom: 1px solid #e7edf5;
  background: #f8fafc;
}

.delivery-workspace-tabs button {
  min-width: 132px;
  min-height: 38px;
  padding: 7px 18px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #5f6e82;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
}

.delivery-workspace-tabs button.active {
  border-color: #c8daf6;
  background: #fff;
  color: #1f65c2;
  box-shadow: 0 2px 7px rgba(15, 23, 42, .07);
}

.delivery-workspace-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 18px 24px 24px;
  overflow: auto;
  background: #f5f8fc;
}

.delivery-workspace-body > section {
  min-width: 0;
}

.delivery-workspace-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid #e0e8f3;
  border-radius: 11px;
  background: #fff;
}

.delivery-workspace-section-head h3,
.delivery-workspace-section-head p {
  margin: 0;
}

.delivery-workspace-section-head h3 {
  color: #172033;
  font-size: 16px;
}

.delivery-workspace-section-head p {
  margin-top: 4px;
  color: #778499;
  font-size: 11px;
}

.delivery-workspace-detail {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.delivery-workspace-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, .92fr);
  align-items: start;
  gap: 18px;
  min-width: 0;
}

.delivery-workspace-main-grid > .delivery-workspace-detail {
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}

.delivery-workspace-hourly {
  position: sticky;
  top: 0;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dce6f3;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(15, 23, 42, .045);
}

.delivery-workspace-hourly-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid #edf1f6;
}

.delivery-workspace-hourly-head p,
.delivery-workspace-hourly-head h3,
.delivery-workspace-hourly-head span,
.delivery-workspace-hourly-head em {
  margin: 0;
}

.delivery-workspace-hourly-head h3 {
  margin-top: 3px;
  color: #172033;
  font-size: 17px;
  line-height: 1.35;
}

.delivery-workspace-hourly-head span {
  display: block;
  margin-top: 4px;
  color: #778499;
  font-size: 11px;
}

.delivery-workspace-hourly-head > em {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: #f0f6ff;
  color: #3973bd;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.delivery-workspace-hourly-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 14px 16px 8px;
}

.delivery-workspace-hourly-kpis > span {
  display: grid;
  align-content: center;
  min-height: 74px;
  padding: 11px 12px;
  border: 1px solid #e3eaf3;
  border-radius: 10px;
  background: #f8fbff;
}

.delivery-workspace-hourly-kpis small,
.delivery-workspace-hourly-kpis b,
.delivery-workspace-hourly-kpis em {
  display: block;
  margin: 0;
}

.delivery-workspace-hourly-kpis small {
  color: #7b889a;
  font-size: 10px;
  font-weight: 650;
}

.delivery-workspace-hourly-kpis b {
  margin-top: 4px;
  color: #185ead;
  font-size: 18px;
  line-height: 1.2;
}

.delivery-workspace-hourly-kpis em {
  margin-top: 2px;
  color: #6f7d91;
  font-size: 10px;
  font-style: normal;
}

.delivery-workspace-hourly-legend {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 8px 18px 2px;
  color: #556479;
  font-size: 10px;
  font-weight: 700;
}

.delivery-workspace-hourly-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.delivery-workspace-hourly-legend i {
  width: 18px;
  height: 3px;
  border-radius: 999px;
}

.delivery-workspace-hourly-legend .is-valid i {
  background: #2f7cf4;
}

.delivery-workspace-hourly-legend .is-revenue i {
  background: #18ad7a;
}

.delivery-workspace-hourly-legend small {
  min-width: 0;
  margin-left: auto;
  color: #97a3b4;
  font-size: 9px;
  font-weight: 500;
  text-align: right;
}

.delivery-workspace-hourly-chart {
  padding: 2px 10px 0;
}

.delivery-workspace-hourly-chart svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 260px;
  overflow: visible;
}

.delivery-workspace-hourly-grid line {
  stroke: #e8eef6;
  stroke-width: 1;
  stroke-dasharray: 4 5;
}

.delivery-workspace-hourly-ylabels text,
.delivery-workspace-hourly-xlabels text {
  fill: #8390a3;
  font-size: 10px;
  font-weight: 600;
}

.delivery-workspace-hourly-ylabels .is-left {
  text-anchor: end;
}

.delivery-workspace-hourly-ylabels .is-right {
  text-anchor: start;
}

.delivery-workspace-hourly-xlabels text {
  text-anchor: middle;
}

.delivery-workspace-hourly-area {
  fill: url(#deliveryWorkspaceValidArea);
}

.delivery-workspace-hourly-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.delivery-workspace-hourly-line.is-valid {
  stroke: #2f7cf4;
}

.delivery-workspace-hourly-line.is-revenue {
  stroke: #18ad7a;
  stroke-width: 2.4;
}

.delivery-workspace-hourly-points circle {
  stroke: #fff;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.delivery-workspace-hourly-points circle.is-valid {
  fill: #2f7cf4;
}

.delivery-workspace-hourly-points circle.is-revenue {
  fill: #18ad7a;
}

.delivery-workspace-hourly-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 15px;
  color: #708096;
  font-size: 9px;
}

.delivery-workspace-hourly-foot > span {
  flex: 0 0 auto;
  font-weight: 700;
}

.delivery-workspace-hourly-foot > small {
  margin-left: auto;
  color: #929eaf;
  font-size: 9px;
  text-align: right;
}

.delivery-workspace-hourly-empty {
  display: grid;
  place-items: center;
  min-height: 390px;
  padding: 36px;
  text-align: center;
}

.delivery-workspace-hourly-empty-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 12px;
  border-radius: 16px;
  background: #edf5ff;
  color: #2f75d3;
  font-size: 27px;
}

.delivery-workspace-hourly-empty b {
  color: #334155;
  font-size: 14px;
}

.delivery-workspace-hourly-empty p {
  max-width: 330px;
  margin: 7px 0 0;
  color: #8290a3;
  font-size: 11px;
  line-height: 1.7;
}

.delivery-workspace-detail .delivery-person-card.is-workspace {
  align-self: start;
  border-radius: 12px;
  box-shadow: 0 5px 18px rgba(15, 23, 42, .045);
}

.delivery-workspace-detail .delivery-person-details.is-workspace-detail {
  margin-top: 14px;
  background: #f6f9fd;
}

.delivery-workspace-detail .delivery-person-details .delivery-assignment-list {
  max-height: none;
}

.delivery-workspace-footer {
  flex: 0 0 auto;
  margin: 0;
  padding: 12px 24px;
  border-top: 1px solid #e4eaf2;
  background: #fff;
}

#deliveryDistributionModal,
#deliveryAssetModal {
  z-index: 1010 !important;
}

.delivery-asset-overview-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(118px, 1fr));
  min-width: min(620px, 54vw);
}

.delivery-asset-overview-metrics > span {
  min-width: 0;
}

.delivery-asset-batchbar {
  display: grid;
  grid-template-columns: minmax(210px, auto) auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 62px;
  padding: 10px 12px;
}

.delivery-asset-select-all {
  gap: 10px;
  min-width: 0;
  font-size: 13px;
}

.delivery-asset-select-all input {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  margin: 0;
}

.delivery-asset-select-all > span,
.delivery-asset-select-all b,
.delivery-asset-select-all small {
  display: block;
}

.delivery-asset-select-all b {
  color: #334155;
  font-size: 13px;
  line-height: 1.25;
}

.delivery-asset-select-all small {
  margin-top: 2px;
  color: #8a96a8;
  font-size: 10px;
  font-weight: 500;
}

.delivery-asset-selected-count {
  padding-left: 14px;
  border-left: 1px solid #e3e9f1;
  color: #64748b;
  font-size: 12px;
  white-space: nowrap;
}

.delivery-asset-selected-count b {
  display: inline;
  margin: 0;
  color: #1f65c2;
  font-size: 14px;
}

.delivery-asset-batch-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  min-width: 0;
}

.delivery-asset-batch-controls select,
.delivery-asset-batch-controls .primary-btn {
  height: 40px;
  min-height: 40px;
  margin: 0;
  font-size: 12px;
  line-height: 1.2;
}

.delivery-asset-batch-controls select {
  width: auto;
  min-width: 156px;
}

.delivery-asset-row-spend {
  min-width: 150px;
}

@media (max-width: 1180px) {
  .delivery-workspace-main-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .delivery-workspace-hourly {
    position: static;
  }

  .delivery-workspace-detail {
    grid-template-columns: 1fr;
  }

  .delivery-asset-overview-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .delivery-asset-overview-metrics {
    width: 100%;
    min-width: 0;
  }

  .delivery-asset-batchbar {
    grid-template-columns: minmax(190px, auto) auto minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .delivery-person-detail-launcher {
    grid-template-columns: minmax(0, 1fr) 26px;
  }

  .delivery-person-detail-launcher-copy {
    grid-column: 1;
    grid-row: 2;
    justify-items: start;
    text-align: left;
  }

  .delivery-person-detail-launcher > i {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .delivery-workspace-backdrop {
    padding: 6px !important;
  }

  .delivery-workspace-modal {
    width: calc(100vw - 12px) !important;
    height: calc(100dvh - 12px);
    max-height: calc(100dvh - 12px) !important;
    border-radius: 13px !important;
  }

  .delivery-workspace-head {
    padding: 15px 16px 12px;
  }

  .delivery-workspace-head .subtle {
    display: none;
  }

  .delivery-workspace-tabs {
    padding: 9px 12px;
  }

  .delivery-workspace-tabs button {
    flex: 1 1 0;
    min-width: 0;
  }

  .delivery-workspace-body {
    padding: 12px;
  }

  .delivery-workspace-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .delivery-workspace-footer {
    padding: 10px 12px;
  }

  .delivery-workspace-main-grid {
    gap: 12px;
  }

  .delivery-workspace-hourly-head {
    padding: 15px 14px 12px;
  }

  .delivery-workspace-hourly-kpis {
    gap: 6px;
    padding: 11px 12px 7px;
  }

  .delivery-workspace-hourly-kpis > span {
    min-height: 66px;
    padding: 9px;
  }

  .delivery-workspace-hourly-kpis b {
    font-size: 15px;
  }

  .delivery-workspace-hourly-legend {
    flex-wrap: wrap;
    padding: 8px 14px 0;
  }

  .delivery-workspace-hourly-legend small {
    width: 100%;
    margin-left: 0;
    text-align: left;
  }

  .delivery-workspace-hourly-chart {
    overflow-x: auto;
  }

  .delivery-workspace-hourly-chart svg {
    width: 680px;
    max-width: none;
  }

  .delivery-workspace-hourly-foot {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 8px 14px 13px;
  }

  .delivery-workspace-hourly-foot > small {
    width: 100%;
    margin-left: 0;
    text-align: left;
  }

  .delivery-asset-overview-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .delivery-asset-batchbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .delivery-asset-batch-controls {
    grid-column: 1 / -1;
    align-items: stretch;
    flex-direction: column;
  }

  .delivery-asset-batch-controls select,
  .delivery-asset-batch-controls .primary-btn {
    width: 100%;
  }
}

/* qingyun-20260812: 常用工具 / 美团链接转换 */
#toolsPanel.common-tools-panel {
  padding-bottom: 42px;
}

#toolsPanel .common-tools-header {
  align-items: center;
  margin-bottom: 18px;
}

#toolsPanel .panel-header-description {
  max-width: 720px;
  margin: 7px 0 0;
  color: #718096;
  font-size: 14px;
  line-height: 1.7;
}

#toolsPanel .common-tools-security {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #ccebdc;
  border-radius: 999px;
  background: #effaf5;
  color: #168052;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

#toolsPanel .common-tools-security i {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #1a9b64;
  color: #fff;
  font-style: normal;
  font-size: 12px;
}

#toolsPanel .common-tools-switch-row {
  justify-content: flex-start;
  margin-bottom: 16px;
}

#toolsPanel .common-tools-tabs {
  flex: 0 1 auto;
  max-width: 100%;
  margin: 0;
}

#toolsPanel .common-tool-pane.module-pane.active {
  display: block !important;
}

#toolsPanel .meituan-tool-card {
  position: relative;
  overflow: hidden;
  padding: 0;
  border: 1px solid #dfe6f1;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(49, 72, 112, .08);
}

#toolsPanel .meituan-tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 320px;
  height: 200px;
  background: radial-gradient(circle at 100% 0, rgba(65, 105, 225, .13), transparent 68%);
  pointer-events: none;
}

#toolsPanel .meituan-tool-intro {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 126px;
  padding: 24px 28px;
  border-bottom: 1px solid #e8edf5;
  background: linear-gradient(135deg, #f9fbff 0%, #f5f8ff 58%, #f0f6ff 100%);
}

#toolsPanel .meituan-tool-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: linear-gradient(145deg, #2d6ee9, #6559ee);
  color: #fff;
  box-shadow: 0 12px 25px rgba(45, 110, 233, .24);
}

#toolsPanel .meituan-tool-icon span {
  font-size: 20px;
  font-weight: 900;
}

#toolsPanel .tool-type-badge {
  display: block;
  margin-bottom: 5px;
  color: #2f6fe4;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
}

#toolsPanel .meituan-tool-intro h2 {
  margin: 0;
  color: #172033;
  font-size: 22px;
  line-height: 1.35;
}

#toolsPanel .meituan-tool-intro p {
  margin: 6px 0 0;
  color: #6d7a91;
  font-size: 14px;
  line-height: 1.65;
}

#toolsPanel .meituan-tool-intro code {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(47, 111, 228, .09);
  color: #275eb8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9em;
}

#toolsPanel .tool-support-tags {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
  max-width: 250px;
}

#toolsPanel .tool-support-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 29px;
  padding: 0 10px;
  border: 1px solid #d7e3f8;
  border-radius: 999px;
  background: rgba(255, 255, 255, .8);
  color: #41638f;
  font-size: 12px;
  font-weight: 800;
}

#toolsPanel .meituan-converter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr);
  align-items: stretch;
  gap: 18px;
  padding: 28px;
}

#toolsPanel .meituan-converter-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#toolsPanel .tool-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 30px;
  margin-bottom: 9px;
}

#toolsPanel .tool-field-head label {
  color: #26334a;
  font-size: 14px;
  font-weight: 850;
}

#toolsPanel .tool-field-head > span {
  color: #8a96a9;
  font-size: 12px;
  white-space: nowrap;
}

#toolsPanel .meituan-converter textarea {
  width: 100%;
  min-height: 210px;
  padding: 16px 17px;
  resize: vertical;
  border: 1px solid #d8e1ee;
  border-radius: 15px;
  outline: 0;
  background: #fbfcfe;
  color: #26334a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.75;
  word-break: break-all;
  overflow-wrap: anywhere;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

#toolsPanel .meituan-converter textarea:hover {
  border-color: #b9c9df;
}

#toolsPanel .meituan-converter textarea:focus {
  border-color: #4b83e8;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(75, 131, 232, .12);
}

#toolsPanel .meituan-converter-column.is-result textarea {
  background: #f5f8ff;
  color: #285da9;
}

#toolsPanel .meituan-converter textarea::placeholder {
  color: #a0aabc;
}

#toolsPanel .tool-field-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: #77859a;
  font-size: 12px;
  line-height: 1.5;
}

#toolsPanel .tool-field-hint > span {
  display: grid;
  place-items: center;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #edf3ff;
  color: #306dd8;
  font-size: 11px;
  font-weight: 900;
}

#toolsPanel .meituan-convert-direction {
  display: grid;
  place-items: center;
  padding-top: 35px;
}

#toolsPanel .meituan-convert-direction span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid #dce5f2;
  border-radius: 50%;
  background: #f7f9fc;
  color: #4e74ae;
  font-size: 20px;
  font-weight: 800;
}

#toolsPanel .meituan-tool-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

#toolsPanel .meituan-tool-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  min-width: 126px;
  min-height: 44px;
  margin: 0;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 850;
}

#toolsPanel .meituan-convert-btn {
  min-width: 164px !important;
  background: linear-gradient(135deg, #2e6fe8, #5b5ce9) !important;
  box-shadow: 0 9px 20px rgba(46, 111, 232, .2);
}

#toolsPanel .meituan-copy-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  box-shadow: none;
}

#toolsPanel .meituan-tool-msg {
  grid-column: 1 / -1;
  min-height: 21px;
  margin: -2px 0 0;
  color: #d14343;
  text-align: right;
  font-size: 13px;
  font-weight: 700;
}

#toolsPanel .meituan-tool-msg.ok {
  color: #168052;
}

#toolsPanel .meituan-tool-notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid #e8edf5;
  background: #fafbfd;
}

#toolsPanel .meituan-tool-notes > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 17px 22px;
  border-right: 1px solid #e8edf5;
}

#toolsPanel .meituan-tool-notes > div:last-child {
  border-right: 0;
}

#toolsPanel .meituan-tool-notes b {
  color: #33435c;
  font-size: 13px;
}

#toolsPanel .meituan-tool-notes span {
  color: #7c899c;
  font-size: 12px;
  line-height: 1.55;
}

@media (max-width: 980px) {
  #toolsPanel .meituan-tool-intro {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  #toolsPanel .meituan-tool-icon {
    width: 52px;
    height: 52px;
  }

  #toolsPanel .tool-support-tags {
    grid-column: 2;
    justify-content: flex-start;
    max-width: none;
  }

  #toolsPanel .meituan-converter {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  #toolsPanel .meituan-convert-direction {
    padding: 0;
  }

  #toolsPanel .meituan-convert-direction span {
    transform: rotate(90deg);
  }
}

@media (max-width: 760px) {
  #toolsPanel.common-tools-panel {
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }

  #toolsPanel .common-tools-header {
    align-items: flex-start !important;
    gap: 12px !important;
    margin-bottom: 12px !important;
  }

  #toolsPanel .panel-header-description {
    font-size: 13px;
  }

  #toolsPanel .common-tools-security {
    min-height: 32px;
    padding: 0 11px;
    font-size: 11px;
  }

  #toolsPanel .common-tools-switch-row {
    margin-bottom: 12px;
  }

  #toolsPanel .common-tools-tabs {
    width: 100%;
  }

  #toolsPanel .common-tools-tabs .module-tab {
    flex: 1 0 auto;
  }

  #toolsPanel .meituan-tool-card {
    border-radius: 18px;
  }

  #toolsPanel .meituan-tool-intro {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 12px;
    min-height: 0;
    padding: 18px 16px;
  }

  #toolsPanel .meituan-tool-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }

  #toolsPanel .meituan-tool-intro h2 {
    font-size: 17px;
  }

  #toolsPanel .meituan-tool-intro p {
    font-size: 12px;
  }

  #toolsPanel .tool-support-tags {
    grid-column: 1 / -1;
  }

  #toolsPanel .tool-support-tags span {
    min-height: 26px;
    padding: 0 8px;
    font-size: 11px;
  }

  #toolsPanel .meituan-converter {
    gap: 13px;
    padding: 18px 14px;
  }

  #toolsPanel .meituan-converter textarea {
    min-height: 150px;
    padding: 13px;
    border-radius: 12px;
    font-size: 12px;
  }

  #toolsPanel .meituan-convert-direction span {
    width: 34px;
    height: 34px;
    font-size: 17px;
  }

  #toolsPanel .meituan-tool-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  #toolsPanel .meituan-tool-actions button {
    width: 100%;
    min-width: 0 !important;
    min-height: 42px;
  }

  #toolsPanel #clearMeituanLinkBtn {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  #toolsPanel .meituan-tool-msg {
    text-align: left;
  }

  #toolsPanel .meituan-tool-notes {
    grid-template-columns: 1fr;
  }

  #toolsPanel .meituan-tool-notes > div {
    padding: 13px 16px;
    border-right: 0;
    border-bottom: 1px solid #e8edf5;
  }

  #toolsPanel .meituan-tool-notes > div:last-child {
    border-bottom: 0;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  color: var(--qy-text);
  background: var(--qy-bg) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI",
    "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif !important;
  font-size: 14px;
  letter-spacing: 0 !important;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
  letter-spacing: 0 !important;
}

button,
select,
input[type="checkbox"],
input[type="radio"] {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.18) !important;
  outline-offset: 1px;
}

[hidden] {
  display: none !important;
}

/* Login and setup */
.login-page {
  min-height: 100%;
  display: grid !important;
  place-items: center;
  padding: 24px;
  background: var(--qy-bg) !important;
}

.login-card {
  width: min(420px, 100%);
  padding: 32px !important;
  border: 1px solid var(--qy-border) !important;
  border-radius: var(--qy-radius) !important;
  background: var(--qy-surface) !important;
  box-shadow: var(--qy-shadow) !important;
}

.login-card h1 {
  margin: 14px 0 8px;
  color: var(--qy-text-strong);
  font-size: 26px;
  line-height: 1.25;
}

.login-card .subtle {
  margin: 0 0 24px;
  color: var(--qy-muted);
  line-height: 1.7;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  background: #ffffff;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.form-stack {
  display: grid;
  gap: 16px;
}

.form-stack label {
  display: grid;
  gap: 7px;
  color: var(--qy-text);
  font-weight: 600;
}

/* App frame */
.app-shell {
  width: 100%;
  height: 100dvh;
  min-height: 0;
  display: grid !important;
  grid-template-columns: var(--qy-sidebar) minmax(0, 1fr) !important;
  gap: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  background: var(--qy-bg) !important;
}

.sidebar {
  position: relative !important;
  inset: auto !important;
  z-index: 30;
  width: var(--qy-sidebar) !important;
  min-width: var(--qy-sidebar);
  height: 100dvh !important;
  display: flex !important;
  flex-direction: column;
  padding: 16px 12px 12px !important;
  overflow: hidden;
  border: 0 !important;
  border-right: 1px solid var(--qy-border) !important;
  border-radius: 0 !important;
  background: var(--qy-surface) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

.side-brand {
  min-height: 48px;
  display: grid !important;
  grid-template-columns: 34px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 10px !important;
  margin: 0 0 12px;
  padding: 0 6px !important;
  border: 0 !important;
}

.side-brand .spark {
  width: 34px !important;
  height: 34px !important;
  display: grid;
  place-items: center;
  border-radius: 8px !important;
  color: #ffffff !important;
  background: var(--qy-blue) !important;
  box-shadow: none !important;
  font-size: 18px !important;
  overflow: hidden;
  background: #ffffff !important;
}

.side-brand .spark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.side-brand strong {
  display: block;
  overflow: hidden;
  color: var(--qy-text-strong);
  font-size: 16px !important;
  line-height: 1.25;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.side-brand span:not(.spark) {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--qy-muted);
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sidebar-toggle,
.mobile-menu-btn,
.icon-btn {
  width: 32px !important;
  height: 32px !important;
  display: inline-grid !important;
  place-items: center;
  padding: 0 !important;
  border: 1px solid transparent !important;
  border-radius: 6px !important;
  color: var(--qy-muted) !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 17px !important;
}

.sidebar-toggle:hover,
.mobile-menu-btn:hover,
.icon-btn:hover {
  color: var(--qy-text);
  background: var(--qy-surface-hover) !important;
}

.side-nav {
  min-height: 0;
  display: flex !important;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 3px !important;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 2px 0 !important;
  scrollbar-width: thin;
}

.nav-item {
  width: 100%;
  min-height: 40px !important;
  display: grid !important;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 7px !important;
  padding: 6px 10px !important;
  border: 0 !important;
  border-radius: 7px !important;
  color: #475569 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.2;
  text-align: left;
}

.nav-item:hover {
  color: var(--qy-text) !important;
  background: var(--qy-surface-hover) !important;
  transform: none !important;
}

.nav-item.active {
  color: #174ea6 !important;
  background: #e8f0fe !important;
}

.nav-icon {
  width: 28px !important;
  height: 28px !important;
  display: grid !important;
  place-items: center;
  color: currentColor;
  font-size: 15px !important;
  line-height: 1;
}

.mobile-label {
  display: none !important;
}

.side-footer {
  flex: 0 0 auto;
  display: grid !important;
  gap: 8px;
  margin-top: 12px;
  padding: 12px 4px 0 !important;
  border-top: 1px solid var(--qy-border);
}

.user-chip {
  min-width: 0;
  display: grid !important;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 9px !important;
  padding: 0 4px !important;
}

.avatar,
.mobile-app-avatar {
  width: 32px !important;
  height: 32px !important;
  display: grid !important;
  place-items: center;
  border-radius: 50% !important;
  color: #ffffff !important;
  background: #168a7a !important;
  font-size: 14px !important;
  font-weight: 700;
}

.user-chip b,
.user-chip small {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.user-chip b {
  color: var(--qy-text);
  font-size: 13px;
}

.user-chip small {
  margin-top: 2px;
  color: var(--qy-muted);
  font-size: 11px;
}

.side-footer > .ghost-btn {
  width: 100%;
  min-height: 34px;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 72px minmax(0, 1fr) !important;
}

body.sidebar-collapsed .sidebar {
  width: 72px !important;
  min-width: 72px;
  padding-inline: 10px !important;
}

body.sidebar-collapsed .side-brand {
  grid-template-columns: 34px;
  grid-template-rows: 34px 32px;
  justify-content: center;
  gap: 4px !important;
  padding: 0 !important;
}

body.sidebar-collapsed .side-brand > div:not(.spark),
body.sidebar-collapsed .desktop-label,
body.sidebar-collapsed .user-chip > div,
body.sidebar-collapsed .side-footer > .ghost-btn {
  display: none !important;
}

body.sidebar-collapsed .side-brand .sidebar-toggle {
  display: inline-grid !important;
}

body.sidebar-collapsed .nav-item {
  grid-template-columns: 1fr;
  padding-inline: 0 !important;
}

body.sidebar-collapsed .nav-icon {
  margin: auto;
}

body.sidebar-collapsed .user-chip {
  grid-template-columns: 32px;
  justify-content: center;
}

.mobile-app-bar,
.mobile-nav-backdrop {
  display: none !important;
}

/* Workspace and panels */
.workspace {
  position: relative !important;
  width: 100%;
  min-width: 0;
  height: 100dvh !important;
  min-height: 0;
  padding: 0 !important;
  overflow: hidden !important;
  background: var(--qy-bg) !important;
}

.panel {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: none !important;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 28px 30px 40px !important;
  background: transparent !important;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.panel.active {
  display: block !important;
}

.panel > * {
  width: 100%;
  max-width: var(--qy-content);
  margin-right: auto;
  margin-left: auto;
}

.panel-header {
  position: static !important;
  inset: auto !important;
  min-height: 70px !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto 20px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.panel-header.compact {
  min-height: 64px !important;
}

.panel-header h1 {
  margin: 2px 0 0 !important;
  color: var(--qy-text-strong) !important;
  font-size: 28px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
}

.panel-header h2 {
  margin: 0;
  color: var(--qy-text-strong);
  font-size: 20px;
}

.eyebrow {
  margin: 0 !important;
  color: var(--qy-blue) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1.4;
  letter-spacing: 0 !important;
  text-transform: uppercase;
}

.config-card,
.table-card,
.summary-section,
.business-section,
.parent-channel-section,
.optimizer-cost-section,
.issue-card,
.announcement-card,
.log-card,
.settings-section,
.permission-overview,
.login-card,
.modal-card {
  border: 1px solid var(--qy-border) !important;
  border-radius: var(--qy-radius) !important;
  background: var(--qy-surface) !important;
  box-shadow: var(--qy-shadow-sm) !important;
  backdrop-filter: none !important;
}

.config-card {
  margin-bottom: 18px !important;
  padding: 18px !important;
}

.table-card {
  padding: 18px !important;
}

.table-head,
.card-head,
.section-head,
.modal-head {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.table-head {
  margin-bottom: 14px;
}

.table-head h2,
.card-head h2,
.section-head h2,
.modal-head h2 {
  margin: 0 !important;
  color: var(--qy-text-strong) !important;
  font-size: 18px !important;
  line-height: 1.35;
}

.pill,
.badge,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px !important;
  border: 0 !important;
  border-radius: 999px !important;
  color: #475569 !important;
  background: #f1f5f9 !important;
  font-size: 12px !important;
  font-weight: 600;
  white-space: nowrap;
}

.empty,
.empty-state {
  min-height: 92px;
  display: grid;
  place-items: center;
  padding: 20px;
  border: 1px dashed var(--qy-border-strong) !important;
  border-radius: 7px !important;
  color: var(--qy-muted) !important;
  background: var(--qy-surface-soft) !important;
}

/* Controls */
label > span,
.field-label {
  color: #475569 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  width: 100%;
  min-height: 40px !important;
  padding: 9px 12px !important;
  border: 1px solid var(--qy-border-strong) !important;
  border-radius: 7px !important;
  color: var(--qy-text) !important;
  background: var(--qy-surface) !important;
  box-shadow: none !important;
  font-size: 14px !important;
}

textarea {
  min-height: 96px;
  line-height: 1.55;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #94a3b8 !important;
  opacity: 1;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #94a3b8 !important;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--qy-blue) !important;
}

button {
  transition: color 0.15s ease, background-color 0.15s ease,
    border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn {
  min-height: 38px !important;
  padding: 8px 14px !important;
  border-radius: 7px !important;
  box-shadow: none !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.2;
}

.primary-btn,
.send-btn {
  border: 1px solid var(--qy-blue) !important;
  color: #ffffff !important;
  background: var(--qy-blue) !important;
}

.primary-btn:hover,
.send-btn:hover {
  border-color: var(--qy-blue-hover) !important;
  background: var(--qy-blue-hover) !important;
}

.secondary-btn {
  border: 1px solid #bfdbfe !important;
  color: #174ea6 !important;
  background: var(--qy-blue-soft) !important;
}

.secondary-btn:hover {
  border-color: #93c5fd !important;
  background: #dbeafe !important;
}

.ghost-btn {
  border: 1px solid var(--qy-border) !important;
  color: #475569 !important;
  background: var(--qy-surface) !important;
}

.ghost-btn:hover {
  color: var(--qy-text) !important;
  background: var(--qy-surface-hover) !important;
}

.danger-btn {
  border: 1px solid #fecaca !important;
  color: var(--qy-red) !important;
  background: var(--qy-red-soft) !important;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed !important;
  opacity: 0.48 !important;
}

.form-msg {
  margin: 0;
  color: var(--qy-muted);
  font-size: 12px;
}

.form-msg.success,
.success {
  color: var(--qy-green) !important;
}

.form-msg.error,
.error {
  color: var(--qy-red) !important;
}

/* Shared tabs */
.section-switch-row {
  min-height: 48px !important;
  display: flex !important;
  align-items: center;
  gap: 12px !important;
  margin: 0 auto 16px !important;
  padding: 4px !important;
  overflow-x: auto;
  border: 1px solid var(--qy-border) !important;
  border-radius: var(--qy-radius) !important;
  background: var(--qy-surface) !important;
  box-shadow: var(--qy-shadow-sm) !important;
  scrollbar-width: none;
  justify-content: flex-start !important;
}

.section-switch-row::-webkit-scrollbar,
.hub-tabs::-webkit-scrollbar,
.module-tabs::-webkit-scrollbar,
.quick-date-tabs::-webkit-scrollbar,
.quick-actions::-webkit-scrollbar {
  display: none;
}

.hub-tabs,
.module-tabs {
  display: flex !important;
  align-items: center;
  gap: 4px !important;
  flex: 0 0 auto;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  justify-content: flex-start !important;
  width: auto !important;
}

.module-tabs {
  flex: 0 0 auto !important;
  margin-left: 2px;
  padding-left: 10px !important;
  border-left: 1px solid var(--qy-border) !important;
}

.hub-tab,
.module-tab {
  min-height: 38px !important;
  padding: 8px 14px !important;
  border: 0 !important;
  border-radius: 6px !important;
  color: #64748b !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  white-space: nowrap;
}

.hub-tab:hover,
.module-tab:hover {
  color: var(--qy-text) !important;
  background: var(--qy-surface-hover) !important;
}

.hub-tab.active,
.module-tab.active {
  color: #174ea6 !important;
  background: #e8f0fe !important;
}

.date-shortcuts,
.quick-date-tabs {
  display: flex !important;
  grid-column: 1 / -1;
  align-items: center;
  gap: 6px !important;
  overflow-x: auto;
  padding: 0 !important;
}

.date-shortcuts button,
.quick-date-tabs button {
  min-height: 32px !important;
  padding: 6px 11px !important;
  border: 1px solid var(--qy-border) !important;
  border-radius: 999px !important;
  color: #475569 !important;
  background: var(--qy-surface) !important;
  box-shadow: none !important;
  font-size: 12px !important;
  font-weight: 700;
  white-space: nowrap;
}

.date-shortcuts button.active,
.quick-date-tabs button.active,
.date-shortcuts button:hover,
.quick-date-tabs button:hover {
  border-color: #93c5fd !important;
  color: #174ea6 !important;
  background: var(--qy-blue-soft) !important;
}

/* Shared filter toolbars */
.records-toolbar {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(125px, 1fr)) auto;
  align-items: end;
  gap: 14px !important;
}

.records-toolbar > label {
  min-width: 0;
  display: grid !important;
  gap: 7px;
}

.business-insights-toolbar,
.optimizer-cost-toolbar {
  grid-template-columns: repeat(3, minmax(180px, 1fr)) auto !important;
}

.summary-toolbar {
  grid-template-columns: repeat(5, minmax(150px, 1fr)) auto !important;
}

.logs-toolbar {
  grid-template-columns: repeat(4, minmax(160px, 1fr)) auto !important;
}

.issue-toolbar {
  grid-template-columns: repeat(3, minmax(180px, 1fr)) auto !important;
}

.toolbar-actions {
  display: flex !important;
  align-items: center;
  gap: 8px !important;
}

#announcementsPanel > .panel-header {
  align-items: center !important;
}

#announcementsPanel > .panel-header > .primary-btn {
  flex: 0 0 auto;
}

#announcementsPanel .announcement-toolbar {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 16px !important;
}

#announcementsPanel .announcement-toolbar h2,
#announcementsPanel .announcement-toolbar p {
  margin: 0 !important;
}

#announcementsPanel .announcement-toolbar p {
  margin-top: 4px !important;
  color: var(--qy-muted);
}

#announcementsPanel .announcement-toolbar .toolbar-actions {
  justify-content: flex-end;
}

#announcementsPanel .announcement-toolbar > .form-msg {
  grid-column: 1 / -1;
}

.records-toolbar > .form-msg,
.records-toolbar > .sync-range-note {
  grid-column: 1 / -1;
}

/* KPIs and data cards */
.optimizer-cost-kpis,
.business-kpis,
.summary-kpis,
.parent-channel-kpis,
.monitor-kpis {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 12px !important;
  margin-bottom: 18px !important;
}

.business-insights-meta {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 10px !important;
  margin-bottom: 14px !important;
}

.business-insights-meta > span {
  min-width: 0;
  min-height: 64px;
  display: grid !important;
  align-content: center;
  gap: 4px;
  padding: 11px 13px !important;
  border: 1px solid var(--qy-border) !important;
  border-radius: var(--qy-radius) !important;
  background: var(--qy-surface) !important;
}

.business-insights-meta b,
.business-insights-meta em {
  display: block;
  overflow-wrap: anywhere;
  font-style: normal;
}

.business-insights-meta b {
  color: var(--qy-muted);
  font-size: 11px;
  font-weight: 600;
}

.business-insights-meta em {
  color: var(--qy-text);
  font-size: 12px;
  font-weight: 700;
}

.business-insights-grid {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

.insight-kpi-card {
  grid-column: span 1 !important;
  min-width: 0;
  min-height: 116px !important;
  display: grid !important;
  align-content: center;
  gap: 7px;
  margin: 0 !important;
  padding: 16px !important;
}

.insight-kpi-card span,
.insight-kpi-card em {
  display: block;
  color: var(--qy-muted) !important;
  font-size: 12px !important;
  font-style: normal;
}

.insight-kpi-card b {
  color: var(--qy-text-strong) !important;
  font-size: 26px !important;
  line-height: 1.15;
}

.insight-rank-card {
  grid-column: 1 / -1;
  margin: 0 !important;
}

.optimizer-cost-kpi,
.business-kpi,
.summary-kpi,
.parent-channel-kpi,
.monitor-kpi,
.metric-card,
.stat-card {
  min-width: 0;
  min-height: 116px !important;
  padding: 16px !important;
  border: 1px solid var(--qy-border) !important;
  border-radius: var(--qy-radius) !important;
  background: var(--qy-surface) !important;
  box-shadow: var(--qy-shadow-sm) !important;
}

.optimizer-cost-kpi span,
.business-kpi span,
.summary-kpi span,
.parent-channel-kpi span,
.metric-card span,
.stat-card span {
  display: block;
  color: var(--qy-muted) !important;
  font-size: 12px !important;
  font-weight: 600;
}

.optimizer-cost-kpi strong,
.business-kpi strong,
.summary-kpi strong,
.parent-channel-kpi strong,
.metric-card strong,
.stat-card strong {
  display: block;
  margin-top: 8px;
  color: var(--qy-text-strong) !important;
  font-size: 26px !important;
  line-height: 1.15;
}

.optimizer-cost-top3,
.ranking-grid,
.user-list,
.announcement-list,
.issue-list,
.logs-list,
.records-list {
  display: grid !important;
  gap: 10px !important;
}

.optimizer-cost-top3 {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.optimizer-card,
.ranking-card,
.record-card,
.user-card,
.announcement-item,
.issue-item,
.log-item {
  min-width: 0;
  padding: 16px !important;
  border: 1px solid var(--qy-border) !important;
  border-radius: var(--qy-radius) !important;
  background: var(--qy-surface) !important;
  box-shadow: none !important;
}

.optimizer-card:hover,
.ranking-card:hover,
.record-card:hover,
.user-card:hover {
  border-color: #bfdbfe !important;
  background: #fbfdff !important;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--qy-text);
}

th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--qy-border);
  color: #64748b;
  background: var(--qy-surface-soft);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

td {
  padding: 12px;
  border-bottom: 1px solid var(--qy-border);
  font-size: 13px;
  vertical-align: middle;
}

tbody tr:hover td {
  background: #fbfdff;
}

.table-scroll,
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--qy-border);
  border-radius: var(--qy-radius);
}

.records-result-head {
  min-height: 40px;
}

.records-title-line {
  display: flex !important;
  align-items: center;
  gap: 10px;
}

.records-title-line h2 {
  margin: 0;
}

.select-all-line {
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  color: var(--qy-muted);
  font-size: 13px;
}

.pager {
  min-height: 44px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px !important;
  margin-top: 14px !important;
  padding: 4px !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.pager:empty {
  display: none !important;
}

.pager button {
  min-width: 34px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--qy-border) !important;
  border-radius: 6px !important;
  color: #475569;
  background: var(--qy-surface) !important;
}

.pager button:hover {
  border-color: #93c5fd !important;
  color: #174ea6;
  background: var(--qy-blue-soft) !important;
}

/* Settings and management */
.settings-grid,
.user-config-layout,
.permission-layout {
  display: grid !important;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 2fr) !important;
  align-items: start;
  gap: 18px !important;
}

.settings-section,
.permission-overview {
  padding: 18px !important;
}

.row.two-cols {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px !important;
}

.row.three-cols {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px !important;
}

/* Embedded products */
#signDeductPanel,
#hourlyMonitorPanel {
  padding: 0 !important;
  overflow: hidden !important;
}

#signDeductPanel.active,
#hourlyMonitorPanel.active {
  display: flex !important;
  flex-direction: column;
}

#signDeductPanel > .sign-deduct-shell,
#hourlyMonitorPanel > .hourly-monitor-shell {
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  min-height: 0 !important;
  flex: 1 1 auto;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--qy-surface) !important;
  box-shadow: none !important;
}

.sign-deduct-native-host,
#signDeductFrame,
#hourlyMonitorFrame {
  width: 100% !important;
  min-width: 0;
  flex: 1 1 auto;
  height: 100% !important;
  min-height: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--qy-surface) !important;
  box-shadow: none !important;
}

.sign-deduct-native-host {
  display: block;
  overflow: auto;
  overscroll-behavior: contain;
}

.sign-deduct-native-error {
  margin: 24px;
  padding: 18px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: #fef2f2;
  color: #b91c1c;
  font-weight: 700;
}

/* Chat layout */
#chatPanel {
  position: relative;
  overflow: hidden !important;
  padding: 20px 28px 16px !important;
}

#chatPanel.active {
  display: flex !important;
  flex-direction: column;
  gap: 0;
}

#chatPanel > .panel-header,
#chatPanel > .sync-panel-wrap,
#chatPanel > .chat-capture-grid,
#chatPanel > .quick-actions,
#chatPanel > .chat-messages,
#chatPanel > .chat-pager,
#chatPanel > .composer {
  width: min(100%, var(--qy-chat)) !important;
  max-width: var(--qy-chat) !important;
  margin-right: auto !important;
  margin-left: auto !important;
}

#chatPanel > .panel-header {
  flex: 0 0 auto;
  min-height: 56px !important;
  margin-bottom: 10px !important;
}

#chatPanel > .panel-header h1 {
  font-size: 24px !important;
}

.sync-panel-wrap {
  flex: 0 0 auto;
  margin-bottom: 10px !important;
  border: 1px solid #bfdbfe !important;
  border-radius: var(--qy-radius) !important;
  background: var(--qy-blue-soft) !important;
  box-shadow: none !important;
}

.sync-toggle-btn {
  width: 100%;
  min-height: 44px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 8px 14px !important;
  border: 0 !important;
  border-radius: 7px !important;
  color: #174ea6 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 14px !important;
  font-weight: 700;
}

.sync-toggle-btn small {
  color: var(--qy-muted);
  font-size: 11px;
}

.sync-toolbar {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 12px !important;
  padding: 14px !important;
  border-top: 1px solid #bfdbfe;
}

.sync-panel-wrap.collapsed .sync-toolbar {
  display: none !important;
}

.sync-toolbar label {
  display: grid;
  gap: 7px;
}

.sync-range-note,
.sync-progress,
.sync-msg,
.sync-detail {
  grid-column: 1 / -1;
}

.chat-capture-grid {
  flex: 0 0 auto;
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 10px !important;
  margin-bottom: 10px !important;
}

.chat-announcement-card,
.record-helper-card {
  min-height: 0 !important;
  padding: 10px !important;
  overflow: hidden;
  border: 1px solid var(--qy-border) !important;
  border-radius: var(--qy-radius) !important;
  background: var(--qy-surface) !important;
  box-shadow: var(--qy-shadow-sm) !important;
}

.chat-announcement-preview {
  min-height: 54px !important;
  padding: 10px 12px !important;
  border: 0 !important;
  border-left: 3px solid #f4b400 !important;
  border-radius: 5px !important;
  color: var(--qy-text);
  background: var(--qy-amber-soft) !important;
}

.chat-announcement-preview.empty {
  display: grid;
  place-items: center;
  border: 1px dashed var(--qy-border) !important;
  color: var(--qy-muted);
  background: var(--qy-surface-soft) !important;
}

.chat-optimizer-podium {
  min-height: 62px;
}

.record-template-grid {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

.fill-action,
.quick-actions button {
  min-height: 36px !important;
  padding: 7px 11px !important;
  border: 1px solid var(--qy-border) !important;
  border-radius: 7px !important;
  color: #174ea6 !important;
  background: var(--qy-surface) !important;
  box-shadow: none !important;
  font-size: 12px !important;
  font-weight: 700;
  white-space: nowrap;
}

.fill-action:hover,
.quick-actions button:hover {
  border-color: #93c5fd !important;
  background: var(--qy-blue-soft) !important;
}

.quick-actions {
  flex: 0 0 auto;
  min-height: 44px !important;
  display: flex !important;
  align-items: center;
  gap: 7px !important;
  margin-bottom: 6px !important;
  padding: 4px 0 !important;
  overflow-x: auto;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  scrollbar-width: none;
}

.quick-actions-title {
  flex: 0 0 auto;
  color: var(--qy-muted);
  font-size: 12px !important;
  font-weight: 700;
  white-space: nowrap;
}

.mobile-quick-title {
  display: none;
}

.chat-messages {
  position: relative !important;
  inset: auto !important;
  width: 100%;
  min-height: 0 !important;
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column;
  gap: 18px !important;
  margin: 0 auto !important;
  padding: 14px 6px 18px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.message {
  width: 100%;
  display: flex !important;
  align-items: flex-end;
  gap: 10px !important;
  margin: 0 !important;
}

.message.user {
  justify-content: flex-end;
}

.message-avatar {
  width: 32px !important;
  height: 32px !important;
  flex: 0 0 32px;
  display: grid !important;
  place-items: center;
  border: 1px solid var(--qy-border) !important;
  border-radius: 50% !important;
  color: #ffffff !important;
  background: var(--qy-blue) !important;
  box-shadow: none !important;
  font-size: 11px !important;
  font-weight: 800;
}

.message.user .message-avatar {
  order: 2;
  color: #ffffff !important;
  background: #168a7a !important;
}

.bubble {
  width: fit-content;
  max-width: min(82%, 760px) !important;
  padding: 12px 15px !important;
  overflow-wrap: anywhere;
  border: 1px solid var(--qy-border) !important;
  border-radius: 8px !important;
  color: var(--qy-text) !important;
  background: var(--qy-surface) !important;
  box-shadow: var(--qy-shadow-sm) !important;
  font-size: 14px !important;
  line-height: 1.65 !important;
}

.message.user .bubble {
  border-color: #bfdbfe !important;
  color: #16315c !important;
  background: #eaf2ff !important;
}

.message.welcome-message .bubble {
  color: #475569 !important;
  background: var(--qy-surface-soft) !important;
}

.chat-pager {
  position: absolute !important;
  right: 0 !important;
  bottom: 76px !important;
  left: 0 !important;
  z-index: 5;
  width: min(520px, calc(100% - 64px)) !important;
  min-height: 40px;
  margin: 0 auto !important;
  pointer-events: auto;
}

#chatPanel > .chat-pager {
  display: none !important;
}

.chat-pager:empty {
  display: none !important;
}

.composer {
  position: relative !important;
  inset: auto !important;
  z-index: 10 !important;
  flex: 0 0 auto !important;
  min-height: 58px !important;
  display: grid !important;
  grid-template-columns: 88px minmax(0, 1fr) auto 42px 44px !important;
  align-items: center;
  gap: 8px !important;
  margin: 0 auto !important;
  padding: 7px 8px 7px 10px !important;
  overflow: visible !important;
  border: 1px solid var(--qy-border-strong) !important;
  border-radius: 8px !important;
  background: var(--qy-surface) !important;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.12) !important;
}

.composer .mode-select {
  min-width: 0;
  min-height: 40px !important;
  padding: 6px 8px !important;
  border: 0 !important;
  border-right: 1px solid var(--qy-border) !important;
  border-radius: 0 !important;
  color: var(--qy-text) !important;
  background: transparent !important;
  font-size: 13px !important;
  font-weight: 700;
}

.composer textarea {
  min-width: 0;
  min-height: 40px !important;
  max-height: 128px;
  padding: 9px 4px !important;
  resize: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  line-height: 1.5;
  box-shadow: none !important;
}

.web-search-toggle {
  min-width: 68px;
  min-height: 36px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 8px !important;
  border: 1px solid var(--qy-border) !important;
  border-radius: 6px !important;
  color: var(--qy-muted) !important;
  background: var(--qy-surface-soft) !important;
  font-size: 12px !important;
  font-weight: 700;
  white-space: nowrap;
}

.web-search-toggle:has(input:checked) {
  border-color: #93c5fd !important;
  color: #174ea6 !important;
  background: #dbeafe !important;
}

.web-search-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.voice-input-btn,
.send-btn {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  display: grid !important;
  place-items: center;
  padding: 0 !important;
  border-radius: 50% !important;
  box-shadow: none !important;
  font-size: 0 !important;
}

.voice-input-btn {
  border: 1px solid var(--qy-border-strong) !important;
  background: var(--qy-surface) !important;
}

.voice-input-btn > span {
  width: 13px;
  height: 19px;
  display: block;
  border: 2px solid var(--qy-text);
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  border-bottom: 0;
}

.send-btn::before {
  content: "↑";
  color: #ffffff;
  font-size: 23px;
  line-height: 1;
}

.voice-status {
  position: absolute !important;
  right: 12px;
  bottom: calc(100% + 10px);
  left: auto !important;
  min-height: 36px;
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 8px 12px !important;
  border: 1px solid #bfdbfe !important;
  border-radius: 7px !important;
  color: #174ea6;
  background: var(--qy-surface) !important;
  box-shadow: var(--qy-shadow) !important;
  font-size: 12px;
}

.voice-wave {
  height: 16px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.voice-wave i {
  width: 2px;
  height: 6px;
  border-radius: 2px;
  background: var(--qy-blue);
  animation: qy-wave 0.8s ease-in-out infinite alternate;
}

.voice-wave i:nth-child(2),
.voice-wave i:nth-child(4) {
  animation-delay: 0.15s;
}

.voice-wave i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes qy-wave {
  to {
    height: 16px;
  }
}

/* Modals */
.modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1000 !important;
  display: grid !important;
  place-items: center;
  padding: 20px;
  overflow: auto;
  background: rgba(15, 23, 42, 0.48) !important;
  backdrop-filter: blur(2px);
  pointer-events: auto !important;
}

.modal-backdrop[hidden] {
  display: none !important;
  pointer-events: none !important;
}

.modal-card {
  width: min(720px, 100%);
  max-height: min(88dvh, 860px);
  padding: 22px !important;
  overflow: auto;
}

.modal-head {
  margin-bottom: 18px;
}

.modal-actions {
  display: flex !important;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

@media (min-width: 761px) {
  #chatPanel.panel.active {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100dvh !important;
    min-height: 0 !important;
    gap: 0 !important;
    padding: 20px 28px 16px !important;
    overflow: hidden !important;
  }

  #chatPanel > .panel-header,
  #chatPanel:not(.has-chat) > .panel-header,
  #chatPanel.has-chat > .panel-header {
    display: none !important;
  }

  #chatPanel:not(.has-chat) > .chat-messages,
  #chatPanel.has-chat > .chat-messages {
    position: relative !important;
    inset: auto !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    width: min(100%, var(--qy-chat)) !important;
    max-width: var(--qy-chat) !important;
    min-height: 0 !important;
    flex: 1 1 auto !important;
    display: flex !important;
    margin: 0 auto !important;
    padding: 14px 6px 18px !important;
    overflow-y: auto !important;
    transform: none !important;
  }

  #chatPanel:not(.has-chat) > form.composer,
  #chatPanel.has-chat > form.composer,
  #chatPanel > form.composer {
    position: relative !important;
    inset: auto !important;
    flex: 0 0 auto !important;
    width: min(100%, var(--qy-chat)) !important;
    max-width: var(--qy-chat) !important;
    min-height: 58px !important;
    height: auto !important;
    display: grid !important;
    grid-template-columns: 88px minmax(0, 1fr) 68px 42px 44px !important;
    gap: 8px !important;
    margin: 0 auto !important;
    padding: 7px 8px 7px 10px !important;
    overflow: visible !important;
    transform: none !important;
    border: 1px solid var(--qy-border-strong) !important;
    border-radius: 8px !important;
    background: var(--qy-surface) !important;
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.12) !important;
  }

  #chatPanel > form.composer .mode-select {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 40px !important;
    height: 40px !important;
    padding: 6px 8px !important;
    border: 0 !important;
    border-right: 1px solid var(--qy-border) !important;
    border-radius: 0 !important;
  }

  #chatPanel > form.composer textarea {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 40px !important;
    max-height: 128px !important;
    padding: 9px 4px !important;
    border: 0 !important;
    background: transparent !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
  }

  #chatPanel > form.composer .web-search-toggle {
    width: 68px !important;
    min-width: 68px !important;
    height: 36px !important;
    min-height: 36px !important;
    border-radius: 6px !important;
  }

  #chatPanel > form.composer .voice-input-btn,
  #chatPanel > form.composer .send-btn {
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
  }
}

/* 20260811: external delayed-deduction dashboard embed. */
#signDeductPanel.sign-deduct-panel,
#hourlyMonitorPanel.hourly-monitor-panel {
  padding: 16px !important;
  background:
    radial-gradient(circle at 4% 0%, rgba(47, 111, 235, .09), transparent 28%),
    var(--qy-bg, #f5f7fb) !important;
}

#signDeductPanel > .sign-deduct-shell.sign-deduct-external-shell,
#hourlyMonitorPanel > .hourly-monitor-shell.hourly-monitor-external-shell {
  display: flex !important;
  flex-direction: column;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden;
  border: 1px solid #d8e1ee !important;
  border-radius: 16px !important;
  background: #fff !important;
  box-shadow: 0 14px 38px rgba(15, 23, 42, .09) !important;
}

.sign-deduct-embed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  gap: 18px;
  min-height: 82px;
  padding: 14px 18px;
  border-bottom: 1px solid #e7ecf3;
  background: linear-gradient(120deg, #fff 0%, #f7faff 100%);
}

.sign-deduct-embed-title {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.sign-deduct-embed-icon {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(135deg, #2f6feb, #6547ef);
  box-shadow: 0 8px 20px rgba(47, 111, 235, .24);
  color: #fff;
  font-size: 22px;
  font-weight: 850;
}

.hourly-monitor-embed-icon {
  background: linear-gradient(135deg, #0891b2, #16a34a);
  box-shadow: 0 8px 20px rgba(8, 145, 178, .24);
}

.sign-deduct-embed-title > div {
  min-width: 0;
}

.sign-deduct-embed-title .eyebrow {
  margin: 0 0 2px;
  font-size: 10px;
}

.sign-deduct-embed-title h1 {
  margin: 0;
  color: #172033;
  font-size: 20px;
  line-height: 1.2;
}

.sign-deduct-embed-title div > span {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: #718096;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sign-deduct-open-link {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 13px !important;
  text-decoration: none;
  white-space: nowrap;
}

.sign-deduct-frame-wrap {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: #f7f9fc;
}

#signDeductFrame.sign-deduct-frame {
  display: block;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  flex: 1 1 auto;
  border: 0 !important;
  background: #fff !important;
}

#hourlyMonitorFrame.hourly-monitor-frame {
  display: block;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  flex: 1 1 auto;
  border: 0 !important;
  background: #fff !important;
}

.sign-deduct-external-shell .sign-deduct-loading {
  background: linear-gradient(160deg, rgba(255, 255, 255, .98), rgba(242, 247, 255, .98));
}

@media (max-width: 760px) {
  #signDeductPanel.sign-deduct-panel,
  #hourlyMonitorPanel.hourly-monitor-panel {
    padding: 8px !important;
  }

  #signDeductPanel > .sign-deduct-shell.sign-deduct-external-shell,
  #hourlyMonitorPanel > .hourly-monitor-shell.hourly-monitor-external-shell {
    border-radius: 12px !important;
  }

  .sign-deduct-embed-head {
    min-height: 68px;
    gap: 10px;
    padding: 10px 12px;
  }

  .sign-deduct-embed-icon {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border-radius: 10px;
    font-size: 18px;
  }

  .sign-deduct-embed-title h1 {
    font-size: 17px;
  }

  .sign-deduct-embed-title div > span,
  .sign-deduct-embed-title .eyebrow {
    display: none;
  }

  .sign-deduct-open-link {
    min-height: 34px;
    padding: 6px 9px !important;
    font-size: 11px !important;
  }
}

/* 2026-08-11: 系统配置收口为“列表浏览 + 弹窗编辑” */
#usersPanel .account-management-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding: 20px 22px;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff 0%, #f7faff 100%);
}

#usersPanel .account-management-copy,
#usersPanel .account-management-actions,
#usersPanel .user-row-identity,
#usersPanel .user-badges,
#usersPanel .user-card-actions {
  display: flex;
  align-items: center;
}

#usersPanel .account-management-copy {
  min-width: 0;
  gap: 14px;
}

#usersPanel .account-management-copy h2,
#usersPanel .account-management-copy p {
  margin: 0;
}

#usersPanel .account-management-copy h2 {
  color: #172033;
  font-size: 19px;
  line-height: 1.35;
}

#usersPanel .account-management-copy p {
  margin-top: 4px;
  color: #778196;
  font-size: 13px;
  line-height: 1.55;
}

#usersPanel .account-management-actions {
  flex: 0 0 auto;
  gap: 10px;
}

.settings-card-icon {
  display: inline-flex;
  flex: 0 0 48px;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  color: #1d5fc7;
  background: #eaf2ff;
  box-shadow: inset 0 0 0 1px rgba(64, 125, 218, .1);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.settings-card-icon.mimo-icon {
  color: #6d42d8;
  background: #f1edff;
}

.settings-card-icon.tencent-icon {
  color: #137568;
  background: #e9f8f4;
}

.settings-card-icon.business-icon {
  color: #a45a0c;
  background: #fff4df;
}

.settings-card-icon.database-icon {
  color: #536176;
  background: #eef2f7;
}

#usersPanel .table-card {
  padding: 22px;
  border-radius: 18px;
}

#usersPanel .user-table-head {
  align-items: center;
  margin-bottom: 18px;
}

#usersPanel .user-table-head h2 {
  margin: 0;
  color: #172033;
  font-size: 18px;
}

#usersPanel .user-tools {
  justify-content: flex-end;
}

#usersPanel .user-tools input,
#usersPanel .user-tools select,
#usersPanel .user-tools button {
  min-height: 40px;
  border-radius: 10px;
  font-size: 13px;
}

#usersPanel .user-tools .user-search-input {
  width: min(300px, 32vw);
}

#usersPanel .users-list {
  gap: 10px;
}

#usersPanel .user-row.user-card {
  gap: 10px;
  padding: 15px 16px;
  border: 1px solid #e6ebf3;
  border-radius: 14px;
  background: #fff;
  box-shadow: none;
}

#usersPanel .user-row.user-card:hover {
  border-color: #cad8ec;
  box-shadow: 0 8px 22px rgba(48, 77, 120, .08);
}

#usersPanel .user-card-head {
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 14px;
}

#usersPanel .user-row-identity {
  min-width: 0;
  gap: 12px;
}

#usersPanel .user-card-avatar {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  font-size: 14px;
}

#usersPanel .user-row-main {
  min-width: 0;
}

#usersPanel .user-row-main b,
#usersPanel .user-row-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#usersPanel .user-row-main b {
  color: #1d2a3d;
  font-size: 14px;
  line-height: 1.4;
}

#usersPanel .user-row-main span {
  margin-top: 2px;
  color: #8a94a6;
  font-size: 12px;
}

#usersPanel .user-badges,
#usersPanel .user-card-actions {
  gap: 7px;
}

#usersPanel .role-badge,
#usersPanel .status-badge,
#usersPanel .user-permission-summary span {
  min-height: 25px;
  margin: 0;
  padding: 3px 9px;
  border: 0;
  font-size: 11px;
  font-weight: 700;
}

#usersPanel .user-card-actions button {
  min-height: 36px;
  padding: 0 13px;
  border-radius: 9px;
  font-size: 12px;
}

#usersPanel .user-permission-summary {
  gap: 6px;
  padding-left: 54px;
}

#usersPanel .user-permission-summary span {
  color: #687386;
  background: #f2f5f9;
}

/* 模型与接口首页 */
#settingsPanel .settings-hub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

#settingsPanel .settings-option-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto 24px;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 104px;
  padding: 20px;
  border: 1px solid #e3e9f2;
  border-radius: 18px;
  color: #172033;
  background: #fff;
  box-shadow: 0 5px 18px rgba(53, 75, 111, .05);
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

#settingsPanel .settings-option-card:hover {
  border-color: #b9cceb;
  box-shadow: 0 12px 28px rgba(47, 82, 134, .1);
  transform: translateY(-2px);
}

#settingsPanel .settings-option-card:focus-visible {
  outline: 3px solid rgba(51, 109, 229, .18);
  outline-offset: 2px;
}

#settingsPanel .settings-option-copy {
  display: block;
  min-width: 0;
}

#settingsPanel .settings-option-copy b,
#settingsPanel .settings-option-copy small {
  display: block;
}

#settingsPanel .settings-option-copy b {
  color: #172033;
  font-size: 16px;
  line-height: 1.4;
}

#settingsPanel .settings-option-copy small {
  margin-top: 5px;
  color: #7a8599;
  font-size: 12px;
  line-height: 1.5;
}

#settingsPanel .settings-option-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  color: #6f7a8c;
  background: #f1f4f8;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

#settingsPanel .settings-option-status.is-ready {
  color: #117350;
  background: #e8f7f0;
}

#settingsPanel .settings-option-status.is-warning {
  color: #9a5b0b;
  background: #fff3dd;
}

#settingsPanel .settings-option-status.is-neutral {
  color: #596579;
  background: #edf1f6;
}

#settingsPanel .settings-option-arrow {
  color: #9aa5b5;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  text-align: right;
}

/* 账号、头像与设置弹窗 */
#usersPanel .modal-backdrop,
#settingsPanel .modal-backdrop {
  padding: 28px;
  background: rgba(24, 34, 51, .46);
  backdrop-filter: blur(4px);
}

#usersPanel .modal-card,
#settingsPanel .modal-card {
  border: 1px solid rgba(213, 221, 233, .96);
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(20, 32, 52, .24);
}

#usersPanel .modal-head,
#settingsPanel .modal-head {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid #edf0f5;
}

#usersPanel .modal-head h2,
#settingsPanel .modal-head h2 {
  color: #172033;
  font-size: 21px;
  line-height: 1.35;
}

#usersPanel .modal-head .eyebrow,
#settingsPanel .modal-head .eyebrow {
  margin: 0 0 4px;
  font-size: 10px;
  letter-spacing: .1em;
}

#usersPanel .modal-subtitle,
#settingsPanel .modal-subtitle {
  margin: 5px 0 0;
  color: #7b8698;
  font-size: 12px;
  line-height: 1.5;
}

#usersPanel .modal-head .icon-btn,
#settingsPanel .modal-head .icon-btn {
  flex: 0 0 36px;
  border-color: #e4e9f0;
}

#usersPanel .user-permission-modal {
  width: min(1040px, 100%);
  max-height: calc(100vh - 56px);
  padding: 22px 24px 0;
  overflow: hidden;
}

#usersPanel .user-edit-modal-form {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: calc(100vh - 174px);
  margin: 0;
  padding: 0;
  border: 0;
}

#usersPanel .user-edit-modal-body {
  display: grid;
  gap: 14px;
  padding: 0 2px 18px;
  overflow: auto;
  overscroll-behavior: contain;
}

#usersPanel .user-edit-section,
#usersPanel .permission-block,
#usersPanel .permission-scope {
  padding: 16px;
  border: 1px solid #e5eaf2;
  border-radius: 14px;
  background: #f9fbfd;
}

#usersPanel .user-edit-section-head,
#usersPanel .permission-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

#usersPanel .user-edit-section-head {
  margin-bottom: 14px;
}

#usersPanel .user-edit-section-head h3,
#usersPanel .user-edit-section-head p {
  margin: 0;
}

#usersPanel .user-edit-section-head h3 {
  color: #243147;
  font-size: 15px;
}

#usersPanel .user-edit-section-head p {
  margin-top: 3px;
  color: #8690a1;
  font-size: 12px;
}

#usersPanel .permission-grid {
  gap: 14px;
}

#usersPanel .permission-dependency-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #cfe0fb;
  border-radius: 12px;
  background: #f4f8ff;
  color: #60708a;
  font-size: 12px;
  line-height: 1.6;
}

#usersPanel .permission-dependency-note b {
  flex: 0 0 auto;
  color: #1d5cb5;
}

#usersPanel .permission-block {
  min-width: 0;
}

#usersPanel .permission-checks {
  max-height: 230px;
  padding-right: 4px;
  overflow: auto;
}

#usersPanel .permission-checks .check-line {
  margin: 0;
  padding: 7px 8px;
  border-radius: 8px;
  background: #fff;
}

#usersPanel .permission-checks .check-line:hover {
  background: #eef4ff;
}

#usersPanel .permission-scope {
  grid-template-columns: minmax(190px, 250px) minmax(0, 1fr);
}

#usersPanel .user-edit-modal-form.scope-self .visible-user-checks,
#usersPanel .user-edit-modal-form.scope-all .visible-user-checks {
  opacity: .45;
  pointer-events: none;
}

#usersPanel .user-edit-modal-form.scope-custom .visible-user-checks {
  opacity: 1;
  pointer-events: auto;
}

#usersPanel .optimizer-rank-scope {
  grid-template-columns: minmax(190px, 250px) minmax(0, 1fr);
  border-color: #cfe0fb;
  background: linear-gradient(145deg, #f8fbff, #f3f7ff);
}

#usersPanel .optimizer-rank-scope-copy {
  grid-column: 1 / -1;
  display: grid;
  gap: 3px;
  padding-bottom: 11px;
  border-bottom: 1px solid #dce8fa;
}

#usersPanel .optimizer-rank-scope-copy b {
  color: #174ea6;
  font-size: 15px;
}

#usersPanel .optimizer-rank-scope-copy span {
  color: #6d7f99;
  font-size: 12px;
  line-height: 1.55;
}

#usersPanel .optimizer-rank-user-checks {
  grid-column: 1 / -1;
  min-width: 0;
}

#usersPanel .permission-checks.optimizer-rank-users {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  max-height: 420px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#usersPanel .optimizer-rank-scope [hidden] { display: none !important; }
#usersPanel .rank-product-hint { margin: 6px 0 12px; color: #6d7f99; font-size: 12px; line-height: 1.6; }
#usersPanel .rank-owner-card { min-width: 0; padding: 12px; border: 1px solid #dce6f5; border-radius: 10px; background: #fff; }
#usersPanel .rank-owner-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#usersPanel .rank-owner-head > label { min-width: 0; flex: 1; }
#usersPanel .rank-owner-head select { width: 116px; min-width: 0; min-height: 36px; padding: 6px 8px; font-size: 12px; flex: 0 0 116px; }
#usersPanel .rank-owner-head select:disabled { opacity: .5; }
#usersPanel .rank-product-checks { display: grid; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #edf1f7; }
#usersPanel .rank-owner-card .check-line { padding: 0; border: 0; background: none; min-height: 28px; }
#usersPanel .rank-owner-card .check-line span { overflow-wrap: anywhere; }
#usersPanel .rank-owner-card input[type="checkbox"] { width: 16px; height: 16px; min-height: 16px; flex: 0 0 16px; }
@media (max-width: 720px) {
  #usersPanel .permission-checks.optimizer-rank-users { grid-template-columns: minmax(0, 1fr); }
}

#usersPanel .avatar-settings-modal {
  width: min(620px, 100%);
}

#usersPanel .create-user-modal {
  width: min(640px, 100%);
}

.avatar-editor {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid #e4eaf3;
  border-radius: 14px;
  background: #f8faff;
}

.avatar-editor-preview,
.user-editor-avatar {
  display: inline-flex;
  flex: 0 0 54px;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  overflow: hidden;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, #3575ed, #6550e9);
  font-size: 15px;
  font-weight: 800;
}

.avatar-editor-preview img,
.user-editor-avatar img,
#usersPanel .user-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-editor-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.avatar-editor-copy b,
.avatar-editor-copy span {
  display: block;
}

.avatar-editor-copy b {
  color: #26334a;
  font-size: 14px;
}

.avatar-editor-copy span {
  margin-top: 4px;
  color: #808b9e;
  font-size: 12px;
  line-height: 1.45;
}

.avatar-picker-button {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  overflow: hidden;
  border: 1px solid #cbd8eb;
  border-radius: 10px;
  color: #235fbd;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.avatar-picker-button:hover {
  border-color: #8fb1e4;
  background: #f2f7ff;
}

.avatar-picker-button input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

#usersPanel .compact-avatar-editor {
  margin-bottom: 14px;
}

#usersPanel .user-modal-avatar {
  margin-bottom: 14px;
  padding: 12px 14px;
}

#usersPanel .user-edit-modal-form label > span,
#usersPanel .create-user-modal label > span,
#settingsPanel .settings-modal-form label > span {
  margin-bottom: 7px;
  color: #596579;
  font-size: 12px;
  font-weight: 700;
}

#usersPanel .user-edit-modal-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
#usersPanel .user-edit-modal-form select,
#usersPanel .create-user-modal input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
#usersPanel .create-user-modal select,
#settingsPanel .settings-modal-form input:not([type="checkbox"]):not([type="radio"]),
#settingsPanel .settings-modal-form select {
  min-height: 42px;
  border-radius: 10px;
  font-size: 13px;
}

#usersPanel .modal-form-actions,
#settingsPanel .modal-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 0;
  padding: 15px 0 18px;
  border-top: 1px solid #edf0f5;
  background: #fff;
}

#usersPanel .modal-form-actions button,
#settingsPanel .modal-form-actions button {
  min-width: 92px;
  min-height: 40px;
  border-radius: 10px;
  font-size: 13px;
}

#usersPanel .user-edit-modal-form > .form-msg,
#settingsPanel .settings-modal-form > .form-msg {
  margin: 0;
  padding: 8px 0 0;
}

#settingsPanel .settings-editor-modal {
  width: min(760px, 100%);
  max-height: calc(100vh - 56px);
  padding: 22px 24px 0;
  overflow: hidden;
}

#settingsPanel .settings-editor-modal.business-settings-modal {
  width: min(980px, 100%);
}

#settingsPanel .settings-modal-form {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: calc(100vh - 174px);
  margin: 0;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

#settingsPanel .modal-settings-grid {
  display: block;
}

#settingsPanel .settings-subsection {
  padding: 0 2px 18px;
  border: 0;
  background: transparent;
}

#settingsPanel .settings-subsection[hidden] {
  display: none !important;
}

#settingsPanel .settings-subsection > h3 {
  margin: 0 0 14px;
  color: #28354a;
  font-size: 14px;
}

#settingsPanel .settings-subsection > label,
#settingsPanel .settings-subsection > .row,
#settingsPanel .business-settings-modal .settings-modal-form > label,
#settingsPanel .business-settings-modal .settings-modal-form > .row,
#settingsPanel .business-settings-modal .settings-modal-form > section {
  margin-bottom: 14px;
}

#settingsPanel .business-settings-modal .settings-modal-form {
  padding: 0 2px;
}

#settingsPanel .business-auto-sync-panel {
  padding: 16px;
  border: 1px solid #e5eaf2;
  border-radius: 14px;
  background: #f8faff;
}

#settingsPanel .database-settings-modal {
  width: min(660px, 100%);
}

#settingsPanel .database-config-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

#settingsPanel .database-config-summary > div {
  padding: 14px;
  border: 1px solid #e5eaf2;
  border-radius: 12px;
  background: #f8faff;
}

#settingsPanel .database-config-summary span,
#settingsPanel .database-config-summary b {
  display: block;
}

#settingsPanel .database-config-summary span {
  color: #8a94a5;
  font-size: 11px;
}

#settingsPanel .database-config-summary b {
  margin-top: 5px;
  color: #28354a;
  font-size: 13px;
}

#settingsPanel .compact-code {
  overflow: auto;
  line-height: 1.8;
}

@media (max-width: 980px) {
  #usersPanel .user-card-head {
    grid-template-columns: minmax(200px, 1fr) auto;
  }

  #usersPanel .user-card-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  #usersPanel .user-permission-summary {
    padding-left: 0;
  }

  #settingsPanel .settings-hub-grid {
    grid-template-columns: 1fr;
  }

  #settingsPanel .auto-sync-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  #usersPanel .account-management-bar,
  #usersPanel .table-card {
    padding: 16px;
  }

  #usersPanel .account-management-bar,
  #usersPanel .user-table-head {
    align-items: stretch;
    flex-direction: column;
  }

  #usersPanel .account-management-actions,
  #usersPanel .user-tools {
    width: 100%;
  }

  #usersPanel .account-management-actions > *,
  #usersPanel .user-tools > * {
    flex: 1 1 130px;
  }

  #usersPanel .user-tools .user-search-input {
    width: 100%;
    flex-basis: 100%;
  }

  #usersPanel .user-card-head {
    grid-template-columns: 1fr;
  }

  #usersPanel .user-badges,
  #usersPanel .user-card-actions {
    justify-content: flex-start;
  }

  #usersPanel .user-card-actions button {
    flex: 1 1 120px;
  }

  #settingsPanel .settings-option-card {
    grid-template-columns: 44px minmax(0, 1fr) 20px;
    min-height: 92px;
    padding: 16px;
  }

  #settingsPanel .settings-option-card .settings-card-icon {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  #settingsPanel .settings-option-status {
    grid-column: 2;
    justify-self: start;
    margin-top: -4px;
  }

  #settingsPanel .settings-option-arrow {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  #usersPanel .modal-backdrop,
  #settingsPanel .modal-backdrop {
    padding: 10px;
  }

  #usersPanel .modal-card,
  #settingsPanel .modal-card,
  #usersPanel .user-permission-modal,
  #settingsPanel .settings-editor-modal {
    width: 100%;
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    padding: 18px 16px 0;
    border-radius: 18px;
  }

  #usersPanel .user-edit-modal-form,
  #settingsPanel .settings-modal-form {
    max-height: calc(100vh - 142px);
    max-height: calc(100dvh - 142px);
  }

  #usersPanel .permission-grid,
  #usersPanel .permission-scope,
  #usersPanel .user-edit-modal-form .row,
  #settingsPanel .settings-modal-form .row,
  #settingsPanel .auto-sync-grid,
  #settingsPanel .database-config-summary {
    grid-template-columns: 1fr;
  }

  #usersPanel .optimizer-rank-scope-copy,
  #usersPanel .optimizer-rank-user-checks {
    grid-column: auto;
  }

  #usersPanel .permission-checks,
  #usersPanel .permission-checks.visible-users,
  #usersPanel .permission-checks.optimizer-rank-users {
    grid-template-columns: 1fr;
  }

  .avatar-editor {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .avatar-editor-copy {
    min-width: calc(100% - 70px);
  }

  .avatar-picker-button {
    width: 100%;
  }

  #usersPanel .modal-form-actions,
  #settingsPanel .modal-form-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
  }
}

/* 20260811: delivery assignment fields and interactive mind-map overview. */
.delivery-distribution-form .field-tip {
  display: block;
  margin-top: 7px;
  color: #718096;
  font-size: 12px;
  font-weight: 500;
}

.delivery-mindmap {
  overflow: hidden;
  border: 1px solid #dce3ee;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(15, 23, 42, .05);
}

.delivery-map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #edf1f6;
}

.delivery-map-toolbar > div:first-child {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.delivery-map-toolbar b {
  color: #172033;
  font-size: 16px;
}

.delivery-map-toolbar span {
  color: #718096;
  font-size: 12px;
}

.delivery-map-toolbar-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.delivery-map-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 20px 0;
}

.delivery-map-legend span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
}

.delivery-map-legend .is-category {
  background: #eaf2ff;
  color: #1757b8;
}

.delivery-map-legend .is-product {
  background: #f1ecff;
  color: #6d45b5;
}

.delivery-map-legend .is-platform {
  background: #fff3df;
  color: #a45a05;
}

.delivery-map-legend .is-person {
  background: #e9f8ef;
  color: #16794a;
}

.delivery-map-scroll {
  overflow: auto;
  padding: 20px;
  scrollbar-width: thin;
}

.delivery-map-canvas {
  display: grid;
  grid-template-columns: minmax(190px, 220px) minmax(560px, 1fr);
  align-items: start;
  gap: 42px;
  min-width: 790px;
}

.delivery-map-root,
.delivery-map-node,
.delivery-map-person {
  border: 1px solid #dce3ee;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .06);
}

.delivery-map-root {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 84px;
  padding: 14px;
  border-color: #b9cef7;
  background: linear-gradient(135deg, #edf4ff 0%, #fff 76%);
  color: #172033;
  cursor: pointer;
  text-align: left;
}

.delivery-map-root::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -43px;
  width: 42px;
  border-top: 2px solid #b9c8dd;
}

.delivery-map-root-icon {
  display: grid;
  width: 42px;
  height: 42px;
  grid-row: 1 / 3;
  place-items: center;
  border-radius: 12px;
  background: #2f6feb;
  color: #fff;
  font-size: 17px;
  font-weight: 850;
}

.delivery-map-root > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.delivery-map-root b,
.delivery-map-root small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-map-root b {
  font-size: 15px;
}

.delivery-map-root small {
  color: #64748b;
  font-size: 11px;
}

.delivery-map-root > strong {
  grid-column: 2;
  color: #1558b0;
  font-size: 13px;
}

.delivery-map-root:hover,
.delivery-map-person:hover,
.delivery-map-drill:hover {
  border-color: #8eb2f4;
  box-shadow: 0 7px 20px rgba(47, 111, 235, .12);
}

.delivery-map-root:focus-visible,
.delivery-map-person:focus-visible,
.delivery-map-drill:focus-visible,
.delivery-map-branch > summary:focus-visible {
  outline: 3px solid rgba(47, 111, 235, .22);
  outline-offset: 2px;
}

.delivery-map-branches,
.delivery-map-children {
  position: relative;
  display: grid;
  gap: 10px;
}

.delivery-map-branches {
  padding-left: 28px;
}

.delivery-map-branches::before {
  content: "";
  position: absolute;
  top: 31px;
  bottom: 31px;
  left: 0;
  border-left: 2px solid #b9c8dd;
}

.delivery-map-branch {
  position: relative;
  min-width: 0;
}

.delivery-map-branch::before {
  content: "";
  position: absolute;
  top: 30px;
  left: -28px;
  width: 28px;
  border-top: 2px solid #b9c8dd;
}

.delivery-map-branch > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  list-style: none;
  cursor: pointer;
}

.delivery-map-branch > summary::-webkit-details-marker {
  display: none;
}

.delivery-map-node {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 60px;
  padding: 10px 30px 10px 12px;
  border-left-width: 4px;
}

.delivery-map-branch > summary .delivery-map-node::after {
  content: "›";
  position: absolute;
  top: 50%;
  right: 10px;
  color: #8190a5;
  font-size: 18px;
  line-height: 1;
  transform: translateY(-50%);
  transition: transform .18s ease;
}

.delivery-map-branch[open] > summary .delivery-map-node::after {
  transform: translateY(-50%) rotate(90deg);
}

.delivery-map-category > summary .delivery-map-node {
  border-left-color: #2f6feb;
  background: #f7faff;
}

.delivery-map-product > summary .delivery-map-node {
  border-left-color: #8b5cf6;
  background: #fbf9ff;
}

.delivery-map-platform > summary .delivery-map-node {
  border-left-color: #f59e0b;
  background: #fffaf2;
}

.delivery-map-node-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  background: #eaf2ff;
  color: #1757b8;
  font-size: 12px;
  font-weight: 850;
}

.delivery-map-product > summary .delivery-map-node-icon {
  background: #f1ecff;
  color: #6d45b5;
}

.delivery-map-platform > summary .delivery-map-node-icon {
  background: #fff0d5;
  color: #a45a05;
}

.delivery-map-node-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.delivery-map-node-copy b,
.delivery-map-node-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-map-node-copy b {
  color: #243247;
  font-size: 13px;
}

.delivery-map-node-copy small {
  color: #718096;
  font-size: 11px;
}

.delivery-map-node > strong {
  color: #1558b0;
  font-size: 12px;
  white-space: nowrap;
}

.delivery-map-drill {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid #d8e2f1;
  border-radius: 8px;
  background: #fff;
  color: #255da8;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.delivery-map-children {
  margin: 10px 0 4px 22px;
  padding-left: 32px;
  border-left: 2px solid #d6dfec;
}

.delivery-map-children > .delivery-map-branch::before,
.delivery-map-children > .delivery-map-person::before {
  left: -32px;
  width: 32px;
  border-color: #d6dfec;
}

.delivery-map-people {
  gap: 8px;
}

.delivery-map-person {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 54px;
  padding: 9px 11px;
  color: #243247;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.delivery-map-person::before {
  content: "";
  position: absolute;
  top: 50%;
  border-top: 2px solid #d6dfec;
}

.delivery-map-person-avatar {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  margin: 0 !important;
  font-size: 12px !important;
}

.delivery-map-person > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.delivery-map-person b,
.delivery-map-person small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-map-person b {
  font-size: 12px;
}

.delivery-map-person small {
  color: #718096;
  font-size: 10px;
}

.delivery-map-person > strong {
  color: #16794a;
  font-size: 11px;
  white-space: nowrap;
}

.delivery-map-person > em {
  color: #255da8;
  font-size: 10px;
  font-style: normal;
  font-weight: 750;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .delivery-map-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .delivery-map-toolbar-actions {
    width: 100%;
  }

  .delivery-map-toolbar-actions button {
    flex: 1 1 0;
  }

  .delivery-map-scroll {
    padding: 14px;
  }

  .delivery-map-canvas {
    grid-template-columns: 1fr;
    gap: 18px;
    min-width: 0;
  }

  .delivery-map-root::after {
    top: 100%;
    right: auto;
    left: 29px;
    width: 0;
    height: 20px;
    border-top: 0;
    border-left: 2px solid #b9c8dd;
  }

  .delivery-map-branches {
    padding-left: 18px;
  }

  .delivery-map-children {
    margin-left: 8px;
    padding-left: 20px;
  }

  .delivery-map-children > .delivery-map-branch::before,
  .delivery-map-children > .delivery-map-person::before {
    left: -20px;
    width: 20px;
  }

  .delivery-map-node {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .delivery-map-node > strong {
    grid-column: 2;
  }

  .delivery-map-person {
    grid-template-columns: 32px minmax(0, 1fr) auto;
  }

  .delivery-map-person > em {
    display: none;
  }
}

/* Medium desktop */
@media (max-width: 1180px) and (min-width: 761px) {
  :root {
    --qy-sidebar: 200px;
  }

  .panel {
    padding: 24px 20px 36px !important;
  }

  .records-toolbar,
  .business-insights-toolbar,
  .optimizer-cost-toolbar,
  .summary-toolbar,
  .logs-toolbar,
  .issue-toolbar {
    grid-template-columns: repeat(2, minmax(180px, 1fr)) !important;
  }

  .toolbar-actions {
    grid-column: 1 / -1;
  }

  .settings-grid,
  .user-config-layout,
  .permission-layout {
    grid-template-columns: 1fr !important;
  }
}

/* Mobile */
@media (max-width: 760px) {
  :root {
    --qy-chat: 100%;
  }

  html,
  body {
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .app-shell,
  body.sidebar-collapsed .app-shell {
    display: block !important;
    height: 100dvh;
  }

  .mobile-app-bar {
    position: fixed !important;
    top: 0;
    right: 0;
    left: 0;
    z-index: 80;
    height: 62px;
    display: grid !important;
    grid-template-columns: 42px minmax(0, 1fr) 36px;
    align-items: center;
    gap: 10px;
    padding: max(8px, env(safe-area-inset-top)) 14px 8px !important;
    border-bottom: 1px solid var(--qy-border);
    background: rgba(255, 255, 255, 0.96) !important;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(12px);
  }

  .mobile-menu-btn {
    width: 40px !important;
    height: 40px !important;
  }

  .mobile-app-title {
    min-width: 0 !important;
  }

  .mobile-app-title strong,
  .mobile-app-title span {
    display: block !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
  }

  .mobile-app-title strong {
    color: var(--qy-text-strong) !important;
    font-size: 16px !important;
    line-height: 1.2 !important;
  }

  .mobile-app-title span {
    margin-top: 2px !important;
    color: var(--qy-muted) !important;
    font-size: 11px !important;
  }

  .mobile-app-avatar {
    width: 34px !important;
    height: 34px !important;
  }

  .mobile-menu-lines,
  .mobile-menu-lines::before,
  .mobile-menu-lines::after {
    width: 20px;
    height: 2px;
    display: block;
    border-radius: 2px;
    background: var(--qy-text);
  }

  .mobile-menu-lines {
    position: relative;
  }

  .mobile-menu-lines::before,
  .mobile-menu-lines::after {
    position: absolute;
    left: 0;
    content: "";
  }

  .mobile-menu-lines::before {
    top: -6px;
  }

  .mobile-menu-lines::after {
    top: 6px;
  }

  .mobile-app-title {
    min-width: 0;
  }

  .mobile-app-title strong,
  .mobile-app-title span {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .mobile-app-title strong {
    color: var(--qy-text-strong);
    font-size: 16px;
    line-height: 1.2;
  }

  .mobile-app-title span {
    margin-top: 2px;
    color: var(--qy-muted);
    font-size: 11px;
  }

  .mobile-app-avatar {
    width: 34px !important;
    height: 34px !important;
  }

  .mobile-nav-backdrop {
    position: fixed !important;
    inset: 0 !important;
    z-index: 85 !important;
    display: block !important;
    background: rgba(15, 23, 42, 0.4) !important;
  }

  .mobile-nav-backdrop[hidden] {
    display: none !important;
  }

  .sidebar,
  body.sidebar-collapsed .sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 90 !important;
    width: min(82vw, 300px) !important;
    min-width: min(82vw, 300px) !important;
    height: 100dvh !important;
    padding: 14px 12px !important;
    transform: translateX(-104%);
    transition: transform 0.2s ease;
    box-shadow: 18px 0 40px rgba(15, 23, 42, 0.18) !important;
  }

  body.mobile-nav-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-collapsed .side-brand {
    grid-template-columns: 34px minmax(0, 1fr) 32px;
    justify-content: initial;
  }

  body.sidebar-collapsed .side-brand > div:not(.spark),
  body.sidebar-collapsed .side-brand .sidebar-toggle,
  body.sidebar-collapsed .desktop-label,
  body.sidebar-collapsed .user-chip > div,
  body.sidebar-collapsed .side-footer > .ghost-btn {
    display: block !important;
  }

  body.sidebar-collapsed .side-brand .sidebar-toggle {
    display: inline-grid !important;
  }

  body.sidebar-collapsed .nav-item {
    grid-template-columns: 28px minmax(0, 1fr);
    padding: 6px 10px !important;
  }

  body.sidebar-collapsed .nav-icon {
    margin: 0;
  }

  body.sidebar-collapsed .user-chip {
    grid-template-columns: 32px minmax(0, 1fr);
    justify-content: initial;
  }

  .desktop-label {
    display: none !important;
  }

  .mobile-label {
    display: block !important;
  }

  .workspace {
    height: 100dvh !important;
  }

  .panel {
    height: 100dvh !important;
    padding: 78px 12px 28px !important;
    overscroll-behavior: contain;
  }

  .workspace > .panel.active {
    padding: calc(70px + env(safe-area-inset-top)) 12px calc(84px + env(safe-area-inset-bottom)) !important;
  }

  .workspace > #recordsPanel.panel.active,
  .workspace > #summaryPanel.panel.active,
  .workspace > #businessInsightsPanel.panel.active,
  .workspace > #parentChannelInsightsPanel.panel.active,
  .workspace > #optimizerCostPanel.panel.active,
  .workspace > #announcementsPanel.panel.active,
  .workspace > #issueReportsPanel.panel.active,
  .workspace > #usersPanel.panel.active,
  .workspace > #settingsPanel.panel.active,
  .workspace > #logsPanel.panel.active {
    padding: calc(70px + env(safe-area-inset-top)) 10px calc(84px + env(safe-area-inset-bottom)) !important;
  }

  .panel-header,
  .panel-header.compact {
    min-height: 54px !important;
    margin-bottom: 12px !important;
  }

  .panel-header h1 {
    font-size: 23px !important;
  }

  .eyebrow {
    font-size: 10px !important;
  }

  .section-switch-row {
    position: relative !important;
    top: auto !important;
    min-height: 46px !important;
    gap: 4px !important;
    margin-bottom: 10px !important;
    overflow-x: auto;
    border-radius: 7px !important;
  }

  .hub-tab,
  .module-tab {
    min-height: 36px !important;
    padding: 7px 11px !important;
    font-size: 12px !important;
  }

  .module-tabs {
    flex: 0 0 auto;
  }

  .config-card {
    padding: 14px !important;
  }

  .table-card {
    padding: 14px !important;
  }

  .records-toolbar,
  .business-insights-toolbar,
  .optimizer-cost-toolbar,
  .summary-toolbar,
  .logs-toolbar,
  .issue-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .records-toolbar > label,
  .records-toolbar > .operation-filter-label,
  .records-toolbar > .toolbar-actions,
  .records-toolbar > .form-msg {
    grid-column: 1 / -1;
  }

  .records-toolbar > label:has(input[type="date"]) {
    grid-column: auto;
  }

  .toolbar-actions > button {
    flex: 1 1 0;
  }

  .optimizer-cost-kpis,
  .business-kpis,
  .summary-kpis,
  .parent-channel-kpis,
  .monitor-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .business-insights-meta,
  .business-insights-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .optimizer-cost-kpi,
  .business-kpi,
  .summary-kpi,
  .parent-channel-kpi,
  .metric-card,
  .stat-card {
    min-height: 94px !important;
    padding: 13px !important;
  }

  .optimizer-cost-kpi strong,
  .business-kpi strong,
  .summary-kpi strong,
  .parent-channel-kpi strong,
  .metric-card strong,
  .stat-card strong {
    font-size: 21px !important;
  }

  .optimizer-cost-top3,
  .ranking-grid {
    grid-template-columns: 1fr !important;
  }

  .settings-grid,
  .user-config-layout,
  .permission-layout,
  .row.two-cols,
  .row.three-cols {
    grid-template-columns: 1fr !important;
  }

  .table-scroll,
  .table-wrap {
    max-width: 100%;
    overflow-x: auto;
  }

  .table-head,
  .card-head,
  .section-head {
    align-items: flex-start !important;
  }

  .records-result-head {
    flex-wrap: wrap;
  }

  .records-title-line {
    min-width: 0;
    flex-wrap: wrap;
  }

  .pager {
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    min-width: 0;
    margin-top: 12px !important;
  }

  /* Mobile chat */
  #chatPanel.panel.active {
    padding: calc(56px + env(safe-area-inset-top)) 0 0 !important;
  }

  #chatPanel > .panel-header,
  #chatPanel > .sync-panel-wrap,
  #chatPanel > .chat-capture-grid {
    display: none !important;
  }

  #chatPanel > .quick-actions,
  #chatPanel > .chat-messages,
  #chatPanel > .composer {
    width: 100% !important;
    max-width: 100% !important;
  }

  .quick-actions {
    position: relative !important;
    z-index: 4;
    min-height: 50px !important;
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    margin: 0 !important;
    padding: 7px 12px !important;
    border-bottom: 1px solid var(--qy-border) !important;
    background: var(--qy-surface) !important;
  }

  .quick-actions-title {
    position: static !important;
    height: auto !important;
    min-width: auto !important;
    margin: 0 !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    transform: none !important;
  }

  .desktop-quick-title {
    display: none;
  }

  .mobile-quick-title {
    display: inline;
  }

  .quick-actions button {
    min-height: 34px !important;
    padding: 6px 10px !important;
    color: #475569 !important;
    background: var(--qy-surface-hover) !important;
  }

  .mobile-optimizer-rank-strip:not([hidden]) {
    display: flex !important;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    height: 34px !important;
    margin: 0 !important;
    line-height: 1.2 !important;
    transform: none !important;
  }

  #chatPanel > .quick-actions .quick-actions-title {
    position: static !important;
    display: inline-flex !important;
    align-items: center !important;
    min-width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    transform: none !important;
  }

  #chatPanel > .quick-actions .mobile-optimizer-rank-strip:not([hidden]) {
    position: static !important;
    display: flex !important;
    align-items: center !important;
    min-width: 0 !important;
    width: 100% !important;
    height: 34px !important;
    margin: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    line-height: 1.2 !important;
    transform: none !important;
  }

  #chatPanel > .quick-actions .mobile-optimizer-rank-strip.empty {
    min-height: 34px !important;
    padding: 0 2px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    text-align: left !important;
  }

  .chat-messages {
    gap: 16px !important;
    margin: 0 auto !important;
    padding: 16px 12px 12px !important;
  }

  .message {
    gap: 7px !important;
  }

  .message-avatar {
    width: 28px !important;
    height: 28px !important;
    flex-basis: 28px;
    font-size: 9px !important;
  }

  .bubble {
    max-width: calc(100% - 38px) !important;
    padding: 10px 12px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
  }

  .chat-pager {
    display: none !important;
  }

  .composer {
    position: relative !important;
    inset: auto !important;
    flex: 0 0 auto !important;
    margin: 8px auto max(8px, env(safe-area-inset-bottom)) !important;
    min-height: 54px !important;
    grid-template-columns: 58px minmax(0, 1fr) 34px 38px 40px !important;
    gap: 4px !important;
    padding: 5px 6px !important;
    border-radius: 8px !important;
  }

  #chatPanel > form.composer {
    width: calc(100% - 16px) !important;
  }

  .composer .mode-select {
    min-height: 38px !important;
    padding: 4px 5px !important;
    font-size: 12px !important;
  }

  .composer textarea {
    min-height: 38px !important;
    max-height: 86px;
    padding: 8px 3px !important;
    overflow-x: hidden !important;
    overflow-y: hidden;
    font-size: 12px !important;
    white-space: pre-wrap !important;
  }

  .web-search-toggle {
    min-width: 32px;
    width: 32px;
    min-height: 32px;
    padding: 0 !important;
    border-radius: 50% !important;
  }

  .web-search-label {
    display: none !important;
  }

  .voice-input-btn,
  .send-btn {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
  }

  .send-btn::before {
    font-size: 20px;
  }

  .voice-status {
    right: 0;
    left: 0 !important;
    justify-content: center;
  }

  .modal-backdrop {
    align-items: end;
    padding: 12px;
  }

  .modal-card {
    width: 100%;
    max-height: 88dvh;
    padding: 18px !important;
    border-bottom-right-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
  }
}

@media (max-width: 420px) {
  .panel {
    padding-right: 10px !important;
    padding-left: 10px !important;
  }

  .records-toolbar,
  .business-insights-toolbar,
  .optimizer-cost-toolbar,
  .summary-toolbar,
  .logs-toolbar,
  .issue-toolbar {
    grid-template-columns: 1fr !important;
  }

  .records-toolbar > label:has(input[type="date"]) {
    grid-column: 1 / -1;
  }

  .optimizer-cost-kpis,
  .business-kpis,
  .summary-kpis,
  .parent-channel-kpis,
  .monitor-kpis {
    grid-template-columns: 1fr !important;
  }

  .business-insights-meta,
  .business-insights-grid {
    grid-template-columns: 1fr !important;
  }

  .composer {
    grid-template-columns: 52px minmax(0, 1fr) 32px 34px 38px !important;
  }
}

@media (max-width: 760px) {
  #chatPanel > .chat-messages {
    margin-bottom: 0 !important;
    padding-bottom: 12px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Desktop page rail: headers, secondary navigation and content share one start edge. */
@media (min-width: 761px) {
  .panel:not(#chatPanel) > * {
    max-width: none !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
  }

  .panel:not(#chatPanel) > .panel-header {
    margin: 0 0 20px !important;
  }

  .panel:not(#chatPanel) .panel-title-copy {
    text-align: left !important;
  }
}

.panel-header.panel-header-with-tabs {
  display: grid !important;
  grid-template-columns: minmax(180px, 210px) minmax(0, 1fr) !important;
  align-items: center !important;
  justify-content: stretch !important;
  gap: 24px !important;
  min-height: 64px !important;
}

.panel-header-with-tabs .panel-header-tabs {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 4px !important;
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  min-width: 0;
  min-height: 44px !important;
  margin: 0 !important;
  padding: 4px !important;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--qy-border, #dce3ee) !important;
  border-radius: 9px !important;
  background: var(--qy-surface, #fff) !important;
  box-shadow: var(--qy-shadow-sm) !important;
  scrollbar-width: none;
}

.panel-header-with-tabs .panel-header-tabs::-webkit-scrollbar {
  display: none;
}

.panel-header-with-tabs .panel-title-copy {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  min-width: 0;
  margin: 0;
}

.panel-header-tabs .hub-tabs,
.panel-header-tabs .module-tabs {
  display: flex !important;
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 0 !important;
  align-items: center;
  justify-content: flex-start !important;
  gap: 4px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.panel-header-tabs .module-tabs {
  margin-left: 2px !important;
  padding-left: 8px !important;
  border-left: 1px solid var(--qy-border, #dce3ee) !important;
}

.panel-header-tabs .hub-tab,
.panel-header-tabs .module-tab {
  flex: 0 0 auto;
  min-width: 0 !important;
  min-height: 34px !important;
  padding: 7px 12px !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
  text-align: center;
  white-space: nowrap;
}

/* Delivery distribution */
.delivery-distribution-toolbar {
  display: grid !important;
  grid-template-columns: minmax(220px, 1.25fr) minmax(145px, .62fr) repeat(3, minmax(145px, .68fr)) auto;
  align-items: end;
  gap: 14px;
}

.delivery-distribution-toolbar label,
.delivery-distribution-toolbar .toolbar-actions {
  min-width: 0;
}

.delivery-distribution-toolbar .toolbar-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.delivery-distribution-kpis {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

#deliveryDistributionPanel > .delivery-distribution-toolbar[hidden],
#deliveryDistributionPanel > .delivery-distribution-kpis[hidden] {
  display: none !important;
}

/* Delivery assets: additive lifecycle center (keeps distribution UI intact) */
.delivery-asset-center {
  display: grid;
  gap: 14px;
  min-height: 180px;
}

.delivery-asset-center.empty {
  display: grid;
}

.delivery-asset-overview-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 22px;
  border: 1px solid #dce6f5;
  border-radius: 12px;
  background: linear-gradient(135deg, #f7faff 0%, #edf5ff 100%);
}

.delivery-asset-overview-card h2,
.delivery-asset-overview-card p,
.delivery-asset-overview-card span {
  margin: 0;
}

.delivery-asset-overview-card h2 {
  margin: 4px 0 6px;
  color: #172033;
  font-size: 20px;
}

.delivery-asset-overview-card > div:first-child > span {
  color: #64748b;
  font-size: 13px;
}

.delivery-asset-overview-metrics {
  display: flex;
  align-items: center;
  gap: 10px;
}

.delivery-asset-overview-metrics > span {
  min-width: 130px;
  padding: 12px 15px;
  border: 1px solid rgba(37, 99, 235, .13);
  border-radius: 10px;
  background: rgba(255, 255, 255, .8);
}

.delivery-asset-overview-metrics small,
.delivery-asset-overview-metrics b {
  display: block;
}

.delivery-asset-overview-metrics small {
  color: #64748b;
  font-size: 11px;
}

.delivery-asset-overview-metrics b {
  margin-top: 4px;
  color: #1558b0;
  font-size: 20px;
}

.delivery-asset-status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.delivery-asset-status-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid #e1e8f2;
  border-radius: 999px;
  background: #fff;
  color: #56657a;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}

.delivery-asset-status-summary.active {
  border-color: #78a9f8;
  background: #eaf2ff;
  color: #1558b0;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .08);
}

.delivery-asset-status-summary b,
.delivery-asset-status-summary em {
  font: inherit;
  font-weight: 700;
}

.delivery-asset-batchbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid #dce6f5;
  border-radius: 10px;
  background: #fff;
}

.delivery-asset-batchbar b {
  margin-right: auto;
  color: #526176;
  font-size: 12px;
}

.delivery-asset-batchbar select {
  width: auto;
  min-width: 150px;
  min-height: 38px;
  padding: 7px 30px 7px 10px;
  border: 1px solid #d6dfec;
  border-radius: 8px;
  background-color: #fff;
  color: #334155;
}

.delivery-asset-batchbar .primary-btn {
  min-height: 38px;
  padding: 8px 14px;
}

.delivery-asset-select-all {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.delivery-asset-owner-groups,
.delivery-asset-rows {
  display: grid;
  gap: 10px;
}

.delivery-asset-owner-group {
  overflow: hidden;
  border: 1px solid #dce4ef;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 18px rgba(15, 23, 42, .035);
}

.delivery-asset-owner-group > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 13px 16px;
  background: linear-gradient(90deg, #fff 0%, #f8fbff 100%);
  cursor: pointer;
  list-style: none;
}

.delivery-asset-owner-group > summary::-webkit-details-marker { display: none; }

.delivery-asset-owner-group[open] > summary {
  border-bottom: 1px solid #e6ecf4;
}

.delivery-asset-owner-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  font-size: 14px;
}

.delivery-asset-owner-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.delivery-asset-owner-copy b,
.delivery-asset-owner-copy small,
.delivery-asset-owner-stats b,
.delivery-asset-owner-stats small {
  display: block;
}

.delivery-asset-owner-copy b { color: #172033; font-size: 15px; }
.delivery-asset-owner-copy small,
.delivery-asset-owner-stats small { margin-top: 3px; color: #778399; font-size: 11px; }

.delivery-asset-owner-stats {
  text-align: right;
}

.delivery-asset-owner-stats b { color: #1558b0; font-size: 16px; }

.delivery-asset-owner-group > summary > i {
  width: 9px;
  height: 9px;
  margin: 0 3px 4px 8px;
  border-right: 2px solid #8a98ab;
  border-bottom: 2px solid #8a98ab;
  transform: rotate(45deg);
  transition: transform .18s ease;
}

.delivery-asset-owner-group[open] > summary > i { transform: rotate(225deg); margin-bottom: -4px; }

.delivery-asset-rows { padding: 10px; }

.delivery-asset-row {
  display: grid;
  grid-template-columns: auto 36px minmax(180px, 1fr) minmax(92px, .38fr) auto auto auto auto;
  align-items: center;
  gap: 11px;
  min-height: 62px;
  padding: 10px 11px;
  border: 1px solid #e3e9f1;
  border-left: 3px solid #aab7c8;
  border-radius: 9px;
  background: #fff;
}

.delivery-asset-row.is-running { border-left-color: #2aa86b; }
.delivery-asset-row.is-paused,
.delivery-asset-row.is-closed,
.delivery-asset-row.is-source_detached { border-left-color: #94a3b8; background: #f8fafc; }
.delivery-asset-row.is-abnormal,
.delivery-asset-row.has-risk { border-left-color: #ea8a21; background: #fffdfa; }

.delivery-asset-check { display: grid; place-items: center; cursor: pointer; }
.delivery-asset-check input { width: 16px; height: 16px; margin: 0; }

.delivery-asset-row-title,
.delivery-asset-row-spend { min-width: 0; }

.delivery-asset-row-title b,
.delivery-asset-row-title small,
.delivery-asset-row-spend b,
.delivery-asset-row-spend small { display: block; }

.delivery-asset-row-title b {
  overflow: hidden;
  color: #1e293b;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-asset-row-title small,
.delivery-asset-row-spend small { margin-top: 3px; color: #8390a3; font-size: 10px; }
.delivery-asset-row-spend b { margin-top: 2px; color: #1558b0; font-size: 13px; }

.delivery-asset-delivery-status,
.delivery-asset-row-stage,
.delivery-asset-row-risk {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 25px;
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 800;
}

.delivery-asset-delivery-status { background: #eef2f7; color: #64748b; }
.delivery-asset-delivery-status.is-running { background: #e9f8f0; color: #167548; }
.delivery-asset-delivery-status.is-paused,
.delivery-asset-delivery-status.is-closed,
.delivery-asset-delivery-status.is-source_detached { background: #eceff3; color: #5f6d80; }
.delivery-asset-delivery-status.is-abnormal { background: #fff0df; color: #b45309; }
.delivery-asset-row-stage { background: #eef4ff; color: #315f9e; }
.delivery-asset-row-risk { background: #fff0df; color: #b45309; }

.delivery-asset-open-btn {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid #bdd3f4;
  border-radius: 8px;
  background: #f5f9ff;
  color: #1d5fb8;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
}

.delivery-asset-hero-status {
  display: flex;
  align-items: center;
  gap: 7px;
}

.delivery-asset-status-summary em {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #edf3ff;
  color: #1d5fb8;
}

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

.delivery-asset-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid #dfe6f0;
  border-radius: 10px;
  background: #fff;
  color: #172033;
  cursor: pointer;
  font: inherit;
  text-align: left;
  box-shadow: 0 4px 16px rgba(15, 23, 42, .035);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.delivery-asset-card:hover {
  border-color: #9fc3ff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .1);
  transform: translateY(-1px);
}

.delivery-asset-card-head,
.delivery-asset-card-body,
.delivery-asset-card-foot,
.delivery-asset-hero > div {
  display: flex;
  align-items: center;
}

.delivery-asset-card-head {
  min-width: 0;
  gap: 10px;
}

.delivery-asset-platform-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 9px;
  background: #eaf2ff;
  color: #1d61bd;
  font-size: 14px;
  font-weight: 800;
}

.delivery-asset-platform-icon.large {
  width: 46px;
  height: 46px;
  flex-basis: 46px;
  font-size: 17px;
}

.delivery-asset-card-title {
  min-width: 0;
  flex: 1 1 auto;
}

.delivery-asset-card-title b,
.delivery-asset-card-title small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-asset-card-title b {
  font-size: 14px;
}

.delivery-asset-card-title small {
  margin-top: 3px;
  color: #758196;
  font-size: 11px;
}

.delivery-asset-lifecycle,
.delivery-asset-source {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eaf8f0;
  color: #17774a;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.delivery-asset-lifecycle.is-watching {
  background: #fff2e6;
  color: #b45309;
}

.delivery-asset-lifecycle.is-paused,
.delivery-asset-lifecycle.is-closed,
.delivery-asset-source.is-detached {
  background: #f1f3f6;
  color: #64748b;
}

.delivery-asset-lifecycle.is-scaling {
  background: #eef2ff;
  color: #4f46e5;
}

.delivery-asset-lifecycle.is-testing,
.delivery-asset-lifecycle.is-pending_setup {
  background: #eff6ff;
  color: #2563eb;
}

.delivery-asset-card-body {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.delivery-asset-card-body > span {
  min-width: 0;
}

.delivery-asset-card-body small,
.delivery-asset-card-body b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-asset-card-body small {
  color: #8793a5;
  font-size: 10px;
}

.delivery-asset-card-body b {
  margin-top: 3px;
  font-size: 12px;
}

.delivery-asset-targets {
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 7px;
  background: #f7f9fc;
  color: #64748b;
  font-size: 11px;
  line-height: 1.55;
}

.delivery-asset-targets.has-risk {
  background: #fff7ed;
  color: #b45309;
  font-weight: 700;
}

.delivery-asset-card-foot {
  justify-content: space-between;
  gap: 10px;
}

.delivery-asset-card-foot em {
  color: #2563eb;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.delivery-asset-modal {
  width: min(920px, calc(100vw - 32px)) !important;
  max-height: calc(100vh - 40px);
  overflow: auto;
}

.delivery-asset-detail.loading,
.delivery-asset-detail.empty {
  min-height: 240px;
  padding: 80px 24px;
  color: #64748b;
  text-align: center;
}

.delivery-asset-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 0 18px;
  border-bottom: 1px solid #e5eaf2;
}

.delivery-asset-hero > div {
  min-width: 0;
  gap: 12px;
}

.delivery-asset-hero h3,
.delivery-asset-hero p,
.delivery-asset-hero small {
  margin: 0;
}

.delivery-asset-hero h3 {
  margin: 3px 0;
  font-size: 19px;
}

.delivery-asset-hero p,
.delivery-asset-hero small {
  color: #64748b;
  font-size: 12px;
}

.delivery-asset-detail-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 0;
}

.delivery-asset-detail-kpis > span {
  padding: 12px;
  border: 1px solid #e4e9f1;
  border-radius: 8px;
  background: #f9fbfd;
}

.delivery-asset-detail-kpis small,
.delivery-asset-detail-kpis b {
  display: block;
}

.delivery-asset-detail-kpis small {
  color: #768399;
  font-size: 11px;
}

.delivery-asset-detail-kpis b {
  margin-top: 5px;
  font-size: 16px;
}

.delivery-asset-form {
  display: grid;
  gap: 13px;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid #dce6f5;
  border-radius: 10px;
  background: #f8fbff;
}

.delivery-asset-form .row.three-cols {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.delivery-asset-form .form-footer-row {
  justify-content: space-between;
}

.delivery-asset-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e5eaf2;
}

.delivery-asset-section .table-head {
  margin-bottom: 10px;
}

.delivery-asset-records,
.delivery-asset-timeline {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow: auto;
}

.delivery-asset-records article {
  padding: 11px 12px;
  border: 1px solid #e3e9f1;
  border-radius: 8px;
  background: #fff;
}

.delivery-asset-records article > span,
.delivery-asset-timeline article span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.delivery-asset-records p,
.delivery-asset-timeline p {
  margin: 6px 0 0;
  color: #425066;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.delivery-asset-records time,
.delivery-asset-timeline time,
.delivery-asset-timeline small {
  color: #8a95a7;
  font-size: 10px;
}

.delivery-asset-timeline article {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 9px;
  padding: 4px 4px 10px;
}

.delivery-asset-timeline article > i {
  width: 9px;
  height: 9px;
  margin-top: 4px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #2f6feb;
  box-shadow: 0 0 0 1px #aac8f8;
}

.delivery-asset-timeline small {
  display: block;
  margin-top: 4px;
}

.delivery-asset-empty {
  padding: 20px;
  border: 1px dashed #d6deea;
  border-radius: 8px;
  color: #7a8799;
  font-size: 12px;
  text-align: center;
}

.delivery-asset-modal-footer {
  padding-top: 16px;
  border-top: 1px solid #e5eaf2;
}

@media (max-width: 1180px) {
  .delivery-distribution-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .delivery-asset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .delivery-asset-row {
    grid-template-columns: auto 36px minmax(160px, 1fr) auto auto auto;
  }
  .delivery-asset-row-stage,
  .delivery-asset-row-risk { display: none; }
}

@media (max-width: 760px) {
  .delivery-asset-overview-card,
  .delivery-asset-hero {
    align-items: flex-start;
    flex-direction: column;
  }
  .delivery-asset-overview-metrics {
    width: 100%;
  }
  .delivery-asset-overview-metrics > span {
    min-width: 0;
    flex: 1 1 50%;
  }
  .delivery-asset-grid {
    grid-template-columns: 1fr;
  }
  .delivery-asset-detail-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .delivery-asset-form .row.three-cols {
    grid-template-columns: 1fr;
  }
  .delivery-asset-batchbar {
    align-items: stretch;
    flex-direction: column;
  }
  .delivery-asset-batchbar select { width: 100%; }
  .delivery-asset-owner-group > summary { padding: 12px; }
  .delivery-asset-owner-stats small { display: none; }
  .delivery-asset-row {
    grid-template-columns: auto 34px minmax(0, 1fr) auto;
    gap: 9px;
  }
  .delivery-asset-row-spend { grid-column: 3; }
  .delivery-asset-delivery-status { grid-column: 4; grid-row: 1; }
  .delivery-asset-open-btn { grid-column: 4; grid-row: 2; }
}

.delivery-distribution-kpis .config-card {
  min-height: 86px;
  padding: 15px 14px;
}

.delivery-distribution-kpis span {
  display: block;
  color: var(--muted, #64748b);
  font-size: 13px;
}

.delivery-distribution-kpis b {
  display: block;
  margin-top: 8px;
  color: var(--text, #172033);
  font-size: clamp(20px, 1.42vw, 27px);
  line-height: 1;
}

.delivery-distribution-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-height: 180px;
}

.delivery-distribution-list.empty {
  display: block;
}

.delivery-distribution-list.loading {
  opacity: .62;
  pointer-events: none;
}

.delivery-person-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border, #dce3ee);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(15, 23, 42, .04);
}

.delivery-person-head,
.delivery-person-identity,
.delivery-person-summary,
.delivery-assignment-labels,
.delivery-assignment-actions {
  display: flex;
  align-items: center;
}

.delivery-person-head {
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid #edf1f6;
}

.delivery-person-identity {
  min-width: 0;
  gap: 10px;
}

.delivery-person-avatar {
  width: 38px !important;
  height: 38px !important;
  flex: 0 0 38px;
}

.delivery-person-identity h3,
.delivery-person-identity p {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-person-identity h3 {
  font-size: 16px;
}

.delivery-person-identity p,
.delivery-person-summary span {
  color: var(--muted, #64748b);
  font-size: 12px;
}

.delivery-person-summary {
  flex: 0 0 auto;
  gap: 8px;
}

.delivery-add-btn {
  width: 32px !important;
  height: 32px !important;
}

.delivery-assignment-list {
  display: grid;
  gap: 8px;
  padding-top: 12px;
}

.delivery-assignment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-left: 3px solid #2f6feb;
  background: #f7f9fc;
}

.delivery-assignment-row.is-paused {
  border-left-color: #94a3b8;
  opacity: .72;
}

.delivery-assignment-main {
  min-width: 0;
}

.delivery-assignment-main > b,
.delivery-assignment-main > p,
.delivery-assignment-main > em {
  display: block;
  overflow: hidden;
  margin: 5px 0 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-assignment-main > b {
  font-size: 14px;
}

.delivery-assignment-main > p,
.delivery-assignment-main > em {
  color: var(--muted, #64748b);
  font-size: 12px;
  font-style: normal;
}

.delivery-assignment-labels,
.delivery-assignment-actions {
  flex-wrap: wrap;
  gap: 6px;
}

.delivery-platform-badge,
.delivery-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eaf2ff;
  color: #1757b8;
  font-size: 12px;
  font-weight: 700;
}

.delivery-status-badge {
  background: #e8f7ef;
  color: #16794a;
}

.delivery-person-empty {
  display: grid;
  gap: 5px;
  padding: 22px 4px 6px;
  color: var(--muted, #64748b);
}

.delivery-person-empty b {
  color: var(--text, #172033);
  font-size: 14px;
}

.delivery-person-empty span {
  font-size: 12px;
}

.delivery-distribution-modal {
  width: min(720px, calc(100vw - 32px)) !important;
}

@media (max-width: 1100px) {
  .panel-header.panel-header-with-tabs {
    grid-template-columns: minmax(150px, 180px) minmax(0, 1fr) !important;
    gap: 16px !important;
  }

  .panel-header-tabs .hub-tab,
  .panel-header-tabs .module-tab {
    padding-right: 10px !important;
    padding-left: 10px !important;
  }

  .delivery-distribution-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .delivery-distribution-toolbar .toolbar-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .delivery-distribution-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .panel-header.panel-header-with-tabs {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .panel-header-with-tabs .panel-title-copy {
    order: 1;
    align-self: stretch;
    text-align: left !important;
  }

  .panel-header-with-tabs .panel-header-tabs {
    order: 2;
    width: 100%;
    min-height: 44px !important;
  }

  .panel-header-tabs .hub-tab,
  .panel-header-tabs .module-tab {
    min-height: 34px !important;
    font-size: 12px !important;
  }

  .delivery-distribution-toolbar {
    grid-template-columns: 1fr !important;
  }

  .delivery-distribution-toolbar .toolbar-actions {
    grid-column: auto;
  }

  .delivery-distribution-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .delivery-person-head,
  .delivery-assignment-row {
    align-items: flex-start;
  }

  .delivery-assignment-row {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 420px) {
  .delivery-distribution-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .delivery-distribution-kpis .config-card {
    min-height: 84px;
    padding: 14px;
  }

  .delivery-distribution-kpis b {
    margin-top: 6px;
    font-size: 24px;
  }
}

/* Delivery distribution: compact assignment and drill-down overview */
.delivery-distribution-view-tabs {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 4px;
  margin: 0 0 14px;
  padding: 4px;
  border: 1px solid #dce3ee;
  border-radius: 8px;
  background: #f4f7fb;
}

.delivery-distribution-view-tabs button {
  min-height: 34px;
  padding: 7px 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #536174;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.delivery-distribution-view-tabs button.active {
  background: #fff;
  color: #1f6feb;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .12);
}

.delivery-product-center {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.delivery-product-filterbar {
  display: grid;
  grid-template-columns: minmax(180px, .7fr) minmax(260px, 1.4fr) auto;
  align-items: end;
  gap: 14px;
  margin-bottom: 14px;
}

.delivery-product-filterbar[hidden] { display: none !important; }
.delivery-product-filterbar label { min-width: 0; margin: 0; }
.delivery-product-filterbar select,
.delivery-product-filterbar input { width: 100%; }

.delivery-product-filter-count {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: #6e7d92;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

/* Delivery account center */
.delivery-account-center {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.delivery-account-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 24px;
  border: 1px solid #d7e4f6;
  border-radius: 16px;
  background: linear-gradient(135deg, #f7faff 0%, #edf5ff 100%);
  box-shadow: 0 10px 28px rgba(42, 91, 158, .07);
}

.delivery-account-hero h2,
.delivery-account-hero p,
.delivery-account-hero span {
  margin: 0;
}

.delivery-account-hero h2 {
  margin: 4px 0 6px;
  color: #17243a;
  font-size: 24px;
}

.delivery-account-hero > div:first-child > span {
  color: #65758d;
  font-size: 13px;
  line-height: 1.6;
}

.delivery-account-hero-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(92px, 1fr));
  gap: 9px;
  flex: 0 0 auto;
}

.delivery-account-hero-metrics > span {
  min-width: 96px;
  padding: 11px 13px;
  border: 1px solid rgba(37, 99, 235, .13);
  border-radius: 12px;
  background: rgba(255, 255, 255, .86);
}

.delivery-account-hero-metrics small,
.delivery-account-hero-metrics b {
  display: block;
  white-space: nowrap;
}

.delivery-account-hero-metrics small {
  color: #8190a6;
  font-size: 11px;
}

.delivery-account-hero-metrics b {
  margin-top: 4px;
  color: #1658ad;
  font-size: 18px;
}

.delivery-account-toolbar {
  display: grid !important;
  grid-template-columns: minmax(220px, 1.35fr) minmax(150px, .72fr) repeat(4, minmax(142px, .72fr)) auto;
  align-items: end;
  gap: 11px;
  padding: 16px !important;
}

.delivery-account-toolbar label {
  min-width: 0;
}

.delivery-account-toolbar label > span {
  display: block;
  margin-bottom: 7px;
  color: #526178;
  font-size: 12px;
  font-weight: 700;
}

.delivery-account-toolbar input,
.delivery-account-toolbar select {
  width: 100%;
  min-height: 42px;
}

.delivery-account-toolbar > button {
  min-height: 42px;
}

.delivery-account-data-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 4px;
  color: #6a7890;
  font-size: 12px;
}

.delivery-account-data-note b {
  color: #244a7c;
}

.delivery-account-data-note em {
  color: #6b7d96;
  font-style: normal;
}

.delivery-account-table-wrap {
  overflow: auto;
  border: 1px solid #dfe7f2;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(25, 55, 96, .05);
}

.delivery-account-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
  table-layout: fixed;
}

.delivery-account-table th,
.delivery-account-table td {
  padding: 13px 14px;
  border-bottom: 1px solid #edf1f6;
  color: #314057;
  text-align: left;
  vertical-align: middle;
  font-size: 12px;
}

.delivery-account-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f6f8fc;
  color: #677790;
  font-size: 11px;
  font-weight: 800;
}

.delivery-account-table th:first-child { width: 23%; }
.delivery-account-table th:nth-child(2) { width: 11%; }
.delivery-account-table th:nth-child(3) { width: 16%; }
.delivery-account-table th:nth-child(4) { width: 10%; }
.delivery-account-table th:nth-child(5) { width: 10%; }
.delivery-account-table th:nth-child(6) { width: 8%; }
.delivery-account-table th:nth-child(7) { width: 10%; }
.delivery-account-table th:nth-child(8) { width: 6%; }
.delivery-account-table th:last-child { width: 86px; }

.delivery-account-table .is-number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.delivery-account-row {
  cursor: pointer;
  transition: background .16s ease, box-shadow .16s ease;
}

.delivery-account-row:hover {
  background: #f7faff;
  box-shadow: inset 3px 0 #3b82f6;
}

.delivery-account-row.is-unmatched {
  background: #fafbfc;
}

.delivery-account-id,
.delivery-account-product {
  display: block;
  min-width: 0;
}

.delivery-account-id code {
  display: block;
  color: #153e75;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
}

.delivery-account-id small,
.delivery-account-category {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: #8a97aa;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-account-platform {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  background: #edf4ff;
  color: #2464b9;
  font-weight: 800;
}

.delivery-account-product {
  overflow: hidden;
  color: #255997;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-account-roi {
  display: inline-flex;
  min-width: 44px;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 999px;
  background: #fff2e7;
  color: #b75c12;
  font-weight: 800;
}

.delivery-account-roi.is-good {
  background: #e8f8ef;
  color: #13824c;
}

.delivery-account-open-btn {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid #cfe0f8;
  border-radius: 8px;
  background: #f2f7ff;
  color: #2165bd;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.delivery-account-empty-state {
  min-height: 220px;
  border: 1px dashed #cfd9e8;
  border-radius: 14px;
  background: #fbfcfe;
}

.delivery-account-hourly-modal {
  width: min(920px, calc(100vw - 36px));
  max-height: min(860px, calc(100vh - 36px));
}

.delivery-account-hourly-body {
  overflow: auto;
  padding-right: 4px;
}

.delivery-account-hourly-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.delivery-account-hourly-kpis > span {
  padding: 13px 15px;
  border: 1px solid #dce6f4;
  border-radius: 12px;
  background: #f7faff;
}

.delivery-account-hourly-kpis small,
.delivery-account-hourly-kpis b {
  display: block;
}

.delivery-account-hourly-kpis small {
  color: #7b899e;
  font-size: 11px;
}

.delivery-account-hourly-kpis b {
  margin-top: 4px;
  color: #1758ac;
  font-size: 19px;
}

.delivery-account-hourly-section {
  overflow: hidden;
  border: 1px solid #e0e7f0;
  border-radius: 13px;
  background: #fbfcfe;
}

.delivery-account-hourly-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 16px 13px;
  border-bottom: 1px solid #e7edf5;
  background: #fff;
}

.delivery-account-hourly-section-head p,
.delivery-account-hourly-section-head h3,
.delivery-account-hourly-section-head span {
  margin: 0;
}

.delivery-account-hourly-section-head h3 {
  margin-top: 3px;
  color: #1c2b43;
  font-size: 17px;
}

.delivery-account-hourly-section-head > span {
  color: #7e8ba0;
  font-size: 12px;
}

.delivery-account-hourly-chart {
  display: grid;
  gap: 5px;
  padding: 0 14px 14px;
}

.delivery-account-hour-head,
.delivery-account-hour-row {
  display: grid;
  grid-template-columns: 72px minmax(260px, 1fr) 110px 110px;
  align-items: center;
  gap: 16px;
}

.delivery-account-hour-head {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0 -14px 4px;
  padding: 11px 14px;
  border-bottom: 1px solid #e7edf5;
  background: #f4f7fb;
  color: #607089;
  font-size: 12px;
  font-weight: 800;
}

.delivery-account-hour-head span:nth-child(n+2) {
  text-align: right;
}

.delivery-account-hour-row {
  min-height: 30px;
  color: #526178;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.delivery-account-hour-row time,
.delivery-account-hour-row b,
.delivery-account-hour-row em,
.delivery-account-hour-row strong {
  white-space: nowrap;
}

.delivery-account-hour-valid {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) 62px;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.delivery-account-hour-valid b {
  color: #244d82;
  text-align: right;
}

.delivery-account-hour-cost {
  color: #8492a6;
  font-style: normal;
  text-align: right;
}

.delivery-account-hour-revenue {
  color: #15804a;
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.delivery-account-hour-track {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf6;
}

.delivery-account-hour-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f7cf4, #6555ec);
}

.delivery-account-hourly-footnote {
  margin: 12px 2px 0;
  color: #7f8da2;
  font-size: 11px;
  line-height: 1.6;
}

.delivery-hourly-empty {
  min-height: 210px;
  border: 1px dashed #d7dfeb;
  border-radius: 13px;
  background: #fafcff;
}

@media (max-width: 1180px) {
  .delivery-account-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .delivery-account-hero-metrics {
    width: 100%;
  }

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

  .delivery-account-toolbar .is-keyword {
    grid-column: span 2;
  }
}

@media (max-width: 720px) {
  .delivery-distribution-view-tabs {
    max-width: 100%;
    overflow-x: auto;
  }

  .delivery-account-hero {
    padding: 17px;
    border-radius: 13px;
  }

  .delivery-account-hero h2 { font-size: 21px; }
  .delivery-account-hero-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .delivery-account-hero-metrics > span { min-width: 0; }
  .delivery-account-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .delivery-account-toolbar .is-keyword { grid-column: 1 / -1; }
  .delivery-account-toolbar > button { width: 100%; }
  .delivery-account-data-note { align-items: flex-start; flex-direction: column; gap: 4px; }
  .delivery-account-hourly-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .delivery-account-hour-head,
  .delivery-account-hour-row { grid-template-columns: 48px minmax(150px, 1fr) 56px 72px; gap: 9px; }
  .delivery-account-hour-valid { grid-template-columns: minmax(70px, 1fr) 48px; gap: 7px; }
  .delivery-account-hourly-section-head { align-items: flex-start; flex-direction: column; gap: 5px; }
}

@media (max-width: 430px) {
  .delivery-account-toolbar { grid-template-columns: 1fr; }
  .delivery-account-toolbar .is-keyword { grid-column: auto; }
  .delivery-account-hourly-modal { width: calc(100vw - 18px); }
}

.delivery-product-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 28px;
  border: 1px solid #d6e2f4;
  border-radius: 22px;
  background: linear-gradient(135deg, #f7faff 0%, #edf4ff 100%);
  box-shadow: 0 12px 34px rgba(39, 88, 155, .08);
}

.delivery-product-hero h2 {
  margin: 3px 0 7px;
  color: #17243a;
  font-size: clamp(22px, 2vw, 30px);
}

.delivery-product-hero > div > span {
  color: #66758c;
  line-height: 1.65;
}

.delivery-product-hero-stats {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex: 0 0 auto;
}

.delivery-product-hero-stats > span {
  min-width: 88px;
  padding: 11px 14px;
  border: 1px solid #d8e3f3;
  border-radius: 15px;
  background: rgba(255,255,255,.82);
  color: #728097;
  text-align: center;
  font-size: 12px;
}

.delivery-product-hero-stats > span b {
  display: block;
  margin-bottom: 2px;
  color: #1f5fb8;
  font-size: 22px;
}

.delivery-product-hero-stats > span.is-warning b { color: #b56a00; }

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

.delivery-product-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid #dce5f2;
  border-radius: 19px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(31, 71, 128, .06);
}

.delivery-product-card.is-pending { border-color: #f3d7a5; background: linear-gradient(180deg, #fffdf8, #fff); }
.delivery-product-card.is-disabled { opacity: .72; background: #f8fafc; }

.delivery-product-card-head,
.delivery-product-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.delivery-product-card-head h3 {
  margin: 10px 0 0;
  color: #173d76;
  font-size: 19px;
  overflow-wrap: anywhere;
}

.delivery-product-status {
  padding: 6px 10px;
  border-radius: 999px;
  background: #e9f7ef;
  color: #238254;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.delivery-product-card.is-pending .delivery-product-status { background: #fff1d8; color: #9a6000; }
.delivery-product-card.is-disabled .delivery-product-status { background: #edf0f4; color: #697386; }

.delivery-product-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0 14px;
}

.delivery-product-metrics span {
  min-width: 0;
  padding: 11px;
  border-radius: 13px;
  background: #f5f8fc;
}

.delivery-product-metrics small,
.delivery-product-metrics b { display: block; }
.delivery-product-metrics small { margin-bottom: 5px; color: #8995a8; font-size: 11px; }
.delivery-product-metrics b { color: #20314c; font-size: 15px; overflow-wrap: anywhere; }

.delivery-product-formula {
  display: grid;
  gap: 5px;
  padding: 13px 14px;
  border-radius: 13px;
  background: #eef5ff;
  color: #24599d;
}

.delivery-product-formula span { color: #71819a; font-size: 12px; line-height: 1.55; }

.delivery-product-card-foot {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #edf1f6;
}

.delivery-product-card-foot > span { color: #8793a6; font-size: 12px; }

.delivery-product-modal {
  display: flex;
  flex-direction: column;
  width: min(860px, calc(100vw - 28px));
  max-height: min(820px, calc(100dvh - 28px));
  overflow: hidden;
}

.delivery-product-modal > .modal-head {
  flex: 0 0 auto;
  margin-bottom: 0;
  padding-bottom: 16px;
  border-bottom: 1px solid #e7edf5;
}

.delivery-product-form {
  flex: 1 1 auto;
  min-height: 0;
  gap: 14px;
  padding: 18px 22px 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.delivery-product-form-section {
  display: grid;
  gap: 14px;
  padding: 17px;
  border: 1px solid #e1e8f2;
  border-radius: 16px;
  background: #fff;
}

.delivery-product-form-section.is-revenue {
  border-color: #cfe0f8;
  background: linear-gradient(180deg, #f8fbff, #fff);
}

.delivery-product-form-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e9eef5;
}

.delivery-product-form-section-head > span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  background: #e9f2ff;
  color: #2367ca;
  font-size: 13px;
  font-weight: 850;
}

.delivery-product-form-section-head > div {
  display: grid;
  gap: 2px;
}

.delivery-product-form-section-head b {
  color: #1f2f47;
  font-size: 14px;
}

.delivery-product-form-section-head small {
  color: #8794a7;
  font-size: 11px;
}

.delivery-product-form-grid {
  display: grid;
  grid-template-columns: .9fr .9fr 1.25fr .72fr;
  gap: 12px;
  align-items: start;
}

.delivery-product-form-grid.is-rule {
  grid-template-columns: 1fr 1fr 1fr;
}

.delivery-product-form label {
  min-width: 0;
  margin: 0;
}

.delivery-product-form input,
.delivery-product-form select,
.delivery-product-form textarea {
  width: 100%;
}

.delivery-product-form textarea {
  min-height: 82px;
  resize: vertical;
}

.delivery-product-money-input {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  min-height: 44px;
  padding: 0 11px;
  border: 1px solid #cad6e5;
  border-radius: 11px;
  background: #fff;
}

.delivery-product-money-input:focus-within {
  border-color: #4d8ff0;
  box-shadow: 0 0 0 3px rgba(77, 143, 240, .13);
}

.delivery-product-money-input input {
  min-width: 0;
  height: 40px;
  padding: 0 8px;
  border: 0;
  box-shadow: none;
}

.delivery-product-money-input input:focus { box-shadow: none; }
.delivery-product-money-input > span { color: #2b6fd3; font-weight: 850; }
.delivery-product-money-input em { color: #8491a5; font-size: 11px; font-style: normal; white-space: nowrap; }
.delivery-product-form.is-clue-revenue #deliveryProductUnitRevenueField {
  opacity: .62;
}
.delivery-product-form.is-clue-revenue #deliveryProductUnitRevenueField .delivery-product-money-input {
  background: #f3f6fa;
  border-style: dashed;
  box-shadow: none;
}
.delivery-product-form.is-clue-revenue #deliveryProductUnitRevenueField input {
  cursor: not-allowed;
}
.delivery-product-rule-tip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 11px 13px;
  border: 1px solid #d9e6f8;
  border-radius: 14px;
  background: #f3f7fd;
  color: #52657f;
  line-height: 1.6;
}
.delivery-product-rule-tip b { color: #255ea8; }
.delivery-product-rule-tip span {
  padding: 4px 9px;
  border-radius: 999px;
  background: #fff;
  color: #5f7088;
  font-size: 11px;
}

.delivery-product-form-footer {
  position: sticky;
  bottom: -22px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 -22px -22px;
  padding: 14px 22px 18px;
  border-top: 1px solid #e4eaf2;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px);
}

.delivery-product-form-footer > div { display: flex; gap: 10px; }
.delivery-product-form-footer .form-msg { min-height: 0; margin: 0; }

@media (max-width: 1180px) {
  .delivery-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .delivery-product-hero { align-items: flex-start; flex-direction: column; }
  .delivery-product-filterbar { grid-template-columns: minmax(170px, .7fr) minmax(220px, 1.3fr) auto; }
}

@media (max-width: 720px) {
  .delivery-product-grid { grid-template-columns: 1fr; }
  .delivery-product-filterbar { grid-template-columns: 1fr; }
  .delivery-product-filter-count { min-height: 0; justify-content: flex-start; }
  .delivery-product-hero { padding: 20px; border-radius: 18px; }
  .delivery-product-hero-stats { width: 100%; flex-wrap: wrap; }
  .delivery-product-hero-stats > span { flex: 1 1 28%; min-width: 74px; }
  .delivery-product-hero-stats .primary-btn { width: 100%; }
  .delivery-product-metrics { grid-template-columns: 1fr 1fr; }
  .delivery-product-card-foot { align-items: flex-start; flex-direction: column; }
  .delivery-product-modal { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
  .delivery-product-form { padding: 12px 14px 16px; }
  .delivery-product-form-section { padding: 14px; }
  .delivery-product-form-grid,
  .delivery-product-form-grid.is-rule { grid-template-columns: 1fr; }
  .delivery-product-form-section-head { align-items: flex-start; }
  .delivery-product-form-section-head small { line-height: 1.5; }
  .delivery-product-form-footer { bottom: -16px; align-items: stretch; flex-direction: column; margin: 0 -14px -16px; padding: 12px 14px 14px; }
  .delivery-product-form-footer > div { width: 100%; }
  .delivery-product-form-footer button { flex: 1; }
}

.delivery-person-card {
  align-self: start;
  padding: 16px;
}

.delivery-person-details {
  margin-top: 12px;
  border: 1px solid #e4e9f1;
  border-radius: 7px;
  background: #f8fafc;
  overflow: hidden;
}

.delivery-person-details > summary,
.delivery-overview-category > summary,
.delivery-overview-product > summary,
.delivery-overview-person > summary {
  list-style: none;
  cursor: pointer;
}

.delivery-person-details > summary::-webkit-details-marker,
.delivery-overview-category > summary::-webkit-details-marker,
.delivery-overview-product > summary::-webkit-details-marker,
.delivery-overview-person > summary::-webkit-details-marker {
  display: none;
}

.delivery-person-details > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 9px 11px;
}

.delivery-person-details > summary::after,
.delivery-overview-category > summary::after,
.delivery-overview-product > summary::after,
.delivery-overview-person > summary::after {
  content: "›";
  color: #8793a5;
  font-size: 18px;
  line-height: 1;
  transform: rotate(90deg);
  transition: transform .18s ease;
}

.delivery-person-details[open] > summary::after,
.delivery-overview-category[open] > summary::after,
.delivery-overview-product[open] > summary::after,
.delivery-overview-person[open] > summary::after {
  transform: rotate(-90deg);
}

.delivery-person-details > summary > strong {
  color: #1558b0;
  font-size: 13px;
}

.delivery-person-details > summary > small {
  color: #69768a;
  font-size: 11px;
}

.delivery-product-preview,
.delivery-account-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.delivery-product-preview span,
.delivery-category-badge,
.delivery-spend-badge,
.delivery-account-chip {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #edf3ff;
  color: #255da8;
  font-size: 11px;
  font-weight: 700;
}

.delivery-product-preview span {
  overflow: hidden;
  max-width: 132px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-spend-badge {
  background: #eaf8f0;
  color: #187849;
}

.delivery-person-details .delivery-assignment-list {
  max-height: 390px;
  padding: 0 10px 10px;
  overflow: auto;
}

.delivery-person-details .delivery-assignment-row {
  border: 1px solid #e4e9f1;
  border-left: 3px solid #2f6feb;
  border-radius: 6px;
  background: #fff;
}

.delivery-assignment-main > b {
  margin-top: 8px;
  white-space: normal;
}

.delivery-assignment-main > em {
  white-space: normal;
}

.delivery-assignment-main > em.delivery-duplicate-account-warning {
  display: block;
  width: fit-content;
  max-width: 100%;
  padding: 6px 9px;
  border: 1px solid #f3c7c7;
  border-radius: 8px;
  background: #fff3f3;
  color: #b42318;
  font-weight: 700;
  white-space: normal;
}

.delivery-account-chips {
  margin-top: 8px;
}

.delivery-account-chip {
  gap: 6px;
  border: 1px solid #dce4f0;
  background: #fff;
  color: #334155;
  font-weight: 600;
}

.delivery-account-chip.is-matched {
  border-color: #b8ddc8;
  background: #effaf4;
}

.delivery-account-chip code {
  color: inherit;
  font: inherit;
  letter-spacing: 0;
}

.delivery-account-chip small {
  color: #187849;
  font-size: 10px;
  font-weight: 700;
}

.delivery-account-chip em {
  color: #176b43;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.delivery-roi-metrics {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  color: #718096;
}

.delivery-roi-metrics small,
.delivery-roi-metrics b {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.delivery-roi-metrics small {
  background: #f3f6fb;
  color: #65758b;
}

.delivery-roi-metrics b {
  background: #e8f7ef;
  color: #147447;
  font-weight: 850;
}

.delivery-person-summary > .delivery-roi-metrics {
  justify-content: flex-end;
  max-width: 260px;
}

.delivery-product-card > .delivery-roi-metrics {
  margin: 12px 0 0;
}

.delivery-asset-row-spend em {
  display: block;
  margin-top: 3px;
  color: #187849;
  font-size: 10px;
  font-style: normal;
  font-weight: 750;
  white-space: nowrap;
}

.delivery-account-empty {
  display: inline-block;
  margin-top: 7px;
  color: #8793a5;
  font-size: 12px;
}

.delivery-distribution-overview {
  min-height: 180px;
}

.delivery-distribution-overview.empty {
  display: block;
}

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

.delivery-overview-category {
  align-self: start;
  border: 1px solid #dce3ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(15, 23, 42, .04);
  overflow: hidden;
}

.delivery-overview-category > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.delivery-overview-category > summary > div {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.delivery-overview-category h3,
.delivery-overview-category p {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-overview-category h3 {
  color: #172033;
  font-size: 16px;
}

.delivery-overview-category p {
  margin-top: 3px;
  color: #69768a;
  font-size: 11px;
}

.delivery-overview-category > summary > strong,
.delivery-overview-product > summary > strong {
  color: #1558b0;
  font-size: 14px;
}

.delivery-category-mark {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border-radius: 50%;
  background: #eaf2ff;
  color: #1558b0;
  font-size: 14px;
  font-weight: 800;
}

.delivery-overview-products {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}

.delivery-overview-product {
  border: 1px solid #e4e9f1;
  border-radius: 7px;
  background: #f8fafc;
  overflow: hidden;
}

.delivery-overview-product > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
}

.delivery-overview-product > summary b,
.delivery-overview-product > summary span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-overview-product > summary b {
  color: #243247;
  font-size: 13px;
}

.delivery-overview-product > summary span,
.delivery-overview-person > summary small {
  margin-top: 3px;
  color: #69768a;
  font-size: 11px;
}

.delivery-overview-people {
  display: grid;
  gap: 6px;
  padding: 0 9px 9px;
}

.delivery-overview-person {
  border-top: 1px solid #e4e9f1;
  background: #fff;
}

.delivery-overview-person > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
}

.delivery-overview-person > summary span {
  overflow: hidden;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-overview-person > summary small {
  margin: 0;
  white-space: nowrap;
}

.delivery-overview-person > .delivery-account-chips {
  padding: 0 10px 10px;
}

@media (max-width: 1100px) {
  .delivery-overview-grid {
    grid-template-columns: 1fr;
  }
}

/* 20260825: mobile chat rank drawer and delivery distribution layout repair. */
.chat-rank-drawer {
  display: none;
}

.delivery-person-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.delivery-person-head > .delivery-person-identity {
  grid-column: 1;
  grid-row: 1;
}

.delivery-person-head > .delivery-person-summary {
  grid-column: 2;
  grid-row: 1;
}

.delivery-person-head > .delivery-roi-metrics {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  margin-top: 9px;
  padding-top: 10px;
  border-top: 1px solid #edf1f6;
  justify-content: flex-end;
}

@media (max-width: 760px) {
  #chatPanel > .chat-rank-drawer {
    flex: 0 0 auto;
    display: block !important;
    width: calc(100% - 24px);
    max-width: 720px;
    margin: 0 auto 8px;
    overflow: hidden;
    border: 1px solid #dbe6f5;
    border-radius: 14px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 6px 18px rgba(24, 73, 148, .08);
  }

  #chatPanel > .chat-rank-drawer > summary {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    min-height: 48px;
    padding: 7px 11px;
    list-style: none;
    cursor: pointer;
    user-select: none;
  }

  #chatPanel > .chat-rank-drawer > summary::-webkit-details-marker {
    display: none;
  }

  #chatPanel > .chat-rank-drawer[open] > summary {
    border-bottom: 1px solid #edf2f8;
    background: linear-gradient(90deg, #f7fbff 0%, #fff 72%);
  }

  .chat-rank-drawer-icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 11px;
    background: linear-gradient(145deg, #2f75ee, #635bdf);
    color: #fff;
    font-size: 17px;
    font-weight: 900;
    box-shadow: 0 5px 12px rgba(47, 117, 238, .2);
  }

  .chat-rank-drawer-copy {
    display: grid;
    min-width: 0;
    gap: 2px;
  }

  .chat-rank-drawer-copy b,
  .chat-rank-drawer-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .chat-rank-drawer-copy b {
    color: #172033;
    font-size: 13px;
    font-weight: 900;
  }

  .chat-rank-drawer-copy small {
    color: #6b7890;
    font-size: 10px;
    font-weight: 650;
  }

  .chat-rank-drawer-state {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #2563b8;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
  }

  .chat-rank-drawer-state::after {
    content: "⌄";
    font-size: 14px;
    line-height: 1;
    transform: rotate(-90deg);
    transition: transform .18s ease;
  }

  .chat-rank-drawer[open] .chat-rank-drawer-state::after {
    transform: rotate(0deg);
  }

  #chatPanel > .chat-rank-drawer .mobile-optimizer-rank-strip {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 6px;
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
    padding: 8px;
    overflow: visible !important;
  }

  #chatPanel > .chat-rank-drawer .mobile-optimizer-rank-strip[hidden] {
    display: none !important;
  }

  #chatPanel > .chat-rank-drawer .mobile-optimizer-rank-strip.empty {
    min-height: 48px;
    place-items: center;
    color: #7a8799;
    font-size: 12px;
    font-weight: 700;
  }

  #chatPanel > .chat-rank-drawer .mobile-rank-chip {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 6px 10px 6px 8px;
    border: 1px solid #e2e8f2;
    border-radius: 11px;
    background: #f8fafd;
    color: #172033;
    text-align: left;
    box-shadow: none;
  }

  #chatPanel > .chat-rank-drawer .mobile-rank-chip i {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 50%;
    background: #e8f0fe;
    color: #185abc;
    font-size: 11px;
    font-style: normal;
    font-weight: 900;
  }

  #chatPanel > .chat-rank-drawer .mobile-rank-chip.rank-1 i {
    background: #fff2cb;
    color: #a85c00;
  }

  #chatPanel > .chat-rank-drawer .mobile-rank-chip.rank-2 i {
    background: #edf2f7;
    color: #52616f;
  }

  #chatPanel > .chat-rank-drawer .mobile-rank-chip.rank-3 i {
    background: #ffeddc;
    color: #984c00;
  }

  #chatPanel > .chat-rank-drawer .mobile-rank-chip b {
    min-width: 0;
    overflow: hidden;
    color: #253248;
    font-size: 12px;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #chatPanel > .chat-rank-drawer .mobile-rank-chip span {
    color: #155cb7;
    font-size: 11px;
    font-weight: 850;
    white-space: nowrap;
  }

  .delivery-person-card.is-summary {
    gap: 10px;
    padding: 14px;
    border-radius: 16px;
  }

  .delivery-person-head {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start !important;
    gap: 10px 8px;
    padding-bottom: 12px;
  }

  .delivery-person-identity {
    width: 100%;
    min-width: 0;
    gap: 10px;
  }

  .delivery-person-avatar {
    width: 42px !important;
    height: 42px !important;
    flex: 0 0 42px;
  }

  .delivery-person-copy {
    width: 100%;
    min-width: 0;
  }

  .delivery-person-identity h3 {
    font-size: 16px;
    line-height: 1.25;
  }

  .delivery-person-identity p {
    margin-top: 2px;
    font-size: 11px;
  }

  .delivery-person-meta {
    max-width: none;
    margin-top: 5px;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .delivery-person-summary {
    width: auto !important;
    min-width: 100px;
    grid-template-columns: minmax(0, auto) 34px;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 7px;
  }

  .delivery-person-spend {
    font-size: 16px;
  }

  .delivery-person-summary .delivery-add-btn {
    width: 34px !important;
    height: 34px !important;
  }

  .delivery-person-head > .delivery-roi-metrics {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    max-width: none;
    margin-top: 0;
    padding-top: 10px;
    border-top: 1px solid #edf1f6;
  }

  .delivery-person-head > .delivery-roi-metrics small,
  .delivery-person-head > .delivery-roi-metrics b {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 6px 5px;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
  }

  .delivery-platform-summary {
    gap: 8px;
    padding: 10px 0;
  }

  .delivery-platform-total {
    min-height: 44px;
    padding: 7px 10px;
  }

  .delivery-person-detail-launcher {
    min-height: 58px;
    border-radius: 12px;
  }
}

@media (max-width: 370px) {
  .delivery-person-head {
    grid-template-columns: minmax(0, 1fr) 92px;
  }

  .delivery-person-avatar {
    width: 38px !important;
    height: 38px !important;
    flex-basis: 38px;
  }

  .delivery-person-summary {
    min-width: 92px;
    grid-template-columns: minmax(0, auto) 30px;
    column-gap: 5px;
  }

  .delivery-person-summary .delivery-add-btn {
    width: 30px !important;
    height: 30px !important;
  }

  .delivery-person-spend {
    font-size: 14px;
  }

  #chatPanel > .chat-rank-drawer .mobile-rank-chip span {
    max-width: 122px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 760px) {
  .delivery-distribution-view-tabs {
    display: flex;
    width: 100%;
  }

  .delivery-distribution-view-tabs button {
    flex: 1 1 0;
  }

  .delivery-person-card {
    padding: 14px;
  }

  .delivery-person-head {
    flex-direction: column;
  }

  .delivery-person-summary {
    width: 100%;
    justify-content: space-between;
  }

  .delivery-person-details > summary {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .delivery-person-details > summary > small {
    display: none;
  }

  .delivery-overview-category > summary,
  .delivery-overview-product > summary {
    padding: 12px;
  }
}

/* 20260811: record/admin secondary navigation follows the title's left edge. */
@media (min-width: 761px) {
  .panel-header.panel-header-with-tabs.left-aligned-subnav {
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 12px !important;
  }

  .panel-header-with-tabs.left-aligned-subnav .panel-title-copy {
    grid-column: 1;
    grid-row: 1;
  }

  .panel-header-with-tabs.left-aligned-subnav .panel-header-tabs {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
  }
}

/* 20260811: compact ChatGPT-style composer controls. */
#chatPanel > form.composer,
#chatPanel.has-chat > form.composer,
#chatPanel:not(.has-chat) > form.composer {
  grid-template-columns: 82px minmax(0, 1fr) 70px 42px 42px !important;
  align-items: center !important;
  width: min(100%, var(--qy-chat)) !important;
  max-width: var(--qy-chat) !important;
  gap: 4px !important;
  margin-right: auto !important;
  margin-left: auto !important;
  min-height: 58px !important;
  padding: 6px 7px 6px 9px !important;
  border: 1px solid #d9e1ec !important;
  border-radius: 18px !important;
  background: #ffffff !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.1) !important;
}

#chatPanel > form.composer .mode-select,
#chatPanel.has-chat > form.composer .mode-select {
  grid-column: 1 !important;
  width: 78px !important;
  min-width: 78px !important;
  max-width: 78px !important;
  height: 42px !important;
  min-height: 42px !important;
  padding: 0 11px !important;
  border: 0 !important;
  border-radius: 12px !important;
  color: #202124 !important;
  background: #f4f5f6 !important;
  font-size: 14px !important;
  font-weight: 700 !important;
}

#chatPanel > form.composer textarea,
#chatPanel.has-chat > form.composer textarea {
  grid-column: 2 !important;
  padding-right: 10px !important;
  padding-left: 8px !important;
}

#chatPanel > form.composer .web-search-toggle,
#chatPanel.has-chat > form.composer .web-search-toggle {
  grid-column: 3 !important;
  width: 70px !important;
  min-width: 70px !important;
  height: 42px !important;
  min-height: 42px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  padding: 0 8px !important;
  border: 0 !important;
  border-radius: 12px !important;
  color: #202124 !important;
  background: transparent !important;
  box-shadow: none !important;
  animation: none !important;
  transform: none !important;
  align-self: center !important;
  justify-self: center !important;
  margin: 0 !important;
}

#chatPanel > form.composer .web-search-toggle:hover,
#chatPanel.has-chat > form.composer .web-search-toggle:hover {
  color: #111827 !important;
  background: #f4f5f6 !important;
  transform: none !important;
}

#chatPanel > form.composer .web-search-icon,
#chatPanel.has-chat > form.composer .web-search-icon {
  width: 18px !important;
  height: 18px !important;
  display: inline-grid !important;
  place-items: center !important;
  border-radius: 0 !important;
  color: currentColor !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 0 !important;
  line-height: 1 !important;
}

#chatPanel > form.composer .web-search-icon > svg,
#chatPanel.has-chat > form.composer .web-search-icon > svg {
  width: 18px !important;
  height: 18px !important;
  display: block !important;
}

#chatPanel > form.composer .web-search-label,
#chatPanel.has-chat > form.composer .web-search-label {
  display: inline !important;
  color: currentColor !important;
  font-size: 13px !important;
  font-weight: 650 !important;
}

#chatPanel > form.composer .web-search-toggle.checked,
#chatPanel > form.composer .web-search-toggle:has(input:checked),
#chatPanel.has-chat > form.composer .web-search-toggle.checked {
  color: #174ea6 !important;
  background: #edf4ff !important;
  box-shadow: none !important;
  animation: none !important;
}

#chatPanel > form.composer .web-search-toggle.checked::after,
#chatPanel > form.composer .web-search-toggle:has(input:checked)::after,
#chatPanel.has-chat > form.composer .web-search-toggle.checked::after {
  content: none !important;
  display: none !important;
}

#chatPanel > form.composer .voice-input-btn,
#chatPanel.has-chat > form.composer .voice-input-btn {
  grid-column: 4 !important;
  width: 42px !important;
  min-width: 42px !important;
  height: 42px !important;
  min-height: 42px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  color: #202124 !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
  align-self: center !important;
  justify-self: center !important;
  margin: 0 !important;
}

#chatPanel > form.composer .voice-input-btn:hover,
#chatPanel.has-chat > form.composer .voice-input-btn:hover {
  color: #111827 !important;
  background: #f4f5f6 !important;
  transform: none !important;
}

#chatPanel > form.composer .voice-input-btn > .voice-input-icon,
#chatPanel.has-chat > form.composer .voice-input-btn > .voice-input-icon {
  width: 22px !important;
  height: 22px !important;
  display: block !important;
  border: 0 !important;
  pointer-events: none !important;
}

#chatPanel > form.composer .voice-input-btn.is-recording,
#chatPanel.has-chat > form.composer .voice-input-btn.is-recording {
  color: #c5221f !important;
  background: #fce8e6 !important;
}

#chatPanel > form.composer .voice-input-btn.is-processing,
#chatPanel.has-chat > form.composer .voice-input-btn.is-processing {
  color: #174ea6 !important;
  background: #e8f0fe !important;
}

#chatPanel > form.composer .send-btn,
#chatPanel.has-chat > form.composer .send-btn,
#chatPanel:not(.has-chat) > form.composer .send-btn {
  grid-column: 5 !important;
  width: 42px !important;
  min-width: 42px !important;
  height: 42px !important;
  min-height: 42px !important;
  display: grid !important;
  place-items: center !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  color: #ffffff !important;
  background: #202124 !important;
  box-shadow: none !important;
  font-size: 0 !important;
  transform: none !important;
  align-self: center !important;
  justify-self: center !important;
  margin: 0 !important;
}

#chatPanel > form.composer .send-btn:hover,
#chatPanel.has-chat > form.composer .send-btn:hover,
#chatPanel:not(.has-chat) > form.composer .send-btn:hover {
  background: #34363a !important;
  transform: scale(1.04) !important;
}

#chatPanel > form.composer .send-btn::before,
#chatPanel.has-chat > form.composer .send-btn::before,
#chatPanel:not(.has-chat) > form.composer .send-btn::before {
  content: none !important;
  display: none !important;
}

#chatPanel > form.composer .send-btn::after,
#chatPanel.has-chat > form.composer .send-btn::after,
#chatPanel:not(.has-chat) > form.composer .send-btn::after {
  content: none !important;
  display: none !important;
}

#chatPanel > form.composer .send-btn > .send-btn-icon,
#chatPanel.has-chat > form.composer .send-btn > .send-btn-icon,
#chatPanel:not(.has-chat) > form.composer .send-btn > .send-btn-icon {
  width: 22px !important;
  height: 22px !important;
  display: block !important;
  pointer-events: none !important;
}

#chatPanel > form.composer .send-btn:disabled,
#chatPanel.has-chat > form.composer .send-btn:disabled,
#chatPanel:not(.has-chat) > form.composer .send-btn:disabled {
  color: #9ca3af !important;
  background: #e5e7eb !important;
}

#chatPanel > form.composer .send-btn:disabled::after,
#chatPanel.has-chat > form.composer .send-btn:disabled::after,
#chatPanel:not(.has-chat) > form.composer .send-btn:disabled::after {
  color: #9ca3af !important;
}

@media (max-width: 760px) {
  #chatPanel > form.composer,
  #chatPanel.has-chat > form.composer,
  #chatPanel:not(.has-chat) > form.composer {
    grid-template-columns: 58px minmax(0, 1fr) 40px 40px 40px !important;
    gap: 3px !important;
    padding: 5px 6px 5px 7px !important;
    border-radius: 16px !important;
  }

  #chatPanel > form.composer .mode-select,
  #chatPanel.has-chat > form.composer .mode-select {
    width: 56px !important;
    min-width: 56px !important;
    max-width: 56px !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 7px !important;
    border-radius: 10px !important;
    font-size: 13px !important;
  }

  #chatPanel > form.composer .web-search-toggle,
  #chatPanel.has-chat > form.composer .web-search-toggle {
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
    border-radius: 50% !important;
  }

  #chatPanel > form.composer .web-search-label,
  #chatPanel.has-chat > form.composer .web-search-label {
    display: none !important;
  }

  #chatPanel > form.composer .voice-input-btn,
  #chatPanel.has-chat > form.composer .voice-input-btn {
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
  }

  #chatPanel > form.composer .send-btn,
  #chatPanel.has-chat > form.composer .send-btn,
  #chatPanel:not(.has-chat) > form.composer .send-btn {
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
  }

  #chatPanel > form.composer .send-btn > .send-btn-icon,
  #chatPanel.has-chat > form.composer .send-btn > .send-btn-icon,
  #chatPanel:not(.has-chat) > form.composer .send-btn > .send-btn-icon {
    width: 20px !important;
    height: 20px !important;
  }
}

/* 20260811: final UI polish — chat dock, transparent avatars and delivery cards. */
#chatPanel > form.composer .web-search-toggle.checked .web-search-icon,
#chatPanel > form.composer .web-search-toggle:has(input:checked) .web-search-icon,
#chatPanel.has-chat > form.composer .web-search-toggle.checked .web-search-icon,
#chatPanel.has-chat > form.composer .web-search-toggle:has(input:checked) .web-search-icon {
  color: #174ea6 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

#chatPanel > form.composer .web-search-toggle.checked .web-search-icon > svg,
#chatPanel > form.composer .web-search-toggle:has(input:checked) .web-search-icon > svg,
#chatPanel.has-chat > form.composer .web-search-toggle.checked .web-search-icon > svg,
#chatPanel.has-chat > form.composer .web-search-toggle:has(input:checked) .web-search-icon > svg {
  display: block !important;
  color: inherit !important;
  fill: currentColor !important;
}

#chatPanel > form.composer .web-search-toggle.checked .web-search-icon path,
#chatPanel > form.composer .web-search-toggle:has(input:checked) .web-search-icon path,
#chatPanel.has-chat > form.composer .web-search-toggle.checked .web-search-icon path,
#chatPanel.has-chat > form.composer .web-search-toggle:has(input:checked) .web-search-icon path {
  fill: currentColor !important;
}

.avatar.has-image,
.mobile-app-avatar.has-image,
.message-avatar.has-image,
.chat-avatar-preview.has-image,
.assistant-avatar-preview.has-image,
.avatar-editor-preview.has-image,
.user-editor-avatar.has-image,
.user-card-avatar.has-image,
.delivery-person-avatar.has-image {
  overflow: hidden !important;
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}

.avatar.has-image img,
.mobile-app-avatar.has-image img,
.message-avatar.has-image img,
.chat-avatar-preview.has-image img,
.assistant-avatar-preview.has-image img,
.avatar-editor-preview.has-image img,
.user-editor-avatar.has-image img,
.user-card-avatar.has-image img,
.delivery-person-avatar.has-image img {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  border-radius: inherit !important;
  background: transparent !important;
  object-fit: cover !important;
}

.message-avatar.assistant-avatar.has-image img,
.assistant-avatar-preview.has-image img,
.avatar-editor-preview.has-image img {
  object-fit: contain !important;
}

.delivery-person-head {
  align-items: flex-start;
}

.delivery-person-identity {
  flex: 1 1 auto;
  align-items: flex-start;
}

.delivery-person-copy {
  min-width: 0;
}

.delivery-person-meta {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-person-summary {
  min-width: 104px;
  display: grid;
  grid-template-columns: minmax(0, auto) 32px;
  grid-template-rows: auto auto;
  align-items: center;
  justify-items: end;
  column-gap: 8px;
  row-gap: 2px;
  text-align: right;
}

.delivery-person-spend-label {
  grid-column: 1;
  grid-row: 1;
  color: #94a3b8 !important;
  font-size: 11px !important;
  font-weight: 600;
  line-height: 1.2;
}

.delivery-person-spend {
  grid-column: 1;
  grid-row: 2;
  color: #1757b8;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
}

.delivery-person-summary .delivery-add-btn {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  border: 1px solid #cfe0ff !important;
  border-radius: 10px !important;
  color: #1757b8 !important;
  background: #eef5ff !important;
}

.delivery-person-summary .delivery-add-btn:hover {
  border-color: #9ec1ff !important;
  background: #e3efff !important;
}

.delivery-platform-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #edf1f6;
}

.delivery-platform-summary-label {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.delivery-platform-total-list {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.delivery-platform-total {
  min-height: 34px;
  display: inline-grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 8px;
  padding: 6px 10px;
  border: 1px solid #d8e5f8;
  border-radius: 11px;
  background: #f6f9ff;
  white-space: nowrap;
}

.delivery-platform-total > span {
  grid-column: 1;
  grid-row: 1;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
}

.delivery-platform-total > strong {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: #1757b8;
  font-size: 14px;
  font-weight: 800;
}

.delivery-platform-total > small {
  grid-column: 1;
  grid-row: 2;
  color: #94a3b8;
  font-size: 10px;
}

.delivery-assignment-actions {
  display: grid;
  grid-template-columns: repeat(2, 68px);
  flex-wrap: nowrap;
  gap: 8px;
}

.delivery-action-btn {
  min-width: 68px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}

.delivery-action-btn:hover {
  transform: translateY(-1px);
}

.delivery-action-btn.is-edit {
  border-color: #cfe0ff;
  color: #1757b8;
  background: #eef5ff;
}

.delivery-action-btn.is-edit:hover {
  border-color: #9ec1ff;
  background: #e2edff;
}

.delivery-action-btn.is-delete {
  border-color: #fecaca;
  color: #b42318;
  background: #fff5f5;
}

.delivery-action-btn.is-delete:hover {
  border-color: #fca5a5;
  background: #feecec;
}

.chat-route-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 22px;
  margin: 0 0 8px;
  padding: 3px 8px;
  border: 1px solid #dbe5f4;
  border-radius: 999px;
  background: #f7f9fc;
  color: #607086;
  font-size: 11px;
  font-weight: 750;
  line-height: 1;
}

.chat-route-badge.is-system {
  border-color: #cfe0ff;
  background: #edf4ff;
  color: #1f5cae;
}

.chat-route-badge.is-realtime {
  border-color: #bde8d4;
  background: #edf9f3;
  color: #197a4c;
}

.chat-route-badge.is-model {
  border-color: #ded8ff;
  background: #f4f1ff;
  color: #6049ad;
}

.chat-agent-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: -2px 0 9px;
}

.chat-agent-step {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 3px 8px;
  border: 1px solid #dbe7df;
  border-radius: 999px;
  background: #f4faf6;
  color: #397254;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.2;
}

.chat-agent-step.is-error {
  border-color: #f3d1ce;
  background: #fff6f5;
  color: #a33d35;
}

.chat-agent-evidence {
  width: fit-content;
  max-width: 100%;
  margin: -2px 0 9px;
  color: #65758b;
  font-size: 10px;
}

.chat-agent-evidence summary {
  width: fit-content;
  padding: 3px 8px;
  border: 1px solid #dce5f0;
  border-radius: 999px;
  background: #f8fafc;
  color: #52637a;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.chat-agent-evidence summary::-webkit-details-marker {
  display: none;
}

.chat-agent-evidence summary::before {
  content: "▸";
  margin-right: 4px;
}

.chat-agent-evidence[open] summary::before {
  content: "▾";
}

.chat-agent-evidence-list {
  display: grid;
  gap: 4px;
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fbfcfe;
}

.chat-agent-evidence-item {
  line-height: 1.45;
  word-break: break-word;
}

.chat-agent-evidence-item::before {
  content: "✓";
  margin-right: 5px;
  color: #2f855a;
  font-weight: 800;
}

.chat-agent-evidence-item.is-partial::before {
  content: "!";
  color: #b7791f;
}

.chat-agent-assumptions {
  max-width: 100%;
  margin: -3px 0 9px;
  padding: 6px 9px;
  border-left: 2px solid #c7d7ef;
  color: #6b788b;
  font-size: 10px;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .chat-agent-steps {
    flex-wrap: nowrap;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .chat-agent-steps::-webkit-scrollbar {
    display: none;
  }

  .chat-agent-step {
    flex: 0 0 auto;
    font-size: 9px;
  }

  .chat-agent-evidence,
  .chat-agent-assumptions {
    font-size: 9px;
  }

  .chat-agent-evidence-list {
    max-width: min(78vw, 360px);
  }

  #chatPanel.panel.active {
    position: relative !important;
    height: 100dvh !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    padding: calc(56px + env(safe-area-inset-top)) 0 0 !important;
    overflow: hidden !important;
  }

  /* Only the active workspace panel may participate in the mobile layout. */
  .workspace > .panel:not(.active),
  .workspace > #chatPanel.panel:not(.active),
  .workspace > .panel[hidden] {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  #chatPanel > .quick-actions {
    flex: 0 0 auto !important;
  }

  #chatPanel > .chat-messages,
  #chatPanel:not(.has-chat) > .chat-messages,
  #chatPanel.has-chat > .chat-messages {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    min-height: 0 !important;
    flex: 1 1 auto !important;
    margin: 0 !important;
    padding: 14px 10px 18px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    transform: none !important;
    scroll-padding-bottom: 18px;
    overscroll-behavior: contain;
  }

  #chatPanel > form.composer,
  #chatPanel.has-chat > form.composer,
  #chatPanel:not(.has-chat) > form.composer {
    position: relative !important;
    inset: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    flex: 0 0 auto !important;
    width: calc(100% - 16px) !important;
    max-width: none !important;
    min-height: 52px !important;
    height: 52px !important;
    grid-template-columns: 56px minmax(0, 1fr) 38px 38px 40px !important;
    gap: 3px !important;
    margin: 6px 8px max(8px, env(safe-area-inset-bottom)) !important;
    padding: 5px 6px !important;
    overflow: hidden !important;
    border-radius: 16px !important;
    transform: none !important;
  }

  #chatPanel > form.composer .mode-select,
  #chatPanel.has-chat > form.composer .mode-select {
    width: 54px !important;
    min-width: 54px !important;
    max-width: 54px !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 6px !important;
    font-size: 12px !important;
  }

  #chatPanel > form.composer textarea,
  #chatPanel.has-chat > form.composer textarea {
    width: 100% !important;
    min-width: 0 !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    padding: 10px 3px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    word-break: normal !important;
    line-height: 20px !important;
    scrollbar-width: none;
  }

  #chatPanel > form.composer textarea::-webkit-scrollbar,
  #chatPanel.has-chat > form.composer textarea::-webkit-scrollbar {
    display: none;
  }

  #chatPanel > form.composer .web-search-toggle,
  #chatPanel.has-chat > form.composer .web-search-toggle,
  #chatPanel > form.composer .voice-input-btn,
  #chatPanel.has-chat > form.composer .voice-input-btn,
  #chatPanel > form.composer .send-btn,
  #chatPanel.has-chat > form.composer .send-btn,
  #chatPanel:not(.has-chat) > form.composer .send-btn {
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    align-self: center !important;
    justify-self: center !important;
  }

  #chatPanel > form.composer .send-btn,
  #chatPanel.has-chat > form.composer .send-btn,
  #chatPanel:not(.has-chat) > form.composer .send-btn {
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
  }

  .delivery-person-head {
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 8px;
  }

  .delivery-person-identity {
    min-width: 0;
    flex: 1 1 auto;
  }

  .delivery-person-summary {
    width: auto !important;
    min-width: 92px;
    flex: 0 0 auto;
    justify-content: end;
  }

  .delivery-person-meta {
    max-width: 180px;
    font-size: 11px;
    white-space: normal;
  }

  .delivery-person-spend {
    font-size: 15px;
  }

  .delivery-platform-summary {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 10px 0;
  }

  .delivery-platform-total-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    gap: 7px;
  }

  .delivery-platform-total {
    min-width: 0;
    width: 100%;
  }

  .delivery-platform-total > span,
  .delivery-platform-total > small {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .delivery-assignment-actions {
    grid-template-columns: repeat(2, 74px);
    justify-content: start;
  }

  .delivery-action-btn {
    min-width: 74px;
    height: 36px;
    border-radius: 10px;
    font-size: 13px;
  }
}

@media (max-width: 420px) {
  .delivery-platform-total-list {
    grid-template-columns: 1fr;
  }
}

/* qingyun-20260812: 常用工具最终覆盖层（避免通用表单样式反向覆盖） */
#toolsPanel .common-tools-switch-row {
  margin-bottom: 16px !important;
}

#toolsPanel .common-tools-tabs {
  width: fit-content !important;
  margin: 0 !important;
  padding-left: 0 !important;
  border-left: 0 !important;
}

#toolsPanel .meituan-tool-card {
  padding: 0 !important;
  border: 1px solid #dfe6f1 !important;
  border-radius: 22px !important;
  background: #fff !important;
  box-shadow: 0 12px 34px rgba(49, 72, 112, .08) !important;
}

#toolsPanel .meituan-tool-intro h2 {
  color: #172033 !important;
  font-size: 22px !important;
}

#toolsPanel .meituan-converter textarea {
  min-height: 210px !important;
  padding: 16px 17px !important;
  border: 1px solid #d8e1ee !important;
  border-radius: 15px !important;
  background: #fbfcfe !important;
  color: #26334a !important;
  box-shadow: none !important;
  font-size: 13px !important;
}

#toolsPanel .meituan-converter textarea:hover {
  border-color: #b9c9df !important;
}

#toolsPanel .meituan-converter textarea:focus {
  border-color: #4b83e8 !important;
  background: #fff !important;
  box-shadow: 0 0 0 4px rgba(75, 131, 232, .12) !important;
}

#toolsPanel .meituan-converter-column.is-result textarea {
  background: #f5f8ff !important;
  color: #285da9 !important;
}

#toolsPanel .meituan-tool-actions button {
  min-height: 44px !important;
  padding: 9px 16px !important;
  border-radius: 12px !important;
}

@media (max-width: 760px) {
  #toolsPanel .common-tools-switch-row {
    margin-bottom: 12px !important;
  }

  #toolsPanel .common-tools-tabs {
    width: 100% !important;
  }

  #toolsPanel .meituan-tool-card {
    border-radius: 18px !important;
  }

  #toolsPanel .meituan-tool-intro h2 {
    font-size: 17px !important;
  }

  #toolsPanel .meituan-converter textarea {
    min-height: 150px !important;
    padding: 13px !important;
    border-radius: 12px !important;
    font-size: 12px !important;
  }

  #toolsPanel .meituan-tool-actions button {
    min-height: 42px !important;
    padding: 8px 10px !important;
  }
}

/* qingyun-20260812: 沉浸式按住说话 */
body.voice-record-open {
  overflow: hidden !important;
  overscroll-behavior: none;
}

.voice-record-overlay {
  --voice-level: .18;
  position: fixed !important;
  inset: 0 !important;
  z-index: 2400 !important;
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) auto;
  width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(26px, env(safe-area-inset-top)) 24px max(28px, env(safe-area-inset-bottom));
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 50% 42%, rgba(68, 111, 222, .24), transparent 34%),
    rgba(12, 18, 31, .78);
  -webkit-backdrop-filter: blur(9px) saturate(.78);
  backdrop-filter: blur(9px) saturate(.78);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  animation: qy-voice-overlay-in .16s ease-out both;
}

@keyframes qy-voice-overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.voice-record-overlay[hidden] {
  display: none !important;
}

.voice-record-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding-top: 8vh;
  text-align: center;
}

.voice-overlay-hint {
  min-height: 26px;
  margin: 0 0 22px;
  color: rgba(255, 255, 255, .86);
  font-size: clamp(14px, 2.8vw, 17px);
  font-weight: 700;
  letter-spacing: .04em;
}

.voice-live-bubble {
  position: relative;
  width: min(440px, calc(100vw - 64px));
  height: clamp(108px, 18vh, 154px);
  display: grid;
  place-items: center;
  padding: 20px 28px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 30px;
  background: linear-gradient(135deg, #3978f6 0%, #5962ef 54%, #7259ea 100%);
  box-shadow: 0 28px 70px rgba(11, 28, 69, .36), inset 0 1px 0 rgba(255, 255, 255, .2);
  transform: translateZ(0) scale(calc(.985 + var(--voice-level) * .015));
  transition: transform .1s linear, background .2s ease, box-shadow .2s ease;
}

.voice-live-bubble::after {
  content: '';
  position: absolute;
  right: 42px;
  bottom: -10px;
  width: 23px;
  height: 23px;
  border-radius: 4px;
  background: #6960ec;
  transform: rotate(45deg);
}

.voice-live-wave {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 1.2vw, 8px);
}

.voice-live-wave i {
  width: clamp(3px, .75vw, 5px);
  height: calc(11px + var(--voice-level) * 36px);
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 0 10px rgba(255, 255, 255, .18);
  animation: qy-voice-live-wave .76s ease-in-out infinite alternate;
  transform-origin: center;
}

.voice-live-wave i:nth-child(2n) { animation-delay: -.52s; height: calc(16px + var(--voice-level) * 24px); }
.voice-live-wave i:nth-child(3n) { animation-delay: -.24s; height: calc(22px + var(--voice-level) * 40px); }
.voice-live-wave i:nth-child(4n) { animation-delay: -.66s; height: calc(9px + var(--voice-level) * 31px); }
.voice-live-wave i:nth-child(5n) { animation-delay: -.38s; height: calc(26px + var(--voice-level) * 32px); }

@keyframes qy-voice-live-wave {
  from { transform: scaleY(.54); opacity: .68; }
  to { transform: scaleY(1.06); opacity: 1; }
}

.voice-overlay-duration {
  margin-top: 25px;
  color: #fff;
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: .08em;
  text-shadow: 0 4px 18px rgba(0, 0, 0, .26);
}

.voice-overlay-state {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, .7);
  font-size: 13px;
}

.voice-record-gesture {
  width: min(520px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  justify-self: center;
  padding-bottom: min(3vh, 28px);
}

.voice-gesture-zone {
  min-height: 108px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 26px;
  color: rgba(255, 255, 255, .76);
  background: rgba(255, 255, 255, .08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07);
  transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease;
}

.voice-gesture-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, .12);
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
}

.voice-gesture-icon svg {
  width: 23px;
  height: 23px;
}

.voice-gesture-zone b {
  font-size: 14px;
  font-weight: 750;
}

.voice-record-overlay.is-recording .voice-send-zone {
  border-color: rgba(125, 164, 255, .46);
  color: #fff;
  background: rgba(66, 111, 226, .24);
  transform: translateY(-3px);
}

.voice-record-overlay.is-recording .voice-send-zone .voice-gesture-icon {
  background: linear-gradient(135deg, #3978f6, #655bea);
  box-shadow: 0 8px 24px rgba(54, 103, 227, .3);
}

.voice-record-overlay.is-cancel {
  background:
    radial-gradient(circle at 50% 42%, rgba(221, 73, 86, .22), transparent 34%),
    rgba(20, 15, 22, .82);
}

.voice-record-overlay.is-cancel .voice-live-bubble {
  background: linear-gradient(135deg, #ef5661, #d93e53);
  box-shadow: 0 28px 70px rgba(83, 12, 27, .32), inset 0 1px 0 rgba(255, 255, 255, .18);
}

.voice-record-overlay.is-cancel .voice-live-bubble::after {
  background: #df4658;
}

.voice-record-overlay.is-cancel .voice-cancel-zone {
  border-color: rgba(255, 124, 134, .58);
  color: #fff;
  background: rgba(220, 58, 75, .3);
  transform: translateY(-7px) scale(1.035);
}

.voice-record-overlay.is-cancel .voice-cancel-zone .voice-gesture-icon {
  background: linear-gradient(135deg, #f65b66, #d93850);
  box-shadow: 0 8px 24px rgba(193, 40, 58, .3);
}

.voice-record-overlay.is-opening .voice-live-wave i {
  height: 10px;
  animation-duration: 1.15s;
}

@media (max-width: 760px) {
  .voice-record-overlay {
    padding: max(22px, env(safe-area-inset-top)) 18px max(22px, env(safe-area-inset-bottom));
  }

  .voice-record-stage {
    justify-content: flex-end;
    padding: 12vh 0 5vh;
  }

  .voice-live-bubble {
    width: min(360px, calc(100vw - 48px));
    height: 118px;
    border-radius: 25px;
  }

  .voice-live-bubble::after {
    right: 34px;
  }

  .voice-overlay-duration {
    margin-top: 22px;
    font-size: 25px;
  }

  .voice-record-gesture {
    gap: 14px;
    padding-bottom: 2vh;
  }

  .voice-gesture-zone {
    min-height: 102px;
    border-radius: 23px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .voice-live-wave i {
    animation: none !important;
  }
}

/* qingyun-20260812: 业务缓存 + 日快照统一挂机页 */
.auto-sync-page {
  min-height: 100vh;
  color: var(--qy-text);
  background:
    radial-gradient(circle at 10% 0, rgba(37, 99, 235, .08), transparent 28%),
    #f5f7fa !important;
}

.auto-sync-page .auto-sync-shell {
  width: min(1240px, calc(100% - 40px));
}

.auto-sync-page .auto-sync-hero h1 {
  color: var(--qy-text-strong);
  font-size: 34px;
}

.auto-sync-page .auto-sync-live-card,
.auto-sync-page .auto-sync-settings-standalone,
.auto-sync-page .auto-sync-log-card,
.auto-sync-page .snapshot-keeper-card,
.auto-sync-page .history-relay-card {
  border: 1px solid #dfe6f1 !important;
  border-radius: 20px !important;
  background: rgba(255, 255, 255, .94) !important;
  box-shadow: 0 12px 32px rgba(33, 53, 88, .07) !important;
}

.snapshot-keeper-card {
  position: relative;
  overflow: hidden;
  margin-top: 18px;
  padding: 22px !important;
}

.history-relay-card {
  position: relative;
  overflow: hidden;
  margin-top: 18px;
  padding: 22px !important;
}

.history-relay-progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #eaf0f8;
}

.history-relay-progress > i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f6fe4, #5b5cf6);
  box-shadow: 0 2px 8px rgba(47, 111, 228, .26);
  transition: width .35s ease;
}

#historyRelayMessage {
  min-height: 22px;
  margin: 9px 0 0;
}

#historyRelayBadge.history-relay-status-running,
#historyRelayBadge.history-relay-status-queued {
  color: #1e5bb6 !important;
  background: #eaf2ff !important;
}

#historyRelayBadge.history-relay-status-success {
  color: #137447 !important;
  background: #e9f8f0 !important;
}

#historyRelayBadge.history-relay-status-partial,
#historyRelayBadge.history-relay-status-failed {
  color: #b33a44 !important;
  background: #fff0f1 !important;
}

.snapshot-keeper-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 360px;
  height: 180px;
  background: radial-gradient(circle at 100% 0, rgba(47, 111, 228, .13), transparent 68%);
  pointer-events: none;
}

.snapshot-keeper-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 18px;
}

.snapshot-keeper-head h2 {
  margin: 3px 0 4px;
  color: #172033;
  font-size: 23px;
}

.snapshot-keeper-head .subtle {
  max-width: 780px;
  margin: 0;
  color: #6d7a91;
}

.snapshot-keeper-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
}

#snapshotKeeperBadge.is-online {
  color: #137447 !important;
  background: #e9f8f0 !important;
}

#snapshotKeeperBadge.is-offline {
  color: #a15c00 !important;
  background: #fff7e6 !important;
}

.snapshot-keeper-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.snapshot-keeper-kpis > div {
  min-width: 0;
  padding: 14px;
  border: 1px solid #e2e8f2;
  border-radius: 14px;
  background: #f8faff;
}

.snapshot-keeper-kpis span,
.snapshot-keeper-kpis b {
  display: block;
}

.snapshot-keeper-kpis span {
  margin-bottom: 5px;
  color: #77859a;
  font-size: 12px;
  font-weight: 750;
}

.snapshot-keeper-kpis b {
  overflow: hidden;
  color: #26334a;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.snapshot-keeper-schedule {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.snapshot-keeper-schedule > span {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid #dbe6f8;
  border-radius: 13px;
  background: #f7faff;
}

.snapshot-keeper-schedule i {
  padding: 3px 7px;
  border-radius: 999px;
  color: #2f6fe4;
  background: #e9f1ff;
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}

.snapshot-keeper-schedule b {
  color: #244d8e;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.snapshot-keeper-schedule small {
  overflow: hidden;
  color: #7c899c;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#snapshotKeeperMessage {
  min-height: 22px;
  margin: 8px 0 0;
}

.snapshot-keeper-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 9px;
  padding-top: 15px;
  border-top: 1px solid #e7ecf4;
}

.snapshot-keeper-log-head b {
  color: #33435c;
  font-size: 14px;
}

.snapshot-keeper-log-head span {
  color: #8692a5;
  font-size: 12px;
}

.snapshot-keeper-logs {
  display: grid;
  gap: 7px;
  max-height: 260px;
  overflow: auto;
}

.snapshot-keeper-logs.empty {
  min-height: 66px;
  place-items: center;
  border: 1px dashed #d8e1ee !important;
  border-radius: 12px !important;
  background: #fafbfd !important;
}

.snapshot-keeper-logs > div {
  display: grid;
  grid-template-columns: 146px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e7ecf4;
  border-left: 3px solid #25a267;
  border-radius: 11px;
  background: #fbfcfe;
}

.snapshot-keeper-logs > div.is-error {
  border-left-color: #df4a55;
  background: #fffafa;
}

.snapshot-keeper-logs b,
.snapshot-keeper-logs span,
.snapshot-keeper-logs small {
  min-width: 0;
}

.snapshot-keeper-logs b {
  color: #526078;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.snapshot-keeper-logs span {
  overflow: hidden;
  color: #33435c;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.snapshot-keeper-logs small {
  color: #8a96a9;
  font-size: 11px;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .snapshot-keeper-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .snapshot-keeper-schedule {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .auto-sync-page .auto-sync-shell {
    width: min(100% - 24px, 720px);
  }

  .snapshot-keeper-head {
    display: grid;
  }

  .snapshot-keeper-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .snapshot-keeper-actions > * {
    width: 100%;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .snapshot-keeper-kpis {
    grid-template-columns: 1fr;
  }

  .snapshot-keeper-logs > div {
    grid-template-columns: 1fr auto;
  }

  .snapshot-keeper-logs span {
    grid-column: 1 / -1;
    grid-row: 2;
    white-space: normal;
  }
}

/* Delivery workspace final cascade overrides. */
.delivery-asset-overview-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(118px, 1fr));
  min-width: min(620px, 54vw);
}

.delivery-asset-overview-metrics > span { min-width: 0; }

.delivery-asset-batchbar {
  display: grid;
  grid-template-columns: minmax(210px, auto) auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 62px;
  padding: 10px 12px;
}

.delivery-asset-select-all {
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 13px;
}

.delivery-asset-select-all input {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  margin: 0;
}

.delivery-asset-select-all > span,
.delivery-asset-select-all b,
.delivery-asset-select-all small { display: block; }
.delivery-asset-select-all b { color: #334155; font-size: 13px; line-height: 1.25; }
.delivery-asset-select-all small { margin-top: 2px; color: #8a96a8; font-size: 10px; font-weight: 500; }

.delivery-asset-selected-count {
  padding-left: 14px;
  border-left: 1px solid #e3e9f1;
  color: #64748b;
  font-size: 12px;
  white-space: nowrap;
}

.delivery-asset-selected-count b {
  display: inline;
  margin: 0;
  color: #1f65c2;
  font-size: 14px;
}

.delivery-asset-batch-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  min-width: 0;
}

.delivery-asset-batch-controls select,
.delivery-asset-batch-controls .primary-btn {
  width: auto;
  height: 40px;
  min-height: 40px;
  margin: 0;
  font-size: 12px;
  line-height: 1.2;
}

.delivery-asset-batch-controls select { min-width: 156px; }
.delivery-asset-row-spend { min-width: 150px; }

@media (max-width: 1180px) {
  .delivery-asset-overview-metrics { width: 100%; min-width: 0; }
}

@media (max-width: 760px) {
  .delivery-asset-overview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .delivery-asset-batchbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
  .delivery-asset-batch-controls {
    grid-column: 1 / -1;
    align-items: stretch;
    flex-direction: column;
  }
  .delivery-asset-batch-controls select,
  .delivery-asset-batch-controls .primary-btn { width: 100%; }
}

/* Delivery performance analysis */
.delivery-performance-analysis {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.delivery-performance-analysis[hidden] { display: none !important; }

.delivery-analysis-filter-card {
  display: grid;
  grid-template-columns: minmax(240px, .75fr) minmax(620px, 2.25fr);
  gap: 24px;
  align-items: end;
  padding: 22px 24px;
}

.delivery-analysis-filter-copy h2,
.delivery-analysis-section-head h3 { margin: 0; color: #152238; }
.delivery-analysis-filter-copy h2 { font-size: 25px; }
.delivery-analysis-filter-copy p:last-child,
.delivery-analysis-section-head p:last-child { margin: 6px 0 0; color: #7b879a; font-size: 13px; line-height: 1.55; }

.delivery-analysis-filters {
  display: grid;
  grid-template-columns: 150px minmax(160px, 1fr) minmax(190px, 1.2fr) minmax(150px, 1fr) minmax(250px, auto);
  gap: 10px;
  align-items: end;
}

.delivery-analysis-filters label { min-width: 0; }
.delivery-analysis-filters label > span { display: block; margin: 0 0 7px; color: #546278; font-size: 12px; font-weight: 700; }
.delivery-analysis-filters input,
.delivery-analysis-filters select,
.delivery-analysis-filters .primary-btn { width: 100%; height: 42px; min-height: 42px; margin: 0; }
.delivery-analysis-filters .primary-btn { width: auto; white-space: nowrap; }

.delivery-analysis-refresh-actions {
  display: grid;
  grid-template-rows: auto 42px;
  gap: 7px;
  align-self: end;
  min-width: 250px;
}
.delivery-analysis-refresh-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  color: #546278;
  font-size: 12px;
  font-weight: 700;
}
.delivery-analysis-refresh-buttons {
  display: grid;
  grid-template-columns: auto auto;
  gap: 7px;
  align-items: stretch;
}
.delivery-analysis-refresh-actions .primary-btn,
.delivery-analysis-refresh-actions .ghost-btn {
  width: auto;
  height: 42px;
  min-height: 42px;
  margin: 0;
  padding: 0 13px;
  white-space: nowrap;
}
.delivery-analysis-auto-state {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  color: #77849a;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.delivery-analysis-auto-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a9b4c4;
}
.delivery-analysis-auto-state.is-active i {
  background: #17a76b;
  box-shadow: 0 0 0 4px rgba(23, 167, 107, .11);
}

.delivery-analysis-compare-bar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(270px, 1.25fr) auto 168px auto auto minmax(150px, auto);
  align-items: end;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid #dbe6f5;
  border-radius: 15px;
  background: linear-gradient(135deg, #f7faff 0%, #fbfdff 58%, #f6fbf9 100%);
}
.delivery-analysis-compare-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.delivery-analysis-compare-title > div { min-width: 0; }
.delivery-analysis-compare-title b,
.delivery-analysis-compare-title small { display: block; }
.delivery-analysis-compare-title b { color: #1f3150; font-size: 13px; }
.delivery-analysis-compare-title small { margin-top: 3px; color: #8190a5; font-size: 10px; line-height: 1.35; }
.delivery-analysis-compare-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: #e9f1ff;
  color: #2f6bdb;
  font-size: 18px;
  font-weight: 900;
}
.delivery-analysis-compare-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid #d8e3f2;
  border-radius: 12px;
  background: #fff;
  color: #34506f;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.delivery-analysis-compare-switch input { width: 17px; height: 17px; min-height: 0; margin: 0; accent-color: #2f6de0; }
.delivery-analysis-compare-date > span { display: block; margin-bottom: 5px; color: #607089; font-size: 10px; font-weight: 750; }
.delivery-analysis-compare-date input { width: 100%; height: 40px; min-height: 40px; }
.delivery-analysis-compare-date.is-disabled { opacity: .48; }
.delivery-analysis-compare-presets,
.delivery-analysis-compare-modes,
.delivery-analysis-chart-views {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  background: #fff;
}
.delivery-analysis-compare-presets button,
.delivery-analysis-compare-modes button,
.delivery-analysis-chart-views button {
  min-height: 31px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #68778c;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}
.delivery-analysis-compare-presets button.active,
.delivery-analysis-compare-modes button.active,
.delivery-analysis-chart-views button.active {
  background: #eaf2ff;
  color: #245fbf;
  box-shadow: inset 0 0 0 1px #d3e2fb;
}
.delivery-analysis-compare-presets button:disabled,
.delivery-analysis-compare-modes button:disabled { cursor: default; opacity: .45; }
.delivery-analysis-compare-alignment {
  align-self: center;
  justify-self: end;
  color: #66758b;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}
.delivery-analysis-compare-bar.is-disabled .delivery-analysis-compare-alignment { color: #9aa5b3; }

.delivery-analysis-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 32px;
}

.delivery-analysis-status span,
.delivery-analysis-status em {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 5px 11px;
  border: 1px solid #dfe7f2;
  border-radius: 999px;
  background: #fff;
  color: #758195;
  font-size: 11px;
  font-style: normal;
}
.delivery-analysis-status b { color: #1d5cb5; font-size: 12px; }
.delivery-analysis-status em { border-color: #f2dfb4; background: #fffaf0; color: #9b6a12; }

.delivery-analysis-compare-insight {
  display: grid;
  grid-template-columns: minmax(280px, 1.35fr) minmax(360px, 1fr);
  gap: 14px;
  align-items: center;
  padding: 15px 17px;
  border: 1px solid #dce6f3;
  border-left: 4px solid #6b86aa;
  border-radius: 15px;
  background: #fff;
}
.delivery-analysis-compare-insight[hidden] { display: none !important; }
.delivery-analysis-compare-insight.is-good { border-left-color: #16a06c; background: linear-gradient(90deg, #f4fcf8, #fff 42%); }
.delivery-analysis-compare-insight.is-risk { border-left-color: #df3f4e; background: linear-gradient(90deg, #fff7f7, #fff 42%); }
.delivery-analysis-compare-insight.is-warning { border-left-color: #df971e; background: linear-gradient(90deg, #fffaf2, #fff 42%); }
.delivery-analysis-compare-conclusion > span { display: block; color: #6f7f95; font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.delivery-analysis-compare-conclusion b { display: block; margin-top: 5px; color: #1f2f48; font-size: 15px; }
.delivery-analysis-compare-conclusion p { margin: 5px 0 0; color: #68778b; font-size: 11px; line-height: 1.55; }
.delivery-analysis-compare-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.delivery-analysis-compare-facts span { min-width: 0; padding: 9px 10px; border: 1px solid #e5ebf3; border-radius: 11px; background: rgba(255,255,255,.88); }
.delivery-analysis-compare-facts small,
.delivery-analysis-compare-facts b { display: block; }
.delivery-analysis-compare-facts small { color: #8591a3; font-size: 9px; }
.delivery-analysis-compare-facts b { margin-top: 4px; color: #26364e; font-size: 12px; font-variant-numeric: tabular-nums; }

.delivery-analysis-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 10px;
}

.delivery-analysis-kpi { 
  position: relative;
  overflow: hidden;
  min-height: 126px;
  padding: 19px 18px;
}

.delivery-analysis-kpi::after {
  content: "";
  position: absolute;
  top: -28px;
  right: -24px;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: #eaf1ff;
}
.delivery-analysis-kpi.is-1::after { background: #e4f7ea; }
.delivery-analysis-kpi.is-2::after { background: #e5f4f7; }
.delivery-analysis-kpi.is-3::after { background: #fff0e7; }
.delivery-analysis-kpi.is-4::after { background: #ffe9ec; }
.delivery-analysis-kpi.is-5::after { background: #f2ebff; }
.delivery-analysis-kpi.is-6::after { background: #ffe9f0; }
.delivery-analysis-kpi.is-7::after { background: #f2ece9; }
.delivery-analysis-kpi.is-8::after { background: #e9f2ff; }
.delivery-analysis-kpi.is-9::after { background: #edf8f2; }
.delivery-analysis-kpi.is-10::after { background: #fff1e2; }
.delivery-analysis-kpi.is-11::after { background: #eee9ff; }
.delivery-analysis-kpi > * { position: relative; z-index: 1; display: block; }
.delivery-analysis-kpi span { color: #718097; font-size: 12px; font-weight: 700; }
.delivery-analysis-kpi b { margin-top: 11px; color: #14213a; font-size: clamp(23px, 2vw, 32px); line-height: 1; letter-spacing: -.04em; }
.delivery-analysis-kpi small { margin-top: 13px; color: #8c98aa; font-size: 10px; line-height: 1.4; }
.delivery-analysis-kpi .delivery-analysis-kpi-compare {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 8px;
  margin-top: 10px;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}
.delivery-analysis-kpi .delivery-analysis-kpi-compare span { color: #7a8799; font-size: 9px; }
.delivery-analysis-kpi .delivery-analysis-kpi-compare em { padding: 2px 6px; border-radius: 999px; background: #eef2f7; color: #66758a; font-style: normal; font-weight: 850; }
.delivery-analysis-kpi .delivery-analysis-kpi-compare em.is-good { background: #e7f8ef; color: #118553; }
.delivery-analysis-kpi .delivery-analysis-kpi-compare em.is-bad { background: #ffebed; color: #cf3342; }
.delivery-analysis-kpi .delivery-analysis-kpi-compare.is-unavailable span { color: #a06d18; }
.delivery-analysis-kpi:has(.delivery-analysis-kpi-compare) { min-height: 148px; }

.delivery-analysis-chart-card,
.delivery-analysis-table-card { padding: 22px 24px; }
.delivery-analysis-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.delivery-analysis-section-head h3 { font-size: 19px; }
.delivery-analysis-chart-tools {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  justify-items: end;
  gap: 10px;
  width: 100%;
  min-width: 0;
}
.delivery-analysis-chart-views { justify-self: end; }
.delivery-analysis-chart-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.delivery-analysis-chart-actions .ghost-btn {
  width: auto;
  min-height: 34px;
  height: 34px;
  margin: 0;
  padding: 0 12px;
  font-size: 11px;
}
.delivery-analysis-mobile-range { display: none !important; }

.delivery-analysis-metric-toggles {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 7px;
  width: 100%;
  max-width: none;
  overflow-x: auto;
  padding: 2px 1px 5px;
  scrollbar-width: thin;
}
.delivery-analysis-metric-toggles button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid #dce5f1;
  border-radius: 999px;
  background: #fff;
  color: #657389;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  flex: 0 0 auto;
}
.delivery-analysis-metric-toggles button i { width: 8px; height: 8px; border-radius: 50%; background: var(--metric-color); }
.delivery-analysis-metric-toggles button.active { border-color: var(--metric-color); background: var(--metric-color); color: #fff; box-shadow: 0 7px 18px color-mix(in srgb, var(--metric-color) 20%, transparent); }
.delivery-analysis-metric-toggles button.active i { background: #fff; }

.delivery-analysis-chart {
  height: 438px;
  min-height: 438px;
  margin-top: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}
.delivery-analysis-combined {
  min-width: 980px;
  height: 430px;
  overflow: hidden;
  border: 1px solid #e0e8f3;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
}
.delivery-analysis-scale-note,
.delivery-analysis-series-summary {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
}
.delivery-analysis-scale-note { border-bottom: 1px solid #edf2f7; color: #7a879b; font-size: 11px; }
.delivery-analysis-scale-note span { padding: 4px 8px; border-radius: 999px; background: #edf4ff; color: #2b63b5; font-weight: 800; }
.delivery-analysis-scale-note b { font-weight: 600; }
.delivery-analysis-combined-canvas { height: 330px; padding: 0 8px; }
.delivery-analysis-combined-canvas svg { display: block; width: 100%; height: 330px; }
.delivery-analysis-series-summary { min-height: 48px; flex-wrap: nowrap; overflow-x: auto; border-top: 1px solid #edf2f7; scrollbar-width: thin; }
.delivery-analysis-series-summary > span { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 5px; color: #5f6d82; font-size: 11px; white-space: nowrap; }
.delivery-analysis-series-summary i { width: 8px; height: 8px; border-radius: 50%; background: var(--metric-color); }
.delivery-analysis-series-summary b { color: #2a374c; }
.delivery-analysis-series-summary small { color: #8a96a8; }
.delivery-analysis-chart > .empty-state { min-height: 430px; height: 430px; }
.delivery-analysis-chart .analysis-grid-line { stroke: #e5ebf4; stroke-width: 1; }
.delivery-analysis-chart .analysis-axis-label { fill: #768397; font-size: 11px; font-weight: 600; }
.delivery-analysis-chart .analysis-point-label { font-size: 10px; font-weight: 800; }
.delivery-analysis-chart .analysis-point-label-group rect { stroke-width: 1; fill-opacity: .94; }
.delivery-analysis-chart .analysis-label-leader { stroke-width: 1; stroke-opacity: .5; stroke-dasharray: 2 2; }
.delivery-analysis-chart .analysis-series-line { filter: drop-shadow(0 4px 5px rgba(32, 72, 148, .12)); }
.delivery-analysis-chart .analysis-series-point { stroke: #fff; stroke-width: 2px; }
.delivery-analysis-chart .analysis-compare-line { stroke-width: 3.5px; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 4px 5px rgba(32, 72, 148, .12)); }
.delivery-analysis-chart .analysis-compare-line.is-previous { stroke-width: 2.5px; stroke-dasharray: 9 8; opacity: .58; }
.delivery-analysis-chart .analysis-compare-point { stroke-width: 2px; }
.delivery-analysis-chart .analysis-compare-point.is-current { stroke: #fff; }
.delivery-analysis-chart .analysis-compare-point.is-previous { opacity: .75; }
.delivery-analysis-chart .analysis-compare-value-label text { font-size: 10px; font-weight: 850; font-variant-numeric: tabular-nums; }
.delivery-analysis-chart .analysis-compare-value-label rect { stroke-width: 1.2px; filter: drop-shadow(0 3px 5px rgba(31, 48, 78, .12)); }
.delivery-analysis-chart .analysis-compare-value-label.is-previous text { font-weight: 800; }
.delivery-analysis-chart .analysis-compare-value-label.is-previous rect { stroke-dasharray: 3 2; }
.delivery-analysis-compare-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 48px;
  padding: 9px 16px;
  border-top: 1px solid #edf2f7;
  overflow-x: auto;
}
.delivery-analysis-compare-legend > span { display: inline-flex; align-items: center; gap: 6px; color: #68768a; font-size: 10px; white-space: nowrap; }
.delivery-analysis-compare-legend i { width: 22px; height: 3px; border-radius: 99px; background: var(--metric-color); }
.delivery-analysis-compare-legend .is-previous i { height: 2px; background: repeating-linear-gradient(90deg, var(--metric-color) 0 5px, transparent 5px 9px); opacity: .7; }
.delivery-analysis-compare-legend strong { color: #23334a; font-size: 12px; }
.delivery-analysis-compare-legend em { margin-left: auto; padding: 5px 9px; border-radius: 999px; background: #eef2f7; color: #607086; font-size: 10px; font-style: normal; font-weight: 850; white-space: nowrap; }
.delivery-analysis-compare-legend em.is-good { background: #e6f8ee; color: #118553; }
.delivery-analysis-compare-legend em.is-bad { background: #ffeaed; color: #cb3040; }

.delivery-analysis-chart-card:fullscreen,
.delivery-analysis-chart-card.is-chart-expanded {
  position: fixed;
  inset: 0;
  z-index: 2000;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 24px;
  overflow: auto;
  border-radius: 0;
  background: #f6f9fd;
}
.delivery-analysis-chart-card:fullscreen .delivery-analysis-chart,
.delivery-analysis-chart-card.is-chart-expanded .delivery-analysis-chart { height: calc(100vh - 150px); }
.delivery-analysis-chart-card:fullscreen .delivery-analysis-combined,
.delivery-analysis-chart-card.is-chart-expanded .delivery-analysis-combined { height: calc(100vh - 170px); }
.delivery-analysis-chart-card:fullscreen .delivery-analysis-combined-canvas,
.delivery-analysis-chart-card:fullscreen .delivery-analysis-combined-canvas svg,
.delivery-analysis-chart-card.is-chart-expanded .delivery-analysis-combined-canvas,
.delivery-analysis-chart-card.is-chart-expanded .delivery-analysis-combined-canvas svg { height: calc(100vh - 275px); }

.delivery-analysis-table-wrap { margin-top: 16px; overflow: auto; border: 1px solid #e1e8f2; border-radius: 14px; }
.delivery-analysis-table { width: 100%; min-width: 960px; border-collapse: collapse; background: #fff; color: #334155; font-size: 12px; }
.delivery-analysis-hourly-table { min-width: 1320px; }
.delivery-analysis-channel-table { min-width: 1730px; }
.delivery-analysis-table th,
.delivery-analysis-table td { padding: 13px 12px; border-bottom: 1px solid #edf1f6; text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.delivery-analysis-table thead th { position: sticky; top: 0; z-index: 1; background: #f6f8fb; color: #627087; font-size: 11px; font-weight: 800; }
.delivery-analysis-table tbody tr:hover { background: #f8fbff; }
.delivery-analysis-table tbody tr:last-child td { border-bottom: 0; }
.delivery-analysis-table tfoot th { border-top: 1px solid #dce5f1; border-bottom: 0; background: #f5f8fc; color: #1f2b40; font-weight: 800; }
.delivery-analysis-channel-table td:nth-child(2),
.delivery-analysis-channel-table td:nth-child(4) { text-align: left; }
.delivery-analysis-hourly-table th:first-child,
.delivery-analysis-hourly-table td:first-child { text-align: center; }
.delivery-analysis-hourly-table th:not(:first-child),
.delivery-analysis-hourly-table td:not(:first-child),
.delivery-analysis-hourly-table tfoot th:not(:first-child) { text-align: right; }
.delivery-analysis-channel-table th:nth-child(n+6),
.delivery-analysis-channel-table td:nth-child(n+6) { text-align: right; }
.delivery-analysis-channel-table th:nth-child(3),
.delivery-analysis-channel-table td:nth-child(3),
.delivery-analysis-channel-table th:nth-child(5),
.delivery-analysis-channel-table td:nth-child(5) { text-align: center; }
.delivery-analysis-channel-table td:nth-child(2) b,
.delivery-analysis-channel-table td:nth-child(2) small { display: block; }
.delivery-analysis-channel-table td:nth-child(2) b { max-width: 300px; overflow: hidden; text-overflow: ellipsis; color: #1d2a40; }
.delivery-analysis-channel-table td:nth-child(2) small { margin-top: 4px; color: #8a96a8; font-size: 10px; }
.delivery-analysis-table .is-valid { color: #0d9b4e; font-weight: 800; }
.delivery-analysis-table .is-revenue { color: #087d61; font-weight: 800; }
.delivery-analysis-table .is-valid-cost { color: #6d28d9; font-weight: 800; }
.delivery-analysis-table .is-risk { color: #eb6a18; font-weight: 800; }
.delivery-analysis-table .is-danger { color: #e22d39; font-weight: 800; }
.delivery-analysis-table .is-good-roi { color: #0d9b4e; }
.delivery-analysis-table-delta { display: inline-flex; padding: 3px 7px; border-radius: 999px; background: #eef2f7; color: #637188; font-size: 10px; font-weight: 850; }
.delivery-analysis-table-delta.is-good { background: #e6f8ee; color: #118553; }
.delivery-analysis-table-delta.is-bad { background: #ffeaed; color: #cb3040; }
.delivery-analysis-compare-hourly-table { min-width: 1260px; }
.delivery-analysis-rank { display: inline-grid; place-items: center; width: 27px; height: 27px; border-radius: 9px; background: #edf3fb; color: #55657b; font-weight: 800; }
.delivery-analysis-channel-table tbody tr:nth-child(-n+3) .delivery-analysis-rank { background: #fff1cf; color: #bf7410; }
.delivery-analysis-delivery-status { display: inline-flex; align-items: center; justify-content: center; min-width: 58px; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 850; }
.delivery-analysis-delivery-status.is-running { color: #12805c; background: #e8f7f0; }
.delivery-analysis-delivery-status.is-emptied { color: #c92a3a; background: #ffedf0; }
.delivery-analysis-boost-status { display: inline-flex; align-items: center; justify-content: center; min-width: 58px; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 850; }
.delivery-analysis-boost-status.is-enabled { color: #1769d2; background: #eaf2ff; }
.delivery-analysis-boost-status.is-disabled { color: #7b8799; background: #eef2f6; }

@media (max-width: 1500px) {
  .delivery-analysis-kpis { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
  .delivery-analysis-filter-card { grid-template-columns: 1fr; }
  .delivery-analysis-compare-bar { grid-template-columns: minmax(260px, 1fr) auto 168px auto auto; }
  .delivery-analysis-compare-alignment { grid-column: 1 / -1; justify-self: start; }
}

@media (max-width: 980px) {
  .delivery-analysis-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .delivery-analysis-filters .primary-btn { width: 100%; }
  .delivery-analysis-section-head { flex-direction: column; }
  .delivery-analysis-metric-toggles { justify-content: flex-start; max-width: none; }
  .delivery-analysis-chart-tools { grid-template-columns: 1fr; width: 100%; justify-items: stretch; }
  .delivery-analysis-chart-views { justify-self: start; }
  .delivery-analysis-chart-actions { justify-content: flex-start; }
  .delivery-analysis-compare-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; }
  .delivery-analysis-compare-title { grid-column: 1 / -1; }
  .delivery-analysis-compare-switch { justify-content: center; }
  .delivery-analysis-compare-presets,
  .delivery-analysis-compare-modes { width: 100%; }
  .delivery-analysis-compare-presets button,
  .delivery-analysis-compare-modes button { flex: 1 1 0; }
  .delivery-analysis-compare-insight { grid-template-columns: 1fr; }
}

@media (min-width: 981px) {
  .delivery-analysis-chart-card .delivery-analysis-section-head {
    display: grid;
    grid-template-columns: minmax(220px, auto) minmax(0, 1fr);
    align-items: center;
    gap: 18px;
  }
}

@media (max-width: 680px) {
  .delivery-analysis-filter-card,
  .delivery-analysis-chart-card,
  .delivery-analysis-table-card { padding: 16px; }
  .delivery-analysis-filters { grid-template-columns: 1fr; }
  .delivery-analysis-refresh-actions { min-width: 0; }
  .delivery-analysis-refresh-buttons { grid-template-columns: 1fr 1fr; }
  .delivery-analysis-refresh-actions .primary-btn,
  .delivery-analysis-refresh-actions .ghost-btn { width: 100%; }
  .delivery-analysis-compare-bar { grid-template-columns: 1fr 1fr; padding: 12px; }
  .delivery-analysis-compare-title,
  .delivery-analysis-compare-presets,
  .delivery-analysis-compare-modes,
  .delivery-analysis-compare-alignment { grid-column: 1 / -1; }
  .delivery-analysis-compare-switch { min-width: 0; }
  .delivery-analysis-compare-date { min-width: 0; }
  .delivery-analysis-compare-title small { max-width: 270px; }
  .delivery-analysis-compare-insight { padding: 14px; }
  .delivery-analysis-compare-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .delivery-analysis-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .delivery-analysis-kpi { min-height: 138px; padding: 16px; }
  .delivery-analysis-section-head { gap: 13px; }
  .delivery-analysis-metric-toggles {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding: 1px 1px 7px;
    scroll-snap-type: x proximity;
  }
  .delivery-analysis-metric-toggles button { flex: 0 0 auto; scroll-snap-align: start; }
  .delivery-analysis-mobile-range { display: inline-flex !important; }
  .delivery-analysis-chart { height: 402px; min-height: 402px; margin-right: -16px; padding-right: 16px; }
  .delivery-analysis-combined { min-width: 720px; height: 394px; }
  .delivery-analysis-scale-note { position: sticky; left: 0; width: min(100vw - 64px, 360px); }
  .delivery-analysis-combined-canvas,
  .delivery-analysis-combined-canvas svg { height: 300px; }
  .delivery-analysis-series-summary { min-height: 55px; flex-wrap: nowrap; overflow-x: auto; }
  .delivery-analysis-chart > .empty-state { min-height: 394px; height: 394px; }
  .delivery-analysis-compare-legend { position: sticky; left: 0; width: min(100vw - 64px, 390px); gap: 9px; }
  .delivery-analysis-compare-legend em { margin-left: 0; }
  .delivery-analysis-table-card:has(.delivery-analysis-compare-hourly-table) .delivery-analysis-table-wrap { overflow: visible; border: 0; }
  .delivery-analysis-compare-hourly-table,
  .delivery-analysis-compare-hourly-table tbody,
  .delivery-analysis-compare-hourly-table tr,
  .delivery-analysis-compare-hourly-table td { display: block; width: 100%; min-width: 0; }
  .delivery-analysis-compare-hourly-table { background: transparent; }
  .delivery-analysis-compare-hourly-table thead,
  .delivery-analysis-compare-hourly-table tfoot { display: none; }
  .delivery-analysis-compare-hourly-table tbody { display: grid; gap: 10px; }
  .delivery-analysis-compare-hourly-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
    border: 1px solid #dfe7f2;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 5px 16px rgba(31, 48, 78, .06);
  }
  .delivery-analysis-compare-hourly-table tbody td {
    min-height: 51px;
    padding: 8px 9px;
    border: 0;
    border-radius: 10px;
    background: #f7f9fc;
    text-align: left !important;
    white-space: normal;
  }
  .delivery-analysis-compare-hourly-table tbody td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 5px;
    color: #8490a2;
    font-size: 9px;
    font-weight: 750;
  }
  .delivery-analysis-compare-hourly-table tbody td:first-child {
    grid-column: 1 / -1;
    min-height: 40px;
    background: #edf4ff;
    color: #225db6;
    font-size: 15px;
    font-weight: 900;
  }
  .delivery-analysis-compare-hourly-table tbody td:first-child::before { display: none; }
}

/* Account analysis · AI operations center */
.delivery-live-monitor {
  --live-blue: #2563eb;
  --live-green: #0f9f6e;
  --live-amber: #d99010;
  --live-red: #dc3947;
  min-height: 100%;
  padding: 22px;
  color: #172033;
  background: #f4f7fb;
}

.delivery-live-hero,
.delivery-live-section-head,
.delivery-live-actions,
.delivery-live-freshness {
  display: flex;
  align-items: center;
}

.delivery-live-hero {
  justify-content: space-between;
  gap: 24px;
  padding: 24px 26px;
  border: 1px solid #dce6f4;
  border-radius: 20px;
  background: linear-gradient(135deg, #fff 0%, #f1f7ff 100%);
  box-shadow: 0 12px 32px rgba(31, 62, 112, .06);
}

.delivery-live-hero h2,
.delivery-live-section-head h3 {
  margin: 4px 0 0;
}

.delivery-live-hero-copy > p:last-child,
.delivery-live-section-head p {
  margin: 6px 0 0;
  color: #6f7e94;
}

.delivery-live-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.delivery-live-connection,
.delivery-live-countdown,
.delivery-live-source {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #dce6f4;
  border-radius: 999px;
  background: #fff;
  color: #617087;
  font-size: 13px;
  white-space: nowrap;
}

.delivery-live-connection i {
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--live-green);
  box-shadow: 0 0 0 5px rgba(15, 159, 110, .12);
}

.delivery-live-connection.is-loading i { background: var(--live-blue); animation: livePulse 1s infinite; }
.delivery-live-connection.is-error i { background: var(--live-red); box-shadow: 0 0 0 5px rgba(220, 57, 71, .12); }

@keyframes livePulse {
  50% { opacity: .35; transform: scale(.82); }
}

.delivery-live-freshness {
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 14px 0;
  padding: 12px 18px;
  border: 1px solid #dfe7f2;
  border-radius: 14px;
  background: #fff;
  color: #758399;
  font-size: 13px;
}

.delivery-live-freshness span:first-child i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--live-green);
}
.delivery-live-freshness.is-warning { border-color: #f0d8a0; background: #fffaf0; }
.delivery-live-freshness.is-danger { border-color: #f3bcc4; background: #fff4f5; }
.delivery-live-freshness.is-warning span:first-child i { background: var(--live-amber); }
.delivery-live-freshness.is-danger span:first-child i { background: var(--live-red); }
.delivery-live-data-health b { color: #334155; }
.delivery-live-freshness.is-warning .delivery-live-data-health b { color: #946200; }
.delivery-live-freshness.is-danger .delivery-live-data-health b { color: #b82437; }

.delivery-live-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.delivery-live-kpis article {
  min-width: 0;
  padding: 18px;
  border: 1px solid #dfe7f2;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(31, 62, 112, .04);
}

.delivery-live-kpis small,
.delivery-live-kpis span {
  display: block;
  color: #7b889b;
}

.delivery-live-kpis b {
  display: block;
  margin: 8px 0 5px;
  color: #164fa6;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1;
}

.delivery-live-kpis span { font-size: 12px; }

.delivery-live-action-summary {
  margin-top: 14px;
  padding: 20px;
  border: 1px solid #dfe7f2;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(31, 62, 112, .04);
}

.delivery-live-priority-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.delivery-live-priority-head h3 { margin: 3px 0 0; font-size: 20px; }
.delivery-live-priority-head p { margin: 0; }
.delivery-live-priority-head span,
.delivery-live-priority-head > small { color: #7a8799; font-size: 12px; }
.delivery-live-priority-head > div > span { display: block; margin-top: 5px; }
.delivery-live-priority-head > small { flex: 0 0 auto; }

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

.delivery-live-priority-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 248px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid #dfe7f2;
  border-radius: 16px;
  background: linear-gradient(145deg, #fff, #f8fafc);
  color: #26364d;
  text-align: left;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.delivery-live-priority-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #a7b4c6;
  content: '';
}

.delivery-live-priority-card:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(31, 62, 112, .09); }
.delivery-live-priority-card.is-active { box-shadow: 0 0 0 2px rgba(47, 110, 237, .18), 0 12px 28px rgba(31, 62, 112, .08); }
.delivery-live-priority-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 13px; }
.delivery-live-priority-card-head em { display: inline-grid; place-content: center; min-width: 34px; height: 24px; padding: 0 8px; border-radius: 999px; background: #edf2f8; color: #526178; font-size: 11px; font-style: normal; font-weight: 800; }
.delivery-live-priority-card-head small { overflow: hidden; color: #75849a; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-overflow: ellipsis; white-space: nowrap; }
.delivery-live-priority-card-head > i { margin-left: auto; padding: 4px 7px; border-radius: 999px; background: #e7f4ff; color: #2464ad; font-size: 10px; font-style: normal; font-weight: 750; letter-spacing: 0; }
.delivery-live-priority-card > strong { overflow: hidden; color: #1c2a3e; font-size: 16px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.delivery-live-priority-card > b { margin-top: 7px; color: #315d9d; font-size: 25px; line-height: 1.1; }
.delivery-live-priority-detail { min-height: 42px; margin-top: 10px; color: #637187; font-size: 13px; line-height: 1.6; }
.delivery-live-priority-meta { margin-top: 7px; color: #8a96a8; font-size: 11px; }
.delivery-live-priority-next { display: flex; align-items: center; gap: 7px; margin-top: auto; padding-top: 12px; border-top: 1px solid #e8edf4; color: #3b536f; font-size: 12px; font-weight: 650; }
.delivery-live-priority-next small { color: #8a96a8; font-size: 11px; font-weight: 500; }
.delivery-live-priority-next i { margin-left: auto; font-size: 17px; font-style: normal; }
.delivery-live-priority-card.is-danger { border-color: #f2c4ca; background: linear-gradient(145deg, #fff 55%, #fff3f4); }
.delivery-live-priority-card.is-danger::before { background: var(--live-red); }
.delivery-live-priority-card.is-danger .delivery-live-priority-card-head em { background: #ffe6ea; color: #bd2638; }
.delivery-live-priority-card.is-danger > b { color: #c52c3f; }
.delivery-live-priority-card.is-warning { border-color: #f0dbab; background: linear-gradient(145deg, #fff 55%, #fff9ed); }
.delivery-live-priority-card.is-warning::before { background: var(--live-amber); }
.delivery-live-priority-card.is-warning .delivery-live-priority-card-head em { background: #fff1cf; color: #946000; }
.delivery-live-priority-card.is-warning > b { color: #9b6500; }
.delivery-live-priority-card.is-opportunity { border-color: #c9daf8; background: linear-gradient(145deg, #fff 55%, #eff6ff); }
.delivery-live-priority-card.is-opportunity::before { background: var(--live-blue); }
.delivery-live-priority-card.is-opportunity .delivery-live-priority-card-head em { background: #e5efff; color: #1e5db9; }
.delivery-live-priority-card.is-opportunity > b { color: #1f5fb8; }
.delivery-live-priority-card.is-quality { border-color: #c6e8da; background: linear-gradient(145deg, #fff 55%, #ecfaf4); }
.delivery-live-priority-card.is-quality::before,
.delivery-live-priority-card.is-stable::before { background: var(--live-green); }
.delivery-live-priority-card.is-quality .delivery-live-priority-card-head em,
.delivery-live-priority-card.is-stable .delivery-live-priority-card-head em { background: #e1f6ed; color: #08794e; }
.delivery-live-priority-card.is-quality > b,
.delivery-live-priority-card.is-stable > b { color: #08794e; }

.delivery-live-incident-workbench {
  position: relative;
  margin-top: 14px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid #dfe7f2;
  border-radius: 17px;
  background: #f8fafc;
}
.delivery-live-incident-workbench::before { position: absolute; inset: 0 auto 0 0; width: 4px; background: #8aa0bc; content: ''; }
.delivery-live-incident-workbench.is-danger::before { background: var(--live-red); }
.delivery-live-incident-workbench.is-warning::before { background: var(--live-amber); }
.delivery-live-incident-workbench.is-opportunity::before { background: var(--live-blue); }
.delivery-live-incident-workbench.is-quality::before,
.delivery-live-incident-workbench.is-stable::before { background: var(--live-green); }
.delivery-live-incident-workbench-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.delivery-live-incident-workbench-head p { margin: 0; }
.delivery-live-incident-workbench-head h3 { margin: 3px 0 4px; color: #1c2a3e; font-size: 20px; }
.delivery-live-incident-workbench-head span { color: #7c899c; font-size: 12px; }
.delivery-live-incident-status > span { display: inline-flex; min-height: 30px; align-items: center; padding: 0 10px; border-radius: 999px; background: #edf1f6; color: #607087; font-size: 11px; font-weight: 700; }
.delivery-live-incident-status > span.is-acknowledged { background: #e3f5ed; color: #0b7a52; }
.delivery-live-incident-summary { display: grid; grid-template-columns: minmax(130px, .55fr) minmax(240px, 1.45fr) minmax(220px, 1fr); gap: 10px; margin-top: 16px; }
.delivery-live-incident-summary article { min-width: 0; padding: 13px 14px; border: 1px solid #e4eaf2; border-radius: 12px; background: #fff; }
.delivery-live-incident-summary small,
.delivery-live-incident-evidence-head small,
.delivery-live-incident-evidence-list small { display: block; color: #8b97a9; font-size: 11px; }
.delivery-live-incident-summary b { display: block; margin-top: 5px; color: #2a3b52; font-size: 13px; line-height: 1.55; }
.delivery-live-incident-evidence { margin-top: 15px; }
.delivery-live-incident-evidence-head { display: flex; align-items: baseline; gap: 9px; margin-bottom: 9px; }
.delivery-live-incident-evidence-head > b { color: #2b3a50; font-size: 14px; }
.delivery-live-incident-evidence-list { display: grid; gap: 7px; }
.delivery-live-incident-evidence-list article { display: grid; grid-template-columns: minmax(210px, 1.4fr) repeat(3, minmax(110px, .55fr)); align-items: center; gap: 12px; padding: 11px 13px; border: 1px solid #e5ebf3; border-radius: 11px; background: #fff; }
.delivery-live-incident-evidence-list article > div,
.delivery-live-incident-evidence-list article > span { min-width: 0; }
.delivery-live-incident-evidence-list article > div > b { color: #1f4f91; font-size: 14px; }
.delivery-live-incident-evidence-list article > div > small { overflow: hidden; margin-top: 3px; text-overflow: ellipsis; white-space: nowrap; }
.delivery-live-incident-evidence-list article > span > b { display: block; margin-top: 3px; color: #35475e; font-size: 12px; }
.delivery-live-incident-more { padding: 4px 2px 0; }
.delivery-live-incident-evidence-empty { display: flex; gap: 12px; padding: 13px; border: 1px dashed #d9e2ee; border-radius: 11px; background: #fff; }
.delivery-live-incident-evidence-empty span { color: #68778b; font-size: 12px; }
.delivery-live-incident-ai { margin-top: 15px; padding: 15px; border: 1px solid #d9e4f3; border-radius: 13px; background: linear-gradient(135deg, #f1f6ff, #fff); }
.delivery-live-incident-ai-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.delivery-live-incident-ai-head > div { min-width: 0; }
.delivery-live-incident-ai-head small { display: block; color: #2867c8; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.delivery-live-incident-ai-head b { display: inline-block; margin-top: 3px; color: #1c3150; font-size: 15px; }
.delivery-live-incident-ai-head span { margin-left: 8px; color: #8290a4; font-size: 11px; }
.delivery-live-incident-ai-head button { flex: 0 0 auto; }
.delivery-live-incident-rule-plan { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 13px; }
.delivery-live-incident-rule-plan article { display: flex; min-width: 0; align-items: flex-start; gap: 9px; padding: 11px; border: 1px solid #dfe8f5; border-radius: 10px; background: rgba(255, 255, 255, .9); }
.delivery-live-incident-rule-plan em { display: inline-flex; width: 23px; height: 23px; flex: 0 0 23px; align-items: center; justify-content: center; border-radius: 50%; background: #e3edff; color: #2864bd; font-size: 11px; font-style: normal; font-weight: 800; }
.delivery-live-incident-rule-plan span { color: #43546b; font-size: 12px; line-height: 1.55; }
.delivery-live-incident-ai-text { margin-top: 13px; padding: 13px 14px; border: 1px solid #dfe8f5; border-radius: 10px; background: #fff; color: #334761; font-size: 13px; line-height: 1.75; }
.delivery-live-incident-ai-error { margin: 9px 0 0; color: #9a6805; font-size: 11px; }
.delivery-live-incident-feedback { display: flex; align-items: center; gap: 7px; margin-top: 11px; }
.delivery-live-incident-feedback > span { margin-right: 2px; color: #7b899d; font-size: 11px; }
.delivery-live-incident-feedback button { min-height: 29px; padding: 0 10px; border: 1px solid #d9e2ef; border-radius: 999px; background: #fff; color: #596b82; font-size: 11px; cursor: pointer; }
.delivery-live-incident-feedback button.is-active { border-color: #9bbdf2; background: #e7f0ff; color: #205da8; font-weight: 700; }
.delivery-live-incident-actions { display: flex; align-items: center; gap: 9px; margin-top: 15px; padding-top: 15px; border-top: 1px solid #e4eaf2; }
.delivery-live-incident-actions > small { margin-left: auto; color: #8794a7; font-size: 11px; }
.delivery-live-incident-system-note { display: inline-flex; min-height: 36px; align-items: center; padding: 0 12px; border-radius: 10px; background: #edf2f8; color: #617088; font-size: 12px; font-weight: 700; }

.delivery-live-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, .55fr);
  gap: 14px;
  margin-top: 14px;
}

.delivery-live-brief-card,
.delivery-live-health-card,
.delivery-live-table-card,
.delivery-live-timeline-card {
  margin: 0 !important;
  border-radius: 18px !important;
}

.delivery-live-section-head {
  justify-content: space-between;
  gap: 18px;
}

.delivery-live-brief {
  margin-top: 18px;
  padding: 20px;
  border-radius: 14px;
  background: #f2f7ff;
  color: #263850;
  font-size: 15px;
  line-height: 1.8;
}

.delivery-live-source { min-height: 32px; padding: 0 11px; color: #265ba8; }

.delivery-live-health {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  min-height: 156px;
}

.delivery-live-health-ring {
  display: grid;
  place-content: center;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: radial-gradient(circle at center, #fff 0 54%, transparent 56%), conic-gradient(var(--live-green) 0 var(--good), var(--live-amber) var(--good) var(--watch), var(--live-red) var(--watch) 100%);
  text-align: center;
}

.delivery-live-health-ring strong { font-size: 24px; color: #174c91; }
.delivery-live-health-ring small { color: #7a8799; }
.delivery-live-health-legend { display: grid; gap: 9px; min-width: 118px; }
.delivery-live-health-legend span { display: flex; align-items: center; gap: 7px; color: #66758a; }
.delivery-live-health-legend span b { margin-left: auto; color: #1d2a3d; }
.delivery-live-health-legend i { width: 8px; height: 8px; border-radius: 50%; background: #aab4c3; }
.delivery-live-health-legend .is-good i { background: var(--live-green); }
.delivery-live-health-legend .is-quality i { background: #0f9f6e; }
.delivery-live-health-legend .is-normal i { background: #4f83cc; }
.delivery-live-health-legend .is-watch i { background: var(--live-amber); }
.delivery-live-health-legend .is-danger i { background: var(--live-red); }
.delivery-live-health-legend .is-handled i { background: #7b8da7; }

.delivery-live-table-card,
.delivery-live-timeline-card { margin-top: 14px !important; }
.delivery-live-table-tools { display: flex; align-items: center; justify-content: flex-end; flex: 1 1 760px; flex-wrap: wrap; gap: 10px; min-width: 0; }
.delivery-live-table-tools input { flex: 1 1 280px; min-width: 190px; width: auto; }
.delivery-live-table-tools select { flex: 0 1 190px; min-width: 150px; width: auto; }
.delivery-live-copy-ids { min-width: 148px; white-space: nowrap; }
.delivery-live-copy-ids.is-copied { border-color: #9bd8c2; background: #eaf9f3; color: #08794e; }
.delivery-live-copy-ids.is-copy-error { border-color: #f0aab3; background: #fff0f2; color: #b82437; }
.delivery-live-copy-ids:disabled { cursor: not-allowed; opacity: .5; }
.delivery-live-segments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.delivery-live-segments button { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 13px; border: 1px solid #dce5f1; border-radius: 999px; background: #fff; color: #65748a; cursor: pointer; }
.delivery-live-segments button b { display: inline-grid; place-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #edf2f8; color: #44546a; font-size: 11px; }
.delivery-live-segments button.active { border-color: #8db8fb; background: #edf5ff; color: #1558b0; box-shadow: 0 0 0 3px rgba(37, 99, 235, .08); }
.delivery-live-segments button:first-child.active { border-color: #ef9ca7; background: #fff0f2; color: #b82437; }
.delivery-live-batch-bar[hidden] { display: none !important; }
.delivery-live-batch-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 11px 13px;
  border: 1px solid #f0cbd1;
  border-radius: 13px;
  background: linear-gradient(90deg, #fff7f8, #fff);
  color: #5e6d82;
}
.delivery-live-batch-bar label { display: inline-flex; align-items: center; gap: 8px; color: #28374d; cursor: pointer; }
.delivery-live-batch-bar input { width: 17px; height: 17px; accent-color: #dc3947; }
.delivery-live-batch-bar > span { padding: 4px 9px; border-radius: 999px; background: #fff0f2; color: #b82437; font-size: 12px; }
.delivery-live-batch-bar button { min-height: 36px; margin-left: auto; padding: 0 17px; background: #d73547; }
.delivery-live-batch-bar small { color: #8793a5; }
.delivery-live-table-wrap { overflow: auto; margin-top: 16px; border: 1px solid #e1e8f2; border-radius: 14px; }
.delivery-live-table-wrap table { width: 100%; min-width: 1760px; border-collapse: collapse; }
.delivery-live-table-wrap th { padding: 13px 14px; background: #f3f6fb; color: #67758a; font-size: 12px; text-align: left; white-space: nowrap; }
.delivery-live-table-wrap td { padding: 13px 14px; border-top: 1px solid #e8edf4; color: #344156; font-size: 13px; }
.delivery-live-table-wrap td small { display: block; max-width: 270px; margin-top: 4px; overflow: hidden; color: #8290a3; text-overflow: ellipsis; white-space: nowrap; }
.delivery-live-table-wrap .is-number { text-align: right; white-space: nowrap; }
.delivery-live-select-cell { width: 50px; text-align: center !important; }
.delivery-live-select-cell input { width: 17px; height: 17px; accent-color: #dc3947; cursor: pointer; }
.delivery-live-table-wrap tr.is-danger td:first-child { box-shadow: inset 4px 0 #dc3947; }
.delivery-live-table-wrap tr.is-opportunity td:first-child { box-shadow: inset 4px 0 #2563eb; }
.delivery-live-table-wrap tr.is-quality td:first-child { box-shadow: inset 4px 0 #0f9f6e; }
.delivery-live-table-wrap tr.is-handled { background: #f8fafc; }
.delivery-live-table-wrap tr.is-handled td:first-child { box-shadow: inset 4px 0 #7b8da7; }
.delivery-live-reason { min-width: 300px; max-width: 380px; }
.delivery-live-reason b { display: block; color: #344156; font-weight: 600; line-height: 1.5; }
.delivery-live-reason small { max-width: none !important; white-space: normal !important; }
.delivery-live-state { display: inline-flex; padding: 5px 10px; border-radius: 999px; background: #edf1f6; color: #697589; font-size: 12px; white-space: nowrap; }
.delivery-live-state.is-good { background: #e5f7ef; color: #08794e; }
.delivery-live-state.is-watch { background: #fff4d9; color: #9b6300; }
.delivery-live-state.is-danger { background: #ffe9ec; color: #ba2535; }
.delivery-live-state.is-quality { background: #dff6eb; color: #08794e; }
.delivery-live-state.is-opportunity { background: #e5efff; color: #1f5fb8; }
.delivery-live-state.is-normal { background: #eaf1fb; color: #4d6484; }
.delivery-live-state.is-handled { background: #e9eef5; color: #51647d; }
.delivery-live-state.is-insufficient,
.delivery-live-state.is-inactive,
.delivery-live-state.is-unknown { background: #f0f2f5; color: #7e8998; }

.delivery-live-timeline { display: grid; gap: 10px; margin-top: 16px; }
.delivery-live-timeline article { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 18px; padding: 18px 20px; border: 1px solid #e4eaf2; border-left: 4px solid #aeb9c8; border-radius: 14px; background: #f8fafd; }
.delivery-live-timeline article.is-good { border-left-color: var(--live-green); }
.delivery-live-timeline article.is-warning { border-left-color: var(--live-amber); }
.delivery-live-timeline article.is-danger { border-left-color: var(--live-red); }
.delivery-live-timeline time { color: #718096; font-variant-numeric: tabular-nums; }
.delivery-live-timeline time b { color: #42516a; font-size: 15px; }
.delivery-live-timeline time small { display: block; margin-top: 5px; color: #95a0af; font-size: 11px; }
.delivery-live-timeline article b,
.delivery-live-timeline article span { display: block; }
.delivery-live-timeline-body { min-width: 0; }
.delivery-live-timeline-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.delivery-live-timeline-title > div > b { color: #202d42; font-size: 16px; line-height: 1.45; }
.delivery-live-timeline-title > div > small { display: block; margin-top: 4px; color: #7f8da1; }
.delivery-live-timeline-title em { flex: 0 0 auto; padding: 5px 10px; border: 1px solid #dce5f1; border-radius: 999px; background: #fff; color: #5d6d84; font-size: 12px; font-style: normal; font-variant-numeric: tabular-nums; white-space: nowrap; }
.delivery-live-timeline-detail { margin-top: 7px; color: #68778d; line-height: 1.55; }
.delivery-live-timeline-metrics { display: grid; grid-template-columns: repeat(5, minmax(105px, 1fr)); gap: 8px; margin-top: 14px; }
.delivery-live-timeline-metrics > span { min-width: 0; margin: 0 !important; padding: 10px 12px; border: 1px solid #e4eaf2; border-radius: 10px; background: #fff; }
.delivery-live-timeline-metrics small { display: block; color: #8491a4; font-size: 11px; }
.delivery-live-timeline-metrics b { margin-top: 4px; color: #1e4f91; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.delivery-live-timeline article.is-good .delivery-live-timeline-metrics b { color: #08794e; }
.delivery-live-timeline article.is-warning .delivery-live-timeline-metrics b { color: #9b6300; }
.delivery-live-timeline article.is-danger .delivery-live-timeline-metrics b { color: #b82437; }
.delivery-live-timeline-cumulative { margin: 11px 0 0; color: #7a8799; font-size: 12px; line-height: 1.6; }
.delivery-live-timeline-cumulative b { display: inline !important; color: #4a5a70; font-weight: 650; }
.delivery-live-timeline-empty { padding: 28px; border: 1px dashed #cfdae8; border-radius: 14px; text-align: center; }
.delivery-live-timeline-empty b,
.delivery-live-timeline-empty span { display: block; }
.delivery-live-timeline-empty span { margin-top: 5px; color: #7b889a; }

/* Account decision center: keep the page scannable and move evidence on demand. */
.delivery-live-decision-center .delivery-live-action-summary {
  margin: 16px 0 14px;
  padding: 16px;
  border-color: #e3eaf3;
  border-radius: 14px;
  background: #f7f9fc;
  box-shadow: none;
}

.delivery-live-decision-center .delivery-live-priority-head {
  align-items: center;
  margin-bottom: 12px;
}

.delivery-live-decision-center .delivery-live-priority-head h3 { font-size: 17px; }
.delivery-live-decision-center .delivery-live-priority-grid { gap: 9px; }
.delivery-live-decision-center .delivery-live-priority-card {
  min-height: 0;
  padding: 14px 15px;
  border-radius: 13px;
  background: #fff;
}
.delivery-live-decision-center .delivery-live-priority-card:hover { transform: none; border-color: #aec7ef; box-shadow: 0 7px 18px rgba(31, 62, 112, .08); }
.delivery-live-priority-card-head { margin-bottom: 10px; }
.delivery-live-priority-main { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; }
.delivery-live-priority-main > span { min-width: 0; }
.delivery-live-priority-main strong,
.delivery-live-priority-main small { display: block; }
.delivery-live-priority-main strong { overflow: hidden; color: #1e2d42; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.delivery-live-priority-main small { overflow: hidden; margin-top: 4px; color: #738198; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.delivery-live-priority-main > b { color: #315d9d; font-size: 18px; white-space: nowrap; }
.delivery-live-priority-main > i { color: #8190a5; font-size: 18px; font-style: normal; }
.delivery-live-priority-card.is-danger .delivery-live-priority-main > b { color: #c52c3f; }
.delivery-live-priority-card.is-warning .delivery-live-priority-main > b { color: #9b6500; }
.delivery-live-priority-card.is-opportunity .delivery-live-priority-main > b { color: #1f5fb8; }
.delivery-live-priority-card.is-quality .delivery-live-priority-main > b,
.delivery-live-priority-card.is-stable .delivery-live-priority-main > b { color: #08794e; }

.delivery-live-account-link {
  display: block;
  width: 100%;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.delivery-live-account-link b,
.delivery-live-account-link small { display: block; }
.delivery-live-account-link b { color: #1f4f91; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; }
.delivery-live-account-link small { overflow: hidden; margin-top: 3px; color: #8592a5; text-overflow: ellipsis; white-space: nowrap; }
.delivery-live-account-link:hover b { text-decoration-color: #8db0e4; }

.delivery-live-decision-backdrop {
  position: fixed;
  z-index: 1090;
  inset: 0;
  border: 0;
  background: rgba(22, 34, 51, .28);
  backdrop-filter: blur(2px);
}
.delivery-live-decision-backdrop[hidden] { display: none; }
.delivery-live-decision-drawer {
  position: fixed;
  z-index: 1091;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(720px, 92vw);
  overflow: auto;
  border-left: 1px solid #dce5f0;
  background: #fff;
  box-shadow: -18px 0 48px rgba(26, 43, 69, .18);
  transform: translateX(105%);
  visibility: hidden;
  transition: transform .2s ease, visibility .2s ease;
}
.delivery-live-decision-drawer.is-open { transform: translateX(0); visibility: visible; }
.delivery-live-decision-drawer-body { min-height: 100%; padding: 24px; background: #f7f9fc; }
.delivery-live-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin: -24px -24px 18px; padding: 22px 24px 18px; border-bottom: 1px solid #e2e8f1; background: #fff; }
.delivery-live-drawer-head p { margin: 0; }
.delivery-live-drawer-head h3 { margin: 3px 0 4px; color: #1c2a3e; font-size: 21px; }
.delivery-live-drawer-head span { display: block; color: #77859a; font-size: 12px; }
.delivery-live-decision-drawer .delivery-live-incident-workbench { margin-top: 0; background: #fff; }
.delivery-live-decision-drawer .delivery-live-incident-summary { grid-template-columns: 1fr; }
.delivery-live-decision-drawer .delivery-live-incident-summary article:last-child { grid-column: auto; }
.delivery-live-decision-drawer .delivery-live-incident-evidence-list article { grid-template-columns: minmax(170px, 1.2fr) repeat(3, minmax(75px, .55fr)); }

.delivery-live-account-profile { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: center; gap: 9px; padding: 15px; border: 1px solid #e1e8f1; border-radius: 14px; background: #fff; }
.delivery-live-account-profile > div { min-width: 0; }
.delivery-live-account-profile small,
.delivery-live-account-profile b { display: block; }
.delivery-live-account-profile small { color: #8a96a8; font-size: 11px; }
.delivery-live-account-profile b { overflow: hidden; margin-top: 4px; color: #2b3c53; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.delivery-live-account-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 11px; }
.delivery-live-account-metrics article { padding: 14px; border: 1px solid #e1e8f1; border-radius: 13px; background: #fff; }
.delivery-live-account-metrics small,
.delivery-live-account-metrics b { display: block; }
.delivery-live-account-metrics small { color: #8592a5; font-size: 11px; }
.delivery-live-account-metrics b { margin-top: 5px; color: #1e4f91; font-size: 18px; }
.delivery-live-account-judgment { margin-top: 11px; padding: 16px; border: 1px solid #dfe7f2; border-left: 4px solid #91a1b7; border-radius: 13px; background: #fff; }
.delivery-live-account-judgment.is-danger { border-left-color: var(--live-red); }
.delivery-live-account-judgment.is-watch { border-left-color: var(--live-amber); }
.delivery-live-account-judgment.is-quality,
.delivery-live-account-judgment.is-opportunity { border-left-color: var(--live-green); }
.delivery-live-account-judgment small,
.delivery-live-account-judgment b { display: block; }
.delivery-live-account-judgment small { color: #8491a4; font-size: 11px; }
.delivery-live-account-judgment b { margin-top: 4px; color: #24364e; font-size: 16px; }
.delivery-live-account-judgment p { margin: 12px 0 7px; color: #5f6f84; font-size: 13px; line-height: 1.7; }
.delivery-live-account-judgment strong { color: #2d4d75; font-size: 13px; }
.delivery-live-account-events { margin-top: 11px; padding: 16px; border: 1px solid #e1e8f1; border-radius: 13px; background: #fff; }
.delivery-live-drawer-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.delivery-live-drawer-section-head b { color: #263850; font-size: 14px; }
.delivery-live-drawer-section-head small { color: #8995a7; font-size: 11px; }
.delivery-live-account-events article { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-top: 1px solid #edf1f6; }
.delivery-live-account-events time { color: #738198; font-size: 12px; }
.delivery-live-account-events article b,
.delivery-live-account-events article span { display: block; }
.delivery-live-account-events article b { color: #2a3b52; font-size: 13px; }
.delivery-live-account-events article span { margin-top: 3px; color: #7b889a; font-size: 12px; line-height: 1.55; }
.delivery-live-drawer-empty { padding: 20px; border: 1px dashed #d4deeb; border-radius: 11px; color: #7f8b9d; font-size: 12px; text-align: center; }

.delivery-live-monitor:fullscreen,
.delivery-live-monitor.is-fallback-fullscreen {
  width: 100vw;
  height: 100vh;
  overflow: auto;
  background: #f4f7fb;
}

@media (max-width: 1280px) {
  .delivery-live-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .delivery-live-priority-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .delivery-live-overview-grid { grid-template-columns: 1fr; }
  .delivery-live-incident-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .delivery-live-incident-summary article:last-child { grid-column: 1 / -1; }
  .delivery-live-incident-evidence-list article { grid-template-columns: minmax(190px, 1.2fr) repeat(3, minmax(95px, .6fr)); }
}

@media (max-width: 760px) {
  .delivery-live-monitor { padding: 12px; }
  .delivery-live-hero { align-items: flex-start; flex-direction: column; padding: 18px; }
  .delivery-live-actions { justify-content: flex-start; width: 100%; }
  .delivery-live-actions button { flex: 1 1 130px; }
  .delivery-live-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .delivery-live-action-summary { padding: 15px; }
  .delivery-live-priority-head { align-items: flex-start; flex-direction: column; }
  .delivery-live-priority-grid { grid-template-columns: 1fr; }
  .delivery-live-priority-card { min-height: 0; }
  .delivery-live-priority-main { grid-template-columns: minmax(0, 1fr) auto; }
  .delivery-live-priority-main > i { display: none; }
  .delivery-live-decision-drawer { width: 100vw; }
  .delivery-live-decision-drawer-body { padding: 18px; }
  .delivery-live-drawer-head { margin: -18px -18px 15px; padding: 18px; }
  .delivery-live-account-profile { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .delivery-live-account-profile button { grid-column: 1 / -1; width: 100%; }
  .delivery-live-account-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .delivery-live-decision-drawer .delivery-live-incident-evidence-list article { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .delivery-live-incident-workbench { padding: 16px; }
  .delivery-live-incident-workbench-head { flex-direction: column; gap: 10px; }
  .delivery-live-incident-summary { grid-template-columns: 1fr; }
  .delivery-live-incident-summary article:last-child { grid-column: auto; }
  .delivery-live-incident-evidence-head { align-items: flex-start; flex-direction: column; gap: 3px; }
  .delivery-live-incident-evidence-list article { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .delivery-live-incident-evidence-list article > div { grid-column: 1 / -1; }
  .delivery-live-incident-evidence-list article > span:last-child { grid-column: 1 / -1; }
  .delivery-live-incident-ai-head { align-items: flex-start; flex-direction: column; }
  .delivery-live-incident-ai-head button { width: 100%; }
  .delivery-live-incident-rule-plan { grid-template-columns: 1fr; }
  .delivery-live-incident-feedback { align-items: stretch; flex-wrap: wrap; }
  .delivery-live-incident-feedback > span { flex: 1 1 100%; }
  .delivery-live-incident-feedback button { flex: 1 1 120px; }
  .delivery-live-incident-actions { align-items: stretch; flex-wrap: wrap; }
  .delivery-live-incident-actions > button,
  .delivery-live-incident-system-note { flex: 1 1 150px; justify-content: center; }
  .delivery-live-incident-actions > small { flex: 1 1 100%; margin-left: 0; line-height: 1.55; }
  .delivery-live-kpis article { padding: 14px; }
  .delivery-live-section-head { align-items: flex-start; flex-direction: column; }
  .delivery-live-table-tools { width: 100%; }
  .delivery-live-table-tools input { min-width: 100%; width: 100%; flex: 1 1 100%; }
  .delivery-live-table-tools select { min-width: 0; flex: 1 1 calc(50% - 5px); }
  .delivery-live-copy-ids { min-width: 126px; padding-inline: 12px; }
  .delivery-live-batch-bar { align-items: flex-start; flex-wrap: wrap; }
  .delivery-live-batch-bar button { margin-left: 0; }
  .delivery-live-batch-bar small { flex: 1 1 100%; }
  .delivery-live-health { flex-direction: column; }
  .delivery-live-freshness { align-items: flex-start; flex-direction: column; }
  .delivery-live-timeline article { grid-template-columns: 1fr; gap: 10px; padding: 15px; }
  .delivery-live-timeline time { display: flex; align-items: center; gap: 8px; }
  .delivery-live-timeline time small { margin-top: 0; }
  .delivery-live-timeline-title { flex-direction: column; gap: 9px; }
  .delivery-live-timeline-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .delivery-live-timeline-metrics > span:last-child { grid-column: 1 / -1; }
}

/* 2026-08-18: move account center and business analysis into hourly monitoring. */
#hourlyMonitorPanel.hourly-monitor-panel {
  overflow: hidden !important;
}

#hourlyMonitorPanel > .hourly-monitor-workspace {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
}

.hourly-monitor-load-state {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  min-height: 58px;
  margin-bottom: 12px;
  padding: 11px 14px;
  border: 1px solid #cfe0fb;
  border-radius: 14px;
  background: #f4f8ff;
  color: #687994;
}

.hourly-monitor-load-state[hidden] {
  display: none !important;
}

.hourly-monitor-load-state > div {
  display: grid;
  min-width: 0;
  gap: 2px;
  flex: 1 1 auto;
}

.hourly-monitor-load-state b {
  color: #1d5cb5;
  font-size: 13px;
}

.hourly-monitor-load-state span {
  font-size: 12px;
  line-height: 1.5;
}

.hourly-monitor-load-state.is-error,
.hourly-monitor-load-state.is-warning {
  border-color: #f0d6ae;
  background: #fff9ef;
}

.hourly-monitor-load-state.is-error b,
.hourly-monitor-load-state.is-warning b {
  color: #a35b12;
}

.hourly-monitor-load-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 2px solid #c8daf7;
  border-top-color: #2f6feb;
  border-radius: 50%;
}

.hourly-monitor-load-state.is-loading .hourly-monitor-load-icon {
  animation: hourly-monitor-loading-spin .8s linear infinite;
}

.hourly-monitor-load-state.is-error .hourly-monitor-load-icon,
.hourly-monitor-load-state.is-warning .hourly-monitor-load-icon {
  border: 0;
  border-radius: 50%;
  background: #f0a43c;
  box-shadow: inset 0 0 0 6px #fff3dd;
}

@keyframes hourly-monitor-loading-spin {
  to { transform: rotate(360deg); }
}

.hourly-monitor-workspace-head {
  flex: 0 0 auto;
  margin-bottom: 12px !important;
}

.hourly-monitor-view-tabs {
  flex: 0 0 auto;
  margin-bottom: 14px;
}

.hourly-monitor-view-tabs button {
  min-width: 104px;
}

.hourly-monitor-view-pane {
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.hourly-monitor-view-pane[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  #hourlyMonitorPanel > .hourly-monitor-workspace {
    min-height: 0;
  }

  .hourly-monitor-workspace-head {
    min-height: 56px !important;
    margin-bottom: 8px !important;
  }

  .hourly-monitor-workspace-head .panel-intro {
    display: none;
  }

  .hourly-monitor-view-tabs {
    display: flex;
    width: 100%;
    max-width: 100%;
    margin-bottom: 10px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .hourly-monitor-view-tabs::-webkit-scrollbar {
    display: none;
  }

  .hourly-monitor-view-tabs button {
    min-width: 96px;
    flex: 1 0 auto;
    padding-right: 12px;
    padding-left: 12px;
  }

  .hourly-monitor-view-pane {
    padding-bottom: 16px;
  }

  .hourly-monitor-load-state {
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 9px;
  }

  .hourly-monitor-load-state .ghost-btn {
    width: 100%;
  }
}

/* 2026-08-18: record center responsive guard.
   This must remain at the end of the theme so shared fixed-width rules cannot
   re-introduce horizontal overflow on small desktop and mobile screens. */
#summaryPanel,
#summaryPanel * {
  min-width: 0;
}

#summaryPanel .summary-toolbar {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(120px, 1fr)) auto !important;
  gap: 12px !important;
  width: 100%;
  max-width: 100%;
  overflow: visible !important;
}

#summaryPanel .summary-toolbar > .summary-date-tabs,
#summaryPanel .summary-toolbar > .form-msg {
  grid-column: 1 / -1 !important;
}

#summaryPanel .summary-date-tabs {
  display: flex !important;
  flex-wrap: wrap;
  width: 100%;
  overflow: visible !important;
}

#summaryPanel .summary-date-tabs button {
  width: auto !important;
  min-width: 56px !important;
  flex: 0 0 auto;
}

#summaryPanel .summary-toolbar > label,
#summaryPanel .summary-toolbar > .operation-filter-label,
#summaryPanel .summary-toolbar > .toolbar-actions {
  min-width: 0 !important;
}

#summaryPanel .summary-toolbar input,
#summaryPanel .summary-toolbar select,
#summaryPanel .summary-toolbar button {
  max-width: 100%;
}

#summaryPanel .record-intelligence-grid > *,
#summaryPanel .work-review-layout > *,
#summaryPanel .operator-evaluation-list > *,
#summaryPanel .summary-kpis > * {
  min-width: 0;
}

#summaryPanel .record-intelligence-card,
#summaryPanel .operator-evaluation-card,
#summaryPanel .attention-item,
#summaryPanel .evidence-item {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 1450px) {
  #summaryPanel .summary-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 1080px) {
  #summaryPanel .summary-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #summaryPanel .record-intelligence-grid,
  #summaryPanel .work-review-layout,
  #summaryPanel .operator-evaluation-list {
    grid-template-columns: 1fr !important;
  }

  #summaryPanel .work-review-kpis,
  #summaryPanel .summary-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #summaryPanel .summary-toolbar > .toolbar-actions {
    grid-column: 1 / -1 !important;
  }
}

@media (max-width: 680px) {
  #summaryPanel .summary-toolbar {
    grid-template-columns: 1fr !important;
  }

  #summaryPanel .summary-toolbar > label,
  #summaryPanel .summary-toolbar > .operation-filter-label,
  #summaryPanel .summary-toolbar > .toolbar-actions {
    grid-column: 1 / -1 !important;
  }

  #summaryPanel .summary-toolbar > .toolbar-actions,
  #summaryPanel .record-intelligence-actions,
  #summaryPanel .operator-evaluation-actions {
    display: grid !important;
    grid-template-columns: 1fr;
    width: 100%;
  }

  #summaryPanel .summary-toolbar > .toolbar-actions button,
  #summaryPanel .record-intelligence-actions button,
  #summaryPanel .operator-evaluation-actions button {
    width: 100%;
  }

  #summaryPanel .work-review-kpis,
  #summaryPanel .summary-kpis {
    grid-template-columns: 1fr !important;
  }
}

/* 2026-08-21: 常用工具 / 数字 ID 提取器 */
#toolsPanel .id-extractor-tool-card {
  position: relative;
  overflow: hidden;
  padding: 0 !important;
  border: 1px solid #dfe6f1 !important;
  border-radius: 22px !important;
  background: #fff !important;
  box-shadow: 0 12px 34px rgba(49, 72, 112, .08) !important;
}

#toolsPanel .id-extractor-tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 360px;
  height: 210px;
  background: radial-gradient(circle at 100% 0, rgba(85, 78, 235, .14), transparent 68%);
  pointer-events: none;
}

#toolsPanel .id-extractor-tool-icon {
  background: linear-gradient(145deg, #2d6ee9, #6559ee);
}

#toolsPanel .id-extractor-workspace {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px minmax(320px, .82fr);
  align-items: stretch;
  gap: 18px;
  padding: 28px;
  background: #fff;
}

#toolsPanel .id-extractor-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 20px;
  border: 1px solid #dfe6f1;
  border-radius: 18px;
  background: #fff;
}

#toolsPanel .id-extractor-panel.is-result {
  background: linear-gradient(180deg, #f8faff 0%, #f5f8fd 100%);
}

#toolsPanel .id-extractor-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  margin-bottom: 14px;
}

#toolsPanel .id-extractor-panel-head > div {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

#toolsPanel .id-extractor-panel-head h3 {
  margin: 0;
  color: #1e2b41;
  font-size: 16px;
  line-height: 1.35;
}

#toolsPanel .id-extractor-step {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 7px;
  border-radius: 9px;
  background: #eaf2ff;
  color: #2867d6;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
}

#toolsPanel .id-extractor-meta {
  flex: 0 0 auto;
  color: #8090a8;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

#toolsPanel .id-extractor-panel textarea {
  display: block;
  width: 100%;
  min-height: 292px !important;
  padding: 16px 17px !important;
  border: 1px solid #d8e1ee !important;
  border-radius: 14px !important;
  background: #fbfcfe !important;
  color: #26334a !important;
  box-shadow: none !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px !important;
  line-height: 1.75;
  resize: vertical;
}

#toolsPanel .id-extractor-panel textarea:hover {
  border-color: #b9c9df !important;
}

#toolsPanel .id-extractor-panel textarea:focus {
  border-color: #4b83e8 !important;
  background: #fff !important;
  box-shadow: 0 0 0 4px rgba(75, 131, 232, .12) !important;
  outline: 0;
}

#toolsPanel .id-extractor-subactions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 12px;
}

#toolsPanel .id-extractor-subactions button {
  min-height: 38px;
  padding: 7px 13px;
  border-radius: 10px;
  font-size: 13px;
}

#toolsPanel .id-extractor-direction {
  align-self: center;
  width: 48px;
  height: 48px;
  margin: 0;
}

#toolsPanel .id-extractor-results {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 8px;
  min-height: 248px;
  max-height: 292px;
  padding-right: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

#toolsPanel .id-extractor-empty {
  display: grid;
  place-items: center;
  align-content: center;
  flex: 1 1 auto;
  min-height: 210px;
  padding: 24px;
  border: 1px dashed #cfdbea;
  border-radius: 14px;
  color: #8291a8;
  text-align: center;
}

#toolsPanel .id-extractor-empty > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 10px;
  border-radius: 13px;
  background: #eaf2ff;
  color: #3975dc;
  font-size: 21px;
  font-weight: 900;
}

#toolsPanel .id-extractor-empty b {
  color: #53627a;
  font-size: 14px;
}

#toolsPanel .id-extractor-empty small {
  margin-top: 5px;
  font-size: 12px;
}

#toolsPanel .id-extractor-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 48px;
  padding: 7px 8px 7px 10px;
  border: 1px solid #dfe7f3;
  border-radius: 12px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 3px 10px rgba(42, 70, 112, .035);
  animation: idExtractorReveal .28s ease both;
}

#toolsPanel .id-extractor-order {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: #edf3ff;
  color: #3c70c8;
  font-size: 11px;
  font-weight: 900;
}

#toolsPanel .id-extractor-row code {
  overflow: hidden;
  color: #23334d;
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#toolsPanel .id-extractor-copy-one {
  min-width: 58px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #cddcf3;
  border-radius: 9px;
  background: #f5f8ff;
  color: #2d67c5;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

#toolsPanel .id-extractor-copy-one:hover {
  border-color: #8fb2ed;
  background: #eaf2ff;
}

#toolsPanel .id-extractor-copy-all {
  width: 100%;
  min-height: 44px;
  margin-top: 12px;
  border-radius: 12px;
}

#toolsPanel .id-extractor-copy-all:disabled {
  opacity: .52;
  cursor: not-allowed;
  filter: saturate(.55);
}

#toolsPanel .id-extractor-tool-msg {
  grid-column: 1 / -1;
  min-height: 20px;
  margin: -2px 0 -5px;
  color: #c24444;
  font-size: 13px;
  text-align: center;
}

#toolsPanel .id-extractor-tool-msg.ok {
  color: #168052;
}

@keyframes idExtractorReveal {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 980px) {
  #toolsPanel .id-extractor-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  #toolsPanel .id-extractor-direction {
    transform: rotate(90deg);
  }
}

@media (max-width: 760px) {
  #toolsPanel .id-extractor-tool-card {
    border-radius: 18px !important;
  }

  #toolsPanel .id-extractor-workspace {
    gap: 12px;
    padding: 14px;
  }

  #toolsPanel .id-extractor-panel {
    padding: 14px;
    border-radius: 14px;
  }

  #toolsPanel .id-extractor-panel textarea {
    min-height: 210px !important;
    padding: 13px !important;
    border-radius: 12px !important;
    font-size: 12px !important;
  }

  #toolsPanel .id-extractor-results {
    min-height: 200px;
    max-height: 260px;
  }

  #toolsPanel .id-extractor-empty {
    min-height: 178px;
  }

  #toolsPanel .id-extractor-subactions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #toolsPanel .id-extractor-subactions button {
    width: 100%;
  }
}

@media (max-width: 430px) {
  #toolsPanel .id-extractor-panel-head {
    align-items: flex-start;
  }

  #toolsPanel .id-extractor-row {
    grid-template-columns: 26px minmax(0, 1fr) auto;
    gap: 8px;
  }

  #toolsPanel .id-extractor-order {
    width: 26px;
    height: 26px;
  }
}

/* 20260825: terminal mobile cascade guard for the delivery card header. */
@media (max-width: 760px) {
  .delivery-person-head {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
  }

  .delivery-person-copy,
  .delivery-person-meta {
    min-width: 0 !important;
    max-width: none !important;
  }

  .delivery-person-meta {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .delivery-person-head > .delivery-roi-metrics {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: none !important;
  }
}

/* 20260825: keep the stop control visible while a model answer is running. */
#chatPanel > form.composer .send-btn.is-stop,
#chatPanel.has-chat > form.composer .send-btn.is-stop,
#chatPanel:not(.has-chat) > form.composer .send-btn.is-stop {
  position: relative !important;
  opacity: 1 !important;
  visibility: visible !important;
}

#chatPanel > form.composer .send-btn.is-stop::after,
#chatPanel.has-chat > form.composer .send-btn.is-stop::after,
#chatPanel:not(.has-chat) > form.composer .send-btn.is-stop::after {
  content: "" !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  display: block !important;
  width: 13px !important;
  min-width: 13px !important;
  max-width: 13px !important;
  height: 13px !important;
  min-height: 13px !important;
  max-height: 13px !important;
  border-radius: 3px !important;
  background: #fff !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: translate(-50%, -50%) !important;
}

/* 20260902: independent job positions and position-first people filters. */
#recordsPanel .records-toolbar,
#summaryPanel .records-toolbar {
  grid-template-columns: repeat(6, minmax(118px, 1fr)) auto !important;
}

#issueReportsPanel .issue-toolbar {
  grid-template-columns: repeat(4, minmax(145px, 1fr)) auto !important;
}

#logsPanel .logs-toolbar {
  grid-template-columns: repeat(5, minmax(132px, 1fr)) auto !important;
}

.delivery-distribution-toolbar {
  grid-template-columns: minmax(210px, 1.2fr) minmax(135px, .65fr) repeat(5, minmax(118px, .68fr)) auto !important;
}

#usersPanel .user-batch-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -4px 0 14px;
  padding: 10px 12px;
  border: 1px solid #e4ebf5;
  border-radius: 12px;
  background: #f8faff;
}

#usersPanel .user-tools {
  display: grid !important;
  grid-template-columns: minmax(200px, 1fr) repeat(3, minmax(112px, 128px)) auto !important;
  width: min(790px, calc(100% - 90px));
}

#usersPanel .user-tools .user-search-input {
  width: 100% !important;
}

#usersPanel .user-batch-toolbar .check-line,
#usersPanel .user-batch-toolbar .check-line span {
  white-space: nowrap;
}

#usersPanel .user-batch-toolbar > span {
  margin-right: auto;
  color: #69758a;
  font-size: 12px;
  font-weight: 700;
}

#usersPanel .user-batch-toolbar select,
#usersPanel .user-batch-toolbar button {
  min-height: 36px;
}

#usersPanel .user-card-head {
  grid-template-columns: 22px minmax(210px, 1fr) auto auto !important;
}

#usersPanel .user-batch-check {
  display: grid;
  place-items: center;
  width: 22px;
  height: 32px;
  cursor: pointer;
}

#usersPanel .user-batch-check input {
  width: 16px;
  height: 16px;
  accent-color: #2b6fdb;
}

#usersPanel .position-badge {
  min-height: 25px;
  margin: 0;
  padding: 3px 9px;
  border-radius: 999px;
  color: #6046b7;
  background: #f0edff;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

#usersPanel .permission-checks .check-line > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

#usersPanel .permission-checks .check-line > span small {
  color: #8a94a6;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  #recordsPanel .records-toolbar,
  #summaryPanel .records-toolbar,
  #issueReportsPanel .issue-toolbar,
  #logsPanel .logs-toolbar,
  .delivery-distribution-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #usersPanel .user-card-head {
    grid-template-columns: 22px minmax(180px, 1fr) auto !important;
  }

  #usersPanel .user-table-head {
    align-items: stretch;
    flex-direction: column;
  }

  #usersPanel .user-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100%;
  }

  #usersPanel .user-card-actions {
    grid-column: 2 / -1;
    justify-content: flex-end;
  }
}

@media (max-width: 760px) {
  #recordsPanel .records-toolbar,
  #summaryPanel .records-toolbar,
  #issueReportsPanel .issue-toolbar,
  #logsPanel .logs-toolbar,
  .delivery-distribution-toolbar {
    grid-template-columns: 1fr !important;
  }

  #usersPanel .user-batch-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  #usersPanel .user-card-head {
    grid-template-columns: 22px minmax(0, 1fr) !important;
  }

  #usersPanel .user-badges,
  #usersPanel .user-card-actions {
    grid-column: 2;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

/* foldable-navigation-20260917
 * Foldable browsers commonly expose a 761-1040px CSS viewport even when the
 * device is being used like a phone. Use the mobile drawer in that range and
 * keep the navigation itself independently scrollable. */
:root {
  --qy-viewport-height: 100dvh;
  --qy-compact-bar-height: 62px;
}

.app-shell,
.sidebar,
.workspace {
  min-height: 0 !important;
}

.sidebar {
  height: var(--qy-viewport-height, 100dvh) !important;
  max-height: var(--qy-viewport-height, 100dvh) !important;
}

.side-brand,
.side-footer {
  flex: 0 0 auto !important;
}

.side-nav {
  position: relative;
  flex: 1 1 0 !important;
  flex-wrap: nowrap !important;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.side-nav .nav-item {
  flex: 0 0 auto !important;
}

@media (min-width: 761px) and (max-width: 1040px) {
  html,
  body {
    width: 100% !important;
    min-width: 0 !important;
    height: var(--qy-viewport-height, 100dvh) !important;
    overflow: hidden !important;
  }

  body.mobile-nav-open {
    overflow: hidden !important;
  }

  .app-shell,
  body.sidebar-collapsed .app-shell {
    width: 100vw !important;
    height: var(--qy-viewport-height, 100dvh) !important;
    min-height: 0 !important;
    display: block !important;
    grid-template-columns: none !important;
    padding: var(--qy-compact-bar-height) 0 0 !important;
    overflow: hidden !important;
  }

  .mobile-app-bar {
    position: fixed !important;
    inset: 0 0 auto 0 !important;
    z-index: 980 !important;
    height: var(--qy-compact-bar-height) !important;
    display: grid !important;
    grid-template-columns: 42px minmax(0, 1fr) 36px !important;
    align-items: center !important;
    gap: 10px !important;
    padding: max(8px, env(safe-area-inset-top)) 14px 8px !important;
    border-bottom: 1px solid var(--qy-border) !important;
    background: rgba(255, 255, 255, 0.96) !important;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06) !important;
    backdrop-filter: blur(12px);
  }

  .mobile-menu-btn {
    width: 40px !important;
    height: 40px !important;
  }

  .mobile-menu-lines,
  .mobile-menu-lines::before,
  .mobile-menu-lines::after {
    width: 20px !important;
    height: 2px !important;
    display: block !important;
    border-radius: 2px !important;
    background: var(--qy-text) !important;
  }

  .mobile-menu-lines {
    position: relative !important;
  }

  .mobile-menu-lines::before,
  .mobile-menu-lines::after {
    position: absolute !important;
    left: 0 !important;
    content: "" !important;
  }

  .mobile-menu-lines::before {
    top: -6px !important;
  }

  .mobile-menu-lines::after {
    top: 6px !important;
  }

  .mobile-nav-backdrop {
    position: fixed !important;
    inset: 0 !important;
    z-index: 1000 !important;
    display: block !important;
    background: rgba(15, 23, 42, 0.4) !important;
    backdrop-filter: blur(2px);
  }

  .mobile-nav-backdrop[hidden],
  body:not(.mobile-nav-open) .mobile-nav-backdrop {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .sidebar,
  body.sidebar-collapsed .sidebar {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    z-index: 1010 !important;
    width: min(86vw, 326px) !important;
    min-width: min(86vw, 326px) !important;
    height: var(--qy-viewport-height, 100dvh) !important;
    max-height: var(--qy-viewport-height, 100dvh) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    padding: calc(14px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom)) !important;
    overflow: hidden !important;
    border: 0 !important;
    border-right: 1px solid var(--qy-border) !important;
    border-radius: 0 22px 22px 0 !important;
    background: var(--qy-surface) !important;
    box-shadow: 18px 0 40px rgba(15, 23, 42, 0.18) !important;
    transform: translateX(-106%) !important;
    transition: transform 0.2s ease !important;
  }

  body.mobile-nav-open .sidebar,
  body.mobile-nav-open.sidebar-collapsed .sidebar {
    transform: translateX(0) !important;
  }

  .side-brand,
  body.sidebar-collapsed .side-brand {
    min-height: 48px !important;
    display: grid !important;
    grid-template-columns: 42px minmax(0, 1fr) 40px !important;
    align-items: center !important;
    justify-content: initial !important;
    gap: 10px !important;
    padding: 0 !important;
  }

  .side-brand .spark {
    width: 42px !important;
    min-width: 42px !important;
    height: 42px !important;
  }

  .side-brand > div:not(.spark),
  body.sidebar-collapsed .side-brand > div:not(.spark),
  .side-footer,
  body.sidebar-collapsed .side-footer,
  .side-footer .user-chip > div,
  body.sidebar-collapsed .side-footer .user-chip > div,
  .side-footer > .ghost-btn,
  body.sidebar-collapsed .side-footer > .ghost-btn {
    display: grid !important;
  }

  .sidebar-toggle {
    position: static !important;
    width: 40px !important;
    height: 40px !important;
    margin: 0 !important;
  }

  .side-nav {
    width: 100% !important;
    gap: 5px !important;
    padding: 4px 0 !important;
  }

  .side-nav .nav-item,
  body.sidebar-collapsed .side-nav .nav-item {
    width: 100% !important;
    min-width: 0 !important;
    height: 46px !important;
    min-height: 46px !important;
    display: grid !important;
    grid-template-columns: 28px minmax(0, 1fr) auto !important;
    justify-content: initial !important;
    gap: 10px !important;
    padding: 6px 12px !important;
    border-radius: 12px !important;
    text-align: left !important;
  }

  .side-nav .nav-icon,
  body.sidebar-collapsed .side-nav .nav-icon {
    margin: 0 !important;
  }

  .side-nav .desktop-label,
  body.sidebar-collapsed .side-nav .desktop-label {
    display: block !important;
  }

  .side-nav .mobile-label {
    display: none !important;
  }

  .side-footer {
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 10px !important;
    margin: 0 !important;
    padding: 10px 0 0 !important;
  }

  .side-footer .user-chip,
  body.sidebar-collapsed .side-footer .user-chip {
    grid-template-columns: 36px minmax(0, 1fr) !important;
    justify-content: initial !important;
  }

  .workspace {
    width: 100vw !important;
    height: calc(var(--qy-viewport-height, 100dvh) - var(--qy-compact-bar-height)) !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  .workspace > .panel,
  .workspace > .panel.active {
    height: 100% !important;
    min-height: 0 !important;
  }

  .sign-deduct-shell,
  .hourly-monitor-shell,
  .sign-deduct-frame,
  .hourly-monitor-frame {
    height: 100% !important;
    min-height: 0 !important;
  }
}

@media (max-width: 760px) {
  html,
  body,
  .app-shell {
    height: var(--qy-viewport-height, 100dvh) !important;
    max-height: var(--qy-viewport-height, 100dvh) !important;
  }

  .sidebar,
  body.sidebar-collapsed .sidebar {
    z-index: 1010 !important;
    height: var(--qy-viewport-height, 100dvh) !important;
    max-height: var(--qy-viewport-height, 100dvh) !important;
  }

  .mobile-nav-backdrop {
    z-index: 1000 !important;
  }
}
/* 记录中心 · 日报生成：独立于报警卡片，采用简洁的管理摘要布局。 */
.daily-report-hero {
  display:flex; align-items:center; justify-content:space-between; gap:24px;
  padding:28px 30px; background:linear-gradient(135deg,#f5f9ff 0%,#fff 58%,#f3fbf7 100%);
  border-color:#dbe7f7;
}
.daily-report-hero h2,.daily-report-toolbar-card h2{margin:4px 0 7px;font-size:26px;color:#17233b}
.daily-report-hero p{margin:0;color:#64748b;line-height:1.7}
.daily-report-role-badge{flex:none;padding:9px 14px;border-radius:999px;background:#e8f1ff;color:#205fc5;font-weight:700;font-size:13px}
.daily-report-toolbar-card{padding:20px 24px}
.daily-report-toolbar{display:grid;grid-template-columns:minmax(170px,220px) minmax(180px,240px) minmax(180px,240px) minmax(220px,1fr) auto;gap:14px;align-items:end}
.daily-report-toolbar>label:not(.daily-report-ai-toggle){display:flex;flex-direction:column;gap:7px;color:#56657d;font-size:13px;font-weight:700}
.daily-report-toolbar input[type="date"],.daily-report-toolbar input[readonly],.daily-report-toolbar select{height:44px;border:1px solid #d9e2ef;border-radius:11px;background:#fff;padding:0 13px;color:#17233b;font:inherit}
.daily-report-ai-toggle{min-height:44px;display:flex;align-items:center;gap:10px;padding:7px 12px;border:1px solid #e0e8f2;border-radius:11px;background:#f8fafc}
.daily-report-ai-toggle>span{display:flex;flex-direction:column;gap:2px}.daily-report-ai-toggle b{font-size:13px;color:#24324a}.daily-report-ai-toggle small{color:#8793a7;font-size:11px}
.daily-report-toolbar-actions{display:flex;gap:9px;align-items:center}.daily-report-toolbar-actions button{white-space:nowrap;min-height:44px}
.daily-report-workspace{display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:18px;align-items:start}
.daily-report-main{min-width:0;display:flex;flex-direction:column;gap:18px}.daily-report-main>#dailyReportContent{display:flex;flex-direction:column;gap:18px}.daily-report-main>#dailyReportContent[hidden]{display:none}
.daily-report-empty{text-align:center;padding:80px 24px}.daily-report-empty>div{width:58px;height:58px;border-radius:18px;display:grid;place-items:center;margin:0 auto 16px;background:#eaf2ff;color:#2366d1;font-size:24px;font-weight:800}.daily-report-empty h2{margin:0 0 8px}.daily-report-empty p{margin:0;color:#7a879b}
.daily-report-overview{padding:26px}.daily-report-overview-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px}.daily-report-overview-head h2{font-size:25px;margin:4px 0 6px;color:#18243a}.daily-report-overview-head p{margin:0;color:#8894a7;font-size:13px}.daily-report-source{padding:7px 11px;border-radius:999px;background:#edf7f2;color:#16855a;font-size:12px;font-weight:800}
.daily-report-kpis{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;margin-top:22px}.daily-report-kpis>div{padding:16px;border-radius:14px;background:#f7f9fc;border:1px solid #edf1f6}.daily-report-kpis span{display:block;color:#7a879b;font-size:12px;margin-bottom:7px}.daily-report-kpis b{font-size:22px;color:#18243a;letter-spacing:-.02em}
.daily-report-conclusion{margin-top:16px;padding:18px 20px;border-radius:14px;background:linear-gradient(90deg,#edf4ff,#f7fbff);border-left:4px solid #3978e9}.daily-report-conclusion>span{color:#3978e9;font-size:12px;font-weight:800;text-transform:uppercase}.daily-report-conclusion strong{display:block;margin:5px 0 4px;color:#17233b;font-size:17px}.daily-report-conclusion p{margin:0;color:#64748b;line-height:1.7}
.daily-report-facts-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.daily-report-facts-grid>.config-card{padding:22px;min-width:0}
.daily-report-fact-list{display:flex;flex-direction:column;gap:10px;margin-top:15px}.daily-report-fact-list.empty{min-height:120px;display:grid;place-items:center;color:#93a0b2}.daily-report-fact-list article{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 12px;padding:13px 14px;border-radius:12px;background:#f8fafc;border:1px solid #edf1f6}.daily-report-fact-list article>div{min-width:0}.daily-report-fact-list b{display:block;color:#25324a;font-size:13px}.daily-report-fact-list span{display:block;color:#718096;font-size:12px;margin-top:4px;line-height:1.5;white-space:normal}.daily-report-fact-list strong{color:#1e63c6;font-size:14px}.daily-report-fact-list small{color:#8a96a8;font-size:11px;align-self:end}
.daily-report-analysis-card{padding:24px}.daily-report-analysis-card h2{margin:4px 0 0}.daily-report-analysis-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-top:18px}.daily-report-analysis-grid>div{padding:16px;border-radius:13px;background:#fafbfc;border:1px solid #e9eef4}.daily-report-analysis-grid h3{margin:0 0 10px;font-size:14px;color:#2a3850}.daily-report-analysis-grid ul,.daily-report-analysis-grid ol{margin:0;padding-left:20px;color:#5f6e84;font-size:13px;line-height:1.75}.daily-report-analysis-grid li+li{margin-top:5px}.daily-report-analysis-grid .muted{color:#9aa5b5}
.daily-report-editor-card{padding:24px}.daily-report-editor-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:15px}.daily-report-editor-head h2{margin:4px 0 5px}.daily-report-editor-head p{margin:0;color:#7b879a}.daily-report-editor-head>div:last-child{display:flex;gap:9px}.daily-report-editor-card textarea{width:100%;min-height:430px;resize:vertical;border:1px solid #dce5ef;border-radius:14px;background:#fbfcfe;padding:19px 21px;box-sizing:border-box;color:#25324a;font:14px/1.8 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace;outline:none}.daily-report-editor-card textarea:focus{border-color:#6ea4f4;box-shadow:0 0 0 3px rgba(70,127,222,.1);background:#fff}
.daily-report-history-card{padding:20px;position:sticky;top:18px;max-height:calc(100vh - 42px);overflow:auto}.daily-report-history-card .table-head{align-items:flex-start}.daily-report-history-list{display:flex;flex-direction:column;gap:8px;margin-top:14px}.daily-report-history-list.empty{min-height:120px;display:grid;place-items:center;color:#99a4b5}.daily-report-history-item{width:100%;border:1px solid #e6ebf2;border-radius:12px;background:#fff;padding:12px;text-align:left;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 10px;color:inherit;cursor:pointer}.daily-report-history-item:hover{border-color:#bcd1ef;background:#f8fbff}.daily-report-history-item.active{border-color:#6f9fee;background:#eef5ff;box-shadow:inset 3px 0 #3978e9}.daily-report-history-item span{display:flex;align-items:center;gap:7px;min-width:0}.daily-report-history-item b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}.daily-report-history-item span small{padding:2px 6px;border-radius:999px;background:#edf1f6;color:#6f7d91;font-size:10px}.daily-report-history-item strong{font-size:12px;color:#54647b}.daily-report-history-item em{grid-column:1/-1;color:#98a3b3;font-size:10px;font-style:normal}
@media (max-width:1280px){.daily-report-workspace{grid-template-columns:minmax(0,1fr)}.daily-report-history-card{position:static;max-height:none}.daily-report-history-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}.daily-report-toolbar{grid-template-columns:repeat(3,minmax(160px,1fr))}.daily-report-toolbar-actions{grid-column:auto}.daily-report-ai-toggle{grid-column:span 2}}
@media (max-width:760px){.daily-report-hero{padding:20px;align-items:flex-start}.daily-report-role-badge{display:none}.daily-report-toolbar{grid-template-columns:1fr}.daily-report-ai-toggle,.daily-report-toolbar-actions{grid-column:auto}.daily-report-toolbar-actions{display:grid;grid-template-columns:1fr 1fr}.daily-report-kpis{grid-template-columns:repeat(2,1fr)}.daily-report-kpis>div:last-child{grid-column:1/-1}.daily-report-facts-grid,.daily-report-analysis-grid{grid-template-columns:1fr}.daily-report-editor-head{flex-direction:column}.daily-report-editor-head>div:last-child{width:100%;display:grid;grid-template-columns:1fr 1fr}.daily-report-history-list{grid-template-columns:1fr}.daily-report-overview,.daily-report-analysis-card,.daily-report-editor-card{padding:18px}.daily-report-editor-card textarea{min-height:360px;font-size:13px}}

/* 日报：明确实际职责、数据质量和分析来源。 */
.daily-report-profile{color:#45638a;font-size:13px;line-height:1.6;margin:12px 0 0}
.daily-report-data-note{color:#896227;background:#fff9ec;border:1px solid #f0e3c7;border-radius:9px;padding:10px 12px;font-size:12px;line-height:1.7;overflow-wrap:anywhere;margin:12px 0 0}
.daily-report-kpis.with-business{grid-template-columns:repeat(3,minmax(0,1fr))}
.daily-report-kpis>[hidden],.daily-report-data-note[hidden]{display:none}
@media(min-width:1600px){.daily-report-kpis.with-business{grid-template-columns:repeat(6,minmax(0,1fr))}}
@media(max-width:760px){.daily-report-kpis.with-business{grid-template-columns:repeat(2,minmax(0,1fr))}.daily-report-kpis.with-business>div:last-child{grid-column:auto}}

/* 20260917: 日报工作台视觉收口。控件统一高度、正文优先、明细汇总后置。 */
#dailyReportsPanel{color:#1f2c43}
#dailyReportsPanel .config-card{box-shadow:0 8px 24px rgba(31,52,82,.045)}
.daily-report-hero{padding:22px 26px;background:#fff;border-color:#e2e8f0}
.daily-report-hero h2,.daily-report-toolbar-card h2{font-size:22px;letter-spacing:-.02em}
.daily-report-hero p{font-size:14px;line-height:1.65}
.daily-report-role-badge{padding:7px 11px;font-size:12px;background:#edf4ff}.daily-report-source{flex:none;white-space:nowrap}
.daily-report-toolbar-card{padding:18px 20px;overflow:hidden}
.daily-report-toolbar{width:100%;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:12px;align-items:end}
.daily-report-toolbar>label:not(.daily-report-ai-toggle){min-width:0;gap:6px;font-size:12px}
.daily-report-toolbar input[type="date"],.daily-report-toolbar input[readonly],.daily-report-toolbar select{width:100%;min-width:0;height:42px;border-radius:9px;padding:0 12px;box-sizing:border-box;font-size:14px}
.daily-report-ai-toggle{min-width:0;min-height:42px;padding:6px 11px;border-radius:9px;box-sizing:border-box}
.daily-report-ai-toggle input{flex:0 0 16px!important;width:16px!important;height:16px!important;min-width:16px!important;margin:0!important;padding:0!important}
.daily-report-ai-toggle>span{min-width:0!important;margin:0!important}.daily-report-ai-toggle b{font-size:13px}.daily-report-ai-toggle small{font-size:10px;line-height:1.35}
.daily-report-toolbar-actions{min-width:0;display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:8px}
.daily-report-toolbar-actions button,.daily-report-editor-head button{width:100%;min-width:0;min-height:42px;padding:0 14px;border-radius:9px;font-size:13px;white-space:nowrap;box-sizing:border-box}
.daily-report-workspace{grid-template-columns:minmax(0,1fr) 280px;gap:16px}
.daily-report-main,.daily-report-main>#dailyReportContent{gap:16px}
.daily-report-overview{padding:24px}.daily-report-overview-head h2{font-size:23px}
.daily-report-kpis{gap:10px;margin-top:18px}.daily-report-kpis>div{padding:14px;border-radius:11px;background:#f8fafc}.daily-report-kpis b{font-size:20px}
.daily-report-conclusion{padding:16px 18px;border-radius:11px}.daily-report-conclusion strong{font-size:16px}
.daily-report-editor-card{padding:22px}.daily-report-editor-head{align-items:center;margin-bottom:13px}.daily-report-editor-head h2{font-size:19px}.daily-report-editor-head p{font-size:13px;line-height:1.55}.daily-report-editor-head>div:last-child{flex:0 0 auto}
.daily-report-editor-card textarea{min-height:340px;border-radius:11px;background:#fff;padding:18px 20px;color:#26344c;font:15px/1.9 -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;letter-spacing:.01em}
.daily-report-facts-grid{gap:16px}.daily-report-facts-grid.single{grid-template-columns:1fr}.daily-report-facts-grid>.config-card{padding:20px}
.daily-report-action-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.daily-report-action-summary article{margin:0;align-items:center;background:#fafbfd}.daily-report-action-summary article strong{align-self:center;font-size:15px}
.daily-report-analysis-card{padding:22px}.daily-report-analysis-grid{gap:12px;margin-top:15px}.daily-report-analysis-grid>div{padding:14px}
.daily-report-history-card{padding:18px}.daily-report-history-item{padding:11px;border-radius:10px}
@media (max-width:1280px){.daily-report-workspace{grid-template-columns:minmax(0,1fr)}.daily-report-toolbar{grid-template-columns:repeat(2,minmax(0,1fr))}.daily-report-toolbar-actions{grid-column:auto}.daily-report-ai-toggle{grid-column:auto}}
@media (max-width:760px){.daily-report-toolbar{grid-template-columns:1fr}.daily-report-action-summary{grid-template-columns:1fr}.daily-report-editor-card textarea{min-height:300px;font-size:14px}.daily-report-editor-head{align-items:flex-start}.daily-report-hero h2{font-size:20px}}

/* Account analysis header: compact inline filters/actions and opt-in comparison. */
#hourlyMonitorPanel .hourly-monitor-view-tabs {
  display:grid; grid-template-columns:repeat(3,minmax(124px,1fr)); gap:6px;
  width:fit-content; max-width:100%; padding:5px; margin:0 0 16px;
  border:1px solid #dce5f1; border-radius:12px; background:#edf2f9; overflow:visible;
}
#hourlyMonitorPanel .hourly-monitor-view-tabs button {
  min-width:0; min-height:44px; padding:10px 20px; border-radius:8px;
  font-size:14px; line-height:1.4; font-weight:600; white-space:nowrap;
}
#hourlyMonitorPanel .delivery-analysis-filter-card {
  display:flex; flex-direction:column; align-items:stretch; gap:12px;
  padding:14px 18px!important; min-width:0; box-shadow:0 3px 12px rgba(34,58,92,.035);
}
#hourlyMonitorPanel .delivery-analysis-header-row {
  display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:6px 16px; min-width:0;
}
#hourlyMonitorPanel .delivery-analysis-filter-copy { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 12px; min-width:0; }
#hourlyMonitorPanel .delivery-analysis-filter-copy h2 { font-size:18px; line-height:1.4; }
#hourlyMonitorPanel .delivery-analysis-filter-copy p:last-child { margin:0; font-size:12px; }
#hourlyMonitorPanel .delivery-analysis-toolbar { display:flex; flex-wrap:wrap; align-items:flex-end; gap:10px 14px; min-width:0; }
#hourlyMonitorPanel .delivery-analysis-refresh-actions {
  display:flex; flex:0 0 auto; flex-wrap:wrap; align-items:flex-end; gap:8px; align-self:auto;
  min-width:0; max-width:100%; margin-left:auto; grid-template-rows:none;
}
#hourlyMonitorPanel .delivery-analysis-auto-state { font-size:12px; font-weight:500; white-space:normal; }
#hourlyMonitorPanel .delivery-analysis-auto-state i { flex:0 0 7px; }
#hourlyMonitorPanel .delivery-analysis-refresh-buttons { display:flex; flex-wrap:wrap; gap:8px; }
#hourlyMonitorPanel .delivery-analysis-refresh-buttons button {
  width:auto; height:44px; min-height:44px!important; margin:0; padding:8px 12px!important;
  border-radius:9px!important; font-size:13px; line-height:1.5; font-weight:600!important; white-space:nowrap;
}
#hourlyMonitorPanel .delivery-analysis-filters {
  display:grid; flex:1 1 630px; grid-template-columns:minmax(145px,.8fr) minmax(165px,1.2fr) minmax(170px,1.3fr) minmax(120px,.8fr);
  gap:10px; width:auto; min-width:0; padding:0; border:0;
}
#hourlyMonitorPanel .delivery-analysis-filters > label { display:block; margin:0; min-width:0; }
#hourlyMonitorPanel .delivery-analysis-filters label > span { font-size:12px; font-weight:600; margin-bottom:5px; }
#hourlyMonitorPanel .delivery-analysis-filters input,
#hourlyMonitorPanel .delivery-analysis-filters select,
#hourlyMonitorPanel .delivery-analysis-compare-date input {
  box-sizing:border-box; width:100%; min-width:0; height:44px; min-height:44px;
  padding:8px 10px; margin:0; border:1px solid #d7e1ef; border-radius:9px;
  background:#fff; font-size:14px; line-height:1.5; color:#24364e;
}
#hourlyMonitorPanel .delivery-analysis-compare-bar {
  display:flex; flex-direction:column; align-items:stretch; gap:0; padding:12px;
  border:1px solid #dce7f6; border-radius:11px; background:#f7faff;
}
#hourlyMonitorPanel .delivery-analysis-compare-bar.is-disabled { display:none; }
#hourlyMonitorPanel .delivery-analysis-compare-switch {
  display:inline-flex; flex-direction:row; align-items:center; justify-content:center; gap:9px;
  height:44px; min-height:44px; min-width:106px; padding:8px 10px; margin:0;
  font-size:13px; font-weight:600; border-radius:9px; cursor:pointer;
}
#hourlyMonitorPanel .delivery-analysis-compare-switch input {
  flex:0 0 18px; width:18px!important; height:18px!important; min-height:18px!important; max-height:18px!important;
  padding:0; margin:0; cursor:pointer;
}
#hourlyMonitorPanel .delivery-analysis-compare-alignment {
  grid-column:auto; max-width:none; justify-self:auto; font-size:12px; font-weight:600; white-space:normal;
}
#hourlyMonitorPanel .delivery-analysis-compare-controls {
  display:grid; grid-template-columns:minmax(160px,220px) minmax(190px,240px) minmax(220px,280px);
  align-items:end; gap:10px 16px; padding:0; margin:0; border:0;
}
#hourlyMonitorPanel .delivery-analysis-compare-controls[hidden] { display:none!important; }
#hourlyMonitorPanel .delivery-analysis-compare-date,
#hourlyMonitorPanel .delivery-analysis-compare-field { min-width:0; margin:0; }
#hourlyMonitorPanel .delivery-analysis-compare-date > span,
#hourlyMonitorPanel .delivery-analysis-compare-field > span { display:block; color:#607089; font-size:12px; font-weight:600; margin-bottom:7px; }
#hourlyMonitorPanel .delivery-analysis-compare-presets,
#hourlyMonitorPanel .delivery-analysis-compare-modes { width:100%; padding:3px; gap:4px; border-radius:9px; }
#hourlyMonitorPanel .delivery-analysis-compare-presets button,
#hourlyMonitorPanel .delivery-analysis-compare-modes button {
  flex:1 1 0; min-width:0; min-height:44px; padding:8px 10px; font-size:13px; line-height:1.4; font-weight:600;
}
#hourlyMonitorPanel .delivery-analysis-compare-hint { grid-column:1/-1; display:flex; flex-wrap:wrap; gap:4px 12px; margin:0; color:#74859d; font-size:12px; line-height:1.5; }
#hourlyMonitorPanel .hourly-monitor-view-tabs button:focus-visible,
#hourlyMonitorPanel .delivery-analysis-filter-card :is(button,input,select):focus-visible { outline:3px solid #a8c8ff; outline-offset:2px; }
@media(max-width:1100px) {
  #hourlyMonitorPanel .delivery-analysis-compare-controls { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:680px) {
  #hourlyMonitorPanel .hourly-monitor-view-tabs { width:100%; grid-template-columns:repeat(3,minmax(0,1fr)); gap:3px; }
  #hourlyMonitorPanel .hourly-monitor-view-tabs button { padding:10px 6px; font-size:13px; }
  #hourlyMonitorPanel .delivery-analysis-filter-card { padding:12px!important; gap:10px; }
  #hourlyMonitorPanel .delivery-analysis-filters { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  #hourlyMonitorPanel .delivery-analysis-refresh-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); width:100%; margin-left:0; gap:8px; }
  #hourlyMonitorPanel .delivery-analysis-refresh-buttons { display:contents; }
  #hourlyMonitorPanel .delivery-analysis-refresh-buttons button { width:100%; }
  #hourlyMonitorPanel .delivery-analysis-compare-controls { grid-template-columns:minmax(0,1fr); }
}
@media(max-width:380px) {
  #hourlyMonitorPanel .delivery-analysis-filters { grid-template-columns:minmax(0,1fr); }
}
