/* JEI Account Desk - stage 1 (look-up). No external fonts or assets (CSP: self only). */
:root {
  --bg: #eef2f5;
  --surface: #ffffff;
  --ink: #1b2733;
  --muted: #5b6b7a;
  --line: #d5dde4;
  --teal: #0f6e6e;
  --teal-soft: #dcefee;
  --ok: #2e7d4f;
  --ok-soft: #e1f2e7;
  --warn: #a8640d;
  --warn-soft: #fbefd9;
  --bad: #b42318;
  --bad-soft: #fbe4e1;
  --radius-s: 6px;
  --radius-l: 14px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Noto Sans", sans-serif;
  --font-ar: "Segoe UI", "Noto Naskh Arabic", "Noto Sans Arabic", Tahoma, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131a21;
    --surface: #1b242e;
    --ink: #e4ebf1;
    --muted: #93a3b2;
    --line: #2c3946;
    --teal: #5cc0bc;
    --teal-soft: #173a3b;
    --ok: #6fcf97;
    --ok-soft: #173326;
    --warn: #f0b45c;
    --warn-soft: #3a2c14;
    --bad: #ff8a7a;
    --bad-soft: #3d1c19;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  font-variant-numeric: tabular-nums;
  min-height: 100vh;
}
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
button { font: inherit; cursor: pointer; }
.primary {
  background: var(--teal); color: #fff; border: 0; border-radius: var(--radius-s);
  padding: .55rem 1.1rem; font-weight: 600;
}
@media (prefers-color-scheme: dark) { .primary { color: #0b1a1a; } }
.quiet {
  background: transparent; color: var(--teal); border: 1px solid var(--line);
  border-radius: var(--radius-s); padding: .35rem .8rem;
}

/* top bar */
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .8rem clamp(1rem, 3vw, 2rem); border-bottom: 1px solid var(--line); background: var(--surface);
}
.brand { display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap; }
.mark { width: .9rem; height: .9rem; border-radius: 3px; background: var(--teal); align-self: center; }
.brand-name { font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; }
.stage { color: var(--muted); font-size: .85rem; }
.who { display: flex; align-items: center; gap: .6rem; color: var(--muted); font-size: .9rem; }
.who strong { color: var(--ink); font-weight: 600; }

main { padding: clamp(1rem, 3vw, 2rem); max-width: 1180px; margin: 0 auto; }

/* sign-in gate */
.gate { max-width: 34rem; margin: 12vh auto 0; }
.gate h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 .6rem; letter-spacing: -.015em; }
.gate p { color: var(--muted); margin: 0 0 1.2rem; }
.gate-note { font-size: .9rem; }

/* search */
.search { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.search input[type=search] {
  flex: 1 1 22rem; min-width: 0; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-s); padding: .6rem .8rem;
}
.hold { position: relative; color: var(--teal); font-size: .9rem; cursor: pointer; border: 1px dashed var(--line); border-radius: var(--radius-s); padding: .45rem .7rem; }
.hold input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.hold:focus-within { outline: 3px solid var(--teal); outline-offset: 2px; }
.hint { color: var(--muted); font-size: .9rem; min-height: 1.4em; margin: .5rem 0 1rem; }
.hint.error { color: var(--bad); }

.split { display: grid; grid-template-columns: minmax(16rem, 22rem) 1fr; gap: 1.2rem; align-items: start; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }

/* results list */
.results { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.results:empty { display: none; }
.results button {
  width: 100%; text-align: start; background: transparent; color: inherit; border: 0;
  border-left: 3px solid transparent; border-radius: 0 var(--radius-s) var(--radius-s) 0; padding: .5rem .7rem;
}
.results button:hover { background: var(--surface); }
.results button[aria-current="true"] { background: var(--surface); border-left-color: var(--teal); }
.r-name { display: block; font-family: var(--font-ar); font-weight: 600; }
.r-meta { display: block; color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
.r-off { color: var(--bad); }

/* person card */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: clamp(1rem, 2.5vw, 1.6rem); }
.card h2 { font-family: var(--font-ar); font-size: 1.55rem; line-height: 1.25; margin: 0; letter-spacing: -.01em; }
.card .upn { color: var(--muted); margin: .2rem 0 1.2rem; overflow-wrap: anywhere; }
.card h3 { font-size: .95rem; margin: 1.6rem 0 .5rem; }

/* the health line - the one bold element */
.health { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-radius: var(--radius-s); overflow: hidden; border: 1px solid var(--line); }
.light { padding: .7rem .8rem .75rem; border-top: 5px solid var(--muted); background: var(--surface); }
.light { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.health { border-right: 0; border-bottom: 0; }
@media (max-width: 560px) { .health { grid-template-columns: repeat(2, 1fr); } }
.light .l-name { display: block; font-size: .8rem; color: var(--muted); }
.light .l-value { display: block; font-weight: 600; font-size: .92rem; overflow-wrap: anywhere; }
.light.ok { border-top-color: var(--ok); background: var(--ok-soft); }
.light.warn { border-top-color: var(--warn); background: var(--warn-soft); }
.light.bad { border-top-color: var(--bad); background: var(--bad-soft); }
.light.na { border-top-color: var(--line); }

.issues { margin: 1rem 0 0; padding: 0; list-style: none; display: grid; gap: .35rem; }
.issues li { padding-left: 1.1rem; position: relative; }
.issues li::before { content: ""; position: absolute; left: 0; top: .55em; width: .5rem; height: .5rem; border-radius: 50%; background: var(--warn); }
.issues li.bad::before { background: var(--bad); }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: 0; list-style: none; }
.chips li { border: 1px solid var(--line); border-radius: 999px; padding: .1rem .6rem; font-size: .85rem; }
.chips li.miss { border-color: var(--bad); color: var(--bad); }
.chips li.in { border-color: var(--ok); }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.6rem; }
.note { color: var(--muted); font-size: .85rem; }
.fatal { color: var(--bad); font-weight: 600; }

@media (prefers-reduced-motion: no-preference) {
  .card:not([hidden]) { animation: rise .18s ease-out; }
  @keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
}
@media (max-width: 560px) {
  .stage { display: none; }
  .who { font-size: .8rem; }
  .bar { padding: .6rem .9rem; }
}

/* stage 2: reset */
.danger { background: var(--bad); color: #fff; border: 0; border-radius: var(--radius-s); padding: .55rem 1.1rem; font-weight: 600; }
.danger:disabled { opacity: .45; cursor: not-allowed; }
.danger-outline { background: transparent; color: var(--bad); border: 1px solid var(--bad); border-radius: var(--radius-s); padding: .35rem .8rem; font-weight: 600; }
@media (prefers-color-scheme: dark) { .danger { color: #1b0d0b; } }
.dialog { border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); color: var(--ink); padding: 1.4rem 1.6rem; width: min(30rem, calc(100vw - 2rem)); }
.dialog::backdrop { background: rgba(10, 20, 30, .55); }
.dialog h2 { margin: 0 0 .6rem; font-size: 1.25rem; }
.dialog p { margin: .3rem 0; }
.dialog dl.facts { margin: .9rem 0; }
.confirm { display: block; margin-top: .8rem; font-weight: 600; }
.dialog input { font: inherit; font-size: 1.2rem; letter-spacing: .3em; width: 7ch; margin-top: .4rem; padding: .35rem .5rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--bg); color: var(--ink); }
.pw { display: block; font-size: 1.6rem; font-weight: 700; letter-spacing: .06em; padding: .6rem .8rem; margin: .4rem 0 .8rem; background: var(--teal-soft); border-radius: var(--radius-s); user-select: all; font-variant-ligatures: none; }
