:root {
  color-scheme: dark;
  --bg: #07111c;
  --bg-deep: #040b13;
  --surface: rgba(13, 27, 42, 0.84);
  --surface-strong: #0d1b2a;
  --surface-soft: rgba(18, 37, 56, 0.68);
  --line: rgba(157, 190, 219, 0.16);
  --line-strong: rgba(112, 184, 235, 0.34);
  --text: #f4f8fc;
  --text-soft: #bed0df;
  --muted: #7f97aa;
  --primary: #55b9f3;
  --primary-strong: #2699dc;
  --teal: #5bd7bd;
  --warning: #f4c765;
  --danger: #ff7f87;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.26);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg-deep);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 14% -8%, rgba(45, 145, 205, 0.18), transparent 34%),
    radial-gradient(circle at 88% 9%, rgba(53, 190, 164, 0.11), transparent 26%),
    linear-gradient(180deg, #081522 0, var(--bg) 330px, var(--bg-deep) 100%);
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
summary:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(85, 185, 243, 0.32);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px clamp(18px, 3vw, 48px);
  border-bottom: 1px solid rgba(155, 190, 220, 0.12);
  background: rgba(5, 13, 22, 0.82);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(18px) saturate(135%);
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(122, 199, 242, 0.26);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(43, 145, 207, 0.25), rgba(43, 190, 164, 0.14));
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 3px;
  object-fit: contain;
}

.brand-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  overflow: hidden;
  font-size: 16px;
  font-weight: 720;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0.19em;
}

.topbar-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
}

.user-menu {
  position: relative;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 4px 6px;
  border-radius: 8px;
  cursor: pointer;
  list-style: none;
}

.user-chip::-webkit-details-marker {
  display: none;
}

.user-chip:hover,
.user-menu[open] > .user-chip {
  background: rgba(85, 185, 243, 0.09);
}

.user-chevron {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.user-menu[open] .user-chevron {
  transform: rotate(180deg);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 160px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-strong);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.user-dropdown .logout-button {
  width: 100%;
  justify-content: flex-start;
}

.user-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(91, 215, 189, 0.28);
  border-radius: 50%;
  color: #dffaf4;
  background: linear-gradient(145deg, rgba(50, 162, 194, 0.42), rgba(42, 172, 143, 0.32));
  font-size: 13px;
  font-weight: 760;
}

.user-copy {
  display: grid;
  gap: 1px;
  text-align: right;
}

.user-copy strong {
  max-width: 150px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-copy small {
  color: var(--muted);
  font-size: 10px;
}

.topbar-primary,
.logout-button,
.primary-button,
.secondary-button,
.danger-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.035);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.topbar-primary svg,
.logout-button svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.topbar-primary {
  border-color: rgba(85, 185, 243, 0.48);
  color: #f5fbff;
  background: linear-gradient(135deg, rgba(43, 154, 217, 0.95), rgba(37, 127, 183, 0.95));
  box-shadow: 0 8px 22px rgba(33, 133, 190, 0.18);
}

.topbar-primary:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #39a9e8, #2d8ac4);
}

.logout-button {
  padding: 0 12px;
}

.logout-button:hover,
.secondary-button:hover {
  border-color: rgba(85, 185, 243, 0.34);
  color: #e9f7ff;
  background: rgba(85, 185, 243, 0.09);
}

.page-main {
  width: min(1680px, 100%);
  flex: 1 0 auto;
  margin: 0 auto;
  padding: clamp(24px, 3vw, 44px) clamp(18px, 3vw, 48px) 70px;
}

.is-experience-user .page-main {
  padding-top: clamp(22px, 2.4vw, 34px);
}

.page-footer {
  flex: 0 0 auto;
  padding: 13px 18px 15px;
  border-top: 1px solid rgba(155, 190, 220, 0.12);
  color: #d1dbe4;
  background: #050b12;
  text-align: center;
  font-size: 12px;
  line-height: 1.7;
}

.page-footer p {
  margin: 0;
}

.page-footer a {
  color: #28aef2;
  text-decoration: none;
}

.page-footer a:hover {
  color: #71ccff;
  text-decoration: underline;
}

.overview {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  margin-bottom: 22px;
  padding: 4px 0 22px;
  border-bottom: 1px solid var(--line);
}

.overview::after {
  content: "";
  position: absolute;
  right: 3%;
  bottom: -1px;
  width: min(420px, 42vw);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(85, 185, 243, 0.72), transparent);
}

.overview-copy {
  min-width: 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  color: #80c9ef;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.2em;
}

