:root {
  --bg: #080a10;
  --bg-elevated: #0f131d;
  --bg-card: #141926;
  --bg-hover: #1a2133;
  --bg-input: #0c1018;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef2ff;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent: #5865f2;
  --accent-hover: #4752c4;
  --accent-soft: rgba(88, 101, 242, 0.16);
  --cyan: #22d3ee;
  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.16);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.16);
  --rose: #f43f5e;
  --rose-soft: rgba(244, 63, 94, 0.16);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", "Consolas", monospace;
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

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

code,
.mono {
  font-family: var(--font-mono);
}

.hidden {
  display: none !important;
}

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

.tiny {
  font-size: 0.78rem;
}

/* Loading */
.loading-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--text-muted);
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Brand */
.brand-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-row-lg {
  gap: 14px;
  margin-bottom: 20px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #22d3ee);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  color: #fff;
  box-shadow: 0 8px 20px rgba(88, 101, 242, 0.35);
  flex-shrink: 0;
}

.brand-row-lg .brand-logo {
  width: 46px;
  height: 46px;
  font-size: 1.05rem;
}

.brand-name {
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 1.05rem;
}

.brand-sub {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-discord {
  background: #5865f2;
  color: #fff;
  box-shadow: 0 10px 26px rgba(88, 101, 242, 0.32);
}

.btn-discord:hover {
  background: #4752c4;
}

.btn-discord.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.btn-secondary {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-secondary:hover {
  background: #232c43;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.btn-danger {
  background: var(--rose-soft);
  border-color: rgba(244, 63, 94, 0.3);
  color: #fda4af;
}

.btn-danger:hover {
  background: rgba(244, 63, 94, 0.25);
}

.btn-lg {
  padding: 13px 20px;
  font-size: 0.98rem;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.84rem;
}

.btn-xs {
  padding: 4px 9px;
  font-size: 0.78rem;
}

.btn-block {
  width: 100%;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

/* Login View */
.login-view {
  min-height: 100vh;
  position: relative;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow: hidden;
}

.login-bg-glow {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 20% 25%, rgba(88, 101, 242, 0.22), transparent 42%),
    radial-gradient(circle at 80% 75%, rgba(34, 211, 238, 0.14), transparent 42%);
  pointer-events: none;
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 490px;
  background: rgba(20, 25, 38, 0.88);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  padding: 34px 30px;
  box-shadow: var(--shadow);
}

.login-title {
  margin: 0 0 12px;
  font-size: 1.55rem;
  line-height: 1.25;
}

.login-desc {
  margin: 0 0 24px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.login-desc code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--cyan);
}

.discord-icon {
  width: 22px;
  height: 22px;
}

.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 0.88rem;
  border: 1px solid rgba(244, 63, 94, 0.35);
  background: var(--rose-soft);
  color: #fecdd3;
}

.setup-notice {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.1);
  font-size: 0.86rem;
}

.setup-notice h3 {
  margin: 0 0 6px;
  font-size: 0.94rem;
  color: #fcd34d;
}

.setup-notice p {
  margin: 0 0 8px;
  color: var(--text-muted);
}

.setup-notice ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
}

.setup-notice code {
  color: #fde68a;
  font-size: 0.82rem;
}

