body[data-page="dashboard"] {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 153, 0, .11), transparent 34%),
    radial-gradient(circle at 82% 12%, rgba(90, 167, 255, .09), transparent 30%),
    linear-gradient(145deg, var(--sai-bg), var(--sai-bg-2));
  color: var(--sai-text);
}

body[data-page="dashboard"] *,
body[data-page="dashboard"] *::before,
body[data-page="dashboard"] *::after {
  box-sizing: border-box;
}

.sai-dashboard-shell {
  width: 100%;
  height: 100vh;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 360px;
  gap: 12px;
  padding: 12px;
}

.sai-sidebar,
.sai-playground,
.sai-chat-panel {
  min-height: 0;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .032));
  backdrop-filter: blur(26px) saturate(170%);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
}

.sai-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  overflow: hidden;
}

.sai-sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
}

.sai-sidebar-brand img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
}

.sai-sidebar-brand span {
  display: grid;
  gap: 1px;
}

.sai-sidebar-brand strong {
  font-size: 14px;
  font-weight: 900;
}

.sai-sidebar-brand em {
  color: var(--sai-muted);
  font-size: 12px;
  font-style: normal;
}

.sai-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .055);
}

.sai-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--sai-orange);
  color: #fff;
  font-weight: 900;
}

.sai-user-card strong,
.sai-user-card small {
  display: block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sai-user-card small {
  margin-top: 2px;
  color: var(--sai-muted);
}

.sai-main-nav {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 10px 0;
}

.sai-main-nav button {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, .78);
  font-weight: 850;
  text-align: left;
  cursor: pointer;
}

.sai-main-nav button:hover,
.sai-main-nav button.sai-active {
  background: rgba(255, 255, 255, .09);
  color: #fff;
}

.sai-sidebar-bottom {
  flex: 0 0 auto;
  display: grid;
  gap: 4px;
}

.sai-sidebar-bottom a,
.sai-sidebar-bottom button {
  min-height: 22px;
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--sai-muted);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.sai-sidebar-bottom a::after {
  content: "↗";
  font-size: 11px;
  line-height: 1;
  transform: translateY(-2px);
}

.sai-sidebar-bottom a:hover,
.sai-sidebar-bottom button:hover {
  color: #fff;
}

.sai-playground,
.sai-chat-panel {
  position: relative;
  overflow: hidden;
}

.sai-frame {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: transparent;
}

.sai-chat-panel {
  display: grid;
  grid-template-rows: auto 1fr;
}

.sai-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
}

.sai-chat-head strong {
  color: #fff;
}

.sai-chat-head button {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-weight: 850;
  cursor: pointer;
}

body.sai-chat-fullscreen .sai-chat-panel {
  position: fixed;
  inset: 12px;
  z-index: 2147482000;
}

body.sai-chat-fullscreen .sai-playground,
body.sai-chat-fullscreen .sai-sidebar {
  pointer-events: none;
  filter: brightness(.55);
}

body.sai-modal-open::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2147481000;
  background: rgba(0, 0, 0, .58);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  pointer-events: none;
}

.sai-billing-loader {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, .58);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.sai-billing-loader.sai-open {
  display: grid;
}

.sai-billing-card {
  width: min(100%, 420px);
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 24px;
  border-radius: 10px;
  background: var(--sai-modal);
  text-align: center;
}

.sai-spinner {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 4px solid rgba(255, 255, 255, .16);
  border-top-color: #fff;
  animation: saiSpin .75s linear infinite;
}

.sai-home-panel {
  min-height: 100%;
  display: grid;
  align-content: center;
  gap: 16px;
  padding: 0;
}

.sai-home-panel h1 {
  margin: 0;
  font-size: clamp(36px, 5vw, 72px);
  line-height: .9;
}

.sai-home-panel p {
  margin: 0;
  max-width: 560px;
  color: var(--sai-muted);
  line-height: 1.55;
}

.sai-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 640px;
}

.sai-stats-grid article,
.sai-email-settings {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .07);
}

.sai-stats-grid span {
  color: var(--sai-soft);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.sai-stats-grid strong {
  color: var(--sai-orange);
  font-size: 34px;
}

.sai-stats-grid small {
  color: var(--sai-muted);
}

.sai-email-settings {
  max-width: 580px;
}

.sai-email-settings label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, .86);
}

.sai-email-settings button {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  background: var(--sai-orange);
  color: #fff;
  font-weight: 900;
}

@media (max-width: 1100px) {
  .sai-dashboard-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .sai-chat-panel {
    display: none;
  }

  body.sai-chat-fullscreen .sai-chat-panel {
    display: grid;
  }
}

@media (max-width: 760px) {
  body[data-page="dashboard"] {
    overflow: auto;
  }

  .sai-dashboard-shell {
    height: auto;
    min-height: 100vh;
    grid-template-columns: 1fr;
  }

  .sai-sidebar {
    min-height: 360px;
  }

  .sai-playground {
    min-height: 80vh;
  }
}

/* Dashboard startup loader */
.sai-dashboard-loading-active .sai-dashboard-shell[hidden] {
  display: none !important;
}

.sai-dashboard-loader {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 153, 0, .11), transparent 34%),
    radial-gradient(circle at 82% 12%, rgba(90, 167, 255, .09), transparent 30%),
    linear-gradient(145deg, var(--sai-bg), var(--sai-bg-2));
  color: #fff;
}

.sai-dashboard-loader[hidden] {
  display: none !important;
}

.sai-dashboard-loader-card {
  width: min(100%, 420px);
  min-height: 260px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  padding: 28px;
  border-radius: 10px;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  text-align: center;
}

.sai-dashboard-loader-card h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1;
  font-weight: 950;
}

.sai-dashboard-loader-card p {
  margin: 0;
  max-width: 260px;
  color: var(--sai-muted);
  font-size: 14px;
  line-height: 1.5;
}

.sai-dashboard-error-text {
  color: #ffb4bd !important;
}

/* v11 single-html mounts: no iframes/pages */
.sai-playground-mount,
.sai-chat-mount {
  width: 100%;
  height: 100%;
  overflow: auto;
  border: 0;
  background: transparent;
}

.sai-playground-mount > *,
.sai-chat-mount > * {
  max-width: 100%;
}

body.sai-chat-fullscreen .sai-chat-panel {
  position: fixed !important;
  inset: 14px !important;
  z-index: 2147483200 !important;
  width: auto !important;
  height: auto !important;
}

body.sai-chat-fullscreen .sai-chat-mount {
  height: calc(100vh - 96px) !important;
}

/* v0.2.7 dashboard data + floating AI chat widget */
.sai-dashboard-shell {
  grid-template-columns: 286px minmax(0, 1fr) !important;
}

.sai-chat-panel {
  display: none !important;
}

.sai-home-panel {
  min-height: 100%;
}

.sai-stats-grid {
  align-items: stretch;
}

.sai-chat-widget {
  position: fixed;
  right: 120px;
  bottom: 120px;
  z-index: 2147482500;
  color: #fff;
}

.sai-chat-float-btn {
  min-width: 122px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 10px;
  background: var(--sai-orange, #ff9900);
  color: #fff;
  font-weight: 950;
  box-shadow: 0 18px 60px rgba(0,0,0,.38);
  animation: saiChatFloat 2.8s ease-in-out infinite;
}

.sai-chat-widget-panel {
  display: none;
  width: min(440px, calc(100vw - 28px));
  height: min(680px, calc(100vh - 160px));
  overflow: hidden;
  border-radius: 10px;
  background: var(--sai-modal, rgba(20,20,20,.94));
  box-shadow: 0 28px 100px rgba(0,0,0,.52);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
}

.sai-chat-widget.sai-chat-small .sai-chat-widget-panel,
.sai-chat-widget.sai-chat-fullscreen .sai-chat-widget-panel {
  display: flex;
  flex-direction: column;
}

.sai-chat-widget.sai-chat-small .sai-chat-float-btn,
.sai-chat-widget.sai-chat-fullscreen .sai-chat-float-btn,
.sai-chat-widget.sai-chat-hidden .sai-chat-widget-panel {
  display: none;
}

.sai-chat-widget.sai-chat-hidden .sai-chat-float-btn,
.sai-chat-widget.sai-chat-collapsed .sai-chat-float-btn {
  display: inline-flex;
}

.sai-chat-widget.sai-chat-fullscreen {
  inset: 14px;
  right: 14px;
  bottom: 14px;
}

.sai-chat-widget.sai-chat-fullscreen .sai-chat-widget-panel {
  width: 100%;
  height: 100%;
}

.sai-chat-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sai-chat-head-actions {
  display: inline-flex;
  gap: 6px;
}

.sai-chat-head-actions button,
.sai-chat-head button {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 10px;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
}

.sai-chat-mount {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.sai-chat-mount #streaming-dashboard,
.sai-chat-mount .sai-chat-embedded {
  width: 100%;
  min-height: 100%;
  height: 100%;
  overflow: hidden;
}

.sai-chat-mount .sd-modal-header {
  display: none;
}

.sai-chat-mount .sd-form,
.sai-chat-mount .sd-chat-shell,
.sai-chat-mount .sd-chat-main {
  height: 100%;
  min-height: 0;
}

@keyframes saiChatFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

@media (max-width: 980px) {
  .sai-dashboard-shell {
    grid-template-columns: 1fr !important;
  }

  .sai-chat-widget {
    right: 18px;
    bottom: 18px;
  }
}

/* ========================================================================== 
   DASHBOARD V13 PATCHES
   ========================================================================== */
.sai-dashboard-shell {
  grid-template-columns: 270px minmax(0, 1fr) !important;
}

.sai-playground {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
    radial-gradient(circle at 18% 0%, rgba(255, 153, 0, .10), transparent 32%),
    radial-gradient(circle at 86% 12%, rgba(90, 167, 255, .07), transparent 28%),
    #080809 !important;
  background-size: 34px 34px, 34px 34px, auto, auto, auto !important;
}

.sai-playground-mount {
  height: 100%;
  overflow: auto;
  padding: 14px;
}

.sai-chat-widget {
  right: 30px !important;
  bottom: 30px !important;
}

.sai-chat-widget.sai-chat-fullscreen {
  inset: 14px !important;
  right: 14px !important;
  bottom: 14px !important;
}

.sai-chat-mount,
.sai-chat-embedded,
.sai-chat-embedded .sd-chat-shell,
.sai-chat-embedded .sd-chat-main {
  min-height: 0 !important;
  height: 100% !important;
}

.sai-chat-embedded .sd-chat-shell {
  display: flex !important;
  flex-direction: column !important;
}

.sai-chat-embedded .sd-chat-main {
  display: flex !important;
  flex-direction: column !important;
}

.sai-chat-embedded .sd-chat-messages {
  flex: 1 1 auto !important;
  min-height: 220px !important;
  max-height: none !important;
}

/* Make old standalone studio pages behave like windows inside the playground */
.sai-playground-mount #streaming-dashboard {
  min-height: 0 !important;
  height: auto !important;
  background: transparent !important;
}

.sai-playground-mount #streaming-dashboard .sd-playground {
  width: 100% !important;
  min-height: 0 !important;
  padding: 0 !important;
}

.sai-playground-mount #streaming-dashboard .sd-studio-sl-card.sl-card {
  min-height: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border-radius: 10px !important;
}

.sai-playground-mount #streaming-dashboard .sd-studio-topbar {
  display: none !important;
}

.sai-playground-mount #streaming-dashboard .sd-studio-header {
  margin: 0 0 16px !important;
}

.sai-playground-mount #streaming-dashboard .sd-studio-ground {
  display: block !important;
  gap: 14px !important;
  min-height: 0 !important;
  height: auto !important;
}

.sai-playground-mount #streaming-dashboard .sd-studio-control-panel {
  width: 260px !important;
  flex-basis: 260px !important;
}

.sai-cloud-page {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sai-cloud-page .sd-ai-cloud-grid {
  width: 100%;
}

@media (max-width: 980px) {

  .sai-playground-mount #streaming-dashboard .sd-studio-control-panel {
    width: 100% !important;
    flex-basis: auto !important;
  }
}

/* ========================================================================== 
   DASHBOARD V14 REQUESTED PATCHES
   ========================================================================== */
body[data-page="dashboard"] {
  background:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
    radial-gradient(circle at 18% 0%, rgba(255, 153, 0, .10), transparent 32%),
    radial-gradient(circle at 86% 12%, rgba(90, 167, 255, .07), transparent 28%),
    #080809 !important;
  background-size: 34px 34px, 34px 34px, auto, auto, auto !important;
}

.sai-playground {
  background: rgba(255, 255, 255, .025) !important;
  background-size: auto !important;
}

.sai-chat-head-actions {
  display: none !important;
}

.sai-mobile-menu-btn {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 2147482600;
  width: 42px;
  height: 42px;
  display: none;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, .10);
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
}

.sd-chat-close-toggle {
  font-size: 20px !important;
  line-height: 1 !important;
}

@media (max-width: 980px) {
  .sai-mobile-menu-btn {
    display: grid;
  }

  .sai-dashboard-shell {
    padding-top: 64px !important;
  }

  .sai-sidebar {
    position: fixed !important;
    top: 12px;
    left: 12px;
    bottom: 12px;
    z-index: 2147482550;
    width: min(280px, calc(100vw - 24px));
    transform: translateX(calc(-100% - 24px));
    transition: transform .18s ease;
  }

  body.sai-sidebar-open .sai-sidebar {
    transform: translateX(0);
  }

  body.sai-sidebar-open::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 2147482500;
    background: rgba(0,0,0,.48);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}

/* Dashboard auth gate */
.sai-dashboard-auth-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, .62);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.sai-dashboard-auth-modal[hidden] { display: none !important; }
.sai-dashboard-auth-card {
  width: min(100%, 520px);
  padding: 24px;
  border-radius: 10px;
  background: var(--sai-modal, rgba(20,20,20,.94));
  color: #fff;
}
.sai-dashboard-auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.sai-dashboard-auth-brand img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
}
.sai-dashboard-auth-brand span { display: grid; gap: 2px; }
.sai-dashboard-auth-brand em { color: var(--sai-muted); font-style: normal; font-size: 12px; }
.sai-dashboard-auth-panel .sai-auth-header h1 { margin: 0 0 8px; font-size: 32px; }
.sai-dashboard-auth-panel .sai-auth-header p { margin: 0 0 18px; color: var(--sai-muted); line-height: 1.5; }
.sai-dashboard-auth-panel .sai-auth-form { display: grid; gap: 10px; }
.sai-dashboard-auth-panel input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: var(--sai-input);
  color: #fff;
  outline: none;
}
.sai-dashboard-auth-panel .sl-btn,
.sai-dashboard-auth-panel .ss-btn {
  width: 100%;
  min-height: 48px;
  border-radius: 10px;
  background: var(--sai-orange);
  color: #fff;
  font-weight: 900;
}
.sai-dashboard-auth-panel .sl-btn-secondary,
.sai-dashboard-auth-panel .ss-btn-secondary { background: rgba(255,255,255,.08); }
.sai-dashboard-auth-panel .sl-error,
.sai-dashboard-auth-panel .ss-error { padding: 12px; border-radius: 10px; background: rgba(255,91,110,.12); color: #ffb4bd; }
.sai-dashboard-auth-panel .sl-message,
.sai-dashboard-auth-panel .ss-message { padding: 12px; border-radius: 10px; background: rgba(40,233,140,.10); color: #b7ffd8; }
.sai-dashboard-auth-panel .sai-auth-note { margin-top: 14px; color: var(--sai-muted); text-align: center; }
.sai-dashboard-auth-panel .sai-auth-note button { color: var(--sai-orange); background: transparent; font-weight: 900; }

/* ========================================================================== 
   DASHBOARD V18 TARGETED FIXES
   ========================================================================== */
.sai-chat-widget .sai-chat-widget-panel {
  position: relative !important;
}

.sai-chat-widget .sai-chat-head {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  min-height: 54px !important;
  padding: 12px 132px 12px 14px !important;
}

.sai-chat-widget .sai-chat-mount .sd-chat-modal-tools {
  position: absolute !important;
  top: 10px !important;
  right: 12px !important;
  z-index: 30 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 6px !important;
}

.sai-chat-widget.sai-chat-fullscreen .sai-chat-mount .sd-chat-history-toggle {
  display: none !important;
}

.sai-chat-widget.sai-chat-fullscreen .sd-chat-history-panel {
  display: flex !important;
}

.sai-chat-widget:not(.sai-chat-fullscreen) .sai-chat-mount .sd-chat-history-toggle {
  display: inline-flex !important;
}

.sai-user-card {
  position: fixed !important;
  top: 16px !important;
  right: 16px !important;
  z-index: 2147481200 !important;
  min-width: 220px !important;
  max-width: 280px !important;
  background: rgba(255,255,255,.075) !important;
  backdrop-filter: blur(22px) saturate(170%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(170%) !important;
}

.sai-sidebar .sai-user-card {
  margin-top: 0 !important;
}

.sai-playground-mount #streaming-dashboard .sd-studio-sl-card {
  position: relative !important;
}

.sai-playground-mount #streaming-dashboard .sd-studio-ground {
  display: block !important;
}

.sai-playground-mount #streaming-dashboard .sd-dashboard.sd-studio-dashboard {
  width: 100% !important;
  max-width: none !important;
  flex: 1 1 auto !important;
}

