* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #14161a;
  color: #f2f2f4;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

button {
  font-family: inherit;
}

/* ---- Login ---- */
.login-wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 340px;
  background: #1e2127;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.login-card h1 {
  font-size: 20px;
  margin: 0 0 20px;
}

.login-card input {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: 10px;
  border: 1px solid #34384280;
  background: #14161a;
  color: #f2f2f4;
  font-size: 15px;
}

.login-card button {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: #4f7cff;
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.login-error {
  color: #ff6b6b;
  font-size: 13px;
  min-height: 18px;
  margin-bottom: 8px;
}

/* ---- App shell ---- */
#app {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  flex: 0 0 auto;
}

.topbar h1 {
  font-size: 18px;
  margin: 0;
  letter-spacing: 0.5px;
}

.icon-btn {
  background: #1e2127;
  border: none;
  color: #f2f2f4;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
}

.deck-wrap {
  flex: 1 1 auto;
  position: relative;
  padding: 8px 18px;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.deck {
  position: relative;
  width: 100%;
  max-width: 420px;
}

.empty-state {
  margin: auto;
  text-align: center;
  color: #8a8f99;
  padding: 40px 20px;
}

.card {
  position: absolute;
  inset: 0;
  background: #1e2127;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 28px rgba(0,0,0,0.45);
  touch-action: none;
  user-select: none;
  will-change: transform;
}

.card-photo {
  height: 45%;
  background-size: cover;
  background-position: center;
  background-color: #2a2e36;
  position: relative;
  flex: 0 0 auto;
}

.card-photo.no-photo::after {
  content: attr(data-initials);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  font-weight: 700;
  color: #4f7cff;
}

.badge {
  position: absolute;
  top: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
}

.badge.fit-HIGH { left: 12px; background: rgba(72, 199, 116, 0.85); color: #06210f; }
.badge.fit-MED  { left: 12px; background: rgba(255, 196, 61, 0.85); color: #3a2a00; }
.badge.fit-THIN,
.badge.fit-REVIEW,
.badge.fit-SKIP { left: 12px; background: rgba(150,150,160,0.85); color: #16181c; }

.badge.icp { right: 12px; background: rgba(79, 124, 255, 0.85); color: #fff; }

.stamp {
  position: absolute;
  top: 20px;
  border: 4px solid;
  border-radius: 10px;
  padding: 4px 12px;
  font-size: 22px;
  font-weight: 800;
  text-transform: uppercase;
  opacity: 0;
  transform: rotate(-18deg);
}

.stamp.call      { left: 50%; transform: translateX(-50%) rotate(0deg); border-color: #48c774; color: #48c774; top: 14px; }
.stamp.linkedin  { left: 50%; bottom: 14px; top: auto; transform: translateX(-50%); border-color: #4f7cff; color: #4f7cff; }
.stamp.email     { right: 18px; border-color: #ffc43d; color: #ffc43d; }
.stamp.disqualify{ left: 18px; border-color: #ff6b6b; color: #ff6b6b; }

.card-body {
  flex: 1 1 auto;
  padding: 16px 18px;
  overflow-y: auto;
}

.card-body h2 {
  margin: 0 0 2px;
  font-size: 20px;
}

.card-body .headline {
  color: #b7bcc8;
  font-size: 13px;
  margin: 0 0 10px;
}

.card-body .position {
  font-size: 14px;
  margin: 0 0 4px;
}

.card-body .meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.chip {
  background: #2a2e36;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: #cfd3db;
}

.chip.muted { opacity: 0.45; }

.signal {
  margin-top: 10px;
  padding: 8px 10px;
  background: #262a33;
  border-left: 3px solid #4f7cff;
  border-radius: 6px;
  font-size: 12px;
  color: #cfd3db;
}

.controls {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 16px 18px 26px;
}

.ctrl-btn {
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  font-size: 22px;
  cursor: pointer;
  background: #1e2127;
  color: #f2f2f4;
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}

.ctrl-btn.big { width: 64px; height: 64px; font-size: 26px; }
.ctrl-btn.disqualify { color: #ff6b6b; }
.ctrl-btn.linkedin { color: #4f7cff; }
.ctrl-btn.email { color: #ffc43d; }
.ctrl-btn.call { color: #48c774; }

/* ---- Filter sheet ---- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  z-index: 200;
}

.sheet-backdrop.open { display: block; }

.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  max-height: 80vh;
  background: #1e2127;
  border-radius: 20px 20px 0 0;
  padding: 18px 18px 24px;
  transform: translateY(100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
  z-index: 201;
}

.sheet.open { transform: translateY(0); }

.sheet h2 {
  margin: 0 0 16px;
  font-size: 17px;
}

.filter-group {
  margin-bottom: 18px;
}

.filter-group label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #8a8f99;
  margin-bottom: 8px;
}

.chip-select {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 160px;
  overflow-y: auto;
}

.chip-option {
  background: #2a2e36;
  border: 1px solid transparent;
  color: #cfd3db;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}

.chip-option.selected {
  background: #4f7cff33;
  border-color: #4f7cff;
  color: #fff;
}

.filter-group input[type=text] {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #34384280;
  background: #14161a;
  color: #f2f2f4;
  margin-bottom: 8px;
  font-size: 13px;
}

.filter-empty {
  font-size: 12px;
  color: #5b606b;
  font-style: italic;
}

.sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.sheet-actions button {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.sheet-actions .apply { background: #4f7cff; color: white; }
.sheet-actions .clear { background: #2a2e36; color: #cfd3db; }
