:root {
  color-scheme: dark;
  --bg: #07060f;
  --surface: #0c0b1a;
  --surface-2: #111026;
  --surface-3: #181730;
  --border: #1e1c38;
  --border-2: #2b294e;
  --text: #ddd9f5;
  --text-2: #7872a8;
  --text-3: #44405e;
  --accent: #9d7fff;
  --accent-dim: rgba(157, 127, 255, 0.12);
  --accent-glow: rgba(157, 127, 255, 0.28);
  --danger: #f87171;
  --danger-dim: rgba(248, 113, 113, 0.1);
  --amber: #fbbf24;
  --green: #4ade80;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.7);
  --transition: 150ms ease;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
}

html { height: 100%; }

body {
  min-height: 100%;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 90% 55% at 50% -5%, rgba(120, 80, 255, 0.11) 0%, transparent 65%),
    radial-gradient(ellipse 50% 35% at 90% 90%, rgba(100, 60, 220, 0.06) 0%, transparent 60%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── header ── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 6, 15, 0.84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  height: 54px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}

.brand-icon {
  width: 20px;
  height: 20px;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 3px;
  border-radius: 4px;
}

.brand-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.025em;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  line-height: 1.6;
}

/* ── buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  padding: 0 14px;
  height: 36px;
  text-decoration: none;
  white-space: nowrap;
  transition: filter var(--transition), opacity var(--transition), background var(--transition), border-color var(--transition), color var(--transition);
  border: 1px solid transparent;
  flex-shrink: 0;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.btn:not(:disabled):active {
  transform: translateY(1px);
  filter: brightness(0.92);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: rgba(157, 127, 255, 0.5);
  font-weight: 700;
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.12); }

.btn-ghost {
  background: var(--surface-2);
  border-color: var(--border-2);
  color: var(--text-2);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface-3);
  color: var(--text);
}

.btn-danger {
  background: var(--danger-dim);
  border-color: rgba(248, 113, 113, 0.25);
  color: var(--danger);
}
.btn-danger:hover:not(:disabled) { background: rgba(248, 113, 113, 0.18); }

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.btn-lg {
  height: 42px;
  padding: 0 22px;
  font-size: 15px;
}

/* ── inputs ── */
input:not([type="file"]) {
  width: 100%;
  height: 40px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  padding: 0 12px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:not([type="file"]):focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(157, 127, 255, 0.15);
}
input:not([type="file"])::placeholder { color: var(--text-3); }

/* ── main layout ── */
.main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ── auth ── */
.auth-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 44px;
  padding: 64px 0 24px;
}

.auth-hero { text-align: center; }

.auth-title {
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.08;
  margin-bottom: 14px;
  background: linear-gradient(140deg, var(--text) 30%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-sub {
  color: var(--text-2);
  font-size: 16px;
}

.auth-cards {
  display: grid;
  grid-template-columns: repeat(2, 320px);
  gap: 20px;
}

/* ── card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 18px;
  letter-spacing: -0.02em;
}

/* ── forms ── */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-stack .btn { width: 100%; height: 40px; }

/* ── app section ── */
.app-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── upload ── */
.upload-form { display: flex; flex-direction: column; gap: 10px; }

#imageInput {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-zone {
  position: relative;
  border: 2px dashed var(--border-2);
  border-radius: var(--radius-lg);
  background: var(--surface);
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.upload-zone:hover {
  border-color: var(--accent);
  background: rgba(157, 127, 255, 0.03);
}

.upload-zone.drag-over {
  border-color: var(--accent);
  background: rgba(157, 127, 255, 0.07);
  box-shadow: 0 0 0 4px var(--accent-dim);
}

.upload-zone-body {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 28px 30px;
}

.upload-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius);
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
  transition: background var(--transition), border-color var(--transition);
}

.upload-icon svg { width: 20px; height: 20px; }

.upload-zone:hover .upload-icon,
.upload-zone.drag-over .upload-icon {
  background: var(--accent-dim);
  border-color: var(--accent-glow);
}

.upload-zone-text { display: flex; flex-direction: column; gap: 3px; }
.upload-zone-text strong { font-size: 15px; font-weight: 600; color: var(--text); }
.upload-sub { font-size: 13px; color: var(--text-2); }

.upload-progress {
  height: 3px;
  background: var(--surface-2);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
}

.upload-progress-bar {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 200ms ease;
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px var(--accent-glow);
}

.upload-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 30px;
}

