@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #060709;
  --bg-1: #0a0d12;
  --surface: #11141b;
  --line: rgba(255,255,255,0.09);
  --line-2: rgba(255,255,255,0.15);
  --fg: #f7f5ef;
  --fg-soft: #c9cbd1;
  --fg-mute: #90939c;
  --gold: #e9c46a;
  --gold-2: #d4af37;
  --gold-glow: rgba(233,196,106,0.18);
  --display: 'Space Grotesk', sans-serif;
  --body: 'Manrope', sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background:
    radial-gradient(1000px 700px at 82% 0%, rgba(233,196,106,0.10), transparent 55%),
    radial-gradient(800px 500px at 12% 18%, rgba(127,169,255,0.08), transparent 50%),
    var(--bg);
  color: var(--fg);
  font-family: var(--body);
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
.wrap { width: min(1200px, calc(100% - 40px)); margin: 0 auto; }
.nav {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(16px);
  background: rgba(6,7,9,0.72);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 18px;
}
.brand {
  display: inline-flex; align-items: center; gap: 11px;
  font-family: var(--display); font-size: 19px; font-weight: 700;
}
.brand .mark {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(180deg, var(--gold), var(--gold-2));
  color: #1a1400;
}
.brand b { color: var(--gold); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--fg-soft);
  padding: 9px 15px;
  border-radius: 999px;
  transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--fg); background: rgba(255,255,255,0.05); }
.nav-links a.active { color: var(--gold); }
.nav-links a.nav-mobile-only { display: none; }
.nav-right { display: flex; align-items: center; gap: 14px; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; width: 42px; height: 42px; border-radius: 10px; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--fg); margin: 4px auto; transition: .3s; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 1px solid transparent; border-radius: 999px;
  padding: 14px 22px; font-family: var(--display); font-weight: 600; cursor: pointer;
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-gold {
  background: linear-gradient(180deg, var(--gold), var(--gold-2));
  color: #1a1400;
  box-shadow: 0 12px 26px -16px rgba(233,196,106,0.5);
}
.btn-danger {
  background: linear-gradient(180deg, #f06a6a, #c93b3b);
  color: #fff;
  border-color: rgba(255,120,120,0.25);
  box-shadow: 0 12px 26px -16px rgba(239,90,90,0.55);
}
.btn-ghost {
  background: rgba(255,255,255,0.03);
  border-color: var(--line-2);
  color: var(--fg);
}

.hero { padding: 54px 0 88px; }
.hero-grid {
  display: grid; grid-template-columns: 1.04fr 0.96fr; gap: 28px; align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--gold); font-family: var(--display); font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 24px; height: 1px; background: linear-gradient(90deg, var(--gold), transparent); }
h1 {
  font-family: var(--display); font-size: clamp(42px, 6vw, 76px); line-height: 0.98; margin: 18px 0 16px;
}
.lead { font-size: 18px; color: var(--fg-soft); max-width: 560px; }
.list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 14px; }
.list li { display: flex; gap: 12px; align-items: flex-start; color: var(--fg-soft); }
.tick {
  width: 24px; height: 24px; border-radius: 7px; flex: none;
  display: grid; place-items: center;
  background: var(--gold-glow); color: var(--gold); border: 1px solid rgba(233,196,106,0.24);
}
.card {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(180deg, var(--surface), var(--bg-1));
  box-shadow: 0 40px 90px -55px rgba(0,0,0,0.9);
}
.signin-card { padding: 30px; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.pill {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2);
  color: var(--fg-soft); font-size: 12px; font-family: var(--display); letter-spacing: .08em; text-transform: uppercase;
}
.tab-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 22px; }
.tab-row button {
  border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,0.02);
  color: var(--fg-soft); padding: 13px 14px; font-family: var(--display); font-weight: 600; cursor: pointer;
}
.tab-row button.on { background: var(--gold-glow); border-color: rgba(233,196,106,0.28); color: var(--gold); }
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 7px; color: var(--fg-soft); font-family: var(--display); font-size: 13px; }
.field input, .field select {
  width: 100%; padding: 14px 16px;
  background: #0b0d12; color: var(--fg);
  border: 1px solid var(--line-2); border-radius: 12px; font: inherit;
}
.field input { padding-right: 56px; }
.field input[readonly] {
  background: rgba(255,255,255,0.025);
  color: #9aa0ab;
  border-color: rgba(255,255,255,0.08);
  box-shadow: none;
  cursor: default;
}
.field input[readonly]:focus {
  border-color: rgba(255,255,255,0.10);
  box-shadow: none;
}
.input-wrap { position: relative; }
.field .pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--fg-mute);
  cursor: pointer;
  padding: 0;
}
.field .pw-toggle:hover { color: var(--gold); background: rgba(255,255,255,0.03); }
.field .pw-toggle svg { width: 19px; height: 19px; }
.field textarea {
  width: 100%; min-height: 120px; resize: vertical;
  padding: 14px 16px; background: #0b0d12; color: var(--fg);
  border: 1px solid var(--line-2); border-radius: 12px; font: inherit;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-glow); }
