/* ============================================================
   WARNING LAB — Warning-format ad agent
   ============================================================ */

@font-face {
  font-family: 'Anton';
  src: url('./assets/fonts/Anton-400.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('./assets/fonts/Inter-400.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('./assets/fonts/Inter-600.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('./assets/fonts/Inter-800.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('./assets/fonts/Inter-900.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('./assets/fonts/IBMPlexMono-400.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('./assets/fonts/IBMPlexMono-500.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('./assets/fonts/IBMPlexMono-600.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #09090a;
  --bg-raised: #0e0e10;
  --panel: #121214;
  --panel-2: #17171a;
  --panel-3: #1d1d21;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f3f0e8;
  --text-soft: #cbc8c0;
  --muted: #8d8d94;
  --muted-2: #65656d;
  --red: #ff3b30;
  --red-bright: #ff4d3f;
  --red-deep: #b3130c;
  --red-dark: #390b08;
  --amber: #ffc44d;
  --green: #66d992;
  --blue: #72b7ff;
  --radius-panel: 20px;
  --radius-input: 11px;
  --font-ui: 'Inter', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  --font-display: 'Anton', 'Arial Narrow', Impact, 'Arial Black', sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
  --shadow-panel: 0 28px 70px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(1100px 620px at 88% -10%, rgba(255, 59, 48, 0.13), transparent 60%),
    radial-gradient(900px 600px at -6% 18%, rgba(92, 102, 135, 0.075), transparent 62%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 84px 84px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 84%);
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

::selection {
  color: #fff;
  background: var(--red-deep);
}

.svg-defs {
  position: fixed;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: none;
  vertical-align: middle;
}

.page-noise {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
  mix-blend-mode: screen;
}

/* ---------- Topbar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  height: 64px;
  padding: 0 30px;
  display: flex;
  align-items: center;
  gap: 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 9, 10, 0.8);
  backdrop-filter: blur(22px) saturate(1.2);
}

.topbar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 59, 48, 0.32) 18%, transparent 38%);
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  flex: 0 0 auto;
}

.brand-mark {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--red);
  color: #09090a;
  box-shadow: 0 0 30px rgba(255, 59, 48, 0.28);
}

.brand-mark .icon {
  width: 20px;
  height: 20px;
}

.brand-type {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.045em;
  line-height: 1;
}

.brand-type span {
  color: var(--red);
}

.brand-sub {
  align-self: center;
  padding-left: 10px;
  border-left: 1px solid var(--line-strong);
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  line-height: 1.35;
}

.topbar-path {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.topbar-path strong {
  overflow: hidden;
  color: var(--muted);
  font-weight: 400;
  text-overflow: ellipsis;
}

.path-slash {
  color: #3b3b40;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
}

.engine-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.07em;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.engine-pill:hover {
  border-color: var(--line-strong);
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.045);
}

.engine-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(102, 217, 146, 0.75);
}

.engine-pill.is-live .engine-dot {
  background: var(--red);
  box-shadow: 0 0 10px rgba(255, 59, 48, 0.8);
  animation: blink 1.8s ease-in-out infinite;
}

.ghost-button {
  height: 34px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  transition: 160ms ease;
}

.ghost-button:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.045);
}

.ghost-button .icon {
  width: 14px;
  height: 14px;
}

.user-chip {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: linear-gradient(145deg, #2d2d31, #171719);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* ---------- Page & hero ---------- */

.page {
  width: min(1740px, 100%);
  margin: 0 auto;
  padding: 0 30px 32px;
}

.hero {
  min-height: 208px;
  padding: 38px 2px 32px;
  display: flex;
  align-items: flex-end;
  gap: 40px;
  justify-content: space-between;
  animation: reveal 700ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-copy {
  max-width: 820px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.13em;
  white-space: nowrap;
}

.eyebrow-icon {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: var(--red);
  color: #0a0a0b;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 0 18px rgba(255, 59, 48, 0.25);
}

.eyebrow-rule {
  width: 34px;
  height: 1px;
  background: var(--line-strong);
}

.eyebrow-cn {
  color: var(--muted-2);
  letter-spacing: 0.05em;
}

.hero h1 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: clamp(40px, 4.2vw, 64px);
  font-weight: 900;
  letter-spacing: -0.065em;
  line-height: 1.03;
}

.red-word {
  position: relative;
  display: inline-block;
  color: var(--red);
  text-shadow: 0 0 50px rgba(255, 59, 48, 0.16);
}

.red-word::after {
  content: '';
  position: absolute;
  left: 0.04em;
  right: 0.01em;
  bottom: -0.02em;
  height: 0.075em;
  border-radius: 2px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  animation: underline-in 850ms 560ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero p {
  margin: 18px 0 0;
  max-width: 690px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.hero-protocol {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding-bottom: 4px;
  flex: 0 0 auto;
}

.protocol-stat {
  min-width: 82px;
  padding: 4px 18px;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.protocol-stat:first-child {
  border-left: 0;
  padding-left: 0;
}

.protocol-stat b {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: 0.02em;
}

.protocol-stat b span {
  color: var(--muted);
  font-size: 16px;
}

.protocol-stat > span {
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.45;
}

.protocol-note {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 210px;
  margin-left: 10px;
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.protocol-note .icon {
  width: 21px;
  height: 21px;
  color: var(--red);
}

.protocol-note p {
  margin: 0;
  color: var(--text-soft);
  font-size: 10px;
  line-height: 1.5;
}

.protocol-note small {
  display: block;
  margin-top: 4px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.01em;
}

/* ---------- Studio grid & panels ---------- */

.studio {
  display: grid;
  grid-template-columns: 352px minmax(480px, 1fr) 374px;
  grid-template-areas: 'brief output preview';
  align-items: start;
  gap: 18px;
}

.brief-panel { grid-area: brief; }
.output-panel { grid-area: output; }
.preview-panel { grid-area: preview; position: sticky; top: 82px; }

.panel {
  position: relative;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 24%),
    linear-gradient(180deg, rgba(20, 20, 23, 0.97), rgba(14, 14, 16, 0.97));
  box-shadow: var(--shadow-panel);
}

.panel::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.02), transparent 22%, transparent 78%, rgba(255, 59, 48, 0.025));
}

.brief-panel { animation: reveal 700ms 80ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.output-panel { animation: reveal 700ms 140ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.preview-panel { animation: reveal 700ms 200ms cubic-bezier(0.16, 1, 0.3, 1) both; }

.panel-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.heading-main {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-width: 0;
}

.step-index {
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 59, 48, 0.32);
  border-radius: 7px;
  background: rgba(255, 59, 48, 0.07);
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.02em;
}

.panel-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.panel-heading p {
  margin: 4px 0 0;
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.45;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-2);
  font-size: 9px;
  white-space: nowrap;
  cursor: pointer;
  transition: 150ms ease;
}

.text-button .icon {
  width: 12px;
  height: 12px;
}

.text-button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

/* ---------- Brief form ---------- */

.brief-form {
  position: relative;
  z-index: 1;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(106px, 0.8fr);
  gap: 10px;
}

.field label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.015em;
}

.label-note {
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.02em;
}

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

.field-label-row label {
  margin: 0;
}

.upload-count {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
}

input[type='text'],
input[type='url'],
input[type='password'],
textarea,
select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: var(--radius-input);
  background: #0b0b0d;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.5;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

input[type='text'],
input[type='url'],
input[type='password'] {
  height: 40px;
  padding: 0 11px;
}

textarea {
  min-height: 66px;
  padding: 10px 11px;
  resize: vertical;
}

input:hover,
textarea:hover,
select:hover {
  border-color: rgba(255, 255, 255, 0.13);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(255, 59, 48, 0.56);
  background: #0d0c0d;
  box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.075);
}

input::placeholder,
textarea::placeholder {
  color: #53535a;
}

.input-shell {
  position: relative;
}

.input-shell input {
  padding-right: 52px;
}

.input-hint {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #47474e;
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  pointer-events: none;
}

.select-shell {
  position: relative;
}

.select-shell select {
  height: 40px;
  padding: 0 28px 0 10px;
  appearance: none;
  cursor: pointer;
  font-size: 10px;
}

.select-shell .icon {
  position: absolute;
  right: 9px;
  top: 50%;
  width: 13px;
  height: 13px;
  transform: translateY(-50%);
  color: var(--muted-2);
  pointer-events: none;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0b0b0d;
}

.segmented button {
  height: 30px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  cursor: pointer;
  transition: 160ms ease;
}

.segmented button:hover {
  color: var(--text-soft);
}

.segmented button.active {
  background: var(--text);
  color: #0c0c0d;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.tag-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.018);
  color: var(--muted-2);
  font-size: 9px;
  cursor: pointer;
  transition: 150ms ease;
}

.tag:hover {
  color: var(--text-soft);
  border-color: var(--line-strong);
}

.tag.active {
  border-color: rgba(255, 59, 48, 0.32);
  background: rgba(255, 59, 48, 0.08);
  color: #ff8b82;
}

.upload-zone {
  position: relative;
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.014);
  cursor: pointer;
  transition: 160ms ease;
}

.upload-zone:hover,
.upload-zone.is-dragging {
  border-color: rgba(255, 59, 48, 0.38);
  background: rgba(255, 59, 48, 0.035);
}

.upload-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.upload-icon {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted-2);
}

.upload-icon .icon {
  width: 14px;
  height: 14px;
}

.upload-empty p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.upload-empty > span:last-child {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.03em;
}

.upload-thumbs {
  display: none;
  width: 100%;
  gap: 7px;
  overflow-x: auto;
}

.upload-zone.has-images .upload-empty {
  display: none;
}

.upload-zone.has-images .upload-thumbs {
  display: flex;
}

.upload-thumb {
  position: relative;
  width: 54px;
  height: 64px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  overflow: hidden;
  background: #080809;
}

.upload-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.upload-thumb button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  cursor: pointer;
}

