/* ========================================
   YouTubeSearchPro - Design System
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* --- Design Tokens --- */
:root {
  --bg-primary: #0f0f0f;
  --bg-secondary: #181818;
  --bg-surface: #272727;
  --bg-surface-hover: #3a3a3a;
  --bg-glass: rgba(39, 39, 39, 0.8);
  --bg-glass-strong: rgba(24, 24, 24, 0.95);

  --color-primary: #f1f1f1;
  --color-accent: #3ea6ff;

  --text-primary: #f1f1f1;
  --text-secondary: #aaaaaa;
  --text-muted: #717171;
  --text-link: #3ea6ff;

  --border-color: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(255, 255, 255, 0.2);

  --shadow-sm: 0 1px 4px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 22px;
  --radius-full: 9999px;

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--text-link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select { font-family: inherit; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--bg-surface-hover); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* --- Layout --- */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Header --- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 14px 0;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: #ff0000;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
}

.logo-text span {
  color: var(--text-primary);
}

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

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-hover);
}

.btn-primary {
  background: var(--text-primary);
  border: none;
  color: #0f0f0f;
  font-weight: 600;
}

.btn-primary:hover {
  background: #d9d9d9;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--bg-surface);
}

.btn-sm { padding: 5px 10px; font-size: 0.8rem; }
.btn-icon { padding: 8px; }

/* --- Hero / Search Area --- */
.hero {
  padding: 60px 0 30px;
  text-align: center;
  background: var(--bg-primary);
}

.hero-title {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.hero-title .highlight {
  color: var(--text-primary);
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 32px;
}

/* --- Search Bar --- */
.search-wrapper {
  max-width: 720px;
  margin: 0 auto 20px;
  position: relative;
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 0;
  overflow: hidden;
  transition: border-color var(--transition-base);
}

.search-bar:focus-within {
  border-color: var(--border-hover);
}

.search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 1.05rem;
  padding: 14px 20px;
}

.search-bar input::placeholder { color: var(--text-muted); }

.search-btn {
  background: var(--bg-surface);
  border: none;
  border-radius: 0;
  color: var(--text-primary);
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
  transition: background var(--transition-base);
  display: flex;
  align-items: center;
  gap: 6px;
  height: 100%;
}

.search-btn:hover {
  background: var(--bg-surface-hover);
}

.search-btn:active {
  background: var(--bg-surface);
}




/* --- Operator Buttons --- */
.operator-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  max-width: 720px;
  margin: 0 auto;
}

.op-btn {
  padding: 5px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-family: 'SFMono-Regular', Consolas, monospace;
  transition: all var(--transition-fast);
}

.op-btn:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.op-btn.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

/* --- Filters Panel --- */
.filters-section {
  padding: 20px 0;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.filter-panel-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.filter-panel-toggle .btn {
  gap: 6px;
}

.filter-panel {
  max-width: 800px;
  margin: 0 auto;
}

.filter-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 0;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.filter-toggle-btn:hover { color: var(--text-primary); }

.filter-chevron {
  margin-left: auto;
  transition: transform var(--transition-base);
}

.filter-toggle-btn.open .filter-chevron {
  transform: rotate(180deg);
}

.filter-collapsible {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.filter-collapsible.open {
  max-height: 2000px;
}

.filter-fieldset {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 16px;
}

.filter-fieldset legend {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0 8px;
}

.filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.filter-group.full-width {
  grid-column: 1 / -1;
}

.filter-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.filter-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 4px;
  grid-column: 1 / -1;
}

.filter-select {
  appearance: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 9px 32px 9px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  width: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23717171' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.filter-select:hover { border-color: var(--border-hover); }
.filter-select:focus { outline: none; border-color: var(--text-secondary); }

.filter-input {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 9px 12px;
  font-size: 0.85rem;
  width: 100%;
  transition: border-color var(--transition-fast);
}

.filter-input::placeholder { color: var(--text-muted); font-size: 0.8rem; }
.filter-input:focus { outline: none; border-color: var(--text-secondary); }

.filter-custom-input {
  margin-top: 6px;
  width: 100%;
  padding: 8px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
}
.filter-custom-input::placeholder { color: var(--text-muted); font-size: 0.8rem; }
.filter-custom-input:focus { outline: none; border-color: var(--text-secondary); }

/* --- Tag Input --- */
.tag-input-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  min-height: 40px;
  transition: border-color var(--transition-fast);
}
.tag-input-container:focus-within {
  border-color: var(--text-secondary);
}
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 0.8rem;
  color: var(--text-primary);
}
.tag-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}
.tag-remove:hover {
  color: var(--text-primary);
}
.tag-input {
  flex-grow: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  min-width: 150px;
  padding: 2px 0;
}
.tag-input::placeholder {
  color: var(--text-muted);
}

.custom-date-inline {
  margin-top: 8px;
}

.custom-date-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.filter-date {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 9px 12px;
  font-size: 0.85rem;
  width: 100%;
  transition: border-color var(--transition-fast);
  color-scheme: dark;
}

.filter-date:focus { outline: none; border-color: var(--text-secondary); }

/* --- AND/OR Toggle --- */
.search-mode-toggle {
  display: inline-flex;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-top: 4px;
}

.search-mode-btn {
  padding: 7px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  background: var(--bg-surface);
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.search-mode-btn.active {
  background: var(--text-primary);
  color: #0f0f0f;
}

.search-mode-btn:hover:not(.active) {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

/* --- Toggle Switch --- */
.toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  margin-top: 16px;
}

.toggle-item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
  user-select: none;
}

.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

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

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 22px;
  transition: all var(--transition-base);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all var(--transition-base);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
  background: #fff;
}

/* --- Filter Header Row --- */
.filter-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  width: 100%;
}

.filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

/* --- Stats Bar --- */
.stats-bar {
  padding: 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.stats-info {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.stats-info strong { color: var(--text-primary); }

.stats-quota {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.quota-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
}

.quota-dot.warning { background: #fbbf24; }
.quota-dot.danger { background: #f87171; }

/* --- Results Grid --- */
.results-section { padding: 24px 0 60px; }

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* --- Video Card --- */
.video-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-base);
  animation: fadeSlideUp 0.4s ease both;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.video-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: inherit;
}

.video-card .thumbnail {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-secondary);
}

.video-card .thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.video-card:hover .thumbnail img { transform: scale(1.05); }

.video-card .duration-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.video-card .card-body { padding: 12px; }

.video-card .card-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.video-card .card-channel {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

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

.card-meta .dot::before { content: '•'; }

/* --- Load More --- */
.load-more-section {
  text-align: center;
  padding: 30px 0;
}

.load-more-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  padding: 14px 48px;
  font-size: 1rem;
  font-weight: 600;
  transition: all var(--transition-base);
}

.load-more-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-hover);
}




/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.active { display: flex; }

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  animation: scaleIn 0.25s ease;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  padding: 4px;
  line-height: 1;
  transition: color var(--transition-fast);
}

.modal-close:hover { color: var(--text-primary); }

.modal-body { padding: 24px; }

.modal-body .field { margin-bottom: 16px; }

.modal-body label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.modal-body input[type="text"],
.modal-body input[type="password"] {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: 0.9rem;
  transition: border-color var(--transition-fast);
}

.modal-body input:focus {
  outline: none;
  border-color: var(--text-secondary);
}

.modal-body .hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}

.modal-body .guide-steps {
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 12px;
}

.modal-body .guide-steps ol {
  padding-left: 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.modal-body .guide-steps li { margin-bottom: 8px; }

.modal-body .guide-steps a { color: var(--color-accent); }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* --- Toast --- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-glass-strong);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font-size: 0.875rem;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 240px;
}

.toast.success { border-left: 3px solid #34d399; }
.toast.error { border-left: 3px solid #f87171; }
.toast.info { border-left: 3px solid #60a5fa; }

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p { font-size: 0.9rem; }

/* --- Loading Skeleton --- */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.skeleton-card {
  border-radius: var(--radius-md);
  overflow: hidden;
}

.skeleton-thumb {
  aspect-ratio: 16 / 9;
  background: var(--bg-surface);
  animation: shimmer 1.5s infinite;
}

.skeleton-body { padding: 12px; }

.skeleton-line {
  height: 14px;
  background: var(--bg-surface);
  border-radius: 4px;
  margin-bottom: 8px;
  animation: shimmer 1.5s infinite;
}

.skeleton-line.short { width: 60%; }

/* --- Footer --- */
.footer {
  padding: 24px 0;
  text-align: center;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes shimmer {
  0% { opacity: 0.5; }
  50% { opacity: 0.8; }
  100% { opacity: 0.5; }
}

/* Staggered animation for cards */
.video-card:nth-child(1) { animation-delay: 0s; }
.video-card:nth-child(2) { animation-delay: 0.05s; }
.video-card:nth-child(3) { animation-delay: 0.1s; }
.video-card:nth-child(4) { animation-delay: 0.15s; }
.video-card:nth-child(5) { animation-delay: 0.2s; }
.video-card:nth-child(6) { animation-delay: 0.25s; }

/* --- Hidden Utility --- */
.hidden { display: none !important; }

/* --- Tooltips --- */
[title] {
  position: relative;
}

.btn-block-channel:hover {
  color: var(--danger) !important;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .hero { padding: 40px 0 20px; }
  .hero-title { font-size: 1.6rem; }
  
  .search-bar {
    border-radius: var(--radius-xl);
    padding-right: 0;
  }
  .search-btn span { display: none; }
  .search-btn { 
    padding: 12px 18px; 
    border-radius: 0;
    margin-left: auto;
    background: transparent;
  }
  .search-btn:hover { background: var(--bg-surface-hover); }
  .search-bar input {
    padding: 12px 16px;
    font-size: 1rem;
  }

  .filter-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .search-mode-toggle {
    width: 100%;
  }
  .search-mode-btn {
    flex: 1;
    text-align: center;
  }

  .filter-grid { grid-template-columns: 1fr; }
  .toggle-row { flex-direction: column; gap: 12px; }
  .results-grid { grid-template-columns: 1fr; gap: 16px; }
  .skeleton-grid { grid-template-columns: 1fr; }
  .stats-bar { flex-direction: column; align-items: flex-start; }
  .toast-container { left: 16px; right: 16px; }
  .toast { min-width: auto; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .results-grid { grid-template-columns: repeat(2, 1fr); }
}

/* --- Footer --- */
.site-footer {
  margin-top: 60px;
  padding: 24px 20px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.footer-inner {
  max-width: 800px;
  margin: 0 auto;
}

.footer-copy {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 8px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 10px;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-note {
  color: var(--text-muted);
  font-size: 0.7rem;
}

/* --- Legal Pages --- */
.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.legal-back {
  display: inline-block;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  margin-bottom: 24px;
  transition: color var(--transition-fast);
}

.legal-back:hover { color: var(--text-primary); }

.legal-page h1 {
  color: var(--text-primary);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.legal-updated {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 32px;
}

.legal-page section {
  margin-bottom: 28px;
}

.legal-page h2 {
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.legal-page p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 8px;
}

.legal-page ul {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
  padding-left: 20px;
  margin-bottom: 8px;
}

.legal-page li { margin-bottom: 4px; }

.legal-page a {
  color: #60a5fa;
  text-decoration: none;
}

.legal-page a:hover { text-decoration: underline; }
