* { box-sizing: border-box; }

:root {
  --bg: #f4f1ea;
  --panel: #fffdf8;
  --panel-border: #ddd4c6;
  --text: #1d1c19;
  --muted: #6f675c;
  --accent: #a74c2d;
  --accent-strong: #7f361c;
  --chip: #efe5d8;
  --danger: #b33c2f;
  --shadow: 0 12px 30px rgba(59, 37, 20, 0.07);
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(167, 76, 45, 0.1), transparent 28%),
    linear-gradient(180deg, #f7f4ee 0%, var(--bg) 100%);
}

.page { min-height: 100vh; display: flex; flex-direction: column; }

.topbar,
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: rgba(255, 253, 248, 0.95);
  backdrop-filter: blur(8px);
  z-index: 10;
}

.topbar { border-bottom: 1px solid var(--panel-border); }
.footer { border-top: 1px solid var(--panel-border); position: sticky; bottom: 0; }
.brand { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.03em; }
.account { display: flex; align-items: center; gap: 12px; }

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
}

.brand {
  grid-column: 2;
  text-align: center;
  width: auto;
  align-self: center;
}

.account {
  grid-column: 3;
  justify-self: end;
  width: auto;
}

.topbar .field.compact {
  width: 250px;
  grid-template-columns: 1fr;
  gap: 4px;
}

.topbar .field.compact .field-label {
  padding-top: 0;
}

.topbar .field.compact .field-control {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

#accountId {
  width: 170px;
}

#accountSelect {
  width: 150px;
}

.account-quota {
  display: block;
  margin-top: 4px;
  margin-left: auto;
  max-width: 250px;
  font-variant-numeric: tabular-nums;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-strong);
  border: 1px solid #d6c3ad;
  background: #f7ecde;
  border-radius: 8px;
  padding: 4px 8px;
  white-space: pre-line;
  text-align: right;
  overflow-wrap: anywhere;
}

.mobile-section-tabs {
  display: none;
  gap: 4px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--panel-border);
  background: rgba(255, 253, 248, 0.97);
}

.mobile-section-tab {
  flex: 1;
  min-width: 0;
  border: 1px solid #d9c9b6;
  border-radius: 9px;
  background: #f8efe2;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 7px 6px;
  cursor: pointer;
}

.mobile-section-tab.is-active {
  background: #fff;
  border-color: #c7b39d;
  color: var(--accent-strong);
}

.generator {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--panel-border);
}

.generator .field.field-top {
  grid-template-columns: 52px minmax(0, 1fr);
}

.three-col {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
}

.panel {
  position: relative;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: flex-start;
  flex-direction: column;
  gap: 8px;
  padding-top: 72px;
  border-radius: inherit;
  background: rgba(255, 252, 246, 0.78);
  backdrop-filter: blur(1px);
}

.panel.is-loading .panel-loading-overlay {
  display: flex;
}

.panel.is-loading .panel-header,
.panel.is-loading .form-grid {
  opacity: 0.55;
  pointer-events: none;
}

.panel-loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(127, 54, 28, 0.2);
  border-top-color: var(--accent-strong);
  border-radius: 50%;
  animation: panel-spin 0.8s linear infinite;
}

.panel-loading-text {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent-strong);
}

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

.panel.section-locked .form-grid > :not(.panel-header) input,
.panel.section-locked .form-grid > :not(.panel-header) select,
.panel.section-locked .form-grid > :not(.panel-header) textarea,
.panel.section-locked .form-grid > :not(.panel-header) .chip,
.panel.section-locked .form-grid > :not(.panel-header) .chip-list,
.panel.section-locked .form-grid > :not(.panel-header) .combo-option {
  filter: grayscale(0.5);
  opacity: 0.65;
}

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

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

.compact-actions {
  margin-top: 6px;
}

.panel-action-wrap {
  display: grid;
  gap: 6px;
  justify-items: end;
}

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

.panel-subactions label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.status-quick-select {
  width: auto;
  min-width: 108px;
  padding: 4px 8px;
  font-size: 11px;
}

