/* ============================================
   Media Analyzer — Style System
   ============================================ */

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

/* --- Design Tokens --- */
:root {
  /* Background */
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

  --bg-primary: #0f172a;
  --bg-surface: #12121a;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-hover: rgba(28, 28, 45, 0.8);
  --bg-input: rgba(255, 255, 255, 0.04);

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.15);
  --border-accent: rgba(167, 139, 250, 0.3);
  --border-glow: rgba(167, 139, 250, 0.5);

  /* Text */
  --text-primary: #f8fafc;
  --text-secondary: #8888a0;
  --text-muted: #94a3b8;
  --text-accent: #a78bfa;

  /* Accents */
  --accent-red: #f87171;
  --accent-purple: #a78bfa;
  --accent-cyan: #06b6d4;
  --accent-amber: #fbbf24;
  --accent-green: #34d399;
  --accent-pink: #f472b6;

  /* Gradients */
  --grad-accent: linear-gradient(135deg, #a78bfa 0%, #06b6d4 100%);
  --grad-card: linear-gradient(145deg, rgba(167, 139, 250, 0.05) 0%, rgba(6, 182, 212, 0.03) 100%);
  --grad-glow: radial-gradient(ellipse at 50% 0%, rgba(167, 139, 250, 0.12) 0%, transparent 60%);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;

  /* Header Controls */
  --control-height: 2.4rem;
  --control-height-sm: 1.78rem;
  --control-height-xs: 1.64rem;

  /* Shadows */
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3), 0 1px 4px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.08);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', monospace;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Light Theme Overrides ===== */
.light-theme {
  --bg-primary: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.7);
  --bg-card-hover: rgba(245, 243, 255, 0.8);
  --border-subtle: rgba(148, 163, 184, 0.5);
  --text-primary: #111827;
  --text-muted: #60738f;

  --shadow-card: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 25px rgba(59, 130, 246, 0.1);

  background-image:
    radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(168, 85, 247, 0.1) 0%, transparent 50%);
}

body {
  background-color: var(--bg-primary);
  background-image:
    radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(168, 85, 247, 0.15) 0%, transparent 50%);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem;
  overflow-x: hidden;
}

body::selection {
  background: var(--bg-secondary);
  color: var(--accent-cyan);
}

/* ============================================
   HEADER
   ============================================ */
.header {
  width: 100%;
  max-width: 960px;
  margin-bottom: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.header-main {
  display: flex;
  align-items: center;
  gap: 16px;
}

.title {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  text-align: center;
  margin: 0 1rem 0.5rem;
  background: var(--gradient-primary);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.subtitle {
  font-size: 0.9rem;
  text-align: center;
  color: var(--text-muted);
  margin: 0 1rem 1rem;
}

.title-icon {
  height: 2rem;
  width: auto;
  vertical-align: middle;
  margin-right: 1rem;
  filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.3));
  transition: transform 0.3s ease;
  animation: float 3s ease-in-out infinite;
}

.title:hover .title-icon {
  transform: scale(1.1) rotate(15deg);
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

/* ============================================
   THEME AND LANGUAGE SWITCHER
   ============================================ */
.theme-lang-switcher {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  display: flex;
  gap: 0.5rem;
  z-index: 100;
}

/* ===== THEME TOGGLE ===== */
.theme-toggle-group {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.theme-toggle-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--gradient-primary);
  border: 1px solid var(--border-subtle);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transform: translateY(0) scale(0.94);
  opacity: 0.50;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.theme-toggle-btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

.theme-toggle-btn:hover {
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  opacity: 0.95;
}

.theme-toggle-btn:hover svg {
  transform: translateY(-1px);
}

.theme-toggle-btn:active {
  transform: scale(0.95);
}

.theme-toggle-btn:focus-visible {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35), 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.theme-toggle-btn.is-active {
  opacity: 1;
  transform: translateY(-1px) scale(1);
}

.light-theme .theme-toggle-btn {
  box-shadow: 0 8px 22px rgba(59, 130, 246, 0.24);
}

.version-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 2px 10px;
  border-radius: 100px;
}

/* ===== LANGUAGE SELECTOR ===== */
.lang-select {
  box-sizing: border-box;
  background: transparent;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  height: var(--control-height);
  padding: 0 2.5rem 0 1rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.3s ease;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 14px 14px;
  outline: none;
}