.sai-playground-mount #streaming-dashboard .sd-stream-list,
.sai-playground-mount #streaming-dashboard .sd-ai-list {
  width: 100% !important;
}

.sai-mobile-brand {
  display: none !important;
}

@media (max-width: 980px) {
  .sai-mobile-menu-btn {
    left: auto !important;
    right: 14px !important;
  }

  .sai-mobile-brand {
    position: fixed !important;
    top: 14px !important;
    left: 14px !important;
    z-index: 2147482600 !important;
    display: inline-flex !important;
  }

  .sai-user-card {
    top: 66px !important;
    right: 14px !important;
    min-width: 0 !important;
    max-width: calc(100vw - 28px) !important;
  }

  .sai-playground-mount #streaming-dashboard .sd-studio-header {
    padding-right: 0 !important;
  }

  .sai-playground-mount #streaming-dashboard .sd-studio-control-panel {
    position: static !important;
    width: 100% !important;
    flex-basis: auto !important;
    margin-bottom: 14px !important;
  }
}

/* ========================================================================== 
   DASHBOARD V19 REQUESTED TARGETED PATCHES
   ========================================================================== */
.sai-sidebar > .sai-user-card {
  display: none !important;
}

.sai-home-panel {
  position: relative !important;
}

.sai-home-top {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 18px !important;
  margin-bottom: 22px !important;
}

.sai-home-panel .sai-user-card {
  position: static !important;
  top: auto !important;
  right: auto !important;
  z-index: auto !important;
  min-width: 220px !important;
  max-width: 280px !important;
  margin-left: auto !important;
}

.sai-chat-widget .sai-chat-widget-panel {
  position: relative !important;
}

.sai-chat-widget .sai-chat-head,
.sai-chat-widget .sai-chat-mount .sd-chat-modal-tools {
  display: flex !important;
  align-items: center !important;
}

.sai-chat-widget .sai-chat-head {
  justify-content: flex-start !important;
  padding-right: 190px !important;
}

.sai-chat-widget .sai-chat-mount .sd-chat-modal-tools {
  position: absolute !important;
  top: 10px !important;
  right: 12px !important;
  z-index: 50 !important;
  justify-content: flex-end !important;
  gap: 6px !important;
}

.sai-chat-widget .sai-chat-tool-close {
  font-size: 22px !important;
  line-height: 1 !important;
  font-weight: 800 !important;
}

.sai-chat-widget .sd-chat-shell {
  display: grid !important;
  grid-template-columns: minmax(170px, 210px) minmax(0, 1fr) !important;
  min-height: 0 !important;
}

.sai-chat-widget .sd-chat-history-panel,
.sai-chat-widget .sd-chat-history-panel[hidden] {
  display: flex !important;
  position: relative !important;
  transform: none !important;
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.sai-chat-widget .sd-chat-history-toggle {
  display: none !important;
}

.sai-chat-widget.sai-chat-fullscreen .sd-chat-shell {
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr) !important;
}

.sai-playground-mount #streaming-dashboard .sd-studio-actions button[aria-label="Account"] {
  display: none !important;
}

.sai-playground-mount #streaming-dashboard .sd-dashboard-tools.sd-studio-tools {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
}

.sai-playground-mount #streaming-dashboard .sd-dashboard-tools .sai-tool-action-btn,
.sai-playground-mount #streaming-dashboard .sd-dashboard-tools #sdAiCloudBtn {
  width: auto !important;
  min-width: 0 !important;
  white-space: nowrap !important;
}

.sai-playground-mount #streaming-dashboard .sd-studio-control-panel .sd-studio-actions:empty {
  display: none !important;
}

@media (max-width: 760px) {
  .sai-home-top {
    display: grid !important;
  }

  .sai-home-panel .sai-user-card {
    width: 100% !important;
    max-width: none !important;
  }

  .sai-chat-widget .sd-chat-shell,
  .sai-chat-widget.sai-chat-fullscreen .sd-chat-shell {
    grid-template-columns: 1fr !important;
  }

  .sai-chat-widget .sd-chat-history-panel {
    max-height: 150px !important;
  }
}

/* v20 targeted fixes */
#sdStreamFilter,
#sdStreamSearch,
#sdAiFilter,
#sdAiSearch {
  width: fit-content !important;
  max-width: 100% !important;
}

.sai-playground-mount #streaming-dashboard .sl-header.sd-studio-header,
.sai-playground-mount #streaming-dashboard .sd-studio-header {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 16px !important;
}

.sai-playground-mount #streaming-dashboard .sd-studio-header > p,
.sai-playground-mount #streaming-dashboard .sd-studio-header > h1 {
  flex: 0 1 auto !important;
}

.sai-playground-mount #streaming-dashboard .sd-studio-control-panel,
.sai-playground-mount #streaming-dashboard .sai-studio-top-panel {
  position: static !important;
  inset: auto !important;
  transform: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  width: fit-content !important;
  max-width: 100% !important;
  margin-left: auto !important;
}

.sai-playground-mount #streaming-dashboard .sd-studio-control-panel .sd-studio-actions {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
}

.sai-playground-mount #streaming-dashboard .sd-studio-ground {
  display: block !important;
  min-height: 0 !important;
  height: auto !important;
}

/* Chat history: dropdown in small widget, sidebar only in fullscreen */
.sai-chat-widget:not(.sai-chat-fullscreen) .sd-chat-shell {
  display: flex !important;
  grid-template-columns: none !important;
  position: relative !important;
}

.sai-chat-widget:not(.sai-chat-fullscreen) .sd-chat-history-panel[hidden] {
  display: none !important;
}

.sai-chat-widget:not(.sai-chat-fullscreen) .sd-chat-history-panel:not([hidden]) {
  display: flex !important;
  position: absolute !important;
  top: 8px !important;
  left: 8px !important;
  bottom: auto !important;
  width: min(300px, calc(100% - 16px)) !important;
  max-height: 72% !important;
  z-index: 80 !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.sai-chat-widget:not(.sai-chat-fullscreen) .sd-chat-history-toggle {
  display: inline-flex !important;
}

.sai-chat-widget.sai-chat-fullscreen .sd-chat-shell {
  display: grid !important;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr) !important;
}

.sai-chat-widget.sai-chat-fullscreen .sd-chat-history-panel,
.sai-chat-widget.sai-chat-fullscreen .sd-chat-history-panel[hidden] {
  display: flex !important;
  position: relative !important;
  top: auto !important;
  left: auto !important;
  width: auto !important;
  max-height: none !important;
  height: auto !important;
  z-index: auto !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.sai-chat-widget.sai-chat-fullscreen .sd-chat-history-toggle {
  display: none !important;
}

.sai-chat-widget .sd-chat-history-head button[aria-label="Close history"] {
  display: none !important;
}

@media (max-width: 760px) {
  .sai-sidebar > .sai-sidebar-brand {
    display: none !important;
  }

  .sai-playground-mount #streaming-dashboard .sl-header.sd-studio-header,
  .sai-playground-mount #streaming-dashboard .sd-studio-header {
    flex-direction: column !important;
  }

  .sai-playground-mount #streaming-dashboard .sd-studio-control-panel,
  .sai-playground-mount #streaming-dashboard .sai-studio-top-panel {
    width: 100% !important;
    justify-content: flex-start !important;
    margin-left: 0 !important;
  }
}

/* v21 small fixes: chat history + studio header */
.sai-chat-widget.sai-chat-fullscreen .sd-chat-history-panel,
.sai-chat-widget.sai-chat-fullscreen .sd-chat-history-panel[hidden] {
  display: grid !important;
  align-content: start !important;
  gap: 10px !important;
  padding-left: 14px !important;
  padding-right: 12px !important;
  box-sizing: border-box !important;
}

.sai-chat-widget:not(.sai-chat-fullscreen) .sd-chat-history-panel:not([hidden]) {
  left: 14px !important;
  width: min(300px, calc(100% - 28px)) !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
  box-sizing: border-box !important;
}

.sai-chat-widget .sd-chat-history-panel,
.sai-chat-widget .sd-chat-history-list,
.sai-chat-widget .sd-chat-history-items {
  box-sizing: border-box !important;
}

.sai-playground-mount #streaming-dashboard .sl-header.sd-studio-header,
.sai-playground-mount #streaming-dashboard .sd-studio-header {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 18px !important;
  width: 100% !important;
}

.sai-playground-mount #streaming-dashboard .sai-studio-heading-text {
  display: grid !important;
  gap: 6px !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

.sai-playground-mount #streaming-dashboard .sai-studio-heading-text h1,
.sai-playground-mount #streaming-dashboard .sai-studio-heading-text p {
  margin: 0 !important;
}

.sai-playground-mount #streaming-dashboard .sd-studio-control-panel,
.sai-playground-mount #streaming-dashboard .sai-studio-top-panel {
  flex: 0 0 auto !important;
  align-self: flex-start !important;
}

@media (max-width: 760px) {
  .sai-playground-mount #streaming-dashboard .sl-header.sd-studio-header,
  .sai-playground-mount #streaming-dashboard .sd-studio-header {
    display: grid !important;
    gap: 14px !important;
  }

  .sai-playground-mount #streaming-dashboard .sd-studio-control-panel,
  .sai-playground-mount #streaming-dashboard .sai-studio-top-panel {
    width: 100% !important;
  }
}

/* v22 targeted restore: home user card, chat conversation layout, studio right controls */
.sai-home-panel .sai-home-top {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 18px !important;
  margin-bottom: 22px !important;
}

.sai-home-panel .sai-home-copy {
  display: grid !important;
  gap: 8px !important;
  min-width: 0 !important;
}

.sai-home-panel .sai-home-copy h1,
.sai-home-panel .sai-home-copy p {
  margin: 0 !important;
}

.sai-home-panel .sai-user-card {
  display: flex !important;
  align-items: center !important;
  flex: 0 0 auto !important;
  min-width: 240px !important;
  max-width: 320px !important;
  margin-left: auto !important;
}

.sai-sidebar > .sai-user-card {
  display: none !important;
}

/* Small chat: conversations are a compact dropdown, not a flex sidebar */
.sai-chat-widget:not(.sai-chat-fullscreen) .sd-chat-history-panel:not([hidden]) {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  align-content: start !important;
  gap: 10px !important;
  position: absolute !important;
  top: 10px !important;
  left: 18px !important;
  width: min(300px, calc(100% - 36px)) !important;
  max-height: 72% !important;
  padding: 14px !important;
  border-radius: 10px !important;
  background: rgba(10, 10, 11, .94) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  box-shadow: 0 18px 50px rgba(0,0,0,.42) !important;
  z-index: 80 !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Fullscreen chat: conversations become a standalone left sidebar */
.sai-chat-widget.sai-chat-fullscreen .sd-chat-shell {
  display: grid !important;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr) !important;
  gap: 14px !important;
  min-height: 0 !important;
}

.sai-chat-widget.sai-chat-fullscreen .sd-chat-history-panel,
.sai-chat-widget.sai-chat-fullscreen .sd-chat-history-panel[hidden] {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  align-content: start !important;
  gap: 12px !important;
  position: relative !important;
  top: auto !important;
  left: auto !important;
  width: auto !important;
  min-width: 0 !important;
  height: calc(100% - 24px) !important;
  max-height: none !important;
  margin: 12px 0 12px 12px !important;
  padding: 16px !important;
  border-radius: 10px !important;
  background: rgba(12, 12, 13, .86) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05) !important;
  z-index: auto !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  box-sizing: border-box !important;
}

.sai-chat-widget.sai-chat-fullscreen .sd-chat-history-list,
.sai-chat-widget.sai-chat-fullscreen .sd-chat-history-items,
.sai-chat-widget:not(.sai-chat-fullscreen) .sd-chat-history-list,
.sai-chat-widget:not(.sai-chat-fullscreen) .sd-chat-history-items {
  min-width: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.sai-chat-widget.sai-chat-fullscreen .sd-chat-main {
  min-width: 0 !important;
}

/* Studio header: title/description left, controls wider on right */
.sai-playground-mount #streaming-dashboard .sl-header.sd-studio-header,
.sai-playground-mount #streaming-dashboard .sd-studio-header {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 22px !important;
  width: 100% !important;
}

.sai-playground-mount #streaming-dashboard .sd-studio-control-panel,
.sai-playground-mount #streaming-dashboard .sai-studio-top-panel {
  position: static !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  flex: 0 1 460px !important;
  width: min(460px, 48%) !important;
  max-width: 520px !important;
  min-width: 320px !important;
  margin-left: auto !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
}

.sai-playground-mount #streaming-dashboard .sd-studio-control-panel .sd-studio-actions,
.sai-playground-mount #streaming-dashboard .sai-studio-top-panel .sd-studio-actions,
.sai-playground-mount #streaming-dashboard .sd-dashboard-tools.sd-studio-tools {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
  width: 100% !important;
}

@media (max-width: 760px) {
  .sai-home-panel .sai-home-top {
    display: grid !important;
  }

  .sai-home-panel .sai-user-card {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
  }

  .sai-chat-widget.sai-chat-fullscreen .sd-chat-shell {
    grid-template-columns: 1fr !important;
  }

  .sai-chat-widget.sai-chat-fullscreen .sd-chat-history-panel,
  .sai-chat-widget.sai-chat-fullscreen .sd-chat-history-panel[hidden] {
    height: auto !important;
    max-height: 190px !important;
    margin: 12px !important;
  }

  .sai-playground-mount #streaming-dashboard .sd-studio-control-panel,
  .sai-playground-mount #streaming-dashboard .sai-studio-top-panel {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    justify-content: flex-start !important;
    margin-left: 0 !important;
  }
}

/* v23 exact requested fixes */
.sd-plan-card {
  width: 100% !important;
}

