@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* ---------- design tokens (dark = primary) ---------- */
:root {
  /* Brand dark palette — hardcoded (NOT bound to Telegram theme vars), so the app
     is always dark by default regardless of the user's Telegram theme. Light is
     opt-in via the .theme-light class (header toggle).
     v2 "maritime institution" re-skin: deeper ink, structural blue alongside brass. */
  --bg: #08111B;                /* was #0B1117 — deeper, slight blue undertone */
  --bg-2: #0D1620;              /* chart panel / paywall base */
  --surface: #131C26;
  --surface-2: #1A2530;
  --border: #243240;
  --text: #E6ECF1;
  --text-2: #D6DEE6;            /* "why this fits" body */
  --text-3: #B7C2CE;            /* secondary body */
  --muted: #8A98A6;
  --muted-2: #6B7B8A;           /* darker meta */
  --faint: #4F6580;
  --accent: #D9A441;            /* brass — brand-side, not bound to tg button color */
  --accent-soft: rgba(217, 164, 65, 0.10);
  --accent-bdr: rgba(217, 164, 65, 0.40);
  --on-accent: #08111B;
  /* structural blue — institutional secondary (NEW) */
  --blue: #2F6090;              /* rules, sheet handle, chart track, chip border */
  --blue-deep: #16344F;         /* chart-bar track fill, paywall gradient stop */
  --blue-soft: rgba(47, 96, 144, 0.18);
  --blue-text: #6FA0CC;
  --success: #6FD0AB;
  --warning: #E2B567;
  --danger: #E07B75;
  --sheet-shadow: 0 -8px 24px rgba(0, 0, 0, 0.45);
}
.theme-light {
  --bg: #F4F2EC;                /* slight warm shift to read "paper" */
  --bg-2: #ECEAE2;
  --surface: #FFFFFF;
  --surface-2: #F1EEE5;
  --border: #D7D2C4;
  --text: #0F1820;
  --text-2: #2A323B;
  --text-3: #4F555D;
  --muted: #5B6A78;
  --muted-2: #6B6F75;
  --faint: #8E939A;
  --accent: #B57E1F;
  --accent-soft: rgba(181, 126, 31, 0.10);
  --accent-bdr: rgba(181, 126, 31, 0.35);
  --on-accent: #FFFFFF;
  --blue: #1E4E7A;
  --blue-deep: #DDE6EF;
  --blue-soft: rgba(30, 78, 122, 0.10);
  --blue-text: #1E4E7A;
  --success: #2C7A55;
  --warning: #8E6314;
  --danger: #A23A35;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font-family: 'IBM Plex Sans', system-ui, -apple-system, sans-serif; font-size: 15px; line-height: 1.5; }
html { background: var(--bg); }
/* Fixed shell: the page itself never scrolls — the header is pinned and only
   #app scrolls. (A sticky header jitters during momentum scroll in the iOS
   Telegram WebView; keeping it outside the scroll area makes it rock-solid.) */
body { max-width: 480px; margin: 0 auto; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; overflow: hidden; }

/* Wide screens — Telegram Desktop opens the Mini App full-width, plus desktop
   browsers and tablets: use the WHOLE screen. Full-bleed chrome (header spans
   the width), content centred in comfortable columns, and the vacancy list as a
   multi-column grid like a real job board — not a phone card floating in black.
   Phones (<760px) stay full-screen exactly as before. */
@media (min-width: 760px) {
  html { display: block; min-height: 0; padding: 0; background: var(--bg); }
  body { max-width: none; width: 100%; height: 100dvh; border: 0; border-radius: 0; box-shadow: none; }
  .topbar { padding-left: clamp(24px, 5vw, 72px); padding-right: clamp(24px, 5vw, 72px); }
  #app { padding-left: clamp(24px, 5vw, 72px); padding-right: clamp(24px, 5vw, 72px); }

  /* every screen centres in a comfortable container */
  .screen { max-width: 1200px; margin: 0 auto; width: 100%; }
  #screen-story, #screen-cv, #screen-salaries { max-width: 680px; }  /* forms & salaries stay readable-narrow */

  /* welcome → centred two-column landing that fills the space */
  #screen-welcome { max-width: 980px; min-height: calc(100dvh - 150px); display: grid;
    gap: 14px 26px; grid-template-columns: 1fr 1fr;
    grid-template-areas: "hero hero" "dir how" "cta cta" "stats stats"; align-content: center; }
  #screen-welcome .hero { grid-area: hero; padding-top: 0; }
  #screen-welcome #welcomeStats { grid-area: stats; margin: 0; }
  #screen-welcome .hero h1 { font-size: 30px; }
  #screen-welcome .hero .subtitle { max-width: 540px; }
  #screen-welcome .dir-cards { grid-area: dir; margin: 0; }
  #screen-welcome .how { grid-area: how; margin: 0; }
  #screen-welcome #buildProfileBtn { grid-area: cta; justify-self: center; width: auto; min-width: 340px; }

  /* matches → responsive multi-column card grid. Cards stretch to equal height
     per row and the action row is pinned to the bottom, so the buttons line up
     across the row no matter how long each description is. */
  #matchList { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 14px; align-items: stretch; }
  #matchList .card { height: 100%; margin: 0; display: flex; flex-direction: column; }
  #matchList .card-body { display: flex; flex-direction: column; flex: 1; }
  #matchList .actions { margin-top: auto; }
}

.mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }

/* ---------- header / shell ---------- */
.topbar { flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: calc(12px + var(--safe-top, 0px)) 20px 11px;
  z-index: 5; background: var(--bg); border-bottom: 1px solid var(--border); }
#app { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 12px 20px calc(env(safe-area-inset-bottom, 16px) + var(--safe-bottom, 0px) + 12px); }
.brand { display: flex; align-items: center; gap: 9px; }
.brand .wordmark { font-weight: 600; font-size: 17px; letter-spacing: -0.005em; }
.brand .wordmark, .brand > svg { cursor: pointer; }
.brand svg { display: block; flex: none; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  margin: -4px 2px -4px -6px; background: transparent; border: none; color: var(--text); border-radius: 8px; cursor: pointer; }
.iconbtn:active { background: var(--surface-2); }
.primary svg, .ghost svg, .seg button svg, .actions svg, .iconbtn svg { flex: none; }
.badge { font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; font-weight: 500; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent); background: var(--accent-soft);
  border: 1px solid var(--accent-bdr); padding: 3px 7px; border-radius: 4px; }

.lang { display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 7px; padding: 3px; }
.lang button { font-family: 'IBM Plex Mono', monospace; font-size: 11px; font-weight: 500; letter-spacing: 0.04em;
  background: transparent; color: var(--muted); border: none; border-radius: 5px; padding: 5px 8px; cursor: pointer; }
.lang button.on { background: var(--surface-2); color: var(--text); }

/* ---------- typography helpers ---------- */
h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.015em; margin: 8px 0 6px; line-height: 1.15; }
h2 { font-size: 18px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.eyebrow { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; font-weight: 500; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--accent); margin: 4px 0 0; }
.subtitle, .muted { color: var(--muted); }
.subtitle { font-size: 14px; margin: 0 0 18px; }
.small { font-size: 12.5px; }
.label { font-family: 'IBM Plex Sans'; font-size: 10.5px; font-weight: 500; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); }
.hidden { display: none !important; }
.screen { padding-bottom: 28px; animation: cl-fade 0.22s ease; }
@keyframes cl-fade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* ---------- fields ---------- */
.field { display: flex; flex-direction: column; gap: 7px; margin: 16px 0; }
.field > span { font-family: 'IBM Plex Sans'; font-size: 10.5px; font-weight: 500; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); }
input, textarea { width: 100%; background: var(--surface); color: var(--text); font-family: inherit; font-size: 15px;
  border: 1px solid var(--border); border-radius: 8px; padding: 12px 13px; resize: vertical; }