.upload-thumb button .icon {
  width: 9px;
  height: 9px;
}

.upload-add {
  width: 54px;
  height: 64px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
}

.upload-add .icon {
  width: 15px;
  height: 15px;
}

.primary-button {
  position: relative;
  width: 100%;
  height: 51px;
  padding: 0 9px 0 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  background: linear-gradient(180deg, #ff4b40, #e92b20);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow:
    0 12px 28px rgba(197, 22, 15, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.26);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.primary-button::before {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 48%);
  pointer-events: none;
}

.primary-button:hover {
  filter: brightness(1.06);
  box-shadow:
    0 16px 35px rgba(197, 22, 15, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.primary-button:active {
  transform: translateY(0) scale(0.995);
}

.primary-button:disabled {
  opacity: 0.75;
  cursor: wait;
  transform: none;
}

.button-spark {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.14);
}

.button-spark .icon {
  width: 14px;
  height: 14px;
}

.button-text {
  text-align: left;
}

.button-arrow {
  margin-left: auto;
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.08);
}

.button-arrow .icon {
  width: 15px;
  height: 15px;
}

.primary-button.compact {
  width: auto;
  height: 40px;
  padding: 0 15px;
  font-size: 11px;
}

.primary-button.compact .icon {
  width: 14px;
  height: 14px;
}

.primary-button.is-loading .button-spark .icon {
  animation: spin 1.1s linear infinite;
}

.provider-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 2px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.provider-line > span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.provider-line b {
  color: var(--muted);
  font-weight: 500;
}

.provider-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--muted-2);
}

