:root {
  --bg: #0b0e14;
  --bg-elevated: #121722;
  --surface: #171d2b;
  --surface-hover: #1e2638;
  --surface-soft: rgba(255, 255, 255, 0.045);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f3f5f9;
  --text-muted: #9aa4b8;
  --text-dim: #687389;

  --like: #10b981;
  --like-bg: rgba(16, 185, 129, 0.14);
  --nope: #f43f5e;
  --nope-bg: rgba(244, 63, 94, 0.14);
  --super: #f59e0b;
  --super-bg: rgba(245, 158, 11, 0.14);
  --accent: #3b82f6;
  --accent-bg: rgba(59, 130, 246, 0.15);
  --remote: #a855f7;
  --remote-bg: rgba(168, 85, 247, 0.15);

  --shadow-card: 0 22px 50px -12px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.07);
  --radius-xl: 22px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

:root[data-theme="light"] {
  --bg: #f3f5f9;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-hover: #f8fafc;
  --surface-soft: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  --like: #059669;
  --like-bg: rgba(5, 150, 105, 0.11);
  --nope: #e11d48;
  --nope-bg: rgba(225, 29, 72, 0.1);
  --super: #d97706;
  --super-bg: rgba(217, 119, 6, 0.12);
  --accent: #2563eb;
  --accent-bg: rgba(37, 99, 235, 0.1);
  --remote: #7e22ce;
  --remote-bg: rgba(126, 34, 206, 0.1);

  --shadow-card: 0 20px 44px -14px rgba(15, 23, 42, 0.14), 0 0 0 1px rgba(15, 23, 42, 0.06);
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* App Shell */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #10b981 0%, #2563eb 100%);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.28);
  flex-shrink: 0;
}

.brand-text h1 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.brand-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  display: block;
}

/* View Switcher Tabs */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 3px;
}

.nav-tab {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  padding: 7px 12px;
  min-height: 38px;
  border-radius: 9px;
  font-size: 0.84rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 160ms ease, color 160ms ease;
}

.nav-tab:hover {
  color: var(--text);
}

