:root {
  --font-sans: "Bahnschrift", "Aptos", "Segoe UI", sans-serif;
  --font-mono: "Cascadia Code", "Consolas", monospace;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --sidebar-width: 296px;
}

body[data-theme='dark'],
body:not([data-theme='light']) {
  --bg-base: #09111b;
  --bg-accent:
    radial-gradient(circle at 18% 18%, rgba(38, 132, 108, 0.22), transparent 34%),
    radial-gradient(circle at 88% 14%, rgba(234, 164, 66, 0.18), transparent 26%),
    linear-gradient(145deg, #08121a 0%, #0f1d29 42%, #121722 100%);
  --panel: rgba(16, 24, 35, 0.82);
  --panel-strong: rgba(10, 16, 24, 0.9);
  --panel-soft: rgba(255, 255, 255, 0.04);
  --text: #edf5ff;
  --text-muted: #9fb3ca;
  --line: rgba(165, 184, 208, 0.16);
  --line-strong: rgba(165, 184, 208, 0.28);
  --accent: #3ec5a1;
  --accent-strong: #88f0d1;
  --accent-soft: rgba(62, 197, 161, 0.14);
  --danger: #ff8b7a;
  --danger-soft: rgba(255, 139, 122, 0.14);
  --warning: #f7c46c;
  --warning-soft: rgba(247, 196, 108, 0.16);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  --input-bg: rgba(7, 12, 19, 0.72);
  --sidebar-bg: rgba(4, 8, 15, 0.88);
}

body[data-theme='light'] {
  --bg-base: #e8edf5;
  --bg-accent:
    radial-gradient(circle at 18% 18%, rgba(38, 132, 108, 0.14), transparent 34%),
    radial-gradient(circle at 88% 14%, rgba(234, 164, 66, 0.12), transparent 26%),
    linear-gradient(145deg, #edf2f8 0%, #dde7f0 42%, #f4efe8 100%);
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: rgba(255, 255, 255, 0.94);
  --panel-soft: rgba(14, 27, 41, 0.04);
  --text: #152433;
  --text-muted: #5d7085;
  --line: rgba(21, 36, 51, 0.12);
  --line-strong: rgba(21, 36, 51, 0.22);
  --accent: #1f8f73;
  --accent-strong: #125f4a;
  --accent-soft: rgba(31, 143, 115, 0.12);
  --danger: #b34838;
  --danger-soft: rgba(179, 72, 56, 0.12);
  --warning: #ad6c00;
  --warning-soft: rgba(173, 108, 0, 0.12);
  --shadow: 0 24px 60px rgba(15, 34, 52, 0.12);
  --input-bg: rgba(255, 255, 255, 0.94);
  --sidebar-bg: rgba(19, 32, 45, 0.92);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg-base);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg-accent);
}

code,
pre,
input.code-like,
textarea.code-like {
  font-family: var(--font-mono);
}

code {
  padding: 0.1em 0.36em;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--accent-strong);
}

a {
  color: inherit;
}

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  padding: 28px 22px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
  color: #f6fbff;
  display: flex;
  flex-direction: column;
  gap: 22px;
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand h1 {
  margin: 6px 0 0;
  font-size: 1.48rem;
  line-height: 1.2;
}

.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #ffd998 0%, #6ff0ca 100%);
  color: #0c1721;
  font-weight: 800;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.sidebar .eyebrow {
  color: rgba(255, 255, 255, 0.68);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav a {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(246, 251, 255, 0.86);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.mode-toggle {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--text);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.nav a:hover,
.nav a.active {
  transform: translateX(2px);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.08);
}

.mode-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.sidebar-tools {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar .mode-toggle {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(246, 251, 255, 0.86);
}

.sidebar .mode-toggle:hover {
  transform: translateX(2px);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.12);
}

.tip-panel {
  margin-top: auto;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  line-height: 1.75;
  color: rgba(246, 251, 255, 0.88);
}

.content {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.hero,
.panel,
.stat-card {
  border-radius: var(--radius-xl);
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.hero {
  padding: 28px 30px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.hero h2,
.panel h3,
.panel h4 {
  margin: 6px 0 0;
}

.hero-copy,
.panel-copy {
  margin-top: 12px;
  line-height: 1.75;
  color: var(--text-muted);
  max-width: 920px;
}

.hero-actions,
.button-row,
.inline-actions,
.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.stat-card {
  padding: 20px;
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 2rem;
}

.stat-card span {
  color: var(--text-muted);
  line-height: 1.65;
}

.panel {
  padding: 24px;
}

.panel-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-title-row.compact {
  margin-bottom: 12px;
}

.grid-panel,
.workspace-grid,
.two-column {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 20px;
}

.workspace-grid {
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
}

.panel-block,
.workspace-main,
.workspace-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.stack-form,
.filter-form,
.jump-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.filter-form {
  gap: 14px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field-inline,
label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text-muted);
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--text);
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--text-muted) 78%, transparent);
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line-strong));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-soft) 82%, transparent);
}