.provider-dot.text.is-live,
.provider-dot.voice.is-live,
.provider-dot.video.is-live {
  background: var(--green);
  box-shadow: 0 0 7px rgba(102, 217, 146, 0.7);
}

.provider-line button {
  margin-left: auto;
  padding: 2px;
  border: 0;
  background: none;
  color: #4d4d54;
  font-family: var(--font-mono);
  font-size: 6.5px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.provider-line button:hover {
  color: var(--text-soft);
}

/* ---------- Output panel ---------- */

.output-panel {
  min-height: 780px;
  display: flex;
  flex-direction: column;
}

.output-heading {
  align-items: flex-start;
}

.agent-path {
  position: relative;
  z-index: 1;
  margin-top: 17px;
  min-height: 35px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #0b0b0d;
}

.agent-path-item {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #55555d;
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.025em;
  white-space: nowrap;
  transition: color 220ms ease;
}

.agent-path-item i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #3b3b41;
  transition: 220ms ease;
}

.agent-path-item.done {
  color: var(--muted);
}

.agent-path-item.done i {
  background: var(--green);
  box-shadow: 0 0 7px rgba(102, 217, 146, 0.5);
}

.agent-path-item.active {
  color: var(--text);
}

.agent-path-item.active i {
  background: var(--red);
  box-shadow: 0 0 8px rgba(255, 59, 48, 0.8);
  animation: blink 900ms ease-in-out infinite;
}

