/* Chrome of the application around the stage: library, creation, studio, brands, player. */

:root {
    color-scheme: dark;
    --ui-bg: #0c0e16;
    --ui-panel: #141826;
    --ui-panel-2: #1b2032;
    --ui-line: #2a3047;
    --ui-text: #eef0fa;
    --ui-muted: #98a0bd;
    --ui-primary: #6d7cff;
    --ui-primary-2: #5565f0;
    --ui-danger: #ff7b7b;
    --ui-good: #4fd37a;
    --ui-warn: #ffc456;
    --ui-radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--ui-bg); color: var(--ui-text); font: 15px/1.5 "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif; }
a { color: #a5afff; text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 6px; line-height: 1.25; }
h1 { font-size: 28px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0 0 10px; }
.muted { color: var(--ui-muted); }
.error { color: var(--ui-danger); }
.success { color: var(--ui-good); }
.warn { color: var(--ui-warn); margin: 0; }
.icon { width: 1.15em; height: 1.15em; vertical-align: -.2em; }

.topbar { display: flex; align-items: center; gap: 40px; padding: 14px 32px; border-bottom: 1px solid var(--ui-line); background: var(--ui-panel); position: sticky; top: 0; z-index: 20; }
.topbar .logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--ui-text); }
.topbar .logo .icon { width: 30px; height: 30px; padding: 7px; border-radius: 9px; background: linear-gradient(135deg, var(--ui-primary), #b66dff); color: #fff; fill: #fff; }
.topbar nav { display: flex; gap: 6px; flex-wrap: wrap; }
.topbar nav a { color: var(--ui-muted); padding: 6px 12px; border-radius: 8px; }
.topbar nav a:hover { color: var(--ui-text); text-decoration: none; background: var(--ui-panel-2); }
.topbar nav a.active { color: var(--ui-text); background: var(--ui-panel-2); }
main { padding: 28px 32px 60px; max-width: 1700px; margin: 0 auto; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.center { justify-content: center; flex-wrap: wrap; }
.grow { flex: 1; }
.spacer { flex: 1; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 9px; border: 1px solid var(--ui-line); background: var(--ui-panel-2); color: var(--ui-text); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.button:hover { border-color: #46507a; text-decoration: none; }
.button.primary { background: var(--ui-primary-2); border-color: var(--ui-primary-2); color: #fff; }
.button.primary:hover { background: var(--ui-primary); }
.button.ghost { background: transparent; }
.button.danger { color: var(--ui-danger); }
.button.small { padding: 5px 11px; font-size: 13px; }
.button.big { padding: 13px 24px; font-size: 16px; }
.button:disabled { opacity: .45; cursor: default; }
.link-button { background: none; border: 0; color: #a5afff; font: inherit; cursor: pointer; padding: 0; }
.icon-button { background: none; border: 0; color: var(--ui-muted); cursor: pointer; padding: 4px; font: inherit; }
.visually-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

input, textarea, select { width: 100%; padding: 9px 12px; border-radius: 9px; border: 1px solid var(--ui-line); background: #0f121e; color: var(--ui-text); font: inherit; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--ui-primary); outline-offset: -1px; }
textarea { resize: vertical; }
textarea.code { font: 12.5px/1.5 Consolas, Menlo, monospace; white-space: pre; }
input[type=checkbox] { width: auto; }
input[type=color] { width: 46px; height: 34px; padding: 3px; cursor: pointer; }
input[type=range] { padding: 0; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ui-muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row.three { grid-template-columns: repeat(3, 1fr); }
.check { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.inline { display: flex; gap: 8px; align-items: center; color: var(--ui-muted); }
.inline select { width: auto; }

.empty { text-align: center; padding: 80px 20px; border: 1px dashed var(--ui-line); border-radius: 18px; }

/* ---- accounts and access -------------------------------------------------------------- */

.who { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.who form { margin: 0; }
.gate { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.gate-card { width: 100%; max-width: 420px; background: var(--ui-panel); border: 1px solid var(--ui-line); border-radius: 18px; padding: 30px 32px; display: flex; flex-direction: column; }
.gate-card h1 { margin-bottom: 16px; }
.gate-card .button { margin-top: 4px; }
.narrow { max-width: 480px; margin-bottom: 30px; }
.list { width: 100%; max-width: 1000px; border-collapse: collapse; margin-bottom: 34px; }
.list th, .list td { text-align: left; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--ui-line); vertical-align: middle; }
.list th { font-size: 13px; color: var(--ui-muted); font-weight: 600; }
.list input { width: 220px; padding: 5px 10px; }
.secret { margin-top: 16px; }
.secret code { display: block; word-break: break-all; margin: 6px 0 10px; user-select: all; }
.api-example pre { max-width: 1000px; overflow: auto; background: var(--ui-panel); border: 1px solid var(--ui-line); border-radius: var(--ui-radius); padding: 16px 18px; font: 13px/1.55 Consolas, Menlo, monospace; }
.share-line { display: flex; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.new-brand { margin-bottom: 18px; }
.new-brand summary { cursor: pointer; color: #a5afff; margin-bottom: 10px; }
.new-brand input:not([type=file]) { width: 240px; }
.swatch-logo { display: flex; padding: 4px 6px; border-radius: 7px; border: 1px solid var(--ui-line); }
.swatch-logo img { height: 20px; max-width: 90px; object-fit: contain; }

/* ---- pictures and icons --------------------------------------------------------------- */

.sources-panel { background: var(--ui-panel); border: 1px solid var(--ui-line); border-radius: var(--ui-radius); padding: 12px 18px; margin-bottom: 22px; }
.sources-panel summary { cursor: pointer; font-weight: 600; }
.source-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; margin: 16px 0; }
.sources-panel blockquote { margin: 0 0 8px; padding: 10px 14px; border-left: 3px solid var(--ui-primary); background: #0f121e; font-size: 13.5px; }
.find input { max-width: 420px; }
.found { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 4px; }
.found button { width: 132px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 8px; border-radius: 10px; border: 1px solid var(--ui-line); background: var(--ui-panel-2); color: var(--ui-muted); font: inherit; font-size: 11.5px; cursor: pointer; overflow-wrap: anywhere; }
.found button:hover { border-color: var(--ui-primary); color: var(--ui-text); }
.found img { width: 40px; height: 40px; object-fit: contain; }
.found button.picture { width: 190px; }
.found button.picture img { width: 100%; height: 100px; object-fit: cover; border-radius: 6px; }
.library-tabs small { color: var(--ui-muted); font-weight: 400; }
.library { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
.library.with-detail { grid-template-columns: minmax(0, 1fr) 360px; }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; align-content: start; }
.asset-card { position: relative; }
.asset-open { width: 100%; height: 100%; display: flex; flex-direction: column; gap: 4px; align-items: stretch; text-align: left; padding: 10px; border-radius: 12px; border: 1px solid var(--ui-line); background: var(--ui-panel); color: var(--ui-text); font: inherit; cursor: pointer; }
.asset-open:hover { border-color: #46507a; }
.asset-card.selected .asset-open { border-color: var(--ui-primary); box-shadow: 0 0 0 1px var(--ui-primary); }
.asset-open strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-open small { color: var(--ui-muted); font-size: 12px; }
.asset-open small.count { color: var(--ui-good); }
.asset-open small.unused { color: var(--ui-muted); }
.asset-thumb { height: 96px; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 44px; background: repeating-conic-gradient(#232941 0 25%, #1b2032 0 50%) 0 0 / 18px 18px; }
.asset-thumb img { max-width: 86%; max-height: 80px; object-fit: contain; }
.asset-thumb .icon-img { width: 56px; height: 56px; }
.asset-thumb.large { height: 170px; margin: 10px 0 16px; }
.asset-thumb.large img { max-height: 148px; }
.asset-uses { display: none; position: absolute; left: 0; top: calc(100% - 6px); z-index: 15; width: 300px; max-width: 80vw; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--ui-primary); background: #101426; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .7); font-size: 12.5px; }
.asset-uses ul, .use-list { margin: 6px 0 0; padding-left: 18px; }
.asset-card:hover .asset-uses, .asset-card:focus-within .asset-uses { display: block; }
.asset-detail { position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow: auto; background: var(--ui-panel); border: 1px solid var(--ui-line); border-radius: 16px; padding: 16px 18px 20px; }
.asset-detail h4 { margin: 18px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--ui-muted); }
.asset-detail select, .asset-detail > input { margin-bottom: 8px; }
.use-list { font-size: 13px; }
.small-print { font-size: 12px; margin-top: 10px; overflow-wrap: anywhere; }
.follow-up { border-color: var(--ui-primary); }
.job { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13.5px; }

/* ---- library -------------------------------------------------------------------------- */

.deck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 24px; }
.deck-card { background: var(--ui-panel); border: 1px solid var(--ui-line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.thumb { display: block; aspect-ratio: 16 / 9; position: relative; background: #000; }
.thumb-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; background: rgba(5, 7, 14, .45); transition: opacity .2s; }
.thumb-play .icon { width: 64px; height: 64px; padding: 18px; border-radius: 50%; background: var(--ui-primary); color: #fff; fill: #fff; }
.thumb:hover .thumb-play, .thumb:focus-visible .thumb-play { opacity: 1; }
.deck-info { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; }
.deck-info p { margin: 0; font-size: 13px; }
.deck-info code { font-size: 12px; color: var(--ui-muted); margin-bottom: 6px; }

/* ---- create --------------------------------------------------------------------------- */

.create { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 36px; align-items: start; }
.note { background: var(--ui-panel); border: 1px solid var(--ui-line); border-radius: var(--ui-radius); padding: 18px 20px; margin-bottom: 18px; }
.note.warning { border-color: var(--ui-warn); }

.drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px; border: 1.5px dashed var(--ui-line); border-radius: var(--ui-radius); cursor: pointer; text-align: center; position: relative; }
.drop:hover { border-color: var(--ui-primary); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop span { font-size: 13px; color: var(--ui-muted); }
.sources ul { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; }
.sources li { display: flex; gap: 12px; align-items: center; background: var(--ui-panel); border: 1px solid var(--ui-line); border-radius: 9px; padding: 6px 12px; }
.sources li button { margin-left: auto; }

.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatches.large { margin-bottom: 24px; }
.swatch { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 11px; border: 1px solid var(--ui-line); background: var(--ui-panel); color: var(--ui-text); font: inherit; cursor: pointer; }
.swatch:hover { text-decoration: none; border-color: #46507a; }
.swatch.selected { border-color: var(--ui-primary); box-shadow: 0 0 0 1px var(--ui-primary); }
.dots { display: flex; gap: 3px; padding: 7px; border-radius: 7px; border: 1px solid var(--ui-line); }
.dots i { width: 13px; height: 13px; border-radius: 50%; }

.author-status { background: var(--ui-panel); border: 1px solid var(--ui-primary); border-radius: var(--ui-radius); padding: 16px 18px; margin-top: 14px; }
.author-line { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.author-status ol { margin: 10px 0 0; padding-left: 22px; color: var(--ui-muted); }
.author-status li { animation: slide-in .5s ease both; }
@keyframes slide-in { from { opacity: 0; transform: translateX(-12px); } }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ui-line); border-top-color: var(--ui-primary); animation: spin .8s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }

/* ---- studio and brand editor ---------------------------------------------------------- */

.studio { display: grid; grid-template-columns: 270px minmax(0, 1fr) 390px; gap: 20px; align-items: start; }
.outline ol { list-style: none; padding: 0; margin: 0; max-height: calc(100vh - 220px); overflow: auto; }
.outline li { padding-left: calc(var(--depth) * 20px); }
.outline button { width: 100%; display: grid; grid-template-columns: 26px 1fr; text-align: left; gap: 0 8px; padding: 8px 10px; border: 1px solid transparent; border-radius: 9px; background: none; color: var(--ui-text); font: inherit; cursor: pointer; }
.outline button:hover { background: var(--ui-panel); }
.outline button.current { background: var(--ui-panel-2); border-color: var(--ui-primary); }
.outline .number { grid-row: span 2; color: var(--ui-muted); font-size: 12px; padding-top: 2px; }
.outline .name { line-height: 1.3; }
.outline .kind { font-size: 11.5px; color: var(--ui-muted); }

.screen { aspect-ratio: 16 / 9; width: 100%; background: #000; border-radius: var(--ui-radius); overflow: hidden; border: 1px solid var(--ui-line); position: relative; }
.screen-black { position: absolute; inset: 0; background: #000; opacity: .88; pointer-events: none; }
.controls { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.preview.sticky { position: sticky; top: 84px; }

.inspector { background: var(--ui-panel); border: 1px solid var(--ui-line); border-radius: 16px; padding: 16px 18px 20px; max-height: calc(100vh - 180px); overflow: auto; }
.inspector .row { margin-top: 12px; }
.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--ui-line); }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--ui-muted); padding: 7px 12px; font: inherit; font-weight: 600; cursor: pointer; }
.tabs button.current { color: var(--ui-text); border-color: var(--ui-primary); }

.brand-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 32px; align-items: start; }
.colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.colors label { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.logo-preview { height: 52px; max-width: 220px; padding: 8px; border-radius: 8px; object-fit: contain; }

/* ---- player ---------------------------------------------------------------------------- */

.player { position: fixed; inset: 0; background: #000; overflow: hidden; user-select: none; }
.viewport { position: absolute; inset: 0; }
body.idle .player.running { cursor: none; }
.player-missing { min-height: 100vh; display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; }

.start-poster { position: absolute; inset: 0; filter: blur(14px) brightness(.45); transform: scale(1.04); }
.start { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; }
.start-card { text-align: center; max-width: 720px; background: rgba(16, 20, 34, .82); border: 1px solid rgba(255, 255, 255, .12); border-radius: 22px; padding: 38px 46px; backdrop-filter: blur(8px); animation: rise .6s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }
.start-label { text-transform: uppercase; letter-spacing: .18em; font-size: 12px; color: var(--ui-muted); }
.start-card h1 { font-size: 34px; margin: 10px 0 4px; }
.start-card p { color: var(--ui-muted); margin-bottom: 24px; }
.start-card .link-button { margin-top: 16px; }
.keys { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; margin-top: 26px; color: var(--ui-muted); font-size: 13px; }
kbd { font: 600 11px Consolas, monospace; border: 1px solid var(--ui-line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; color: var(--ui-text); }

.blackout { position: absolute; inset: 0; background: #000; z-index: 8; animation: fade-in .35s both; }
@keyframes fade-in { from { opacity: 0; } }

.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; z-index: 6; background: rgba(127, 135, 170, .18); }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--ui-primary), #b66dff); transition: width .6s cubic-bezier(.16, 1, .3, 1); }

.hud { position: absolute; left: 50%; bottom: 18px; translate: -50% 0; z-index: 9; display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 999px; background: rgba(14, 17, 30, .82); border: 1px solid rgba(255, 255, 255, .12); backdrop-filter: blur(8px); opacity: 0; transition: opacity .35s; }
.player:hover .hud, .hud:focus-within { opacity: 1; }
body.idle .hud:not(:hover):not(:focus-within) { opacity: 0; pointer-events: none; }
.hud button, .hud a { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: none; color: #eef0fa; cursor: pointer; font: inherit; font-size: 16px; }
.hud button:hover, .hud a:hover { background: rgba(255, 255, 255, .12); }
.counter { font-size: 13px; font-variant-numeric: tabular-nums; padding: 0 8px; color: #c7cce2; }
.divider { width: 1px; height: 20px; background: rgba(255, 255, 255, .16); margin: 0 6px; }

.map { position: absolute; inset: 0; z-index: 10; background: rgba(6, 8, 15, .9); backdrop-filter: blur(10px); display: flex; animation: fade-in .25s both; }
.map-inner { margin: auto; max-width: 96vw; max-height: 92vh; display: flex; flex-direction: column; gap: 20px; }
.map-remote { position: absolute; top: 18px; right: 18px; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--ui-line); border-radius: 50%; background: var(--ui-panel); color: #eef0fa; cursor: pointer; }
.map-remote svg { width: 26px; height: 26px; }
.map-remote:hover { border-color: var(--ui-primary); }
.remote-code { position: absolute; inset: 0; z-index: 12; display: flex; align-items: center; justify-content: center; background: rgba(6, 8, 15, .3); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); animation: fade-in .2s both; }
.remote-code-card { display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: min(98vw, 720px); color: #d3d7e3; text-align: center; }
.remote-code-card svg { width: min(84vh, 680px, 98vw); height: auto; aspect-ratio: 1; }
.remote-code-card p { position: relative; margin: calc(-1 * min(4vh, 32px)) 0 0; font-size: 18px; font-weight: 600; }
.remote-code-close { padding: 8px 22px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; background: none; color: inherit; font: inherit; cursor: pointer; }
.map-head { text-align: center; color: #eef0fa; }
.map-head span { color: var(--ui-muted); font-size: 13px; }
.map-scroll { overflow: auto; padding: 8px; }
.map-tree { display: flex; gap: 18px; align-items: flex-start; justify-content: safe center; }
.map-branch { display: flex; flex-direction: column; align-items: center; gap: 22px; animation: rise .5s cubic-bezier(.16, 1, .3, 1) both; }
.map-branch:nth-child(2) { animation-delay: .04s; }
.map-branch:nth-child(3) { animation-delay: .08s; }
.map-branch:nth-child(4) { animation-delay: .12s; }
.map-branch:nth-child(n+5) { animation-delay: .16s; }
.map-children { display: flex; gap: 14px; align-items: flex-start; border-top: 2px solid var(--ui-line); padding-top: 20px; position: relative; }
.map-children::before { content: ""; position: absolute; left: 50%; top: -22px; height: 20px; border-left: 2px solid var(--ui-line); }
.map-node { width: 156px;min-height: 76px; display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--ui-line); background: var(--ui-panel); color: var(--ui-text); font: inherit; font-size: 13px; line-height: 1.3; cursor: pointer; transition: translate .2s, border-color .2s; }
.map-node:hover { translate: 0 -4px; border-color: var(--ui-primary); }
.map-node.seen { opacity: .62; }
.map-node.current { opacity: 1; border-color: var(--ui-primary); box-shadow: 0 0 0 2px var(--ui-primary), 0 14px 34px -14px var(--ui-primary); }
.map-node.chosen, .map-action.chosen { outline: 3px solid #39ff14; outline-offset: 3px; opacity: 1; }
.map-number { font-size: 11px; color: var(--ui-muted); }
/* Actions hang from their page on a line with a dot each, so they never pass for topics. */
.map-actions { list-style: none; margin: -22px 0 0; padding: 8px 0 0; width: 156px; display: flex; flex-direction: column; }
.map-actions li { position: relative; padding-left: 22px; }
.map-actions li::before { content: ""; position: absolute; left: 11px; top: -2px; bottom: 0; border-left: 2px solid var(--ui-line); }
.map-actions li:last-child::before { bottom: 50%; }
.map-action { width: 100%; text-align: left; padding: 4px 6px; border: 0; border-radius: 6px; background: none; color: var(--ui-muted); font: inherit; font-size: 12px; line-height: 1.3; cursor: pointer; }
.map-action::before { content: ""; position: absolute; left: 7px; top: calc(50% - 5px); width: 6px; height: 6px; border-radius: 50%; border: 2px solid var(--ui-muted); background: #05070f; }
.map-action:hover { color: var(--ui-text); background: var(--ui-panel); }
.map-action.seen { opacity: .6; }
.map-action.current { opacity: 1; color: var(--ui-text); font-weight: 600; }
.map-action.current::before { border-color: var(--ui-primary); background: var(--ui-primary); }

/* ---- presenter console ----------------------------------------------------------------- */

.console { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr) 290px; grid-template-rows: auto minmax(0, 1fr); gap: 18px; height: 100vh; padding: 0 18px 18px; }
/* Child selectors only: the live previews inside the console have headers and headings of their own. */
.console > header { grid-column: 1 / -1; display: flex; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--ui-line); flex-wrap: wrap; }
.console > section { min-height: 0; overflow: auto; }
.console > section > h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--ui-muted); margin: 0 0 8px; }
.console-side > h3 { margin-top: 16px; }
.console-side > h3:first-child { margin-top: 0; }
.clock { font: 600 24px Consolas, monospace; font-variant-numeric: tabular-nums; }
.notes { background: var(--ui-panel); border: 1px solid var(--ui-line); border-radius: var(--ui-radius); padding: 14px 16px; font-size: 17px; line-height: 1.55; white-space: pre-wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--ui-panel-2); border: 1px solid var(--ui-line); border-radius: 999px; padding: 4px 12px; font-size: 13px; }
.console-list ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.console-list button { width: 100%; display: flex; gap: 10px; text-align: left; padding: 6px 10px; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--ui-text); font: inherit; font-size: 13.5px; cursor: pointer; }
.console-list button span { color: var(--ui-muted); min-width: 22px; }
.console-list button:hover { background: var(--ui-panel); }
.console-list .current button { background: var(--ui-panel-2); border-color: var(--ui-primary); }
.console-list .sub button { padding-left: 30px; }
.console-list .return button { color: var(--ui-muted); font-style: italic; }

/* ---- framework ------------------------------------------------------------------------- */

#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000; padding: 12px 20px; background: #5a1d28; color: #fff; }
#blazor-error-ui .dismiss { position: absolute; right: 14px; top: 12px; cursor: pointer; }

@media (max-width: 1200px) {
    .studio { grid-template-columns: 220px minmax(0, 1fr); }
    .inspector { grid-column: 1 / -1; max-height: none; }
    .create, .brand-editor, .library.with-detail { grid-template-columns: 1fr; }
    .asset-detail { position: static; order: -1; max-height: none; }
    .brand-editor .preview { order: -1; position: static; }
    .console { grid-template-columns: 1fr; grid-template-rows: none; height: auto; }
}

@media (max-width: 720px) {
    main { padding: 18px 14px 40px; }
    .topbar { gap: 14px; padding: 12px 14px; flex-wrap: wrap; }
    .deck-grid { grid-template-columns: 1fr; }
    .studio { grid-template-columns: 1fr; }
    .field-row, .field-row.three { grid-template-columns: 1fr; }
}

/* ---- virtual cursor and phone remote ---------------------------------------------------- */

.pointer-dot { position: fixed; z-index: 2000; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: #39ff14; box-shadow: 0 0 0 4px rgba(57, 255, 20, .35), 0 0 24px 8px rgba(57, 255, 20, .65); pointer-events: none; transition: left .06s linear, top .06s linear; }
.pointer-ripple { position: fixed; z-index: 1999; width: 80px; height: 80px; margin: -40px 0 0 -40px; border: 4px solid #39ff14; border-radius: 50%; pointer-events: none; animation: pointer-ripple .5s ease-out both; }
@keyframes pointer-ripple { from { scale: .2; opacity: 1; } to { scale: 1.2; opacity: 0; } }

.remote { position: fixed; inset: 0; display: flex; flex-direction: column; gap: 12px; padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); background: #07090f; color: #eef0fa; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.remote button { font: inherit; color: inherit; border: 1px solid #2a3047; border-radius: 18px; background: #151a2b; cursor: pointer; }
.remote button:active { filter: brightness(1.35); }
.remote-head { display: flex; flex-direction: column; gap: 2px; text-align: center; }
.remote-head span { font-size: 13px; color: #9aa4c7; }
.remote-toggles { display: flex; gap: 12px; }
.remote .remote-toggle, .remote .remote-map { flex: 1; height: 12vh; min-height: 84px; font-size: 22px; font-weight: 700; }
.remote .remote-map.on { background: #20285a; border-color: #6d7cff; }
.remote.pointing .remote-toggle { background: #123d0c; border-color: #39ff14; }
.remote-note { margin: 0; font-size: 13px; color: #ffcf6b; text-align: center; }
.remote-note:empty { display: none; }
.remote-middle { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; }
.remote-pad { display: none; align-items: center; justify-content: center; height: 100%; max-height: 160px; border: 1px dashed #2a3047; border-radius: 14px; font-size: 13px; color: #9aa4c7; touch-action: none; }
.remote.pointing.blind .remote-pad { display: flex; }
.remote-buttons { display: flex; gap: 12px; height: 28vh; min-height: 130px; }
.remote .remote-prev { flex: 1; font-size: 34px; }
.remote .remote-next { flex: 3; font-size: 30px; font-weight: 700; background: #6d7cff; border-color: #6d7cff; color: #fff; }
.remote .remote-click { display: none; flex: 3; font-size: 30px; font-weight: 700; background: #2b6b45; border-color: #3f8f60; color: #e8f7ee; }
.remote.pointing .remote-click { display: block; }
.remote.pointing .remote-next { display: none; }
.remote[data-map="open"]:not(.pointing) .remote-buttons { display: none; }
.remote[data-map="open"].pointing .remote-prev { display: none; }
.remote-cross { display: none; align-self: center; width: min(100%, 50vh); aspect-ratio: 1; grid-template: repeat(3, 1fr) / repeat(3, 1fr); gap: 10px; }
.remote[data-map="open"]:not(.pointing) .remote-cross { display: grid; }
.remote .remote-cross button { font-size: 30px; touch-action: manipulation; }
.remote .remote-cross .up { grid-area: 1 / 2; }
.remote .remote-cross .left { grid-area: 2 / 1; }
.remote .remote-cross .ok { grid-area: 2 / 2; font-size: 20px; font-weight: 700; background: #6d7cff; border-color: #6d7cff; color: #fff; border-radius: 50%; }
.remote .remote-cross .right { grid-area: 2 / 3; }
.remote .remote-cross .down { grid-area: 3 / 2; }