input { height: 46px; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--faint); }
.field.req > span::after { content: ' *'; color: var(--accent); }
input.invalid, textarea.invalid { border-color: #e0594b; background: rgba(224, 89, 75, 0.08); }
.cert-hint { background: var(--accent-soft); border: 1px solid var(--accent-bdr); border-radius: 8px;
  padding: 11px 13px; font-size: 12.5px; line-height: 1.5; color: var(--text); margin: 0 0 12px; }
.consent { display: flex; align-items: flex-start; gap: 10px; margin: 18px 0 4px; font-size: 13px;
  color: var(--muted); line-height: 1.45; cursor: pointer; }
.consent input[type="checkbox"] { width: 20px; height: 20px; flex: none; margin: 0; padding: 0;
  border-radius: 4px; accent-color: var(--accent); cursor: pointer; }
.consent a { color: var(--accent); text-decoration: underline; }
.consent.invalid { color: #e0594b; }
.consent.invalid input[type="checkbox"] { outline: 2px solid #e0594b; outline-offset: 1px; }
.terms-body p { font-size: 13.5px; line-height: 1.55; color: var(--text); margin: 0 0 14px; }
.section-label { font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 500; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent); margin: 22px 0 2px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
.char-counter { align-self: flex-end; font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--faint); margin-top: -2px; }

.hint { display: flex; gap: 9px; align-items: flex-start; background: var(--accent-soft);
  border: 1px solid var(--accent-bdr); border-radius: 8px; padding: 11px 12px; font-size: 12px; color: var(--text); margin: 4px 0; }
.hint svg { margin-top: 1px; flex: none; }
.footnote { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; color: var(--faint);
  text-align: center; margin: 12px 0 0; letter-spacing: 0.04em; }

/* ---------- buttons ---------- */
button { font-family: inherit; cursor: pointer; }
.primary { background: var(--accent); color: var(--on-accent); border: none; border-radius: 10px;
  height: 52px; width: 100%; font-size: 16px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px; }
.theme-light .primary { background: var(--text); color: #fff; }
.ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 10px;
  height: 46px; font-size: 15px; font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 8px; }
.primary:active, .ghost:active { transform: scale(0.99); }
button:disabled { opacity: 0.45; }
.full { width: 100%; margin-top: 16px; }

/* ---------- segmented (mode toggle, etc.) ---------- */
.seg { display: flex; gap: 3px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 9px; padding: 3px; margin: 6px 0 14px; }
.seg button { flex: 1; height: 38px; background: transparent; color: var(--muted); border: none; border-radius: 6px;
  font-size: 14px; font-weight: 500; display: flex; align-items: center; justify-content: center; gap: 7px; }
.seg button.on { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.theme-light .seg button.on { background: var(--text); color: #fff; }

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 12px; border-radius: 4px; font-size: 13px; cursor: pointer;
  background: transparent; color: var(--muted); border: 1px solid var(--border); }
.chip.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 500; }
.theme-light .chip.on { background: var(--text); color: #fff; border-color: var(--text); }
.chip.read { cursor: default; background: var(--surface-2); color: var(--text); }

/* ---------- my profile ---------- */
.prof-head { display: flex; align-items: center; gap: 14px; margin: 4px 0 2px; }
.prof-avatar { flex: none; width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 22px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); border: 1px solid var(--accent-bdr); }
.prof-id h1 { margin: 0; font-size: 20px; line-height: 1.2; }
.prof-id .subtitle { margin: 3px 0 0; font-size: 13px; }
.prof-stats { display: flex; gap: 10px; margin: 16px 0 6px; }
.pstat { flex: 1; text-align: center; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 8px; }
.pstat b { display: block; font-family: 'IBM Plex Mono', monospace; font-size: 20px; font-weight: 600; }
.pstat span { font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.prof-rows { display: flex; flex-direction: column; }
.prow { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; font-size: 14px;
  border-bottom: 1px solid var(--border); }
.prow span { color: var(--muted); flex: none; }
.prow b { font-weight: 600; text-align: right; word-break: break-word; }
.muted-note { color: var(--faint); font-size: 13px; }

/* ---------- welcome / landing ---------- */
.hero { text-align: center; padding: 20px 0 6px; }
.hero-logo { color: var(--text); }
.hub-tag { font-family: 'IBM Plex Mono', monospace; font-size: 11px; font-weight: 500; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--accent); margin: 10px 0 0; }
.hero h1 { font-size: 24px; margin: 6px 0 8px; }
.hero .subtitle { margin: 0 auto; max-width: 360px; }
.dir-cards { display: flex; gap: 12px; margin: 20px 0; }
.dir-card { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 24px 16px 20px; cursor: pointer; text-align: center; position: relative; overflow: hidden; }
.dir-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--accent); }
.dir-card[data-mode="shore"]::before { background: var(--blue); }
.dir-card:active { border-color: var(--accent); }
.dir-card .dir-ic { width: 50px; height: 50px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; margin-bottom: 10px; color: var(--accent);
  background: var(--accent-soft); border: 1px solid var(--accent-bdr); }
