/* AI Rap Video — immersive dark product skin + mobile */

.optional { font-weight: 500; color: color-mix(in srgb, var(--muted) 85%, transparent); }

/* —— Dark product skin (scoped) —— */
html:has(body.rap-skin),
body.rap-skin {
  overflow-x: hidden;
  max-width: 100%;
}
body.rap-skin {
  --rap-bg: #07070a;
  --rap-card: #121218;
  --rap-card-2: #1a1a22;
  --rap-line: rgba(255,255,255,0.10);
  --rap-fg: #f4f1ea;
  --rap-muted: #a8a29a;
  --rap-neon: #ff3cac;
  --rap-neon-2: #7b61ff;
  --rap-cyan: #39d0ff;
  background:
    radial-gradient(900px 420px at 12% -8%, rgba(123,97,255,0.22) 0%, transparent 55%),
    radial-gradient(800px 380px at 92% 0%, rgba(255,60,172,0.16) 0%, transparent 50%),
    var(--rap-bg);
  color: var(--rap-fg);
  overflow-x: hidden;
  max-width: 100%;
}
body.rap-skin img {
  max-width: 100%;
}
body.rap-skin .site-header {
  background: color-mix(in srgb, #07070a 82%, transparent);
  border-bottom-color: var(--rap-line);
  backdrop-filter: blur(16px) saturate(1.2);
}
body.rap-skin .brand,
body.rap-skin .crumb-current { color: var(--rap-fg); }
body.rap-skin .crumbs,
body.rap-skin .crumbs a,
body.rap-skin .muted,
body.rap-skin .account-meta { color: var(--rap-muted); }
body.rap-skin .lang-switch {
  border-color: var(--rap-line);
  color: var(--rap-muted);
}
body.rap-skin .btn.primary {
  background: linear-gradient(135deg, #ff3cac 0%, #7b61ff 55%, #39d0ff 120%);
  color: #fff;
  border: 0;
  box-shadow: 0 10px 28px rgba(123,97,255,0.35);
}
body.rap-skin .btn.ghost {
  border-color: var(--rap-line);
  color: var(--rap-fg);
  background: rgba(255,255,255,0.03);
}
body.rap-skin .site-footer {
  border-top: 1px solid var(--rap-line);
  background: #050508;
}
body.rap-skin .footer-brand { color: var(--rap-fg); }
body.rap-skin .tool-page {
  width: min(100% - 1.5rem, 980px);
  padding: 1.1rem 0 2rem;
  max-width: 100%;
}
body.rap-skin .tool-header {
  width: min(100% - 1.5rem, 980px);
  max-width: 100%;
}

/* Header compact */
.tool-header { gap: 0.65rem; flex-wrap: wrap; align-items: center; }
.account-bar {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: nowrap;
  min-width: 0;
}
.account-guest, .account-user {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: nowrap;
  min-width: 0;
}
/* display:inline-flex must not override HTML hidden */
.account-guest[hidden],
.account-user[hidden] {
  display: none !important;
}
.account-meta {
  font-size: 0.82rem;
  font-weight: 500;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-logout { margin-top: 0; color: var(--rap-muted); }
.btn.small {
  padding: 0.42rem 0.85rem;
  font-size: 0.82rem;
  border-radius: 999px;
  min-height: 2.25rem;
}
.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--fg);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.crumbs { flex-wrap: wrap; max-width: 100%; }

/* —— Immersive hero —— */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
.rap-hero {
  margin: 0 0 1.35rem;
  padding: 0;
  border: 0;
  overflow: hidden;
  max-width: 100%;
}
.rap-stage {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
  background: #0a0a10;
  width: 100%;
  max-width: 100%;
  height: clamp(240px, 52vh, 420px);
  box-shadow:
    0 0 0 1px rgba(255,60,172,0.08),
    0 24px 60px rgba(0,0,0,0.45);
}
body.rap-skin .rap-stage > img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none; /* fill stage box; stage itself is width-capped */
  object-fit: cover;
  object-position: center 30%;
  pointer-events: none;
}
.rap-stage-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(1.1rem, 4vw, 2rem);
  background:
    linear-gradient(180deg, rgba(7,7,10,0.15) 0%, rgba(7,7,10,0.25) 35%, rgba(7,7,10,0.88) 100%),
    linear-gradient(90deg, rgba(7,7,10,0.55) 0%, transparent 55%);
  max-width: 100%;
}
.rap-stage-overlay .eyebrow {
  margin: 0 0 0.45rem;
  color: #ffb4e0;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
}
.rap-stage-overlay h1 {
  margin: 0 0 0.45rem;
  font-family: var(--serif);
  font-size: clamp(1.85rem, 6.2vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: #fff;
  text-shadow: 0 8px 30px rgba(0,0,0,0.45);
  max-width: 14ch;
}
.rap-stage-lead {
  margin: 0 0 1rem;
  font-size: clamp(0.98rem, 2.6vw, 1.15rem);
  line-height: 1.4;
  color: #e8e2d8;
  max-width: 28rem;
}
.rap-stage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}
.rap-hero-cta {
  display: inline-flex;
  min-height: 2.85rem;
  padding: 0.85rem 1.35rem;
  font-size: 1rem;
  text-decoration: none;
}
.rap-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.85rem;
}
.rap-chip {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  color: #f4f1ea;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
}

