:root {
    --red: #e11d2e;
    --red-dark: #b91c1c;
    --blue: #1597d4;
    --blue-dark: #0284c7;
    --teal: #14b8a6;
    --ink: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --soft: #f3f4f6;
    --bg: #ffffff;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body { background: #e5e7eb; color: var(--ink); font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }
.app-shell { width: 100%; max-width: 480px; min-height: 100vh; margin: 0 auto; background: #fff; position: relative; box-shadow: 0 0 40px rgba(17,24,39,.08); }
.app-main { min-height: 100vh; padding-bottom: 82px; }
.app-topbar { height: 64px; display: flex; align-items: center; justify-content: center; padding: 0 16px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.app-logo { display: inline-flex; align-items: center; gap: 2px; font-size: 24px; font-weight: 900; letter-spacing: -.9px; color: var(--red); }
.app-logo .chev { color: var(--blue); font-size: 25px; font-weight: 900; letter-spacing: -5px; margin-right: 2px; }
.app-topbar__side { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; color: #374151; font-size: 21px; border: 0; background: transparent; }\n.app-topbar__side:first-child { left: 10px; }\n.app-topbar__side:last-child { right: 10px; }
.app-topbar__title { font-size: 15px; font-weight: 700; }

.app-search-wrap { padding: 14px 16px 6px; }
.app-search { display: flex; align-items: center; gap: 10px; height: 52px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; box-shadow: 0 5px 16px rgba(17,24,39,.07); background: #fff; }
.app-search i { color: #9ca3af; font-size: 24px; }
.app-search input { border: 0; outline: 0; flex: 1; font-size: 15px; color: var(--ink); background: transparent; }
.app-search input::placeholder { color: #6b7280; }

.app-chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px 12px; scrollbar-width: none; }
.app-chips::-webkit-scrollbar { display: none; }
.app-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; border: 1px solid #d1d5db; border-radius: 999px; padding: 9px 14px; font-size: 13px; font-weight: 500; color: #374151; background: #fff; }
.app-chip i { font-size: 15px; color: #374151; }
.app-chip.active { border-color: var(--blue); color: var(--blue-dark); background: #f0f9ff; }

.app-section-bar { display: flex; align-items: center; justify-content: space-between; padding: 11px 16px; background: #f9fafb; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 700; color: #4b5563; letter-spacing: .02em; }
.app-section-bar span:first-child { text-transform: uppercase; }
.app-section-bar span:last-child { font-weight: 500; color: #6b7280; }

.app-location-note { background: #e8f7fb; color: #374151; padding: 15px 16px; font-size: 15px; line-height: 1.5; border-bottom: 1px solid #d8eef5; }
.app-location-note strong { color: #111827; }

.app-job-list { background: #fff; }
.app-job-row { display: flex; gap: 13px; padding: 15px 16px; border-bottom: 1px solid var(--line); background: #fff; }
.app-job-logo { flex: 0 0 64px; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: #f3f4f6; display: flex; align-items: center; justify-content: center; }
.app-job-logo img { width: 100%; height: 100%; object-fit: cover; }
.app-job-logo .company-logo { width: 100%; height: 100%; border: 0; border-radius: 0; object-fit: cover; }
.app-job-body { flex: 1; min-width: 0; }
.app-job-title { margin: 0 0 3px; font-size: 16px; font-weight: 800; color: #111827; line-height: 1.25; }
.app-job-company { display: flex; align-items: center; gap: 4px; color: var(--blue-dark); font-size: 14px; font-weight: 600; margin: 0 0 4px; }
.app-job-company i { color: var(--blue); font-size: 16px; }
.app-job-loc { color: #4b5563; font-size: 14px; margin: 0 0 4px; }
.app-job-distance { color: #4b5563; font-size: 14px; margin: 0 0 8px; }
.app-job-distance i { color: var(--red); font-size: 15px; margin-right: 3px; }
.app-job-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #4b5563; font-size: 14px; }
.app-job-new { color: var(--teal); font-size: 14px; font-weight: 500; }
.app-job-old { color: #9ca3af; font-size: 13px; }

.app-bottom-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; height: 72px; background: #fff; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-around; z-index: 50; padding: 5px 4px calc(5px + env(safe-area-inset-bottom)); }
.app-nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; color: #6b7280; font-size: 11px; font-weight: 500; text-align: center; }
.app-nav-item i { font-size: 24px; line-height: 1; }
.app-nav-item.active { color: var(--red); font-weight: 600; }
.app-nav-post { color: #4b5563; }
.app-nav-post i { width: 34px; height: 34px; border-radius: 50%; background: #4b5563; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 19px; margin-top: -10px; }
.app-nav-item .nav-badge { position: absolute; margin-left: 18px; margin-top: -4px; width: 7px; height: 7px; background: var(--red); border-radius: 50%; }

/* Role selection */
.role-screen { min-height: 100vh; display: flex; flex-direction: column; }
.role-top { flex: 1 1 52%; background: var(--red); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 44px 24px; }
.role-top h1, .role-bottom h2 { margin: 0 0 12px; font-size: 25px; font-weight: 800; letter-spacing: -.4px; }
.role-top p, .role-bottom p { margin: 0 0 26px; font-size: 18px; line-height: 1.45; max-width: 330px; }
.role-top p { color: rgba(255,255,255,.96); }
.role-bottom p { color: #4b5563; }
.role-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 220px; padding: 15px 28px; border-radius: 6px; font-size: 19px; font-weight: 500; }
.role-btn--outline { border: 1.5px solid #fff; color: #fff; }
.role-btn--red { background: var(--red); color: #fff; border: 1.5px solid var(--red); }
.role-bottom { flex: 1 1 48%; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; text-align: center; padding: 46px 24px 18px; position: relative; overflow: hidden; }
.role-bottom::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 58%; background: url('app-city.svg') center bottom / cover no-repeat; opacity: .7; pointer-events: none; }
.role-bottom > * { position: relative; z-index: 1; }
.role-brand { margin-top: auto; padding-top: 18px; color: #6b7280; font-size: 12px; }
.role-brand strong { color: var(--red); }

/* Auth app */
.app-auth { min-height: calc(100vh - 64px); background: #f9fafb; padding: 24px 18px 30px; }
.app-auth__card { background: #fff; border-radius: 14px; padding: 22px; box-shadow: 0 12px 30px rgba(17,24,39,.08); }
.app-auth h1 { margin: 0 0 5px; font-size: 23px; letter-spacing: -.5px; }
.app-auth p.lead { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.app-auth .field { margin-bottom: 11px; }
.app-auth label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.app-auth input { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 0 11px; font-size: 14px; outline: 0; }
.app-auth input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(225,29,46,.08); }
.app-tabs { display: flex; background: #f3f4f6; border-radius: 8px; padding: 3px; margin-bottom: 16px; }
.app-tabs a { flex: 1; text-align: center; padding: 8px; font-size: 12px; font-weight: 700; color: var(--muted); border-radius: 6px; }
.app-tabs a.active { background: #fff; color: var(--red); box-shadow: 0 1px 4px rgba(17,24,39,.08); }
.app-btn { display: flex; align-items: center; justify-content: center; width: 100%; height: 46px; border-radius: 8px; border: 0; background: var(--red); color: #fff; font-size: 15px; font-weight: 700; }
.app-btn:hover { background: var(--red-dark); color: #fff; }
.app-btn--outline { background: #fff; border: 1px solid var(--red); color: var(--red); }
.app-auth__note { text-align: center; color: var(--muted); font-size: 12px; margin: 14px 0 0; }
.app-auth__note a { color: var(--red); font-weight: 600; }
.app-alert { border-radius: 8px; padding: 9px 11px; font-size: 12px; margin-bottom: 10px; }
.app-alert--error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.app-alert--success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }

/* Employer */
.emp-tabs { display: flex; gap: 0; background: #fff; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.emp-tabs a { flex: 1; min-width: 86px; text-align: center; padding: 14px 8px; font-size: 14px; color: #4b5563; border-bottom: 2px solid transparent; white-space: nowrap; }
.emp-tabs a.active { color: var(--blue-dark); border-bottom-color: var(--blue); font-weight: 600; }
.emp-chips { display: flex; gap: 8px; overflow-x: auto; padding: 11px 16px; background: #fff; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.emp-chips::-webkit-scrollbar { display: none; }
.emp-chip { flex: 0 0 auto; border: 1px solid #d1d5db; border-radius: 999px; padding: 8px 15px; color: #4b5563; font-size: 13px; background: #fff; }
.emp-chip.active { border-color: var(--blue); color: var(--blue-dark); background: #f0f9ff; }
.emp-empty { padding: 54px 26px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.emp-empty img { width: 210px; max-width: 75%; height: auto; margin-bottom: 22px; }
.emp-empty h2 { margin: 0 0 10px; font-size: 23px; font-weight: 800; }
.emp-empty p { margin: 0 0 24px; color: #374151; font-size: 17px; line-height: 1.5; max-width: 330px; }
.emp-empty .app-btn { max-width: 340px; height: 52px; font-size: 17px; }
.emp-job-card { background: #fff; border-bottom: 1px solid var(--line); padding: 16px; }
.emp-job-card h3 { margin: 0 0 4px; font-size: 16px; }
.emp-job-card p { margin: 0 0 6px; color: var(--muted); font-size: 13px; }
.emp-job-card .status { display: inline-block; border-radius: 999px; padding: 4px 9px; font-size: 11px; font-weight: 700; }
.status-published { background: #dcfce7; color: #166534; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-closed { background: #f3f4f6; color: #4b5563; }
.status-rejected { background: #fee2e2; color: #991b1b; }

/* Detail */
.app-detail { padding: 16px; }
.app-detail__company { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.app-detail__logo { width: 54px; height: 54px; border-radius: 10px; overflow: hidden; background: #f3f4f6; display: flex; align-items: center; justify-content: center; }
.app-detail__logo .company-logo { width: 100%; height: 100%; border: 0; border-radius: 0; }
.app-detail h1 { font-size: 24px; margin: 0 0 6px; letter-spacing: -.6px; }
.app-detail__meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.app-detail__tag { background: #f3f4f6; color: #4b5563; border-radius: 6px; padding: 5px 9px; font-size: 12px; }
.app-detail__section { margin-top: 22px; }
.app-detail__section h2 { font-size: 18px; margin: 0 0 8px; }
.app-detail__section p, .app-detail__section li { color: #374151; font-size: 14px; line-height: 1.65; }
.app-detail__section ul { padding-left: 18px; margin: 0; }
.app-detail__apply { position: fixed; bottom: 72px; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; padding: 10px 16px; background: #fff; border-top: 1px solid var(--line); z-index: 40; }
.app-detail__apply .app-btn { height: 48px; }

/* Profile/misc */
.app-list { background: #fff; }
.app-list a, .app-list button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 15px 16px; border: 0; border-bottom: 1px solid var(--line); background: #fff; text-align: left; font-size: 14px; color: #111827; }
.app-list i { color: var(--red); font-size: 20px; width: 24px; text-align: center; }
.app-list a:last-child, .app-list button:last-child { border-bottom: 0; }
.app-profile-head { background: #fff; padding: 22px 16px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); }
.app-avatar { width: 58px; height: 58px; border-radius: 50%; background: #fee2e2; color: var(--red); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; }
.app-profile-head h2 { margin: 0 0 2px; font-size: 18px; }
.app-profile-head p { margin: 0; color: var(--muted); font-size: 13px; }
.app-empty { text-align: center; padding: 42px 24px; color: var(--muted); }
.app-empty i { font-size: 38px; color: #d1d5db; }
.app-empty h2 { color: #111827; font-size: 18px; margin: 10px 0 5px; }
.app-empty p { font-size: 13px; margin: 0 0 16px; }
.app-msg { padding: 16px; border-bottom: 1px solid var(--line); }
.app-msg h3 { margin: 0 0 3px; font-size: 15px; }
.app-msg p { margin: 0; color: var(--muted); font-size: 13px; }
.app-subtle { color: var(--muted); font-size: 12px; }
.app-section-title { padding: 18px 16px 8px; font-size: 16px; font-weight: 800; }
.app-form { padding: 16px; }
.app-form .field { margin-bottom: 11px; }
.app-form label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.app-form input, .app-form select, .app-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 11px; font-size: 14px; outline: 0; background: #fff; }
.app-form textarea { min-height: 100px; }
.app-form input:focus, .app-form select:focus, .app-form textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(225,29,46,.08); }
.app-form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.app-form .app-btn { margin-top: 6px; }

@media (max-width: 520px) {
    body { background: #fff; }
    .app-shell { box-shadow: none; }
}
