:root {
  --bg: #0b0c0f;
  --panel: #0f1115;
  --border: #1a1e28;
  --text: #eaeef8;
  --muted: #a0a8c0;
  --accent: #0a84ff; /* Apple blue */
  --accent-2: #79ffe1;
  --glass: rgba(16, 19, 24, 0.5);
  --shadow: 0 6px 18px rgba(0,0,0,0.22), 0 1px 6px rgba(0,0,0,0.18);
  --pink: #ff7ab6;
  --violet: #9d7dff;
  --cyan: #7df9ff;
  --neon-a: #00ffd1;
  --neon-b: #ff4bd1;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: radial-gradient(1200px 800px at 50% -20%, #111523, transparent 60%), var(--bg); color: var(--text); font-family: -apple-system, system-ui, Segoe UI, Roboto, Helvetica, Arial, sans-serif; }
.skip-link { position: absolute; left: -999px; top: -999px; background: var(--accent); color: #0b0c0f; padding: 8px 12px; border-radius: 8px; z-index: 1000; }
.skip-link:focus { left: 12px; top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Background hero video */
.bg-video { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; overflow: hidden; background: var(--bg); }
.bg-video-el { width: 100%; height: 100%; object-fit: cover; opacity: 0.15; }
@media (prefers-reduced-motion: reduce) {
  .bg-video-el { display: none; }
}
/* Hide video on mobile to save bandwidth/battery */
@media (max-width: 768px) {
  .bg-video-el { display: none; }
}

.page-wrapper {
  position: relative;
  z-index: 2;
}

.aurora { position: fixed; inset: -20%; pointer-events: none; filter: blur(70px) saturate(130%); opacity: 0.18; z-index: 1; background:
  radial-gradient(900px 700px at 15% 0%, rgba(125,249,255,0.12), transparent 65%),
  radial-gradient(900px 700px at 85% 10%, rgba(157,125,255,0.12), transparent 65%);
}

.app-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 32px; border-bottom: 1px solid var(--border); position: sticky; top: 0; backdrop-filter: blur(8px); background: rgba(11,12,15,0.5); z-index: 100; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); }
.brand img { display: block; height: 32px; width: auto; filter: drop-shadow(0 2px 6px rgba(10,132,255,0.12)); }
.brand:hover img { filter: drop-shadow(0 3px 10px rgba(10,132,255,0.2)); }
.brand span { font-weight: 800; font-size: 18px; line-height: 1; letter-spacing: 0.2px; }
.header-actions { display: flex; gap: 16px; align-items: center; }
.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); padding: 8px 12px; border-radius: 10px; cursor: pointer; }
.ghost:hover { color: var(--text); border-color: var(--accent); }

.container { max-width: 1400px; margin: 64px auto; padding: 0 32px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 24px; margin-bottom: 24px; box-shadow: var(--shadow); }
.glass { background: var(--glass); backdrop-filter: blur(10px); }
.glass { position: relative; overflow: hidden; }
.glass::before { content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: 18px; background: linear-gradient(120deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02)); filter: blur(6px); }
.grid { display: grid; grid-template-columns: 1fr; gap: 32px; }