/* Mood / example strip */
.rap-moods {
  margin: 1rem 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.mood-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--rap-line);
  background: #0f0f14;
  aspect-ratio: 1 / 1;
  max-width: 100%;
}
body.rap-skin .mood-card img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}
.mood-card figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 0.75rem 0.85rem;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.85));
  color: #fff;
}
.mood-card strong {
  display: block;
  font-size: 0.95rem;
  font-family: var(--serif);
}
.mood-card span {
  display: block;
  font-size: 0.78rem;
  color: #cfc7bb;
  margin-top: 0.15rem;
}
.mood-badge {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  background: #f0e8db;
  color: #141414;
}

/* Compose / panels */
body.rap-skin .panel,
body.rap-skin .faq-block,
body.rap-skin .account-panel {
  background: var(--rap-card);
  border-color: var(--rap-line);
  color: var(--rap-fg);
}
body.rap-skin .panel-title,
body.rap-skin .faq-block h2 { color: var(--rap-fg); }
body.rap-skin .field-label,
body.rap-skin .field-group legend,
body.rap-skin .howto,
body.rap-skin .howto ol,
body.rap-skin .howto-note,
body.rap-skin .pricing-lead,
body.rap-skin .tool-foot,
body.rap-skin .faq-block details p,
body.rap-skin .char-count { color: var(--rap-muted); }
body.rap-skin .dropzone {
  border-color: rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.03);
}
body.rap-skin .dropzone:hover,
body.rap-skin .dropzone.is-drag {
  border-color: rgba(255,60,172,0.55);
  background: rgba(255,60,172,0.06);
}
body.rap-skin .field textarea,
body.rap-skin .field select,
body.rap-skin .auth-form .field input {
  background: #0c0c12;
  border-color: rgba(255,255,255,0.12);
  color: var(--rap-fg);
  width: 100%;
  max-width: 100%;
  font-size: 16px; /* prevent iOS zoom */
}
body.rap-skin .radio { color: var(--rap-fg); min-width: 0; }
body.rap-skin .radio { word-break: break-word; }
body.rap-skin .plan-card {
  background: var(--rap-card-2);
  border-color: var(--rap-line);
}
body.rap-skin .auth-dialog {
  background: #121218;
  color: var(--rap-fg);
  border-color: var(--rap-line);
}
body.rap-skin .linkish { color: var(--rap-muted); }
body.rap-skin .linkish:hover { color: var(--rap-fg); }

