:root {
  color-scheme: dark;
  font-family: Manrope, system-ui, sans-serif;
  --bg: #09090a;
  --surface: #171718;
  --raised: #202022;
  --line: #303033;
  --text: #f3f3f4;
  --muted: #9a9a9f;
  --dim: #69696f;
  --light: #e9e9eb;
  --ink: #101011;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-width: 0; min-height: 100%; margin: 0; background: var(--bg); color: var(--text); }
body { overflow-x: hidden; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; transition: transform .16s ease, background-color .2s ease, color .2s ease, border-color .2s ease; }
button:not(:disabled):active, .primary-action:active, .secondary-action:active { transform: scale(.98); }
.icon { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

#app { width: min(100%, 390px); min-height: 100vh; margin: 0 auto; position: relative; background: var(--bg); }
.screen { min-height: 100vh; padding: 26px 16px 92px; overflow-x: hidden; }
.screen.detail-screen { padding-top: 22px; padding-bottom: 24px; }
.screen.is-entering { animation: screen-enter .3s cubic-bezier(.2,.7,.2,1) both; }
.screen.motion-back.is-entering { animation-name: screen-enter-back; }
@keyframes screen-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes screen-enter-back { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

.page-header { height: 61px; display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 14px; }
.heading-block { min-width: 0; }
.eyebrow { margin: 0 0 3px; color: var(--muted); font-size: 10px; line-height: 14px; font-weight: 700; letter-spacing: .18em; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: 32px; line-height: 1.36; letter-spacing: -.035em; }
.header-actions { display: flex; align-items: center; gap: 10px; padding-bottom: 0; }
.icon-button, .count-pill { height: 34px; border: 1px solid var(--line); background: var(--surface); }
.icon-button { width: 34px; padding: 0; display: grid; place-items: center; border-radius: 50%; color: var(--muted); cursor: pointer; }
.count-pill { display: grid; place-items: center; min-width: 64px; border-radius: 17px; padding: 0 10px; color: var(--muted); font-size: 11px; font-weight: 600; }

.segmented { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); height: 42px; gap: 4px; margin-bottom: 14px; padding: 4px; border: 0; border-radius: 21px; background: var(--surface); }
.segmented.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.segmented button { min-width: 0; border: 0; border-radius: 17px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--light); color: var(--ink); animation: segmented-active .2s ease both; }
@keyframes segmented-active { from { opacity: .75; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }

.feed { display: grid; gap: 12px; }
.swipe-row { position: relative; border-radius: 27px; overflow: hidden; background: var(--light); touch-action: pan-y; }
.swipe-content { position: relative; z-index: 2; transition: transform .2s cubic-bezier(.2,.7,.2,1), opacity .18s ease; will-change: transform; }
.swipe-row.swiped .swipe-content { transform: translateX(-78px); }
.swipe-row.is-dragging .swipe-content { transition: none; }
.swipe-row.is-archiving .swipe-content { animation: archive-out .18s ease-in both; pointer-events: none; }
.archive-rail { position: absolute; z-index: 1; inset: 0 0 0 auto; width: 78px; border: 0; background: var(--light); color: var(--ink); display: grid; place-content: center; justify-items: center; gap: 6px; font-size: 10px; font-weight: 700; cursor: pointer; opacity: 0; transform: translateX(10px); transition: opacity .16s ease, transform .2s ease; }
.swipe-row.is-revealing .archive-rail, .swipe-row.swiped .archive-rail { opacity: 1; transform: translateX(0); }
@keyframes archive-out { to { opacity: 0; transform: translateX(-100%); } }

.card { border: 1px solid var(--line); border-radius: 27px; background: var(--surface); }
.vacancy-card { min-height: 238px; padding: 15px; display: grid; gap: 14px; }
.card-header { display: flex; justify-content: space-between; gap: 12px; }
.card-title-wrap { min-width: 0; }
.card-title { margin: 0; border: 0; padding: 0; background: none; color: var(--text); text-align: left; font-size: 16px; line-height: 1.35; font-weight: 700; cursor: pointer; }
.card-company { margin: 3px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.4; font-weight: 600; }
.date-source { flex: 0 0 58px; text-align: right; font-size: 11px; line-height: 1.45; }
.date-source span { display: block; }
.date-source span + span { color: var(--muted); font-weight: 500; }
.location-salary { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; line-height: 1.35; font-weight: 600; }
.location-salary span:last-child { text-align: right; font-weight: 700; }
.match-pill { min-height: 34px; border: 1px solid var(--line); border-radius: 17px; padding: 0 11px; display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--raised); font-size: 12px; font-weight: 700; }
.match-pill.strong { border-color: transparent; background: var(--light); color: var(--ink); }
.match-score { font-weight: 800; }
.reason { margin: 0; color: var(--text); font-size: 12px; line-height: 1.38; }
.field-label { display: block; margin-bottom: 2px; color: var(--muted); font-size: 11px; font-weight: 700; }
.description-toggle, .row-action { width: 100%; min-height: 40px; border: 1px solid var(--line); border-radius: 18px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #111112; color: var(--text); font-size: 12px; font-weight: 700; cursor: pointer; }
.inline-description-wrap { display: grid; grid-template-rows: 0fr; margin: -4px 0 0; opacity: 0; transition: grid-template-rows .24s ease, opacity .18s ease; }
.inline-description-wrap.is-expanded { grid-template-rows: 1fr; opacity: 1; }
.inline-description { min-height: 0; margin: 0; overflow: hidden; padding: 0 12px; border-radius: 18px; background: #111112; color: var(--muted); font-size: 12px; line-height: 1.55; white-space: pre-line; transition: padding .24s ease; }
.inline-description-wrap.is-expanded .inline-description { padding: 12px; }
.description-toggle .icon { transform: rotate(-90deg); transition: transform .2s ease; }
.description-toggle[aria-expanded="true"] .icon { transform: rotate(0); }

.applications-list { display: grid; gap: 10px; }
.application-card { padding: 14px; display: grid; gap: 11px; }
.status-chip { flex: 0 0 auto; max-width: 120px; border: 1px solid var(--line); border-radius: 14px; padding: 6px 9px; background: var(--raised); font-size: 9px; line-height: 1.2; font-weight: 700; text-align: center; }
.status-chip.sent, .status-chip.reply { background: var(--light); color: var(--ink); border-color: transparent; }
.application-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 10px; line-height: 1.4; }

.bottom-nav { position: fixed; z-index: 30; bottom: calc(14px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: min(calc(100% - 32px), 358px); height: 64px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 6px; border: 1px solid var(--line); border-radius: 32px; background: #19191bef; backdrop-filter: blur(16px); }
.bottom-nav button { min-width: 0; border: 0; border-radius: 26px; background: transparent; color: var(--muted); display: grid; place-content: center; justify-items: center; gap: 2px; font-size: 10px; font-weight: 600; cursor: pointer; }
.bottom-nav button[aria-current="page"] { background: var(--light); color: var(--ink); font-weight: 700; animation: nav-active .2s ease both; }
@keyframes nav-active { from { opacity: .75; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }
.bottom-nav .icon { width: 19px; height: 19px; }

.state { min-height: 92px; padding: 16px; border: 1px solid var(--line); border-radius: 26px; background: var(--surface); display: flex; align-items: center; gap: 12px; }
.state.centered { min-height: 480px; border: 0; background: transparent; flex-direction: column; justify-content: center; text-align: center; }
.state-icon { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 14px; background: var(--raised); color: var(--text); }
.state-copy { min-width: 0; flex: 1; }
.state h2 { margin: 0; font-size: 15px; line-height: 1.35; }
.state p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.retry { min-height: 38px; border: 0; border-radius: 19px; padding: 0 16px; background: var(--light); color: var(--ink); font-size: 12px; font-weight: 700; cursor: pointer; }
.spinner { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.back { min-height: 44px; margin: 0 0 14px; border: 0; border-radius: 22px; padding: 0 13px 0 9px; display: inline-flex; align-items: center; gap: 5px; background: var(--surface); color: var(--text); font-size: 11px; font-weight: 700; cursor: pointer; }
.detail-title { margin: 0 0 14px; font-size: 27px; line-height: 1.28; }
.detail-stack { display: grid; gap: 14px; }
.detail-card { padding: 16px; border-radius: 27px; }
.detail-card h2 { margin: 0 0 13px; font-size: 14px; line-height: 1.35; }
.detail-card p { margin: 0; font-size: 12px; line-height: 1.55; white-space: pre-line; }
.detail-card p + p { margin-top: 10px; }
.summary-title { margin: 0; font-size: 20px; line-height: 1.25; }
.summary-company { margin: 5px 0 14px; color: var(--muted); font-size: 12px; }
.summary-grid { display: grid; gap: 8px; }
.summary-line { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; }
.summary-line span:first-child { color: var(--muted); }
.summary-line span:last-child { text-align: right; }
.detail-match { display: grid; gap: 12px; }
.detail-match .match-pill { margin-bottom: 2px; }
.contact-lines { display: grid; gap: 8px; }
.contact-lines span, .contact-lines a { color: var(--text); font-size: 12px; text-decoration: none; }
.primary-action, .secondary-action { width: 100%; min-height: 52px; border-radius: 26px; display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 12px; font-weight: 700; cursor: pointer; text-decoration: none; }
.primary-action { border: 0; background: var(--light); color: var(--ink); }
.secondary-action { border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.danger-action { border-color: #3b3030; }

.candidate-card { min-height: 154px; padding: 16px; display: grid; gap: 12px; }
.candidate-row { display: flex; align-items: center; gap: 11px; }
.avatar { width: 46px; height: 46px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--light); color: var(--ink); }
.candidate-kicker { color: var(--muted); font-size: 10px; }
.candidate-name { margin: 2px 0 0; font-size: 16px; line-height: 1.3; }
.freshness { min-height: 42px; padding: 9px 11px; border-radius: 15px; background: #111112; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.freshness span { color: var(--muted); font-size: 10px; }
.freshness strong { padding: 5px 8px; border-radius: 12px; background: var(--light); color: var(--ink); font-size: 9px; }
.profile-sections { display: grid; gap: 8px; margin-top: 14px; }
.profile-link { width: 100%; min-height: 76px; padding: 13px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); display: flex; align-items: center; gap: 12px; color: var(--text); text-align: left; cursor: pointer; }
.profile-link .state-icon { width: 36px; height: 36px; border-radius: 12px; }
.profile-link-copy { min-width: 0; flex: 1; }
.profile-link-copy strong { display: block; font-size: 12px; }
.profile-link-copy span { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.4; }

.profile-page-title, .archive-title { margin: 0 0 14px; font-size: 27px; line-height: 1.5; }
.info-list { display: grid; gap: 8px; }
.info-card { min-height: 68px; padding: 13px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); display: flex; gap: 12px; align-items: flex-start; }
.info-card .state-icon { width: 34px; height: 34px; border-radius: 12px; }
.info-copy { min-width: 0; flex: 1; }
.info-copy small { display: block; color: var(--muted); font-size: 9px; }
.info-copy strong, .info-copy span { display: block; margin-top: 3px; font-size: 11px; line-height: 1.45; white-space: pre-line; }
.page-bottom-action { margin-top: 14px; }
.edit-form { display: grid; gap: 12px; }
.edit-form textarea, .edit-form input { width: 100%; border: 1px solid var(--line); border-radius: 22px; padding: 14px; background: var(--surface); color: var(--text); font-size: 12px; line-height: 1.55; resize: vertical; }
.edit-form textarea { min-height: 560px; }
.edit-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.archive-note { min-height: 56px; margin-bottom: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.archive-card { padding: 14px; display: grid; gap: 11px; }
.restore { width: 100%; min-height: 34px; border: 1px solid var(--line); border-radius: 17px; background: #111112; color: var(--text); display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 10px; cursor: pointer; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom)); transform: translate(-50%, 14px); width: min(calc(100% - 32px), 358px); min-height: 56px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 20px; background: var(--raised); display: flex; align-items: center; justify-content: space-between; gap: 10px; box-shadow: 0 10px 30px #0008; font-size: 11px; opacity: 0; transition: opacity .18s ease, transform .24s cubic-bezier(.2,.7,.2,1); }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast button { border: 0; border-radius: 14px; padding: 7px 10px; background: #343438; color: var(--text); font-size: 10px; font-weight: 700; cursor: pointer; }

@media (max-width: 350px) {
  .screen { padding-left: 12px; padding-right: 12px; }
  .bottom-nav { width: calc(100% - 24px); }
  h1 { font-size: 29px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
