:root {
  --bg: #f4f3ef; --card: #fff; --ink: #143d33; --text: #1d2422; --muted: #6b7570; --line: #e3e1da;
  --mint: #7fe0b5; --green: #1f8a5b; --amber: #c58b14; --red: #c2453b; --blue: #2d6cdf;
  --radius: 10px; --shadow: 0 1px 2px rgba(20,40,30,.06), 0 2px 8px rgba(20,40,30,.04);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.45; }
a { color: var(--ink); }
h2 { font-size: 16px; margin: 0 0 6px; }
h3 { font-size: 15px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.err { color: var(--red); min-height: 1em; margin: 6px 0 0; }

/* header */
.top { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; padding: 10px 24px;
  background: var(--card); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; color: var(--ink); letter-spacing: -.01em; }
nav { display: flex; gap: 2px; }
nav button { border: 0; background: none; padding: 8px 12px; border-radius: 8px; font: inherit; color: var(--muted); cursor: pointer; font-weight: 500; }
nav button:hover { background: var(--bg); color: var(--text); }
nav button.on { background: var(--ink); color: #fff; }
nav b { font-weight: 600; margin-left: 4px; font-size: 12px; opacity: .8; }
nav b:empty { display: none; }
.runbox { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.runmeta { font-size: 12px; color: var(--muted); text-align: right; }
.runmeta .live { color: var(--green); font-weight: 500; }
.runmeta .live::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  margin-right: 6px; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .25; } }

main { max-width: 1240px; margin: 0 auto; padding: 18px 24px 80px; }
.tab { display: none; }
.tab.on { display: block; }

/* controls */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 8px; padding: 7px 12px; font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #c9c6bc; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #0e2d25; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.sm { padding: 4px 9px; font-size: 13px; }
.link { border: 0; background: none; color: var(--muted); font: inherit; cursor: pointer; text-decoration: underline; padding: 0; }
input, select, textarea { font: inherit; color: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: var(--card); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--mint); border-color: var(--ink); }
input[type=checkbox] { width: auto; accent-color: var(--ink); }
input[type=range] { padding: 0; border: 0; accent-color: var(--ink); width: 110px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.end { justify-content: flex-end; }
.stack { display: flex; flex-direction: column; gap: 8px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--card); padding: 10px; border-radius: var(--radius);
  box-shadow: var(--shadow); }
.filters #f-q { flex: 1 1 260px; }
.filters select { width: auto; }
.chk { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--muted); }
.score-filter { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); white-space: nowrap; }
.score-filter output { min-width: 22px; color: var(--text); font-weight: 600; }
.listbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 14px 2px 8px; color: var(--muted); font-size: 13px; }
.listbar > span:last-child { display: flex; gap: 8px; }