.sai-playground-mount #streaming-dashboard .sd-studio-control-panel,
.sai-playground-mount #streaming-dashboard .sai-studio-top-panel {
  align-items: flex-start !important;
}

.sd-chat-history-list {
  margin-top: 0 !important;
}

/* v24 tiny patch: AI credits + studio panel spacing */
.sai-playground-mount #streaming-dashboard .sd-studio-control-panel,
.sai-playground-mount #streaming-dashboard .sai-studio-top-panel,
.sd-studio-control-panel {
  padding: 10px !important;
}

.sd-ai-user-coins-card {
  background: transparent !important;
  box-shadow: none !important;
}

/* v25: chatbot native select + fullscreen history margin */
.sai-chat-widget .sd-chat-mode-select {
  width: fit-content !important;
  min-width: 170px !important;
}

.sai-chat-widget .sd-chat-mode-select .sd-native-select {
  display: block !important;
  appearance: auto !important;
  -webkit-appearance: menulist !important;
  width: fit-content !important;
  min-width: 170px !important;
  height: 38px !important;
  padding: 0 12px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(255, 255, 255, .12) !important;
  background: rgba(255, 255, 255, .06) !important;
  color: var(--sai-text) !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  outline: none !important;
}

.sai-chat-widget .sd-chat-mode-select .sd-custom-select-btn,
.sai-chat-widget .sd-chat-mode-select .sd-custom-select-menu {
  display: none !important;
}

.sai-chat-widget.sai-chat-fullscreen .sd-chat-history-panel,
.sai-chat-widget.sai-chat-fullscreen .sd-chat-history-panel[hidden] {
  margin: 12px 0 12px 26px !important;
}

/* v0.4.5 AI module thumbnails + first-name greeting support */
.sai-playground-mount .sd-image-generator-card .sd-ai-module-image,
.sd-image-generator-card .sd-ai-module-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
  object-fit: cover;
  border-radius: 10px;
  margin: 10px 0 8px;
}

/* ==========================================================================
   DASHBOARD V27 WHITE THEME OVERRIDES
   ========================================================================== */
body[data-page="dashboard"],
body {
  background: #fafafa !important;
  background-image: none !important;
  color: #111111 !important;
}

.sai-dashboard-loader,
.sai-billing-loader,
.sai-dashboard-auth-modal,
body.sai-modal-open::before {
  background: rgba(250, 250, 250, .92) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.sai-sidebar {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.sai-playground,
.sai-chat-widget-panel,
.sai-dashboard-auth-card,
.sai-billing-card,
.sai-home-panel,
.sai-stats-grid article,
.sai-email-settings,
.sai-playground-mount #streaming-dashboard .sd-studio-sl-card.sl-card,
.sai-playground-mount #streaming-dashboard .sl-card,
.sai-playground-mount #streaming-dashboard .sd-studio-sl-card,
.sai-chat-widget.sai-chat-fullscreen .sd-chat-history-panel,
.sai-chat-widget:not(.sai-chat-fullscreen) .sd-chat-history-panel:not([hidden]) {
  background: #ffffff !important;
  background-image: none !important;
  border: 1px solid rgba(17, 17, 17, .08) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.sai-sidebar-brand,
.sai-sidebar-brand strong,
.sai-main-nav button,
.sai-home-panel h1,
.sai-chat-head strong,
.sai-user-card strong,
.sai-dashboard-auth-card,
.sai-billing-card,
.sai-chat-widget,
.sai-email-settings label {
  color: #111111 !important;
}

.sai-sidebar-brand em,
.sai-user-card small,
.sai-home-panel p,
.sai-stats-grid small,
.sai-sidebar-bottom a,
.sai-sidebar-bottom button,
.sai-dashboard-loader-card p,
.sai-dashboard-auth-panel .sai-auth-header p,
.sai-dashboard-auth-panel .sai-auth-note {
  color: rgba(17, 17, 17, .62) !important;
}

.sai-main-nav button:hover,
.sai-main-nav button.sai-active {
  background: #ffffff !important;
  color: #111111 !important;
  box-shadow: inset 0 0 0 1px rgba(17, 17, 17, .10) !important;
}

.sai-sidebar-bottom a:hover,
.sai-sidebar-bottom button:hover {
  color: #000000 !important;
}

.sai-user-card {
  background: #ffffff !important;
  border: 1px solid rgba(17, 17, 17, .08) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.sai-avatar,
.sai-chat-float-btn,
.sai-email-settings button,
.sai-dashboard-auth-panel .sl-btn,
.sai-dashboard-auth-panel .ss-btn,
.sai-playground-mount .sd-primary-action,
.sai-playground-mount .sd-add-btn.sd-primary-action,
.sai-playground-mount .sd-upload-btn.sd-primary-action,
.sai-chat-widget .sd-chat-send-btn,
.sai-chat-widget .sd-upload-btn.sd-primary-action {
  background: #000000 !important;
  color: #ffffff !important;
  border-color: #000000 !important;
  box-shadow: none !important;
}

.sai-chat-head button,
.sai-chat-widget .sai-chat-head-actions button,
.sai-chat-widget .sd-chat-modal-tools button,
.sai-playground-mount .sd-secondary-action,
.sai-playground-mount .sd-add-btn.sd-secondary-action,
.sai-playground-mount .sd-upload-btn.sd-secondary-action,
.sai-dashboard-auth-panel .sl-btn-secondary,
.sai-dashboard-auth-panel .ss-btn-secondary {
  background: #ffffff !important;
  color: #111111 !important;
  border: 1px solid rgba(17, 17, 17, .10) !important;
  box-shadow: none !important;
}

.sai-playground-mount input,
.sai-playground-mount select,
.sai-playground-mount textarea,
.sai-chat-widget input,
.sai-chat-widget select,
.sai-chat-widget textarea,
.sai-dashboard-auth-panel input {
  background: #ffffff !important;
  color: #111111 !important;
  border: 1px solid rgba(17, 17, 17, .12) !important;
}

.sai-spinner {
  border-color: rgba(17, 17, 17, .12) !important;
  border-top-color: #000000 !important;
}

body.sai-chat-fullscreen .sai-playground,
body.sai-chat-fullscreen .sai-sidebar {
  filter: none !important;
}

.sai-mobile-menu-btn {
  background: #ffffff !important;
  color: #111111 !important;
  border: 1px solid rgba(17, 17, 17, .10) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* v28: white theme refinements requested */
.sai-playground,
.sai-chat-widget-panel,
.sai-dashboard-auth-card,
.sai-billing-card,
.sai-home-panel,
.sai-stats-grid article,
.sai-email-settings,
.sai-playground-mount #streaming-dashboard .sd-studio-sl-card.sl-card,
.sai-playground-mount #streaming-dashboard .sl-card,
.sai-playground-mount #streaming-dashboard .sd-studio-sl-card,
.sai-chat-widget.sai-chat-fullscreen .sd-chat-history-panel,
.sai-chat-widget:not(.sai-chat-fullscreen) .sd-chat-history-panel:not([hidden]) {
  border: 0 !important;
  box-shadow: none !important;
}

.sd-plan-card {
  width: 100% !important;
}

.sai-stats-grid {
  max-width: none !important;
  width: 100% !important;
  grid-template-columns: repeat(4, minmax(0px, 1fr)) !important;
}

.sai-stats-grid article {
  border: 1px solid rgba(17, 17, 17, .10) !important;
  box-shadow: none !important;
}

.sai-home-panel {
  align-content: start !important;
  align-items: stretch !important;
  justify-content: start !important;
  place-content: start stretch !important;
}

.sai-playground-mount #streaming-dashboard .sd-studio-control-panel,
.sai-playground-mount #streaming-dashboard .sai-studio-top-panel {
  max-width: 420px !important;
  width: 100% !important;
}

.sai-chat-widget .sd-chat-plus,
.sd-chat-plus {
  border: 1px solid rgba(17, 17, 17, .14) !important;
}

/* Restore SAIUNES AI chat mode native select. Old ai.css hides .sd-native-select as 1px/opacity:0. */
.sai-chat-widget .sd-chat-mode-select {
  display: block !important;
  width: fit-content !important;
  min-width: 170px !important;
}

.sai-chat-widget .sd-chat-mode-select .sd-native-select,
.sai-chat-widget select#sdChatMode {
  display: block !important;
  position: static !important;
  width: fit-content !important;
  min-width: 170px !important;
  height: 38px !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  appearance: auto !important;
  -webkit-appearance: menulist !important;
  padding: 0 12px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(17, 17, 17, .14) !important;
  background: #ffffff !important;
  color: #111111 !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 38px !important;
  outline: none !important;
}

body[data-page="dashboard"] input,
body[data-page="dashboard"] textarea,
body[data-page="dashboard"] select,
body[data-page="dashboard"] .sd-native-select,
.sai-playground-mount input,
.sai-playground-mount textarea,
.sai-playground-mount select,
.sai-chat-widget input,
.sai-chat-widget textarea,
.sai-chat-widget select,
.sai-dashboard-auth-panel input {
  border: 1px solid rgba(17, 17, 17, .14) !important;
  background: #ffffff !important;
  color: #111111 !important;
  box-shadow: none !important;
}

@media (max-width: 760px) {
  .sai-playground-mount #streaming-dashboard .sd-studio-control-panel,
  .sai-playground-mount #streaming-dashboard .sai-studio-top-panel {
    max-width: 100% !important;
  }

  .sai-stats-grid {
    grid-template-columns: 1fr !important;
  }
}

/* v29: bordered white UI refinements */
.sai-chat-widget.sai-chat-small .sai-chat-widget-panel,
.sai-chat-widget.sai-chat-fullscreen .sai-chat-widget-panel,
.sai-chat-widget-panel {
  border: 1px solid rgba(17, 17, 17, .12) !important;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .12) !important;
}

.sd-chat-history-item {
  border: 1px solid rgba(17, 17, 17, .12) !important;
  background: #ffffff !important;
}

.sd-chat-history-actions button {
  border: 1px solid rgba(17, 17, 17, .14) !important;
  background: #ffffff !important;
  color: #111111 !important;
  opacity: 1 !important;
}

.sd-chat-history-actions button svg,
.sd-chat-history-actions button path {
  fill: currentColor !important;
  color: currentColor !important;
}

.sai-playground-mount #streaming-dashboard .sd-studio-control-panel,
.sai-playground-mount #streaming-dashboard .sai-studio-top-panel {
  border: 1px solid rgba(17, 17, 17, .12) !important;
}

.sai-playground-mount #streaming-dashboard .sd-stream-card,
.sd-stream-card {
  border: 1px solid rgba(17, 17, 17, .12) !important;
  background: #ffffff !important;
}

.sd-ai-card,
.sd-image-generator-card {
  border: 1px solid rgba(17, 17, 17, .12) !important;
  background: #ffffff !important;
}

.sd-ai-user-coins-card {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  width: 100% !important;
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  padding: 0 !important;
}

.sd-ai-user-coins-card strong {
  display: flex !important;
  align-items: baseline !important;
  gap: 8px !important;
  color: #111111 !important;
  white-space: nowrap !important;
}

.sd-ai-user-coins-card .sd-add-coins-inline-btn {
  width: fit-content !important;
  min-width: fit-content !important;
  white-space: nowrap !important;
  padding-inline: 12px !important;
}

.sd-ai-cloud-item {
  border: 1px solid rgba(17, 17, 17, .12) !important;
  background: #ffffff !important;
}

.sd-file-picker {
  border: 1px dashed rgba(17, 17, 17, .28) !important;
  background: #ffffff !important;
}

.sd-slot-price-line {
  color: #111111 !important;
}

.sd-slot-price-line *,
.sd-slot-price-line b,
.sd-slot-price-line span {
  color: #111111 !important;
}

.sd-manage-slots-grid {
  border: 1px solid rgba(17, 17, 17, .12) !important;
  background: #ffffff !important;
}

.sd-modal.sd-small-modal,
.sd-small-modal {
  box-shadow: 0 22px 60px rgba(0, 0, 0, .16) !important;
}

/* v30: white liquid-glass theme — soft vessels, no hard borders */
:root {
  --sai-liquid-bg: rgba(255, 255, 255, .72);
  --sai-liquid-bg-strong: rgba(255, 255, 255, .86);
  --sai-liquid-bg-soft: rgba(255, 255, 255, .58);
  --sai-liquid-shadow: 0 22px 70px rgba(15, 23, 42, .10), 0 8px 24px rgba(15, 23, 42, .06);
  --sai-liquid-shadow-soft: 0 14px 38px rgba(15, 23, 42, .08);
  --sai-liquid-highlight: inset 0 1px 0 rgba(255, 255, 255, .92), inset 0 -1px 0 rgba(15, 23, 42, .035);
}

body[data-page="dashboard"] {
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 255, 255, .92), transparent 30%),
    radial-gradient(circle at 85% 8%, rgba(235, 240, 255, .95), transparent 28%),
    linear-gradient(145deg, #fafafa, #f4f4f5) !important;
}

.sai-sidebar {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.sai-playground,
.sai-chat-widget-panel,
.sai-dashboard-auth-card,
.sai-billing-card,
.sai-home-panel,
.sai-email-settings,
.sai-playground-mount #streaming-dashboard .sd-studio-sl-card.sl-card,
.sai-playground-mount #streaming-dashboard .sl-card,
.sai-playground-mount #streaming-dashboard .sd-studio-sl-card,
.sai-chat-widget.sai-chat-fullscreen .sd-chat-history-panel,
.sai-chat-widget:not(.sai-chat-fullscreen) .sd-chat-history-panel:not([hidden]),
.sai-playground-mount #streaming-dashboard .sd-studio-control-panel,
.sai-playground-mount #streaming-dashboard .sai-studio-top-panel,
.sai-playground-mount #streaming-dashboard .sd-stream-card,
.sd-stream-card,
.sd-ai-card,
.sd-image-generator-card,
.sd-ai-cloud-item,
.sd-manage-slots-grid,
.sd-modal,
.sd-modal.sd-small-modal,
.sd-small-modal,
.sd-chat-history-item,
.sai-stats-grid article,
.sd-plan-card {
  border: 0 !important;
  background: var(--sai-liquid-bg) !important;
  box-shadow: var(--sai-liquid-shadow-soft), var(--sai-liquid-highlight) !important;
  backdrop-filter: blur(22px) saturate(1.4) !important;
  -webkit-backdrop-filter: blur(22px) saturate(1.4) !important;
}

.sai-playground,
.sai-chat-widget-panel,
.sd-modal,
.sai-home-panel {
  background: var(--sai-liquid-bg-strong) !important;
  box-shadow: var(--sai-liquid-shadow), var(--sai-liquid-highlight) !important;
}

.sai-playground-mount #streaming-dashboard .sd-studio-control-panel,
.sai-playground-mount #streaming-dashboard .sai-studio-top-panel,
.sd-ai-user-coins-card,
.sd-dashboard-tools,
.sd-hero-dashboard-tools,
.sd-studio-tools {
  border: 0 !important;
  background: rgba(255, 255, 255, .62) !important;
  box-shadow: var(--sai-liquid-shadow-soft), var(--sai-liquid-highlight) !important;
  backdrop-filter: blur(18px) saturate(1.35) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.35) !important;
}

.sd-ai-user-coins-card {
  padding: 10px !important;
  border-radius: 10px !important;
}