.dropzone {
  display: block;
  border: 1.5px dashed #d2c9bb;
  border-radius: 16px;
  background: #fcfbf9;
  min-height: 9.5rem;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease;
  max-width: 100%;
}
.dropzone:hover, .dropzone.is-drag {
  border-color: #b8ae9f;
  background: #fff;
}
.dropzone.has-file { border-style: solid; }
.dropzone-inner {
  display: grid;
  gap: 0.35rem;
  place-content: center;
  text-align: center;
  padding: 1.6rem 1rem;
  min-height: 9.5rem;
}
.dropzone-title { font-weight: 600; font-size: 0.95rem; }
.dropzone-hint { color: var(--muted); font-size: 0.82rem; line-height: 1.45; }
.photo-preview {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  background: #111;
}
.linkish {
  margin-top: 0.45rem;
  border: 0;
  background: none;
  padding: 0;
  color: var(--muted);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.field textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fcfbf9;
  color: var(--fg);
  font: inherit;
  font-size: 0.95rem;
  resize: vertical;
  min-height: 6rem;
  line-height: 1.5;
  box-sizing: border-box;
}
.field textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--fg) 25%, transparent);
  outline-offset: 1px;
}
.char-count {
  font-size: 0.78rem;
  color: var(--muted);
  text-align: right;
}
.preview-box {
  border: 1px solid var(--rap-line, var(--line));
  border-radius: 14px;
  background: #0a0a10;
  color: #f4f1ea;
  min-height: 11rem;
  padding: 1.1rem 1.05rem;
  margin-bottom: 1.15rem;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.preview-empty {
  margin: 0;
  color: #b8b2a8;
  font-size: 0.9rem;
  line-height: 1.55;
}
.status-pill {
  display: inline-block;
  margin: 0 0 0.85rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: #3a342c;
  color: #f0e8db;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.request-summary {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.55;
  color: #f4f1ea;
}
.faq-block {
  margin: 0 0 2rem;
  padding: 1.35rem 1.3rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
}
.faq-block h2 {
  margin: 0 0 0.85rem;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
}
.faq-block details {
  border-top: 1px solid var(--rap-line, var(--line));
  padding: 0.75rem 0;
}
.faq-block summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
}
.faq-block details p {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.cmd-actions .btn {
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}
.plan-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 0.95rem;
  background: #fcfbf9;
  display: grid;
  gap: 0.45rem;
}
.plan-card h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
}
.plan-credits { margin: 0; color: var(--muted); font-size: 0.88rem; }
.plan-card .btn { justify-self: start; margin-top: 0.35rem; }
.library-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}
.library-item {
  border: 1px solid var(--rap-line, var(--line));
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  display: grid;
  gap: 0.25rem;
  background: var(--rap-card-2, #fcfbf9);
}
.library-item strong { font-size: 0.86rem; text-transform: uppercase; letter-spacing: 0.04em; }
.library-prompt { font-size: 0.88rem; }
.auth-dialog {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0;
  max-width: 22rem;
  width: calc(100% - 2rem);
  background: var(--card);
  color: var(--fg);
  box-shadow: 0 18px 50px rgba(0,0,0,0.18);
}
.auth-dialog::backdrop { background: rgba(0,0,0,0.55); }
.auth-form { padding: 1.25rem 1.2rem 1.15rem; display: grid; gap: 0.75rem; }
.auth-form h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
}
.auth-form .field input {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fcfbf9;
  font: inherit;
  box-sizing: border-box;
}
.muted { color: var(--muted); }
.account-panel { margin: 0 0 1.25rem; }
.pricing-lead { margin: 0 0 1rem; font-size: 0.92rem; }
.rap-note {
  margin: 0.85rem 0 0;
  font-size: 0.8rem;
  color: var(--rap-muted);
  line-height: 1.45;
}
#compose { scroll-margin-top: 5rem; }
body.rap-skin .tool-layout { gap: 0.9rem; }
body.rap-skin .panel { padding: 1.2rem 1.1rem; }

/* —— Mobile ≤768 —— */
@media (max-width: 768px) {
  body.rap-skin .tool-page,
  body.rap-skin .tool-header,
  body.rap-skin .header-inner {
    width: min(100% - 1rem, 980px);
    max-width: 100%;
  }
  body.rap-skin .tool-page { padding: 0.75rem 0 1.5rem; }
  /* Compact header: brand + crumbs one row, auth buttons one row */
  .tool-header.header-inner {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.65rem;
    padding: 0.65rem 0;
  }
  .tool-header .brand { flex: 0 0 auto; }
  .tool-header .crumbs {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.8rem;
  }
  .account-bar {
    margin-left: 0;
    flex: 1 1 100%;
    width: 100%;
    justify-content: flex-end;
  }
  .account-guest, .account-user {
    width: auto;
    margin-left: auto;
  }
  .account-guest .btn,
  .account-user .btn {
    flex: 0 0 auto;
    justify-content: center;
  }
  .account-meta {
    max-width: 11rem;
    white-space: nowrap;
  }
  .rap-stage {
    height: min(56vh, 320px);
    border-radius: 16px;
  }
  .rap-stage > img {
    border-radius: 16px;
  }
  .rap-stage-overlay { padding: 1rem; }
  .rap-stage-overlay h1 { max-width: none; font-size: clamp(1.7rem, 8vw, 2.2rem); }
  .rap-hero-cta,
  #generate-btn,
  .checkout-btn {
    width: 100%;
    justify-content: center;
    min-height: 2.85rem;
  }
  .rap-moods { grid-template-columns: 1fr 1fr; gap: 0.55rem; }
  .mood-card { max-width: 100%; }
  .mood-card figcaption { padding: 0.55rem 0.6rem; }
  .mood-card strong { font-size: 0.85rem; }
  .mood-card span { font-size: 0.72rem; }
  .plan-grid { grid-template-columns: 1fr; }
  body.rap-skin .panel,
  body.rap-skin .faq-block { padding: 1rem 0.9rem; border-radius: 14px; }
  .cmd-actions { flex-direction: column; align-items: stretch; }
  .dropzone-inner { padding: 1.25rem 0.75rem; min-height: 8rem; }
  .radio { font-size: 0.92rem; }
}

@media (max-width: 420px) {
  .rap-moods { grid-template-columns: 1fr; }
  .rap-chip { font-size: 0.68rem; }
}
