/* ============================================================
   Wing Yip Group — Welcome Pack Digital
   Brand-aware + light/dark dual themes
   ============================================================ */

/* ---------- Defaults (selector — light) ---------- */
:root {
  --bg: #ffffff;
  --bg-2: #f7f7f7;
  --bg-3: #efefef;
  --line: #e3e3e3;
  --line-2: #cfcfcf;
  --txt: #555555;
  --txt-2: #555555;
  --txt-3: #8a8a8a;

  --accent-1: #c4142b;       /* WY red (group default) */
  --accent-1-soft: rgba(196, 20, 43, 0.10);
  --accent-2: #fcd116;       /* WY yellow */
  --accent-2-soft: rgba(252, 209, 22, 0.18);
  --on-accent-1: #ffffff;
  --on-accent-2: #181818;

  --red: #d12626;
  --radius: 8px;
  --radius-sm: 6px;

  --card-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  --card-shadow-hover: 0 16px 32px rgba(0, 0, 0, 0.10);

  --map-bg: #f3f3f3;
  --map-road: #e0e0e0;
  --map-line: #b0b0b0;
  --map-bldg: #ffffff;
}

/* ---------- Default dark (selector page) ---------- */
body[data-theme="dark"]:not([data-brand]) {
  --bg: #0d0d0d;
  --bg-2: #161616;
  --bg-3: #1d1d1d;
  --line: #262626;
  --line-2: #333333;
  --txt: #f2f2f2;
  --txt-2: #b5b5b5;
  --txt-3: #6b6b6b;
  --card-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  --card-shadow-hover: 0 16px 40px rgba(0, 0, 0, 0.55);
  --map-bg: #161616;
  --map-road: #1f1f1f;
  --map-line: #333333;
  --map-bldg: #1a1a1a;
}

/* ============================================================
   WING YIP — red + yellow + white/grey
   ============================================================ */
body[data-brand="wy"][data-theme="light"] {
  --bg: #ffffff;
  --bg-2: #faf9f8;
  --bg-3: #f3f3f2;
  --line: #e6e6e6;
  --line-2: #d4d4d4;
  --txt: #171717;
  --txt-2: #525252;
  --txt-3: #8a8a8a;
  --accent-1: #c4142b;
  --accent-1-soft: rgba(196, 20, 43, 0.12);
  --accent-2: #fcd116;
  --accent-2-soft: rgba(252, 209, 22, 0.22);
  --on-accent-1: #ffffff;
  --on-accent-2: #1a1010;
  --map-bg: #f7f7f7;
  --map-road: #e6e6e6;
  --map-line: #d4d4d4;
  --map-bldg: #ffffff;
}
body[data-brand="wy"][data-theme="dark"] {
  --bg: #14090a;
  --bg-2: #1d0e10;
  --bg-3: #261417;
  --line: #3a1d22;
  --line-2: #4a262c;
  --txt: #fdf3f3;
  --txt-2: #d0b5b8;
  --txt-3: #8a6a6e;
  --accent-1: #e62540;
  --accent-1-soft: rgba(230, 37, 64, 0.18);
  --accent-2: #fcd116;
  --accent-2-soft: rgba(252, 209, 22, 0.18);
  --on-accent-1: #ffffff;
  --on-accent-2: #14090a;
  --map-bg: #1a0d0e;
  --map-road: #220f12;
  --map-line: #3a1d22;
  --map-bldg: #14090a;
}

/* ============================================================
   WY DIDI — same red + yellow palette
   ============================================================ */
body[data-brand="didi"][data-theme="light"] {
  --bg: #ffffff;
  --bg-2: #faf9f8;
  --bg-3: #f3f3f2;
  --line: #e6e6e6;
  --line-2: #d4d4d4;
  --txt: #171717;
  --txt-2: #525252;
  --txt-3: #8a8a8a;
  --accent-1: #c4142b;
  --accent-1-soft: rgba(196, 20, 43, 0.12);
  --accent-2: #fcd116;
  --accent-2-soft: rgba(252, 209, 22, 0.30);
  --on-accent-1: #ffffff;
  --on-accent-2: #1a1410;
  --map-bg: #f7f7f7;
  --map-road: #e6e6e6;
  --map-line: #d4d4d4;
  --map-bldg: #ffffff;
}
body[data-brand="didi"][data-theme="dark"] {
  --bg: #14110a;
  --bg-2: #1d180e;
  --bg-3: #262014;
  --line: #3a3220;
  --line-2: #4a4030;
  --txt: #fef8e8;
  --txt-2: #d0c5a0;
  --txt-3: #8a7e60;
  --accent-1: #e62540;
  --accent-1-soft: rgba(230, 37, 64, 0.18);
  --accent-2: #fcd116;
  --accent-2-soft: rgba(252, 209, 22, 0.22);
  --on-accent-1: #ffffff;
  --on-accent-2: #14110a;
  --map-bg: #1a160e;
  --map-road: #221c10;
  --map-line: #3a3220;
  --map-bldg: #14110a;
}

/* ============================================================
   PRIORITY COLD STORE — navy + cyan (real PCS brand)
   ============================================================ */
body[data-brand="pcs"][data-theme="light"] {
  --bg: #ffffff;
  --bg-2: #faf9f8;
  --bg-3: #f3f3f2;
  --line: #e6e6e6;
  --line-2: #d4d4d4;
  --txt: #171717;
  --txt-2: #525252;
  --txt-3: #8a8a8a;
  --accent-1: #1d2e5f;
  --accent-1-soft: rgba(29, 46, 95, 0.10);
  --accent-2: #36a9e1;
  --accent-2-soft: rgba(54, 169, 225, 0.18);
  --on-accent-1: #ffffff;
  --on-accent-2: #0d1830;
  --map-bg: #f7f7f7;
  --map-road: #e6e6e6;
  --map-line: #d4d4d4;
  --map-bldg: #ffffff;
}
body[data-brand="pcs"][data-theme="dark"] {
  --bg: #0a1220;
  --bg-2: #0e1a2d;
  --bg-3: #12233c;
  --line: #1c2f4e;
  --line-2: #243d62;
  --txt: #eaf3ff;
  --txt-2: #a8bcd6;
  --txt-3: #5a6e88;
  --accent-1: #36a9e1;
  --accent-1-soft: rgba(54, 169, 225, 0.18);
  --accent-2: #7fd7ff;
  --accent-2-soft: rgba(127, 215, 255, 0.18);
  --on-accent-1: #0a1220;
  --on-accent-2: #0a1220;
  --map-bg: #0e1a2d;
  --map-road: #122339;
  --map-line: #1c2f4e;
  --map-bldg: #0a1220;
}

/* ============================================================
   BASE
   ============================================================ */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

body {
  background: var(--bg);          /* plain white — no red/yellow glow (logbook style) */
}

/* ---------- screen system ---------- */
.screen {
  display: none;
  min-height: 100vh;
  width: 100%;
  position: relative;
}
.screen.active { display: block; }

/* ============================================================
   THEME TOGGLE (fixed top-right)
   ============================================================ */
.theme-toggle {
  position: fixed !important;
  top: 20px !important;
  right: 20px !important;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--txt-2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  /* Promote to its own layer so no ancestor can hijack the containing block. */
  will-change: transform;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.theme-toggle:hover {
  border-color: var(--accent-1);
  color: var(--accent-1);
}
.theme-toggle:hover svg { transform: rotate(15deg); transition: transform 0.2s; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
body[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
body[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ============================================================
   SCREEN 0 — BRAND SELECTOR (white bg by default)
   ============================================================ */
#screen-selector.active,
#screen-branches.active {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 14px 24px 28px;
  min-height: 100vh;
}

.selector-shell {
  width: 100%;
  max-width: 1200px;
  text-align: center;
  animation: fadeUp 0.6s ease-out;
}

/* ---- Group mark (logo + GROUP label) ---- */
.group-mark {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 4px;
  gap: 0;
}
.group-logo {
  width: clamp(260px, 32vw, 380px);
  height: auto;
  display: block;
}
.group-mark.sm .group-logo { width: clamp(240px, 26vw, 320px); }
/* DIDI horizontal lockup is wider than tall — allow a larger width */
.group-mark.sm .group-logo.group-logo--didi { width: clamp(320px, 38vw, 460px); }
/* WY Superstore logo is square — give it a square-friendly width */
.group-mark.sm .group-logo.group-logo--ss { width: clamp(140px, 16vw, 200px); border-radius: 14px; }

body[data-theme="dark"] .group-logo {
  filter: brightness(1.15) contrast(1.05);
}

.group-label {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 18px;
  letter-spacing: 0.42em;
  color: #c4142b;
  font-weight: 700;
  text-transform: uppercase;
  margin-top: -12px;
  line-height: 1;
  padding-left: 0.42em;
  opacity: 0.85;
}
body[data-theme="dark"] .group-label {
  color: #e62540;
  opacity: 0.9;
}

.selector-title {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 600;
  margin: 4px 0 16px;
  letter-spacing: -0.6px;
  line-height: 1.2;
  color: var(--txt);
}

.brand-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
  margin: 0 auto 24px;
  max-width: 1120px;
}
@media (max-width: 720px) {
  .brand-grid { grid-template-columns: 1fr; max-width: 380px; }
}

.brand-card {
  appearance: none;
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 34px 28px 30px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  transition: box-shadow 0.15s, transform 0.15s;
  font-family: inherit;
  color: #ffffff;
  text-align: center;
  overflow: hidden;
  min-height: 310px;
  /* flat WY red (DIDI same). PCS overridden below. */
  background: var(--accent-1);
  box-shadow: 0 1.6px 3.6px rgba(0, 0, 0, 0.10), 0 0.3px 0.9px rgba(0, 0, 0, 0.07);
}
.brand-card::before { display: none; }
.brand-card > * { position: relative; z-index: 1; }
.brand-card[data-brand="pcs"] {
  background: #1d6fa0;                          /* flat PCS blue */
  border-color: rgba(0, 0, 0, 0.12);
}

@media (hover: hover) {
  .brand-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);
  }
}
.brand-card:active { transform: translateY(0); }

.brand-logo {
  width: 100%;
  max-width: 230px;
  aspect-ratio: 1 / 1;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
}
.brand-logo.white-bg { background: #ffffff; padding: 10px; }
.brand-logo img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.brand-card-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}
.brand-card-label {
  align-items: center;
  text-align: center;
}
.brand-card-label strong {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.2px;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.brand-card-label span {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.5px;
}

.selector-foot {
  margin-top: 14px;
  color: var(--txt-2);
  font-size: 17px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
}

/* ============================================================
   SCREEN 0B — BRANCH PICKER
   ============================================================ */
.branch-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  margin: 0 auto 32px;
  max-width: 1320px;
}
@media (max-width: 1100px) {
  .branch-grid { grid-template-columns: repeat(2, 1fr); gap: 22px; }
}
@media (max-width: 520px) {
  .branch-grid { grid-template-columns: 1fr; max-width: 360px; }
}

/* Branch cards inherit the brand-card glossy aesthetic (red for WY/DIDI).
   Set body[data-brand="didi"] / data-brand="wy" so the gradient is the same. */
.branch-card {
  appearance: none;
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 20px 18px 22px;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1),
              opacity 0.42s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: #ffffff;
  background: var(--accent-1);
  box-shadow: 0 1.6px 3.6px rgba(0, 0, 0, 0.10), 0 0.3px 0.9px rgba(0, 0, 0, 0.07);
}
/* gloss highlight on top — same trick as brand-card */
.branch-card::before { display: none; }
.branch-card > * { position: relative; z-index: 1; }

/* hover-expand group on branch grid */
@media (hover: hover) {
  .branch-grid:hover .branch-card:not(.branch-card--soon) {
    transform: scale(0.94);
    opacity: 0.7;
    filter: saturate(0.85);
  }
  .branch-grid:hover .branch-card:hover:not(.branch-card--soon) {
    transform: scale(1.06);
    opacity: 1;
    filter: saturate(1) brightness(1.06);
    z-index: 2;
  }
}

.branch-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
}
.branch-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s;
}
.branch-card:hover .branch-photo img { transform: scale(1.04); }

