:root {
  --bg: #050b14;
  --panel: #0d1726;
  --panel-2: #111e31;
  --line: #2b425f;
  --line-soft: #36597f;
  --text: #eef6ff;
  --muted: #9eb6d3;
  --primary: #4fc6a8;
  --primary-strong: #2fa98a;
  --warning: #f3b84a;
  --danger: #ef6d5f;
  --shadow: 0 18px 30px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 8% -10%, #1a2f4f, transparent 36%),
    radial-gradient(circle at 92% 0%, #27304b, transparent 28%), var(--bg);
  position: relative;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: "Outfit", sans-serif;
  letter-spacing: 0.01em;
}

.bg-orb {
  position: fixed;
  width: 380px;
  height: 380px;
  filter: blur(46px);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.2;
}

.bg-orb-a {
  background: #50c8aa;
  top: -160px;
  left: -120px;
}

.bg-orb-b {
  background: #f4c05d;
  right: -180px;
  bottom: -220px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  padding: 1.2rem 1.3rem;
  backdrop-filter: blur(9px);
  background: rgba(7, 14, 24, 0.82);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.topbar-actions {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  flex-wrap: wrap;
}

.eyebrow {
  margin: 0;
  color: #8fe3cf;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.75rem;
  font-weight: 700;
}

.topbar h1 {
  margin-top: 0.2rem;
  font-size: clamp(1.2rem, 3vw, 1.8rem);
}

.subtext {
  margin: 0.28rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.workspace-scroll {
  overflow-x: visible;
  padding: 1rem 1rem 1.4rem;
}

.shell {
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  gap: 0.95rem;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: linear-gradient(180deg, rgba(16, 29, 46, 0.96), rgba(11, 21, 34, 0.96));
  box-shadow: var(--shadow);
}

.roster-panel {
  padding: 0.9rem;
  height: fit-content;
}

.panel-head {
  margin-bottom: 0.65rem;
}

.panel-head p {
  margin: 0.34rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.customer-list,
.asset-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.customer-item {
  border: 1px solid #334f70;
  border-radius: 0.75rem;
  padding: 0.58rem 0.62rem;
  cursor: pointer;
  background: #0f1a2a;
  transition: border-color 0.14s ease, transform 0.14s ease;
}

.customer-item:hover,
.customer-item.active {
  border-color: #6ecdb4;
  transform: translateY(-1px);
}

.customer-item p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.form-stack,
.form-grid {
  display: grid;
  gap: 0.58rem;
}

.form-stack {
  margin-top: 0.8rem;
}

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

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

label,
fieldset {
  display: grid;
  gap: 0.25rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.help-label {
  position: relative;
  padding-right: 2rem;
}

.help-label .label-text {
  display: inline-block;
  max-width: calc(100% - 2rem);
}

.help-pop {
  position: absolute;
  top: -0.04rem;
  right: 0;
  z-index: 10;
}

.help-pop summary {
  list-style: none;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  border: 1px solid #6b88ac;
  background: #102238;
  color: #cde4ff;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  user-select: none;
}

.help-pop summary::-webkit-details-marker {
  display: none;
}

.help-pop summary:hover {
  border-color: #84b4ec;
  color: #e8f2ff;
}

.help-pop[open] summary {
  border-color: #73d8be;
  color: #9ff2dd;
  background: #123329;
}

.help-popover {
  margin-top: 0.38rem;
  width: min(280px, calc(100vw - 2.2rem));
  border: 1px solid #4a6a8f;
  border-radius: 0.62rem;
  background: #0c1828;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.32);
  padding: 0.55rem 0.6rem;
  color: #d7e7fb;
  font-size: 0.76rem;
  line-height: 1.35;
}

.help-popover code {
  background: #13263e;
  border: 1px solid #304b6d;
  border-radius: 0.3rem;
  padding: 0.05rem 0.2rem;
  font-size: 0.72rem;
  color: #e4f0ff;
}

input,
textarea,
select {
  border: 1px solid #355171;
  border-radius: 0.65rem;
  background: #0a1421;
  color: var(--text);
  font: inherit;
  padding: 0.6rem 0.68rem;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #73d8be;
  border-color: #73d8be;
}

.channel-fieldset {
  margin: 0;
  border: 1px solid #355171;
  border-radius: 0.65rem;
  padding: 0.5rem;
}

.channel-fieldset legend {
  color: #c8efe4;
  font-size: 0.84rem;
  padding: 0 0.25rem;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

#customerDefaultsHint {
  margin: 0;
}

.choice-chip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid #355171;
  border-radius: 999px;
  background: #0f1a2a;
  padding: 0.36rem 0.56rem;
  color: #d9ebff;
}

.choice-chip input {
  width: 14px;
  height: 14px;
  accent-color: var(--primary);
}

.btn {
  border-radius: 0.68rem;
  border: 1px solid transparent;
  padding: 0.58rem 0.82rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, #63d8be, #3fbea1 55%, #27a78b);
  color: #06261f;
}

.btn-secondary {
  border-color: #446788;
  background: #102238;
  color: #e0efff;
}

.btn-small {
  font-size: 0.78rem;
  padding: 0.3rem 0.45rem;
  border-radius: 0.54rem;
}

.message {
  min-height: 1.1rem;
  margin: 0;
  font-size: 0.84rem;
  color: #9bc3d8;
}

.message.success {
  color: #8de3c9;
}

.message.error {
  color: #ff9c91;
}

.main-grid {
  display: grid;
  gap: 0.9rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 0.6rem;
}

.metric-card {
  border: 1px solid #345172;
  border-radius: 0.85rem;
  background: linear-gradient(170deg, #101d30, #0c1727);
  padding: 0.72rem;
}

.metric-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.metric-card strong {
  display: block;
  margin-top: 0.28rem;
  font-size: 1.5rem;
}

.ops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 0.8rem;
}

.ops-grid .panel {
  padding: 0.85rem;
}

.integration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.7rem;
}

.integration-card {
  border: 1px solid #3c5b80;
  border-radius: 0.75rem;
  background: #0f1a2b;
  padding: 0.6rem;
}

.integration-card h3 {
  margin: 0;
  font-size: 0.92rem;
}

.range-value {
  color: #d5f2ea;
  font-size: 0.86rem;
}

.asset-list {
  margin-top: 0.65rem;
  max-height: 168px;
  overflow: auto;
}

.asset-item {
  border: 1px solid #334f70;
  border-radius: 0.68rem;
  padding: 0.5rem;
  background: #0f1a2a;
}

.asset-item p,
.asset-item small {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
}

.ad-output-panel {
  padding: 0.9rem;
}

.ad-run-list {
  display: grid;
  gap: 0.75rem;
}

.ad-run {
  border: 1px solid var(--line-soft);
  border-radius: 0.85rem;
  padding: 0.72rem;
  background: #0f1a2a;
}

.ad-run-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.ad-run-head p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.option-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.option-nav-btn {
  min-width: 2rem;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.option-nav-label {
  color: #cce1fb;
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  min-width: 7.6rem;
  text-align: center;
}

.option-nav-inline {
  margin-top: 0.45rem;
  margin-left: 0;
  justify-content: flex-start;
}

.ad-options {
  margin-top: 0.62rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 0.55rem;
}

.ad-option {
  border: 1px solid #3d5e83;
  border-radius: 0.75rem;
  background: #102036;
  padding: 0.6rem;
}

.ad-option h4 {
  font-size: 0.95rem;
}

.ad-option p {
  margin: 0.25rem 0 0;
  color: #bfd3ec;
  font-size: 0.82rem;
}

.ad-option-context {
  color: #9cb9da;
  font-size: 0.76rem;
}

.publish-actions {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.ad-preview {
  margin-top: 0.5rem;
}

.preview-label {
  margin: 0 0 0.25rem;
  color: #d6e8ff;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.preview-card {
  border: 1px solid #d0d7e2;
  border-radius: 0.72rem;
  background: #ffffff;
  padding: 0.5rem;
  max-width: 320px;
}

.platform-preview {
  margin-bottom: 0.42rem;
}

.facebook-feed-card {
  background: #fff;
}

.facebook-top {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.42rem;
}

.facebook-avatar {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  background: #d8e7fb;
  color: #163b70;
  display: grid;
  place-items: center;
  font-size: 0.76rem;
  font-weight: 700;
}

.facebook-meta {
  display: grid;
  gap: 0.05rem;
}

.facebook-meta strong {
  color: #1f2a37;
  font-size: 0.79rem;
  line-height: 1.2;
}

.facebook-meta span {
  color: #566172;
  font-size: 0.71rem;
}

.preview-body {
  margin: 0;
  color: #111827;
  font-size: 0.8rem;
  line-height: 1.34;
}

.preview-media {
  margin-top: 0.42rem;
  height: 172px;
  border-radius: 0.42rem;
  border: 1px solid #dae1ec;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  color: #5d6674;
  background: #eef2f7;
  overflow: hidden;
}

.facebook-media {
  aspect-ratio: 1.91 / 1;
  height: auto;
  min-height: 150px;
}

.preview-media img,
.preview-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-bottom {
  margin-top: 0.45rem;
  display: grid;
  gap: 0.2rem;
}

.facebook-link-row {
  border: 1px solid #e3e8ef;
  border-radius: 0.45rem;
  padding: 0.45rem;
  background: #f6f7f9;
}

.facebook-domain {
  margin: 0;
  color: #67758a;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.preview-bottom strong {
  font-size: 0.8rem;
  color: #161f2d;
}

.preview-bottom p {
  margin: 0;
  color: #4e5b6f;
  font-size: 0.74rem;
}

.preview-cta {
  justify-self: end;
  padding: 0.26rem 0.48rem;
  border-radius: 0.35rem;
  border: 1px solid #d0d7e2;
  background: #ffffff;
  color: #1f2a37;
  font-size: 0.69rem;
  font-weight: 600;
}

.google-search-card {
  max-width: 360px;
}

.google-url-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.google-url-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  padding: 0.08rem 0.25rem;
  border: 1px solid #dadce0;
  border-radius: 999px;
  color: #4d5156;
  font-size: 0.62rem;
  line-height: 1;
}

.google-url {
  margin: 0;
  color: #188038;
  font-size: 0.77rem;
}

.google-headline {
  margin: 0.2rem 0 0;
  color: #1a0dab;
  font-size: 0.95rem;
  line-height: 1.33;
}

.google-desc {
  margin: 0.24rem 0 0;
  color: #4d5156;
  font-size: 0.79rem;
  line-height: 1.36;
}

.platform-block {
  margin-top: 0.5rem;
  border-top: 1px dashed #39557a;
  padding-top: 0.5rem;
}

.platform-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.38rem;
}

.platform-head h5 {
  margin: 0;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #cce3ff;
}

.copy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.3rem;
}

.field-sections {
  display: grid;
  gap: 0.5rem;
}

.field-section {
  display: grid;
  gap: 0.32rem;
}

.field-section-title {
  margin: 0;
  color: #9bc4ea;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.advanced-fields {
  border: 1px dashed #3f5f84;
  border-radius: 0.62rem;
  background: #0c1728;
  padding: 0.4rem;
}

.advanced-fields summary {
  cursor: pointer;
  color: #cde4ff;
  font-size: 0.78rem;
  font-weight: 700;
}

.advanced-fields-note {
  margin: 0.35rem 0 0.4rem;
  color: #92aecf;
  font-size: 0.74rem;
}

.copy-row {
  border: 1px solid #355171;
  border-radius: 0.6rem;
  background: #0b1524;
  padding: 0.38rem;
  display: grid;
  gap: 0.28rem;
  position: relative;
}

.copy-label-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.35rem;
}

.copy-label {
  color: #9eb6d3;
  font-size: 0.71rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.copy-help {
  position: relative;
  z-index: 4;
}

.copy-help summary {
  list-style: none;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  border: 1px solid #6b88ac;
  background: #102238;
  color: #cde4ff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  user-select: none;
}

.copy-help summary::-webkit-details-marker {
  display: none;
}

.copy-help summary:hover {
  border-color: #84b4ec;
  color: #e8f2ff;
}

.copy-help[open] summary {
  border-color: #73d8be;
  color: #9ff2dd;
  background: #123329;
}

.copy-help-popover {
  position: absolute;
  top: 1.2rem;
  right: 0;
  width: min(250px, calc(100vw - 2.2rem));
  border: 1px solid #4a6a8f;
  border-radius: 0.58rem;
  background: #0c1828;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.34);
  padding: 0.5rem 0.55rem;
  color: #d7e7fb;
  font-size: 0.74rem;
  line-height: 1.32;
}

.pack-field {
  width: 100%;
  border: 1px solid #446385;
  border-radius: 0.45rem;
  background: #0f1a2a;
  color: #ebf5ff;
  font-size: 0.77rem;
  padding: 0.32rem 0.4rem;
  line-height: 1.35;
}

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

.badge {
  border: 1px solid #406384;
  border-radius: 999px;
  padding: 0.15rem 0.42rem;
  font-size: 0.7rem;
  color: #d2e4f9;
}

.badge.warn {
  border-color: #97711f;
  color: #ffd994;
}

.badge.ok {
  border-color: #2f7f56;
  color: #a7f0ca;
}

.empty-col {
  color: #8ba8c9;
  font-size: 0.79rem;
  margin: 0;
}

.queue-list {
  display: grid;
  gap: 0.65rem;
}

.queue-job {
  border: 1px solid #405f84;
  border-radius: 0.75rem;
  background: #101f33;
  padding: 0.6rem;
}

.queue-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.55rem;
}

.queue-meta {
  margin: 0.3rem 0 0;
  color: #bfd3ec;
  font-size: 0.82rem;
}

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

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

  .topbar .btn {
    width: 100%;
  }

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

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