.eyebrow span {
  width: 20px;
  height: 2px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--teal), var(--primary));
  box-shadow: 0 0 14px rgba(85, 185, 243, 0.48);
}

.overview h1 {
  margin: 0;
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 760;
  letter-spacing: -0.035em;
}

.overview-description {
  max-width: 680px;
  margin: 10px 0 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.7;
}

.overview-copy .access-hint {
  width: fit-content;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  padding: 6px 10px;
  border: 1px solid rgba(91, 215, 189, 0.18);
  border-radius: 999px;
  color: #9bc8c0;
  background: rgba(53, 153, 134, 0.08);
  font-size: 10px;
  line-height: 1.4;
}

.access-hint::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 8px rgba(91, 215, 189, 0.52);
}

.overview-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(112px, 1fr));
  gap: 10px;
  margin: 0;
}

.overview-stats > div {
  min-width: 112px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(18, 39, 57, 0.78), rgba(11, 25, 39, 0.7));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
}

.overview-stats dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
}

.overview-stats dd {
  margin: 0;
  color: #eff9ff;
  font-size: 22px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.scene-browser {
  min-width: 0;
}

.browser-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.browser-heading h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 720;
}

.browser-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.browser-controls {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(300px, 1fr) auto;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(12, 27, 41, 0.68);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(12px);
}

.search-box {
  min-width: 0;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 11px;
  border: 1px solid rgba(155, 190, 220, 0.18);
  border-radius: 10px;
  background: rgba(3, 11, 19, 0.5);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.search-box:focus-within {
  border-color: rgba(85, 185, 243, 0.52);
  box-shadow: 0 0 0 3px rgba(85, 185, 243, 0.08);
}

.search-box svg {
  width: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 13px;
}

.search-box input::placeholder {
  color: #668094;
}

.search-box input::-webkit-search-cancel-button {
  display: none;
}

.search-box button {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  padding: 0 0 2px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.055);
  font-size: 18px;
  line-height: 1;
}

.search-box button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.select-controls {
  display: flex;
  gap: 10px;
}

.select-field {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding-left: 11px;
  border: 1px solid rgba(155, 190, 220, 0.18);
  border-radius: 10px;
  background: rgba(3, 11, 19, 0.5);
}

.select-field > span {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.dropdown-field {
  position: relative;
  padding-right: 5px;
}

.dropdown-field:focus-within,
.dropdown-field.is-open {
  border-color: rgba(95, 208, 181, 0.56);
  box-shadow: 0 0 0 2px rgba(95, 208, 181, 0.14);
}

.dropdown-trigger {
  height: 100%;
  min-width: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 7px 0 2px;
  border: 0;
  color: var(--text-soft);
  background: transparent;
  font-size: 12px;
}

.dropdown-trigger:hover {
  color: #edf8ff;
}

.dropdown-trigger:focus-visible {
  outline: 0;
}

.dropdown-trigger > svg {
  width: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: #8ee5d0;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transition: transform 0.18s ease;
}

.dropdown-field.is-open .dropdown-trigger > svg {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 5px);
  right: -1px;
  width: 172px;
  padding: 5px;
  border: 1px solid rgba(95, 208, 181, 0.42);
  border-radius: 8px;
  background: #091722;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(98, 183, 255, 0.08);
  animation: dropdown-menu-in 0.16s ease-out;
}

.dropdown-option {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  color: #c8d9e6;
  background: transparent;
  text-align: left;
  font-size: 12px;
}

.dropdown-option:hover,
.dropdown-option:focus-visible {
  outline: 0;
  color: #eff9ff;
  background: #163247;
}

.dropdown-option[aria-selected="true"] {
  color: #f3fffc;
  background: linear-gradient(90deg, rgba(95, 208, 181, 0.26), rgba(98, 183, 255, 0.16));
}

.dropdown-option > svg {
  width: 16px;
  fill: none;
  stroke: #8ee5d0;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  opacity: 0;
}

.dropdown-option[aria-selected="true"] > svg {
  opacity: 1;
}

