:root {
  color-scheme: light;
  --paper: #f6f2eb; --surface: #fffdf9; --ink: #362e28; --muted: #786d63;
  --line: #e5ddd1; --sand: #e9dfd0; --button: #3d3229; --button-ink: #fffaf2;
  --soft: #e9ecdf; --green: #53624d; --warm: #806044; --danger: #9d4e43;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper); color: var(--ink); font-synthesis: none;
}
:root[data-theme=dark] {
  color-scheme: dark;
  --paper: #211e1b; --surface: #2b2723; --ink: #f2e9de; --muted: #c0b2a4;
  --line: #463e36; --sand: #40382f; --button: #e6d7c4; --button-ink: #2e261f;
  --soft: #343b2c; --green: #b8c5a8; --warm: #dbc0a2; --danger: #ecada0;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .6; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }
a { color: inherit; }
button, a { touch-action: manipulation; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; letter-spacing: -.6px; }
h1 { font-size: clamp(29px, 6vw, 39px); line-height: 1.16; overflow-wrap: anywhere; }
h2 { font-size: 25px; line-height: 1.25; }
h3 { font-size: 16px; font-weight: 500; }
p { line-height: 1.6; }
.shell { max-width: 880px; margin: auto; padding: 0 24px calc(108px + var(--safe-bottom)); }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 24px 0; padding-top: calc(24px + var(--tg-content-safe-area-inset-top, 0px)); border-bottom: 1px solid var(--line); }
.wordmark { font-family: Georgia, "Times New Roman", serif; letter-spacing: -1.1px; font-size: 27px; text-decoration: none; white-space: nowrap; }
.topbar > span { font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); text-align: right; max-width: 120px; }
main { padding-top: 22px; }
.muted { color: var(--muted); }
.eyebrow { font-size: 11px; line-height: 1.6; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.hero { overflow: hidden; border-radius: 18px; background: var(--sand); height: 206px; margin-bottom: 28px; }
.hero img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.intro { max-width: 490px; margin-bottom: 24px; }
.intro p:not(.eyebrow) { color: var(--muted); font-size: 14px; margin-top: 13px; max-width: 390px; }
.primary, .secondary, .quiet { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; border-radius: 11px; min-height: 48px; padding: 13px 16px; text-decoration: none; font-size: 14px; line-height: 1.4; font-weight: 500; white-space: normal; overflow-wrap: anywhere; }
.primary { background: var(--button); color: var(--button-ink); border: 1px solid var(--button); }
.secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.quiet { background: transparent; color: var(--muted); border: 0; }
.danger { color: var(--danger); }
.section-head { display: flex; align-items: baseline; gap: 12px; justify-content: space-between; margin: 28px 0 13px; }
.section-head h2 { font-size: 24px; }
.section-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.text-link { background: none; border: 0; color: var(--muted); font-size: 12px; min-height: 44px; padding: 8px 0; }
.people { display: grid; gap: 10px; }
.person { display: flex; align-items: center; gap: 13px; width: 100%; padding: 17px 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--ink); text-align: left; min-height: 86px; }
.avatar { flex-shrink: 0; width: 38px; height: 43px; border: 1px solid var(--line); border-radius: 8px; display: grid; place-items: center; color: var(--muted); font-family: Georgia, serif; font-size: 15px; }
.person-copy { flex: 1; min-width: 0; }
.person-copy strong { display: block; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.person-copy small { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; line-height: 1.4; }
.status { display: inline-block; font-size: 11px; margin-top: 8px; color: var(--warm); }
.status.ready { color: var(--green); }
.person-chevron { color: var(--muted); font-size: 23px; }
.empty { padding: 28px 12px; text-align: center; color: var(--muted); }
.empty p { font-size: 13px; margin-top: 9px; }
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.quick-grid .secondary { min-height: 58px; font-size: 13px; }
.admin { margin-top: 27px; padding-top: 20px; border-top: 1px solid var(--line); }
.admin .quiet { justify-content: space-between; padding-left: 0; padding-right: 0; }
.bottom { position: fixed; z-index: 3; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%, 880px); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 10px 12px calc(10px + var(--safe-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.bottom button { border: 0; background: transparent; color: var(--muted); font-size: 11px; padding: 6px 2px; min-height: 49px; }
.bottom button[aria-current=page] { color: var(--ink); }
.nav-mark { display: block; font-size: 21px; line-height: 1; margin-bottom: 7px; }
.back { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; color: var(--muted); min-height: 44px; padding: 0; margin-bottom: 16px; font-size: 13px; }
.flow-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.7; margin: 20px 0 24px; }
.flow-actions { display: grid; gap: 8px; }
.form { margin: 20px 0; display: grid; gap: 10px; }
.form label { font-size: 13px; color: var(--muted); }
.form input, .search, .country-filter select { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); padding: 13px; font-size: 16px; width: 100%; min-height: 48px; }
.notice { position: fixed; z-index: 5; left: 50%; bottom: calc(84px + var(--safe-bottom)); transform: translateX(-50%); background: var(--button); color: var(--button-ink); border-radius: 12px; padding: 14px 17px; font-size: 13px; width: min(calc(100% - 32px), 560px); line-height: 1.5; }
.loading { padding: 46px 0; color: var(--muted); text-align: center; }
.upload-box { border: 1px dashed var(--line); border-radius: 13px; padding: 20px; margin-top: 22px; background: var(--surface); }
.upload-box p { font-size: 13px; color: var(--muted); margin: 9px 0 16px; }
.file { border-top: 1px solid var(--line); padding: 20px 0; }
.file-name { font-size: 15px; margin-bottom: 12px; overflow-wrap: anywhere; }
.source-photo { max-width: 100%; height: auto; display: block; border-radius: 10px; margin: 15px 0; }
figure { margin: 20px 0; }
.busy { padding: 15px 17px; border-radius: 12px; background: var(--soft); color: var(--green); font-size: 13px; line-height: 1.5; margin: 16px 0; }
.preview-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; margin: -6px 0 15px; }
.preview-line .text-link { flex-shrink: 0; font-size: 11px; }
.preview-inline { font-size: 11px; color: var(--muted); padding-top: 22px; }
.list-tools { margin: 20px 0 16px; }
.search { margin-bottom: 15px; }
.filter-row { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-button { background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 7px; padding: 10px 11px; font-size: 12px; min-height: 44px; }
.filter-button[aria-pressed=true] { background: var(--sand); color: var(--ink); }
.country-filter { font-size: 12px; color: var(--muted); display: grid; gap: 7px; margin-bottom: 15px; }
.country-filter select { font-size: 14px; }
.filter-caption { color: var(--muted); font-size: 11px; margin-bottom: 15px; overflow-wrap: anywhere; }
.reset-filters { padding-top: 0; margin-bottom: 10px; color: var(--ink); }
.pager { display: flex; gap: 10px; margin-top: 16px; }
.applicant-meta { color: var(--muted); font-size: 13px; margin-top: 12px; }
.applicant-mode { color: var(--muted); font-size: 12px; margin-top: 4px; }
.status-badge { display: inline-block; font-size: 11px; color: var(--warm); background: var(--sand); border-radius: 6px; padding: 6px 10px; margin-top: 16px; }
.status-badge.ready { color: var(--green); background: var(--soft); }
.status-badge.archive { color: var(--muted); background: transparent; border: 1px solid var(--line); }
.group-caption { font-size: 12px; color: var(--muted); margin-top: 12px; }
.applicant-grid { margin-top: 23px; }
.next-step { background: var(--sand); border-radius: 13px; padding: 20px; }
.next-step h2 { font-size: 24px; }
.next-step p { color: var(--muted); font-size: 13px; margin-top: 9px; }
.next-step .primary { margin-top: 17px; }
.document-list { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.document-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 75px; padding: 15px 14px; background: transparent; color: var(--ink); border: 0; text-align: left; }
.document-row + .document-row { border-top: 1px solid var(--line); }
.document-icon { display: grid; place-items: center; flex-shrink: 0; width: 33px; height: 40px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: 10px; letter-spacing: .5px; }
.document-copy { flex: 1; min-width: 0; }
.document-copy strong { display: block; font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.document-copy small { display: block; color: var(--muted); font-size: 11px; margin-top: 5px; line-height: 1.4; }
.document-end { color: var(--muted); font-size: 17px; }
.accepted, .document-copy .accepted { color: var(--green); }
.replace-documents { margin-top: 12px; font-size: 12px; }
.inline-note { padding: 14px; font-size: 12px; color: var(--muted); }
.card-actions { margin-top: 18px; }
.card-actions .quiet { justify-content: flex-start; text-align: left; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 13px; }
.preparation-details { margin-top: 20px; color: var(--muted); font-size: 12px; }
.preparation-details summary { min-height: 44px; padding: 12px 0; cursor: pointer; }
.preparation-details p { white-space: pre-wrap; overflow-wrap: anywhere; padding: 10px 0; }
.source-description { font-size: 14px; color: var(--muted); margin: 20px 0 24px; }
.source-action + .source-action { margin-top: 10px; }
@media (min-width: 680px) {
  .shell { padding-left: 34px; padding-right: 34px; }
  .home-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: start; }
  .hero { height: 260px; }
  .home-grid > section:nth-child(2) > .section-head { margin-top: 0; }
  .bottom { padding-left: 85px; padding-right: 85px; }
  .applicant-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 30px; align-items: start; }
  .applicant-grid > section:nth-child(2) > .section-head { margin-top: 0; }
  .list-tools .primary { width: auto; min-width: 210px; }
}
@media (max-width: 350px) {
  .shell { padding-left: 17px; padding-right: 17px; }
  .wordmark { font-size: 23px; }
  .topbar > span { font-size: 10px; letter-spacing: .7px; }
  .hero { height: 180px; }
  .preview-line { align-items: flex-start; }
  .preview-line > span { max-width: 145px; }
  .document-row { padding: 14px 11px; gap: 9px; }
}
@media (prefers-reduced-motion: no-preference) {
  button, a { transition: background-color .15s ease, opacity .15s ease; }
}
