:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-soft: #f9fafb;
  --line: #d9e0e7;
  --text: #1c2733;
  --muted: #667281;
  --accent: #1868db;
  --accent-dark: #0f4ca8;
  --good: #c01818;
  --good-bg: #fee4e2;
  --warn: #ad5b00;
  --bad: #197a46;
  --bad-bg: #dcfae6;
  --shadow: 0 12px 30px rgba(29, 41, 57, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: 76px;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 132px;
  z-index: 30;
  height: 100vh;
  min-height: 0;
  padding: 18px 10px;
  background: #132238;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: hidden;
}

.brand {
  display: block;
  padding: 6px 8px 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #2d7ff9;
  font-weight: 800;
  font-size: 20px;
}

.brand-title {
  font-size: 17px;
  font-weight: 750;
  white-space: nowrap;
}

.brand-version,
.sidebar-note {
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}

.nav-group-title {
  margin: 8px 4px 0;
  color: rgba(255, 255, 255, 0.45);
  font-size: 11px;
  font-weight: 700;
}

.nav-item {
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  text-align: left;
  color: rgba(255, 255, 255, 0.78);
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}

.nav-item:hover,
.nav-item.active {
  color: white;
  background: rgba(255, 255, 255, 0.12);
}

.sidebar-note {
  margin-top: auto;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
}

.main {
  min-width: 0;
  padding: 24px;
  margin-left: 132px;
}

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

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.2;
}

h2 {
  font-size: 16px;
}

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

.status-pill,
.tag {
  border-radius: 999px;
  padding: 5px 9px;
  background: #e8f1ff;
  color: #174ea6;
  white-space: nowrap;
}

.status-stack {
  display: grid;
  justify-items: end;
  gap: 7px;
}

.action-status {
  max-width: 320px;
  border-radius: 999px;
  padding: 5px 10px;
  background: #eef2f6;
  color: #465465;
  font-size: 12px;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(29, 41, 57, 0.08);
}

.action-status.loading {
  color: #174ea6;
  background: #e8f1ff;
}

.action-status.success {
  color: var(--good);
  background: var(--good-bg);
}

.action-status.error {
  color: #b42318;
  background: #fee4e2;
}

.action-status.info {
  color: #465465;
  background: #eef2f6;
}

.action-status.hidden {
  display: none;
}

.view {
  display: none;
}

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

.home-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
}

.home-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 116px;
  padding: 10px 18px 4px;
}

.home-eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.home-hero h2 {
  margin: 0;
  color: #10203a;
  font-size: 34px;
  letter-spacing: 0.04em;
}

.home-hero p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
}

.home-company-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 clamp(84px, 8vw, 128px);
  width: clamp(84px, 8vw, 128px);
  min-width: 0;
  height: clamp(84px, 8vw, 128px);
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.home-company-logo img {
  width: 100%;
  height: 100%;
  max-width: 128px;
  max-height: 128px;
  object-fit: contain;
  transform: none;
}

.home-module-grid {
  gap: 22px;
}

.home-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 270px;
  overflow: hidden;
  border: 1px solid #e0e7f0;
  border-radius: 18px;
  padding: 28px;
  background: var(--panel);
  box-shadow: 0 14px 36px rgba(18, 42, 84, 0.08);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.home-card:hover {
  border-color: #9bbcff;
  box-shadow: 0 14px 34px rgba(24, 104, 219, 0.12);
}

.home-card span {
  width: fit-content;
  color: #7a95d7;
  font-size: 25px;
  font-weight: 800;
  line-height: 1;
}

.home-card strong {
  font-size: 28px;
  line-height: 1.25;
}

.home-card em {
  color: #53657d;
  font-size: 15px;
  font-style: normal;
  font-weight: 700;
}

