:root {
  --navy:#10233f; --blue:#0891b2; --violet:#0e7490; --bg:#f6f8fb;
  --card:#fff; --ink:#10233f; --muted:#5f6f86; --line:#dbe3ee;
  --good:#148658; --warn:#a46504; --bad:#b42318;
  --safe-top:env(safe-area-inset-top,0px); --safe-bottom:env(safe-area-inset-bottom,0px);
}
* { box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html,body { margin:0; min-height:100%; overscroll-behavior-y:contain; background:var(--bg); color:var(--ink); font:15px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
button,input,select { font:inherit; }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible { outline:3px solid #f59e0b; outline-offset:3px; }
button,a { touch-action:manipulation; }
/* height (a HARD cap), not min-height (a FLOOR that never actually constrains anything) -
   confirmed with real diagnostics on a device (21/08/2026): min-height let .app grow to its
   full natural content height (635px) regardless of the keyboard shrinking the visible window
   to a sliver (170px), with nothing left to trigger the browser's normal "scroll the focused
   field into view" behaviour - that needs an actually height-BOUNDED, scrollable box to work
   inside. 100dvh tracks the real, live visible height (keyboard included); overflow-y:auto
   makes .app itself the one scrollable region, so a tall form scrolls inside a properly sized
   box instead of pushing the whole page past the visible area. */
.app { max-width:540px; height:100dvh; overflow-y:auto; -webkit-overflow-scrolling:touch; margin:auto; background:var(--bg); box-shadow:0 0 42px #0c1c3822; }
.top { position:sticky; top:0; z-index:10; padding:calc(var(--safe-top) + 12px) 18px 15px; color:#fff; background:linear-gradient(145deg,#0e7490,#0891b2); }
.brand { display:flex; align-items:center; gap:11px; }
.brand > div { min-width:0; }   /* allow the name/email column to shrink so it can ellipsis, not overflow */
.mark { display:grid; place-items:center; width:38px; height:38px; border-radius:12px; background:linear-gradient(135deg,var(--blue),#22b8cf); font-size:20px; font-weight:900; flex:0 0 auto; }
.brand h1 { margin:0; font-size:20px; }
.brand p { margin:1px 0 0; color:#cbd8ed; font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.credits { margin-left:auto; padding:6px 9px; border:1px solid #ffffff3b; border-radius:999px; background:#ffffff16; font-size:11px; }
.content { padding:16px 14px calc(88px + var(--safe-bottom)); }
.hero { padding:18px; border-radius:18px; color:#fff; background:linear-gradient(140deg,#173968,#5d55cf); box-shadow:0 12px 26px #18377422; }
.hero h2 { margin:0 0 4px; font-size:23px; }
.hero p { margin:0; color:#dbe5ff; }
.tabs { display:flex; gap:7px; overflow:auto; padding:14px 0 12px; scrollbar-width:none; }
.tabs::-webkit-scrollbar { display:none; }
.chip,.icon-btn { border:1px solid var(--line); background:#fff; color:var(--muted); border-radius:999px; padding:8px 12px; font-weight:700; white-space:nowrap; }
.chip.on { color:#fff; border-color:var(--blue); background:var(--blue); }
/* A real segmented-control tab bar, for switching between sections of the SAME screen
   (Search a job site / I have a job already; Ready to send / Applied) - .chip's individual
   pill border made each option read as its own floating button, not as parts of one whole
   (TJ, 22/08/2026). One shared track; the active section gets a raised inner pill, everything
   else sits flush - unambiguously "sections of this page", not a row of separate buttons. */
.tabbar { display:flex; gap:3px; padding:4px; margin:0 0 14px; background:#eef1f6; border-radius:14px; }
.tabbar button { flex:1; border:0; background:transparent; color:var(--muted); font-weight:750; font-size:13px; padding:10px 6px; border-radius:11px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tabbar button.on { background:var(--card); color:var(--ink); box-shadow:0 1px 5px #10233f26; }
.job { display:block; width:100%; margin:0 0 11px; padding:15px; text-align:left; color:inherit; background:var(--card); border:1px solid var(--line); border-radius:17px; box-shadow:0 3px 10px #1527470a; }
.job:active { transform:scale(.99); }
.job-head { display:flex; gap:12px; }
.job-main { min-width:0; flex:1; }
.job h3 { margin:0; font-size:16px; }
.company { margin-top:2px; color:var(--blue); font-weight:650; }
.meta,.small { color:var(--muted); font-size:12px; }
.meta { display:flex; gap:9px; flex-wrap:wrap; margin-top:8px; }
.score { flex:0 0 54px; text-align:center; color:var(--good); font-size:20px; font-weight:900; }
.score span { display:block; color:var(--muted); font-size:9px; letter-spacing:.6px; }
/* Made much more obvious 22/08/2026 (TJ: the muted low-opacity version was too subtle to
   read as "tap for more") - full-strength brand blue in a filled circle, sized to be an
   unmissable tap target rather than a faint typographic hint. */
.chev { flex:0 0 26px; width:26px; height:26px; align-self:center; display:grid; place-items:center; border-radius:50%; background:var(--blue); color:#fff; font-size:17px; font-weight:900; line-height:1; }
.badges { display:flex; gap:6px; flex-wrap:wrap; margin-top:11px; }
.badge { padding:4px 8px; border-radius:999px; background:#eef3fb; color:#50617a; font-size:10px; font-weight:800; text-transform:uppercase; }
.badge.good { color:var(--good); background:#e7f7f0; }
.badge.warn { color:var(--warn); background:#fff4d8; }
.badge.bad { color:var(--bad); background:#fff0ef; }
.badge.top { color:#7a4b00; background:#fff3d6; }
.linkbtn { border:0; background:none; padding:0; font:inherit; color:inherit; text-decoration:underline; text-underline-offset:2px; cursor:pointer; }
.pill.linkbtn { text-decoration:underline; }
.empty,.panel { padding:20px; background:#fff; border:1px solid var(--line); border-radius:17px; }
.empty { text-align:center; color:var(--muted); }
.detail h2 { margin:7px 0 2px; font-size:24px; }
.back { border:0; background:none; color:var(--blue); padding:4px 0 10px; font-weight:750; }
.match-box { display:flex; align-items:center; gap:14px; margin:15px 0; padding:15px; border-radius:17px; background:#eaf7f1; }
.match-big { font-size:30px; font-weight:900; color:var(--good); }
ul { padding-left:21px; }
.description { white-space:pre-wrap; max-height:330px; overflow:auto; }
.action-grid { display:grid; grid-template-columns:1fr 1fr; gap:9px; margin-top:13px; }
/* The job-detail screen's own action buttons (added 22/08/2026, TJ: "should be like view job
   description button but better looking") - a REAL layout bug this replaces: those buttons
   had no width of their own and were relying on .action-grid's 2-column grid to lay them out,
   squeezing every one of them - including the primary call-to-action - to half-width, unlike
   the deliberately full-width "View job description" button right above them. flex-column's
   default align-items:stretch fills each button to the container's width with no per-button
   style needed, and reads as one deliberate stack instead of a mismatched grid. */
.action-stack { display:flex; flex-direction:column; gap:10px; margin-top:13px; }
.action-stack .btn { width:100%; }
.action-stack details.add-job { width:100%; }
.action-stack details.add-job .action-stack { margin-top:10px; }
.btn { display:inline-flex; align-items:center; justify-content:center; min-height:48px; border:0; border-radius:13px; padding:12px 14px; font-weight:800; text-decoration:none; }
.btn.primary { color:#fff; background:linear-gradient(135deg,var(--blue),var(--violet)); }
.btn.secondary { color:#24446f; background:#e9f0fb; }
.btn.danger { color:var(--bad); background:#fff0ef; }
.btn:disabled { opacity:.5; }
.field { display:block; margin:0 0 14px; }
.field span { display:block; margin-bottom:6px; font-weight:750; }
.field input,.field select { width:100%; min-height:48px; padding:11px; border:1px solid #cbd6e5; border-radius:12px; background:#fff; }
.add-job > summary { cursor:pointer; color:var(--blue); }
.add-job[open] > summary { margin-bottom:14px; }
.auth { min-height:100%; padding:calc(var(--safe-top) + 44px) 20px 30px; background:linear-gradient(160deg,var(--navy),#163d7c); color:#fff; }
.auth-card { margin-top:36px; padding:22px; border-radius:20px; background:#fff; color:var(--ink); box-shadow:0 18px 50px #0003; }
.auth-card h2 { margin-top:0; }
.error { padding:11px; border-radius:11px; background:#fff0ef; color:var(--bad); }
.nav { position:fixed; z-index:20; bottom:0; left:50%; transform:translateX(-50%); display:grid; grid-template-columns:repeat(5,1fr); width:min(540px,100%); padding:7px 8px calc(7px + var(--safe-bottom)); background:#ffffffed; border-top:1px solid var(--line); backdrop-filter:blur(15px); }
.nav button { border:0; background:none; color:var(--muted); padding:7px 2px; font-size:11px; font-weight:750; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.nav button.on { color:var(--blue); }
.nav b { display:block; font-size:19px; }
.history { padding:12px 0; border-bottom:1px solid var(--line); }
.toast { position:fixed; z-index:100; left:50%; bottom:calc(82px + var(--safe-bottom)); transform:translate(-50%,20px); width:min(440px,calc(100% - 28px)); padding:13px 16px; border-radius:13px; background:#12223b; color:#fff; opacity:0; pointer-events:none; transition:.2s; }
.toast.show { opacity:1; transform:translate(-50%,0); }
.spinner { width:30px; height:30px; margin:28px auto; border:3px solid #d8e2f1; border-top-color:var(--blue); border-radius:50%; animation:spin .7s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.ovlog { max-height:120px; overflow-y:auto; margin:12px 0 0; padding:10px 12px; border-radius:10px; background:#f6f8fb; text-align:left; font-size:12px; color:var(--muted); line-height:1.5; }
.pill { display:inline-block; font-size:13px; font-weight:750; border-radius:999px; padding:5px 12px; background:#eef3fb; color:#50617a; max-width:100%; overflow-wrap:anywhere; text-align:left; }
.pill.ok { background:#e7f7f0; color:var(--good); }
.plainhead { margin:0 0 6px; }
/* Sized back up 22/08/2026 (TJ: the compact version read as too quiet) - still plain text,
   no card/gradient/padding, so it stays cheap on vertical space; the weight and colour do
   the work of standing out instead. */
.plainhead h1 { margin:0; font-size:27px; font-weight:800; color:var(--ink); }
.plainhead p { margin:3px 0 0; color:var(--muted); font-size:13px; }
.legal { margin-top:18px; color:var(--muted); font-size:11px; text-align:center; }
.legal a { color:inherit; }
.notice { margin-top:12px; padding:11px; border-radius:12px; color:#754c00; background:#fff4d8; font-size:12px; }
details + hr { border:0; border-top:1px solid var(--line); }
summary { padding:6px 0; cursor:pointer; }
.muted { color:var(--muted); }
.overlay { position:fixed; inset:0; z-index:200; display:grid; place-items:center; padding:24px; background:rgba(8,20,40,.66); backdrop-filter:blur(4px); }
.overlay-card { width:min(360px,100%); padding:24px 22px 26px; text-align:center; background:#fff; color:var(--ink); border-radius:20px; box-shadow:0 22px 60px #0006; }
.overlay-card p { margin:6px 0 0; font-weight:750; }
.overlay-card p.small { font-weight:500; }
/* ---- search filters + before/after diff ---- */
.note { margin:0 0 14px; padding:10px 12px; border-radius:12px; font-size:12px; background:#eef3fb; color:#50617a; }
.note.ok { background:#e7f7f0; color:var(--good); }
.note.warn { background:#fff4d8; color:#754c00; }
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.checks { display:flex; flex-wrap:wrap; gap:8px; }
.checks label { display:inline-flex; align-items:center; gap:6px; padding:9px 12px; border:1px solid var(--line); border-radius:999px; background:#fff; font-size:13px; font-weight:650; text-transform:capitalize; }
.checks input { width:17px; height:17px; }
.sheet { position:fixed; inset:0; z-index:250; display:flex; flex-direction:column; background:var(--bg); }
.sheet-head { position:sticky; top:0; display:flex; align-items:center; gap:10px; padding:calc(var(--safe-top) + 12px) 16px 12px; color:#fff; background:linear-gradient(145deg,#0e7490,#0891b2); }
.sheet-head h2 { margin:0; font-size:17px; flex:1; }
.sheet-head button { border:0; background:#ffffff26; color:#fff; border-radius:10px; padding:9px 14px; font-weight:800; }
.sheet-body { flex:1; overflow:auto; padding:16px 14px calc(24px + var(--safe-bottom)); }
.dstats { margin:0 0 12px; color:var(--muted); font-size:13px; }
.tpo { display:block; padding:11px 2px; border-bottom:1px solid var(--line); font-size:14px; cursor:pointer; }
.tpo:last-child { border-bottom:0; }
.tpo input { margin-right:9px; vertical-align:middle; width:18px; height:18px; }
.panel h3 { margin:0 0 6px; font-size:14px; }
.dblock { margin:0 0 12px; padding:13px; background:#fff; border:1px solid var(--line); border-radius:14px; }
.dlabel { margin:9px 0 3px; font-size:10px; font-weight:800; letter-spacing:.5px; text-transform:uppercase; color:var(--muted); }
.dlabel:first-child { margin-top:0; }
.dtext { white-space:pre-wrap; overflow-wrap:anywhere; font-size:14px; line-height:1.5; }
mark.ins { background:#dcfce7; color:#166534; border-radius:3px; padding:0 1px; }
mark.del { background:#fee2e2; color:#991b1b; border-radius:3px; padding:0 1px; text-decoration:line-through; }
@media (min-width:541px) { .nav { border-left:1px solid var(--line); border-right:1px solid var(--line); } }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation-duration:.01ms!important; animation-iteration-count:1!important; transition-duration:.01ms!important; } }
.credits { color:#fff; }
.start-card { margin-bottom:12px; }
.startstep { display:flex; align-items:center; gap:10px; width:100%; text-align:left; background:#fff; border:1px solid var(--line, #e2e8f0); border-radius:10px; padding:10px 12px; margin-top:7px; font:inherit; font-size:14px; cursor:pointer; }
.startstep b { flex:0 0 26px; width:26px; height:26px; border-radius:8px; display:grid; place-items:center; background:linear-gradient(100deg,#0891b2,#0e7490); color:#fff; font-size:13px; }
.startstep.done { opacity:.62; }
.startstep.done b { background:#0f9d58; }
.splash { min-height:88vh; display:grid; place-content:center; justify-items:center; gap:14px; text-align:center; }
.splash h1 { font-size:22px; margin:0; }

/* In-app Word document preview (docx-preview), so "View résumé" shows the real document
   without handing the person off to an external app to open it (TJ, 22/08/2026). Mirrors
   app.html's own .docview* rules - same library, same reasons, mobile-scaled by JS via
   .zoom instead of a fixed desktop canvas. */
.docprev { margin-top:2px; overflow-x:auto; -webkit-overflow-scrolling:touch; border-radius:12px; background:#525a68; }
.docprev .docx-wrapper { background:#525a68; padding:16px 10px; display:flex; flex-direction:column; align-items:center; gap:14px; }
.docprev .docx-wrapper>section.docx { box-shadow:0 4px 22px #00000066; background:#fff; margin:0; }
/* UNDO the app's own global rules inside the rendered document - Word computes every width
   as content-box and expects paragraphs/images to be exactly what the document says; this
   app's *{box-sizing:border-box} would otherwise silently shrink table cells and pictures. */
.docprev .docx-wrapper,
.docprev .docx-wrapper * { box-sizing:content-box; }
.docprev .docx-wrapper p { max-width:none; }
.docprev .docx-wrapper img { max-width:none; }
.docprev .docx-wrapper table { max-width:none; border-collapse:collapse; }

/* Dark mode: follows the phone's system setting - there is no in-app toggle, matching
   how the phone's other apps behave. The custom properties carry most of the UI; the
   handful of rules below hardcode #fff/near-white surfaces that the variables don't
   reach, so they get an explicit dark-surface override too. */
@media (prefers-color-scheme: dark) {
  :root {
    --navy:#0a1526; --blue:#22b8cf; --violet:#2dd4bf; --bg:#0b1526;
    --card:#141f33; --ink:#e7edf7; --muted:#94a3bb; --line:#26344d;
    --good:#34d399; --warn:#fbbf24; --bad:#f87171;
  }
  .chip,.icon-btn,.job,.empty,.panel,.field input,.field select,.checks label,
  .dblock,.overlay-card,.auth-card { background:var(--card); color:var(--ink); }
  .tabbar { background:#060b16; }
  .field input,.field select { border-color:var(--line); }
  .badge { background:#1c2a42; color:#aebfd8; }
  .badge.good { background:#0f3d2c; }
  .badge.warn { background:#4a3a0c; }
  .badge.bad { background:#4a1f1c; }
  .badge.top { color:#f0d089; background:#4a3a0c; }
  .pill { background:#1c2a42; color:#aebfd8; }
  .pill.ok { background:#0f3d2c; }
  .ovlog { background:#1c2a42; }
  .match-box { background:#0f3d2c; }
  .btn.secondary { background:#1c2a42; color:var(--ink); }
  .btn.danger { background:#4a1f1c; }
  .error { background:#4a1f1c; }
  .note { background:#1c2a42; color:#aebfd8; }
  .note.ok { background:#0f3d2c; }
  .note.warn { background:#4a3a0c; color:#f3d98a; }
  .notice { background:#4a3a0c; color:#f3d98a; }
  .nav { background:#0b1526ed; }
  mark.ins { background:#0f3d2c; color:#6ee7b7; }
  mark.del { background:#4a1f1c; color:#fca5a5; }
}
