/* ============================================================
   Design Tokens — CSS Custom Properties
   Dark theme is default; [data-theme="light"] overrides
   ============================================================ */

:root {
  /* Surfaces */
  --bg-base:        #121214;
  --surface-primary: #1e1e24;
  --surface-hover:  #25252b;
  --surface-raised: #2a2a32;
  --surface-input:  rgba(0,0,0,0.2);

  /* Text */
  --text-primary:   #e4e4e7;
  --text-secondary: #a1a1aa;
  --text-muted:     #71717a;

  /* Brand */
  --accent-primary: #6366f1;
  --accent-hover:   #4f46e5;

  /* Semantics */
  --success:  #22c55e;
  --danger:   #ef4444;
  --warning:  #f59e0b;
  --info:     #3b82f6;
  --neutral:  #71717a;

  /* Borders */
  --border-subtle:  rgba(255,255,255,0.03);
  --border-default: rgba(255,255,255,0.05);
  --border-strong:  rgba(255,255,255,0.10);

  /* Spacing (8pt grid) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;

  /* Radii */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   16px;
  --radius-pill: 9999px;
  --radius-full: 50%;

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'SF Mono', 'Menlo', 'Consolas', monospace;

  /* Shadows (more visible in dark via borders) */
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.25);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.35);

  /* Z-index */
  --z-dropdown: 40;
  --z-sticky:   50;
  --z-modal:    100;

  /* Transitions */
  --dur-fast:   150ms;
  --dur-normal: 250ms;
  --dur-slow:   350ms;
}

[data-theme="light"] {
  --bg-base:        #f8fafc;
  --surface-primary: #ffffff;
  --surface-hover:  #f1f5f9;
  --surface-raised: #ffffff;
  --surface-input:  #ffffff;

  --text-primary:   #0f172a;
  --text-secondary: #64748b;
  --text-muted:     #94a3b8;

  --border-subtle:  #f1f5f9;
  --border-default: #e2e8f0;
  --border-strong:  #cbd5e1;

  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.10);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.10);
}

/* ============================================================
   Reset & Base
   ============================================================ */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-base);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

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

button { font-family: inherit; cursor: pointer; border: none; background: none; }

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

img, video { max-width: 100%; display: block; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   Grid container
   ============================================================ */
.page-grid {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--space-8);
}

@media (max-width: 768px) {
  .page-grid { padding: 0 var(--space-4); }
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25;
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast), opacity var(--dur-fast);
  white-space: nowrap;
  vertical-align: middle;
  border: 1px solid transparent;
}

.btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

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

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

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn-danger:hover { background: #dc2626; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: var(--space-1) var(--space-3); font-size: 0.8125rem; }
.btn-icon {
  padding: var(--space-2);
  border-radius: var(--radius-md);
}

/* ============================================================
   Form Controls
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.form-input {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: var(--surface-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: border-color var(--dur-fast), outline var(--dur-fast);
}

.form-input:focus {
  outline: 2px solid var(--accent-primary);
  outline-offset: 1px;
  border-color: var(--accent-primary);
}

.form-input::placeholder { color: var(--text-muted); }
.form-input:disabled { opacity: 0.5; cursor: not-allowed; }

.form-row { display: flex; gap: var(--space-4); flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 200px; }

/* ============================================================
   Badges
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
}

.badge-success  { color: var(--success);  background: rgba(34,197,94,0.12);  }
.badge-danger   { color: var(--danger);   background: rgba(239,68,68,0.12);  }
.badge-warning  { color: var(--warning);  background: rgba(245,158,11,0.12); }
.badge-info     { color: var(--info);     background: rgba(59,130,246,0.12); }
.badge-neutral  { color: var(--neutral);  background: rgba(113,113,122,0.12);}

/* ============================================================
   Alerts
   ============================================================ */
.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  border-left: 4px solid;
}
.alert-danger {
  background: rgba(239,68,68,0.1);
  border-color: var(--danger);
  color: var(--danger);
}
.alert-detail { opacity: 0.8; }

/* ============================================================
   Auth Page
   ============================================================ */
.auth-container {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.auth-logo { display: flex; justify-content: center; }
.auth-title {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  text-align: center;
  color: var(--text-primary);
}
.auth-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: calc(-1 * var(--space-4));
}

.auth-form { display: flex; flex-direction: column; gap: var(--space-4); }

/* ============================================================
   App Layout
   ============================================================ */
.app-layout {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Toolbar */
.toolbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--surface-primary);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-8);
  height: 56px;
}

.toolbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* 🦐 Shreemp brand mark — emoji logo */
.logo-emoji {
  font-size: 1.75rem;
  line-height: 1;
  display: inline-block;
  user-select: none;
}
.logo-emoji-lg { font-size: 2.5rem; }
.logo-emoji-sm { font-size: 1.5rem; }
.toolbar-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Theme toggle icons */
[data-theme="dark"]  .icon-moon { display: none; }
[data-theme="dark"]  .icon-sun  { display: block; }
[data-theme="light"] .icon-sun  { display: none; }
[data-theme="light"] .icon-moon { display: block; }