.branch-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  padding: 0 4px 4px;
}
.branch-label strong {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.2px;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.branch-label span {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.4px;
}

/* coming soon variant */
.branch-photo { position: relative; }
.soon-badge {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 20px;
  backdrop-filter: blur(6px);
}
.branch-card--soon {
  opacity: 0.55;
  cursor: not-allowed;
  filter: saturate(0.7);
}
.branch-card--soon:hover { transform: none; }
.branch-card--soon .branch-photo img { filter: grayscale(0.6) brightness(0.88); }

.branch-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 64px;
  font-weight: 600;
  color: #c4142b;
  background: var(--bg-2);
  opacity: 0.9;
}

/* ============================================================
   SCREEN 1 — LOGIN
   ============================================================ */
#screen-login.active {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.login-shell {
  width: 100%;
  max-width: 420px;
  text-align: center;
  animation: fadeUp 0.6s ease-out;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 48px;
}

.brand-mark {
  min-width: 120px;
  max-width: 240px;
  height: 120px;
  border-radius: 22px;
  background: #ffffff;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 20px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}
.brand-mark img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.brand-mark.sm { min-width: 38px; max-width: 90px; height: 38px; border-radius: 10px; padding: 4px 6px; }

.brand-name {
  font-size: 15px;
  color: var(--txt-2);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  font-weight: 600;
}

.login-title {
  font-size: 42px;
  font-weight: 700;
  margin: 0 0 14px;
  letter-spacing: -0.8px;
  color: var(--txt);
}

.login-sub {
  color: var(--txt-2);
  margin: 0 0 36px;
  font-size: 15px;
}

#login-form { display: flex; flex-direction: column; gap: 14px; }

#code-input {
  width: 100%;
  height: 64px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--txt);
  font-size: 24px;
  letter-spacing: 8px;
  text-align: center;
  font-family: "SF Mono", ui-monospace, monospace;
  outline: none;
  transition: all 0.2s;
}
#code-input:focus {
  border-color: var(--accent-1);
  background: var(--bg-3);
  box-shadow: 0 0 0 3px var(--accent-1-soft);
}
#code-input::placeholder { color: var(--txt-3); letter-spacing: 4px; }

.btn-primary {
  position: relative;
  height: 40px;
  padding: 0 18px;
  background: var(--accent-1);              /* flat WY red — no gloss/gradient (logbook style) */
  color: var(--on-accent-1);
  font-weight: 600;
  border: 1px solid var(--accent-1);
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s, border-color 0.15s;
  letter-spacing: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.btn-primary::before { display: none; }
.btn-primary > * { position: relative; z-index: 1; }
.btn-primary:hover {
  background: #9c0e22;
  border-color: #9c0e22;
}
.btn-primary:active {
  background: #7a0818;
  border-color: #7a0818;
}
.btn-primary.btn-large { height: 46px; padding: 0 24px; font-size: 15px; }

.login-error { color: var(--red); font-size: 14px; min-height: 20px; margin: 12px 0 0; }

.login-hint { margin-top: 32px; color: var(--txt-3); font-size: 13px; }
.login-hint code {
  background: var(--bg-2);
  padding: 2px 8px;
  border-radius: 6px;
  color: var(--accent-1);
  border: 1px solid var(--line);
  font-weight: 600;
}

/* ============================================================
   SCREEN 2 — WELCOME EXPLOSION
   ============================================================ */
#screen-welcome.active {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 40px 24px;
  overflow: hidden;
}

.welcome-content {
  text-align: center;
  z-index: 10;
  position: relative;
  animation: welcomePop 0.9s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.welcome-eyebrow {
  color: var(--accent-1);
  font-size: 14px;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin: 0 0 20px;
  font-weight: 600;
}

.welcome-title {
  font-size: clamp(40px, 7vw, 76px);
  font-weight: 700;
  letter-spacing: -2px;
  margin: 0 0 48px;
  line-height: 1.05;
  color: var(--txt);
}

.name-highlight {
  color: var(--accent-1);
  position: relative;
  display: inline-block;
}
.name-highlight::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.08em;
  height: 0.18em;
  background: var(--accent-2);
  z-index: -1;
  border-radius: 4px;
}

.welcome-family {
  font-size: 0.6em;
  font-weight: 500;
  color: var(--txt-2);
  letter-spacing: -0.5px;
}

/* ============================================================
   SCREEN — REVIEW (second visit: data + contract sign chain)
   ============================================================ */
.review-wrap { max-width: 720px; }

.review-summary-card .review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
  margin-top: 4px;
}
@media (max-width: 560px) {
  .review-summary-card .review-grid { grid-template-columns: 1fr; }
}
.review-grid .rg-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.review-grid .rg-row:last-child,
.review-grid .rg-row:nth-last-child(2) { border-bottom: none; }
.review-grid .rg-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--txt-3);
  font-weight: 700;
}
.review-grid .rg-value {
  font-size: 14.5px;
  color: var(--txt);
  font-weight: 500;
  word-break: break-word;
}
.review-grid .rg-value.muted { color: var(--txt-3); font-style: italic; }

.review-confirm { margin-bottom: 6px; }

/* Stage buttons — progressively unlocked */
.btn-stage {
  margin-top: 14px !important;
}
.btn-stage-contract { display: flex; }
.btn-stage-save { display: flex; }

/* Contract panel — slides in once Open contract is clicked */
.contract-panel {
  animation: contractSlideIn 0.45s cubic-bezier(0.18, 0.89, 0.32, 1.15);
  border: 1.5px solid var(--accent-1) !important;
  background: var(--bg-3);
}
@keyframes contractSlideIn {
  from { opacity: 0; transform: translateY(-10px); max-height: 0; }
  to   { opacity: 1; transform: translateY(0); max-height: 2000px; }
}

.contract-doc-preview {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.director-pdf-frame {
  width: 100%;
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}
.director-row { flex-wrap: wrap; }
.director-row > .btn-ghost { margin-left: 8px; }
@media (max-width: 700px) {
  .director-pdf-frame { min-height: 420px; }
}
.contract-doc-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.contract-doc-meta .doc-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 48px;
  background: var(--accent-1);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  border-radius: 4px;
  flex-shrink: 0;
}
.contract-doc-meta .doc-name {
  font-weight: 700;
  color: var(--txt);
  font-size: 14px;
}
.contract-doc-meta .doc-meta {
  font-size: 12px;
  color: var(--txt-3);
}

.contract-body-preview {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--txt);
}
.contract-body-preview h4 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 800;
  color: var(--accent-1);
  letter-spacing: -0.2px;
}
.contract-body-preview p { margin: 6px 0; }
.contract-body-preview .contract-fine {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
  color: var(--txt-2);
  font-style: italic;
}

.review-sig-block { margin-top: 4px; }
.sig-meta-row { margin-top: 4px; }
.sig-meta-row input[readonly] { background: var(--bg-2); cursor: default; color: var(--txt-2); }

.contract-actions-row {
  margin-top: 14px;
  animation: contractSlideIn 0.4s ease;
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #fff;
  color: var(--txt);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  height: 40px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-secondary:hover {
  border-color: var(--accent-1);
  color: var(--accent-1);
  background: var(--accent-1-soft);
}

/* When buttons hit the saved state */
.btn-stage.is-done {
  background: #1e7a33 !important;              /* flat green (done) */
  border-color: #1e7a33 !important;
  cursor: default;
  pointer-events: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06) !important;
}

/* Welcome back small adjustments */
#screen-welcome-back.active {
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}
.welback-content .welcome-family {
  color: var(--accent-1);
  font-weight: 600;
}

/* ============================================================
   SCREEN — WELL DONE (post first-submit interstitial)
   ============================================================ */
#screen-well-done.active {
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at top, var(--bg-2) 0%, var(--bg) 70%);
  padding: 60px 24px 80px;
  min-height: 100vh;
}
.welldone-shell {
  position: relative;
  z-index: 10;
  max-width: 560px;
  width: 100%;
  text-align: center;
  animation: welcomePop 0.9s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
.welldone-eyebrow {
  color: var(--accent-1);
  font-size: 12px;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin: 0 0 18px;
  font-weight: 700;
}
.welldone-title {
  font-size: clamp(58px, 11vw, 110px);
  font-weight: 800;
  letter-spacing: -3px;
  margin: 0 0 8px;
  line-height: 0.95;
  color: var(--txt);
  background: linear-gradient(135deg, var(--accent-1) 0%, #ff5a3a 50%, var(--accent-1) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: welldoneShimmer 4s ease-in-out infinite;
}
.welldone-bang {
  color: var(--accent-2);
  -webkit-text-fill-color: var(--accent-2);
  font-style: italic;
  margin-left: 4px;
  display: inline-block;
  animation: welldoneBounce 1.4s ease-in-out infinite;
}
.welldone-name {
  font-size: 20px;
  font-weight: 500;
  color: var(--txt);
  margin: 12px 0 24px;
  letter-spacing: -0.3px;
}
.welldone-message {
  font-size: 16px;
  line-height: 1.65;
  color: var(--txt-2);
  margin: 0 auto 36px;
  max-width: 480px;
}
.welldone-foot {
  font-size: 15px;
  line-height: 1.7;
  color: var(--txt-2);
  margin: 36px 0 0;
  font-style: italic;
}
.welldone-foot strong {
  display: inline-block;
  margin-top: 4px;
  font-style: normal;
  font-weight: 700;
  color: var(--accent-1);
  letter-spacing: 0.3px;
}

/* Timeline */
.welldone-timeline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 28px 0 12px;
  flex-wrap: nowrap;
}
.welldone-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 0 0 auto;
}
.welldone-step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 2px solid var(--line);
  color: var(--txt-2);
  flex-shrink: 0;
  transition: all 0.3s;
}
.welldone-step.is-done .welldone-step-icon {
  background: var(--accent-1);
  border-color: var(--accent-1);
  color: var(--on-accent-1);
}
.welldone-step.is-active .welldone-step-icon {
  background: var(--bg);
  border-color: var(--accent-1);
  box-shadow: 0 0 0 4px var(--accent-1-soft);
}
.welldone-pulse-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-1);
  animation: welldonePulse 1.4s ease-in-out infinite;
}
.welldone-step-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--txt-2);
  text-align: center;
  max-width: 90px;
  line-height: 1.3;
}
.welldone-step.is-done .welldone-step-label,
.welldone-step.is-active .welldone-step-label {
  color: var(--txt);
}
.welldone-step-line {
  height: 2px;
  background: var(--line);
  flex: 1 1 auto;
  max-width: 60px;
  margin-bottom: 24px;
  border-radius: 1px;
}

@keyframes welldoneShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@keyframes welldoneBounce {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-12px) rotate(-6deg); }
}
@keyframes welldonePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

@media (max-width: 520px) {
  .welldone-step-line { max-width: 30px; }
  .welldone-step-label { font-size: 10.5px; max-width: 70px; }
}

.confetti, .balloons, .fireworks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.fireworks { z-index: 2; }

.firework-burst {
  position: absolute;
  width: 0;
  height: 0;
}
.firework-spark {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  left: 0;
  top: 0;
  opacity: 0;
  animation: fireworkSpark 1.5s cubic-bezier(0.15, 0.6, 0.3, 1) forwards;
}
@keyframes fireworkSpark {
  0% { transform: translate(0, 0) scale(1.4); opacity: 1; }
  30% { opacity: 1; }
  80% { opacity: 0.6; }
  100% { transform: translate(var(--tx), calc(var(--ty) + 30px)) scale(0.3); opacity: 0; }
}

.confetti-piece {
  position: absolute;
  width: 8px;
  height: 14px;
  top: -20px;
  opacity: 0;
  animation: confettiFall linear infinite;
}

@keyframes confettiFall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0.6; }
}

.balloon {
  position: absolute;
  bottom: -120px;
  width: 60px;
  height: 76px;
  border-radius: 50% 50% 50% 50% / 55% 55% 45% 45%;
  opacity: 0.85;
  animation: balloonRise 7s ease-in infinite;
}
.balloon::after {
  content: "";
  position: absolute;
  bottom: -28px;
  left: 50%;
  width: 1px;
  height: 28px;
  background: var(--line-2);
}

@keyframes balloonRise {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: 0.85; }
  100% { transform: translateY(-115vh) translateX(40px); opacity: 0.2; }
}

