:root {
    --brand-dark: #1B0F4A; --brand: #4F2BD1; --accent: #5B33E0; --accent-hover: #4824C4; --accent-soft: #EEE9FF;
    --mint: #12B886; --bg: #F6F5FB; --card: #FFFFFF; --text: #17142B; --muted: #686580; --line: #E6E3F0; --bad: #C0262D;
    --radius: 14px; --shadow: 0 1px 2px rgba(23, 20, 43, .05), 0 4px 16px rgba(23, 20, 43, .06);
    --shadow-hover: 0 2px 4px rgba(23, 20, 43, .06), 0 10px 28px rgba(79, 43, 209, .14);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; letter-spacing: -.01em; }
h2 { font-size: 1.25rem; margin: 0 0 8px; }

/* Header: a gradient hero on every page */
header { color: #fff; padding: 20px 16px 72px; background:
    radial-gradient(900px 300px at 85% -10%, rgba(18, 184, 134, .35), transparent 60%),
    radial-gradient(700px 300px at 0% 120%, rgba(255, 255, 255, .10), transparent 60%),
    linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%); }
header > *, header .top { max-width: 900px; margin-inline: auto; }
header h1 { margin: 0; font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
header p { margin: 10px auto 0; opacity: .9; font-size: 1.05rem; max-width: 900px; }
header .top { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
header .top h1 { margin-right: auto; }
header .hero { font-size: clamp(1.6rem, 5vw, 2.4rem); font-weight: 800; margin: 28px auto 0; letter-spacing: -.02em; line-height: 1.15; }
header select { width: auto; padding: 6px 10px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .12); color: #fff; font: inherit; font-size: .9rem; }
header select option { color: var(--text); }
#installButton { padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, .15); color: #fff; border-color: rgba(255, 255, 255, .4); }

/* Content floats up over the hero */
main { max-width: 900px; margin: 16px auto 0; padding: 0 16px 24px; position: relative; }
header + main { margin-top: -52px; }

nav { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; background: var(--card); padding: 5px; border-radius: 16px; box-shadow: var(--shadow); }
@media (max-width: 560px) { nav { display: grid; grid-template-columns: 1fr 1fr; } }
nav button { flex: 1 1 auto; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-weight: 600; padding: 10px 12px; }
nav button:hover { color: var(--accent); background: var(--accent-soft); }
nav button[aria-selected="true"] { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(91, 51, 224, .35); }

button, .button { font: inherit; font-weight: 600; border: 1px solid var(--line); background: var(--card); color: var(--accent); border-radius: 10px; padding: 10px 16px; cursor: pointer; text-decoration: none; display: inline-block; text-align: center; transition: background .15s, box-shadow .15s, transform .15s, border-color .15s; }
button:hover, .button:hover { border-color: var(--accent); }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(91, 51, 224, .25); }
button.primary:hover, .button.primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
button:disabled { opacity: .6; cursor: wait; transform: none; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid rgba(91, 51, 224, .45); outline-offset: 2px; }
button.link { border: 0; padding: 0; background: none; text-decoration: underline; font-weight: 500; box-shadow: none; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 12px; box-shadow: var(--shadow); }
article.card { transition: box-shadow .2s, transform .2s, border-color .2s; }
article.card:hover { box-shadow: var(--shadow-hover); border-color: #D8D0FA; transform: translateY(-1px); }
.card h3 { margin: 6px 0 4px; font-size: 1.1rem; font-weight: 700; }
.card h3 a { color: var(--text); text-decoration: none; }
.card h3 a:hover { color: var(--accent); }

.meta { color: var(--muted); font-size: .92rem; }
.tag { display: inline-block; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 3px 10px; font-size: .78rem; font-weight: 600; margin: 0 6px 4px 0; }
.tag.new { background: #E3F9F1; color: #0B7F5C; }
label { display: block; font-weight: 600; font-size: .92rem; margin: 10px 0 6px; }
label.inline { display: flex; align-items: center; gap: 8px; font-weight: 500; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
input[type=text], input[type=url], input[type=email], input[type=tel], input[type=number], input[type=date], select, textarea { width: 100%; font: inherit; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #FBFAFE; color: var(--text); transition: border-color .15s, background .15s; }
input:hover, select:hover, textarea:hover { border-color: #CFC8E8; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); background: #fff; }
textarea { min-height: 120px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 200px; }
.row > button { flex: 0 0 auto; }
.error { color: var(--bad); }
.pre { white-space: pre-wrap; }
[hidden] { display: none !important; }
.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.filters { margin: 10px 0 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chips button { padding: 5px 12px; border-radius: 999px; font-size: .85rem; font-weight: 600; background: var(--accent-soft); border-color: transparent; }
.filters summary { cursor: pointer; color: var(--accent); font-weight: 600; padding: 6px 0; }

/* Facebook groups */
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin-top: 10px; }
.groups a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--text); font-weight: 600; background: #FBFAFE; }
.groups a::before { content: "f"; flex: 0 0 28px; height: 28px; border-radius: 50%; background: #1877F2; color: #fff; font-weight: 800; display: grid; place-items: center; font-family: Arial, sans-serif; }
.groups a:hover { border-color: #1877F2; background: #F0F6FF; }

footer { text-align: center; padding: 24px 16px 32px; font-size: .9rem; color: var(--muted); }
[dir=rtl] body { text-align: right; }
.translated { border-inline-start: 3px solid var(--accent); padding-inline-start: 8px; }
.match { background: var(--accent-soft); border-radius: 10px; padding: 8px 12px; }
.letter textarea { width: 100%; margin: 6px 0; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
td + td, th + th { text-align: right; }
.similar { list-style: none; padding: 0; margin: 0; }
.similar li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.similar li:last-child { border-bottom: 0; }
.map { height: 360px; border-radius: 12px; margin: 8px 0; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---- Job app (index.html): slim header, sticky search, bottom menu on phones ---- */
body.app header { padding: 12px 16px; }
body.app header + main { margin-top: 0; }
body.app main { padding-top: 0; }
.searchbar { position: sticky; top: 0; z-index: 20; background: var(--bg); padding: 10px 0 6px; margin: 0 -16px 8px; padding-inline: 16px; }
.searchrow { display: flex; gap: 6px; align-items: center; }
.searchrow input { min-width: 0; height: 46px; background: var(--card); box-shadow: var(--shadow); }
.searchrow #q { flex: 3 1 0; }
.searchrow #ort { flex: 2 1 0; }
button.icon { flex: 0 0 46px; width: 46px; height: 46px; padding: 0; display: grid; place-items: center; border-radius: 12px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 8px -16px 0; padding: 2px 16px 4px; -webkit-overflow-scrolling: touch; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chips button { flex: 0 0 auto; min-height: 36px; white-space: nowrap; background: var(--card); border: 1px solid var(--line); color: var(--text); font-weight: 600; }
.chips button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
body.app nav button { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; }
@media (max-width: 720px) {
    body.app { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
    body.app nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0; border-radius: 0; display: grid; grid-template-columns: repeat(4, 1fr);
        padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); box-shadow: 0 -1px 0 var(--line), 0 -4px 16px rgba(23, 20, 43, .06); }
    body.app nav button { flex-direction: column; gap: 2px; padding: 6px 2px; font-size: .72rem; border-radius: 10px; }
    body.app nav button[aria-selected="true"] { background: transparent; color: var(--accent); box-shadow: none; }
}
.skeleton span { display: block; height: 14px; border-radius: 7px; background: linear-gradient(90deg, var(--line) 25%, var(--accent-soft) 50%, var(--line) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; margin: 8px 0; }
.skeleton span:first-child { width: 60%; height: 18px; }
.skeleton span:last-child { width: 40%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Job cards: avatar, chips, heart; the whole card opens the detail view */
.card.job { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px 52px 14px 14px; }
.card.job .body { flex: 1; min-width: 0; }
.card.job h3 { margin: 0 0 2px; font-size: 1.02rem; overflow-wrap: anywhere; }
.card.job h3 a { color: var(--text); text-decoration: none; }
.card.job .meta { margin: 0; }
.stretch::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.avatar { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.1rem; }
.chipline { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 2px; }
.chipline .tag { margin: 0; }
.tag.muted { background: var(--line); color: var(--muted); }
.card.job .save, .actionbar .save { position: relative; z-index: 2; }
.card.job .save { position: absolute; top: 6px; right: 6px; }
button.save.heart { width: 44px; height: 44px; padding: 0; border: 0; background: transparent; box-shadow: none; font-size: 1.4rem; line-height: 1; color: var(--accent); }
.resultsHead { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 4px 0 8px; }
.resultsHead h2 { margin: 0; font-size: 1.05rem; }
.sentinel { height: 1px; }
.alertslim { padding: 12px 14px; }
.alertslim summary { cursor: pointer; font-weight: 700; color: var(--accent); min-height: 24px; }
.alertslim form { margin-top: 10px; }

/* Detail view: full screen over the list, sticky action bar at the bottom */
#detail { position: fixed; inset: 0; z-index: 50; overflow-y: auto; background: var(--bg); padding: 0 16px; }
#detail > * { max-width: 760px; margin-inline: auto; }
body.detailOpen { overflow: hidden; }
body.detailOpen nav { display: none; }
.detailTop { position: sticky; top: 0; z-index: 3; background: var(--bg); padding: 8px 0; }
.detailHead { display: flex; gap: 12px; align-items: center; margin: 4px 0 12px; }
.detailHead h2 { margin: 0; font-size: 1.3rem; overflow-wrap: anywhere; }
ul.facts { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
ul.facts li { display: flex; gap: 10px; align-items: baseline; }
.actionbar { position: sticky; bottom: 0; z-index: 3; display: flex; gap: 8px; align-items: center; background: var(--card); margin: 16px -16px 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -1px 0 var(--line), 0 -4px 16px rgba(23, 20, 43, .06); max-width: none; }
.actionbar .grow { flex: 1; min-height: 48px; display: grid; place-items: center; }
button.ghost { background: transparent; border-color: transparent; box-shadow: none; }

/* Tap targets */
body.app button, body.app .button, body.app select { min-height: 44px; }
body.app button.link { min-height: 0; padding: 10px 0; }

/* Dark mode */
@media (prefers-color-scheme: dark) {
    :root { --bg: #100D1F; --card: #1B1730; --text: #ECEAF6; --muted: #A6A2BD; --line: #2E2948; --accent: #9C84FF; --accent-hover: #B3A0FF; --accent-soft: #2A2350; --bad: #FF7A80;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-hover: 0 4px 16px rgba(0, 0, 0, .4); color-scheme: dark; }
    input[type=text], input[type=url], input[type=email], input[type=tel], input[type=number], input[type=date], select, textarea, .groups a { background: #15122A; }
    input:focus, select:focus, textarea:focus { background: #1B1730; }
    article.card:hover { border-color: #4A3F80; }
    .groups a:hover { background: #1A2440; }
    .tag.new { background: #0F3B2E; color: #5EE2B5; }
    button.primary, .button.primary, nav button[aria-selected="true"], .chips button[aria-pressed="true"] { background: #6C4CF0; border-color: #6C4CF0; color: #fff; }
}
#detail .card { box-shadow: none; }
#detail .card > .tag, #detail .card > h3, #detail .card > .meta:first-of-type { display: none; }
.card.job .match { margin: 6px 0; overflow-wrap: anywhere; }
#detail:not([hidden]) { display: flex; flex-direction: column; }
#detail > * { width: 100%; }
#detail > .actionbar { margin: auto -16px 0; width: auto; max-width: none; position: sticky; }
/* Tighter search area: nothing between the chips and the result count */
.searchbar { padding-bottom: 4px; margin-bottom: 0; }
.searchrow, .searchrow > * { margin: 0; }
.resultsHead { margin: 6px 0 8px; min-height: 36px; }
.resultsHead button { min-height: 36px; padding: 4px 12px; font-size: .88rem; }
/* Fade on the right edge shows the chips row scrolls */
.chips.scroll { -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent); }
[dir=rtl] .chips.scroll { -webkit-mask-image: linear-gradient(to left, #000 85%, transparent); mask-image: linear-gradient(to left, #000 85%, transparent); }
/* Detail: line icons in the facts, labelled share button, small report link */
ul.facts li { align-items: center; }
ul.facts svg { flex: 0 0 20px; color: var(--accent); }
button.share { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; }
button.link.small { font-size: .85rem; color: var(--muted); }
[dir=rtl] .detailTop .arrow { display: inline-block; transform: scaleX(-1); }

/* Empty state and pull to refresh */
.card.empty { text-align: center; padding: 24px 16px; }
.card.empty h3 { margin: 8px 0 4px; overflow-wrap: anywhere; }
.card.empty .chips { justify-content: center; }
.pull { height: 0; overflow: hidden; display: grid; place-items: center; color: var(--muted); font-size: 1.4rem; transition: height .15s; }
.pull.ready { color: var(--accent); }
/* First-visit bottom sheet */
.shade { position: fixed; inset: 0; z-index: 60; background: rgba(10, 8, 25, .45); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--card); width: 100%; max-width: 560px; border-radius: 20px 20px 0 0; padding: 20px 16px calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 30px rgba(0, 0, 0, .2); max-height: 90vh; overflow-y: auto; }
.sheet h2 { margin: 0 0 4px; }
.sheet label { display: block; margin: 14px 0 4px; font-weight: 600; }
.sheet .row { display: flex; gap: 8px; margin-top: 16px; }
.sheet .row .primary { flex: 1; }
/* Profile completeness meter and sticky save bar */
.meter h3 { margin: 0 0 8px; }
.meter .bar { height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; }
.meter .bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--mint)); border-radius: 5px; transition: width .3s; }
.meter .chips { margin-top: 6px; }
.stickybar { position: sticky; bottom: 0; z-index: 5; background: var(--card); padding: 10px 0; }
.stickybar .primary { width: 100%; }
@media (max-width: 720px) { body.app .stickybar { bottom: calc(64px + env(safe-area-inset-bottom)); } }
[data-icon] { display: flex; align-items: center; gap: 8px; }
[data-icon] svg { flex: 0 0 auto; color: var(--accent); }
.footlinks { font-size: .85rem; color: var(--muted); margin: 0 0 6px; }
.chips.landing a { font-size: .85rem; padding: 6px 12px; border-radius: 999px; }
.cvpreview { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 30vh; overflow-y: auto; background: var(--bg); border-radius: 10px; padding: 10px; font: inherit; font-size: .85rem; }
#detail .shade { position: fixed; }
#detail > .shade { max-width: none; margin: 0; width: auto; }
body.landing main h2 { margin-top: 20px; }
/* One-line menu labels keep the bottom nav one height in every language (the sticky save bar sits above it). */
@media (max-width: 720px) { body.app nav button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; } }

/* ---- Start view: hero line, occupation tiles, newest group posts, employer banner ---- */
body.app header { padding-bottom: 20px; }
body.app header .hero { font-size: clamp(1.7rem, 7vw, 2.4rem); margin: 18px auto 0; }
body.app header .herocount { margin: 6px auto 0; font-weight: 600; color: #B8F5DD; min-height: 1.5em; }
#home h2 { font-size: 1.05rem; margin: 14px 0 8px; }
.tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
@media (max-width: 560px) { .tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; } }
.tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); color: var(--text); font-size: .78rem; font-weight: 600; box-shadow: var(--shadow); min-width: 0; }
.tile span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile svg { width: 26px; height: 26px; color: var(--accent); background: var(--accent-soft); border-radius: 10px; padding: 6px; box-sizing: content-box; }
.tile:hover { border-color: var(--accent); }
.strip { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 8px; scrollbar-width: none; scroll-snap-type: x mandatory; }
.strip::-webkit-scrollbar { display: none; }
.mini { flex: 0 0 200px; scroll-snap-align: start; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: start; padding: 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); color: var(--text); box-shadow: var(--shadow); }
.mini strong { font-size: .95rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini .meta { font-weight: 400; font-size: .82rem; }
.mini .avatar { width: 36px; height: 36px; flex-basis: auto; font-size: .95rem; }
.banner { display: flex; align-items: center; gap: 12px; justify-content: space-between; margin: 16px 0 6px; padding: 16px; border-radius: 16px; color: #fff;
    background: radial-gradient(400px 160px at 100% 0%, rgba(18, 184, 134, .45), transparent 60%), linear-gradient(135deg, var(--brand-dark), var(--brand)); }
.banner div { display: flex; flex-direction: column; gap: 2px; }
.banner span { opacity: .9; font-size: .9rem; }
.banner .button { flex: 0 0 auto; background: #fff; color: var(--brand); border-color: #fff; }
.tile { font-size: .72rem; }
.tile span { overflow: visible; text-overflow: clip; }
.strip { scroll-padding-inline: 16px; }
@media (max-width: 560px) { .banner { flex-wrap: wrap; } .banner .button { width: 100%; } }
.tile span { letter-spacing: -.01em; }
