:root {
  --accent: #2B5CFF;
  --accent-pressed: #1F45DB;
  --accent-soft: #E8EEFF;
  --hero: #0C1633;
  --ink: #0F1115;
  --ink-soft: #5B6170;
  --line: #E4E7EC;
  --canvas: #F5F6F8;
  --card: #FFFFFF;
  --coral: #E5484D;
  --amber: #D97706;
  --leaf: #16A34A;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(15, 17, 21, .05), 0 8px 24px rgba(15, 17, 21, .06);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-pressed); }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }
h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 20px; font-weight: 750; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0; line-height: 1.45; }
.muted { color: var(--ink-soft); font-size: 14px; }
.small { font-size: 13px; }

.page { max-width: 760px; margin: 0 auto; padding: calc(18px + env(safe-area-inset-top)) 16px 24px; display: grid; gap: 14px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wordmark { font-weight: 900; font-size: 24px; letter-spacing: -.04em; }
.wordmark span { color: var(--accent-pressed); }
.mark { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #3D6EFF, #1F45DB); display: inline-grid; place-items: center; color: #fff; font-weight: 900; }
.brand { display: flex; align-items: center; gap: 10px; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: grid; gap: 12px; }
.hero { background: var(--hero); color: #fff; }
.hero .muted { color: rgba(255, 255, 255, .72); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 10px; }
.stat { background: rgba(255, 255, 255, .08); border-radius: 14px; padding: 12px; }
.stat b { display: block; font-size: 26px; font-weight: 800; }

.btn { border: 0; border-radius: 14px; padding: 12px 16px; font-weight: 700; cursor: pointer; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; min-height: 44px; }
.btn:hover { background: var(--accent-pressed); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: var(--accent-soft); color: var(--accent-pressed); }
.btn.plain { background: transparent; color: var(--ink-soft); }
.btn.danger { background: #FDECEC; color: var(--coral); }
.btn.white { background: #fff; color: var(--accent-pressed); }
.btn.wide { width: 100%; }

label.field { display: grid; gap: 6px; font-size: 13px; font-weight: 650; color: var(--ink-soft); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url], input[type=number], input[type=month], input[type=date], select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; background: #fff; color: var(--ink); font-weight: 500; font-size: 16px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 12px; font-size: 14px; font-weight: 600; cursor: pointer; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tag { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); color: var(--accent-pressed); border-radius: 999px; padding: 6px 10px; font-size: 14px; font-weight: 600; }
.tag button { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0; font-weight: 800; }
.pill { display: inline-block; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; background: var(--accent-soft); color: var(--accent-pressed); }
.pill.amber { background: #FEF3E2; color: var(--amber); }
.pill.coral { background: #FDECEC; color: var(--coral); }
.pill.leaf { background: #E7F7EC; color: var(--leaf); }
.pill.grey { background: #EEF0F3; color: var(--ink-soft); }

.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; cursor: pointer; }
.toggle input { appearance: none; width: 46px; height: 28px; border-radius: 999px; background: #D5D9E0; position: relative; cursor: pointer; flex: none; transition: background .15s; }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.toggle input:checked { background: var(--accent); }
.toggle input:checked::after { transform: translateX(18px); }

/* Swipe deck */
.deck { position: relative; min-height: 520px; }
.jobcard { position: absolute; inset: 0; background: var(--card); border-radius: 26px; box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; touch-action: pan-y; user-select: none; transition: transform .25s ease, opacity .25s ease; }
.jobcard.behind { transform: scale(.96) translateY(10px); opacity: .6; pointer-events: none; }
.jobcard header { padding: 18px; color: #fff; background: linear-gradient(135deg, #3D6EFF, #1F45DB); display: flex; gap: 12px; align-items: center; }
.logo { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; color: #fff; font-weight: 800; font-size: 19px; background: #334155; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
.logo[data-tone="0"] { background: #1F45DB; } .logo[data-tone="1"] { background: #0E7490; } .logo[data-tone="2"] { background: #6D28D9; }
.logo[data-tone="3"] { background: #B45309; } .logo[data-tone="4"] { background: #047857; } .logo[data-tone="5"] { background: #BE185D; }
.logo[data-tone="6"] { background: #334155; } .logo[data-tone="7"] { background: #4338CA; }
.jobcard header .logo { box-shadow: 0 0 0 2px rgba(255, 255, 255, .9); }
.score { margin-left: auto; background: #fff; color: var(--accent-pressed); border-radius: 14px; padding: 6px 10px; text-align: center; font-weight: 800; font-size: 20px; line-height: 1; }
.score small { display: block; font-size: 10px; color: var(--ink-soft); font-weight: 700; margin-top: 2px; }
.jobbody { padding: 18px; display: grid; gap: 12px; overflow-y: auto; flex: 1; align-content: start; }
.reasons { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.desc { white-space: pre-wrap; font-size: 14px; line-height: 1.5; color: var(--ink-soft); max-height: 260px; overflow: auto; border-top: 1px solid var(--line); padding-top: 10px; }
.stamp { position: absolute; top: 90px; padding: 6px 14px; border: 3px solid; border-radius: 10px; font-weight: 900; font-size: 22px; opacity: 0; transform: rotate(-12deg); }
.stamp.yes { left: 22px; color: var(--leaf); }
.stamp.no { right: 22px; color: var(--coral); transform: rotate(12deg); }
.actions { display: flex; justify-content: center; gap: 18px; }
.round { width: 64px; height: 64px; border-radius: 50%; border: 0; font-size: 26px; cursor: pointer; box-shadow: var(--shadow); background: #fff; }
.round.yes { background: var(--accent); color: #fff; width: 76px; height: 76px; font-size: 30px; }

/* Lists */
.list { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.item { display: flex; gap: 12px; align-items: center; background: var(--card); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); cursor: pointer; border: 0; text-align: left; width: 100%; }
.item .grow { flex: 1; min-width: 0; }
.item .title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline { display: grid; gap: 10px; border-left: 2px solid var(--line); padding-left: 14px; }
.resume { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 10px; background: #FCFCFD; }
.resume ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.letter { white-space: pre-wrap; font-size: 14px; line-height: 1.5; }

/* Tabs */
nav.tabs { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom)); background: rgba(15, 17, 21, .92); backdrop-filter: blur(12px); border-radius: 22px; padding: 6px; display: flex; gap: 4px; box-shadow: 0 10px 30px rgba(15, 17, 21, .25); z-index: 10; }
nav.tabs button { border: 0; background: transparent; color: rgba(255, 255, 255, .7); padding: 9px 16px; border-radius: 16px; font-weight: 700; font-size: 14px; cursor: pointer; display: grid; justify-items: center; gap: 2px; min-width: 72px; }
nav.tabs button.on { background: var(--accent); color: #fff; }
nav.tabs .ico { font-size: 18px; line-height: 1; }

/* Sheet */
.backdrop { position: fixed; inset: 0; background: rgba(15, 17, 21, .45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--canvas); width: 100%; max-width: 760px; max-height: 92vh; overflow-y: auto; border-radius: 26px 26px 0 0; padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); display: grid; gap: 14px; }
@media (min-width: 800px) { .backdrop { align-items: center; } .sheet { border-radius: 26px; } }

#toast { position: fixed; left: 50%; transform: translateX(-50%); top: calc(14px + env(safe-area-inset-top)); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 30; max-width: 90vw; }
#toast.show { opacity: 1; }
.empty { text-align: center; padding: 40px 16px; display: grid; gap: 10px; justify-items: center; }
.spin { width: 18px; height: 18px; border: 3px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.auth { max-width: 420px; margin: 8vh auto 0; }

/* How it works */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; }
.step-no { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-pressed); display: grid; place-items: center; font-weight: 800; font-size: 14px; flex: none; }
details > summary { cursor: pointer; font-weight: 700; }
details.how[open] > summary, details.self-id[open] > summary { margin-bottom: 12px; }
.self-id { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }

/* First-time setup */
.progress { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.progress span { height: 6px; border-radius: 999px; background: var(--line); }
.progress span.on { background: var(--accent); }
.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 600; cursor: pointer; }
.check input { width: 22px; height: 22px; margin-top: 1px; flex: none; accent-color: var(--accent); }

/* Profile, LinkedIn-style */
.li { padding: 0; gap: 0; overflow: hidden; }
.li .cover { height: 92px; background: linear-gradient(120deg, #3D6EFF 0%, #1F45DB 55%, #0C1633 100%); }
.li-body { padding: 0 16px 16px; display: grid; gap: 6px; justify-items: start; }
.li-body > * { justify-self: stretch; }
.li-body > .li-photo { justify-self: start; }
.li-photo { width: 112px; height: 112px; border-radius: 50%; border: 4px solid #fff; margin-top: -56px; background: var(--accent-soft); display: grid; place-items: center; overflow: hidden; box-shadow: var(--shadow); flex: none; }
.li-photo.small { width: 72px; height: 72px; margin-top: 0; border-width: 2px; }
.li-photo img { width: 100%; height: 100%; object-fit: cover; }
.li-initials { font-size: 38px; font-weight: 800; color: var(--accent-pressed); }
.li-photo.small .li-initials { font-size: 24px; }
.li h1 { margin-top: 6px; font-size: 24px; }
.li-headline { font-size: 16px; }
.open-to { background: #E7F7EC; color: #14532D; border-radius: 12px; padding: 8px 12px; display: grid; gap: 2px; font-size: 14px; }
.li-links a { font-weight: 700; text-decoration: none; font-size: 14px; }
.strength { display: grid; gap: 6px; padding-top: 6px; }
.strength progress { width: 100%; height: 8px; appearance: none; border: 0; border-radius: 999px; background: #EEF0F3; overflow: hidden; }
.strength progress::-webkit-progress-bar { background: #EEF0F3; border-radius: 999px; }
.strength progress::-webkit-progress-value { background: var(--leaf); border-radius: 999px; }
.strength progress::-moz-progress-bar { background: var(--leaf); }
.li-list { display: grid; }
.li-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.li-item:first-child { border-top: 0; padding-top: 0; }
.li-item .grow { flex: 1; min-width: 0; display: grid; gap: 2px; }
.li-bullets { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; color: var(--ink-soft); }
.plain-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.about { white-space: pre-wrap; }
.home-link { text-decoration: none; color: inherit; }
.center { text-align: center; }
.public { padding-bottom: 32px; }
body:has(.public) { padding-bottom: 0; }

/* Share sheet */
.qr-box { display: grid; place-items: center; background: #fff; border-radius: 18px; padding: 14px; }
.qr { width: 240px; height: 240px; image-rendering: pixelated; }
.share-url { font-weight: 700; word-break: break-all; text-align: center; }

@media print {
  nav.tabs, .no-print, #toast { display: none !important; }
  body { background: #fff; padding: 0; }
  .card { box-shadow: none; border: 1px solid var(--line); break-inside: avoid; }
  .li .cover, .open-to { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

/* It's a match */
.match-backdrop { align-items: center; background: rgba(12, 22, 51, .7); }
.match-backdrop .sheet { background: linear-gradient(160deg, #3D6EFF, #1F45DB 55%, #0C1633); color: #fff; border-radius: 28px; max-width: 440px; margin: 16px; overflow: hidden; }
.match { position: relative; display: grid; gap: 14px; justify-items: center; text-align: center; padding: 18px 6px 6px; }
.match .muted { color: rgba(255, 255, 255, .75); }
.match-kicker { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 800; color: #86A5FF; }
.match-title { font-size: 44px; font-weight: 900; letter-spacing: -.04em; transform: rotate(-4deg); animation: pop .6s cubic-bezier(.2, 1.6, .4, 1) both; }
.match-line { font-size: 18px; font-weight: 700; max-width: 320px; }
.match .row { justify-content: center; }
.match > :not(.hearts) { position: relative; z-index: 1; }
.match-pair { display: flex; align-items: center; gap: 4px; margin: 6px 0; }
.bubble { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; font-weight: 900; border: 4px solid #fff; }
.bubble.me { background: #fff; color: var(--accent-pressed); animation: slide-in-left .7s ease-out both; }
.bubble.them { background: #FFD6E0; color: #C2185B; animation: slide-in-right .7s ease-out both; }
.bubble.spark { width: 46px; height: 46px; font-size: 22px; background: #E5484D; color: #fff; border-width: 3px; z-index: 1; margin: 0 -14px; animation: pop .5s .55s cubic-bezier(.2, 1.6, .4, 1) both; }
.btn.plain.light { color: rgba(255, 255, 255, .85); }
.hearts { position: absolute; inset: -20px 0 auto; height: 100%; pointer-events: none; overflow: hidden; }
.heart { position: absolute; bottom: -20px; font-size: 18px; color: #FFB3C6; opacity: 0; animation: float-up 3.2s ease-in infinite; }
.heart.h0 { left: 6%; animation-delay: 0s; } .heart.h1 { left: 22%; animation-delay: .5s; font-size: 14px; }
.heart.h2 { left: 40%; animation-delay: 1.1s; } .heart.h3 { left: 58%; animation-delay: .3s; font-size: 22px; }
.heart.h4 { left: 76%; animation-delay: .9s; } .heart.h5 { left: 90%; animation-delay: 1.5s; font-size: 13px; }
.heart:nth-child(n+7) { animation-duration: 4s; } .heart:nth-child(n+13) { animation-duration: 2.6s; color: #fff; }
@keyframes pop { from { transform: scale(.3) rotate(-4deg); opacity: 0; } to { transform: scale(1) rotate(-4deg); opacity: 1; } }
@keyframes slide-in-left { from { transform: translateX(-120px) rotate(-20deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slide-in-right { from { transform: translateX(120px) rotate(20deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes float-up { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: .9; } 100% { transform: translateY(-460px) rotate(25deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