.selected-file {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-2);
  min-width: 0;
}

.selected-file svg { color: var(--accent); flex-shrink: 0; }
#selectedFileName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── section ── */
.section-block { display: flex; flex-direction: column; gap: 14px; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

/* tighter margin for the standalone section-block (which has its own gap) */
.section-block > .section-header {
  margin-bottom: 0;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* ── media grid ── */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.media-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  aspect-ratio: 4 / 3;
  transition: border-color var(--transition), transform 200ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 200ms ease;
}

.media-card:hover {
  border-color: var(--border-2);
  transform: scale(1.025);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

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

.media-card video {
  object-fit: contain;
  background: #000;
}

.media-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.5) 45%, rgba(0, 0, 0, 0.1) 100%);
  opacity: 0;
  transition: opacity var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px;
  gap: 7px;
}

.media-card:hover .media-overlay { opacity: 1; }

.media-overlay-info { min-width: 0; }

.media-overlay-name {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-overlay-meta {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 1px;
}

.media-overlay-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.media-overlay-actions .btn {
  height: 26px;
  padding: 0 8px;
  font-size: 12px;
}

/* ── two col ── */
.two-col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

/* ── compact list ── */
.compact-list { display: flex; flex-direction: column; gap: 8px; }

.compact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.25);
  min-width: 0;
  transition: border-color var(--transition);
}

.compact-row:hover { border-color: var(--border-2); }

.compact-row-info { min-width: 0; flex: 1; }

.compact-row-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}