.home-card small {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.home-card-icon {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border-radius: 50%;
  background: #eaf1ff;
  color: #3975f7;
  font-size: 28px;
}

.home-card-ad .home-card-icon {
  background: #f1efff;
  color: #7565eb;
}

.home-card-manage .home-card-icon {
  background: #e8faf9;
  color: #35bdbd;
}

.home-card i {
  position: absolute;
  right: 26px;
  bottom: 24px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid #dce5f1;
  border-radius: 50%;
  color: var(--accent);
  font-size: 25px;
  font-style: normal;
}

.account-directory-panel {
  min-height: 340px;
}

.account-directory-table-wrap {
  margin-top: 10px;
  max-height: 420px;
}

.account-directory-table-wrap .data-table {
  min-width: 960px;
}

.manage-entry-grid {
  margin-bottom: 16px;
}

.standard-entry-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.entry-tab {
  min-height: 38px;
  border: 1px solid #c9d3df;
  border-radius: 8px;
  padding: 8px 14px;
  background: #fff;
  color: #344054;
  font-weight: 800;
  cursor: pointer;
}

.entry-tab.active {
  border-color: var(--accent);
  background: #e8f1ff;
  color: var(--accent-dark);
}

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

.filters {
  display: flex;
  gap: 12px;
  align-items: end;
  padding: 14px;
  flex-wrap: wrap;
}

.filter-field {
  min-width: 160px;
}

.date-quick-select {
  position: relative;
}

.date-quick-select > summary {
  list-style: none;
  gap: 8px;
}

.date-quick-select > summary::-webkit-details-marker {
  display: none;
}

.date-quick-select > summary:focus-visible,
.date-quick-menu button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.date-quick-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  width: 228px;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.date-quick-menu button {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.date-quick-menu button:hover,
.date-quick-menu button:focus-visible {
  background: #e8f1ff;
  color: var(--accent);
}

.date-quick-menu small {
  display: block;
  padding: 7px 10px 4px;
  color: var(--muted);
  font-size: 12px;
}

.check-dropdown-field {
  position: relative;
  min-width: 180px;
}

.visually-hidden-select {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.check-dropdown {
  position: relative;
}

.check-dropdown-button {
  width: 100%;
  min-height: 36px;
  border: 1px solid #c9d3df;
  border-radius: 7px;
  padding: 8px 10px;
  color: var(--text);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}

.check-dropdown-button span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.check-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 95;
  width: min(320px, calc(100vw - 48px));
  max-height: 280px;
  overflow: auto;
  padding: 8px;
  border: 1px solid #c9d3df;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
}

.check-dropdown-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 5px 6px;
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
}

.check-dropdown-option:hover {
  background: #edf4ff;
}

.check-dropdown-option input {
  width: 14px;
  height: 14px;
  min-height: 0;
  margin: 0;
  padding: 0;
}

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

input,
select,
textarea {
  min-height: 36px;
  border: 1px solid #c9d3df;
  border-radius: 7px;
  padding: 8px 10px;
  color: var(--text);
  background: white;
}

textarea {
  resize: vertical;
  min-width: 0;
}

.primary,
.ghost-link,
.ghost-button,
.danger-button {
  min-height: 36px;
  border: 0;
  border-radius: 7px;
  padding: 8px 13px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.primary:hover {
  background: var(--accent-dark);
}

.ghost-button.active {
  background: #e8f1ff;
  color: var(--accent-dark);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.primary:disabled,
.ghost-button:disabled,
.danger-button:disabled,
.ghost-link[aria-disabled="true"],
.tiny-button:disabled {
  cursor: progress;
  opacity: 0.66;
}

.is-loading-button {
  position: relative;
}

.is-loading-button::after {
  content: "";
  width: 12px;
  height: 12px;
  margin-left: 8px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.ghost-button.is-loading-button::after,
.tiny-button.is-loading-button::after {
  border-color: rgba(24, 104, 219, 0.25);
  border-top-color: var(--accent);
}

body.is-busy {
  cursor: progress;
}

.view.is-loading .panel,
.view.is-loading .kpi,
.view.is-loading .filters {
  opacity: 0.72;
  transition: opacity 0.12s ease;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.ghost-link {
  color: var(--accent);
  background: #e8f1ff;
}

.ghost-button {
  color: var(--accent);
  background: #e8f1ff;
}

.danger-button {
  background: #fee4e2;
  color: #b42318;
  font-weight: 700;
}

.danger-button:hover {
  background: #ffd4cf;
}

.batch-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.batch-replace-box {
  display: flex;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid #edf1f5;
  border-radius: 8px;
  background: #f8fafc;
  flex-wrap: wrap;
}

.compact-table-wrap {
  max-height: 320px;
  border: 1px solid #edf1f5;
  border-radius: 8px;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  color: var(--text);
  font-size: 13px;
}

.inline-check input {
  min-height: 0;
}

.health-tool-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}

.tool-inline-result {
  color: var(--muted);
  font-size: 13px;
}

.health-scope-controls { align-items: end; }
.health-scope-controls label { min-width: 260px; max-width: 100%; }
#healthDetail { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; }

.text-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 750;
  cursor: pointer;
}

.status-ok {
  color: #197a46;
  font-weight: 750;
}

.status-warn {
  color: #ad5b00;
  font-weight: 750;
}

.batch-table {
  min-width: 1320px;
  table-layout: fixed;
}

.batch-table th,
.batch-table td {
  font-size: 12px;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.batch-product-cell,
.batch-platform-cell {
  width: 120px;
  max-width: 120px;
}

.batch-account-cell {
  width: 150px;
  max-width: 150px;
}

.batch-account-id-cell {
  width: 180px;
  max-width: 180px;
}

.batch-week-cell {
  width: 140px;
  max-width: 140px;
}

.batch-file-cell {
  max-width: 360px;
  width: 360px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.batch-row-count-cell {
  width: 72px;
  text-align: right;
  white-space: nowrap;
}

.batch-time-cell {
  width: 150px;
  white-space: nowrap;
}

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

.mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.mode-tab {
  min-height: 36px;
  border: 1px solid #c9d3df;
  border-radius: 7px;
  padding: 8px 13px;
  background: #fff;
  color: #344054;
  font-weight: 750;
  cursor: pointer;
}

.mode-tab.active {
  border-color: var(--accent);
  background: #eaf1ff;
  color: var(--accent-dark);
}

.danger-ghost {
  color: #b42318;
}

.ad-screenshot-details,
.ad-low-frequency-config {
  display: block;
}

.ad-screenshot-details > summary,
.ad-low-frequency-config > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  cursor: pointer;
  color: #10203a;
  font-weight: 800;
}

.ad-screenshot-details > summary small,
.ad-low-frequency-config > summary small {
  color: var(--muted);
  font-weight: 650;
}

.ad-low-frequency-config > .panel-head {
  margin-top: 14px;
}

.compact-data-table {
  min-width: 780px;
}

.report-output {
  min-height: 260px;
  margin: 0;
  border: 1px solid #e5ebf2;
  border-radius: 8px;
  padding: 14px;
  background: #0f172a;
  color: #e5edf8;
  white-space: pre-wrap;
  overflow: auto;
  font-size: 13px;
  line-height: 1.65;
}

.ad-trend-chart {
  min-height: 300px;
  border: 1px solid #edf1f5;
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
}

.ad-trend-svg {
  display: block;
  width: 100%;
  height: auto;
}

.ad-trend-svg rect,
.ad-trend-svg circle {
  cursor: default;
  transition: opacity 120ms ease, filter 120ms ease;
}

.ad-trend-svg rect:hover,
.ad-trend-svg rect:focus-visible,
.ad-trend-svg circle:hover,
.ad-trend-svg circle:focus-visible {
  opacity: 0.86;
  filter: drop-shadow(0 4px 8px rgba(18, 33, 53, 0.18));
  outline: none;
}

.ad-trend-svg text {
  fill: #667281;
  font-size: 12px;
}

.chart-grid-line {
  stroke: #e6ecf3;
  stroke-width: 1;
}

.ad-chart-legend {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.ad-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ad-chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.ad-standard-sheet {
  min-width: 1680px;
}

.ad-standard-sheet th,
.ad-standard-sheet td {
  font-size: 12px;
}

.ad-standard-sheet th.ad-sticky-select,
.ad-standard-sheet td.ad-sticky-select,
.ad-standard-sheet th.ad-sticky-actions,
.ad-standard-sheet td.ad-sticky-actions,
.ad-standard-sheet th.ad-sticky-status,
.ad-standard-sheet td.ad-sticky-status {
  position: sticky;
  z-index: 6;
  background: #fff;
}

.ad-standard-sheet th.ad-sticky-select,
.ad-standard-sheet td.ad-sticky-select {
  left: 0;
  min-width: 42px;
  width: 42px;
  text-align: center;
}

.ad-standard-sheet th.ad-sticky-actions,
.ad-standard-sheet td.ad-sticky-actions {
  left: 42px;
  min-width: 108px;
  width: 108px;
}

.ad-standard-sheet th.ad-sticky-status,
.ad-standard-sheet td.ad-sticky-status {
  left: 150px;
  min-width: 98px;
  width: 98px;
  box-shadow: 8px 0 12px rgba(29, 41, 57, 0.08);
}

.ad-standard-sheet thead th.ad-sticky-select,
.ad-standard-sheet thead th.ad-sticky-actions,
.ad-standard-sheet thead th.ad-sticky-status {
  z-index: 9;
  background: #f8fafc;
}

.ad-standard-sheet .ad-total-row td.ad-sticky-select,
.ad-standard-sheet .ad-total-row td.ad-sticky-actions,
.ad-standard-sheet .ad-total-row td.ad-sticky-status {
  background: #e8f4fb;
}

.ad-standard-sheet .ad-platform-title-row td {
  background: #eef5ff;
  color: #102033;
  font-size: 13px;
  font-weight: 750;
}

.ad-platform-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ad-platform-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.ad-row-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
}

.tiny-button.action-confirm {
  border-color: #adc8ff;
  color: #174ea6;
  background: #eef5ff;
}

.tiny-button.action-confirm:hover {
  border-color: var(--accent);
  background: #e3edff;
}

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

.empty-state {
  display: grid;
  min-height: 240px;
  place-items: center;
  color: var(--muted);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.kpi {
  padding: 14px;
}

.kpi span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.kpi strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.evaluation-strip {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(0, 1.3fr);
  gap: 12px;
  align-items: stretch;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.evaluation-title {
  display: grid;
  align-content: center;
  gap: 4px;
  font-weight: 800;
}

.evaluation-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

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

.evaluation-card {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #f8fafc;
}

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

.evaluation-card strong {
  font-size: 18px;
}

.evaluation-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.evaluation-card em.good {
  color: var(--good);
}

.evaluation-card em.bad {
  color: var(--bad);
}

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

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

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

.table-wrap {
  overflow: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1320px;
}

.direction-table,
.health-table,
.conflicts-table,
.ai-preview-table,
.direction-dict-table {
  min-width: 1080px;
}

.ai-preview-table {
  table-layout: fixed;
}

.ai-preview-table th:nth-child(1),
.ai-preview-table td:nth-child(1) {
  width: 190px;
  max-width: 190px;
}

.ai-preview-table th:nth-child(2),
.ai-preview-table td:nth-child(2) {
  width: 220px;
  max-width: 220px;
}

.ai-preview-table th:nth-child(3),
.ai-preview-table td:nth-child(3) {
  width: 170px;
  max-width: 170px;
}

.ai-preview-table th:nth-child(4),
.ai-preview-table td:nth-child(4) {
  width: 360px;
  max-width: 360px;
}

.ai-preview-table td {
  white-space: normal;
}

.ai-preview-table .long-text,
.ai-preview-table .clamp-text {
  display: -webkit-box;
  max-height: 42px;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid #edf1f5;
  padding: 9px 8px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-soft);
  color: #465465;
  font-size: 12px;
}

.leaderboard-table th small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.data-table tr:hover td {
  background: #f7fbff;
}

.material-cell {
  width: 380px;
  min-width: 380px;
  max-width: 380px;
  white-space: normal;
}

.material-cell button {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.leaderboard-table th:nth-child(1),
.leaderboard-table td:nth-child(1) {
  width: 48px;
}

.leaderboard-table th:nth-child(2),
.leaderboard-table td:nth-child(2) {
  width: 54px;
}

.leaderboard-table th:nth-child(n + 4),
.leaderboard-table td:nth-child(n + 4) {
  min-width: 86px;
}

.leaderboard-table .opening-direction-cell {
  width: 210px;
  min-width: 180px;
  max-width: 230px;
  white-space: normal;
}

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

.anomalies {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  max-width: 260px;
}

.anomaly {
  border-radius: 999px;
  padding: 2px 7px;
  background: #fff4e5;
  color: var(--warn);
  font-size: 12px;
}

.anomaly.bad {
  background: var(--bad-bg);
  color: var(--bad);
}

.anomaly.good {
  background: var(--good-bg);
  color: var(--good);
}

.evaluation-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 7px;
  background: #eef2f6;
  color: #465465;
  font-size: 12px;
  white-space: nowrap;
}

.evaluation-tag + .evaluation-tag {
  margin-left: 4px;
}

.evaluation-tag.quality {
  color: #175cd3;
  background: #e8f1ff;
}

.evaluation-tag.first {
  color: #7c3aed;
  background: #f3e8ff;
}

.evaluation-tag.low {
  color: #c2410c;
  background: #ffedd5;
}

.evaluation-tag.warning {
  color: #b54708;
  background: #fff4d6;
}

.evaluation-tag.bad {
  color: #b42318;
  background: #fee4e2;
}

.evaluation-tag.unmarked {
  color: #465465;
  background: #eef2f6;
}

.metric-compare {
  display: grid;
  gap: 2px;
  min-width: 84px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.metric-compare span {
  font-weight: 650;
}

.metric-compare em {
  width: fit-content;
  border-radius: 999px;
  padding: 1px 6px;
  color: var(--muted);
  background: #eef2f6;
  font-size: 11px;
  font-style: normal;
}

.metric-compare em.good {
  color: var(--good);
  background: var(--good-bg);
}

.metric-compare em.bad {
  color: var(--bad);
  background: var(--bad-bg);
}

.change-text {
  font-weight: 700;
}

.change-text.good {
  color: var(--good);
}

.change-text.bad {
  color: var(--bad);
}

.risk-cell {
  display: grid;
  gap: 2px;
  min-width: 130px;
  color: #344054;
  line-height: 1.35;
}

.risk-cell span {
  white-space: nowrap;
}

.risk-cell small {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.table-panel {
  padding: 0;
  overflow: hidden;
}

.table-panel .panel-head {
  padding: 16px 16px 0;
}

.column-panel {
  margin: 0 16px 12px;
  padding: 12px;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  background: #f8fafc;
}

.column-panel.hidden {
  display: none;
}

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

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

.column-option {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-size: 13px;
}

.column-option input {
  min-height: 0;
}

.sheet-wrap {
  min-height: 300px;
  max-height: calc(100vh - 248px);
  overflow: auto;
  border-top: 1px solid var(--line);
}

.sheet-table {
  width: max-content;
  min-width: max(100%, 960px);
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 13px;
}

.sheet-table th,
.sheet-table td {
  min-width: 70px;
  border-right: 1px solid #edf1f5;
  border-bottom: 1px solid #edf1f5;
  padding: 6px 8px;
  background: white;
  vertical-align: top;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sheet-table td.ad-editable-cell {
  background: #fffdf5;
  box-shadow: inset 0 0 0 1px #f2c94c;
  cursor: text;
}

.sheet-table td.ad-editable-cell:focus {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
  background: #eff6ff;
}

.sheet-table td.ad-editable-cell.is-edited {
  background: #ecfdf3;
  box-shadow: inset 0 0 0 2px #12b76a;
}

.sheet-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #f8fafc;
  height: 48px;
  overflow: visible;
}

.ad-standard-sheet thead tr:first-child th {
  height: 34px;
  text-align: center;
  font-weight: 800;
  color: #102033;
  background: #d8eef9;
}

.ad-standard-sheet thead tr:nth-child(2) th {
  top: 34px;
}

.ad-standard-sheet .ad-group-account {
  background: #b8c2cc;
}

.ad-standard-sheet .ad-group-frontend {
  background: #9bd8f0;
}

.ad-standard-sheet .ad-group-backend_with_refund,
.ad-standard-sheet .ad-group-backend_net,
.ad-standard-sheet .ad-group-refund,
.ad-standard-sheet .ad-group-other {
  background: #a9df95;
}

.ad-standard-sheet .ad-total-row td {
  background: #e8f4fb;
  font-weight: 800;
}

.sheet-table .summary-row td {
  background: #e8f4fb;
  font-weight: 800;
}

.sheet-table tbody tr:hover td {
  background: #f7fbff;
}

.sheet-table tbody tr.summary-row:hover td {
  background: #e8f4fb;
}

.sheet-header {
  position: relative;
  min-width: 0;
}

.column-menu-button,
.sheet-table .sort-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  min-height: 30px;
  border: 1px solid #c9d3df;
  border-radius: 7px;
  padding: 4px 7px;
  background: white;
  color: #465465;
  cursor: pointer;
  text-align: left;
  font-weight: 700;
  min-width: 0;
}

.column-menu-button {
  padding-right: 6px;
}

.sheet-table .sort-button:hover,
.sheet-table .sort-button.active,
.column-menu-button:hover,
.column-menu-button.active {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: #e8f1ff;
}

.header-label {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-triangle {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: #475569;
  font-size: 12px;
  line-height: 1;
  width: 20px;
  height: 20px;
  text-align: center;
  border-radius: 6px;
  background: #f1f5f9;
}

.column-menu-button:hover .menu-triangle,
.column-menu-button.active .menu-triangle {
  background: #dbeafe;
  color: var(--accent-dark);
}

.sort-icon {
  display: inline-flex;
  min-width: 14px;
  justify-content: center;
  font-weight: 800;
}

.column-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 60;
  width: 220px;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #c9d3df;
  border-radius: 10px;
  background: white;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.18);
}

.column-menu-wide {
  width: 260px;
  max-height: min(70vh, 470px);
  overflow-y: auto;
}

.column-menu button {
  min-height: 30px;
  border: 1px solid #edf1f5;
  border-radius: 7px;
  background: #f8fafc;
  cursor: pointer;
  text-align: left;
}

.column-menu label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.column-menu input {
  width: 100%;
  min-height: 32px;
}

.column-menu select {
  width: 100%;
  min-height: 32px;
}

.column-menu select[multiple] {
  min-height: 136px;
}

.column-menu-actions {
  position: sticky;
  bottom: -10px;
  display: grid;
  gap: 7px;
  margin: 0 -10px -10px;
  padding: 9px 10px 10px;
  border-top: 1px solid #e5ebf2;
  background: #fff;
}

.column-menu small {
  color: var(--muted);
  line-height: 1.35;
}

.resize-handle {
  position: absolute;
  top: 5px;
  right: -3px;
  width: 6px;
  height: calc(100% - 10px);
  cursor: col-resize;
  border-radius: 99px;
}

.resize-handle:hover {
  background: #bfd7ff;
}

.sheet-table .sticky-col {
  position: sticky;
  z-index: 4;
  background: #fff;
}

.sheet-table thead .sticky-col {
  z-index: 8;
  background: #f8fafc;
}

.sheet-table .sticky-1 {
}

.sheet-table .sticky-2 {
}

.sheet-table .sticky-3 {
}

.sheet-table .sticky-4 {
}

.sheet-table .sticky-terminal {
  box-shadow: 8px 0 12px rgba(29, 41, 57, 0.08);
}

.sequence-head {
  line-height: 1.2;
}

.sequence-title {
  font-weight: 800;
}

.sort-current {
  margin-top: 3px;
  color: var(--accent-dark);
  font-size: 11px;
  white-space: normal;
}

.sequence-cell {
  font-weight: 750;
  color: #465465;
}

.col-rank-change {
  width: 130px;
  min-width: 130px;
  max-width: 130px;
}

.col-usage-history {
  width: 210px;
  min-width: 210px;
  max-width: 230px;
}

.col-material-name {
  width: 280px;
  min-width: 280px;
  max-width: 280px;
  white-space: normal !important;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.col-material-id {
  width: 190px;
  min-width: 190px;
  max-width: 190px;
}

.col-material-type {
  width: 120px;
  min-width: 120px;
  max-width: 120px;
}

.col-frame {
  width: 96px;
  min-width: 96px;
  max-width: 96px;
}

.col-script {
  width: 300px;
  min-width: 260px;
  max-width: 340px;
}

.long-text {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
  min-width: 220px;
  max-width: 320px;
}

.direction-delta {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 750;
  white-space: nowrap;
  background: #eef2f6;
  color: #344054;
}

.direction-delta.up {
  background: #e5f5ff;
  color: #185cd8;
}

.direction-delta.down {
  background: #fff0e5;
  color: #b54708;
}

.direction-trend-bars {
  display: inline-flex;
  align-items: end;
  gap: 5px;
  min-width: 72px;
  min-height: 40px;
  padding: 4px 6px;
  border: 1px solid #edf1f5;
  border-radius: 7px;
  background: #f8fafc;
}

.direction-trend-bars i {
  display: block;
  width: 11px;
  min-height: 4px;
  border-radius: 5px 5px 2px 2px;
}

.direction-trend-bars .bar-0 {
  background: #7aa2ff;
}

.direction-trend-bars .bar-1 {
  background: #64c58a;
}

.direction-trend-bars .bar-2 {
  background: #f4aa45;
}

.direction-trend-bars .bar-3 {
  background: #9b7cf6;
}

.direction-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 380px;
}

.direction-tag-list span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef4ff;
  color: #2355b8;
  font-weight: 750;
  white-space: nowrap;
}

.material-name-cell {
  white-space: normal !important;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.clamp-text {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.direction-cell {
  min-width: 130px;
  max-width: 180px;
  white-space: normal;
}

.col-opening-direction,
.opening-direction-cell {
  width: 170px;
  min-width: 140px;
  max-width: 190px;
  white-space: normal !important;
}

.direction-read-cell {
  vertical-align: top !important;
  white-space: normal;
}

.direction-cell-content {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  line-height: 1.55;
  white-space: normal;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.direction-cell-content .segment-pill {
  display: inline-block;
  margin: 2px 4px 2px 0;
  max-width: 100%;
  vertical-align: top;
}

.cell-link {
  display: inline-flex;
  max-width: 88px;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.link-host {
  display: block;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.frame-preview {
  display: inline-flex;
  width: 56px;
  height: 56px;
  margin-bottom: 0;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
}

.compact-frame {
  width: 56px;
  height: 56px;
}

.frame-cell {
  text-align: center;
  vertical-align: middle !important;
}

.frame-edit-cell {
  outline: none;
}

.frame-edit-cell.drag-over,
.frame-edit-cell:focus {
  background: #eef5ff !important;
  box-shadow: inset 0 0 0 1px #2f6bdd;
}

.frame-upload-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin-top: 4px;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid #c7d5e8;
  border-radius: 6px;
  background: #f8fbff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.frame-upload-button input {
  display: none;
}

.frame-text {
  display: block;
  max-height: 44px;
  white-space: normal;
  overflow: hidden;
  color: var(--muted);
  line-height: 1.3;
}

.frame-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.usage-cell {
  white-space: normal !important;
  min-width: 220px;
  max-width: 260px;
}

.usage-summary {
  display: grid;
  gap: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.usage-summary.active {
  font-weight: 700;
}

.usage-summary-line {
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
}

.usage-summary-line.mix-cut {
  color: var(--accent-dark);
}

.usage-summary-line.fine-cut {
  color: #7c3aed;
}

.usage-summary-line.empty {
  color: var(--muted);
  font-weight: 500;
}

.use-cell {
  white-space: normal !important;
}

.usage-type-list {
  display: grid;
  justify-items: start;
  gap: 4px;
}

.usage-type-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
  white-space: nowrap;
}

.usage-type-mix_cut {
  background: #e8f1ff;
  color: var(--accent-dark);
}

.usage-type-fine_cut {
  background: #f1eafe;
  color: #6d28d9;
}

.usage-type-empty {
  color: var(--muted);
  font-size: 12px;
}

.usage-type-edit-cell {
  padding: 4px !important;
}

.usage-type-edit-trigger {
  position: relative;
  width: 100%;
  min-height: 34px;
  padding: 4px 28px 4px 5px;
  border: 1px solid #c9d3df;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  text-align: left;
}

.usage-type-edit-trigger:hover,
.usage-type-edit-trigger:focus-visible {
  border-color: var(--accent);
  background: #f7fbff;
  outline: none;
}

.usage-type-edit-mark {
  position: absolute;
  right: 7px;
  top: 50%;
  color: var(--accent);
  font-size: 13px;
  transform: translateY(-50%);
}

.usage-type-editor-popover {
  position: fixed;
  z-index: 130;
  display: grid;
  gap: 10px;
  width: min(250px, calc(100vw - 28px));
  padding: 12px;
  border: 1px solid #b9c9e5;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(15, 32, 61, 0.24);
}

.usage-type-editor-head {
  color: #27364b;
  font-weight: 800;
}

.usage-type-editor-options {
  display: grid;
  gap: 6px;
}

.usage-type-editor-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 7px;
  color: #334155;
  cursor: pointer;
}

.usage-type-editor-option:hover {
  background: #eef5ff;
}

.usage-type-editor-option input {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  padding: 0;
  flex: 0 0 16px;
}

.usage-type-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.usage-type-editor-actions button {
  min-height: 30px;
}

.usage-type-editor-actions [data-usage-type-clear] {
  margin-right: auto;
}

.editable-cell {
  min-width: 220px;
  max-width: 320px;
  white-space: normal !important;
}

.editable-cell textarea {
  width: 100%;
  min-height: 48px;
  padding: 6px 8px;
  line-height: 1.35;
}

.direction-edit-cell {
  position: relative;
  min-width: 140px;
  max-width: 190px;
  white-space: normal !important;
}

.direction-edit-trigger {
  position: absolute;
  right: 4px;
  bottom: 4px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid #b9c9e5;
  border-radius: 7px;
  background: #fff;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(24, 58, 112, 0.12);
}

.direction-edit-trigger:hover {
  background: #eaf2ff;
  border-color: var(--accent);
}

.direction-editor-popover {
  position: fixed;
  z-index: 130;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 28px));
  max-height: min(520px, calc(100vh - 28px));
  padding: 13px;
  border: 1px solid #b9c9e5;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(15, 32, 61, 0.24);
}

.direction-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #27364b;
  font-weight: 800;
}

.direction-editor-search {
  width: 100%;
  min-height: 34px;
}

.direction-editor-list {
  display: grid;
  gap: 5px;
  max-height: 280px;
  overflow: auto;
  padding-right: 3px;
}

.direction-editor-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 7px;
  color: #334155;
  cursor: pointer;
}

.direction-editor-option[hidden],
.direction-editor-option.is-hidden {
  display: none !important;
}

.direction-editor-option:hover {
  background: #eef5ff;
}

.direction-editor-option input {
  min-height: 0;
  margin-top: 2px;
}

.direction-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.direction-editor-actions button {
  min-height: 32px;
}

.script-cell {
  min-width: 260px;
  max-width: 340px;
}

.rank-change {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 7px;
  background: #eef2f6;
  color: #465465;
  font-size: 12px;
  font-weight: 700;
}

.rank-change.good {
  background: var(--good-bg);
  color: var(--good);
}

.rank-change.bad {
  background: var(--bad-bg);
  color: var(--bad);
}

.sheet-check {
  min-height: 0;
}

.sheet-empty-cell {
  height: 260px;
  min-width: 960px !important;
  text-align: center;
  vertical-align: middle !important;
  white-space: normal !important;
  color: var(--muted);
  background: #fbfdff !important;
}

.manage-panel[data-manage-panel="conflicts"] .compact-table-wrap {
  max-height: none;
  overflow: visible;
}

.manage-panel[data-manage-panel="conflicts"] .conflict-list {
  min-height: 340px;
  max-height: 60vh;
  overflow: auto;
  padding-right: 8px;
}

.saved {
  outline: 2px solid #24a148;
}

.saving {
  opacity: 0.72;
}

.save-error {
  outline: 2px solid #b42318;
}

.table-pagination {
  position: fixed;
  right: 24px;
  bottom: 18px;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  max-width: calc(100vw - 300px);
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.16);
}

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

.pagination-controls label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.pagination-controls select,
.page-jump-input {
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid #c9d3df;
  border-radius: 8px;
  background: #fff;
}

.page-size-select {
  min-width: 130px;
}

.page-jump-input {
  width: 76px;
}

.page-arrow,
.page-current {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
}

.page-arrow {
  border: 1px solid transparent;
  background: #f1f5f9;
  color: #334155;
  cursor: pointer;
  font-size: 19px;
}

.page-arrow:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.page-current {
  border: 1px solid var(--accent);
  color: var(--accent-dark);
  background: #fff;
  font-weight: 800;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 16px;
}

.detail-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.trend-head-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.trend-head-actions select {
  min-height: 32px;
  padding: 5px 8px;
}

.metric-change-detail {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.metric-detail-title {
  color: var(--muted);
  font-size: 12px;
}

.metric-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
}

.metric-detail-chip {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fafc;
}

.metric-detail-chip span,
.metric-detail-chip small {
  color: var(--muted);
  font-size: 12px;
}

.metric-detail-chip strong {
  font-size: 16px;
}

.metric-detail-chip em {
  width: fit-content;
  border-radius: 999px;
  padding: 1px 6px;
  color: var(--muted);
  background: #eef2f6;
  font-size: 11px;
  font-style: normal;
}

.metric-detail-chip em.good {
  color: var(--good);
  background: var(--good-bg);
}

.metric-detail-chip em.bad {
  color: var(--bad);
  background: var(--bad-bg);
}

.checkline {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
}

.checkline input {
  min-height: 0;
}

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

.compact-form {
  grid-template-columns: minmax(180px, 260px) minmax(280px, 1fr) auto;
  align-items: end;
}

.file-field {
  grid-column: span 2;
}

.compact-form .file-field {
  grid-column: auto;
}

.frame-backfill-form {
  grid-template-columns: minmax(180px, 240px) minmax(180px, 240px) minmax(170px, auto) minmax(280px, 1fr) auto;
  align-items: end;
}

.frame-backfill-form .file-field {
  grid-column: auto;
}

.frame-backfill-check {
  min-height: 42px;
  padding-top: 20px;
}

.ai-filter-form {
  grid-template-columns: repeat(3, minmax(220px, 1fr)) minmax(160px, 1fr) minmax(120px, 160px) auto auto;
  align-items: end;
}

.ai-filter-form select[multiple] {
  min-height: 112px;
}

.ai-filter-form label small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.screenshot-drop-zone {
  display: grid;
  gap: 5px;
  align-content: center;
  min-height: 82px;
  border: 1px dashed #9fb4ce;
  border-radius: 8px;
  padding: 12px;
  background: #f8fbff;
  color: #475467;
  outline: none;
}

.screenshot-drop-zone strong {
  color: #1d2939;
}

.screenshot-drop-zone.drag-over,
.screenshot-drop-zone:focus {
  border-color: #2f6bdd;
  background: #eef5ff;
}

.screenshot-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.screenshot-preview-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 240px;
  border: 1px solid #d8e1ec;
  border-radius: 8px;
  padding: 6px 8px;
  background: white;
  color: #344054;
  font-size: 12px;
}

.screenshot-preview-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.screenshot-preview-chip img {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: 6px;
  background: #eef2f6;
}

.screenshot-preview-chip button {
  min-height: 28px;
  padding: 3px 7px;
}

.result-box {
  margin: 14px 0 0;
  padding: 12px;
  min-height: 90px;
  overflow: auto;
  border-radius: 8px;
  background: #101828;
  color: #d1e9ff;
  white-space: pre-wrap;
}

.subtle-result {
  min-height: 60px;
  background: #f8fafc;
  color: #344054;
  border: 1px solid #edf1f5;
}

.stacked-form {
  display: grid;
  gap: 11px;
}

.stacked-form.compact {
  grid-template-columns: repeat(2, minmax(120px, 1fr));
}

.stacked-form .primary,
.compact .primary {
  width: fit-content;
}

.manage-split {
  grid-template-columns: minmax(320px, 0.85fr) minmax(360px, 1.15fr);
}

.manage-tabs {
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.manage-tab {
  min-height: 34px;
  border: 1px solid #c9d3df;
  border-radius: 7px;
  padding: 7px 12px;
  background: white;
  color: #344054;
  cursor: pointer;
  font-weight: 750;
}

.manage-tab.active {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: #e8f1ff;
}

.manage-panel {
  display: none;
}

.manage-panel.active {
  display: block;
}

.metrics-table input[type="number"] {
  width: 76px;
}

.metrics-table input[type="text"] {
  min-width: 240px;
}

.metrics-table select {
  min-width: 160px;
}

.metric-order-board {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid #edf1f5;
  border-radius: 8px;
  background: #f8fafc;
  max-height: 156px;
  overflow: auto;
}

.field-picker-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto minmax(80px, auto);
  align-items: end;
  gap: 10px;
}

.field-picker-row label {
  margin: 0;
}

.compact-save-button {
  width: auto;
  min-width: 128px;
  justify-self: start;
}

.save-state {
  align-self: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.save-state.is-saving {
  color: #ad5b00;
}

.save-state.is-saved {
  color: #197a46;
}

.save-state.is-error {
  color: #c01818;
}

.metric-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.metric-sync-result {
  min-height: 42px;
  margin-bottom: 12px;
}

.ai-run-history {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.ai-run-card {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 10px 12px;
  border: 1px solid #edf1f5;
  border-radius: 8px;
  background: #f8fafc;
  color: #344054;
}

.ai-run-card strong {
  color: var(--text);
}

.ai-task-progress {
  margin-top: 12px;
}

.ai-progress-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #d8e2ee;
  border-radius: 8px;
  background: #f8fbff;
}

.ai-progress-head,
.ai-progress-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.ai-progress-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #eaf0f8;
}

.ai-progress-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3b6ff2, #61bf82);
}