.lang-select:hover {
  border-color: var(--border-accent);
  color: var(--text-primary);
  transform_: translateY(-2px);
}

.lang-select:focus {
  box-shadow: 0 0 0 2px var(--shadow-glow);
}

.lang-select option {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  padding: 10px;
}

.light-theme .lang-select {
  box-shadow: 0 1px 1px rgba(59, 130, 246, 0.06);
}

/* ============================================
   MAIN
   ============================================ */
#app-main {
  flex: 1;
  position: relative;
  z-index: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: var(--space-xl);
}

/* --- Upload Section --- */
#upload-section {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
  animation: fadeInUp 0.6s var(--transition-slow) both;
}

#upload-section.hidden {
  display: none;
}

#upload-section.visible {
  display: flex;
}

#drop-zone {
  position: relative;
  width: 100%;
  max-width: 600px;
  padding: var(--space-2xl) var(--space-xl);
  border: 2px dashed var(--border-accent);
  border-radius: var(--radius-xl);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: center;
  outline: none;
}

#drop-zone::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-xl);
  background: var(--grad-glow);
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

#drop-zone:hover,
#drop-zone:focus-visible {
  border-color: var(--border-glow);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

#drop-zone:hover::before,
#drop-zone:focus-visible::before {
  opacity: 1;
}

#drop-zone.drag-over {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.08);
  transform: scale(1.02);
  box-shadow: 0 0 60px rgba(6, 182, 212, 0.15);
}

.drop-zone-content {
  position: relative;
  z-index: 1;
}

.drop-icon {
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
  transition: color var(--transition-base), transform var(--transition-base);
}

#drop-zone:hover .drop-icon,
#drop-zone.drag-over .drop-icon {
  color: var(--accent-purple);
  transform: translateY(-4px);
}

.drop-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.drop-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.drop-formats {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* --- Results Section --- */
#results-section {
  animation: fadeInUp 0.5s ease both;
}

#results-section.hidden {
  display: none;
}

/* Toolbar */
#results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
}

.file-badge {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.file-badge span {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--text-primary);
}

#btn-reset {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

#btn-reset:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: var(--border-accent);
}

/* --- Results Grid --- */
#results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: blur(12px);
  transition: all var(--transition-base);
  animation: fadeInUp 0.5s ease both;
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.10s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.20s; }
.card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6) { animation-delay: 0.30s; }
.card:nth-child(7) { animation-delay: 0.35s; }
.card:nth-child(8) { animation-delay: 0.40s; }
.card:nth-child(9) { animation-delay: 0.45s; }

.card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--grad-card);
}

.card-header h2 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.2);
  padding: 2px 8px;
  border-radius: 100px;
}

.card-body {
  padding: var(--space-md) var(--space-lg);
}

/* Preview card spans full width on first row */
.card-preview {
  grid-column: 1 / 2;
}

#media-preview-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  max-height: 400px;
  background: repeating-conic-gradient(#CCCCCC 0 25%, #FFFFFF 0 50%) 50% / 20px 20px;
  background-size: 10px 10px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

#image-preview {
  max-width: 100%;
  max-height: 380px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

#image-preview.hidden,
#video-preview.hidden,
#raw-preview-placeholder.hidden {
  display: none;
}

#video-preview {
  max-width: 100%;
  max-height: 380px;
  border-radius: var(--radius-sm);
  outline: none;
}

#raw-preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-2xl);
  color: var(--text-muted);
}

#raw-preview-placeholder p {
  font-size: 0.9rem;
  font-weight: 500;
}

#raw-preview-placeholder .raw-hint {
  font-size: 0.75rem;
  color: var(--accent-green);
  font-weight: 400;
}

.tag-video {
  color: var(--accent-pink);
  background: rgba(244, 114, 182, 0.1);
  border-color: rgba(244, 114, 182, 0.2);
}

.card-video.hidden {
  display: none;
}

/* --- Meta Table --- */
.meta-table {
  width: 100%;
  border-collapse: collapse;
}

.meta-table tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-fast);
}

.meta-table tr:last-child {
  border-bottom: none;
}

.meta-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.meta-table td {
  padding: var(--space-sm) 0;
  font-size: 0.82rem;
  vertical-align: top;
}

