:root {
  --bg: #f4f1ea;
  --panel: #fffaf1;
  --ink: #171717;
  --muted: #63605a;
  --line: #ded6c7;
  --accent: #007f73;
  --accent-dark: #005f57;
  --hot: #d9382f;
  --gold: #f0b429;
  --plum: #4e2d6f;
  --shadow: 0 22px 70px rgba(24, 24, 24, .13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(0, 127, 115, .08) 1px, transparent 1px),
    linear-gradient(rgba(78, 45, 111, .08) 1px, transparent 1px),
    var(--bg);
  background-size: 44px 44px;
}

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

button {
  cursor: pointer;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr);
  gap: 24px;
  align-items: center;
  padding: 32px 0;
}

.composer-panel,
.live-panel {
  background: rgba(255, 250, 241, .94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.composer-panel {
  padding: clamp(20px, 4vw, 34px);
}

.brand-row,
.panel-top,
.audio-box,
.ad-actions,
.message-card,
.message-head {
  display: flex;
  align-items: center;
}

.brand-row {
  gap: 16px;
}

.brand-mark {
  width: clamp(170px, 24vw, 240px);
  display: grid;
  align-items: center;
}

.brand-logo {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 10px 24px rgba(78, 45, 111, .24));
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-dark);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 680px;
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 4.25rem);
  line-height: .96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.5rem;
}