.ai-log-list {
  flex: 1 1 100%;
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.direction-group-row td {
  background: #f8fafc;
}

.direction-child-row td:first-child {
  padding-left: 18px;
}

.direction-child-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.direction-child-name::before {
  content: "";
  width: 14px;
  height: 1px;
  background: #b9c5d4;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2f6;
  color: #344054;
  font-weight: 750;
  white-space: nowrap;
}

.status-chip.ok {
  color: #197a46;
  background: #dcfae6;
}

.status-chip.warn {
  color: #ad5b00;
  background: #fff4db;
}

.status-chip.bad {
  color: #c01818;
  background: #fee4e2;
}

.metric-chip {
  position: relative;
  min-height: 32px;
  border: 1px solid #c9d3df;
  border-radius: 7px;
  padding: 5px 9px;
  background: white;
  color: #344054;
  font-weight: 750;
  cursor: grab;
}

.metric-chip span {
  margin-right: 6px;
  color: var(--muted);
  font-weight: 650;
}

.metric-chip.dragging {
  opacity: 0.55;
  cursor: grabbing;
}

.metric-chip.drag-over {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.metric-chip.is-drop-before::before,
.metric-chip.is-drop-after::after,
.field-order-chip.is-drop-before::before,
.field-order-chip.is-drop-after::after {
  content: "";
  position: absolute;
  top: -6px;
  bottom: -6px;
  width: 3px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
  pointer-events: none;
}

.metric-chip.is-drop-before::before,
.field-order-chip.is-drop-before::before {
  left: -6px;
}

.metric-chip.is-drop-after::after,
.field-order-chip.is-drop-after::after {
  right: -6px;
}

.metric-note {
  min-width: 240px;
  max-width: 340px;
  white-space: normal !important;
  color: #344054;
  line-height: 1.35;
}

.move-cell {
  display: flex;
  gap: 6px;
}

.conflict-list {
  display: grid;
  gap: 12px;
}

.conflict-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid #edf1f5;
  border-radius: 8px;
  background: #fff;
}

.conflict-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.conflict-card-head div,
.conflict-card-head span {
  display: grid;
  gap: 3px;
}

.conflict-card-head small {
  color: var(--muted);
  text-align: right;
}

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

.conflict-value {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.conflict-value > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.conflict-value pre {
  max-height: 220px;
  min-height: 96px;
  margin: 0;
  padding: 10px;
  border: 1px solid #edf1f5;
  border-radius: 8px;
  background: #f8fafc;
  white-space: pre-wrap;
  overflow: auto;
  overflow-wrap: anywhere;
}

.conflict-image {
  width: 150px;
  height: 150px;
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
}

.conflict-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.conflict-value code {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

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

.tiny-button {
  min-height: 30px;
  border: 1px solid #c9d3df;
  border-radius: 6px;
  padding: 5px 8px;
  background: white;
  cursor: pointer;
}

.tiny-button.danger {
  border-color: #f1b8b8;
  color: #b42318;
  background: #fff7f7;
}

.tiny-button.danger:hover {
  border-color: #d92d20;
  background: #fff0f0;
}

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

.tiny-button:disabled {
  color: #98a2b3;
  cursor: not-allowed;
}

.tiny-button.is-loading-button:disabled {
  cursor: progress;
}

.field-order-editor {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  padding: 10px;
  border: 1px solid #d5dfeb;
  border-radius: 8px;
  background: #f8fafc;
}

.field-order-chip {
  position: relative;
  display: inline-grid;
  grid-template-columns: auto minmax(80px, auto) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  max-width: 100%;
  padding: 6px 8px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #fff;
  cursor: grab;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.field-order-chip strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-order-chip.is-dragging {
  opacity: 0.55;
}

.field-order-chip small {
  color: var(--muted);
  white-space: nowrap;
}

.chip-remove-button {
  min-height: 28px;
  border: 1px solid #ffb6ae;
  border-radius: 7px;
  padding: 3px 8px;
  background: #fff;
  color: #c01818;
  font-weight: 750;
  cursor: pointer;
}

.chip-remove-button:hover {
  border-color: #d92d20;
  background: #fff0f0;
}

.field-order-row {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(160px, 1fr) minmax(110px, 160px) auto auto auto;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #fff;
  cursor: grab;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.field-order-row.is-dragging {
  opacity: 0.55;
}

.field-order-row.is-drag-over {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.field-order-row.is-drop-before::before,
.field-order-row.is-drop-after::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  height: 3px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
  pointer-events: none;
}

.field-order-row.is-drop-before::before {
  top: -7px;
}

.field-order-row.is-drop-after::after {
  bottom: -7px;
}

.field-order-index {
  color: var(--muted);
  font-weight: 700;
}

.field-order-row small {
  color: var(--muted);
  white-space: nowrap;
}

.compact-empty {
  min-height: 56px;
  padding: 16px;
}

.prose {
  display: grid;
  gap: 12px;
  max-width: 900px;
}

code {
  padding: 1px 5px;
  border-radius: 5px;
  background: #eef2f6;
}

canvas {
  width: 100%;
  height: 300px;
  display: block;
}

.hidden,
.permission-hidden,
.module-hidden {
  display: none !important;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.22);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.35);
}

.modal-card {
  width: min(760px, calc(100vw - 48px));
  max-height: calc(100vh - 64px);
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
}

.modal-card h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.modal-card p {
  margin: 0 0 14px;
  color: var(--muted);
}

.ad-overlap-summary {
  max-height: 320px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  white-space: pre-wrap;
  line-height: 1.65;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.material-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 90;
  width: min(620px, 94vw);
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 42px rgba(15, 23, 42, 0.18);
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.drawer-head h2 {
  margin: 0;
  font-size: 18px;
}

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

.drawer-body {
  overflow: auto;
  padding: 16px 18px 24px;
  display: grid;
  align-content: start;
  gap: 14px;
}

.drawer-actions {
  position: sticky;
  top: -16px;
  z-index: 2;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 0;
  background: var(--panel);
}

.small-primary,
.small-ghost {
  min-height: 32px;
  padding: 6px 10px;
}

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

.drawer-summary > div {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #f8fafc;
}

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

.drawer-summary strong {
  font-size: 15px;
}

.drawer-section {
  display: grid;
  gap: 10px;
}

.drawer-section-title {
  color: #344054;
  font-weight: 800;
  font-size: 14px;
}

.drawer-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.drawer-kpi {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #f8fafc;
}

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

.drawer-kpi strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

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

.metric-toggle-row .active,
.drawer-actions .active {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: #e8f1ff;
}

.drawer-trend-card,
.audience-trend-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #edf1f5;
  border-radius: 10px;
  background: #fff;
}

.drawer-trend-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #344054;
}

.drawer-trend-head span {
  color: var(--muted);
  font-size: 12px;
}

.mini-line-chart {
  width: 100%;
  height: 150px;
}

.mini-line-chart line {
  stroke: #d9e0e7;
}

.mini-line-chart polyline {
  fill: none;
  stroke: #c01818;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mini-line-chart circle {
  fill: #c01818;
  cursor: default;
  outline: none;
  transform-box: fill-box;
  transform-origin: center;
  transition: filter 120ms ease, transform 120ms ease;
}

.mini-line-chart circle:hover,
.mini-line-chart circle:focus-visible {
  filter: drop-shadow(0 2px 3px rgba(18, 33, 53, 0.22));
  transform: scale(1.18);
}

.mini-line-chart text {
  fill: #667281;
  font-size: 11px;
}

.trend-week-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 8px;
  color: var(--muted);
  font-size: 12px;
}

.audience-trend-row {
  display: grid;
  gap: 5px;
  padding: 8px 0;
  border-top: 1px solid #edf1f5;
}

.audience-trend-row:first-of-type {
  border-top: 0;
}

.audience-trend-row div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.audience-trend-row span {
  border-radius: 999px;
  padding: 2px 7px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
}

.grouped-bars {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #edf1f5;
  border-radius: 8px;
  background: #fff;
}

.grouped-bars h3 {
  margin: 0;
  font-size: 13px;
}

.bar-group-row {
  display: grid;
  grid-template-columns: 92px minmax(120px, 1fr) 48px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}

.bar-group-row > span {
  color: #344054;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-group-row > em {
  color: var(--muted);
  font-style: normal;
  text-align: right;
}

.bar-group {
  height: 76px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 10px;
  justify-content: start;
  align-items: end;
  gap: 4px;
  border-bottom: 1px solid #d9e0e7;
}

.bar-group i {
  display: block;
  min-height: 2px;
  border-radius: 4px 4px 0 0;
  cursor: default;
  outline: none;
  transition: filter 120ms ease, transform 120ms ease;
}

.bar-group i:hover,
.bar-group i:focus-visible {
  filter: saturate(1.12) brightness(0.96);
  transform: translateY(-1px);
}

.week-color-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 12px;
}

