@font-face { font-family: "Inter"; src: url("../fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #0b0e14;
  --surface: #121722;
  --surface-2: #171e2b;
  --row-hover: #1a2231;
  --border: #1f2734;
  --border-strong: #2a3442;
  --text: #e6e9ef;
  --muted: #8b93a3;
  --faint: #5d6675;
  --accent: #2f6bff;
  --accent-soft: rgba(47, 107, 255, 0.16);
  --accent-text: #6f9bff;
  --green: #22a06b;
  --green-soft: rgba(34, 160, 107, 0.16);
  --red: #d9534f;
  --red-soft: rgba(217, 83, 79, 0.16);
  --amber: #d9a441;
  --amber-soft: rgba(217, 164, 65, 0.16);
  --purple: #8b7cd8;
  --purple-soft: rgba(139, 124, 216, 0.16);
  --radius: 8px;
  --radius-sm: 6px;
  --sidebar: 212px;
  --topbar: 60px;
  --drawer: 460px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* min-height, not height: with a fixed height the body's bottom padding sits at the viewport edge and the
   overflowing content scrolls underneath the fixed bottom navigation on phones */
html, body { min-height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 13.5px/1.45 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
kbd { font: 11px/1 var(--font); color: var(--faint); border: 1px solid var(--border); border-radius: 4px; padding: 2px 5px; }
.ic { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100%; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px;
  padding: 18px 12px; border-right: 1px solid var(--border); background: var(--bg);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 7px;
  background: var(--surface); border: 1px solid var(--border); color: var(--accent-text); font-weight: 700; font-size: 13px;
}
.brand-name { font-weight: 600; font-size: 14px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--muted); font-weight: 500;
}
.nav a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.nav a.active { color: var(--text); background: var(--accent-soft); }
.nav a.active .ic { color: var(--accent-text); }
.tagline { margin-top: auto; padding: 0 10px 6px; color: var(--faint); font-size: 12px; line-height: 1.5; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar); display: flex; align-items: center; gap: 14px;
  padding: 0 24px; background: rgba(11, 14, 20, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.topbar > * { min-width: 0; flex-shrink: 1; }
.topbar .run-control, .topbar .avatar, .topbar .brand-mobile { flex: none; }
.brand-mobile { display: none; padding: 0; }
.bottom-nav { display: none; }
.search {
  flex: 1; max-width: 420px; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--muted);
}
.search:focus-within { border-color: var(--border-strong); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); }
.search input::placeholder { color: var(--faint); }
.search input::-webkit-search-cancel-button { filter: invert(0.6); }
.run-control { margin-left: auto; position: relative; }
.avatar {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--muted);
}
.content { padding: 26px 28px 60px; max-width: 1320px; width: 100%; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 500; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #3f78ff; }
.btn.danger { color: #ff8580; border-color: rgba(217, 83, 79, 0.45); }
.btn.danger:hover { background: var(--red-soft); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--surface); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn .ic { width: 16px; height: 16px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); }

/* ---------- run control ---------- */
.run-btn { min-width: 108px; justify-content: center; }
.run-control { display: flex; align-items: center; gap: 8px; }
.auto-answer-btn { color: var(--muted); }
.auto-answer-btn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.auto-answer-btn.on { color: #4fcf95; border-color: rgba(34, 160, 107, 0.5); background: var(--green-soft); }
.auto-answer-btn .lbl-short { display: none; }
.auto-answer-btn.on .dot { background: var(--green); box-shadow: 0 0 0 3px rgba(34, 160, 107, 0.25); }
.run-btn.running { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.spinner {
  width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent-text);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
.popover {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; width: 380px; max-width: calc(100vw - 32px);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.popover .pop-section { padding: 12px 14px; border-top: 1px solid var(--border); }
.popover .pop-section:first-child { border-top: 0; }
.pop-title { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.mode-btn {
  display: flex; width: 100%; align-items: flex-start; gap: 10px; text-align: left; padding: 10px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: transparent; cursor: pointer;
}
.mode-btn:hover { background: var(--surface-2); border-color: var(--border); }
.mode-btn:disabled { opacity: 0.55; cursor: default; }
.mode-btn .ic { color: var(--accent-text); margin-top: 2px; }
.mode-btn b { display: block; font-weight: 600; }
.mode-btn small { color: var(--muted); }
.run-hist { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow: auto; }
.run-hist-row {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 7px 8px; border-radius: var(--radius-sm); cursor: pointer;
}
.run-hist-row:hover { background: var(--surface-2); }
.run-hist-row .when { font-weight: 500; }
.run-hist-row .counts { grid-column: 1 / -1; color: var(--muted); font-size: 12.5px; }
.run-hist-row .err { grid-column: 1 / -1; color: #ff8580; font-size: 12.5px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap;
}
.pill.blue { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.pill.green { background: var(--green-soft); color: #4fcf95; border-color: transparent; }
.pill.red { background: var(--red-soft); color: #ff8580; border-color: transparent; }
.pill.amber { background: var(--amber-soft); color: #e9bd5e; border-color: transparent; }
.pill.purple { background: var(--purple-soft); color: #b3a7f0; border-color: transparent; }
.pill.grey { background: var(--surface-2); color: var(--muted); }
.pill.solid-blue { background: var(--accent); color: #fff; border-color: transparent; }
.pill.solid-green { background: var(--green); color: #fff; border-color: transparent; }
.pill.solid-red { background: var(--red); color: #fff; border-color: transparent; }

.run-panel { display: flex; flex-direction: column; gap: 10px; }
.run-panel .kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13px; }
.run-panel .kv dt { color: var(--muted); }
.run-panel .kv dd { margin: 0; }
.run-log {
  max-height: 180px; overflow: auto; padding: 8px 10px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 12px; line-height: 1.5; color: var(--muted); white-space: pre-wrap; word-break: break-word;
}
.run-errors { color: #ff8580; font-size: 12.5px; white-space: pre-wrap; }

/* ---------- page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; }
.page-head .sub { color: var(--muted); margin-top: 3px; }
.page-actions { display: flex; align-items: center; gap: 8px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 14px; }
.chip {
  height: 30px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { color: var(--text); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip .n { font-size: 12px; opacity: 0.8; }
.chips .spacer { flex: 1; }
.select {
  height: 30px; padding: 0 28px 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface);
  color: var(--text); appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5' fill='none' stroke='%238b93a3' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 7px center; background-size: 16px;
}
.select.sm { height: 30px; }

/* ---------- tables ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr.row { cursor: pointer; }
.tbl tbody tr.row:hover { background: var(--row-hover); }
.tbl tbody tr.selected { background: var(--accent-soft); }
.tbl .company { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.logo {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; font-size: 12px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); flex: none;
}
.tbl .actions { text-align: right; width: 44px; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); font-weight: 600; margin-bottom: 4px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--border); }
.pager .pages { display: flex; align-items: center; gap: 4px; }
.pager button { min-width: 28px; height: 28px; border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.pager button.cur { border-color: var(--border-strong); color: var(--text); background: var(--surface-2); }
.pager button:disabled { opacity: 0.4; cursor: default; }

/* ---------- menu ---------- */
.menu {
  position: fixed; z-index: 60; min-width: 190px; padding: 6px; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}
.menu button, .menu a {
  display: flex; width: 100%; align-items: center; gap: 8px; padding: 7px 10px; border-radius: var(--radius-sm); border: 0; background: none;
  text-align: left; color: var(--text); cursor: pointer;
}
.menu button:hover, .menu a:hover { background: var(--surface-2); text-decoration: none; }
.menu button.danger { color: #ff8580; }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 5px 0; }
.menu .ic { width: 15px; height: 15px; color: var(--muted); }

/* ---------- drawer ---------- */
.drawer-backdrop { position: fixed; top: var(--topbar); right: 0; bottom: 0; left: 0; z-index: 15; background: rgba(0, 0, 0, 0.35); }
.drawer {
  position: fixed; top: var(--topbar); right: 0; bottom: 0; z-index: 18; width: var(--drawer); max-width: 100vw; display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--border-strong); box-shadow: -12px 0 32px rgba(0, 0, 0, 0.35);
}
.drawer[hidden], .drawer-backdrop[hidden], [hidden] { display: none; }
.drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 18px 12px; border-bottom: 1px solid var(--border); }
.drawer-head .logo { width: 40px; height: 40px; font-size: 15px; border-radius: 9px; }
.drawer-head h2 { font-size: 16px; }
.drawer-head .sub { color: var(--muted); }
.drawer-head .close { margin-left: auto; }
.tabs { display: flex; gap: 2px; padding: 0 12px; border-bottom: 1px solid var(--border); }
.tabs button {
  padding: 10px 10px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-weight: 500; cursor: pointer;
}
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.drawer-body { flex: 1; overflow: auto; padding: 16px 18px 28px; }
.drawer-foot { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 18px; border-top: 1px solid var(--border); }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.section { margin-top: 20px; }
.section h3 { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.desc { max-height: 260px; overflow: auto; padding: 10px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); white-space: pre-wrap; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.doc-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); margin-bottom: 6px;
}
.doc-row .ic { color: #ff8580; }
.doc-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-row.missing .name { color: var(--muted); text-decoration: line-through; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 18px; border-left: 1px solid var(--border); margin-left: 6px; }
.timeline li::before { content: ""; position: absolute; left: -4px; top: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.timeline li:last-child { padding-bottom: 0; }
.timeline .d { color: var(--muted); font-size: 12px; display: block; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 12.5px; }
.fields .k { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shots { display: flex; gap: 8px; flex-wrap: wrap; }
.shots a img { width: 120px; height: 80px; object-fit: cover; object-position: top; border: 1px solid var(--border); border-radius: 6px; }
.note-form { display: flex; flex-direction: column; gap: 8px; }
textarea.input { min-height: 80px; resize: vertical; }
.input {
  width: 100%; height: 34px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
.input:focus { outline: 0; border-color: var(--accent); }
textarea.input { padding: 8px 10px; height: auto; }
.form-row { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.form-row label { color: var(--muted); font-size: 12.5px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qrow { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 6px; font-size: 12.5px; }
.qrow .a { color: var(--muted); }

/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, 0.5); display: grid; place-items: center; padding: 16px; }
.modal { width: 460px; max-width: 100%; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5); }
.modal-head { display: flex; align-items: center; padding: 16px 18px 8px; }
.modal-head h2 { font-size: 16px; }
.modal-head .close { margin-left: auto; }
.modal-body { padding: 8px 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.toast { padding: 10px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border-strong); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); font-size: 13px; }
.toast.error { border-color: rgba(217, 83, 79, 0.6); }
.toast.ok { border-color: rgba(34, 160, 107, 0.6); }

/* ---------- calendar ---------- */
.cal-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-toolbar .title { font-weight: 600; font-size: 15px; min-width: 150px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { height: 30px; padding: 0 12px; border: 0; background: var(--surface); color: var(--muted); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.active { background: var(--accent); color: #fff; }
/* the card supplies the outer frame; cells draw only inner lines, so nothing overshoots the rounded corners */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); overflow: hidden; }
.cal-grid .dow { padding: 8px 10px; font-size: 12px; color: var(--muted); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.cal-cell { min-height: 96px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); min-width: 0; }
.cal-grid .dow:nth-child(7n), .cal-grid .cal-cell:nth-child(7n) { border-right: 0; }
.cal-grid .cal-cell:nth-last-child(-n+7) { border-bottom: 0; }
.cal-cell.other { background: rgba(0, 0, 0, 0.18); color: var(--faint); }
.cal-cell .dn { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.cal-cell.today .dn { color: var(--accent-text); font-weight: 600; }
.cal-cell.other .dn { color: var(--faint); }
.ev {
  display: block; width: 100%; text-align: left; padding: 4px 6px; margin-bottom: 3px; border-radius: 5px; border: 1px solid transparent; cursor: pointer;
  font-size: 12px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--surface-2); color: var(--text);
}
.ev b { font-weight: 600; }
.ev small { display: block; color: inherit; opacity: 0.85; }
.ev.k-interview, .ev.k-recruiter_call { background: var(--accent-soft); color: #cfe0ff; }
.ev.k-technical_interview { background: var(--green-soft); color: #bff0d8; }
.ev.k-assessment, .ev.k-assessment_deadline { background: var(--amber-soft); color: #f1dcac; }
.ev.k-follow_up { background: var(--purple-soft); color: #d8d1f7; }
.ev.k-application_deadline { background: var(--red-soft); color: #ffc3c0; }
.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.week-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-height: 220px; padding: 8px; }
.week-col .dn { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.week-col.today .dn { color: var(--accent-text); font-weight: 600; }
.ev-list .ev { white-space: normal; padding: 8px 10px; margin-bottom: 6px; }
.ev-list .day { margin: 14px 0 6px; font-size: 12px; color: var(--muted); }

/* ---------- analytics ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stat-row { display: grid; grid-template-columns: 1fr 120px 56px 56px; gap: 10px; align-items: center; padding: 8px 14px; border-top: 1px solid var(--border); }
.stat-row:first-of-type { border-top: 0; }
.stat-row .bar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.stat-row .bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.stat-row .n { text-align: right; font-variant-numeric: tabular-nums; }
.stat-head { padding: 12px 14px; display: grid; grid-template-columns: 1fr 120px 56px 56px; gap: 10px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border); }
.card h2.card-title { font-size: 14px; padding: 12px 14px 0; }

/* ---------- settings ---------- */
.settings { display: grid; grid-template-columns: 200px 1fr; gap: 20px; align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: calc(var(--topbar) + 20px); }
.settings-nav button { text-align: left; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--muted); font-weight: 500; cursor: pointer; }
.settings-nav button:hover { color: var(--text); background: var(--surface); }
.settings-nav button.active { color: var(--text); background: var(--accent-soft); }
.settings-panel { padding: 18px 20px 20px; }
.settings-panel h2 { font-size: 16px; margin-bottom: 4px; }
.settings-panel .lead { color: var(--muted); margin-bottom: 14px; }
.field { display: grid; grid-template-columns: 220px 1fr; gap: 6px 18px; padding: 12px 0; border-top: 1px solid var(--border); align-items: start; }
.field:first-of-type { border-top: 0; }
.field .lbl { font-weight: 500; padding-top: 6px; }
.field .help { grid-column: 2; color: var(--muted); font-size: 12.5px; }
.field .ctl { min-width: 0; }
.field .ctl .input { max-width: 380px; }
.field.dirty .lbl::after { content: " •"; color: var(--accent-text); }
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle .track { width: 36px; height: 20px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background 0.15s; flex: none; }
.toggle .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.toggle input:checked + .track { background: var(--accent); }
.toggle input:checked + .track::after { transform: translateX(16px); }
.toggle input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.toggle input:disabled + .track { opacity: 0.4; }
.toggle .t-label { color: var(--muted); font-size: 12.5px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 4px 0 10px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; }
.tag button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px 4px; border-radius: 4px; display: grid; place-items: center; }
.tag button:hover { color: var(--text); background: var(--border); }
.tag button .ic { width: 12px; height: 12px; }
.tags input { height: 26px; min-width: 140px; flex: 1; background: none; border: 0; border-bottom: 1px dashed var(--border-strong); outline: 0; color: var(--text); }
.loc-row { display: grid; grid-template-columns: 1fr 70px auto auto; gap: 8px; align-items: center; margin-bottom: 6px; }
.weights { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 460px; }
.weights label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.checks { display: flex; flex-direction: column; gap: 6px; }
.checks label { display: flex; align-items: center; gap: 8px; }
.savebar { position: sticky; bottom: 16px; display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 10px 14px; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4); }
.savebar .msg { color: var(--muted); flex: 1; }
.rules { margin: 14px 0 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); }
.rules h4 { margin: 0 0 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.rules ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.fact { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.fact:first-child { border-top: 0; }
.fact .f-name { font-weight: 500; min-width: 160px; }
.fact .f-desc { color: var(--muted); flex: 1; font-size: 12.5px; }
.notice { padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg); color: var(--muted); font-size: 12.5px; margin-bottom: 12px; }
.notice.warn { border-color: rgba(217, 164, 65, 0.5); color: #e9bd5e; }
pre.out { margin: 8px 0 0; padding: 8px 10px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--muted); font-size: 12px; white-space: pre-wrap; }

/* ---------- documents ---------- */
.doc-name { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.doc-name .ic { color: #ff8580; }
.doc-name.cv .ic, .doc-name.template .ic { color: var(--accent-text); }
.doc-name.missing { color: var(--muted); }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent-text); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* ---------- connect screen ---------- */
.connect { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; padding: 24px 0; }
.connect-card { width: 100%; max-width: 440px; min-width: 0; padding: 22px 22px 20px; }
.connect-card pre.out { overflow-x: auto; }

/* ---------- mobile ---------- */
.mobile-cards { display: none; }
.cal-cell .dots { display: none; }
@media (max-width: 960px) {
  :root { --drawer: 100vw; --topbar: 56px; }
  html { -webkit-text-size-adjust: 100%; }
  /* App-shell layout: the shell is exactly one screen tall, the middle scrolls, the top bar and the bottom
     navigation are ordinary flex items. iOS moves position:fixed bars on pages too short to scroll; this does not. */
  /* Fixed bottom bar over a normally scrolling document (the layout Michael approved on the Jobs page). iOS only
     places a fixed bar at the true screen edge when the document scrolls, so every page is made scrollable by
     at least a little: the content is never shorter than the viewport. */
  body { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .brand-mobile { display: inline-flex; }
  .topbar { flex: none; padding: 0 12px; padding-top: env(safe-area-inset-top); gap: 10px; height: calc(var(--topbar) + env(safe-area-inset-top)); }
  .search { max-width: none; height: 34px; }
  .search kbd { display: none; }
  .avatar { display: none; }
  .run-btn { min-width: 0; padding: 0 12px; }
  .auto-answer-btn { padding: 0 10px; }
  .auto-answer-btn .lbl { display: none; }
  .auto-answer-btn .lbl-short { display: inline; }
  .content { padding: 16px 12px 24px; min-height: calc(100vh - var(--topbar) - env(safe-area-inset-top) + 1px); min-height: calc(100lvh - var(--topbar) - env(safe-area-inset-top) + 1px); }
  .page-head { margin-bottom: 12px; }
  .page-head h1 { font-size: 20px; }
  .page-actions { width: 100%; flex-wrap: wrap; min-width: 0; }
  .page-actions .btn { flex: 1 1 auto; justify-content: center; white-space: normal; height: auto; min-height: 34px; padding: 6px 12px; text-align: center; }
  .page-actions .select { flex: 1; }
  .chips { gap: 6px; margin-bottom: 10px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; }
  .chips::-webkit-scrollbar { display: none; }
  .chips .spacer { display: none; }
  .chip, .select { flex: none; }
  .two-col, .settings, .form-grid { grid-template-columns: 1fr; }
  .settings { gap: 10px; }
  .settings-nav { position: static; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: 4px; padding-bottom: 4px; scrollbar-width: none; margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; }
  .settings-nav::-webkit-scrollbar { display: none; }
  .settings-nav button { white-space: nowrap; flex: none; background: var(--surface); border: 1px solid var(--border); }
  .settings-nav button.active { border-color: var(--accent); }
  .settings-panel { padding: 14px; }
  .field { grid-template-columns: 1fr; gap: 6px; padding: 12px 0; }
  .field .lbl { padding-top: 0; }
  .field .help { grid-column: 1; }
  .field .ctl .input { max-width: none; }
  .weights { grid-template-columns: repeat(2, 1fr); max-width: none; }
  .loc-row { grid-template-columns: 1fr 64px; }
  .loc-row .toggle { grid-column: 1; }
  .loc-row .icon-btn { grid-column: 2; justify-self: end; }
  .savebar { bottom: calc(68px + env(safe-area-inset-bottom)); }
  .fact { flex-wrap: wrap; }
  .fact .f-name { min-width: 0; flex: 1; }
  .fact .f-desc { flex-basis: 100%; order: 3; }
  .table-wrap.apps { display: none; }
  .mobile-cards { display: block; }
  .m-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
  .m-card:last-child { border-bottom: 0; }
  .m-card .m-body { flex: 1; min-width: 0; }
  .m-card .m-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .m-card .m-sub { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pager { flex-direction: column; align-items: stretch; text-align: center; }
  .pager .pages { justify-content: center; flex-wrap: wrap; }
  .tbl td, .tbl th { padding: 10px 10px; }
  .card h2.card-title { padding: 12px 12px 0; }
  .stat-row, .stat-head { grid-template-columns: 1fr 52px 52px; padding-left: 12px; padding-right: 12px; }
  .stat-row .bar, .stat-head .bh { display: none; }
  .cal-toolbar .title { min-width: 0; font-size: 14px; }
  .cal-toolbar .seg { width: 100%; }
  .cal-toolbar .seg button { flex: 1; }
  .cal-grid .dow { padding: 6px 4px; font-size: 11px; text-align: center; }
  .cal-cell { min-height: 52px; padding: 4px; cursor: pointer; }
  .cal-cell .dn { text-align: center; margin-bottom: 2px; }
  .cal-cell .ev { display: none; }
  .cal-cell .dots { display: flex; justify-content: center; gap: 3px; flex-wrap: wrap; }
  .cal-cell .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-text); }
  .cal-cell .dots i.k-technical_interview { background: #4fcf95; }
  .cal-cell .dots i.k-assessment, .cal-cell .dots i.k-assessment_deadline { background: #e9bd5e; }
  .cal-cell .dots i.k-follow_up { background: #b3a7f0; }
  .cal-cell .dots i.k-application_deadline { background: #ff8580; }
  .week-grid { grid-template-columns: 1fr; gap: 6px; }
  .week-col { min-height: 0; }
  .topbar { z-index: 30; }   /* above the sheet so RUN and its popover stay reachable */
  .drawer { z-index: 26; top: calc(var(--topbar) + env(safe-area-inset-top)); bottom: 0; border-left: 0; box-shadow: none; }
  .table-wrap.docs { display: none; }
  .m-card .m-title .pill { margin-left: 6px; vertical-align: middle; }
  .drawer-backdrop { top: calc(var(--topbar) + env(safe-area-inset-top)); }
  .drawer-head { padding: 14px 14px 10px; }
  .drawer-body { padding: 14px 14px calc(24px + env(safe-area-inset-bottom)); }
  .drawer-foot { padding: 10px 14px calc(12px + env(safe-area-inset-bottom)); }
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tabs button { white-space: nowrap; }
  .kv { grid-template-columns: 96px 1fr; gap: 8px 10px; }
  .fields { grid-template-columns: 1fr; }
  .shots a img { width: 100px; height: 68px; }
  .modal { width: 100%; }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal { border-radius: 14px 14px 0 0; max-height: 88vh; overflow: auto; padding-bottom: env(safe-area-inset-bottom); }
  .popover { position: fixed; top: calc(var(--topbar) + env(safe-area-inset-top) + 6px); right: 8px; left: 8px; width: auto; max-height: calc(100vh - var(--topbar) - 90px); max-height: calc(100dvh - var(--topbar) - 90px); overflow: auto; }
  /* 16px stops iOS Safari from zooming the page when a field is focused, which shifts every margin */
  .search input, .input, .select, textarea.input, .tags input { font-size: 16px; }
  .search input::placeholder, .input::placeholder { font-size: 15px; }
  .content { padding-top: 14px; }
  .page-head { align-items: flex-start; }
  .run-hist { max-height: none; }
  .toasts { right: 12px; left: 12px; bottom: calc(72px + env(safe-area-inset-bottom)); max-width: none; }
  .bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: grid; grid-template-columns: repeat(5, 1fr);
    height: calc(60px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(11, 14, 20, 0.96); backdrop-filter: blur(8px); border-top: 1px solid var(--border);
  }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 500; text-decoration: none; }
  .bottom-nav a .ic { width: 22px; height: 22px; }
  .bottom-nav a.active { color: var(--accent-text); }
  .connect { padding: 8px 0; }
  .connect-card { padding: 18px 16px; }
}
@media (max-width: 400px) {
  .chip { padding: 0 10px; }
  .run-btn { padding: 0 10px; }
  .cal-grid .dow { font-size: 10px; }
}
@media (display-mode: standalone) {
  .topbar { border-bottom-color: var(--border-strong); }
}