.sd-chat-history-actions button,
.sai-chat-widget .sd-chat-plus,
.sd-chat-plus,
.sd-file-picker,
body[data-page="dashboard"] input,
body[data-page="dashboard"] textarea,
body[data-page="dashboard"] select,
body[data-page="dashboard"] .sd-native-select,
.sai-playground-mount input,
.sai-playground-mount textarea,
.sai-playground-mount select,
.sai-chat-widget input,
.sai-chat-widget textarea,
.sai-chat-widget select,
.sai-dashboard-auth-panel input {
  border: 0 !important;
  background: rgba(255, 255, 255, .72) !important;
  color: #111111 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 8px 24px rgba(15, 23, 42, .06) !important;
  backdrop-filter: blur(14px) saturate(1.25) !important;
  -webkit-backdrop-filter: blur(14px) saturate(1.25) !important;
}

.sd-file-picker {
  border: 1px dashed rgba(0, 0, 0, .10) !important;
}

.sai-primary-btn,
.sai-btn-primary,
.sd-primary-action,
.sd-upload-btn.sd-primary-action,
.sd-add-btn.sd-primary-action,
button[type="submit"] {
  background: #000000 !important;
  color: #ffffff !important;
  border: 0 !important;
  box-shadow: 0 16px 34px rgba(0, 0, 0, .16) !important;
}

.sai-secondary-btn,
.sd-secondary-action,
.sd-upload-btn.sd-secondary-action,
.sd-add-btn.sd-secondary-action {
  border: 0 !important;
  background: rgba(255, 255, 255, .70) !important;
  color: #111111 !important;
  box-shadow: var(--sai-liquid-shadow-soft), var(--sai-liquid-highlight) !important;
}

.sai-stats-grid article,
.sd-stream-card,
.sd-ai-card,
.sd-image-generator-card,
.sd-ai-cloud-item,
.sd-chat-history-item {
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease !important;
}

.sai-stats-grid article:hover,
.sd-stream-card:hover,
.sd-ai-card:hover,
.sd-image-generator-card:hover,
.sd-ai-cloud-item:hover,
.sd-chat-history-item:hover {
  transform: translateY(-1px) !important;
  background: rgba(255, 255, 255, .90) !important;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .12), var(--sai-liquid-highlight) !important;
}

.sai-chat-widget.sai-chat-small .sai-chat-widget-panel,
.sai-chat-widget.sai-chat-fullscreen .sai-chat-widget-panel {
  border: 0 !important;
  box-shadow: var(--sai-liquid-shadow), var(--sai-liquid-highlight) !important;
}

/* v31: refined white liquid-glass — playground owns the surface, inner panels stay clean */
:root {
  --sai-liquid-page: #fafafa;
  --sai-liquid-surface: rgba(255, 255, 255, .78);
  --sai-liquid-surface-strong: rgba(255, 255, 255, .90);
  --sai-liquid-soft-shadow: 0 28px 80px rgba(15, 23, 42, .08), 0 10px 26px rgba(15, 23, 42, .045);
  --sai-liquid-float-shadow: 0 34px 100px rgba(15, 23, 42, .12), 0 14px 38px rgba(15, 23, 42, .06);
  --sai-liquid-button-shadow: 0 10px 22px rgba(0, 0, 0, .10);
  --sai-liquid-gloss: linear-gradient(145deg, rgba(255, 255, 255, .86), rgba(255, 255, 255, .54));
}

body[data-page="dashboard"] {
  background:
    radial-gradient(circle at 14% -4%, rgba(255, 255, 255, .96), transparent 34%),
    radial-gradient(circle at 88% 8%, rgba(228, 236, 255, .88), transparent 30%),
    radial-gradient(circle at 45% 105%, rgba(255, 255, 255, .92), transparent 32%),
    var(--sai-liquid-page) !important;
}

/* Main glass vessels only */
.sai-playground,
.sai-chat-widget-panel,
.sai-dashboard-auth-card,
.sd-modal {
  border: 0 !important;
  background:
    linear-gradient(145deg, rgba(255,255,255,.94), rgba(255,255,255,.68)),
    rgba(255,255,255,.76) !important;
  box-shadow: var(--sai-liquid-float-shadow) !important;
  backdrop-filter: blur(28px) saturate(1.45) !important;
  -webkit-backdrop-filter: blur(28px) saturate(1.45) !important;
  outline: 1px solid rgba(255,255,255,.62) !important;
  outline-offset: -1px !important;
}

.sai-playground {
  overflow: hidden !important;
  isolation: isolate !important;
}

.sai-playground::before,
.sai-chat-widget-panel::before,
.sd-modal::before,
.sai-dashboard-auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 10px;
  background:
    radial-gradient(circle at 20% 0%, rgba(255,255,255,.78), transparent 38%),
    linear-gradient(180deg, rgba(255,255,255,.46), transparent 44%);
  opacity: .72;
  z-index: 0;
}

.sai-playground > *,
.sai-chat-widget-panel > *,
.sd-modal > *,
.sai-dashboard-auth-card > * {
  position: relative;
  z-index: 1;
}

/* Inner playground content should use the playground surface, not create extra boxes */
.sai-home-panel,
.sai-billing-card,
.sai-email-settings,
.sai-stats-grid article,
.sai-playground-mount #streaming-dashboard .sd-studio-sl-card.sl-card,
.sai-playground-mount #streaming-dashboard .sl-card,
.sai-playground-mount #streaming-dashboard .sd-studio-sl-card,
.sai-playground-mount #streaming-dashboard .sd-playground,
.sai-playground-mount #streaming-dashboard .sd-sl-playground,
.sai-playground-mount #streaming-dashboard .sd-dashboard,
.sai-playground-mount #streaming-dashboard .sd-studio-dashboard,
.sai-playground-mount #streaming-dashboard .sd-studio-ground,
.sai-playground-mount #streaming-dashboard .sd-studio-control-panel,
.sai-playground-mount #streaming-dashboard .sai-studio-top-panel,
.sd-dashboard-tools,
.sd-hero-dashboard-tools,
.sd-studio-tools {
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Cards stay soft, not bordered */
.sd-stream-card,
.sd-ai-card,
.sd-image-generator-card,
.sd-ai-cloud-item,
.sd-chat-history-item,
.sd-manage-slots-grid,
.sd-plan-card {
  border: 0 !important;
  outline: 1px solid rgba(255,255,255,.58) !important;
  outline-offset: -1px !important;
  background: rgba(255,255,255,.58) !important;
  box-shadow: 0 18px 46px rgba(15,23,42,.055) !important;
  backdrop-filter: blur(18px) saturate(1.25) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.25) !important;
}

/* Inputs/selects get a subtle liquid well, not a border */
body[data-page="dashboard"] input,
body[data-page="dashboard"] textarea,
body[data-page="dashboard"] select,
body[data-page="dashboard"] .sd-native-select,
.sai-playground-mount input,
.sai-playground-mount textarea,
.sai-playground-mount select,
.sai-chat-widget input,
.sai-chat-widget textarea,
.sai-chat-widget select,
.sai-dashboard-auth-panel input {
  border: 0 !important;
  outline: 1px solid rgba(0,0,0,.055) !important;
  outline-offset: -1px !important;
  background: rgba(255,255,255,.72) !important;
  color: #111111 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), inset 0 -10px 24px rgba(15,23,42,.025) !important;
  backdrop-filter: blur(14px) saturate(1.18) !important;
  -webkit-backdrop-filter: blur(14px) saturate(1.18) !important;
}

/* Buttons: no border-looking shadow */
.sai-primary-btn,
.sai-btn-primary,
.sd-primary-action,
.sd-upload-btn.sd-primary-action,
.sd-add-btn.sd-primary-action,
button[type="submit"] {
  border: 0 !important;
  outline: 0 !important;
  background: #000000 !important;
  color: #ffffff !important;
  box-shadow: var(--sai-liquid-button-shadow) !important;
}

.sai-secondary-btn,
.sd-secondary-action,
.sd-upload-btn.sd-secondary-action,
.sd-add-btn.sd-secondary-action,
.sd-chat-history-actions button,
.sai-chat-widget .sd-chat-plus,
.sd-chat-plus {
  border: 0 !important;
  outline: 1px solid rgba(0,0,0,.05) !important;
  outline-offset: -1px !important;
  background: rgba(255,255,255,.70) !important;
  color: #111111 !important;
  box-shadow: 0 10px 26px rgba(15,23,42,.055) !important;
}

/* File picker can keep a dashed affordance but softer */
.sd-file-picker {
  border: 1px dashed rgba(0,0,0,.12) !important;
  outline: 0 !important;
  background: rgba(255,255,255,.58) !important;
  box-shadow: none !important;
}

/* Avoid clipped/cut shadows inside mounted old pages */
.sai-playground-mount #streaming-dashboard,
.sai-playground-mount #streamingApp,
.sai-playground-mount #streaming-dashboard .sd-app-shell,
.sai-playground-mount #streaming-dashboard .sd-layout-shell,
.sai-playground-mount #streaming-dashboard .sd-sl-card-shell,
.sai-playground-mount #streaming-dashboard .sd-playground,
.sai-playground-mount #streaming-dashboard .sd-sl-playground {
  box-shadow: none !important;
  background: transparent !important;
  border: 0 !important;
  outline: 0 !important;
  overflow: visible !important;
}

/* Keep home pinned to top with no inner panel background */
.sai-home-panel {
  align-content: start !important;
  justify-content: start !important;
}

.sai-home-top,
.sai-stats-grid {
  background: transparent !important;
  box-shadow: none !important;
}

/* More realistic soft hover without a border ring */
.sai-stats-grid article:hover,
.sd-stream-card:hover,
.sd-ai-card:hover,
.sd-image-generator-card:hover,
.sd-ai-cloud-item:hover,
.sd-chat-history-item:hover {
  transform: translateY(-1px) !important;
  background: rgba(255,255,255,.72) !important;
  box-shadow: 0 22px 58px rgba(15,23,42,.08) !important;
}

/* ==========================================================================
   v0.5.1 targeted refinements
   ========================================================================== */

.sai-stats-grid article {
  box-shadow:
    0 18px 48px rgba(15, 23, 42, .08),
    0 3px 12px rgba(15, 23, 42, .045) !important;
}

.sd-ai-card,
.sd-image-generator-card {
  box-shadow:
    0 16px 42px rgba(15, 23, 42, .075),
    0 2px 10px rgba(15, 23, 42, .04) !important;
}

.sd-ai-card:hover,
.sd-image-generator-card:hover {
  box-shadow:
    0 24px 60px rgba(15, 23, 42, .11),
    0 5px 18px rgba(15, 23, 42, .06) !important;
}

.sd-stream-name {
  color: #000 !important;
}

.sd-stream-meta-row {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 8px !important;
}

.sd-stream-status {
  color: #000 !important;
  box-shadow:
    0 10px 24px rgba(15, 23, 42, .075),
    0 2px 8px rgba(15, 23, 42, .04) !important;
}

.sd-chat-history-search {
  height: fit-content !important;
  min-height: 38px !important;
}

/* ==========================================================================
   v0.5.2 home layout shrink fix
   Actual issue: .sai-home-panel was a grid with justify-content:start,
   so the grid tracks shrink-wrapped around .sai-home-top/.sai-stats-grid.
   ========================================================================== */
.sai-playground-mount .sai-home-panel {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  justify-content: stretch !important;
  justify-items: stretch !important;
  align-content: start !important;
}

.sai-playground-mount .sai-home-top,
.sai-playground-mount .sai-stats-grid {
  grid-column: 1 / -1 !important;
  justify-self: stretch !important;
  max-width: none !important;
}

.sai-playground-mount .sai-home-top {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
}

.sai-playground-mount .sai-home-copy {
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

.sai-playground-mount .sai-stats-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

@media (max-width: 980px) {
  .sai-playground-mount .sai-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  .sai-playground-mount .sai-home-top {
    display: grid !important;
  }

  .sai-playground-mount .sai-stats-grid {
    grid-template-columns: 1fr !important;
  }
}

/* SAIUNES dashboard v34 exact requested patch */
@media (max-width: 760px) {
  .sai-playground-mount #streamingApp {
    padding: 0 !important;
  }
}

.sai-chat-head.sai-chat-head-ready {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
}

.sai-chat-head.sai-chat-head-ready .sd-chat-modal-tools.sai-chat-tools-ready {
  margin-left: auto !important;
}

.sai-playground-mount #streaming-dashboard .sai-studio-top-panel {
  box-shadow: 0 18px 44px rgba(15, 23, 42, .08) !important;
}

body[data-page="dashboard"] textarea,
.sai-playground-mount textarea,
.sai-chat-widget textarea {
  padding: 20px !important;
}

/* ==========================================================================
   DASHBOARD BANDWIDTH GRAPH
   ========================================================================== */
.sai-bandwidth-panel {
  width: 100%;
  box-sizing: border-box;
  display: grid;
  gap: 18px;
  padding: 20px;
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .66)),
    rgba(255, 255, 255, .72);
  box-shadow:
    0 22px 50px rgba(0, 0, 0, .075),
    inset 0 1px 0 rgba(255, 255, 255, .92),
    inset 0 -24px 46px rgba(0, 0, 0, .025);
  overflow: hidden;
}

.sai-bandwidth-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.sai-bandwidth-title {
  display: grid;
  gap: 4px;
}

.sai-bandwidth-title span {
  font-size: 12px;
  font-weight: 800;
text-transform: uppercase;
  color: rgba(0, 0, 0, .52);
}

.sai-bandwidth-title strong {
  font-size: clamp(30px, 4vw, 56px);
  line-height: .95;
  color: #000;
}

.sai-bandwidth-title small {
  color: rgba(0, 0, 0, .56);
  font-weight: 650;
}

.sai-bandwidth-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border-radius: 10px;
  background: rgba(0, 0, 0, .045);
}

.sai-bandwidth-tabs button {
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(0, 0, 0, .68);
  font-weight: 800;
  font-size: 12px;
  padding: 9px 13px;
  cursor: pointer;
}

.sai-bandwidth-tabs button.sai-active {
  background: #000;
  color: #fff;
  box-shadow: 0 10px 22px rgba(0, 0, 0, .16);
}

.sai-bandwidth-chart {
  min-height: 220px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
  align-items: end;
  gap: 12px;
  padding: 12px 4px 0;
}

.sai-bandwidth-bar-wrap {
  min-width: 0;
  height: 220px;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
  gap: 10px;
}

.sai-bandwidth-bar {
  width: 100%;
  min-height: 10px;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .86), rgba(0, 0, 0, .66)),
    #000;
  box-shadow:
    0 16px 30px rgba(0, 0, 0, .12),
    inset 0 1px 0 rgba(255, 255, 255, .24);
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8px 5px;
  box-sizing: border-box;
  transition: height .25s ease, transform .2s ease;
}

.sai-bandwidth-bar:hover {
  transform: translateY(-2px);
}

.sai-bandwidth-bar span {
  color: #fff;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.1;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
}

.sai-bandwidth-bar-wrap small {
  text-align: center;
  color: rgba(0, 0, 0, .58);
  font-weight: 800;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sai-bandwidth-empty {
  grid-column: 1 / -1;
  align-self: center;
  justify-self: center;
  color: rgba(0, 0, 0, .58);
  font-weight: 750;
}

@media (max-width: 720px) {
  .sai-bandwidth-head {
    display: grid;
  }

  .sai-bandwidth-tabs {
    width: fit-content;
    max-width: 100%;
  }

  .sai-bandwidth-chart {
    min-height: 180px;
    gap: 8px;
  }

  .sai-bandwidth-bar-wrap {
    height: 180px;
  }

  .sai-bandwidth-bar span {
    font-size: 10px;
  }
}

/* ========================================================================== 
   V36 HOME BANDWIDTH GRAPH LAYOUT
   ========================================================================== */
.sai-home-usage-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, .9fr);
  gap: 22px;
  align-items: stretch;
}

