:root {
  color-scheme: light;
  font-family: Arial, "Noto Sans Hebrew", sans-serif;
  color: var(--text);
  background: var(--background);
  --background: #faf7f3;
  --surface: #fff;
  --muted: #70615e;
  --border: #e5d8cf;
  --text: #5c4846;
  --heading: #423331;
  --accent: #ffb52b;
  --accent-hover: #f2a91e;
  --soft: #fff1d6;
  --backdrop: #42333199;
  --control-border: #a99a92;
}
:root[data-brand="rebase"] {
  --background: #f5f9f6;
  --muted: #50645a;
  --border: #d5e4d9;
  --text: #233d32;
  --heading: #1f1e28;
  --accent: #2ebc4f;
  --accent-hover: #2aaf4a;
  --soft: #e7f5eb;
  --control-border: #789383;
  --backdrop: #1f1e2899;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-inline-size: 0; line-height: 1.5; }
[hidden] { display: none !important; }
h1, h2, h3, p, dl, dd, ol, ul { margin: 0; }
h1, h2, h3, dd, p { overflow-wrap: anywhere; }
button, input { font: inherit; }
button, .button { cursor: pointer; }
button:disabled { cursor: default; opacity: .52; }
:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }
.masthead { background: var(--surface); border-block-end: 1px solid var(--border); }
.masthead-inner, .shell, .nav-inner { inline-size: min(100%, 46rem); margin-inline: auto; }
.masthead-inner { padding: .65rem 1rem; display: flex; justify-content: space-between; gap: .75rem; align-items: center; min-block-size: 3.75rem; }
.brand { display: inline-flex; align-items: center; gap: .5rem; color: var(--heading); font-size: 1.35rem; font-weight: 800; direction: ltr; }
.brand-logo { display: block; inline-size: 7.5rem; block-size: auto; }
.brand-mark { display: inline-flex; gap: 2px; align-items: center; justify-content: center; inline-size: 1.95rem; block-size: 1.95rem; border-radius: .65rem; background: var(--text); transform: rotate(-4deg); }
.brand-mark span { inline-size: 3px; background: var(--accent); border-radius: 2px; transform: rotate(25deg); }
.brand-mark span:nth-child(1) { block-size: 7px; }
.brand-mark span:nth-child(2) { block-size: 14px; }
.brand-mark span:nth-child(3) { block-size: 11px; }
.account { display: flex; align-items: center; gap: .65rem; color: var(--muted); min-inline-size: 0; font-size: .875rem; }
#account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-button { color: var(--text); background: transparent; border: 0; border-radius: .5rem; min-block-size: 44px; padding: .4rem .3rem; font-weight: 700; white-space: nowrap; }
.text-button:hover { text-decoration: underline; }
.shell { padding: 1.2rem 1rem calc(6.5rem + env(safe-area-inset-bottom)); }
.page-title { font-size: 1.15rem; margin-block-end: .25rem; color: var(--heading); }
.deck-description { margin-block-end: .75rem; color: var(--muted); font-size: .875rem; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 1.1rem; padding: 1rem; }
#candidate { touch-action: pan-y pinch-zoom; }
#candidate > * + *, #messages > * + * { margin-block-start: .7rem; }
.profile { background: var(--soft); border-color: var(--border); padding: 1.1rem; }
.profile h2, .transcript-heading h1 { font-size: clamp(1.65rem, 7vw, 2.45rem); line-height: 1.18; }
.profile h2[dir="auto"], .transcript-heading h1[dir="auto"], .message-body[dir="auto"] { text-align: right; }
.profile-role { font-weight: 700; margin-block-start: .35rem; }
.meta { display: flex; flex-wrap: wrap; gap: .25rem .65rem; margin-block-start: .6rem; color: var(--muted); font-size: .875rem; }
.eyebrow { font-size: .83rem; font-weight: 700; color: var(--text); margin-block-end: .3rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-block-start: .9rem; }
.actions > * { max-inline-size: 100%; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-block-size: 44px; padding: .55rem .8rem; border: 1px solid transparent; border-radius: .65rem; font-weight: 700; line-height: 1.3; text-decoration: none; }
.primary { background: var(--accent); color: var(--heading); }
.primary:hover:not(:disabled) { background: var(--accent-hover); }
.secondary { background: white; color: var(--text); border-color: var(--control-border); }
.secondary:hover:not(:disabled) { background: var(--soft); }
.section-title { font-size: 1.04rem; margin-block-end: .55rem; }
.muted, .subtle { color: var(--muted); }
.subtle { font-size: .875rem; }
.preserve-lines { white-space: pre-wrap; }
.facts, .record-list { display: grid; gap: .55rem; }
.facts > div, .record-list > li { border-block-start: 1px solid var(--border); padding-block-start: .5rem; }
.facts dt { font-size: .875rem; color: var(--muted); }
.record-list { padding: 0; list-style: none; }
.record-list h3 { font-size: 1rem; }
.record-list li > * + * { margin-block-start: .22rem; }
.record-list > .record-positive, .record-list > .record-declined {
  padding: .65rem .75rem;
  border: 1px solid;
  border-radius: .65rem;
}
.record-list > .record-positive { background: #ecf7ee; border-color: #c4dec8; }
.record-list > .record-declined { background: #fceeed; border-color: #edd1cd; }
.job-fit > summary {
  padding-inline: .45rem;
  border: 1px solid var(--border);
  border-radius: .5rem;
  background: var(--surface);
  font-size: .875rem;
}
.job-fit-indicator { display: inline; margin-inline-start: .2rem; }
.job-fit-icon { margin-inline-end: .35rem; vertical-align: middle; font-size: 1.25rem; line-height: 1; }
.job-fit:not([open]) > .job-fit-panel { display: none; }
.job-fit-panel { padding-block: .4rem; }
.fit-checks { inline-size: 100%; table-layout: fixed; border-collapse: collapse; font-size: .875rem; }
.fit-checks caption { text-align: start; font-weight: 700; padding-block: .2rem .45rem; }
.fit-checks th, .fit-checks td {
  padding: .35rem .25rem;
  text-align: start;
  vertical-align: top;
  overflow-wrap: anywhere;
  border-block-end: 1px solid var(--border);
}
.fit-checks thead th:first-child { inline-size: 23%; }
.fit-checks thead th:nth-child(2) { inline-size: 22%; }
.fit-check-status { display: inline-block; border-radius: .3rem; padding-inline: .2rem; background: #ede9e5; }
.fit-check-pass { color: #23643b; background: #e5f4e9; }
.fit-check-fail { color: #8b3127; background: #fae3e0; }
.fit-check-unknown { color: #7c4b08; background: #fceccf; }
.fit-title-details { list-style: none; margin-block-start: .35rem; padding: 0; }
.fit-title-details > li { padding-block: .35rem; border-block-start: 1px solid var(--border); }
.fit-title-details strong { display: block; }
.fit-green { color: #2e9e5b; }
.fit-orange { color: #f08c00; }
.fit-red { color: #e03131; }
.fit-grey { color: #adb5bd; }
.fit-stale { opacity: .45; }
.system-message { padding: 1rem 0; color: var(--muted); }
.error-message, .form-error { color: #8b3127; }
.error-message + .button, .panel > .button { margin-block-start: .5rem; }
.login-panel { max-inline-size: 26rem; margin: clamp(1rem, 8vh, 5rem) auto 0; padding: 1.35rem; }
.login-panel h1 { font-size: 1.65rem; margin-block-end: .7rem; }
.login-panel form { display: grid; gap: .4rem; }
.login-panel label { font-weight: 700; }
.login-panel input { inline-size: 100%; padding: .6rem; min-block-size: 46px; border: 1px solid var(--control-border); border-radius: .55rem; margin-block-end: .4rem; color: inherit; background: white; }
.back { margin-block-end: .35rem; }
.transcript-heading { margin-block-end: .85rem; }
.message-group { display: grid; gap: .55rem; min-inline-size: 0; }
.message-group h2 { font-size: .9rem; color: var(--muted); }
.message { justify-self: start; max-inline-size: 90%; border-radius: .85rem; padding: .65rem .8rem; background: white; border: 1px solid var(--border); }
.message.out { justify-self: end; background: var(--soft); }
.message-meta { font-size: .78rem; color: var(--muted); margin-block-end: .2rem; overflow-wrap: anywhere; }
#navigation { position: fixed; z-index: 2; inset-inline: 0; inset-block-end: 0; padding-block-end: env(safe-area-inset-bottom); background: var(--surface); border-block-start: 1px solid var(--border); }
.nav-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: .65rem; padding: .6rem 1rem; }
#position { font-size: .875rem; color: var(--muted); text-align: center; }
.profile #cv-status { margin-block-start: .4rem; }
.panel > details { margin-block-start: .55rem; }
.panel > details:not([open]) > .record-list { display: none; }
details summary { cursor: pointer; min-block-size: 44px; padding-block: .65rem; color: var(--text); font-weight: 700; }

.referral-tracking { margin-block-end: .75rem; }
.referral-assignment:empty { display: none; }
.referral-assignment { margin-block-start: .4rem; }
.referral-dialog {
  inline-size: min(calc(100% - 1rem), 38rem);
  max-block-size: calc(100dvh - 1rem);
  margin: auto;
  overflow: auto;
  color: var(--heading);
}
.referral-dialog::backdrop { background: var(--backdrop); }
.referral-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  margin-block-end: .75rem;
}
.referral-dialog-header h2 { font-size: 1.3rem; }
.referral-form, .referral-filters { display: grid; gap: .65rem; margin-block: .8rem; }
.referral-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
.referral-field { display: grid; gap: .25rem; font-weight: 700; min-inline-size: 0; }
.referral-field :is(input, textarea, select) {
  inline-size: 100%;
  min-inline-size: 0;
  min-block-size: 44px;
  padding: .5rem;
  border: 1px solid var(--control-border);
  border-radius: .5rem;
  color: inherit;
  background: white;
  font: inherit;
  font-weight: 400;
}
.referral-field textarea { resize: vertical; }
.referral-results, .referral-history { margin-block: .75rem; }
.referral-name { text-align: start; white-space: normal; overflow-wrap: anywhere; }
.referral-due { color: #8b3127; font-weight: 700; }
.referral-success { padding: .45rem .6rem; margin-block-end: .6rem; background: #ecf7ee; border-radius: .45rem; }
