.ml-content { width: min(1320px, calc(100% - 44px)); }

.boot-card { display: grid; justify-items: center; gap: 16px; text-align: center; }
.boot-card h1, .boot-card p { margin-bottom: 0; }

.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 15px 18px;
  background: rgba(16, 20, 29, .9);
}
.notice strong, .notice span { display: block; }
.notice strong { margin-bottom: 4px; font-size: 13px; }
.notice span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.error-notice { border-color: rgba(255, 100, 124, .35); background: rgba(100, 26, 39, .24); }
.safety-notice { border-color: rgba(93, 233, 255, .22); background: rgba(19, 70, 80, .14); }
.safety-notice.warning { border-color: rgba(255, 214, 107, .38); background: rgba(92, 65, 17, .2); }

#loadingState { min-height: 260px; margin-top: 12px; border: 1px solid var(--border); border-radius: var(--radius); }
.ml-kpi-grid { margin-bottom: 18px; }
.compact-value { overflow: hidden; font-size: clamp(17px, 2vw, 24px); text-overflow: ellipsis; white-space: nowrap; }

.operation-panel {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 18px;
  padding: 22px;
}
.operation-panel .eyebrow, .panel-header .eyebrow { margin-top: 0; }
.operation-panel h2, .operation-panel p { margin-bottom: 0; }
.operation-panel h2 { margin-bottom: 7px; }
.sync-form { display: grid; grid-template-columns: minmax(160px, 210px) auto; gap: 8px; align-items: end; }
.sync-form label { grid-column: 1 / -1; color: var(--muted); font-size: 10px; font-weight: 650; }
.sync-form .button { min-width: 170px; padding: 0 16px; }

.audit-grid { display: grid; gap: 18px; }
.audit-panel { overflow: hidden; }
.panel-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--border);
  padding: 20px;
}
.panel-header h2, .panel-header p { margin-bottom: 0; }
.filter-form { display: flex; align-items: end; gap: 8px; }
.filter-form label { display: grid; gap: 6px; color: var(--muted); font-size: 9px; font-weight: 650; }
.filter-form input { width: 155px; }
.filter-form select { width: 130px; }

.ml-table { min-width: 760px; }
.ml-table th:last-child, .ml-table td:last-child { text-align: right; }
.ml-table .cell-main { color: var(--text); font-weight: 700; }
.ml-table .cell-detail { display: block; margin-top: 4px; color: var(--subtle); font-size: 9px; }
.source-list { display: flex; flex-wrap: wrap; gap: 4px; }
.source-chip, .tone-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}
.source-chip.active { border-color: rgba(93, 233, 255, .32); color: var(--cyan); background: rgba(93, 233, 255, .06); }
.tone-badge.good { border-color: rgba(93, 255, 177, .3); color: var(--green); }
.tone-badge.warning { border-color: rgba(255, 214, 107, .34); color: var(--yellow); }
.tone-badge.danger { border-color: rgba(255, 100, 124, .34); color: var(--red); }
.table-action { min-height: 32px; padding: 0 10px; font-size: 10px; }
.empty-audit { display: grid; min-height: 150px; place-content: center; gap: 6px; padding: 28px; text-align: center; }
.empty-audit strong { font-size: 13px; }
.empty-audit span { color: var(--muted); font-size: 11px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; border-top: 1px solid var(--border); padding: 14px 18px; }
.pagination span { min-width: 120px; text-align: center; font-size: 10px; }

textarea {
  min-height: 110px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(7, 9, 14, .7);
  color: var(--text);
  padding: 12px 13px;
  font: inherit;
}
textarea:focus { border-color: var(--cyan); outline: none; box-shadow: 0 0 0 3px rgba(93, 233, 255, .09); }
.dialog { padding: 24px; }

@media (max-width: 1024px) {
  .ml-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .operation-panel { align-items: stretch; flex-direction: column; }
  .sync-form { grid-template-columns: minmax(0, 1fr) auto; }
  .conflicts-header { align-items: stretch; flex-direction: column; }
}

@media (max-width: 768px) {
  .ml-content { width: min(100% - 28px, 1320px); padding-top: 26px; }
  .topbar { flex-wrap: wrap; gap: 8px 16px; padding: 12px 16px; }
  .topnav { order: 3; width: 100%; min-height: 42px; overflow-x: auto; }
  .topnav a { flex: 0 0 auto; }
  .top-actions { margin-left: auto; }
  .page-heading { align-items: start; flex-direction: column; }
  .heading-meta { text-align: left; }
  .filter-form { display: grid; grid-template-columns: 1fr 1fr; }
  .filter-form label, .filter-form input, .filter-form select { width: 100%; }
  .filter-form .button { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  .ml-content { width: min(100% - 22px, 1320px); }
  .top-actions .status-badge { display: none; }
  .ml-kpi-grid { grid-template-columns: 1fr; }
  .operation-panel, .panel-header { padding: 17px; }
  .sync-form { grid-template-columns: 1fr; }
  .sync-form label { grid-column: auto; }
  .sync-form .button { width: 100%; }
  .notice { align-items: stretch; flex-direction: column; }
  .notice .button { width: 100%; }
  .filter-form { grid-template-columns: 1fr; }
  .filter-form .button { grid-column: auto; }
  .pagination { justify-content: space-between; gap: 6px; }
  .pagination span { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .sync-icon, .spinner { animation-duration: 1.8s !important; }
}
