:root {
  color-scheme: dark;
  --bg: #0f1216;
  --bg-soft: #151a20;
  --surface: #1b222b;
  --surface-2: #121922;
  --surface-3: #202833;
  --text: #f6f7f8;
  --text-soft: #c5ced8;
  --muted: #9ca7b5;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.2);
  --brand: #f97316;
  --brand-strong: #ea580c;
  --brand-soft: rgba(249, 115, 22, 0.16);
  --success: #34d399;
  --danger: #fb7185;
  --radius: 12px;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background:
    linear-gradient(135deg, rgba(32, 40, 51, 0.92) 0%, rgba(15, 18, 22, 0.98) 34%, #0b1016 100%);
  color: var(--text);
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

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

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.app-sidebar {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  height: 100vh;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: rgba(15, 18, 22, 0.82);
  backdrop-filter: blur(16px);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
}

.sidebar-logo {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 10px;
}

.sidebar-brand strong {
  display: block;
  font-family: "Sora", sans-serif;
  font-size: 18px;
  line-height: 1.1;
}

.sidebar-brand small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(249, 115, 22, 0.38);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(249, 115, 22, 0.24), rgba(249, 115, 22, 0.08)),
    var(--surface);
  color: #fff8ef;
  font-family: "Sora", sans-serif;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 14px 34px rgba(249, 115, 22, 0.14);
}

.topbar-logo {
  display: block;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 12px;
  filter: drop-shadow(0 12px 26px rgba(249, 115, 22, 0.18));
}

.hero-logo {
  display: block;
  width: min(420px, 72%);
  max-height: 132px;
  object-fit: contain;
  filter: drop-shadow(0 18px 38px rgba(249, 115, 22, 0.2));
}

.sidebar-nav {
  display: grid;
  align-content: start;
  gap: 6px;
}

.sidebar-nav a {
  display: flex;
  min-height: 42px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 800;
}

.sidebar-nav a:hover,
.sidebar-nav a.is-active {
  border-color: rgba(249, 115, 22, 0.35);
  background: rgba(249, 115, 22, 0.12);
  color: var(--text);
}

.sidebar-status {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 800;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.12);
}

.workspace {
  width: min(1180px, calc(100vw - 320px));
  margin: 0 auto;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(27, 34, 43, 0.88), rgba(18, 25, 34, 0.88));
  box-shadow: var(--shadow);
}

.hero-topbar {
  min-height: 168px;
  align-items: center;
  justify-content: center;
}

.brand-lockup,
.title-row,
.block-actions,
.channel-panel {
  display: flex;
  align-items: center;
}

.brand-lockup {
  gap: 14px;
}

.eyebrow,
.step,
.panel-kicker,
.preview-box span,
.card-kicker {
  margin: 0 0 7px;
  color: #ffd8b7;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Sora", sans-serif;
  letter-spacing: 0;
}

h1 {
  font-size: 42px;
  line-height: 1.05;
}

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

.subtitle,
.panel-copy {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.5;
}

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

.ghost-link,
.ghost-button,
.copy-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.ghost-link:hover,
.ghost-button:hover,
.copy-button:hover {
  border-color: rgba(249, 115, 22, 0.45);
  color: #fff4ea;
}

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

.hub-card {
  display: grid;
  min-height: 178px;
  align-content: space-between;
  gap: 20px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(27, 34, 43, 0.92), rgba(18, 25, 34, 0.92)),
    var(--surface);
  color: var(--text);
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.28);
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.hub-card-active:hover {
  border-color: rgba(249, 115, 22, 0.5);
  background:
    linear-gradient(180deg, rgba(32, 40, 51, 0.96), rgba(18, 25, 34, 0.96)),
    var(--surface);
  transform: translateY(-2px);
}

.hub-card h2 {
  font-size: 26px;
}

.hub-card p {
  max-width: 58ch;
  margin: 10px 0 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.55;
}

.card-status,
.status-pill {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(249, 115, 22, 0.34);
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.11);
  color: #ffd8b7;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.card-status.ready {
  width: 30px;
  min-height: 30px;
  justify-content: center;
  padding: 0;
  border-color: rgba(52, 211, 153, 0.28);
  background: rgba(52, 211, 153, 0.08);
}

.card-status.ready .status-dot {
  width: 9px;
  height: 9px;
}