@keyframes dropdown-menu-in {
  from {
    opacity: 0;
    transform: translateY(-5px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.filter-stack {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 14px 0 18px;
}

.scope-tabs {
  min-width: 0;
  max-width: 100%;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
}

.scope-tabs::-webkit-scrollbar {
  display: none;
}

.scope-tab,
.category-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
  white-space: nowrap;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.scope-tab {
  min-height: 34px;
  padding: 0 13px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 650;
}

.scope-tab::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #536c80;
}

.scope-tab:hover {
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.04);
}

.scope-tab[aria-pressed="true"] {
  border-color: rgba(85, 185, 243, 0.27);
  color: #e7f7ff;
  background: rgba(57, 157, 216, 0.14);
}

.scope-tab[aria-pressed="true"]::before {
  background: var(--primary);
  box-shadow: 0 0 10px rgba(85, 185, 243, 0.7);
}

.filter-count {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  color: #a8bed0;
  background: rgba(255, 255, 255, 0.06);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.category-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.category-label {
  flex: 0 0 auto;
  color: #718a9f;
  font-size: 11px;
}

.category-chips {
  min-width: 0;
  max-width: 100%;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-chips::-webkit-scrollbar {
  display: none;
}

.category-chip {
  min-height: 30px;
  padding: 0 11px;
  border-color: var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.024);
  font-size: 11px;
}

.category-chip:hover {
  border-color: rgba(91, 215, 189, 0.28);
  color: #dff8f2;
}

.category-chip[aria-pressed="true"] {
  border-color: rgba(91, 215, 189, 0.34);
  color: #dffaf4;
  background: rgba(66, 180, 156, 0.13);
}

.scene-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 20px;
}

.scene-card {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: inherit;
  background: linear-gradient(180deg, rgba(16, 34, 50, 0.96), rgba(8, 19, 30, 0.98));
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.2);
  text-decoration: none;
  isolation: isolate;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.scene-card::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
}

.scene-card-main {
  min-width: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}

.scene-card-main[href] {
  cursor: pointer;
}

.scene-card-main:focus-visible {
  outline: 3px solid rgba(85, 185, 243, 0.38);
  outline-offset: -3px;
}

.scene-card-main.is-disabled {
  cursor: default;
  opacity: 0.72;
}

.scene-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background:
    radial-gradient(circle at 76% 20%, rgba(85, 185, 243, 0.22), transparent 30%),
    linear-gradient(145deg, #132c41, #091724 62%, #102d34);
}

.scene-cover::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(180deg, rgba(3, 10, 17, 0.06) 44%, rgba(3, 10, 17, 0.78) 100%);
  pointer-events: none;
}

.scene-cover img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.45s ease, filter 0.3s ease;
}

.cover-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 7px;
  color: #8db0c7;
  text-align: center;
}

.cover-fallback svg {
  width: 44px;
  margin: 0 auto;
  fill: none;
  stroke: #66bada;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.2;
  opacity: 0.8;
}

.cover-fallback span {
  font-size: 11px;
}

.cover-badges {
  position: absolute;
  z-index: 3;
  top: 12px;
  right: 12px;
  left: 12px;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.type-badge,
.status-badge {
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  backdrop-filter: blur(9px);
}

.type-badge {
  max-width: 66%;
  overflow: hidden;
  color: #e6fbf6;
  background: rgba(10, 49, 58, 0.78);
  border-color: rgba(91, 215, 189, 0.3);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-badge::before {
  content: "";
  width: 5px;
  height: 5px;
  margin-right: 5px;
  border-radius: 50%;
  background: currentColor;
}

.status-published {
  color: #adf3d8;
  background: rgba(9, 68, 53, 0.8);
  border-color: rgba(91, 215, 189, 0.3);
}

.status-draft {
  color: #ffe3a0;
  background: rgba(78, 57, 10, 0.82);
  border-color: rgba(244, 199, 101, 0.32);
}

.status-unpublished,
.status-placeholder {
  color: #d3dfeb;
  background: rgba(44, 57, 70, 0.82);
  border-color: rgba(177, 197, 216, 0.23);
}

.scene-card-body {
  min-height: 205px;
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 17px 18px 16px;
}

.scene-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 10px;
}

.scene-scope {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene-scope::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 8px rgba(91, 215, 189, 0.56);
}

.scene-updated {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}

.scene-card h3 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  min-height: 49px;
  margin: 0;
  color: #f5faff;
  font-size: 18px;
  font-weight: 720;
  letter-spacing: -0.015em;
  line-height: 1.36;
}

.scene-description {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  min-height: 63px;
  margin: 8px 0 15px;
  color: #a9bdce;
  font-size: 12px;
  line-height: 1.72;
}

.scene-card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px solid rgba(157, 190, 219, 0.11);
}

.open-cue {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #88cff5;
  font-size: 11px;
  font-weight: 680;
}

.open-cue svg {
  width: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transition: transform 0.18s ease;
}

.scene-card-actions {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 12px 16px 15px;
  border-top: 1px solid rgba(157, 190, 219, 0.12);
  background: rgba(4, 13, 21, 0.34);
}

