/* Shared rhythm for headings, fields, panels and quiet actions. */
:root { --workspace-content-width:1000px; --workspace-gutter:24px; }
.app-body.settings-layout { --workspace-content-width:800px; }
.app-body>main { max-width:calc(var(--workspace-content-width) + 2 * var(--workspace-gutter)); min-width:0; padding-inline:var(--workspace-gutter); }
.app-body>.footer { max-width:var(--workspace-content-width); width:calc(100% - 2 * var(--workspace-gutter)); margin-inline:auto; }
@media(max-width:640px){ :root { --workspace-gutter:18px; } }
.sidebar {
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
}
.sidebar > * { flex-shrink: 0; }
.credit-plan-link {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font: inherit;
  border-radius: 4px;
}
.credit-plan-link:hover > span { color: var(--primary); }
.credit-card-active { border-color: var(--primary); }

:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --panel-padding: var(--space-6);
}

.page-heading,
.offer-editor-heading {
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}
.page-heading p,
.offer-editor-heading p { margin-top: var(--space-2); }

main .tabs { gap: var(--space-6); margin-bottom: var(--space-6); }
.tabs + .filter-row { margin-top: 0; }
.section-title,
.product-section-title,
.offer-form .section-title {
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.section-title:has(+ p) { margin-bottom: var(--space-2); }
.section-title + p {
  margin-top: 0;
  margin-bottom: var(--space-6);
}
.settings-section > h2 { margin-bottom: var(--space-2); }
.settings-section > p { margin: 0 0 var(--space-6); }
.plan-card .section-title + p { margin: 0 0 var(--space-6); }
.chart-heading { margin-top: 0; }
.drawer-body > .section-title h3 { margin: 0; }
.drawer-body > .section-title .btn { margin-top: 0; }

.settings-section,
.product-settings,
.plan-card { padding: var(--panel-padding); }
.field,
.product-settings .field { gap: var(--space-2); margin-bottom: var(--space-5); }
.form-grid,
.product-settings .form-grid { column-gap: var(--space-4); }
.form-actions { gap: var(--space-3); padding-top:0; }
.offer-form .form-actions { margin-top:24px; padding-top:0; }
.offer-form > fieldset > h2,
.offer-form .section-title { margin-bottom: var(--space-6); }
.offer-image-section { padding: var(--space-6) 0; }
.offer-image-section h3 { margin-bottom: var(--space-4); }
.offer-image-layout { gap: var(--space-5); }
.offer-image-actions { gap: var(--space-2); }
.offer-additional { padding-top: var(--space-6); }
.offer-ad-goals { margin-top: var(--space-1); padding-top: var(--space-6); }
.offer-ad-goals h3 { margin-bottom: var(--space-6); }
.offer-landing-list { gap: var(--space-4); margin-bottom: var(--space-6); }
.offer-landing-list:empty,
.asset-grid:empty { display: none; }
.asset-grid { gap: var(--space-4); }
.asset-grid:not(:empty) + #offer-asset-form { margin-top: var(--space-6); }
.offer-landing-row { padding: var(--panel-padding); gap: var(--space-4); }
.offer-row-actions { gap: var(--space-1); }
.product-assets > div > .text-btn { margin-top: auto; font-size: 12px; }

/* Quiet buttons keep the same padded hit area in every state. */
.text-btn,
.btn.product-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  line-height: 1.5;
  transition: background-color .15s, color .15s;
}
.text-btn:not(:disabled):hover,
.text-btn:focus-visible,
.btn.product-back:not(:disabled):hover,
.btn.product-back:focus-visible {
  background: var(--soft);
  border-color: transparent;
  color: var(--primary);
}
.btn.product-back { margin: 0 0 var(--space-6) -13px; }

@media (max-width: 640px) {
  :root { --panel-padding: var(--space-5); }
  .page-heading,
  .offer-editor-heading { row-gap: var(--space-4); }
  main .tabs { gap: var(--space-4); }
  .offer-image-layout { gap: var(--space-4); }
}
@media (pointer: coarse) {
  .text-btn,
  .btn.product-back { min-height: 44px; }
}

.asset-upload-actions{display:flex;align-items:center;gap:var(--space-2);flex-wrap:wrap}
.asset-file-picker{position:relative;overflow:hidden;cursor:pointer}
.asset-file-picker input{position:absolute;inset:0;opacity:0;width:100%;height:100%;cursor:inherit;font-size:16px}
.asset-file-picker:focus-within{outline:2px solid var(--focus-ring);outline-offset:3px}
.section-title:has(+.asset-upload-hint){margin-bottom:var(--space-2)}
.asset-upload-hint{font-size:11px;line-height:1.8;color:var(--muted);margin:0 0 var(--space-6)}
.asset-upload-error{margin:0 0 var(--space-6)}
.product-assets .offer-asset-card{padding:var(--space-4);min-width:0}
.product-assets .offer-asset-preview{display:block;width:100%;height:160px;object-fit:contain;background:var(--bg);border-radius:6px}
.product-assets .offer-asset-name{font-size:12px;line-height:1.7;overflow-wrap:anywhere;max-width:100%}
.product-assets .offer-asset-card>small{font-size:11px;line-height:1.7}
@media(max-width:640px){.asset-upload-actions{width:100%}.asset-upload-actions>.btn{flex:1}.product-assets{grid-template-columns:1fr}.product-assets .offer-asset-preview{height:190px}}

.asset-preparation{padding:12px 16px;border:1px solid var(--border);border-radius:8px;background:var(--bg);color:var(--accent);font-size:12px;margin:0 0 var(--space-6);overflow-wrap:anywhere}
.asset-optimization{color:var(--muted)}

/* User forms share product panels, tab spacing and action placement. */
.user-details-form h2,.user-access-panel h2 { margin:0 0 var(--space-6); }
.user-details-form fieldset { border:0; padding:0; margin:0; min-width:0; }
.user-preview-note { margin-top:var(--space-6); display:flex; align-items:center; justify-content:space-between; gap:var(--space-4); flex-wrap:wrap; }
.user-preview-note p { margin:0; color:var(--muted); font-size:12px; }

