:root {
  --bg: #0f1419;
  --card: #1a2332;
  --card-hover: #243044;
  --text: #e8edf4;
  --muted: #8b9cb3;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.15);
  --border: rgba(255, 255, 255, 0.08);
  --radius: 14px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px 32px;
}

.header {
  text-align: center;
  padding: 8px 0 20px;
}

.header-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 6px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.header h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
}

.subtitle {
  font-size: 14px;
  color: var(--muted);
}

.search-wrap {
  margin-bottom: 16px;
}

#search {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  font-size: 16px;
  outline: none;
}

#search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 8px;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex-shrink: 0;
  padding: 10px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

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

.content { min-height: 200px; }

.loader {
  text-align: center;
  color: var(--muted);
  padding: 40px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.card:active { transform: scale(0.98); }
.card:hover { background: var(--card-hover); }

.card-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}

.card-body { flex: 1; min-width: 0; }

.card-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 4px;
}

.card-meta {
  font-size: 12px;
  color: var(--muted);
}

.card-arrow {
  color: var(--muted);
  font-size: 18px;
  flex-shrink: 0;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 32px 16px;
  font-size: 14px;
}

.text-preview {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.45;
  white-space: pre-wrap;
  max-height: 120px;
  overflow: hidden;
}

.video-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.video-modal {
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

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

.video-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.video-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
}

.video-modal video {
  width: 100%;
  max-height: 60vh;
  background: #000;
  display: block;
}

.video-open-ext {
  display: block;
  width: calc(100% - 28px);
  margin: 12px 14px 14px;
  padding: 10px;
  border: none;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