.meta-table td:first-child {
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  padding-right: var(--space-lg);
  width: 40%;
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

.meta-table td:last-child {
  color: var(--text-primary);
  word-break: break-word;
}

/* --- Histogram --- */
.card-histogram {
  grid-column: 1 / -1;
}

#histogram-canvas {
  width: 100%;
  height: 200px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.25);
}

.histogram-toggles {
  display: flex;
  gap: 4px;
}

.hist-btn {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 100px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.hist-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-accent);
}

.hist-btn.active {
  background: var(--accent-purple);
  color: #fff;
  border-color: var(--accent-purple);
}

.hist-btn[data-channel="r"].active {
  background: var(--accent-red);
  border-color: var(--accent-red);
}

.hist-btn[data-channel="g"].active {
  background: var(--accent-green);
  border-color: var(--accent-green);
}

.hist-btn[data-channel="b"].active {
  background: #3b82f6;
  border-color: #3b82f6;
}

.hist-btn[data-channel="lum"].active {
  background: var(--text-secondary);
  border-color: var(--text-secondary);
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: var(--space-lg) 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

/* --- Footer --- */
#app-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: var(--space-lg) var(--space-xl);
  color: var(--text-muted);
  font-size: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

/* --- Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-border {
  0%, 100% { border-color: var(--border-accent); }
  50% { border-color: var(--accent-cyan); }
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* --- Loading spinner --- */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(8px);
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--accent-purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

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

/* --- Responsive --- */
@media (max-width: 900px) {
  #results-grid {
    grid-template-columns: 1fr;
  }

  .card-preview {
    grid-column: 1;
  }

  .card-histogram {
    grid-column: 1;
  }

  #app-main {
    padding: var(--space-md);
  }
}

/* ============================================
   FOOTER
   ============================================ */
.app-footer {
  width: 100%;
  max-width: 1100px;
  margin-top: auto;
  padding: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: center;
  position: relative;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 0 1rem;
  color: var(--text-muted);
}

.footer-title {
  font-weight: 500;
  font-size: 0.85rem;
}

.footer-separator {
  color: var(--border-subtle);
  user-select: none;
}

.footer-content a {
  color: #a78bfa;
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.footer-content a:hover {
  color: #764ba2;
  filter: brightness(1.2);
}

/* ============================================
   SCROLL-TO-TOP BUTTON
   ============================================ */
.scroll-top-btn {
  position: fixed;
  right: 2rem;
  bottom: 2rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--gradient-primary);
  border: 1px solid var(--border-subtle);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
}

.scroll-top-btn.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top-btn svg {
  transition: transform 0.3s ease;
}

.scroll-top-btn:hover {
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.scroll-top-btn:hover svg {
  transform: translateY(-2px);
}

.scroll-top-btn:active {
  transform: scale(0.95);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1000px) {
  .theme-lang-switcher {
    top: 0.55rem;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    gap: 0.4rem;
  }

  .header {
    padding-top: 3.1rem;
  }

  .title {
    font-size: 1.8rem;
    line-height: 1.2;
  }
}

@media (max-width: 800px) {
  .theme-lang-switcher {
    top: 0.5rem;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    gap: 0.35rem;
  }

  .theme-toggle-group {
    height: var(--control-height-sm);
    padding: 0 0.16rem;
    gap: 0.22rem;
  }

  .theme-toggle-btn {
    width: 1.72rem;
    height: 1.72rem;
  }

  .theme-toggle-btn svg {
    width: 13px;
    height: 13px;
  }

  .lang-select {
    height: var(--control-height-sm);
    font-size: 0.82rem;
    padding: 0 2.2rem 0 0.7rem;
    background-position: right 0.6rem center;
  }

  .header-inner {
    padding: var(--space-sm) var(--space-md);
  }

  .logo h1 {
    font-size: 1rem;
  }

  #drop-zone {
    padding: var(--space-xl) var(--space-md);
  }

  .drop-title {
    font-size: 1rem;
  }
}

@media (max-width: 380px) {
  .theme-lang-switcher {
    top: 0.45rem;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }

  .theme-toggle-btn {
    width: 1.58rem;
    height: 1.58rem;
  }

  .lang-select {
    height: var(--control-height-xs);
    max-width: 7.9rem;
    font-size: 0.78rem;
  }

  .theme-toggle-group {
    height: var(--control-height-xs);
  }
}

/* --- Card body scrollable for long metadata --- */
.card-exif .card-body,
.card-meta .card-body {
  max-height: 400px;
  overflow-y: auto;
}