.main-content {
  flex: 1;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

@media (max-width: 768px) {
  .toolbar { padding: 0 var(--space-4); }
  .main-content { padding: var(--space-4); gap: var(--space-6); }
}

/* ============================================================
   Section headers
   ============================================================ */
.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.section-count {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 2px 8px;
  background: var(--surface-hover);
  border-radius: var(--radius-pill);
}

/* ============================================================
   Upload Card
   ============================================================ */
.upload-card {
  background: var(--surface-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.upload-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-12) var(--space-8);
  border-bottom: 1px solid var(--border-default);
  cursor: pointer;
  transition: background var(--dur-fast);
  text-align: center;
}
.upload-dropzone:hover, .upload-dropzone.drag-over {
  background: var(--surface-hover);
}
.upload-dropzone-text {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}
.upload-browse-link {
  color: var(--accent-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.upload-browse-link:hover { color: var(--accent-hover); }
.upload-dropzone-hint {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.upload-fields {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.upload-file-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--surface-hover);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
}
.upload-file-name {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.875rem;
  word-break: break-all;
}
.upload-file-size {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.upload-file-info .btn-icon { margin-left: auto; flex-shrink: 0; }

/* Expiry control */
.expiry-control {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}
.expiry-input {
  width: 90px;
  flex-shrink: 0;
  font-family: var(--font-mono);
  text-align: center;
}
.expiry-unit-toggle {
  display: flex;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.expiry-unit-btn {
  padding: var(--space-2) var(--space-3);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface-input);
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast);
  border: none;
  font-family: inherit;
}
.expiry-unit-btn + .expiry-unit-btn { border-left: 1px solid var(--border-strong); }
.expiry-unit-btn.active {
  background: var(--accent-primary);
  color: #fff;
}
.expiry-unit-btn:hover:not(.active) {
  background: var(--surface-hover);
  color: var(--text-primary);
}
.expiry-unit-btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 1px;
}

/* Progress */
.upload-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.progress-bar {
  height: 6px;
  background: var(--border-strong);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent-primary);
  border-radius: var(--radius-pill);
  transition: width 200ms linear;
}
.progress-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
}

/* ============================================================
   Data Table
   ============================================================ */
.table-container {
  background: var(--surface-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

.data-table th {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}

.data-table td {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-default);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr:hover td { background: var(--surface-hover); }

.col-right, .cell-right { text-align: right; }
.col-actions { text-align: right; }
.cell-actions {
  display: flex;
  gap: var(--space-1);
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
}
.cell-mono {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  white-space: nowrap;
}
.cell-date { font-size: 0.8125rem; color: var(--text-secondary); white-space: nowrap; }
.data-table .cell-name { max-width: 320px; padding-top: var(--space-2); padding-bottom: var(--space-2); }
.cell-name-title { font-weight: 500; word-break: break-word; }
.cell-name-file {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  word-break: break-word;
  margin-top: 2px;
}

.action-btn { color: var(--text-muted); border-radius: var(--radius-sm); }
.action-btn:hover { color: var(--text-primary); background: var(--surface-hover); }
.action-btn-danger:hover { color: var(--danger); background: rgba(239,68,68,0.1); }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-12) var(--space-8);
  color: var(--text-muted);
  background: var(--surface-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
}

/* Responsive table → card stack */
@media (max-width: 600px) {
  .table-container { border: none; background: none; }
  .data-table { display: block; min-width: 0; }
  .data-table thead { display: none; }
  .data-table tbody { display: flex; flex-direction: column; gap: var(--space-3); }
  .data-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
    padding: var(--space-4);
    background: var(--surface-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
  }
  .data-table tr:hover { background: var(--surface-hover); }
  .data-table td {
    padding: 0;
    border: none;
    font-size: 0.8125rem;
  }
  .data-table td.cell-name {
    grid-column: 1 / -1;
    max-width: none;
  }
  .data-table td .cell-name-title {
    font-size: 0.9375rem;
  }
  .data-table td.cell-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  animation: fadeIn var(--dur-normal) ease-out;
}

.modal-body {
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-lg);
  max-width: 420px;
  width: 100%;
  animation: slideUp var(--dur-normal) ease-out;
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}
.modal-text {
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
  line-height: 1.6;
}
.modal-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
}

/* ============================================================
   Toasts
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-modal);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
  max-width: 360px;
  width: calc(100% - var(--space-8));
}

.toast {
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  border-left: 4px solid;
  animation: slideInRight var(--dur-normal) ease-out;
  pointer-events: all;
}
.toast-success { border-left-color: var(--success); }
.toast-danger  { border-left-color: var(--danger); }
.toast-info    { border-left-color: var(--info); }

.toast-message {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-primary);
  line-height: 1.4;
}

/* ============================================================
   View Page
   ============================================================ */
