#streaming-dashboard {
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--sai-text);
}

#streaming-dashboard *,
#streaming-dashboard *::before,
#streaming-dashboard *::after {
  box-sizing: border-box;
}

#streaming-dashboard svg {
  width: 22px;
  height: 22px;
  display: block;
  fill: currentColor;
}

body[data-page="streaming"] {
  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));
}

.st-dashboard-loading {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.st-error-card {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.st-error-card h2 {
  margin: 0 0 10px;
  font-size: 32px;
  line-height: 1.1;
}

.st-error-card p {
  margin: 0;
  color: var(--sai-muted);
  line-height: 1.5;
}

.sd-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;
}


.st-dashboard-loading .sai-library-loader {
  min-height: 220px;
  width: min(100%, 420px);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
  color: var(--sai-text);
}

.st-dashboard-loading .sai-library-loader strong {
  font-size: 22px;
  line-height: 1.15;
}

.st-dashboard-loading .sai-library-loader span {
  color: var(--sai-muted);
  line-height: 1.45;
}

.st-dashboard-loading .sai-spinner {
  margin-bottom: 8px;
}

.sd-app-shell.sd-layout-shell {
  display: block;
  width: 100%;
  min-height: 100vh;
}

.sd-mobile-topnav,
.sd-mobile-sidebar-backdrop,
.sd-sidebar,
.sd-hero,
.sd-stats-grid,
.sd-plan-actions-grid {
  display: none !important;
}

.sd-playground {
  width: min(100% - 28px, 1240px);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(18px, 4vw, 42px) 0;
}

.sd-studio-sl-card.sl-card {
  max-width: none;
  min-height: calc(100vh - 84px);
  padding: clamp(20px, 3vw, 34px);
  border-radius: 10px;
  position: relative;
  overflow: visible;
  background: var(--sai-glass-bg);
}

.sd-studio-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
  padding: 0;
  background: transparent;
}

.sd-studio-topbar .sl-back-home,
#streaming-dashboard .sl-back-home {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .05)),
    rgba(255, 255, 255, .065);
  color: #fff;
  font-size: 24px;
  font-weight: 850;
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  transition: background .16s ease, transform .16s ease, color .16s ease;
}

.sd-studio-topbar .sl-back-home:hover,
#streaming-dashboard .sl-back-home:hover {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .075)),
    rgba(255, 255, 255, .09);
  color: #fff;
  transform: translateY(-1px);
}

.sd-studio-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.sd-studio-brand img {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  object-fit: cover;
}

.sd-studio-brand span {
  display: grid;
  gap: 1px;
}

.sd-studio-brand strong {
  font-size: 14px;
}

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

.sd-studio-header {
  margin-bottom: 22px;
}

.sd-studio-header h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 64px);
  line-height: .92;
}

.sd-studio-header p {
  margin: 12px 0 0;
  max-width: 540px;
  color: var(--sai-muted);
  font-size: 15px;
  line-height: 1.55;
}

.sd-studio-ground {
  width: 100%;
  display: block;
  gap: 24px;
  overflow: visible !important;
}

.sd-studio-control-panel {
  width: 320px;
  flex: 0 0 320px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .032));
  backdrop-filter: var(--sai-glass-blur);
  -webkit-backdrop-filter: var(--sai-glass-blur);
  height: auto;
  max-height: none;
  overflow: visible;
}

.sd-studio-dashboard {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  overflow: visible !important;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sd-plan-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .07);
  order: 2;
}

.sd-plan-card strong {
  color: #fff;
  font-size: 16px;
  font-weight: 850;
}

.sd-plan-card strong b {
  color: var(--sai-orange);
}

.sd-plan-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(255, 255, 255, .10);
}

.sd-plan-bar i {
  display: block;
  height: 100%;
  border-radius: 10px;
  background: var(--sai-orange);
}

.sd-plan-counts {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--sai-soft);
  font-size: 13px;
}

.sd-plan-counts em {
  font-style: normal;
}

.sd-plan-counts b {
  color: #fff;
}

.sd-studio-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  order: 3;
}

.sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools {
  width: 100%;
  display: flex;
  flex-direction: row;
  gap: 8px;
  order: 0;
}

.sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools #sdStreamFilter {
  flex: 0 0 190px;
}

.sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools #sdStreamSearch {
  flex: 1 1 auto;
}

.sd-studio-tools {
  order: 1;
}

.sd-add-btn,
.sd-upload-btn,
.sd-secondary-btn,
.sd-danger-btn,
.sd-control-btn,
.sd-notice-btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 16px;
  border-radius: 10px;
  background: var(--sai-card-2);
  color: #fff;
  font-size: 14px;
  font-weight: 850;
}

.sd-add-btn,
.sd-upload-btn,
.sd-secondary-btn,
.sd-danger-btn,
.sd-control-btn,
.sd-notice-btn,
.sd-card-menu-btn,
.sd-card-menu button {
  transition: background .16s ease, color .16s ease, transform .16s ease;
}

.sd-add-btn:hover,
.sd-upload-btn:hover,
.sd-secondary-btn:hover,
.sd-control-btn:hover,
.sd-notice-btn:hover {
  background: var(--sai-card-3);
  color: #fff;
  transform: translateY(-1px);
}

.sd-primary-action {
  background: var(--sai-orange);
  color: #fff;
}

.sd-primary-action:hover,
.sd-add-btn.sd-primary-action:hover {
  background: #ffaa24;
  color: #fff;
}

.sd-secondary-action,
.sd-secondary-btn {
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.sd-danger-btn {
  background: rgba(255, 91, 110, .16);
  color: #ffd5dc;
}

.sd-danger-btn:hover {
  background: rgba(255, 91, 110, .24);
  color: #fff;
  transform: translateY(-1px);
}

.sd-studio-actions .sd-add-btn {
  width: 100%;
}

#sdStreamFilter,
#sdStreamSearch {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background-color: var(--sai-input);
  color: #fff;
  outline: none;
  font-size: 14px;
  font-weight: 750;
}

#sdStreamFilter {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 640'%3E%3Cpath fill='rgba(255,255,255,.72)' 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");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
}

#sdStreamSearch::placeholder {
  color: var(--sai-soft);
}

.sd-stream-list {
  width: 100%;
  display: grid;
  overflow: visible;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-content: start;
}

.sd-empty-streams,
.sd-no-stream-matches {
  grid-column: 1 / -1;
  min-height: 180px;
  display: block;
  place-items: center;
  color: var(--sai-soft);
  text-align: left;
  font-size: 14px;
  font-weight: 750;
}

.sd-stream-card {
  position: relative;
  min-width: 0;
  display: block;
  padding: 16px 58px 16px 16px;
  border-radius: 10px;
  overflow: visible;
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 255, 255, .13), transparent 28%),
    radial-gradient(circle at 86% 12%, rgba(255, 153, 0, .16), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .032));
  backdrop-filter: var(--sai-glass-blur);
  -webkit-backdrop-filter: var(--sai-glass-blur);
}

.sd-stream-card::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .10), transparent 48%);
  pointer-events: none;
}

.sd-stream-thumb {
  display: none !important;
}

.sd-stream-details {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 0;
  border-radius: 10px;
  background: transparent;
}

.sd-stream-title-row {
  min-width: 0;
  padding-right: 4px;
}

.sd-stream-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
  font-size: 18px;
  line-height: 1.15;
  font-weight: 900;
}

.sd-stream-meta-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr;
  align-items: end;
  gap: 12px;
  text-transform: uppercase;
}

.sd-stream-updated {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--sai-soft);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 700;
}

.sd-stream-status {
  align-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .09);
  color: rgba(255, 255, 255, .86);
  font-size: 12px;
  font-weight: 900;
  text-transform: capitalize;
  white-space: nowrap;
}

.sd-stream-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 10px;
  background: var(--sai-soft);
}

.sd-stream-status[data-status="live"]::before,
.sd-stream-status[data-status="running"]::before {
  background: var(--sai-green);
}

.sd-stream-status[data-status="processing"]::before,
.sd-stream-status[data-status="starting"]::before,
.sd-stream-status[data-status="uploading"]::before,
.sd-stream-status[data-status="deleting"]::before,
.sd-stream-status[data-status="stopping"]::before,
.sd-stream-status[data-status="restarting"]::before {
  background: var(--sai-orange);
}

