:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #0f1720;
  --muted: #516072;
  --accent: #0b63ce;
  --accent-2: #12407a;
  --ok: #0f7b32;
  --warn: #a15d00;
  --bad: #b42318;
  --border: #d8e0e8;
}

html,
body {
  height: 100%;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  background: radial-gradient(circle at 15% 10%, #dce9f7 0%, #f4f6f8 45%, #eef2f6 100%);
  color: var(--text);
  min-height: 100vh;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

body.auth-locked {
  overflow: hidden;
}

body.auth-locked > header,
body.auth-locked > main {
  filter: blur(28px) saturate(0.55);
  opacity: 0.12;
  pointer-events: none;
  user-select: none;
}

header {
  padding: 18px 22px;
  background: linear-gradient(120deg, #0d2a4d, #18487a);
  color: #fff;
  transition: filter 140ms ease, opacity 140ms ease;
}

.top-page-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.page-tab {
  border: 1px solid rgba(210, 226, 247, 0.45);
  background: rgba(255, 255, 255, 0.08);
  color: #dbe9fa;
  border-radius: 9px;
  padding: 7px 14px;
  font-weight: 600;
  min-height: 34px;
}

.page-tab:hover {
  border-color: rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.14);
}

.page-tab.active {
  background: #f6fbff;
  color: #123657;
  border-color: #f6fbff;
}

.header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.header-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.header-user-session {
  display: grid;
  gap: 6px;
  min-width: 220px;
  padding: 8px 10px;
  border: 1px solid rgba(210, 226, 247, 0.3);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
}

.header-user-label {
  font-size: 12px;
  color: #d2e2f7;
  font-weight: 600;
}

.header-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.header-user-row strong {
  color: #ffffff;
}

.header-user-row button {
  min-height: 30px;
}

.header-db-switch {
  display: grid;
  gap: 6px;
  min-width: 280px;
}

.header-db-switch label {
  font-size: 12px;
  color: #d2e2f7;
  font-weight: 600;
}

.header-db-switch select {
  border: 1px solid #2b5a8f;
  background: #f6fbff;
  color: #123657;
  min-height: 34px;
}

header h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.2px;
}

header .sub {
  margin-top: 5px;
  color: #d2e2f7;
  font-size: 13px;
}

main {
  padding: 18px 22px 28px;
  transition: filter 140ms ease, opacity 140ms ease;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

body.widget-page-active {
  overflow: hidden;
}

body.widget-page-active main {
  overflow: hidden;
  padding-bottom: 18px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.app-page[hidden] {
  display: none !important;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(7, 14, 24, 0.76);
  backdrop-filter: blur(22px) saturate(0.72);
  -webkit-backdrop-filter: blur(22px) saturate(0.72);
  z-index: 20000;
}

.auth-overlay.visible {
  display: flex;
}

.auth-card {
  width: min(440px, 100%);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(216, 224, 232, 0.9);
  border-radius: 16px;
  box-shadow: 0 28px 90px rgba(6, 18, 34, 0.42);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 22px;
  display: grid;
  gap: 12px;
}

.auth-card h2 {
  margin: 0;
  font-size: 24px;
}

.auth-card label {
  display: grid;
  gap: 6px;
}

.auth-card input {
  min-height: 40px;
}

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

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(20, 38, 58, 0.06);
}

.collapsible-panel {
  padding-top: 10px;
  padding-bottom: 10px;
}

.collapsible-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.collapsible-panel > summary::-webkit-details-marker {
  display: none;
}

.collapsible-panel > summary::after {
  content: "▸";
  font-size: 15px;
  line-height: 1;
  color: #24486f;
  font-weight: 700;
}

.collapsible-panel[open] > summary::after {
  content: "▾";
}

.collapsible-panel > summary strong {
  font-size: 14px;
}

.heading-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.help-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid #c9defa;
  background: #eef6ff;
  color: #1b436f;
  padding: 0;
  cursor: help;
  flex-shrink: 0;
}

.help-icon-btn:hover {
  filter: none;
}

.help-icon-btn svg {
  width: 12px;
  height: 12px;
  display: block;
}

.help-icon-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.floating-tooltip {
  position: fixed;
  left: 0;
  top: 0;
  transform: translateY(2px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  width: max-content;
  max-width: min(360px, calc(100vw - 24px));
  padding: 8px 10px;
  border-radius: 8px;
  background: #111111;
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  white-space: normal;
  z-index: 10000;
  transition: opacity 0.06s linear, transform 0.06s linear;
}

.floating-tooltip.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.floating-tooltip::after {
  content: "";
  position: absolute;
  left: var(--tooltip-arrow-x, 50%);
  transform: translateX(-50%);
  border: 6px solid transparent;
}

.floating-tooltip[data-side="top"]::after {
  top: 100%;
  border-top-color: #111111;
}

.floating-tooltip[data-side="bottom"]::after {
  bottom: 100%;
  border-bottom-color: #111111;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.claim-banner {
  border: 1px solid #c9defa;
  background: #eef6ff;
  border-radius: 10px;
  padding: 10px 12px;
  display: grid;
  gap: 8px;
}

.claim-banner.blocked {
  border-color: #f2c1b8;
  background: #fff2ef;
}

.claim-banner-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.claim-banner-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.claim-chip {
  border-radius: 999px;
  border: 1px solid #c6d4e3;
  background: #ffffff;
  color: #284462;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 9px;
}

.claim-chip.mine {
  border-color: #bcd9c4;
  color: #0f6e2b;
  background: #edf9f0;
}

.claim-chip.other {
  border-color: #f0d1a0;
  color: #915707;
  background: #fff7e8;
}

.claim-chip.available {
  border-color: #c9defa;
  color: #0c4a84;
  background: #f4f9ff;
}

button {
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 10px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
}

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

button.running {
  opacity: 0.88;
}

button:hover {
  filter: brightness(0.98);
}

input,
select,
textarea {
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 6px 8px;
  font-size: 13px;
  background: #fff;
}

textarea {
  width: 100%;
  min-height: 52px;
}

#log {
  font-family: "IBM Plex Mono", "Consolas", monospace;
  font-size: 12px;
  background: #0f1720;
  color: #dbe7ff;
  border-radius: 9px;
  padding: 10px;
  max-height: 160px;
  overflow: auto;
  white-space: pre-wrap;
}

#toast-stack {
  position: fixed;
  top: 14px;
  right: 14px;
  display: grid;
  gap: 8px;
  width: min(420px, calc(100vw - 24px));
  z-index: 9999;
}