@keyframes welcomePop {
  0% { transform: scale(0.85); opacity: 0; }
  60% { transform: scale(1.02); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes fadeUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ============================================================
   SCREEN 3 — FORM
   ============================================================ */
#screen-form.active { display: block; padding: 0 0 80px; }

.form-header, .dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* extra right-padding reserves room for the fixed theme toggle (~60px) */
  padding: 18px 80px 18px 32px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-small {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.5px;
  color: var(--txt);
}

.progress-trail { display: flex; gap: 8px; }
.progress-trail .step {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--txt-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}
.progress-trail .step.done {
  background: var(--accent-1-soft);
  border-color: var(--accent-1);
  color: var(--accent-1);
}
.progress-trail .step.active {
  background: var(--accent-1);
  border-color: var(--accent-1);
  color: var(--on-accent-1);
}

.form-wrap { max-width: 1120px; margin: 0 auto; padding: 48px 32px 0; }

.form-intro { margin-bottom: 36px; }
.form-intro h2 {
  font-size: 28px;
  margin: 0 0 8px;
  letter-spacing: -0.5px;
  font-weight: 600;
  color: var(--txt);
}
.form-intro p { color: var(--txt-2); margin: 0; font-size: 14px; }

.dress-emoji {
  display: inline-block;
  font-size: 18px;
  margin-left: 4px;
  transform: translateY(1px);
}

/* ============================================================
   WIP card (Wing Yip Internal Portal — first-week training)
   ============================================================ */
.wip-card {
  background: linear-gradient(135deg, var(--bg-2), var(--accent-1-soft));
  border-color: var(--accent-1);
}
.wip-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}
.wip-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #fcd116, #c79900);
  color: #5a0612;
  font-weight: 900;
  letter-spacing: 0.5px;
  font-size: 17px;
  box-shadow: 0 4px 12px rgba(196, 20, 43, 0.2),
              inset 0 1px 0 rgba(255,255,255,0.5);
}
.wip-head h3 {
  margin: 0 0 2px;
  font-size: 17px;
  font-weight: 700;
}
.wip-head h3 strong { color: var(--accent-1); }
.wip-head p { margin: 0; }
.wip-open {
  background: var(--accent-1);
  color: #ffffff;
  text-decoration: none;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
  transition: filter 0.15s, transform 0.15s;
}
.wip-open:hover { filter: brightness(1.08); transform: translateY(-1px); }

.wip-modules {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wip-mod {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
}
.wip-mod-tick {
  font-size: 14px;
  line-height: 1;
}
.wip-mod-tick[data-state="pending"] { color: var(--txt-3); opacity: 0.45; }
.wip-mod-tick[data-state="done"] { color: #16a34a; }
.wip-mod.is-done { background: rgba(22, 163, 74, 0.06); border-color: rgba(22, 163, 74, 0.25); }
.wip-mod-dur { color: var(--txt-3); font-size: 12px; }

@media (max-width: 640px) {
  .wip-head { grid-template-columns: auto 1fr; }
  .wip-head .wip-open { grid-column: 1 / -1; justify-self: start; }
}

/* Survey deep-link in candidate modal */
.survey-link-row {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.survey-link-label {
  font-size: 12px;
  color: var(--txt-3);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.survey-link-box {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.survey-link-input {
  flex: 1;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-2);
  color: var(--txt-2);
  min-width: 0;
}
.survey-link-box .btn-ghost {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  font-size: 13px;
}

/* ============================================================
   SURVEY screen (post-WIP-training)
   ============================================================ */
#screen-survey.active {
  display: block;
}
.survey-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  backdrop-filter: blur(8px);
}
.survey-pill {
  background: var(--accent-1-soft);
  color: var(--accent-1);
}

.survey-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.survey-intro { margin-bottom: 28px; }
.survey-intro h2 {
  font-size: 30px;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.5px;
}
.survey-intro p { color: var(--txt-2); margin: 0; font-size: 14px; }

.survey-form { display: flex; flex-direction: column; gap: 18px; }

.survey-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 0;
}
.survey-card legend {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--accent-1);
  padding: 0 8px;
}
.survey-q {
  margin: 8px 0 16px;
  color: var(--txt);
  font-size: 15px;
  font-weight: 500;
}
.rating-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.rating-btn {
  appearance: none;
  border: 1.5px solid var(--line);
  background: var(--bg);
  border-radius: 12px;
  padding: 14px 0;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  color: var(--txt-2);
  cursor: pointer;
  transition: all 0.15s;
}
.rating-btn:hover { border-color: var(--accent-1); color: var(--accent-1); transform: translateY(-1px); }
.rating-btn.is-selected {
  background: var(--accent-1);
  border-color: var(--accent-1);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(196, 20, 43, 0.3);
}
.rating-legend {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--txt-3);
  margin-top: 8px;
  letter-spacing: 0.3px;
}

.survey-text-label { display: block; }
.survey-text-label textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  background: var(--bg);
  color: var(--txt);
  resize: vertical;
  box-sizing: border-box;
}
.survey-anon {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--txt-2);
  cursor: pointer;
}

/* Thank you screen */
#screen-survey-done.active {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  min-height: 100vh;
}
.thanks-shell {
  max-width: 480px;
  text-align: center;
  animation: fadeUp 0.6s ease-out;
}
.thanks-icon {
  font-size: 64px;
  margin-bottom: 16px;
  display: inline-block;
  animation: thanksBounce 0.8s ease-out;
}
@keyframes thanksBounce {
  0% { transform: scale(0.4) rotate(-15deg); opacity: 0; }
  60% { transform: scale(1.15) rotate(4deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.thanks-shell h1 {
  font-size: 32px;
  letter-spacing: -0.6px;
  margin: 0 0 12px;
  color: var(--txt);
}
.thanks-shell p {
  color: var(--txt-2);
  font-size: 15px;
  margin: 0 0 24px;
  line-height: 1.55;
}
.thanks-stats {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--txt-2);
}
.thanks-stats strong { color: var(--accent-1); font-size: 16px; }

/* Admin survey summary */
.survey-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin: 16px 0;
}
.survey-sum-tile {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}
.survey-sum-tile .sst-num {
  font-size: 24px;
  font-weight: 800;
  color: var(--accent-1);
  letter-spacing: -0.5px;
}
.survey-sum-tile .sst-lbl {
  font-size: 11px;
  color: var(--txt-3);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-top: 4px;
}
.survey-feedback-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.survey-feedback-item {
  appearance: none;
  font-family: inherit;
  text-align: left;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent-1);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--txt-2);
  line-height: 1.5;
  cursor: pointer;
  overflow: hidden;
  min-width: 0;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.survey-feedback-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(196, 20, 43, 0.10);
  border-left-color: #8a0a20;
}
.survey-feedback-item .sfi-main {
  min-width: 0;
  overflow: hidden;
}
.survey-feedback-item .sfi-meta {
  color: var(--txt-3);
  font-size: 11px;
  margin-bottom: 4px;
  letter-spacing: 0.3px;
}
/* Truncate to 2 lines + break anywhere so a single long token can't push the layout */
.survey-feedback-item .sfi-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.survey-feedback-item .sfi-score {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-1);
  background: var(--accent-1-soft);
  padding: 6px 10px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.survey-feedback-item .sfi-arrow {
  color: var(--txt-3);
  font-size: 16px;
  margin-left: 4px;
}

/* Survey modal — full detail with per-question rating chips */
.survey-modal-card { width: min(640px, 100%); }
.survey-modal-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 18px;
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 18px;
}
.survey-modal-meta .smm-k {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--txt-3);
  margin-bottom: 2px;
}
.survey-modal-meta .smm-v {
  font-size: 14px;
  color: var(--txt);
  font-weight: 600;
}
.survey-modal-meta .smm-pill {
  display: inline-block;
  background: var(--accent-1);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.survey-rating-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}
.survey-rating-line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.srl-label { font-size: 13px; font-weight: 600; color: var(--txt); }
.srl-chips {
  display: inline-flex;
  gap: 4px;
}
.srl-chip {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--txt-3);
  background: var(--bg);
}
.srl-chip.is-on {
  background: var(--accent-1);
  border-color: var(--accent-1);
  color: #fff;
  box-shadow: 0 2px 6px rgba(196, 20, 43, 0.35);
}
.srl-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-1);
  min-width: 36px;
  text-align: right;
}

.survey-modal-feedback-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--txt-3);
  margin-bottom: 6px;
}
.survey-modal-feedback {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent-1);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--txt);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-height: 240px;
  overflow-y: auto;
}
.survey-modal-feedback.is-empty {
  color: var(--txt-3);
  font-style: italic;
  border-left-color: var(--line);
}

.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin: 0 0 20px;
}
.card legend {
  padding: 0 8px;
  font-size: 12px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--accent-1);
  font-weight: 700;
}
.card legend .muted {
  color: var(--txt-3);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  margin-left: 4px;
}

.card label { display: block; margin: 16px 0 0; font-size: 13px; color: var(--txt-2); }

.card input[type="text"],
.card input[type="tel"],
.card select {
  width: 100%;
  height: 46px;
  margin-top: 6px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--txt);
  padding: 0 14px;
  font-size: 15px;
  outline: none;
  transition: all 0.15s;
  font-family: inherit;
}
.card input:focus, .card select:focus {
  border-color: var(--accent-1);
  background: var(--bg);
}
.card select { appearance: none; cursor: pointer; }

.row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.upload-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.upload-row.upload-row--three {
  grid-template-columns: 1fr 1fr 1fr;
  gap: 22px;
  margin-top: 18px;
}
.upload-row.upload-row--three + .upload-row.upload-row--three { margin-top: 22px; }
.upload-row.upload-row--three .upload-tile { padding: 20px 18px; min-height: 150px; }
@media (max-width: 720px) {
  .upload-row.upload-row--three { grid-template-columns: 1fr; gap: 16px; }
  .upload-row.upload-row--three .upload-tile { min-height: 0; }
}
.upload-row.hidden { display: none; }
.hidden { display: none !important; }

/* "Bring originals on Day 1" notice — closes the Documents fieldset */
.originals-notice {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: 18px;
  padding: 14px 16px;
  background: var(--accent-1-soft);
  border: 1px solid var(--accent-1-soft);
  border-left: 3px solid var(--accent-1);
  border-radius: var(--radius-sm);
  color: var(--txt);
  line-height: 1.5;
}
.originals-notice .originals-icon {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--accent-1);
}
.originals-notice strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-1);
  margin-bottom: 4px;
  letter-spacing: 0.1px;
}
.originals-notice p {
  margin: 0;
  font-size: 13.5px;
  color: var(--txt-2);
}
.certify-standalone { margin-top: 18px; }

.submit-missing-hint {
  margin-top: 10px;
  font-size: 13px;
  color: var(--accent-1);
  text-align: center;
  line-height: 1.5;
}
.submit-missing-hint a {
  color: var(--accent-1);
  text-decoration: underline;
  text-decoration-style: dotted;
  font-weight: 600;
}
.submit-missing-hint a:hover { text-decoration-style: solid; }

.upload-tile {
  position: relative;
  background: var(--bg-3);
  border: 1.5px dashed var(--line-2);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
}
.upload-tile:not(.rtw-tile):hover { border-color: var(--accent-1); background: var(--bg-2); }
.upload-tile:not(.rtw-tile) > input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-label { display: block; font-size: 13px; color: var(--txt-2); margin-bottom: 8px; font-weight: 500; }
.upload-cta { color: var(--accent-1); font-size: 13px; font-weight: 600; }

/* Required tiles — always solid red frame (replaces the dashed default).
   Optional tiles (no .upload-tile--required) keep the dashed grey style. */
.upload-tile.upload-tile--required {
  border: 1.5px solid var(--accent-1);
  background: var(--bg-2);
}
.upload-tile.upload-tile--required:hover { background: var(--bg-3); }

/* "N/A" tick — every Documents tile needs a value OR this box ticked before the
   form can be submitted. Sits above the invisible full-tile file input (which is
   position:absolute; inset:0), hence the z-index. */
