/* =====================================================================
   Mobile kiosk: the reception tablet's look, on a phone. Staff carry it
   at busy events to sign guests in. Same navy and gold, big type and big
   targets as kiosk.css, laid out for a narrow screen. Colours follow the
   ones set in Settings, which the page applies on load.
   ===================================================================== */

:root {
  --navy: var(--brand-navy, #112250);
  --navy-deep: var(--brand-navy-dark, #0a1636);
  --gold: var(--brand-gold, #d9b53b);
  --gold-light: #eed654;
  --ink: #0f172a;
  --muted: rgba(255, 255, 255, .8);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body.mk {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: #fff;
  background: var(--navy-deep);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

.is-hidden { display: none !important; }

.mk-loading {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 700;
}

.mk-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(217, 181, 59, .22), transparent 60%),
    linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* ---------- Header ------------------------------------------------------ */
.mk-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 3px solid var(--gold);
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%);
}

.mk-logo { display: block; height: 30px; width: auto; }
.mk-logo.is-uploaded-logo { background: #fff; padding: 3px 8px; border-radius: 8px; }

.mk-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 700;
  font-size: .9rem;
  color: var(--muted);
}

.mk-user [data-user-name] {
  max-width: 38vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mk-link {
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font: inherit;
  font-weight: 800;
  font-size: .85rem;
  padding: 8px 12px;
  cursor: pointer;
}

/* ---------- Main -------------------------------------------------------- */
.mk-main {
  flex: 1 1 auto;
  width: min(100%, 640px);
  margin: 0 auto;
  padding: 22px 18px 16px;
}

.mk-title {
  margin: 0;
  font-size: clamp(1.7rem, 7vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -.03em;
}

.mk-sub {
  margin: 4px 0 20px;
  font-size: 1rem;
  color: var(--muted);
}

.mk-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.mk-input {
  width: 100%;
  border: 2px solid rgba(255, 255, 255, .3);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: .02em;
  padding: 14px 16px;
}

.mk-btn {
  min-height: 48px;
  border: 0;
  border-radius: 16px;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 800;
  padding: 14px 22px;
  cursor: pointer;
}

.mk-btn.primary {
  background: linear-gradient(150deg, var(--gold-light), var(--gold));
  color: var(--navy);
}

.mk-btn.ghost {
  background: rgba(255, 255, 255, .14);
  color: #fff;
}

.mk-btn:disabled { opacity: .6; cursor: default; }

.mk-scan {
  width: 100%;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.mk-msg {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  font-weight: 700;
  line-height: 1.4;
  background: rgba(255, 255, 255, .12);
}

.mk-msg.is-ok { background: #e3f4ea; color: #14532d; }
.mk-msg.is-error { background: #fde8e8; color: #8a1c1c; }
.mk-msg.is-info { background: #fdf6dd; color: var(--navy); }

/* ---------- The list ------------------------------------------------------ */
.mk-listhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.mk-h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
}

.mk-scope { display: flex; gap: 6px; }

.mk-pill-btn {
  min-height: 40px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: .95rem;
  padding: 7px 16px;
  cursor: pointer;
}

.mk-pill-btn.is-selected {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy);
}

.mk-summary {
  margin: 8px 0 12px;
  color: var(--muted);
}

.mk-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mk-list:focus { outline: none; }

.mk-empty { margin: 0; color: var(--muted); }

.mk-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: #fff;
  color: var(--navy);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .25);
}

.mk-card.is-found { box-shadow: 0 0 0 4px var(--gold), 0 10px 26px rgba(0, 0, 0, .25); }

.mk-card-main { flex: 1 1 180px; min-width: 0; }

.mk-name { font-weight: 800; font-size: 1.15rem; }

.mk-meta {
  margin-top: 2px;
  font-size: .92rem;
  color: #4b5563;
}

.mk-state {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 800;
  background: #eef0f5;
  color: var(--navy);
}

.mk-state.is-in { background: #e3f4ea; color: #146c3c; }
.mk-state.is-left { background: #f1f1f1; color: #4b5563; }

.mk-action { flex: 0 0 auto; min-width: 8.5rem; }

/* On a white card the "ghost" button needs its own edge. */
.mk-card .mk-btn.ghost {
  background: #fff;
  color: var(--navy);
  border: 2px solid var(--navy);
}

@media (max-width: 380px) {
  .mk-action { flex: 1 1 100%; }
}

.mk-footer {
  padding: 14px 18px 20px;
  text-align: center;
  font-size: .9rem;
  color: var(--muted);
  border-top: 1px solid rgba(255, 255, 255, .12);
}

/* ---------- Scanner dialog ------------------------------------------------ */
.mk-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(10, 22, 54, .88);
}

.mk-modal.is-active { display: flex; }

.mk-modal-box {
  width: min(100%, 440px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 18px 18px;
  border-radius: 24px;
  border: 3px solid var(--gold);
  background: var(--navy);
  color: #fff;
  text-align: center;
}

.mk-modal-box .mk-sub { margin: 0; }

.mk-camera {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  overflow: hidden;
  background: #000;
}

.mk-camera video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Where to hold the code. */
.mk-camera-frame {
  position: absolute;
  inset: 14%;
  border: 3px solid var(--gold);
  border-radius: 16px;
  box-shadow: 0 0 0 999px rgba(10, 22, 54, .35);
  pointer-events: none;
}

.mk-modal.is-found .mk-camera-frame { background: rgba(217, 181, 59, .3); }

/* ---------- Keyboard focus and the skip link ------------------------------ */
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.mk-card :focus-visible { outline-color: var(--navy); }

.mk-skip {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 10px;
  background: #fff;
  color: var(--navy);
  font-weight: 800;
}

.mk-skip:focus { top: 12px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Networking portal (network.html) ------------------------------ */
.nw-gap { margin-top: 18px; }

.nw-lines {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 8px;
  font-size: .95rem;
}

.nw-lines a {
  color: var(--navy);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.nw-save {
  flex: 1 1 100%;
  min-height: 44px;
  padding: 10px 16px;
  font-size: .95rem;
}