.panel-title {
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.report-body {
  min-height: 100vh;
}

.report-page {
  min-height: 100vh;
  padding: 18px;
}

.report-topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.report-brand {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.report-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.report-balance {
  margin-top: 8px;
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f3e7d4;
  border: 1px solid #dcc6a7;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
}

.report-controls {
  display: flex;
  align-items: end;
  gap: 10px;
}

.report-account-field {
  min-width: 240px;
}

.report-sections {
  display: grid;
  gap: 16px;
}

.report-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  margin: 6px 0 14px;
  border: 1px solid #d9c9b6;
  border-radius: 999px;
  background: #f8efe2;
}

.report-tab {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 9px 14px;
  cursor: pointer;
}

.report-tab.is-active {
  background: #fff;
  color: var(--accent-strong);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.report-section {
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.report-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--panel-border);
}

.report-section-head h2 {
  margin: 0;
  font-size: 1rem;
}

.report-section-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

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

.report-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1600px;
}

.report-table th,
.report-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eadfce;
  vertical-align: top;
  text-align: left;
  font-size: 12px;
  line-height: 1.45;
}

.report-table th {
  position: relative;
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8f2e8;
  font-size: 11px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  user-select: none;
}

.report-table tbody tr:nth-child(odd) {
  background: rgba(239, 229, 216, 0.3);
}

.report-group-start td {
  border-top: 1px solid #dcc9b2;
}

.report-col-label {
  display: inline-block;
  padding-right: 14px;
}

.report-col-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 3;
}

.report-col-resizer::after {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 3px;
  width: 2px;
  border-radius: 999px;
  background: #d5c2aa;
}

.report-is-resizing {
  cursor: col-resize;
}

.report-is-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

.report-creative-cell {
  white-space: normal;
  overflow-wrap: anywhere;
}

.report-entity-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.report-entity-name {
  font-weight: 600;
  white-space: normal;
  overflow-wrap: anywhere;
}

.report-identity-cell {
  position: relative;
  vertical-align: top;
  padding-bottom: 28px;
}

.report-status-toggle-switch {
  width: 20px;
  height: 11px;
  border: 0;
  border-radius: 999px;
  background: #cfcbc3;
  cursor: pointer;
  transition: background 140ms ease;
}

.report-identity-cell .report-status-toggle-switch {
  position: absolute;
  left: 12px;
  bottom: 10px;
}

.report-status-toggle-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 140ms ease;
}

.report-status-toggle-switch.is-on {
  background: #1877f2;
}

.report-status-toggle-switch.is-on::after {
  transform: translateX(9px);
}

.report-status-toggle-switch:disabled {
  opacity: 0.7;
  cursor: wait;
}

.report-creative-copy {
  max-width: 100%;
}

.report-creative-copy-text {
  white-space: normal;
  overflow-wrap: anywhere;
}

.report-creative-copy-text.is-collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.report-see-more {
  border: 0;
  background: transparent;
  color: #1877f2;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 0 0;
  cursor: pointer;
}

.report-image-cell {
  text-align: center;
}

.report-creative-image {
  display: block;
  width: auto;
  max-width: 100%;
  height: 56px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #d8c6b2;
  margin: 0 auto;
  background: #f4efe8;
}

.report-empty {
  text-align: center;
  color: var(--muted);
  padding: 18px 12px;
}

.report-timeline-cell {
  font-weight: 700;
  color: var(--accent-strong);
  white-space: nowrap;
}

.report-summary-row td {
  font-weight: 700;
  background: #fff7ec;
}

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

.field {
  display: grid;
  grid-template-columns: minmax(110px, 160px) minmax(0, 1fr);
  align-items: start;
  gap: 10px;
}

.field.field-top { grid-template-columns: 72px minmax(0, 1fr); }
.field.field-stacked { grid-template-columns: 1fr; gap: 6px; }
.field.compact { grid-template-columns: auto minmax(220px, 320px); }

.field-label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding-top: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.field-label.field-label-stacked {
  display: block;
}