.feature-pills {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feature-pills span {
  font-size: 0.78rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  padding: 5px 10px;
  border-radius: 999px;
}

/* App Shell & Topbar */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 66px;
  padding: 0 18px;
  background: rgba(10, 13, 20, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.topbar-search {
  position: relative;
  flex: 1;
  max-width: 480px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.topbar-search input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px 9px 38px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.topbar-search input:focus {
  border-color: var(--accent);
}

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

.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 10px;
  border-left: 1px solid var(--border);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.user-name {
  font-size: 0.86rem;
  font-weight: 600;
}

.user-handle {
  font-size: 0.74rem;
  color: var(--text-dim);
}

/* Workspace Layout */
.workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
}

.sidebar {
  border-right: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: calc(100vh - 66px);
  position: sticky;
  top: 66px;
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stats-card {
  background: linear-gradient(160deg, rgba(88, 101, 242, 0.15), rgba(20, 25, 38, 0.9));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.stats-main {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}

.stats-label {
  font-size: 0.76rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stats-value {
  font-size: 1.35rem;
  font-weight: 800;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.stats-num {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
}

.stats-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

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

.cat-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.cat-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.cat-btn.active {
  background: var(--accent-soft);
  border-color: rgba(88, 101, 242, 0.35);
  color: #fff;
}

.cat-count {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.cat-btn.active .cat-count {
  background: rgba(88, 101, 242, 0.35);
  color: #fff;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
}

.toggle-row input {
  accent-color: var(--accent);
}

/* Main Content */
.main-content {
  padding: 22px 24px 48px;
  min-width: 0;
}

.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.07), rgba(34, 211, 238, 0.04));
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(88, 101, 242, 0.12);
}

.dropzone-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dropzone-icon {
  font-size: 2rem;
  line-height: 1;
}

.dropzone h2 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.dropzone p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.dropzone code {
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 5px;
  border-radius: 5px;
  color: var(--cyan);
}

/* Global Drop Overlay */
.global-drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(8, 10, 16, 0.82);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 20px;
}

.global-drop-box {
  border: 2px dashed var(--accent);
  background: var(--bg-card);
  border-radius: 22px;
  padding: 46px 36px;
  text-align: center;
  max-width: 440px;
}

.drop-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

/* Upload Queue */
.upload-queue {
  margin-top: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.upload-queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.upload-queue-header h3 {
  margin: 0;
  font-size: 0.94rem;
}

.upload-queue-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.upload-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.upload-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.upload-item-name {
  font-size: 0.88rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-item-status {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.progress-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  transition: width 0.12s linear;
}

.progress-fill.done {
  background: var(--green);
}

.progress-fill.error {
  background: var(--rose);
}

/* Toolbar */
.toolbar {
  margin: 22px 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toolbar-title h2 {
  margin: 0;
  font-size: 1.12rem;
}

.count-pill {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

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

.select-input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 0.86rem;
  outline: none;
  cursor: pointer;
}

.view-toggle {
  display: inline-flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.view-btn {
  width: 32px;
  height: 30px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-dim);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.view-btn.active {
  background: var(--bg-hover);
  color: var(--text);
}

/* Files Grid */
.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 14px;
}

.file-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.file-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

.file-thumb {
  position: relative;
  height: 152px;
  background: #0c1018;
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

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

.file-type-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.file-type-emoji {
  font-size: 2.3rem;
  line-height: 1;
}

.ext-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
}

.ext-pill.cat-jar {
  background: var(--amber-soft);
  color: #fcd34d;
}

.ext-pill.cat-video {
  background: rgba(168, 85, 247, 0.2);
  color: #d8b4fe;
}

.ext-pill.cat-image {
  background: rgba(34, 211, 238, 0.16);
  color: #67e8f9;
}

.ext-pill.cat-archive {
  background: var(--green-soft);
  color: #6ee7b7;
}

.ext-pill.cat-audio {
  background: rgba(236, 72, 153, 0.18);
  color: #f9a8d4;
}

.ext-pill.cat-document {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

.public-badge {
  position: absolute;
  top: 9px;
  right: 9px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.22);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #6ee7b7;
  backdrop-filter: blur(6px);
}

.play-badge {
  position: absolute;
  bottom: 9px;
  right: 9px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: grid;
  place-items: center;
  font-size: 0.78rem;
}

.file-body {
  padding: 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.file-name {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.file-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.file-actions {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
}

.file-actions .btn {
  flex: 1;
  padding: 6px 8px;
  font-size: 0.8rem;
}

/* Files List View */
.files-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1.8fr) auto auto auto;
  align-items: center;
  gap: 14px;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.file-row:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.row-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #0c1018;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: pointer;
}

.row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.row-main {
  min-width: 0;
  cursor: pointer;
}

.row-main .file-name {
  margin-bottom: 2px;
}

.row-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.row-size {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 58px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.empty-state h3 {
  margin: 0 0 6px;
  color: var(--text);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 12, 0.78);
  backdrop-filter: blur(6px);
}

.modal-dialog {
  position: relative;
  width: 100%;
  max-width: 980px;
  max-height: 90vh;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.modal-title {
  margin: 0;
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-body {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) 330px;
  overflow-y: auto;
}

.modal-preview-stage {
  background: #06080e;
  padding: 20px;
  display: grid;
  place-items: center;
  min-height: 320px;
  max-height: 70vh;
  overflow: auto;
}

.modal-preview-stage img {
  max-width: 100%;
  max-height: 62vh;
  border-radius: 10px;
  object-fit: contain;
}

.modal-preview-stage video {
  width: 100%;
  max-height: 62vh;
  border-radius: 10px;
  background: #000;
}

.modal-preview-stage audio {
  width: 100%;
  max-width: 460px;
}

.modal-preview-stage iframe {
  width: 100%;
  height: 60vh;
  border: 0;
  border-radius: 8px;
  background: #fff;
}

.modal-preview-stage pre {
  width: 100%;
  max-height: 60vh;
  margin: 0;
  padding: 14px;
  background: #0b0f19;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.preview-binary-card {
  text-align: center;
  padding: 30px 20px;
}

.preview-binary-card .big-emoji {
  font-size: 3.4rem;
  margin-bottom: 10px;
}

.modal-sidebar {
  border-left: 1px solid var(--border);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-section h4 {
  margin: 0 0 8px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.info-list {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.info-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.85rem;
}

.info-list dt {
  color: var(--text-dim);
}

.info-list dd {
  margin: 0;
  text-align: right;
  word-break: break-all;
}

.hash-box {
  margin-top: 10px;
  padding: 9px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.hash-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.hash-box code {
  display: block;
  font-size: 0.74rem;
  color: var(--cyan);
  word-break: break-all;
}

.inline-form {
  display: flex;
  gap: 8px;
}

.inline-form input {
  flex: 1;
  min-width: 0;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 0.85rem;
  outline: none;
}

.inline-form input:focus {
  border-color: var(--accent);
}

.share-toggle-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.share-link-box {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.modal-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  transition: 0.2s;
}

.slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}

.switch input:checked + .slider {
  background: var(--green);
}

.switch input:checked + .slider::before {
  transform: translateX(18px);
}

/* Public Share Page */
.share-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 10%, rgba(88, 101, 242, 0.14), transparent 36%),
    var(--bg);
}

.share-topbar {
  height: 64px;
  padding: 0 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.share-shell {
  max-width: 940px;
  margin: 0 auto;
  padding: 28px 18px 56px;
}

.share-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.share-card-empty {
  max-width: 480px;
  margin: 60px auto;
  text-align: center;
}

.share-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.share-filename {
  margin: 8px 0 6px;
  font-size: 1.35rem;
  word-break: break-word;
}

.share-preview {
  margin-top: 22px;
  background: #07090f;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: grid;
  place-items: center;
}

.share-preview img,
.share-preview video {
  max-width: 100%;
  max-height: 66vh;
  border-radius: 8px;
}

.share-preview audio {
  width: 100%;
  max-width: 520px;
}

.share-preview-pdf iframe {
  width: 100%;
  height: 65vh;
  border: 0;
  border-radius: 8px;
  background: #fff;
}

.share-preview-text pre {
  width: 100%;
  max-height: 60vh;
  margin: 0;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.share-meta-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.meta-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
}

.meta-label {
  display: block;
  font-size: 0.74rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.meta-value {
  font-size: 0.82rem;
  word-break: break-all;
}

.meta-hash {
  color: var(--cyan);
}

/* Toasts */
.toast-container {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 340px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 0.88rem;
  box-shadow: var(--shadow);
  animation: slideIn 0.18s ease;
}

.toast.success {
  border-left-color: var(--green);
}

.toast.error {
  border-left-color: var(--rose);
}

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

/* Responsive */
.mobile-only {
  display: none;
}

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

  .mobile-only {
    display: inline-grid;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    height: 100vh;
    z-index: 80;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-header.mobile-only {
    display: flex;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 75;
    background: rgba(0, 0, 0, 0.6);
  }

  .modal-body {
    grid-template-columns: 1fr;
  }

  .modal-sidebar {
    border-left: 0;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 680px) {
  .desktop-only {
    display: none;
  }

  .topbar {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 14px;
    gap: 10px;
  }

  .topbar-search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }

  .main-content {
    padding: 14px 14px 40px;
  }

  .dropzone {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
  }

  .dropzone .btn {
    width: 100%;
  }

  .files-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
  }

  .file-thumb {
    height: 126px;
  }

  .file-row {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 10px;
  }

  .row-size,
  .row-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .toast-container {
    left: 14px;
    right: 14px;
    max-width: none;
  }
}
