/* VCWD Repository — shared design system */
:root {
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --bg: #f4f7fb;
  --bg-accent: #e8f2ff;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: #e2e8f0;

  --text: #0f172a;
  --text-muted: #64748b;
  --text-soft: #94a3b8;

  --primary: #0b6bcb;
  --primary-2: #0284c7;
  --primary-glow: rgba(11, 107, 203, 0.22);
  --primary-grad: linear-gradient(135deg, #0b6bcb 0%, #0284c7 55%, #06b6d4 100%);

  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --success-text: #065f46;

  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --danger-text: #991b1b;

  --warn-bg: #fffbeb;
  --warn-border: #fde68a;
  --warn-text: #92400e;

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;

  --shadow-sm: 0 2px 8px rgba(2, 6, 23, 0.05);
  --shadow: 0 12px 40px rgba(2, 6, 23, 0.08);
  --shadow-lg: 0 24px 64px rgba(2, 6, 23, 0.12);

  --header-h: 64px;
  --wrap: 1140px;
  --ease: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(11, 107, 203, 0.14), transparent 70%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(6, 182, 212, 0.08), transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-accent) 40%, #eef2f7 100%);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); }

.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.site-header-inner {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.site-logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--primary-grad);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 8px 20px var(--primary-glow);
}

.site-brand-text strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.site-brand-text span {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.nav-link.is-active {
  color: var(--primary);
  background: rgba(11, 107, 203, 0.08);
  border-color: rgba(11, 107, 203, 0.15);
}

.site-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.page-title-pill {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: none;
}

@media (min-width: 900px) {
  .page-title-pill { display: block; }
}

/* —— Main —— */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 28px 20px 32px;
  flex: 1 0 auto;
}

.muted { color: var(--text-muted); font-size: 13px; }

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 18px;
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--ease), box-shadow var(--ease), background var(--ease);
  background: var(--surface-2);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn:active { transform: translateY(0); }

.btn:disabled,
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--primary-grad);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 28px var(--primary-glow);
}

.btn-primary:hover {
  box-shadow: 0 14px 36px var(--primary-glow);
}

.btn-light {
  background: var(--surface);
  border-color: var(--border-strong);
}

.btn-danger-outline {
  border-color: #fca5a5 !important;
  color: #b91c1c;
}

/* —— Cards —— */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.card + .card { margin-top: 16px; }

/* —— Page headers (list, upload, slider) —— */
.repo-header,
.up-head,
.sm-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.repo-kicker,
.up-kicker,
.sm-kicker {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 700;
}

.repo-title,
.up-title,
.sm-title {
  margin: 6px 0 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.repo-sub,
.up-sub,
.sm-sub {
  margin: 8px 0 0;
  color: var(--text-muted);
  line-height: 1.45;
  max-width: 52ch;
}

.repo-actions,
.sm-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.repo-tools,
.sm-tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 16px;
}

.repo-search,
.sm-search,
.up-input,
.up-textarea,
.repo-modal input[type="password"],
#deleteGateModal input[type="password"] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  outline: none;
  background: var(--surface);
  font: inherit;
  font-size: 14px;
  transition: border-color var(--ease), box-shadow var(--ease);
}

.repo-search,
.sm-search { flex: 1; min-width: 240px; }

.up-textarea { resize: vertical; min-height: 96px; }

.repo-search:focus,
.sm-search:focus,
.up-input:focus,
.up-textarea:focus,
.repo-modal input[type="password"]:focus,
#deleteGateModal input[type="password"]:focus {
  border-color: var(--primary-2);
  box-shadow: 0 0 0 4px rgba(11, 107, 203, 0.12);
}

.up-label {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
  display: block;
  color: var(--text);
}

.up-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

@media (max-width: 900px) {
  .up-grid { grid-template-columns: 1fr; }
}

/* —— Alerts —— */
.repo-alert-ok,
.up-alert-ok,
.sm-alert-ok {
  padding: 14px 16px;
  border: 1px solid var(--success-border);
  background: var(--success-bg);
  border-radius: var(--radius);
  margin: 0 0 16px;
  font-weight: 600;
  font-size: 14px;
  color: var(--success-text);
}

.repo-alert-err,
.up-alert-err,
.sm-alert-err {
  padding: 14px 16px;
  border: 1px solid var(--danger-border);
  background: var(--danger-bg);
  border-radius: var(--radius);
  margin: 0 0 16px;
  font-weight: 600;
  font-size: 14px;
  color: var(--danger-text);
}

/* —— Tables —— */
.repo-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.repo-table thead th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
  padding: 14px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
  text-align: left;
}

