.studio-view-switch{position:fixed;left:max(32px,env(safe-area-inset-left));bottom:max(18px,env(safe-area-inset-bottom));display:flex;align-items:center;gap:4px;padding:5px;border:1px solid #e4c9c4;border-radius:18px;background:rgba(255,253,249,.96);box-shadow:0 4px 20px #29130d26;backdrop-filter:blur(12px);z-index:40}
.studio-view-switch button{display:grid;place-items:center;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border:0;border-radius:12px;color:#e85258;background:transparent;cursor:pointer;box-shadow:none}
.studio-view-switch button[aria-pressed=true]{color:#fff;background:#e85258;cursor:default}
.studio-view-switch button:hover:not([aria-pressed=true]){background:#ffebe7}
.studio-view-switch button:focus-visible{outline:3px solid #e85258;outline-offset:2px}
.studio-view-switch svg{display:block;pointer-events:none}
.studio-session-check .studio-view-switch,.studio-entry-loading .studio-view-switch{visibility:hidden}
#timeline-error-chat .error-chat-toggle{position:relative;display:flex;align-items:center;justify-content:center;gap:0;box-sizing:border-box;width:54px;height:54px;min-height:54px;padding:0;border-radius:50%}
#timeline-error-chat .error-chat-toggle>svg{display:block;flex:none;margin:0;width:24px;height:24px}
#timeline-error-chat .error-chat-toggle>span:not(:empty){position:absolute;top:-4px;right:-5px;min-width:22px;height:22px;display:grid;place-items:center;margin:0;padding:0 5px;border:1px solid #e85258;border-radius:999px;font:700 11px/1 Poppins,system-ui,sans-serif;background:#fff;color:#e85258}
@media(max-width:1000px){
  .studio-view-switch{left:auto;right:max(20px,env(safe-area-inset-right));bottom:max(12px,env(safe-area-inset-bottom))}
  .studio-timeline-view .studio-view-switch{right:calc(max(20px,env(safe-area-inset-right)) + 66px)}
  .studio-view-switch.with-composer{bottom:calc(var(--studio-composer-height,64px) + max(18px,env(safe-area-inset-bottom)) + 12px)}
  #chat{margin-bottom:calc(var(--studio-composer-height,64px) + 110px)}
}
#timeline-error-chat{display:flex;flex-direction:column-reverse;align-items:flex-end}
#timeline-error-chat[hidden]{display:none}

/* Mobile controls occupy their own row, outside the scrolling footage area. */
.studio-mobile-toolbar{display:none}
@media(max-width:700px){
  body.studio-timeline-view{--studio-mobile-toolbar-height:calc(66px + env(safe-area-inset-bottom));height:100dvh;overflow:hidden;padding-top:env(safe-area-inset-top)}
  .studio-timeline-view .timeline-app{height:calc(100dvh - var(--studio-mobile-toolbar-height) - env(safe-area-inset-top) - 12px);overflow-y:auto;overscroll-behavior-y:contain;scroll-padding:12px;scrollbar-width:thin}
  .studio-timeline-view .studio-mobile-toolbar{display:block;position:fixed;left:0;right:0;bottom:0;height:var(--studio-mobile-toolbar-height);background:#fffaf5;border-top:1px solid #e6d8cd;box-shadow:0 -3px 16px #29130d0a;z-index:35;pointer-events:none}
  .studio-view-switch{padding:2px;gap:2px;border-radius:15px;box-shadow:0 2px 10px #29130d16}
  .studio-view-switch button{width:44px;height:44px;min-width:44px;min-height:44px;border-radius:11px}
  .studio-view-switch svg{width:20px;height:20px}
  .studio-timeline-view .studio-view-switch{left:auto;right:calc(max(20px,env(safe-area-inset-right)) + 62px);bottom:calc(8px + env(safe-area-inset-bottom))}
  .studio-timeline-view #timeline-error-chat{right:max(20px,env(safe-area-inset-right));bottom:calc(8px + env(safe-area-inset-bottom))}
  #timeline-error-chat .error-chat-toggle{width:50px;height:50px;min-height:50px;box-shadow:0 2px 10px #29130d16}
  #timeline-error-chat .error-chat-toggle>svg{width:22px;height:22px}
  #timeline-error-chat .error-chat-toggle>span:not(:empty){top:-3px;right:-3px;min-width:19px;height:19px;font-size:10px}
  .studio-timeline-view> .api-activity{top:auto;bottom:calc(15px + env(safe-area-inset-bottom));left:max(12px,env(safe-area-inset-left));right:calc(max(20px,env(safe-area-inset-right)) + 168px);max-width:none;justify-content:center;gap:6px;padding:8px 2px;border:0;box-shadow:none;background:transparent;font-size:11px;line-height:20px;white-space:nowrap}
  .studio-timeline-view> .api-activity .api-activity-spinner{width:14px;height:14px}
  .studio-timeline-view #timeline-error-chat section{max-height:calc(100dvh - var(--studio-mobile-toolbar-height) - env(safe-area-inset-top) - 24px)}
}

/* An empty count must not take a layout slot beside/below the bell. */
#timeline-error-chat .error-chat-toggle>span:empty{display:none}
