:root {
    --bg: #101214;
    --bg-2: #16191d;
    --surface: #1e2329;
    --line: rgba(210, 222, 232, 0.12);
    --steel: #c5ced8;
    --steel-2: #8b96a3;
    --silver: #e8eef3;
    --muted: #8a929c;
    --danger: #c45c4a;
    --ok: #8fbc8f;
    --accent: #19e3d5;
    --text-subtitle: color-mix(in oklab, hsl(var(--hue-2) 88% 72%) 58%, hsl(var(--hue-1) 82% 76%));
    --text-lede: color-mix(in oklab, var(--muted) 92%, white);
    --ink: #111418;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    --radius: 18px;
    --font: "Asap", "Segoe UI", sans-serif;
    --display: "Amaranth", "Asap", sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    --text-2xs: 0.625rem;
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-body: 1rem;
    --text-lg: 1.25rem;
    --text-title: clamp(1.7rem, 4.6vw, 2.6rem);
    --pad: max(1rem, env(safe-area-inset-left));
    --header: 3.6rem;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { background: var(--bg); }
html.has-open-modal { overflow: hidden; overscroll-behavior: none; }
html.is-geo-denied body > :not([data-modal="geo-denial"]) { visibility: hidden; }
html.is-geo-denied [data-modal="geo-denial"] { visibility: visible; }
body.has-open-modal { position: fixed; top: var(--modal-scroll-offset, 0); right: 0; left: 0; width: 100%; overflow: hidden; overscroll-behavior: none; }
body {
    font-family: var(--font);
    color: var(--silver);
    background:
        radial-gradient(1200px 500px at 80% -10%, rgba(197, 206, 216, 0.16), transparent 50%),
        radial-gradient(800px 400px at -10% 20%, rgba(139, 150, 163, 0.1), transparent 45%),
        var(--bg);
    line-height: 1.5;
    padding-bottom: env(safe-area-inset-bottom);
}
img { max-width: 100%; display: block; }
a { color: var(--steel); text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
.visually-hidden, .skip {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}
.skip:focus {
    width: auto;
    height: auto;
    clip: auto;
    inset: 0.5rem;
    padding: 0.5rem 0.8rem;
    background: var(--steel);
    color: var(--ink);
    z-index: 20;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 0.75rem;
    min-height: var(--header);
    padding: 0.6rem var(--pad);
    padding-top: max(0.6rem, env(safe-area-inset-top));
    background: rgba(16, 18, 20, 0.88);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
}
.brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 0.55rem;
    color: var(--silver);
    font-family: var(--display);
    font-size: 1.35rem;
    font-style: italic;
    letter-spacing: -0.02em;
}
.brand .wordmark {
    background: linear-gradient(90deg, var(--accent) 0%, #d33deb 50%, #f00e43 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}
.brand em { font-style: italic; color: var(--muted); font-size: 0.72em; }
.header-brand-group {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: .7rem;
    min-width: 0;
    max-width: 100%;
}
.header-workflows-link {
    position: relative;
    top: .22rem;
    flex: 0 0 auto;
    color: var(--accent);
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    text-shadow: 0 0 16px color-mix(in srgb, var(--accent) 24%, transparent);
    transition: color .2s ease, text-shadow .2s ease;
}
.header-workflows-link span { margin-inline-end: .15rem; color: #d33deb; }
.header-workflows-link:hover, .header-workflows-link:focus-visible { color: var(--accent); text-shadow: 0 0 18px color-mix(in srgb, var(--accent) 48%, transparent); }
.header-actions {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 0.45rem;
    min-width: 0;
    flex: 1 1 0;
    max-width: 100%;
}
.header-desktop-links {
    display: flex;
    align-items: center;
}
.header-overflow-menu {
    display: none;
}
.lang-switch {
    position: relative;
    max-width: min(14rem, 42vw);
}
.lang-switch-trigger {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.42rem;
    width: 100%;
    min-width: 0;
    padding: 0.22rem 1.45rem 0.22rem 0.55rem;
    border: 1px solid rgba(210, 222, 232, 0.1);
    border-radius: 999px;
    background: transparent;
    color: var(--silver);
    font: inherit;
    font-size: 0.78rem;
    cursor: pointer;
    list-style: none;
}
.lang-switch-trigger::-webkit-details-marker {
    display: none;
}
.lang-switch-trigger::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 0.62rem;
    width: 0.34rem;
    height: 0.34rem;
    border-right: 1.5px solid rgba(210, 222, 232, 0.75);
    border-bottom: 1.5px solid rgba(210, 222, 232, 0.75);
    transform: translateY(-65%) rotate(45deg);
    transition: transform 0.15s ease;
    pointer-events: none;
}
.lang-switch[open] .lang-switch-trigger::after {
    transform: translateY(-35%) rotate(225deg);
}
.lang-switch-trigger:focus-visible {
    outline: 2px solid rgba(210, 222, 232, 0.35);
    outline-offset: 2px;
}
.lang-code-bubble {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 1.65rem;
    padding: 0.14rem 0.32rem;
    border-radius: 999px;
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    line-height: 1;
    color: rgba(255, 255, 255, 0.88);
    background: rgba(210, 222, 232, 0.12);
    border: 1px solid rgba(210, 222, 232, 0.16);
}
.lang-switch-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lang-switch-menu {
    position: absolute;
    z-index: 40;
    top: calc(100% + 0.35rem);
    left: 0;
    right: auto;
    width: min(8rem, calc(100vw - 1rem));
    min-width: 0;
    margin: 0;
    padding: 0.28rem;
    border: 1px solid rgba(210, 222, 232, 0.12);
    border-radius: 0.85rem;
    background: rgba(12, 14, 18, 0.96);
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
    list-style: none;
}
.lang-switch-option {
    display: flex;
    align-items: center;
    gap: 0.42rem;
    width: 100%;
    padding: 0.42rem 0.45rem;
    border: 0;
    border-radius: 0.55rem;
    color: var(--silver);
    background: transparent;
    text-decoration: none;
    text-align: left;
    font: inherit;
    font-size: 0.78rem;
    cursor: pointer;
}
.lang-switch-menu form { margin: 0; }
.lang-switch-menu .lang-switch-name {
    overflow: visible;
    text-overflow: clip;
}
.lang-switch-option:hover,
.lang-switch-option:focus-visible {
    background: rgba(210, 222, 232, 0.08);
    outline: none;
}
.lang-switch-option.is-on {
    background: rgba(210, 222, 232, 0.12);
    color: white;
}
[dir="rtl"] .lang-switch-trigger {
    padding: 0.22rem 0.55rem 0.22rem 1.45rem;
}
[dir="rtl"] .lang-switch-trigger::after {
    right: auto;
    left: 0.62rem;
}
[dir="rtl"] .lang-switch-menu {
    left: 0;
    right: auto;
}
.wallet-chip {
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    font-size: 0.85rem;
    color: var(--steel);
    cursor: pointer;
    font: inherit;
}
.header-badge-rack {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    padding: 0.2rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: hsl(225 30% 5% / 0.56);
    box-shadow: inset 0 1px hsl(0 0% 100% / 0.06);
}
.header-badge {
    --badge-accent: #8c96a3;
    position: relative;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--badge-accent) 62%, transparent);
    border-radius: 50%;
    background: radial-gradient(circle at 35% 25%, color-mix(in srgb, var(--badge-accent) 24%, transparent), transparent 66%), #08090d;
    box-shadow: 0 0 10px color-mix(in srgb, var(--badge-accent) 22%, transparent);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.header-badge span {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg in oklch, var(--accent) 0%, #d33deb 55%, #f00e43 100%);
    -webkit-mask: var(--header-badge-icon) center / contain no-repeat;
    mask: var(--header-badge-icon) center / contain no-repeat;
}
.header-badge:hover,
.header-badge:focus-visible {
    z-index: 1;
    border-color: var(--badge-accent);
    box-shadow: 0 0 18px color-mix(in srgb, var(--badge-accent) 42%, transparent);
}
.header-badge:focus-visible { outline: 2px solid var(--badge-accent); outline-offset: 2px; }
.icon-btn, .text-btn, .primary-btn, .chip {
    border: 0;
    background: none;
    cursor: pointer;
}
.icon-btn {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: var(--silver);
    display: grid;
    place-items: center;
}
.icon-btn:hover, .text-btn:hover { background: rgba(210, 222, 232, 0.08); }
.text-btn {
    color: var(--silver);
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    font-size: var(--text-sm);
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.text-btn.danger { color: #fb7185; }
.primary-btn.danger {
    background: linear-gradient(180deg, #fb7185, #e11d48);
    color: #fff7f8;
}
.text-btn.danger:hover {
    color: #fecdd3;
    background: rgba(251, 113, 133, 0.14);
}
.primary-btn {
    background: linear-gradient(180deg, var(--steel), var(--steel-2));
    color: var(--ink);
    font-weight: 600;
    border-radius: 999px;
    padding: 0.85rem 1.2rem;
    min-height: 48px;
}
.primary-btn:disabled { opacity: 0.55; cursor: wait; }
.badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 1.05rem;
    height: 1.05rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: var(--steel);
    color: var(--ink);
    font-size: 0.65rem;
    font-weight: 600;
    display: grid;
    place-items: center;
}

main { width: min(920px, calc(100% - 2 * var(--pad))); margin: 0 auto; padding: 1.25rem 0 4rem; }

.hero { padding: 1.4rem 0 0.4rem; }
.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: var(--text-xs);
    color: var(--text-subtitle);
    margin: 0 0 0.6rem;
}
h1 {
    font-family: var(--display);
    font-weight: 500;
    font-size: var(--text-title);
    line-height: 1.12;
    letter-spacing: -0.03em;
    margin: 0 0 0.8rem;
}
.lede, .sheet-copy { margin: 0 0 1rem; max-width: 38rem; }
.lede { color: var(--text-lede); }
.sheet-copy { color: var(--text-subtitle); }

.studio { margin-top: 1.5rem; }
.prompt-card, .stat-card, .auth-card, .media-card {
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.prompt-card { padding: 1rem; }
.reference-controls { display: grid; gap: .4rem; margin-top: .75rem; }
.reference-controls.references-hidden .reference-toolbar select,
.reference-controls.references-hidden .reference-files-row,
.reference-controls.references-hidden .reference-summary { display: none; }
.reference-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.reference-toolbar-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: .45rem; }
.reference-toolbar select { min-height: 2.4rem; max-width: 70%; border: 1px solid var(--line); border-radius: 10px; color: var(--silver); background: var(--bg-2); padding: .35rem 2rem .35rem .7rem; }
.reference-toolbar-actions select { max-width: min(22rem, 100%); }
.reference-toolbar select option { color: var(--silver); background: var(--bg-2); }
.reference-files-row { display: flex; align-items: flex-start; flex-wrap: wrap; gap: .5rem; }
.reference-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.reference-slot { display: flex; flex-direction: column; align-items: center; gap: .25rem; width: 5rem; min-width: 0; }
.reference-slot-label { width: 100%; overflow: hidden; color: var(--muted); font-size: var(--text-xs); line-height: 1.15; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.reference-dropzone { display: grid; place-items: center; align-content: center; width: 5rem; min-height: 3.65rem; padding: .35rem; border: 1px dashed var(--steel); border-radius: 10px; background: rgba(255,255,255,.025); color: var(--muted); text-align: center; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.reference-dropzone:hover, .reference-dropzone.is-dragging { border-color: var(--accent); background: rgba(255,255,255,.05); }
.reference-add-icon { color: var(--silver); font-size: 1.35rem; line-height: 1; }
.reference-file-list { display: flex; flex: 1 1 12rem; flex-wrap: wrap; gap: 1rem .4rem; min-width: 0; }
.homepage-reference-slot { position: relative; width: 5.6rem; }
.homepage-reference-slot .reference-dropzone, .homepage-reference-slot .reference-file-chip { width: 5.1rem; height: 4.1rem; min-height: 4.1rem; }
.homepage-reference-slot .homepage-reference-file-chip { display: grid; padding: 0; overflow: hidden; cursor: pointer; }
.homepage-reference-slot .reference-picker-remove { top: -.25rem; right: 0; }
.reference-file-chip { display: flex; align-items: center; gap: .4rem; width: 5rem; min-height: 3.65rem; padding: .35rem .45rem .35rem .6rem; border: 1px solid var(--line); border-radius: 9px; color: var(--silver); background: var(--bg-2); font-size: var(--text-xs); }
.reference-file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reference-file-chip button { flex: 0 0 auto; border: 0; color: var(--muted); background: transparent; cursor: pointer; font-size: 1rem; line-height: 1; }
.reference-file-chip button:hover { color: var(--silver); }
.reference-summary { color: var(--muted); font-size: var(--text-xs); }
.reference-clear { justify-self: end; }
.reference-library-button { flex: 0 0 auto; white-space: nowrap; }
.prompt-input-wrap { position: relative; }
.generation-prompt-highlight { position: absolute; inset: 0; z-index: 1; margin: 0; padding: .85rem 3.9rem .85rem .9rem; overflow: hidden; color: var(--silver); border: 1px solid transparent; white-space: pre-wrap; overflow-wrap: break-word; pointer-events: none; font: inherit; line-height: 1.45; }
.prompt-input-wrap #prompt { position: relative; z-index: 2; color: transparent; -webkit-text-fill-color: transparent; caret-color: var(--silver); background: transparent; }
.prompt-input-wrap #prompt:focus { color: transparent; -webkit-text-fill-color: transparent; }
.prompt-input-wrap #prompt::selection, .prompt-helper-editor .helper-editor-source::selection { color: transparent; -webkit-text-fill-color: transparent; background: hsl(var(--hue-1) 72% 62% / .3); text-shadow: none; }
.prompt-highlight .prompt-reference, .helper-editor-highlight .helper-editor-reference, .prompt-highlight .prompt-media-reference, .helper-editor-highlight .helper-editor-media-reference { color: hsl(var(--hue-1) 70% 73%); font: inherit; white-space: inherit; }
.prompt-syntax-marker, .prompt-syntax-hash { color: hsl(var(--hue-1) 70% 73%); }
.prompt-syntax-media-kind { color: color-mix(in oklab, var(--accent) 74%, white); font-weight: 700; }
.prompt-syntax-media-index { color: #ed78cb; font-weight: 800; }
.prompt-syntax-punctuation, .prompt-syntax-operator { color: #ed55c3; }
.prompt-syntax-literal, .prompt-syntax-string, .prompt-syntax-regex { color: color-mix(in oklab, var(--accent) 76%, white); }
.prompt-syntax-regex-flags, .prompt-syntax-regex-delimiter, .prompt-syntax-regex-symbol, .prompt-syntax-quote { color: hsl(var(--hue-1) 62% 78%); }
.prompt-highlight .prompt-comment, .helper-editor-highlight .prompt-comment { color: hsl(150 34% 58%); font-family: var(--font-mono); font-style: italic; }
.prompt-helper-fan { position: absolute; right: .75rem; bottom: .75rem; z-index: 8; }
.prompt-helper-fab, .prompt-fan-button { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; padding: 0; color: var(--silver); background: hsl(220 25% 7% / 0.96); border: 1px solid hsl(var(--hue-1) 72% 69% / 0.5); border-radius: 50%; box-shadow: 0 0 22px hsl(var(--hue-1) 84% 60% / 0.18); cursor: pointer; }
.prompt-helper-fab { position: relative; z-index: 3; transition: color .18s ease, border-color .18s ease, transform .18s ease; }
.prompt-helper-fan.is-open .prompt-helper-fab { color: white; border-color: hsl(var(--hue-1) 82% 75%); transform: rotate(8deg); }
.prompt-input-wrap:focus-within .prompt-helper-fan:not(.is-open) > .prompt-helper-fab,
.helper-editor-input-wrap:focus-within .prompt-helper-fan:not(.is-open) > .prompt-helper-fab,
.prompt-helper-fan.is-open [data-open-prompt-helper] {
    isolation: isolate;
    background: hsl(220 32% 3% / .99);
}
.prompt-input-wrap:focus-within .prompt-helper-fan:not(.is-open) > .prompt-helper-fab::before,
.helper-editor-input-wrap:focus-within .prompt-helper-fan:not(.is-open) > .prompt-helper-fab::before,
.prompt-helper-fan.is-open [data-open-prompt-helper]::before {
    content: "";
    position: absolute;
    inset: -5px;
    z-index: 0;
    padding: 3px;
    border-radius: inherit;
    background: linear-gradient(120deg, #dc3737 0%, #c700ff 50%, #fff 100%);
    background-size: 200% 100%;
    box-shadow: 0 0 10px hsl(var(--hue-1) 92% 66% / .8), 0 0 24px hsl(var(--hue-2) 88% 60% / .5);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: prompt-helper-border-run 2s linear infinite;
    pointer-events: none;
}
@keyframes prompt-helper-border-run {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}
.prompt-fan-actions { position: absolute; right: 0; bottom: 0; display: flex; align-items: flex-end; gap: .5rem; width: max-content; max-width: min(82vw, 760px); pointer-events: none; }
.prompt-fan-actions[aria-hidden="false"] { pointer-events: auto; }
.prompt-fan-primary-actions, .prompt-fan-column { display: flex; flex-direction: column; align-items: center; gap: .42rem; }
.prompt-fan-primary-actions { margin-bottom: 3.15rem; }
.prompt-fan-columns { display: flex; align-items: flex-end; gap: .5rem; }
.prompt-fan-column { position: relative; flex: 0 0 auto; }
.prompt-fan-shortcut-wrap { position: relative; }
.prompt-fan-button { position: relative; z-index: 1; opacity: 0; transform: translate(var(--fan-x, 2.9rem), var(--fan-y, 1.2rem)) scale(.35) rotate(-14deg); transition: opacity .2s ease, transform .34s cubic-bezier(.18,.9,.28,1.2), color .15s ease, background .15s ease; transition-delay: 0ms; }
.prompt-helper-fan.is-open .prompt-fan-button { opacity: 1; transform: translate(0, 0) scale(1) rotate(0); animation: prompt-fan-slide .38s cubic-bezier(.18,.9,.28,1.2) both; animation-delay: var(--fan-delay, 0ms); }
.prompt-helper-fan.is-measuring .prompt-fan-button { opacity: 0; transform: none; transition: none; }
@keyframes prompt-fan-slide {
    from { opacity: 0; transform: translate(var(--fan-x, 2.9rem), var(--fan-y, 1.2rem)) scale(.35) rotate(-14deg); }
    to { opacity: 1; transform: translate(0, 0) scale(1) rotate(0); }
}
.prompt-fan-button:hover, .prompt-fan-button:focus-visible { color: white; background: hsl(var(--hue-1) 38% 20% / .98); }
.prompt-fan-add-shortcut { color: hsl(var(--hue-1) 62% 75%); }
.prompt-fan-add-shortcut[hidden] { display: none; }
.prompt-fan-shortcut { width: auto; min-width: 2.6rem; max-width: 8.5rem; padding: 0 .62rem; overflow: hidden; border-radius: 1.3rem; color: hsl(var(--hue-1) 70% 76%); font: 700 var(--text-xs) var(--font-mono); text-overflow: ellipsis; white-space: nowrap; }
.prompt-fan-shortcut-menu { position: absolute; right: calc(100% + .4rem); bottom: 0; z-index: 15; min-width: 170px; padding: .35rem; background: hsl(220 25% 8% / .99); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.prompt-fan-shortcut-menu[hidden] { display: none; }
.prompt-fan-shortcut-menu button { display: block; width: 100%; padding: .5rem .65rem; color: var(--silver); text-align: left; background: transparent; border: 0; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.prompt-fan-shortcut-menu button:hover, .prompt-fan-shortcut-menu button:focus-visible { color: white; background: rgba(255,255,255,.08); }
.prompt-helper-panel { width: min(1100px, calc(100vw - 2rem)); max-width: none; max-height: calc(100dvh - 2rem); overflow: hidden; }
.prompt-helper-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.prompt-helper-title { display: flex; align-items: center; gap: .65rem; }
.prompt-helper-title img { flex: 0 0 auto; width: 2rem; height: 2rem; }
.prompt-helper-head h2, .prompt-helper-head p { margin: 0; }
.prompt-helper-actions, .helper-toolbar, .helper-ai-row { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }
.helper-ai-row { flex-wrap: nowrap; }
.prompt-helper-panel .helper-ai-row .helper-apply { flex: 0 0 auto; width: auto; max-width: max-content; margin: 0 0 0 auto; white-space: nowrap; }
.prompt-helper-grid { display: grid; grid-template-columns: minmax(230px, .72fr) minmax(0, 2fr); gap: 1rem; min-height: 0; }
.prompt-helper-sidebar, .prompt-helper-editor { min-height: 0; }
.prompt-helper-sidebar { border-right: 1px solid var(--line); padding-right: 1rem; }
.prompt-helper-sidebar .format-row { margin: 0 0 .65rem; }
.prompt-helper-sidebar input { width: 100%; }
.helper-search-wrap { position: relative; }
.prompt-helper-sidebar .helper-search-wrap input { padding-right: 2.4rem; }
.helper-search-clear { position: absolute; top: 50%; right: .45rem; display: grid; place-items: center; width: 1.8rem; height: 1.8rem; padding: 0; color: var(--muted); background: transparent; border: 0; border-radius: 50%; cursor: pointer; transform: translateY(-50%); }
.helper-search-clear[hidden] { display: none; }
.helper-search-clear:hover { color: var(--silver); background: rgba(255,255,255,.08); }
.helper-library { height: min(50vh, 420px); margin-top: .7rem; overflow: auto; display: grid; align-content: start; gap: .5rem; }
.helper-library-row { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.helper-library-item { width: 100%; padding: .7rem 2.5rem .7rem .7rem; text-align: left; color: var(--silver); background: transparent; border: 0; border-radius: inherit; cursor: pointer; }
.helper-library-row.is-prompt { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; }
.helper-library-row.is-prompt .helper-library-item { grid-column: 1 / -1; grid-row: 1; min-width: 0; }
.helper-library-row.is-prompt .helper-prompt-meta { grid-column: 2; grid-row: 2; justify-content: flex-end; }
.helper-prompt-actions { position: relative; grid-column: 1; grid-row: 2; display: flex; align-items: stretch; }
.helper-prompt-ref-button { width: 100%; padding: .45rem .7rem; color: hsl(var(--hue-1) 70% 73%); background: transparent; border: 0; border-radius: 0 0 0 11px; cursor: pointer; font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 700; }
.helper-prompt-ref-button:hover { color: white; background: hsl(var(--hue-1) 50% 35% / .24); }
.helper-hash-at { display: inline-block; margin-right: .2em; }
.helper-prompt-menu { position: absolute; left: .35rem; top: calc(100% - .25rem); z-index: 12; min-width: 130px; padding: .35rem; background: hsl(220 25% 8% / .99); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.helper-prompt-menu.is-up { top: auto; bottom: calc(100% - .25rem); }
.helper-prompt-menu[hidden] { display: none; }
.helper-prompt-menu button { display: block; width: 100%; padding: .5rem .65rem; color: var(--silver); text-align: left; background: transparent; border: 0; border-radius: 7px; cursor: pointer; }
.helper-prompt-menu button:hover { color: white; background: rgba(255,255,255,.08); }
.helper-prompt-menu .helper-menu-secondary { margin-top: .3rem; border-top: 1px solid var(--line); border-radius: 0 0 7px 7px; }
.helper-prompt-menu button:disabled { color: var(--muted); cursor: default; }
.helper-prompt-meta { display: flex; align-items: center; gap: .55rem; min-height: 2.35rem; padding: .45rem .7rem; color: var(--muted); font-size: var(--text-xs); }
.helper-prompt-metric { display: inline-flex; align-items: center; gap: .2rem; }
.helper-prompt-metric svg { fill: none; stroke: currentColor; }
.helper-prompt-metric.is-favorited { color: #ffd76a; }
.helper-prompt-metric.is-favorited svg, .helper-favorite-button.is-favorited svg { fill: currentColor; stroke: currentColor; }
.helper-favorite-button { display: inline-flex; align-items: center; gap: .35rem; }
.helper-favorite-button svg { fill: none; stroke: currentColor; stroke-width: 1.6; }
.helper-favorite-button.is-favorited { color: #ffd76a; }
.helper-favorite-button[aria-disabled="true"] { color: var(--muted); cursor: default; }
.helper-prompt-visibility { display: inline-flex; align-items: center; color: var(--muted); }
.helper-prompt-visibility.is-public { color: hsl(var(--hue-1) 62% 72%); }
.helper-prompt-visibility svg { display: block; }
.helper-time-wrap { position: relative; }
.helper-relative-time { padding: 0; color: inherit; background: transparent; border: 0; border-bottom: 1px dotted currentColor; cursor: help; font: inherit; }
.helper-exact-time { position: absolute; top: calc(100% + .4rem); right: 0; z-index: 4; width: max-content; max-width: 220px; padding: .4rem .55rem; color: var(--silver); background: hsl(220 25% 8% / .98); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); font-size: var(--text-xs); }
.helper-exact-time.is-above { top: auto; bottom: calc(100% + .4rem); }
.helper-library-row.is-highlighted { animation: helper-item-highlight 1.8s ease; }
.helper-library-row.is-highlighted .helper-library-item { color: white; }
@keyframes helper-item-highlight { 0%, 35% { border-color: hsl(var(--hue-1) 82% 72% / .9); background: hsl(var(--hue-1) 48% 24% / .72); box-shadow: 0 0 0 3px hsl(var(--hue-1) 85% 66% / .14), 0 0 24px hsl(var(--hue-1) 85% 58% / .25); } 100% { border-color: var(--line); background: var(--surface); box-shadow: none; } }
.helper-library-delete { position: absolute; top: .45rem; right: .45rem; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; color: var(--muted); background: transparent; cursor: pointer; }
.helper-library-delete:hover { color: var(--silver); background: rgba(255,255,255,.07); }
.helper-library-empty { color: var(--muted); font-size: .85rem; }
.prompt-helper-editor { position: relative; display: flex; flex-direction: column; gap: .7rem; }
.helper-editor-viewport { flex: 1 1 380px; min-width: 0; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; scrollbar-color: hsl(var(--hue-1) 35% 42%) transparent; }
.helper-editor-track { display: flex; gap: .8rem; min-width: 100%; height: 100%; min-height: min(48vh, 430px); }
.helper-prompt-view { position: relative; flex: 0 0 100%; min-width: 0; min-height: inherit; overflow: hidden; background: hsl(220 20% 10% / .72); border: 1px solid var(--line); border-radius: 13px; scroll-snap-align: start; }
.helper-editor-track.has-side-views .helper-prompt-view { flex-basis: 80%; }
.helper-prompt-view.is-side { color: hsl(220 10% 72%); background: hsl(220 18% 9% / .78); border-color: hsl(220 15% 28% / .72); }
.helper-editor-input-wrap { position: relative; height: 100%; min-height: inherit; }
.prompt-helper-editor .helper-editor-source { position: relative; z-index: 2; height: 100%; min-height: inherit; color: transparent; -webkit-text-fill-color: transparent; caret-color: var(--silver); background: transparent; resize: none; }
.prompt-helper-editor .helper-editor-source:focus { color: transparent; -webkit-text-fill-color: transparent; }
.helper-editor-input-wrap .helper-editor-source, .helper-editor-input-wrap .helper-editor-highlight { padding-right: 3.9rem; }
.helper-editor-highlight { position: absolute; inset: 0; z-index: 1; margin: 0; padding: .85rem .9rem; overflow: hidden; color: var(--silver); border: 1px solid transparent; white-space: pre-wrap; overflow-wrap: break-word; pointer-events: none; font: inherit; line-height: 1.45; }
.prompt-input-wrap #prompt, .generation-prompt-highlight, .prompt-helper-editor .helper-editor-source, .helper-editor-highlight { font-family: var(--font-mono); font-variant-ligatures: none; }
.helper-side-view-head { position: absolute; top: .55rem; right: .55rem; left: .7rem; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: .5rem; pointer-events: none; }
.helper-side-view-hash { overflow: hidden; color: hsl(var(--hue-1) 45% 67%); font: 700 var(--text-xs) var(--font-mono); text-overflow: ellipsis; white-space: nowrap; }
.helper-side-view-actions { display: flex; gap: .3rem; pointer-events: auto; }
.helper-side-view-actions .icon-btn { width: 2rem; height: 2rem; padding: .38rem; background: hsl(220 22% 8% / .88); }
.helper-side-view-body { height: 100%; padding: 3.2rem .9rem .9rem; overflow: auto; color: hsl(220 10% 72%); white-space: pre-wrap; overflow-wrap: break-word; font: inherit; line-height: 1.45; }
.helper-side-reference-wrap { position: relative; display: inline-block; white-space: nowrap; }
.helper-side-reference { padding: 0; color: hsl(var(--hue-1) 48% 68%); background: transparent; border: 0; cursor: pointer; font: 700 1em var(--font-mono); }
.helper-side-reference:hover { color: hsl(var(--hue-1) 72% 82%); }
.helper-side-reference-menu { position: fixed; inset: auto; z-index: 40; }
.helper-floating-prompt-menu { position: fixed; inset: auto; z-index: 40; }
.helper-reference-popover { position: absolute; z-index: 25; max-height: 300px; overflow: auto; padding: .5rem; color: var(--silver); background: hsl(220 25% 8% / .99); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.helper-reference-popover[hidden] { display: none; }
.generation-reference-popover { top: .75rem; left: .75rem; width: min(340px, calc(100% - 1.5rem)); }
.helper-reference-popover > p { margin: .35rem; color: var(--muted); font-size: var(--text-sm); }
.helper-reference-option { display: grid; gap: .2rem; width: 100%; padding: .55rem .65rem; color: var(--silver); text-align: left; background: transparent; border: 0; border-radius: 8px; cursor: pointer; }
.helper-reference-option:hover, .helper-reference-option.is-selected { color: white; background: rgba(255,255,255,.08); }
.helper-reference-split { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 2.35rem; }
.helper-reference-split > .helper-reference-option { border-radius: 8px 0 0 8px; }
.helper-reference-more { display: grid; place-items: center; padding: 0; color: var(--muted); background: transparent; border: 0; border-radius: 0 8px 8px 0; cursor: pointer; }
.helper-reference-more:hover, .helper-reference-more[aria-expanded="true"] { color: white; background: rgba(255,255,255,.08); }
.helper-reference-more-menu { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: .3rem; margin: .2rem .25rem .35rem; padding: .3rem; background: hsl(220 22% 6% / .96); border: 1px solid var(--line); border-radius: 8px; }
.helper-reference-more-menu[hidden] { display: none; }
.helper-reference-more-menu button { padding: .45rem .55rem; color: var(--silver); background: transparent; border: 0; border-radius: 6px; cursor: pointer; }
.helper-reference-more-menu button:hover { color: white; background: rgba(255,255,255,.08); }
.helper-reference-more-menu button:disabled { color: var(--muted); cursor: default; }
.helper-media-reference-option { border-bottom: 1px solid var(--line); border-radius: 8px 8px 4px 4px; margin-bottom: .3rem; padding-bottom: .7rem; }
.helper-media-reference-option .helper-reference-hash { color: color-mix(in oklab, var(--accent) 78%, white); }
.helper-reference-hash { color: hsl(var(--hue-1) 70% 73%); font-family: var(--font-mono); font-weight: 700; }
.helper-reference-option > span { overflow: hidden; color: var(--muted); font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.helper-reference-detail-actions { display: flex; gap: .5rem; margin-top: .65rem; }
.helper-reference-detail-actions .text-btn { display: inline-flex; align-items: center; gap: .35rem; text-decoration: none; }
.helper-reference-detail-actions .text-btn:disabled { color: var(--muted); cursor: default; }
.helper-reference-open svg { flex: 0 0 auto; }
@media (min-width: 721px) {
    .helper-editor-viewport {
        --helper-scrollbar-lane: .75rem;
        padding-bottom: var(--helper-scrollbar-lane);
        scrollbar-width: thin;
    }
    .helper-editor-track {
        height: calc(100% - var(--helper-scrollbar-lane));
        min-height: calc(min(48vh, 430px) - var(--helper-scrollbar-lane));
        align-items: stretch;
    }
    .helper-prompt-view { height: 100%; min-height: 0; }
    .helper-editor-input-wrap { min-height: 0; }
    .prompt-helper-editor .helper-editor-source { min-height: 0; }
    .helper-editor-viewport::-webkit-scrollbar { height: 7px; }
    .helper-editor-viewport::-webkit-scrollbar-track { margin-inline: .65rem; background: transparent; }
    .helper-editor-viewport::-webkit-scrollbar-thumb { background: hsl(var(--hue-1) 35% 42%); border-radius: 999px; }
    .helper-editor-viewport::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
}
@media (max-width: 720px) {
    .helper-editor-viewport {
        --helper-scrollbar-lane: .4rem;
        padding-bottom: var(--helper-scrollbar-lane);
        scrollbar-width: thin;
    }
    .prompt-helper-editor .helper-editor-track {
        height: calc(100% - var(--helper-scrollbar-lane));
        min-height: calc(38vh - var(--helper-scrollbar-lane));
        align-items: stretch;
    }
    .helper-prompt-view { height: 100%; min-height: 0; }
    .helper-editor-input-wrap { min-height: 0; }
    .prompt-helper-editor .helper-editor-source { min-height: 0; }
    .helper-editor-viewport::-webkit-scrollbar { height: 5px; }
    .helper-editor-viewport::-webkit-scrollbar-track { margin-inline: .4rem; background: transparent; }
    .helper-editor-viewport::-webkit-scrollbar-thumb { background: hsl(var(--hue-1) 35% 42%); border-radius: 999px; }
    .helper-editor-viewport::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
}
.reference-picker { z-index: 45; }
.media-library-picker { z-index: 46; }
.reference-picker-panel { display: grid; grid-template-rows: auto auto minmax(7rem, auto) auto; gap: 1rem; width: min(1040px, calc(100vw - 3rem)); max-height: calc(100dvh - 3rem); overflow: visible; }
.media-library-panel { display: grid; width: min(1040px, calc(100vw - 3rem)); height: min(700px, calc(100dvh - 3rem)); overflow: hidden; }
.reference-picker-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; padding-right: 2.6rem; }
.reference-picker-head .eyebrow, .reference-picker-head h2, .reference-picker-head .sheet-copy { margin: 0; }
.reference-picker-head .eyebrow { margin-bottom: .25rem; }
.reference-picker-head h2 { font-family: var(--display); font-size: 1.45rem; }
.reference-picker-head .sheet-copy { max-width: 34rem; font-size: var(--text-sm); text-align: right; }
.reference-picker-config { display: grid; grid-template-columns: minmax(13rem, 1.15fr) minmax(12rem, 1fr) minmax(12rem, .8fr); align-items: end; gap: .8rem; padding: .8rem; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.025); }
.reference-picker-config fieldset { display: block; align-self: center; min-width: 0; margin: 0; padding: 0; border: 0; }
.reference-picker-config legend { position: static; margin: 0 0 .3rem; padding: 0; color: var(--muted); font-size: var(--text-sm); }
.reference-picker-config label { margin: 0; }
.reference-picker-config .format-row { margin: 0; }
.reference-picker-config select { min-height: 2.65rem; }
.reference-picker-references, .reference-picker-library { min-width: 0; }
.reference-picker-slots-head { display: flex; align-items: center; justify-content: flex-end; margin-bottom: .35rem; }
.reference-picker-arrange { min-height: 2rem; padding: .35rem .7rem; }
.reference-picker-arrange.is-on { color: white; background: hsl(var(--hue-1) 60% 35% / .2); border-color: hsl(var(--hue-1) 72% 67% / .55); }
.reference-picker-section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .65rem; }
.reference-picker-section-head h3, .reference-picker-section-head p { margin: 0; }
.reference-picker-section-head h3 { font-family: var(--display); font-size: 1rem; }
.reference-picker-section-head p { margin-top: .2rem; color: var(--muted); font-size: .76rem; }
.reference-picker-slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(5.75rem, 6.5rem)); align-items: start; justify-content: start; gap: .3rem .1rem; padding: .2rem 0; }
.reference-picker-slot { position: relative; width: 100%; padding: .25rem; border: 1px solid transparent; border-radius: 13px; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.reference-picker-slot .reference-dropzone, .reference-picker-slot .reference-file-chip { width: 5.1rem; height: 4.1rem; min-height: 4.1rem; }
.reference-picker-slot .reference-file-chip { display: grid; padding: 0; overflow: hidden; border: 1px solid var(--line); cursor: pointer; }
.reference-picker-media-preview { display: block; width: 100%; height: 4.1rem; object-fit: cover; pointer-events: none; }
.reference-picker-media-fallback { display: grid; place-items: center; width: 100%; min-height: 4.1rem; color: var(--muted); font-size: 1.4rem; }
.reference-picker-slots.is-arranging .reference-file-chip, .reference-picker-slots.is-arranging .reference-dropzone { cursor: grab; }
.reference-picker-slots.is-arranging .reference-file-chip:active, .reference-picker-slots.is-arranging .reference-dropzone:active { cursor: grabbing; }
.reference-picker-slots.is-arranging .reference-picker-slot { cursor: grab; }
.reference-picker-slots.is-arranging .reference-picker-slot:active { cursor: grabbing; }
.reference-picker-slots.is-arranging .reference-picker-slot::before { content: "⠿"; position: absolute; top: -.35rem; right: -.35rem; z-index: 2; display: grid; place-items: center; width: 1.45rem; height: 1.45rem; color: hsl(var(--hue-1) 86% 82%); background: hsl(224 34% 10% / .94); border: 1px solid hsl(var(--hue-1) 72% 67% / .68); border-radius: 999px; box-shadow: 0 0 12px hsl(var(--hue-1) 80% 60% / .24); font-size: .92rem; line-height: 1; pointer-events: none; }
.reference-picker-slots.is-arranging .reference-file-chip, .reference-picker-slots.is-arranging .reference-dropzone { border-color: hsl(var(--hue-1) 72% 67% / .62); border-style: dashed; background: linear-gradient(145deg, hsl(var(--hue-1) 54% 28% / .13), rgba(255,255,255,.025)); box-shadow: inset 0 0 0 1px hsl(var(--hue-1) 72% 67% / .08), 0 5px 14px hsl(225 70% 2% / .28); transform: translateY(-1px); }
.reference-picker-slots.is-arranging .reference-picker-slot-label { color: hsl(var(--hue-1) 48% 76%); }
.reference-picker-slots.is-arranging .reference-picker-remove { display: none; }
.reference-picker-file-chip.is-being-arranged { opacity: .45; }
.reference-picker-drag-preview { position: fixed; z-index: -1; width: 5.1rem; height: 4.1rem; min-height: 4.1rem; opacity: 1; pointer-events: none; transform: rotate(2deg) scale(.96); box-shadow: 0 10px 30px hsl(225 70% 2% / .55); }
.reference-picker-drag-preview.is-empty { opacity: 1; background: hsl(220 8% 52%); border: 1px solid hsl(220 10% 72% / .7); border-radius: 12px; }
.reference-picker-file-chip.is-arrange-target, .reference-picker-dropzone.is-arrange-target { border-color: hsl(var(--hue-1) 78% 68% / .88); background: hsl(var(--hue-1) 58% 28% / .18); box-shadow: 0 0 0 2px hsl(var(--hue-1) 78% 68% / .16); }
.reference-picker-slot .reference-file-chip span { width: 100%; text-align: center; }
.reference-picker-slot .reference-slot-label { margin-top: .1rem; }
.reference-slot-menu { position: fixed; z-index: 60; display: grid; gap: .25rem; width: 11rem; padding: .3rem; background: hsl(220 25% 8%); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.reference-slot-menu.is-modal-anchored { position: absolute; }
.reference-slot-menu .text-btn { width: 100%; padding: .45rem .5rem; border-radius: 4px; text-align: left; white-space: normal; }
.reference-slot-menu .text-btn:hover, .reference-slot-menu .text-btn:focus-visible { color: var(--silver); background: hsl(220 8% 25%); border-color: transparent; }
.reference-picker-slot .reference-slot-apply.primary-btn { width: auto; min-width: 4.25rem; min-height: 2.1rem; margin-top: .25rem; padding: .32rem .7rem; }
.reference-picker-remove { position: absolute; top: -.25rem; right: -.25rem; display: grid; place-items: center; width: 1.35rem; height: 1.35rem; padding: 0; color: var(--muted); background: hsl(220 25% 8%); border: 1px solid var(--line); border-radius: 50%; cursor: pointer; font-size: 0; line-height: 1; }
.reference-picker-remove::before { content: "×"; display: block; font: 400 var(--text-body)/1 var(--font); transform: translateY(-.02rem); }
.reference-picker-remove:hover { color: white; border-color: var(--steel); }
.reference-picker-library { display: flex; min-height: 0; height: 100%; flex-direction: column; padding-top: .15rem; }
.reference-picker-library-head { display: grid; gap: .65rem; margin-top: 0; }
.reference-picker-library-head h2 { min-width: 0; padding-right: 2.6rem; }
.reference-picker-library-head input { width: 100%; min-height: 2.5rem; margin: 0; }
.reference-picker-library-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .55rem; min-height: 0; overflow-y: auto; }
.reference-picker-media {
    display: grid;
    grid-template-columns: 5.2rem minmax(0, 1fr);
    align-items: center;
    gap: .65rem;
    width: 100%;
    min-width: 0;
    padding: .45rem;
    color: var(--silver);
    text-align: left;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 11px;
    cursor: pointer;
    box-sizing: border-box;
}
.reference-picker-media:hover,
.reference-picker-media:focus-visible {
    color: white;
    border-color: var(--steel);
    background: rgba(255,255,255,.055);
    outline: none;
}
.reference-picker-media.is-selected { border-color: hsl(var(--hue-1) 72% 67% / .72); box-shadow: inset 0 0 0 1px hsl(var(--hue-1) 72% 67% / .22); }
.reference-picker-media.is-busy,
.reference-picker-media[aria-disabled="true"] { cursor: wait; opacity: .65; pointer-events: none; }
.reference-picker-media-frame {
    display: grid;
    place-items: center;
    width: 5.2rem;
    max-width: 5.2rem;
    min-width: 0;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    color: var(--muted);
    background: hsl(224 40% 4% / .72);
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: .68rem;
}
.reference-picker-media-frame img,
.reference-picker-media-frame video {
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
}
.reference-picker-media-copy {
    display: grid;
    gap: .3rem;
    min-width: 0;
    overflow: hidden;
}
.reference-picker-media-copy strong,
.reference-picker-media-copy small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.reference-picker-media-copy strong { font-size: .76rem; font-weight: 600; }
.reference-picker-media-copy small { color: var(--muted); font-size: .66rem; }
[data-modal="media-library"] .reference-picker-library-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 720px) {
    [data-modal="media-library"] .reference-picker-library-grid {
        grid-template-columns: 1fr;
    }
}
.reference-picker-empty { margin: auto; color: var(--muted); font-size: var(--text-sm); text-align: center; }
.reference-picker-pagination { display: flex; align-items: center; justify-content: center; gap: .8rem; min-height: 2.25rem; margin-top: .45rem; color: var(--muted); font-size: .76rem; }
.reference-picker-pagination .text-btn:disabled { opacity: .42; }
.reference-picker-actions { display: flex; justify-content: flex-end; padding-top: .75rem; border-top: 1px solid var(--line); }
.reference-picker-panel .reference-picker-actions .primary-btn { width: auto; min-width: 7rem; margin: 0; }
.helper-confirm-overlay { position: fixed; inset: 0; z-index: 35; display: grid; place-items: center; padding: 1rem; }
.helper-confirm-overlay[hidden] { display: none; }
.helper-confirm-backdrop { position: absolute; inset: 0; background: rgba(1,3,8,.76); backdrop-filter: blur(5px); }
.helper-confirm-panel { position: relative; width: min(430px, 100%); padding: 1.2rem; border-radius: 16px; box-shadow: var(--shadow); }
.helper-confirm-panel > .sheet-close { position: absolute; top: .7rem; right: .7rem; }
.helper-confirm-panel > h3 { margin-top: 0; padding-right: 2.4rem; }
.helper-confirm-panel p { margin-top: 0; }
.helper-publish-preview { padding: .7rem; color: var(--muted); background: var(--surface); border-radius: 10px; font-size: .82rem; }
.helper-confirm-panel .helper-publish-toggle { display: flex; align-items: center; gap: .55rem; margin: .9rem 0; color: var(--silver); cursor: pointer; }
.helper-publish-toggle input { width: 1rem; height: 1rem; margin: 0; accent-color: hsl(var(--hue-1) 70% 60%); }
.helper-confirm-actions { display: flex; justify-content: flex-end; gap: .55rem; }
.helper-confirm-panel .helper-confirm-actions .primary-btn { flex: 0 0 auto; width: auto; margin: 0; }
.helper-bake-panel { width: min(680px, 100%); }
.helper-bake-preview { max-height: min(58vh, 520px); margin: 0 0 1rem; padding: .85rem; overflow: auto; color: var(--silver); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.45; }
.helper-bake-issues { color: #ffd76a; font-size: .82rem; }
.helper-reverse-input { position: absolute; width: 1px !important; height: 1px; opacity: 0; pointer-events: none; }
@media (max-width: 720px) { .prompt-helper-panel { overflow-y: auto; } .prompt-helper-head { align-items: flex-start; flex-direction: column; } .prompt-helper-grid { grid-template-columns: 1fr; } .prompt-helper-sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 .8rem; } .helper-library { height: 145px; } .helper-editor-track { min-height: 38vh; } .reference-picker-panel, .media-library-panel { display: block; width: 100%; height: 100dvh; max-height: 100dvh; overflow-y: auto; } .reference-picker-head { align-items: flex-start; flex-direction: column; gap: .55rem; } .reference-picker-config { grid-template-columns: 1fr; margin: 1rem 0; } .reference-picker-config fieldset { margin-bottom: -.4rem; } .sheet-panel .reference-picker-config > label { margin: 0; } .reference-picker-config legend { margin-bottom: .5rem; } .reference-picker-references, .reference-picker-library { margin-top: 1rem; } .reference-picker-library { height: auto; } .reference-picker-library-head { align-items: stretch; flex-direction: column; } .reference-picker-library-head input { width: 100%; } .reference-picker-library-grid { grid-template-columns: 1fr; max-height: 42vh; } }
.format-row, .amount-row { display: flex; gap: 0.45rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.amount-row { align-items: stretch; }
.sheet-panel .custom-amount {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    min-height: 40px;
    margin: 0;
    padding: 0.4rem 0.65rem;
    color: var(--muted);
    background: var(--surface-deep, #14181c);
    border: 1px solid var(--line);
    border-radius: 999px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.sheet-panel .custom-amount:focus-within {
    color: var(--silver);
    border-color: hsl(var(--hue-1) 74% 72% / 0.7);
    box-shadow: 0 0 18px hsl(var(--hue-1) 85% 58% / 0.14);
}
.sheet-panel .custom-amount input {
    width: 4.2rem;
    min-width: 0;
    margin: 0;
    padding: 0;
    color: inherit;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    outline: 0;
}
.sheet-panel .custom-amount input::-webkit-inner-spin-button,
.sheet-panel .custom-amount input::-webkit-outer-spin-button {
    margin: 0;
    appearance: none;
}
.chip {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.4rem 0.75rem;
    color: var(--muted);
    min-height: 40px;
}
.chip.is-on { color: var(--ink); background: var(--silver); border-color: transparent; }
.chip.is-soon { opacity: 0.45; cursor: not-allowed; }
.model-picker {
    display: inline-flex;
    align-items: center;
    position: relative;
}
.model-picker::after {
    content: "";
    position: absolute;
    right: 0.9rem;
    top: 50%;
    width: 0.42rem;
    height: 0.42rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    color: hsl(222 22% 88%);
    pointer-events: none;
    transform: translateY(-70%) rotate(45deg);
}
.model-picker select {
    appearance: none;
    width: auto;
    field-sizing: content;
    max-width: min(16rem, 42vw);
    min-width: 0;
    min-height: 48px;
    color: white;
    color-scheme: dark;
    background: linear-gradient(180deg, hsl(222 18% 19%), hsl(224 20% 13%));
    border: 1px solid hsl(222 18% 42% / 0.72);
    border-radius: 999px 0 0 999px;
    padding: 0.65rem 2.25rem 0.65rem 1rem;
    outline: none;
    cursor: pointer;
    text-overflow: ellipsis;
    box-shadow: inset 0 1px hsl(0 0% 100% / 0.08);
}
.model-picker select option {
    color: #f4f7fb;
    background: #14181c;
}
.model-picker select:hover { filter: brightness(1.08); }
.model-picker select:focus-visible {
    border-color: var(--steel);
    box-shadow: 0 0 0 3px hsl(var(--hue-1) 85% 66% / 0.12);
}
textarea, input[type="email"], input[type="password"], input[type="text"], input[type="search"], input[type="number"] {
    width: 100%;
    background: #14181c;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.85rem 0.9rem;
    outline: none;
}
textarea {
    min-height: 8.5rem;
    resize: vertical;
    line-height: 1.45;
}
textarea:focus, input:focus { border-color: var(--steel); }
.prompt-translate-option {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.45rem;
    margin: 0;
    max-width: 28rem;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.35;
    cursor: pointer;
}
.prompt-translate-option input {
    width: 0.95rem;
    height: 0.95rem;
    margin: 0.12rem 0 0;
    flex: 0 0 auto;
    accent-color: var(--pink);
}
.prompt-meta {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 0.85rem;
    margin-top: 0.55rem;
}
.prompt-meta-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 0.45rem;
    min-width: 0;
    flex: 1 1 auto;
}
.prompt-submit-actions {
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    gap: 0;
    min-width: 0;
    isolation: isolate;
}
.prompt-submit-actions .model-picker {
    flex: 0 1 auto;
    align-self: stretch;
    min-width: 0;
}
.prompt-submit-actions .model-picker select,
.prompt-submit-actions .primary-btn {
    box-sizing: border-box;
    height: 48px;
    min-height: 48px;
}
.prompt-submit-actions .model-picker select {
    display: block;
}
.prompt-count {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.2;
}
.prompt-submit-actions .primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    align-self: stretch;
    margin-left: -1px;
    border-radius: 0 999px 999px 0;
    line-height: 1;
    white-space: nowrap;
}
.prompt-submit-actions .primary-btn.is-access-request {
    margin-left: 0;
    border-radius: 999px;
}
.prompt-meta .model-picker select { min-height: 48px; }
@media (max-width: 620px) {
    .prompt-meta { flex-wrap: wrap; }
    .prompt-submit-actions {
        width: 100%;
    }
    .model-picker select { max-width: 52vw; }
}
.prompt-meta span, .fine-print { color: var(--muted); font-size: var(--text-sm); }
.fine-print { margin: 0.8rem 0 0; }
.access-note {
    margin: 0;
    min-height: 8.5rem;
    display: grid;
    place-items: center;
    text-align: center;
    color: var(--muted);
    padding: 1.25rem 1rem;
    background: #14181c;
    border: 1px solid var(--line);
    border-radius: 12px;
    line-height: 1.45;
}

.library-cta {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1.25rem;
}
.library-cta-button {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 11rem;
    text-decoration: none;
}
.job-board { display: grid; gap: 0.8rem; margin-top: 1.2rem; }
.job-card {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 0.8rem;
    padding: 0.8rem;
    border-radius: 14px;
    align-items: start;
}
.job-card.is-clickable {
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.job-card.is-clickable:hover { border-color: rgba(197, 206, 216, 0.35); }
.job-card.is-clickable:active { background: var(--surface); }
.job-thumb {
    width: 88px;
    height: 88px;
    border-radius: 10px;
    background: #0c0e11;
    overflow: hidden;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 0.75rem;
    text-align: center;
    padding: 0.3rem;
    flex-shrink: 0;
}
.job-thumb img, .job-thumb video { width: 100%; height: 100%; object-fit: cover; }
.job-card > [data-job-meta] {
    height: 88px;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
}
.job-card > [data-job-meta] > p {
    margin: 0;
    align-self: stretch;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    font-size: 0.88rem;
    line-height: 1.35;
    color: var(--muted);
    word-break: break-word;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}
.bolt-loader {
    height: 1.4rem;
    display: flex;
    justify-content: center;
    align-items: center;
}
.bolt-loader > span {
    display: block;
    width: 4px;
    height: 6px;
    margin: 0 2px;
    border-radius: 10px;
    background: var(--accent);
    animation: bolt-up-down 1.2s infinite;
}
.bolt-loader > span:first-child { animation-delay: 0.15s; }
.bolt-loader > span:nth-child(2) { animation-delay: 0.3s; }
.bolt-loader > span:nth-child(3) { animation-delay: 0.45s; }
.bolt-loader > span:nth-child(4) { animation-delay: 0.6s; }
.bolt-loader > span:last-child { animation-delay: 0.75s; }
@keyframes bolt-up-down {
    0% { height: 6px; background: var(--accent); }
    50% { height: 22px; background: #d33deb; }
    100% { height: 6px; background: #f00e43; }
}
.status-pill {
    display: inline-block;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
    font-size: 0.72rem;
    color: var(--muted);
    margin-right: 0.25rem;
}
.status-pill.is-live { color: var(--steel); border-color: rgba(197, 206, 216, 0.35); }

.page-head, .sheet-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1rem;
}
.page-head h1, .sheet-panel h2 { margin: 0; }
.account-signout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 42px;
    padding: 0.6rem 1rem;
}
.account-signout-btn svg { flex: 0 0 auto; }
.sheet-panel > h2 {
    margin: 0;
    padding-right: 2.5rem;
}
.sheet-panel > .eyebrow {
    margin: 0 0 0.35rem;
}
.sheet-panel > .sheet-copy {
    margin: 0.45rem 0 0;
}
.sheet-panel > .sheet-copy + .sheet-copy {
    margin-top: 0.75rem;
}
/* Clear gap between title/subtitle block and modal body content. */
.sheet-panel > h2:not(:has(+ .sheet-copy)):not(:has(+ .eyebrow)) {
    margin-bottom: 1.15rem;
}
.sheet-panel > .sheet-copy:not(:has(+ .sheet-copy)) {
    margin-bottom: 1.15rem;
}
.sheet-panel > .sheet-head {
    margin-bottom: 1.15rem;
}
.feedback-panel > .sheet-copy {
    margin: 0.45rem 0 1.15rem;
}
.terms-sheet-panel {
    display: flex;
    flex-direction: column;
    max-height: min(48rem, calc(100dvh - 2rem));
    overflow: hidden;
}
.terms-sheet-content {
    min-height: 0;
    margin: 1rem 0;
    padding: 0.9rem 1rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    color: var(--muted);
}
.terms-sheet-content p { margin: 0 0 0.85rem; }
.terms-sheet-content section + section { margin-top: 1rem; }
.terms-sheet-content h3 { margin: 0 0 0.35rem; color: var(--silver); font-size: var(--text-body); }
.terms-sheet-content a { color: var(--accent); }
.legal-related { display: flex; flex-wrap: wrap; gap: 0.85rem 1.1rem; margin: 1.5rem 0; }
.legal-related a { color: #c084fc; text-decoration: underline dotted; text-decoration-color: color-mix(in oklab, hsl(222 39% 95%) 40%, hsl(var(--hue-2) 50% 50%)); text-underline-offset: 0.2em; }
.legal-markdown > h1 { max-width: none; }
.content-page-body.legal-markdown section {
    padding-top: 0;
    margin-top: 0;
}
.terms-sheet-panel > .primary-btn { flex: 0 0 auto; }
.tabs {
    display: flex;
    gap: 0.3rem;
    overflow-x: auto;
    margin: 0 0 1rem;
    padding-bottom: 0.2rem;
}
.tab {
    background: transparent;
    color: var(--muted);
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 0.55rem 0.9rem;
    min-height: 42px;
    white-space: nowrap;
}
.tab-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    font: inherit;
}
.tab.is-on { color: var(--silver); border-color: var(--line); background: var(--surface); }
.account-tabs {
    margin: 0 0 1rem;
}
.account-tabs .chip {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    cursor: pointer;
}
.account-tabs a.chip {
    font: inherit;
}
.section-title { font-size: var(--text-body); margin: 1.4rem 0 0.6rem; }
.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.7rem;
}
.funnel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin-bottom: 1.4rem;
}
.funnel-stage {
    min-width: 0;
    padding: 0.85rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
}
.funnel-rate { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.76rem; }
.trend-head { display: grid; gap: 1rem; align-items: end; }
.trend-range-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    align-items: end;
}
.trend-range-form label { color: var(--muted); font-size: 0.8rem; }
.trend-range-form select,
.trend-range-form input {
    width: 100%;
    min-height: 44px;
    margin-top: 0.3rem;
    padding: 0.6rem 0.7rem;
    color: var(--silver);
    color-scheme: dark;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
}
.trend-range-form .primary-btn { min-height: 44px; padding-block: 0.6rem; }
.trend-totals { margin: 1rem 0; }
.trend-chart-grid { display: grid; gap: 0.8rem; }
.trend-chart { min-width: 0; padding: 0.9rem; }
.trend-chart h3 { margin: 0 0 0.5rem; font-size: var(--text-sm); font-weight: 500; }
.trend-line-chart {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
    color: hsl(var(--hue-1) 82% 68%);
}
.trend-grid-line,
.trend-axis-line { vector-effect: non-scaling-stroke; stroke: var(--line); stroke-width: 1; }
.trend-grid-line { stroke-dasharray: 3 5; }
.trend-line-area { color: hsl(var(--hue-1) 82% 68%); }
.trend-line {
    fill: none;
    vector-effect: non-scaling-stroke;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.trend-point {
    fill: var(--bg-2);
    vector-effect: non-scaling-stroke;
    stroke: currentColor;
    stroke-width: 1.5;
}
.trend-x-label,
.trend-y-label {
    fill: var(--muted);
    font-family: var(--font);
    /* Keep axis labels readable instead of inheriting an undersized SVG default. */
    font-size: max(12px, 0.75rem);
}
.trend-x-label { text-anchor: middle; }
.stat-card { padding: 1rem; }
.wallet-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.wallet-summary .stat-value { margin-bottom: 0; }
.wallet-summary .primary-btn { margin-left: auto; }
.library-storage-summary {
    align-items: center;
    gap: 1rem 1.25rem;
    margin-bottom: 1rem;
}
.library-storage-copy {
    flex: 0 1 auto;
    min-width: 0;
}
.library-storage-summary .stat-value {
    margin: 0.15rem 0 0.2rem;
    font-size: clamp(1.05rem, 2.4vw, 1.35rem);
    font-weight: 600;
    letter-spacing: 0.01em;
}
.library-storage-summary .fine-print { margin: 0; }
.library-storage-summary .text-btn {
    flex: 0 0 auto;
    margin-left: 0;
    align-self: center;
}
.library-storage-meter {
    flex: 1 1 8rem;
    width: auto;
    max-width: none;
    min-width: 6rem;
    height: 0.9rem;
    overflow: hidden;
    background: hsl(224 28% 12%);
    border: 1px solid var(--line);
    border-radius: 999px;
}
.library-storage-meter span {
    display: block;
    width: var(--storage-used, 0%);
    min-width: var(--storage-used, 0%);
    height: 100%;
    background: linear-gradient(90deg, hsl(var(--hue-1) 62% 48%), hsl(var(--hue-1) 72% 62%));
    border-radius: inherit;
}
@media (max-width: 540px) {
    .library-storage-summary { flex-wrap: wrap; }
    .library-storage-copy { flex: 1 1 calc(100% - 6rem); }
    .library-storage-summary .text-btn { margin-left: auto; }
    .library-storage-meter { flex: 1 1 100%; order: 3; min-width: 0; }
}
.admin-job-duration { display: block; white-space: nowrap; margin-top: .2rem; }
.admin-provider-delta { display: block; margin-top: .2rem; font-size: .76rem; white-space: nowrap; }
.studio-retention-note { position: relative; z-index: 2; margin-top: .35rem; }
.studio > .prompt-card { z-index: 1; }
.material-workflow-entry { margin-top: 1.45rem; scroll-margin-top: 6rem; text-align: center; }
.material-workflow-entry > .workflow-card + .workflow-card { margin-top: 1rem; }
.workflow-card { position: relative; display: inline-flex; align-items: center; width: min(100%, 680px); min-height: 150px; overflow: hidden; padding: 1.25rem; color: white; background: #04060c; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); cursor: pointer; text-align: left; text-decoration: none; transition: border-color .35s ease, box-shadow .35s ease; }
.workflow-card::before { position: absolute; inset: 0; background: var(--workflow-card-image) center / cover; content: ''; transform: scale(1); transform-origin: center; filter: brightness(1); transition: transform .7s cubic-bezier(.22, 1, .36, 1), filter .7s ease; will-change: transform, filter; }
.workflow-card::after { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(4,6,12,.82), rgba(4,6,12,.18)); content: ''; transition: background .7s ease; }
.workflow-card--interior { --workflow-card-image: url('../img/interior-design-workflow.jpg'); }
.workflow-card--long-video { --workflow-card-image: url('../img/long-form-video-workflow.jpg'); }
.world-video-page.material-workflow-page { max-width: min(1600px, 100%); }
.world-video-page .material-workflow-header { max-width: 760px; }
.world-video-grid { display: grid; grid-template-columns: minmax(280px, 400px) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.world-video-controls {
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-height: calc(100dvh - 160px);
    overflow: hidden;
    border-radius: var(--radius);
    isolation: isolate;
}
.world-video-controls.material-workflow-card {
    padding: 0;
}
.world-video-controls-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: clamp(1.15rem, 4vw, 2rem);
}
.world-video-controls .material-workflow-step:last-child { padding-bottom: 0; }
.world-video-page .material-workflow-step-heading {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr);
    column-gap: .85rem;
    row-gap: 0;
    align-items: start;
}
.world-video-page .material-workflow-step-heading > span {
    grid-column: 1;
    grid-row: 1;
}
.world-video-page .material-workflow-step-heading > h2 {
    grid-column: 2;
    grid-row: 1;
    margin: .1rem 0 0;
    align-self: center;
}
.world-video-page .material-workflow-step-heading > p {
    grid-column: 1 / -1;
    grid-row: 2;
    margin: .85rem 0 0;
    max-width: none;
}
.world-video-controls video {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    max-height: 170px;
    margin-block: .35rem 0;
    object-fit: contain;
    border-radius: .8rem;
    border: 1px solid var(--line, rgba(255,255,255,.15));
    background: #0c0e12;
}
.world-video-controls video[hidden] { display: none; }
.world-video-quality {
    margin-top: 1rem;
}
.world-video-quality-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.world-video-quality-row output {
    color: var(--silver);
}
.world-video-controls input[type="range"] { width: 100%; margin-top: .35rem; }
.world-video-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .55rem;
    margin-top: 1.15rem;
}
.world-video-actions .primary-btn {
    min-width: 12rem;
}
.world-video-actions .primary-btn:disabled {
    opacity: .45;
    cursor: default;
}
.world-video-actions .text-btn {
    max-width: none;
}
.world-video-actions .text-btn:disabled {
    opacity: .45;
    cursor: default;
}
.world-video-controls [data-wv-add-route].is-recording {
    color: #fff7f8;
    border-color: hsl(350 80% 70% / .55);
    background: linear-gradient(180deg, #fb7185, #e11d48);
    box-shadow:
        inset 0 1px hsl(0 0% 100% / 0.2),
        0 0 24px rgba(251, 113, 133, 0.28);
    text-shadow: 0 1px 4px hsl(350 70% 10% / 0.55);
}
.world-video-controls [data-wv-arrange].is-on,
.world-video-controls [data-wv-arrange][aria-pressed="true"] {
    color: white;
    background: hsl(var(--hue-1) 60% 35% / .2);
    box-shadow: 0 0 18px hsl(var(--hue-1) 85% 60% / 0.12);
}
.world-video-clip {
    display: grid;
    gap: .45rem;
    margin: .5rem 0;
    padding: .75rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: hsl(224 30% 7% / .55);
}
.world-video-clip.is-arranging { cursor: grab; border-style: dashed; }
.world-video-clip.is-arranging > * { pointer-events: none; }
.world-video-clip.is-dragging { opacity: .45; cursor: grabbing; }
.world-video-clip-head { display: flex; align-items: center; gap: .4rem; }
.world-video-clip-play { flex: 1; text-align: left; }
.world-video-clip-head button:last-child { min-width: 2.5rem; }
.world-video-clip-head button {
    min-height: 2.35rem;
    padding: .4rem .65rem;
    border: 1px solid hsl(var(--hue-1) 60% 70% / .38);
    border-radius: 9px;
    color: var(--silver);
    background: hsl(var(--hue-1) 42% 22% / .32);
    font: inherit;
    cursor: pointer;
}
.world-video-clip-head button:hover:not(:disabled) {
    color: white;
    border-color: hsl(var(--hue-1) 75% 74% / .72);
    background: hsl(var(--hue-1) 48% 29% / .55);
}
.world-video-clip-range { position: relative; height: 1.5rem; margin: 0 .55rem 0 1.65rem; }
.world-video-clip-track { position: absolute; top: 50%; right: 0; left: 0; height: .35rem; transform: translateY(-50%); border-radius: 1rem; background: hsl(var(--hue-1) 20% 45% / .45); }
.world-video-clip-fill { position: absolute; height: 100%; border-radius: inherit; background: hsl(var(--hue-1) 75% 70%); }
.world-video-clip-range input[type="range"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; appearance: none; -webkit-appearance: none; background: transparent; pointer-events: none; }
.world-video-clip-range input[type="range"]::-webkit-slider-runnable-track { background: transparent; }
.world-video-clip-range input[type="range"]::-moz-range-track { background: transparent; }
.world-video-clip-range input[type="range"]::-webkit-slider-thumb { width: 1rem; height: 1rem; border: 2px solid #fff; border-radius: 50%; background: hsl(var(--hue-1) 75% 60%); box-shadow: 0 1px 5px #0008; appearance: none; -webkit-appearance: none; pointer-events: auto; cursor: ew-resize; }
.world-video-clip-range input[type="range"]::-moz-range-thumb { width: .85rem; height: .85rem; border: 2px solid #fff; border-radius: 50%; background: hsl(var(--hue-1) 75% 60%); box-shadow: 0 1px 5px #0008; pointer-events: auto; cursor: ew-resize; }
.world-video-clip-range input[type="range"]:focus-visible { outline: none; }
.world-video-clip-range input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 2px solid #fff; outline-offset: 2px; }
.world-video-clip-range input[type="range"]:focus-visible::-moz-range-thumb { outline: 2px solid #fff; outline-offset: 2px; }
.world-video-clip-times { padding-left: 1.65rem; color: var(--silver); font-size: .85rem; font-variant-numeric: tabular-nums; }
.world-video-inline-link {
    display: inline-block;
    margin-top: .55rem;
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: .15em;
}
.world-video-inline-link[hidden] { display: none; }
.world-video-source-slot .reference-file-chip {
    display: grid;
    padding: 0;
    overflow: hidden;
    cursor: pointer;
}
.world-video-source-slot .reference-file-chip video {
    width: 100%;
    height: 100%;
    max-height: none;
    margin: 0;
    object-fit: cover;
    border: 0;
    border-radius: inherit;
    background: #0c0e12;
    pointer-events: none;
}
.world-video-stage-shell {
    box-sizing: border-box;
    min-height: 620px;
    height: calc(100dvh - 165px);
    padding: 1px;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--edge-border);
    box-shadow: var(--shadow);
}
.world-video-stage {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: calc(var(--radius) - 1px);
    background: #14161a;
    isolation: isolate;
    clip-path: inset(0 round calc(var(--radius) - 1px));
}
.world-video-stage canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    border-radius: inherit;
}
.world-video-hint {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 2rem;
    color: var(--text-subtitle);
    text-align: center;
    pointer-events: none;
}
.world-video-hint[hidden] { display: none; }
@media (max-width: 850px) {
    .world-video-grid { display: flex; flex-direction: column-reverse; }
    .world-video-stage-shell { width: 100%; min-height: 320px; height: 48dvh; }
    .world-video-controls { max-height: none; width: 100%; }
    .world-video-controls-scroll { overflow: visible; }
}
.workflow-card > span {
    position: relative;
    z-index: 1;
    display: inline-block;
    margin-inline-start: 0;
    color: white;
    font: 700 2rem/1.1 var(--display);
    text-shadow: 0 2px 12px rgba(0,0,0,.75);
    transform: scale(1);
    transform-origin: left center;
    transition: color .2s ease;
}
[dir="rtl"] .workflow-card > span { transform-origin: right center; }
.workflow-card:is(:hover, :focus-visible, .is-holo-active) > span:not(.workflow-catalog-card-copy) {
    color: var(--accent);
}
.workflow-card:hover { border-color: var(--silver); box-shadow: 0 18px 42px rgba(0,0,0,.3); }
.workflow-card:hover::before { transform: scale(1.07); filter: brightness(1.18); }
.workflow-card:hover::after { background: linear-gradient(90deg, rgba(4,6,12,.68), rgba(4,6,12,.08)); }
.workflow-card:focus-visible { outline: 2px solid var(--silver); outline-offset: 3px; }
.workflow-card--holo {
    isolation: isolate;
    transition: border-color .35s ease, box-shadow .35s ease;
}
.workflow-card--holo > span { z-index: 3; }
.workflow-card-border {
    position: absolute;
    inset: 0;
    z-index: 4;
    padding: 2px;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(115deg, #00e7ff, #a540ff, #ff00e7, #00e7ff);
    background-size: 300% 300%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    animation: workflow-border-shift 6s ease-in-out infinite alternate;
}
@keyframes workflow-border-shift { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
.workflow-card--holo::before {
    /* Oversized so perspective tilt never reveals empty card edges. */
    inset: -18%;
    transform: perspective(900px) rotateX(var(--holo-rx, 0deg)) rotateY(var(--holo-ry, 0deg)) scale(1.08);
    transform-origin: center;
    transition: transform .45s cubic-bezier(.22, 1, .36, 1), filter .7s ease;
}
.workflow-card--holo:is(:hover, :focus-visible, .is-holo-active)::before {
    transform: perspective(900px) rotateX(var(--holo-rx, 0deg)) rotateY(var(--holo-ry, 0deg)) scale(1.16);
    filter: contrast(1.5);
}
.workflow-card--holo:hover::after { background: linear-gradient(90deg, rgba(4,6,12,.82), rgba(4,6,12,.18)); }
.workflow-card--holo::after {
    inset: -18%;
    transform: perspective(900px) rotateX(var(--holo-rx, 0deg)) rotateY(var(--holo-ry, 0deg));
    transform-origin: center;
    transition: transform .45s ease, background .7s ease;
}
.workflow-card-holo {
    position: absolute;
    inset: -18%;
    z-index: 2;
    pointer-events: none;
    border-radius: inherit;
    opacity: 0;
    mix-blend-mode: color-dodge;
    background: linear-gradient(115deg, transparent calc(var(--holo-band, 50%) - 24%), #00a9bf00 calc(var(--holo-band, 50%) - 20%), #00a9bf calc(var(--holo-band, 50%) - 1.5%), #39329b var(--holo-band, 50%), #b500a1 calc(var(--holo-band, 50%) + 1.5%), #b500a100 calc(var(--holo-band, 50%) + 20%), transparent calc(var(--holo-band, 50%) + 24%));
    transform: perspective(900px) rotateX(var(--holo-rx, 0deg)) rotateY(var(--holo-ry, 0deg));
    transform-origin: center;
    transition: opacity .35s ease, transform .45s ease;
}
.workflow-card--holo:is(:hover, :focus-visible, .is-holo-active) .workflow-card-holo { opacity: .55; }
/* While tracking the pointer, drop transform easing so tilt doesn't lag/jump.
   Keep the masked border untilted — transform breaks mask-composite. */
.workflow-card--holo.is-holo-active::before,
.workflow-card--holo.is-holo-active::after,
.workflow-card--holo.is-holo-active .workflow-card-holo {
    transition: filter .7s ease, opacity .35s ease, background .7s ease;
}
.workflow-holo-spark { position: absolute; left: var(--spark-x); top: var(--spark-y); width: var(--spark-size); height: var(--spark-size); color: hsl(var(--spark-hue) 100% 70%); background: currentColor; border-radius: 50%; box-shadow: 0 0 3px currentColor; opacity: 0; animation: workflow-spark-inward var(--spark-duration) ease-out var(--spark-delay) infinite; animation-play-state: paused; }
.workflow-holo-spark:nth-child(7n)::before, .workflow-holo-spark:nth-child(7n)::after { content: ''; position: absolute; inset: -2px 35%; background: currentColor; border-radius: 50%; }
.workflow-holo-spark:nth-child(7n)::after { transform: rotate(90deg); }
.workflow-card--holo:is(.is-holo-active, :hover, :focus-visible) .workflow-holo-spark { animation-play-state: running; }
@keyframes workflow-spark-inward {
    0% { left: var(--spark-x); top: var(--spark-y); transform: scale(.35); opacity: 0; color: hsl(var(--spark-hue) 100% 65%); }
    12% { opacity: .8; transform: scale(1); }
    45%, 100% { left: calc(var(--spark-x) + (50% - var(--spark-x)) * var(--spark-travel, .18)); top: calc(var(--spark-y) + (50% - var(--spark-y)) * var(--spark-travel, .18)); transform: scale(.2); opacity: 0; color: hsl(calc(var(--spark-hue) + 90) 100% 70%); }
}
.workflow-card--holo:is(:hover, :focus-visible) { border-color: #c7b5ee; box-shadow: -10px -8px 24px -18px #00e7ff, 10px 8px 24px -18px #ff00e7, 0 18px 42px rgba(0,0,0,.3); }
@media (prefers-reduced-motion: reduce) {
    .workflow-card-border { animation-duration: 18s; }
    .workflow-card--holo::before {
        transform: perspective(900px) rotateX(var(--holo-rx, 0deg)) rotateY(var(--holo-ry, 0deg)) scale(1.08) !important;
        transition: filter .45s ease;
    }
    .workflow-card--holo:is(:hover, :focus-visible, .is-holo-active)::before {
        transform: perspective(900px) rotateX(var(--holo-rx, 0deg)) rotateY(var(--holo-ry, 0deg)) scale(1.08) !important;
    }
    .workflow-card--holo .workflow-card-holo { opacity: 0; transition: opacity .35s ease; }
    .workflow-card--holo:is(:hover, :focus-visible, .is-holo-active) .workflow-card-holo { opacity: .4; }
    .workflow-card--holo .workflow-holo-spark { --spark-travel: .035; animation-duration: calc(var(--spark-duration) * 2.5); }
}
.material-reference-slots { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1rem 0; }
.material-reference-slot { position: relative; width: 8rem; }
.material-reference-slot .reference-dropzone, .material-reference-slot .reference-file-chip { width: 7.5rem; height: 6rem; min-height: 6rem; overflow: hidden; }
.material-reference-slot img { width: 100%; height: 100%; object-fit: cover; }
.material-workflow-measurements { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.material-workflow-result { margin-top: 1.25rem; padding: 1rem; border: 1px solid var(--line, rgba(255,255,255,.15)); border-radius: 1rem; }
.material-workflow-result-media { min-height: 220px; overflow: hidden; margin-bottom: 1rem; border-radius: .8rem; }
.material-workflow-result-media img { display: block; width: 100%; height: auto; }
@media (max-width: 680px) { .material-workflow-measurements { grid-template-columns: 1fr; } }
.workflows-page, .material-workflow-page { max-width: 980px; }
.workflows-page-header { max-width: 720px; }
.workflow-catalog { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 1.25rem; }
.workflow-catalog-card { width: 100%; min-height: 280px; align-items: flex-end; }
.workflow-card > .workflow-catalog-card-copy { position: relative; z-index: 3; display: grid; gap: .8rem; max-width: 34rem; transform-origin: left bottom; }
[dir="rtl"] .workflow-catalog-card-copy { transform-origin: right bottom; }
.workflow-catalog-card-copy strong { color: var(--accent); font: 700 clamp(1.65rem, 4vw, 2.35rem)/1.05 var(--display); }
.workflow-catalog-card-copy em { max-width: 31rem; color: rgba(255,255,255,.82); font: 400 var(--text-body)/1.5 var(--font); font-style: normal; }
.workflow-breadcrumbs { display: flex; gap: .5rem; margin: -1rem 0 1.35rem; color: var(--muted); font-size: var(--text-sm); }
.workflow-breadcrumbs a { color: var(--accent); }
.workflow-seo-section { max-width: 800px; margin: 2.6rem auto 0; }
.workflow-seo-section h2, .workflow-related h2 { margin: 0 0 .7rem; color: color-mix(in oklab, hsl(222 39% 95%) 70%, hsl(var(--hue-1) 50% 50%)); font: 700 clamp(1.4rem, 3vw, 1.9rem)/1.2 var(--display); }
.workflow-seo-section h3 { margin: 0 0 .6rem; color: color-mix(in oklab, hsl(222 39% 95%) 70%, hsl(var(--hue-1) 50% 50%)); font: 700 var(--text-lg)/1.2 var(--display); }
.workflow-seo-section p { color: color-mix(in oklab, var(--muted) 84%, white); }
.workflow-steps-list { display: grid; gap: .75rem; padding-inline-start: 1.4rem; color: color-mix(in oklab, var(--muted) 84%, white); }
.workflow-steps-list strong { color: var(--accent); }
.workflow-detail-card { padding: clamp(1rem, 3vw, 1.5rem); padding-bottom: .75rem; background: rgba(30,35,41,.74); border: 1px solid var(--line); border-radius: var(--radius); }
.workflow-detail-list { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .65rem; margin: 1rem 0 1.25rem; padding: 0; list-style: none; }
.workflow-detail-list li { padding: .85rem; padding-inline-start: 1.15rem; color: color-mix(in oklab, var(--muted) 84%, white); border-radius: 10px; }
.workflow-detail-list strong { color: var(--accent); }
.workflow-faq details { padding: .8rem 0; border-top: 1px solid var(--line); }
.workflow-faq summary { color: color-mix(in oklab, hsl(222 39% 95%) 70%, hsl(var(--hue-1) 50% 50%)); cursor: pointer; font-weight: 700; }
.workflow-faq details p { margin-bottom: 0; }
.workflow-related { max-width: 800px; margin: 2.6rem auto 0; }
.workflow-related > strong { color: var(--accent); }
.workflow-seo-section p a,
.workflow-seo-section h3 a { color: #c084fc; text-decoration: underline dotted; text-decoration-color: color-mix(in oklab, hsl(222 39% 95%) 40%, hsl(var(--hue-2) 50% 50%)); text-underline-offset: .2em; }
@media (max-width: 640px) { .workflow-detail-list { grid-template-columns: 1fr; } }
.material-workflow-header { max-width: 760px; }
.material-workflow-card { position: relative; padding: clamp(1.15rem, 4vw, 2rem); border-radius: var(--radius); }
.material-workflow-step { padding: 0 0 1.6rem; }
.material-workflow-step + .material-workflow-step { padding-top: 1.6rem; border-top: 1px solid var(--line); }
.material-workflow-step-heading { display: flex; gap: .85rem; align-items: flex-start; margin-bottom: 1.15rem; }
.material-workflow-step-heading > span { display: grid; flex: 0 0 2rem; width: 2rem; height: 2rem; place-items: center; color: #04100f; background: var(--accent); border-radius: 50%; font-weight: 800; }
.material-workflow-step-heading h2 { margin: .1rem 0 .25rem; color: var(--silver); font: 700 var(--text-lg)/1.2 var(--display); }
.material-workflow-step-heading p { margin: 0; color: var(--text-subtitle); font-size: var(--text-sm); }
.material-workflow-page .material-reference-slots { margin-inline-start: 2.85rem; }
.material-workflow-page .fine-print { margin-inline-start: 2.85rem; }
.material-workflow-step > .form-field,
.material-workflow-step > .material-workflow-measurements { margin-inline-start: 2.85rem; }
.material-workflow-submit { display: flex; justify-content: flex-end; margin-top: 1.15rem; padding-top: 0; }
.material-workflow-submit .primary-btn { min-width: 12rem; }
/* World to Video: full-width step body under the blue subtitle. */
.world-video-page.material-workflow-page .material-workflow-step > :not(.material-workflow-step-heading),
.world-video-page.material-workflow-page .material-reference-slots,
.world-video-page.material-workflow-page .fine-print,
.world-video-page.material-workflow-page .material-workflow-step > .form-field {
    margin-inline-start: 0;
}
@media (max-width: 560px) {
    .material-workflow-page .material-reference-slots,
    .material-workflow-page .fine-print,
    .material-workflow-step > .form-field,
    .material-workflow-step > .material-workflow-measurements { margin-inline-start: 0; }
    .material-workflow-submit .primary-btn,
    .world-video-actions .primary-btn { width: 100%; }
    .world-video-actions { flex-direction: column; align-items: stretch; }
    .world-video-actions .text-btn { align-self: flex-start; }
}

/* Long-form editor */
.long-video-page { width: min(1600px, 100%); min-height: calc(100dvh - var(--header)); margin: 0 auto; padding: clamp(.7rem, 2vw, 1.5rem); }
.long-video-titlebar, .lv-panel-head, .lv-transport, .lv-timeline-tools { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.long-video-titlebar { margin-bottom: 1rem; }
.long-video-titlebar h1 { margin: 0; font: 700 var(--text-title)/1.1 var(--display); }
.long-video-titlebar p { margin: .25rem 0 0; color: var(--muted); }
.long-video-titlebar .eyebrow { color: var(--accent); }
.long-video-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.long-video-workspace { display: grid; grid-template-columns: minmax(220px, 280px) minmax(360px, 1fr) minmax(180px, 230px); gap: .8rem; min-height: 460px; }
.lv-library, .lv-scenes, .lv-stage, .lv-timeline-panel { min-width: 0; padding: .85rem; border: 1px solid var(--line); background: rgba(17,20,24,.82); border-radius: 14px; }
.lv-panel-head h2 { margin: 0; font: 700 var(--text-lg)/1.2 var(--display); }
.lv-generator-links { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; margin: .8rem 0; }
.lv-generator-links a, .lv-upload { padding: .48rem; color: var(--steel); background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; font-size: var(--text-xs); text-align: center; }
.lv-upload { display: block; width: 100%; cursor: pointer; }
.lv-library-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .5rem; max-height: 460px; margin-top: .7rem; overflow: auto; overscroll-behavior: contain; }
.lv-media { min-width: 0; padding: 0; overflow: hidden; color: var(--silver); background: #090b0e; border: 1px solid var(--line); border-radius: 9px; cursor: grab; text-align: left; }
.lv-media:active { cursor: grabbing; }
.lv-media-preview { display: grid; width: 100%; aspect-ratio: 16/9; place-items: center; overflow: hidden; color: var(--muted); background: #030405; font-size: .7rem; }
.lv-media-preview :is(img,video) { width: 100%; height: 100%; object-fit: cover; }
.lv-media-preview audio { width: 90%; height: 28px; }
.lv-media span { display: block; overflow: hidden; padding: .35rem; font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.lv-preview-wrap { position: relative; display: grid; height: 100%; min-height: 340px; place-items: center; overflow: hidden; background: #000; border-radius: 9px; }
.lv-preview-wrap canvas { display: block; width: 100%; max-height: 58vh; aspect-ratio: 16/9; object-fit: contain; background: #000; }
.lv-preview-play { position: absolute; display: grid; width: 3.3rem; height: 3.3rem; place-items: center; padding: 0 0 0 .15rem; color: white; background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.5); border-radius: 50%; font-size: 1.35rem; cursor: pointer; }
.lv-preview-wrap.is-playing .lv-preview-play { opacity: 0; }
.lv-preview-wrap:hover .lv-preview-play, .lv-preview-play:focus-visible { opacity: 1; }
.lv-transport { padding-top: .7rem; color: var(--muted); font: .75rem var(--font-mono); }
.lv-transport label { display: flex; align-items: center; gap: .4rem; }
.lv-scenes [data-scene-id] { display: flex; width: 100%; justify-content: space-between; gap: .4rem; margin-top: .45rem; padding: .55rem; color: var(--steel); background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; cursor: grab; }
.lv-scenes [data-scene-id].is-active { color: var(--accent); border-color: color-mix(in srgb, var(--accent), transparent 45%); }
.lv-timeline-panel { margin-top: .8rem; }
.lv-timeline-tools { justify-content: flex-start; flex-wrap: wrap; margin-bottom: .55rem; }
.lv-timeline-scroll { --pps: 70; position: relative; min-height: 210px; overflow: auto; background: #0a0c0f; border-radius: 9px; touch-action: pan-x pan-y; }
.lv-ruler { position: sticky; z-index: 4; top: 0; left: 0; width: max(100%, calc(var(--duration, 30) * var(--pps) * 1px)); height: 28px; background: repeating-linear-gradient(90deg, rgba(255,255,255,.22) 0 1px, transparent 1px calc(var(--pps) * 1px)); border-bottom: 1px solid var(--line); }
.lv-track { position: relative; width: max(100%, calc(var(--duration, 30) * var(--pps) * 1px)); height: 62px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, rgba(255,255,255,.015), transparent); }
.lv-track::before { position: sticky; z-index: 2; left: 0; display: inline-block; width: 76px; padding: .2rem .35rem; color: var(--muted); background: rgba(10,12,15,.85); content: attr(data-label); font-size: .65rem; pointer-events: none; }
.lv-clip { position: absolute; z-index: 1; top: 22px; height: 34px; min-width: 14px; overflow: hidden; padding: .25rem .4rem; color: #eef; background: linear-gradient(120deg, #195d68, #273151); border: 1px solid rgba(255,255,255,.25); border-radius: 6px; cursor: grab; font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; touch-action: none; }
.lv-track--audio .lv-clip { background: linear-gradient(120deg, #613c66, #303665); }
.lv-clip--scene { background: linear-gradient(120deg, #664d1d, #713747); }
.lv-clip.is-selected { outline: 2px solid var(--accent); outline-offset: 1px; }
.lv-playhead { position: absolute; z-index: 5; top: 0; bottom: 0; left: 0; width: 2px; background: #ffdb5c; pointer-events: none; transform: translateX(calc(var(--time, 0) * var(--pps) * 1px)); }
.lv-playhead::before { position: absolute; top: 0; left: -5px; border: 6px solid transparent; border-top-color: #ffdb5c; content: ''; }
.lv-export-dialog { width: min(520px, calc(100% - 1.2rem)); color: var(--silver); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.lv-export-dialog::backdrop { background: rgba(0,0,0,.72); }
.lv-export-dialog form { display: grid; gap: 1rem; }
.lv-export-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.lv-export-grid label { display: grid; gap: .25rem; color: var(--muted); font-size: var(--text-sm); }
.lv-export-grid select { padding: .55rem; color: var(--silver); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.lv-export-dialog progress { width: 100%; }
@media (max-width: 900px) { .long-video-workspace { grid-template-columns: 190px 1fr; } .lv-scenes { grid-column: 1 / -1; } .lv-scenes [data-lv-scenes] { display: flex; gap: .4rem; overflow-x: auto; } .lv-scenes [data-scene-id] { flex: 0 0 150px; } }
@media (max-width: 620px) { .long-video-page { padding: .5rem; } .long-video-titlebar { align-items: flex-start; flex-direction: column; } .long-video-actions { width: 100%; } .long-video-actions > * { flex: 1; } .long-video-workspace { display: flex; flex-direction: column; } .lv-stage { order: -1; padding: .4rem; } .lv-preview-wrap { min-height: 210px; } .lv-library-list { display: flex; max-height: none; overflow-x: auto; } .lv-media { flex: 0 0 120px; } .lv-generator-links { display: flex; overflow-x: auto; } .lv-generator-links a { flex: 0 0 auto; } .lv-export-grid { grid-template-columns: 1fr; } .lv-timeline-tools .text-btn { flex: 1 1 42%; } }
.saved-card-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.75rem;
    padding: 0.9rem 1rem;
    border-radius: 14px;
}
.saved-card-summary p { margin: 0; }
.saved-card-number { margin-top: 0.18rem !important; font-size: var(--text-body); letter-spacing: 0.08em; }
.password-card {
    display: grid;
    gap: 1rem;
    max-width: 28rem;
    padding: 1.2rem;
}
.maintenance-card {
    display: grid;
    gap: 1rem;
    max-width: 28rem;
    padding: 1.2rem;
    margin-bottom: 1rem;
}
.settings-top-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}
.settings-top-row .maintenance-card {
    width: 100%;
    max-width: none;
    margin-bottom: 0;
}
.settings-email-card {
    margin-top: 1rem;
}
.settings-email-card [data-admin-test-email-form] .primary-btn {
    margin-top: 0.75rem;
}
.media-generators-card {
    display: grid;
    gap: 1rem;
    max-width: 32rem;
    padding: 1.2rem;
    margin-bottom: 1rem;
}
.media-generators-list {
    display: grid;
    gap: 0.65rem;
}
.media-generator-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 0;
    border-top: 1px solid var(--line);
}
.media-generator-row:first-child {
    border-top: 0;
    padding-top: 0;
}
.media-generator-row .fine-print {
    margin: 0.15rem 0 0;
}
.maintenance-controls {
    display: grid;
    gap: 0.75rem;
    justify-items: start;
}
.maintenance-admin-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem 1rem;
    margin: 0;
    padding: 0.7rem max(1rem, env(safe-area-inset-right)) 0.7rem max(1rem, env(safe-area-inset-left));
    color: #f2e6d8;
    background: linear-gradient(90deg, hsl(28 55% 18% / 0.95), hsl(12 45% 16% / 0.92));
    border-bottom: 1px solid hsl(28 40% 42% / 0.45);
    font-size: 0.9rem;
    line-height: 1.35;
}
.maintenance-admin-banner strong {
    font-weight: 650;
}
.maintenance-admin-banner .text-btn {
    margin-left: auto;
}
.password-form {
    display: grid;
    gap: 0.75rem;
}
.password-form label {
    display: grid;
    gap: 0.35rem;
    color: var(--muted);
    font-size: 0.85rem;
}
.password-form input {
    width: 100%;
}
.password-form .primary-btn {
    justify-self: start;
    margin-top: 0.2rem;
}
.form-success {
    margin: 0;
    color: #7dcea0;
    font-size: 0.88rem;
}
.stat-label { margin: 0; color: var(--muted); font-size: var(--text-xs); }
.stat-value {
    font-family: var(--display);
    font-size: clamp(1.6rem, 6vw, 2.4rem);
    margin: 0.2rem 0 0.6rem;
}
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
th, td { text-align: left; padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; }
.pos { color: var(--ok); }
.neg { color: #e08a7a; }
.media-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.8rem;
}
.media-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.65rem;
    margin-bottom: 1rem;
}
.media-controls .filter { margin: 0; }
.media-controls input,
.media-controls select {
    width: 100%;
    min-height: 44px;
    margin-top: 0.35rem;
    padding: 0.65rem 0.75rem;
    color: var(--silver);
    background: var(--surface-deep);
    border: 1px solid var(--line);
    border-radius: 10px;
    font: inherit;
}
.media-controls select { cursor: pointer; }
.media-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    color: var(--muted);
}
.media-pagination .text-btn:disabled { opacity: 0.35; cursor: default; }
.media-pagination .text-btn.is-disabled { opacity: 0.35; cursor: default; }
.media-card { padding: 0.7rem; }
.media-frame {
    aspect-ratio: 1;
    background: #0c0e11;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    display: grid;
    place-items: center;
    color: var(--muted);
}
.media-frame img, .media-frame video { width: 100%; height: 100%; object-fit: cover; }
.media-frame .status-pill { position: absolute; top: 0.5rem; left: 0.5rem; z-index: 1; background: rgba(16,18,20,0.8); }
.media-frame .audio-wave-thumb,
.job-thumb .audio-wave-thumb,
.reference-picker-media-frame .audio-wave-thumb {
    object-fit: cover;
    background: #0c0e11;
}
.media-card .media-frame { cursor: pointer; }
.prompt-snip { font-size: var(--text-sm); color: var(--muted); margin: 0.6rem 0; }
.media-card-prompt {
    max-height: 4.8rem;
    overflow-x: hidden;
    overflow-y: auto;
    margin: 0.6rem 0;
    padding-right: 0.25rem;
    overscroll-behavior: contain;
}
.media-card-prompt .prompt-snip {
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.4;
}
.media-card-meta { color: var(--muted); font-size: var(--text-xs); margin: -0.25rem 0 0.6rem; }
.card-actions { display: flex; justify-content: space-between; }
.empty, .empty-title { color: var(--muted); }
.empty-title { font-family: var(--display); font-size: 3rem; margin: 2rem 0 0.3rem; }
.filter { display: block; margin-bottom: 0.8rem; color: var(--muted); font-size: 0.85rem; }
.row-actions { display: flex; flex-wrap: wrap; gap: 0.3rem; }

.sheet {
    position: fixed;
    inset: 0;
    z-index: 30;
    opacity: 1;
    transition: opacity 0.2s ease-out !important;
}
.sheet.is-fading {
    opacity: 0;
    pointer-events: none;
}
.sheet.is-modal-obscured { pointer-events: none; }
.sheet.is-modal-obscured .sheet-panel { overflow: hidden; overscroll-behavior: none; }
.feedback-dock {
    position: fixed;
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
    z-index: 24;
}
.feedback-button {
    display: grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    margin-left: auto;
    color: var(--silver);
    background: hsl(220 25% 7% / 0.94);
    border: 1px solid hsl(var(--hue-1) 72% 69% / 0.5);
    border-radius: 50%;
    box-shadow: 0 0 22px hsl(var(--hue-1) 84% 60% / 0.18);
    cursor: pointer;
}
.feedback-panel {
    width: min(360px, calc(100vw - 2rem));
    max-height: min(560px, calc(100svh - 5rem));
    margin-bottom: 0.65rem;
    padding: 1rem;
    overflow: auto;
    color: var(--silver);
    border-radius: var(--radius);
    box-shadow: var(--shadow), 0 0 28px hsl(var(--hue-2) 80% 55% / 0.12);
}
.feedback-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.feedback-head h2 { margin: 0; font-family: var(--display); font-size: var(--text-lg); }
.feedback-panel form,
.auth-card form {
    display: grid;
    gap: 0.85rem;
}
.feedback-panel label { display: block; color: var(--muted); font-size: var(--text-sm); }
.feedback-panel select,
.feedback-panel textarea { margin: 0; }
.feedback-panel textarea { min-height: 7rem; resize: vertical; }
.feedback-panel .primary-btn { width: 100%; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55); }
.sheet-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 22px 22px 0 0;
    padding: 1.2rem 1.1rem calc(1.2rem + env(safe-area-inset-bottom));
    max-height: min(92vh, 720px);
    overflow: auto;
    animation: rise 0.22s ease;
}
.sheet-close { position: absolute; top: 0.6rem; right: 0.6rem; font-size: 1.4rem; }
[data-modal="notifications"] .sheet-head {
    padding-right: 2.75rem;
}
.sheet-panel label { display: block; color: var(--muted); font-size: var(--text-sm); margin: 0.7rem 0; }
.sheet-panel label input,
.sheet-panel label select { margin-top: 0.35rem; }
.sheet-panel label select {
    width: 100%;
    padding: 0.85rem 0.9rem;
    color: hsl(var(--hue-2) 26% 88%);
    background: #14181c;
    border: 1px solid var(--line);
    border-radius: 12px;
    outline: none;
}
@media (max-width: 720px) {
    .settings-top-row { grid-template-columns: 1fr; }
}
.sheet-panel label select:focus { border-color: var(--steel); }
.sheet-panel .primary-btn {
    width: 100%;
    margin-top: 0.5rem;
    white-space: normal;
    line-height: 1.25;
}
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.card-expiry-row { display: grid; grid-template-columns: 0.75fr 0.75fr 1fr; gap: 0.6rem; }
.sheet-panel .remember-card-option { display: flex; align-items: center; gap: 0.55rem; }
.sheet-panel .remember-card-option input { width: auto; margin: 0; accent-color: var(--steel); }
.form-error { margin: 0; color: #e08a7a; font-size: var(--text-sm); }
.note-list { display: grid; gap: 0.55rem; }
.note {
    padding: 0.75rem 0.8rem;
    border-radius: 12px;
}
.note:not(.is-unread) { color: var(--muted); }
.note.is-unread { border-color: rgba(197, 206, 216, 0.4); }
.note.is-clickable { cursor: pointer; }
.note.is-clickable:hover { border-color: rgba(197, 206, 216, 0.35); }

.sheet-panel-wide {
    max-height: min(94vh, 860px);
}
.sheet-panel-wide h2 {
    margin: 0;
    font-family: var(--display);
    font-weight: 500;
    font-size: 1.35rem;
}
.job-viewer-frame {
    aspect-ratio: 1;
    background: #0c0e11;
    border-radius: 14px;
    overflow: hidden;
    display: grid;
    place-items: center;
    margin-bottom: 0.8rem;
}
.job-viewer-frame img,
.job-viewer-frame video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.splat-thumb-label {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    min-height: 2.5rem;
    color: var(--silver);
    letter-spacing: 0.08em;
    font-size: 0.72rem;
    font-weight: 700;
    background:
        radial-gradient(circle at 30% 35%, hsl(var(--hue-1) 55% 55% / .28), transparent 55%),
        radial-gradient(circle at 70% 70%, hsl(200 40% 40% / .22), transparent 50%),
        hsl(224 40% 6% / .9);
}
.splat-viewer-host {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 16rem;
    background: #0c0e11;
}
.splat-viewer-canvas {
    display: block;
    width: 100%;
    height: 100%;
}
.job-viewer-frame:has(.splat-viewer-host) {
    aspect-ratio: 16 / 10;
    place-items: stretch;
}
.job-thumb .splat-thumb-label,
.media-frame .splat-thumb-label,
.reference-picker-media-frame .splat-thumb-label {
    border-radius: inherit;
}
.media-frame .splat-thumb-label {
    position: absolute;
    inset: 0;
    min-height: 0;
}
.job-viewer-frame audio {
    width: calc(100% - 1.5rem);
}
.job-viewer-frame > .empty {
    margin: 0;
    padding: 1rem;
    text-align: center;
}
.job-viewer-frame:has(pre),
.job-viewer-frame:has(audio) {
    aspect-ratio: auto;
    min-height: 8rem;
    align-items: stretch;
    padding: 0.75rem;
}
.job-viewer-frame .chat-result {
    margin: 0;
    width: 100%;
    max-height: min(60vh, 28rem);
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--ink);
}
.job-viewer-prompt {
    max-height: min(28vh, 10.5rem);
    overflow-x: hidden;
    overflow-y: auto;
    margin: 0 0 0.8rem;
    padding: 0.15rem 0.35rem 0.15rem 0;
    overscroll-behavior: contain;
}
.job-viewer-prompt [data-job-viewer-prompt] {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--muted);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.job-viewer-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
}
.job-viewer-actions [data-job-delete] {
    grid-column: 1 / -1;
    justify-self: center;
    width: auto;
    min-width: 8.5rem;
    max-width: 12rem;
    min-height: 48px;
}
.job-viewer-actions .primary-btn,
.job-viewer-actions .text-btn:not([data-job-delete]) {
    width: 100%;
    min-height: 48px;
}
.confirmation-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
    margin-top: 1rem;
}
.confirmation-actions-split {
    grid-template-columns: 1fr 1fr;
}
.confirmation-actions .primary-btn,
.confirmation-actions .text-btn {
    width: 100%;
    min-height: 48px;
}
.job-viewer-actions [data-job-delete].danger {
    color: #fb7185;
    border: 1px solid rgba(251, 113, 133, 0.45);
}
.note small { color: var(--muted); }

.toasts {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    bottom: calc(0.75rem + env(safe-area-inset-bottom));
    z-index: 40;
    display: grid;
    gap: 0.45rem;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    background: var(--silver);
    color: var(--ink);
    border-radius: 12px;
    padding: 0.8rem 0.9rem;
    box-shadow: var(--shadow);
}
.is-hidden, [hidden] { display: none !important; }

.bars {
    display: flex;
    align-items: flex-end;
    gap: 0.35rem;
    height: 160px;
    padding: 0.4rem 0 1.6rem;
    border-bottom: 1px solid var(--line);
}
.bar {
    flex: 1;
    height: var(--h);
    min-height: 4px;
    background: linear-gradient(180deg, var(--steel), var(--steel-2));
    border-radius: 6px 6px 0 0;
    position: relative;
}
.bar-n, .bar-l {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.58rem;
    color: var(--muted);
    white-space: nowrap;
}
.bar-n { top: -1.1rem; }
.bar-l { bottom: -1.3rem; }

.auth-card { max-width: 26rem; margin: 2rem auto; padding: 1.2rem; }
.auth-card form label {
    display: grid;
    gap: 0.35rem;
    color: var(--muted);
    font-size: 0.82rem;
}
.auth-card form .primary-btn { width: 100%; margin-top: 0.15rem; }
.admin-main { width: min(1100px, calc(100% - 2 * var(--pad))); }

.sheet[data-modal="maintenance"],
.sheet[data-modal="geo-denial"] { z-index: 50; }
.sheet[data-modal="geo-denial"] a { color: var(--accent); text-decoration: underline dotted; text-decoration-color: color-mix(in oklab, hsl(222 39% 95%) 40%, hsl(var(--hue-2) 50% 50%)); text-underline-offset: 0.18em; }
.sheet-panel.is-notice {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    width: min(440px, calc(100% - 2 * var(--pad)));
    transform: translate(-50%, -50%);
    border: 1px solid transparent;
    border-radius: var(--radius);
    animation: none;
    max-height: min(85vh, 720px);
}
.sheet-panel.is-notice h2 { margin: 0 0 0.6rem; font-family: var(--display); font-weight: 500; }
.diag-card {
    border-radius: var(--radius);
    padding: 1.1rem 1.15rem;
    margin-bottom: 0.8rem;
}
.diag-lead { margin: 0.35rem 0 0.7rem; font-size: 1.05rem; }
.diag-hint { color: var(--steel); margin: 0; }
.diag-grid { margin: 0 0 0.8rem; }
.diag-mono { font-size: clamp(1rem, 3vw, 1.35rem); word-break: break-all; }
.diag-list { margin: 0; display: grid; gap: 0.55rem; }
.diag-list div {
    display: grid;
    grid-template-columns: 8.5rem 1fr;
    gap: 0.6rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--line);
}
.diag-list dt { color: var(--muted); margin: 0; font-size: 0.82rem; }
.diag-list dd { margin: 0; word-break: break-all; }

@keyframes rise {
    from { transform: translateY(16px); opacity: 0.4; }
    to { transform: none; opacity: 1; }
}

@media (min-width: 720px) {
    .toasts {
        left: auto;
        right: 1.25rem;
        bottom: 1.25rem;
        width: min(20rem, calc(100vw - 2.5rem));
    }
    .toast {
        padding: 0.65rem 0.75rem;
        font-size: 0.9rem;
    }
    .media-grid { grid-template-columns: repeat(2, 1fr); }
    .media-controls { grid-template-columns: minmax(14rem, 1fr) minmax(9rem, 0.45fr) minmax(10rem, 0.5fr); }
    .stat-grid { grid-template-columns: repeat(3, 1fr); }
    .funnel-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .trend-head { grid-template-columns: minmax(12rem, 0.5fr) minmax(34rem, 1fr); }
    .trend-range-form { grid-template-columns: 1.1fr 1fr 1fr auto; }
    .trend-chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sheet-panel {
        left: 50%;
        right: auto;
        bottom: auto;
        top: 50%;
        width: min(420px, 92vw);
        transform: translate(-50%, -50%);
        border-radius: 18px;
        animation: none;
    }
    .sheet-panel-wide { width: min(560px, 94vw); }
    .job-card { grid-template-columns: 120px 1fr; }
    .job-thumb { width: 120px; height: 120px; }
    .job-card > [data-job-meta] { height: 120px; }
    .job-card > [data-job-meta] > p { -webkit-line-clamp: 5; }
}

@media (min-width: 980px) {
    .media-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Neon glass theme, adapted from the supplied context-menu reference. */
:root {
    --hue-1: 255;
    --hue-2: 222;
    --bg: #08090d;
    --bg-2: hsl(222 34% 8% / 0.82);
    --surface: hsl(224 31% 10% / 0.72);
    --surface-deep: hsl(220 27% 5% / 0.78);
    --line: hsl(var(--hue-2) 18% 30% / 0.48);
    --steel: hsl(var(--hue-2) 32% 78%);
    --steel-2: hsl(var(--hue-1) 20% 60%);
    --silver: hsl(225 30% 94%);
    --muted: hsl(222 14% 59%);
    --danger: #fb7185;
    --ok: #6ee7b7;
    --ink: hsl(224 45% 7%);
    --shadow:
        0 28px 70px hsl(var(--hue-2) 70% 2% / 0.72),
        0 12px 28px hsl(var(--hue-1) 70% 3% / 0.48);
    --radius: 22px;
    --ease: cubic-bezier(0.5, 1, 0.89, 1);
    /* Shared panel edge: lighter toward top-right and bottom-left. */
    --edge-border: linear-gradient(
        135deg,
        hsl(var(--hue-2) 28% 12% / 0.92) 0%,
        hsl(var(--hue-1) 88% 78% / 0.88) 48%,
        hsl(var(--hue-2) 28% 12% / 0.92) 100%
    );
    --edge-fill: linear-gradient(hsl(224 34% 6% / 0.94), hsl(224 34% 6% / 0.94));
}

html {
    background: var(--bg);
}

html,
body {
    overflow-x: clip;
}

body {
    min-height: 100svh;
    background: #08090d;
    color: var(--silver);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-color: #08090d;
    background-image:
        linear-gradient(rgb(3 5 10 / 0.48), rgb(3 5 10 / 0.64)),
        linear-gradient(125deg, var(--accent), #d33deb 52%, #f00e43),
        image-set(
            url("../img/abstract-light-1600.webp") type("image/webp"),
            url("../img/abstract-light.jpg") type("image/jpeg")
        );
    background-size: cover;
    background-position: center top;
    background-blend-mode: normal, color, normal;
}

body > * {
    position: relative;
    z-index: 1;
    visibility: visible;
}

::selection {
    color: white;
    background: hsl(var(--hue-1) 76% 58% / 0.72);
}

.site-header {
    min-height: 4.25rem;
    padding-block: 0.75rem;
    background:
        linear-gradient(90deg, hsl(var(--hue-2) 55% 10% / 0.42), transparent 32%, hsl(var(--hue-1) 55% 10% / 0.3)),
        hsl(224 35% 5% / 0.68);
    border-bottom-color: hsl(var(--hue-2) 30% 45% / 0.28);
    box-shadow: 0 10px 32px hsl(225 70% 2% / 0.34);
    backdrop-filter: blur(18px) saturate(1.3);
}

.site-header::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -1px;
    width: min(42vw, 34rem);
    height: 1px;
    background: linear-gradient(90deg, transparent, hsl(var(--hue-1) 90% 72% / 0.85));
    box-shadow: 0 0 16px hsl(var(--hue-1) 95% 64% / 0.72);
}

.brand {
    font-size: 1.7rem;
    text-shadow: 0 0 18px hsl(var(--hue-1) 85% 68% / 0.36);
}

.brand .wordmark {
    background: linear-gradient(90deg in oklch, var(--accent) 0%, #d33deb 50%, #f00e43 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.header-actions {
    gap: 0.3rem;
}

.wallet-chip,
.icon-btn,
.text-btn {
    transition: color 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.wallet-chip {
    color: hsl(var(--hue-2) 50% 86%);
    border-color: hsl(var(--hue-2) 38% 42% / 0.42);
    background: hsl(var(--hue-2) 45% 12% / 0.46);
    box-shadow: inset 0 1px hsl(var(--hue-2) 75% 85% / 0.08);
}

.icon-btn:hover,
.text-btn:hover,
.wallet-chip:hover {
    color: white;
    background: hsl(var(--hue-1) 48% 21% / 0.36);
    box-shadow: 0 0 18px hsl(var(--hue-1) 85% 60% / 0.16);
}

.text-btn.danger,
.job-viewer-actions [data-job-delete].danger {
    color: #fb7185;
}

.text-btn.danger:hover,
.job-viewer-actions [data-job-delete].danger:hover {
    color: #fecdd3;
    background: rgba(251, 113, 133, 0.16);
    box-shadow: 0 0 18px rgba(251, 113, 133, 0.18);
}

.primary-btn.danger {
    background: linear-gradient(180deg, #fb7185, #e11d48);
    color: #fff7f8;
}

.primary-btn.danger:hover {
    color: #fff;
    box-shadow: 0 0 18px rgba(251, 113, 133, 0.28);
}

main {
    width: min(960px, calc(100% - 2 * var(--pad)));
    padding-top: clamp(1.6rem, 4vw, 3.4rem);
}

.hero {
    padding: clamp(0.6rem, 2vw, 1.4rem) 0 0.5rem;
    display: flex;
    gap: 0.5em;
    flex-direction: column;
}

.eyebrow {
    color: var(--text-subtitle);
    text-shadow: 0 0 16px hsl(var(--hue-2) 88% 58% / 0.46);
}

.hero h1,
.hero p {
    margin: 0;
    color: color-mix(in oklab, hsl(222 39% 95%) 70%, hsl(var(--hue-1) 50% 50%));
}

.home-title {
    color: color-mix(in oklab, hsl(222 39% 95%) 70%, hsl(var(--hue-1) 50% 50%));
    font-family: var(--display);
    font-weight: 500;
    line-height: 1.12;
    letter-spacing: -0.03em;
    text-wrap: pretty;
    text-shadow: none;
}

.hero p {
    color: var(--text-subtitle);
    text-shadow: none;
}

h1 {
    max-width: 28ch;
    color: color-mix(in oklab, hsl(222 39% 95%) 70%, hsl(var(--hue-1) 50% 50%));
    font-size: clamp(1.7rem, 4.6vw, 2.6rem);
    line-height: 1.12;
    letter-spacing: -0.03em;
    text-wrap: pretty;
    text-shadow: none;
}

.lede { color: var(--text-lede); }
.sheet-copy { color: var(--text-subtitle); }

.studio {
    margin-top: clamp(0.85rem, 2.2vw, 1.4rem);
}

/* Shared gradient edge for generator, page boxes, library cards, and modals. */
.prompt-card,
.stat-card,
.auth-card,
.media-card,
.diag-card,
.surface-card,
.sheet-panel,
.provider-dialog,
.content-page-body,
.product-overview,
.workflow-detail-card,
.product-overview li,
.workflow-detail-list li,
.contact-card,
.contact-topics section,
.helper-confirm-panel,
.job-card,
.note,
.feedback-panel,
.guide-cta,
.saved-card-summary,
.referral-card {
    border: 1px solid transparent;
    background:
        linear-gradient(235deg, hsl(var(--hue-1) 52% 13% / 0.55), transparent 34%) padding-box,
        linear-gradient(45deg, hsl(var(--hue-2) 54% 13% / 0.48), transparent 34%) padding-box,
        var(--edge-fill) padding-box,
        var(--edge-border) border-box;
    background-origin: border-box;
    background-clip: padding-box, padding-box, padding-box, border-box;
    box-shadow: var(--shadow), inset 0 1px hsl(0 0% 100% / 0.045);
}
/* Clip gradient edge borders to radius — avoids square corner bleed on World to Video panels. */
.world-video-controls.surface-card {
    overflow: hidden;
    border: 0;
    border-radius: var(--radius);
    background:
        linear-gradient(235deg, hsl(var(--hue-1) 52% 13% / 0.55), transparent 34%),
        linear-gradient(45deg, hsl(var(--hue-2) 54% 13% / 0.48), transparent 34%),
        var(--edge-fill);
    box-shadow: var(--shadow);
    isolation: isolate;
}
.world-video-controls.surface-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 4;
    border-radius: inherit;
    padding: 1px;
    background: var(--edge-border);
    pointer-events: none;
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    mask-composite: exclude;
}
.settings-card-subtitle {
    margin: 0.35rem 0 0;
    color: var(--text-subtitle);
    font-size: var(--text-sm);
    line-height: 1.35;
}
.settings-card-subtitle + .settings-card-subtitle { margin-top: 0.15rem; }
.maintenance-controls .status-pill {
    margin: 0;
    padding: 0.3rem 0.7rem;
    background: hsl(222 22% 9% / 0.78);
    box-shadow: inset 0 1px hsl(0 0% 100% / 0.04);
}
.maintenance-controls .status-pill.is-off {
    color: hsl(222 18% 72%);
    border-color: hsl(222 18% 42% / 0.55);
}

.provider-dialog {
    width: min(46rem, calc(100vw - 2rem));
    max-width: none;
    max-height: min(84vh, 48rem);
    margin: auto;
    padding: clamp(1rem, 2.5vw, 1.4rem);
    color: var(--silver);
    border-radius: var(--radius);
    overflow: hidden;
}
.provider-dialog[open] {
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    gap: 0.8rem;
}
.provider-dialog::backdrop {
    background: hsl(224 40% 3% / 0.76);
    backdrop-filter: blur(4px);
}
.provider-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.provider-dialog-head h2 {
    margin: 0;
    color: var(--silver);
    font-family: var(--display);
    font-size: clamp(1.2rem, 3vw, 1.55rem);
    font-weight: 500;
}
.provider-dialog-head .icon-btn {
    flex: 0 0 auto;
    font-size: 1.45rem;
}
.provider-dialog-prompt {
    max-height: 12rem;
    padding: 0.85rem 1rem;
    overflow: auto;
    background: hsl(222 26% 10% / 0.72);
    border: 1px solid var(--line);
    border-radius: 12px;
}
.provider-dialog-prompt h3,
.provider-dialog-data-title {
    margin: 0;
    color: var(--muted);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.provider-dialog-prompt p {
    margin: 0.35rem 0 0;
    color: var(--silver);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.provider-dialog pre {
    min-width: 0;
    min-height: 8rem;
    margin: 0;
    padding: 1rem;
    overflow: auto;
    color: #d9fffb;
    background: hsl(224 35% 5% / 0.82);
    border: 1px solid var(--line);
    border-radius: 12px;
    font-family: var(--font-mono);
    font-size: clamp(0.72rem, 1.8vw, 0.84rem);
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    overscroll-behavior: contain;
}

.form-stack { display: grid; gap: 1rem; }
.form-field { display: grid; gap: .4rem; color: var(--muted); font-size: var(--text-sm); }

.stat-card,
.auth-card,
.media-card,
.diag-card {
    backdrop-filter: blur(14px) saturate(1.25);
}

.prompt-card {
    position: relative;
    isolation: isolate;
    padding: clamp(1rem, 2.4vw, 1.35rem);
    border: 1px solid transparent;
    background:
        linear-gradient(135deg, hsl(0 0% 100% / 0.075), transparent 42%) padding-box,
        linear-gradient(235deg, hsl(var(--hue-1) 55% 18% / 0.34), transparent 38%) padding-box,
        linear-gradient(45deg, hsl(var(--hue-2) 55% 18% / 0.3), transparent 38%) padding-box,
        var(--edge-fill) padding-box,
        var(--edge-border) border-box;
    background-origin: border-box;
    background-clip: padding-box, padding-box, padding-box, padding-box, border-box;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow:
        inset 0 0 1.25rem hsl(220 65% 92% / 0.13),
        inset 0 1px hsl(0 0% 100% / 0.22),
        0 0 2rem hsl(0 0% 100% / 0.09),
        hsl(var(--hue-2) 50% 2%) 0 10px 16px -8px,
        hsl(var(--hue-2) 50% 4%) 0 20px 36px -14px;
    animation: glass-in 0.8s var(--ease) both;
}

.prompt-card > :not(.visually-hidden):not(.neon-light) {
    position: relative;
    z-index: 4;
}

.prompt-card > .prompt-input-wrap.is-reference-open {
    z-index: 10;
}

.prompt-card::before,
.prompt-card::after {
    content: none;
}

.neon-light {
    pointer-events: none;
    position: absolute;
    display: block;
    min-height: 0;
}

.neon-shine,
.neon-shine::before,
.neon-shine::after {
    --hue: var(--hue-1);
    --start: 12%;
    --end: 50%;

    border-radius: 0;
    border-top-right-radius: inherit;
    border-bottom-left-radius: inherit;
    border: 1px solid transparent;
    background: conic-gradient(
        from var(--conic, -45deg) at center in oklch,
        transparent var(--start),
        hsl(var(--hue) var(--sat, 80%) var(--lit, 60%)),
        transparent var(--end)
    ) border-box;
}

.neon-shine {
    z-index: 3;
    top: -1px;
    right: -1px;
    width: auto;
    height: 100%;
    aspect-ratio: 1;
    -webkit-mask: linear-gradient(transparent), linear-gradient(black);
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-clip: padding-box, border-box;
    -webkit-mask-composite: xor;
    mask: linear-gradient(transparent), linear-gradient(black);
    mask-repeat: no-repeat;
    mask-clip: padding-box, border-box;
    mask-composite: subtract;
    animation: reference-glow 2s var(--ease) both;
}

.neon-shine::before,
.neon-shine::after {
    content: "";
    position: absolute;
    inset: -2px;
    width: auto;
    -webkit-mask: none;
    mask: none;
}

.neon-shine::after {
    --start: 17%;
    --end: 33%;
    --lit: 85%;
}

.neon-shine-bottom {
    --hue: var(--hue-2);
    --conic: 135deg;
    inset: auto auto -1px -1px;
    animation-delay: 0.1s;
    animation-duration: 1.8s;
}

.neon-glow {
    --hue: var(--hue-1);
    --start: 0%;
    --end: 50%;

    z-index: 2;
    top: calc(var(--radius) * -2);
    right: calc(var(--radius) * -2);
    width: auto;
    height: 100%;
    aspect-ratio: 1;
    border-top-right-radius: calc(var(--radius) * 2.5);
    border-bottom-left-radius: calc(var(--radius) * 2.5);
    border: calc(var(--radius) * 1.25) solid transparent;
    -webkit-mask: url("../img/noise-base.png");
    -webkit-mask-size: 29%;
    mask: url("../img/noise-base.png");
    mask-mode: luminance;
    mask-size: 29%;
    opacity: 1;
    /* Blur disabled with prompt-card glass — soft glow without live blur:
    filter: blur(12px) saturate(1.25) brightness(0.5);
    */
    filter: saturate(1.25) brightness(0.5);
    mix-blend-mode: plus-lighter;
    animation: reference-glow 1s var(--ease) 0.2s both;
}

.neon-glow::before,
.neon-glow::after {
    content: "";
    position: absolute;
    inset: 0;
    border: inherit;
    border-radius: inherit;
    background: conic-gradient(
        from var(--conic, -45deg) at center in oklch,
        transparent var(--start),
        hsl(var(--hue) var(--sat, 95%) var(--lit, 60%)),
        transparent var(--end)
    ) border-box;
    -webkit-mask: linear-gradient(transparent), linear-gradient(black);
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-clip: padding-box, border-box;
    -webkit-mask-composite: xor;
    mask: linear-gradient(transparent), linear-gradient(black);
    mask-repeat: no-repeat;
    mask-clip: padding-box, border-box;
    mask-composite: subtract;
    filter: saturate(2) brightness(1);
}

.neon-glow::after {
    --start: 15%;
    --end: 35%;
    --lit: 70%;
    --sat: 100%;
    inset: calc(var(--radius) * -0.25);
    z-index: 3;
    border-width: calc(var(--radius) * 1.75);
    border-radius: calc(var(--radius) * 2.75);
    opacity: 0.75;
}

.neon-glow-bottom {
    --hue: var(--hue-2);
    --conic: 135deg;
    inset: auto auto calc(var(--radius) * -2) calc(var(--radius) * -2);
    animation-delay: 0.3s;
}

.neon-glow-bright {
    --start: 13%;
    --end: 37%;
    --lit: 80%;
    --sat: 100%;

    top: -7px;
    right: -7px;
    border-width: 5px;
    border-radius: calc(var(--radius) + 2px);
    /* filter: blur(2px) brightness(0.66); */
    filter: brightness(0.66);
    animation-delay: 0.1s;
    animation-duration: 1.5s;
}

.neon-glow-bright::after {
    content: none;
}

.neon-glow-bright.neon-glow-bottom {
    inset: auto auto -7px -7px;
    animation-delay: 0.3s;
    animation-duration: 1.1s;
}

/* Edge neon glows off by default; enabled with html.visual-fx-on. */
.prompt-card .neon-light {
    display: none;
}

.prompt-card {
    /* Soften depth vs. neon-edge era; keep shared gradient border. */
    box-shadow:
        inset 0 0 1.25rem hsl(220 65% 92% / 0.1),
        inset 0 1px hsl(0 0% 100% / 0.18),
        0 0 0 1px hsl(var(--hue-2) 55% 48% / 0.08),
        var(--shadow);
}

/* Opt-in heavy FX: restore original glass (pre blur/glow disable). */
html.visual-fx-on .prompt-card,
.visual-fx-probe.visual-fx-on .prompt-card {
    border: 1px solid hsl(var(--hue-1) 45% 84% / 0.42);
    background:
        linear-gradient(135deg, hsl(0 0% 100% / 0.075), transparent 42%),
        linear-gradient(235deg, hsl(var(--hue-1) 55% 18% / 0.34), transparent 38%),
        linear-gradient(45deg, hsl(var(--hue-2) 55% 18% / 0.3), transparent 38%),
        hsl(224 34% 6% / 0.46);
    background-origin: padding-box;
    background-clip: border-box;
    -webkit-backdrop-filter: blur(26px) saturate(1.2);
    backdrop-filter: blur(26px) saturate(1.2);
    box-shadow:
        inset 0 0 1.25rem hsl(220 65% 92% / 0.13),
        inset 0 1px hsl(0 0% 100% / 0.22),
        0 0 2rem hsl(0 0% 100% / 0.09),
        hsl(var(--hue-2) 50% 2%) 0 10px 16px -8px,
        hsl(var(--hue-2) 50% 4%) 0 20px 36px -14px;
}

html.visual-fx-on .prompt-card .neon-light,
.visual-fx-probe.visual-fx-on .prompt-card .neon-light {
    display: block;
}

html.visual-fx-on .neon-glow,
.visual-fx-probe.visual-fx-on .neon-glow {
    filter: blur(12px) saturate(1.25) brightness(0.5);
}

html.visual-fx-on .neon-glow-bright,
.visual-fx-probe.visual-fx-on .neon-glow-bright {
    filter: blur(2px) brightness(0.66);
}

/* Safari / iOS WebKit and Responsively App cannot paint the masked neon edge. */
html.no-neon-edge .prompt-card .neon-light,
html.no-neon-edge.visual-fx-on .prompt-card .neon-light,
.visual-fx-probe.no-neon-edge .prompt-card .neon-light {
    display: none !important;
}

/* Mask compositing is unreliable on some WebKit builds — keep edges off there. */
@supports not ((-webkit-mask-composite: xor) or (mask-composite: subtract)) {
    html.visual-fx-on .prompt-card .neon-light,
    .visual-fx-probe.visual-fx-on .prompt-card .neon-light {
        display: none;
    }
}

.format-row,
.amount-row {
    gap: 0.5rem;
}

.chip {
    color: hsl(222 15% 62%);
    border-color: hsl(var(--hue-2) 22% 34% / 0.5);
    background: linear-gradient(180deg, hsl(var(--hue-2) 32% 18% / 0.28), hsl(224 38% 9% / 0.3));
    box-shadow: inset 0 1px hsl(0 0% 100% / 0.04);
    transition: all 0.25s var(--ease);
}

.chip:not(.is-soon):hover,
.chip:focus-visible {
    color: white;
    border-color: hsl(var(--hue-1) 72% 67% / 0.68);
    box-shadow: 0 0 18px hsl(var(--hue-1) 84% 58% / 0.2);
    outline: none;
}

.chip.is-on {
    color: white;
    border-color: hsl(var(--hue-1) 85% 72% / 0.52);
    background:
        linear-gradient(90deg in oklch, hsl(var(--hue-2) 54% 24% / 0.94), hsl(var(--hue-1) 58% 28% / 0.9));
    box-shadow:
        inset 0 0 0 1px hsl(0 0% 100% / 0.08),
        0 0 18px hsl(var(--hue-1) 90% 62% / 0.2);
}

textarea,
input[type="email"],
input[type="password"],
input[type="text"],
input[type="search"] {
    color: hsl(var(--hue-2) 26% 88%);
    caret-color: hsl(var(--hue-1) 100% 76%);
    background:
        linear-gradient(to bottom, hsl(var(--hue-1) 28% 18% / 0.14) 48%, hsl(var(--hue-1) 54% 36% / 0.42) 190%),
        hsl(224 38% 5% / 0.72);
    background-size: 100% 300%;
    background-position: 0 0;
    border-color: hsl(var(--hue-2) 20% 30% / 0.56);
    box-shadow: inset 0 1px 10px hsl(225 70% 2% / 0.38);
    transition: background-position 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

textarea::placeholder,
input::placeholder {
    color: hsl(222 12% 68% / 0.52);
}

textarea:focus,
input:focus {
    color: white;
    background-position: 0 50%;
    border-color: hsl(var(--hue-1) 74% 72% / 0.7);
    box-shadow:
        inset 0 1px 10px hsl(225 70% 2% / 0.28),
        0 0 0 3px hsl(var(--hue-1) 85% 66% / 0.09),
        0 0 24px hsl(var(--hue-1) 85% 58% / 0.14);
}

.primary-btn {
    color: white;
    border: 1px solid hsl(var(--hue-1) 80% 74% / 0.5);
    background: linear-gradient(115deg in oklch, hsl(var(--hue-2) 66% 42%), hsl(var(--hue-1) 62% 50%));
    box-shadow:
        inset 0 1px hsl(0 0% 100% / 0.2),
        0 0 24px hsl(var(--hue-1) 90% 56% / 0.22),
        0 10px 26px hsl(225 80% 2% / 0.48);
    text-shadow: 0 1px 4px hsl(225 70% 3% / 0.8);
    transition: transform 0.2s var(--ease), filter 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.primary-btn:not(:disabled):hover {
    transform: translateY(-1px);
    filter: brightness(1.12) saturate(1.12);
    box-shadow:
        inset 0 1px hsl(0 0% 100% / 0.24),
        0 0 32px hsl(var(--hue-1) 95% 62% / 0.34),
        0 14px 30px hsl(225 80% 2% / 0.52);
}

.prompt-submit-actions [data-generate-btn]:not(:disabled):hover {
    transform: none;
}

.primary-btn:not(:disabled):active {
    transform: translateY(0);
}

.fine-print {
    color: hsl(222 12% 66% / 0.82);
}

.job-card,
.note {
    background:
        linear-gradient(120deg, hsl(var(--hue-2) 48% 14% / 0.4), transparent 38%) padding-box,
        var(--edge-fill) padding-box,
        var(--edge-border) border-box;
    background-origin: border-box;
    background-clip: padding-box, padding-box, border-box;
    border: 1px solid transparent;
    backdrop-filter: blur(12px);
}

.table-wrap,
.tab.is-on {
    background:
        linear-gradient(120deg, hsl(var(--hue-2) 48% 14% / 0.4), transparent 38%),
        hsl(224 33% 7% / 0.68);
    border-color: hsl(var(--hue-2) 20% 32% / 0.48);
    backdrop-filter: blur(12px);
}

.job-card.is-clickable:hover,
.note.is-clickable:hover {
    box-shadow: 0 0 0 1px hsl(var(--hue-1) 72% 69% / 0.45), 0 0 20px hsl(var(--hue-1) 84% 60% / 0.12);
}

.sheet-backdrop {
    background:
        radial-gradient(circle at 70% 20%, hsl(var(--hue-1) 65% 22% / 0.22), transparent 42%),
        hsl(225 55% 2% / 0.78);
    backdrop-filter: blur(5px);
}

.sheet-panel {
    color: var(--silver);
    background:
        linear-gradient(235deg, hsl(var(--hue-1) 52% 13% / 0.84), transparent 34%) padding-box,
        linear-gradient(45deg, hsl(var(--hue-2) 54% 13% / 0.82), transparent 34%) padding-box,
        linear-gradient(hsl(220 25% 4.8% / 0.92), hsl(220 25% 4.8% / 0.92)) padding-box,
        var(--edge-border) border-box;
    background-origin: border-box;
    background-clip: padding-box, padding-box, padding-box, border-box;
    border: 1px solid transparent;
    box-shadow:
        0 0 1px hsl(var(--hue-1) 100% 85%),
        0 0 24px hsl(var(--hue-1) 90% 58% / 0.28),
        var(--shadow);
    backdrop-filter: blur(18px) saturate(1.35);
}

[data-modal="prompt-helper"] .prompt-helper-panel {
    width: min(1200px, calc(100vw - 3rem));
    max-width: none;
    max-height: calc(100dvh - 3rem);
}

[data-modal="reference-picker"] .reference-picker-panel {
    width: min(1040px, calc(100vw - 3rem));
    max-width: none;
    max-height: calc(100dvh - 3rem);
    overflow: hidden;
}

.toast {
    color: var(--silver);
    background:
        linear-gradient(100deg, hsl(var(--hue-2) 50% 18% / 0.96), hsl(var(--hue-1) 48% 16% / 0.96));
    border: 1px solid hsl(var(--hue-1) 78% 72% / 0.42);
    box-shadow: 0 0 26px hsl(var(--hue-1) 88% 60% / 0.2), var(--shadow);
}

.access-note,
.job-thumb,
.media-frame,
.job-viewer-frame {
    background: hsl(224 40% 4% / 0.72);
    border-color: hsl(var(--hue-2) 20% 28% / 0.5);
}

@keyframes glass-in {
    0% { opacity: 0; filter: blur(5px); transform: translateY(10px); }
    38% { opacity: 1; filter: blur(0); }
    100% { opacity: 1; transform: none; }
}

@keyframes reference-glow {
    0% { opacity: 0; }
    3% { opacity: 1; }
    10% { opacity: 0; }
    12% { opacity: 0.7; }
    16% { opacity: 0.3; animation-timing-function: var(--ease); }
    100% { opacity: 1; animation-timing-function: var(--ease); }
}

@media (prefers-reduced-motion: reduce) {
    .prompt-card,
    .neon-light {
        animation: none;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }

    .prompt-helper-fan .prompt-fan-button {
        transition-duration: .2s, .34s, .15s, .15s !important;
    }

    /* Keep this deliberate hover feedback usable even when the global motion
       preference shortens decorative transitions. */
    .workflow-card {
        transition-duration: .2s !important;
    }
    .workflow-card--holo {
        transition-duration: .35s !important;
    }
    .workflow-card::before,
    .workflow-card::after {
        transition-duration: .45s !important;
    }
    .workflow-card--holo.is-holo-active::before,
    .workflow-card--holo.is-holo-active::after,
    .workflow-card--holo.is-holo-active .workflow-card-holo {
        transition-duration: .7s, .35s, .7s !important;
    }
    .workflow-card--holo .workflow-card-holo {
        transition-duration: .35s, .45s !important;
    }
}

@property --scrollbar-opacity {
    syntax: "<number>";
    inherits: true;
    initial-value: 0;
}

.format-row,
.tabs,
.table-wrap {
    --scrollbar-opacity: 0;
    scrollbar-width: thin;
    scrollbar-color: hsl(var(--hue-1) 78% 66% / var(--scrollbar-opacity)) transparent;
    transition: --scrollbar-opacity 0.18s ease-out !important;
}

.format-row::-webkit-scrollbar,
.tabs::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.format-row::-webkit-scrollbar-track,
.tabs::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track {
    background: transparent;
}

.format-row::-webkit-scrollbar-button,
.tabs::-webkit-scrollbar-button,
.table-wrap::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

.format-row::-webkit-scrollbar-thumb,
.tabs::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background-color: hsl(var(--hue-1) 78% 66% / var(--scrollbar-opacity));
}

.format-row.is-scroll-active,
.tabs.is-scroll-active,
.table-wrap.is-scroll-active {
    --scrollbar-opacity: 0.72;
}

/* Keep scroll compositing inexpensive on phones, touch tablets, and narrow windows. */
@media (max-width: 900px), (hover: none) and (pointer: coarse) {
    /*
     * Mobile scroll performance: a fixed, viewport-sized blended image and a
     * blurred sticky header force costly repaint/compositing work on every
     * scroll frame. Keep the artwork near the top of the page, but make it a
     * finite document layer and use an opaque header on mobile devices.
     */
    body {
        position: relative;
        background: #08090d;
    }

    body::before {
        position: absolute;
        top: 0;
        right: 0;
        bottom: auto;
        left: 0;
        height: min(100svh, 56rem);
        background-size: cover;
        background-position: center top;
        background-repeat: no-repeat;
    }

    .site-header {
        background:
            linear-gradient(90deg, hsl(var(--hue-2) 55% 10% / 0.28), transparent 32%, hsl(var(--hue-1) 55% 10% / 0.2)),
            #0b0d12;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        box-shadow: 0 5px 16px hsl(225 70% 2% / 0.24);
    }
}

@media (max-width: 719px) {
    .header-actions {
        gap: 0.25rem;
    }

    .header-actions .text-btn {
        max-width: 7.5rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .lang-switch {
        max-width: min(9.5rem, 34vw);
        flex: 0 1 auto;
    }

    .sheet-panel {
        left: 50%;
        right: auto;
        top: 50%;
        bottom: auto;
        width: min(420px, calc(100% - 1.5rem));
        max-height: calc(
            100svh - 1.5rem - env(safe-area-inset-top) - env(safe-area-inset-bottom)
        );
        padding: 1.15rem 1rem calc(1.15rem + env(safe-area-inset-bottom));
        transform: translate(-50%, -50%);
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
        border: 1px solid hsl(var(--hue-2) 45% 52% / 0.48);
        border-radius: 18px;
        animation: none;
    }

    .sheet-panel-wide {
        width: min(560px, calc(100% - 1.5rem));
    }

    .sheet-panel.is-notice {
        top: 50%;
        bottom: auto;
        transform: translate(-50%, -50%);
        border-radius: 18px;
    }

    [data-modal="prompt-helper"] .prompt-helper-panel {
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        padding-top: calc(1rem + env(safe-area-inset-top));
        border: 0;
        border-radius: 0;
        scrollbar-gutter: auto;
    }

    [data-modal="reference-picker"] .reference-picker-panel,
    [data-modal="media-library"] .media-library-panel {
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        padding-top: calc(1rem + env(safe-area-inset-top));
        overflow-x: hidden;
        overflow-y: auto;
        border: 0;
        border-radius: 0;
        scrollbar-gutter: auto;
    }
}

/* Phone headers need two rows before their labels are forced into ellipses. */
@media (max-width: 540px) {
    .site-header {
        flex-wrap: wrap;
        align-items: center;
        row-gap: 0.25rem;
    }

    .header-actions {
        flex: 0 0 auto;
        width: auto;
        margin-inline-start: auto;
        flex-wrap: nowrap;
        row-gap: 0.1rem;
    }

    .header-actions .text-btn {
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .header-overflow-menu {
        position: relative;
        display: block;
        flex: 0 0 auto;
        margin-inline-start: auto;
    }

    .header-desktop-links {
        display: none;
    }

    .header-menu-trigger {
        display: grid;
        place-items: center;
        width: 42px;
        height: 42px;
        padding: 0;
        border-radius: 50%;
        color: var(--silver);
        cursor: pointer;
        list-style: none;
    }

    .header-menu-trigger::-webkit-details-marker {
        display: none;
    }

    .header-menu-trigger span,
    .header-menu-trigger span::before,
    .header-menu-trigger span::after {
        display: block;
        width: 1.2rem;
        height: 2px;
        border-radius: 999px;
        background: currentColor;
    }

    .header-menu-trigger span {
        position: relative;
    }

    .header-menu-trigger span::before,
    .header-menu-trigger span::after {
        content: "";
        position: absolute;
        left: 0;
    }

    .header-menu-trigger span::before { top: -0.38rem; }
    .header-menu-trigger span::after { top: 0.38rem; }

    .header-menu-trigger:hover,
    .header-menu-trigger:focus-visible,
    .header-overflow-menu[open] .header-menu-trigger {
        color: white;
        background: rgba(210, 222, 232, 0.08);
    }

    .header-menu-trigger:focus-visible {
        outline: 2px solid rgba(210, 222, 232, 0.35);
        outline-offset: 2px;
    }

    .header-menu-items {
        position: absolute;
        top: calc(100% + 0.4rem);
        right: 0;
        z-index: 12;
        display: grid;
        min-width: 10rem;
        padding: 0.35rem;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: #101217;
        box-shadow: 0 16px 36px rgba(0, 0, 0, 0.42);
    }

    .header-overflow-menu:not([open]) .header-menu-items {
        display: none;
    }

    .header-menu-items .text-btn {
        display: block;
        width: 100%;
        padding: 0.65rem 0.75rem;
        border-radius: 8px;
        text-align: start;
    }

    .header-menu-items form {
        margin: 0;
    }
}

@media (max-width: 540px) {
    .lang-switch {
        max-width: min(12rem, 48vw);
    }

    .lang-switch-menu {
        left: auto;
        right: 0;
        width: min(8rem, calc(100vw - 1rem));
    }

    [dir="rtl"] .lang-switch-menu {
        left: 0;
        right: auto;
    }

    .lang-switch-trigger {
        font-size: 0.72rem;
        padding-top: 0.18rem;
        padding-bottom: 0.18rem;
    }

    .lang-code-bubble {
        font-size: 0.54rem;
        min-width: 1.5rem;
        padding: 0.12rem 0.28rem;
    }

    .site-header {
        min-height: 3.8rem;
    }

    main {
        padding-top: 1rem;
    }

    .hero {
        padding-top: 1.15rem;
    }

    .format-row {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: max-content;
        justify-content: start;
        width: 100%;
        max-width: 100%;
        flex-wrap: nowrap;
        margin: 0 0 0.55rem;
        padding: 0.2rem 0.15rem 0.55rem;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-inline: contain;
        scroll-snap-type: inline proximity;
        touch-action: pan-x;
        -webkit-overflow-scrolling: touch;
    }

    .format-row .chip {
        flex: 0 0 auto;
        scroll-snap-align: start;
    }

}

/* Rewards: cyberpunk badge materials and non-blocking referral controls. */
.rewards-panel { display: grid; gap: 1rem; }
.reward-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.reward-streak-card { position: relative; overflow: hidden; display: flex; align-items: center; gap: 0.8rem; }
.reward-streak-card .stat-value { margin-bottom: 0; }
.reward-streak-card .fine-print { margin-top: 0; }
.reward-signal {
    width: 0.75rem;
    height: 3.8rem;
    flex: 0 0 auto;
    border-radius: 999px;
    background: linear-gradient(var(--accent), #d33deb 55%, #f00e43);
    box-shadow: 0 0 18px hsl(var(--hue-1) 90% 65% / 0.62);
}
.referral-card { display: grid; gap: 1rem; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, transparent), hsl(292 77% 58% / 0.09)) padding-box, var(--edge-fill) padding-box, var(--edge-border) border-box; background-origin: border-box; background-clip: padding-box, padding-box, border-box; }
.referral-card h2 { margin: 0; font-family: var(--display); font-size: 1.5rem; }
.referral-card .eyebrow { margin-bottom: 0.25rem; }
.referral-card .fine-print { margin-top: 0.25rem; }
.referral-link-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 0.55rem; align-items: center; }
.referral-link-row input[type="url"] {
    width: 100%;
    min-width: 0;
    padding: 0.8rem 0.9rem;
    color: var(--silver);
    background: var(--surface-deep);
    border: 1px solid var(--line);
    border-radius: 12px;
}
.referral-link-row .primary-btn { min-height: 44px; padding-block: 0.65rem; }
.referral-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.referral-stats div { padding: 0.6rem 0.7rem; border: 1px solid var(--line); border-radius: 12px; background: hsl(220 27% 5% / 0.45); }
.referral-stats strong, .referral-stats span { display: block; }
.referral-stats strong { font-family: var(--display); font-size: 1.3rem; }
.referral-stats span { color: var(--muted); font-size: 0.75rem; }
.rewards-intro { margin-top: -0.55rem; }
.reward-group { min-width: 0; }
.reward-group-head { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; margin-bottom: 0.55rem; }
.reward-group-head h3 { margin: 0; font-size: 0.95rem; }
.reward-group-head span { color: var(--muted); font-size: 0.8rem; }
.badge-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; }
.achievement-card {
    scroll-margin-top: 6rem;
    --badge-accent: #9ca3af;
    --badge-pointer-x: 50%;
    --badge-pointer-y: 50%;
    position: relative;
    min-width: 0;
    display: grid;
    grid-template-columns: 3.2rem minmax(0, 1fr);
    gap: 0.7rem;
    align-items: center;
    padding: 0.75rem;
    overflow: hidden;
    color: var(--silver);
    background: linear-gradient(145deg, color-mix(in srgb, var(--badge-accent) 12%, transparent), transparent 55%), var(--surface-deep);
    border: 1px solid color-mix(in srgb, var(--badge-accent) 46%, var(--line));
    border-radius: 15px;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}
.achievement-card.is-locked .achievement-emblem,
.achievement-card.is-locked .achievement-copy {
    filter: saturate(0.25);
    opacity: 0.62;
}
.achievement-card.is-earned {
    box-shadow: inset 0 0 24px color-mix(in srgb, var(--badge-accent) 8%, transparent), 0 8px 22px rgb(0 0 0 / 0.16);
    touch-action: pan-y;
    cursor: pointer;
}
.achievement-card.is-earned:focus-visible { outline: 2px solid var(--badge-accent); outline-offset: 3px; }
.achievement-hologram,
.achievement-shine,
.achievement-scanline {
    position: absolute;
    pointer-events: none;
}
.achievement-hologram {
    z-index: 0;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(45deg, #ff00cc, #3333ff, #00ffcc, #ffcc00);
    background-size: 400% 400%;
    opacity: 0.2;
    mix-blend-mode: screen;
    animation: achievement-hologram-shift 8s ease infinite;
}
.achievement-shine {
    z-index: 3;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at var(--badge-pointer-x) var(--badge-pointer-y), rgb(255 255 255 / 0.46) 0%, transparent 58%);
    opacity: 0;
    mix-blend-mode: overlay;
    transition: opacity 180ms ease;
}
.achievement-card.is-earned:hover .achievement-shine,
.achievement-card.is-earned.is-interacting .achievement-shine { opacity: 1; }
.achievement-scanline {
    z-index: 3;
    left: 0;
    top: -2px;
    width: 100%;
    height: 2px;
    background: linear-gradient(to bottom, transparent, rgb(0 255 255 / 0.68), transparent);
    box-shadow: 0 0 8px rgb(0 255 255 / 0.35);
    animation: achievement-scan 3s linear infinite;
}
.achievement-emblem,
.achievement-copy,
.achievement-progress { z-index: 2; }
.achievement-emblem {
    position: relative;
    width: 3.2rem;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    padding: 0.35rem;
    color: var(--badge-accent);
    background: linear-gradient(145deg, color-mix(in srgb, var(--badge-accent) 34%, #08090d), #08090d 68%);
    border: 1px solid color-mix(in srgb, var(--badge-accent) 62%, transparent);
    border-radius: 12px 5px 12px 5px;
    box-shadow: 0 0 16px color-mix(in srgb, var(--badge-accent) 22%, transparent);
    overflow: hidden;
}
.achievement-emblem::after {
    content: attr(data-tier-mark);
    position: absolute;
    z-index: 0;
    inset: 0;
    display: grid;
    align-items: center;
    justify-items: center;
    color: var(--badge-accent);
    font: 900 3.35rem/0.9 var(--font);
    letter-spacing: 0.04em;
    opacity: 0.09;
    transform: translateX(-0.38rem) scaleX(0.72);
    transform-origin: center;
    pointer-events: none;
}
.achievement-emblem img { position: relative; z-index: 1; width: 100%; height: 100%; filter: invert(1); opacity: 0.9; }
.achievement-card.is-earned .achievement-emblem img { visibility: hidden; }
.achievement-card.is-earned .achievement-emblem::before {
    content: "";
    position: absolute;
    inset: 0.35rem;
    z-index: 1;
    background: linear-gradient(135deg, var(--accent) 0%, #d33deb 55%, #f00e43 100%);
    -webkit-mask: var(--badge-icon) center / contain no-repeat;
    mask: var(--badge-icon) center / contain no-repeat;
    filter: drop-shadow(0 0 5px rgb(211 61 235 / 0.5));
}
.achievement-name { margin: 0; font-weight: 650; line-height: 1.2; }
.achievement-meta, .achievement-reward { margin: 0.18rem 0 0; color: var(--muted); font-size: 0.72rem; }
.achievement-reward { color: var(--badge-accent); }
.achievement-progress { grid-column: 1 / -1; height: 3px; overflow: hidden; background: var(--line); border-radius: 999px; }
.achievement-progress span {
    display: block;
    width: var(--progress);
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, #d33deb 50%, #f00e43 100%);
    background: linear-gradient(90deg in oklch, var(--accent) 0%, #d33deb 50%, #f00e43 100%);
    box-shadow: 0 0 8px hsl(292 77% 58% / 0.55);
}
.badge-tier-carbon { --badge-accent: #8c96a3; }
.badge-tier-chrome { --badge-accent: #e8eef3; }
.badge-tier-neon { --badge-accent: var(--accent); }
.badge-tier-holographic { --badge-accent: #d33deb; }
.badge-tier-holographic.is-earned .achievement-hologram { opacity: 0.34; }
.achievement-new {
    position: absolute;
    z-index: 2;
    top: 0.35rem;
    right: 0.4rem;
    padding: 0.08rem 0.36rem;
    color: var(--ink);
    background: var(--accent);
    border-radius: 999px;
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.achievement-card.is-new { outline: 1px solid color-mix(in srgb, var(--badge-accent) 75%, transparent); outline-offset: 2px; }
.reward-history { min-width: 0; }

/* Earned badge showcase, adapted from the holographic cyber ID treatment. */
.badge-detail-sheet { z-index: 42; }
.badge-detail-panel {
    position: absolute;
    inset: 0;
    display: grid;
    align-items: center;
    justify-items: center;
    padding: max(2.8rem, env(safe-area-inset-top)) 1.25rem max(1.25rem, env(safe-area-inset-bottom));
    pointer-events: none;
}
.badge-detail-close {
    position: absolute;
    z-index: 6;
    top: max(1rem, env(safe-area-inset-top));
    right: max(1rem, env(safe-area-inset-right));
    pointer-events: auto;
}
.badge-showcase-wrap {
    width: min(340px, calc(100vw - 2.5rem), calc((100svh - 5rem) * 340 / 480));
    perspective: 1200px;
    pointer-events: auto;
}
.badge-showcase-card {
    --showcase-accent: #d33deb;
    --showcase-pointer-x: 50%;
    --showcase-pointer-y: 50%;
    position: relative;
    width: 100%;
    aspect-ratio: 340 / 480;
    overflow: hidden;
    color: #fff;
    background: #080a10;
    border: 1px solid color-mix(in srgb, var(--showcase-accent) 55%, rgb(255 255 255 / 0.18));
    border-radius: 30px 8px 30px 8px;
    box-shadow: 0 28px 80px rgb(0 0 0 / 0.64), 0 0 42px color-mix(in srgb, var(--showcase-accent) 28%, transparent);
    transform: rotateX(0deg) rotateY(0deg);
    transform-style: preserve-3d;
    transition: transform 180ms ease-out;
    touch-action: none;
}
.badge-showcase-card.is-interacting { transition: transform 35ms linear; }
.badge-showcase-card::before {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgb(255 255 255 / 0.13), rgb(255 255 255 / 0.025));
    backdrop-filter: blur(12px);
    pointer-events: none;
}
.badge-showcase-hologram,
.badge-showcase-shine,
.badge-showcase-scanline { position: absolute; pointer-events: none; }
.badge-showcase-hologram {
    z-index: 0;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(45deg, #ff00cc, #3333ff, #00ffcc, #ffcc00);
    background-size: 400% 400%;
    opacity: 0.38;
    mix-blend-mode: screen;
    animation: achievement-hologram-shift 8s ease infinite;
}
.badge-showcase-shine {
    z-index: 2;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at var(--showcase-pointer-x) var(--showcase-pointer-y), rgb(255 255 255 / 0.62) 0%, transparent 58%);
    opacity: 0;
    mix-blend-mode: overlay;
    transition: opacity 160ms ease;
}
.badge-showcase-card.is-interacting .badge-showcase-shine,
.badge-showcase-card:hover .badge-showcase-shine { opacity: 1; }
.badge-showcase-scanline {
    z-index: 3;
    left: 0;
    top: -2px;
    width: 100%;
    height: 2px;
    background: linear-gradient(to bottom, transparent, rgb(0 255 255 / 0.82), transparent);
    box-shadow: 0 0 12px rgb(0 255 255 / 0.48);
    animation: achievement-scan 3s linear infinite;
}
.badge-showcase-content {
    position: relative;
    z-index: 4;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    text-shadow: 0 0 12px rgb(0 255 255 / 0.32);
    transform: translateZ(22px);
}
.badge-showcase-kicker { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.badge-showcase-kicker span {
    padding: 0.28rem 0.65rem;
    border: 1px solid rgb(0 255 255 / 0.28);
    border-radius: 999px;
    background: rgb(0 255 255 / 0.1);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}
.badge-showcase-kicker .badge-showcase-brand {
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    padding: 0.28rem;
    border-color: rgb(255 255 255 / 0.14);
    border-radius: 50%;
    background: linear-gradient(145deg, color-mix(in srgb, var(--showcase-accent) 34%, #08090d), #08090d 68%);
    box-shadow: none;
}
.badge-showcase-brand img { width: 100%; height: 100%; object-fit: contain; }
.badge-showcase-identity { margin: auto 0; }
.badge-showcase-emblem {
    position: relative;
    width: 5.4rem;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    padding: 0.65rem;
    margin-bottom: 1rem;
    border: 1px solid color-mix(in srgb, var(--showcase-accent) 68%, transparent);
    border-radius: 18px 7px 18px 7px;
    background: linear-gradient(145deg, color-mix(in srgb, var(--showcase-accent) 34%, #08090d), #08090d 68%);
    box-shadow: 0 0 30px color-mix(in srgb, var(--showcase-accent) 34%, transparent);
    overflow: hidden;
}
.badge-showcase-emblem::before {
    content: "";
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--accent) 0%, #d33deb 55%, #f00e43 100%);
    -webkit-mask: var(--showcase-icon) center / contain no-repeat;
    mask: var(--showcase-icon) center / contain no-repeat;
    filter: drop-shadow(0 0 9px rgb(211 61 235 / 0.56));
}
.badge-showcase-emblem::after {
    content: attr(data-tier-mark);
    position: absolute;
    z-index: 0;
    inset: 0;
    display: grid;
    align-items: center;
    justify-items: start;
    color: var(--showcase-accent);
    font: 900 6rem/0.9 var(--font);
    letter-spacing: 0.04em;
    opacity: 0.09;
    transform: translateX(-0.63rem) scaleX(0.7);
    transform-origin: center;
    pointer-events: none;
}
.badge-showcase-identity > p { margin: 0; color: rgb(180 244 244 / 0.86); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; }
.badge-showcase-identity h2 { margin: 0.32rem 0; font-family: var(--font); font-size: clamp(2rem, 9vw, 2.8rem); font-weight: 800; line-height: 0.98; text-transform: uppercase; }
.badge-showcase-tier { color: color-mix(in srgb, var(--showcase-accent) 70%, white) !important; }
.badge-showcase-stats { border-top: 1px solid rgb(255 255 255 / 0.14); }
.badge-showcase-stats p { display: flex; justify-content: space-between; gap: 1rem; margin: 0; padding: 0.5rem 0; border-bottom: 1px solid rgb(255 255 255 / 0.1); font-size: 0.72rem; }
.badge-showcase-stats span { color: rgb(130 244 235 / 0.82); text-transform: uppercase; letter-spacing: 0.08em; }
.badge-showcase-stats strong { text-align: right; font-weight: 550; }
.badge-showcase-access { margin: 1rem 0 0; text-align: center; color: #76ff94; font-size: 0.7rem; letter-spacing: 0.28em; text-transform: uppercase; text-shadow: 0 0 13px rgb(45 255 91 / 0.75); }
.badge-showcase-tier-carbon { --showcase-accent: #8c96a3; }
.badge-showcase-tier-chrome { --showcase-accent: #e8eef3; }
.badge-showcase-tier-neon { --showcase-accent: var(--accent); }
.badge-showcase-tier-holographic { --showcase-accent: #d33deb; }

@media (max-width: 480px) {
    .badge-showcase-content { padding: 1.15rem; }
    .badge-showcase-emblem { width: 4.5rem; padding: 0.55rem; margin-bottom: 0.75rem; }
    .badge-showcase-identity h2 { font-size: clamp(1.65rem, 9vw, 2.25rem); }
    .badge-showcase-stats p { padding: 0.38rem 0; font-size: 0.66rem; }
    .badge-showcase-access { margin-top: 0.7rem; font-size: 0.62rem; }
}

@keyframes achievement-hologram-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
@keyframes achievement-scan {
    from { top: -2px; }
    to { top: calc(100% + 2px); }
}
.reward-preference {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--line);
    cursor: pointer;
}
.reward-preference span, .reward-preference small { display: block; }
.reward-preference small { margin-top: 0.2rem; color: var(--muted); }
.reward-preference input { width: 1.2rem; height: 1.2rem; accent-color: var(--accent); }

@media (min-width: 720px) {
    .badge-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
    .reward-summary-grid, .badge-grid { grid-template-columns: 1fr; }
    .referral-link-row { grid-template-columns: minmax(0, 1fr) auto; }
    .referral-link-row .text-btn { grid-column: 1 / -1; justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
    .achievement-hologram { animation-duration: 16s; }
    .achievement-scanline { animation-duration: 6s; }
}

[dir="rtl"] body {
    text-align: right;
}

[dir="rtl"] .site-header,
[dir="rtl"] .header-actions,
[dir="rtl"] .format-row,
[dir="rtl"] .modal-actions,
[dir="rtl"] .referral-link-row,
[dir="rtl"] .pager,
[dir="rtl"] .admin-toolbar {
    direction: rtl;
}

[dir="rtl"] .brand,
[dir="rtl"] .hero h1,
[dir="rtl"] .modal-head,
[dir="rtl"] .account-tabs {
    direction: rtl;
}

[dir="rtl"] input,
[dir="rtl"] textarea,
[dir="rtl"] select {
    text-align: right;
}

[dir="rtl"] .skip {
    left: auto;
    right: 1rem;
}

/* Shared footer and editorial pages. */
.site-footer {
    width: min(960px, calc(100% - 2 * var(--pad)));
    margin: 0 auto;
    padding: 0 0 max(1.5rem, env(safe-area-inset-bottom));
    color: var(--muted);
    font-size: 0.82rem;
}
.site-footer-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
}
.site-footer p { flex: 0 0 auto; margin: 0; white-space: nowrap; }
.footer-links { display: flex; flex: 1 1 auto; min-width: 0; align-items: center; justify-content: flex-end; gap: 0.4rem 1.1rem; flex-wrap: wrap; }
.footer-links a { color: var(--steel); transition: color 0.2s var(--ease); }
.footer-links a:hover, .footer-links a:focus-visible { color: white; }

.content-page { max-width: 760px; margin: 0 auto; }
.product-overview { max-width: 760px; margin: 4rem auto 0; padding: clamp(1.2rem, 4vw, 2rem); border-radius: var(--radius); }
.product-overview > .home-title {
    margin: 0 0 0.7rem;
}
.product-overview > .eyebrow {
    color: var(--text-subtitle);
    text-shadow: none;
}
.product-overview p, .product-overview li { color: color-mix(in oklab, var(--muted) 84%, white); }
.product-overview ol { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; padding: 0; list-style: none; }
.product-overview li { padding: 0.85rem; padding-inline-start: 1.15rem; border-radius: 10px; }
.product-overview strong { color: var(--accent); }

/* Inner callout cards: keep edge gradient, add thick teal leading edge. */
.product-overview li,
.workflow-detail-list li,
.guide-markdown:not(.legal-markdown) > h1 + p + p,
.guide-summary,
.guide-cta {
    box-shadow:
        inset 3px 0 0 #35d8ca,
        var(--shadow),
        inset 0 1px hsl(0 0% 100% / 0.045);
}

[dir="rtl"] .product-overview li,
[dir="rtl"] .workflow-detail-list li,
[dir="rtl"] .guide-markdown:not(.legal-markdown) > h1 + p + p,
[dir="rtl"] .guide-summary,
[dir="rtl"] .guide-cta {
    box-shadow:
        inset -3px 0 0 #35d8ca,
        var(--shadow),
        inset 0 1px hsl(0 0% 100% / 0.045);
}

.product-overview a,
.product-overview li a,
.content-page-body.guide-markdown a,
.guide-markdown > h1 + p + p a,
.guide-summary a,
.guide-cta a,
.feedback-panel > .sheet-copy a {
    color: #c084fc;
    text-decoration: underline dotted;
    text-decoration-color: color-mix(in oklab, hsl(222 39% 95%) 40%, hsl(var(--hue-2) 50% 50%));
    text-underline-offset: 0.2em;
}
.content-page-header { margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.content-page-header h1 { margin-bottom: 0.6rem; }
.content-page-meta { margin: 0; color: var(--muted); font-size: var(--text-sm); }
.content-page-body {
    padding: clamp(1.2rem, 4vw, 2.25rem);
    background:
        linear-gradient(145deg, hsl(var(--hue-2) 40% 15% / 0.58), hsl(var(--hue-1) 36% 9% / 0.62)) padding-box,
        var(--edge-fill) padding-box,
        var(--edge-border) border-box;
    background-origin: border-box;
    background-clip: padding-box, padding-box, border-box;
    border: 1px solid transparent;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* Guides share the How Plyry works panel chrome (corner tints + edge gradient). */
.content-page-body.guide-markdown {
    padding: clamp(1.2rem, 4vw, 2rem);
    border: 1px solid transparent;
    border-radius: var(--radius);
    background:
        linear-gradient(235deg, hsl(var(--hue-1) 52% 13% / 0.55), transparent 34%) padding-box,
        linear-gradient(45deg, hsl(var(--hue-2) 54% 13% / 0.48), transparent 34%) padding-box,
        var(--edge-fill) padding-box,
        var(--edge-border) border-box;
    background-origin: border-box;
    background-clip: padding-box, padding-box, padding-box, border-box;
    box-shadow: var(--shadow), inset 0 1px hsl(0 0% 100% / 0.045);
}
.content-page-body > p:first-child { margin-top: 0; color: var(--steel); font-size: 1.02rem; }
.sign-in-page { max-width: 520px; }
.sign-in-card .primary-btn { justify-self: start; min-width: 9rem; }
.content-page-body section { padding-top: 1rem; }
.content-page-body h2, .contact-card h2, .contact-topics h2 { color: var(--silver); font-family: var(--display); }
.content-page-body h2 { margin: 0 0 0.5rem; font-size: var(--text-lg); }
.guide-markdown > h1 {
    margin: 0 0 1rem;
    color: color-mix(in oklab, hsl(222 39% 95%) 70%, hsl(var(--hue-1) 50% 50%));
    font-family: var(--display);
    font-weight: 500;
    font-size: var(--text-title);
    line-height: 1.12;
    letter-spacing: -0.03em;
    text-wrap: pretty;
    text-shadow: none;
}
.guide-markdown > h1 + p {
    margin: -0.3rem 0 2.5rem;
    color: var(--text-subtitle);
    font-size: var(--text-sm);
}
.guide-markdown:not(.legal-markdown) > h1 + p + p,
.guide-summary {
    margin: 1.5rem 0 3rem;
    padding: 1rem 1.1rem;
    padding-inline-start: 1.45rem;
    border: 1px solid transparent;
    border-radius: 10px;
    background:
        linear-gradient(235deg, hsl(var(--hue-1) 52% 13% / 0.55), transparent 34%) padding-box,
        linear-gradient(45deg, hsl(var(--hue-2) 54% 13% / 0.48), transparent 34%) padding-box,
        var(--edge-fill) padding-box,
        var(--edge-border) border-box;
    background-origin: border-box;
    background-clip: padding-box, padding-box, padding-box, border-box;
}
.guide-markdown strong { color: var(--accent); }
.guide-markdown > h1 + p + p strong { color: var(--accent); }
.guide-markdown h2 {
    margin-top: 2.2rem;
    margin-bottom: 0.5rem;
    color: color-mix(in oklab, hsl(222 39% 95%) 70%, hsl(var(--hue-1) 50% 50%));
    font-family: var(--display);
    font-weight: 500;
    font-size: clamp(1.4rem, 3.5vw, 1.7rem);
    line-height: 1.12;
    letter-spacing: -0.03em;
    text-wrap: pretty;
    text-shadow: none;
}
.content-page-body h3 { margin: 1.4rem 0 0.45rem; color: var(--silver); font-family: var(--display); font-size: var(--text-body); }
.content-page-body.guide-markdown h3 {
    margin: 1.6rem 0 0.5rem;
    color: color-mix(in oklab, hsl(222 39% 95%) 70%, hsl(var(--hue-1) 50% 50%));
    font-family: var(--display);
    font-weight: 500;
    font-size: clamp(1.18rem, 2.7vw, 1.34rem);
    line-height: 1.12;
    letter-spacing: -0.03em;
    text-wrap: pretty;
    text-shadow: none;
}
.content-page-body p, .content-page-body li { color: color-mix(in oklab, var(--muted) 82%, white); }
.content-page-body ul,
.content-page-body ol { padding-inline-start: 1.3rem; }
.content-page-body ol { display: grid; gap: 0.55rem; }
.content-page-body a, .contact-card a { color: var(--accent); text-decoration: underline dotted; text-decoration-color: color-mix(in oklab, hsl(222 39% 95%) 40%, hsl(var(--hue-2) 50% 50%)); text-underline-offset: 0.2em; }
.content-page-body pre { overflow-x: auto; margin: 0.8rem 0 1.25rem; padding: 1rem; color: #d9fffb; background: hsl(224 35% 5% / 0.82); border: 1px solid var(--line); border-radius: 12px; line-height: 1.55; }
.content-page-body code { font-family: var(--font-mono); font-size: 0.9em; }
.content-page-body :not(pre) > code { padding: 0.12em 0.35em; color: #d9fffb; background: hsl(224 35% 5% / 0.72); border-radius: 5px; }
.guide-table-scroll { max-width: 100%; margin: 1rem 0 1.4rem; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.guide-structure-table { width: 100%; min-width: 680px; border-collapse: collapse; color: color-mix(in oklab, var(--muted) 82%, white); font-size: var(--text-sm); line-height: 1.45; }
.guide-structure-table th, .guide-structure-table td { padding: 0.75rem; text-align: start; vertical-align: top; border-bottom: 1px solid var(--line); }
.guide-structure-table thead th { color: var(--silver); background: hsl(224 35% 5% / 0.78); font-family: var(--display); }
.guide-structure-table tbody th { width: 16%; color: var(--accent); background: hsl(224 31% 8% / 0.42); }
.guide-structure-table tbody tr:last-child > * { border-bottom: 0; }
.guide-cta { margin-top: 2rem; padding: 1rem; padding-inline-start: 1.45rem; border-radius: 12px; }

.contact-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1rem;
    padding: clamp(1.25rem, 4vw, 2rem);
    background:
        linear-gradient(145deg, hsl(var(--hue-2) 45% 16% / 0.7), hsl(var(--hue-1) 42% 10% / 0.68)) padding-box,
        var(--edge-fill) padding-box,
        var(--edge-border) border-box;
    background-origin: border-box;
    background-clip: padding-box, padding-box, border-box;
    border: 1px solid transparent;
    border-radius: var(--radius);
    box-shadow: var(--shadow), 0 0 32px hsl(var(--hue-1) 80% 55% / 0.08);
}
.contact-card-icon { width: 3.25rem; height: 3.25rem; display: grid; place-items: center; color: var(--accent); background: hsl(var(--hue-2) 65% 25% / 0.34); border: 1px solid hsl(var(--hue-2) 70% 60% / 0.35); border-radius: 14px; }
.contact-card .eyebrow { margin-bottom: 0.25rem; }
.contact-card h2 { margin: 0 0 0.6rem; font-size: clamp(1.25rem, 4vw, 1.65rem); }
.contact-card p:last-child { margin: 0; color: var(--muted); }
.contact-topics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin-top: 1rem; }
.contact-topics section { padding: 1rem; border-radius: 16px; }
.contact-topics h2 { margin: 0 0 0.4rem; font-size: var(--text-body); }
.contact-topics p { margin: 0; color: var(--muted); font-size: var(--text-sm); }

@media (max-width: 640px) {
    .site-footer-inner { align-items: flex-start; flex-direction: column; }
    .site-footer p { white-space: normal; }
    .footer-links { justify-content: flex-start; }
    .contact-topics { grid-template-columns: 1fr; }
    .product-overview ol { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
    .contact-card { grid-template-columns: 1fr; }
}
.provider-credit-count{font-size:.45em;font-weight:500;color:var(--muted);white-space:nowrap}
