/* ════════════════════════════════════════════════════════════════════════
   Ambassador Studio page (app/Views/ambassadors/studio/*, partials/identity):
   the public Ambassador page and the Studio canvas. Design target:
   docs/Ambassadors/Love666 VTLOG Ambassador Dashboard.png.

   Colour system. Panels are neutral dark, headings white, body text light grey.
   The creator's accent (Studio\Palette: --acc, --acc-ink, --acc-soft, --acc-line,
   contrast-checked on the server) is for highlights only: heading icons, labels,
   outlines, the photo ring, selected states. VTLOG orange stays for everything
   official; platform buttons keep their platform colours.

   Layout. The grid and the hero answer to the page's own width, every module to
   its own width (container queries), so a module reflows when it is resized and
   the Studio canvas at 390 px behaves like a phone. Hard corners, as the site.
   ════════════════════════════════════════════════════════════════════════ */
.ams-host {
    --acc: var(--amb-accent, #ff9900);
    --acc-ink: #111;
    --acc-soft: rgba(255, 153, 0, 0.14);
    --acc-line: rgba(255, 153, 0, 0.55);
    --vtlog: #ff9900;
    --ams-surface: rgba(18, 18, 22, 0.94);
    --ams-raised: rgba(255, 255, 255, 0.035);
    --ams-line: rgba(255, 255, 255, 0.08);
    --ams-line-2: rgba(255, 255, 255, 0.14);
    --ams-ink: #f2f2f4;
    --ams-text: rgba(232, 232, 236, 0.86);
    --ams-dim: rgba(232, 232, 236, 0.64);
    --ams-head-font: 'Rajdhani', system-ui, sans-serif;
    container: amshost / inline-size;
    gap: 0.85rem;
}
.ams-host .amb-crumbs { margin-bottom: -0.25rem; }

/* ── Hero: one cinematic identity ───────────────────────────────── */
.ams-hero {
    position: relative; overflow: hidden;
    background: #0c0c10;
    border: 1px solid var(--ams-line);
    min-height: clamp(300px, 17cqi, 470px);
    display: flex; flex-direction: column; justify-content: flex-end;
}
.ams-hero-media { position: absolute; inset: 0; }
.ams-hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ams-hero-media::after {
    content: ""; position: absolute; inset: 0;
    background:
        linear-gradient(to top, #0c0c10 0%, rgba(12,12,16,0.88) 22%, rgba(12,12,16,0.35) 52%, rgba(12,12,16,0) 72%),
        linear-gradient(to right, rgba(12,12,16,0.6) 0%, rgba(12,12,16,0) 45%);
}
.ams-hero-body {
    position: relative; z-index: 1;
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: end;
    gap: 0.75rem clamp(1rem, 2cqi, 2rem);
    padding: clamp(5rem, 9cqi, 9rem) clamp(1rem, 2.2cqi, 2.25rem) clamp(1rem, 1.6cqi, 1.6rem);
}
.ams-hero .amb-avatar.is-profile {
    --amb-pf-av: clamp(104px, 9.5cqi, 176px);
    margin-top: 0;
    border: 4px solid var(--acc);
    box-shadow: 0 0 0 4px rgba(12,12,16,0.65), 0 0 28px var(--acc-soft), 0 8px 24px rgba(0,0,0,0.5);
}
.ams-hero .amb-avatar.is-profile .amb-avatar-mono { color: var(--acc); }
.ams-hero-who { min-width: 0; padding-bottom: 0.15rem; }
.ams-hero-name {
    margin: 0; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
    font: 700 clamp(1.8rem, 1.2rem + 1.5cqi, 2.9rem)/1.05 'Rajdhani', system-ui, sans-serif;
    color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,0.6); overflow-wrap: anywhere;
}
.ams-verified { color: var(--vtlog); font-size: 0.6em; }
.ams-hero-role {
    margin: 0.35rem 0 0; display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap;
    font: 700 1.05rem/1.2 'Rajdhani', system-ui, sans-serif; color: var(--vtlog);
}
.ams-hero-demo { padding: 0.05rem 0.45rem; border: 1px solid rgba(79,160,255,0.6); color: #8cc4ff; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; }
.ams-hero-tagline { margin: 0.55rem 0 0; max-width: 68ch; font-size: 0.95rem; line-height: 1.5; color: rgba(240,240,244,0.9); text-shadow: 0 1px 6px rgba(0,0,0,0.6); }
.ams-hero-tags { list-style: none; margin: 0.7rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ams-hero-tags li { padding: 0.25rem 0.7rem; background: rgba(12,12,16,0.7); border: 1px solid var(--ams-line-2); font-size: 0.76rem; font-weight: 600; color: var(--ams-ink); }
.ams-hero-side { display: flex; flex-direction: column; align-items: flex-end; gap: 0.75rem; }
.ams-hero-socials { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.35rem; }
.ams-hs {
    display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
    background: var(--lc, #2a2a30); color: #fff; font-size: 0.95rem; text-decoration: none; border: 1px solid transparent;
}
.ams-hs svg { width: 15px; height: 15px; }
.ams-hs:hover { color: #fff; filter: brightness(1.15); }
.ams-hs.is-placeholder { opacity: 0.8; cursor: default; }
.ams-hero-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; }
/* The profile socials partial (fallback when the page has no Links module). */
.ams-hero .amb-socials { justify-content: flex-end; }

@container amshost (max-width: 980px) {
    .ams-hero-body { grid-template-columns: auto minmax(0, 1fr); }
    .ams-hero-side { grid-column: 1 / -1; align-items: flex-start; }
    .ams-hero-socials, .ams-hero-actions { justify-content: flex-start; }
}
@container amshost (max-width: 600px) {
    .ams-hero { min-height: 0; }
    .ams-hero-media { position: relative; inset: auto; height: 190px; }
    .ams-hero-media::after { background: linear-gradient(to top, #0c0c10 0%, rgba(12,12,16,0) 60%); }
    .ams-hero-body { grid-template-columns: minmax(0, 1fr); padding-top: 0; margin-top: -64px; }
    .ams-hero-tagline { font-size: 0.9rem; }
}

/* ── Page background (Layout::STYLES) ───────────────────────────── */
.ams-page { container: ams / inline-size; position: relative; }
.ams-page.ams-background-glow::before,
.ams-page.ams-background-banner::before {
    content: ""; position: absolute; inset: -1rem -1.25rem auto; height: 640px; z-index: 0; pointer-events: none;
}
.ams-page.ams-background-glow::before {
    background: radial-gradient(55% 60% at 15% 0%, var(--acc-soft), transparent 70%),
                radial-gradient(45% 50% at 90% 5%, rgba(255,153,0,0.06), transparent 70%);
}
.ams-page.ams-background-banner::before {
    background-image: linear-gradient(to bottom, rgba(13,13,14,0.6), #0d0d0e 92%), var(--ams-backdrop, none);
    background-size: cover; background-position: center top; filter: blur(16px); opacity: 0.6;
}
.ams-page.ams-font-stencil { --ams-head-font: 'Saira Stencil One', 'Rajdhani', system-ui, sans-serif; }
.ams-page.ams-font-inter   { --ams-head-font: 'Inter', 'Segoe UI', system-ui, sans-serif; }
.ams-page.ams-boxes-glass  { --ams-surface: rgba(18, 18, 22, 0.66); }

/* ── Grid ───────────────────────────────────────────────────────── */
.ams-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0.85rem; }
.ams-mod {
    grid-column: span var(--w, 12);
    container: amsmod / inline-size;
    position: relative; min-width: 0;
    padding: 1rem 1.15rem 1.1rem;
    background: var(--ams-surface);
    border: 1px solid var(--ams-line);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.32);
    display: flex; flex-direction: column; gap: 0.8rem;
}
.ams-page.ams-boxes-glass .ams-mod { backdrop-filter: blur(8px); }
.ams-page.ams-boxes-outline .ams-mod, .ams-mod.ams-box-accent { border-color: var(--acc-line); }
.ams-mod.ams-box-bare { background: transparent; border-color: transparent; box-shadow: none; padding-left: 0; padding-right: 0; }
.ams-m-giveaways, .ams-m-about { overflow: hidden; }

@container ams (max-width: 1100px) {
    .ams-mod { grid-column: span 12; }
    .ams-mod[data-w="3"], .ams-mod[data-w="4"], .ams-mod[data-w="5"], .ams-mod[data-w="6"] { grid-column: span 6; }
}
@container ams (max-width: 720px) {
    .ams-grid { gap: 0.7rem; }
    .ams-mod, .ams-mod[data-w] { grid-column: span 12; }
}

/* ── Shared parts ───────────────────────────────────────────────── */
.ams-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem 0.8rem; flex-wrap: wrap; min-width: 0; }
.ams-head.is-inline { justify-content: flex-start; }
.ams-h { margin: 0; display: flex; align-items: center; gap: 0.55rem; font: 700 1.3rem/1.15 var(--ams-head-font); letter-spacing: 0.01em; color: var(--ams-ink); }
.ams-page.ams-font-stencil .ams-h { font-weight: 400; letter-spacing: 0.04em; }
.ams-h > i { color: var(--acc); font-size: 0.95em; }
.ams-h.is-live { color: #ff4040; text-transform: uppercase; letter-spacing: 0.03em; }
.ams-h3 { margin: 0.2rem 0 0; font: 700 1.1rem/1.2 var(--ams-head-font); color: var(--ams-ink); }
.ams-sub { margin: -0.4rem 0 0; color: var(--ams-dim); font-size: 0.86rem; }
.ams-sub i { color: var(--acc); }
.ams-text { color: var(--ams-text); font-size: 0.93rem; line-height: 1.55; max-width: 78ch; }
.ams-text p { margin: 0 0 0.45rem; }
.ams-text p:last-child { margin-bottom: 0; }
.ams-text a { color: var(--acc); text-decoration: underline; text-underline-offset: 2px; }
.ams-text strong { color: var(--ams-ink); }
.ams-small { font-size: 0.84rem; color: var(--ams-dim); }
.ams-chip { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.2rem 0.6rem; border: 1px solid var(--ams-line-2); background: var(--ams-raised); color: var(--ams-text); font-size: 0.74rem; font-style: normal; white-space: nowrap; }
.ams-chip i { color: var(--acc); }
.ams-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.ams-chips li { padding: 0.22rem 0.6rem; border: 1px solid var(--ams-line-2); background: rgba(12,12,16,0.6); color: var(--ams-text); font-size: 0.74rem; font-weight: 600; }
.ams-chips li::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 0.4rem; border-radius: 50%; background: var(--acc); vertical-align: 1px; }
.ams-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ams-tags li { padding: 0.25rem 0.85rem; border: 1px solid var(--acc-line); color: var(--acc); font-size: 0.8rem; font-weight: 600; border-radius: 999px; }

/* Buttons: neutral by default; accent outline for the creator's own actions; platform colours
   for platform actions; VTLOG orange for official ones; a filled accent uses --acc-ink. */
.ams-btns { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0; }
.ams-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
    min-height: 38px; padding: 0.5rem 0.95rem;
    border: 1px solid var(--ams-line-2); background: var(--ams-raised); color: var(--ams-ink);
    font-size: 0.86rem; font-weight: 700; text-decoration: none; border-radius: 0; cursor: pointer; white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, filter 0.15s;
}
.ams-btn svg { width: 1em; height: 1em; }
button.ams-btn { font-family: inherit; }
.ams-btn:hover { color: var(--ams-ink); border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.07); }
.ams-btn.is-ghost { background: rgba(12,12,16,0.6); }
/* An action the Ambassador must still take (accept updated Rules & Terms). */
.ams-btn.is-attention { background: #ff9900; border-color: #ff9900; color: #161617; }
.ams-btn.is-attention:hover { background: #ffb84d; border-color: #ffb84d; color: #161617; }
.ams-btn.is-outline { border-color: var(--acc-line); color: var(--ams-ink); background: rgba(12,12,16,0.6); }
.ams-btn.is-outline > i, .ams-btn.is-outline > svg { color: var(--acc); }
.ams-btn.is-outline:hover { background: var(--acc-soft); border-color: var(--acc); }
.ams-btn.is-accent { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.ams-btn.is-accent:hover { filter: brightness(1.08); color: var(--acc-ink); }
.ams-btn.is-vtlog { border-color: rgba(255,153,0,0.7); color: var(--vtlog); background: rgba(255,153,0,0.06); }
.ams-btn.is-vtlog:hover { background: rgba(255,153,0,0.14); color: #ffb84d; border-color: var(--vtlog); }
.ams-btn.is-sm { min-height: 32px; padding: 0.35rem 0.8rem; font-size: 0.8rem; align-self: flex-start; }
.ams-btn.is-twitch, .ams-btn.is-youtube, .ams-btn.is-kick { color: #fff; border-color: transparent; }
.ams-btn.is-twitch  { background: #9146ff; }
.ams-btn.is-youtube { background: #e62117; }
.ams-btn.is-kick    { background: #1f9e0f; }
.ams-btn.is-twitch:hover, .ams-btn.is-youtube:hover, .ams-btn.is-kick:hover { filter: brightness(1.12); color: #fff; }
.ams-btn.is-placeholder { opacity: 0.75; cursor: default; }
.ams-btn.is-placeholder:hover { filter: none; }
.ams-btn:focus-visible, .ams-link:focus-visible, .ams-hs:focus-visible, .ams-play:focus-visible, .ams-gallery a:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

/* Example content: one quiet label per module (the hero says "Demo" too). */
.ams-demo {
    position: absolute; top: 0.5rem; right: 0.6rem; z-index: 3;
    padding: 0.1rem 0.45rem; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
    color: rgba(232,232,236,0.6); background: rgba(12,12,16,0.75); border: 1px solid var(--ams-line);
}

/* ── Livestream: the feature module ─────────────────────────────── */
.ams-stage {
    position: relative; overflow: hidden;
    aspect-ratio: 16 / 9; max-height: 30rem;
    background: #0b0b0e center / cover no-repeat; border: 1px solid var(--ams-line);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem;
}
.ams-stage.is-cinema { aspect-ratio: 2.5 / 1; min-height: 180px; max-height: 24rem; }
.ams-stage.is-playing { aspect-ratio: 16 / 9; max-height: none; }
/* The preview picture is an <img> (srcset: the browser picks the file for the screen) drawn the
   way the former CSS background was: cover, centred, under the gradient and the controls. */
.ams-stage > .ams-stage-img { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.ams-stage::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(to top, rgba(8,8,10,0.92) 0%, rgba(8,8,10,0.25) 55%, rgba(8,8,10,0.1)); }
.ams-stage > :where(:not(.ams-stage-img)) { position: relative; z-index: 2; }
.ams-stage > iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ams-play {
    display: inline-flex; align-items: center; justify-content: center; width: 66px; height: 66px; padding: 0 0 0 4px;
    border-radius: 50%; background: var(--acc); color: var(--acc-ink); border: 0; cursor: pointer; font-size: 1.5rem;
    box-shadow: 0 0 0 6px rgba(0,0,0,0.25), 0 0 30px var(--acc-soft); transition: transform 0.15s;
}
.ams-play:hover { transform: scale(1.06); }
.ams-play.is-idle { opacity: 0.85; cursor: default; }
.ams-play-note { color: rgba(255,255,255,0.72); font-size: 0.72rem; }
.ams-stage-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 0.8rem 1rem; display: flex; flex-direction: column; gap: 0.1rem; pointer-events: none; }
.ams-stage-cap small { color: var(--acc); font-size: 0.85rem; font-weight: 600; }
.ams-stage-cap b { color: #fff; font: 700 1.3rem/1.15 var(--ams-head-font); text-shadow: 0 2px 8px rgba(0,0,0,0.7); }
.ams-stream-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 0.6rem; }
.ams-stream-foot .ams-btns { justify-content: flex-end; gap: 0.4rem; }
.ams-stream-foot .ams-btn { min-height: 34px; padding: 0.4rem 0.75rem; font-size: 0.82rem; }
.ams-live { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.2rem 0.6rem; border: 1px solid var(--ams-line-2); font-size: 0.74rem; font-weight: 700; color: var(--ams-dim); text-transform: uppercase; letter-spacing: 0.06em; }
.ams-live.is-on { color: #fff; background: #d42a2f; border-color: #d42a2f; }
.ams-live-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: currentColor; animation: ams-pulse 1.6s ease-in-out infinite; }
@keyframes ams-pulse { 50% { opacity: 0.35; } }
@container amsmod (max-width: 520px) {
    .ams-stage.is-cinema { aspect-ratio: 16 / 9; }
    .ams-stage-cap b { font-size: 1.05rem; }
    .ams-play { width: 54px; height: 54px; font-size: 1.25rem; }
    /* No room for the note under the play button above a caption: the button's label says it. */
    .ams-stage:has(.ams-stage-cap) .ams-play-note { display: none; }
    .ams-stream-foot .ams-btns { justify-content: flex-start; }
}

/* ── Streaming & Content ────────────────────────────────────────── */
.ams-offer-art { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; }
.ams-offer-art li {
    position: relative; aspect-ratio: 4 / 3; display: flex; align-items: flex-end; justify-content: center;
    background: #0b0b0e center / cover no-repeat; border: 1px solid var(--ams-line); overflow: hidden;
}
.ams-offer-art li::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(8,8,10,0.9), rgba(8,8,10,0) 65%); }
.ams-offer-art span { position: relative; padding: 0.45rem 0.4rem; text-align: center; font-size: 0.8rem; font-weight: 700; color: #fff; line-height: 1.2; }
.ams-offers { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 0.5rem; }
.ams-offers li { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.35rem; min-height: 70px; padding: 0.55rem 0.35rem; text-align: center; background: var(--ams-raised); border: 1px solid var(--ams-line); font-size: 0.76rem; font-weight: 600; color: var(--ams-text); line-height: 1.2; }
.ams-offers i { color: var(--acc); font-size: 1.2rem; }
@container amsmod (max-width: 420px) { .ams-offer-art { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ── Links & Community ──────────────────────────────────────────── */
.ams-links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.ams-link {
    /* Dark tiles: the platform is recognised by its own icon (in its colour, --pc), with only a
       light tint and a thin border of that colour; hover raises both a little. */
    --pc: #bdbdc2;
    display: flex; align-items: center; gap: 0.6rem; min-height: 42px; padding: 0.5rem 0.75rem;
    background: #1b1b1e; background: color-mix(in srgb, var(--pc) 7%, #19191c);
    border: 1px solid rgba(255,255,255,0.12); border-color: color-mix(in srgb, var(--pc) 34%, transparent);
    color: #ececee; text-decoration: none; font-size: 0.88rem; font-weight: 700;
    transition: background-color .15s, border-color .15s;
}
.ams-link > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ams-link svg, .ams-link > i:first-child { width: 1.05rem; height: 1.05rem; font-size: 1.05rem; flex: 0 0 auto; color: var(--pc); }
.ams-link .ams-ext { font-size: 0.72rem; color: var(--ams-dim); }
.ams-link:hover { color: #fff; background: color-mix(in srgb, var(--pc) 14%, #19191c); border-color: color-mix(in srgb, var(--pc) 62%, transparent); }
.ams-link.is-placeholder { cursor: default; }
.ams-link.is-placeholder:hover { background: color-mix(in srgb, var(--pc) 7%, #19191c); border-color: color-mix(in srgb, var(--pc) 34%, transparent); }
@media (prefers-reduced-motion: reduce) { .ams-link { transition: none; } }
@container amsmod (max-width: 330px) {
    .ams-links { gap: 0.4rem; }
    .ams-link { gap: 0.45rem; padding: 0.45rem 0.55rem; font-size: 0.8rem; }
    .ams-link .ams-ext { display: none; }
}
@container amsmod (max-width: 210px) { .ams-links { grid-template-columns: minmax(0, 1fr); } }
/* Platform colours (shared with the hero icons). */
.ams-host .is-twitch    { --lc: #9146ff; }
.ams-host .is-youtube   { --lc: #e62117; }
.ams-host .is-kick      { --lc: #1f9e0f; }
.ams-host .is-discord   { --lc: #5865f2; }
.ams-host .is-tiktok    { --lc: #17171b; }
.ams-host .is-instagram { --lc: linear-gradient(135deg, #f58529, #dd2a7b 50%, #8134af); }
.ams-host .is-facebook  { --lc: #1877f2; }
.ams-host .is-x         { --lc: #17171b; }
.ams-host .is-bluesky   { --lc: #1185fe; }
.ams-host .is-steam     { --lc: #1b2838; }
.ams-host .is-website   { --lc: #d97a00; }
.ams-hs.is-instagram { background: var(--lc); }
.ams-hs.is-tiktok, .ams-hs.is-x { border-color: rgba(255,255,255,0.16); }
/* The Links tiles' icon colours: each platform's own, lifted where the official colour is too dark
   to read on a dark tile (Discord, Facebook, Bluesky); X and TikTok are white marks. */
.ams-link.is-twitch    { --pc: #a970ff; }
.ams-link.is-youtube   { --pc: #ff3d33; }
.ams-link.is-kick      { --pc: #53fc18; }
.ams-link.is-discord   { --pc: #8c94ff; }
.ams-link.is-tiktok    { --pc: #f2f2f2; }
.ams-link.is-instagram { --pc: #f04f8c; }
.ams-link.is-facebook  { --pc: #4b95ff; }
.ams-link.is-x         { --pc: #f2f2f2; }
.ams-link.is-bluesky   { --pc: #4aa6ff; }
.ams-link.is-steam     { --pc: #c7d5e0; }
.ams-link.is-website, .ams-link.is-community, .ams-link.is-custom { --pc: var(--acc); }

/* ── Schedule ───────────────────────────────────────────────────── */
.ams-sched { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.8rem; align-items: center; }
@container amsmod (min-width: 760px) { .ams-sched { grid-template-columns: minmax(0, 1fr) minmax(150px, 210px); } }
.ams-sched-side { display: flex; flex-direction: column; gap: 0.6rem; }
.ams-sched-side .ams-text { display: flex; gap: 0.5rem; }
.ams-side-icon { color: var(--acc); margin-top: 0.2rem; }
.ams-week { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.35rem; }
.ams-week > li { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; padding: 0.5rem 0.25rem 0.55rem; background: var(--ams-raised); border: 1px solid var(--ams-line); text-align: center; min-width: 0; }
.ams-week > li > b { font-size: 0.85rem; color: var(--ams-ink); }
.ams-week > li.is-rest { background: transparent; }
.ams-week > li.is-rest > b { color: var(--ams-dim); font-weight: 600; }
.ams-rest { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; font-size: 0.76rem; color: var(--ams-dim); }
.ams-rest i { color: var(--ams-dim); }
.ams-slot { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; width: 100%; }
.ams-slot time { font-weight: 700; font-size: 0.95rem; color: var(--ams-ink); font-variant-numeric: tabular-nums; }
.ams-slot em, .ams-slot small { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0.12rem 0.4rem; font-size: 0.68rem; font-style: normal; font-weight: 600; border: 1px solid var(--ams-line-2); color: var(--ams-text); background: rgba(12,12,16,0.5); }
.ams-slot em.is-ets2 { border-color: rgba(79,160,255,0.55); color: #8cc4ff; }
.ams-slot em.is-ats  { border-color: rgba(255,138,61,0.6); color: #ffb07a; }
.ams-slot em.is-both { border-color: var(--acc-line); color: var(--acc); }
@container amsmod (max-width: 520px) { .ams-week { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ── Events ─────────────────────────────────────────────────────── */
.ams-events { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 0.6rem; }
.ams-event { display: grid; grid-template-columns: minmax(110px, 0.9fr) minmax(0, 1fr); background: var(--ams-raised); border: 1px solid var(--ams-line); min-width: 0; }
.ams-event.no-pic { grid-template-columns: minmax(0, 1fr); }
.ams-event.is-past { opacity: 0.55; }
/* The text decides the card's height; the picture fills its side whatever its own ratio. */
.ams-event-pic { position: relative; min-height: 108px; overflow: hidden; }
.ams-event-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ams-event-body { padding: 0.65rem 0.8rem; display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.ams-event-title { font: 700 1.02rem/1.2 var(--ams-head-font); color: var(--ams-ink); }
.ams-event-when { font-size: 0.8rem; color: var(--ams-text); }
.ams-event-when i { color: var(--acc); }

/* ── Premium giveaways: the Diamond card IS the right side of the module ─ */
.ams-give { position: relative; display: flex; min-height: 100%; }
.ams-give-copy { position: relative; z-index: 1; width: 56%; display: flex; flex-direction: column; gap: 0.75rem; }
/* The artwork is the card's full-height right side, the same treatment as the About picture:
   top to bottom edge, faded into the text from the left. object-fit: cover keeps its proportions
   (never stretched); it is centred on the Premium card and diamond. */
.ams-give-art {
    position: absolute; top: -1rem; right: -1.15rem; bottom: -1.1rem; width: 72%;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, transparent 24%, #000 56%);
            mask-image: linear-gradient(to right, transparent 0%, transparent 24%, #000 56%);
}
.ams-give-art img { width: 100%; height: 100%; object-fit: cover; object-position: 54% 50%; display: block; }
@container amsmod (min-width: 1000px) { .ams-give-art { width: 58%; } .ams-give-copy { width: 52%; } }
.ams-give-hl { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.ams-give-hl li { display: flex; align-items: center; gap: 0.55rem; padding: 0.55rem 0.75rem; background: rgba(12,12,16,0.75); border: 1px solid var(--ams-line-2); font-size: 0.82rem; font-weight: 700; color: var(--ams-ink); }
.ams-give-hl i { font-size: 1.15rem; }
.ams-give-hl .is-gem { color: #5ec8ff; }
.ams-give-hl .is-gold { color: #f2b632; }
.ams-give-hl .is-acc { color: var(--acc); }
.ams-fine { margin: 0; font-size: 0.74rem; color: var(--ams-dim); line-height: 1.45; }
/* Narrow module: the card on top at its own ratio, fading into the text below. */
@container amsmod (max-width: 460px) {
    .ams-give { flex-direction: column; }
    .ams-give-copy { width: 100%; }
    .ams-give-art {
        position: relative; inset: auto; transform: none; width: auto; margin: -1rem -1.15rem 0; aspect-ratio: 1983 / 793;
        -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent 100%);
                mask-image: linear-gradient(to bottom, #000 70%, transparent 100%);
    }
    .ams-give-art img { object-position: center; }
}

/* ── About: the picture IS the right side of the module ─────────── */
.ams-about { position: relative; display: flex; min-height: 100%; }
.ams-about-copy { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 0.75rem; }
.ams-about.has-pic .ams-about-copy { width: 62%; }
.ams-feature-art {
    position: absolute; top: -1rem; right: -1.15rem; bottom: -1.1rem; width: 46%;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 40%);
            mask-image: linear-gradient(to right, transparent 0%, #000 40%);
}
.ams-feature-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
@container amsmod (max-width: 440px) {
    .ams-about { flex-direction: column; }
    .ams-about.has-pic .ams-about-copy { width: 100%; }
    .ams-feature-art {
        position: relative; inset: auto; width: auto; margin: -1rem -1.15rem 0; aspect-ratio: 16 / 9;
        -webkit-mask-image: linear-gradient(to bottom, #000 65%, transparent 100%);
                mask-image: linear-gradient(to bottom, #000 65%, transparent 100%);
    }
}

/* ── Text & Images ──────────────────────────────────────────────── */
.ams-rich { display: flex; flex-direction: column; gap: 0.7rem; }
.ams-figure { margin: 0; }
.ams-figure img { display: block; width: 100%; height: auto; border: 1px solid var(--ams-line); }
.ams-figure figcaption, .ams-gallery figcaption { margin-top: 0.3rem; font-size: 0.76rem; color: var(--ams-dim); }

/* ── Gallery: a compact cinematic strip ─────────────────────────── */
.ams-gallery { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.ams-gallery.is-row  { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.ams-gallery.is-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.ams-gallery figure { margin: 0; }
.ams-gallery a { display: block; overflow: hidden; border: 1px solid var(--ams-line); }
.ams-gallery img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; max-height: 15rem; object-fit: cover; transition: transform 0.25s ease; }
.ams-gallery a:hover img { transform: scale(1.04); }

/* ── VTLOG Activity ─────────────────────────────────────────────── */
.ams-stats { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.5rem; }
.ams-stats > div { padding: 0.6rem 0.75rem; border: 1px solid var(--ams-line); background: var(--ams-raised); }
.ams-stats dt { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ams-dim); }
.ams-stats dt i { color: var(--acc); }
.ams-stats dd { margin: 0.2rem 0 0; font-size: 1.15rem; font-weight: 700; color: var(--ams-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── VTLOG partnership: official, in VTLOG orange ───────────────── */
/* One grid for the whole card, so the badge's label shares a row with the button: rows are
   heading, text, "Ambassador since" (takes the spare height) and the button. The two wrappers
   are display: contents, so their children are placed in it directly. Right column: the emblem
   over rows 1-3, sitting on the label; the label in the button's row, both centred in that row,
   so the centre line of "About the Ambassador Program" runs through "VTLOG Ambassador". */
.ams-partner { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto 1fr auto; gap: 0.6rem 1.25rem; height: 100%; }
.ams-partner-copy, .ams-seal { display: contents; }
.ams-partner-copy > * { grid-column: 1; min-width: 0; }
.ams-partner-copy > .ams-head { grid-row: 1; }
.ams-partner-copy > .ams-text { grid-row: 2; align-self: start; }
.ams-partner-copy > .ams-sub { grid-row: 3; align-self: start; }
.ams-partner-copy > .ams-btn { grid-row: 4; align-self: center; justify-self: start; }
/* The recognition badge: the official mark large, with "VTLOG Ambassador" right under it, centred
   in the right-hand column. No box of its own: the card shows through. Sizes follow the
   module's width (cqi), so a narrow or resized module keeps it in proportion. */
.ams-seal img { grid-column: 2; grid-row: 1 / 4; align-self: end; justify-self: center; width: clamp(104px, 31cqi, 176px); height: auto; margin-bottom: -0.3rem; }
.ams-seal-label { grid-column: 2; grid-row: 4; align-self: center; justify-self: center; display: block; line-height: 1; text-align: center; }
.ams-seal-label b { display: block; font: 700 clamp(1.15rem, 3.95cqi, 1.6rem)/1 var(--ams-head-font); color: var(--vtlog); white-space: nowrap; }
/* Readable official text: the description and the "Ambassador since" line larger than the shared
   module sizes; the heading keeps its size, so the hierarchy stays heading > text > line. */
.ams-partner .ams-text { font-size: 1.125rem; }
.ams-partner .ams-sub { font-size: 1rem; margin-top: -0.3rem; }
@container amsmod (max-width: 480px) { .ams-partner .ams-text { font-size: 1.05rem; } }
@container amsmod (max-width: 430px) { .ams-partner .ams-text { font-size: 1rem; } .ams-partner .ams-sub { font-size: 0.94rem; } }
/* Narrow: the badge goes under the text, the same centred group (emblem over its label). */
@container amsmod (max-width: 400px) {
    .ams-partner { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; gap: 1rem; height: auto; }
    .ams-partner-copy { display: flex; flex-direction: column; gap: 0.6rem; }
    .ams-partner-copy > .ams-text, .ams-partner-copy > .ams-sub { align-self: stretch; }
    .ams-partner-copy > .ams-btn { align-self: flex-start; }
    .ams-seal { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; }
    .ams-seal img { width: 88px; margin-bottom: 0; align-self: center; }
    .ams-seal-label b { font-size: 1.3rem; }
}

/* ── Editor-only marks (the canvas; never on a public page) ─────── */
.ams-mod.is-hidden { opacity: 0.5; border-style: dashed; }
.ams-edit-badge { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 4; padding: 0.3rem 0.7rem; background: rgba(12,12,16,0.92); border: 1px solid var(--ams-line-2); color: var(--ams-ink); font-size: 0.78rem; white-space: nowrap; pointer-events: none; }
.ams-edit-note { margin: 0; padding: 0.45rem 0.6rem; font-size: 0.8rem; background: rgba(255,153,0,0.08); border-left: 3px solid var(--vtlog); color: var(--ams-text); position: relative; z-index: 2; }
.ams-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem; min-height: 140px; padding: 1rem; border: 1px dashed var(--ams-line-2); text-align: center; color: var(--ams-dim); font-size: 0.84rem; }
.ams-placeholder i { font-size: 1.4rem; color: var(--acc); }
.ams-placeholder b { color: var(--ams-ink); }
.as-canvas .ams-page.is-editing, .as-canvas .ams-hero { user-select: none; }

@media (prefers-reduced-motion: reduce) {
    .ams-live-dot { animation: none; }
    .ams-btn, .ams-gallery img, .ams-play { transition: none; }
    .ams-gallery a:hover img, .ams-play:hover { transform: none; }
}

/* ── Content-aware fill ─────────────────────────────────────────────
   A row is as tall as its tallest module. Instead of leaving an empty band under shorter content,
   the main visual of a module takes the remaining height (within limits): the livestream stage,
   the content tiles, the link buttons. Text modules keep their natural size. */
.ams-stage.is-cinema { flex: 1 0 auto; }
.ams-links { flex: 1 1 auto; grid-auto-rows: minmax(42px, 1fr); max-height: 30rem; }
.ams-links > li { display: flex; }
.ams-links > li > .ams-link { flex: 1; }
.ams-offer-art { flex: 1 1 auto; grid-auto-rows: minmax(80px, 1fr); max-height: 24rem; }
.ams-offer-art li { aspect-ratio: auto; }
.ams-offers li { min-height: 64px; }
/* A narrow content module: the secondary items become a compact two-column list. */
@container amsmod (max-width: 480px) {
    .ams-offers { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.4rem; }
    .ams-offers li { flex-direction: row; justify-content: flex-start; min-height: 40px; padding: 0.4rem 0.55rem; text-align: left; gap: 0.5rem; }
    .ams-offers i { font-size: 1rem; width: 1.2rem; text-align: center; }
    .ams-offer-art { grid-auto-rows: minmax(70px, 1fr); }
}
/* Room for the "Example content" label next to a module's heading. */
.ams-mod:has(> .ams-demo) .ams-head { padding-right: 6.6rem; }
@container amsmod (max-width: 360px) { .ams-mod:has(> .ams-demo) .ams-head { padding-right: 0; margin-top: 0.9rem; } }
/* Gallery strip: the pictures take the row's height (cropped, never stretched). */
.ams-gallery.is-row { flex: 1 1 auto; grid-auto-rows: minmax(110px, 1fr); max-height: 22rem; }
.ams-gallery.is-row li, .ams-gallery.is-row figure, .ams-gallery.is-row a { height: 100%; }
.ams-gallery.is-row figure:has(figcaption) a { height: calc(100% - 1.4rem); }
.ams-gallery.is-row a { position: relative; min-height: clamp(110px, 10cqi, 240px); }
.ams-gallery.is-row img { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; max-height: none; }
/* Premium giveaways: VTLOG's status and prize line (Studio\Giveaways). */
.ams-give-status { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.45rem; font-size: 0.82rem; color: var(--ams-dim); }
.ams-give-status i { color: var(--ams-dim); }
.ams-give-status b { color: var(--ams-ink); }
.ams-give-status.is-running i, .ams-give-status.is-idle i { color: var(--vtlog); }

/* Module height (Layout::HEIGHTS, set in the Studio): a minimum, so content never clips. Only where
   modules sit side by side; on a phone every module fits its content. */
@container ams (min-width: 721px) {
    .ams-mod[data-h]:not([data-h="0"]) { min-height: var(--h); }
}

/* Giveaways and About: text at the top, the highlights / labels in their own compact row at the
   bottom of the card (the copy column keeps its approved width and stretches to the card's full
   height, as a flex item of the row). Nothing is centred; the pictures keep their place, gradient
   and crop. */
.ams-give, .ams-about { flex: 1 1 auto; }
.ams-give-hl, .ams-about-copy > .ams-tags { margin-top: auto; padding-top: 0.15rem; }
/* VTLOG's prize block: a compact vertical tier list, no cards. */
.ams-give-prizes p { margin: 0 0 0.3rem; }
.ams-give-tiers { list-style: none; margin: 0 0 0.3rem; padding: 0 0 0 0.2rem; display: grid; gap: 0.1rem; line-height: 1.4; }

/* Links: the VTLOG profile tile, same treatment, in VTLOG orange with the official orange mark. */
.ams-link.is-vtlog { --pc: #ff9900; }
.ams-vtlog-mark { width: 1.1rem; height: 1.1rem; object-fit: contain; flex: 0 0 auto; }

/* The independence disclaimer under every Ambassador page: present, quiet. */
.ams-disclaimer { margin: 0; padding: 0.4rem 0 0.2rem; display: flex; align-items: baseline; gap: 0.45rem; font-size: 0.78rem; line-height: 1.5; color: var(--ams-dim, rgba(224,224,224,0.6)); }
.ams-disclaimer i { font-size: 0.72rem; opacity: 0.8; }
