:root {
  --bg: #0c0d11;
  --surface: #13151b;
  --surface-2: #191c24;
  --surface-3: #222631;
  --border: rgba(255,255,255,.09);
  --border-strong: rgba(255,255,255,.16);
  --text: #f5f6f8;
  --muted: #9aa1af;
  --muted-2: #6f7684;
  --brand-primary: #006EFF;
  --brand-accent: #FFFFFF;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #fb7185;
  --blue: #60a5fa;
  --shadow: 0 24px 80px rgba(0,0,0,.34);
  --radius: 20px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }

.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo { width: 42px; height: 42px; border-radius: 13px; object-fit: contain; background: #111318; box-shadow: 0 8px 24px rgba(0,0,0,.24); }
.brand-lockup div { min-width: 0; }
.brand-lockup strong, .brand-lockup span { display: block; }
.brand-lockup strong { font-size: 16px; letter-spacing: -.02em; }
.brand-lockup span { margin-top: 3px; max-width: 180px; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-lockup-large { gap: 15px; }
.brand-lockup-large .brand-logo { width: 54px; height: 54px; border-radius: 16px; }
.brand-lockup-large strong { font-size: 19px; }
.brand-lockup-large span { max-width: 360px; font-size: 13px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 252px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 18px; display: flex; flex-direction: column; border-right: 1px solid var(--border); background: #0f1015; z-index: 20; }
.sidebar-brand { padding: 0 8px 28px; }
.sidebar-nav { display: grid; gap: 7px; }
.nav-item { width: 100%; min-height: 48px; display: flex; align-items: center; gap: 13px; padding: 0 14px; border: 1px solid transparent; border-radius: 13px; background: transparent; color: var(--muted); cursor: pointer; text-align: left; transition: .2s ease; }
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.045); }
.nav-item.active { color: #fff; border-color: color-mix(in srgb, var(--brand-accent) 25%, transparent); background: linear-gradient(135deg, color-mix(in srgb, var(--brand-primary) 44%, #15161d), rgba(255,255,255,.035)); box-shadow: inset 3px 0 0 var(--brand-accent); }
.nav-icon { width: 24px; height: 24px; display: grid; place-items: center; color: var(--brand-accent); font-size: 17px; }
.sidebar-footer { margin-top: auto; display: grid; gap: 14px; }
.connection-card, .system-card { display: flex; align-items: center; gap: 11px; padding: 13px; border: 1px solid var(--border); border-radius: 14px; background: rgba(255,255,255,.025); }
.connection-card strong, .connection-card span, .system-card strong, .system-card span { display: block; }
.connection-card strong, .system-card strong { font-size: 12px; }
.connection-card div span, .system-card div span { margin-top: 3px; color: var(--muted-2); font-size: 10px; }
.status-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: var(--muted-2); box-shadow: 0 0 0 4px rgba(255,255,255,.04); }
.status-dot-online { background: var(--success); box-shadow: 0 0 0 4px rgba(52,211,153,.11), 0 0 16px rgba(52,211,153,.35); }
.status-dot-offline { background: var(--danger); box-shadow: 0 0 0 4px rgba(251,113,133,.1); }
.status-dot-waiting { background: var(--warning); box-shadow: 0 0 0 4px rgba(251,191,36,.1); }
.sidebar-logout { padding: 4px 12px; color: var(--muted-2); font-size: 12px; }
.sidebar-logout:hover { color: var(--danger); }

.app-main { min-width: 0; }
.topbar { min-height: 92px; padding: 19px 34px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--border); background: rgba(12,13,17,.86); backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 15; }
.topbar h1 { margin: 3px 0 0; font-size: clamp(22px, 2vw, 30px); line-height: 1; letter-spacing: -.04em; }
.topbar-kicker, .eyebrow, .panel-kicker { color: var(--brand-accent); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.live-pill { height: 40px; display: inline-flex; align-items: center; gap: 9px; padding: 0 13px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: 12px; background: rgba(255,255,255,.025); }
.live-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 14px rgba(251,113,133,.7); animation: livePulse 2s infinite; }
@keyframes livePulse { 50% { opacity: .45; } }
.workspace { width: min(1500px, 100%); margin: 0 auto; padding: 34px; }
.page-section { display: none; animation: sectionIn .25s ease; }
.page-section.active { display: block; }
@keyframes sectionIn { from { opacity: 0; transform: translateY(4px); } }
.section-heading { margin-bottom: 23px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.section-heading h2 { margin: 7px 0 7px; font-size: clamp(25px, 3vw, 37px); letter-spacing: -.045em; }
.section-heading p { margin: 0; max-width: 740px; color: var(--muted); font-size: 14px; line-height: 1.65; }

.operation-grid { display: grid; grid-template-columns: minmax(0, 1.28fr) minmax(360px, .72fr); gap: 20px; align-items: start; }
.control-stack { display: grid; gap: 20px; }
.two-column-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; align-items: start; }
.panel { min-width: 0; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(160deg, rgba(255,255,255,.035), transparent 42%), var(--surface); box-shadow: 0 18px 55px rgba(0,0,0,.14); }
.panel-heading { min-height: 42px; margin-bottom: 17px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel-heading h3 { margin: 5px 0 0; font-size: 18px; letter-spacing: -.025em; }
.text-link { color: var(--muted); font-size: 12px; }
.text-link:hover { color: var(--brand-accent); }
.state-badge, .integration-badge { display: inline-flex; align-items: center; min-height: 26px; padding: 0 9px; border: 1px solid rgba(52,211,153,.22); border-radius: 999px; background: rgba(52,211,153,.08); color: var(--success); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.state-badge-neutral { color: var(--muted); border-color: var(--border); background: rgba(255,255,255,.025); }
.integration-badge { color: var(--blue); border-color: rgba(96,165,250,.22); background: rgba(96,165,250,.07); }

.display-frame { position: relative; width: 100%; aspect-ratio: 16/9; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 16px; background: #000; box-shadow: inset 0 0 0 1px rgba(255,255,255,.03), 0 20px 50px rgba(0,0,0,.26); }
.display-frame::after { content: "PREVIEW"; position: absolute; right: 12px; top: 11px; z-index: 2; padding: 5px 7px; border-radius: 7px; background: rgba(0,0,0,.62); color: rgba(255,255,255,.55); font-size: 8px; font-weight: 900; letter-spacing: .12em; pointer-events: none; }
.display-frame iframe { width: 100%; height: 100%; border: 0; background: #000; pointer-events: none; }
.mode-switcher { margin-top: 15px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.mode-button { min-height: 65px; display: grid; place-items: center; gap: 4px; padding: 8px 4px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: 10px; cursor: pointer; transition: .2s ease; }
.mode-button span { color: var(--text); font-size: 13px; font-weight: 800; }
.mode-button:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.mode-button.active { border-color: color-mix(in srgb, var(--brand-accent) 55%, transparent); background: color-mix(in srgb, var(--brand-primary) 38%, var(--surface-2)); color: #fff; box-shadow: inset 0 -2px 0 var(--brand-accent); }

.timer-readout { margin: 6px 0 12px; color: #f8fafc; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: clamp(42px, 5.6vw, 72px); font-weight: 700; line-height: 1; letter-spacing: -.07em; text-align: center; font-variant-numeric: tabular-nums; text-shadow: 0 0 35px rgba(255,255,255,.09); }
.timer-readout.overtime { color: var(--danger); text-shadow: 0 0 30px rgba(251,113,133,.18); }
.timer-adjust-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.timer-progress { height: 5px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.07); }
.timer-progress span { display: block; width: 100%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent)); transition: width .3s linear; }
.icon-button { min-height: 32px; padding: 0 9px; border: 1px solid var(--border); border-radius: 9px; background: transparent; color: var(--muted); font-size: 10px; cursor: pointer; }
.timer-primary-actions { margin: 16px 0; display: grid; grid-template-columns: 1fr auto; gap: 9px; }
.time-fields { display: grid; grid-template-columns: repeat(3, 1fr) auto; align-items: end; gap: 8px; }
.time-fields label span { display: block; margin-bottom: 6px; color: var(--muted-2); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.time-fields input { width: 100%; height: 42px; padding: 0 9px; border: 1px solid var(--border); border-radius: 10px; background: #0e1015; color: var(--text); text-align: center; outline: 0; }
.preset-row { margin-top: 10px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.preset-row button { min-height: 32px; border: 1px solid var(--border); border-radius: 9px; background: transparent; color: var(--muted); font-size: 10px; cursor: pointer; }
.preset-row button:hover, .icon-button:hover { color: #fff; border-color: var(--border-strong); }

.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; border: 1px solid transparent; border-radius: 11px; font-weight: 700; font-size: 12px; cursor: pointer; transition: transform .15s ease, border-color .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button-large { min-height: 48px; padding-inline: 20px; font-size: 13px; }
.button-primary { color: #0d0e12; background: var(--brand-accent); box-shadow: 0 10px 28px color-mix(in srgb, var(--brand-accent) 18%, transparent); }
.button-secondary { border-color: var(--border); background: var(--surface-2); color: var(--text); }
.button-success { color: #07130f; background: var(--success); }
.button-danger-soft { color: var(--danger); border-color: rgba(251,113,133,.18); background: rgba(251,113,133,.07); }
.button-ghost { color: var(--muted); background: transparent; }

.message-input { width: 100%; min-height: 88px; resize: vertical; padding: 13px 14px; border: 1px solid var(--border); border-radius: 12px; background: #0e1015; color: var(--text); line-height: 1.5; outline: 0; }
.message-input:focus, input:focus, textarea:focus, select:focus { border-color: color-mix(in srgb, var(--brand-accent) 58%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-accent) 9%, transparent); }
.message-options { margin-top: 10px; display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; border: 1px solid var(--border); border-radius: 11px; background: #0e1015; }
.segmented button { min-height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 10px; cursor: pointer; }
.segmented button.active { background: var(--surface-3); color: #fff; box-shadow: 0 5px 15px rgba(0,0,0,.2); }
.message-options select { min-width: 130px; padding: 0 10px; border: 1px solid var(--border); border-radius: 11px; background: #0e1015; color: var(--text); outline: 0; }
.message-footer { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.message-footer > div { display: flex; gap: 7px; }
.checkbox { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; cursor: pointer; }
.checkbox input { accent-color: var(--brand-accent); }

.field { display: grid; gap: 7px; margin-bottom: 15px; }
.field > span { color: var(--muted); font-size: 11px; font-weight: 700; }
.field small { color: var(--muted-2); font-weight: 500; }
.field input, .field textarea, .field select { width: 100%; min-height: 45px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 11px; background: #0e1015; color: var(--text); outline: 0; }
.field textarea { line-height: 1.55; resize: vertical; }
.field-hint { margin: -5px 0 14px; color: var(--muted-2); font-size: 11px; line-height: 1.55; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.form-actions .field-hint { margin: 0 auto 0 0; }
.form-divider { position: relative; margin: 21px 0 17px; border-top: 1px solid var(--border); }
.form-divider span { position: relative; top: -8px; padding-right: 10px; background: var(--surface); color: var(--muted-2); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.toggle-list { margin: 19px 0; display: grid; gap: 9px; }
.switch-row { min-height: 64px; padding: 11px 13px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid var(--border); border-radius: 13px; background: rgba(255,255,255,.02); cursor: pointer; }
.switch-row strong, .switch-row span { display: block; }
.switch-row strong { font-size: 12px; }
.switch-row span { margin-top: 4px; color: var(--muted-2); font-size: 10px; }
.switch-row input { position: absolute; opacity: 0; }
.switch-row i { width: 40px; height: 23px; flex: 0 0 auto; padding: 3px; border-radius: 999px; background: #333844; transition: .2s; }
.switch-row i::after { content: ""; display: block; width: 17px; height: 17px; border-radius: 50%; background: white; transition: .2s; }
.switch-row input:checked + i { background: var(--brand-accent); }
.switch-row input:checked + i::after { transform: translateX(17px); background: #111; }
.info-panel { display: grid; gap: 18px; }
.info-illustration { min-height: 210px; padding: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 16px; background: radial-gradient(circle at center, color-mix(in srgb, var(--brand-primary) 55%, transparent), transparent 62%), #0a0b0e; text-align: center; }
.info-illustration span { color: var(--brand-accent); font-size: 12px; font-weight: 900; letter-spacing: .25em; }
.info-illustration strong { margin-top: 9px; font-size: clamp(24px, 4vw, 43px); letter-spacing: -.05em; }
.info-illustration small { margin-top: 9px; color: var(--muted); }
.info-copy h3 { margin: 0 0 10px; font-size: 15px; }
.info-copy ol { margin: 0; padding-left: 20px; color: var(--muted); font-size: 12px; line-height: 1.9; }
.notice { padding: 13px 14px; display: grid; gap: 5px; border: 1px solid var(--border); border-radius: 12px; }
.notice strong { font-size: 11px; }
.notice span { color: var(--muted); font-size: 10px; line-height: 1.55; }
.notice-warning { border-color: rgba(251,191,36,.17); background: rgba(251,191,36,.045); }
.notice-warning strong { color: var(--warning); }


.mode-switcher-live { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.setlist-layout { display: grid; grid-template-columns: minmax(340px,.72fr) minmax(0,1.28fr); gap: 20px; align-items: start; }
.block-editor-panel { position: sticky; top: 126px; }
.block-editor-actions { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.block-editor-actions > div { display: flex; gap: 8px; }

.setlist-live-panel { min-width: 0; }
.current-block-preview { min-height: 360px; padding: 28px; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 18px; background: radial-gradient(circle at 14% 8%, color-mix(in srgb, var(--brand-primary) 45%, transparent), transparent 36%), linear-gradient(145deg,#090a0d,#11141b); box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
.current-block-top { display: grid; gap: 7px; }
.current-block-top span { color: var(--brand-accent); font-size: 10px; font-weight: 900; letter-spacing: .18em; }
.current-block-top strong { font-size: clamp(32px,4vw,56px); line-height: 1; letter-spacing: -.055em; }
.current-block-songs { margin-top: 24px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.current-song-row { min-width: 0; min-height: 52px; padding: 9px 11px; display: flex; align-items: center; gap: 10px; border: 1px solid rgba(255,255,255,.09); border-radius: 11px; background: rgba(255,255,255,.035); }
.current-song-row span { flex: 0 0 auto; color: var(--brand-accent); font-family: ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size: 10px; font-weight: 850; opacity: .72; }
.current-song-row strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; letter-spacing: -.015em; }
.empty-setlist { grid-column: 1/-1; min-height: 180px; display: grid; place-items: center; color: var(--muted); font-size: 13px; text-align: center; }

.block-nav-controls { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.block-nav-button { min-width: 0; min-height: 72px; padding: 10px 14px; display: flex; align-items: center; gap: 13px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); cursor: pointer; text-align: left; transition: .18s ease; }
.block-nav-button:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--border-strong); background: var(--surface-3); }
.block-nav-button:disabled { opacity: .35; cursor: not-allowed; }
.block-nav-button > span { color: var(--brand-accent); font-size: 26px; line-height: 1; }
.block-nav-button div { min-width: 0; }
.block-nav-button small, .block-nav-button strong { display: block; }
.block-nav-button small { color: var(--muted-2); font-size: 8px; font-weight: 900; letter-spacing: .16em; }
.block-nav-button strong { margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.block-nav-button-next { justify-content: flex-end; text-align: right; }

.setlist-strip-heading { margin-top: 22px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.setlist-strip-heading strong, .setlist-strip-heading span { display: block; }
.setlist-strip-heading strong { font-size: 12px; }
.setlist-strip-heading div span { margin-top: 4px; color: var(--muted-2); font-size: 10px; }
.keyboard-hint { flex: 0 0 auto; padding: 5px 8px; border: 1px solid var(--border); border-radius: 7px; color: var(--muted); background: rgba(255,255,255,.025); font-size: 9px; }
.block-carousel { margin-top: 10px; padding-bottom: 6px; display: flex; gap: 9px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin; }
.saved-block-card { flex: 0 0 185px; min-width: 0; min-height: 96px; padding: 13px; display: flex; flex-direction: column; align-items: flex-start; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-2); color: var(--muted); cursor: pointer; scroll-snap-align: start; text-align: left; transition: .18s ease; }
.saved-block-card:hover { transform: translateY(-1px); border-color: var(--border-strong); }
.saved-block-card > span { color: var(--brand-accent); font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.saved-block-card strong { width: 100%; margin-top: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: 13px; }
.saved-block-card small { margin-top: auto; padding-top: 7px; color: var(--muted-2); font-size: 9px; }
.saved-block-card.active { border-color: color-mix(in srgb,var(--brand-accent) 58%,transparent); background: color-mix(in srgb,var(--brand-primary) 30%,var(--surface-2)); box-shadow: inset 0 -2px 0 var(--brand-accent); }
.saved-block-card.editing { outline: 1px solid color-mix(in srgb,var(--blue) 55%,transparent); outline-offset: -4px; }

.color-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.color-field { display: grid; grid-template-columns: 48px 1fr; gap: 7px; }
.color-field input[type=color] { padding: 4px; }
.logo-upload-row { display: flex; align-items: center; gap: 16px; }
.logo-preview { width: 84px; height: 84px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--border); border-radius: 18px; background: #0b0c10; }
.logo-preview img { max-width: 80%; max-height: 80%; object-fit: contain; }
.system-card { margin-top: 30px; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; min-width: 300px; max-width: min(430px, calc(100vw - 30px)); padding: 14px 16px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--border-strong); border-radius: 15px; background: rgba(25,28,36,.96); box-shadow: var(--shadow); backdrop-filter: blur(16px); transform: translateY(24px); opacity: 0; pointer-events: none; transition: .25s ease; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: rgba(52,211,153,.12); color: var(--success); font-weight: 900; }
.toast strong, .toast div span { display: block; }
.toast strong { font-size: 12px; }
.toast div span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.toast.error > span { color: var(--danger); background: rgba(251,113,133,.1); }

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 16% 15%, color-mix(in srgb, var(--brand-primary) 55%, transparent), transparent 32%), radial-gradient(circle at 88% 82%, color-mix(in srgb, var(--brand-accent) 12%, transparent), transparent 24%), #0b0c10; }
.auth-shell { width: min(1120px, 100%); min-height: 680px; display: grid; grid-template-columns: 1.12fr .88fr; overflow: hidden; border: 1px solid var(--border); border-radius: 28px; background: rgba(15,16,21,.93); box-shadow: var(--shadow); }
.auth-shell-login { min-height: 620px; }
.auth-visual { padding: clamp(32px, 5vw, 64px); display: flex; flex-direction: column; border-right: 1px solid var(--border); background: linear-gradient(150deg, rgba(255,255,255,.035), transparent 45%); }
.auth-copy { margin: auto 0; max-width: 610px; }
.auth-copy h1 { margin: 13px 0 16px; font-size: clamp(38px, 5.1vw, 65px); line-height: 1.02; letter-spacing: -.06em; }
.auth-copy p { margin: 0; max-width: 560px; color: var(--muted); font-size: 15px; line-height: 1.75; }
.feature-row { display: flex; flex-wrap: wrap; gap: 8px; }
.feature-row span { padding: 8px 11px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: 10px; }
.display-quick-link { min-height: 55px; display: flex; align-items: center; justify-content: space-between; padding: 0 17px; border: 1px solid var(--border); border-radius: 14px; background: rgba(255,255,255,.025); color: var(--muted); font-size: 12px; }
.display-quick-link:hover { border-color: var(--border-strong); color: #fff; }
.display-quick-link strong { color: var(--brand-accent); font-size: 18px; }
.auth-card { padding: clamp(30px, 4.5vw, 54px); display: flex; flex-direction: column; justify-content: center; background: #12141a; }
.auth-card-compact { padding-inline: clamp(32px, 5vw, 70px); }
.auth-card-header { margin-bottom: 24px; }
.auth-card-header h2 { margin: 10px 0 7px; font-size: 27px; letter-spacing: -.04em; }
.auth-card-header p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.step-pill { display: inline-flex; min-height: 27px; align-items: center; padding: 0 10px; border: 1px solid color-mix(in srgb, var(--brand-accent) 22%, transparent); border-radius: 999px; color: var(--brand-accent); background: color-mix(in srgb, var(--brand-accent) 7%, transparent); font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.stack-form { display: grid; }
.stack-form .field { margin-bottom: 13px; }
.alert { margin-bottom: 18px; padding: 12px 14px; border-radius: 11px; font-size: 11px; line-height: 1.5; }
.alert-error { color: #fecdd3; border: 1px solid rgba(251,113,133,.2); background: rgba(251,113,133,.08); }
.auth-footnote { margin: 17px 0 0; color: var(--muted-2); font-size: 10px; line-height: 1.6; text-align: center; }

@media (max-width: 1180px) {
  .operation-grid { grid-template-columns: 1fr; }
  .setlist-layout { grid-template-columns: 1fr; }
  .block-editor-panel { position: static; }
  .control-stack { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { position: sticky; height: auto; padding: 11px 15px; flex-direction: row; align-items: center; gap: 14px; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar-brand { padding: 0; }
  .sidebar-brand span { display: none; }
  .sidebar-nav { flex: 1; display: flex; justify-content: center; overflow-x: auto; }
  .nav-item { width: auto; min-width: 105px; justify-content: center; padding: 0 12px; }
  .sidebar-footer { margin: 0; }
  .connection-card, .sidebar-logout { display: none; }
  .topbar { top: 71px; padding: 15px 20px; }
  .workspace { padding: 24px 20px; }
  .two-column-grid { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual { min-height: 400px; border-right: 0; border-bottom: 1px solid var(--border); }
}

@media (max-width: 680px) {
  .auth-page { padding: 0; place-items: stretch; }
  .auth-shell { min-height: 100vh; border: 0; border-radius: 0; }
  .auth-visual { min-height: 330px; padding: 28px 24px; }
  .auth-copy h1 { font-size: 38px; }
  .auth-card { padding: 30px 24px; }
  .sidebar { overflow-x: auto; }
  .sidebar-brand { display: none; }
  .sidebar-nav { justify-content: flex-start; }
  .nav-item { min-width: 92px; flex-direction: column; gap: 2px; font-size: 9px; }
  .nav-icon { height: 20px; }
  .topbar { top: 71px; min-height: 76px; padding: 14px 15px; }
  .topbar-kicker, .live-pill { display: none; }
  .topbar h1 { font-size: 22px; }
  .button-secondary { padding-inline: 11px; }
  .workspace { padding: 20px 12px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .panel { padding: 15px; border-radius: 16px; }
  .control-stack { grid-template-columns: 1fr; }
  .mode-switcher { grid-template-columns: repeat(2, 1fr); }
  .current-block-songs { grid-template-columns: 1fr; }
  .block-editor-actions { align-items: stretch; flex-direction: column; }
  .block-editor-actions > div { display: grid; grid-template-columns: 1fr 1fr; }
  .block-nav-controls { grid-template-columns: 1fr; }
  .time-fields { grid-template-columns: repeat(3, 1fr); }
  .time-fields .button { grid-column: 1 / -1; }
  .preset-row { grid-template-columns: repeat(5, minmax(52px, 1fr)); overflow-x: auto; }
  .message-options { grid-template-columns: 1fr; }
  .message-footer { align-items: flex-start; flex-direction: column; }
  .message-footer > div { width: 100%; }
  .message-footer .button { flex: 1; }
  .color-grid { grid-template-columns: 1fr; }
  .toast { right: 15px; bottom: 15px; min-width: 0; }
}

/* StageFlow Live v1.2 — operação rápida, usuários e responsividade */
.sidebar-user { min-width: 0; padding: 11px 12px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 14px; background: rgba(255,255,255,.02); }
.sidebar-user > div:last-child { min-width: 0; }
.sidebar-user strong, .sidebar-user span { display: block; }
.sidebar-user strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.sidebar-user span { margin-top: 3px; color: var(--muted-2); font-size: 9px; }
.user-avatar { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid color-mix(in srgb,var(--brand-accent) 22%,transparent); border-radius: 10px; background: color-mix(in srgb,var(--brand-primary) 34%,var(--surface-2)); color: var(--brand-accent); font-size: 12px; font-weight: 900; text-transform: uppercase; }
.user-avatar-large { width: 42px; height: 42px; border-radius: 12px; font-size: 15px; }

.operation-block-current { min-height: 86px; padding: 15px 16px; display: flex; flex-direction: column; justify-content: center; border: 1px solid color-mix(in srgb,var(--brand-accent) 18%,var(--border)); border-radius: 14px; background: radial-gradient(circle at 10% 20%, color-mix(in srgb,var(--brand-primary) 34%,transparent), transparent 50%), #0e1015; }
.operation-block-current span { color: var(--brand-accent); font-size: 9px; font-weight: 900; letter-spacing: .17em; }
.operation-block-current strong { margin-top: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(21px,2.2vw,31px); line-height: 1; letter-spacing: -.04em; }
.operation-block-select { margin: 13px 0 0; }
.operation-block-select select { cursor: pointer; }
.operation-block-actions { display: grid; grid-template-columns: .9fr 1.35fr .9fr; gap: 8px; }
.operation-step-button { min-width: 0; gap: 7px; }
.operation-step-button span { color: var(--brand-accent); font-size: 18px; line-height: 1; }
.operation-step-button strong { font-size: 11px; }

.settings-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; align-items: start; }
.new-user-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; align-items: end; }
.new-user-grid .field:nth-child(3) { grid-column: 1 / 2; }
.new-user-button { min-height: 45px; margin-bottom: 15px; }
.user-role-hint { margin-top: 2px; }
.user-role-hint strong { color: var(--text); }
.user-list { display: grid; gap: 8px; }
.user-list-row { min-width: 0; min-height: 58px; padding: 9px 10px; display: grid; grid-template-columns: auto minmax(0,1fr) auto auto; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,.022); }
.user-list-info { min-width: 0; }
.user-list-info strong, .user-list-info span { display: block; }
.user-list-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.user-list-info span { margin-top: 3px; color: var(--muted-2); font-size: 9px; }
.user-role-badge, .account-role-badge { min-height: 24px; display: inline-flex; align-items: center; padding: 0 8px; border: 1px solid rgba(96,165,250,.18); border-radius: 999px; background: rgba(96,165,250,.06); color: #93c5fd; font-size: 8px; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.user-role-badge.admin, .account-role-badge { border-color: color-mix(in srgb,var(--brand-accent) 20%,transparent); background: color-mix(in srgb,var(--brand-accent) 6%,transparent); color: var(--brand-accent); }
.user-remove-button { min-height: 30px; padding: 0 8px; border: 1px solid rgba(251,113,133,.16); border-radius: 8px; background: rgba(251,113,133,.055); color: var(--danger); font-size: 9px; cursor: pointer; }
.user-remove-button:hover { border-color: rgba(251,113,133,.34); background: rgba(251,113,133,.1); }
.current-user-label { color: var(--muted-2); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.account-user-row { margin-bottom: 18px; padding: 11px 12px; display: flex; align-items: center; gap: 11px; border: 1px solid var(--border); border-radius: 13px; background: rgba(255,255,255,.022); }
.account-user-row strong, .account-user-row span { display: block; }
.account-user-row strong { font-size: 12px; }
.account-user-row span { margin-top: 3px; color: var(--muted-2); font-size: 9px; }
.logo-upload-actions { min-width: 0; }

@media (max-width: 1360px) {
  .settings-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .account-panel { grid-column: 1 / -1; }
}

@media (max-width: 1180px) {
  .operation-block-panel { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .sidebar-user { display: none; }
  .settings-grid { grid-template-columns: 1fr; }
  .account-panel { grid-column: auto; }
  .topbar-actions { flex: 0 0 auto; }
}

@media (max-width: 680px) {
  html, body { overflow-x: hidden; }
  .workspace { width: 100%; }
  .operation-grid, .setlist-layout, .settings-grid, .two-column-grid { width: 100%; min-width: 0; }
  .display-frame { border-radius: 12px; }
  .panel-heading { min-height: 0; margin-bottom: 14px; }
  .operation-block-current { min-height: 76px; padding: 13px 14px; }
  .operation-block-current strong { font-size: 24px; }
  .new-user-grid { grid-template-columns: 1fr; }
  .new-user-grid .field:nth-child(3) { grid-column: auto; }
  .new-user-button { width: 100%; margin-bottom: 15px; }
  .logo-upload-row { align-items: flex-start; }
  .current-block-preview { min-height: 280px; padding: 20px; }
  .section-heading .button { width: 100%; }
  .topbar-actions .button { min-height: 42px; }
}

@media (max-width: 520px) {
  .sidebar { padding-inline: 8px; gap: 7px; }
  .sidebar-nav { gap: 5px; }
  .nav-item { min-width: 88px; padding-inline: 8px; }
  .topbar { min-height: 70px; padding: 11px 12px; gap: 10px; }
  .topbar h1 { font-size: 19px; }
  .topbar-actions .button { padding-inline: 10px; font-size: 10px; }
  .workspace { padding: 16px 9px 26px; }
  .section-heading { margin-bottom: 16px; }
  .section-heading h2 { font-size: 28px; }
  .section-heading p { font-size: 12px; }
  .panel { padding: 13px; }
  .mode-button { min-height: 58px; }
  .timer-readout { font-size: clamp(38px,13vw,58px); }
  .timer-primary-actions { grid-template-columns: 1fr 1fr; }
  .timer-primary-actions .button { min-width: 0; padding-inline: 8px; }
  .preset-row { display: flex; overflow-x: auto; padding-bottom: 3px; }
  .preset-row button { min-width: 58px; flex: 0 0 auto; }
  .operation-block-actions { grid-template-columns: 1fr 1fr; }
  #operationBlockGo { grid-column: 1 / -1; grid-row: 1; }
  #operationPrevBlock { grid-column: 1; grid-row: 2; }
  #operationNextBlock { grid-column: 2; grid-row: 2; }
  .message-footer > div { display: grid; grid-template-columns: 1fr 1fr; }
  .user-list-row { grid-template-columns: auto minmax(0,1fr) auto; }
  .user-role-badge { display: none; }
  .logo-upload-row { flex-direction: column; }
  .logo-upload-actions, .logo-upload-actions .button { width: 100%; }
  .block-editor-actions > div, .block-editor-actions > .button { width: 100%; }
  .block-editor-actions > .button { min-height: 44px; }
  .block-nav-button { min-height: 62px; }
  .saved-block-card { flex-basis: min(78vw, 250px); }
}

@media (max-width: 380px) {
  .nav-item { min-width: 82px; font-size: 8px; }
  .topbar-actions .button { max-width: 102px; }
  .mode-switcher { gap: 6px; }
  .time-fields { gap: 5px; }
  .time-fields input { padding-inline: 4px; }
  .message-footer > div { grid-template-columns: 1fr; }
  .color-field { grid-template-columns: 42px minmax(0,1fr); }
}


/* StageFlow Live v1.2.1 — preview 16:9 real e navegação móvel */
.button-label-mobile { display: none; }

/* O preview sempre simula um monitor Full HD. O iframe é reduzido por JS,
   em vez de recalcular o layout do display com a largura do celular. */
.display-frame iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 1920px;
  height: 1080px;
  max-width: none;
  opacity: 0;
  transform-origin: 0 0;
  will-change: transform;
  transition: opacity .12s ease;
}
.display-frame.preview-ready iframe { opacity: 1; }

@media (max-width: 900px) {
  html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
  .app-shell { display: block; min-width: 0; }
  .app-main { min-width: 0; padding-bottom: calc(78px + env(safe-area-inset-bottom)); }

  /* No celular a navegação vira uma barra inferior, como app. Isso evita
     o cabeçalho sticky duplo que o Safari estava sobrepondo. */
  .sidebar {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    min-height: 70px;
    padding: 7px max(8px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    display: block;
    overflow: visible;
    border-right: 0;
    border-bottom: 0;
    border-top: 1px solid var(--border-strong);
    background: rgba(13,14,18,.96);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 -14px 34px rgba(0,0,0,.34);
    z-index: 1000;
  }
  .sidebar-brand, .sidebar-footer { display: none !important; }
  .sidebar-nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 6px;
    overflow: visible;
  }
  .nav-item {
    width: 100%;
    min-width: 0;
    min-height: 54px;
    padding: 5px 4px;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    border-radius: 12px;
    font-size: 10px;
    text-align: center;
  }
  .nav-icon { width: 22px; height: 21px; font-size: 16px; }
  .nav-item.active { box-shadow: inset 0 -2px 0 var(--brand-accent); }

  .topbar {
    top: 0;
    min-height: 68px;
    padding: 12px 15px;
    gap: 10px;
    z-index: 900;
  }
  .topbar > div:first-child { min-width: 0; }
  .topbar h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-actions { min-width: 0; flex: 0 0 auto; }
  .workspace { width: 100%; max-width: 100%; padding: 22px 14px 28px; }

  .operation-grid, .control-stack, .setlist-layout, .settings-grid, .two-column-grid,
  .preview-panel, .panel { min-width: 0; width: 100%; max-width: 100%; }
  .display-frame { width: 100%; max-width: 100%; aspect-ratio: 16 / 9; }
}

@media (max-width: 680px) {
  .topbar { min-height: 62px; padding: 10px 12px; }
  .topbar h1 { font-size: 20px; }
  .workspace { padding: 18px 10px 24px; }
  .section-heading { gap: 10px; }
  .section-heading h2 { font-size: clamp(27px, 8vw, 34px); }
  .panel { padding: 13px; }
  .preview-panel .panel-heading { align-items: center; }
  .preview-panel .panel-heading h3 { font-size: 18px; }
  .display-frame { border-radius: 12px; }
  .mode-switcher { margin-top: 12px; gap: 7px; }
  .mode-button { min-width: 0; min-height: 58px; }
  .mode-button span { font-size: 13px; }
  .operation-block-actions { gap: 7px; }
  .preset-row { -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .preset-row::-webkit-scrollbar { display: none; }
}

@media (max-width: 520px) {
  .button-label-desktop { display: none; }
  .button-label-mobile { display: inline; }
  .topbar-actions .button { min-width: 88px; min-height: 40px; padding-inline: 10px; font-size: 10px; }
  .workspace { padding-inline: 9px; }
  .section-heading p { max-width: 100%; }
  .panel-heading { gap: 10px; }
  .text-link { flex: 0 0 auto; font-size: 10px; }
  .mode-switcher { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .operation-block-current strong { font-size: clamp(21px, 7vw, 27px); }
}
