:root {
  color-scheme: dark;
  --bg: #100f15;
  --ink: #f8f2fa;
  --accent: #e9afff;
  --button-ink: #23102e;
  --border: #e9afff;
  --surface: #191720;
  --line: #383341;
  --mute: #b5aabd;
  font: 100%/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: inherit; }
a, button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
img[hidden], [hidden] { display: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.13; }
h1 { font-size: clamp(2rem, 7vw, 3rem); font-weight: 720; letter-spacing: -.045em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.brand { text-decoration: none; font-weight: 760; letter-spacing: -.05em; }
.brand span { color: var(--accent); }
.brand small { color: var(--mute); letter-spacing: 0; font-weight: 520; }

.landing { width: min(100%, 32rem); margin: auto; padding: 2.25rem clamp(1rem, 5vw, 1.75rem) 1.5rem; text-align: center; }
.region { display: inline-block; border: 1px solid currentColor; border-radius: 999px; padding: .25rem .85rem; font-size: .85rem; opacity: .8; margin-bottom: 1.25rem; }
.identity { display: grid; justify-items: center; gap: .35rem; margin-bottom: 1.35rem; }
.avatar { width: 96px; height: 96px; border-radius: 50%; border: 2px solid var(--border); object-fit: cover; margin-bottom: .55rem; }
[data-avatar-placeholder][hidden] { display: none; }
.monogram { display: grid; place-items: center; background: #302238; color: #f5d6ff; font-weight: 700; font-size: 2rem; }
.handle, .age { opacity: .8; font-size: .9rem; }
.bio { max-width: 34ch; margin-top: .35rem; overflow-wrap: anywhere; white-space: pre-line; }
.identity h1, .cta { overflow-wrap: anywhere; }
.offer { display: grid; gap: .2rem; border: 1px solid currentColor; border-radius: 1rem; padding: .65rem; margin-bottom: 1rem; }
.offer span { font-size: .9rem; }
.offer time { font-variant-numeric: tabular-nums; }
.cover { position: relative; overflow: hidden; isolation: isolate; min-height: 14rem; border-radius: 1.5rem; background: radial-gradient(ellipse at 70% 10%, #624274, #292035 65%, #17131f); }
.cover img { width: 100%; height: auto; }
.cover::after { position: absolute; inset: 35% 0 0; z-index: 0; content: ""; background: linear-gradient(transparent, rgba(12, 8, 17, .92)); pointer-events: none; }
.cover-action { position: absolute; z-index: 1; inset: auto .9rem .95rem; display: grid; justify-items: center; gap: .4rem; }
.cta { display: block; width: 100%; padding: .8rem 1rem; border-radius: .85rem; color: var(--button-ink); background: var(--accent); font-weight: 760; text-decoration: none; }
.external { max-width: 100%; overflow-wrap: anywhere; font-size: .8rem; color: #f0e8f3; }
.age { margin-top: .9rem; }
.landing-footer { display: flex; justify-content: center; flex-wrap: wrap; gap: .45rem 1rem; margin-top: 1.35rem; font-size: .85rem; }
.landing-footer a { display: inline-flex; align-items: center; min-height: 44px; text-underline-offset: .2em; }
.splash { min-height: 90vh; display: grid; place-content: center; text-align: center; padding: 1rem; }
.splash .brand { font-size: clamp(3rem, 12vw, 7rem); }
.legal { max-width: 40rem; margin: auto; padding: 2rem 1rem; display: grid; gap: 1rem; }

.studio-header { border-bottom: 1px solid var(--line); background: #15131b; }
.header-inner, .studio-main { width: min(100% - 2rem, 74rem); margin: auto; }
.header-inner { display: flex; justify-content: space-between; align-items: center; gap: .5rem 1rem; flex-wrap: wrap; min-height: 4.4rem; padding-block: .55rem; }
.header-inner .brand { font-size: 1.4rem; }
nav { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
nav a, .text-button { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; font-size: .93rem; }
.text-button { padding: 0; color: inherit; background: none; border: 0; }
.studio-main { padding-block: 2.2rem 4rem; }
.heading { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: .85rem; margin-bottom: 1.4rem; }
.heading p { margin-top: .35rem; color: var(--mute); }
.panel { padding: clamp(1rem, 3vw, 1.4rem); border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); }
.panel > h2 { margin-bottom: .9rem; }
.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .5rem .95rem; border-radius: .65rem; text-decoration: none; border: 1px solid transparent; font-size: .92rem; font-weight: 650; }
.primary { color: var(--button-ink); background: var(--accent); }
.primary:focus-visible { outline-color: var(--accent); }
.secondary { color: var(--ink); background: #221e2a; border-color: var(--line); }
.profile-grid { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.profile-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .7rem; }
.profile-card h2, .profile-card p { overflow-wrap: anywhere; }
.profile-card h2 { margin-bottom: .15rem; }
.mini-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; font-size: 1.25rem; }
.actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .45rem; }
.status { color: #e7c6f1; background: #372541; border-radius: 999px; padding: .25rem .65rem; font-size: .85rem; }
.status.active { color: #a8eabf; background: #243b31; }
.muted { color: var(--mute); }
.login { max-width: 26rem; margin: 6vh auto; }
.login h1, .login p { margin-bottom: 1rem; }
.editor { display: grid; gap: 1.5rem; align-items: start; }
.editor-form { display: grid; gap: 1rem; min-width: 0; }
.editor-form > .primary { justify-self: start; }
.fields { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
label { display: grid; gap: .35rem; margin-bottom: .85rem; font-size: .94rem; color: #e5dbea; min-width: 0; }
input, select, textarea { color: var(--ink); background: #110f17; border: 1px solid var(--line); border-radius: .55rem; min-height: 44px; padding: .5rem .7rem; width: 100%; min-width: 0; font-size: 1rem; }
textarea { resize: vertical; }
input[type=checkbox] { accent-color: var(--accent); width: 1.15rem; min-height: auto; height: 1.15rem; }
.check { display: flex; align-items: center; gap: .5rem; min-height: 30px; }
input[type=color] { padding: .2rem; }
input[type=range] { accent-color: var(--accent); }
.color-row { display: grid; gap: .6rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.crop { min-width: 0; padding: .7rem; border: 1px solid var(--line); border-radius: .7rem; }
.photo-grid { row-gap: .7rem; }
.crop-window { margin: .65rem auto; overflow: hidden; background: #32273d; width: min(100%, 10rem); aspect-ratio: 4/5; border-radius: .65rem; }
.crop-window.avatar { width: 6rem; height: auto; aspect-ratio: 1; border-radius: 50%; }
.crop-image { width: 100%; height: 100%; object-fit: cover; }
.preview { min-width: 0; }
.preview h2 { margin-bottom: .75rem; }
.preview iframe { display: block; width: min(100%, 24.5rem); height: 43rem; border: 2px solid var(--line); border-radius: 1.5rem; background: var(--bg); }
.notice { border: 1px solid #416952; color: #bcf0c9; padding: .65rem .8rem; border-radius: .5rem; margin-bottom: .9rem; }
.error { border-color: #ab616b; color: #ffc6ce; }
.analytics-filter { display: flex; gap: .5rem .7rem; flex-wrap: wrap; align-items: end; }
.analytics-filter label { flex: 1 1 9rem; margin: 0; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin: .9rem 0; }
.metrics p { color: var(--mute); font-size: .86rem; }
.metrics strong { font-size: clamp(1rem, 4vw, 2rem); overflow-wrap: anywhere; }
.table-wrap { overflow: auto; }
table { border-collapse: collapse; width: 100%; font-size: .85rem; white-space: nowrap; }
td, th { padding: .6rem; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--mute); }
@media (min-width: 56rem) {
  .editor { grid-template-columns: minmax(0, 1fr) minmax(18rem, 24.5rem); }
  .preview { position: sticky; top: 1rem; }
}

.identity .avatar { width: var(--avatar-size, 96px); height: var(--avatar-size, 96px); border-width: var(--border-width, 2px); }
.identity .profile-name { font-size: var(--name-size, 48px); }
.handle, .age, .region, .landing-footer { color: var(--secondary-ink, var(--ink)); opacity: 1; }
.identity-badge {
  display: inline-grid;
  place-items: center;
  width: 1.25em;
  height: 1.25em;
  margin-inline-start: .3em;
  border-radius: 50%;
  vertical-align: .24em;
  font-size: .43em;
  background: #1755b6;
  color: #fff;
}
.cover { display: block; text-decoration: none; }
.cover.has-action:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
.cover img { aspect-ratio: var(--cover-ratio, auto); object-fit: cover; object-position: var(--cover-x, 50%) var(--cover-y, 50%); }
.cover img[hidden] { display: none; }
.cover.ratio-legacy { --cover-ratio: 4 / 5; }
.cover.ratio-portrait { --cover-ratio: 3 / 4; }
.cover.ratio-landscape { --cover-ratio: 4 / 3; }
.cover.ratio-square { --cover-ratio: 1 / 1; }
.cover:has(img:not([hidden])) { min-height: 0; }
.cover.has-action:has(img:not([hidden])) { min-height: 7rem; }
.cover.style-overlay::after { inset: 0; background: linear-gradient(transparent 15%, var(--overlay-bg) max(65%, calc(100% - 7rem))); }
.cover.style-overlay .cover-action { inset: auto 0 0; background: linear-gradient(transparent, var(--overlay-bg) .65rem); padding: .65rem .9rem .6rem; gap: 0; }
.cover.style-overlay .cta { background: transparent; padding-block: .45rem .15rem; }
.cover.style-overlay .external { padding-bottom: .4rem; }
.offer { background: var(--promo-color); color: var(--promo-ink); border-color: transparent; }
.visual-timer { background: var(--timer-color); color: var(--timer-ink); }
.visual-timer time { font-weight: 700; font-size: 1.1rem; }
.timer-label { display: flex; align-items: center; justify-content: center; gap: .35em; min-width: 0; }
.timer-label strong { min-width: 0; overflow-wrap: anywhere; }
.visual-timer.timer-compact { display: flex; align-items: center; justify-content: center; gap: .65rem; padding-block: .4rem; }
.timer-compact .timer-label strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer-compact time { flex-shrink: 0; }

.timer-help { margin-bottom: .8rem; }
@media (prefers-reduced-motion: no-preference) {
  .offer.pulse { animation: promo-pulse 2.4s ease-in-out 2; }
  @keyframes promo-pulse { 50% { transform: scale(1.015); } }
}
.color-row { grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); }
.color-control { display: flex; align-items: end; gap: .35rem; margin-bottom: .85rem; }
.color-control label { margin: 0; flex: 1; }
.color-control input[type=color] { width: 44px; flex-shrink: 0; }
.contrast-status { margin-bottom: .85rem; }
.contrast-status[data-failed] { color: #ffc6ce; }
.preview { position: sticky; top: 1rem; }
.preview iframe { height: min(43rem, calc(100vh - 5rem)); height: min(43rem, calc(100dvh - 5rem)); }
@media (max-width: 55.999rem) {
  .editor { display: flex; flex-direction: column; align-items: stretch; }
  .preview {
    order: -1;
    position: sticky;
    z-index: 2;
    top: 0;
    background: var(--bg);
    padding: .5rem 0;
  }
  .preview h2 { margin-bottom: .4rem; }
  .preview iframe { height: min(20rem, 33vh); height: min(20rem, 33dvh); }
  .editor-form input, .editor-form select, .editor-form textarea { scroll-margin-top: 42vh; }
}

.source-form { max-width: 48rem; }
.source-list { margin-top: 1rem; }
.source-entry { display: grid; gap: .75rem; padding: 1rem 0; overflow-wrap: anywhere; }
.source-entry + .source-entry { border-top: 1px solid var(--line); }
.source-entry .status { display: inline-block; margin-top: .35rem; }
.traffic-totals { margin-bottom: .65rem; }
@media (min-width: 52rem) {
  .source-entry { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); align-items: start; }
}

.publication-details { display: grid; gap: .65rem; margin: 0 0 1rem; }
.publication-details dt { color: var(--muted); font-size: .9rem; }
.publication-details dd { margin: 0; font-weight: 600; }
[data-cloud-publish] button { margin-top: .75rem; }