.remember {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 24px;
  cursor: pointer;
  user-select: none;
}
.remember input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.remember .box {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: var(--bg);
  display: grid;
  place-items: center;
  transition: .2s;
  flex: none;
}
.remember .box svg {
  width: 12px;
  height: 12px;
  color: #1a1400;
  opacity: 0;
  transform: scale(.6);
  transition: .2s;
}
.remember input:checked + .box {
  background: linear-gradient(180deg,var(--gold),var(--gold-2));
  border-color: transparent;
}
.remember input:checked + .box svg {
  opacity: 1;
  transform: scale(1);
}
.remember input:focus-visible + .box { box-shadow: 0 0 0 3px var(--gold-glow); }
.remember .lbl { font-size: 14px; color: var(--fg-soft); }

.status {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
  color: var(--fg-soft);
  display: flex;
  align-items: center;
  gap: 10px;
}
.status svg { width: 16px; height: 16px; flex: none; }
.status.show { display: flex; }
.status.error { background: rgba(229,72,77,0.1); border: 1px solid rgba(229,72,77,0.3); color: #f1a5a7; }
.status.ok { background: var(--gold-glow); border: 1px solid rgba(233,196,106,0.3); color: var(--gold); }

.dashboard-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 120;
  min-width: min(92vw, 420px);
  max-width: min(92vw, 520px);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(18px);
  transition: opacity .2s ease, transform .2s ease;
}
.dashboard-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.dashboard-toast__msg {
  display: block;
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid rgba(233,196,106,0.26);
  background: rgba(17,20,27,0.96);
  color: var(--fg);
  box-shadow: 0 22px 50px -30px rgba(0,0,0,0.85);
  font-family: var(--display);
  font-weight: 600;
  text-align: center;
}

.helper { font-size: 13px; color: var(--fg-mute); margin-top: 10px; }
.alt { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); text-align: center; font-size: 14.5px; color: var(--fg-mute); }
.alt a { color: var(--gold); font-weight: 600; }
.trust { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 22px; font-size: 12px; color: var(--fg-faint); font-family: var(--display); letter-spacing: 0.04em; }
.trust svg { width: 13px; height: 13px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.actions { display: flex; gap: 12px; margin-top: 22px; }
.actions .btn { flex: 1; }
.status strong { color: var(--fg); }
.helper-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  font-size: 13px;
}
.helper-links a {
  color: var(--fg-mute);
  font-family: var(--display);
  font-weight: 600;
  transition: color .2s;
}
.helper-links a:hover { color: var(--gold); }