.stream-snapshot {
  margin: 28px 0;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.video-frame {
  position: relative;
  min-height: 136px;
  overflow: hidden;
  border-radius: 8px;
  background:
    radial-gradient(circle at 24% 28%, rgba(240, 180, 41, .9) 0 10%, transparent 11%),
    linear-gradient(135deg, #1b1b1b, #43255f 58%, #007f73);
}

.equalizer {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 22px;
  height: 44px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  align-items: end;
}

.equalizer span {
  display: block;
  border-radius: 6px 6px 0 0;
  background: rgba(255, 250, 241, .86);
  animation: pulse 1s ease-in-out infinite alternate;
}

.equalizer span:nth-child(1) { height: 34%; }
.equalizer span:nth-child(2) { height: 70%; animation-delay: .1s; }
.equalizer span:nth-child(3) { height: 46%; animation-delay: .2s; }
.equalizer span:nth-child(4) { height: 86%; animation-delay: .3s; }
.equalizer span:nth-child(5) { height: 55%; animation-delay: .4s; }

.live-chip,
.viewer-count,
.ad-badge {
  position: absolute;
  border-radius: 999px;
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
}

.live-chip {
  top: 12px;
  left: 12px;
  padding: 6px 9px;
  background: var(--hot);
}

.viewer-count {
  right: 12px;
  bottom: 12px;
  padding: 6px 9px;
  background: rgba(0, 0, 0, .58);
}

.snapshot-copy {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.snapshot-copy strong,
.snapshot-copy span,
.audio-title,
.audio-status {
  display: block;
}

.snapshot-copy span,
.audio-status,
.form-meta,
.message-head span {
  color: var(--muted);
  font-size: .9rem;
}

.message-form {
  display: grid;
  gap: 10px;
}

label {
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input {
  height: 48px;
  padding: 0 14px;
}

select {
  height: 48px;
  padding: 0 42px 0 14px;
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%),
    #fff;
  background-position:
    calc(100% - 22px) 21px,
    calc(100% - 16px) 21px,
    0 0;
  background-size:
    6px 6px,
    6px 6px,
    100% 100%;
  background-repeat: no-repeat;
}

textarea {
  min-height: 128px;
  resize: vertical;
  padding: 14px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 127, 115, .16);
}

.voice-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 10px;
}

.preview-voice {
  width: 100%;
}

.form-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.audio-box {
  justify-content: space-between;
  gap: 16px;
  margin-top: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.audio-title {
  font-weight: 800;
}

.icon-button {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--plum);
}

.icon-button.is-recording {
  background: var(--hot);
  animation: breathe 1s ease-in-out infinite alternate;
}

svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

audio {
  width: 100%;
}

.primary-button,
.ghost-button {
  min-height: 48px;
  border-radius: 8px;
  font-weight: 800;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  border: 0;
  color: #fff;
  background: var(--accent);
}

.primary-button:disabled {
  cursor: not-allowed;
  background: #969189;
}

.ghost-button {
  padding: 0 14px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

.live-panel {
  min-height: min(760px, calc(100vh - 64px));
  padding: 22px;
  display: flex;
  flex-direction: column;
}

.panel-top {
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.live-messages {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 18px;
  overflow: auto;
}

.empty-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 24px;
}

.message-card {
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.message-avatar {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--plum));
}

.message-content {
  min-width: 0;
  flex: 1;
}

.message-head {
  justify-content: space-between;
  gap: 12px;
}

.message-card p {
  margin: 7px 0 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.ad-dialog {
  width: min(560px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.ad-dialog::backdrop {
  background: rgba(0, 0, 0, .58);
  backdrop-filter: blur(5px);
}

.ad-shell {
  overflow: hidden;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.ad-media {
  position: relative;
  min-height: 280px;
  padding: 24px;
  display: grid;
  align-items: end;
  background:
    linear-gradient(135deg, rgba(0, 127, 115, .96), rgba(78, 45, 111, .96)),
    #1d1b20;
  color: #fff;
}

.network-ad-media {
  position: relative;
  min-height: 330px;
  padding: 28px;
  display: grid;
  place-content: center;
  gap: 10px;
  text-align: center;
  color: #fff;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .12) 0 12px, transparent 12px 24px),
    linear-gradient(135deg, #121417, #007f73 62%, #4e2d6f);
}

.network-ad-media[hidden] {
  display: none;
}

.network-ad-media span {
  color: rgba(255, 255, 255, .74);
  font-size: .82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.network-ad-media strong {
  font-size: clamp(1.25rem, 3vw, 2rem);
  line-height: 1.12;
}

.network-ad-media small {
  max-width: 360px;
  color: rgba(255, 255, 255, .74);
}

.ad-direct-link {
  min-width: 180px;
  min-height: 44px;
  display: inline-grid;
  place-items: center;
  justify-self: center;
  padding: 0 16px;
  color: #171717;
  background: var(--gold);
  border-radius: 8px;
  font-weight: 900;
  text-decoration: none;
}



.ad-badge {
  top: 18px;
  left: 18px;
  padding: 7px 10px;
  background: rgba(0, 0, 0, .45);
}

.ad-product {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 18px;
  align-items: center;
}

.ad-product h3 {
  margin-bottom: 6px;
  font-size: 1.8rem;
}

.ad-product p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, .82);
}

.ad-phone {
  height: 132px;
  padding: 14px;
  border: 4px solid rgba(255, 255, 255, .9);
  border-radius: 20px;
  background: rgba(255, 255, 255, .14);
}

.ad-phone span {
  display: block;
  height: 13px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
}

.ad-phone span:nth-child(2) {
  width: 72%;
}

.ad-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 8px;
  background: rgba(255, 255, 255, .24);
}

.ad-progress span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--gold);
}

.ad-actions {
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
}

.ad-actions .primary-button {
  width: auto;
  min-width: 170px;
  padding: 0 18px;
}


@keyframes pulse {
  to { transform: scaleY(.7); opacity: .72; }
}

@keyframes breathe {
  to { transform: scale(.94); }
}

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

  .live-panel {
    min-height: 420px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding: 10px 0;
  }

  .stream-snapshot {
    grid-template-columns: 1fr;
  }

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

  .brand-row,
  .ad-actions,
  .panel-top {
    align-items: flex-start;
  }

  .brand-row,
  .panel-top,
  .ad-actions {
    flex-direction: column;
  }

  .ad-actions .primary-button {
    width: 100%;
  }

  .ad-product {
    grid-template-columns: 1fr;
  }
}