.dir-card[data-mode="shore"] .dir-ic { color: var(--blue-text);
  background: var(--blue-soft); border-color: rgba(47, 96, 144, 0.40); }
.dir-card b { font-size: 17px; font-weight: 600; color: var(--text); }
.dir-card span { font-size: 12.5px; color: var(--muted); }
/* AI credit chip — blue (tech) + brass dot: "the AI does the work" */
.ai-tag { display: inline-flex; align-items: center; gap: 6px; margin: 14px 0 0;
  font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; font-weight: 500; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--blue-text); background: var(--blue-soft);
  border: 1px solid rgba(47, 96, 144, 0.40); border-radius: 999px; padding: 5px 11px; }
.ai-tag .ai-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.how { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin: 6px 0; }
.how-title { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.how-step { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 13.5px; }
.how-step .n { flex: none; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); border-radius: 999px; font-family: 'IBM Plex Mono', monospace; font-size: 12px; font-weight: 600; }
.cv-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--accent-soft); border: 1px solid var(--accent-bdr); border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; font-size: 12.5px; }
.banner-btn { flex: none; background: var(--accent); color: var(--on-accent); border: none; border-radius: 8px; padding: 8px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.theme-light .banner-btn { background: var(--text); color: #fff; }

/* ---------- match meta ---------- */
.match-meta { display: flex; align-items: center; justify-content: space-between;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--muted);
  letter-spacing: 0.04em; text-transform: uppercase; margin: 2px 0 12px; }

/* ---------- vacancy card ---------- */
.card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px; margin: 0 0 11px; overflow: hidden; }
.theme-light .card { box-shadow: 0 1px 2px rgba(15, 24, 32, 0.04); }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card h3 { margin: 0 0 7px; font-size: 16px; font-weight: 600; line-height: 1.25; }
.vchips { display: flex; flex-wrap: wrap; gap: 6px; }
.vchip { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--muted);
  background: var(--surface-2); border-radius: 4px; padding: 3px 7px; letter-spacing: 0.02em; }