/* job rows */
.list { display: flex; flex-direction: column; gap: 6px; }
.job { display: grid; grid-template-columns: 52px 1fr auto; gap: 14px; align-items: start; background: var(--card); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: var(--shadow); border: 1px solid transparent; cursor: pointer; transition: border-color .12s; }
.job:hover { border-color: #d6d3c9; }
.job.dim { opacity: .6; }
.score { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 15px;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), #ecebe5 0); position: relative; }
.score::before { content: ""; position: absolute; inset: 4px; background: var(--card); border-radius: 50%; }
.score span { position: relative; }
.job .t { font-weight: 600; font-size: 15px; color: var(--text); text-decoration: none; }
.job .t:hover { text-decoration: underline; }
.job .meta { color: var(--muted); font-size: 13px; margin-top: 2px; display: flex; flex-wrap: wrap; gap: 0 10px; }
.job .meta .co { color: var(--text); font-weight: 500; }
.job .meta .pay { color: var(--green); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.chip { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: #eef7f2; color: #1d6b48; white-space: nowrap; }
.chip.no { background: #f5f3ee; color: #8a8d86; }
.chip.warn { background: #fdf0ec; color: var(--red); }
.src { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; color: var(--muted); background: #f0eee8;
  padding: 1px 6px; border-radius: 4px; }
.actions { display: flex; gap: 4px; }
.ico { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); cursor: pointer;
  display: grid; place-items: center; color: var(--muted); font-size: 15px; }
.ico:hover { color: var(--ink); border-color: var(--ink); }
.ico.save:hover { color: var(--amber); border-color: var(--amber); }
.ico.x:hover { color: var(--red); border-color: var(--red); }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); background: var(--card); border-radius: var(--radius); }

/* board */
.board { display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: 10px; align-items: start; overflow-x: auto; }
.col { background: #ebe9e3; border-radius: var(--radius); padding: 8px; min-height: 300px; }
.col.over { outline: 2px dashed var(--ink); }
.col h4 { margin: 2px 4px 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; justify-content: space-between; }
.card { background: var(--card); border-radius: 8px; padding: 9px 10px; margin-bottom: 6px; box-shadow: var(--shadow); cursor: grab; font-size: 13px; }
.card .t { font-weight: 600; font-size: 13.5px; }
.card .m { color: var(--muted); margin-top: 2px; }
.card .d { color: var(--muted); font-size: 12px; margin-top: 5px; display: flex; justify-content: space-between; }
.card .due { color: var(--amber); font-weight: 500; }
.card .due.late { color: var(--red); }

/* panels / tables */
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 12px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 8px; border-bottom: 1px solid #f0eee8; vertical-align: top; }
.badge { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 4px; background: #e7f0fb; color: var(--blue); text-transform: capitalize; }
.badge.err { background: #fdf0ec; color: var(--red); }
.sample { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* criteria form */
.cfg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.field .hint { font-size: 12px; color: var(--muted); margin: 3px 0 0; }
.field textarea { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; }
.inline { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.weights { display: grid; grid-template-columns: 90px 1fr 30px; gap: 6px 10px; align-items: center; font-size: 13px; }
.weights input { width: 100%; }
.boards { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.savebar { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; display: flex; justify-content: flex-end; gap: 10px; align-items: center; }
.secret { display: inline-flex; gap: 6px; align-items: center; margin-right: 14px; font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #cfccc3; }
.dot.on { background: var(--green); }

/* drawer */
.scrim { position: fixed; inset: 0; background: rgba(15,25,20,.25); opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 20; }
.scrim.on { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100vw); background: var(--card); z-index: 21;
  transform: translateX(100%); transition: transform .18s ease; box-shadow: -8px 0 30px rgba(0,0,0,.08); overflow-y: auto; }
.drawer.on { transform: none; }
.drawer-inner { padding: 22px 26px 40px; }
.drawer h2 { font-size: 20px; letter-spacing: -.01em; padding-right: 70px; }
.drawer .desc { white-space: pre-wrap; font-size: 13.5px; line-height: 1.55; border-top: 1px solid var(--line); margin-top: 16px; padding-top: 16px; }
.drawer .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.drawer label { font-size: 12px; font-weight: 600; color: var(--muted); display: block; margin-bottom: 3px; }
.close { position: absolute; top: 14px; right: 16px; }

dialog { border: 0; border-radius: 12px; padding: 20px; width: min(460px, 92vw); box-shadow: 0 10px 40px rgba(0,0,0,.2); }
dialog::backdrop { background: rgba(15,25,20,.3); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 9px 16px;
  border-radius: 8px; opacity: 0; transition: all .2s; pointer-events: none; z-index: 40; font-weight: 500; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.act { display: flex; align-items: center; gap: 14px; padding: 7px 8px 7px 16px; }
.toast.act.on { pointer-events: auto; }
.toast-undo { border: 0; background: rgba(255,255,255,.14); color: var(--mint); font: inherit; font-weight: 700; padding: 6px 12px;
  border-radius: 6px; cursor: pointer; }
.toast-undo:hover { background: rgba(255,255,255,.22); }

/* criteria sections */
.cfg-sec { margin-bottom: 28px; }
.sec-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 0 2px 10px; }
.sec-head h2 { font-size: 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sec-head p { margin: 4px 0 0; }
.sec-head .btns { display: flex; gap: 8px; flex-shrink: 0; }
.when { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; letter-spacing: .01em; }
.when.next { background: #e7f0fb; color: var(--blue); }
.when.now { background: #eef7f2; color: #1d6b48; }
.unsaved { display: none; font-size: 11.5px; font-weight: 600; color: var(--amber); }
.cfg-sec.dirty .unsaved { display: inline; }
.panel h3 { font-size: 14px; margin-bottom: 10px; }
.cfg-sec .cfg-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* duplicates + live updates */
.chip.dupchip { background: #fbf3e2; color: #8a5d00; }
.dupbox { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: #fbf3e2; font-size: 13px; }
.new-banner { color: var(--green); font-weight: 600; text-decoration: none; margin-left: 8px; }
.new-banner:hover { text-decoration: underline; }

/* stop button */
.btn.primary.stop { background: var(--card); color: var(--red); border-color: var(--red); }
.btn.primary.stop:hover { background: #fdf0ec; }

/* tracker: stages left to right */
.board { display: flex; flex-direction: row; align-items: flex-start; gap: 10px; overflow-x: auto; padding-bottom: 6px;
  scroll-snap-type: x proximity; }
.stage { flex: 1 1 0; min-width: 230px; background: #ebe9e3; border-radius: var(--radius); padding: 8px; scroll-snap-align: start;
  display: flex; flex-direction: column; }
.stage.over { outline: 2px dashed var(--ink); }
.stage-head { margin: 0 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text); display: flex;
  align-items: center; gap: 7px; cursor: pointer; user-select: none; white-space: nowrap; }
.stage-head .n { color: var(--muted); font-weight: 600; margin-left: auto; }
.stage-head .caret { color: var(--muted); font-size: 11px; transition: transform .15s; }
.stage-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.st-saved { background: var(--amber); } .st-applied { background: var(--blue); } .st-interviewing { background: #7a4fd6; }
.st-offer { background: var(--green); } .st-rejected { background: #a7a59d; }
.stage-body { display: flex; flex-direction: column; gap: 7px; margin-top: 9px; min-height: 60px; }
/* collapsed stage: a slim strip with a sideways label */
.stage.closed { flex: 0 0 40px; min-width: 40px; padding: 10px 0; align-items: center; }
.stage.closed .stage-body { display: none; }
.stage.closed .stage-head { writing-mode: vertical-rl; gap: 8px; margin: 0; }
.stage.closed .caret { transform: rotate(-90deg); }
.stage.closed .stage-head .n { margin-left: 0; margin-top: 0; }
/* compact cards */
.stage-body .card { margin: 0; padding: 8px 10px; font-size: 13px; border-radius: 7px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.stage-body .card:hover { box-shadow: 0 1px 4px rgba(0,0,0,.14); }
.stage-body .card .t { font-size: 14px; line-height: 1.35; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; }
.stage-body .card .m { display: flex; align-items: baseline; gap: 6px; margin-top: 4px; color: var(--muted); }
.stage-body .card .co { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-body .card .co b { font-weight: 500; color: var(--text); }
.stage-body .card .d { flex: none; display: flex; gap: 7px; margin: 0; font-size: 12px; }
.stage-body .card .sc { font-weight: 600; font-variant-numeric: tabular-nums; }
.stage-body .card .tag { font-size: 10px; padding: 0 4px; }
.stage-empty { color: var(--muted); font-size: 12px; padding: 14px 4px; border: 1px dashed #cfccc3; border-radius: 6px; text-align: center; }

/* ---------- desktop defaults for mobile-only bits ---------- */
nav i { display: none; }
.searchrow { display: contents; }
.more-filters { display: contents; }
.f-toggle, .ico .lbl, .card .move { display: none; }
.job[data-swipe="right"] { box-shadow: inset 6px 0 0 var(--green), var(--shadow); }
.job[data-swipe="left"] { box-shadow: inset -6px 0 0 var(--red), var(--shadow); }
html { -webkit-text-size-adjust: 100%; }

/* touch screens: show the "move to" menu on tracker cards (drag & drop doesn't work with fingers) */
@media (hover: none) {
  .card .move { display: block; width: 100%; margin-top: 5px; padding: 3px 6px; font-size: 12px; background: var(--bg); }
  .card { cursor: pointer; }
}

/* ---------- phones & small tablets ---------- */
@media (max-width: 760px) {
  body { overflow-x: hidden; }
  input, select, textarea { font-size: 16px; }            /* stops iOS zooming into fields */

  /* header: brand + run button; live status as a slim strip */
  .top { flex-wrap: wrap; gap: 6px 10px; padding: calc(8px + env(safe-area-inset-top)) 14px 8px; }
  .brand { font-size: 16px; }
  .runbox { gap: 8px; }
  .runmeta { display: none; }
  .top:has(.runmeta .live) .runmeta { display: block; order: 4; width: 100%; text-align: left; font-size: 12.5px;
    margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .runbox:has(.live) { display: contents; }
  #run-now { padding: 7px 12px; }

  /* bottom tab bar */
  nav#tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: grid; grid-template-columns: repeat(6, 1fr);
    gap: 0; background: var(--card); border-top: 1px solid var(--line); padding: 4px 2px calc(4px + env(safe-area-inset-bottom)); }
  nav#tabs button { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 0 4px; border-radius: 10px;
    font-size: 10.5px; font-weight: 500; position: relative; min-height: 50px; }
  nav#tabs button.on { background: none; color: var(--ink); font-weight: 650; }
  nav#tabs button.on i { background: #e3efe9; }
  nav i { display: grid; place-items: center; width: 44px; height: 28px; border-radius: 14px; }
  nav#tabs b { position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; background: var(--ink); color: #fff; font-size: 10px;
    min-width: 17px; height: 17px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; opacity: 1; }
  nav#tabs b:empty { display: none; }
  main { padding: 10px 10px calc(84px + env(safe-area-inset-bottom)); }

  /* inbox filters collapse behind a button */
  .filters { padding: 8px; gap: 8px; }
  .searchrow { display: flex; gap: 8px; width: 100%; }
  .searchrow input { flex: 1; min-width: 0; }
  .f-toggle { display: inline-flex; }
  .more-filters { display: none; }
  .filters.open .more-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; align-items: center; }
  .more-filters select { width: 100%; }
  .score-filter { grid-column: 1 / -1; }
  .score-filter input { flex: 1; width: auto; }
  .listbar { margin: 10px 4px 8px; flex-wrap: wrap; }

  /* job cards */
  .job { grid-template-columns: 40px minmax(0, 1fr); gap: 4px 10px; padding: 12px; touch-action: pan-y; }
  .job > div { min-width: 0; }
  .score { width: 38px; height: 38px; font-size: 13.5px; }
  .job .t { font-size: 15px; line-height: 1.3; display: block; }
  .job .meta { font-size: 12.5px; }
  .chip { white-space: normal; }
  .job .chips .chip:nth-child(n+4) { display: none; }      /* full list is in the detail view */
  .job .actions { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
  .job .actions:has(.btn) { grid-template-columns: 2fr 1fr; }
  .ico { width: auto; height: 40px; gap: 6px; display: flex; align-items: center; justify-content: center; font-size: 14px; }
  .ico .lbl { display: inline; font-size: 13px; font-weight: 500; }
  .actions .btn.sm { height: 40px; justify-content: center; font-size: 14px; }

  /* detail view: full screen */
  .drawer { width: 100vw; }
  .drawer-inner { padding: calc(54px + env(safe-area-inset-top)) 16px calc(30px + env(safe-area-inset-bottom)); }
  .drawer .close { position: fixed; top: calc(10px + env(safe-area-inset-top)); right: 12px; z-index: 2; padding: 8px 14px; }
  .drawer h2 { font-size: 18px; padding-right: 0; }
  .drawer .grid2 { grid-template-columns: 1fr; }
  .drawer .row.end .btn { flex: 1; justify-content: center; height: 44px; }

  /* tracker */
  .stage { flex: 0 0 82vw; min-width: 0; }
  .stage.closed { flex: 0 0 40px; }
  .stage-head { min-height: 30px; }
  .board { scroll-snap-type: x mandatory; margin: 0 -10px; padding: 0 10px 6px; scroll-padding: 0 10px; }
  #tracker .listbar > span:first-child { display: none; }
  #tracker .listbar { justify-content: flex-end; }

  /* tables become stacked cards */
  .tbl, .tbl tbody { display: block; }
  .tbl tr:first-child:has(th) { display: none; }
  .tbl tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
  .tbl td { display: block; padding: 0; border: 0; max-width: none !important; min-width: 0; overflow-wrap: anywhere; }
  .tbl td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
  .tbl td:first-child, .tbl td.first, .tbl td.acts, .tbl td[data-label="Found"], .tbl td[data-label="Errors"] { grid-column: 1 / -1; }
  .tbl td.first { font-weight: 600; }
  .tbl td.empty-cell { display: none; }
  .tbl td.acts { display: flex; gap: 8px; }
  .tbl td.acts .btn { flex: 1; justify-content: center; height: 38px; }
  #co-form { flex-direction: column; align-items: stretch; }
  #co-form input { max-width: none !important; }
  #runs .listbar > span:first-child { display: none; }

  /* criteria */
  .sec-head { flex-direction: column; align-items: stretch; }
  .sec-head .btns { width: 100%; }
  .sec-head .btns .btn { flex: 1; justify-content: center; height: 42px; }
  .cfg-sec .cfg-grid { grid-template-columns: 1fr; }
  .panel { padding: 14px; }
  .row:has(> .field) { flex-direction: column; align-items: stretch; gap: 0; }
  .weights { grid-template-columns: 84px 1fr 26px; }

  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
  dialog { width: 94vw; }
}

/* login */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 28px 24px; width: min(340px, 100%);
  display: flex; flex-direction: column; gap: 12px; align-items: stretch; text-align: center; }
.login-card img { border-radius: 14px; margin: 0 auto; }
.login-card h2 { font-size: 20px; margin: 0 0 4px; }
.login-card input { font-size: 16px; padding: 11px 12px; }
.login-card .btn { justify-content: center; height: 44px; font-size: 15px; }
.login-card .err { margin: 0; }

/* companies board */
.co-intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin: 4px 2px 14px; }
.co-intro h2 { font-size: 18px; }
.co-intro p { margin: 4px 0 0; max-width: 720px; }
#fc-form { min-width: 340px; }
/* three equal columns whose width never depends on what's in them (search results, long names, empty lists) */
.co-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.co-board > .co-col { min-width: 0; }
.co-col { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; border: 2px solid transparent; }
.co-col.over { border-color: var(--ink); border-style: dashed; }
.co-col header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.co-col h3 { margin: 0; font-size: 14px; display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.co-col h3 .n { color: var(--muted); font-weight: 600; }
.co-col .co-search { flex: 1 1 120px; min-width: 0; max-width: 220px; padding: 5px 9px; font-size: 13px; }
.co-col header { flex-wrap: wrap; }
.dot-f, .dot-d, .dot-h { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-f { background: var(--amber); } .dot-d { background: var(--blue); } .dot-h { background: #a7a59d; }
.co-hint { font-size: 12px; color: var(--muted); margin: -2px 0 8px; }
.co-cats { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; align-items: center; }
.chipbtn { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 2px 9px; font: inherit; font-size: 12px; cursor: pointer; color: var(--muted); }
.chipbtn.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.co-cats .link { font-size: 12px; margin-left: 4px; }
.co-list { max-height: 62vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding-right: 2px; }
.co-item { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; background: var(--bg); cursor: grab; }
.co-item:hover { background: #ebe9e3; }
.co-item.dragging { opacity: .4; }
.co-main { flex: 1; min-width: 0; }
.co-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-meta { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin-top: 1px; }
.co-meta .jobs { font-size: 12px; color: var(--ink); }
.tag { font-size: 10.5px; padding: 0 6px; border-radius: 4px; background: #e8e6df; color: var(--muted); font-weight: 600; }
.tag.t100 { background: #fbf3e2; color: #8a5d00; }
.co-btns { display: flex; gap: 4px; flex-shrink: 0; }
.co-btns .btn.sm { padding: 3px 8px; font-size: 12px; }
.co-foot { padding: 8px 4px 2px; font-size: 12px; }
.co-empty { font-size: 13px; padding: 12px 4px; text-align: center; border: 1px dashed #cfccc3; border-radius: 8px; }
details.feeds { margin-top: 16px; }
details.feeds summary { cursor: pointer; }
details.feeds[open] summary { margin-bottom: 8px; }

@media (max-width: 1000px) { .co-board { grid-template-columns: repeat(2, minmax(0, 1fr)); } .co-col[data-list="hidden"] { grid-column: 1 / -1; } }
@media (max-width: 760px) {
  .co-intro { flex-direction: column; align-items: stretch; gap: 10px; }
  #fc-form { min-width: 0; }
  .co-board { grid-template-columns: 1fr; }
  .co-list { max-height: 50vh; }
  .co-item { cursor: default; padding: 9px 10px; }
  .co-btns .btn.sm { padding: 7px 10px; font-size: 13px; }
  .co-board > .co-col { min-width: 0; }
  .co-col header { flex-wrap: wrap; }
  .co-col .co-search { max-width: none; flex: 1 1 140px; min-width: 0; }
}

/* ranking panel */
.rank-panel { position: fixed; top: 57px; right: 0; bottom: 0; width: 430px; background: var(--card); border-left: 1px solid var(--line);
  box-shadow: -8px 0 24px rgba(0,0,0,.05); z-index: 12; transform: translateX(100%); transition: transform .18s ease;
  display: flex; flex-direction: column; }
body.rank-open .rank-panel { transform: none; }
body.rank-open main { padding-right: 454px; }
body.rank-open #rank-open { background: var(--ink); color: #fff; border-color: var(--ink); }
.rank-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 14px 18px 10px; border-bottom: 1px solid var(--line); }
.rank-head h2 { font-size: 17px; margin: 0; }
.rank-status { font-size: 12.5px; color: var(--muted); margin-top: 2px; min-height: 1.2em; }
.rank-status.busy { color: var(--blue); } .rank-status.ok { color: var(--green); } .rank-status.err { color: var(--red); }
.rank-status.busy::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--blue);
  margin-right: 6px; animation: pulse 1s infinite; }
.rank-body { overflow-y: auto; padding: 6px 18px 30px; }
.rank-sec { padding: 12px 0; border-bottom: 1px solid #efede7; }
.rank-sec:last-child { border-bottom: 0; }
.rank-sec h3 { font-size: 14px; display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.when.re { background: #f1eefb; color: #6a48c9; }
.rank-panel .weights { grid-template-columns: 140px 1fr 26px; }
.moved-note { margin-bottom: 28px; background: #eef7f2; box-shadow: none; }
.moved-note .link { color: var(--ink); font-weight: 600; }
@media (max-width: 1100px) { body.rank-open main { padding-right: 24px; } }
@media (max-width: 760px) {
  .rank-panel { top: 0; width: 100vw; z-index: 22; padding-top: env(safe-area-inset-top); }
  .rank-head { padding: 14px 16px 10px; }
  .rank-head .btn { height: 38px; padding: 0 16px; }
  .rank-body { padding: 4px 16px calc(30px + env(safe-area-inset-bottom)); }
  .rank-btn { padding: 7px 10px; }
}

/* folded near-duplicates */
.chip.simchip { background: #e9eefb; color: #2c4f9e; cursor: pointer; position: relative; font-weight: 500; }
.sim-pop { display: none; position: absolute; left: 0; top: calc(100% + 6px); z-index: 9; width: min(460px, 80vw); background: var(--card);
  color: var(--text); border-radius: 10px; box-shadow: 0 8px 30px rgba(20,40,30,.18); padding: 10px 12px; white-space: normal; cursor: default; font-weight: 400; }
.sim-pop::before { content: ""; position: absolute; top: -8px; left: 0; right: 0; height: 8px; }   /* hover bridge */
.sim-pop > b { display: block; font-size: 12.5px; margin-bottom: 4px; }
@media (hover: hover) { .simchip:hover .sim-pop, .simchip:focus-within .sim-pop { display: block; } }
.simchip.open .sim-pop { display: block; }
.sim { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid #efede7; }
.sim:first-of-type { border-top: 0; }
.sim-main { flex: 1; min-width: 0; }
.sim-main a { font-weight: 600; font-size: 13px; color: var(--text); text-decoration: none; }
.sim-main a:hover { text-decoration: underline; }
.sim-meta { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 3px 6px; align-items: center; margin-top: 1px; }
.sim .btn.sm { flex-shrink: 0; font-size: 12px; padding: 3px 8px; }
.simbox { margin-top: 14px; padding: 10px 12px; border-radius: 8px; background: #eef2fb; font-size: 13px; }
.simbox .sim { border-top-color: #dde4f3; }
@media (max-width: 760px) {
  .job .chips .chip.simchip { display: inline-flex !important; }   /* never hidden by the 3-chip limit */
  .sim-pop { position: fixed; left: 10px; right: 10px; top: auto; bottom: calc(80px + env(safe-area-inset-bottom)); width: auto; max-height: 60vh; overflow-y: auto; }
  .sim { flex-wrap: wrap; }
  .sim .btn.sm { padding: 7px 10px; }
}

/* title keyword counts */
.kw-counts { display: flex; flex-wrap: wrap; gap: 4px 6px; font-size: 12px; margin: -4px 0 10px; align-items: center; }
.kwc { background: #eef7f2; color: #1d6b48; padding: 1px 8px; border-radius: 999px; }
.kwc.zero { background: #fdf0ec; color: var(--red); }
#kw-filter-note { margin: -6px 0 12px; font-size: 12px; color: var(--muted); }

/* job detail actions */
.d-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.d-actions .btn.on { background: #eef7f2; border-color: var(--green); color: #1d6b48; }
.d-actions .btn[data-st="dismissed"].on { background: #fdf0ec; border-color: var(--red); color: var(--red); }
.d-actions .btn.follow.on { background: #fbf3e2; border-color: var(--amber); color: #8a5d00; }
.d-actions .btn.follow { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.d-actions .btn.follow.on:hover::after { content: " · unfollow"; font-weight: 400; }
@media (max-width: 760px) {
  .d-actions { display: grid; grid-template-columns: repeat(3, 1fr); }
  .d-actions .btn { justify-content: center; height: 42px; }
  .d-actions .btn.follow { grid-column: 1 / -1; }
}

/* industries */
.ind-group { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 10px 0 4px; }
.ind-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 3px 0; font-size: 13px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; flex-shrink: 0; }
.seg label { cursor: pointer; }
.seg input { display: none; }
.seg span { display: block; padding: 3px 9px; font-size: 12px; color: var(--muted); border-left: 1px solid var(--line); }
.seg label:first-child span { border-left: 0; }
.seg input:checked + span { background: var(--ink); color: #fff; }
.seg label:nth-child(2) input:checked + span { background: #5f8a78; }
.seg label:nth-child(3) input:checked + span { background: #e8e6df; color: var(--text); }
.d-industry { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 12px; font-size: 13px; }
.d-industry select { width: auto; max-width: 100%; padding: 4px 8px; font-size: 13px; }
.ind-desc { flex-basis: 100%; color: var(--muted); font-size: 12.5px; }
.co-ind { width: auto; max-width: 190px; padding: 0 4px; font-size: 11.5px; height: 20px; border-radius: 5px; background: #e9eefb; color: #2c4f9e; border-color: transparent; }
.co-ind.unset { background: #f5f3ee; color: var(--muted); }
.co-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; margin-bottom: 6px; }
@media (max-width: 760px) { .ind-row { font-size: 14px; } .seg span { padding: 6px 10px; font-size: 13px; } .co-ind { height: 28px; font-size: 13px; max-width: 220px; } }

.chipbtn.none { border-style: dashed; }
.cat-acts { font-size: 12px; margin-left: 4px; color: var(--muted); }
.cat-acts .link { font-size: 12px; }

/* company jobs popover */
.jobs-pop { position: fixed; z-index: 19; width: 390px; max-width: calc(100vw - 16px); max-height: 60vh; overflow-y: auto;
  background: var(--card); border-radius: 10px; box-shadow: 0 8px 30px rgba(20,40,30,.2); padding: 10px; font-size: 13px; }
.jobs-pop > b { display: block; padding: 0 4px 6px; }
.jp-row { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; background: none; font: inherit;
  padding: 7px 6px; border-radius: 7px; cursor: pointer; color: var(--text); }
.jp-row:hover { background: var(--bg); }
.jp-score { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; border: 2.5px solid var(--c); display: grid; place-items: center;
  font-weight: 700; font-size: 12px; }
.jp-main { min-width: 0; display: flex; flex-direction: column; }
.jp-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jp-meta { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jp-all { display: block; margin: 6px 6px 2px; font-size: 12.5px; }
@media (max-width: 760px) { .jobs-pop { left: 8px !important; right: 8px; width: auto; } .jp-row { padding: 10px 6px; } }

/* add by URL */
.url-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--card); padding: 10px; border-radius: var(--radius); box-shadow: var(--shadow); }
.url-add input { flex: 1 1 360px; }
.url-status { flex-basis: 100%; font-size: 12.5px; color: var(--muted); }
.url-status:empty { display: none; }
.url-status.busy { color: var(--blue); } .url-status.ok { color: var(--green); } .url-status.err { color: var(--red); }
.tag.manual-tag { background: #ece8f7; color: #5b43a8; vertical-align: 1px; }
@media (max-width: 760px) { .url-add input { flex-basis: 100%; } .url-add .btn { flex: 1; justify-content: center; height: 42px; } }

/* edit job details */
.d-edit { font-size: 13px; font-weight: 500; margin-left: 6px; vertical-align: 2px; color: var(--muted); }
.d-editform { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin-top: 14px; padding: 12px; border-radius: 10px; background: var(--bg); }
.d-editform label { font-size: 12px; font-weight: 600; color: var(--muted); display: flex; flex-direction: column; gap: 3px; margin: 0; }
.d-editform label:first-child { grid-column: 1 / -1; }
.d-editform .row { grid-column: 1 / -1; }
.d-editform[hidden] { display: none; }
@media (max-width: 760px) { .d-editform { grid-template-columns: 1fr; } }

/* ---------- Play mode ---------- */
.play-btn { margin-left: 6px; border: 0; background: var(--ink); color: #fff; font: inherit; font-size: 12.5px; font-weight: 650;
  padding: 5px 11px; border-radius: 999px; cursor: pointer; letter-spacing: .01em; }
.play-btn:hover { background: #0f2f27; }
body.playing { overflow: hidden; }
.play { position: fixed; inset: 0; z-index: 35; background: var(--bg); display: flex; flex-direction: column;
  padding: calc(10px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom)); }
.play[hidden] { display: none; }
.play-top { display: flex; align-items: center; gap: 10px; max-width: 560px; width: 100%; margin: 0 auto; }
.play-count { font-weight: 650; color: var(--ink); }
.play-tally { margin-left: auto; color: var(--muted); font-size: 13px; }
.play-stack { position: relative; flex: 1; min-height: 0; max-width: 560px; width: 100%; margin: 12px auto; }
.pcard { position: absolute; inset: 0; background: var(--card); border-radius: 18px; border: 1px solid var(--line);
  box-shadow: 0 6px 24px rgba(20,40,30,.10); padding: 18px; display: flex; flex-direction: column; align-items: stretch; gap: 10px; overflow: hidden;
  touch-action: pan-y; user-select: none; -webkit-user-select: none; transition: transform .25s ease-out; will-change: transform; }
.pcard.next { transform: scale(.95) translateY(10px); opacity: .7; pointer-events: none; }
.pcard.top { cursor: grab; }
.pc-head { display: flex; gap: 12px; align-items: flex-start; }
.pc-head .score { flex: none; }
.pc-head h2 { font-size: 19px; line-height: 1.25; margin: 0 0 4px; letter-spacing: -.01em; }
.pc-co { font-weight: 600; color: var(--ink); }
.tag.fol { background: #e3efe9; color: var(--green); }
.pc-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 13px; color: var(--muted); }
.pc-meta .pay { color: var(--green); }
.pcard .chips { margin: 0; }
.pc-desc { flex: 1; min-height: 60px; overflow-y: auto; white-space: pre-wrap; font-size: 13.5px; line-height: 1.55;
  border-top: 1px solid var(--line); padding-top: 10px; -webkit-overflow-scrolling: touch; }
.pc-open { align-self: flex-start; }
.pcard * { touch-action: pan-y; }   /* the scrollable description must not claim horizontal swipes */
.stamp { position: absolute; top: 22px; padding: 4px 12px; border: 3px solid; border-radius: 8px; font-weight: 800; font-size: 22px;
  letter-spacing: .06em; opacity: 0; pointer-events: none; z-index: 2; background: rgba(255,255,255,.85); }
.stamp.like { left: 18px; color: var(--green); transform: rotate(-12deg); }
.stamp.nope { right: 18px; color: var(--red); transform: rotate(12deg); }
.play-ctrl { display: flex; justify-content: center; align-items: center; gap: 22px; }
.pbtn { width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); font-size: 26px;
  cursor: pointer; box-shadow: var(--shadow); display: grid; place-items: center; transition: transform .1s; }
.pbtn:active { transform: scale(.92); }
.pbtn.nope { color: var(--red); }
.pbtn.like { color: var(--green); }
.pbtn.undo { width: 48px; height: 48px; font-size: 21px; color: var(--amber); }
.pbtn:disabled { opacity: .35; cursor: default; }
.play-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; }
.play-empty .big { font-size: 44px; }

/* company selection */
.co-pick { flex: none; width: 17px; height: 17px; margin: 0; accent-color: var(--green); cursor: pointer; }
.co-item.picked { background: #e3efe9; box-shadow: inset 0 0 0 1px #b9d6c8; }
.co-selbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-height: 0; margin: 0 0 6px; padding: 0 2px; font-size: 13px; }
.co-selbar:empty { display: none; }
.co-selall { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--muted); font-weight: 500; margin: 0; padding-left: 8px; }
.co-selall input { width: 17px; height: 17px; margin: 0; accent-color: var(--green); }
.co-selcount { font-weight: 650; color: var(--ink); }
.co-selacts { display: inline-flex; gap: 6px; margin-left: auto; }
.btn.warn { color: var(--red); }
@media (max-width: 760px) { .co-pick { width: 20px; height: 20px; } .co-selacts { margin-left: 0; } }

.co-abroad-tog { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin: 0 10px 0 0; cursor: pointer; }
.co-abroad-tog input { accent-color: var(--green); }
.co-meta .abroad { font-size: 12px; margin-left: 6px; }

/* ---------- search everything ---------- */
.gsearch { position: relative; flex: 1 0 100%; display: flex; align-items: center; }
.gsearch .gs-icon { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.gsearch input { width: 100%; padding: 9px 40px 9px 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
  font: inherit; font-size: 14px; color: var(--text); }
.gsearch input:focus { outline: none; border-color: var(--ink); background: var(--card); box-shadow: 0 0 0 3px rgba(20,61,51,.12); }
.gs-kbd { position: absolute; right: 10px; font: 600 11px/1 ui-monospace, monospace; color: var(--muted); border: 1px solid var(--line);
  border-radius: 4px; padding: 3px 6px; background: var(--card); pointer-events: none; }
.gsearch input:focus ~ .gs-kbd, .gsearch input:not(:placeholder-shown) ~ .gs-kbd { display: none; }
.gs-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; max-height: min(70vh, 640px); overflow-y: auto; z-index: 30;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(20,40,30,.16); padding: 6px; }
.gs-h { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 10px 4px; }
.gs-h b { font-weight: 600; margin-left: 4px; }
.gs-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none; font: inherit;
  color: var(--text); padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.gs-item:hover, .gs-item.on { background: var(--bg); }
.gs-score { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700;
  color: var(--c); border: 2px solid var(--c); }
.gs-co { flex: none; width: 32px; text-align: center; font-size: 17px; }
.gs-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gs-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-tag { flex: none; display: flex; flex-direction: column; align-items: flex-end; font-size: 12px; font-weight: 600; color: var(--ink); }
.gs-tag small { font-size: 11px; font-weight: 500; color: var(--muted); }
.gs-tag.gs-st-applied, .gs-tag.gs-st-interviewing, .gs-tag.gs-st-offer { color: var(--green); }
.gs-tag.gs-st-dismissed, .gs-tag.gs-st-rejected, .gs-tag.gs-co-hidden { color: var(--muted); }
.gs-more { justify-content: center; color: var(--ink); font-weight: 600; font-size: 13px; }
.gs-results mark { background: #fbeec2; color: inherit; border-radius: 2px; padding: 0 1px; }
.gs-none { padding: 14px; color: var(--muted); }
@media (max-width: 760px) {
  .gsearch { order: 5; }
  .gsearch input { font-size: 16px; }   /* stops iPhone zooming in on focus */
  .gs-kbd { display: none; }
  .gs-results { max-height: 62vh; }
}

.co-link { color: inherit; font-weight: 600; text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 3px; }
.co-link:hover { color: var(--ink); text-decoration-color: currentColor; }
.co-ic { font-size: .8em; margin-left: 3px; opacity: .7; }