.sd-stream-status[data-status="error"]::before {
  background: var(--sai-red);
}

.sd-stream-status[data-status="ready"]::before {
  background: var(--sai-blue);
}

.sd-replacement-ready,
.sd-replacement-processing {
  width: fit-content;
  padding: 7px 10px;
  border-radius: 10px;
  color: #b8d8ff;
  background: rgba(90, 167, 255, .12);
  font-size: 12px;
  font-weight: 800;
}

.sd-replacement-processing {
  color: #ffd894;
  background: rgba(255, 153, 0, .12);
}

.sd-stream-card.sd-menu-open {
  z-index: 50;
}

.sd-stream-card-menu-wrap {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 60;
  border-radius: 10px;
}

.sd-stream-card-menu-wrap:hover .sd-card-menu-btn,
.sd-stream-card-menu-wrap:focus-within .sd-card-menu-btn,
.sd-card-menu-btn:hover {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .24), rgba(255, 255, 255, .07)),
    rgba(15, 15, 15, .62);
  color: #fff;
  transform: translateY(-1px);
}

.sd-card-menu-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: rgba(255, 255, 255, .86);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .17), rgba(255, 255, 255, .045)),
    rgba(15, 15, 15, .54);
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
}

.sd-card-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 176px;
  padding: 6px;
  border-radius: 10px;
  z-index: 70;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .105), rgba(255, 255, 255, .045)),
    rgba(20, 20, 20, .86);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
}

.sd-card-menu.sd-open {
  display: grid;
  gap: 3px;
}

.sd-card-menu.sd-open-up {
  top: auto;
  bottom: calc(100% + 8px);
}

.sd-card-menu button {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, .82);
  font-size: 13px;
  font-weight: 750;
  text-align: left;
  white-space: nowrap;
}

.sd-card-menu button:hover {
  background: var(--sai-card-3);
  color: #fff;
}

.sd-card-menu .sd-menu-danger {
  color: #ff9aa6;
}

.sd-menu-disabled {
  opacity: .3 !important;
}

.sd-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, .58);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .16s ease, visibility .16s ease;
}

.sd-modal-backdrop.sd-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.sd-modal {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: min(92vh, 780px);
  overflow: auto;
  padding: 24px;
  border-radius: 10px;
  background: var(--sai-modal);
  color: #fff;
  box-shadow: none;
}

.sd-small-modal,
.sd-confirm-modal {
  max-width: 520px;
}

.sd-watch-modal {
  max-width: 860px;
}

.sd-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: 24px;
  line-height: 1;
}

.sd-modal-header {
  padding-right: 42px;
}

.sd-modal-header h2,
.sd-confirm-copy h2 {
  margin: 0;
  color: #fff;
  font-size: 25px;
  line-height: 1.15;
  font-weight: 850;
}

.sd-modal-header p,
.sd-confirm-copy p {
  margin: 9px 0 20px;
  color: var(--sai-muted);
  font-size: 14px;
  line-height: 1.55;
}

.sd-form {
  display: grid;
  gap: 14px;
}

.sd-field {
  display: grid;
  gap: 7px;
}

.sd-field input,
.sd-field select,
.sd-custom-select-btn {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: var(--sai-input);
  color: #fff;
  outline: none;
}

.sd-field small {
  color: var(--sai-soft);
  font-size: 12px;
  line-height: 1.45;
}

.sd-file-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 10px;
  background: unset;
  border: 2px dashed var(--sai-card-2);
  color: #fff;
  cursor: pointer;
}

.sd-file-picker input {
  display: none;
}

.sd-file-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 10px;
  background: #fff;
  color: #050507;
  font-weight: 900;
}

.sd-file-picker strong {
  display: block;
  color: #fff;
}

.sd-file-picker small {
  display: block;
  margin-top: 3px;
  color: var(--sai-soft);
}

.sd-form-error,
.sd-command-message,
.sd-upload-stats,
.sd-stream-meta,
.sd-delete-loading,
.sd-modal-loading,
.sd-upload-overlay-progress,
.sd-stat-grid > div,
.sd-schedule-picker-grid,
.sd-choice-card,
.sd-custom-select-menu {
  border-radius: 10px;
  background: rgba(255, 255, 255, .06);
}

