:root {
  --ink: #202124;
  --muted: #5f6368;
  --line: #d8dde5;
  --panel: #ffffff;
  --paper: #f7f4ef;
  --charcoal: #18242f;
  --teal: #0f766e;
  --coral: #c2410c;
  --gold: #b7791f;
  --green: #2f7d32;
  --red: #b42318;
  --blue: #315c99;
  --violet: #315c99;
  --amber-soft: #fff7ed;
  --green-soft: #f0fdf4;
  --blue-soft: #eff6ff;
  --surface: #fbfaf7;
  --shadow: 0 18px 44px rgba(24, 36, 47, 0.11);
  --shadow-soft: 0 8px 24px rgba(24, 36, 47, 0.08);
  --radius: 8px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(15, 118, 110, 0.06), rgba(49, 92, 153, 0.045) 46%, rgba(194, 65, 12, 0.04)),
    var(--paper);
  letter-spacing: 0;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  min-width: 0;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

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

.app-shell[hidden] {
  display: none;
}

.workspace-unavailable {
  min-height: 100vh;
  width: min(100%, 680px);
  margin: 0 auto;
  padding: clamp(32px, 8vh, 88px) 24px;
}

.workspace-unavailable h1 {
  margin: 0 0 12px;
  font-size: clamp(24px, 2rem, 32px);
  line-height: 1.2;
}

.workspace-unavailable p {
  max-width: 54ch;
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.5;
}

.workspace-unavailable button {
  border: 1px solid var(--teal);
  border-radius: 6px;
  background: var(--teal);
  color: #fff;
  min-height: 44px;
  padding: 10px 18px;
  font-weight: 600;
}

.sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.2), rgba(24, 36, 47, 0) 36%),
    var(--charcoal);
  color: #f8fafc;
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

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

.mark {
  width: 48px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: #f8fafc;
  color: var(--charcoal);
  border-radius: 8px;
  font-weight: 900;
  overflow: hidden;
}

.brand-mark {
  position: relative;
  width: 82px;
  aspect-ratio: 2.65;
  padding: 6px 8px;
}

.brand-wordmark {
  display: flex;
  align-items: baseline;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 1.18rem;
  line-height: 1;
  font-weight: 900;
  color: var(--charcoal);
}

.brand-wordmark strong {
  color: #038c2c;
  font-size: 1.48em;
  font-weight: 900;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.sidebar .eyebrow {
  color: #b8c2cf;
}

.brand-lockup h1 {
  max-width: 176px;
  font-size: 1.18rem;
  line-height: 1.12;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin: 0;
  font-size: 1.35rem;
}

h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2vw, 2rem);
}

h3 {
  margin-bottom: 8px;
  font-size: clamp(1.2rem, 2vw, 1.7rem);
  line-height: 1.15;
}

h4 {
  margin-bottom: 8px;
  font-size: 1rem;
}

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

.nav-item {
  border: 0;
  background: transparent;
  color: #dce3eb;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: var(--radius);
  text-align: left;
  min-width: 0;
  font-weight: 760;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.13);
  color: #ffffff;
}

.nav-item.locked {
  opacity: 0.5;
}

.nav-item.hidden-by-flow {
  display: none;
}

.nav-icon {
  width: 28px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.76rem;
  font-weight: 900;
}

.sidebar-screen {
  display: grid;
  gap: 10px;
  margin: 4px 0 2px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.screen-frame {
  position: relative;
  min-height: 112px;
  aspect-ratio: 16 / 9;
  display: grid;
  align-content: center;
  gap: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.9), rgba(49, 92, 153, 0.86)),
    #0b1220;
  color: #ffffff;
}

.screen-safe-zone {
  position: absolute;
  inset: 14%;
  border: 1px dashed rgba(255, 255, 255, 0.52);
  border-radius: 4px;
}

.screen-frame strong,
.screen-frame small {
  position: relative;
  z-index: 1;
}

.screen-frame strong {
  font-size: 2rem;
  line-height: 1;
}

.screen-frame small {
  max-width: 18ch;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.3;
}