.card-action {
  min-width: 66px;
  min-height: 34px;
  flex: 1 1 66px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #b8cbd9;
  background: rgba(255, 255, 255, 0.035);
  font-size: 10.5px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.card-action svg {
  width: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.card-action:hover:not(:disabled) {
  border-color: rgba(85, 185, 243, 0.34);
  color: #e9f7ff;
  background: rgba(85, 185, 243, 0.09);
}

.card-action.primary {
  border-color: rgba(85, 185, 243, 0.44);
  color: #f4fbff;
  background: linear-gradient(135deg, rgba(43, 154, 217, 0.92), rgba(37, 127, 183, 0.92));
}

.card-action.primary:hover:not(:disabled) {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #39a9e8, #2d8ac4);
}

.card-action.danger {
  border-color: rgba(255, 127, 135, 0.28);
  color: #ffadb2;
  background: rgba(178, 47, 59, 0.09);
}

.card-action.danger:hover:not(:disabled) {
  border-color: rgba(255, 127, 135, 0.48);
  color: #ffd1d4;
  background: rgba(198, 55, 68, 0.18);
}

.card-action:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.card-action[data-busy="true"]::before,
.confirm-actions button[data-busy="true"]::before {
  content: "";
  width: 11px;
  height: 11px;
  border: 1.5px solid rgba(255, 255, 255, 0.26);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.confirm-dialog {
  width: min(430px, calc(100vw - 28px));
  padding: 0;
  border: 1px solid rgba(255, 127, 135, 0.26);
  border-radius: 18px;
  color: var(--text);
  background: #0b1926;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.56);
}

.copy-confirm-dialog {
  border-color: rgba(85, 185, 243, 0.3);
}

.copy-confirm-dialog .confirm-icon {
  border-color: rgba(85, 185, 243, 0.28);
  color: var(--primary);
  background: rgba(43, 154, 217, 0.11);
}

.confirm-dialog::backdrop {
  background: rgba(2, 7, 12, 0.76);
  backdrop-filter: blur(7px);
}

.confirm-card {
  display: grid;
  justify-items: center;
  padding: 30px 28px 26px;
  text-align: center;
}

.confirm-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 127, 135, 0.25);
  border-radius: 16px;
  color: var(--danger);
  background: rgba(193, 50, 63, 0.1);
}

.confirm-icon svg {
  width: 28px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.confirm-card h2 {
  margin: 16px 0 0;
  font-size: 20px;
}

.confirm-card p {
  margin: 9px 0 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.7;
}

.confirm-actions {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 24px;
}

.confirm-dialog[data-busy="true"] .confirm-card {
  cursor: progress;
}

#delete-dialog[data-busy="true"] .confirm-icon {
  border-color: rgba(255, 127, 135, 0.42);
  background: rgba(193, 50, 63, 0.16);
  box-shadow: 0 0 0 7px rgba(193, 50, 63, 0.06);
}

#delete-dialog[data-busy="true"] .confirm-icon svg {
  display: none;
}

#delete-dialog[data-busy="true"] .confirm-icon::before {
  content: "";
  width: 25px;
  height: 25px;
  border: 2.5px solid rgba(255, 255, 255, 0.24);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

#delete-dialog[data-busy="true"] .confirm-card p {
  color: #c7d6e2;
}

#delete-dialog[data-error="true"] .confirm-card {
  border-color: rgba(255, 127, 135, 0.42);
}

#delete-dialog[data-error="true"] .confirm-card p {
  color: #ffdadd;
}

.confirm-actions button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.danger-button {
  border-color: rgba(255, 127, 135, 0.4);
  color: #fff5f5;
  background: linear-gradient(135deg, #c44350, #9f3340);
}

.danger-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #d5515e, #b43b49);
}

.danger-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.toast-region {
  position: fixed;
  z-index: 80;
  top: 82px;
  left: 50%;
  transform: translateX(-50%);
  width: min(360px, calc(100vw - 28px));
  display: grid;
  gap: 9px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 14px;
  border: 1px solid rgba(91, 215, 189, 0.3);
  border-radius: 11px;
  color: #e8faf6;
  background: rgba(11, 43, 45, 0.94);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.34);
  font-size: 12px;
  line-height: 1.55;
  backdrop-filter: blur(14px);
  animation: toast-in 0.2s ease both;
}

.toast.error {
  border-color: rgba(255, 127, 135, 0.32);
  color: #ffe7e9;
  background: rgba(66, 26, 34, 0.95);
}