.sd-form-error {
  padding: 12px;
  color: #ffb4bd;
  background: rgba(255, 91, 110, .10);
  font-size: 13px;
  font-weight: 750;
}

.sd-command-message {
  padding: 12px;
  color: #b7ffd8;
  background: rgba(40, 233, 140, .10);
  font-size: 13px;
  font-weight: 750;
}

.sd-modal-loading,
.sd-delete-loading {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  color: var(--sai-muted);
  background: transparent;
}

.sd-progress {
  height: 10px;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(255, 255, 255, .10);
}

.sd-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: 10px;
  background: var(--sai-orange);
  transition: width .16s ease;
}

.sd-upload-stats,
.sd-upload-overlay-progress {
  padding: 12px;
}

.sd-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.sd-stat-grid > div {
  padding: 10px;
}

.sd-stat-grid span {
  display: block;
  color: var(--sai-soft);
  font-size: 11px;
  font-weight: 800;
}

.sd-stat-grid strong {
  display: block;
  margin-top: 4px;
  color: #fff;
  font-size: 12px;
}

.sd-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.sd-watch-player,
.sd-watch-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}

.sd-watch-player video,
.sd-watch-frame video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
}

.sd-choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sd-choice-card {
  flex: 1 1 calc(50% - 5px);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px;
  cursor: pointer;
}

.sd-choice-card:has(input:checked) {
  background: rgba(255, 255, 255, .10);
}

.sd-choice-card strong {
  display: block;
  color: #fff;
  font-size: 14px;
}

.sd-choice-card small {
  display: block;
  margin-top: 4px;
  color: var(--sai-soft);
  font-size: 12px;
  line-height: 1.4;
}

.sd-schedule-picker-grid {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 10px;
  background: var(--sai-card-2);
}

.sd-schedule-picker-fields,
.sd-schedule-date-fields,
.sd-schedule-time-fields {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sd-schedule-picker-arrow {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .045);
  color: rgba(255, 255, 255, .58);
  font-size: 12px;
  font-weight: 750;
  text-align: center;
}

.sd-time-disabled {
  opacity: .45;
  pointer-events: none;
}

.sd-native-select {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.sd-custom-select {
  position: relative;
  min-width: 0;
}

.sd-custom-select-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  text-align: left;
}

.sd-custom-select-btn::after {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-right: 2px solid rgba(255, 255, 255, .55);
  border-bottom: 2px solid rgba(255, 255, 255, .55);
  transform: rotate(45deg) translateY(-2px);
}

.sd-custom-select-options,
.sd-custom-select-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 2147483600;
  display: none;
  max-height: 245px;
  overflow: auto;
  padding: 6px;
  border-radius: 10px;
  background: #282828;
}

.sd-custom-select.sd-open .sd-custom-select-options,
.sd-custom-select.sd-open .sd-custom-select-menu {
  display: grid;
  gap: 3px;
}

.sd-custom-select-options button,
.sd-custom-select-menu button {
  width: 100%;
  min-height: 38px;
  padding: 0 11px;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, .82);
  text-align: left;
  font-weight: 750;
}

.sd-slot-price-line {
  display: inline-flex;
  width: fit-content;
  margin: 0 0 14px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .07);
  color: rgba(255, 255, 255, .86);
  font-size: 13px;
  font-weight: 850;
}

.sd-manage-slots-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.sd-manage-slots-grid > div {
  padding: 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .055);
}