.card-status.production {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.hub-card-disabled {
  opacity: 0.72;
}

.channel-panel,
.block,
.complete-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(27, 34, 43, 0.9), rgba(18, 25, 34, 0.94));
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.24);
}

.channel-panel {
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  margin-bottom: 16px;
}

.channel-panel label {
  width: min(360px, 100%);
}

.generator {
  display: grid;
  gap: 14px;
}

#trafficForm,
#ropreForm,
#ropreOnboardingForm {
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  align-items: start;
}

#trafficForm .block,
#ropreForm .block,
#ropreOnboardingForm .block {
  min-height: 100%;
}

#trafficForm .complete-panel,
#trafficForm .form-message,
#ropreForm .complete-panel,
#ropreForm .form-message,
#ropreOnboardingForm .complete-panel,
#ropreOnboardingForm .form-message {
  grid-column: 2;
}

#trafficForm .form-message,
#ropreForm .form-message,
#ropreOnboardingForm .form-message {
  margin-top: 0;
}

#ropreForm .form-message,
#ropreOnboardingForm .form-message {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(760px, 100%);
  text-align: center;
}

.block {
  padding: 18px;
}

.block-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.title-row {
  gap: 12px;
}

.step-badge {
  display: grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(249, 115, 22, 0.35);
  border-radius: 10px;
  background: rgba(249, 115, 22, 0.12);
  color: #ffd8b7;
  font-weight: 900;
}

.block-actions {
  gap: 8px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(300px, 0.82fr);
  gap: 16px;
  align-items: stretch;
}

.content-grid-single {
  grid-template-columns: 1fr;
}

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

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

label,
.checkbox-field {
  display: block;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 800;
}

.checkbox-list {
  display: grid;
  max-height: 260px;
  margin-top: 7px;
  padding: 10px;
  gap: 8px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(15, 18, 22, 0.42);
}

.checkbox-option {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.checkbox-option:hover {
  background: rgba(249, 115, 22, 0.1);
}

.checkbox-option input {
  width: 16px;
  min-height: 16px;
  margin: 0;
  accent-color: var(--brand);
}

input,
select,
textarea {
  width: 100%;
  margin-top: 7px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(15, 18, 22, 0.72);
  color: var(--text);
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: rgba(197, 206, 216, 0.58);
}

input,
select {
  min-height: 44px;
}

textarea {
  min-height: 112px;
  padding-top: 12px;
  resize: vertical;
}

select {
  color-scheme: dark;
}

input[readonly] {
  background: rgba(249, 115, 22, 0.08);
  color: #ffd8b7;
  font-weight: 900;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(249, 115, 22, 0.72);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.16);
}

button {
  min-height: 42px;
  border-radius: 10px;
  font-weight: 900;
}

.primary-button {
  width: 100%;
  min-height: 48px;
  border: 0;
  background: linear-gradient(180deg, var(--brand), var(--brand-strong));
  color: #fff;
  box-shadow: 0 16px 36px rgba(249, 115, 22, 0.24);
}

.primary-button:hover {
  filter: brightness(1.06);
}

.secondary-button {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.secondary-button:hover {
  border-color: rgba(249, 115, 22, 0.5);
}

.copy-button.copied,
.primary-button.copied {
  border-color: rgba(249, 115, 22, 0.62);
  background: rgba(249, 115, 22, 0.16);
  color: #ffd8b7;
}

.preview-box {
  display: grid;
  align-content: start;
  min-height: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(16, 22, 30, 0.92), rgba(12, 18, 24, 0.92)),
    var(--surface-2);
}

.preview {
  display: block;
  min-height: 74px;
  padding: 15px;
  border: 1px solid rgba(249, 115, 22, 0.24);
  border-radius: 10px;
  background: rgba(15, 18, 22, 0.72);
  color: #fff8ef;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, ui-monospace, monospace;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.45;
  overflow-wrap: anywhere;
  box-shadow: inset 3px 0 0 var(--brand);
}

.complete-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 0.34fr);
  gap: 12px;
  padding: 14px;
}

.complete-panel .primary-button:only-child {
  grid-column: 1 / -1;
}

.ropre-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 0.34fr);
  gap: 12px;
  margin-top: 8px;
}

.ropre-campaign-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(15, 18, 22, 0.46);
}

.ropre-campaign-panel[hidden] {
  display: none;
}