.toast::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 9px rgba(91, 215, 189, 0.55);
}

.toast.error::before {
  background: var(--danger);
  box-shadow: 0 0 9px rgba(255, 127, 135, 0.5);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.state-panel {
  min-height: 300px;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 40px 20px;
  border: 1px dashed rgba(157, 190, 219, 0.2);
  border-radius: var(--radius-lg);
  color: var(--muted);
  text-align: center;
  background: rgba(10, 23, 35, 0.46);
}

.state-panel h3,
.state-panel strong {
  margin: 13px 0 0;
  color: var(--text-soft);
  font-size: 17px;
}

.state-panel p {
  max-width: 520px;
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.7;
}

.loading-ring {
  width: 34px;
  height: 34px;
  border: 2px solid rgba(85, 185, 243, 0.16);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.message-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(244, 199, 101, 0.22);
  border-radius: 14px;
  color: var(--warning);
  background: rgba(244, 199, 101, 0.07);
}

.message-icon svg {
  width: 28px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.message-actions {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-top: 18px;
}

.primary-button,
.secondary-button {
  border: 1px solid var(--line);
}

.primary-button {
  border-color: rgba(85, 185, 243, 0.5);
  color: #f5fbff;
  background: linear-gradient(135deg, #2b9ad9, #257fb7);
  box-shadow: 0 8px 22px rgba(33, 133, 190, 0.2);
}

.primary-button:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #39a9e8, #2d8ac4);
}

.empty-graphic {
  width: 78px;
  height: 54px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 5px;
}

.empty-graphic i {
  width: 18px;
  border: 1px solid rgba(85, 185, 243, 0.28);
  border-radius: 5px 5px 2px 2px;
  background: rgba(85, 185, 243, 0.07);
}

.empty-graphic i:nth-child(1) { height: 32px; }
.empty-graphic i:nth-child(2) { height: 48px; }
.empty-graphic i:nth-child(3) { height: 39px; }

.empty-panel .secondary-button {
  margin-top: 17px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (hover: hover) and (pointer: fine) {
  .scene-card[data-openable="true"]:hover {
    z-index: 1;
    transform: translateY(-4px);
    border-color: var(--line-strong);
    box-shadow: 0 26px 62px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(85, 185, 243, 0.04);
  }

  .scene-card[data-openable="true"]:hover .scene-cover img {
    transform: scale(1.035);
    filter: saturate(1.06) contrast(1.02);
  }

  .scene-card[data-openable="true"]:hover .open-cue svg {
    transform: translate(2px, -2px);
  }
}

@media (max-width: 1020px) {
  .overview {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .overview-stats {
    width: 100%;
  }

  .browser-controls {
    grid-template-columns: 1fr;
  }

  .select-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
}

@media (max-width: 900px) {
  .scene-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 16px;
  }
}

@media (max-width: 680px) {
  .topbar {
    min-height: 62px;
    padding: 8px 14px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .user-copy,
  .topbar-primary span {
    display: none;
  }

  .user-menu {
    padding-left: 6px;
  }

  .topbar-primary {
    width: 38px;
    padding: 0;
  }

  .page-main {
    padding: 22px 14px 50px;
  }

  .overview {
    padding-bottom: 18px;
  }

  .overview-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .overview-stats > div {
    min-width: 0;
    padding: 11px 10px;
  }

  .overview-stats dd {
    font-size: 19px;
  }

  .browser-controls {
    padding: 9px;
  }

  .select-controls {
    gap: 8px;
  }

  .select-field {
    min-width: 0;
    padding-left: 9px;
  }

  .dropdown-menu {
    width: min(220px, calc(100vw - 28px));
    max-height: min(45vh, 240px);
    overflow-y: auto;
  }

  .dropdown-option {
    min-height: 44px;
  }

  .category-row {
    display: grid;
    gap: 7px;
  }

  .scene-grid {
    grid-template-columns: 1fr;
  }

  .scene-card-body {
    min-height: 192px;
  }

  .scene-card-actions {
    padding-right: 14px;
    padding-left: 14px;
  }

  .state-panel {
    min-height: 260px;
  }

}

@media (max-width: 440px) {
  .brand-copy strong {
    font-size: 14px;
  }

  .brand-copy small {
    display: none;
  }

  .topbar-actions {
    gap: 8px;
  }

  .overview h1 {
    font-size: 27px;
  }

  .overview-description {
    font-size: 12px;
  }

  .overview-stats dt {
    font-size: 9px;
  }

  .overview-stats dd {
    font-size: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