.na-toggle {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 3px 9px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--txt-2);
  background: var(--bg-1);
  cursor: pointer;
  user-select: none;
}
.na-toggle:hover { border-color: var(--accent-1); color: var(--accent-1); }
.na-toggle input { width: 14px; height: 14px; margin: 0; cursor: pointer; accent-color: var(--accent-1); }

/* Ticked: the tile is declared not applicable — grey it out so it reads as
   deliberately empty rather than forgotten. */
.upload-tile--na {
  opacity: 0.55;
  border-style: dashed !important;
  border-color: var(--line-2) !important;
  background: var(--bg-3) !important;
}
.upload-tile--na .na-toggle {
  opacity: 1;
  border-color: var(--accent-1);
  color: var(--accent-1);
}

/* Highlight a missing required field so the candidate knows what's left.
   Applied by JS (refreshMissingHighlights) when certify is ticked but a
   required tile still has no value. */
.upload-tile.field-missing,
label.field-missing input,
label.field-missing select,
label.field-missing textarea {
  border-color: var(--accent-1) !important;
  box-shadow: 0 0 0 3px rgba(196, 20, 43, 0.15);
  background: rgba(196, 20, 43, 0.05);
}
.upload-tile.field-missing { animation: field-pulse 1.4s ease-in-out 1; }
@keyframes field-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(196, 20, 43, 0.35); }
  50%  { box-shadow: 0 0 0 8px rgba(196, 20, 43, 0.10); }
  100% { box-shadow: 0 0 0 3px rgba(196, 20, 43, 0.15); }
}

/* ---- Right to Work tile: tabs + share code ---- */
.rtw-tile {
  text-align: left;
  cursor: default;
}
.rtw-tile .upload-label { text-align: center; }

.rtw-tabs {
  display: flex;
  gap: 3px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  margin: 0 auto 12px;
  width: fit-content;
}
.rtw-tab {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--txt-2);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: all 0.15s;
}
.rtw-tab.active {
  background: var(--accent-1);
  color: var(--on-accent-1);
}
.rtw-tab:not(.active):hover { color: var(--accent-1); }

.rtw-pane { display: none; }
.rtw-pane.active { display: block; }

.rtw-upload-target {
  position: relative;
  display: block;
  text-align: center;
  padding: 8px 0 4px;
  cursor: pointer;
}
.rtw-upload-target input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.share-code-inputs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.share-code-input {
  width: 72px;
  height: 40px;
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  color: var(--txt);
  text-align: center;
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  outline: none;
  letter-spacing: 2px;
  padding: 0 6px;
  transition: all 0.15s;
}
.share-code-input:focus { border-color: var(--accent-1); box-shadow: 0 0 0 3px var(--accent-1-soft); }
.share-code-input.filled { border-color: var(--accent-1); }
.sc-sep { color: var(--txt-3); font-weight: 700; font-size: 14px; }
.sc-status { margin-top: 8px; }
.sc-status.complete { color: var(--accent-1); }

.nin-tile {
  text-align: left;
  cursor: default;
}
.nin-tile .upload-label { text-align: center; }
.nin-input {
  display: block;
  width: 100%;
  max-width: 220px;
  margin: 0 auto;
  height: 44px;
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  color: var(--txt);
  text-align: center;
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  outline: none;
  padding: 0 10px;
  transition: all 0.15s;
}
.nin-input::placeholder { color: var(--txt-3); letter-spacing: 2px; font-weight: 500; }
.nin-input:focus { border-color: var(--accent-1); box-shadow: 0 0 0 3px var(--accent-1-soft); }
.nin-input.valid { border-color: var(--accent-1); }
.nin-input.invalid { border-color: #c4142b; }
#nin-hint { margin-top: 8px; }
#nin-hint.complete { color: var(--accent-1); }
#nin-hint.error { color: #c4142b; }

.toggle {
  display: flex !important;
  align-items: center;
  gap: 10px;
  margin-top: 20px !important;
  cursor: pointer;
  color: var(--txt) !important;
  font-size: 14px !important;
}
.toggle input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent-1); }
.toggle--right-align {
  justify-content: flex-end;
  /* sit roughly under the RTW column (right half of the 2-tile upload-row above) */
  padding-right: 8px;
}

.btn-submit { width: 100%; margin-top: 12px; }

/* ============================================================
   SCREEN 4 — DASHBOARD
   ============================================================ */
#screen-dashboard.active { display: block; padding-bottom: 80px; }

.dash-hello { font-size: 15px; font-weight: 600; color: var(--txt); }
.dash-sub { font-size: 12px; color: var(--txt-3); letter-spacing: 0.4px; }

.dash-status {
  font-size: 11px;
  color: var(--txt-2);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 600;
  margin-right: 64px;
}
.dash-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a85a;
  box-shadow: 0 0 8px #16a85a;
}

.dash-wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 36px 24px 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hero-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  position: relative;
  overflow: hidden;
}
.hero-card::before { display: none; }   /* no red glow (logbook white) */

.hero-eyebrow {
  color: var(--accent-1);
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: 12px;
  margin: 0 0 8px;
  font-weight: 700;
}
.hero-day {
  font-size: 56px;
  margin: 0;
  font-weight: 700;
  letter-spacing: -2px;
  line-height: 1;
  color: var(--txt);
}
.hero-date { margin: 10px 0 0; color: var(--txt-2); font-size: 16px; }

.countdown {
  text-align: center;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 28px;
  min-width: 120px;
}
.cd-num {
  font-size: 44px;
  font-weight: 700;
  color: var(--accent-1);
  line-height: 1;
}
.cd-lbl {
  font-size: 11px;
  color: var(--txt-3);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 6px;
  font-weight: 600;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } }

.card-d {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--card-shadow);
}
.card-d h3 {
  margin: 0 0 16px;
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--txt-3);
  font-weight: 700;
}
.card-d .badge {
  background: var(--accent-2-soft);
  color: var(--accent-1);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: none;
  letter-spacing: 0.3px;
  margin-left: 8px;
  font-weight: 600;
}

.contact-row { display: flex; gap: 16px; align-items: center; }
.avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--on-accent-1);
  font-size: 17px;
  flex-shrink: 0;
}
.contact-name { font-weight: 600; font-size: 17px; margin-bottom: 2px; color: var(--txt); }
.contact-role { color: var(--txt-3); font-size: 13px; margin-bottom: 6px; }
.link-accent { color: var(--accent-1); text-decoration: none; font-size: 14px; font-weight: 600; }
.link-accent:hover { text-decoration: underline; }

.addr { line-height: 1.65; color: var(--txt); margin: 0 0 12px; font-size: 15px; }

/* ============================================================
   STORE MAP — polished aerial walkthrough
   ============================================================ */
.store-map-card {
  padding: 24px;
}
.store-map-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.store-map-header h3 { margin: 0 0 2px; }
.store-map-sub { margin: 0; }