.ropre-campaign-actions {
  display: grid;
  grid-template-columns: minmax(180px, 0.34fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.ropre-campaign-actions .secondary-button {
  min-height: 42px;
}

.muted-inline {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
}

.ropre-campaign-list {
  display: grid;
  max-height: 280px;
  gap: 8px;
  overflow: auto;
}

.campaign-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: 54px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.campaign-option:hover {
  border-color: rgba(249, 115, 22, 0.42);
  background: rgba(249, 115, 22, 0.08);
}

.campaign-option input {
  width: 16px;
  min-height: 16px;
  margin: 2px 0 0;
  accent-color: var(--brand);
}

.campaign-option span {
  display: grid;
  min-width: 0;
  gap: 4px;
}

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

.campaign-option small {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 750;
}

.empty-list {
  margin: 0;
  padding: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 800;
}

.task-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.35fr);
  gap: 12px;
  margin-top: 18px;
}

.form-message {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 800;
}

.form-message.success {
  color: #a7f3d0;
}

.form-message.error {
  color: #fecdd3;
}

.form-message.warning {
  color: #fde68a;
}

.form-message.report-output {
  display: grid;
  gap: 13px;
  padding: 18px;
  border: 1px solid rgba(249, 115, 22, 0.24);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(16, 22, 30, 0.96), rgba(12, 18, 24, 0.96)),
    var(--surface-2);
  color: var(--text-soft);
  font-weight: 650;
  line-height: 1.55;
  box-shadow: inset 3px 0 0 var(--brand);
}

.form-message.report-output h3 {
  margin: 0;
  color: #ffd8b7;
  font-size: 16px;
  font-weight: 900;
}

.form-message.report-output p,
.form-message.report-output ul {
  margin: 0;
}

.form-message.report-output ul {
  display: grid;
  gap: 6px;
  padding-left: 20px;
}

.form-message.report-output strong {
  color: var(--text);
  font-weight: 900;
}

.form-message.report-output a {
  color: #fb923c;
  font-weight: 900;
  overflow-wrap: anywhere;
}

#ropreForm .form-message.report-output,
#ropreOnboardingForm .form-message.report-output {
  box-shadow: inset 0 3px 0 var(--brand);
}

#ropreForm .form-message.warning.report-output {
  border-color: rgba(251, 191, 36, 0.28);
  box-shadow: inset 0 3px 0 #f59e0b;
}

.ropre-payload-preview {
  min-height: 260px;
  white-space: pre-wrap;
}

.task-preview {
  display: grid;
  gap: 10px;
  margin: 0;
}

.task-preview div {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.task-preview div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.task-preview dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.task-preview dd {
  margin: 3px 0 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.task-preview-box {
  position: sticky;
  top: 18px;
}

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

  .app-sidebar {
    position: static;
    height: auto;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    align-items: center;
  }

  .sidebar-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .sidebar-status {
    grid-column: 1 / -1;
  }

  .workspace {
    width: min(1180px, 100%);
  }
}

@media (max-width: 900px) {
  .content-grid,
  #trafficForm,
  #ropreForm,
  #ropreOnboardingForm {
    grid-template-columns: 1fr;
  }

  #trafficForm .complete-panel,
  #trafficForm .form-message,
  #ropreForm .complete-panel,
  #ropreForm .form-message,
  #ropreOnboardingForm .complete-panel,
  #ropreOnboardingForm .form-message {
    grid-column: auto;
  }

  .hub-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .workspace {
    padding: 18px;
  }

  .app-sidebar,
  .topbar,
  .channel-panel,
  .topbar-actions {
    display: grid;
  }

  .sidebar-nav {
    justify-content: start;
  }

  .channel-panel label {
    width: 100%;
  }

  .field-grid,
  .complete-panel,
  .ropre-actions,
  .task-actions {
    grid-template-columns: 1fr;
  }

  .task-preview-box {
    position: static;
  }

  h1 {
    font-size: 34px;
  }

  .hub-card h2 {
    font-size: 23px;
  }
}

@media (max-width: 560px) {
  .app-sidebar,
  .workspace {
    padding: 14px;
  }

  .topbar,
  .block-header,
  .block-actions {
    display: grid;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .ghost-button,
  .ghost-link,
  .copy-button {
    width: 100%;
  }

  h1 {
    font-size: 30px;
  }
}