.week-color-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.week-color-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.drawer-note {
  padding: 9px 10px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
  line-height: 1.45;
}

.detail-field {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid #edf1f5;
  border-radius: 9px;
  background: #fff;
}

.detail-field-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  color: #465465;
  font-weight: 750;
}

.drawer-line-value,
.drawer-text-value {
  width: 100%;
  margin: 0;
  border-radius: 8px;
  padding: 9px 10px;
  background: #f8fafc;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.drawer-text-value {
  max-height: 220px;
  overflow: auto;
}

.drawer-text-value.compact {
  max-height: 120px;
}

.drawer-empty {
  color: var(--muted);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}

.drawer-frame-card {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.drawer-frame {
  display: inline-flex;
  width: 112px;
  height: 112px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #f8fafc;
}

.drawer-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wide-link {
  max-width: 100%;
}

.audience-table th,
.audience-table td {
  white-space: nowrap;
}

.audience-material {
  min-width: 220px;
  white-space: normal !important;
}

.material-detail-link,
.audience-material .material-detail-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  text-align: left;
  font-weight: 800;
  white-space: normal;
}

.material-detail-link:hover {
  text-decoration: underline;
}

.audience-material strong,
.audience-material small {
  display: block;
}

.audience-material small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.segment-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  background: #f1f5f9;
  color: #475569;
  font-weight: 700;
  font-size: 12px;
}