.screen-caption {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #cbd5e1;
  font-size: 0.75rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sidebar-note {
  margin-top: auto;
  padding: 14px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  color: #edf2f7;
}

.sidebar-note p {
  margin-bottom: 0;
  color: #cbd5e1;
  line-height: 1.45;
}

.main {
  min-width: 0;
  padding: 28px clamp(22px, 3vw, 40px) 40px;
}

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

.topbar h2 {
  letter-spacing: 0;
}

.topbar-subtitle {
  max-width: 76ch;
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.account-identity-button {
  max-width: min(320px, 100%);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#globalSignOutButton[hidden] {
  display: none;
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.segmented label {
  display: block;
  cursor: pointer;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: block;
  min-width: 44px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-align: center;
}

.segmented input:checked + span {
  background: var(--charcoal);
  color: #ffffff;
}

.access-toggle {
  grid-template-columns: repeat(2, 1fr);
}

.quick-affiliates {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -2px 0 14px;
}

.icon-button,
.ghost,
.primary {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 800;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.icon-button,
.ghost {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--charcoal);
}

.primary {
  border: 1px solid var(--charcoal);
  background: var(--charcoal);
  color: #ffffff;
}

.icon-button:hover,
.ghost:hover,
.primary:hover {
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.contract-status {
  min-height: 58px;
  margin-bottom: 16px;
  border: 1px solid rgba(24, 36, 47, 0.12);
  border-left: 5px solid var(--teal);
  border-radius: 8px;
  padding: 13px 14px;
  background: #ffffff;
  color: var(--charcoal);
  font-size: 0.9rem;
  line-height: 1.35;
  box-shadow: var(--shadow-soft);
}

.contract-status span {
  margin: 0;
}

.command-strip {
  display: grid;
  grid-template-columns: minmax(180px, 0.85fr) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.command-strip-main {
  display: grid;
  gap: 4px;
}

.command-strip-main strong {
  font-size: 1rem;
}

.command-strip-main small {
  color: var(--muted);
  line-height: 1.35;
}

.command-strip-steps,
.status-stack {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  border: 1px solid #e8edf3;
  border-radius: 999px;
  padding: 0 10px;
  background: #f8fafc;
  color: #334155;
  font-size: 0.8rem;
  font-weight: 850;
  white-space: nowrap;
}

.status-chip:before {
  content: "";
  width: 7px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--muted);
}

.status-chip.ok {
  background: var(--green-soft);
  border-color: rgba(47, 125, 50, 0.22);
  color: #1f6b35;
}

.status-chip.ok:before {
  background: var(--green);
}

.status-chip.warn {
  background: var(--amber-soft);
  border-color: rgba(183, 121, 31, 0.24);
  color: #8a4f08;
}

.status-chip.warn:before {
  background: var(--gold);
}

.status-chip.info {
  background: var(--blue-soft);
  border-color: rgba(49, 92, 153, 0.22);
  color: #27445d;
}

.status-chip.info:before {
  background: var(--blue);
}

.status-chip.danger {
  background: #fff5f5;
  border-color: rgba(180, 35, 24, 0.26);
  color: #842029;
}

.status-chip.danger:before {
  background: var(--red);
}

.workflow-panel {
  margin: 0 0 16px;
  padding: 16px;
  border: 1px solid rgba(216, 221, 229, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
}

.workflow-panel.compact {
  box-shadow: none;
}

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

.workflow-panel-head h4 {
  margin-bottom: 0;
}

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

.workflow-card {
  min-height: 168px;
  display: grid;
  grid-template-rows: auto auto auto auto minmax(42px, 1fr) auto;
  align-content: start;
  gap: 8px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  padding: 12px;
  background: #fffdf8;
  color: var(--charcoal);
  text-align: left;
  min-width: 0;
}

.workflow-card.ok {
  border-left-color: var(--green);
  background: #f8fff9;
}

.workflow-card.info {
  border-left-color: var(--blue);
  background: #f8fbff;
}

.workflow-card.danger {
  border-left-color: var(--red);
  background: #fff8f8;
}

.workflow-card.active {
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.38);
}

.workflow-number {
  width: 24px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid currentColor;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.workflow-card strong,
.workflow-card small,
.workflow-card p,
.workflow-card em {
  min-width: 0;
  overflow-wrap: anywhere;
}

.workflow-card strong {
  font-size: 0.94rem;
  line-height: 1.2;
}

.workflow-card small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.workflow-card p {
  margin: 0;
  color: #475569;
  font-size: 0.82rem;
  line-height: 1.35;
}

.workflow-card em {
  color: #842029;
  font-size: 0.78rem;
  font-style: normal;
  line-height: 1.3;
}

.builder-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.access-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.access-auth-shell {
  display: grid;
  grid-template-columns: minmax(320px, 600px) minmax(280px, 430px);
  justify-content: center;
  gap: 18px;
  align-items: start;
  padding-top: 10px;
}

.authorization-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.journey-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.journey-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--charcoal);
  padding: 10px 12px;
  text-align: left;
}

.journey-step span {
  width: 26px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.74rem;
  font-weight: 900;
}

.journey-step strong {
  overflow-wrap: anywhere;
}

.journey-step small {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.journey-step.active {
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.32);
}

.journey-step.done span {
  background: var(--green);
  border-color: var(--green);
  color: #ffffff;
}

.locked-card-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-top: 14px;
  border: 1px solid rgba(183, 121, 31, 0.28);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  padding: 16px;
  background: rgba(183, 121, 31, 0.07);
}

.locked-card-section p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.access-card {
  background: var(--panel);
  border: 1px solid rgba(216, 221, 229, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  min-width: 0;
}

.auth-card {
  padding: clamp(24px, 4vw, 38px);
  position: relative;
  overflow: hidden;
}

.auth-card:before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--teal), var(--blue), var(--coral));
}