.agent-path-line {
  min-width: 8px;
  flex: 1;
  height: 1px;
  background: #29292e;
}

.path-status {
  margin-left: 6px;
  padding: 3px 6px;
  border: 1px solid rgba(102, 217, 146, 0.16);
  border-radius: 4px;
  background: rgba(102, 217, 146, 0.05);
  color: #66d992;
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.05em;
}

.path-status.is-running {
  border-color: rgba(255, 59, 48, 0.24);
  background: rgba(255, 59, 48, 0.07);
  color: var(--red);
}

.tabbar {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 20px;
  margin-top: 10px;
  border-bottom: 1px solid var(--line);
}

.tab {
  position: relative;
  height: 40px;
  padding: 0 1px;
  border: 0;
  background: transparent;
  color: var(--muted-2);
  font-size: 10px;
  cursor: pointer;
  transition: color 160ms ease;
}

.tab span {
  margin-left: 3px;
  color: #48484f;
  font-family: var(--font-mono);
  font-size: 7px;
}

.tab:hover {
  color: var(--text-soft);
}

.tab.active {
  color: var(--text);
}

.tab.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--red);
  box-shadow: 0 -3px 12px rgba(255, 59, 48, 0.22);
}

.tab.active span {
  color: var(--red);
}

.output-body {
  position: relative;
  z-index: 1;
  flex: 1;
  padding: 18px 1px 12px;
  min-height: 480px;
}

.output-body.is-switching {
  animation: content-in 380ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* strategy */

.insight-card {
  position: relative;
  overflow: hidden;
  padding: 17px 16px 15px;
  border: 1px solid rgba(255, 59, 48, 0.16);
  border-radius: 12px;
  background:
    radial-gradient(340px 160px at 95% 0%, rgba(255, 59, 48, 0.12), transparent 70%),
    #121011;
}

.insight-card::before {
  content: '“';
  position: absolute;
  top: -25px;
  right: 12px;
  color: rgba(255, 59, 48, 0.09);
  font-family: Georgia, serif;
  font-size: 118px;
  line-height: 1;
}

.insight-kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #ff7168;
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.08em;
}

.insight-kicker .icon {
  width: 11px;
  height: 11px;
}

.insight-card h3 {
  position: relative;
  margin: 10px 0 7px;
  max-width: 470px;
  color: var(--text);
  font-size: 19px;
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: -0.025em;
}

.insight-card h3 em {
  color: #ff776d;
  font-style: normal;
}

.insight-card p {
  position: relative;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.audience-line {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 13px;
}

.audience-line span {
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.02em;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0 9px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.09em;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.sellpoint-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sellpoint {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.015);
  transition: 170ms ease;
}

.sellpoint:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.026);
}

.sellpoint-index {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
}

.sellpoint.is-used .sellpoint-index {
  border-color: rgba(255, 59, 48, 0.24);
  background: rgba(255, 59, 48, 0.07);
  color: #ff736a;
}

.sellpoint-copy {
  min-width: 0;
}