.sai-home-usage-row .sai-bandwidth-panel,
.sai-home-usage-row .sai-stats-grid {
  min-width: 0;
}

.sai-bandwidth-panel,
.sai-stats-grid article {
  box-shadow: 0 24px 60px rgba(15, 23, 42, .11), 0 5px 18px rgba(15, 23, 42, .06) !important;
}

.sai-home-usage-row .sai-stats-grid {
  grid-template-columns: 1fr !important;
  align-self: stretch;
}

.sai-home-usage-row .sai-stats-grid article {
  min-height: 0;
}

.sai-bandwidth-panel {
  position: relative;
  padding-bottom: 44px !important;
}

.sai-bandwidth-note {
  position: absolute;
  left: 20px;
  bottom: 16px;
  margin: 0;
  max-width: calc(100% - 40px);
  color: rgba(0, 0, 0, .62) !important;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.sai-bandwidth-bar {
  overflow: visible !important;
}

.sai-bandwidth-bar span {
  position: absolute !important;
  left: 50%;
  top: -26px;
  transform: translateX(-50%) !important;
  writing-mode: horizontal-tb !important;
  color: #000 !important;
  background: transparent !important;
  font-size: 11px !important;
  font-weight: 850 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  pointer-events: none;
}

@media (max-width: 980px) {
  .sai-home-usage-row {
    grid-template-columns: 1fr;
  }

  .sai-home-usage-row .sai-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  .sai-home-usage-row .sai-stats-grid {
    grid-template-columns: 1fr !important;
  }

  .sai-bandwidth-note {
    position: static;
    max-width: none;
    margin-top: 4px;
  }

  .sai-bandwidth-panel {
    padding-bottom: 20px !important;
  }
}

/* v36 home bandwidth + stats horizontal layout */
.sai-home-usage-row {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: stretch;
  gap: 18px;
}

.sai-home-usage-row .sai-bandwidth-panel {
  flex: 3 1 0;
  min-width: 0;
}

.sai-home-usage-row .sai-stats-grid {
  flex: 1 1 0;
  min-width: 260px;
  display: grid;
  grid-template-columns: 1fr;
  align-content: stretch;
  gap: 14px;
}

.sai-bandwidth-chart {
  padding-top: 34px !important;
  overflow: visible !important;
}

.sai-bandwidth-bar-wrap {
  overflow: visible !important;
}

.sai-bandwidth-bar span {
  position: absolute !important;
  top: -28px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  writing-mode: horizontal-tb !important;
  color: #000 !important;
  font-size: 12px !important;
  font-weight: 850 !important;
  white-space: nowrap !important;
  line-height: 1 !important;
}

.sai-bandwidth-note {
  margin: 0 !important;
  align-self: start;
  justify-self: start;
  color: rgba(0, 0, 0, .58) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  text-align: left !important;
}

@media (max-width: 980px) {
  .sai-home-usage-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .sai-home-usage-row .sai-stats-grid {
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .sai-home-usage-row .sai-stats-grid {
    grid-template-columns: 1fr;
  }
}

/* v37 exact patch: account modal, top avatar, home top removal */
.sai-main-nav .sai-account-nav-btn {
}

.sai-dashboard-shell {
  position: relative !important;
}

.sai-shell-user-card {
  position: fixed !important;
  top: 18px !important;
  right: 18px !important;
  z-index: 120 !important;
  width: 46px !important;
  height: 46px !important;
  min-width: 46px !important;
  max-width: 46px !important;
  padding: 2px !important;
  display: grid !important;
  place-items: center !important;
  overflow: visible !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: pointer !important;
}

.sai-shell-user-card .sai-avatar {
  width: 42px !important;
  height: 42px !important;
  flex: 0 0 42px !important;
}

.sai-shell-user-card .sai-user-card-details {
  position: absolute !important;
  top: calc(100% + 8px) !important;
  right: 0 !important;
  min-width: 220px !important;
  padding: 10px 12px !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, .88) !important;
  backdrop-filter: blur(18px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(150%) !important;
  box-shadow: 0 18px 55px rgba(0, 0, 0, .12) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(-4px) !important;
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease !important;
  text-align: left !important;
  pointer-events: none !important;
}

.sai-shell-user-card:hover .sai-user-card-details,
.sai-shell-user-card:focus-visible .sai-user-card-details {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
}

.sai-shell-user-card strong,
.sai-shell-user-card small {
  color: #000 !important;
}

.sai-home-panel > .sai-home-copy {
  display: grid !important;
  gap: 8px !important;
  margin-bottom: 18px !important;
  width: 100% !important;
  min-width: 0 !important;
}

.sai-home-panel > .sai-home-copy h1,
.sai-home-panel > .sai-home-copy p {
  margin: 0 !important;
}

.sai-home-top {
  display: none !important;
}

.sai-bandwidth-note {
}

.sai-account-backdrop.sd-open,
.sai-account-backdrop.sai-open {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  visibility: visible !important;
}

.sai-account-modal {
  max-width: 440px !important;
}

.sai-account-info-grid {
  display: grid !important;
  gap: 10px !important;
}

.sai-account-info-grid > div {
  display: grid !important;
  gap: 4px !important;
  padding: 12px !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, .62) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .06) !important;
}

.sai-account-info-grid span {
  color: rgba(0, 0, 0, .56) !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
}

.sai-account-info-grid strong {
  color: #000 !important;
  font-size: 15px !important;
  font-weight: 850 !important;
}

@media (max-width: 640px) {
  .sai-shell-user-card {
    top: 12px !important;
    right: 62px !important;
  }
}

/* v0.5.7 requested patch */
.sd-modal-close {
  background: rgba(218, 218, 218, 0.88) !important;
  color: #000 !important;
}
.sai-shell-user-card,
.sai-user-card {
  display: none !important;
}

/* v0.5.8 exact modal + bandwidth patch */
.sd-modal-close {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 38px !important;
  height: 38px !important;
  padding: 0 !important;
  line-height: 1 !important;
  text-align: center !important;
  z-index: 30 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  background: rgba(218, 218, 218, 0.88) !important;
  color: #000 !important;
}

.sai-bandwidth-note {
  margin-top: 0 !important;
}

.sai-bandwidth-chart {
  padding-bottom: 20px !important;
}

/* SAIUNES dashboard v41 chat header alignment patch */
.sai-chat-widget .sai-chat-head.sai-chat-head-ready {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 52px !important;
  gap: 0 !important;
  padding: 10px !important;
  padding-right: 10px !important;
  background: #e9e9e9 !important;
  border-bottom: 0 !important;
}

.sai-chat-widget .sai-chat-head.sai-chat-head-ready > strong {
  width: 100% !important;
  color: #000 !important;
  pointer-events: none !important;
}

.sai-chat-widget .sai-chat-head.sai-chat-head-ready > .sd-chat-modal-tools.sai-chat-tools-ready {
  position: absolute !important;
  top: 50% !important;
  right: 10px !important;
  transform: translateY(-50%) !important;
  z-index: 50 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 6px !important;
  margin-left: 0 !important;
}

/* SAIUNES dashboard v42 chat history background patch */
#sdChatHistoryPanel {
  background: #e9e9e9 !important;
}

/* SAIUNES dashboard v43 library page */
.sai-library-panel {
  display: grid !important;
  gap: 18px !important;
  width: 100% !important;
  min-height: 100% !important;
  align-content: start !important;
}

.sai-library-head {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 18px !important;
}

.sai-library-head h1 {
  margin: 0 !important;
  color: #000 !important;
  font-size: clamp(28px, 4vw, 54px) !important;
line-height: .95 !important;
}

.sai-library-head p {
  margin: 8px 0 0 !important;
  color: rgba(0, 0, 0, .62) !important;
  max-width: 620px !important;
  font-size: 14px !important;
  line-height: 1.55 !important;
}

.sai-library-tools {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
  min-width: min(100%, 520px) !important;
}

.sai-library-tools select,
.sai-library-tools input {
  height: 42px !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, .78) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.92), 0 12px 30px rgba(0,0,0,.06) !important;
  color: #000 !important;
  padding: 0 14px !important;
}

.sai-library-tools input {
  width: min(100%, 280px) !important;
}

.sai-library-tools button {
  height: 42px !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: #000 !important;
  color: #fff !important;
  padding: 0 18px !important;
  font-weight: 850 !important;
  cursor: pointer !important;
}

.sai-library-status {
  color: rgba(0, 0, 0, .62) !important;
  font-size: 13px !important;
  font-weight: 750 !important;
}

.sai-library-grid {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 14px !important;
  width: 100% !important;
}

.sai-library-card {
  display: grid !important;
  gap: 10px !important;
  min-width: 0 !important;
}

.sai-library-media {
  position: relative !important;
  display: block !important;
  aspect-ratio: 1 / 1 !important;
  overflow: hidden !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, .76) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.92), 0 18px 46px rgba(0,0,0,.075) !important;
}

.sai-library-media img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  transition: transform .2s ease !important;
}

.sai-library-card:hover .sai-library-media img {
  transform: scale(1.035) !important;
}

.sai-library-play {
  position: absolute !important;
  inset: auto 10px 10px auto !important;
  width: 34px !important;
  height: 34px !important;
  border-radius: 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(255,255,255,.92) !important;
  color: #000 !important;
  box-shadow: 0 8px 22px rgba(0,0,0,.12) !important;
  font-size: 12px !important;
}

.sai-library-card-body {
  display: grid !important;
  gap: 2px !important;
  min-width: 0 !important;
}

.sai-library-card-body strong {
  color: #000 !important;
  font-size: 13px !important;
  line-height: 1.25 !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
}

.sai-library-card-body small {
  color: rgba(0,0,0,.54) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
}

@media (max-width: 1180px) {
  .sai-library-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
}

@media (max-width: 760px) {
  .sai-library-head { display: grid !important; }
  .sai-library-tools { justify-content: stretch !important; min-width: 0 !important; }
  .sai-library-tools select,
  .sai-library-tools input,
  .sai-library-tools button { width: 100% !important; }
  .sai-library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

/* v0.6.6 library page fix */
.sai-library-panel {
  width: 100%;
  min-height: 100%;
  display: grid;
  align-content: start;
  gap: 18px;
}
.sai-library-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  gap: 18px !important;
}
.sai-library-tools {
  display: flex !important;
  align-items: stretch !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  min-width: min(100%, 520px);
}
.sai-library-tools select,
.sai-library-tools input {
  width: fit-content;
  min-width: 150px;
}
.sai-library-tools input {
  min-width: 230px;
}
.sai-library-loader {
  min-height: 180px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: #000;
}
.sai-library-loader[hidden] {
  display: none !important;
}
.sai-library-loader strong {
  font-size: 22px;
}
.sai-library-loader span {
  color: rgba(0,0,0,.62);
}
.sai-library-status.sai-library-error {
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(255, 238, 238, .95);
  color: #a10000;
  box-shadow: 0 10px 28px rgba(0,0,0,.07);
}
@media (max-width: 760px) {
  .sai-library-header,
  .sai-library-tools {
    display: grid !important;
    justify-content: stretch !important;
    min-width: 0 !important;
  }
  .sai-library-tools select,
  .sai-library-tools input,
  .sai-library-tools button {
    width: 100% !important;
    min-width: 0 !important;
  }
}

/* SAIUNES dashboard v45 library filters, preview modal, and pagination */
.sai-library-tools {
  min-width: min(100%, 880px) !important;
}

.sai-library-tools select,
.sai-library-tools input {
  min-width: 132px !important;
}

.sai-library-tools #saiLibrarySearch {
  min-width: 220px !important;
}

.sai-library-tools [hidden] {
  display: none !important;
}

.sai-library-status-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;
  width: 100% !important;
}

.sai-library-attribution {
  color: rgba(0, 0, 0, .52) !important;
  font-size: 12px !important;
  font-weight: 750 !important;
  text-align: right !important;
}

.sai-library-card button.sai-library-media {
  width: 100% !important;
  border: 0 !important;
  cursor: pointer !important;
  padding: 0 !important;
  text-align: left !important;
}

.sai-library-pagination {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;
  width: 100% !important;
  padding: 6px 0 0 !important;
}

.sai-library-pagination[hidden] {
  display: none !important;
}

.sai-library-pagination span {
  color: #000 !important;
  font-weight: 850 !important;
  font-size: 13px !important;
}

.sd-library-preview-modal {
  width: min(100% - 28px, 980px) !important;
}

.sai-library-preview {
  display: grid !important;
  place-items: center !important;
  width: 100% !important;
  padding: 4px 0 12px !important;
}

.sai-library-preview-image,
.sai-library-preview-video {
  width: 100% !important;
  max-height: min(68vh, 720px) !important;
  object-fit: contain !important;
  border-radius: 10px !important;
  background: #000 !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .10) !important;
}

.sai-library-preview-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
  padding-top: 8px !important;
}

.sai-library-preview-actions a {
  text-decoration: none !important;
  justify-content: center !important;
}

@media (max-width: 760px) {
  .sai-library-status-row {
    display: grid !important;
  }
  .sai-library-attribution {
    text-align: left !important;
  }
  .sai-library-preview-actions a {
    width: 100% !important;
  }
}

/* SAIUNES dashboard v46 library/auth refinements */
.sai-auth-field input::placeholder,
.sai-auth-card .sl-field input::placeholder,
.sai-auth-card .ss-field input::placeholder {
  color: rgba(0, 0, 0, .46) !important;
  opacity: 1 !important;
}

.sai-library-header {
  display: grid !important;
  grid-template-columns: 1fr !important;
  align-items: start !important;
  justify-content: stretch !important;
  gap: 16px !important;
}

#saiLibraryForm.sai-library-tools {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
  align-items: stretch !important;
  justify-content: stretch !important;
  gap: 10px !important;
}

#saiLibraryForm.sai-library-tools select,
#saiLibraryForm.sai-library-tools input,
#saiLibraryForm.sai-library-tools button {
  width: 100% !important;
  min-width: 0 !important;
}

#saiLibrarySearch {
  min-width: min(100%, 220px) !important;
}

.sai-library-attribution {
  display: none !important;
}

#saiLibraryPreviewTitle {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.08 !important;
  max-height: 2.16em !important;
}

@media (max-width: 760px) {
  #saiLibraryForm.sai-library-tools {
    grid-template-columns: 1fr !important;
  }
}

/* SAIUNES dashboard v47 library layout + partner results */
#saiLibraryForm.sai-library-tools {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 12px !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
}

#saiLibraryForm .sai-library-primary-row {
  display: grid !important;
  grid-template-columns: minmax(130px, 190px) minmax(220px, 1fr) !important;
  gap: 10px !important;
  width: 100% !important;
}

#saiLibraryForm .sai-library-filter-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
  align-items: stretch !important;
  gap: 10px !important;
  width: 100% !important;
}

#saiLibraryForm .sai-library-primary-row select,
#saiLibraryForm .sai-library-primary-row input,
#saiLibraryForm .sai-library-filter-grid select,
#saiLibraryForm .sai-library-filter-grid input,
#saiLibraryForm .sai-library-filter-grid button {
  width: 100% !important;
  min-width: 0 !important;
}

.sai-library-status {
  color: rgba(0, 0, 0, .62) !important;
  font-weight: 850 !important;
}

@media (max-width: 760px) {
  #saiLibraryForm .sai-library-primary-row,
  #saiLibraryForm .sai-library-filter-grid {
    grid-template-columns: 1fr !important;
  }
}