.auth-brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.auth-brand-row .mark {
  border-color: rgba(24, 36, 47, 0.12);
  background: var(--charcoal);
  color: #ffffff;
}

.auth-brand-row .brand-mark {
  background: #f8fafc;
}

.auth-card h3 {
  margin-bottom: 8px;
  font-size: clamp(1.7rem, 3vw, 2.25rem);
  line-height: 1.08;
}

.auth-subtitle {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.5;
  margin-bottom: 18px;
}

.email-chip {
  display: inline-flex;
  max-width: 100%;
  min-height: 42px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f3f4f6;
  color: #4b5563;
  padding: 0 16px;
  font-size: 1.08rem;
  overflow-wrap: anywhere;
}

.auth-mode-toggle {
  width: 100%;
  margin-bottom: 20px;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.code-form {
  margin-top: 24px;
}

.auth-form .field {
  gap: 8px;
}

.auth-form .field input,
.password-shell {
  min-height: 58px;
}

.auth-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-label-row b {
  color: var(--red);
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--violet);
  font-weight: 850;
  padding: 0;
}

.password-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.password-shell:focus-within {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(109, 74, 255, 0.14);
}

.password-shell input {
  border: 0;
  min-height: 56px;
}

.password-shell input:focus {
  outline: 0;
}

.password-toggle {
  min-height: 40px;
  border: 0;
  border-left: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  padding: 0 12px;
  font-weight: 850;
}

.auth-status-card {
  grid-column: auto;
}

.access-details {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
}

.access-details summary {
  cursor: pointer;
  font-weight: 850;
  color: var(--charcoal);
}

.compact-access-fields {
  margin-top: 12px;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  padding: 16px;
  background: linear-gradient(90deg, rgba(15, 118, 110, 0.08), rgba(49, 92, 153, 0.05)), #ffffff;
  margin-bottom: 14px;
}

.hero-panel h4,
.hero-panel p {
  margin-bottom: 4px;
}

.hero-panel p {
  color: var(--muted);
  line-height: 1.45;
}

.access-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
  margin-bottom: 14px;
}

.access-header h4,
.access-card h4 {
  margin-bottom: 6px;
}

.access-actions {
  margin-top: 14px;
}

.auth-code-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 190px;
}