/* Hero */
.hero { background: transparent; padding: 0; margin-bottom: 28px; }
.hero-inner { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 24px; align-items: center; }
.hero-logo { display: inline-flex; align-items: center; gap: 8px; opacity: 0.92; margin-bottom: 4px; font-weight: 800; font-size: 22px; }
.hero-logo img { display: block; border-radius: 6px; box-shadow: 0 2px 8px rgba(10,132,255,0.2); }
.hero-copy h1 { margin: 8px 0 10px; font-size: 36px; letter-spacing: 0.2px; }
.lead { color: var(--muted); max-width: 56ch; }
.hero-ctas { margin-top: 20px; display: flex; gap: 16px; }
.waitlist-form { margin-top: 16px; display: grid; grid-template-columns: 1fr auto; gap: 12px; max-width: 420px; }
.waitlist-form input { 
  padding: 12px 14px; 
  border-radius: 12px; 
  border: 2px solid var(--accent); 
  background: rgba(12,14,20,0.8); 
  color: var(--text); 
  width: 100%; 
  box-shadow: 0 0 0 1px rgba(121,255,225,0.1), 0 2px 8px rgba(121,255,225,0.15);
  transition: all 0.2s ease;
}
.waitlist-form input.input-error { border-color: #ff5f56; box-shadow: 0 0 0 3px rgba(255,95,86,0.2); }
.waitlist-form input:focus { 
  outline: none; 
  border-color: var(--accent-2); 
  box-shadow: 0 0 0 3px rgba(121,255,225,0.2), 0 4px 12px rgba(121,255,225,0.25);
  background: rgba(12,14,20,0.95);
}
.waitlist-form input::placeholder { color: var(--muted); opacity: 0.7; }
.waitlist-form button { 
  padding: 12px 20px; 
  border-radius: 12px; 
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); 
  color: #0b0c0f; 
  font-weight: 800; 
  border: none; 
  cursor: pointer; 
  box-shadow: 0 4px 12px rgba(121,255,225,0.3), 0 0 0 1px rgba(121,255,225,0.2);
  transition: all 0.2s ease;
}
.waitlist-form button:hover { 
  transform: translateY(-1px); 
  box-shadow: 0 6px 16px rgba(121,255,225,0.4), 0 0 0 1px rgba(121,255,225,0.3);
}
.hero-card { background: var(--glass); border: 1px solid var(--border); border-radius: 16px; padding: 24px; box-shadow: var(--shadow); }
.mini-ui { display: grid; gap: 12px; }
.mini-search { display: grid; grid-template-columns: 22px 1fr 40px; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: rgba(12,14,20,0.6); }
.mini-prefix { color: var(--muted); }
.mini-input { color: var(--text); opacity: 0.9; }
.mini-kbd { font-size: 12px; color: var(--muted); border: 1px solid var(--border); padding: 4px 6px; border-radius: 6px; text-align: center; background: rgba(16,19,24,0.6); }
.mini-list { display: grid; gap: 8px; }
.mini-item { height: 40px; border: 1px solid var(--border); border-radius: 10px; background: linear-gradient(180deg, rgba(17,20,28,0.9), rgba(15,17,23,0.9)); }
.hero-grid { position: relative; }
.hero-grid::after { content: ""; position: absolute; inset: -12px; border-radius: 16px; background: repeating-linear-gradient(120deg, rgba(121,255,225,0.06) 0 2px, transparent 2px 10px); filter: blur(20px); opacity: 0.25; pointer-events: none; }
.typewriter { color: var(--accent-2); white-space: nowrap; }
/* Smooth text rotator */
.typewrap { display: inline-block; min-width: 260px; height: 1em; vertical-align: baseline; position: relative; }
.typewrap .type { display: inline-block; opacity: 1; transition: opacity .35s ease; background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 6px rgba(121,255,225,0.15)); }
.typewrap.leaving .type { opacity: 0; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.feature { background: var(--glass); border: 1px solid var(--border); border-radius: 14px; padding: 14px; }
.f-icon { font-size: 18px; }
.how { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin: 24px 0; }
.how-step { background: rgba(16,19,24,0.6); border: 1px solid var(--border); border-radius: 12px; padding: 12px; color: var(--muted); }
.how-step .num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 999px; background: var(--accent); color: #0b0c0f; font-weight: 800; margin-right: 8px; }
.testimonial { text-align: center; color: var(--muted); margin-bottom: 10px; }
.testimonial blockquote { margin: 0; font-size: 16px; color: var(--text); }
.testimonial .t-author { font-size: 12px; opacity: 0.8; margin-top: 6px; }

/* Reveal animations (triggered on scroll) */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; }
.reveal.show { opacity: 1; transform: none; }