.dashboard { padding: 42px 0 72px; }
.dash-head {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  margin-bottom: 22px;
}
.dash-head h2 { font-family: var(--display); font-size: clamp(28px, 4vw, 40px); margin: 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 22px 0; }
.stat { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,0.015); }
.stat b { display: block; font-family: var(--display); font-size: 28px; color: var(--gold); line-height: 1; }
.stat span { display: block; margin-top: 6px; color: var(--fg-mute); font-size: 13px; }
.live-panel {
  padding: 18px;
  margin-bottom: 16px;
}
.panel-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.panel-head h3 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 20px;
}
.panel-head p {
  margin: 0;
  color: var(--fg-mute);
  font-size: 13px;
  max-width: 680px;
}
.panel-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.live-table {
  border-radius: 16px;
}
.toolbar {
  display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap;
  margin: 20px 0 16px;
}
.toolbar select, .toolbar input {
  background: #0b0d12; color: var(--fg); border: 1px solid var(--line-2); border-radius: 12px;
  padding: 12px 14px; font: inherit;
}
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,0.015); }
table { width: 100%; border-collapse: collapse; min-width: 860px; }
th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,0.06); vertical-align: top; }
th { font-family: var(--display); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-mute); }
td { color: var(--fg-soft); font-size: 14px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 10px;
  border: 1px solid rgba(233,196,106,0.25); background: var(--gold-glow); color: var(--gold);
  font-family: var(--display); font-size: 12px; font-weight: 600;
}
.tag.admin { border-color: rgba(127,169,255,0.25); color: #9bc0ff; background: rgba(127,169,255,0.08); }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.mini {
  border: 1px solid var(--line-2); border-radius: 999px; padding: 8px 12px; background: rgba(255,255,255,0.03);
  color: var(--fg); font-family: var(--display); font-size: 12px; cursor: pointer;
}
.mini.danger {
  border-color: rgba(239,90,90,0.35);
  background: rgba(239,90,90,0.08);
  color: #ffafaf;
}
.empty {
  padding: 40px; text-align: center; color: var(--fg-mute);
}

.manager-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  margin: 18px 0 22px;
}
.manager-card {
  padding: 20px;
  min-width: 0;
}
.profile-card--full {
  grid-column: 1 / -1;
}
.manager-card h3 {
  font-family: var(--display);
  font-size: 20px;
  margin: 0 0 6px;
}
.manager-card p {
  margin: 0 0 14px;
  color: var(--fg-mute);
  font-size: 13px;
}
.manager-card .actions {
  margin-top: 16px;
}
.manager-card .hint {
  margin-top: 12px;
  font-size: 12px;
  color: var(--fg-mute);
}