/* Simple aerial reference (park3.jpg) — replaces the SVG cardinals layout */
.store-map-frame {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #f5f1e6;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.08);
}
.store-map-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
}
.store-map-leaflet {
  width: 100%;
  height: 460px;
  border-radius: 14px;
  z-index: 1;
}
.store-map-leaflet .leaflet-control-attribution {
  font-size: 9px;
  background: rgba(255, 255, 255, 0.85);
}
/* Custom marker styles */
.wy-marker {
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  font-family: system-ui, -apple-system, sans-serif;
}
.wy-marker--park { background: #5ec048; }
.wy-marker--entry { background: #9b30c4; }
.wy-marker--start { background: #1976d2; }
/* New 2026-05-17 — Alfre's annotation: P=blue, store entrance=green, carpark entry=blue star */
.wy-marker--parking-blue { background: #1976d2; }
.wy-marker--entry-green { background: #2e9d3a; }

/* Leaflet popup — branded photo card */
.wy-pop { width: 280px; font-family: system-ui, -apple-system, sans-serif; }
.wy-pop-title {
  font-weight: 800;
  font-size: 14px;
  color: #1a1a1a;
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}
.wy-pop-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.wy-pop-cap {
  margin-top: 8px;
  font-size: 12px;
  color: #555;
  line-height: 1.4;
}
.leaflet-popup-content-wrapper { border-radius: 12px; padding: 4px; }
.leaflet-popup-content { margin: 12px; }
.map-legend {
  list-style: none;
  margin: 0;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 13px;
  font-weight: 600;
  color: #2a2a2a;
}
.map-legend li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.legend-swatch {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}
.legend-swatch--park {
  background: #5ec048;
  border-color: #3e8a2f;
}
.legend-swatch--walk {
  background: #fcd116;
  border-color: #c4a000;
  border-radius: 2px;
  position: relative;
}
.legend-swatch--walk::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-left: 6px solid #6b5400;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}
.legend-swatch--entry {
  background: #9b30c4;
  border-color: #5e1c7a;
  border-radius: 50%;
}
/* New 2026-05-17 swatches matching map markers (carpark entry = blue star,
   parking = blue P, store entrance = green dot) */
.legend-swatch--start {
  background: #1976d2;
  border-color: #0f4c8a;
  border-radius: 50%;
  position: relative;
}
.legend-swatch--start::after {
  content: "★";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}
.legend-swatch--parking {
  background: #1976d2;
  border-color: #0f4c8a;
  border-radius: 50%;
  position: relative;
}
.legend-swatch--parking::after {
  content: "P";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}
.legend-swatch--store-entry {
  background: #2e9d3a;
  border-color: #1b6325;
  border-radius: 50%;
}

/* Candidate row action buttons — exact same look as .btn-primary
   (gradient + pill + glossy shine ::before + multi-layer shadows + text-shadow),
   just scaled down to fit in the row. */
.cand-action-btn {
  position: relative;
  height: 36px;
  padding: 0 14px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  overflow: hidden;
  transition: transform 0.18s, filter 0.18s, box-shadow 0.18s;

  /* Default = neutral flat (for Edit) */
  background: #fff;
  color: #2a2a2a;
  border: 1px solid var(--line-2);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.cand-action-btn::before { display: none; }
.cand-action-btn > * { position: relative; z-index: 1; }
.cand-action-btn:hover { background: var(--bg-2); }
.cand-action-btn:active { background: var(--bg-3); }

/* RED variant — identical gradient as .btn-primary (Generate code & create) */
/* Destructive action — outlined, lower visual weight than the red CTAs */
.cand-action-btn--danger {
  background: transparent;
  color: #9c0e22;
  border: 1.5px solid rgba(156, 14, 34, 0.35);
  box-shadow: none;
  text-shadow: none;
  font-weight: 700;
}
.cand-action-btn--danger::before { display: none; }
.cand-action-btn--danger:hover {
  background: rgba(156, 14, 34, 0.08);
  border-color: #c4142b;
  color: #c4142b;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(196, 20, 43, 0.18);
}
body[data-theme="dark"] .cand-action-btn--danger {
  color: #e63950;
  border-color: rgba(230, 57, 80, 0.4);
}
body[data-theme="dark"] .cand-action-btn--danger:hover {
  background: rgba(230, 57, 80, 0.14);
  color: #ff5a73;
}

.cand-action-btn--red {
  background: var(--accent-1);                  /* flat WY red */
  color: #ffffff;
  border: 1px solid var(--accent-1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.cand-action-btn--red:hover {
  background: #9c0e22;
  border-color: #9c0e22;
}

/* GREEN variant — signals the action is already done (welcome sent, contract sent, etc.).
   Same shape and shine as the red, just the success colour. */
.cand-action-btn--green,
.cand-upload-btn.is-done {
  background: #1f7a37 !important;               /* flat green (done) */
  color: #ffffff !important;
  border: 1px solid #1f7a37 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06) !important;
  text-shadow: none !important;
}
.cand-action-btn--green:hover:not(:disabled),
.cand-upload-btn.is-done:hover {
  background: #16562a !important;
  border-color: #16562a !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06) !important;
}
/* Green variants override the disabled grayscale so a finished step stays clearly green */
.cand-action-btn--green:disabled,
.cand-upload-btn.is-done:disabled {
  opacity: 1;
  filter: none;
  cursor: default;
}

.cand-action-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  filter: grayscale(0.55);
  transform: none;
}
.cand-action-btn:disabled:hover {
  transform: none;
  filter: grayscale(0.55);
}

/* Survey CTA card on the candidate dashboard (replaced the old WIP card) */
.survey-cta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.survey-cta-card h3 { margin: 0 0 4px; }
.survey-cta-card p { margin: 0; }
.survey-cta-card .btn-primary { flex-shrink: 0; }
.store-map-frame-legacy { display: none !important; }

.map-replay {
  appearance: none;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-1-soft);
  color: var(--accent-1);
  border: 1px solid var(--accent-1);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: all 0.15s;
  flex-shrink: 0;
}
.map-replay:hover {
  background: var(--accent-1);
  color: #fff;
  transform: translateY(-1px);
}

/* Legend chips next to map header */
.map-legend {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--txt-2);
}
.map-legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.map-leg-sw {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1.5px solid currentColor;
  display: inline-block;
}
.map-leg-sw--park  { background: #22c55e; border-color: #15803d; }
.map-leg-sw--walk  { background: #facc15; border-color: #b08407; }
.map-leg-sw--entry { background: #9333ea; border-color: #6b21a8; border-radius: 50%; }

/* ============================================================
   Stylized illustrated store guide (NOT a literal map)
   ============================================================ */
.store-guide {
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--line);
  box-shadow: 0 12px 32px rgba(0,0,0,0.08);
  margin-bottom: 18px;
}
.store-guide-svg {
  display: block;
  width: 100%;
  height: auto;
}

/* Zone hover state */
.sg-zone {
  cursor: pointer;
  transition: filter 0.25s;
}
.sg-zone:hover { filter: brightness(1.04) drop-shadow(0 6px 16px rgba(196,20,43,0.12)); }
.sg-zone.is-focus rect:first-of-type {
  stroke-width: 3;
}
.sg-zone--park.is-focus rect:first-of-type { stroke: #4ea832; }
.sg-zone--walk.is-focus rect:first-of-type { stroke: #c79900; }
.sg-zone--enter.is-focus rect:first-of-type { stroke: #c4142b; }

/* Pulsing ring on the green "park here" spot */
.sg-pulse {
  transform-origin: center;
  transform-box: fill-box;
  animation: sgPulse 2s ease-out infinite;
}
@keyframes sgPulse {
  0%   { opacity: 0.7; r: 14; }
  100% { opacity: 0;   r: 28; }
}

/* Walking path draw-in */
.sg-path-anim {
  stroke-dasharray: 500;
  stroke-dashoffset: 500;
  animation: sgPathDraw 2.4s cubic-bezier(0.25, 0.8, 0.3, 1) 0.4s forwards;
}
@keyframes sgPathDraw {
  to { stroke-dashoffset: 0; }
}

/* Door glow pulse */
.sg-door-glow {
  transform-origin: center;
  transform-box: fill-box;
  animation: sgDoorBreathe 2.4s ease-in-out infinite;
}
@keyframes sgDoorBreathe {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50%      { opacity: 0.85; transform: scale(1.15); }
}

/* Door pointer bounce */
.sg-door-pointer {
  animation: sgPointerBounce 1.2s ease-in-out infinite;
}
@keyframes sgPointerBounce {
  0%, 100% { transform: translate(100px, 230px); }
  50%      { transform: translate(100px, 224px); }
}

/* Walker glow */
.sg-walker {
  filter: drop-shadow(0 0 6px rgba(196, 20, 43, 0.4));
}
.sg-walker circle:first-child {
  animation: walkerGlow 1.6s ease-in-out infinite;
}

/* --- Aerial guide (ag-*) following park3 structure --- */
.ag-zone {
  cursor: pointer;
  transition: filter 0.2s;
}
.ag-zone:hover { filter: brightness(1.06) drop-shadow(0 4px 10px rgba(0,0,0,0.18)); }
.ag-zone.is-focus rect:first-of-type {
  stroke-width: 4;
}
.ag-pin {
  cursor: pointer;
  opacity: 0;
  transform-origin: center bottom;
  transform-box: fill-box;
  animation: pinPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  transition: filter 0.2s;
}
.ag-pin:hover { filter: brightness(1.1) drop-shadow(0 4px 8px rgba(0,0,0,0.25)); }
.ag-pin--arrive { animation-delay: 0.5s; }
.ag-pin--park   { animation-delay: 1.6s; }
.ag-pin--enter  { animation-delay: 3.6s; }
.ag-pin.is-focus circle:nth-child(2) {
  animation: pinBounce 0.6s ease-in-out infinite alternate;
}

.ag-pulse {
  transform-origin: center;
  transform-box: fill-box;
  animation: pulseRing 1.8s ease-out infinite;
}
.ag-pulse-big {
  transform-origin: center;
  transform-box: fill-box;
  animation: pulseRingBig 1.8s ease-out infinite;
}
@keyframes pulseRingBig {
  0%   { transform: scale(0.5); opacity: 0.9; }
  100% { transform: scale(2.3); opacity: 0;   }
}

.drive-path-anim {
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: pathDraw 1.6s cubic-bezier(0.25, 0.8, 0.3, 1) 0.4s forwards;
}
.walk-path-anim {
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: pathDraw 2.6s cubic-bezier(0.25, 0.8, 0.3, 1) 1.9s forwards;
}
.driver rect:first-child {
  animation: walkerGlow 1.6s ease-in-out infinite;
}
.walker circle:first-child {
  animation: walkerGlow 1.4s ease-in-out infinite;
}

/* Hero photo + hotspot overlay */
.store-map-photo-wrap {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 12px 32px rgba(0,0,0,0.10),
              inset 0 0 0 2px rgba(196, 20, 43, 0.04);
  margin-bottom: 18px;
  background: #1a0608;
}
.store-map-photo {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.store-map-photo-wrap:hover .store-map-photo {
  transform: scale(1.015);
}
.store-map-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.store-map-overlay .hotspot {
  pointer-events: auto;
  cursor: pointer;
  transition: filter 0.2s;
}
.store-map-overlay .hotspot:hover {
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.6));
}
.store-map-overlay .hotspot-pulse {
  transform-origin: center;
  transform-box: fill-box;
  animation: hotspotPulse 2s ease-out infinite;
}
@keyframes hotspotPulse {
  0%   { opacity: 0.95; r: 1.5;  stroke-width: 0.5; }
  100% { opacity: 0;    r: 5.5;  stroke-width: 0.1; }
}
.store-map-overlay .hotspot.is-focus circle:last-child {
  animation: hotspotBounce 0.6s ease-in-out infinite alternate;
}
@keyframes hotspotBounce {
  from { transform: scale(1); }
  to   { transform: scale(1.4); }
}

.store-map-credit {
  position: absolute;
  bottom: 10px;
  right: 12px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.2px;
  font-style: italic;
  pointer-events: none;
}
@media (max-width: 480px) {
  .store-map-credit { font-size: 10px; padding: 3px 8px; }
}

.store-map-frame {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: inset 0 0 0 2px rgba(196, 20, 43, 0.05),
              0 8px 24px rgba(0, 0, 0, 0.08);
  background: var(--bg-2);
  margin-bottom: 18px;
}
.store-map-svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Drive path (blue) — draws first */
.drive-path-anim {
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: pathDraw 2s cubic-bezier(0.25, 0.8, 0.3, 1) 0.3s forwards;
}
/* Walking path (yellow) — draws after */
.walk-path-anim {
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: pathDraw 2.8s cubic-bezier(0.25, 0.8, 0.3, 1) 2.3s forwards;
}
@keyframes pathDraw {
  to { stroke-dashoffset: 0; }
}

/* Car marker glow */
.driver rect:first-child {
  animation: walkerGlow 1.6s ease-in-out infinite;
}

/* Pin pop-in (staggered) */
.map-pin {
  opacity: 0;
  transform-origin: center bottom;
  transform-box: fill-box;
  animation: pinPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  cursor: pointer;
  transition: filter 0.2s;
}
.map-pin:hover { filter: brightness(1.1) drop-shadow(0 4px 8px rgba(0,0,0,0.3)); }
.map-pin.is-focus { animation: pinBounce 0.6s ease-in-out infinite alternate; }
.map-pin--arrive { animation-delay: 0.6s; }
.map-pin--park   { animation-delay: 2.4s; }
.map-pin--walk   { animation-delay: 3.6s; }
.map-pin--entry  { animation-delay: 4.6s; }
@keyframes pinPop {
  0%   { opacity: 0; transform: translateY(-30px) scale(0.5); }
  60%  { opacity: 1; transform: translateY(4px)   scale(1.1); }
  100% { opacity: 1; transform: translateY(0)     scale(1); }
}
@keyframes pinBounce {
  from { transform: translateY(0); }
  to   { transform: translateY(-4px); }
}

/* Pulse ring on arrival pin */
.pulse-ring {
  transform-origin: center;
  transform-box: fill-box;
  animation: pulseRing 1.8s ease-out infinite;
}
@keyframes pulseRing {
  0%   { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(2.2); opacity: 0;   }
}

/* Region (parking) hover */
.map-region {
  cursor: pointer;
  transition: filter 0.2s;
}
.map-region:hover { filter: brightness(1.08); }
.map-region--park.is-focus path { stroke-width: 4; }

/* Walker dot small glow */
.walker circle:first-child {
  animation: walkerGlow 1.4s ease-in-out infinite;
}
@keyframes walkerGlow {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(196, 20, 43, 0.6)); }
  50%      { filter: drop-shadow(0 0 10px rgba(196, 20, 43, 0.95)); }
}

/* Step walkthrough */
.map-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
@media (max-width: 1080px) {
  .map-steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 580px) {
  .map-steps { grid-template-columns: 1fr; }
}
.map-step {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  padding: 12px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
  align-items: start;
}
.map-step:hover {
  transform: translateY(-2px);
  border-color: var(--accent-1);
  box-shadow: 0 8px 20px rgba(196, 20, 43, 0.1);
}
.map-step.is-active {
  border-color: var(--accent-1);
  background: linear-gradient(160deg, var(--bg-2), var(--accent-1-soft));
  box-shadow: 0 6px 16px rgba(196, 20, 43, 0.18);
}
.map-step-n {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent-1);
  color: var(--accent-1);
  font-size: 14px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.map-step.is-active .map-step-n {
  background: var(--accent-1);
  color: #fff;
}

/* Map symbol markers — match the Leaflet map markers exactly */
.map-step-n--star {
  background: #1976d2;
  border-color: #0f4c8a;
  color: #ffffff;
  font-size: 15px;
}
.map-step-n--parking {
  background: #1976d2;
  border-color: #0f4c8a;
  color: #ffffff;
  font-size: 13px;
}
.map-step-n--walk {
  background: #fcd116;
  border-color: #c4a000;
  border-radius: 4px;
}
.map-step-n--walk::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 8px solid #6b5400;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  display: block;
}
.map-step-n--entry {
  background: #2e9d3a;
  border-color: #1b6325;
}
/* When active (step selected), keep symbol colour — just add a subtle accent ring */
.map-step.is-active .map-step-n--star,
.map-step.is-active .map-step-n--parking,
.map-step.is-active .map-step-n--walk,
.map-step.is-active .map-step-n--entry {
  background: inherit;
  color: inherit;
  box-shadow: 0 0 0 3px var(--accent-1-soft), 0 2px 6px rgba(0, 0, 0, 0.15);
}
.map-step-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.map-step-body strong {
  font-size: 13px;
  color: var(--txt);
  letter-spacing: -0.1px;
  line-height: 1.3;
}
.map-step-body span {
  font-size: 12px;
  color: var(--txt-2);
  line-height: 1.45;
}

/* Photo viewer card (shows the real photo for each step) */
.map-photo-card {
  position: relative;
  margin-top: 14px;
  padding: 0;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent-1);
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 360px) 1fr;
  gap: 0;
  align-items: stretch;
  box-shadow: 0 10px 28px rgba(0,0,0,0.10);
  animation: photoSlide 0.35s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.map-photo-card.hidden { display: none; }
@keyframes photoSlide {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);    }
}
.map-photo-card img {
  width: 100%;
  height: 100%;
  max-height: 240px;
  object-fit: cover;
  display: block;
  background: #000;
}
.map-photo-cap {
  padding: 16px 20px;
  font-size: 14px;
  color: var(--txt);
  line-height: 1.5;
  display: flex;
  align-items: center;
  font-weight: 500;
}
.map-photo-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  line-height: 1;
}
.map-photo-close:hover { background: var(--accent-1); }
@media (max-width: 640px) {
  .map-photo-card { grid-template-columns: 1fr; }
  .map-photo-card img { max-height: 200px; }
}

/* Fallback (non-Birmingham branches) */
.store-map-fallback {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 30px 22px;
  background: var(--bg-2);
  border: 1px dashed var(--accent-1);
  border-radius: 14px;
}
.store-map-fallback.hidden { display: none; }
.map-fb-icon { font-size: 32px; }
.store-map-fallback strong { font-size: 15px; color: var(--txt); display: block; margin-bottom: 4px; }
.store-map-fallback p { margin: 0; }

/* Legacy fallback kept for any non-rewritten card */
.map-mock {
  background: var(--bg-3);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  margin-bottom: 12px;
}
.map-mock svg { width: 100%; height: auto; display: block; }

.muted { color: var(--txt-3); }
.muted-li { color: var(--txt-3); font-size: 13px; }
.small { font-size: 13px; }

.dress-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 600px) { .dress-grid { grid-template-columns: 1fr; } }

.dress-label {
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 10px;
  font-weight: 700;
}
.dress-label.provides { color: var(--accent-1); }
.dress-label.bring { color: var(--accent-2); }
body[data-theme="light"][data-brand="didi"] .dress-label.bring,
body[data-theme="light"][data-brand="wy"] .dress-label.bring { color: #b88a00; }

.dress-col ul {
  margin: 0;
  padding-left: 18px;
  color: var(--txt);
  line-height: 1.9;
  font-size: 15px;
}

/* ============================================================
   CORE VALUES — full-bleed + WY uniform SVG figures
   ============================================================ */
.values-card {
  background: linear-gradient(135deg, var(--bg-2), var(--accent-1-soft));
  /* break out of dash-wrap (880px) to span full viewport */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  border-left: none;
  border-right: none;
  border-radius: 0;
  padding: 48px clamp(20px, 5vw, 64px);
}

.values-inner {
  max-width: 1280px;
  margin: 0 auto;
}

.values-card h3 {
  text-align: center;
  font-size: 15px;
  letter-spacing: 2px;
  margin-bottom: 32px;
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
@media (max-width: 980px) { .values-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .values-grid { grid-template-columns: 1fr; } }

.value-tile {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 18px 24px;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.42s cubic-bezier(0.2, 0.8, 0.2, 1),
              opacity 0.42s cubic-bezier(0.2, 0.8, 0.2, 1),
              border-color 0.25s, box-shadow 0.25s, filter 0.42s;
}

@media (hover: hover) {
  .values-grid:hover .value-tile {
    transform: scale(0.96);
    opacity: 0.78;
    filter: saturate(0.9);
  }
  .values-grid:hover .value-tile:hover {
    transform: scale(1.05);
    opacity: 1;
    filter: saturate(1);
    border-color: var(--accent-1);
    box-shadow: 0 18px 38px rgba(0,0,0,0.10);
    z-index: 2;
  }
}

.value-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--txt);
  letter-spacing: -0.3px;
  line-height: 1.25;
}

/* ---- value photo (flat illustration from wy_pack) ---- */
.value-photo {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 200px;
  padding: 8px 0 4px;
  overflow: hidden;
  border-radius: 12px;
}
.value-photo img {
  width: 100%;
  height: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
  border-radius: 12px;
}
/* For SVG flat-illustrations: show the whole picture, no crop. */
.value-photo.value-illustration img {
  object-fit: contain;
  background: transparent;
}

/* ---- back-to-selector button ---- */
.back-btn {
  position: absolute;
  top: 24px;
  left: 24px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--txt-2);
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.15s;
  z-index: 50;
}
.back-btn:hover { border-color: var(--accent-1); color: var(--accent-1); }