.toast {
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: #152433;
  box-shadow: 0 8px 22px rgba(15, 23, 32, 0.15);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.35;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.toast-info {
  border-color: #c7daf5;
  background: #eef6ff;
  color: #1b436f;
}

.toast.toast-success {
  border-color: #b7dfc4;
  background: #effaf2;
  color: #156737;
}

.toast.toast-error {
  border-color: #efc2c2;
  background: #fff2f2;
  color: #8d1f1f;
}

.toast.hide {
  opacity: 0;
  transform: translateY(-6px);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}

.mono {
  font-family: "IBM Plex Mono", "Consolas", monospace;
}

.summary-card {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px;
  background: #fcfdff;
  display: grid;
  gap: 8px;
}

.summary-card h3 {
  margin: 0;
  font-size: 15px;
}

#db-meta {
  color: #335471;
}

#table-projection {
  display: grid;
  gap: 10px;
}

.projection-card {
  background: #fbfdff;
}

.projection-table-wrap {
  overflow-x: auto;
  border: 1px solid #dbe4ee;
  border-radius: 8px;
}

.projection-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.projection-table th,
.projection-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #e7edf4;
  text-align: left;
  font-size: 12px;
  vertical-align: top;
}

.projection-table th {
  background: #eef5fc;
  color: #234566;
  font-weight: 700;
}

.projection-table tbody tr:last-child td {
  border-bottom: none;
}

.projection-table tbody tr.projection-warn td {
  background: #fff7ec;
}

.projection-table tbody tr.projection-review td {
  background: #fef8ec;
}

.projection-table tbody tr.projection-total-row td {
  background: #f2f7fd;
  font-weight: 700;
}