.field-label-main {
  display: inline;
}

.field-label-note {
  display: block;
  flex-basis: 100%;
  margin-top: 1px;
  font-weight: 400;
  line-height: 1.2;
}

.char-counter {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.char-counter[data-kind="warn"] {
  color: #9c661f;
}

.char-counter[data-kind="error"] {
  color: var(--danger);
}

.field-control { min-width: 0; }

.prompt-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.requirements {
  min-height: 78px;
}

.field.field-invalid .field-label {
  color: var(--danger);
}

.field.field-invalid input,
.field.field-invalid select,
.field.field-invalid textarea {
  border-color: var(--danger);
  box-shadow: 0 0 0 2px rgba(179, 60, 47, 0.14);
}

.asset-file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
}

.asset-clear-btn {
  width: 26px;
  height: 26px;
  border: 1px solid #c9b49d;
  border-radius: 999px;
  background: #f6eee3;
  color: #4a2c1e;
  font-size: 15px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border: 1px solid #c9b49d;
  border-radius: 10px;
  background: #f6eee3;
  color: var(--accent-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.asset-clear-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.icon-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.field-raw-options {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.3;
  word-break: break-word;
}

.field-raw-options.field-raw-options-under-label {
  display: block;
  margin-top: 3px;
  margin-bottom: 0;
}

input,
textarea,
select,
.combo-top input {
  width: 100%;
  min-width: 0;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid #cfc3b0;
  background: #fff;
  color: var(--text);
  font-size: 11px;
  line-height: 1.35;
  font-family: inherit;
}

select,
.compact-select {
  padding-top: 6px;
  padding-bottom: 6px;
}

textarea {
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

input:focus,
select:focus,
textarea:focus,
.btn:focus {
  outline: 2px solid rgba(167, 76, 45, 0.18);
  outline-offset: 1px;
  border-color: var(--accent);
}

.status {
  min-height: 18px;
  font-size: 12px;
  color: #4a433a;
  white-space: pre-wrap;
}

.status[data-kind="error"] { color: #9a2f19; }

.inline-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 6px;
  align-items: center;
}

.inline-note {
  align-self: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.placement-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.placement-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 7px;
  border: 1px solid #dbcbb6;
  border-radius: 8px;
  background: #fff;
  font-size: 11px;
}

.plain-group {
  padding: 0;
  border: 0;
  background: transparent;
  gap: 6px;
}

.section-block,
.stats-card,
.preview,
.csv-block {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid #e4d8c8;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(247, 241, 232, 0.95));
}

.json-preview {
  margin: 0;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #dbcbb6;
  background: #fff;
  color: var(--text);
  font-size: 11px;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}

.section-head,
.stats-title,
.preview-title,
.subnote {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.csv-filter-builder {
  display: grid;
  gap: 8px;
}

.csv-filter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 46px;
  gap: 8px;
  align-items: center;
}

.csv-filter-grid select[multiple] {
  min-height: 110px;
}

.table-wrap {
  max-height: 52vh;
  overflow: auto;
  border: 1px solid #dbcbb6;
  border-radius: 10px;
  background: #fff;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 420px;
}

.table-wrap th,
.table-wrap td {
  padding: 6px 8px;
  border-bottom: 1px solid #efe5d8;
  font-size: 12px;
  text-align: left;
}

.table-wrap th {
  position: sticky;
  top: 0;
  background: #fcf7ef;
  z-index: 1;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(21, 18, 14, 0.45);
}

.modal-card {
  width: min(960px, 100%);
  max-height: min(88vh, 880px);
  overflow: hidden;
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid #d9c9b6;
  background: #fffdf9;
  box-shadow: 0 20px 45px rgba(27, 20, 13, 0.22);
}

.modal-card-compact {
  width: min(560px, 100%);
}

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

.modal-download-row {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: auto;
  padding-top: 6px;
}

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

.modal-actions {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 860px) {
  .csv-filter-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.location-shell {
  display: grid;
  gap: 8px;
  align-items: start;
}

.location-panel,
.map-wrap,
.combo { min-width: 0; }
.location-panel { position: relative; z-index: 2; }

.location-searchline {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}

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

.location-search-provider {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.location-search-combo {
  min-width: 0;
}

.location-searchline input,
.location-searchline select,
.location-panel input,
.location-panel select {
  min-width: 0;
}

.map-wrap {
  display: grid;
  gap: 8px;
  min-height: 180px;
  width: 100%;
  position: relative;
  z-index: 1;
}

.map {
  width: 100%;
  height: 180px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #d1c4b2;
  min-width: 0;
  background: #ede6db;
}

.leaflet-container {
  width: 100%;
  height: 100%;
  max-width: 100%;
  font: inherit;
}

.combo {
  position: relative;
}

.combo-clear-btn {
  position: absolute;
  top: 50%;
  right: 7px;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border: 1px solid #c9b49d;
  border-radius: 999px;
  background: #f6eee3;
  color: #4a2c1e;
  font-size: 13px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 2;
}

#locationIncludeQuery {
  padding-right: 34px;
}

.combo-top {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  gap: 6px;
}

.combo-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow: auto;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid #d8c6b0;
  background: #fffdf8;
  box-shadow: 0 14px 30px rgba(38, 26, 17, 0.12);
  z-index: 1200;
}

.combo-results.empty {
  display: none;
}

.combo-option {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.combo-option:hover,
.combo-option.active {
  background: #f6eee3;
}

.combo-option small {
  color: var(--muted);
  font-size: 11px;
}

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

#assetValidationHint[data-kind="error"] {
  color: #9a2f19;
  font-weight: 600;
}

#assetValidationHint[data-kind="warn"] {
  color: #8a5a00;
}

#assetValidationHint[data-kind="ok"] {
  color: #1f6b3d;
}

#assetAutoFitNotice {
  color: #8a5a00;
}