.view-layout {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.view-header {
  background: var(--surface-primary);
  border-bottom: 1px solid var(--border-default);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}
.view-header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--space-8);
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.view-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color var(--dur-fast);
}
.view-brand:hover { color: var(--text-primary); }

.view-main {
  flex: 1;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.view-meta { text-align: center; }
.view-title {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  word-break: break-word;
}
.view-expiry {
  margin-top: var(--space-2);
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.view-content { display: flex; flex-direction: column; gap: var(--space-4); }

/* PDF viewer */
.pdf-viewer {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.pdf-actions { display: flex; justify-content: center; }
.pdf-embed-wrap {
  width: 100%;
  aspect-ratio: 8.5 / 11;
  min-height: 500px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-primary);
}
.pdf-embed {
  width: 100%;
  height: 100%;
  border: none;
}

/* Image viewer */
.image-viewer { display: flex; justify-content: center; }
.image-zoom-container {
  position: relative;
  display: inline-block;
  max-width: 800px;
  width: 100%;
}
.preview-image {
  max-width: 800px;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  display: block;
}
.zoom-lens {
  position: absolute;
  border: 2px solid var(--accent-primary);
  border-radius: var(--radius-sm);
  pointer-events: none;
  background: rgba(99,102,241,0.1);
  transition: opacity var(--dur-fast);
}
.zoom-result {
  position: fixed;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-repeat: no-repeat;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  z-index: var(--z-dropdown);
  width: 320px;
  height: 320px;
}

/* Video viewer */
.video-viewer { display: flex; justify-content: center; }
.video-wrap {
  position: relative;
  width: 100%;
  max-width: 900px;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16/9;
}
.preview-video {
  width: 100%;
  height: 100%;
  display: block;
}
.video-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--dur-fast);
}
.video-play-overlay.hidden { opacity: 0; pointer-events: none; }
.video-play-btn {
  border: none;
  background: none;
  cursor: pointer;
  color: #fff;
  transition: transform var(--dur-fast), opacity var(--dur-fast);
}
.video-play-btn:hover { transform: scale(1.1); }
.video-play-btn:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 4px; border-radius: var(--radius-full); }

/* Audio viewer */
.audio-viewer { display: flex; justify-content: center; padding: var(--space-8) 0; }
.preview-audio { width: 100%; max-width: 600px; }

/* Other viewer */
.other-viewer { display: flex; justify-content: center; padding: var(--space-12) var(--space-8); }
.other-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
  text-align: center;
  max-width: 400px;
}
.other-info { display: flex; flex-direction: column; gap: var(--space-2); }
.other-name { font-size: 1.25rem; font-weight: 600; color: var(--text-primary); word-break: break-word; }
.other-filename { font-family: var(--font-mono); font-size: 0.875rem; color: var(--text-secondary); word-break: break-all; }
.other-type { font-size: 0.8125rem; color: var(--text-muted); }

/* Error pages */
.error-container {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
}
.error-card {
  text-align: center;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}
.error-icon { color: var(--text-muted); }
.error-title { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.025em; color: var(--text-primary); }
.error-text { color: var(--text-secondary); line-height: 1.6; }

/* ============================================================
   Animations
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideUp {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes fadeOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(100%); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* Skeleton */
.skeleton {
  background: var(--surface-hover);
  border-radius: var(--radius-sm);
  animation: pulse 1.5s ease-in-out infinite;
}

/* ============================================================
   Responsive / screen size adjustments
   ============================================================ */
@media (min-width: 1921px) {
  .main-content, .view-main, .toolbar, .view-header-inner {
    max-width: 960px;
  }
  body { padding: 0; }
}

@media (max-width: 768px) {
  .view-header-inner { padding: 0 var(--space-4); }
  .view-main { padding: var(--space-4); }
  .view-title { font-size: 1.375rem; }
  .view-meta { text-align: left; }

  .pdf-embed-wrap { aspect-ratio: unset; min-height: 70dvh; }

  .image-zoom-container { max-width: 100%; }
  .video-wrap { max-width: 100%; }

  .modal-body { padding: var(--space-6); }
  .toast-container { bottom: var(--space-4); right: var(--space-4); left: var(--space-4); max-width: none; }
}

@media (max-width: 480px) {
  .auth-card { padding: var(--space-6); }
  .toolbar { padding: 0 var(--space-3); }
  .toolbar-name { display: none; }
}

/* ============================================================
   Icon colors (SVGs use currentColor; set via container color)
   ============================================================ */
.upload-dropzone > svg { color: var(--text-muted); }
.other-card > svg { color: var(--text-muted); }

/* ============================================================
   Utilities — keep LAST so .is-hidden wins over component display.
   JS toggles visibility via element.style (CSSOM, allowed under strict
   style-src CSP); the initial hidden state is set with this class so
   there is no first-paint flash.
   ============================================================ */
.is-hidden { display: none; }