.access-status {
  position: static;
  grid-column: 1 / -1;
}

.website-scan {
  border: 1px solid #eef0f3;
  border-radius: 8px;
  padding: 12px;
  margin: 12px 0;
  background: #fafafa;
}

.allocation-panel {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.allocation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: baseline;
}

.allocation-row span,
.allocation-row strong,
.allocation-row small {
  min-width: 0;
}

.allocation-row span {
  font-weight: 800;
}

.allocation-row small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.builder-main,
.side-panel,
.step-panel,
.metric-panel,
.partner-note,
.report-band {
  background: var(--panel);
  border: 1px solid rgba(216, 221, 229, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}

.builder-main {
  padding: 18px;
  overflow: hidden;
}

.builder-mode {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f2f5f6;
}

.builder-mode[hidden],
.builder-chat[hidden],
#builderForm[hidden] {
  display: none;
}

.builder-mode button {
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  padding: 7px 15px;
  cursor: pointer;
}

.builder-mode button[aria-pressed="true"] {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(24, 36, 47, 0.14);
  font-weight: 700;
}

.builder-chat {
  max-width: 760px;
}

.builder-chat-thread {
  min-height: 230px;
  max-height: min(56vh, 540px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 4px 18px;
}

.builder-chat-message {
  max-width: min(88%, 590px);
  padding: 11px 14px;
  border-radius: 6px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.builder-chat-message.assistant {
  align-self: flex-start;
  background: #edf5f3;
  color: var(--charcoal);
}

.builder-chat-message.advertiser {
  align-self: flex-end;
  background: #eaf0f8;
  color: var(--ink);
}

.builder-chat-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.builder-chat-choices button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  padding: 8px 11px;
  cursor: pointer;
}

.builder-chat-choices button:hover,
.builder-chat-choices button:focus-visible {
  border-color: var(--teal);
}

.builder-chat-form label {
  display: block;
  font-weight: 650;
  margin-bottom: 7px;
}

.builder-chat-compose {
  display: flex;
  gap: 8px;
}

.builder-chat-compose textarea {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
}

.builder-chat-status {
  min-height: 22px;
  color: var(--muted);
  margin: 10px 0 0;
}

#builderChatCreative:not(:empty) {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

@media (max-width: 600px) {
  .builder-chat-compose { flex-wrap: wrap; }
  .builder-chat-compose button { width: 100%; }
  .builder-chat-message { max-width: 95%; }
}

.stepper {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.step-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fafafa;
  color: var(--muted);
  min-height: 76px;
}

.step-item.complete {
  border-color: rgba(47, 125, 50, 0.32);
  background: rgba(47, 125, 50, 0.07);
  color: var(--green);
}

.step-item.active {
  border-color: rgba(15, 118, 110, 0.45);
  background: rgba(15, 118, 110, 0.08);
  color: var(--teal);
}

.step-num {
  width: 24px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid currentColor;
  font-size: 0.75rem;
  font-weight: 900;
  margin-bottom: 8px;
}

.step-name {
  display: block;
  font-size: 0.82rem;
  font-weight: 850;
}

.mobile-step-header {
  display: none;
  margin-bottom: 14px;
  font-weight: 850;
}

.progress-track {
  margin-top: 8px;
  height: 5px;
  border-radius: 8px;
  background: #e6e8ed;
  overflow: hidden;
}

.progress-track span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--teal);
  transition: width 160ms ease;
}

.step-panel {
  box-shadow: none;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.045), rgba(255, 255, 255, 0) 120px),
    #ffffff;
}

.step-copy p:last-child {
  color: var(--muted);
  line-height: 1.5;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field.full {
  grid-column: 1 / -1;
}

.field span {
  color: #374151;
  font-size: 0.88rem;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 0;
  border-color: rgba(15, 118, 110, 0.62);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.11);
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: rgba(180, 35, 24, 0.72);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.08);
}

.field-hint {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
}

.field-hint:empty {
  display: none;
}

.field-hint.error {
  color: var(--red);
  font-weight: 760;
}

.field.checkline {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
}

.field.checkline input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

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

