:root {
  --bg: #f5f7f9;
  --surface: #ffffff;
  --surface-soft: #eef3f6;
  --line: #dce3e8;
  --text: #17212b;
  --muted: #66717d;
  --green: #16815a;
  --green-soft: #e4f5ee;
  --blue: #2367d1;
  --blue-soft: #e8f0ff;
  --amber: #9a6800;
  --amber-soft: #fff3d7;
  --rose: #b33a4a;
  --rose-soft: #ffe8ec;
  --shadow: 0 18px 50px rgba(23, 33, 43, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 22px;
  background: #101820;
  color: #f6fbff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: #d9f99d;
  color: #17212b;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 2px;
  color: #aab8c5;
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #c7d2dd;
  text-align: left;
  padding: 0 12px;
}

.nav-item.is-active,
.nav-item:hover {
  background: #243240;
  color: #ffffff;
}

.identity {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.identity label {
  color: #aab8c5;
  font-size: 12px;
}

.identity input,
.form-panel input,
.form-panel textarea,
.filter-panel input,
.filter-panel select,
.filter-panel textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #ffffff;
  color: var(--text);
}

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

.topbar,
.section-head,
.panel-head,
.actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 22px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.15;
}

h2 {
  font-size: 20px;
  line-height: 1.2;
}

h3 {
  font-size: 16px;
  line-height: 1.25;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.status-strip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-dot,
.plan-pill,
.count-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.status-dot.is-ok {
  color: var(--green);
  background: var(--green-soft);
  border-color: #bfe7d7;
}

.status-dot.is-loading,
.status-dot.is-partial {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: #f4d58b;
}

.status-dot.is-error,
.form-status.is-error {
  color: var(--rose);
}

.plan-pill {
  color: var(--blue);
  background: var(--blue-soft);
}

.view {
  display: none;
}

.view.is-visible {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.metric {
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 12px;
  font-size: 28px;
  line-height: 1;
}

.metric em {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 14px;
}

.panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-wide {
  grid-column: 1 / -1;
}

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

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

.button,
.icon-button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--text);
  color: #ffffff;
  font-weight: 700;
}

.button-secondary,
.icon-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.button-danger {
  background: var(--rose);
}

