/* SLIBLE Studio — a progressive skin, independent from canvas/export rendering. */
:root:not([data-experience="landing"]) {
    --accent: #ff873e;
    --accent-hover: #f47728;
    --accent-soft: #fff1e7;
    --accent-ink: #9a3c0c;
    --app-bg: #f4f4f5;
    --surface: #ffffff;
    --surface-raised: #ffffff;
    --surface-muted: #f4f4f5;
    --surface-hover: #e9e9ec;
    --text: #232325;
    --text-secondary: #626269;
    --text-tertiary: #74747a;
    --border: rgba(35, 35, 35, .10);
    --border-strong: rgba(35, 35, 35, .22);
    --stage: #ededf0;
    --shadow-canvas: 0 24px 52px rgba(0, 0, 0, .19), 0 3px 12px rgba(0, 0, 0, .12);
}
:root[data-theme="dark"]:not([data-experience="landing"]) {
    --accent: #ff873e;
    --accent-hover: #ffad79;
    --accent-soft: #302116;
    --accent-ink: #ffb583;
    --app-bg: #0b0d12;
    --surface: #14171e;
    --surface-raised: #1e1e20;
    --surface-muted: #18181b;
    --surface-hover: #27272a;
    --text: #f5f5f7;
    --text-secondary: #b7b7bc;
    --text-tertiary: #97979f;
    --border: rgba(255, 255, 255, .13);
    --border-strong: rgba(255, 255, 255, .24);
    --stage: #0b0d12;
    --shadow-canvas: 0 24px 58px rgba(0, 0, 0, .5);
}
:root:not([data-experience="landing"]) body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.app-shell .topbar { padding-inline: 22px; background: var(--surface); box-shadow: none; }
.app-shell .brand h1 { font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 19px; letter-spacing: -.9px; }
.app-shell .brand h1::after { display: inline-block; width: 5px; height: 5px; margin-left: 3px; background: var(--accent); content: ''; }
.app-shell .brand p { font-size: 10px; margin-top: 5px; letter-spacing: .3px; }
.app-shell .icon-button { border-radius: 10px; width: 36px; height: 36px; }
.app-shell .present-button { background: var(--text); color: var(--surface); border-color: var(--text); }
.app-shell .present-button:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--surface); }
.app-shell .autosave-status { border: 0; background: var(--surface-muted); }
.app-shell .mode-tabs { padding: 12px; gap: 6px; background: var(--surface); }
.app-shell .mode-tab { border: 1px solid transparent; height: 40px; font-size: 11px; }
.app-shell .mode-tab.active { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 24%, transparent); box-shadow: none; }
.app-shell .configuration-panel-header { background: var(--surface); }
.app-shell .configuration-panel-header strong { font-size: 12px; letter-spacing: .25px; }
.app-shell .editor-section h2, .app-shell .right-panel-heading h2 { font-size: 12px; letter-spacing: -.1px; }
.app-shell .right-panel-heading { background: var(--surface); }
.app-shell .control-group input:not([type="color"]):not([type="range"]):not([type="file"]),
.app-shell .control-group select, .app-shell .control-group textarea { border-radius: 9px; background: var(--surface-raised); }
.app-shell .field-note { line-height: 1.7; }
.app-shell .element-library-grid button { border-radius: 10px; background: var(--surface-muted); }
.app-shell .element-library-icon { background: var(--surface-raised); color: var(--text); border-color: var(--border); }
.app-shell .element-library-grid button:hover .element-library-icon { background: var(--accent-soft); color: var(--accent-ink); }
.app-shell .template-card { border-radius: 10px; }
.app-shell .template-card > span { padding: 9px 8px; font-size: 11px; }
.app-shell .template-element-item { background: var(--surface-raised); border-radius: 8px; }
.app-shell .template-element-item.is-selected { background: var(--accent-soft); }
.app-shell .smart-content-section:has(textarea:disabled) .control-group { display: none; }
.app-shell .smart-content-section:has(textarea:disabled) { background: var(--surface-muted); }
.app-shell .stage-panel { position: relative; }
.app-shell .stage-header { padding: 10px 16px; gap: 8px; background: var(--surface-muted); }
.app-shell .stage-actions { flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.app-shell .stage-header .save-status { display: none; }
.app-shell .stage-header h2 { font-size: 12px; }
.app-shell .canvas-container { padding-bottom: 78px; background-image: radial-gradient(var(--border) .9px, transparent .9px); background-size: 18px 18px; }
.app-shell .canvas-frame { border-radius: 3px; }
.app-shell .filmstrip-panel { background: var(--surface); }
.app-shell .filmstrip-header { background: var(--surface); }
.app-shell .slide-item { border-radius: 10px; }
.app-shell .panel-resizer { background: color-mix(in srgb, var(--border) 38%, var(--surface)); }
.app-shell .panel-resizer:hover, .app-shell .panel-resizer.is-resizing { background: var(--accent); }
.studio-command-trigger { display: flex; align-items: center; gap: 9px; height: 36px; padding: 0 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-muted); color: var(--text-secondary); font-size: 11px; }
.studio-command-trigger svg { width: 15px; height: 15px; }
.studio-command-trigger:hover { border-color: var(--accent); color: var(--accent-ink); }
.studio-command-trigger kbd { margin-left: 8px; font: 10px monospace; opacity: .8; }
.studio-focus-button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.studio-dock { position: absolute; z-index: 5; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; gap: 5px; padding: 6px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: 0 5px 20px rgba(0, 0, 0, .1); }
.studio-dock button { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: transparent; color: var(--text-secondary); transition: color .15s, background .15s; }
.studio-dock button svg { width: 19px; height: 19px; }
.studio-dock button:hover { background: var(--accent-soft); color: var(--accent-ink); }
.studio-dock button:last-child { background: var(--text); color: var(--surface); }
.studio-dock button:last-child:hover { background: var(--accent-ink); }
.app-shell.studio-focus { grid-template-rows: 64px minmax(0, 1fr); }
.studio-focus .workspace { grid-template-columns: minmax(0, 1fr); }
.studio-focus .editor-panel, .studio-focus .layers-sidebar, .studio-focus .properties-panel,
.studio-focus .panel-resizer, .studio-focus .filmstrip-panel { display: none; }
.studio-focus .stage-panel { min-height: 0; }
.studio-template-search { margin: 0 0 12px; }
.studio-template-search label { display: block; margin-bottom: 7px; color: var(--text-secondary); font-size: 11px; }
.studio-template-search input { width: 100%; height: 38px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-muted); padding: 0 11px; font-size: 12px; }
.studio-template-status { font-size: 10px; color: var(--text-secondary); margin-top: 6px; }
.studio-template-status:empty { display: none; }
.studio-command-dialog { position: fixed; inset: 0; width: min(560px, calc(100vw - 28px)); max-height: calc(100dvh - 40px); margin: auto; overflow: hidden; padding: 0; border: 1px solid var(--border-strong); border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: 0 28px 90px rgba(0, 0, 0, .3); }
.studio-command-dialog::backdrop { background: rgba(16, 20, 23, .55); backdrop-filter: blur(5px); }
.studio-command-heading { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px 16px; }
.studio-command-eyebrow { display: block; margin-bottom: 5px; color: var(--accent-ink); font-size: 9px; font-weight: 700; letter-spacing: 1.8px; }
.studio-command-heading h2 { font-size: 19px; letter-spacing: -.5px; }
.studio-command-close { width: 32px; height: 32px; border-radius: 9px; background: var(--surface-muted); font-size: 24px; color: var(--text-secondary); }
.studio-command-search { display: flex; align-items: center; gap: 10px; margin: 0 18px 12px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface-raised); }
.studio-command-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.studio-command-search svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--text-secondary); }
.studio-command-search input { width: 100%; min-width: 0; height: 46px; padding: 0; border: 0; background: transparent; font-size: 13px; }
.studio-command-search input:focus { outline: none; }
.studio-command-results { max-height: min(380px, calc(100dvh - 250px)); overflow-y: auto; overscroll-behavior: contain; padding: 0 10px 12px; }
.studio-command-result { display: flex; min-height: 43px; gap: 12px; align-items: center; justify-content: space-between; padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 12px; }
.studio-command-result[aria-selected="true"] { background: var(--accent-soft); color: var(--accent-ink); }
.studio-command-result small { font-size: 9px; color: var(--text-secondary); flex-shrink: 0; }
.studio-command-empty { padding: 24px; color: var(--text-secondary); font-size: 12px; line-height: 1.6; }
.studio-command-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 24px; border-top: 1px solid var(--border); color: var(--text-secondary); font-size: 10px; background: var(--surface-muted); }
.studio-command-footer kbd { padding: 3px 5px; border: 1px solid var(--border); border-radius: 4px; font-size: 10px; }
@media (max-width: 1200px) {
    .studio-command-trigger kbd { display: none; }
    .app-shell .topbar { padding-inline: 14px; }
    .app-shell .topbar-actions { gap: 6px; }
    .app-shell .stage-header > div:first-child { display: none; }
    .app-shell .stage-header { justify-content: center; }
}
@media (max-width: 840px) {
    .studio-command-trigger span { display: none; }
    .studio-command-trigger { width: 34px; padding: 0; justify-content: center; }
    .app-shell .topbar { padding-inline: 10px; }
    .app-shell .topbar-actions { gap: 4px; }
    .app-shell .icon-button { width: 32px; height: 32px; border-radius: 8px; }
    .app-shell .brand h1 { font-size: 15px; }
    .app-shell .topbar-actions > a.icon-button { display: none; }
    .app-shell .stage-panel { min-height: 420px; }
    .app-shell.studio-focus { display: grid; height: 100dvh; min-height: 0; grid-template-rows: 60px minmax(0, 1fr); }
    .studio-focus .workspace { min-height: 0; }
    .app-shell.studio-focus .stage-panel { height: 100%; min-height: 0; }
    .studio-focus .canvas-container { min-height: 0; }
    .app-shell .canvas-container { padding-bottom: 76px; }
    .studio-dock { bottom: 14px; }
}
@media (max-width: 440px) {
    .app-shell .ui-language-control { width: 76px; grid-template-columns: minmax(0, 1fr) 10px; padding-inline: 6px; }
    .app-shell .ui-language-icon { display: none; }
    .app-shell .autosave-status { padding-inline: 4px; }
    .app-shell .topbar { gap: 4px; }
    .app-shell .stage-actions { gap: 4px; }
    .studio-command-heading { padding-inline: 18px; }
    .studio-command-heading h2 { font-size: 17px; }
    .studio-command-footer { padding-inline: 18px; }
}
@media (prefers-reduced-motion: reduce) {
    .app-shell *, .studio-command-dialog * { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* On phones, split branding and instruments instead of shrinking or clipping controls. */
@media (max-width: 440px) {
    .app-shell .topbar { height: 88px; padding: 8px 12px; flex-direction: column; align-items: stretch; justify-content: center; gap: 8px; }
    .app-shell .topbar-actions { width: 100%; justify-content: space-between; gap: 3px; }
    .app-shell .autosave-status { display: none; }
    .app-shell .icon-button, .studio-command-trigger { width: 36px; height: 36px; flex: 0 0 36px; }
    .app-shell .mode-tabs { top: 88px; }
    .app-shell.studio-focus { grid-template-rows: 88px minmax(0, 1fr); }
    .app-shell .export-panel { top: 86px; }
}

.app-shell .text-button { color: var(--accent-ink); }

/* Prism instruments: precision, neutral surfaces and a quieter canvas surround. */
.app-shell .topbar { border-bottom-color: var(--border); box-shadow: 0 2px 14px rgba(0, 0, 0, .025); }
.app-shell .brand h1 { font-family: 'Raleway', sans-serif; font-weight: 800; letter-spacing: -.7px; }
.app-shell .brand h1::after { width: 6px; height: 6px; border-radius: 2px; margin-left: 4px; }
.app-shell .brand p { color: var(--text-secondary); font-size: 10px; }
.app-shell .mode-tabs { background: var(--surface-muted); padding: 10px; gap: 4px; }
.app-shell .mode-tab { font-family: inherit; font-size: 12px; font-weight: 600; }
.app-shell .mode-tab.active { background: var(--surface-raised); border-color: var(--border); color: var(--text); box-shadow: 0 2px 6px rgba(0, 0, 0, .07); }
.app-shell .mode-tab.active svg { color: var(--accent-ink); }
.app-shell .editor-section h2, .app-shell .right-panel-heading h2 { font-family: inherit; font-size: 12px; font-weight: 650; }
.app-shell .section-status { font-family: inherit; font-size: 10px; color: var(--text-secondary); }
.app-shell .stage-header { background: var(--surface-muted); padding-block: 12px; }
.app-shell .stage-header .section-kicker { color: var(--text-secondary); font-size: 9px; letter-spacing: .10em; }
.app-shell .stage-actions .icon-button { background: var(--surface-raised); box-shadow: 0 2px 4px rgba(0, 0, 0, .025); }
.app-shell .canvas-container { background-color: var(--stage); background-image: radial-gradient(color-mix(in srgb, var(--text-tertiary) 35%, transparent) .7px, transparent .7px); background-size: 22px 22px; }
.app-shell .canvas-frame { border-radius: 5px; box-shadow: var(--shadow-canvas); }
.app-shell .control-group input:not([type='color']):not([type='range']):not([type='file']), .app-shell .control-group select, .app-shell .control-group textarea { border-color: var(--border-strong); font-family: inherit; font-size: 12px; }
.app-shell .segmented-control { background: var(--surface-muted); border-color: var(--border); }
.app-shell .segmented-control button.active { background: var(--surface-raised); color: var(--text); box-shadow: 0 2px 5px rgba(0, 0, 0, .08); }
.app-shell .element-library-grid button { border-color: var(--border); transition: background-color 180ms ease, border-color 180ms ease; }
.app-shell .element-library-grid button:hover { background: var(--surface-raised); border-color: var(--border-strong); }
.app-shell .element-library-icon { border-radius: 8px; }
.app-shell .template-card { border-color: var(--border); border-radius: 12px; box-shadow: 0 2px 6px rgba(0, 0, 0, .03); }
.app-shell .template-card:hover { box-shadow: 0 5px 15px rgba(0, 0, 0, .09); }
.app-shell .template-element-item { padding-block: 10px; border-color: var(--border); }
.app-shell .template-element-item.is-selected { box-shadow: inset 3px 0 0 var(--accent); }
.app-shell .filmstrip-panel { box-shadow: 0 -2px 14px rgba(0, 0, 0, .025); }
.app-shell .slide-item { padding: 6px; border-radius: 12px; box-shadow: 0 2px 7px rgba(0, 0, 0, .04); }
.app-shell .slide-item.active { border-color: var(--accent); background: var(--surface); }
.studio-command-trigger { background: var(--surface-muted); font-family: inherit; border-radius: 10px; }
.studio-dock { background: color-mix(in srgb, var(--surface) 95%, transparent); border-radius: 16px; padding: 7px; gap: 5px; box-shadow: 0 12px 28px rgba(0, 0, 0, .12), 0 1px 3px rgba(0, 0, 0, .08); }
.studio-command-dialog { border-radius: 20px; }
.studio-command-heading h2 { font-family: 'Raleway', sans-serif; font-weight: 700; font-size: 22px; }
.studio-command-eyebrow { letter-spacing: .14em; }
.app-shell .creative-studio-section { background: var(--surface); }
.app-shell .creative-tabs { border-color: var(--border); padding: 4px; gap: 3px; }
.app-shell .creative-tab[aria-selected='true'] { background: var(--surface-raised); border-color: var(--border); color: var(--text); box-shadow: 0 2px 5px rgba(0, 0, 0, .07); }
.app-shell .creative-card { min-height: 54px; border-radius: 10px; border-color: var(--border); }
.app-shell .creative-card-details strong { font-family: inherit; font-size: 10px; }
.app-shell .creative-card-preview { min-height: 40px; border-radius: 7px; }
.app-shell .bible-studio-block { background: var(--surface-muted); border-color: var(--border); box-shadow: 0 2px 8px rgba(0, 0, 0, .025); }
@media (max-width: 840px) {
    .app-shell .stage-header { padding: 10px 12px; }
    .app-shell .mode-tabs { padding: 10px; }
}

.app-shell .canvas-zoom-control, .app-shell .canvas-history-control { background: var(--surface-raised); border-color: var(--border); }
.app-shell .canvas-zoom-control button, .app-shell .canvas-history-control button { background: transparent; }
.app-shell .canvas-zoom-control button:disabled, .app-shell .canvas-history-control button:disabled { background: var(--surface-muted); }
.app-shell .autosave-status { transition: border-color 160ms ease; }
.app-shell .autosave-status[data-state='saved'] { color: #177539; background: #eff8f2; }
.app-shell .autosave-status[data-state='offline'] { color: #995700; }
:root[data-theme='dark'] .app-shell .autosave-status[data-state='saved'] { color: #6ce4a1; background: #203b2d; }
:root[data-theme='dark'] .app-shell .autosave-status[data-state='offline'] { color: #ffc777; }
:root[data-theme='dark'] .app-shell .autosave-status[data-state='error'] { color: #ff9a9a; }