.direction-pill {
  background: #eef4ff;
  color: #174ea6;
}

.muted-pill {
  color: #98a2b3;
  background: #f2f4f7;
}

.metric-cell {
  display: grid;
  gap: 3px;
}

.metric-cell strong {
  font-weight: 800;
}

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

.audience-metric {
  display: grid;
  gap: 4px;
}

.audience-metric strong {
  font-weight: 800;
}

.audience-metric em {
  justify-self: start;
  border-radius: 999px;
  padding: 2px 7px;
  background: #f1f5f9;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  font-weight: 750;
}

.audience-metric em.good {
  background: var(--good-bg);
  color: var(--good);
}

.audience-metric em.bad {
  background: var(--bad-bg);
  color: var(--bad);
}

.source-list,
.audience-breakdown-list {
  display: grid;
  gap: 8px;
}

.source-item,
.audience-breakdown-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fafc;
}

.source-item span,
.audience-breakdown-item small {
  color: var(--muted);
  font-size: 12px;
}

.source-item em {
  grid-row: span 2;
  color: var(--good);
  font-style: normal;
  font-weight: 800;
}

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

.pie-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #edf1f5;
  border-radius: 12px;
  background: #fff;
}

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

.pie-chart {
  width: 132px;
  height: 132px;
  margin: 0 auto;
  border-radius: 999px;
  background: #eef2f6;
}