/* v0.6.7 exact library/studio refinements */
.sai-playground-mount #streaming-dashboard .sd-studio-header p {
  max-width: 380px !important;
}

.sd-stream-card,
.sai-studio-top-panel,
.sai-playground-mount #streaming-dashboard .sai-studio-top-panel {
  box-shadow: 0 16px 42px rgba(15, 23, 42, .075), 0 2px 10px rgba(15, 23, 42, .04) !important;
}

@media (max-width: 980px) {

}

@media (max-width: 620px) {
  .sai-library-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ========================================================================== 
   v0.6.9 - Restore SAIUNES AI Chat message actions / branch controls
   Keeps old ai.js logic visible in the white dashboard theme.
   ========================================================================== */
.sai-chat-widget .sd-chat-message-actions,
.sai-playground-mount .sd-chat-message-actions,
.sd-chat-message-actions {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  align-self: flex-end !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  margin-top: 7px !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  position: relative !important;
  z-index: 3 !important;
}

.sai-chat-widget .sd-chat-mini-btn,
.sai-chat-widget .sd-chat-code-head button,
.sai-playground-mount .sd-chat-mini-btn,
.sai-playground-mount .sd-chat-code-head button,
.sd-chat-mini-btn,
.sd-chat-code-head button {
  min-height: 28px !important;
  padding: 0 10px !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: rgba(245, 245, 245, .96) !important;
  color: #111 !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .075), 0 1px 4px rgba(15, 23, 42, .05) !important;
  font-size: 11px !important;
  line-height: 1 !important;
  font-weight: 850 !important;
  cursor: pointer !important;
}

.sai-chat-widget .sd-chat-mini-btn:hover,
.sai-chat-widget .sd-chat-mini-btn:focus,
.sai-chat-widget .sd-chat-code-head button:hover,
.sai-chat-widget .sd-chat-code-head button:focus,
.sai-playground-mount .sd-chat-mini-btn:hover,
.sai-playground-mount .sd-chat-mini-btn:focus,
.sai-playground-mount .sd-chat-code-head button:hover,
.sai-playground-mount .sd-chat-code-head button:focus,
.sd-chat-mini-btn:hover,
.sd-chat-mini-btn:focus,
.sd-chat-code-head button:hover,
.sd-chat-code-head button:focus {
  background: #000 !important;
  color: #fff !important;
  transform: translateY(-1px) !important;
}

.sai-chat-widget .sd-chat-branch-controls,
.sai-playground-mount .sd-chat-branch-controls,
.sd-chat-branch-controls {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  margin: 0 4px 0 0 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.sai-chat-widget .sd-chat-branch-controls .sd-chat-mini-btn,
.sai-playground-mount .sd-chat-branch-controls .sd-chat-mini-btn,
.sd-chat-branch-controls .sd-chat-mini-btn {
  min-width: 28px !important;
  padding: 0 8px !important;
}

.sai-chat-widget .sd-chat-branch-controls span,
.sai-playground-mount .sd-chat-branch-controls span,
.sd-chat-branch-controls span {
  color: #111 !important;
  font-size: 12px !important;
  font-weight: 850 !important;
}

.sai-chat-widget .sd-chat-message[data-has-files="1"] .sd-chat-message-actions [data-sai-chat-action="edit"],
.sai-chat-widget .sd-chat-message[data-has-files="1"] .sd-chat-message-actions [data-sai-chat-action="cancel-edit"] {
  display: none !important;
}

/* ========================================================================== 
   SAIUNES VIDEO EDITOR
   ========================================================================== */

/* ==========================================================================
   SAIUNES CLOUD MANAGER
   ========================================================================== */
.sai-cloud-page {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sai-cloud-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  overflow: visible;
}

.sai-cloud-hero-copy {
  min-width: 0;
}

.sai-cloud-hero-control {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.sai-cloud-hero h1 {
  margin: 0 0 6px;
  color: #111;
  font-size: clamp(30px, 4vw, 52px);
  line-height: .95;
}

.sai-cloud-hero p {
  margin: 0;
  color: rgba(0, 0, 0, .60);
  max-width: 720px;
  line-height: 1.55;
}

.sai-cloud-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
}

.sai-cloud-icon-btn span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: 4px;
}

.sai-cloud-toolbar {
  display: grid;
  grid-template-columns: 140px minmax(180px, 1fr) 120px auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .74)),
    rgba(255, 255, 255, .78);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .08);
}

.sai-cloud-toolbar label,
.sai-cloud-modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: rgba(0, 0, 0, .58);
  font-size: 12px;
  font-weight: 800;
}

.sai-cloud-toolbar input,
.sai-cloud-toolbar select,
.sai-cloud-modal-field input {
  width: 100%;
  height: 42px;
  border: 1px solid rgba(0, 0, 0, .10);
  border-radius: 10px;
  background: rgba(255, 255, 255, .94);
  color: #111;
  padding: 0 12px;
  outline: none;
}

.sai-cloud-toolbar input:focus,
.sai-cloud-toolbar select:focus,
.sai-cloud-modal-field input:focus {
  border-color: rgba(255, 153, 0, .72);
  box-shadow: 0 0 0 4px rgba(255, 153, 0, .14);
}

.sai-cloud-path-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 28px;
  padding: 0;
  background: transparent;
  border: 0;
  color: rgba(0, 0, 0, .46);
  font-size: 13px;
  font-weight: 400;
}

.sai-cloud-status-text {
  color: rgba(0, 0, 0, .46);
  font-weight: 400;
}

.sai-cloud-breadcrumbs {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  color: rgba(0, 0, 0, .46);
  font-weight: 400;
}

.sai-cloud-breadcrumbs button {
  appearance: none;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
  font-weight: 400;
  cursor: pointer;
  box-shadow: none;
}

.sai-cloud-breadcrumbs button:hover {
  color: rgba(255, 153, 0, .95);
  background: transparent;
}

.sai-cloud-dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  flex-wrap: wrap;
  min-height: 74px;
  border: 1px dashed rgba(0, 0, 0, .16);
  border-radius: 10px;
  background: rgba(255, 255, 255, .62);
  color: rgba(0, 0, 0, .54);
  text-align: center;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.sai-cloud-dropzone strong {
  color: #111;
}

.sai-cloud-dropzone.sai-cloud-dragging {
  border-color: rgba(255, 153, 0, .86);
  background: rgba(255, 153, 0, .10);
  transform: translateY(-1px);
}

.sai-cloud-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sai-cloud-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .94), rgba(255, 255, 255, .78)),
    rgba(255, 255, 255, .82);
  box-shadow: 0 16px 42px rgba(0, 0, 0, .07);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.sai-cloud-row:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 153, 0, .35);
  box-shadow: 0 20px 54px rgba(0, 0, 0, .10);
}

.sai-cloud-row-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.sai-cloud-row-icon {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 153, 0, .18), rgba(255, 153, 0, .07)),
    rgba(255, 255, 255, .92);
  border: 1px solid rgba(255, 153, 0, .22);
}

.sai-cloud-row-icon svg {
  width: 24px;
  height: 24px;
  fill: #111;
}

.sai-cloud-row-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sai-cloud-row-text strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #111;
  font-size: 14px;
}

.sai-cloud-row-text small,
.sai-cloud-row-meta {
  color: rgba(0, 0, 0, .56);
  font-size: 12px;
}

.sai-cloud-row-meta {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  text-transform: capitalize;
}

.sai-cloud-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.sai-cloud-mini-btn {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 0, 0, .10);
  border-radius: 10px;
  background: rgba(255, 255, 255, .86);
  color: #111;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}

.sai-cloud-mini-btn:hover {
  border-color: rgba(255, 153, 0, .40);
  background: rgba(255, 153, 0, .10);
}

.sai-cloud-mini-btn.sai-cloud-danger {
  color: var(--sai-red);
}

.sai-cloud-modal {
  color: #111;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(255, 255, 255, .90)),
    #fff;
}

.sai-cloud-modal .sd-modal-header h2,
.sai-cloud-modal .sd-modal-header p {
  color: #111;
}

.sai-cloud-modal .sd-modal-header p {
  color: rgba(0, 0, 0, .58);
}

@media (max-width: 980px) {
  .sai-cloud-hero {
    grid-template-columns: 1fr;
  }

  .sai-cloud-hero-actions {
    width: 100%;
    justify-content: stretch;
  }

  .sai-cloud-hero-actions .sd-add-btn {
    flex: 1 1 160px;
  }

  .sai-cloud-toolbar {
    grid-template-columns: 1fr;
  }

  .sai-cloud-row {
    grid-template-columns: 1fr;
  }

  .sai-cloud-row-meta,
  .sai-cloud-row-actions {
    justify-content: flex-start;
  }
}

/* v77 account sidebar + cloud cleanup */
.sai-sidebar-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin-bottom: 18px;
}

.sai-sidebar-brand-row .sai-sidebar-brand {
  flex: 1 1 auto;
  min-width: 0;
  margin-bottom: 0 !important;
}

.sai-brand-account-btn {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid rgba(17, 17, 17, .10);
  background: #ffffff;
  color: #111111;
  cursor: pointer;
  box-shadow: none;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.sai-brand-account-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(17, 17, 17, .22);
  background: #f7f7f7;
}

.sai-brand-account-btn svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.sai-account-modal-actions {
  display: none !important;
}

.sd-danger-action,
.sai-playground-mount .sd-danger-action,
.sai-playground-mount .sd-upload-btn.sd-danger-action,
.sai-playground-mount .sd-add-btn.sd-danger-action,
.sai-chat-widget .sd-danger-action,
.sai-account-modal .sd-danger-action {
  background: var(--sai-red, #ff2b2b) !important;
  color: #ffffff !important;
  border-color: var(--sai-red, #ff2b2b) !important;
  box-shadow: none !important;
}

.sd-danger-action:hover,
.sai-playground-mount .sd-danger-action:hover,
.sai-account-modal .sd-danger-action:hover {
  filter: brightness(.95);
}

.sai-section-kicker {
  display: none !important;
}

@media (max-width: 760px) {
  .sai-sidebar-brand-row {
    margin-bottom: 12px;
  }

  .sai-brand-account-btn {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }
}

/* Sidebar account info */
.sai-brand-account-btn,
.sai-account-backdrop,
.sai-account-modal {
  display: none !important;
}

.sai-sidebar-bottom .sai-sidebar-user-info {
  display: grid;
  gap: 2px;
  width: 100%;
  min-width: 0;
  padding: 10px 0 12px;
  border-bottom: 1px solid rgba(17, 17, 17, .08);
  margin-bottom: 2px;
}

.sai-sidebar-user-info strong,
.sai-sidebar-user-info small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sai-sidebar-user-info strong {
  color: #111111;
  font-size: 13px;
  font-weight: 900;
}

.sai-sidebar-user-info small {
  color: rgba(17, 17, 17, .52);
  font-size: 12px;
  font-weight: 700;
}

/* sdStreamFilter styled native select arrow */
#streaming-dashboard #sdStreamFilter,
.sai-playground-mount #streaming-dashboard #sdStreamFilter {
  appearance: none !important;
  -webkit-appearance: none !important;
  padding-right: 42px !important;
  background-color: #ffffff !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 640'%3E%3Cpath fill='rgba(17,17,17,.62)' d='M297.4 438.6C309.9 451.1 330.2 451.1 342.7 438.6L502.7 278.6C515.2 266.1 515.2 245.8 502.7 233.3C490.2 220.8 469.9 220.8 457.4 233.3L320 370.7L182.6 233.4C170.1 220.9 149.8 220.9 137.3 233.4C124.8 245.9 124.8 266.2 137.3 278.7L297.3 438.7z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 16px 16px !important;
}

/* Global native select style: matches sdStreamFilter with visible arrow */
select,
.sd-native-select {
  appearance: none !important;
  -webkit-appearance: none !important;
  min-height: 38px !important;
  padding-right: 42px !important;
  background-color: #ffffff !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 640'%3E%3Cpath fill='rgba(17,17,17,.62)' d='M297.4 438.6C309.9 451.1 330.2 451.1 342.7 438.6L502.7 278.6C515.2 266.1 515.2 245.8 502.7 233.3C490.2 220.8 469.9 220.8 457.4 233.3L320 370.7L182.6 233.4C170.1 220.9 149.8 220.9 137.3 233.4C124.8 245.9 124.8 266.2 137.3 278.7L297.3 438.7z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 16px 16px !important;
}


/* ========================================================================== 
   SAIUNES patch: sidebar icons, chat select, cloud path status
   ========================================================================== */
.sai-main-nav .sai-nav-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 18px;
}

.sai-main-nav .sai-nav-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: currentColor;
}

.sd-chat-mode-select {
  position: relative !important;
  flex: 0 0 auto !important;
  width: fit-content !important;
  min-width: 170px !important;
}

.sd-chat-mode-select select#sdChatMode,
.sd-chat-mode-select .sd-native-select,
select#sdChatMode {
  display: block !important;
  position: static !important;
  width: 100% !important;
  min-width: 170px !important;
  height: 38px !important;
  min-height: 38px !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  padding: 0 42px 0 12px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(17, 17, 17, .12) !important;
  background-color: #ffffff !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 640'%3E%3Cpath fill='rgba(17,17,17,.62)' d='M297.4 438.6C309.9 451.1 330.2 451.1 342.7 438.6L502.7 278.6C515.2 266.1 515.2 245.8 502.7 233.3C490.2 220.8 469.9 220.8 457.4 233.3L320 370.7L182.6 233.4C170.1 220.9 149.8 220.9 137.3 233.4C124.8 245.9 124.8 266.2 137.3 278.7L297.3 438.7z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 16px 16px !important;
  color: #111111 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .08), inset 0 1px 0 rgba(255, 255, 255, .72) !important;
}

.sd-chat-mode-select .sd-custom-select-btn,
.sd-chat-mode-select .sd-custom-select-menu {
  display: none !important;
}

.sai-cloud-status-text {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  color: rgba(0, 0, 0, .46);
  font-weight: 400;
}

.sai-cloud-status-text[hidden] {
  display: none !important;
}

.sai-cloud-breadcrumbs {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  color: rgba(0, 0, 0, .46);
  font-weight: 400;
}

.sai-cloud-breadcrumbs button {
  appearance: none;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
  font-weight: 400;
  cursor: pointer;
  box-shadow: none;
}

.sai-cloud-breadcrumbs button:hover {
  color: rgba(255, 153, 0, .95);
  background: transparent;
}

.sai-cloud-status-message {
  margin-right: -4px;
  color: rgba(0, 0, 0, .46);
  font-weight: 400;
}

/* ========================================================================== 
   SAIUNES PATCH: unified sidebar nav sizing + playground template spacing
   ========================================================================== */
.sai-main-nav button {
  gap: 10px !important;
  font-size: 1.1em !important;
}

.sai-main-nav .sai-nav-icon,
.sai-main-nav .sai-nav-icon svg {
  width: 24px !important;
  height: 24px !important;
}

.sai-main-nav .sai-nav-icon {
  flex: 0 0 24px !important;
}

.sai-playground {
  padding: 0 !important;
}

.sai-playground-mount {
  padding: 34px !important;
}

.sai-playground-mount > #streaming-dashboard,
.sai-playground-mount > #ai-dashboard,
.sai-playground-mount > .sai-home-panel,
.sai-playground-mount > .sai-billing-card,
.sai-playground-mount > .sai-email-settings,
.sai-playground-mount > .sai-cloud-template,
.sai-playground-mount > .sai-library-template {
  width: 100% !important;
  max-width: 100% !important;
}