.asset-auto-fit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  color: #4d3a23;
}

.asset-auto-fit input[type="checkbox"] {
  margin: 0;
}

.asset-tools-row {
  margin-top: 6px;
}

#assetTextStatus {
  margin-top: 6px;
}

.card-hint {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed #dbcbb6;
  background: rgba(255, 255, 255, 0.72);
}

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

.chip-list-compact {
  gap: 4px;
}

.chip-list-collapsed {
  max-height: var(--chip-list-collapsed-height, 40px);
  overflow: hidden;
}

.chip-list-collapse-shell {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.chip-list-collapse-shell > .chip-list {
  flex: 1;
  min-width: 0;
}

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

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid #d8c6b0;
  background: var(--chip);
  color: #3b2b1d;
  font-size: 11px;
}

.chip-static {
  padding-right: 8px;
}

.chip button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}

.chip-list-toggle {
  margin-top: 1px;
  width: 24px;
  min-width: 24px;
  height: 24px;
  border: 1px solid #d7c6b1;
  border-radius: 999px;
  background: #fff7ed;
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
  text-align: center;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chip-list-toggle:hover {
  border-color: #ccb292;
  background: #fff2e1;
  color: var(--accent-strong);
}

.chip-list-toggle-icon {
  display: inline-block;
  transition: transform 160ms ease;
  transform-origin: 50% 50%;
}

.chip-list-toggle.is-expanded .chip-list-toggle-icon {
  transform: rotate(90deg);
}

.define-further-row {
  display: flex;
  align-items: center;
  padding-left: 10px;
  padding-top: 0;
}

.chip-location {
  border-radius: 12px;
  padding: 5px 8px;
}

.chip-location-label {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-location-radius {
  width: 56px;
  min-width: 56px;
  padding: 3px 5px;
  border-radius: 8px;
  border: 1px solid #cfc3b0;
  font-size: 12px;
}

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

.is-hidden {
  display: none !important;
}

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

.audience-intel {
  display: grid;
  gap: 7px;
}

.audience-intel-section {
  display: grid;
  gap: 4px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid #e7ddcf;
}

.audience-intel-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-weight: 700;
}

.audience-intel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 6px;
}