.choice {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
  text-align: left;
  min-height: 86px;
}

.choice:hover {
  border-color: rgba(15, 118, 110, 0.46);
  box-shadow: var(--shadow-soft);
}

.choice.active {
  border-color: var(--teal);
  box-shadow: inset 0 0 0 1px var(--teal);
}

.choice strong {
  display: block;
  margin-bottom: 5px;
}

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

.targeting-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.targeting-summary span {
  display: grid;
  gap: 3px;
  min-height: 62px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fffd;
  min-width: 0;
}

.targeting-summary strong,
.targeting-summary small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.targeting-summary small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.wizard-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.builder-side {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 18px;
}

.side-panel {
  padding: 16px;
  box-shadow: none;
}

.check-item {
  display: flex;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #eef0f3;
  align-items: start;
}

.check-item:last-child {
  border-bottom: 0;
}

.check-dot {
  width: 20px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  flex: none;
}

.check-item.done .check-dot {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.check-item span:last-child {
  color: var(--muted);
  line-height: 1.35;
}

.package-card {
  border-left: 4px solid var(--teal);
  padding-left: 12px;
}

.package-card.growth {
  border-color: var(--coral);
}

.package-card strong {
  display: block;
  font-size: 1.55rem;
  margin: 2px 0 8px;
}

.package-card p {
  color: var(--muted);
  line-height: 1.45;
}

.package-card dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  margin: 0;
  font-size: 0.9rem;
}

.package-card dd {
  margin: 0;
  font-weight: 850;
}

.agent-step {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 10px;
  padding: 8px 0;
}

.status-dot {
  width: 10px;
  aspect-ratio: 1;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--teal);
}

.status-dot.warn {
  background: var(--gold);
}

.status-dot.done {
  background: var(--green);
}

.agent-step p {
  margin-bottom: 2px;
  font-size: 0.92rem;
  line-height: 1.35;
}

.agent-step small {
  color: var(--muted);
}

.creative-preview {
  display: grid;
  grid-template-columns: minmax(260px, 420px) 1fr;
  gap: 18px;
  align-items: start;
  min-width: 0;
}