/* ============================================================
   Brand logo mini (form + dashboard headers)
   ============================================================ */
.brand-logo-mini {
  height: 44px;
  min-width: 44px;
  max-width: 130px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}
.brand-logo-mini img {
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

/* ============================================================
   Staff login link (selector footer)
   ============================================================ */
.staff-link {
  margin-top: 12px;
  background: transparent;
  border: none;
  color: var(--txt-3);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  letter-spacing: 0.3px;
  padding: 8px 14px;
  border-radius: 999px;
  transition: all 0.15s;
}
.staff-link:hover {
  color: var(--accent-1);
  background: var(--accent-1-soft);
}

/* ============================================================
   Contract + E-signature
   ============================================================ */
.contract-card { background: var(--bg-2); }

/* ============================================================
   ABOUT YOU card — short bio + optional photo
   ============================================================ */
.intro-card {
  background: linear-gradient(135deg, var(--bg-2), var(--accent-1-soft));
  border-color: var(--accent-1);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.intro-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--txt-2);
}
.intro-card textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--txt);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  resize: vertical;
}
.intro-card textarea:focus {
  outline: none;
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(196, 20, 43, 0.15);
}
.intro-card textarea::placeholder {
  color: var(--txt-3);
  opacity: 0.75;
  font-style: italic;
}
.char-counter {
  font-size: 11px;
  color: var(--txt-3);
  align-self: flex-end;
}
.char-counter.is-warn { color: var(--accent-1); font-weight: 600; }

/* photo uploader: a fancy square dropzone that becomes the preview */
.photo-label { gap: 8px; }
.photo-uploader {
  position: relative;
  width: 120px;
  height: 120px;
}
.photo-uploader input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
.photo-preview {
  width: 100%;
  height: 100%;
  border-radius: 18px;
  background: var(--bg) center / cover no-repeat;
  border: 2px dashed var(--accent-1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-1);
  transition: border-style 0.2s, transform 0.2s;
}
.photo-preview.has-photo {
  border-style: solid;
  border-color: var(--accent-1);
  box-shadow: 0 10px 28px rgba(196, 20, 43, 0.22);
}
.photo-uploader:hover .photo-preview {
  transform: translateY(-2px);
}
.photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 700;
  text-align: center;
}
.photo-preview.has-photo .photo-placeholder { display: none; }

.contract-doc {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-top: 14px;
  overflow: hidden;
}

.contract-doc-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
}

.doc-icon {
  width: 42px;
  height: 50px;
  border-radius: 6px;
  background: var(--accent-1);
  color: var(--on-accent-1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.doc-name { font-weight: 600; font-size: 14px; color: var(--txt); }
.doc-meta { font-size: 12px; color: var(--txt-3); margin-top: 2px; }

.doc-preview-btn {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--accent-1);
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.doc-preview-btn:hover { background: var(--accent-1-soft); border-color: var(--accent-1); }

.contract-preview {
  border-top: 1px solid var(--line);
  padding: 18px 20px;
  background: var(--bg);
  animation: fadeUp 0.2s ease-out;
}
.contract-preview.hidden { display: none; }
.contract-preview h4 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--txt);
}
.contract-preview p {
  margin: 6px 0;
  font-size: 13px;
  color: var(--txt-2);
  line-height: 1.55;
}
.contract-preview strong { color: var(--txt); margin-right: 6px; }
.contract-fine { margin-top: 14px !important; font-size: 12px !important; color: var(--txt-3) !important; line-height: 1.55; }

/* signature pad */
.signature-block { margin-top: 18px; }

.signature-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--txt-2);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}

.sig-clear {
  background: transparent;
  border: none;
  color: var(--accent-1);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s;
}
.sig-clear:hover { background: var(--accent-1-soft); }

.signature-pad {
  width: 100%;
  height: 180px;
  background: #ffffff;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--radius-sm);
  cursor: crosshair;
  touch-action: none;
  display: block;
}
.signature-pad.signed {
  border-style: solid;
  border-color: var(--accent-1);
}

.sig-help {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--txt-3);
}
.sig-help.signed {
  color: var(--accent-1);
  font-weight: 600;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: none !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Certify checkbox */
.certify-toggle {
  display: flex !important;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  margin-top: 18px !important;
  padding: 12px 14px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  font-size: 14px !important;
  color: var(--txt) !important;
  line-height: 1.45;
}
.certify-toggle:hover { border-color: var(--accent-1); }
.certify-toggle input { position: absolute; opacity: 0; pointer-events: none; }

.certify-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 6px;
  background: var(--bg);
  border: 1.5px solid var(--line-2);
  color: transparent;
  transition: all 0.15s;
}
.certify-toggle:has(input:checked) {
  border-color: var(--accent-1);
  background: var(--accent-1-soft);
}
.certify-toggle:has(input:checked) .certify-box {
  background: var(--accent-1);
  border-color: var(--accent-1);
  color: var(--on-accent-1);
}
.certify-text { flex: 1; }

/* ============================================================
   ADMIN LOGIN
   ============================================================ */
#screen-admin-login.active {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  min-height: 100vh;
}
.admin-login-shell { max-width: 440px; width: 100%; margin: 0 auto; text-align: center; }
.admin-login-shell #admin-login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.admin-login-shell input[type="email"],
.admin-login-shell input[type="password"] {
  height: 52px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--txt);
  padding: 0 16px;
  font-size: 15px;
  outline: none;
  transition: all 0.15s;
  font-family: inherit;
}
.admin-login-shell input:focus {
  border-color: var(--accent-1);
  background: var(--bg-3);
  box-shadow: 0 0 0 3px var(--accent-1-soft);
}

.admin-hint { text-align: left; line-height: 1.7; }
.admin-hint div { font-size: 12px; }

/* ============================================================
   ADMIN PANEL
   ============================================================ */
#screen-admin-panel.active { display: block; padding-bottom: 80px; }

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* extra right-padding reserves room for the fixed theme toggle (~60px) */
  padding: 18px 80px 18px 32px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
}
.admin-tab {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--txt-2);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: all 0.15s;
}
.admin-tab.active {
  background: var(--accent-1);
  color: var(--on-accent-1);
}
.admin-tab:not(.active):hover { color: var(--accent-1); }

.admin-signout {
  position: static;
  top: auto;
  left: auto;
}

.admin-wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 32px 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-pane { display: none; flex-direction: column; gap: 20px; }
.admin-pane.active { display: flex; }

.access-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}
.access-form label, .access-user-row label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--txt-2);
  font-size: 12px;
  font-weight: 600;
}
.access-form input, .access-form select,
.access-user-row input, .access-user-row select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-3);
  color: var(--txt);
  padding: 10px 11px;
  font: inherit;
}
.access-message, .access-row-message { min-height: 20px; color: var(--accent-1); }
.access-users { display: flex; flex-direction: column; gap: 10px; }
.access-user-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.3fr) minmax(120px, .65fr) minmax(150px, .8fr) minmax(130px, .7fr) minmax(150px, .8fr) auto auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
}
.access-user-identity { display: flex; flex-direction: column; gap: 3px; }
.access-user-identity span, .access-user-identity small { color: var(--txt-2); overflow-wrap: anywhere; }
.access-active { flex-direction: row !important; align-items: center; padding-bottom: 10px; white-space: nowrap; }
.access-active input { width: auto; }
@media (max-width: 980px) {
  .access-user-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .access-form, .access-user-row { grid-template-columns: 1fr; }
}

.admin-intro h2 {
  font-size: 24px;
  margin: 0 0 6px;
  font-weight: 600;
  letter-spacing: -0.4px;
  color: var(--txt);
}
.admin-intro p { color: var(--txt-2); margin: 0; font-size: 14px; }

/* IT stats */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
@media (max-width: 980px) { .admin-stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .admin-stats { grid-template-columns: repeat(2, 1fr); } }

.stat-tile {
  appearance: none;
  font-family: inherit;
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
  text-align: left;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  overflow: visible;
}
.stat-tile:hover {
  transform: translateY(-2px);
  border-color: var(--accent-1);
  box-shadow: 0 10px 24px rgba(196, 20, 43, 0.12);
}
.stat-num {
  font-size: 36px;
  font-weight: 700;
  color: var(--accent-1);
  line-height: 1;
  letter-spacing: -1px;
}
.stat-lbl {
  margin-top: 8px;
  font-size: 11px;
  color: var(--txt-3);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 600;
}