.audience-intel-kv {
  display: grid;
  gap: 2px;
}

.audience-intel-kv-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.audience-intel-kv-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.audience-intel-list {
  margin: 0;
  padding-left: 14px;
  display: grid;
  gap: 2px;
  font-size: 11px;
}

.audience-intel-actions {
  display: flex;
  justify-content: flex-end;
}

.detailed-targeting-group {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: var(--panel-bg);
}

.detailed-targeting-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.detailed-targeting-group-head .field-label {
  margin: 0;
  padding-top: 0;
}

.detailed-targeting-remove-btn {
  width: 22px;
  height: 22px;
  border: 1px solid #d9b1ab;
  border-radius: 999px;
  background: #fff5f4;
  color: var(--danger);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.detailed-targeting-remove-btn:hover {
  background: #fdeeed;
}

.stat {
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid #e7ddcf;
}

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.stat-value { margin-top: 4px; font-size: 16px; font-weight: 700; color: var(--text); }

.preview-box {
  min-height: 160px;
  display: grid;
  place-items: center;
  padding: 12px;
  border-radius: 14px;
  border: 1px dashed #cfbfa9;
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.preview-box img,
.preview-box video {
  max-width: 100%;
  max-height: 280px;
  border-radius: 12px;
}

.asset-slot-preview {
  margin-top: 8px;
  padding: 8px;
  border: 1px dashed #cfbfa9;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.asset-slot-preview img {
  display: block;
  max-width: 100%;
  max-height: 180px;
  border-radius: 8px;
}

.meta-preview-box {
  min-height: 280px;
  place-items: stretch;
}

.meta-preview-iframe {
  width: 100%;
  min-height: 360px;
  border: 0;
  border-radius: 10px;
  background: #fff;
}

.preview-result {
  border: 1px solid #e7ddcf;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.preview-result-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.preview-result-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-strong);
}

.preview-result-link {
  font-size: 11px;
  color: var(--accent);
  text-decoration: underline;
}

.btn {
  border: 1px solid #c9b49d;
  background: #fff8f0;
  color: #4a2c1e;
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.btn.primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  color: white;
  border-color: var(--accent-strong);
}

.btn.secondary { background: #f6eee3; }
.btn.danger { color: var(--danger); border-color: #d9b1ab; background: #fff5f4; }
.btn.btn-small {
  padding: 5px 10px;
  font-size: 11px;
  border-radius: 8px;
}
.btn.btn-link {
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 0;
  border-radius: 0;
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.btn.btn-link:hover {
  color: var(--accent-strong);
}
#defineFurtherBtn {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

.panel-bottom-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

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

@media (max-width: 1380px) {
  .three-col { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .report-tabs {
    display: flex;
  }

  .report-page {
    padding: 12px;
  }

  .report-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .report-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .report-account-field {
    min-width: 0;
  }

  .topbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .brand,
  .account {
    grid-column: auto;
    width: 100%;
  }

  .topbar .field.compact {
    width: 100%;
  }

  #accountId {
    width: 100%;
    margin-left: 0;
  }

  .account,
  .panel-header,
  .footer {
    flex-direction: column;
    align-items: stretch;
  }

  .mobile-section-tabs {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 20;
  }

  .three-col {
    display: block;
    padding: 10px;
  }

  .three-col .panel {
    display: none;
    margin-bottom: 10px;
  }

  .three-col .panel.is-mobile-active {
    display: block;
  }

  .panel-loading-overlay {
    padding-top: 100px;
  }

  .field,
  .field.compact,
  .field.field-top,
  .field.field-stacked {
    grid-template-columns: minmax(92px, 116px) minmax(0, 1fr);
    gap: 7px;
  }

  .field-label {
    padding-top: 5px;
  }

  .location-shell,
  .combo-top,
  .location-searchline,
  .location-dual-search {
    grid-template-columns: 1fr;
  }

  .map,
  .map-wrap {
    min-height: 180px;
    height: 180px;
  }
}