.button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.bars {
  display: grid;
  align-items: end;
  grid-template-columns: repeat(30, minmax(6px, 1fr));
  gap: 5px;
  min-height: 180px;
  margin-top: 18px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.bar {
  min-height: 6px;
  border-radius: 4px 4px 0 0;
  background: var(--blue);
}

.step-list,
.stack-list,
.table-list,
.limit-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.row,
.stack-item,
.step,
.limit-row {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.row {
  grid-template-columns: minmax(140px, 1.3fr) repeat(3, minmax(90px, 0.7fr));
  align-items: center;
}

.row strong,
.stack-item strong,
.step strong {
  font-size: 14px;
}

.row span,
.stack-item span,
.step span,
.limit-row span {
  color: var(--muted);
  font-size: 12px;
}

.stack-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.stack-item button {
  min-width: 92px;
}

.stack-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 260px;
}

.stack-actions .mini-button {
  min-width: 76px;
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.stack-actions .mini-select {
  width: 132px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  background: #ffffff;
  font-size: 12px;
}

.step.is-done {
  background: var(--green-soft);
  border-color: #bfe7d7;
}

.section-head {
  margin: 4px 0 14px;
}

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

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

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

.compact-filter {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

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

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

.compact-metadata {
  margin: 8px 0 4px;
}

.filter-grid .check-label {
  align-content: end;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 60px;
}

.filter-grid .check-label input {
  width: auto;
  min-height: auto;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.channel-edit {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(160px, 1.2fr);
  gap: 8px;
  margin-top: 10px;
}

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

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

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

.saved-filter-item span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.catalog-view-toolbar {
  display: grid;
  align-items: end;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
}

.catalog-view-toolbar label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.estimate-note {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.catalog-view-toolbar select,
.drawer-form input,
.drawer-form textarea,
.active-view-card input,
.active-view-card textarea,
.member-add-form input,
.member-add-form select,
.member-row select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

.access-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.access-badge[data-role="owner"] {
  border-color: #b7d8c7;
  background: var(--green-soft);
  color: var(--green);
}

.access-badge[data-role="editor"] {
  border-color: #b9d0ef;
  background: var(--blue-soft);
  color: var(--blue);
}

.catalog-view-drawer {
  position: fixed;
  z-index: 30;
  inset: 0 0 0 auto;
  width: min(420px, 100vw);
  height: 100dvh;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  padding: 20px;
  background: var(--surface);
  box-shadow: -20px 0 48px rgba(23, 33, 43, 0.18);
}

.catalog-view-drawer[hidden] {
  display: none;
}

.catalog-view-drawer [hidden] {
  display: none;
}

.drawer-head,
.drawer-section-head,
.view-meta-row,
.member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.drawer-copy {
  margin: 10px 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.drawer-form,
.active-view-card,
.drawer-empty {
  display: grid;
  gap: 10px;
}

.drawer-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.drawer-empty,
.active-view-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
}

.drawer-empty span,
.active-view-card > span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.active-view-card label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.compact-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.danger-icon {
  border-color: #efb9c1;
  color: var(--rose);
}

.member-add-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px auto;
  gap: 8px;
  margin-top: 10px;
}

.member-list {
  display: grid;
  margin-top: 10px;
}

.member-row {
  min-height: 54px;
  border-top: 1px solid var(--line);
  padding: 8px 0;
}

.member-row:first-child {
  border-top: 0;
}

.member-row > span:first-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.member-row strong,
.member-row small {
  overflow-wrap: anywhere;
}

.member-row small {
  color: var(--muted);
}

.member-row select {
  width: 96px;
}

@media (min-width: 1440px) {
  .main {
    transition: margin-right 160ms ease;
  }

  .catalog-drawer-open .main {
    margin-right: 420px;
  }
}

.bulk-toolbar {
  display: grid;
  align-items: center;
  grid-template-columns: auto minmax(90px, auto) minmax(150px, 1fr) minmax(130px, 1fr) minmax(150px, 1fr) auto;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.bulk-select-all,
.catalog-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.bulk-select-all input,
.catalog-select input {
  width: auto;
  min-height: auto;
}

.catalog-select {
  margin-bottom: 4px;
}

.scorecard-summary {
  border-color: #b9d0ef;
  background: var(--blue-soft);
}

.history-item {
  background: #ffffff;
}

.placement-documents {
  margin-top: 8px;
}

.placement-documents summary {
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.placement-document-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.placement-document-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.placement-document-row a {
  min-width: 0;
  overflow-wrap: anywhere;
}

.placement-document-form {
  display: grid;
  grid-template-columns: minmax(90px, 0.65fr) minmax(110px, 0.9fr) minmax(160px, 1.45fr) 34px;
  gap: 6px;
  margin-top: 8px;
}

.placement-document-form input,
.placement-document-form select {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 12px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.stack-item .document-remove {
  width: 26px;
  min-width: 26px;
  height: 26px;
  color: var(--red);
}

.stack-item .document-add {
  width: 34px;
  min-width: 34px;
}

.form-status {
  min-height: 18px;
  color: var(--green);
  font-size: 12px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 14px 0;
}

.segmented button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 700;
}

.segmented button.is-active {
  background: var(--blue-soft);
  border-color: #b8cdfa;
  color: var(--blue);
}

.limit-row {
  grid-template-columns: minmax(120px, 1fr) minmax(100px, auto);
}

.empty {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #ffffff;
  font-size: 13px;
}

.empty.is-error {
  border-color: #f2b8c1;
  color: var(--rose);
  background: var(--rose-soft);
}

.marketing-page {
  background: #f7f9fb;
  overflow-x: hidden;
}

.landing-nav {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 0 clamp(20px, 5vw, 72px);
  color: #eef6fb;
}

.landing-brand,
.landing-nav nav,
.hero-actions,
.hero-proof {
  display: flex;
  align-items: center;
}

.landing-brand {
  gap: 12px;
  font-weight: 800;
}

.landing-nav nav {
  gap: 20px;
  color: #c7d2dd;
  font-size: 14px;
  font-weight: 700;
}

.landing-nav nav a:hover {
  color: #ffffff;
}

.landing-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  min-height: min(820px, 88svh);
  overflow: hidden;
  padding: 112px clamp(20px, 5vw, 72px) 74px;
  background: #0f1923;
  color: #f7fbff;
}

.landing-hero::after {
  position: absolute;
  inset: 0;
  content: "";
  background: rgba(15, 25, 35, 0.38);
}

.hero-scene {
  position: absolute;
  inset: 72px clamp(16px, 5vw, 80px) 28px 46%;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(170px, 0.42fr);
  grid-template-rows: 1fr 1fr;
  gap: 14px;
  opacity: 0.92;
}

.scene-panel {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(245, 249, 251, 0.96);
  color: #17212b;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.scene-panel-main {
  grid-row: span 2;
  padding: 18px;
}

.scene-panel-side,
.scene-panel-action {
  align-content: center;
  display: grid;
  gap: 8px;
  padding: 18px;
}

.scene-panel-side strong,
.scene-panel-action strong {
  font-size: 28px;
}

.scene-label,
.scene-topline span,
.scene-panel-side span:last-child,
.scene-panel-action span:last-child {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.scene-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.scene-topline strong {
  color: var(--green);
}

.scene-feed {
  display: grid;
  gap: 9px;
  margin: 24px 0;
}

.feed-line {
  display: block;
  width: 82%;
  height: 12px;
  border-radius: 6px;
  background: #dce3e8;
}

.feed-line-strong {
  width: 96%;
  background: #bfe7d7;
}

.feed-line-short {
  width: 58%;
}

.scene-chart {
  display: grid;
  align-items: end;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  min-height: 240px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.scene-chart span {
  display: block;
  border-radius: 6px 6px 0 0;
  background: #2367d1;
}

.hero-copy {
  position: relative;
  z-index: 1;
  width: min(100%, 600px);
  min-width: 0;
}

.hero-copy h1 {
  max-width: 100%;
  font-size: clamp(52px, 6.2vw, 90px);
  line-height: 0.92;
}

.hero-lead {
  max-width: 560px;
  margin-top: 22px;
  color: #dbe6ee;
  font-size: clamp(18px, 2.1vw, 24px);
  line-height: 1.42;
  overflow-wrap: break-word;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.landing-primary {
  display: inline-flex;
  align-items: center;
  background: #d9f99d;
  color: #17212b;
}

.landing-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #f7fbff;
  border-color: rgba(255, 255, 255, 0.24);
}

.hero-proof {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.hero-proof span {
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: #c7d2dd;
  font-size: 13px;
  font-weight: 700;
}

.landing-band,
.landing-section,
.landing-cta {
  padding: 58px clamp(20px, 5vw, 72px);
}

.metrics-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: #dce3e8;
}

.metrics-band div {
  display: grid;
  gap: 8px;
  min-height: 120px;
  align-content: center;
  padding: 22px;
  background: #ffffff;
}

.metrics-band strong {
  font-size: 28px;
}

.metrics-band span {
  color: var(--muted);
  font-size: 14px;
}

.landing-section {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(28px, 5vw, 76px);
  align-items: start;
  background: #f7f9fb;
}

.section-copy {
  display: grid;
  gap: 16px;
  max-width: 560px;
}

.section-copy h2,
.landing-cta h2 {
  font-size: clamp(30px, 4.2vw, 56px);
  line-height: 1;
}

.section-copy p,
.landing-cta p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

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

.loop-card,
.pricing-table div {
  display: grid;
  gap: 12px;
  min-height: 220px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: #ffffff;
}

.loop-index {
  color: var(--green);
  font-weight: 800;
}

.loop-card p,
.pricing-table p {
  color: var(--muted);
  line-height: 1.45;
}

.landing-split {
  background: #ffffff;
}

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

.pricing-table div:nth-child(2) {
  border-color: #bfe7d7;
  background: var(--green-soft);
}

.pricing-table span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.pricing-table strong {
  font-size: 25px;
}

.landing-cta {
  display: grid;
  gap: 18px;
  justify-items: start;
  background: #101820;
  color: #f7fbff;
}

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

  .sidebar {
    position: static;
  }

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

  .identity {
    grid-template-columns: repeat(3, 1fr);
    align-items: end;
  }

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

  .hero-scene {
    inset: 92px 20px 28px 28%;
    opacity: 0.55;
  }

  .metrics-band,
  .landing-section {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .loop-grid,
  .pricing-table {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .main {
    padding: 16px;
  }

  .topbar,
  .section-head,
  .panel-head,
  .actions-row {
    align-items: stretch;
    flex-direction: column;
  }

  .content-grid,
  .channel-edit,
  .catalog-view-toolbar,
  .member-add-form,
  .filter-grid,
  .bulk-toolbar,
  .placement-document-form,
  .metric-grid,
  .identity,
  .nav {
    grid-template-columns: 1fr;
  }

  .catalog-view-drawer {
    padding: 16px;
  }

  .row,
  .saved-filter-item,
  .stack-item,
  .limit-row {
    grid-template-columns: 1fr;
  }

  .stack-actions {
    justify-content: flex-start;
    max-width: none;
  }

  .landing-nav {
    position: static;
    flex-direction: column;
    align-items: stretch;
    min-height: auto;
    padding: 18px 16px;
    background: #0f1923;
  }

  .landing-nav nav {
    flex-wrap: wrap;
    gap: 12px;
  }

  .landing-hero {
    width: 100%;
    max-width: 100vw;
    min-height: 86svh;
    padding: 44px 16px 48px;
  }

  .landing-hero::after {
    background: rgba(15, 25, 35, 0.88);
  }

  .hero-scene {
    inset: auto -120px 18px 14px;
    grid-template-columns: minmax(260px, 1fr);
    grid-template-rows: auto;
    opacity: 0.38;
    transform: rotate(-1deg);
  }

  .scene-panel-main {
    grid-row: auto;
  }

  .scene-panel-side,
  .scene-panel-action {
    display: none;
  }

  .hero-copy h1 {
    font-size: clamp(40px, 12vw, 50px);
  }

  .hero-copy,
  .hero-lead {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
  }

  .hero-lead {
    font-size: 16px;
    line-height: 1.5;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions .button {
    justify-content: center;
    width: 100%;
  }

  .hero-proof {
    align-items: stretch;
    flex-direction: column;
  }

  .landing-band,
  .landing-section,
  .landing-cta {
    padding: 40px 16px;
  }

  .metrics-band,
  .landing-section {
    grid-template-columns: 1fr;
  }

  .metrics-band div,
  .loop-card,
  .pricing-table div {
    min-height: auto;
  }
}

/* App workspace: 2026 operational dashboard */
.app-body {
  --bg: #f3f5f6;
  --surface: #ffffff;
  --surface-soft: #f7f9f9;
  --line: #dfe4e3;
  --line-strong: #cbd3d1;
  --text: #171c1b;
  --muted: #68716f;
  --green: #147a61;
  --green-soft: #e2f3ed;
  --blue: #2869d8;
  --blue-soft: #e9f0ff;
  --amber: #9a6700;
  --amber-soft: #fff2cf;
  --rose: #b43b4b;
  --rose-soft: #fdebed;
  --accent: #2563eb;
  --sidebar: #ffffff;
  --sidebar-soft: #202927;
  --shadow: 0 1px 2px rgba(20, 31, 28, 0.04);
  min-width: 320px;
  background: var(--bg);
}

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

.app-body .shell {
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100dvh;
}

.app-body .sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 100dvh;
  gap: 18px;
  padding: 20px 16px;
  border-right: 1px solid #26302e;
  background: var(--sidebar);
}

.app-body .brand {
  min-height: 48px;
  gap: 10px;
  padding: 0 4px;
}

.app-body .brand-mark {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  width: 36px;
  height: 36px;
  padding: 8px;
  border: 1px solid rgba(37, 99, 235, 0.45);
  border-radius: 7px;
  background: var(--accent);
}

.app-body .brand-mark i {
  display: block;
  width: 4px;
  border-radius: 2px 2px 0 0;
  background: #17201e;
}

.app-body .brand-mark i:nth-child(1) { height: 8px; }
.app-body .brand-mark i:nth-child(2) { height: 14px; }
.app-body .brand-mark i:nth-child(3) { height: 19px; }

.app-body .brand strong {
  font-size: 15px;
  letter-spacing: 0;
}

.app-body .brand span {
  max-width: 150px;
  margin-top: 3px;
  color: #8f9a97;
  font-size: 11px;
  line-height: 1.25;
}

.app-body .sidebar-label {
  margin: 10px 10px 0;
  color: #71807c;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.app-body .nav {
  gap: 4px;
}

.app-body .nav-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  min-height: 44px;
  gap: 8px;
  border: 1px solid transparent;
  padding: 0 10px;
  color: #b8c2bf;
  font-size: 13px;
  font-weight: 650;
}

.app-body .nav-item:hover {
  background: var(--sidebar-soft);
  color: #ffffff;
}

.app-body .nav-item.is-active {
  border-color: rgba(37, 99, 235, 0.28);
  background: var(--accent);
  color: #17201e;
}

.app-body .nav-index {
  color: #71807c;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.app-body .nav-item.is-active .nav-index {
  color: #4d5c2a;
}

.app-body .identity {
  gap: 7px;
  padding: 14px 10px 0;
  border-color: #2b3533;
}

.app-body .identity-head {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  margin-bottom: 6px;
}

.app-body .identity-head strong,
.app-body .identity-head span {
  display: block;
}

.app-body .identity-head strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-body .identity-head div > span {
  margin-top: 2px;
  color: #7f8c88;
  font-size: 10px;
}

.app-body .identity-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 7px;
  background: #2a3532;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
}

.app-body .identity label {
  color: #7f8c88;
  font-size: 10px;
}

.app-body .identity input {
  min-height: 34px;
  border-color: #35413e;
  background: #1b2422;
  color: #eef3f1;
  font-size: 12px;
}

.app-body .identity .button-secondary {
  min-height: 34px;
  border-color: #3b4845;
  background: transparent;
  color: #e7eeeb;
  font-size: 12px;
}

.app-body .main {
  min-width: 0;
  padding: 0 32px 48px;
}

.app-body .topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  min-height: 112px;
  margin: 0 -32px 22px;
  padding: 22px 32px 18px;
  border-bottom: 1px solid rgba(203, 211, 209, 0.85);
  background: rgba(243, 245, 246, 0.94);
  backdrop-filter: blur(14px);
}

.app-body .topbar-copy {
  min-width: 0;
}

.app-body h1 {
  font-size: 27px;
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: 0;
}

.app-body h2 {
  font-size: 17px;
  font-weight: 720;
  line-height: 1.25;
}

.app-body h3 {
  font-size: 15px;
}

.app-body .eyebrow,
.app-body .panel-kicker {
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.app-body .page-summary {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.app-body .topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.app-body .status-strip {
  gap: 6px;
}

.app-body .status-dot,
.app-body .plan-pill,
.app-body .count-badge,
.app-body .access-badge {
  min-height: 28px;
  border-radius: 6px;
  padding: 0 9px;
  font-size: 11px;
}

.app-body .status-dot::before {
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.app-body .plan-pill {
  color: #42504c;
  background: #ffffff;
}

.app-body .range-control {
  min-width: 166px;
}

.app-body .segmented {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #e9edec;
}

.app-body .segmented button {
  min-height: 30px;
  border: 0;
  border-radius: 5px;
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.app-body .segmented button.is-active,
.app-body .segmented button[aria-pressed="true"] {
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(20, 31, 28, 0.12);
}

.app-body .view {
  width: min(100%, 1440px);
  margin: 0 auto;
}

.app-body .metric-grid {
  overflow: hidden;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.app-body .metric {
  position: relative;
  min-height: 128px;
  padding: 17px 18px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

.app-body .metric:last-child {
  border-right: 0;
}

.app-body .metric::before {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
  content: "";
}

.app-body .metric[data-tone="positive"]::before { background: var(--green); }
.app-body .metric[data-tone="attention"]::before { background: #e0a31b; }
.app-body .metric[data-tone="info"]::before { background: var(--blue); }

.app-body .metric span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.app-body .metric strong {
  margin-top: 18px;
  font-size: 27px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.app-body .metric em {
  margin-top: 10px;
  color: #89918f;
  font-size: 10px;
}

.app-body .content-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}

.app-body .content-grid > .panel:not(.panel-wide):not(.panel-chart):not(.panel-onboarding):not(.panel-sources):not(.panel-signals) {
  grid-column: span 6;
}

.app-body .panel-wide { grid-column: 1 / -1; }
.app-body .panel-chart { grid-column: span 8; }
.app-body .panel-onboarding { grid-column: span 4; }
.app-body .panel-sources { grid-column: span 8; }
.app-body .panel-signals { grid-column: span 4; }

.app-body .panel {
  min-width: 0;
  padding: 18px;
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.app-body .panel-head {
  min-height: 34px;
}

.app-body .panel-head > div:first-child {
  min-width: 0;
}

.app-body .panel-kicker {
  margin-bottom: 5px;
}

.app-body .chart-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 22px;
}

.app-body .chart-meta strong {
  font-size: 23px;
  font-variant-numeric: tabular-nums;
}

.app-body .chart-meta span {
  color: var(--muted);
  font-size: 11px;
}

.app-body .bars {
  position: relative;
  min-height: 184px;
  gap: 4px;
  margin-top: 14px;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
  background-image: linear-gradient(to bottom, transparent 32%, var(--line) 33%, transparent 34%, transparent 65%, var(--line) 66%, transparent 67%);
}

.app-body .bar {
  min-height: 4px;
  border-radius: 3px 3px 1px 1px;
  background: var(--green);
  opacity: 0.88;
  transition: opacity 150ms ease;
}

.app-body .bar:hover { opacity: 1; }

.app-body .button,
.app-body .icon-button {
  min-height: 36px;
  border-radius: 7px;
  padding: 0 13px;
  background: #19211f;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.app-body .button:hover,
.app-body .icon-button:hover {
  background: #2c3835;
}

.app-body .button-secondary,
.app-body .icon-button {
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--text);
}

.app-body .button-secondary:hover,
.app-body .icon-button:hover {
  border-color: #aeb9b6;
  background: var(--surface-soft);
}

.app-body .button-danger {
  background: var(--rose);
  color: #ffffff;
}

.app-body input,
.app-body select,
.app-body textarea,
.app-body .catalog-view-toolbar select,
.app-body .drawer-form input,
.app-body .drawer-form textarea,
.app-body .active-view-card input,
.app-body .active-view-card textarea,
.app-body .member-add-form input,
.app-body .member-add-form select,
.app-body .member-row select {
  border-color: var(--line-strong);
  border-radius: 7px;
  background: #ffffff;
  color: var(--text);
  outline: none;
}

.app-body input:focus,
.app-body select:focus,
.app-body textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(20, 122, 97, 0.11);
}

.app-body .step-list,
.app-body .stack-list,
.app-body .table-list,
.app-body .limit-list {
  gap: 0;
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.app-body .row,
.app-body .stack-item,
.app-body .step,
.app-body .limit-row,
.app-body .member-row {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 12px 8px;
  background: transparent;
}

.app-body .row:last-child,
.app-body .stack-item:last-child,
.app-body .step:last-child,
.app-body .limit-row:last-child,
.app-body .member-row:last-child {
  border-bottom: 0;
}

.app-body .step.is-done {
  position: relative;
  padding-left: 28px;
  border-color: var(--line);
  background: transparent;
}

.app-body .step.is-done::before {
  position: absolute;
  top: 14px;
  left: 8px;
  display: grid;
  width: 13px;
  height: 13px;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  border: 3px solid #ffffff;
  content: "";
}

.app-body .table-head {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.app-body .table-head strong {
  color: var(--muted);
  font-size: 9px;
}

.app-body .empty {
  min-height: 92px;
  align-content: center;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--muted);
  text-align: center;
}

.app-body .section-head {
  min-height: 54px;
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.app-body .form-panel,
.app-body .filter-panel {
  gap: 11px;
}

.app-body .content-grid > .form-panel {
  align-self: start;
}

.app-body .catalog-view-toolbar,
.app-body .bulk-toolbar {
  border-color: var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.app-body .tag-pill,
.app-body .access-badge {
  border-radius: 5px;
}

.app-body .catalog-view-drawer {
  width: min(440px, 100vw);
  border-color: var(--line);
  padding: 22px;
  background: #ffffff;
  box-shadow: -18px 0 50px rgba(18, 25, 24, 0.16);
}

@media (max-width: 1100px) {
  .app-body .shell { grid-template-columns: 1fr; }

  .app-body .sidebar {
    position: static;
    height: auto;
    padding: 14px 18px;
  }

  .app-body .sidebar-label { display: none; }
  .app-body .nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  .app-body .identity {
    grid-template-columns: minmax(180px, 1fr) repeat(2, minmax(160px, 1fr)) auto;
    margin-top: 0;
    padding: 12px 0 0;
  }

  .app-body .identity-head { margin: 0; }
  .app-body .identity label { display: none; }
  .app-body .main { padding-top: 0; }
  .app-body .topbar { top: 0; }
  .app-body .panel-chart,
  .app-body .panel-sources { grid-column: span 7; }
  .app-body .panel-onboarding,
  .app-body .panel-signals { grid-column: span 5; }
}

@media (max-width: 760px) {
  .app-body .sidebar {
    gap: 10px;
    padding: 12px;
  }

  .app-body .brand { min-height: 40px; }
  .app-body .brand-mark { width: 32px; height: 32px; padding: 7px; }
  .app-body .brand span { display: none; }

  .app-body .nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .app-body .nav::-webkit-scrollbar { display: none; }

  .app-body .nav-item {
    flex: 0 0 auto;
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 38px;
    padding: 0 10px;
    white-space: nowrap;
  }

  .app-body .identity {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding-top: 10px;
  }

  .app-body .identity-head { display: none; }
  .app-body .identity .button-secondary { grid-column: 1 / -1; }

  .app-body .main { padding: 0 12px 32px; }

  .app-body .topbar {
    position: static;
    align-items: stretch;
    min-height: 0;
    margin: 0 -12px 14px;
    padding: 18px 12px 14px;
  }

  .app-body .topbar-actions {
    align-items: stretch;
    flex-direction: column;
    margin-top: 14px;
  }

  .app-body .status-strip { justify-content: flex-start; }
  .app-body .range-control { width: 100%; }
  .app-body h1 { font-size: 23px; }
  .app-body .page-summary { line-height: 1.4; }

  .app-body .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-body .metric {
    min-height: 112px;
    padding: 14px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .app-body .metric:nth-child(2n) { border-right: 0; }
  .app-body .metric:nth-last-child(-n + 2) { border-bottom: 0; }
  .app-body .metric strong { margin-top: 14px; font-size: 23px; }

  .app-body .content-grid { grid-template-columns: 1fr; }
  .app-body .content-grid > .panel,
  .app-body .content-grid > .panel:not(.panel-wide):not(.panel-chart):not(.panel-onboarding):not(.panel-sources):not(.panel-signals),
  .app-body .panel-wide,
  .app-body .panel-chart,
  .app-body .panel-onboarding,
  .app-body .panel-sources,
  .app-body .panel-signals { grid-column: 1; }

  .app-body .panel { padding: 14px; }
  .app-body .panel-head { align-items: flex-start; }
  .app-body .panel-head .icon-button { align-self: flex-start; }
  .app-body .bars { gap: 2px; min-height: 160px; }

  .app-body .row,
  .app-body .saved-filter-item,
  .app-body .stack-item,
  .app-body .limit-row { grid-template-columns: 1fr; }

  .app-body .filter-grid,
  .app-body .catalog-view-toolbar,
  .app-body .member-add-form,
  .app-body .bulk-toolbar,
  .app-body .placement-document-form { grid-template-columns: 1fr; }
}

.app-body .page-row.is-selected {
  background: rgba(37, 99, 235, 0.12);
}

.app-body .page-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.app-body .page-actions a {
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
}

.app-body .campaign-workspace {
  padding: 0;
  overflow: hidden;
}

.app-body .campaign-head {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.app-body .campaign-selector {
  display: grid;
  grid-template-columns: auto minmax(240px, 360px);
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.app-body .campaign-selector select {
  min-height: 36px;
}

.app-body .campaign-workspace > .form-status {
  padding: 0 18px;
}

.app-body .campaign-product {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  margin: 0 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.app-body .campaign-product > .empty {
  grid-column: 1 / -1;
  width: 100%;
}

.app-body .campaign-product > div > strong,
.app-body .campaign-product > div > span {
  display: block;
}

.app-body .campaign-product > div > strong {
  font-size: 13px;
}

.app-body .campaign-product > div > span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.app-body .campaign-market {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 7px;
  background: #6e3bdb;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
}

.app-body .campaign-product-meta {
  text-align: right;
}

.app-body .campaign-product-meta a {
  display: block;
  margin-top: 4px;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
}

.app-body .campaign-filter {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr)) auto;
  align-items: end;
  gap: 10px;
  padding: 14px 18px;
}

.app-body .campaign-filter label,
.app-body .compact-form label,
.app-body .comparison-form label,
.app-body .expense-row label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.app-body .campaign-filter input,
.app-body .campaign-filter select,
.app-body .compact-form input,
.app-body .compact-form select,
.app-body .comparison-form input,
.app-body .expense-row input {
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
}

.app-body .campaign-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.app-body .campaign-metric {
  min-width: 0;
  min-height: 106px;
  padding: 15px;
  border-right: 1px solid var(--line);
}

.app-body .campaign-metric:last-child {
  border-right: 0;
}

.app-body .campaign-metric span,
.app-body .campaign-metric strong,
.app-body .campaign-metric em {
  display: block;
}

.app-body .campaign-metric span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.app-body .campaign-metric span small {
  color: var(--amber);
  font-size: 8px;
  text-transform: uppercase;
}

.app-body .campaign-metric strong {
  overflow: hidden;
  margin-top: 13px;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-body .campaign-metric em {
  margin-top: 7px;
  color: #89918f;
  font-size: 9px;
  font-style: normal;
  line-height: 1.35;
}

.app-body .campaign-bars {
  min-height: 140px;
  overflow-x: auto;
  margin: 0;
  padding: 18px;
  border-top: 0;
}

.app-body .campaign-bars.is-empty {
  display: block;
}

.app-body .campaign-bars > .empty {
  width: 100%;
}

.app-body .panel-total {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.app-body .estimate-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border: 1px solid #e5c56d;
  border-radius: 5px;
  padding: 0 8px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.app-body .compact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.app-body .compact-form .form-span {
  grid-column: 1 / -1;
}

.app-body .expense-list {
  display: grid;
  gap: 0;
  margin-top: 8px;
  border-top: 1px solid var(--line);
}

.app-body .expense-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.app-body .expense-row-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-body .expense-row .expense-comment,
.app-body .expense-row .expense-actions {
  grid-column: 1 / -1;
}

.app-body .expense-row-head strong {
  font-size: 11px;
}

.app-body .expense-row-head span {
  color: var(--muted);
  font-size: 9px;
}

.app-body .expense-actions,
.app-body .attribution-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-body .attribution-actions {
  justify-content: space-between;
  margin-top: 14px;
}

.app-body .attribution-result {
  margin-top: 12px;
}

.app-body .attribution-summary {
  display: grid;
  gap: 5px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.app-body .attribution-summary strong {
  font-size: 16px;
}

.app-body .attribution-summary span,
.app-body .attribution-result p {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.app-body .attribution-result p {
  margin-top: 10px;
}

.app-body .comparison-form {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(120px, 0.5fr) auto;
  align-items: end;
  gap: 10px;
  max-width: 680px;
  margin-top: 16px;
}

.app-body .comparison-result {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.app-body .comparison-result > .empty {
  grid-column: 1 / -1;
  min-height: 92px;
  border: 0;
  border-radius: 0;
}

.app-body .comparison-cell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  min-height: 116px;
  padding: 13px;
  border-right: 1px solid var(--line);
}

.app-body .comparison-cell:last-child {
  border-right: 0;
}

.app-body .comparison-cell > span,
.app-body .comparison-cell > em {
  grid-column: 1 / -1;
}

.app-body .comparison-cell > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.app-body .comparison-cell div small,
.app-body .comparison-cell div strong {
  display: block;
}

.app-body .comparison-cell div small {
  color: #89918f;
  font-size: 8px;
  text-transform: uppercase;
}

.app-body .comparison-cell div strong {
  margin-top: 3px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.app-body .comparison-cell em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.app-body .comparison-cell em.is-up { color: var(--green); }
.app-body .comparison-cell em.is-down { color: var(--rose); }

@media (max-width: 1100px) {
  .app-body .campaign-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .app-body .campaign-metric:nth-child(3n) { border-right: 0; }
  .app-body .campaign-metric:nth-child(-n + 3) { border-bottom: 1px solid var(--line); }
  .app-body .comparison-result { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-body .comparison-cell:nth-child(2n) { border-right: 0; }
  .app-body .comparison-cell:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 760px) {
  .app-body .page-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-body .campaign-head,
  .app-body .campaign-product,
  .app-body .campaign-filter,
  .app-body .expense-row,
  .app-body .comparison-form {
    grid-template-columns: 1fr;
  }

  .app-body .campaign-selector {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .app-body .campaign-product-meta { text-align: left; }
  .app-body .campaign-filter { align-items: stretch; }
  .app-body .campaign-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-body .campaign-metric { border-bottom: 1px solid var(--line); }
  .app-body .campaign-metric:nth-child(2n) { border-right: 0; }
  .app-body .campaign-metric:nth-last-child(-n + 2) { border-bottom: 0; }
  .app-body .compact-form { grid-template-columns: 1fr; }
  .app-body .compact-form .form-span { grid-column: 1; }
  .app-body .expense-row-head { grid-column: 1; }
  .app-body .expense-actions { justify-content: flex-start; }
  .app-body .comparison-result { grid-template-columns: 1fr; }
  .app-body .comparison-cell,
  .app-body .comparison-cell:nth-child(2n) { border-right: 0; }
.app-body .comparison-cell:not(:last-child) { border-bottom: 1px solid var(--line); }
}

/* App workspace: UI design specification v1.0 */
.app-body {
  --canvas: #f6f9fe;
  --bg: var(--canvas);
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --line: #dfe7f2;
  --line-strong: #c9d6e6;
  --text: #172033;
  --muted: #66758a;
  --blue: #2563eb;
  --blue-hover: #1d4ed8;
  --blue-soft: #eaf2ff;
  --blue-soft-strong: #dbeafe;
  --green: #16815a;
  --green-soft: #e8f7f1;
  --amber: #946200;
  --amber-soft: #fff6db;
  --rose: #b4233a;
  --rose-soft: #fff0f2;
  --shadow: 0 1px 2px rgba(23, 32, 51, 0.06);
  min-width: 0;
  width: 100%;
  max-width: 100%;
  background: var(--canvas);
  color: var(--text);
}

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

.app-body .shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  width: 100%;
  max-width: 100%;
  min-height: 100dvh;
  background: var(--canvas);
}

.app-body .sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 248px;
  height: 100dvh;
  min-width: 0;
  overflow-y: auto;
  padding: 20px 16px;
  border-right: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.app-body .brand {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 48px;
  gap: 10px;
  padding: 0 4px;
}

.app-body .brand > div {
  min-width: 0;
}

.app-body .brand-mark {
  display: flex;
  flex: 0 0 36px;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  width: 36px;
  height: 36px;
  padding: 8px;
  border: 1px solid var(--blue);
  border-radius: 7px;
  background: var(--blue);
}

.app-body .brand-mark i {
  display: block;
  width: 4px;
  border-radius: 2px 2px 0 0;
  background: #ffffff;
}

.app-body .brand-mark i:nth-child(1) { height: 8px; }
.app-body .brand-mark i:nth-child(2) { height: 14px; }
.app-body .brand-mark i:nth-child(3) { height: 19px; }

.app-body .brand strong,
.app-body .brand span {
  display: block;
}

.app-body .brand strong {
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-body .brand span {
  max-width: 160px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.app-body .sidebar-label {
  margin: 10px 10px 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.app-body .nav {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.app-body .nav-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.app-body .nav-item:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.app-body .nav-item.is-active {
  border-color: var(--blue-soft);
  background: var(--blue-soft);
  color: var(--blue);
}

.app-body .nav-index {
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.app-body .nav-item.is-active .nav-index {
  color: var(--blue);
}

.app-body .identity {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin-top: auto;
  padding: 14px 10px 0;
  border-top: 1px solid var(--line);
}

.app-body .identity-head {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
  margin-bottom: 6px;
}

.app-body .identity-head div {
  min-width: 0;
}

.app-body .identity-head strong,
.app-body .identity-head span {
  display: block;
}

.app-body .identity-head strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-body .identity-head div > span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.app-body .identity-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--blue-soft-strong);
  border-radius: 7px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
}

.app-body .identity label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.app-body .identity input,
.app-body .identity .button-secondary {
  min-height: 36px;
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
}

.app-body .identity .account-logout {
  width: 100%;
}

.app-body .main {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 0 24px 40px;
  background: var(--canvas);
}

.app-body .topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  min-height: 96px;
  gap: 24px;
  margin: 0 -24px 24px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: none;
}

.app-body .topbar-copy {
  min-width: 0;
}

.app-body h1,
.app-body h2,
.app-body h3 {
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--text);
  letter-spacing: 0;
}

.app-body h1 {
  font-size: 27px;
  font-weight: 750;
  line-height: 1.2;
}

.app-body h2 {
  font-size: 18px;
  font-weight: 730;
  line-height: 1.3;
}

.app-body h3 {
  font-size: 15px;
  line-height: 1.35;
}

.app-body .eyebrow,
.app-body .panel-kicker {
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.app-body .page-summary {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.app-body .topbar-actions,
.app-body .status-strip,
.app-body .actions-row,
.app-body .panel-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.app-body .topbar-actions {
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 12px;
}

.app-body .status-dot,
.app-body .plan-pill,
.app-body .count-badge,
.app-body .access-badge,
.app-body .estimate-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 9px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.app-body .status-dot::before {
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.app-body .status-dot.is-ok {
  border-color: #bce3d4;
  background: var(--green-soft);
  color: var(--green);
}

.app-body .status-dot.is-loading,
.app-body .status-dot.is-partial,
.app-body .estimate-badge {
  border-color: #ead49a;
  background: var(--amber-soft);
  color: var(--amber);
}

.app-body .status-dot.is-error,
.app-body .form-status.is-error {
  color: var(--rose);
}

.app-body .plan-pill,
.app-body .count-badge {
  border-color: var(--blue-soft-strong);
  background: var(--blue-soft);
  color: var(--blue);
}

.app-body .range-control {
  min-width: 166px;
}

.app-body .segmented {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(max-content, 1fr);
  max-width: 100%;
  gap: 2px;
  overflow-x: auto;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  scrollbar-width: thin;
}

.app-body .segmented button {
  min-height: 32px;
  border: 0;
  border-radius: 5px;
  padding: 0 11px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.app-body .segmented button:hover {
  background: var(--blue-soft);
  color: var(--blue);
}

.app-body .segmented button.is-active,
.app-body .segmented button[aria-pressed="true"] {
  background: var(--blue-soft);
  color: var(--blue);
  box-shadow: none;
}

.app-body .view {
  display: none;
  width: min(100%, 1600px);
  min-width: 0;
  margin: 0 auto;
}

.app-body .view.is-visible {
  display: block;
}

.app-body .metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 1px;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  box-shadow: var(--shadow);
}

.app-body .metric {
  min-width: 0;
  min-height: 118px;
  padding: 16px 18px;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
}

.app-body .metric::before {
  content: none;
}

.app-body .metric:nth-last-child(2):nth-child(5),
.app-body .metric:last-child:nth-child(6) {
  grid-column: span 2;
}

.app-body .metric span,
.app-body .metric strong,
.app-body .metric em {
  display: block;
  min-width: 0;
}

.app-body .metric span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.app-body .metric strong {
  margin-top: 16px;
  font-size: 27px;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.app-body .metric em {
  margin-top: 9px;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  line-height: 1.35;
}

.app-body .section-head,
.app-body .panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 16px;
}

.app-body .section-head {
  min-height: 56px;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.app-body .panel-head {
  min-height: 36px;
}

.app-body .section-head > div,
.app-body .panel-head > div:first-child {
  min-width: 0;
}

.app-body .panel-kicker {
  margin-bottom: 5px;
}

.app-body .content-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  min-width: 0;
}

.app-body .content-grid > * {
  min-width: 0;
}

.app-body .content-grid > .panel:not(.panel-wide):not(.panel-chart):not(.panel-onboarding):not(.panel-sources):not(.panel-signals):not(.panel-automation) {
  grid-column: span 6;
}

.app-body .panel-wide,
.app-body .panel-automation {
  grid-column: 1 / -1;
}

.app-body .panel-chart,
.app-body .panel-sources {
  grid-column: span 8;
}

.app-body .panel-onboarding,
.app-body .panel-signals {
  grid-column: span 4;
}

.app-body .panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.app-body .panel > * {
  max-width: 100%;
}

.app-body .chart-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.app-body .chart-meta strong {
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.app-body .chart-meta span {
  color: var(--muted);
  font-size: 11px;
}

.app-body .bars {
  position: relative;
  display: grid;
  align-items: end;
  grid-template-columns: repeat(30, minmax(3px, 1fr));
  min-width: 0;
  min-height: 184px;
  gap: 4px;
  margin-top: 14px;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
  background-image: none;
}

.app-body .bar {
  min-width: 0;
  min-height: 4px;
  border-radius: 3px 3px 1px 1px;
  background: var(--blue);
  opacity: 0.9;
}

.app-body .bar:hover {
  opacity: 1;
}

.app-body .button,
.app-body .icon-button {
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--blue);
  border-radius: 7px;
  padding: 0 14px;
  background: var(--blue);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: normal;
}

.app-body .button:hover,
.app-body .button:active {
  border-color: var(--blue-hover);
  background: var(--blue-hover);
}

.app-body .button-secondary,
.app-body .icon-button {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text);
}

.app-body .button-secondary:hover,
.app-body .button-secondary:active,
.app-body .icon-button:hover,
.app-body .icon-button:active {
  border-color: var(--blue-soft-strong);
  background: var(--blue-soft);
  color: var(--blue);
}

.app-body .button-danger {
  border-color: var(--rose);
  background: var(--rose);
  color: #ffffff;
}

.app-body .button-danger:hover,
.app-body .button-danger:active {
  border-color: #92192f;
  background: #92192f;
  color: #ffffff;
}

.app-body .danger-icon {
  border-color: #efb9c1;
  background: var(--surface);
  color: var(--rose);
}

.app-body .button:disabled,
.app-body .icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.app-body button:focus-visible,
.app-body a:focus-visible,
.app-body input:focus-visible,
.app-body select:focus-visible,
.app-body textarea:focus-visible {
  outline: 3px solid var(--blue-soft-strong);
  outline-offset: 2px;
}

.app-body input,
.app-body select,
.app-body textarea,
.app-body .catalog-view-toolbar select,
.app-body .drawer-form input,
.app-body .drawer-form textarea,
.app-body .active-view-card input,
.app-body .active-view-card textarea,
.app-body .member-add-form input,
.app-body .member-add-form select,
.app-body .member-row select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 8px 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  outline: none;
}

.app-body textarea {
  resize: vertical;
}

.app-body input:focus,
.app-body select:focus,
.app-body textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.app-body input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  accent-color: var(--blue);
}

.app-body .form-panel,
.app-body .filter-panel {
  align-content: start;
  display: grid;
  gap: 12px;
}

.app-body .form-panel label,
.app-body .filter-grid label,
.app-body .channel-edit label,
.app-body .catalog-view-toolbar label,
.app-body .active-view-card label,
.app-body .campaign-selector,
.app-body .campaign-filter label,
.app-body .compact-form label,
.app-body .comparison-form label,
.app-body .expense-row label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
}

.app-body .filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.app-body .filter-grid .check-label {
  align-content: end;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-height: 60px;
}

.app-body .compact-filter {
  margin-bottom: 14px;
  padding: 0 0 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.app-body .compact-metadata {
  margin: 10px 0 4px;
}

.app-body .form-status {
  min-height: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.app-body .step-list,
.app-body .stack-list,
.app-body .table-list,
.app-body .limit-list {
  display: grid;
  gap: 0;
  min-width: 0;
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.app-body .table-list {
  overflow-x: visible;
}

.app-body .row,
.app-body .stack-item,
.app-body .step,
.app-body .limit-row,
.app-body .member-row {
  min-width: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 12px 8px;
  background: transparent;
}

.app-body .row:last-child,
.app-body .stack-item:last-child,
.app-body .step:last-child,
.app-body .limit-row:last-child,
.app-body .member-row:last-child {
  border-bottom: 0;
}

.app-body .row {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 0.7fr));
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 46px;
}

.app-body .row > *,
.app-body .stack-item > *,
.app-body .limit-row > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

.app-body .row strong,
.app-body .stack-item strong,
.app-body .step strong,
.app-body .limit-row strong {
  font-size: 13px;
}

.app-body .row span,
.app-body .stack-item span,
.app-body .step span,
.app-body .limit-row span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.app-body .table-head,
.app-body .table-head strong {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.app-body .stack-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 46px;
}

.app-body .stack-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 420px;
}

.app-body .stack-actions .mini-button,
.app-body .mini-button {
  min-width: 0;
  min-height: 32px;
  padding: 0 10px;
  font-size: 11px;
}

.app-body .stack-actions .mini-select,
.app-body .mini-select {
  width: 142px;
  min-height: 32px;
  padding: 0 8px;
  font-size: 11px;
}

.app-body .step.is-done {
  position: relative;
  padding-left: 30px;
  border-color: var(--line);
  background: transparent;
}

.app-body .step.is-done::before {
  position: absolute;
  top: 14px;
  left: 8px;
  width: 14px;
  height: 14px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: var(--green);
  content: "";
}

.app-body .empty {
  min-height: 92px;
  align-content: center;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  padding: 16px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  overflow-wrap: anywhere;
}

.app-body .catalog-view-toolbar,
.app-body .bulk-toolbar {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.app-body .catalog-view-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px;
}

.app-body .bulk-toolbar {
  display: grid;
  grid-template-columns: auto minmax(90px, auto) minmax(130px, 1fr) minmax(120px, 1fr) minmax(130px, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 10px;
}

.app-body .bulk-select-all,
.app-body .catalog-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.app-body .tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.app-body .tag-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.app-body .access-badge[data-role="owner"] {
  border-color: #bce3d4;
  background: var(--green-soft);
  color: var(--green);
}

.app-body .access-badge[data-role="editor"] {
  border-color: var(--blue-soft-strong);
  background: var(--blue-soft);
  color: var(--blue);
}

.app-body .channel-edit {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 8px;
  margin-top: 10px;
}

.app-body .saved-filter-list {
  display: grid;
  gap: 8px;
}

.app-body .saved-filter-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.app-body .saved-filter-item span,
.app-body .estimate-note,
.app-body .drawer-copy {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.app-body .catalog-view-drawer {
  position: fixed;
  z-index: 30;
  inset: 0 0 0 auto;
  width: min(440px, 100vw);
  max-width: 100vw;
  height: 100dvh;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  padding: 22px;
  background: var(--surface);
  box-shadow: -8px 0 20px rgba(23, 32, 51, 0.12);
}

.app-body .drawer-head,
.app-body .drawer-section-head,
.app-body .view-meta-row,
.app-body .member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.app-body .drawer-copy {
  margin: 10px 0 16px;
}

.app-body .drawer-form,
.app-body .active-view-card,
.app-body .drawer-empty {
  display: grid;
  gap: 10px;
}

.app-body .drawer-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.app-body .drawer-empty,
.app-body .active-view-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.app-body .member-add-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px auto;
  gap: 8px;
  margin-top: 10px;
}

.app-body .member-list {
  display: grid;
  margin-top: 10px;
}

.app-body .member-row {
  min-height: 54px;
}

.app-body .placement-document-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
}

.app-body .placement-document-list,
.app-body .placement-document-row {
  min-width: 0;
}

.app-body .placement-document-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.app-body .placement-document-row a {
  min-width: 0;
  color: var(--blue);
  overflow-wrap: anywhere;
}

.app-body .page-row.is-selected {
  background: var(--blue-soft);
}

.app-body .page-actions,
.app-body .expense-actions,
.app-body .attribution-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.app-body .page-actions {
  justify-content: flex-end;
}

.app-body .page-actions a,
.app-body .campaign-product-meta a {
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
}

.app-body .campaign-workspace {
  overflow: hidden;
  padding: 0;
}

.app-body .campaign-head {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.app-body .campaign-selector {
  grid-template-columns: auto minmax(220px, 360px);
  align-items: center;
  gap: 10px;
}

.app-body .campaign-workspace > .form-status {
  padding: 0 18px;
}

.app-body .campaign-product {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  margin: 0 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.app-body .campaign-product > .empty {
  grid-column: 1 / -1;
  width: 100%;
}

.app-body .campaign-product > div {
  min-width: 0;
}

.app-body .campaign-product > div > strong,
.app-body .campaign-product > div > span {
  display: block;
  overflow-wrap: anywhere;
}

.app-body .campaign-product > div > strong {
  font-size: 13px;
}

.app-body .campaign-product > div > span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.app-body .campaign-market {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 7px;
  background: var(--blue);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
}

.app-body .campaign-product-meta {
  text-align: right;
}

.app-body .campaign-filter {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 10px;
  padding: 14px 18px;
}

.app-body .campaign-filter input,
.app-body .campaign-filter select,
.app-body .compact-form input,
.app-body .compact-form select,
.app-body .comparison-form input,
.app-body .expense-row input {
  width: 100%;
  min-height: 38px;
}

.app-body .campaign-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.app-body .campaign-metric {
  min-width: 0;
  min-height: 106px;
  padding: 15px;
  border: 0;
  background: var(--surface);
}

.app-body .campaign-metric span,
.app-body .campaign-metric strong,
.app-body .campaign-metric em {
  display: block;
  min-width: 0;
}

.app-body .campaign-metric span,
.app-body .campaign-metric span small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.app-body .campaign-metric span small {
  color: var(--amber);
  text-transform: uppercase;
}

.app-body .campaign-metric strong {
  margin-top: 12px;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.app-body .campaign-metric em {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  line-height: 1.35;
}

.app-body .campaign-bars {
  min-height: 140px;
  overflow-x: auto;
  margin: 0;
  padding: 18px;
  border-top: 0;
}

.app-body .campaign-bars.is-empty {
  display: block;
}

.app-body .panel-total {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.app-body .estimate-badge {
  min-height: 24px;
  font-size: 10px;
  text-transform: uppercase;
}

.app-body .compact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.app-body .compact-form .form-span {
  grid-column: 1 / -1;
}

.app-body .expense-list {
  display: grid;
  gap: 0;
  margin-top: 8px;
  border-top: 1px solid var(--line);
}

.app-body .expense-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.app-body .expense-row-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.app-body .expense-row .expense-comment,
.app-body .expense-row .expense-actions {
  grid-column: 1 / -1;
}

.app-body .expense-row-head strong {
  font-size: 11px;
}

.app-body .expense-row-head span {
  color: var(--muted);
  font-size: 10px;
}

.app-body .attribution-actions {
  justify-content: space-between;
  margin-top: 14px;
}

.app-body .attribution-result {
  margin-top: 12px;
}

.app-body .attribution-summary {
  display: grid;
  gap: 5px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.app-body .attribution-summary strong {
  font-size: 16px;
}

.app-body .attribution-summary span,
.app-body .attribution-result p {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.app-body .comparison-form {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 0.5fr) auto;
  align-items: end;
  gap: 10px;
  max-width: 680px;
  margin-top: 16px;
}

.app-body .comparison-result {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.app-body .comparison-result > .empty {
  grid-column: 1 / -1;
  min-height: 92px;
  border: 0;
  border-radius: 0;
}

.app-body .comparison-cell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  min-width: 0;
  min-height: 116px;
  padding: 13px;
  border-right: 1px solid var(--line);
}

.app-body .comparison-cell:last-child {
  border-right: 0;
}

.app-body .comparison-cell > span,
.app-body .comparison-cell > em {
  grid-column: 1 / -1;
}

.app-body .comparison-cell > span,
.app-body .comparison-cell div small,
.app-body .comparison-cell em {
  color: var(--muted);
  font-size: 10px;
}

.app-body .comparison-cell div strong {
  display: block;
  margin-top: 3px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.app-body .comparison-cell em {
  font-style: normal;
  font-weight: 800;
}

.app-body .comparison-cell em.is-up { color: var(--green); }
.app-body .comparison-cell em.is-down { color: var(--rose); }

@media (min-width: 1440px) {
  .app-body .main {
    transition: margin-right 160ms ease;
  }

  .app-body.catalog-drawer-open .main {
    margin-right: 440px;
  }
}

@media (max-width: 1100px) {
  .app-body .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-body .sidebar {
    position: static;
    width: 100%;
    height: auto;
    overflow: visible;
    padding: 14px 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .app-body .sidebar-label {
    display: none;
  }

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

  .app-body .identity {
    grid-template-columns: minmax(180px, 1fr) auto;
    align-items: center;
    margin-top: 0;
    padding: 12px 0 0;
  }

  .app-body .identity-head {
    margin: 0;
  }

  .app-body .identity > label {
    display: none;
  }

  .app-body .main {
    padding-top: 0;
  }

  .app-body .topbar {
    top: 0;
  }

  .app-body .campaign-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .app-body .comparison-result {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-body .comparison-cell:nth-child(2n) {
    border-right: 0;
  }

  .app-body .comparison-cell:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  .app-body .sidebar {
    gap: 10px;
    padding: 12px;
  }

  .app-body .brand {
    min-height: 40px;
  }

  .app-body .brand-mark {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
    padding: 7px;
  }

  .app-body .brand span {
    display: none;
  }

  .app-body .nav {
    display: flex;
    gap: 6px;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  .app-body .nav-item {
    flex: 0 0 auto;
    grid-template-columns: auto minmax(0, 1fr);
    width: auto;
    min-height: 38px;
    padding: 0 10px;
    white-space: nowrap;
  }

  .app-body .identity {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    padding-top: 10px;
  }

  .app-body .identity-head {
    display: grid;
  }

  .app-body .identity .button-secondary {
    grid-column: auto;
  }

  .app-body .main {
    padding: 0 12px 32px;
  }

  .app-body .topbar {
    position: static;
    align-items: stretch;
    flex-direction: column;
    min-height: 0;
    gap: 0;
    margin: 0 -12px 16px;
    padding: 16px 12px;
  }

  .app-body .topbar-actions {
    align-items: stretch;
    flex-direction: column;
    margin-top: 14px;
  }

  .app-body .status-strip {
    justify-content: flex-start;
  }

  .app-body .range-control {
    width: 100%;
  }

  .app-body h1 {
    font-size: 23px;
  }

  .app-body .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-body .metric:nth-last-child(2):nth-child(5),
  .app-body .metric:last-child:nth-child(6) {
    grid-column: span 1;
  }

  .app-body .metric {
    min-height: 110px;
    padding: 14px;
  }

  .app-body .metric strong {
    margin-top: 13px;
    font-size: 22px;
  }

  .app-body .section-head {
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
  }

  .app-body .panel-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .app-body .content-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .app-body .content-grid > .panel,
  .app-body .panel-wide,
  .app-body .panel-chart,
  .app-body .panel-onboarding,
  .app-body .panel-sources,
  .app-body .panel-signals,
  .app-body .panel-automation {
    grid-column: 1;
  }

  .app-body .panel {
    padding: 14px;
  }

  .app-body .campaign-workspace {
    padding: 0;
  }

  .app-body .bars {
    min-height: 150px;
    gap: 2px;
  }

  .app-body .row {
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
  }

  .app-body .stack-item,
  .app-body .saved-filter-item,
  .app-body .limit-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-body .stack-actions,
  .app-body .page-actions {
    justify-content: flex-start;
    max-width: none;
  }

  .app-body .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-body .catalog-view-toolbar,
  .app-body .member-add-form,
  .app-body .bulk-toolbar,
  .app-body .placement-document-form,
  .app-body .channel-edit {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-body .campaign-head,
  .app-body .campaign-product,
  .app-body .campaign-filter,
  .app-body .expense-row,
  .app-body .comparison-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-body .campaign-head {
    padding: 14px;
  }

  .app-body .campaign-selector {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  .app-body .campaign-product {
    margin: 0 14px;
  }

  .app-body .campaign-product-meta {
    text-align: left;
  }

  .app-body .campaign-filter {
    align-items: stretch;
    padding: 12px 14px;
  }

  .app-body .campaign-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-body .compact-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-body .compact-form .form-span,
  .app-body .expense-row-head,
  .app-body .expense-row .expense-comment,
  .app-body .expense-row .expense-actions {
    grid-column: 1;
  }

  .app-body .comparison-result {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-body .comparison-cell,
  .app-body .comparison-cell:nth-child(2n) {
    border-right: 0;
  }

  .app-body .comparison-cell:not(:last-child) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 520px) {
  .app-body .identity,
  .app-body .filter-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-body .identity .button-secondary {
    grid-column: 1;
  }

  .app-body .metric strong {
    font-size: 20px;
  }

  .app-body .campaign-product {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .app-body .campaign-product-meta {
    grid-column: 1 / -1;
  }

  .app-body .attribution-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-body .catalog-view-drawer {
    width: 100vw;
    padding: 16px;
  }
}