.sellpoint-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.sellpoint h4 {
  margin: 0;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.used-badge {
  padding: 2px 5px;
  border-radius: 3px;
  background: rgba(255, 59, 48, 0.1);
  color: #ff7b72;
  font-family: var(--font-mono);
  font-size: 6px;
  letter-spacing: 0.04em;
}

.sellpoint p {
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sellpoint-score {
  text-align: right;
}

.sellpoint-score b {
  display: block;
  color: var(--text-soft);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 400;
  line-height: 1;
}

.sellpoint-score span {
  display: block;
  margin-top: 3px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 5.5px;
  letter-spacing: 0.06em;
}

.quality-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.quality-item {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 9px 10px;
  border: 1px solid rgba(102, 217, 146, 0.11);
  border-radius: 8px;
  background: rgba(102, 217, 146, 0.025);
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.45;
}

.quality-item .icon {
  width: 12px;
  height: 12px;
  margin-top: 1px;
  color: var(--green);
}

.quality-item b {
  display: block;
  color: var(--text-soft);
  font-size: 9px;
  font-weight: 600;
}

/* warnings */

.warning-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.warning-card {
  position: relative;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #101012;
  transition: border-color 180ms ease, background 180ms ease;
}

.warning-card:hover {
  border-color: var(--line-strong);
}

.warning-card.is-selected {
  border-color: rgba(255, 59, 48, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 59, 48, 0.035), transparent 34%),
    #101012;
}

.warning-card-head {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.warning-num {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--red);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  box-shadow: 0 0 14px rgba(255, 59, 48, 0.2);
}

.warning-card-title {
  min-width: 0;
  flex: 1;
}

.warning-card-title h4 {
  margin: 0;
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 600;
}

.warning-card-title p {
  margin: 3px 0 0;
  color: var(--muted-2);
  font-size: 8px;
}

.warning-time {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 7px;
  white-space: nowrap;
}

.warning-quote {
  margin: 13px 0 4px;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.42;
  letter-spacing: -0.027em;
}

.warning-quote .accent {
  color: #ff7168;
}

.warning-support {
  margin: 0;
  color: var(--muted-2);
  font-size: 8.5px;
  line-height: 1.55;
}

.tone-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-top: 11px;
}

.tone-button {
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.016);
  color: var(--muted-2);
  text-align: left;
  cursor: pointer;
  transition: 150ms ease;
}

.tone-button:hover {
  color: var(--text-soft);
  border-color: var(--line-strong);
}

.tone-button.active {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.055);
  color: var(--text-soft);
}

.tone-button b {
  display: block;
  font-size: 8px;
  font-weight: 600;
}

.tone-button span {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: #58585f;
  font-size: 6.5px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tone-button.active span {
  color: var(--muted);
}

.warning-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.045);
}

.warning-foot .mini-tag {
  padding: 3px 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 6px;
  letter-spacing: 0.03em;
}

.warning-foot .edit-warning {
  margin-left: auto;
  padding: 3px;
  border: 0;
  background: none;
  color: var(--muted-2);
  font-size: 7px;
  cursor: pointer;
}

.warning-foot .edit-warning:hover {
  color: var(--text-soft);
}

.copy-mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 10px;
}

.copy-mini-card {
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.015);
}

.copy-mini-card span {
  display: block;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.06em;
}

.copy-mini-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

/* storyboard */

.storyboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.storyboard-head p {
  margin: 0;
  color: var(--muted-2);
  font-size: 8.5px;
}

.small-actions {
  display: flex;
  gap: 5px;
}

.small-button {
  height: 27px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted-2);
  font-size: 8px;
  cursor: pointer;
  transition: 150ms ease;
}

.small-button:hover {
  color: var(--text-soft);
  border-color: var(--line-strong);
}

.small-button .icon {
  width: 11px;
  height: 11px;
}