.sai-playground-mount > .sai-cloud-template,
.sai-playground-mount > .sai-library-template {
  min-height: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

@media (max-width: 760px) {
  .sai-playground-mount {
    padding: 18px !important;
  }
}
/* ========================================================================== 
   SAIUNES v2.0.6 final dashboard layout + mobile sidebar rewrite
   ========================================================================== */
.sai-dashboard-shell,
.sai-dashboard-shell *,
.sai-dashboard-shell *::before,
.sai-dashboard-shell *::after {
  box-sizing: border-box;
}

.sai-dashboard-shell {
  width: 100% !important;
  max-width: 100% !important;
  grid-template-columns: 270px minmax(0, 1fr) !important;
  gap: 12px !important;
  padding: 0 !important;
}

.sai-sidebar {
  width: 270px !important;
  max-width: 270px !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 12px !important;
  padding: 14px !important;
  overflow-x: hidden !important;
}

.sai-sidebar-brand-row,
.sai-sidebar-brand-row .sai-sidebar-brand,
.sai-sidebar-usage-widget,
.sai-main-nav,
.sai-sidebar-bottom {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

.sai-main-nav {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  padding: 0 !important;
}

.sai-main-nav button {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  justify-content: flex-start !important;
}

.sai-sidebar-bottom {
  flex: 0 0 auto !important;
  display: grid !important;
  gap: 4px !important;
}

.sai-sidebar-bottom a,
.sai-sidebar-bottom button {
  width: fit-content !important;
  max-width: 100% !important;
}

.sai-sidebar-usage-widget {
  flex: 0 0 auto !important;
  display: grid !important;
  gap: 10px !important;
  padding: 12px !important;
  border-radius: 10px !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .76), rgba(255, 255, 255, .54)),
    rgba(255, 255, 255, .72) !important;
  border: 1px solid rgba(17, 17, 17, .08) !important;
  box-shadow: 0 14px 34px rgba(17, 17, 17, .08) !important;
  color: #111111 !important;
}

.sai-sidebar-usage-head,
.sai-sidebar-plan-line,
.sai-sidebar-usage-widget > * {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

.sai-sidebar-usage-head {
  display: grid !important;
  gap: 2px !important;
}

.sai-sidebar-usage-head span {
  color: rgba(17, 17, 17, .48) !important;
  font-size: 10px !important;
  font-weight: 950 !important;
  line-height: 1 !important;
}

.sai-sidebar-usage-head strong {
  color: #111111 !important;
  font-size: 13px !important;
  font-weight: 950 !important;
  line-height: 1.15 !important;
}

.sai-sidebar-usage-grid,
.sai-sidebar-usage-actions {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 8px !important;
}

.sai-sidebar-usage-metric {
  min-width: 0 !important;
  display: grid !important;
  gap: 4px !important;
  padding: 10px !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, .66) !important;
  border: 1px solid rgba(17, 17, 17, .06) !important;
}

.sai-sidebar-usage-metric small {
  color: rgba(17, 17, 17, .52) !important;
  font-size: 10px !important;
  font-weight: 850 !important;
  line-height: 1.1 !important;
}

.sai-sidebar-usage-metric strong {
  color: #111111 !important;
  font-size: 18px !important;
  font-weight: 950 !important;
  line-height: 1 !important;
}

.sai-sidebar-plan-line {
  display: grid !important;
  gap: 7px !important;
}

.sai-sidebar-plan-line .sd-plan-bar {
  width: 100% !important;
  height: 7px !important;
  overflow: hidden !important;
  border-radius: 10px !important;
  background: rgba(17, 17, 17, .08) !important;
}

.sai-sidebar-plan-line .sd-plan-bar i {
  display: block !important;
  height: 100% !important;
  border-radius: 10px !important;
  background: #111111 !important;
  transition: width .22s ease !important;
}

.sai-sidebar-plan-counts {
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  color: rgba(17, 17, 17, .54) !important;
  font-size: 11px !important;
  font-weight: 850 !important;
}

.sai-sidebar-action-btn {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  min-height: 34px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: #111111 !important;
  color: #ffffff !important;
  font-size: 11px !important;
  font-weight: 950 !important;
  cursor: pointer !important;
}

.sai-playground {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  padding: 0 !important;
}

.sai-playground-mount {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  padding: 34px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

.sai-playground-mount > #streaming-dashboard,
.sai-playground-mount > #ai-dashboard,
.sai-playground-mount > .sai-home-panel,
.sai-playground-mount > .sai-billing-card,
.sai-playground-mount > .sai-email-settings,
.sai-playground-mount > .sai-cloud-template,
.sai-playground-mount > .sai-library-template,
.sai-playground-mount #streaming-dashboard,
.sai-playground-mount #streamingApp,
.sai-playground-mount #ai-dashboard,
.sai-playground-mount .sd-app-shell,
.sai-playground-mount .sd-layout-shell,
.sai-playground-mount .sd-sl-card-shell,
.sai-playground-mount .sd-playground,
.sai-playground-mount .sd-sl-playground,
.sai-playground-mount .sd-dashboard,
.sai-playground-mount .sd-studio-dashboard,
.sai-playground-mount .sd-studio-ground {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

.sai-playground-mount #streaming-dashboard .sd-studio-ground {
  display: block !important;
}

.sai-playground-mount #streaming-dashboard .sd-studio-control-panel.sai-studio-top-panel,
.sai-playground-mount #streaming-dashboard .sai-studio-top-panel {
  display: none !important;
}

.sai-sidebar-close {
  display: none;
}