.pie-chart-svg {
  display: block;
  padding: 0;
  border: 10px solid #f6f8fb;
  overflow: visible;
}

.pie-chart-empty {
  border: 10px solid #f6f8fb;
}

.pie-chart-svg path {
  cursor: default;
  outline: none;
  transform-origin: 50% 50%;
  transition: opacity 120ms ease, filter 120ms ease, transform 120ms ease;
}

.pie-chart-svg path:hover,
.pie-chart-svg path:focus-visible {
  opacity: 0.92;
  filter: drop-shadow(0 3px 4px rgba(18, 33, 53, 0.22));
  transform: scale(1.015);
}

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

.pie-legend > div {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  font-size: 12px;
}

.pie-legend span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

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

.chart-tooltip {
  position: fixed;
  z-index: 3000;
  max-width: 240px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  background: rgba(21, 32, 50, 0.95);
  box-shadow: 0 8px 22px rgba(18, 33, 53, 0.18);
  color: #fff;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
  pointer-events: none;
  white-space: nowrap;
}

.chart-tooltip.hidden {
  display: none;
}

.ad-pending-panel,
.ad-unmatched-panel,
.ad-account-correction-panel {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.ad-pending-card {
  display: grid;
  gap: 5px;
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid #dbe6f5;
  border-radius: 8px;
  background: #f8fbff;
  color: #334155;
}

.ad-cash-grid {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.ad-cash-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(120px, 180px);
  gap: 10px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 8px;
}

.ad-cash-row:focus-within {
  border-color: #2563eb;
  background: #eff6ff;
}

.ad-cash-row span {
  min-width: 0;
  overflow: hidden;
  color: #344054;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ad-cash-save-button {
  margin-top: 12px;
  width: max-content;
}

.compact-head {
  margin-bottom: 10px;
}

.compact-head h3 {
  margin: 0;
  font-size: 15px;
}

.ad-unmatched-account-row {
  display: grid;
  grid-template-columns: minmax(100px, 0.55fr) repeat(4, minmax(130px, 1fr)) auto auto;
  gap: 8px;
  align-items: end;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid #ffd6a8;
  border-radius: 8px;
  background: #fffaf3;
}

.ad-unmatched-account-row:first-child {
  margin-top: 0;
}

.ad-unmatched-status {
  align-self: center;
}

.ad-recognized-account-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(180px, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 9px 0;
  border-top: 1px solid var(--border);
}

.ad-recognized-account-row:first-child {
  border-top: 0;
}

.ad-recognized-record-summary {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.ad-recognized-record-summary span {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1080px) {
  .sidebar {
    position: static;
    width: auto;
    min-height: auto;
  }

  .main {
    margin-left: 0;
  }

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

  .split,
  .manage-split,
  .home-grid,
  .ad-overview-grid,
  .kpi-grid,
  .ad-unmatched-account-row,
  .ad-recognized-account-row,
  .ad-cash-row,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .file-field {
    grid-column: auto;
  }
}

/* LC6.9 received data review */
.ingest-pagination,.ingest-actions { display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:16px 0; }
.ingest-notice { color:#285579;background:#edf5fb;border-radius:8px;padding:10px;margin:10px 0; }
.ingest-error { color:#982b27;background:#fff1f0;border-radius:8px;padding:10px;margin:10px 0; }
.ingest-evidence { max-height:420px;overflow:auto;white-space:pre-wrap;word-break:break-word;background:#f7f9fc;padding:16px; }
#ingestTable table { min-width:1050px; }
#ingestTable small { color:#68788c;overflow-wrap:anywhere; }
#ingestBindings summary { cursor:pointer;font-weight:600; }
#ingestDetail label { display:inline-flex;align-items:center;gap:8px;margin:10px 0; }

.ingest-pagination label { display:inline-flex;align-items:center;gap:8px; }
#ingestTable td:first-child,#ingestTable th:first-child { white-space:nowrap; }
#ingestTable td { vertical-align:top; }
#ingestTable td:nth-child(4),#ingestTable td:nth-child(5),#ingestTable td:nth-child(6),#ingestTable td:last-child { white-space:nowrap; }
#ingestTable table,#ingestDetail table { width:100%;border-collapse:collapse; }
#ingestTable th,#ingestTable td,#ingestDetail th,#ingestDetail td { padding:10px 12px;text-align:left;border-bottom:1px solid var(--line); }
#ingestTable th { white-space:nowrap;background:var(--panel-soft); }

/* LC6.9 received identity and full-record metric review. */
.ingest-identity{padding:16px;border:1px solid #dce4ee;border-radius:12px;margin:12px 0}.ingest-identity dl{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px}.ingest-identity dt{font-size:12px;color:#607087}.ingest-identity dd{margin:4px 0;overflow-wrap:anywhere}.ingest-search{display:flex;align-items:end;gap:12px;flex-wrap:wrap;margin:16px 0}#ingestDetail .ingest-search label{display:grid;gap:6px;flex:1;min-width:260px;margin:0}.ingest-search input{width:100%;min-height:38px}.ingest-search span{font-size:13px;color:#607087}
#ingestMetricTable table{table-layout:fixed;min-width:760px}#ingestMetricTable th:first-child{width:48%}#ingestMetricTable th:nth-child(2){width:16%}#ingestMetricTable th:nth-child(3),#ingestMetricTable th:nth-child(4){width:18%}#ingestMetricTable td{vertical-align:top;overflow-wrap:anywhere}#ingestMetricTable small{font-size:12px;line-height:1.5;color:#607087}

/* LC7.0 scoped collection review */
#view-ingest button { border:1px solid #cbd5e1; border-radius:6px; padding:8px 12px; background:#fff; color:#18324f; cursor:pointer; }
#view-ingest button.primary { background:#0868d9; color:#fff; border-color:#0868d9; }
#view-ingest button:disabled { opacity:.45; cursor:default; }
#ingestCollectionPanel { margin-top:24px; padding-top:20px; border-top:1px solid #dbe4ee; }
#ingestCollectionPanel table, #ingestDetail table { width:100%; border-collapse:collapse; }
#ingestCollectionPanel th, #ingestCollectionPanel td, #ingestDetail th, #ingestDetail td { padding:10px 12px; border-bottom:1px solid #dbe4ee; text-align:left; vertical-align:top; }
#ingestCollectionPanel th, #ingestDetail th { background:#f6f8fb; }
#collectionPreview .table-wrap { max-height:440px; overflow:auto; margin:12px 0; }
#collectionPreview thead { position:sticky; top:0; }
#ingestDetail fieldset { border:1px solid #dbe4ee; border-radius:8px; margin:16px 0; padding:16px; }
#ingestDetail input[type=number] { min-width:100px; }
#ingestRefresh { flex-shrink: 0; white-space: nowrap; }
#recoveryChanges pre { max-width: 420px; max-height: 260px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
#recoveryResult { margin-top: 20px; }