.projection-core-breakdown {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.projection-stats-row {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.projection-stat-box {
  border: 1px solid #d7e4f3;
  border-radius: 8px;
  background: #f5f9ff;
  padding: 8px;
  display: grid;
  gap: 4px;
}

.projection-stat-box span {
  font-size: 11px;
  color: #3a5675;
}

.projection-stat-box strong {
  font-size: 16px;
  color: #12395f;
}

.summary-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.summary-total {
  font-family: "IBM Plex Mono", "Consolas", monospace;
  font-size: 11px;
  color: #294766;
  border: 1px solid #cfe0f4;
  background: #f2f8ff;
  border-radius: 999px;
  padding: 3px 8px;
  white-space: nowrap;
}

.summary-state {
  border-radius: 999px;
  border: 1px solid #d8e0e8;
  background: #f5f8fc;
  color: #334a62;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  width: fit-content;
}

.summary-state.ok {
  border-color: #b8e2c6;
  background: #eaf8ee;
  color: #176737;
}

.summary-state.info {
  border-color: #c9defa;
  background: #eef6ff;
  color: #1b436f;
}

.summary-state.warn {
  border-color: #f4cd9f;
  background: #fff5e8;
  color: #8c4f00;
}

.summary-state.bad {
  border-color: #f6bbbb;
  background: #ffecec;
  color: #a12c2c;
}

.summary-progress-wrap {
  display: grid;
  gap: 5px;
}

.summary-progress {
  height: 8px;
  width: 100%;
  border-radius: 999px;
  border: 1px solid #dbe6f3;
  background: #f4f8fd;
  overflow: hidden;
}

.summary-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4a8fd9, #2f74c2);
  border-radius: inherit;
}

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

.summary-metric {
  border: 1px solid #e2eaf3;
  border-radius: 8px;
  padding: 7px;
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
}

.summary-metric strong {
  font-family: "IBM Plex Mono", "Consolas", monospace;
  font-size: 13px;
}

.summary-metric.ok {
  background: #effaf2;
  border-color: #c9e8d1;
}

.summary-metric.info {
  background: #eef6ff;
  border-color: #d1e3fb;
}

.summary-metric.warn {
  background: #fff7ee;
  border-color: #f0d2ad;
}

.summary-metric.bad {
  background: #fff2f2;
  border-color: #f1c3c3;
}

.summary-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.summary-chip {
  border-radius: 999px;
  border: 1px solid #d9e2ec;
  background: #f5f8fc;
  color: #334a62;
  font-size: 11px;
  padding: 3px 8px;
}

.summary-chip.ok {
  border-color: #b8e2c6;
  background: #eaf8ee;
  color: #176737;
}

.summary-chip.info {
  border-color: #c9defa;
  background: #eef6ff;
  color: #1b436f;
}

.summary-chip.warn {
  border-color: #f4cd9f;
  background: #fff5e8;
  color: #8c4f00;
}

.summary-chip.bad {
  border-color: #f6bbbb;
  background: #ffecec;
  color: #a12c2c;
}

.summary-apply-card {
  grid-column: 1 / -1;
}

.apply-list {
  display: grid;
  gap: 8px;
}

.apply-row {
  border: 1px solid #e2eaf3;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  display: grid;
  gap: 6px;
}

.apply-entity {
  font-size: 13px;
  font-weight: 700;
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.workflow-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfdff;
  padding: 10px;
  display: grid;
  gap: 7px;
}

.workflow-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.workflow-card h4 {
  margin: 0;
  font-size: 14px;
}

.workflow-step-badge {
  border-radius: 999px;
  border: 1px solid #d8e0e8;
  background: #f5f8fc;
  color: #334a62;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  white-space: nowrap;
}

.workflow-step-badge.done {
  border-color: #b8e2c6;
  background: #eaf8ee;
  color: #176737;
}

.workflow-card.done {
  border-color: #b8e2c6;
  background: #f2fcf5;
}

.workflow-card.done .workflow-counts {
  border-color: #cfe8d7;
  background: #f6fcf8;
  color: #1f4a2f;
}

.workflow-counts {
  font-family: "IBM Plex Mono", "Consolas", monospace;
  font-size: 11px;
  color: #314357;
  background: #f3f7fc;
  border: 1px solid #dbe6f3;
  border-radius: 7px;
  padding: 6px;
}

.workflow-note {
  font-size: 12px;
  color: #23374d;
}

.table-hint {
  margin-top: 2px;
  margin-bottom: 6px;
  font-family: "IBM Plex Mono", "Consolas", monospace;
}

.workflow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.auto-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.auto-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfdff;
  padding: 10px;
  display: grid;
  gap: 7px;
}

.auto-card h4 {
  margin: 0;
  font-size: 14px;
  text-transform: capitalize;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  font-size: 12px;
  border: 1px solid #e2eaf3;
  border-radius: 7px;
  padding: 6px;
  background: #fff;
}

.metric-row.subtle {
  background: #f8fbff;
}

.metric-row strong {
  font-family: "IBM Plex Mono", "Consolas", monospace;
}

.metric-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 10px;
  align-items: start;
}

.glossary-box {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fbfdff;
  padding: 10px;
  display: grid;
  gap: 7px;
  align-content: start;
  height: fit-content;
}

.glossary-box h4 {
  margin: 0;
  font-size: 14px;
}

.table-wrap {
  overflow-x: auto;
}

.glossary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.glossary-table th,
.glossary-table td {
  border: 1px solid #e4ebf3;
  padding: 6px;
  text-align: left;
  vertical-align: top;
}

.glossary-table th {
  background: #f4f8fe;
}

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

.item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-top: 10px;
  background: #fff;
}

.item-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.heading-wrap strong {
  display: block;
}

.heading-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.action-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
  padding: 2px 8px;
  border: 1px solid #d4dbe5;
  background: #f4f6f8;
  color: #273447;
}

.action-pill.merge {
  border-color: #9fd8b2;
  background: #eaf8ee;
  color: #176737;
}