@media (max-width: 980px) {
  body[data-page="dashboard"] {
    overflow: auto !important;
  }

  .sai-dashboard-shell {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 100vh !important;
    height: auto !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
  }

  .sai-playground {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 100vh !important;
    border-radius: 10px !important;
  }

  .sai-playground-mount {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 100vh !important;
    height: auto !important;
    padding: 68px 12px 18px !important;
    overflow-x: hidden !important;
  }

  .sai-playground-mount > *,
  .sai-playground-mount #streaming-dashboard,
  .sai-playground-mount #streamingApp,
  .sai-playground-mount #ai-dashboard,
  .sai-playground-mount .sd-app-shell,
  .sai-playground-mount .sd-layout-shell,
  .sai-playground-mount .sd-sl-card-shell,
  .sai-playground-mount .sd-playground,
  .sai-playground-mount .sd-sl-playground,
  .sai-playground-mount .sd-dashboard,
  .sai-playground-mount .sd-studio-dashboard,
  .sai-playground-mount .sd-studio-ground,
  .sai-playground-mount .sl-card,
  .sai-playground-mount .sd-studio-sl-card,
  .sai-playground-mount .sai-home-panel,
  .sai-playground-mount .sai-cloud-template,
  .sai-playground-mount .sai-library-template {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools,
  .sai-playground-mount .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
    align-items: stretch !important;
    justify-items: stretch !important;
  }

  .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools > *,
  .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools button,
  .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools input,
  .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools select,
  .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools .sd-native-select,
  .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools .sd-custom-select,
  .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools .sd-custom-select-btn,
  .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools #sdStreamFilter,
  .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools #sdStreamSearch,
  .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools #sdAiSearch,
  .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools #sdAiCloudBtn,
  .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools .sai-tool-action-btn {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
    justify-content: center !important;
  }

  .sai-mobile-menu-btn {
    z-index: 2147483600 !important;
  }

  body.sai-sidebar-open .sai-mobile-menu-btn,
  html.sai-sidebar-open .sai-mobile-menu-btn,
  body.sai-sidebar-open > .sai-mobile-brand,
  html.sai-sidebar-open body > .sai-mobile-brand {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  .sai-sidebar {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    z-index: 2147483650 !important;
    width: min(360px, 92vw) !important;
    max-width: 92vw !important;
    min-width: 0 !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
    padding: 16px !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    color: #111111 !important;
    box-shadow: 24px 0 60px rgba(0, 0, 0, .18) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    transform: translateX(-110%) !important;
    transition: transform .18s ease !important;
  }

  body.sai-sidebar-open .sai-sidebar,
  html.sai-sidebar-open .sai-sidebar {
    transform: translateX(0) !important;
  }

  body.sai-sidebar-open::after,
  html.sai-sidebar-open::after {
    content: "" !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483600 !important;
    background: rgba(0, 0, 0, .42) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
  }

  .sai-sidebar-close {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    z-index: 3 !important;
    width: 38px !important;
    max-width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    display: grid !important;
    place-items: center !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 10px !important;
    background: rgba(17, 17, 17, .06) !important;
    color: #111111 !important;
    font-size: 28px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    cursor: pointer !important;
  }

  .sai-sidebar-brand-row {
    padding-right: 46px !important;
  }
}


/* ==========================================================================
   SAIUNES v2.0.7 layout corrections
   ========================================================================== */
.sai-sidebar {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
}

.sai-sidebar-brand-row {
  order: 0 !important;
}

.sai-sidebar-usage-widget {
  order: 1 !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

.sai-main-nav {
  order: 2 !important;
}

.sai-sidebar-bottom {
  order: 3 !important;
}

@media (max-width: 760px) {
  .sai-playground,
  .sai-frame,
  .sai-playground-mount,
  .sai-playground-mount > *,
  .sai-playground-mount #streaming-dashboard,
  .sai-playground-mount .sd-app-shell,
  .sai-playground-mount .sd-layout-shell,
  .sai-playground-mount .sd-studio-dashboard,
  .sai-playground-mount .sd-studio-ground {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools,
  .sai-playground-mount .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    box-sizing: border-box !important;
  }

  .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools > *,
  .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools button,
  .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools input,
  .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools select,
  .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools .sd-native-select,
  .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools .sd-custom-select,
  .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools .sd-custom-select-btn,
  .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools #sdStreamFilter,
  .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools #sdStreamSearch,
  .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools #sdAiFilter,
  .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools #sdAiSearch,
  .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools #sdAiCloudBtn,
  .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools .sai-tool-action-btn,
  .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools .sd-add-btn,
  .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools .sd-upload-btn,
  .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools .sd-secondary-btn,
  .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools .sd-primary-action,
  .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools .sd-secondary-action {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
    flex-basis: auto !important;
    box-sizing: border-box !important;
    justify-content: center !important;
  }

  .sai-sidebar {
    z-index: 2147483650 !important;
    background: #ffffff !important;
  }

  .sai-sidebar-brand-row {
    order: 0 !important;
  }

  .sai-sidebar-usage-widget {
    order: 1 !important;
  }

  .sai-main-nav {
    order: 2 !important;
  }

  .sai-sidebar-bottom {
    order: 3 !important;
  }
}


/* ==========================================================================
   SAIUNES v2.0.8 sidebar logo + mobile tool button width corrections
   ========================================================================== */
.sai-sidebar .sai-sidebar-brand,
body.sai-sidebar-open .sai-sidebar .sai-sidebar-brand,
html.sai-sidebar-open .sai-sidebar .sai-sidebar-brand {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

@media (max-width: 760px) {
  .sai-sidebar .sai-sidebar-brand-row {
    display: flex !important;
    width: 100% !important;
  }

  .sai-sidebar .sai-sidebar-brand {
    width: calc(100% - 50px) !important;
    max-width: calc(100% - 50px) !important;
  }

  .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools,
  .sai-playground-mount .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools .sd-add-btn.sd-primary-action.sai-tool-action-btn,
  .sai-playground-mount .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools .sd-add-btn.sd-primary-action.sai-tool-action-btn,
  #streaming-dashboard .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools .sd-add-btn.sd-primary-action.sai-tool-action-btn {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 100% !important;
    box-sizing: border-box !important;
    justify-content: center !important;
  }
}


/* SAIUNES v2.0.9 mobile AI chat rewrite */
.sai-chat-mobile-close {
  display: none;
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  margin-left: auto;
  border-radius: 10px;
  border: 1px solid rgba(17, 17, 17, .12);
  background: #ffffff;
  color: #111111;
  font-size: 24px;
  line-height: 1;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 980px) {
  body.sai-mobile-chat-open .sai-mobile-menu-btn,
  html.sai-mobile-chat-open .sai-mobile-menu-btn {
    display: none !important;
  }

  .sai-chat-widget.sai-chat-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483000 !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-width: none !important;
    max-height: none !important;
    padding: 0 !important;
    border-radius: 10px !important;
  }

  .sai-chat-widget.sai-chat-fullscreen .sai-chat-widget-panel,
  .sai-chat-widget.sai-chat-fullscreen .sai-chat-panel-ready {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 10px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .sai-chat-widget.sai-chat-fullscreen .sai-chat-head {
    flex: 0 0 auto !important;
    width: 100% !important;
    min-height: 58px !important;
    padding: max(12px, env(safe-area-inset-top)) 14px 12px !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    border-radius: 10px !important;
  }

  .sai-chat-widget.sai-chat-fullscreen .sai-chat-mobile-close,
  body.sai-mobile-chat-open .sai-chat-mobile-close {
    display: inline-grid !important;
    place-items: center !important;
  }

  .sai-chat-widget.sai-chat-fullscreen .sai-chat-mount,
  .sai-chat-widget.sai-chat-fullscreen .sai-chat-embedded,
  .sai-chat-widget.sai-chat-fullscreen .sd-chat-shell,
  .sai-chat-widget.sai-chat-fullscreen .sd-chat-main {
    width: 100% !important;
    max-width: none !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    box-sizing: border-box !important;
  }

  .sai-chat-widget.sai-chat-fullscreen .sd-chat-history-list {
    margin-top: 0 !important;
  }
}


/* SAIUNES v2.0.10 AI chat history mobile fix */
@media (max-width: 980px) {
  .sai-chat-widget.sai-chat-fullscreen .sd-chat-history-toggle,
  .sai-chat-widget.sai-chat-fullscreen .sai-chat-mount .sd-chat-history-toggle,
  .sd-modal.sd-chat-fullscreen .sd-chat-history-toggle {
    display: inline-grid !important;
    place-items: center !important;
  }

  .sai-chat-widget.sai-chat-fullscreen .sd-chat-history-panel[hidden],
  .sd-modal.sd-chat-fullscreen .sd-chat-history-panel[hidden] {
    display: none !important;
  }

  .sai-chat-widget.sai-chat-fullscreen .sd-chat-history-panel:not([hidden]),
  .sd-modal.sd-chat-fullscreen .sd-chat-history-panel:not([hidden]) {
    display: flex !important;
  }
}


/* ==========================================================================
   SAIUNES v2.0.14 sidebar usage widget placement
   ========================================================================== */
.sai-main-nav > .sai-sidebar-usage-widget {
  order: -1 !important;
  width: 100% !important;
  max-width: 100% !important;
  flex: 0 0 auto !important;
  box-sizing: border-box !important;
}

.sai-sidebar-plan-line .sd-plan-bar i {
  background: #111111 !important;
}

/* ==========================================================================
   SAIUNES v2.0.15 sidebar vertical centering + usage widget button isolation
   ========================================================================== */
.sai-sidebar {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
}

.sai-sidebar-brand-row {
  flex: 0 0 auto !important;
}

.sai-main-nav {
  flex: 1 1 auto !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 12px 0 !important;
  box-sizing: border-box !important;
}

.sai-sidebar-bottom {
  flex: 0 0 auto !important;
}

.sai-main-nav > .sai-sidebar-usage-widget {
  order: -1 !important;
  flex: 0 0 auto !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 0 8px !important;
  box-sizing: border-box !important;
}

.sai-main-nav .sai-sidebar-usage-actions {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 8px !important;
  width: 100% !important;
}

.sai-main-nav .sai-sidebar-usage-widget .sai-sidebar-action-btn {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  min-height: 36px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 0 10px !important;
  border: 1px solid rgba(17, 17, 17, .10) !important;
  border-radius: 10px !important;
  background: #111111 !important;
  color: #ffffff !important;
  box-shadow: 0 10px 22px rgba(17, 17, 17, .14) !important;
  font-size: 11px !important;
  font-weight: 950 !important;
  line-height: 1 !important;
  text-align: center !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  appearance: none !important;
}

.sai-main-nav .sai-sidebar-usage-widget .sai-sidebar-action-btn:hover {
  transform: translateY(-1px) !important;
  background: #000000 !important;
  color: #ffffff !important;
  box-shadow: 0 14px 26px rgba(17, 17, 17, .18) !important;
}

.sai-main-nav .sai-sidebar-usage-widget .sai-sidebar-action-btn:active {
  transform: translateY(0) !important;
}

.sai-sidebar-plan-line .sd-plan-bar i {
  background: #000000 !important;
}

@media (max-width: 760px) {
  .sai-main-nav {
    justify-content: flex-start !important;
    padding: 12px 0 !important;
  }

  .sai-main-nav > .sai-sidebar-usage-widget {
    margin-bottom: 10px !important;
  }
}

/* SAIUNES v2.0.16: AI chat fullscreen removed; conversations use sd-modal */
.sai-chat-widget .sd-chat-fullscreen-toggle {
  display: none !important;
}

.sai-chat-widget.sai-chat-fullscreen,
.sai-chat-widget.sai-chat-fullscreen .sai-chat-widget-panel,
body.sai-chat-fullscreen .sai-chat-panel {
  position: fixed !important;
  right: 24px !important;
  bottom: 24px !important;
  top: auto !important;
  left: auto !important;
  width: min(420px, calc(100vw - 28px)) !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: calc(100vh - 48px) !important;
}

body.sai-chat-fullscreen .sai-playground,
body.sai-chat-fullscreen .sai-sidebar {
  display: initial !important;
}

.sd-chat-history-modal-backdrop.sd-open {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
  z-index: 10050 !important;
}

.sd-chat-history-modal {
  width: min(720px, calc(100vw - 32px)) !important;
  max-height: min(760px, calc(100vh - 40px)) !important;
  min-height: min(620px, calc(100vh - 40px)) !important;
  display: grid !important;
  grid-template-rows: 1fr !important;
  padding: 18px !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #111 !important;
  overflow: hidden !important;
}

.sd-chat-history-modal-slot {
  min-height: 0 !important;
  display: grid !important;
}

.sd-chat-history-modal-panel,
.sd-chat-history-modal .sd-chat-history-panel {
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  display: grid !important;
  grid-template-rows: auto auto 1fr !important;
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.sd-chat-history-modal .sd-chat-history-head {
  padding-right: 42px !important;
}

.sd-chat-history-modal .sd-chat-history-list {
  margin-top: 0 !important;
  min-height: 0 !important;
  overflow: auto !important;
}

@media (max-width: 980px) {
  .sai-chat-widget.sai-chat-small .sai-chat-widget-panel {
    width: min(420px, calc(100vw - 28px)) !important;
    max-height: calc(100vh - 90px) !important;
  }

  .sd-chat-history-modal-backdrop.sd-open {
    padding: 10px !important;
  }

  .sd-chat-history-modal {
    width: calc(100vw - 20px) !important;
    min-height: calc(100vh - 20px) !important;
    max-height: calc(100vh - 20px) !important;
  }
}

/* SAIUNES v2.0.17: chat history panel base reset */
.sd-chat-history-panel.sai-chat-history-sidebar{background:transparent!important;background-image:none!important;box-shadow:none!important;border:0!important;}

/* SAIUNES v2.0.18: conversation dropdown panel */
#sdChatHistoryPanel {
  background: #d7d7d7 !important;
  padding: 30px !important;
  border-radius: 10px !important;
  margin: -3px !important;
}

/* SAIUNES v2.0.19 mobile bandwidth chart one-line fix */
@media (max-width: 640px) {
  .sai-bandwidth-panel {
    min-width: 0 !important;
    overflow: hidden !important;
  }

  #saiBandwidthChart,
  .sai-bandwidth-chart[aria-label="Bandwidth chart"] {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-auto-flow: column !important;
    grid-auto-columns: minmax(42px, 1fr) !important;
    grid-template-columns: none !important;
    align-items: end !important;
    gap: 8px !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    padding: 32px 2px 18px !important;
    overscroll-behavior-x: contain !important;
    -webkit-overflow-scrolling: touch !important;
  }

  #saiBandwidthChart .sai-bandwidth-bar-wrap,
  .sai-bandwidth-chart[aria-label="Bandwidth chart"] .sai-bandwidth-bar-wrap {
    width: 100% !important;
    min-width: 42px !important;
    max-width: none !important;
    height: 170px !important;
  }

  #saiBandwidthChart .sai-bandwidth-bar,
  .sai-bandwidth-chart[aria-label="Bandwidth chart"] .sai-bandwidth-bar {
    min-width: 0 !important;
  }

  #saiBandwidthChart .sai-bandwidth-empty,
  .sai-bandwidth-chart[aria-label="Bandwidth chart"] .sai-bandwidth-empty {
    grid-column: auto !important;
    min-width: 100% !important;
  }
}

/* v2.0.20: home panel padding cleanup */
.sai-home-panel {
  padding: 0 !important;
}

/* SAIUNES v2.0.21 mobile bandwidth chart vertical-height fix */
@media (max-width: 640px) {
  #saiBandwidthChart,
  .sai-bandwidth-chart[aria-label="Bandwidth chart"] {
    display: grid !important;
    grid-auto-flow: row !important;
    grid-auto-columns: initial !important;
    grid-template-columns: repeat(auto-fit, minmax(28px, 1fr)) !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 300px !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    gap: 6px !important;
    padding: 42px 0 22px !important;
    overscroll-behavior-x: auto !important;
    -webkit-overflow-scrolling: auto !important;
  }

  #saiBandwidthChart .sai-bandwidth-bar-wrap,
  .sai-bandwidth-chart[aria-label="Bandwidth chart"] .sai-bandwidth-bar-wrap {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 240px !important;
  }

  #saiBandwidthChart .sai-bandwidth-bar,
  .sai-bandwidth-chart[aria-label="Bandwidth chart"] .sai-bandwidth-bar {
    width: 100% !important;
    min-width: 0 !important;
  }

  #saiBandwidthChart .sai-bandwidth-bar span,
  .sai-bandwidth-chart[aria-label="Bandwidth chart"] .sai-bandwidth-bar span {
    font-size: 9px !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
    transform: translate(-50%, -10px) rotate(-90deg) !important;
    transform-origin: center !important;
  }

  #saiBandwidthChart .sai-bandwidth-bar-wrap small,
  .sai-bandwidth-chart[aria-label="Bandwidth chart"] .sai-bandwidth-bar-wrap small {
    font-size: 9px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  #saiBandwidthChart .sai-bandwidth-empty,
  .sai-bandwidth-chart[aria-label="Bandwidth chart"] .sai-bandwidth-empty {
    grid-column: 1 / -1 !important;
    min-width: 0 !important;
    width: 100% !important;
  }
}


/* SAIUNES v2.0.26 complete home rebuild */
.sai-playground-mount .sai-home-panel,
.sai-home-panel.sai-home-v26 {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 16px !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.sai-home-v26 .sai-home-hero {
  width: 100% !important;
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: start !important;
  gap: 18px !important;
  padding: clamp(18px, 3vw, 30px) !important;
  border-radius: 10px !important;
  background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.035)) !important;
  border: 1px solid rgba(255,255,255,.09) !important;
  box-shadow: none !important;
  overflow: hidden !important;
}

.sai-home-v26 .sai-home-hero-copy {
  display: grid !important;
  gap: 12px !important;
  min-width: 0 !important;
}

.sai-home-v26 .sai-home-eyebrow,
.sai-home-v26 .sai-home-metric-card span,
.sai-home-v26 .sai-home-work-card span {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  width: fit-content !important;
  color: var(--sai-orange) !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  line-height: 1.2 !important;
  text-transform: uppercase !important;
}

.sai-home-v26 h1 {
  max-width: 760px !important;
  margin: 0 !important;
  color: var(--sai-text) !important;
  font-size: clamp(48px, 7vw, 96px) !important;
  line-height: .88 !important;
  font-weight: 950 !important;
}

.sai-home-v26 .sai-home-hero-copy p {
  max-width: 740px !important;
  margin: 0 !important;
  color: var(--sai-muted) !important;
  font-size: clamp(15px, 1.5vw, 18px) !important;
  line-height: 1.55 !important;
}

.sai-home-v26 .sai-home-actions {
  justify-self: end !important;
  align-self: start !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 10px !important;
  width: 190px !important;
  max-width: 190px !important;
  margin: 0 !important;
}

.sai-home-v26 .sai-home-actions button,
.sai-home-v26 .sai-home-work-card button {
  width: 100% !important;
  min-height: 42px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 10px !important;
  padding: 0 14px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  cursor: pointer !important;
}

.sai-home-v26 .sai-home-metrics {
  width: 100% !important;
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

.sai-home-v26 .sai-home-metric-card,
.sai-home-v26 .sai-home-work-card {
  min-width: 0 !important;
  display: grid !important;
  gap: 8px !important;
  align-content: start !important;
  padding: 16px !important;
  border-radius: 10px !important;
  background: rgba(255,255,255,.055) !important;
  border: 1px solid rgba(255,255,255,.09) !important;
  box-shadow: 0 18px 45px rgba(0, 0, 0, .22) !important;
}

.sai-home-metric-card,
.sai-home-v26 .sai-home-metric-card {
  box-shadow: 0 18px 45px rgba(0, 0, 0, .22) !important;
}

.sai-home-work-card,
.sai-home-v26 .sai-home-work-card {
  box-shadow: 0 18px 45px rgba(0, 0, 0, .22) !important;
}

.sai-home-v26 .sai-home-metric-card-main {
  background: linear-gradient(180deg, rgba(255,153,0,.18), rgba(255,255,255,.055)) !important;
}

.sai-home-v26 .sai-home-metric-card strong {
  color: var(--sai-text) !important;
  font-size: clamp(28px, 4vw, 44px) !important;
  line-height: 1 !important;
}

.sai-home-v26 .sai-home-metric-card small,
.sai-home-v26 .sai-home-work-card p {
  margin: 0 !important;
  color: var(--sai-muted) !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
}

.sai-home-v26 .sai-home-bandwidth-panel {
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  border-radius: 10px !important;
  overflow: hidden !important;
}

.sai-home-v26 .sai-bandwidth-chart[aria-label="Bandwidth chart"],
.sai-home-v26 #saiBandwidthChart {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
}

.sai-home-v26 .sai-home-workspace {
  width: 100% !important;
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: 1.2fr 1fr 1fr !important;
  gap: 12px !important;
}

.sai-home-v26 .sai-home-work-card {
  grid-template-rows: auto 1fr auto !important;
  gap: 12px !important;
}

.sai-home-v26 .sai-home-work-card div {
  display: grid !important;
  gap: 6px !important;
}

.sai-home-v26 .sai-home-work-card strong {
  color: var(--sai-text) !important;
  font-size: 18px !important;
  line-height: 1.2 !important;
}

.sai-home-v26 .sai-home-work-card button {
  justify-self: start !important;
  width: fit-content !important;
  background: rgba(255,255,255,.08) !important;
  color: var(--sai-text) !important;
  border: 1px solid rgba(255,255,255,.12) !important;
}

.sai-home-v26 .sai-home-work-card-primary {
  background: linear-gradient(180deg, rgba(255,153,0,.14), rgba(255,255,255,.055)) !important;
}

@media (max-width: 1100px) {
  .sai-home-v26 .sai-home-hero {
    grid-template-columns: 1fr !important;
  }

  .sai-home-v26 .sai-home-actions {
    justify-self: stretch !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    width: 100% !important;
    max-width: none !important;
  }

  .sai-home-v26 .sai-home-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .sai-home-v26 .sai-home-workspace {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 640px) {
  .sai-home-v26 {
    gap: 12px !important;
  }

  .sai-home-v26 .sai-home-hero,
  .sai-home-v26 .sai-home-metric-card,
  .sai-home-v26 .sai-home-work-card {
    padding: 14px !important;
  }

  .sai-home-v26 h1 {
    font-size: clamp(42px, 15vw, 62px) !important;
    line-height: .9 !important;
  }

  .sai-home-v26 .sai-home-actions,
  .sai-home-v26 .sai-home-metrics,
  .sai-home-v26 .sai-home-workspace {
    grid-template-columns: 1fr !important;
  }

  .sai-home-v26 .sai-home-actions,
  .sai-home-v26 .sai-home-actions button,
  .sai-home-v26 .sai-home-work-card button {
    width: 100% !important;
    max-width: none !important;
  }

  .sai-home-v26 .sai-bandwidth-chart[aria-label="Bandwidth chart"],
  .sai-home-v26 #saiBandwidthChart {
    min-height: 300px !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
  }
}

/* v2.0.29: Home metrics + bandwidth flex layout */
.sai-home-v26 .sai-home-usage-flex {
  width: 100% !important;
  min-width: 0 !important;
  display: flex !important;
  align-items: stretch !important;
  gap: 14px !important;
}

.sai-home-v26 .sai-home-usage-flex .sai-home-metrics {
  flex: 0 0 300px !important;
  width: 300px !important;
  min-width: 260px !important;
  max-width: 320px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  order: 1 !important;
}

.sai-home-v26 .sai-home-usage-flex .sai-home-bandwidth-panel {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  order: 2 !important;
}

.sai-home-v26 .sai-home-usage-flex .sai-home-metric-card {
  width: 100% !important;
  min-width: 0 !important;
  flex: 1 1 0 !important;
}

@media (max-width: 980px) {
  .sai-home-v26 .sai-home-usage-flex {
    flex-direction: column !important;
  }

  .sai-home-v26 .sai-home-usage-flex .sai-home-metrics {
    flex: none !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  .sai-home-v26 .sai-home-usage-flex .sai-home-metrics {
    grid-template-columns: 1fr !important;
  }
}

/* ========================================================================== 
   Studio usage widgets moved out of sidebar
   ========================================================================== */
.sai-studio-usage-widget {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.sai-studio-coins-usage {
  grid-template-columns: minmax(0, 1fr) minmax(220px, .45fr);
}

.sai-studio-usage-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid rgba(17, 17, 17, .08);
  border-radius: 10px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, .08);
}

.sai-studio-usage-card span {
  font-size: 12px;
  font-weight: 800;
  color: rgba(17, 17, 17, .58);
}

.sai-studio-usage-card strong {
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1;
  color: #111111;
}

.sai-studio-usage-card small {
  font-size: 12px;
  line-height: 1.35;
  color: rgba(17, 17, 17, .58);
}

.sai-studio-usage-action {
  align-items: stretch;
}

.sai-studio-usage-btn {
  width: 100% !important;
  min-height: 42px;
  justify-content: center !important;
}

@media (max-width: 900px) {
  .sai-studio-usage-widget,
  .sai-studio-coins-usage {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .sai-studio-usage-widget,
  .sai-studio-coins-usage {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .sai-studio-usage-card {
    padding: 14px;
  }
}