.nav-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.tab-count {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

.nav-tab.active .tab-count.like-pill {
  background: var(--like-bg);
  color: var(--like);
  border-color: transparent;
}

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

.icon-btn {
  min-width: 40px;
  min-height: 40px;
  padding: 0 11px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.icon-btn.spinning svg {
  animation: spin 0.9s linear infinite;
}

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

/* Filter Strip */
.filter-bar {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.filter-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 9px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  padding: 6px 11px;
  min-height: 34px;
  border-radius: 999px;
  font-size: 0.79rem;
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 150ms ease;
}

.chip:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.chip.active {
  background: var(--accent-bg);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

.chip-num {
  font-family: var(--font-mono);
  font-size: 0.71rem;
  opacity: 0.85;
}

.search-sort-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrap svg {
  position: absolute;
  left: 10px;
  width: 15px;
  height: 15px;
  color: var(--text-dim);
  pointer-events: none;
}

.search-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 6px 10px 6px 31px;
  min-height: 34px;
  font-size: 0.82rem;
  width: 185px;
  color: var(--text);
}

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

.sort-select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 6px 10px;
  min-height: 34px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Main Workspace */
.workspace {
  flex: 1;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

/* Swipe Deck Stage */
.deck-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
  justify-items: center;
}

@media (min-width: 1024px) {
  .deck-layout {
    grid-template-columns: minmax(0, 560px) 320px;
    justify-content: center;
    align-items: start;
    padding-top: 6px;
  }
}

.deck-column {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.progress-strip {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0 4px;
}

.progress-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.card-stack {
  position: relative;
  width: 100%;
  min-height: 510px;
  perspective: 1200px;
  user-select: none;
}

.swipe-card {
  position: relative;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transform-origin: 50% 85%;
  will-change: transform, opacity;
  touch-action: pan-y;
  z-index: 2;
}

.swipe-card.next-preview {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  transform: scale(0.955) translateY(14px);
  opacity: 0.55;
  filter: saturate(0.8);
  overflow: hidden;
  max-height: 510px;
}

.swipe-card.animating {
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease-out;
}

/* Swipe Decision Stamps */
.stamp {
  position: absolute;
  top: 22px;
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
  opacity: 0;
  z-index: 10;
  border: 3px solid currentColor;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
}

.stamp-like {
  left: 20px;
  color: var(--like);
  transform: rotate(-11deg);
}

.stamp-nope {
  right: 20px;
  color: var(--nope);
  transform: rotate(11deg);
}

.stamp-super {
  left: 50%;
  top: 18px;
  color: var(--super);
  transform: translateX(-50%);
}

/* Card Header Badges */
.card-badges {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.badge-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.badge-track-film_foto { background: rgba(244, 63, 94, 0.15); color: #fb7185; }
.badge-track-web_marketing { background: rgba(59, 130, 246, 0.16); color: #60a5fa; }
.badge-track-unsexy_ki { background: rgba(16, 185, 129, 0.16); color: #34d399; }
.badge-track-handel_druck { background: rgba(245, 158, 11, 0.16); color: #fbbf24; }
.badge-track-it_software { background: rgba(99, 102, 241, 0.16); color: #818cf8; }
.badge-track-gu_event { background: rgba(14, 165, 233, 0.16); color: #38bdf8; }

:root[data-theme="light"] .badge-track-film_foto { color: #be123c; }
:root[data-theme="light"] .badge-track-web_marketing { color: #1d4ed8; }
:root[data-theme="light"] .badge-track-unsexy_ki { color: #047857; }
:root[data-theme="light"] .badge-track-handel_druck { color: #b45309; }
:root[data-theme="light"] .badge-track-it_software { color: #4338ca; }
:root[data-theme="light"] .badge-track-gu_event { color: #0369a1; }

.badge-loc-local { background: var(--like-bg); color: var(--like); }
.badge-loc-regional { background: var(--accent-bg); color: var(--accent); }
.badge-loc-remote { background: var(--remote-bg); color: var(--remote); }

.badge-score {
  font-family: var(--font-mono);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--text);
}

.badge-framework {
  background: var(--super-bg);
  color: var(--super);
}

/* Title & Buyer */
.card-title {
  margin: 0;
  font-size: 1.24rem;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--text);
}

.card-buyer {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 500;
}

.card-buyer svg {
  flex-shrink: 0;
  color: var(--text-dim);
}

/* Pitch Tip Box */
.pitch-box {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.09) 0%, rgba(59, 130, 246, 0.08) 100%);
  border: 1px solid color-mix(in srgb, var(--like) 28%, var(--border));
  border-radius: var(--radius-lg);
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pitch-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--like);
}

.pitch-box p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--text);
}

/* 4-Tile Fact Grid */
.facts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.fact-tile {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fact-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  font-weight: 600;
}

.fact-val {
  font-size: 0.84rem;
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fact-val.urgent {
  color: var(--nope);
}

.fact-val.soon {
  color: var(--super);
}

/* Description & Note */
.desc-box {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 13px;
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.55;
  max-height: 138px;
  overflow-y: auto;
  white-space: pre-line;
}

.desc-box.expanded {
  max-height: 360px;
}

.desc-toggle {
  align-self: flex-start;
  background: none;
  border: 0;
  padding: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
}

.card-footer-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.doc-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  min-height: 38px;
  border-radius: 10px;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: filter 150ms ease;
}

.doc-link-btn:hover {
  filter: brightness(1.12);
}

.secondary-link {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
}

.secondary-link:hover {
  color: var(--text);
  text-decoration: underline;
}

.quick-note-input {
  width: 100%;
  background: var(--surface-soft);
  border: 1px dashed var(--border-strong);
  border-radius: 9px;
  padding: 7px 11px;
  font-size: 0.82rem;
  color: var(--text);
}

/* Tinder Action Dock */
.action-dock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 6px 0 10px;
}

.dock-btn {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.dock-btn:active {
  transform: scale(0.94);
}

.dock-btn.small {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
}

.dock-btn.nope {
  height: 58px;
  padding: 0 22px;
  color: var(--nope);
  border-color: color-mix(in srgb, var(--nope) 40%, var(--border));
}

.dock-btn.nope:hover {
  background: var(--nope-bg);
}

.dock-btn.super {
  height: 52px;
  padding: 0 16px;
  color: var(--super);
  border-color: color-mix(in srgb, var(--super) 40%, var(--border));
}

.dock-btn.super:hover {
  background: var(--super-bg);
}

.dock-btn.like {
  height: 58px;
  padding: 0 24px;
  background: var(--like);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 10px 26px rgba(16, 185, 129, 0.35);
}

.dock-btn.like:hover {
  filter: brightness(1.07);
}

/* Right Side Panel (Desktop Shortcuts & Live Source Radar) */
.side-panel {
  display: none;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

@media (min-width: 1024px) {
  .side-panel {
    display: flex;
  }
}

.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-card h3 {
  margin: 0;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.shortcut-list {
  display: grid;
  gap: 7px;
  font-size: 0.82rem;
}

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
}

kbd {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--surface-soft);
  border: 1px solid var(--border-strong);
  color: var(--text);
}

.source-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
}

.source-item {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
}

.source-item span:last-child {
  font-family: var(--font-mono);
  color: var(--text);
}

/* Shortlist / Rejected Table-Cards View */
.list-view {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.list-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.export-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 12px;
}

.saved-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.saved-card.is-like {
  border-left: 4px solid var(--like);
}

.saved-card.is-super {
  border-left: 4px solid var(--super);
}

.saved-card h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
}

.saved-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.saved-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.mini-btn {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text-muted);
  padding: 6px 10px;
  min-height: 34px;
  border-radius: 8px;
  font-size: 0.77rem;
  font-weight: 600;
}

.mini-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

/* Empty & Loading States */
.empty-state {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 44px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-state h3 {
  margin: 0;
  font-size: 1.15rem;
}

.empty-state p {
  margin: 0;
  color: var(--text-muted);
  max-width: 400px;
  font-size: 0.9rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: var(--bg);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 0.83rem;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 100;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 640px) {
  .topbar-inner { padding: 8px 12px; }
  .brand-sub { display: none; }
  .workspace { padding: 10px 12px; }
  .swipe-card { padding: 16px; }
  .card-title { font-size: 1.1rem; }
  .dock-btn span.btn-label { display: none; }
  .dock-btn.nope, .dock-btn.like, .dock-btn.super { width: 58px; height: 58px; padding: 0; }
  .dock-btn.super { width: 50px; height: 50px; }
}