.action-pill.add {
  border-color: #b8c8f6;
  background: #edf2ff;
  color: #22478f;
}

.action-pill.skip,
.action-pill.pending {
  border-color: #d7dfe9;
  background: #f5f7fa;
  color: #4c5b70;
}

.action-pill.pending:not(.done) {
  opacity: 0.88;
}

.action-pill.confidence {
  border-color: #c9defa;
  background: #eef6ff;
  color: #14406f;
}

.action-pill.confidence.very-strong {
  border-color: #9fd8b2;
  background: #eaf8ee;
  color: #176737;
}

.action-pill.confidence.strong {
  border-color: #b8d9f7;
  background: #eff7ff;
  color: #205a8f;
}

.action-pill.confidence.medium {
  border-color: #f4cd9f;
  background: #fff5e8;
  color: #8c4f00;
}

.action-pill.confidence.weak,
.action-pill.confidence.unknown {
  border-color: #d7dfe9;
  background: #f5f7fa;
  color: #4c5b70;
}

.action-pill.status-pill {
  border-color: #d7dfe9;
  background: #f5f7fa;
  color: #4c5b70;
}

.action-pill.status-pill.needs_review {
  border-color: #f4cd9f;
  background: #fff5e8;
  color: #a15d00;
}

.action-pill.status-pill.auto_approved {
  border-color: #b8e2c6;
  background: #eaf8ee;
  color: #0f7b32;
}

.action-pill.status-pill.blocked_parent {
  border-color: #f6bbbb;
  background: #ffecec;
  color: #b42318;
}

.action-pill.status-pill.applied {
  border-color: #bdd2f6;
  background: #eaf1ff;
  color: #12407a;
}

.action-pill.status-pill.approved {
  border-color: #bad6ff;
  background: #ebf5ff;
  color: #12407a;
}

.action-pill.status-pill.rejected {
  border-color: #efc2c2;
  background: #fff2f2;
  color: #8d1f1f;
}

.badge {
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  border: 1px solid var(--border);
}