.downloads-card {
  padding: 20px;
  min-width: 0;
}
.assets-card {
  padding: 20px;
  min-width: 0;
}
.all-assets-section {
  padding: 20px;
  margin-top: 14px;
  min-width: 0;
}
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.section-head h3 {
  font-family: var(--display);
  font-size: 20px;
  margin: 0 0 6px;
}
.section-head p {
  margin: 0;
  color: var(--fg-mute);
  font-size: 13px;
  max-width: 720px;
}
.downloads-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.downloads-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  flex: none;
  max-width: 100%;
}
.downloads-head h3 {
  font-family: var(--display);
  font-size: 20px;
  margin: 0 0 6px;
}
.downloads-head p {
  margin: 0;
  color: var(--fg-mute);
  font-size: 13px;
}
.download-player {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.015);
  overflow: hidden;
}
.download-player video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #050608;
}
.download-player__meta {
  padding: 14px 16px 4px;
}
.download-player__meta b {
  display: block;
  font-family: var(--display);
  font-size: 15px;
  margin-bottom: 4px;
}
.download-player__meta span {
  display: block;
  color: var(--fg-mute);
  font-size: 13px;
}
.download-actions {
  display: flex;
  gap: 10px;
  padding: 0 16px 14px;
  flex-wrap: wrap;
}
.download-actions .btn {
  flex: 1;
  min-width: 120px;
}
.asset-preview {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.015);
  overflow: hidden;
  padding-bottom: 14px;
  min-width: 0;
}
.asset-preview__stage {
  height: clamp(280px, 52vw, 620px);
  background: #050608;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 12px;
}
.asset-preview__stage[hidden] {
  display: none;
}
.asset-preview__stage img,
.asset-preview__stage video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #050608;
}
@media (max-width: 640px) {
  .asset-preview__stage {
    height: 260px;
    padding: 8px;
  }
}
.asset-preview__stage .empty {
  padding: 40px;
}
.asset-preview__field {
  padding: 0 16px;
  margin-top: 10px;
}
.asset-preview__field label {
  display: block;
  margin-bottom: 7px;
  color: var(--fg-soft);
  font-family: var(--display);
  font-size: 13px;
}
.asset-preview__field input {
  width: 100%;
  padding: 14px 16px;
  background: #0b0d12;
  color: var(--fg);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  font: inherit;
}
.asset-audio-controls {
  padding: 0 16px 12px;
  display: grid;
  gap: 10px;
}
.asset-audio-controls[hidden] {
  display: none;
}
.asset-audio-controls audio {
  width: 100%;
}
.my-assets-list .download-item {
  align-items: flex-start;
}
.my-assets-list .download-thumb {
  display: grid;
  place-items: center;
}
.my-assets-list .download-thumb img,
.my-assets-list .download-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.my-assets-list .download-thumb img {
  background: #050608;
}
.my-assets-list .download-thumb img,
.my-assets-list .download-item {
  cursor: pointer;
}
/* ── My Assets: restore 1-column horizontal row layout ── */
.my-assets-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.download-list.my-assets-list {
  grid-template-columns: repeat(2, 1fr);
}
.my-assets-list .download-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
}
.my-assets-list .download-thumb {
  width: 84px;
  height: 54px;
  aspect-ratio: unset;
  flex: none;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.my-assets-list .dl-play { display: none; }
.my-assets-list .download-info {
  position: static;
  padding: 0;
  background: none;
  min-width: 0;
  flex: 1;
}
.my-assets-list .download-info b {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.my-assets-list .download-info span {
  display: block;
  color: var(--fg-mute);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.download-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
@media (max-width: 600px) {
  .download-list { grid-template-columns: repeat(2, 1fr); }
  .download-list.my-assets-list { grid-template-columns: 1fr; }
}
.download-item {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  transition: border-color .2s, transform .2s;
  width: 100%;
  padding: 0;
  text-align: left;
}
.download-item:hover,
.download-item.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), 0 18px 40px -22px var(--gold-glow);
}
.download-thumb {
  aspect-ratio: 9/16;
  overflow: hidden;
  background: #050608;
  display: grid;
  place-items: center;
  position: relative;
}
.download-thumb img,
.download-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.asset-thumb-tag {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  background: rgba(233,196,106,0.08);
}
.download-item .dl-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(.9);
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(7,8,10,0.5);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.25);
  display: grid; place-items: center;
  opacity: 0;
  transition: opacity .2s, transform .2s;
  pointer-events: none;
}
.download-item:hover .dl-play { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.download-item .dl-play svg { width: 16px; height: 16px; color: #fff; }
.download-info {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 20px 10px 10px;
  background: linear-gradient(transparent, rgba(7,8,10,0.9));
}
.download-info span {
  display: block;
  color: var(--fg-mute);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.image-modal[hidden] {
  display: none;
}
.image-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 18px;
}
.image-modal__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0,0,0,0.84);
  backdrop-filter: blur(14px);
  cursor: pointer;
}
.image-modal__sheet {
  position: relative;
  z-index: 1;
  width: min(100%, 1100px);
  max-height: min(100%, 96vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  border-radius: 24px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(17,20,27,0.98), rgba(10,13,18,0.98));
  box-shadow: 0 40px 120px rgba(0,0,0,0.55);
  overflow: hidden;
}
.image-modal__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 0;
}
.image-modal__meta {
  min-width: 0;
}
.image-modal__eyebrow {
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}
.image-modal__title {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  color: var(--fg);
  word-break: break-word;
}
.image-modal__close {
  border: 1px solid var(--line-2);
  background: rgba(255,255,255,0.03);
  color: var(--fg);
  width: 42px;
  height: 42px;
  border-radius: 999px;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.image-modal__stage {
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0 18px;
}
.image-modal__img {
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 18px;
  background: #050608;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04);
}
.image-modal__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 18px 18px;
}
.image-modal__actions .btn {
  flex: 1;
  min-width: 160px;
}
.downloads-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
}
.all-assets-footer {
  flex-wrap: wrap;
}

.history-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 18px;
}
.history-list, .detail-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.015);
}
.history-list { overflow: hidden; }
.history-list table { min-width: 100%; }
.history-list table th, .history-list table td { padding: 14px 14px; }
.history-list tbody tr { cursor: pointer; transition: background .2s; }
.history-list tbody tr:hover { background: rgba(255,255,255,0.03); }
.detail-card { padding: 20px; }
.detail-card h3 { margin: 0 0 12px; font-family: var(--display); font-size: 22px; }
.detail-row { margin-bottom: 12px; }
.detail-row b { display: block; font-family: var(--display); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-mute); margin-bottom: 6px; }
.detail-row span, .detail-row a, .detail-row pre { color: var(--fg-soft); font-size: 14px; word-break: break-word; }
.detail-row pre { white-space: pre-wrap; background: rgba(0,0,0,0.2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 0; max-height: 220px; overflow: auto; }
.task-modal[hidden] { display: none; }
.task-modal {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: 18px;
}
.task-modal__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0,0,0,0.84);
  backdrop-filter: blur(14px);
  cursor: pointer;
}
.task-modal__sheet {
  position: relative;
  z-index: 1;
  width: min(100%, 760px);
  max-height: min(100%, 92vh);
  border-radius: 24px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(17,20,27,0.98), rgba(10,13,18,0.98));
  box-shadow: 0 40px 120px rgba(0,0,0,0.55);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