.searchbar { display: grid; grid-template-columns: 28px 1fr 48px auto auto; gap: 16px; align-items: center; }
.searchbar .prefix { width: 24px; text-align: center; color: var(--muted); }
.searchbar input { flex: 1; padding: 16px 20px; border-radius: 14px; border: 1px solid var(--border); background: rgba(12,14,20,0.6); color: var(--text); box-shadow: inset 0 1px 0 rgba(255,255,255,0.03); outline: none; }
.searchbar input:focus { box-shadow: 0 0 0 2px rgba(10,132,255,0.35); border-color: rgba(10,132,255,0.45); }
.searchbar .kbd { font-size: 12px; color: var(--muted); border: 1px solid var(--border); padding: 8px 10px; border-radius: 8px; text-align: center; background: rgba(16,19,24,0.6); }
.searchbar button { padding: 12px 16px; border-radius: 12px; background: var(--accent); color: #0b0c0f; font-weight: 800; border: none; cursor: pointer; box-shadow: var(--shadow); }
.searchbar button:hover { filter: brightness(1.05); }
/* Neon underline on focus */
.searchbar { position: relative; }
.searchbar::after { content: ""; position: absolute; left: 28px; right: 180px; bottom: -6px; height: 2px; border-radius: 999px; background: linear-gradient(90deg, var(--neon-a), var(--neon-b)); opacity: 0; transform: scaleX(0.6); transition: opacity 160ms ease, transform 220ms cubic-bezier(.2,.8,.2,1.1); }
.searchbar.focus::after { opacity: 0.9; height: 3px; transform: scaleX(1); }

/* Suggestions chips */
.suggestions { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; white-space: nowrap; padding-bottom: 2px; }
.suggestions::-webkit-scrollbar { height: 6px; }
.suggestions::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 999px; }
.chip { background: rgba(16,19,24,0.6); border: 1px solid var(--border); color: var(--muted); padding: 6px 10px; border-radius: 999px; font-size: 12px; cursor: pointer; }
.chip:hover { color: var(--text); border-color: rgba(255,255,255,0.14); }

/* Stats row */
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 16px 0 24px; }
.stat { background: var(--glass); border: 1px solid var(--border); border-radius: 12px; padding: 18px; box-shadow: var(--shadow); }
.stat-num { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; }

.search-modes { margin-top: 10px; display: inline-flex; gap: 14px; color: var(--muted); font-size: 12px; }
.search-modes input { accent-color: var(--accent); }

/* Inline preferences under search */
.prefs-inline { margin-top: 12px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.prefs-inline .hint { color: var(--muted); font-size: 12px; }

/* Tabs and header row */
.card-header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tabs { display: inline-flex; gap: 6px; background: rgba(16,19,24,0.5); border: 1px solid var(--border); padding: 4px; border-radius: 10px; }
.tab { background: transparent; color: var(--muted); border: 0; padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.tab.active { background: #0f131a; color: var(--text); border: 1px solid rgba(255,255,255,0.06); }
.result-actions { display: inline-flex; gap: 8px; align-items: center; }

/* Preferences */
.pref-row { padding: 12px 0; }
.switch { display: flex; align-items: center; gap: 10px; }
.switch input[type="checkbox"] { width: 18px; height: 18px; }
.switch .label { font-weight: 600; }
.pref-row .hint { color: var(--muted); font-size: 12px; margin-top: 6px; }

/* Empty state */
.empty { text-align: center; color: var(--muted); padding: 24px; }
.empty-illustration { opacity: 0.7; margin-bottom: 8px; }
.empty-title { font-weight: 700; color: var(--text); margin-bottom: 6px; }
.empty-sub { font-size: 13px; }
.empty-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.empty-actions .tip { background: rgba(16,19,24,0.6); }

/* Primary CTA for empty state */
.primary-cta { display: inline-block; padding: 12px 16px; border-radius: 12px; background: var(--accent); color: #ffffff; font-weight: 800; text-decoration: none; box-shadow: var(--shadow); }
.primary-cta:hover { filter: brightness(1.05); }

/* Top progress bar */
.top-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, var(--neon-a), var(--neon-b)); box-shadow: 0 0 12px rgba(121,255,225,0.4); z-index: 1000; transition: width 200ms ease; }

.list { display: flex; flex-direction: column; gap: 12px; max-height: 520px; overflow: auto; padding-right: 4px; }
.item { border: 1px solid var(--border); border-radius: 14px; padding: 14px; background: linear-gradient(180deg, rgba(17,20,28,0.9), rgba(15,17,23,0.9)); transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease; }
.item:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.08); box-shadow: var(--shadow); }
.item h3 { margin: 0 0 8px 0; font-size: 15px; }
.meta { font-size: 12px; color: var(--muted); margin-bottom: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.1px; }
.summary { 
  color: var(--muted); 
  font-size: 14px; 
  /* --- Clean CSS Truncation --- */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3; /* Limit to 3 lines */
  overflow: hidden;
  text-overflow: ellipsis;
  transition: -webkit-line-clamp 0.2s ease-in-out;
}
.item.expanded .summary {
  -webkit-line-clamp: 50; /* Show up to 50 lines when expanded */
}
.link { display: inline-block; margin-top: 8px; color: var(--accent-2); text-decoration: none; }
.link:hover { text-decoration: underline; }