.compact-row-sub {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.compact-row-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-row.is-banned {
  border-color: rgba(248, 113, 113, 0.28);
  background: rgba(248, 113, 113, 0.05);
}

/* ── badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  height: 17px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  vertical-align: middle;
}

.badge-owner     { background: rgba(251, 191, 36, 0.15); color: #fcd34d; border: 1px solid rgba(251, 191, 36, 0.35); }
.badge-admin     { background: var(--accent-dim); color: var(--accent); border: 1px solid var(--accent-glow); }
.badge-moderator { background: rgba(96, 165, 250, 0.1); color: #93c5fd; border: 1px solid rgba(96, 165, 250, 0.25); }
.badge-promoted  { background: rgba(251, 191, 36, 0.1); color: var(--amber); border: 1px solid rgba(251, 191, 36, 0.25); }
.badge-banned    { background: var(--danger-dim); color: var(--danger); border: 1px solid rgba(248, 113, 113, 0.28); }

/* ── notice ── */
.notice {
  border: 1px solid rgba(157, 127, 255, 0.22);
  border-radius: var(--radius-sm);
  background: rgba(157, 127, 255, 0.07);
  color: #cec6ff;
  padding: 12px;
  font-size: 13px;
  margin-bottom: 12px;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

/* ── code ── */
code {
  font-family: "SF Mono", "Fira Code", ui-monospace, Consolas, monospace;
  font-size: 0.875em;
  color: var(--accent);
}

/* ── toast ── */
.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  padding: 11px 16px;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  max-width: min(380px, calc(100vw - 44px));
  animation: toast-in 0.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.toast.hidden {
  display: block !important;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

/* ── utils ── */
.muted { color: var(--text-2); }
.hidden { display: none !important; }

/* ── loading / flash prevention ── */
body.loading .auth-section,
body.loading .app-section {
  opacity: 0;
  pointer-events: none;
}

/* ── animations ── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

/* animations only fire after loading class is removed, preventing the flash */
body:not(.loading) .auth-section,
body:not(.loading) .app-section {
  animation: fade-up 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

body:not(.loading) .auth-cards .card:nth-child(1) { animation: fade-up 0.4s 0.05s cubic-bezier(0.22, 1, 0.36, 1) both; }
body:not(.loading) .auth-cards .card:nth-child(2) { animation: fade-up 0.4s 0.12s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* ── stats pages ── */
.stats-shell { display: flex; flex-direction: column; gap: 20px; }

.stats-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 32px 0 4px;
  flex-wrap: wrap;
}

.stats-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
}

.stats-sub { color: var(--text-2); margin-top: 4px; font-size: 14px; }

/* stat cards */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stat-cards-sm {
  grid-template-columns: repeat(5, 1fr);
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.stat-card-sm { padding: 14px 16px; }

.stat-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1.1;
}

.stat-value-sm { font-size: 22px; }

.stat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-sub { font-size: 12px; color: var(--text-3); }

/* ── browse grid ── */
.browse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}

.browse-card {
  position: relative;
  aspect-ratio: 1;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 200ms ease;
}

.browse-card:hover { transform: scale(1.03); box-shadow: 0 8px 32px rgba(0,0,0,0.5); }

.browse-card-video-thumb {
  width: 100%;
  height: 100%;
  background: #0a0a14;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: rgba(255,255,255,0.35);
  font-size: 28px;
}

.browse-card-video-thumb span {
  font-size: 10px;
  letter-spacing: 0.06em;
  font-weight: 600;
  text-transform: uppercase;
}

.browse-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.browse-card-owner {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 8px 7px;
  background: linear-gradient(transparent, rgba(0,0,0,0.78));
  font-size: 11px;
  color: rgba(255,255,255,0.85);
  font-weight: 500;
  opacity: 0;
  transition: opacity var(--transition);
}

.browse-card:hover .browse-card-owner { opacity: 1; }

/* ── profile header ── */
.profile-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.profile-name {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ── viewer ── */
.viewer {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.viewer.hidden { display: none; }

.viewer-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  color: rgba(255,255,255,0.8);
  font-size: 16px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}

.viewer-close:hover { background: rgba(255,255,255,0.15); color: #fff; }

.viewer-counter {
  position: absolute;
  top: 18px;
  left: 20px;
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}

.viewer-media-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 54px 24px 0;
  overflow: hidden;
  min-height: 0;
}

.viewer-media-el {
  max-width: 100%;
  max-height: calc(100vh - 130px);
  object-fit: contain;
  border-radius: var(--radius-sm);
  display: block;
}

.viewer-info {
  width: 100%;
  padding: 10px 20px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.viewer-username {
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  flex-shrink: 0;
}

.viewer-username:hover { text-decoration: underline; }

.viewer-fname {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.viewer-date { font-size: 12px; color: rgba(255,255,255,0.35); flex-shrink: 0; }

/* viewer slide transitions */
@keyframes v-out-up   { from { opacity:1; transform:translateY(0);    } to { opacity:0; transform:translateY(-48px); } }
@keyframes v-in-up    { from { opacity:0; transform:translateY(48px);  } to { opacity:1; transform:translateY(0);    } }
@keyframes v-out-down { from { opacity:1; transform:translateY(0);    } to { opacity:0; transform:translateY(48px);  } }
@keyframes v-in-down  { from { opacity:0; transform:translateY(-48px); } to { opacity:1; transform:translateY(0);    } }

.viewer-report-form {
  width: 100%;
  padding: 0 20px 14px;
  flex-shrink: 0;
}

.viewer-report-form textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 8px 10px;
  resize: none;
}

.v-out-up   { animation: v-out-up   0.18s ease forwards; }
.v-in-up    { animation: v-in-up    0.22s ease forwards; }
.v-out-down { animation: v-out-down 0.18s ease forwards; }
.v-in-down  { animation: v-in-down  0.22s ease forwards; }

/* layout grids */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.stats-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* bar chart */
.chart-card { padding: 20px 22px; }
.chart-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.bar-chart-wrap { margin-top: 4px; }

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 110px;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 3px;
  cursor: default;
}

.bar-val {
  font-size: 9px;
  color: var(--text-3);
  min-height: 12px;
  line-height: 12px;
}

.bar-fill {
  width: 100%;
  background: var(--accent);
  border-radius: 3px 3px 0 0;
  opacity: 0.7;
  transition: opacity var(--transition);
  min-height: 0;
}

.bar-col:hover .bar-fill { opacity: 1; }

.bar-x-label {
  font-size: 9px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* horizontal bars */
.hbar-list { display: flex; flex-direction: column; gap: 10px; }

.hbar-row { display: flex; flex-direction: column; gap: 4px; }

.hbar-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.hbar-label { font-size: 13px; font-weight: 600; color: var(--text); }
.hbar-sub   { font-size: 12px; color: var(--text-2); }

.hbar-track {
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
}

.hbar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  opacity: 0.75;
  transition: width 0.4s ease;
}

/* expiring + account */
.expiring-list { display: flex; flex-direction: column; gap: 8px; }

.expiring-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.expiring-row:last-child { border-bottom: none; }

.expiring-label { font-size: 13px; color: var(--text-2); }
.expiring-val   { font-size: 14px; font-weight: 700; color: var(--text); }
.expiring-warn  { color: var(--danger); }

.account-card { padding: 20px 22px; }

.account-grid { display: flex; flex-direction: column; gap: 0; }

.account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.account-row:last-child { border-bottom: none; }
.account-label { color: var(--text-2); }

/* stats table */
.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.stats-table th,
.stats-table td {
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.stats-table th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
  background: transparent;
}

.stats-table tr:last-child td { border-bottom: none; }
.stats-table td { color: var(--text); }

@media (max-width: 900px) {
  .stat-cards        { grid-template-columns: repeat(2, 1fr); }
  .stat-cards-sm     { grid-template-columns: repeat(3, 1fr); }
  .stats-grid        { grid-template-columns: 1fr; }
  .stats-grid-3      { grid-template-columns: 1fr; }
}

@media (max-width: 540px) {
  .stat-cards    { grid-template-columns: 1fr 1fr; }
  .stat-cards-sm { grid-template-columns: 1fr 1fr; }
}

/* ── embed / image view page ── */
.embed-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 40px 0 60px;
}

.embed-media {
  max-width: 100%;
  max-height: 72vh;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: block;
  object-fit: contain;
  background: var(--surface);
}

.embed-info {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 600px;
}

.embed-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.embed-meta {
  font-size: 14px;
  color: var(--text-2);
}

.embed-footnote {
  font-size: 12px;
  color: var(--text-3);
}

.embed-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}

/* ── warning banners (shown to warned users in main app) ── */
.warning-banner {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: var(--radius);
  background: rgba(248, 113, 113, 0.07);
  padding: 14px 16px;
  animation: warning-in 0.2s ease;
}

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

.warning-banner-icon {
  color: var(--danger);
  flex-shrink: 0;
  margin-top: 1px;
}

.warning-banner-body { flex: 1; min-width: 0; }

.warning-banner-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--danger);
  margin-bottom: 4px;
}

