:root {
  --bg: #f4f2ec;
  --paper: #ffffff;
  --ink: #122033;
  --muted: #5b6674;
  --line: #d5d8de;
  --line-strong: #122033;
  --accent: #122033;
  --accent-ink: #ffffff;
  --focus: #1f4b73;
  --warn: #8a6a12;
  --danger: #8a2b2b;
  --space: 8px;
  --radius: 2px;
  --max: 920px;
  --tap: 48px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-s: max(20px, env(safe-area-inset-left, 0px));
  --safe-e: max(20px, env(safe-area-inset-right, 0px));
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; }
html, body { margin: 0; min-height: 100%; overflow-x: hidden; }
body {
  font-family: "IBM Plex Sans Arabic", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

.skip {
  position: absolute;
  inset-inline-start: 12px;
  top: -40px;
  background: var(--ink);
  color: #fff;
  padding: 8px 12px;
  z-index: 20;
}
.skip:focus { top: 12px; }

.shell {
  width: min(var(--max), 100%);
  margin: 0 auto;
  padding: calc(32px + var(--safe-t)) var(--safe-e) calc(48px + var(--safe-b)) var(--safe-s);
}
.shell.narrow { width: min(680px, 100%); }

.letterhead {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin: 0 0 28px;
  padding: 0 0 20px;
  border-bottom: 2px solid var(--line-strong);
  text-align: center;
}
.project {
  margin: 0;
  font-family: "IBM Plex Sans Arabic", "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
}
.letterhead .rule {
  width: 56px;
  height: 2px;
  background: var(--ink);
}
.letterhead h1, .head h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.25;
}
.lede {
  display: grid;
  gap: 12px;
  max-width: 36em;
  margin: 6px auto 0;
}
.lede h1 {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.35;
}
.lede p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.85;
  text-align: justify;
}
.jobs-nav {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 700;
}
.jobs-nav a { color: var(--focus); }
.job-list {
  display: grid;
  gap: 18px;
}
.job-card {
  display: grid;
  gap: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: 0 1px 0 rgba(18, 32, 51, 0.04);
}
.job-name {
  display: block;
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
}
.job-name:hover { color: var(--focus); }
.job-meta {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.job-req {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.job-req h2 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
}
.job-req p {
  margin: 0;
  white-space: pre-wrap;
  color: var(--ink);
  line-height: 1.8;
  font-size: 15px;
}
.job-go {
  width: fit-content;
  margin-top: 4px;
}
.req-card {
  margin-bottom: 16px;
  padding: 22px 24px;
}
.req-card h2 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
}
.req-card p {
  margin: 0;
  white-space: pre-wrap;
  color: var(--ink);
  line-height: 1.8;
}
.slim-check { margin: 0 0 10px; padding: 10px 12px; }
.req-edit { display: grid; gap: 8px; margin: 0 0 12px; }
.req-edit textarea { min-height: 88px; }

.head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 24px;
  padding: 0 0 16px;
  border-bottom: 2px solid var(--line-strong);
}
.head .brand { display: grid; gap: 6px; }
.head .project { text-align: start; text-indent: 0; }

.shell.desk { width: min(1120px, 100%); }
.desk-tabs {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 0 0 20px;
  border-bottom: 2px solid var(--line);
}
.desk-tabs button {
  min-height: var(--tap);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.desk-tabs button.on {
  color: var(--ink);
  border-bottom-color: var(--ink);
}
.desk-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}
@media (min-width: 861px) {
  #pane-jobs { position: sticky; top: 16px; }
}
.pane-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}
.pane-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.panel { display: none; }
.panel.on { display: block; }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 1px 0 rgba(18, 32, 51, 0.04);
}
.card-head { margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.card-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

label, .search-label {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
textarea, input:not([type="file"]) {
  width: 100%;
  min-height: var(--tap);
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  outline: none;
}
textarea { min-height: 120px; resize: vertical; }
textarea:focus, input:not([type="file"]):focus, button:focus-visible, a:focus-visible, .upload:focus-within {
  border-color: var(--focus);
  box-shadow: 0 0 0 1px var(--focus);
}

.upload-field { display: grid; gap: 8px; margin: 0 0 18px; }
.upload-title { font-size: 13px; font-weight: 600; }
.upload {
  position: relative;
  min-height: 132px;
  border: 1px solid var(--line);
  background: #fff;
  touch-action: manipulation;
}
.upload input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  margin: 0;
  font-size: 16px;
  cursor: pointer;
}
.upload-box {
  min-height: 132px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 20px 16px;
  text-align: center;
  pointer-events: none;
  color: var(--muted);
}
.upload-box strong { color: var(--ink); font-weight: 700; }
.upload.has-file { border-color: var(--ink); background: #fafaf7; }
.upload-hint { font-size: 13px; }
.touch-only { display: none; }
@media (hover: none) {
  .hover-only { display: none; }
  .touch-only { display: block; }
  .upload { min-height: 148px; }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}
.primary, .ghost, .name-link {
  font: inherit;
  cursor: pointer;
}
.primary, .ghost {
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border-radius: var(--radius);
  font-weight: 700;
  text-decoration: none;
}
.primary {
  background: var(--ink);
  color: var(--accent-ink);
  border: 1px solid var(--ink);
}
.primary:disabled { opacity: 0.5; cursor: wait; }
.ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.hint { margin: 0; color: var(--muted); font-size: 13px; }
.hint.sent { font-weight: 700; color: var(--ink); }
.hidden, [hidden] { display: none !important; }

.code-box {
  letter-spacing: 0.28em;
  text-align: center;
  font-size: 28px;
  font-weight: 700;
}

.thanks { text-align: center; padding: 40px 24px; }
.thanks h2 { margin: 0 0 10px; font-size: 24px; }
.thanks p { margin: 0 0 22px; color: var(--muted); }
.thanks .actions { justify-content: center; }

.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: calc(32px + var(--safe-t)) var(--safe-e) calc(32px + var(--safe-b)) var(--safe-s);
}
.gate-card {
  width: min(440px, 100%);
  display: grid;
  gap: 16px;
}
.gate-card .letterhead { margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.gate-card .primary { width: 100%; }

.check-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 4px 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
}
.check-box input[type="checkbox"] {
  width: 22px;
  height: 22px;
  min-height: 22px;
  margin: 2px 0 0;
  padding: 0;
  flex: none;
  accent-color: var(--ink);
}
.duration-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 8px;
}
.duration-row select {
  width: 100%;
  min-height: var(--tap);
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
}