/* Attention state: pulse glow + colored border + badge */
.stat-tile.attention {
  border-color: var(--accent-1);
  background: linear-gradient(160deg, var(--bg-2) 0%, var(--accent-1-soft) 100%);
  animation: statAttention 2.2s ease-in-out infinite;
}
.stat-tile.attention .stat-num {
  color: var(--accent-1);
}
@keyframes statAttention {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(196, 20, 43, 0.45),
                var(--card-shadow);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(196, 20, 43, 0),
                0 10px 22px rgba(196, 20, 43, 0.18);
  }
}

.stat-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: linear-gradient(180deg, #e63950, #c4142b);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(196, 20, 43, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.35);
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.25s, transform 0.25s cubic-bezier(0.4, 1.6, 0.6, 1);
  pointer-events: none;
}
.stat-tile.attention .stat-badge {
  opacity: 1;
  transform: scale(1);
}

.kv-list { list-style: none; padding: 0; margin: 0; }
.kv-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.kv-list li:last-child { border-bottom: none; }
.kv-list .k { color: var(--txt-2); }
.kv-list .v { font-weight: 600; color: var(--txt); }
.kv-list .v.ok { color: #16a85a; }

/* Payroll: create starter form */
.create-form { display: flex; flex-direction: column; gap: 14px; }
.create-form label {
  display: block;
  font-size: 13px;
  color: var(--txt-2);
}
.create-form input[type="text"],
.create-form input[type="email"],
.create-form input[type="date"],
.create-form select {
  width: 100%;
  height: 44px;
  margin-top: 6px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--txt);
  padding: 0 14px;
  font-size: 15px;
  outline: none;
  font-family: inherit;
}
.create-form input:focus, .create-form select:focus { border-color: var(--accent-1); }
.create-form select { appearance: none; cursor: pointer; }
.create-form button { margin-top: 6px; align-self: flex-start; padding: 0 24px; }

.card-d-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.card-d-head h3 { margin: 0; }

/* Payroll inbox cards: one card per pending manager submission */
.payroll-inbox-list { display: flex; flex-direction: column; gap: 12px; }
.payroll-inbox-card {
  border: 1.5px solid var(--accent-1);
  border-radius: var(--radius-sm);
  background: rgba(196, 20, 43, 0.03);
  padding: 14px 16px;
}
.payroll-inbox-card .inbox-card-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 10px;
}
.payroll-inbox-card .inbox-card-title { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.payroll-inbox-card .inbox-card-title strong { font-size: 15px; }
.payroll-inbox-card .inbox-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 6px 18px;
  font-size: 13px;
  margin-bottom: 12px;
}
.payroll-inbox-card .inbox-card-grid > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.payroll-inbox-card .inbox-card-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 10px; border-top: 1px dashed var(--line);
  gap: 12px; flex-wrap: wrap;
}
.payroll-inbox-card .inbox-card-actions { display: flex; gap: 8px; }
.inbox-badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase;
}
.inbox-badge--edited { background: #fde68a; color: #7c4a03; }
.inbox-badge--numbered { background: #d1fae5; color: #065f46; }
.inbox-badge--todo { background: #fee2e2; color: #991b1b; }

.it-form {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.it-form label { font-size: 12.5px; color: var(--txt-2); display: flex; flex-direction: column; gap: 4px; }
.it-form input {
  padding: 8px 10px; font-size: 13.5px;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); color: var(--txt);
}

.manager-search { margin: 8px 0 14px; }
.manager-search input {
  width: 100%; padding: 9px 12px; font-size: 14px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg);
  color: var(--txt);
}
.manager-search input:focus { outline: none; border-color: var(--accent-1); }

/* Crown number callout on the contract review screen */
.crown-callout {
  display: flex; align-items: center; gap: 18px;
  margin: 8px 0 16px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(252, 209, 22, 0.18), rgba(196, 20, 43, 0.10));
  border: 1.5px solid var(--accent-1);
  border-radius: var(--radius-sm);
}
.crown-callout-num {
  display: flex; flex-direction: column; align-items: center;
  min-width: 90px; padding: 6px 12px;
  background: rgba(255,255,255,0.6);
  border-radius: var(--radius-sm);
}
.crown-callout-num strong {
  font-size: 26px; font-weight: 800;
  letter-spacing: 1px; color: var(--accent-1);
}
.crown-callout-text { font-size: 13px; line-height: 1.5; color: var(--txt); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--txt-2);
  height: 34px;
  padding: 0 14px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-ghost svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn-ghost:hover { border-color: var(--accent-1); color: var(--accent-1); }

/* Minimal icon-only action buttons — exact logbook style (borderless, hover tint) */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0;
  border: none; background: transparent; border-radius: 6px;
  color: var(--txt-3); cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { background: var(--bg-3); color: var(--txt); }
.icon-btn.del { color: var(--accent-1); }
.icon-btn.del:hover { background: rgba(196, 20, 43, 0.08); color: var(--accent-1); }
.icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.icon-btn:disabled:hover { background: transparent; }

/* Grouped icon toolbar — Sign-In-App style pill that wraps the action icons */
.icon-bar {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 3px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.icon-bar .icon-btn { width: 30px; height: 30px; border-radius: 7px; }

/* Candidates list */
.candidates-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.candidate-row {
  display: grid;
  /* 9 cols: checkbox | code | info(1fr) | status pill | welcome ind | director ind | candidate ind | edit | delete
     (Action buttons were replaced with read-only status indicators — welcome auto-fires on create,
      contract auto-fires on director sign. Upload contract lives inside the candidate detail modal.) */
  grid-template-columns: 28px 110px minmax(0, 1fr) auto auto auto auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}
@media (max-width: 1280px) {
  .candidate-row {
    grid-template-columns: 28px 110px 1fr;
    gap: 10px;
  }
  .candidate-row > .cand-status,
  .candidate-row > .cand-upload-btn,
  .candidate-row > .cand-action-btn {
    grid-column: span 1;
  }
}
@media (max-width: 700px) {
  .candidate-row { grid-template-columns: 28px 1fr; gap: 8px; }
}

/* Payroll record fields */
.payroll-numbers-form {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}
.payroll-numbers-form label { display: grid; gap: 6px; font-weight: 700; }
.payroll-numbers-form input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface-1);
  color: var(--text);
  font: inherit;
}
.payroll-numbers-form input:focus { outline: 2px solid var(--accent-1); outline-offset: 1px; }
.candidate-row:hover { border-color: var(--accent-1); }
.candidate-row.selected { background: var(--accent-1-soft); border-color: var(--accent-1); }

/* Read-only status indicators on each candidate row (welcome / director / candidate) */
.cand-ind {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid transparent;
  cursor: help;
}
.cand-ind-icon { font-size: 13px; line-height: 1; }
.cand-ind-label { font-size: 12px; }
.cand-ind.ind--green {
  background: rgba(45, 165, 90, 0.12);
  border-color: rgba(45, 165, 90, 0.35);
  color: #2d8a4a;
}
.cand-ind.ind--red {
  background: rgba(196, 20, 43, 0.10);
  border-color: rgba(196, 20, 43, 0.35);
  color: var(--accent-1, #c4142b);
}
.cand-ind.ind--amber {
  background: rgba(255, 170, 0, 0.14);
  border-color: rgba(255, 170, 0, 0.45);
  color: #a36a00;
}
.cand-ind.ind--grey {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.10);
  color: var(--txt-3, #888);
}

.cand-checkbox { width: 18px; height: 18px; cursor: pointer; accent-color: var(--accent-1); }
.cand-info { cursor: pointer; }
.cand-info:hover .cand-name { color: var(--accent-1); }

.cand-code {
  font-family: "SF Mono", ui-monospace, monospace;
  font-weight: 700;
  color: var(--accent-1);
  font-size: 15px;
  letter-spacing: 1px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  line-height: 1.1;
}
.cand-code-sub {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--txt-3);
  background: var(--accent-1-soft);
  padding: 2px 6px;
  border-radius: 4px;
}
.cand-info { display: flex; flex-direction: column; gap: 2px; }
.cand-name { font-weight: 600; color: var(--txt); font-size: 14px; }
.cand-meta { font-size: 12px; color: var(--txt-3); }