.creative-upload-field input[type="file"] {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.creative-upload-status {
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fffdfa;
}

.creative-upload-status.ready {
  border-left-color: var(--green);
  background: #f6fff9;
}

.creative-upload-status.pending {
  border-left-color: var(--blue);
  background: #f6fbff;
}

.creative-upload-status.failed {
  border-left-color: var(--red);
  background: #fff7f7;
}

.creative-upload-status strong,
.creative-upload-status small {
  display: block;
}

.creative-review-media {
  display: block;
  width: 100%;
  max-height: 360px;
  margin-top: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #050816;
  object-fit: contain;
}

.inline-link {
  display: inline-flex;
  margin-top: 0.75rem;
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.inline-link:hover {
  text-decoration: underline;
}

.tv-frame {
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background:
    radial-gradient(circle at 78% 22%, rgba(255, 255, 255, 0.2), transparent 28%),
    linear-gradient(135deg, rgba(15, 118, 110, 0.9), rgba(49, 92, 153, 0.86)),
    #111827;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.tv-frame:before {
  content: "";
  position: absolute;
  inset: 8%;
  border: 1px dashed rgba(255, 255, 255, 0.72);
  border-radius: 4px;
  pointer-events: none;
}

.mock-logo {
  width: 64px;
  aspect-ratio: 1;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #ffffff;
  color: var(--charcoal);
  font-weight: 900;
}

.tv-frame h4 {
  max-width: 70%;
  font-size: clamp(1rem, 2vw, 1.7rem);
  margin: 0;
}

.tv-frame footer {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  font-weight: 850;
}

.qr {
  width: 54px;
  aspect-ratio: 1;
  border-radius: 4px;
  background:
    linear-gradient(90deg, #111 50%, transparent 0) 0 0 / 12px 12px,
    linear-gradient(#111 50%, transparent 0) 0 0 / 12px 12px,
    #fff;
  border: 5px solid #fff;
}

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

.qa-item {
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  padding: 10px 12px;
}

.qa-item.pass {
  border-left-color: var(--green);
}

.qa-item.warn {
  border-left-color: var(--gold);
}

.qa-item.review {
  border-left-color: var(--red);
}

.split-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
}

.decision-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.decision-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
  display: grid;
  gap: 10px;
}

.decision-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: #eef4f8;
  color: #27445d;
  font-size: 0.82rem;
  font-weight: 800;
}

.pill.warn {
  background: rgba(183, 121, 31, 0.14);
  color: #7a4d08;
}

.kpi-grid,
.partner-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.metric-panel {
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.metric-panel span {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.86rem;
}

.metric-panel strong {
  display: block;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  margin: 10px 0 6px;
}

.metric-panel small {
  color: var(--muted);
}

.report-bands {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.report-band {
  box-shadow: none;
  padding: 16px;
}

.report-band p,
.partner-note p,
.side-panel p {
  color: var(--muted);
  line-height: 1.5;
}

.partner-note {
  margin-top: 16px;
  padding: 18px;
  box-shadow: none;
}

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

.ledger-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.ledger-item span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ledger-item strong {
  overflow-wrap: anywhere;
}

.ledger-item small {
  color: var(--muted);
  line-height: 1.35;
}

.campaign-ledger {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.campaign-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.campaign-row h4 {
  margin: 10px 0 6px;
  font-size: 1.05rem;
}

.campaign-row p {
  color: var(--muted);
  line-height: 1.45;
}

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

.campaign-state-grid span {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid #eef0f3;
  border-radius: 8px;
  background: #fafafa;
  min-width: 0;
}

.campaign-state-grid strong,
.campaign-state-grid small {
  overflow-wrap: anywhere;
}

.campaign-state-grid small {
  color: var(--muted);
}

.notice {
  border: 1px solid rgba(49, 92, 153, 0.22);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  padding: 12px;
  background: rgba(49, 92, 153, 0.06);
  color: #25466f;
  line-height: 1.45;
}

.notice.danger {
  border-color: rgba(180, 35, 24, 0.26);
  border-left-color: var(--red);
  background: #fff5f5;
  color: #842029;
}

.secure-card-shell {
  border: 1px solid #e8edf3;
  border-radius: 8px;
  padding: 14px;
  margin-top: 14px;
  background: #fbfdff;
}

.field-hint {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.test-checklist {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.test-checklist .check-item {
  border: 1px solid #eef0f3;
  border-radius: 8px;
  padding: 10px;
  background: #fafafa;
}

.test-stage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.test-stage {
  border: 1px solid #eef0f3;
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
  min-width: 0;
}

.test-stage strong {
  display: block;
  margin-bottom: 4px;
}

.test-stage small {
  color: var(--muted);
  line-height: 1.35;
}

.estimate-panel,
.optimization-card,
.chat-panel {
  background: #fff;
  border: 1px solid rgba(216, 221, 229, 0.9);
  border-radius: var(--radius);
  padding: 16px;
  min-width: 0;
}

.estimate-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 14px;
  align-items: start;
  margin-top: 14px;
}

.estimate-panel p {
  color: var(--muted);
  line-height: 1.45;
}

.mini-metrics,
.variant-grid {
  display: grid;
  gap: 10px;
}

.mini-metrics span,
.variant-grid div {
  display: grid;
  gap: 4px;
  border: 1px solid #eef0f3;
  border-radius: 8px;
  padding: 10px;
  background: #fafafa;
}

.mini-metrics strong {
  font-size: 1.45rem;
}

.mini-metrics small,
.variant-grid span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.optimization-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.operator-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.operator-section {
  background: #fff;
  border: 1px solid rgba(216, 221, 229, 0.9);
  border-radius: var(--radius);
  padding: 16px;
  min-width: 0;
}

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

.supply-section {
  margin-top: 16px;
}

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

.supply-card {
  display: grid;
  gap: 12px;
  border: 1px solid #eef0f3;
  border-radius: 8px;
  padding: 12px;
  background: #fafafa;
  min-width: 0;
}

.supply-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.supply-card h4,
.supply-card p {
  margin-bottom: 4px;
}

.supply-card p,
.compact-list {
  color: var(--muted);
  line-height: 1.4;
}

.supply-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.supply-metrics strong {
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.vast-tag-box {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.74rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.compact-list {
  margin: 0;
  padding-left: 18px;
}

.operator-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  border: 1px solid #eef0f3;
  border-radius: 8px;
  padding: 12px;
  background: #fafafa;
  min-width: 0;
}

.operator-row h4 {
  margin-bottom: 4px;
}

.operator-row p,
.operator-row small {
  color: var(--muted);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.operator-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.optimization-card h4 {
  margin-top: 12px;
}

.optimization-card p {
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 0;
}

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

.variant-grid strong {
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}

.concierge-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.chat-panel {
  box-shadow: var(--shadow);
}

.chat-thread {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  max-height: 420px;
  overflow: auto;
  padding: 12px;
  border: 1px solid #eef0f3;
  border-radius: 8px;
  background: #fafafa;
}

.chat-message {
  width: min(76%, 620px);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
}

.chat-message.business {
  justify-self: end;
  background: #dcf8c6;
  border-color: rgba(47, 125, 50, 0.22);
}

.chat-message p {
  margin-bottom: 4px;
  line-height: 1.45;
}

.chat-message small {
  color: var(--muted);
  font-size: 0.74rem;
}

.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chat-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 12px;
}

.chat-input input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
}

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

  .sidebar {
    position: static;
    min-height: 0;
    padding: 16px;
  }

  .brand-lockup {
    justify-content: space-between;
  }

  .brand-lockup h1 {
    max-width: none;
  }

  .sidebar-screen {
    display: none;
  }

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

  .sidebar-note {
    display: none;
  }

  .builder-layout,
  .access-layout,
  .access-auth-shell,
  .authorization-layout,
  .command-strip,
  .hero-panel,
  .split-view,
  .concierge-layout,
  .operator-grid,
  .supply-grid,
  .test-stage-grid,
  .campaign-row {
    grid-template-columns: 1fr;
  }

  .builder-side {
    position: static;
  }

  .access-status {
    position: static;
  }

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

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

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

  .topbar-actions,
  .segmented {
    width: 100%;
  }

  .segmented span {
    min-width: 0;
  }

  .workflow-panel-head {
    display: grid;
  }

  .supply-card-header,
  .supply-metrics {
    grid-template-columns: 1fr;
  }

  .access-header {
    display: grid;
  }

  .auth-card {
    padding: 22px;
  }

  .auth-code-actions {
    margin-top: 80px;
  }

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

  .nav-item {
    font-size: 0.92rem;
    padding: 10px;
  }

  .nav-icon {
    width: 24px;
  }

  .stepper {
    display: none;
  }

  .mobile-step-header {
    display: block;
  }

  .form-grid,
  .choice-grid,
  .targeting-summary,
  .journey-strip,
  .workflow-grid,
  .locked-card-section,
  .creative-preview,
  .estimate-panel,
  .kpi-grid,
  .partner-grid,
  .report-bands,
  .variant-grid,
  .chat-input {
    grid-template-columns: 1fr;
  }

  .workflow-card {
    min-height: 0;
  }

  .chat-message {
    width: 100%;
  }

  .operator-row {
    grid-template-columns: 1fr;
  }

  .wizard-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .wizard-actions .primary {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .brand-lockup {
    align-items: flex-start;
    gap: 10px;
  }

  .brand-lockup h1 {
    font-size: 1rem;
  }

  .mark {
    width: 42px;
  }

  .brand-mark {
    width: 66px;
    padding: 6px;
  }

  .brand-wordmark {
    font-size: 0.9rem;
  }

  .brand-wordmark strong {
    font-size: 1.32em;
  }

  .nav-list,
  .workflow-grid {
    grid-template-columns: 1fr;
  }

  .auth-code-actions,
  .wizard-actions {
    grid-template-columns: 1fr;
  }

  .auth-code-actions {
    margin-top: 32px;
  }
}