.vacancy-box { margin-bottom: 0; padding: 20px; }
.vacancy-list { display: grid; gap: 0; margin-top: 8px; }
.vacancy-item {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}
.vacancy-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.vacancy-item strong { font-size: 15px; }
.vacancy-item a.vacancy-url {
  display: block;
  margin: 6px 0 10px;
  color: var(--focus);
  font-size: 13px;
  font-weight: 500;
  word-break: break-all;
}
.vacancy-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ghost.slim {
  min-height: 40px;
  width: auto;
  padding: 0 14px;
}
.ghost.slim.danger {
  color: var(--danger);
  border-color: #e3c4c4;
}

.status-row { display: flex; align-items: center; }
.app-list { display: grid; gap: 10px; }
.app-card { padding: 18px 20px; }
.name-link {
  display: block;
  width: 100%;
  text-align: start;
  background: none;
  border: 0;
  padding: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
}
.name-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.role-line { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.app-card .details { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 16px; }
.fact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  margin: 0 0 16px;
}
.fact-grid p { margin: 0; display: grid; gap: 2px; }
.fact-grid span { color: var(--muted); font-size: 12px; font-weight: 600; }
.fact-grid strong { color: var(--ink); font-size: 14px; word-break: break-word; }
.summary {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}
.fact-blocks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
  margin: 0 0 16px;
}
.fact-blocks h3 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
}
.fact-blocks ul { margin: 0; padding: 0 16px 0 0; color: var(--muted); font-size: 14px; }
.facts { display: grid; gap: 8px; color: var(--muted); font-size: 14px; }
.facts strong { color: var(--ink); }
.facts ul { margin: 0 0 10px; padding: 0 18px 0 0; }
.prepare { display: grid; gap: 12px; margin-top: 8px; }
.action-row { display: flex; flex-wrap: wrap; gap: 10px; }
.decision-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.btn-accept, .btn-reject {
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.btn-accept {
  background: #1b7a3d;
  color: #fff;
  border: 1px solid #1b7a3d;
}
.btn-reject {
  background: #b42318;
  color: #fff;
  border: 1px solid #b42318;
}
.btn-accept:disabled, .btn-reject:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.bar {
  height: 2px;
  background: var(--line);
  overflow: hidden;
}
.bar span {
  display: block;
  height: 100%;
  width: 32%;
  background: var(--ink);
}
.bar.busy span { animation: load 1.1s linear infinite; }
.bar.done span { width: 100%; animation: none; }
@keyframes load {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(360%); }
}

@media (max-width: 860px) {
  .desk-tabs { display: grid; }
  .desk-grid { grid-template-columns: 1fr; }
  .desk-pane { display: none; }
  .desk-pane.on { display: block; }
}
@media (max-width: 560px) {
  .shell { padding-top: calc(20px + var(--safe-t)); }
  .lede h1 { font-size: 22px; }
  .lede p { font-size: 14px; text-align: start; }
  .card { padding: 20px 16px; }
  .primary, .ghost { width: 100%; }
  .ghost.slim { width: auto; }
  .actions .hint { width: 100%; }
  .head { flex-direction: column; align-items: stretch; }
  .fact-grid, .fact-blocks { grid-template-columns: 1fr; }
  .action-row .primary, .action-row .ghost, .btn-accept, .btn-reject, .job-go { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