.sd-manage-slots-grid span {
  display: block;
  color: var(--sai-soft);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.sd-manage-slots-grid strong {
  display: block;
  margin-top: 6px;
  color: #fff;
  font-size: 22px;
  font-weight: 900;
}

@media (min-width: 981px) {
  .sd-studio-sl-card.sl-card,
  .sd-playground,
  .sd-studio-ground,
  .sd-studio-dashboard,
  .sd-stream-list {
    overflow: visible !important;
  }

  .sd-studio-control-panel {
    position: static !important;
    align-self: flex-start !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    transform: none !important;
    z-index: 20;
  }
}

@media (min-width: 1380px) {
  .sd-playground {
    width: min(100% - 56px, 1480px);
  }

  .sd-stream-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .sd-playground {
    width: min(100% - 22px, 1240px);
    padding: 12px 0 32px;
  }

  .sd-studio-sl-card.sl-card {
    min-height: calc(100vh - 24px);
    padding: 18px;
    border-radius: 10px;
  }

  .sd-studio-ground {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    overflow: visible !important;
  }

  .sd-studio-control-panel {
    width: 100%;
    flex: none;
    position: static !important;
    top: auto !important;
    height: auto;
    max-height: none;
    overflow: visible !important;
    transform: none !important;
  }

  .sd-stream-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .sd-stream-card {
    padding: 15px 54px 15px 15px;
  }

  .sd-stream-meta-row {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 10px;
  }

  .sd-stream-status {
    align-self: start;
  }

  .sd-studio-topbar {
    align-items: flex-start;
    margin-bottom: 18px;
  }

  .sd-studio-brand img {
    width: 40px;
    height: 40px;
  }

  .sd-studio-header h1 {
    font-size: 36px;
  }

  .sd-stat-grid,
  .sd-schedule-date-fields,
  .sd-schedule-time-fields,
  .sd-manage-slots-grid {
    grid-template-columns: 1fr;
  }

  .sd-choice-card {
    flex-basis: 100%;
  }

  .sd-confirm-actions {
    flex-direction: column-reverse;
  }

  .sd-secondary-btn,
  .sd-danger-btn {
    width: 100%;
  }

  .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools {
    flex-direction: column;
  }

  .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools #sdStreamFilter,
  .sd-dashboard-tools.sd-hero-dashboard-tools.sd-studio-tools #sdStreamSearch {
    flex: none;
    width: 100%;
  }
}

/* v27 white theme shared override */
body[data-page="dashboard"], body { background: #fafafa !important; background-image: none !important; color: #111111 !important; }
.sd-app-shell, .sd-layout-shell, .sd-sl-card-shell, .sd-playground, .sl-card, .sd-studio-sl-card, .sd-modal, .sd-card, .sd-stream-card, .sd-image-generator-card, .sd-plan-card, .sd-chat-shell, .sd-chat-main, .sd-chat-messages, .sd-chat-composer, .sd-chat-history-panel, .sd-ai-user-coins-card, .sd-ai-cloud-modal, .sd-small-modal { background: #ffffff !important; background-image: none !important; border-color: rgba(17,17,17,.08) !important; box-shadow: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; color: #111111 !important; }
.sd-modal-backdrop { background: rgba(250,250,250,.92) !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
.sd-primary-action, .sd-add-btn.sd-primary-action, .sd-upload-btn.sd-primary-action, .sl-btn, .ss-btn, .sd-chat-send-btn { background: #000000 !important; color: #ffffff !important; border-color: #000000 !important; box-shadow: none !important; }
.sd-secondary-action, .sd-add-btn.sd-secondary-action, .sd-upload-btn.sd-secondary-action, .sl-btn-secondary, .ss-btn-secondary, .sd-chat-modal-tools button { background: #ffffff !important; color: #111111 !important; border: 1px solid rgba(17,17,17,.10) !important; box-shadow: none !important; }
input, select, textarea, .sd-native-select, .sd-custom-select-btn { background: #ffffff !important; color: #111111 !important; border-color: rgba(17,17,17,.12) !important; }
p, small, em, .sd-muted, .sd-card-meta, .sd-ai-type, .sd-chat-message-meta, .sd-chat-history-meta { color: rgba(17,17,17,.62) !important; }
h1, h2, h3, strong, b, label, .sd-chat-message, .sd-chat-message-content { color: #111111 !important; }

/* ==========================================================================
   v0.5.1 targeted refinements
   ========================================================================== */
.sai-home-panel {
  width: 100% !important;
}

.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;
}

/* Keep sdStreamFilter arrow visible after white-theme select overrides */
#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 v2.0.7 mobile tools width fix */
@media (max-width: 760px) {
  .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;
    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;
  }
}


/* SAIUNES v2.0.8 mobile tool action width */
@media (max-width: 760px) {
  .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,
  .sai-playground-mount .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;
  }
}