.shot-list {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shot-list::before {
  content: '';
  position: absolute;
  top: 25px;
  bottom: 25px;
  left: 10px;
  width: 1px;
  background: linear-gradient(to bottom, rgba(255, 59, 48, 0.3), var(--line), rgba(255, 59, 48, 0.16));
}

.shot-card {
  position: relative;
  display: grid;
  grid-template-columns: 24px 72px minmax(0, 1fr);
  gap: 9px;
  padding: 10px 10px 10px 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.014);
  transition: 160ms ease;
}

.shot-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.024);
}

.shot-node {
  width: 7px;
  height: 7px;
  margin: 8px 0 0 7px;
  border: 1px solid #0c0c0e;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 3px #121214, 0 0 12px rgba(255, 59, 48, 0.42);
  z-index: 1;
}

.shot-thumb {
  position: relative;
  width: 72px;
  aspect-ratio: 9 / 16;
  border-radius: 6px;
  overflow: hidden;
  background: #070708;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.shot-thumb canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.shot-thumb span {
  position: absolute;
  left: 4px;
  bottom: 4px;
  padding: 2px 4px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.68);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 5px;
  letter-spacing: 0.04em;
}

.shot-content {
  min-width: 0;
  padding-top: 1px;
}

.shot-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.shot-title-row h4 {
  margin: 0;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shot-timecode {
  margin-left: auto;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 6px;
  white-space: nowrap;
}

.shot-desc {
  margin: 5px 0 0;
  color: var(--muted-2);
  font-size: 8px;
  line-height: 1.55;
}

.shot-desc b {
  color: var(--muted);
  font-weight: 500;
}

.shot-prompt {
  position: relative;
  margin-top: 7px;
  padding: 7px 28px 7px 8px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 5px;
  background: #0a0a0c;
  color: #77777f;
  font-family: var(--font-mono);
  font-size: 6.5px;
  line-height: 1.55;
}

.shot-prompt button {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted-2);
  cursor: pointer;
}

.shot-prompt button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.shot-prompt button .icon {
  width: 9px;
  height: 9px;
}

/* command */

.command-panel {
  position: relative;
  z-index: 1;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.command-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.command-head > span {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-soft);
  font-size: 9px;
  font-weight: 600;
}

.command-head .icon {
  width: 11px;
  height: 11px;
  color: var(--red);
}

.command-head small {
  color: var(--muted-2);
  font-size: 7.5px;
}

.command-chips {
  display: flex;
  gap: 5px;
  margin-bottom: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.command-chips::-webkit-scrollbar {
  display: none;
}

.command-chips button {
  height: 25px;
  padding: 0 8px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.018);
  color: var(--muted-2);
  font-size: 8px;
  cursor: pointer;
  transition: 150ms ease;
}

.command-chips button:hover {
  color: var(--text-soft);
  border-color: rgba(255, 59, 48, 0.24);
  background: rgba(255, 59, 48, 0.05);
}

/* ---------- runtime states / fullscreen ---------- */

body.modal-open {
  overflow: hidden;
}

.engine-pill.is-live .engine-dot {
  background: var(--green);
  box-shadow: 0 0 10px rgba(102, 217, 146, 0.8);
  animation: blink 2.4s ease-in-out infinite;
}

.engine-pill.is-live {
  border-color: rgba(102, 217, 146, 0.16);
  color: #9cbfa8;
}

button:disabled {
  cursor: wait;
}

.text-button:disabled {
  opacity: 0.4;
  cursor: wait;
}

.phone-frame:fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

.phone-frame:fullscreen::before,
.phone-frame:fullscreen .phone-camera {
  display: none;
}

.phone-frame:fullscreen .phone-screen {
  width: auto;
  height: 100vh;
  max-width: 100vw;
  border-radius: 0;
  aspect-ratio: 9 / 16;
}

.phone-frame:fullscreen .screen-frame {
  border-radius: 0;
}

.toast.is-visible {
  pointer-events: none;
}

/* Better modal scroll on short screens */
@media (max-height: 700px) {
  .modal {
    max-height: calc(100vh - 16px);
  }
  .modal-body {
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .connection-card {
    padding: 12px;
  }
}