.checkbox-row {
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

.primary-button,
.ghost-button,
.danger-button,
.mini-button,
.upload-button {
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.primary-button {
  padding: 14px 22px;
  background: linear-gradient(135deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 68%, #ffffff 20%) 100%);
  color: #08131b;
  font-weight: 700;
  box-shadow: 0 16px 30px color-mix(in srgb, var(--accent) 24%, transparent);
}

.ghost-button,
.danger-button,
.mini-button,
.upload-button,
.mode-toggle {
  padding: 12px 18px;
}

.ghost-button,
.upload-button {
  background: var(--panel-soft);
  color: var(--text);
  border-color: var(--line);
}

.danger-button {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 30%, transparent);
}

.mini-button {
  background: var(--panel-soft);
  color: var(--text);
  border-color: var(--line);
  padding: 8px 12px;
}

button:hover,
.upload-button:hover {
  transform: translateY(-1px);
}

.hint-box {
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid color-mix(in srgb, var(--warning) 30%, transparent);
  background: var(--warning-soft);
  color: color-mix(in srgb, var(--warning) 62%, var(--text) 38%);
  line-height: 1.75;
}

.helper-text,
small,
.muted {
  color: var(--text-muted);
  line-height: 1.7;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.summary-card {
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--panel-soft);
  border: 1px solid var(--line);
}

.summary-card strong {
  display: block;
  margin-top: 10px;
  font-size: 1.38rem;
}

.upload-role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.asset-role-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--panel-strong) 78%, transparent);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.asset-role-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.asset-role-head h4 {
  margin: 4px 0 0;
}

.upload-control {
  position: relative;
  overflow: hidden;
  display: inline-flex;
}

.upload-control input[type='file'] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.asset-lane {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.asset-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  min-height: 294px;
}

.asset-strip::-webkit-scrollbar {
  height: 10px;
}

.asset-strip::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-muted) 28%, transparent);
}

.asset-card,
.lane-empty {
  flex: 0 0 210px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-strong) 90%, transparent);
}

.asset-card {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.asset-card.dragging {
  opacity: 0.48;
}

.asset-card.drag-over {
  border-color: color-mix(in srgb, var(--accent) 56%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-soft) 82%, transparent);
}

.asset-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.asset-card-index {
  min-width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent-soft) 78%, transparent);
  color: var(--accent-strong);
  font-weight: 700;
}

.asset-preview {
  height: 148px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-soft) 88%, transparent);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.asset-preview img,
.asset-preview video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.asset-placeholder {
  padding: 12px;
  text-align: center;
  color: var(--text-muted);
  line-height: 1.6;
}

.asset-card-title {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.5;
  word-break: break-word;
}

.asset-card-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.asset-card-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.lane-empty {
  display: grid;
  place-items: center;
  padding: 18px;
  color: var(--text-muted);
  border-style: dashed;
  min-height: 210px;
  text-align: center;
  line-height: 1.75;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 600;
}

tbody tr:hover {
  background: color-mix(in srgb, var(--panel-soft) 84%, transparent);
}

.table-title {
  font-weight: 700;
}

.table-meta {
  margin-top: 6px;
  color: var(--text-muted);
  line-height: 1.6;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.86rem;
}

.badge.default,
.badge.online,
.badge.role-foreground {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: color-mix(in srgb, var(--accent) 32%, transparent);
}

.badge.offline {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 32%, transparent);
}

.badge.role-background {
  background: color-mix(in srgb, var(--warning-soft) 88%, transparent);
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 30%, transparent);
}

.badge.type-image {
  color: #7fcbff;
}

.badge.type-video {
  color: #f6ce7b;
}

.badge.type-model {
  color: #d2a8ff;
}

.badge.source-pending {
  color: #8ddaf2;
}