.vchip.entry-chip { color: #29a745; background: rgba(41, 167, 69, 0.15); font-weight: 600; }
.vchip.entry-chip::before { content: '\25CF\00A0'; }
.vchip.transfer-chip { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.vchip.transfer-chip::before { content: '\21AA\00A0'; }

/* welcome secondary link + market-salaries screen */
.linkbtn { display: block; width: 100%; margin: 8px auto 0; padding: 9px; background: none; border: 0;
  color: var(--accent); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; text-align: center; }
.linkbtn:active { opacity: 0.7; }
.sal-list { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.sal-row { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.sal-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.sal-rank { font-weight: 600; font-size: 14.5px; }
.sal-med { font-family: 'IBM Plex Mono', monospace; font-weight: 600; font-size: 16px; color: var(--accent); white-space: nowrap; }
.sal-med small { font-size: 10px; color: var(--muted); font-weight: 500; margin-left: 1px; }
.sal-bar { height: 5px; border-radius: 999px; background: var(--surface-2); margin: 9px 0 7px; overflow: hidden; }
.sal-bar i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.sal-meta { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); font-family: 'IBM Plex Mono', monospace; }
.stat-head { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--muted); margin: 0 0 14px; letter-spacing: 0.02em; }
.sal-zero { opacity: 0.45; }
.sal-zero .sal-bar i { background: var(--muted); }
.transfer-section { margin-top: 20px; }
.transfer-head { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 12px; padding-top: 14px; border-top: 1px solid var(--border); }

/* Welcome "live stats" hook — big animated vacancy count + teaser bar chart */
.wstats { display: block; width: 100%; text-align: left; cursor: pointer; margin: 18px 0 4px; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.wstats:active { border-color: var(--accent); }
.ws-tag { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.02em; color: var(--muted); margin: 0 0 4px; }
.ws-tag b { color: var(--accent); font-weight: 600; }
.ws-title { font-size: 15px; font-weight: 600; color: var(--text); margin: 0 0 15px; }
.ws-bars { display: flex; flex-direction: column; gap: 9px; }
.ws-bar { display: grid; grid-template-columns: 96px 1fr 34px; align-items: center; gap: 10px; }
.ws-bar-l { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-bar-t { height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.ws-bar-t i { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--accent); transition: width 0.9s cubic-bezier(0.22, 0.61, 0.36, 1); }
.ws-bar-v { font-family: 'IBM Plex Mono', monospace; font-size: 12px; font-weight: 600; color: var(--text); text-align: right; }
.ws-foot { margin-top: 13px; font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--muted); }
.ws-foot b { color: var(--text); font-weight: 600; }
.salary { font-family: 'IBM Plex Mono', monospace; font-size: 18px; font-weight: 600; color: var(--accent);
  white-space: nowrap; text-align: right; }
.salary small { display: block; font-size: 10px; font-weight: 500; color: var(--muted); margin-top: -1px; }
.vsum { margin: 0 0 10px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.matched { margin: 0 0 8px; font-size: 12.5px; line-height: 1.4; color: var(--text); }
.matched .matched-lbl { font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.why { background: var(--accent-soft); border-left: 2px solid var(--accent); border-radius: 4px;
  padding: 8px 10px; margin: 11px 0; }
.why .why-eyebrow { font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; font-weight: 500; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent); }
.why p { margin: 3px 0 0; font-size: 13px; line-height: 1.4; }
.meta-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 2px; }
.meta-row .posted { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--muted); }
.source-tag { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--muted);
  border: 1px solid var(--border); border-radius: 4px; padding: 2px 7px; }
.actions { display: flex; gap: 10px; margin-top: 13px; }
.actions .src, .actions .apply { flex: 1; height: 38px; display: flex; align-items: center; justify-content: center;
  gap: 7px; border-radius: 8px; font-size: 14px; font-weight: 600; text-decoration: none; }
.actions .src { background: transparent; color: var(--text); border: 1px solid var(--border); }
.actions .apply { background: var(--accent); color: var(--on-accent); border: none; }
.theme-light .actions .apply { background: var(--text); color: #fff; }

/* locked card */
.card.locked .card-body { filter: blur(4px); user-select: none; pointer-events: none; }
.card.locked .scrim { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, rgba(11,17,23,0.40), rgba(11,17,23,0.72)); }
.lock-pill { display: flex; align-items: center; gap: 6px; font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  font-weight: 500; letter-spacing: 0.08em; color: var(--accent); background: var(--bg);
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; }

/* ---------- paywall ---------- */
.paywall { background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--accent-bdr); border-radius: 10px; padding: 16px; margin: 4px 0 11px; }
.paywall .pw-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.paywall .pass-eyebrow { font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 500; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent); }
.paywall h3 { margin: 5px 0 3px; font-size: 16px; font-weight: 600; }
.paywall .pw-sub { font-size: 12.5px; color: var(--muted); }
.paywall .price { font-family: 'IBM Plex Mono', monospace; font-size: 20px; font-weight: 600; color: var(--accent);
  white-space: nowrap; text-align: right; }