.repo-table tbody td {
  padding: 14px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.repo-table tbody tr:hover td {
  background: rgba(248, 250, 252, 0.8);
}

.repo-file-title { font-weight: 600; margin-bottom: 4px; }
.repo-file-sub { color: var(--text-muted); font-size: 12px; line-height: 1.35; }
.repo-row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.repo-thumbcell { width: 200px; }
.repo-thumbmini {
  width: 168px;
  height: 126px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow var(--ease);
}

.repo-thumbmini:hover {
  box-shadow: var(--shadow);
}

.repo-thumbmini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.repo-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

.repo-badge {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  padding: 4px 10px;
  border-radius: 999px;
}

.repo-topbadge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--warn-border);
  background: var(--warn-bg);
  color: var(--warn-text);
}

#emptyState { text-align: center; padding: 32px 16px; }

/* —— WP Preview —— */
.wp-preview-wrap { display: none; }
.wp-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.wp-preview-title { font-weight: 700; font-size: 1.05rem; }
.wp-preview-sub { color: var(--text-muted); font-size: 12px; margin-top: 4px; }
.wp-preview-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.wp-preview-box {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
}
.wp-preview-code {
  width: 100%;
  border: 0;
  outline: none;
  padding: 14px;
  font-family: var(--mono);
  font-size: 12px;
  background: #0f172a;
  color: #e2e8f0;
  min-height: 110px;
  resize: vertical;
}
.wp-preview-render {
  padding: 14px;
  background: var(--surface);
  border-top: 1px solid var(--border-strong);
}
.wp-preview-note { color: var(--text-muted); font-size: 12px; margin-top: 10px; }

/* —— Toast —— */
.repo-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(8px);
  background: var(--text);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-weight: 600;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ease), transform var(--ease);
  z-index: 10000;
}

.repo-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* —— Modals (delete gate, upload gate) —— */
.repo-modal,
#deleteGateModal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  padding: 20px;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}

#deleteGateModal[style*="block"],
.repo-modal[style*="block"] {
  display: flex !important;
}

.repo-modal-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.repo-modal-title { font-weight: 700; font-size: 1.15rem; }
.repo-modal-sub { color: var(--text-muted); margin-top: 8px; line-height: 1.45; font-size: 14px; }
.repo-modal-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.repo-modal form > input[type="password"],
#deleteGateModal form > input[type="password"] {
  margin-top: 14px;
}

/* —— Upload passcode modal (index) —— */
.repo-upload-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 999999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
  background: rgba(15, 23, 42, 0.55) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.repo-upload-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  border: 1px solid var(--border);
  position: relative;
}