.badge.source-existing {
  color: var(--text-muted);
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pagination-bar {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.pagination-summary {
  color: var(--text-muted);
  line-height: 1.7;
}

.pagination-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.pagination-controls label,
.jump-form {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.pagination-controls select,
.jump-form input {
  width: auto;
  min-width: 84px;
}

.jump-form input {
  max-width: 96px;
}

.empty-row td {
  color: var(--text-muted);
  text-align: center;
  padding: 28px 18px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: 320px;
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  background: var(--panel-strong);
  color: var(--text);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 30;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  border-color: color-mix(in srgb, var(--danger) 32%, transparent);
}

.hidden {
  display: none !important;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-user {
  font-weight: 700;
}

.auth-role {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.auth-layout {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(520px, 96vw);
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-card h1 {
  margin: 6px 0 0;
}

.auth-card p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.7;
}

.auth-card .mode-toggle {
  width: 100%;
}

.auth-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.copy-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.copy-row input {
  flex: 1;
  min-width: 220px;
}

@media (max-width: 1200px) {
  .upload-role-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1080px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .grid-panel,
  .workspace-grid,
  .two-column {
    grid-template-columns: 1fr;
  }

  .tip-panel {
    margin-top: 0;
  }
}

@media (max-width: 760px) {
  .content {
    padding: 18px;
  }

  .hero,
  .panel {
    padding: 20px;
  }

  .hero {
    flex-direction: column;
  }

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

  .asset-card,
  .lane-empty {
    flex-basis: 190px;
  }

  .pagination-bar,
  .pagination-controls {
    align-items: stretch;
  }

  .pagination-controls label,
  .jump-form {
    flex-wrap: wrap;
  }

  .primary-button,
  .ghost-button,
  .danger-button,
  .upload-button {
    width: 100%;
    justify-content: center;
  }
}

.primary-button,
.ghost-button,
.danger-button,
.mini-button,
.upload-button,
.mode-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.content {
  min-width: 0;
}

.compact-hero {
  padding: 22px 24px;
  align-items: center;
}

.compact-hero .hero-copy {
  margin-bottom: 0;
  max-width: 760px;
}

.compact-grid {
  gap: 16px;
  align-items: start;
}

.editor-grid,
.media-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
  gap: 16px;
  align-items: start;
}

.soft-panel {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--panel-strong) 90%, transparent);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.soft-panel > * {
  min-width: 0;
}

.helper-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--text-muted);
  line-height: 1.7;
}

.page-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.tab-button,
.segmented-button {
  appearance: none;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.tab-button:hover,
.segmented-button:hover {
  color: var(--text);
}

.tab-button.active,
.segmented-button.active {
  color: var(--text);
  background: color-mix(in srgb, var(--panel-strong) 92%, var(--accent-soft) 8%);
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
  box-shadow: 0 12px 24px color-mix(in srgb, var(--accent-soft) 30%, transparent);
}

.tab-panel {
  margin-top: 18px;
}

.tab-panel.active {
  display: block;
}

.table-wrap.responsive-table table {
  min-width: 760px;
}

.segmented-control {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.media-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-strong) 88%, transparent);
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--line) 80%, transparent);
}

.media-card-head,
.media-card-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.media-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.media-preview {
  height: 260px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-soft) 90%, transparent);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.media-preview img,
.media-preview video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.media-preview.is-video video {
  background: #000;
}

.media-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.media-meta-item {
  min-width: 0;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--panel-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.media-meta-item span {
  color: var(--text-muted);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.media-meta-item strong,
.media-meta-item small {
  word-break: break-word;
}

.media-empty {
  padding: 32px;
  text-align: center;
}

@media (max-width: 1200px) {
  .editor-grid,
  .media-settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1080px) {
  .sidebar {
    padding: 20px 18px 18px;
  }

  .nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .nav a {
    flex: 1 1 140px;
  }

  .sidebar-tools {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .sidebar-tools > * {
    flex: 1 1 180px;
  }
}

@media (max-width: 760px) {
  .compact-hero {
    padding: 18px;
    gap: 14px;
    align-items: flex-start;
  }

  .compact-grid,
  .editor-grid {
    gap: 14px;
  }

  .panel-title-row,
  .media-card-head,
  .media-card-actions,
  .asset-role-head,
  .asset-card-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .page-tabs,
  .segmented-control {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .page-tabs::-webkit-scrollbar,
  .segmented-control::-webkit-scrollbar {
    display: none;
  }

  .tab-button,
  .segmented-button {
    flex: 1 0 auto;
    white-space: nowrap;
  }

  .stats-grid,
  .summary-grid,
  .media-grid,
  .media-preview-grid,
  .media-meta-grid,
  .media-settings-grid {
    grid-template-columns: 1fr;
  }

  .media-preview {
    height: 220px;
  }

  .responsive-table table,
  .responsive-table thead,
  .responsive-table tbody,
  .responsive-table tr,
  .responsive-table th,
  .responsive-table td {
    display: block;
    width: 100%;
  }

  .responsive-table table {
    min-width: 0;
  }

  .responsive-table thead {
    display: none;
  }

  .responsive-table tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .responsive-table tr {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--panel-soft) 88%, transparent);
  }

  .responsive-table td {
    padding: 10px 0;
    border-bottom: 1px dashed var(--line);
  }

  .responsive-table td:last-child {
    padding-bottom: 2px;
    border-bottom: 0;
  }

  .responsive-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .responsive-table .actions-row > * {
    flex: 1 1 120px;
  }
}

@media (max-width: 560px) {
  .content {
    padding: 14px;
    gap: 16px;
  }

  .hero,
  .panel {
    padding: 16px;
  }

  .stat-card {
    padding: 16px;
  }

  .brand {
    align-items: flex-start;
  }

  .brand h1 {
    font-size: 1.28rem;
  }

  .brand-mark {
    width: 50px;
    height: 50px;
    border-radius: 16px;
  }

  .nav a {
    flex: 1 1 calc(50% - 8px);
    min-height: 42px;
  }

  .sidebar-tools > * {
    flex-basis: 100%;
  }

  .asset-card,
  .lane-empty {
    flex-basis: 84vw;
  }

  .media-card {
    padding: 16px;
  }

  .media-preview {
    height: 196px;
  }
}
