/* Hong Kong Airlines recruitment simulator: Recruit Desk and candidate page. One file, system fonts, no external requests. */
:root {
  --paper: #fff; --bg: #f4f5f7; --ink: #1a2230; --ink2: #465163; --ink3: #6b7686; --line: #e1e5eb; --line2: #cdd3dc; --chip: #eef0f4;
  --red: #d50032; --red-dark: #b0002a; --red-soft: #fdecef; --amber: #9a5b00; --amber-soft: #fdf3e1; --amber-line: #f1d9a8;
  --grass: #3f7a22; --grass-soft: #edf5e7; --blue: #2f6aa3; --blue-soft: #e8f0f8; --r: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.hidden { display: none !important; }
a { color: var(--red-dark); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---- header ---- */
.top { background: var(--paper); border-bottom: 1px solid var(--line); padding: 12px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mark { width: 36px; height: 36px; border-radius: 9px; background: var(--red); color: #fff; font-weight: 800; font-size: 13px; display: grid; place-items: center; flex: none; }
.top h1 { font-size: 17px; }
.top small { display: block; color: var(--ink3); font-size: 12px; }
.top .spacer { flex: 1; }
.who { color: var(--ink2); font-size: 13px; }

/* ---- buttons, inputs ---- */
.btn { border: 1px solid var(--line2); background: var(--paper); border-radius: 9px; padding: 9px 14px; cursor: pointer; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: var(--ink); }
.btn:hover { border-color: var(--ink3); }
.btn:disabled, .btn.disabled { opacity: .5; cursor: default; }
.btn.pri { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.btn.pri:hover { background: var(--red-dark); }
.btn.warn { color: var(--red-dark); border-color: #f0b5c2; }
.btn.sm { padding: 5px 10px; font-size: 13px; min-height: 32px; }
.btn.block { display: flex; width: 100%; }
label { display: block; font-size: 12px; font-weight: 600; color: var(--ink2); margin: 12px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=search], select, textarea {
  width: 100%; border: 1px solid var(--line2); border-radius: 8px; padding: 9px 10px; background: #fff; min-height: 42px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 3px solid #f4a6b8; outline-offset: 1px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 14px; color: var(--ink); margin-top: 14px; }
.check input { width: 18px; height: 18px; flex: none; }
.help { color: var(--ink3); font-size: 12.5px; margin: 4px 0 0; }

/* ---- pills and notices ---- */
.pill { display: inline-block; border-radius: 99px; padding: 2px 10px; font-size: 12px; font-weight: 600; background: var(--chip); color: var(--ink2); white-space: nowrap; }
.pill.green { background: var(--grass-soft); color: var(--grass); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.red { background: var(--red-soft); color: var(--red-dark); }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.note { border-left: 4px solid var(--blue); background: var(--blue-soft); padding: 10px 14px; border-radius: 0 9px 9px 0; color: var(--ink2); margin: 12px 0; }
.note.warn { border-color: var(--amber); background: var(--amber-soft); }
.note.err { border-color: var(--red); background: var(--red-soft); color: #7a0020; }
.note.ok { border-color: var(--grass); background: var(--grass-soft); }
.muted { color: var(--ink3); }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }

/* ---- Recruit Desk ---- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 16px 16px 60px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.toolbar .search { flex: 1 1 220px; max-width: 420px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip { border: 1px solid var(--line2); background: var(--paper); border-radius: 99px; padding: 5px 12px; font-size: 13px; cursor: pointer; min-height: 32px; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.amber { border-color: var(--amber-line); background: var(--amber-soft); color: var(--amber); }
.chip.amber.on { background: var(--amber); border-color: var(--amber); color: #fff; }
.chip .n { opacity: .75; margin-left: 4px; font-weight: 600; }
.tablecard { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 760px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink3); background: #fafbfc; font-weight: 700; }
tr:last-child td { border-bottom: 0; }
td:first-child { white-space: nowrap; }
td .sub { color: var(--ink3); font-size: 12.5px; display: block; }
td .name { font-weight: 600; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line2); }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--red); color: #fff; font-size: 11.5px; font-weight: 700; text-align: center; margin-left: 4px; }
.empty { padding: 36px 16px; text-align: center; color: var(--ink2); }
.empty h2 { font-size: 17px; margin-bottom: 6px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; color: var(--ink2); font-size: 13px; }

/* ---- sign-in ---- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .box { width: 100%; max-width: 340px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: 0 20px 50px rgba(16, 27, 39, .08); }
.login .brand { text-align: center; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--red); margin-bottom: 4px; }
.login h1 { text-align: center; font-size: 20px; margin-bottom: 14px; }

/* ---- dialogs ---- */
.overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(16, 27, 39, .5); display: flex; align-items: flex-start; justify-content: center; padding: 16px; overflow-y: auto; z-index: 50; }
.dialog { background: var(--paper); border-radius: 14px; width: 100%; max-width: 560px; padding: 18px; margin: auto; box-shadow: 0 24px 60px rgba(0, 0, 0, .25); }
.dialog.wide { max-width: 720px; }
.dialog h2 { font-size: 18px; margin-bottom: 4px; }
.dialog .foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.mail { border: 1px solid var(--line2); border-radius: 10px; background: #fff; padding: 12px 14px; font-size: 13.5px; margin-top: 10px; }
.mail .h { color: var(--ink3); font-size: 12.5px; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 10px; overflow-wrap: anywhere; }
.mail pre { white-space: pre-wrap; word-wrap: break-word; font: inherit; margin: 0; overflow-wrap: anywhere; }
.sec { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--ink3); font-weight: 700; margin: 18px 0 8px; }
.msg { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; background: #fff; }
.msg.open { border-color: var(--amber-line); background: var(--amber-soft); }
.msg .meta { color: var(--ink3); font-size: 12.5px; margin-bottom: 4px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.msg p { margin: 0 0 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
table.plain { min-width: 0; margin-top: 8px; }
table.plain td { padding: 6px 8px; font-size: 13.5px; }
table.plain td:first-child { font-weight: 600; }
.linkbox { display: block; width: 100%; font-size: 13px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 80; max-width: 90vw; font-size: 14px; }

/* ---- candidate page (mobile first) ---- */
.cand { max-width: 560px; margin: 0 auto; background: var(--paper); min-height: 100vh; }
.cand .hero { background: var(--red); color: #fff; padding: 20px 18px 18px; }
.cand .hero .eyebrow { font-size: 11px; letter-spacing: 1px; opacity: .9; text-transform: uppercase; }
.cand .hero h1 { font-size: 22px; margin-top: 6px; }
.cand .body { padding: 16px 18px 32px; }
.cand .who2 { margin: 0 0 8px; }
.slot { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin: 10px 0 16px; background: #fafbfc; }
.slot b { font-size: 17px; display: block; }
.slot .note2 { color: var(--ink2); margin-top: 4px; overflow-wrap: anywhere; }
.cand h2 { font-size: 16px; margin: 4px 0 2px; }
.ap { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: #fff; }
.ap summary { list-style: none; cursor: pointer; padding: 11px 12px; display: flex; align-items: baseline; gap: 8px; min-height: 44px; }
.ap summary::-webkit-details-marker { display: none; }
.ap summary .icao { font-weight: 800; letter-spacing: .3px; }
.ap summary .cnt { margin-left: auto; color: var(--ink3); font-size: 13px; white-space: nowrap; }
.ap ul { list-style: none; margin: 0; padding: 0 12px 8px; }
.ap li { border-top: 1px solid var(--line); }
.ap li a { display: flex; justify-content: space-between; gap: 10px; padding: 11px 0; text-decoration: none; color: var(--ink); min-height: 44px; align-items: center; overflow-wrap: anywhere; }
.ap li a .go { color: var(--red-dark); font-weight: 600; white-space: nowrap; }
.brief { margin: 0 0 18px; }
.docs { list-style: none; margin: 8px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.docs li + li { border-top: 1px solid var(--line); }
.docs li a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 12px; min-height: 48px; text-decoration: none; color: var(--ink); }
.docs .dt { display: block; min-width: 0; }
.docs .dn { display: block; font-weight: 600; overflow-wrap: anywhere; }
.docs .dm { display: block; color: var(--ink3); font-size: 12.5px; }
.docs .go { color: var(--red-dark); font-weight: 600; white-space: nowrap; }
.cand .stack > * + * { margin-top: 10px; }
.cand .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.privacy { color: var(--ink3); font-size: 12.5px; margin-top: 22px; border-top: 1px solid var(--line); padding-top: 12px; overflow-wrap: anywhere; }
.center { text-align: center; padding: 60px 22px; }
.center h1 { font-size: 20px; margin-bottom: 8px; }
.counter { text-align: right; font-size: 12px; color: var(--ink3); }

@media (max-width: 520px) {
  .row2 { grid-template-columns: 1fr; }
  .dialog { padding: 14px; }
  .dialog .foot .btn { flex: 1 1 auto; }
}

.hidden-copy { position: fixed; top: 0; left: -9999px; opacity: 0; }