.cand-status {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.cand-status.created { background: var(--accent-2-soft); color: var(--accent-1); }
.cand-status.uploaded { background: var(--accent-1-soft); color: var(--accent-1); }
.cand-status.signed { background: rgba(22, 168, 90, 0.15); color: #16a85a; }

.cand-upload-btn {
  position: relative;
  height: 36px;
  padding: 0 14px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 0.18s, filter 0.18s, box-shadow 0.18s;

  /* flat WY red (logbook style) */
  background: var(--accent-1);
  color: #ffffff;
  border: 1px solid var(--accent-1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.cand-upload-btn::before { display: none; }
.cand-upload-btn > * { position: relative; z-index: 1; }
.cand-upload-btn:hover {
  background: #9c0e22;
  border-color: #9c0e22;
}
.cand-upload-btn:active { background: #7a0818; }
.cand-upload-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
.empty-list {
  text-align: center;
  padding: 40px 20px;
  color: var(--txt-3);
  font-size: 14px;
}

/* ---- Bulk actions bar ---- */
.bulk-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.bulk-count {
  font-size: 12px;
  color: var(--txt-3);
  margin-right: 6px;
}
.bulk-actions .btn-ghost[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---- Modal ---- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.hidden {
  display: none;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
}
.modal-card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  width: min(560px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  animation: modal-pop 0.18s ease-out;
}
@keyframes modal-pop {
  from { transform: scale(0.96); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--txt);
}
.modal-x {
  background: transparent;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: var(--txt-3);
  cursor: pointer;
  padding: 0 6px;
}
.modal-x:hover { color: var(--txt); }
.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
}
.modal-body .kv-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.modal-body .kv-list li {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.modal-body .kv-list li:last-child { border-bottom: none; }
.modal-section-h {
  margin: 22px 0 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--txt-2, var(--txt));
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}
.modal-section-h .muted { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 12px; }
.modal-section {
  padding: 16px 18px;
  border-radius: 12px;
  margin-bottom: 16px;
}
.modal-section--account {
  background: rgba(196, 20, 43, 0.04);
  border-left: 3px solid var(--accent-1, #c4142b);
}
.modal-section--submitted {
  background: rgba(252, 209, 22, 0.06);
  border-left: 3px solid var(--accent-2, #fcd116);
}
.modal-section-h--primary, .modal-section-h--accent {
  margin-top: 0;
  font-size: 14px;
  border-bottom-width: 2px;
}
.modal-section-h--primary { color: var(--accent-1, #c4142b); border-bottom-color: rgba(196, 20, 43, 0.3); }
.modal-section-h--accent { color: var(--txt); border-bottom-color: rgba(252, 209, 22, 0.5); }
.file-chip {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
}
.file-chip--present {
  background: rgba(45, 165, 90, 0.08);
  border: 1px solid rgba(45, 165, 90, 0.3);
  color: var(--txt);
}
.file-chip--missing {
  background: var(--bg-2, rgba(0,0,0,0.04));
  border: 1px dashed var(--line);
  color: var(--txt-3);
  font-style: italic;
}
.file-chip--link {
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s, background 0.12s;
}
.file-chip--link:hover {
  background: rgba(45, 165, 90, 0.15);
  transform: translateY(-1px);
}
/* Phase 2 — contract workflow section inside payroll candidate modal */
.modal-section--workflow {
  background: rgba(100, 130, 200, 0.05);
  border-left: 3px solid #6482c8;
}
.workflow-state {
  margin: 8px 0 0;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
}
.workflow-state--pending { background: rgba(255, 180, 0, 0.12); color: var(--txt); }
.workflow-state--done    { background: rgba(45, 165, 90, 0.12);  color: var(--txt); }
.modal-send-director {
  margin-top: 8px;
}
.modal-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.modal-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  background: var(--bg-2, rgba(0,0,0,0.04));
  border: 1.5px dashed var(--line);
  color: var(--txt);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.modal-upload-btn:hover {
  border-color: var(--accent-1, #c4142b);
  background: rgba(196, 20, 43, 0.04);
}
.modal-upload-btn.is-done {
  background: rgba(45, 165, 90, 0.08);
  border-color: rgba(45, 165, 90, 0.4);
  border-style: solid;
  color: #2d8a4a;
}
.modal-upload-btn input[type="file"] { display: none; }
/* Step-by-step tracker for contract workflow (read-only for Payroll) */
.workflow-tracker {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.wf-step {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}
.wf-step:last-child { border-bottom: none; }
.wf-step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
}
.wf-step--done .wf-step-icon    { background: rgba(45, 165, 90, 0.18);  color: #2d8a4a; }
.wf-step--pending .wf-step-icon { background: rgba(255, 180, 0, 0.18);  color: #a36a00; }
.wf-step--todo .wf-step-icon    { background: rgba(0,0,0,0.05);         color: var(--txt-3); }
.wf-step--done .wf-step-label    { color: var(--txt); font-weight: 600; }
.wf-step--pending .wf-step-label { color: var(--txt); font-weight: 600; }
.wf-step--todo .wf-step-label    { color: var(--txt-3); }
.wf-step-ts { font-size: 11px; color: var(--txt-3); }
/* Director sign modal — bigger card for the contract preview + pad */
.director-modal-card { max-width: 720px; width: 90vw; max-height: 88vh; }
.director-modal-card .modal-body { max-height: 70vh; overflow-y: auto; }
.director-sign-zone {
  margin-top: 22px;
  padding: 14px;
  background: var(--bg-2, rgba(0,0,0,0.03));
  border: 1px solid var(--line);
  border-radius: 10px;
}
.director-sign-zone .signature-pad {
  display: block;
  width: 100%;
  height: 140px;
  margin: 10px 0;
  background: #fff;
  border: 1.5px dashed var(--line);
  border-radius: 8px;
  cursor: crosshair;
  touch-action: none;
}
.signature-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.director-row .cand-info { padding-left: 12px; }
.director-row { grid-template-columns: 110px minmax(0, 1fr) auto; }
.file-chip-note { font-size: 11px; color: var(--txt-3); font-style: italic; }
.modal-body .kv-list .k {
  color: var(--txt-3);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.modal-body .kv-list .v { color: var(--txt); }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
}

.wy-welcome-bubble {
  position: relative;
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px) scale(0.7);
  transition: opacity 0.3s ease-out, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.wy-welcome-bubble.is-on {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.wy-welcome-bubble .wy-welcome-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(180deg, #fcd116 0%, #c79900 100%);
  color: #5a0612;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.4px;
  padding: 8px 14px;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(196, 20, 43, 0.45),
              0 0 0 3px rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  font-family: system-ui, -apple-system, sans-serif;
  animation: welcomeWobble 0.9s ease-in-out infinite alternate;
}
.wy-welcome-bubble .wy-welcome-pill::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: #c79900;
  border-bottom-right-radius: 2px;
}
@keyframes welcomeWobble {
  from { transform: translateY(0) rotate(-2deg); }
  to   { transform: translateY(-3px) rotate(2deg); }
}

/* Walker dot animated along the path */
.wy-walker {
  position: relative;
  width: 22px;
  height: 22px;
  pointer-events: none;
}
.wy-walker-dot {
  position: absolute;
  inset: 5px;
  background: #c4142b;
  border: 2.5px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.25), 0 4px 10px rgba(0,0,0,0.35);
  z-index: 2;
}
.wy-walker-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(196, 20, 43, 0.45);
  animation: walkerPulse 1.4s ease-out infinite;
  z-index: 1;
}
@keyframes walkerPulse {
  0%   { transform: scale(0.4); opacity: 0.9; }
  100% { transform: scale(1.8); opacity: 0;   }
}

/* ============================================================
   MANAGER PANEL — admin pane for line managers
   ============================================================ */

.admin-pane[data-pane="manager"] .manager-section {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px 18px;
  margin-top: 16px;
  background: var(--bg-2);
}
.admin-pane[data-pane="manager"] .manager-section > legend {
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--txt-3);
  font-weight: 700;
  padding: 0 6px;
}
.admin-pane[data-pane="manager"] .manager-section .row.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.admin-pane[data-pane="manager"] .manager-section label {
  display: block;
  font-size: 13px;
  color: var(--txt-2);
  margin-top: 10px;
}
.admin-pane[data-pane="manager"] .manager-section input,
.admin-pane[data-pane="manager"] .manager-section select,
.admin-pane[data-pane="manager"] .manager-section textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--txt);
  font-size: 14px;
  font-family: inherit;
}
.admin-pane[data-pane="manager"] .manager-section .muted.small {
  font-size: 12px;
  color: var(--txt-3);
  margin: 8px 0 0;
}

.schedule-table-wrap { overflow-x: auto; margin-top: 12px; }
.schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 720px;
}
.schedule-table th,
.schedule-table td {
  padding: 8px 6px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.schedule-table thead th {
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--txt-3);
  font-weight: 700;
  background: var(--bg-3);
}
.schedule-table tbody th {
  text-align: left;
  font-weight: 600;
  color: var(--txt);
  padding-left: 12px;
}
.schedule-table tbody input {
  width: 100%;
  max-width: 110px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--txt);
  font-size: 13px;
  text-align: center;
}
.schedule-table tbody tr.is-off { background: rgba(0,0,0,0.04); opacity: 0.7; }
.schedule-table tbody tr.is-off input { background: var(--bg-3); color: var(--txt-3); }
.schedule-table tbody tr.is-off .hours-cell { color: var(--txt-3); font-style: italic; }

.day-actions { display: flex; gap: 6px; align-items: center; justify-content: center; }
.day-off-btn {
  background: var(--bg-3);
  color: var(--txt-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 10px;
  cursor: pointer;
  letter-spacing: 0.3px;
}
.day-off-btn:hover { background: var(--bg-2); color: var(--accent-1); border-color: var(--accent-1); }
tr.is-off .day-off-btn { background: var(--accent-1); color: #fff; border-color: var(--accent-1); }
.day-apply-sel {
  font-size: 11.5px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--txt-2);
  max-width: 110px;
}
.day-apply-sel:disabled { opacity: 0.5; }
.schedule-table .hours-cell {
  font-weight: 700;
  color: var(--accent-1);
  font-variant-numeric: tabular-nums;
}
.schedule-table tfoot .schedule-total-lbl {
  text-align: right;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--txt-3);
  padding-right: 12px;
}
.schedule-table tfoot .schedule-total {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-1);
}

.manager-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

/* Status badges in the "My starters" list */
.candidates-list .badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.3px;
  background: var(--bg-3);
  color: var(--txt-2);
}
.candidates-list .badge.ok   { background: rgba(46, 160, 67, .15); color: #2ea043; }
.candidates-list .badge.warn { background: rgba(255, 153, 0, .18); color: #b06b00; }
.candidates-list .badge.bad  { background: rgba(196, 20, 43, .15); color: var(--accent-1); }

.manager-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.manager-row:last-child { border-bottom: 0; }
.manager-row .cand-name { font-weight: 700; }
.manager-row .cand-sub  { color: var(--txt-3); font-size: 12.5px; margin-top: 2px; }
.manager-row .cand-actions { display: flex; gap: 6px; }

.empty-state {
  padding: 22px;
  text-align: center;
  color: var(--txt-3);
  font-size: 13.5px;
  background: var(--bg-3);
  border-radius: var(--radius-sm);
}

/* Payroll-side modal sections for manager-submitted starters */
.modal-section.modal-section--alert {
  padding: 10px 14px;
  border-radius: 8px;
  margin-top: 14px;
  font-size: 13.5px;
  line-height: 1.4;
}
.modal-section.alert-warn { background: rgba(255, 153, 0, .12); border: 1px solid rgba(255, 153, 0, .35); color: #8a4d00; }
.modal-section.alert-bad  { background: rgba(196, 20, 43, .10); border: 1px solid rgba(196, 20, 43, .35); color: var(--accent-1); }
.modal-section--manager {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.modal-section-h--accent { color: var(--accent-1); font-size: 13px; font-weight: 700; letter-spacing: 0.3px; margin: 0 0 10px; }

/* Candidate dashboard — Crown / Employee number card */
.crown-numbers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 6px;
}
.crown-tile {
  padding: 18px 18px 16px;
  background: var(--bg-2);
  border: 1px solid var(--accent-1);
  border-radius: var(--radius-sm);
  text-align: center;
}
.crown-num {
  font-size: 32px;
  font-weight: 800;
  color: var(--accent-1);
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}
.crown-lbl {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--txt-3);
  font-weight: 700;
}
.crown-sub {
  font-size: 12.5px;
  color: var(--txt-2);
  margin-top: 8px;
  line-height: 1.4;
}
@media (max-width: 580px) {
  .crown-numbers { grid-template-columns: 1fr; }
}


/* Multiple car-reg plates (gate opens for any registered vehicle) */
.car-reg-list { display: flex; flex-direction: column; gap: 6px; }
.car-reg-row { display: flex; align-items: center; gap: 6px; }
.car-reg-row .car-reg-input { flex: 1; text-transform: uppercase; }
.car-reg-remove {
  border: 1px solid #d8cdb0; background: #fff; color: #7a6b48;
  width: 28px; height: 28px; border-radius: 6px; cursor: pointer; line-height: 1; font-size: 16px;
}
.car-reg-remove:hover { background: #f3ecd9; }
.car-reg-add {
  margin-top: 6px; background: none; border: none; color: #7a6b48;
  font-size: 13px; cursor: pointer; padding: 2px 0; text-decoration: underline;
}
.car-reg-add:hover { color: #5a4e34; }

/* Role-based pre-start training */
.training-progress { font-weight: 800; color: var(--accent-1); white-space: nowrap; }
.training-list, .training-admin-list, .training-role-list { display: grid; gap: 10px; margin-top: 12px; }
.training-item, .training-admin-item {
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center;
  padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2);
}
.training-item.is-complete { border-color: #4a9b64; background: rgba(74,155,100,.08); }
.training-item h4, .training-admin-item h4 { margin: 0 0 4px; }
.training-item p, .training-admin-item p { margin: 0; }
.training-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.training-badge { display: inline-block; margin-top: 6px; padding: 3px 7px; border-radius: 999px; background: var(--surface-3); font-size: 11px; font-weight: 700; }
.training-badge.all { background: rgba(31,110,212,.12); color: #174f99; }
.training-role-edit { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto minmax(70px, auto); gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.training-role-edit input[name="name"] { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; background: var(--surface-1); color: var(--text); }
@media (max-width: 700px) { .training-role-edit { grid-template-columns: 1fr; } }
.training-video-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.training-wide { grid-column: 1 / -1; }
.training-role-picker { border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.training-role-picker legend { padding: 0 5px; font-weight: 700; }
#training-video-role-options, #manager-training-video-role-options { display: flex; flex-wrap: wrap; gap: 8px 14px; }
#training-video-role-options label, #manager-training-video-role-options label { display: flex; gap: 5px; align-items: center; }
.training-player-card { width: min(900px, calc(100vw - 28px)); }
#training-player { width: 100%; max-height: 60vh; background: #000; border-radius: 8px; }
.training-confirmation { margin-top: 16px; border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.training-confirmation label { display: inline-flex; gap: 6px; margin: 10px 18px 0 0; }
.scheduled-email-form { margin: 14px 0; }
.access-delete { color: #a12b2b; border-color: #d9a4a4; }
@media (max-width: 700px) {
  .training-item, .training-admin-item { grid-template-columns: 1fr; }
  .training-actions { justify-content: flex-start; }
  .training-video-form { grid-template-columns: 1fr; }
  .training-wide { grid-column: auto; }
}
.manager-section-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
  padding: 10px;
  border: 1px solid var(--border, #e3e5e8);
  border-radius: 14px;
  background: var(--surface, #fff);
  box-shadow: 0 8px 24px rgba(28, 34, 45, .08);
}

.manager-section-menu a {
  flex: 1 1 150px;
  padding: 10px 14px;
  border-radius: 10px;
  color: inherit;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.manager-section-menu a:hover,
.manager-section-menu a:focus-visible,
.manager-section-menu a.active,
.manager-section-menu a[aria-selected="true"] {
  color: #fff;
  background: var(--red, #c8102e);
  outline: none;
}

[data-manager-tab-panel][hidden] {
  display: none !important;
}

@media (max-width: 720px) {
  .manager-section-menu a { flex-basis: calc(50% - 4px); }
}