.skeleton .item { position: relative; overflow: hidden; background: #0f1117; }
.skeleton .item::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent); animation: shimmer 1.2s infinite; }
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

.toast { position: fixed; bottom: 18px; right: 18px; background: #101318; color: var(--text); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.35); }

.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); }
.modal-content { position: relative; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 20px; max-width: 400px; width: 90%; box-shadow: var(--shadow); }
.modal-content h3 { margin: 0 0 12px 0; font-size: 18px; font-weight: 800; }
.modal-content p { margin: 0 0 20px 0; color: var(--muted); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.btn-secondary { background: var(--glass); border: 1px solid var(--border); color: var(--text); padding: 8px 16px; border-radius: 8px; cursor: pointer; }
.btn-danger { background: #dc2626; border: 1px solid #dc2626; color: #fff; padding: 8px 16px; border-radius: 8px; cursor: pointer; }
.btn-danger:hover { background: #b91c1c; }

.muted { color: var(--muted); }
.hidden { display: none; }

.item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.favicon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.domain {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(18,20,26,0.95), rgba(14,17,23,0.95));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), inset 0 -1px 0 rgba(0,0,0,0.35);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.delete-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 4px;
  transition: color 160ms ease, background 160ms ease;
}

.delete-btn:hover {
  color: #ff4bd1;
  background: rgba(255, 75, 209, 0.1);
}

/* Headings with precise weight and no gradient */
h2 { font-weight: 800; letter-spacing: 0.2px; color: var(--text); opacity: 0.92; }

@media (max-width: 1100px) {
  .grid { grid-template-columns: 1fr; }
  .hero-inner { grid-template-columns: 1fr; }
  .features, .how { grid-template-columns: 1fr; }
  .container { padding: 0 20px; }
  .app-header { padding: 14px 20px; }
  .card { padding: 20px; margin-bottom: 20px; }
  .stats-row { gap: 16px; margin: 12px 0 20px; }
  .stat { padding: 16px; }
}

@media (max-width: 600px) {
  .container { padding: 0 16px; margin: 48px auto; }
  .app-header { padding: 12px 16px; }
  .card { padding: 16px; margin-bottom: 16px; }
  .hero-copy h1 { font-size: 32px; }
  .stats-row { grid-template-columns: 1fr; gap: 12px; }
  .searchbar { gap: 12px; }
}

/* Footer */
.app-footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 18px 0; background: rgba(11,12,15,0.4); backdrop-filter: blur(8px); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; }
.foot-left { display: flex; gap: 8px; align-items: center; color: var(--muted); font-weight: 700; }
.foot-right { color: var(--muted); font-size: 12px; }

/* Load more */
.load-more { display: flex; justify-content: center; margin-top: 10px; }
.load-more .ghost { padding: 10px 14px; }

/* Retry button in empty state */
#retrySearchBtn.hidden { display: none; }

/* (removed) footer preferences bar styles */

/* Popover */
.popover { position: fixed; top: 56px; right: 32px; z-index: 1001; }
.popover.hidden { display: none; }
.popover .popover-content { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); min-width: 260px; }
.popover h3 { margin: 0 0 10px 0; font-size: 16px; }

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .skeleton .item::after { display: none; }
}