.task-modal__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 0;
}
.task-modal__meta { min-width: 0; }
.task-modal__eyebrow {
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}
.task-modal__title {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  color: var(--fg);
  word-break: break-word;
}
.task-modal__close {
  border: 1px solid var(--line-2);
  background: rgba(255,255,255,0.03);
  color: var(--fg);
  width: 42px;
  height: 42px;
  border-radius: 999px;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.task-modal__body {
  min-height: 0;
  overflow: auto;
  padding: 18px 18px calc(118px + env(safe-area-inset-bottom, 0px));
}
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 6px 10px;
  border: 1px solid var(--line-2); background: rgba(255,255,255,0.03);
  font-family: var(--display); font-size: 12px; font-weight: 600;
}
.status-pill.queued { color: #ffcf5a; border-color: rgba(255,207,90,0.25); background: rgba(255,207,90,0.08); }
.status-pill.running { color: #88c9ff; border-color: rgba(136,201,255,0.25); background: rgba(136,201,255,0.08); }
.status-pill.succeeded { color: #93e1a6; border-color: rgba(147,225,166,0.25); background: rgba(147,225,166,0.08); }
.status-pill.failed { color: #ff8f8f; border-color: rgba(255,143,143,0.25); background: rgba(255,143,143,0.08); }

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .manager-grid { grid-template-columns: 1fr; }
  .history-grid { grid-template-columns: 1fr; }
  .profile-card--full { grid-column: auto; }
}
@media (max-width: 640px) {
  .wrap { width: min(1200px, calc(100% - 24px)); }
  .dashboard { padding-bottom: 132px; }
  .stats { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .tab-row { grid-template-columns: 1fr; }
  .downloads-footer { justify-content: flex-start; }
  .manager-card,
  .assets-card,
  .downloads-card,
  .all-assets-section,
  .live-panel {
    padding: 16px;
  }
  .downloads-head,
  .section-head,
  .panel-head,
  .dash-head {
    align-items: flex-start;
  }
  .downloads-head {
    flex-direction: column;
  }
  .downloads-meta {
    width: 100%;
    justify-content: flex-start;
  }
  .downloads-meta .pill,
  .downloads-footer .pill {
    padding: 6px 10px;
    letter-spacing: 0.05em;
  }
  .image-modal {
    padding: 0;
  }
  .image-modal__sheet {
    width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
  .image-modal__img {
    max-height: 68vh;
  }
  .task-modal {
    padding: 10px 10px calc(108px + env(safe-area-inset-bottom, 0px));
    align-items: start;
  }
  .task-modal__sheet {
    width: 100%;
    max-height: calc(100vh - 140px - env(safe-area-inset-bottom, 0px));
  }
  .task-modal__body {
    padding-bottom: calc(142px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-toggle { display: none; }
  .sidebar-toggle { display: flex !important; }
  .nav-right {
    gap: 8px;
    flex-wrap: nowrap;
    min-width: 0;
  }
  .nav-right > .pill,
  .nav-right > .tag {
    display: none;
  }
  .nav-right .btn {
    padding: 10px 14px;
    font-size: 13px;
  }
  .nav.open .nav-links {
    display: flex; flex-direction: column;
    position: fixed; top: 74px; left: 0; right: 0; width: 100vw; max-width: 100vw;
    background: rgba(6,7,9,0.96); backdrop-filter: blur(16px);
    padding: 18px; gap: 8px; border-bottom: 1px solid var(--line);
    z-index: 40;
    max-height: calc(100vh - 74px);
    overflow: auto;
  }
  .nav.open .nav-links a {
    padding: 14px 16px;
    width: 100%;
    justify-content: flex-start;
  }
  .nav.open .nav-links a.nav-mobile-only { display: flex; }
}

/* ── Dashboard mobile: hide all panels, JS reveals the active one ── */
@media (max-width: 900px) {
  /* flatten the grid so individual cards can be shown/hidden cleanly */
  [data-dashboard] .manager-grid { display: block; }

  /* hide the stats summary bar — it has no dedicated tab */
  [data-dashboard] [data-summary] { display: none; }

  /* all panels off by default */
  [data-dashboard] [data-mobile-panel] { display: none !important; }

  /* JS adds this class to the active panel(s) */
  [data-dashboard] [data-mobile-panel].mobile-panel-active { display: block !important; }
}

/* Hide public nav links on authenticated pages */
.nav--authed .nav-links { display: none !important; }


/* ═══════════════════════════════════════════════════════════
   DESKTOP SIDEBAR NAV  —  visible only at ≥ 901 px
   ═══════════════════════════════════════════════════════════ */

/* Hamburger toggle — top-left, all screen sizes */
.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 9px;
  border: none;
  background: none;
  color: var(--fg-soft,#c3c5ca);
  cursor: pointer;
  flex-shrink: 0;
  transition: background .18s, color .18s;
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.07); color: #f6f5f1; }
/* Brand stays left of nav-right on all sizes */
.nav-inner:has(.sidebar-toggle) .brand,
.nav-slim:has(.sidebar-toggle) .brand { margin-right: auto; }

/* Dim overlay */
.sidebar-overlay {
  display: block;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.52);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s;
}
.sidebar-overlay.sidebar-overlay--open { opacity: 1; pointer-events: auto; }

/* Slide-in panel */
.sidebar {
  display: flex;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 272px;
  background: #111419;
  border-right: 1px solid rgba(255,255,255,0.09);
  z-index: 410;
  transform: translateX(-100%);
  transition: transform .3s cubic-bezier(.2,.7,.2,1);
  flex-direction: column;
}
.sidebar.sidebar--open { transform: translateX(0); }

/* Panel header */
.sidebar-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.sidebar-title {
  font-family: var(--display,"Space Grotesk",sans-serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-mute,#8b8e96);
}
.sidebar-close {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: none;
  color: #8b8e96;
  font-size: 14px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .18s, color .18s;
}
.sidebar-close:hover { background: rgba(255,255,255,0.12); color: #f6f5f1; }

/* Account block */
.sidebar-account {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.sidebar-account-av {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: linear-gradient(145deg,#e9c46a,#b8902a);
  display: grid; place-items: center;
  color: #1a1400;
  font-family: var(--display,"Space Grotesk",sans-serif);
  font-weight: 700; font-size: 18px;
  flex-shrink: 0;
}
.sidebar-account-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sidebar-account-info b {
  font-family: var(--display,"Space Grotesk",sans-serif);
  font-size: 14px; font-weight: 700; color: #f6f5f1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-account-info span { font-size: 12px; color: #5c5f67; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Nav links */
.sidebar-nav {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  flex: 1;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  color: #c3c5ca;
  text-decoration: none;
  font-family: var(--display,"Space Grotesk",sans-serif);
  font-size: 14px;
  font-weight: 600;
  transition: background .16s, color .16s;
  border: none;
  background: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
}
.sidebar-item:hover { background: rgba(255,255,255,0.05); color: #f6f5f1; }
.sidebar-item.sidebar--active { background: rgba(233,196,106,0.1); color: #e9c46a; }
.sidebar-item.sidebar--active svg { color: #e9c46a; }
.sidebar-item svg { width: 18px; height: 18px; color: #5c5f67; flex-shrink: 0; transition: color .16s; }
.sidebar-item:hover svg { color: #8b8e96; }

/* Footer — Sign Out */
.sidebar-foot {
  padding: 10px;
  border-top: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.sidebar-item--danger { color: #f06a6a; }
.sidebar-item--danger svg { color: #f06a6a; }
.sidebar-item--danger:hover { background: rgba(240,106,106,0.1); color: #f06a6a; }
.sidebar-item--danger:hover svg { color: #f06a6a; }

/* Admin-only nav items — hidden until role:admin is confirmed */
[data-admin-only] { display: none !important; }
[data-admin-only].admin-visible { display: flex !important; }