.badge.needs_review { background: #fff5e8; color: var(--warn); border-color: #f4cd9f; }
.badge.auto_approved { background: #eaf8ee; color: var(--ok); border-color: #b8e2c6; }
.badge.blocked_parent { background: #ffecec; color: var(--bad); border-color: #f6bbbb; }
.badge.applied { background: #eaf1ff; color: var(--accent-2); border-color: #bdd2f6; }
.badge.approved { background: #ebf5ff; color: var(--accent-2); border-color: #bad6ff; }

.notice {
  margin-top: 10px;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
}

.notice.warning {
  background: #fff4e6;
  border: 1px solid #f3cfaa;
  color: #925200;
}

.notice.info {
  background: #eef6ff;
  border: 1px solid #c9defa;
  color: #14406f;
}

.reason-panel {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px;
  background: #fcfdff;
}

.reason-panel h4 {
  margin: 0 0 8px;
  font-size: 14px;
}

.reason-body {
  margin-top: 8px;
}

.reason-panel.info {
  border-color: #c9defa;
  background: #f3f9ff;
}

.reason-panel.warning {
  border-color: #f3cfaa;
  background: #fff4e6;
}

.reason-line {
  font-size: 13px;
  margin-bottom: 6px;
}

.item-body {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 10px;
}

.info-block {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px;
  background: #fbfdff;
}

.info-block h4,
.candidates h4,
.decision-panel h4 {
  margin: 0 0 8px;
  font-size: 13px;
}

.kv-list {
  display: grid;
  gap: 6px;
}

.kv-row {
  display: grid;
  grid-template-columns: 45% 55%;
  gap: 6px;
  align-items: baseline;
  font-size: 12px;
}

.kv-key {
  color: var(--muted);
  font-family: "IBM Plex Mono", "Consolas", monospace;
}

.kv-val {
  color: #1e2b39;
  font-family: "IBM Plex Mono", "Consolas", monospace;
  overflow-wrap: anywhere;
}

.kv-row-different .kv-key,
.kv-key-different {
  color: #8b1f1a;
}

.kv-val-different {
  color: #7a1c16;
}

.ben10-diff-hint {
  margin-top: 8px;
  color: #4f6178;
}

.comparison-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.compare-col {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: #fafcff;
}

.compare-head {
  margin: 0 0 10px;
  font-size: 14px;
}

.selected-existing {
  margin-top: 10px;
  border: 1px solid #d8e3f0;
  border-radius: 9px;
  padding: 8px;
  background: #fff;
}

.selected-existing h4 {
  margin: 0 0 8px;
  font-size: 13px;
}

.compare-summary {
  margin-top: 8px;
}

.compare-list {
  margin-top: 8px;
  border-radius: 8px;
  border: 1px solid #dde6ef;
  padding: 8px;
  background: #fff;
}

.compare-list.same {
  border-color: #b6dfc5;
  background: #f1fbf5;
}

.compare-list.different {
  border-color: #f2c8c8;
  background: #fff4f4;
}

.compare-list.unknown {
  border-color: #d7deea;
  background: #f8faff;
}

.compare-list-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}

.compare-list-line {
  font-size: 12px;
  margin-bottom: 4px;
  color: #1d2a37;
}

.diff-ben10-token {
  color: #b42318;
  background: #ffe3e3;
  border-radius: 3px;
  padding: 0 2px;
}

.diff-candidate-token {
  color: #b42318;
  background: #ffe3e3;
  border-radius: 3px;
  padding: 0 2px;
}

.stage-review-panel {
  margin-top: 12px;
  border: 1px solid #d8e4f2;
  border-radius: 10px;
  padding: 10px;
  background: #fbfdff;
}

.stage-review-panel h4 {
  margin: 0 0 8px;
  font-size: 13px;
}

.stage-review-intro {
  color: #50637a;
  margin-bottom: 8px;
}

.stage-review-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.stage-pair-list {
  display: grid;
  gap: 10px;
}

.stage-pair-card {
  border: 1px solid #dbe5ef;
  border-radius: 9px;
  padding: 9px;
  background: #fff;
}

.stage-pair-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.stage-pair-title {
  font-size: 13px;
  font-weight: 700;
  color: #1c2a37;
}

.stage-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stage-side {
  border: 1px solid #e0e8f1;
  border-radius: 8px;
  padding: 8px;
  background: #fcfdff;
}

.stage-side-title {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #213345;
}

.stage-kv-list {
  gap: 4px;
}

.stage-meta-note {
  margin-top: 6px;
  color: #50637a;
}

.stage-action-wrap {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.stage-action-help {
  color: #50637a;
}

.candidates {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px;
  background: #fcfdff;
}

.candidate-list {
  display: grid;
  gap: 8px;
}

.candidate-choice {
  border: 1px solid #dae4ef;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.candidate-choice.selected {
  border-color: #79a6de;
  background: #f0f7ff;
}

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

.candidate-title {
  font-size: 13px;
  color: #1c2a37;
  font-weight: 600;
}

.google-lookup-panel {
  margin-top: 10px;
  border: 1px solid #d8e4f2;
  border-radius: 9px;
  padding: 9px;
  background: #fcfdff;
  display: grid;
  gap: 8px;
}

.google-lookup-panel h4 {
  margin: 0;
  font-size: 13px;
}

.google-lookup-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border: 1px solid #c9d7ea;
  border-radius: 7px;
  text-decoration: none;
  color: #20456c;
  background: #f4f9ff;
  font-size: 12px;
  font-weight: 600;
}

.button-link:hover {
  background: #ecf4ff;
}

.google-results-block {
  border: 1px solid #dee7f2;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.google-results-block h4 {
  margin: 0 0 6px;
  font-size: 12px;
}

.google-results-list {
  margin: 0;
  padding-left: 16px;
  display: grid;
  gap: 6px;
}

.google-results-list li a {
  color: #1a4f8a;
  text-decoration: none;
  font-weight: 600;
}

.google-results-list li a:hover {
  text-decoration: underline;
}

.candidate-main {
  font-size: 13px;
  color: #1c2a37;
}

.use-btn {
  padding: 4px 8px;
  font-size: 12px;
  background: #eef5ff;
  border-color: #cbdcf8;
}

.use-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.decision-panel {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px;
  background: #fbfdff;
}

.selected-target {
  margin: 8px 0;
  border: 1px solid #d4e4f8;
  border-radius: 8px;
  background: #f4f9ff;
  padding: 8px;
  font-size: 12px;
  color: #123e70;
}

.decision-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 8px;
}

.control {
  display: grid;
  gap: 4px;
}

.control.note {
  grid-column: 1 / -1;
}

.action-help {
  margin: 8px 0;
  border: 1px dashed #cbd9ea;
  border-radius: 8px;
  padding: 8px;
  font-size: 12px;
  color: #23354a;
  background: #f8fbff;
}

.decision-buttons {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.advanced-actions {
  margin-top: 10px;
}

.advanced-actions summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
}

.advanced-intro {
  margin-top: 8px;
  margin-bottom: 8px;
  color: #2a3a4f;
}

.advanced-edit-panel {
  margin-top: 10px;
  border: 1px solid #dce6f1;
  border-radius: 8px;
  padding: 8px;
  background: #fdfefe;
}

.advanced-edit-title {
  font-size: 12px;
  font-weight: 600;
  color: #213247;
  margin-bottom: 6px;
}

.advanced-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 8px;
}

.advanced-target-controls {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.advanced-target-controls .small {
  flex: 1 1 260px;
}

.raw-json {
  margin-top: 10px;
}

.raw-json summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
}

.raw-json pre {
  margin: 8px 0 0;
  background: #0f1720;
  color: #dbe7ff;
  padding: 8px;
  border-radius: 8px;
  font-size: 11px;
  overflow-x: auto;
  white-space: pre;
}

.advanced-block {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.info-block pre {
  margin: 8px 0 0;
  background: #0f1720;
  color: #dbe7ff;
  padding: 8px;
  border-radius: 8px;
  font-size: 11px;
  overflow-x: auto;
  white-space: pre;
}

.duplicate-summary-bar {
  border: 1px solid #d7e4f3;
  border-radius: 8px;
  background: #f5f9ff;
  padding: 8px 10px;
  color: #254564;
}

.duplicate-groups-list {
  display: grid;
  gap: 10px;
}

.duplicate-group-card {
  border: 1px solid #d9e3ee;
  border-radius: 10px;
  background: #fcfdff;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.duplicate-group-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.duplicate-group-title {
  font-size: 15px;
  font-weight: 700;
  color: #1d2d3f;
}

.duplicate-group-sub {
  color: #4c6077;
  margin-top: 3px;
}

.duplicate-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.duplicate-controls .control {
  min-width: 220px;
}

.duplicate-generation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
}

.duplicate-generation-card {
  border: 1px solid #dbe5ef;
  border-radius: 9px;
  background: #ffffff;
  padding: 8px;
  display: grid;
  gap: 6px;
}

.duplicate-generation-card.keep {
  border-color: #b8e2c6;
  background: #f2fcf5;
}

.duplicate-generation-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
}

.duplicate-generation-title {
  font-weight: 700;
  color: #1f3043;
}

.duplicate-engine-list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.duplicate-engine-item {
  border: 1px solid #e1e9f2;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  display: grid;
  gap: 6px;
}

.duplicate-engine-line {
  font-family: "IBM Plex Mono", "Consolas", monospace;
  font-size: 12px;
  color: #243f59;
  line-height: 1.45;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.duplicate-engine-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1px;
}

.duplicate-engine-badge.exact {
  background: #e6f7ea;
  color: #116638;
  border: 1px solid #bde2c8;
}

.duplicate-engine-badge.exact.group-0 { background: #e6f7ea; border-color: #bde2c8; color: #116638; }
.duplicate-engine-badge.exact.group-1 { background: #e8f2ff; border-color: #b9d4fb; color: #1d4f9a; }
.duplicate-engine-badge.exact.group-2 { background: #f4ecff; border-color: #d8c1f7; color: #5d2f95; }
.duplicate-engine-badge.exact.group-3 { background: #fff2e8; border-color: #f3c9ac; color: #8f4b18; }
.duplicate-engine-badge.exact.group-4 { background: #e9fbf7; border-color: #b9eadf; color: #0e6f5a; }
.duplicate-engine-badge.exact.group-5 { background: #fff7e8; border-color: #efd8a8; color: #7b5a13; }

.duplicate-engine-badge.similar {
  background: #fff4de;
  color: #8a5200;
  border: 1px solid #f2d29b;
}

.duplicate-sig-box {
  border: 1px solid #dfebf7;
  border-radius: 8px;
  background: #f8fbff;
  padding: 8px;
  display: grid;
  gap: 6px;
}

.duplicate-sig-title {
  font-size: 12px;
  font-weight: 700;
  color: #1f3651;
}

.duplicate-sig-engine-line {
  font-family: "IBM Plex Mono", "Consolas", monospace;
  font-size: 11px;
  color: #31485f;
}

.duplicate-sig-merge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #e1e9f2;
  border-radius: 8px;
  padding: 6px 8px;
  background: #fff;
}

.duplicate-sig-merge-card {
  display: grid;
  gap: 8px;
  align-items: stretch;
}

.duplicate-pair-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 8px;
}

.duplicate-pair-pane {
  border: 1px solid #dce6f1;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  display: grid;
  gap: 8px;
}

.duplicate-pair-pane.source {
  border-left: 4px solid #c86f1d;
}

.duplicate-pair-pane.target {
  border-left: 4px solid #2d8f4a;
}

.duplicate-stage-editor {
  border: 1px solid #dbe6f2;
  border-radius: 8px;
  padding: 8px;
  background: #fbfdff;
  display: grid;
  gap: 8px;
}

.duplicate-stage-rows {
  display: grid;
  gap: 8px;
}

.duplicate-stage-row {
  border: 1px solid #e2eaf3;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  align-items: end;
}

.duplicate-match-suggestions {
  display: grid;
  gap: 6px;
}

.duplicate-match-row {
  border: 1px solid #e1e9f2;
  border-radius: 8px;
  background: #fff;
  padding: 6px 8px;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
}

.duplicate-match-row.exact {
  border-color: #bde2c8;
  background: #f5fcf7;
}

.duplicate-match-row.similar {
  border-color: #f2d29b;
  background: #fffaf0;
}

.duplicate-engine-update-grid {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.duplicate-engine-update-card {
  border: 1px solid #e1e9f2;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.duplicate-engine-update-card > summary {
  cursor: pointer;
  font-weight: 600;
  color: #1f3651;
}

.duplicate-group-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#page-widget {
  height: 100%;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.widget-page-active #page-widget {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.widget-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.widget-page-active .widget-panel {
  margin-bottom: 0;
}

.widget-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
  flex: 1;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.widget-column {
  border: 1px solid #dce6f1;
  border-radius: 10px;
  background: #fcfdff;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.widget-title {
  font-weight: 700;
  color: #1c3654;
  padding: 10px 10px 8px;
  border-bottom: 1px solid #e7eff8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  user-select: none;
}

.widget-title[data-widget-level] {
  cursor: context-menu;
}

.widget-title-status {
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  border: 1px solid #d3deeb;
  border-radius: 999px;
  padding: 4px 8px;
  color: #5b7087;
  background: #f6f9fd;
  white-space: nowrap;
}

.widget-title.done {
  color: #1f6d3d;
  background: #eff9f2;
  border-bottom-color: #cae8d2;
}

.widget-title.done .widget-title-status {
  color: #1f6d3d;
  border-color: #9ed2af;
  background: #e4f5ea;
}

.widget-list {
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  flex: 1 1 auto;
  height: 0;
  padding: 8px;
  display: block;
}

.widget-list > * + * {
  margin-top: 6px;
}

.widget-item-card {
  border: 1px solid #d8e3ef;
  border-radius: 8px;
  background: #fff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  padding: 6px;
  position: relative;
  transition: border-color 0.08s ease, background 0.08s ease, box-shadow 0.08s ease;
}

.widget-item {
  text-align: left;
  border: none;
  border-radius: 6px;
  background: transparent;
  padding: 4px;
  line-height: 1.25;
  color: #123657;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.widget-item-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  flex-wrap: nowrap;
  text-align: left;
}

.widget-item-primary {
  font-weight: 600;
  color: #183653;
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
  text-align: left;
}

.widget-item-meta {
  color: #7c8da1;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  margin-left: auto;
  padding-top: 0;
  flex-shrink: 0;
  text-align: left;
}

.widget-generation-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.widget-generation-thumb {
  width: 46px;
  height: 30px;
  min-width: 46px;
  border-radius: 6px;
  border: 1px solid #d6e2ef;
  background: #eef3f9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.widget-generation-thumb.placeholder {
  background: #eef3f9;
}

.widget-generation-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.widget-generation-thumb-text {
  color: #6f8197;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}

.widget-item-card.active {
  border-color: #0b63ce;
  background: #eaf3ff;
  box-shadow: 0 0 0 1px rgba(11, 99, 206, 0.08) inset;
}

.widget-item-card.done {
  border-color: #9cd0ac;
  background: #f2fbf5;
}

.widget-item-card.done .widget-item-primary {
  color: #1f6d3d;
}

.widget-item-card.done .widget-item-meta {
  color: #4b8f63;
}

.widget-item-card.done.active {
  border-color: #2f9253;
  background: #e7f7ec;
  box-shadow: 0 0 0 1px rgba(47, 146, 83, 0.12) inset;
}

.widget-item-card:hover {
  border-color: #8fb8ea;
  background: #f3f8ff;
}

.widget-item-card.dragging {
  opacity: 0.62;
}

.widget-item-card.drag-over {
  border-color: #0b63ce;
  background: #dfefff;
  box-shadow: 0 0 0 2px rgba(11, 99, 206, 0.15);
}

.widget-card-menu {
  position: relative;
  align-self: center;
}

.widget-card-menu-btn {
  min-width: 30px;
  min-height: 30px;
  padding: 0 8px;
  font-size: 20px;
  line-height: 1;
  border: 1px solid #d2deea;
  border-radius: 8px;
  background: #fff;
  color: #214364;
}

.widget-card-menu.open .widget-card-menu-btn {
  border-color: #8fb8ea;
  background: #edf4ff;
}

.widget-card-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 150px;
  border: 1px solid #d2deea;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(13, 26, 42, 0.18);
  padding: 6px;
  display: none;
  z-index: 40;
}

.widget-card-menu.open .widget-card-menu-list {
  display: grid;
  gap: 4px;
}

.widget-card-menu-list button {
  text-align: left;
}

.widget-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 15000;
  background: rgba(8, 15, 25, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.widget-modal {
  width: min(1300px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 1px solid #cfdae8;
  border-radius: 12px;
  background: #ffffff;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.widget-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.widget-modal-head h3 {
  margin: 0;
  font-size: 20px;
}

.widget-modal-close {
  min-width: 34px;
  min-height: 34px;
  padding: 0;
}

.widget-modal-body {
  display: grid;
  gap: 10px;
}

.widget-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.widget-modal-actions {
  display: flex;
  gap: 8px;
}

.widget-modal-message {
  color: #8f2323;
}

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

.widget-dialog-stack {
  display: grid;
  gap: 10px;
}

.widget-dialog-pane {
  border: 1px solid #dbe6f2;
  border-radius: 8px;
  padding: 10px;
  background: #fbfdff;
  display: grid;
  gap: 10px;
  min-width: 0;
}

.widget-dialog-pane.source {
  border-left: 4px solid #c67a19;
}

.widget-dialog-pane.target {
  border-left: 4px solid #1f8a48;
}

.widget-inline-list {
  border: 1px solid #e1e9f3;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  display: grid;
  gap: 4px;
  max-height: 220px;
  overflow: auto;
}

.widget-model-generation-block {
  border: 1px solid #e5edf6;
  border-radius: 6px;
  background: #fbfdff;
  padding: 6px 8px;
  display: grid;
  gap: 4px;
}

.widget-model-generation-title {
  font-weight: 600;
  color: #2a4564;
}

.widget-model-engine-bullets {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 2px;
}

.widget-model-engine-bullets li {
  margin: 0;
}

.widget-engine-match {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 600;
}

.widget-engine-match-shared {
  color: #0f6a35;
}

.widget-shared-match-color-0 { background: #e8f9ee; }
.widget-shared-match-color-1 { background: #ddf4e6; }
.widget-shared-match-color-2 { background: #d3f0df; }
.widget-shared-match-color-3 { background: #c9ecd8; }
.widget-shared-match-color-4 { background: #bfe8d2; }
.widget-shared-match-color-5 { background: #b6e3cc; }
.widget-shared-match-color-6 { background: #addfc6; }
.widget-shared-match-color-7 { background: #a4dbc0; }

.widget-match-color-0 { color: #0f6a35; background: #dff7ea; }
.widget-match-color-1 { color: #0c5a83; background: #deefff; }
.widget-match-color-2 { color: #6c4d00; background: #fff3d6; }
.widget-match-color-3 { color: #6f1f6f; background: #f8e4ff; }
.widget-match-color-4 { color: #8a3e00; background: #ffe9d8; }
.widget-match-color-5 { color: #005c5c; background: #dcf7f7; }
.widget-match-color-6 { color: #7f2139; background: #ffe1e9; }
.widget-match-color-7 { color: #334d07; background: #eef7d6; }

.widget-stage-title {
  font-weight: 700;
  color: #183653;
}

.widget-stage-table-wrap {
  display: grid;
  gap: 6px;
}

.widget-stage-editor {
  border: 1px solid #dbe6f2;
  border-radius: 8px;
  background: #fbfdff;
  padding: 8px;
  display: grid;
  gap: 8px;
}

.widget-stage-editor-rows {
  display: grid;
  gap: 8px;
}

.widget-stage-editor-row {
  border: 1px solid #e2eaf3;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  align-items: end;
}

button.danger {
  border-color: #b42318;
  background: #b42318;
  color: #fff;
}

.widget-empty,
.widget-loading {
  border: 1px dashed #cedae8;
  border-radius: 8px;
  padding: 10px;
  color: #516072;
  background: #fff;
}

.widget-selection-summary {
  margin-top: 10px;
  border: 1px solid #dce6f1;
  border-radius: 8px;
  background: #f8fbff;
  padding: 8px 10px;
}

@media (max-width: 900px) {
  .comparison-grid {
    grid-template-columns: 1fr;
  }

  .stage-compare-grid {
    grid-template-columns: 1fr;
  }

  .decision-fields {
    grid-template-columns: 1fr;
  }

  .advanced-edit-grid {
    grid-template-columns: 1fr;
  }

  .duplicate-pair-layout {
    grid-template-columns: 1fr;
  }

  .widget-grid {
    grid-template-columns: 1fr;
  }

  .widget-panel {
    min-height: 0;
  }

  .widget-column {
    min-height: 0;
  }

  .widget-item-row {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
  }

  .widget-dialog-grid {
    grid-template-columns: 1fr;
  }

  .kv-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

@media (max-width: 760px) {
  .glossary-grid {
    grid-template-columns: 1fr;
  }

  .stage-pair-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-db-switch {
    min-width: 100%;
  }
}