.repo-upload-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.repo-upload-title {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.repo-upload-sub {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.4;
}

.repo-upload-x {
  text-decoration: none;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-size: 22px;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  flex-shrink: 0;
  transition: background var(--ease);
}

.repo-upload-x:hover { background: #fff; color: var(--text); }

.repo-upload-error {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--danger-border);
  background: var(--danger-bg);
  font-weight: 600;
  color: var(--danger-text);
  font-size: 14px;
}

.repo-upload-form { margin-top: 16px; }

.repo-upload-label {
  display: block;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 8px;
}

.repo-upload-inputwrap { position: relative; }

.repo-upload-input {
  width: 100%;
  padding: 12px 48px 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  outline: none;
  font-size: 14px;
  font-family: inherit;
}

.repo-upload-input:focus {
  border-color: var(--primary-2);
  box-shadow: 0 0 0 4px rgba(11, 107, 203, 0.12);
}

.repo-upload-eye {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.repo-upload-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.repo-upload-btn {
  flex: 1 1 140px;
  min-width: 120px;
  text-align: center;
}

.repo-upload-help {
  margin-top: 14px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

/* —— Home —— */
.home-shell { display: flex; justify-content: center; }
.home-hero { max-width: 100%; width: 100%; }

.home-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.home-kicker {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 700;
}

.home-title {
  margin-top: 8px;
  font-weight: 800;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--text);
}

.home-sub {
  margin-top: 12px;
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 56ch;
  font-size: 1rem;
}

.home-links {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.home-linkbtn {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: var(--radius);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  transition: transform var(--ease), box-shadow var(--ease);
}

.home-linkbtn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.home-panels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.home-panel {
  text-decoration: none;
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 22px;
  min-height: 140px;
  position: relative;
  overflow: hidden;
  transition: transform var(--ease), box-shadow var(--ease);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.home-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), transparent 50%);
  pointer-events: none;
}

.home-panel:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.home-panel-ico { font-size: 28px; position: relative; }
.home-panel-title { margin-top: 12px; font-weight: 700; font-size: 1.25rem; position: relative; }
.home-panel-sub {
  margin-top: 8px;
  opacity: 0.92;
  line-height: 1.4;
  font-size: 14px;
  max-width: 280px;
  position: relative;
}
.home-panel-cta {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 700;
  font-size: 14px;
  opacity: 0.95;
}

.home-blue { background: linear-gradient(145deg, #0b6bcb, #0369a1); }
.home-red { background: linear-gradient(145deg, #dc2626, #991b1b); }
.home-green { background: linear-gradient(145deg, #059669, #047857); }

.home-footnote {
  margin-top: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* —— Upload page extras —— */
.up-drop {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 18px;
  background: var(--surface-2);
  transition: border-color var(--ease), background var(--ease);
}

.up-drop.active {
  border-color: var(--primary-2);
  background: rgba(11, 107, 203, 0.04);
}

.up-drop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.up-drop-title { font-weight: 700; }
.up-drop-hint { color: var(--text-muted); font-size: 12px; margin-top: 4px; }

.up-filelist {
  margin-top: 14px;
  border-top: 1px solid var(--border-strong);
  padding-top: 14px;
  display: none;
}

.up-fileitem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 8px;
}

.up-filename {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 480px;
}

.up-filesub { color: var(--text-muted); font-size: 12px; margin-top: 2px; }

.up-remove {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}

.up-progress-wrap {
  display: none;
  margin-top: 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
}

.up-progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.up-progress-bar {
  height: 8px;
  width: 100%;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.up-progress-bar > div {
  height: 100%;
  width: 0%;
  background: var(--primary-grad);
  transition: width 0.12s linear;
  border-radius: 999px;
}

.up-small { color: var(--text-muted); font-size: 12px; }

.slider-box {
  margin-top: 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 16px;
  background: var(--surface-2);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.slider-title { font-weight: 700; }
.slider-sub { margin-top: 6px; color: var(--text-muted); font-size: 13px; line-height: 1.4; }

.slider-switch {
  position: relative;
  width: 52px;
  height: 30px;
  flex-shrink: 0;
}

.slider-switch input { opacity: 0; width: 0; height: 0; }

.slider-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background var(--ease);
}

.slider-knob {
  position: absolute;
  top: 50%;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: transform var(--ease);
}

.slider-switch input:checked + .slider-track {
  background: var(--primary-grad);
}

.slider-switch input:checked + .slider-track .slider-knob {
  transform: translate(22px, -50%);
}

.order-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.pill {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  user-select: none;
  transition: border-color var(--ease), box-shadow var(--ease);
}

.pill.on {
  border-color: var(--primary-2);
  background: rgba(11, 107, 203, 0.08);
  color: var(--primary);
}

.pill[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* —— Footer (sticky to viewport bottom on every page) —— */
.repo-footer {
  flex-shrink: 0;
  margin-top: auto;
  position: sticky;
  bottom: 0;
  z-index: 90;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 14px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  box-shadow: 0 -6px 24px rgba(2, 6, 23, 0.06);
}

.repo-footer b { color: var(--text); font-weight: 600; }

/* —— Help panel —— */
.help-panel { font-size: 14px; }
.help-panel h3 { margin: 0 0 8px; font-size: 1.05rem; }
.help-panel .help-lead { color: var(--text-muted); font-size: 13px; line-height: 1.5; }
.help-code {
  width: 100%;
  min-height: 140px;
  margin-top: 10px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  font-family: var(--mono);
  font-size: 12px;
  background: #0f172a;
  color: #e2e8f0;
  resize: vertical;
}
.help-actions { margin-top: 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.help-settings { font-size: 13px; line-height: 1.65; }
.help-settings code {
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 12px;
}

/* —— Responsive —— */
@media (max-width: 720px) {
  .col-uploaded, .col-size { display: none; }
  .repo-thumbcell { width: 140px; }
  .repo-thumbmini { width: 120px; height: 90px; }
  .home-panels { grid-template-columns: 1fr; }
  .home-panel-cta {
    position: static;
    transform: none;
    margin-top: 12px;
    display: inline-block;
  }
  .site-nav .nav-link span.nav-label { display: none; }
}

@media (max-width: 520px) {
  .repo-upload-btn { flex: 1 1 100%; min-width: 0; }
}

/* —— Slider manager —— */
.sm-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.sm-table thead th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
  padding: 14px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-strong);
  text-align: left;
}
.sm-table tbody td {
  padding: 14px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.sm-thumbcell { width: 200px; }
.sm-thumb {
  width: 168px;
  height: 126px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
}
.sm-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sm-file-title { font-weight: 600; margin-bottom: 4px; }
.sm-file-sub { color: var(--text-muted); font-size: 12px; }
.sm-row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sm-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: box-shadow var(--ease);
}
.sm-toggle:hover { box-shadow: var(--shadow-sm); }
.sm-toggle small { font-weight: 500; color: var(--text-muted); }
.sm-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(8px);
  background: var(--text);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-weight: 600;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ease), transform var(--ease);
  z-index: 10000;
}
.sm-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 720px) {
  .sm-thumbcell { width: 140px; }
  .sm-thumb { width: 120px; height: 90px; }
}