.paywall .price small { display: block; font-size: 10px; color: var(--muted); }
.paywall .primary { height: 44px; margin-top: 13px; }

/* ---------- career directions ---------- */
.directions { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin: 0 0 14px; }
.dir-head { display: flex; align-items: center; gap: 7px; font-family: 'IBM Plex Mono', monospace; font-size: 10px;
  font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.directions .dir-summary { font-size: 14px; line-height: 1.5; color: var(--text); margin: 0 0 12px; }
.dir { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface-2); border-radius: 8px; padding: 11px 12px; margin-top: 8px; }
.dir > span:first-child { font-size: 13.5px; font-weight: 500; }
.dir-links { display: flex; gap: 6px; flex: none; }
.dir-links a { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--muted); text-decoration: none; padding: 4px 2px; }
.dir-links a:hover { color: var(--accent); }

.empty-note { text-align: center; color: var(--muted); font-size: 14px; line-height: 1.5; padding: 22px 10px; }

.match-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; }
.pill { background: var(--surface); color: var(--muted); border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 14px; font-size: 13px; font-weight: 500; cursor: pointer; }
.pill.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-bdr); }
.sort-sel { margin-left: auto; height: auto; width: auto; padding: 7px 26px 7px 12px; font-size: 12px;
  color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  -webkit-appearance: none; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238a94a3' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
.actions .save-btn { flex: 0 0 44px; height: 38px; align-self: stretch; display: flex; align-items: center; justify-content: center; line-height: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: var(--muted); cursor: pointer; }
.actions .save-btn svg { display: block; }
.actions .save-btn.on { color: var(--accent); border-color: var(--accent-bdr); background: var(--accent-soft); }

/* ---------- search the wider web ---------- */
.websearch { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin: 6px 0 14px; }
.ws-head { display: flex; align-items: center; gap: 7px; font-family: 'IBM Plex Mono', monospace; font-size: 10px;
  font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.ws-links { display: flex; flex-wrap: wrap; gap: 8px; }
.ws-links a { font-size: 13px; color: var(--text); text-decoration: none; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; }

/* ---------- apply bottom sheet ---------- */
.sheet { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); display: flex; align-items: flex-end; justify-content: center; z-index: 20; }
.sheet-card { background: var(--surface); width: 100%; max-width: 480px; border-radius: 18px 18px 0 0; border-top: 1px solid var(--border);
  box-shadow: var(--sheet-shadow); padding: 12px 20px env(safe-area-inset-bottom, 24px); max-height: 92vh; overflow: auto;
  animation: cl-up 0.25s ease; }
@keyframes cl-up { from { transform: translateY(100%); } to { transform: none; } }
.grabber { width: 38px; height: 4px; background: var(--border); border-radius: 999px; margin: 0 auto 14px; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.sheet textarea { background: var(--bg); }
.contact { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; margin: 12px 0;
  font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; color: var(--text); line-height: 1.8; word-break: break-word; }
.contact svg { vertical-align: -2px; margin-right: 4px; color: var(--accent); }
.contact .sep { color: var(--faint); font-style: normal; margin: 0 5px; }
.apply-safety { margin: 12px 2px 2px; font-size: 11px; line-height: 1.45; color: var(--muted); text-align: center; }

/* ---------- toast & loader ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); max-width: calc(100% - 40px);
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-left: 2px solid var(--accent);
  padding: 11px 15px; border-radius: 8px; font-size: 13.5px; z-index: 40; box-shadow: var(--sheet-shadow); }
.loader { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(11, 17, 23, 0.55); z-index: 30; }
.spinner { width: 56px; height: 56px; border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: cl-spin 1.1s linear infinite; }
@keyframes cl-spin { to { transform: rotate(360deg); } }

/* ============================================================
   v2 RE-SKIN — "maritime institution" · Stage 1 (global skin)
   Engineered look = hairline borders + 0px corners + structural
   blue, NOT curves. Layered after the base rules so it governs
   radii/blue across every existing component without rewriting
   each one. Stages 2–4 (eyebrow H1 stacks, register strips,
   chart exhibit, sheet detail) build on top.
   ============================================================ */

/* 1 · Tighten radii to a small, precise value (not knife-edge 0, not v1's soft
   10–14px) — engineered but not harsh. */
.card, .ghost, .primary, .seg, .seg button, .chip, .vchip, input, textarea,
.wstats, .dir-card, .how, .paywall, .directions, .dir, .badge, .lang,
.lang button, .pstat, .source-tag, .why, .contact, .cert-hint, .hint,
.banner-btn, .pill, .sort-sel, .actions .src, .actions .apply,
.actions .save-btn, .ws-links a, .websearch, .sal-row,
.toast, .sheet-card, .iconbtn { border-radius: 6px; }
.sheet-card { border-radius: 10px 10px 0 0; }
/* bars keep soft pill ends for a touch of life */
.sal-bar, .sal-bar i, .ws-bar-t, .ws-bar-t i { border-radius: 999px; }

/* keep deliberate curves (visual punctuation only) */
.lock-pill { border-radius: 999px; }
.prof-avatar, .spinner { border-radius: 50%; }
.how-step .n { border-radius: 999px; }

/* 2 · Structural blue — the institutional secondary. */
.sheet-card { background: var(--bg-2); border-top: 1px solid var(--blue); }
.grabber { background: var(--blue); }
.seg, .wstats { background: var(--bg-2); }
.chip.on, .seg button.on, .actions .apply, .primary { /* brass CTAs unchanged */ }

/* 3 · Faint engraved "chart-paper" grid — tiles at a fixed 28px pitch so it
   never blows up on wide screens, and stays a whisper so it never competes
   with content (WCAG AA preserved). The compass identity lives in header + hero. */
:root { --grid: rgba(47, 96, 144, 0.05); }
.theme-light { --grid: rgba(30, 78, 122, 0.05); }
body { background-image:
  repeating-linear-gradient(0deg,  var(--grid) 0 1px, transparent 1px 28px),
  repeating-linear-gradient(90deg, var(--grid) 0 1px, transparent 1px 28px); }
.topbar { position: relative; z-index: 2; }
#app { position: relative; z-index: 1; }

/* ───────── Public landing (browser visitors, not inside Telegram) ───────── */
body.is-landing #profileBtn { display: none; }
.cta-tg { margin-top: 16px; text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; }
.l-meta { text-align: center; margin: 12px 0 0; font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; letter-spacing: 0.04em; color: var(--muted); }
.l-meta b { color: var(--accent); }
.l-jobs-title { margin: 26px 4px 12px; font-size: 13px; font-weight: 700; letter-spacing: 0.02em; color: var(--text); }
.l-jobs { display: grid; gap: 10px; }
.l-job { display: block; text-decoration: none; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 13px 15px; transition: border-color .15s, transform .15s; }
.l-job:hover { border-color: var(--accent); transform: translateY(-1px); }
.l-job-t { font-weight: 650; font-size: 14.5px; color: var(--text); }
.l-job-s { margin-top: 4px; font-size: 13px; line-height: 1.4; color: var(--muted); }
.l-job-m { margin-top: 7px; font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.03em; color: var(--faint); }
.cta-tg2 { margin-top: 16px; text-decoration: none; display: flex; align-items: center; justify-content: center; font-weight: 600; }
@media (min-width: 760px) { #screen-landing .l-jobs { grid-template-columns: 1fr 1fr; } }

/* landing — "why CrewLink" three points */
.l-why { display: grid; gap: 11px; margin: 22px 0 4px; }
.l-why-item { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 13px 14px; }
.l-why-ic { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-bdr); }
.l-why-item > div { display: flex; flex-direction: column; gap: 2px; }
.l-why-item b { font-size: 14px; font-weight: 650; color: var(--text); }
.l-why-item span { font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.cta-tg svg { margin-right: 2px; }
@media (min-width: 760px) { #screen-landing .l-why { grid-template-columns: repeat(3, 1fr); } }

/* landing: brand mark is not a navigation control */
body.is-landing .brand .wordmark, body.is-landing .brand > svg { cursor: default; }