/* Business context above navigation; account actions below it. */
.sidebar-brand-row {display:flex;align-items:center;justify-content:space-between;gap:var(--space-2)}
.sidebar-close,.sidebar-backdrop,.mobile-navigation {display:none}
.sidebar-business {margin:var(--space-6) 0 var(--space-4);min-width:0}
.sidebar .workspace-label {margin:0 0 var(--space-3);font-size:9px;letter-spacing:1.4px}
.sidebar .workspace-picker {gap:var(--space-2);min-width:0}
.sidebar .workspace-picker .system-select {flex:1;width:0;max-width:none}
.sidebar .workspace-picker .system-select-trigger {font-size:12px;padding:10px;gap:var(--space-2);min-height:40px}
.sidebar .workspace-avatar {width:28px;height:28px;flex-shrink:0}
.sidebar-business-context {font-size:10px;color:var(--muted);line-height:1.7;margin:var(--space-2) 0 0 36px;overflow-wrap:anywhere}
.sidebar .store-select {display:block;width:100%;border:1px solid var(--line);border-radius:8px;background:color-mix(in srgb,var(--sidebar-bg) 65%,var(--surface))}
.sidebar .store-select .system-select-trigger {display:grid;grid-template-columns:28px minmax(0,1fr) 14px;gap:10px;min-height:48px;padding:9px 11px;border:0;border-radius:8px;background:transparent;color:var(--ink);font-size:13px;box-shadow:none}
.sidebar .store-select .system-select-trigger:hover,.sidebar .store-select .system-select-trigger[aria-expanded=true] {background:transparent;border:0;box-shadow:none;color:var(--ink)}
.store-picker-symbol {display:grid;place-items:center;width:28px;height:28px;background:var(--selected-bg);color:var(--primary);border-radius:6px}
.sidebar .store-select .system-select-value {font-weight:550}
.sidebar .store-select .system-select-arrow {justify-self:center}
.store-select-menu {display:flex;flex-direction:column;overflow:hidden;font-size:13px}
.store-select-menu>[role=listbox] {min-height:0;overflow-y:auto;overscroll-behavior:contain}
.store-select-menu .system-select-option {min-height:40px;padding:8px 10px;color:var(--muted);font-weight:400}
.store-select-menu .system-select-option[aria-selected=true] {color:var(--primary);font-weight:550}
.store-select-menu .system-select-option:not([aria-disabled=true]):hover,.store-select-menu .system-select-option:not([aria-disabled=true]).is-highlighted {background:var(--selected-bg);color:var(--primary)}
.sidebar>nav .nav-item {display:grid;grid-template-columns:28px minmax(0,1fr) minmax(20px,max-content);gap:10px;min-height:48px;padding:10px 12px}
.sidebar>nav .nav-item>svg {justify-self:center}
.sidebar>nav .nav-count {justify-self:center}
.sidebar>nav .nav-count,.sidebar>nav .nav-item.active .nav-count {display:grid;place-items:center;min-width:18px;height:18px;padding:0 5px;border-radius:5px;background:var(--count-bg);color:var(--primary);font-size:11px;font-weight:600;line-height:1;font-variant-numeric:tabular-nums;margin:0}
.store-select-menu .store-create-action {position:relative;display:flex;flex-shrink:0;align-items:center;width:100%;min-height:44px;margin:10px 0 0;padding:10px;border:0;border-radius:5px;background:transparent;color:var(--primary);font-size:13px;font-weight:550;text-align:left}
.store-select-menu .store-create-action::before {content:"";position:absolute;top:-5px;left:5px;right:5px;height:1px;background:var(--line);pointer-events:none}
.store-select-menu .store-create-action:hover {background:var(--selected-bg)}
.new-business-context {padding:10px 12px;font-size:13px}
.sidebar-account {border-top:1px solid var(--line);padding-top:var(--space-5);margin-top:auto}
.sidebar-account>.workspace-label {margin:0 14px var(--space-3)}
.sidebar-account .credit-card {margin:0 6px var(--space-5)}
.profile:hover,.profile.active {background:var(--soft)}
.profile-summary {min-width:0;flex:1}
.profile strong {overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.account-menu {position:fixed;z-index:80;border:1px solid var(--line);border-radius:9px;padding:var(--space-2);background:var(--surface);box-shadow:0 12px 32px #1720331c,0 2px 6px #1720330a;max-height:calc(100dvh - 24px);overflow:auto}
.account-menu-heading {font-size:9px;letter-spacing:1.4px;color:var(--muted);padding:var(--space-2) var(--space-3)}
.account-menu :is([role=menuitem],[role=menuitemcheckbox]) {display:flex;align-items:center;gap:var(--space-3);width:100%;min-height:44px;padding:var(--space-3);border:0;border-radius:6px;background:transparent;color:var(--ink-secondary);text-align:left;font-size:12px}
.account-menu :is([role=menuitem],[role=menuitemcheckbox]):hover,.account-menu :is([role=menuitem],[role=menuitemcheckbox]):focus-visible {background:var(--soft);color:var(--primary)}
.account-menu :is([role=menuitem],[role=menuitemcheckbox]) svg {color:var(--muted)}
@media(max-width:640px){
 body.navigation-open {overflow:hidden}
 .sidebar {width:min(280px,calc(100vw - 48px));z-index:70}
 .sidebar-close {display:inline-flex;min-width:36px;min-height:36px}
 .sidebar.mobile-open+.sidebar-backdrop {display:block;position:fixed;inset:0;z-index:60;background:#17203340;border:0;padding:0;cursor:default}
 .mobile-navigation {display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);min-height:68px;padding:10px 18px;border-bottom:1px solid var(--line);min-width:0}
 .mobile-navigation .mobile-brand {padding:0;font-size:23px}
 .mobile-nav-toggle {min-width:44px;min-height:44px;flex-shrink:0}
 .sidebar-business {margin-top:var(--space-6)}
 .sidebar .workspace-picker .system-select-trigger {font-size:13px;min-height:44px}
 .sidebar .nav-item {min-height:44px}
}

/* Settings pages share the store navigation hierarchy. */
.sidebar>nav .settings-toggle.settings-current {color:var(--ink);font-weight:600}
.settings-chevron {display:grid;place-items:center;transition:transform .15s}
.settings-toggle[aria-expanded=true] .settings-chevron {transform:rotate(180deg)}
.settings-subnav {margin:0 0 8px}
.settings-subnav[hidden] {display:none}
.sidebar>nav .settings-subnav .settings-link {display:block;min-height:40px;padding:10px 12px 10px 50px;margin-bottom:3px}

/* Setup is a focused action feed on the workspace canvas. */
.getting-started {width:100%;max-width:520px;margin:0 auto 28px}
.getting-started-header {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px 16px}
#app .getting-started-header h2 {margin:0;font-family:var(--font);font-size:19px;line-height:1.4;letter-spacing:0;font-weight:500}
.getting-started-count {font-size:12px;color:var(--muted);white-space:nowrap;font-variant-numeric:tabular-nums}
.getting-started-progress {display:block;appearance:none;border:0;width:100%;height:4px;margin:16px 0 20px;border-radius:3px;overflow:hidden;background:var(--soft);accent-color:var(--primary)}
.getting-started-progress::-webkit-progress-bar {background:var(--soft);border-radius:3px}
.getting-started-progress::-webkit-progress-value {background:var(--primary);border-radius:3px}
.getting-started-progress::-moz-progress-bar {background:var(--primary);border-radius:3px}
.getting-started-feed {display:grid;gap:16px}
.getting-started-completed {display:flex;flex-wrap:wrap;gap:10px 16px;color:var(--muted);font-size:12px;margin-bottom:20px}
.getting-started-completed>.getting-started-completed-step {display:inline-flex;align-items:center;gap:6px;border:0;background:transparent;padding:4px 0;min-height:28px;color:var(--muted);font-size:12px;font-weight:400}
.getting-started-completed>.getting-started-completed-step:hover {color:var(--primary);text-decoration:underline}
.setup-overview-layout {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,292px);gap:28px;align-items:start;margin:28px auto;width:100%;max-width:var(--workspace-content-width)}
.setup-overview-layout>.getting-started {margin:0;min-width:0;max-width:none}
.setup-support {display:grid;gap:20px;min-width:0}
.setup-preview-card {padding:20px;border-radius:10px;min-width:0}
.setup-preview-card {background:var(--subtle-bg)}
.setup-preview-card>header {display:flex;align-items:center;justify-content:space-between;gap:12px;color:var(--muted);font-size:12px;margin-bottom:16px}
.setup-example-label {display:inline-block;color:var(--muted);background:var(--surface);border:1px solid var(--line);border-radius:4px;padding:3px 7px;font-size:11px;margin-bottom:10px}
#app .setup-preview-card h2 {font-family:var(--font);font-size:15px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--ink-secondary);margin:0 0 10px}
.setup-preview-card>p {font-size:13px;line-height:1.7;color:var(--muted);margin:0}
.setup-preview-card>footer {font-size:11px;line-height:1.6;color:var(--muted);margin-top:16px}
.overview-feed-layout {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,292px);gap:28px;align-items:start;width:100%;max-width:var(--workspace-content-width);margin:28px auto}
.overview-main-feed {min-width:0}
.overview-main-feed>.overview-attention,.overview-main-feed>.overview-activity {max-width:none;margin:0 0 28px}
.overview-main-feed>.overview-all-clear {margin:0 0 24px}
.overview-feed-heading {display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:20px;border-bottom:1px solid var(--line)}
#app .overview-feed-tabs {min-width:0;gap:20px;margin:0;border:0}
#app .overview-feed-tabs>.tab {font-size:13px;font-weight:500;min-height:44px;padding:8px 0 12px;white-space:nowrap}
.overview-feed-tabs .attention-count {margin-left:0;font-size:11px;min-width:20px;height:20px}
.overview-feed-heading>.text-btn {font-size:12px;flex-shrink:0;margin-bottom:4px}
.overview-feed :is(.overview-attention,.overview-activity) {max-width:none;margin:0}
.overview-feed>.overview-activity>.actions-section-heading {min-height:44px;margin-bottom:20px}
.overview-feed-empty {margin:0;padding:20px 0;color:var(--muted);font-size:13px;line-height:1.7}
@media(max-width:640px){
 #app .overview-feed-tabs {gap:16px}
 #app .overview-feed-tabs>.tab {font-size:12px}
 .overview-feed-heading>.text-btn {margin-left:auto}
}
.overview-leader-support {display:grid;gap:20px;min-width:0}
.overview-leader-card {--leader-gap:8px;--leader-row-height:64px;padding:18px var(--leader-gap) var(--leader-gap);border-radius:12px;min-width:0;background:color-mix(in srgb,var(--bg) 92%,var(--surface));border-color:color-mix(in srgb,var(--line) 45%,transparent);box-shadow:none}
.overview-leader-card>header {height:64px;padding:0 var(--leader-gap)}
.overview-leader-heading {display:flex;align-items:center;gap:8px}
.overview-leader-heading-copy {flex:1;min-width:0}
#app .overview-leader-card h2 {font-family:var(--font);font-size:14px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--muted);margin:0}
#app .overview-leader-title {display:block}
.overview-leader-title .system-select {max-width:100%;vertical-align:baseline}
.overview-leader-title .system-select-trigger {display:inline-flex;position:relative;width:auto;padding:0;min-height:0;border:0;border-radius:0;background:transparent;gap:0;font:inherit;line-height:inherit;color:inherit;vertical-align:baseline;box-shadow:none}
.overview-leader-title .system-select-value {flex:none;overflow:visible;text-overflow:clip;text-decoration:underline dashed color-mix(in srgb,var(--muted) 55%,transparent);text-underline-offset:4px;text-decoration-thickness:1px}
.overview-leader-title .system-select-arrow {display:none}
.overview-leader-title .system-select-trigger:hover,.overview-leader-title .system-select-trigger[aria-expanded="true"] {background:transparent;color:var(--ink-secondary);box-shadow:none}
.overview-leader-title .system-select-trigger:hover .system-select-value,.overview-leader-title .system-select-trigger[aria-expanded="true"] .system-select-value {text-decoration-style:solid;text-decoration-color:currentColor}
.overview-leader-card header p {margin:4px 0 0;font-size:11px;color:var(--muted);line-height:1.6}
.overview-leader-period {display:flex;align-items:center;gap:6px}
.overview-leader-order {display:inline-flex;align-items:center;justify-content:center;flex:0 0 32px;width:32px;height:32px;padding:6px;border:0;border-radius:4px;background:transparent;color:var(--muted)}
.overview-leader-order:hover {background:var(--subtle-bg);color:var(--ink-secondary)}
.overview-leader-order svg {transition:transform .15s ease}
.overview-leader-order:not(.is-descending) svg {transform:rotate(180deg)}
@media(prefers-reduced-motion:reduce){.overview-leader-order svg {transition:none}}
.overview-leader-items {min-width:0}
.overview-leader-row {position:relative;isolation:isolate;display:flex;align-items:center;gap:10px;width:100%;min-width:0;height:var(--leader-row-height);padding:12px var(--leader-gap);border:0;border-radius:8px;background:transparent;text-align:left;color:var(--ink)}
.overview-leader-row::before {content:'';position:absolute;top:0;left:var(--leader-gap);right:var(--leader-gap);height:1px;background:color-mix(in srgb,var(--line) 65%,transparent)}
.overview-leader-row::after {content:'';position:absolute;inset:var(--leader-gap) 0;border-radius:8px;background:transparent;z-index:-1;pointer-events:none;transition:background-color .15s ease}
.overview-leader-row:hover::after {background:var(--subtle-bg)}
.overview-leader-row:focus-visible {outline:2px solid var(--primary);outline-offset:2px}
.overview-leader-thumb {display:grid;place-items:center;width:36px;height:36px;flex:0 0 36px;border:1px solid color-mix(in srgb,var(--line) 60%,transparent);border-radius:8px;background:var(--surface);color:var(--muted);overflow:hidden}
.overview-leader-thumb img {width:100%;height:100%;object-fit:contain;padding:3px}
.overview-leader-name {flex:1;min-width:0}
.overview-leader-name strong {display:block;font-size:13px;font-weight:400;line-height:1.5;color:var(--ink-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.overview-leader-value {font-size:13px;line-height:1.6;font-weight:400;color:var(--muted);white-space:nowrap;font-variant-numeric:tabular-nums}
.overview-leader-empty {display:flex;align-items:center;justify-content:center;min-height:96px;margin:0;padding:24px var(--leader-gap);color:var(--muted);font-size:13px;line-height:1.7;text-align:center}
.recent-conversions-card {padding:18px 16px 16px;border-radius:12px;background:var(--surface);border-color:color-mix(in srgb,var(--line) 65%,transparent);box-shadow:none;min-width:0}
#app .recent-conversions-card h2 {font-family:var(--font);font-size:14px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--ink-secondary);margin:0}
.recent-conversions-card header p {margin:4px 0 16px;color:var(--muted);font-size:11px;line-height:1.6}
.recent-conversions-list {list-style:none;margin:0;padding:0;display:grid;gap:8px}
.recent-conversions-list li {min-width:0}
.recent-conversion-row {display:grid;grid-template-columns:36px minmax(0,1fr) auto;align-items:center;gap:10px;width:100%;border:0;border-radius:8px;padding:12px 10px;text-align:left;background:color-mix(in srgb,var(--soft) 52%,var(--surface));color:var(--ink)}
button.recent-conversion-row:hover {background:var(--soft)}
.recent-conversion-row:focus-visible {outline:2px solid var(--focus-ring);outline-offset:2px}
.recent-conversion-copy {min-width:0}
.recent-conversion-copy strong {display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:12px;font-weight:500;line-height:1.6}
.recent-conversion-copy small {display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:10px;color:var(--muted);line-height:1.6;margin-top:3px}
.recent-conversion-value {font-size:12px;font-weight:500;white-space:nowrap;font-variant-numeric:tabular-nums;color:var(--primary)}
.recent-conversions-empty {margin:0;padding:20px 0 10px;font-size:12px;color:var(--muted);line-height:1.7}
@media(max-width:1150px){
 .setup-overview-layout {grid-template-columns:minmax(0,1fr)}
 .overview-feed-layout {grid-template-columns:minmax(0,1fr)}
}
@media(max-width:640px){
 .getting-started-header {gap:8px}
 .setup-preview-card {padding:17px 16px}
}

/* Overview owns attention; Automation owns business settings and history. */
.action-rule-row {display:grid;grid-template-columns:28px minmax(0,1fr) auto;gap:16px;padding:23px;align-items:start}
.action-rule-row+.action-rule-row {border-top:1px solid var(--line)}
.action-rule-copy {min-width:0}
.action-rule-title {display:flex;align-items:center;gap:12px;flex-wrap:wrap}
#app .action-rule-title h2 {font-size:var(--type-subheading);margin:0;overflow-wrap:anywhere}
.action-rule-copy>p {font-size:var(--type-small);color:var(--muted);margin:8px 0;overflow-wrap:anywhere}
.action-rule-meta {display:flex;gap:5px 16px;flex-wrap:wrap;font-size:var(--type-caption);color:var(--muted);line-height:1.8}
.action-rule-meta>span:first-child {flex-basis:100%;overflow-wrap:anywhere}
.action-rule-outcome {display:block;font-size:var(--type-small);color:var(--primary);margin-top:10px}
.action-rule-buttons {display:flex;align-items:center;gap:6px}
.automation-navigation{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:24px}
#app .automation-navigation .actions-tabs{flex:1;min-width:0;margin:0}
.automation-channel-tags{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:0 0 20px}
.automation-channel-tag{appearance:none;border:1px solid transparent;border-radius:7px;background:transparent;color:var(--muted);font:inherit;font-size:12px;line-height:20px;padding:6px 14px;cursor:pointer}
.automation-channel-tag:hover{background:var(--soft)}
.automation-channel-tag[aria-pressed="true"]{background:var(--soft);color:var(--ink);border-color:var(--line);font-weight:600}
.automation-channel-tag:focus-visible{outline:2px solid var(--primary);outline-offset:3px}
.automation-group-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:20px;align-items:start}
.automation-group{min-width:0;overflow:hidden}
.automation-group-heading{display:flex;align-items:center;gap:10px;padding:20px 20px 12px}
#app .automation-group-heading h2{font-size:14px;margin:0;font-weight:500}
.automation-group-heading>.badge{margin-left:auto;font-size:10px}
.automation-group-rows{padding:0 20px 8px}
.automation-control-row{display:grid;grid-template-columns:minmax(120px,160px) minmax(0,1fr) auto;align-items:center;gap:16px;padding:14px 0}
.automation-control-row+.automation-control-row{border-top:1px solid var(--line)}
.automation-control-row>span{font-size:12px;min-width:0;overflow-wrap:anywhere}
.automation-control-row>.automation-control-summary{font-size:11px;color:var(--muted);line-height:1.6}
.automation-control-actions{display:flex;align-items:center;gap:6px;flex-shrink:0}
.automation-control-actions .system-select{width:148px}
.automation-control-actions .system-select-trigger{font-size:11px;min-height:36px}
.automation-control-actions .icon-btn{width:26px;height:32px}
.automation-group-footer{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-top:24px}
.automation-group-footer>span{font-size:12px;color:var(--muted)}
.automation-group-footer small{display:block;font-size:11px;line-height:1.6;margin-top:5px}
#automation-scope-form fieldset{border:0;padding:0;margin:0;min-width:0}
.automation-scope-section{margin-top:24px}
.automation-scope-section h3{font-size:14px;margin:0 0 16px}
.automation-scope-section .rule-products{margin-top:4px}
@media(max-width:760px){.automation-control-row{grid-template-columns:minmax(0,1fr) auto;gap:4px 12px}.automation-control-summary{grid-column:1;grid-row:2}.automation-control-actions{grid-column:2;grid-row:1 / span 2}}
@media(max-width:440px){.automation-control-row{display:flex;align-items:flex-start;flex-direction:column;gap:8px}.automation-control-summary:empty{display:none}.automation-control-actions{width:100%}.automation-control-actions .system-select{flex:1;width:auto}.automation-group-heading,.automation-group-rows{padding-left:16px;padding-right:16px}}

.action-rule-buttons .automation-execution-select,.action-rule-buttons .store-select{width:178px;max-width:100%;flex-shrink:0}
#action-rule-form fieldset {border:0;margin:0;padding:0;min-width:0}
#action-rule-form .rule-editor-section {border-top:1px solid var(--line);padding-top:20px;margin-top:8px}
#action-rule-form .rule-editor-section h3 {margin:0 0 17px}
#action-rule-form .rule-editor-section:has(>[data-action="rule-condition-add"]){padding-bottom:16px}
#action-rule-form .section-title {justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:16px}
#action-rule-form .section-title h3 {margin:0}
.rule-condition-row {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.1fr) minmax(75px,.65fr) 28px;gap:12px;align-items:center}
.rule-condition-row .field {margin-bottom:16px}
.rule-condition-row>.icon-btn {margin-top:6px;width:28px}
.rule-products {display:grid;gap:10px;grid-template-columns:1fr 1fr;margin:0 0 20px}
.rule-products[hidden] {display:none}
.rule-product-option {display:flex;align-items:center;gap:9px;font-size:var(--type-small);padding:12px;border:1px solid var(--line);border-radius:6px;min-width:0}
.rule-product-option>span {overflow-wrap:anywhere}
.rule-product-option input {accent-color:var(--primary);width:16px;height:16px;flex-shrink:0}
.rule-editor-note {font-size:var(--type-small);color:var(--muted);margin:0 0 15px}
@media(max-width:640px){
 .action-rule-row {grid-template-columns:28px minmax(0,1fr);gap:12px;padding:18px}
 .action-rule-buttons {grid-column:2}
 .rule-condition-row {grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:0 12px;padding-bottom:10px;margin-bottom:14px;border-bottom:1px solid var(--line)}
 .rule-condition-row>.icon-btn {justify-self:end;margin:0 0 16px}
 .rule-products {grid-template-columns:1fr}
}
:root {--action-error:#a64747;--action-error-bg:#fdf0ed}
.actions-section-heading {display:flex;align-items:center;justify-content:space-between;gap:16px;margin:26px 0 14px}
#app .actions-section-heading h2 {margin:0;font-size:var(--type-subheading)}
.actions-section-heading>span {font-size:var(--type-caption);color:var(--muted)}
.actions-section-heading p,.action-settings-heading p {font-size:var(--type-small);color:var(--muted);margin:6px 0 0}
.overview-attention,.overview-activity {max-width:720px;margin:0 auto 28px}
.overview-attention>.actions-section-heading,.overview-activity>.actions-section-heading {margin-top:0;align-items:center}
.attention-count {display:inline-flex;align-items:center;justify-content:center;min-width:23px;height:23px;padding:0 6px;margin-left:6px;background:var(--soft);color:var(--primary);border-radius:6px;font-size:var(--type-small);vertical-align:middle;letter-spacing:0}
.actions-all-clear>.text-btn {margin-left:auto;white-space:normal}
.action-settings-heading {display:flex;align-items:flex-start;justify-content:space-between;gap:24px;margin:0 0 20px}
#app :is(.action-settings-heading) h2 {font-size:var(--type-subheading);margin:0}
.action-settings-heading>div:first-child {min-width:0;flex:1}
.action-save {display:flex;flex-direction:column;align-items:flex-end;gap:7px;flex-shrink:0}
.action-save>span {font-size:var(--type-caption);color:var(--muted)}
.action-setting-row {display:grid;grid-template-columns:28px minmax(0,1fr) 180px;gap:14px;align-items:start;padding:22px}
.action-setting-row+.action-setting-row,.action-product-row+.action-product-row {border-top:1px solid var(--line)}
#app .action-setting-copy h3 {font-size:var(--type-body);margin:0 0 5px}
.action-setting-copy p {font-size:var(--type-small);color:var(--muted);margin:0;line-height:1.75}
.action-mode {margin:0;gap:6px}
.action-mode>span {font-size:var(--type-caption)}
.action-settings-note {font-size:var(--type-caption);color:var(--muted);margin:15px 0 0}
.action-product-row {display:flex;align-items:center;gap:18px;justify-content:space-between;padding:20px 22px}
.action-product-row>div {min-width:0}
.action-product-row strong {display:block;font-size:var(--type-body);font-weight:550;overflow-wrap:anywhere}
.action-product-row span {display:block;font-size:var(--type-small);color:var(--muted);margin-top:5px}
.action-product-row>.btn {flex-shrink:0}
.product-action-settings {display:flex;align-items:center;justify-content:space-between;gap:16px;border-top:0;padding-top:18px}
.product-action-settings .product-description {margin:0}
.actions-workspace>.actions-section-heading:first-child {margin-top:0}
.action-attention-card {padding:20px;margin-bottom:14px;display:flex;align-items:center;justify-content:space-between;gap:20px}
#app .action-attention-card h3 {font-size:var(--type-subheading);margin:5px 0}
#app .action-attention-card p {font-size:var(--type-small);color:var(--muted);margin:5px 0}
.action-context {display:block;font-size:var(--type-caption);color:var(--muted);line-height:1.6}
.action-state-icon {width:28px;height:28px;display:grid;place-items:center;flex-shrink:0;border-radius:6px;background:var(--selected-bg);color:var(--primary)}
.action-state-icon.failed {background:var(--action-error-bg);color:var(--action-error)}
.action-failure {display:grid;grid-template-columns:28px minmax(0,1fr) auto;align-items:start;gap:12px}
.action-failure-buttons {display:flex;flex-direction:column;align-items:flex-end;gap:5px}
.action-status-error {color:var(--action-error);font-size:var(--type-caption)}
#app .action-attention-card .action-stale {font-size:var(--type-caption);margin-top:8px}
.actions-all-clear {display:flex;align-items:center;gap:10px;padding:14px 16px;border:1px solid var(--line);border-radius:7px;background:var(--surface);font-size:var(--type-small);color:var(--muted);margin-bottom:25px}
.actions-all-clear>svg {color:var(--primary);flex-shrink:0}
.actions-activity {padding:0 20px}
.action-activity-row {display:grid;grid-template-columns:28px minmax(0,1fr) 16px;gap:12px;align-items:start;width:100%;padding:20px 0;border:0;background:transparent;text-align:left;color:var(--ink)}
.action-activity-row+.action-activity-row {border-top:1px solid var(--line)}
.action-activity-row:hover .action-activity-copy>strong {color:var(--primary)}
.action-activity-copy {display:grid;gap:4px;min-width:0;overflow-wrap:anywhere}
.action-activity-copy>strong {font-size:var(--type-body);font-weight:550;line-height:1.5}
.action-change {font-size:var(--type-small);margin-top:4px;font-variant-numeric:tabular-nums}
.action-activity-meta {display:flex;align-items:center;gap:12px;flex-wrap:wrap;font-size:var(--type-caption);color:var(--muted);margin-top:4px}
.action-activity-meta>span {display:inline-flex;align-items:center;gap:4px}
.action-activity-row>svg {color:var(--muted);margin-top:5px}
.actions-load-more {display:flex;justify-content:center;margin-top:18px}
#overlay .action-detail-context {font-size:var(--type-small);color:var(--muted);margin-bottom:16px}
.action-detail-list {margin-top:24px}
.action-detail-list>div {padding:14px 0;border-bottom:1px solid var(--line)}
.action-detail-list dt {font-size:var(--type-caption);color:var(--muted);margin-bottom:4px}
.action-detail-list dd {font-size:var(--type-body);margin:0;overflow-wrap:anywhere}
@media(max-width:640px){
 .action-setting-row {grid-template-columns:28px minmax(0,1fr);padding:18px;gap:12px}
 .action-mode {grid-column:2;width:100%}
 .action-settings-heading {flex-direction:column;gap:16px}
 .action-save {align-items:flex-start}
 .action-product-row {padding:18px;flex-wrap:wrap;gap:12px}
 .overview-attention>.actions-section-heading,.overview-activity>.actions-section-heading {flex-wrap:wrap}
 .product-action-settings {align-items:flex-start;flex-direction:column}
 .action-attention-card {padding:18px;align-items:flex-start;flex-direction:column}
 .action-failure {grid-template-columns:28px minmax(0,1fr)}
 .action-failure-buttons {grid-column:2;flex-direction:row;align-items:center;gap:12px;flex-wrap:wrap}
 .action-creative {display:flex}
 .actions-activity {padding:0 16px}
 .action-activity-row {gap:10px;padding:18px 0}
 .actions-section-heading {gap:12px}
}

/* Keep section spacing after metrics without a revenue-source caption. */
.stats-grid + :is(.overview-attention,.overview-activity,.getting-started) { margin-top:28px; }

/* Products use the shared drawer, with a three-column catalogue behind it. */
#app .product-grid { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px; }
#app .product-grid .product-list-item { min-width:0;transition:border-color .15s,box-shadow .15s; }
#app .product-grid .product-list-item:hover { border-color:var(--focus-ring);box-shadow:0 5px 18px #233e6809; }
#app .product-grid .product-open { display:flex;flex-direction:column;align-items:stretch;height:100%;padding:0;gap:0;flex-wrap:nowrap; }
#app .product-grid .offer-image { position:relative;display:flex;align-items:center;justify-content:center;width:100%;height:auto;aspect-ratio:1;box-sizing:border-box;border-radius:0;border-bottom:1px solid var(--line);background:#fff; }
#app .product-grid .offer-image>img { position:absolute;inset:0;width:100%;height:100%;box-sizing:border-box;object-fit:contain;object-position:center;min-width:0;min-height:0;padding:20px; }
#app .product-grid .offer-image>svg { width:38px;height:38px;opacity:.65; }
#app .product-grid .product-list-summary { flex-basis:auto;padding:18px;gap:10px; }
#app .product-grid .product-list-summary>span:not(.product-meta) { display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden; }
#app .product-grid .product-meta { justify-content:space-between;margin-top:0;padding-top:0;gap:8px; }
#app .product-grid>.empty-state { grid-column:1/-1; }
.product-drawer .drawer-header { flex-shrink:0; }
.product-drawer .drawer-body { padding:24px 28px;scroll-behavior:auto;overflow-anchor:none; }
.product-drawer .drawer-footer { align-items:center;flex-shrink:0;flex-wrap:wrap; }
.product-drawer-status { flex:1;min-width:100px;font-size:var(--type-small);color:var(--muted);line-height:1.6; }
.product-archive-action{color:var(--danger,#b45454)}
.product-table-state{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.product-archive-review ul{padding-left:20px;display:grid;gap:12px;line-height:1.6;margin:20px 0 24px}
.product-archive-campaigns{padding:20px;background:var(--bg,#f6f7f8);border-radius:12px}
.product-archive-campaigns p{line-height:1.6;margin:10px 0 0}
.product-archive-option{display:flex;align-items:center;gap:10px;margin-top:16px;font-size:13px}
.product-archive-option input{width:16px;height:16px;flex-shrink:0;accent-color:var(--ink,#20272d)}
.product-archive-review>.form-error{margin-top:20px}
.product-drawer .product-drawer-section { min-width:0;scroll-margin-top:24px; }
.product-drawer .product-drawer-section+.product-drawer-section { margin-top:28px;padding-top:28px;border-top:1px solid var(--line); }
.product-drawer .product-settings { padding:0;border:0;box-shadow:none;background:transparent; }
.product-drawer .product-settings h2,.product-drawer .product-section-title h2 { font-size:var(--type-subheading); }
.product-drawer .product-section-title { margin-bottom:20px; }
.product-drawer .offer-landing-row { padding:16px;flex-wrap:wrap;gap:12px; }
.product-drawer .offer-landing-row>div:first-child { flex:1;min-width:0; }
.product-drawer .offer-landing-row span { overflow-wrap:anywhere; }
.product-drawer .product-assets { grid-template-columns:repeat(3,minmax(0,1fr)); }
.product-drawer .offer-price-details .field { margin-bottom:0; }
.product-drawer .offer-price-details + .offer-image-section { margin-top:24px;padding:24px 0 0;border-bottom:0; }
.product-drawer .offer-image-layout { align-items:center; }
.product-drawer .offer-image-section h3 { margin-top:0; }
.product-drawer .offer-additional>h3 { margin-top:0; }
.product-drawer .product-action-settings { margin:20px 0; }
.product-drawer .product-action-settings p { margin-bottom:12px; }
@media(max-width:900px) { #app .product-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:560px) {
 #app .product-grid { grid-template-columns:minmax(0,1fr); }
 .product-drawer .drawer-body { padding:20px; }
 .product-drawer .product-assets { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .product-drawer-status { flex-basis:100%; }
}

/* Landing pages use the same repeatable-row pattern as action conditions. */
.product-drawer .product-landing-row { grid-template-columns:minmax(100px,1fr) minmax(150px,1.65fr) minmax(80px,.8fr) minmax(80px,.8fr) 28px;gap:12px;align-items:start; }
.product-drawer .product-landing-row .field { margin-bottom:16px; }
.product-drawer .product-landing-row>.icon-btn { margin-top:29px; }
.product-drawer .product-landing-row input { min-width:0; }
.product-drawer .product-landing-rows+.btn { margin-top:4px; }
@media(max-width:640px) {
 .product-drawer .product-landing-row { grid-template-columns:minmax(0,1fr) minmax(0,1fr) 28px;gap:0 12px;padding-bottom:12px;margin-bottom:16px;border-bottom:1px solid var(--line); }
 .product-drawer .product-landing-row>.field:nth-child(1) { grid-column:1/3;grid-row:1; }
 .product-drawer .product-landing-row>.field:nth-child(2) { grid-column:1/3;grid-row:2; }
 .product-drawer .product-landing-row>.field:nth-child(3) { grid-column:1;grid-row:3; }
 .product-drawer .product-landing-row>.field:nth-child(4) { grid-column:2;grid-row:3; }
 .product-drawer .product-landing-row>.icon-btn { grid-column:3;grid-row:1;margin-top:29px; }
}

/* Dynamic forms keep the same drawer shell, with no scroll anchoring or animated resets. */
.drawer-body { scroll-behavior:auto;overflow-anchor:none; }

/* Product photos and unit pricing share the drawer's compact field spacing. */
.product-image-gallery{display:flex;flex-wrap:wrap;gap:12px}
.product-image-tile,.product-image-add{position:relative;display:flex;align-items:center;justify-content:center;width:104px;height:104px;flex:0 0 104px;border-radius:10px;overflow:hidden}
.product-image-tile{border:1px solid var(--line);background:var(--bg)}
.product-image-tile img{width:100%;height:100%;object-fit:contain}
.product-image-add{border:1px dashed #b7c3d1;background:transparent;color:var(--muted);cursor:pointer}
.product-image-add:hover{border-color:var(--primary);color:var(--primary)}
.product-image-add:focus-within{outline:2px solid var(--primary);outline-offset:3px}
.product-image-add input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
.product-image-add:has(input:disabled){opacity:.55;cursor:wait}
.product-image-main{position:absolute;bottom:5px;left:5px;padding:2px 7px;border-radius:5px;background:#fff;color:var(--ink);font-size:11px;font-weight:600;line-height:1.5}
.product-image-remove{position:absolute;top:6px;right:6px;z-index:1;display:flex;align-items:center;justify-content:center;width:28px;height:28px;box-sizing:border-box;padding:0;border:1px solid var(--line);border-radius:6px;background:#fff;color:var(--muted);line-height:1;cursor:pointer}
.product-image-remove:hover{color:var(--ink);background:var(--soft)}
.product-image-progress{margin:12px 0 0;color:var(--muted);font-size:12px}
.product-pricing-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr)) 100px;gap:16px;align-items:start}
.product-pricing-grid output{display:block;min-height:42px;padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:var(--bg);font-weight:600;font-size:14px;line-height:20px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.product-pricing-grid .field>span{display:block}
@media(max-width:560px){.product-pricing-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.product-image-tile,.product-image-add{width:88px;height:88px;flex-basis:88px}}

.product-create-intro{color:var(--muted);font-size:14px;line-height:1.7;margin:0 0 24px}
.product-create-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.product-create-option{position:relative;text-align:left;padding:24px;border:1px solid var(--line);border-radius:12px;background:var(--surface);display:flex;flex-direction:column;gap:12px;color:var(--ink)}
.product-create-option:hover{border-color:var(--primary);background:var(--bg)}
.product-create-option-icon{display:grid;place-items:center;width:42px;height:42px;border-radius:10px;background:var(--soft);color:var(--primary);margin-bottom:4px}
.product-create-option strong{font-size:16px;font-weight:650}
.product-create-option>span:not(.product-create-option-icon):not(.product-create-option-arrow){font-size:13px;color:var(--muted);line-height:1.7;padding-right:16px}
.product-create-option-arrow{position:absolute;right:20px;top:36px;color:var(--muted)}
.product-import-review{margin:0 0 24px;color:var(--muted);font-size:13px;line-height:1.7}
.product-import-progress{color:var(--muted);font-size:13px;line-height:1.7;margin-top:16px}
@media(max-width:560px){.product-create-options{grid-template-columns:1fr}.product-create-option{padding:20px}}

/* Every step of product creation keeps the same drawer inset. */
.drawer[data-dialog-key="product-create"] .drawer-body{padding:24px 28px}
@media(max-width:560px){.drawer[data-dialog-key="product-create"] .drawer-body{padding:20px}}

/* Campaign drilldowns share one shell and remember each view's scroll position. */
.drawer[data-dialog-key="campaign-explorer"] .drawer-body{overflow-anchor:none;scroll-behavior:auto}

.campaign-breadcrumb{display:flex;align-items:center;gap:10px;min-width:0;flex:1;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;margin:0;padding:0;font-size:12px;color:var(--muted);line-height:1.7}
.campaign-breadcrumb button{padding:0;border:0;background:none;color:var(--primary);font-weight:500;text-align:left}
.campaign-breadcrumb button:hover{text-decoration:underline}
.campaign-breadcrumb [aria-current="page"]{color:var(--ink);font-weight:600;overflow-wrap:anywhere}
.campaign-breadcrumb>svg{flex-shrink:0;color:var(--muted-light)}
.campaign-table-surface tbody td:nth-child(2){min-width:200px}

.campaign-table-surface .campaign-switch-column{width:64px;min-width:64px;padding-left:18px;padding-right:12px}
.campaign-status-switch{display:inline-flex;align-items:center;flex:0 0 auto;width:34px;height:20px;border:1px solid transparent;border-radius:20px;padding:2px;background:#c5cbd3;transition:background .15s;cursor:pointer}
.campaign-status-switch span{width:14px;height:14px;border-radius:50%;background:#fff;box-shadow:0 1px 3px #17203320;transition:transform .15s;pointer-events:none}
.campaign-status-switch[aria-checked=true]{background:var(--primary)}
.campaign-status-switch[aria-checked=true] span{transform:translateX(14px)}
.campaign-status-switch:focus-visible{outline:2px solid var(--primary);outline-offset:3px}
.campaign-status-switch:disabled{opacity:.45;cursor:not-allowed}
@media(prefers-reduced-motion:reduce){.campaign-status-switch,.campaign-status-switch span{transition:none}}


.campaign-ad-identity{display:flex;align-items:center;gap:12px}
.campaign-ad-identity>div{min-width:0}
.campaign-ad-identity small{display:block;margin-top:6px;color:var(--muted);font-size:11px}
.campaign-ad-preview-button{flex:0 0 46px;display:block;border:0;padding:0;background:transparent;border-radius:7px;overflow:hidden}
.campaign-ad-preview-button:focus-visible{outline:2px solid var(--primary);outline-offset:3px}
.campaign-ad-thumbnail{position:relative;display:block;width:46px;height:46px;overflow:hidden;border:1px solid var(--line);border-radius:7px;background:var(--soft)}
.campaign-ad-thumbnail>svg{display:block;width:100%;height:100%}
.campaign-ad-thumbnail>img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;background:var(--surface)}


.campaign-table-surface th,.campaign-table-surface td{padding-left:12px;padding-right:12px}
.campaign-table-surface .campaign-metric-column{padding-left:12px;padding-right:12px;white-space:nowrap}
.campaign-metric-column .system-select{display:block;min-width:0}
.campaign-metric-column .system-select-trigger{width:auto;max-width:145px;min-height:28px;padding:0;border:0;background:transparent;box-shadow:none;gap:8px;font-size:11px;font-weight:500;color:var(--muted)}
.campaign-metric-column .system-select-trigger:hover{color:var(--primary)}
.campaign-metric-column .system-select-trigger[aria-expanded=true]{box-shadow:none;color:var(--primary)}
.campaign-metric-column .system-select-value{white-space:nowrap}
@media(pointer:coarse){.campaign-metric-column .system-select-trigger{min-height:44px}}


.campaign-metric-column[aria-sort=descending] .system-select-value{color:var(--primary);font-weight:600}

.campaign-table-surface td.campaign-metric-column.is-ranked{font-weight:600;color:var(--primary)}


.campaign-breadcrumb>button,.campaign-breadcrumb>[aria-current=page]{flex:0 1 auto;min-width:0;max-width:300px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.campaign-breadcrumb>button:first-child{flex-shrink:0}
.campaign-table-surface tfoot{background:var(--soft)}
.campaign-table-surface tfoot th,.campaign-table-surface tfoot td{background:var(--soft);border-top:1px solid var(--line);border-bottom:0;padding-top:17px;padding-bottom:17px;font-weight:600}
.campaign-table-surface tfoot th{padding-left:18px;color:var(--ink)}
.campaign-table-surface tfoot th small{display:block;margin-top:4px;color:var(--muted);font-weight:400;font-size:11px}


.campaign-table-toolbar{display:flex;align-items:center;gap:20px;height:72px;box-sizing:border-box;padding:16px 20px;border-bottom:1px solid var(--line)}
.campaign-table-toolbar .search-field{flex:0 1 220px;min-width:0;width:220px;max-width:42%;height:38px;box-sizing:border-box;padding:8px 10px}
.product-table-surface table{min-width:840px}
.product-table-identity{display:flex;align-items:center;gap:12px;min-width:220px;max-width:390px}
.product-table-identity>div{min-width:0;flex:1}
.product-table-identity .table-link{max-width:100%;white-space:normal;text-align:left;line-height:1.45}
.product-table-identity small{display:block;max-width:300px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:5px;font-size:11px;color:var(--muted)}
.product-table-thumbnail{display:flex;align-items:center;justify-content:center;flex:0 0 38px;width:38px;height:38px;border:1px solid var(--line);border-radius:6px;background:#fff;color:#778399;overflow:hidden}
.product-table-thumbnail img{width:100%;height:100%;object-fit:contain;padding:3px}
.product-table-edit{flex:0 0 30px;width:30px;height:30px;color:var(--muted)}
.product-attribution-note{padding:12px 20px;margin:0;font-size:11px;color:var(--muted);border-top:1px solid var(--line)}
#landing-page-form>fieldset{border:0;margin:0;padding:0;min-width:0}
.landing-page-section>h3{margin:0 0 20px;font-size:15px}
.landing-page-section>h3:has(+.body-copy){margin-bottom:8px}
.landing-page-section+.landing-page-section{border-top:1px solid var(--line);margin-top:12px;padding-top:24px}
.landing-advertising>.section-title{margin-bottom:8px}
.landing-advertising>.section-title h3{font-size:15px}
#landing-page-form .landing-page-section>.body-copy{margin:0 0 20px}
.landing-draft-help{color:var(--muted);font-size:12px;line-height:1.7;margin:18px 0 0}
.landing-advertising-limits>summary{font-size:12px;color:var(--muted);cursor:pointer;padding:8px 0 16px}
@media(max-width:640px){.campaign-table-toolbar{gap:12px;padding:14px 16px}.campaign-table-toolbar .search-field{flex-basis:160px;width:160px}.campaign-breadcrumb{gap:7px}}

.product-image-remove>svg{display:block;flex-shrink:0}
.product-image-remove:focus-visible{outline:2px solid var(--focus-ring);outline-offset:2px}

/* A quiet canvas behind the workspace; cards and navigation keep solid surfaces. */
.app-body {
 background-color:var(--bg);
 background-image:radial-gradient(circle,color-mix(in srgb,var(--ink) 14%,transparent) .8px,transparent .8px);
 background-attachment:fixed;
 background-position:center;
 background-size:16px 16px;
}

/* Overview is a short daily feed; setup replaces it until all essentials are ready. */
.overview-heading h1 {margin-top:0}
.overview-all-clear {max-width:720px;margin:26px auto 0;color:var(--muted);font-size:var(--type-small)}
.overview-activity-feed {display:grid;gap:20px}
.overview-activity-card {padding:20px}
.overview-activity-card+.overview-activity-card {border:1px solid var(--line)}
.overview-activity-card:hover {background:var(--subtle-bg)}
.overview-heading+.getting-started {margin-top:0}
@media(max-width:640px){.overview-activity-card {padding:18px 16px}}

/* Story cards share one left edge; recent activity is a quieter reading surface. */
.overview-attention-feed,.overview-activity-feed {display:grid;gap:20px}
.overview-feed-card {display:grid;gap:10px;padding:20px;border-radius:10px;background:var(--surface);min-width:0}
.feed-card-header {display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:17px;margin-bottom:2px}
.feed-card-context {font-size:12px;line-height:1.6;color:var(--muted);min-width:0;overflow-wrap:anywhere}
.feed-card-icon {display:grid;place-items:center;width:17px;height:17px;flex-shrink:0;color:var(--muted)}
#app .feed-card-title {font-family:var(--font);font-size:18px;font-weight:500;line-height:1.4;letter-spacing:0;margin:0}
.feed-card-title strong {font-weight:700}
#app .feed-card-description {font-size:14px;line-height:1.7;color:var(--muted);margin:0}
.feed-card-description strong {font-weight:500;color:var(--ink)}
.feed-card-change {display:flex;align-items:baseline;flex-wrap:wrap;gap:8px;font-size:var(--type-small);font-variant-numeric:tabular-nums;line-height:1.6;color:var(--muted)}
.feed-card-change strong {color:var(--ink);font-weight:600}
.feed-card-change small {font-size:var(--type-caption);font-weight:400;margin-left:3px;color:var(--muted)}
.feed-change-arrow {color:var(--muted)}
.feed-change-note {font-size:var(--type-caption);color:var(--muted);margin-left:3px}
.feed-card-meta {font-size:var(--type-caption);line-height:1.6;color:var(--muted);margin:0}
.feed-card-footer {display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:8px}
.feed-card-actions {display:flex;align-items:center;gap:14px;min-width:0;margin-left:auto;flex-shrink:0}
.feed-card-actions>.btn {padding:9px 14px;min-height:36px;font-size:var(--type-small)}
.feed-card-actions>.text-btn {font-size:var(--type-small);padding:9px 12px;min-height:36px}
.feed-needs-review .feed-card-icon {color:var(--action-error);background:var(--action-error-bg)}
.feed-completed {background:var(--subtle-bg);border-color:var(--line)}
.feed-completed .feed-card-icon {color:var(--muted)}
#app .feed-completed .feed-card-title {font-size:16px;color:var(--ink-secondary)}
#app .feed-completed .feed-card-description {font-size:13px}
#app .overview-activity>.actions-section-heading h2 {font-size:15px;font-weight:500;color:var(--muted)}
.feed-card-error {font-size:var(--type-small);color:var(--action-error);margin:0}
.feed-expand {display:flex;justify-content:center;margin-top:10px}
.feed-expand .text-btn {font-size:var(--type-small)}
@media(max-width:640px){
 .overview-feed-card {padding:17px 16px}
 #app .feed-card-title {font-size:18px}
 .feed-card-footer {display:block}
 .feed-card-actions {display:grid;grid-template-columns:1fr 2fr;gap:12px;margin-left:0;width:100%}
 .feed-card-footer>.feed-card-change {margin-bottom:12px}
 .feed-card-actions>.btn,.feed-card-actions>.text-btn {min-height:44px;width:100%}
 .feed-card-actions>:only-child {grid-column:1/-1}
}

/* Recent activity keeps its outcome compact beneath the full-width explanation. */
.feed-activity-footer {flex-wrap:wrap;align-items:baseline;gap:10px 20px}
.feed-activity-footer>.feed-card-meta {margin-left:auto;text-align:right}
.feed-activity-result {display:flex;align-items:baseline;flex-wrap:wrap;gap:8px;min-width:0;overflow-wrap:anywhere;font-size:var(--type-small);line-height:1.6;font-variant-numeric:tabular-nums}
.feed-result-label,.feed-result-previous {font-size:var(--type-caption);line-height:1.6;color:var(--muted)}
.feed-result-value {font-size:var(--type-small);line-height:1.6;color:var(--ink);font-weight:600;font-variant-numeric:tabular-nums}
@media(max-width:640px){
 .feed-activity-footer {display:flex;flex-direction:column;align-items:flex-start;gap:10px}
 .feed-activity-footer>.feed-card-meta {margin-left:0;text-align:left}
}
/* Keep the growth mark aligned with the wordmark. */
.brand{gap:10px;min-height:1.25em}
.sidebar .brand{display:inline-grid;grid-template-columns:28px auto;column-gap:10px;padding-inline:12px}
.sidebar .brand-symbol{justify-self:center}
.brand .brand-symbol{display:block;flex:0 0 auto;align-self:center;width:auto;height:.825em;object-fit:contain;transform:translateY(.02em)}
.brand .brand-name{display:block;flex:0 0 auto;align-self:center;font:inherit;letter-spacing:inherit}

.sidebar>nav .campaigns-toggle.campaigns-current{color:var(--ink);font-weight:600}
.campaigns-toggle[aria-expanded=true] .settings-chevron{transform:rotate(180deg)}

/* Asset groups show text and media side by side, with complete copy. */
.pmax-assets { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px;align-items:start; }
.pmax-copy-assets,.pmax-media-section { min-width:0; }
.pmax-asset-section + .pmax-asset-section { margin-top:24px;padding-top:24px;border-top:1px solid var(--line); }
.pmax-asset-section h3 { margin:0 0 12px;font-size:var(--type-subheading); }
.pmax-text-assets { display:grid;grid-template-columns:minmax(0,1fr);gap:8px;list-style:none;padding:0;margin:0; }
.pmax-text-assets li { padding:12px 14px;border:1px solid var(--line);border-radius:6px;background:var(--surface);font-size:var(--type-body);line-height:1.7;overflow-wrap:anywhere; }
.pmax-assets-empty { margin:0;color:var(--muted);font-size:var(--type-small);line-height:1.7; }
.pmax-media-assets { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;align-items:start; }
.pmax-media-asset { margin:0;min-width:0;width:100%; }
.pmax-media-asset .product-image-tile { width:100%;height:auto;aspect-ratio:1;flex-basis:auto;border-radius:10px; }
.pmax-media-preview { position:relative;width:100%;height:100%;aspect-ratio:1;background:var(--soft);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;color:var(--muted); }
.pmax-media-preview img { position:absolute;inset:0;width:100%;height:100%;object-fit:contain;background:var(--soft); }
.pmax-media-preview img[hidden] { display:none; }
.pmax-media-preview > svg { width:20px;height:20px; }
.pmax-preview-unavailable { font-size:10px;text-align:center;max-width:90%; }
.pmax-media-asset figcaption { margin-top:8px;font-size:var(--type-small);color:var(--muted); }
@media(max-width:640px) { .pmax-assets { grid-template-columns:minmax(0,1fr); } }

.meta-ad-video { display:block;width:100%;max-height:460px;border-radius:10px;background:var(--soft); }

/* Narrow creative drawers: selected media, thumbnail picker, then full copy. */
.creative-assets { min-width:0; }
.creative-copy { margin-top:24px; }
.creative-gallery-stage { position:relative;width:100%;aspect-ratio:4/3;max-height:320px;display:flex;align-items:center;justify-content:center;overflow:hidden;background:var(--soft);border:1px solid var(--line);border-radius:8px; }
.creative-gallery-stage .creative-gallery-main-image,.creative-gallery-stage video,.creative-gallery-stage iframe { display:block;width:100%;height:100%;max-height:320px;object-fit:contain;border:0; }
.creative-gallery-stage [hidden] { display:none; }
.creative-gallery-stage [data-gallery-unavailable] { color:var(--muted);font-size:var(--type-small); }
.creative-gallery-caption { margin:8px 0;color:var(--muted);font-size:var(--type-small); }
.creative-gallery-thumbs { display:flex;flex-wrap:wrap;gap:8px;margin-top:10px; }
.creative-gallery-thumb { position:relative;display:flex;align-items:center;justify-content:center;width:60px;height:60px;flex:0 0 60px;padding:3px;border:1px solid var(--line);border-radius:6px;background:var(--soft);overflow:hidden; }
.creative-gallery-thumb img { width:100%;height:100%;object-fit:contain; }
.creative-gallery-thumb[aria-pressed="true"] { border:2px solid var(--primary);padding:2px; }
.creative-gallery-thumb > span { position:absolute;padding:3px 5px;border-radius:4px;background:#172033bb;color:#fff;font-size:12px; }
.creative-gallery-play { position:absolute;width:54px;height:54px;border-radius:50%;border:0;background:#172033cc;color:#fff;font-size:22px; }

.creative-video { position:relative;width:100%;height:100%;background:var(--soft); }
.creative-video-overlay { position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:grid;place-items:center;width:54px;height:54px;border:0;border-radius:50%;background:var(--primary);color:#fff;font-size:21px;box-shadow:0 3px 16px #0002; }
.creative-video-controls { position:absolute;left:0;right:0;bottom:0;display:flex;align-items:center;gap:8px;padding:9px 10px;background:var(--surface);border-top:1px solid var(--line);color:var(--ink); }
.creative-video-controls[hidden],.creative-video-overlay[hidden] { display:none; }
.creative-video-controls button { display:grid;place-items:center;flex:0 0 28px;height:28px;padding:5px;border:0;border-radius:5px;background:transparent;color:var(--muted);font-size:15px;line-height:1; }
.creative-video-controls button:hover,.creative-video-controls .is-muted { background:var(--soft);color:var(--ink); }
.creative-video-controls svg { display:block;width:18px;height:18px;pointer-events:none; }
.creative-video-controls input[type="range"] { flex:1;min-width:30px;accent-color:var(--primary);height:4px;cursor:pointer; }
.creative-video-controls input[type="range"]:focus { outline:none;box-shadow:none; }
.creative-video-controls input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow:0 0 0 3px var(--focus-ring); }
.creative-video-controls input[type="range"]:focus-visible::-moz-range-thumb { box-shadow:0 0 0 3px var(--focus-ring); }
.creative-video-controls [data-player-time] { font-size:10px;white-space:nowrap;color:var(--muted); }
.creative-video:fullscreen { display:flex;align-items:center;justify-content:center;background:#000; }
.creative-video:fullscreen video { width:100%;height:100%;max-height:none; }

.creative-gallery-empty { flex-direction:column;gap:12px;color:var(--muted);font-size:var(--type-small);text-align:center;padding:24px; }
.creative-gallery-empty > svg { width:36px;height:36px;opacity:.7; }

.campaign-table-surface .table-wrap .empty-state{border:0;background:transparent;border-radius:0}
.campaign-table-surface .table-wrap .empty-state>span{background:transparent;padding:0;margin-bottom:14px}

.campaign-table-surface .table-empty-row>td{padding:0;border:0;text-align:center}