.warning-banner-message {
  font-size: 14px;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.warning-banner-meta {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 6px;
}

#warningBanners {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── moderation page ── */
.mod-shell { display: flex; flex-direction: column; gap: 20px; }

.mod-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 32px 0 4px;
  flex-wrap: wrap;
}

.mod-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
}

.mod-sub { color: var(--text-2); margin-top: 4px; font-size: 14px; }

.mod-hero-actions { display: flex; align-items: center; gap: 8px; }

.role-select {
  height: 28px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.mod-select {
  height: 30px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.mod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.mod-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition), transform 200ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 200ms ease;
}

.mod-card:hover {
  border-color: var(--border-2);
  transform: scale(1.025);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.mod-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: var(--surface-2);
}

.mod-card video.mod-card-thumb { object-fit: contain; background: #000; }

.mod-card-body { padding: 12px; display: flex; flex-direction: column; gap: 8px; }

.mod-card-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }

.mod-owner-badge { margin-bottom: 2px; }

.mod-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mod-card-actions { display: flex; flex-wrap: wrap; gap: 5px; }

.mod-warn-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
  margin-top: 2px;
  animation: warning-in 0.15s ease;
}

.mod-warn-textarea {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 8px 10px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.mod-warn-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(157, 127, 255, 0.15);
}

.mod-warn-form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mod-inline-link { color: var(--accent); text-decoration: none; }
.mod-inline-link:hover { text-decoration: underline; }

/* ── docs ── */
.docs-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.docs-header {
  padding: 36px 0 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.docs-header h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
}

.docs-header p { color: var(--text-2); margin-top: 6px; }

.docs-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.docs-panel h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.docs-panel p { color: var(--text-2); font-size: 14px; }

pre {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.45);
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.65;
}

pre code { color: var(--text); }

table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 14px;
}

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

th {
  color: var(--text-2);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.025);
}

tr:last-child td { border-bottom: 0; }
td { color: var(--text); }

/* ── responsive ── */
@media (max-width: 720px) {
  .main { padding: 24px 16px 60px; }
  .auth-section { padding-top: 40px; gap: 32px; }
  .auth-cards { grid-template-columns: 1fr; max-width: 400px; }
  .two-col { grid-template-columns: 1fr; }
  .upload-zone-body { padding: 22px 18px; gap: 14px; }
  .media-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .compact-row { flex-direction: column; align-items: flex-start; }
  .compact-row-actions { justify-content: flex-start; }
  .header-inner { padding: 0 16px; }
  .docs-header { flex-direction: column; align-items: flex-start; }
}
