/* ============================================================
   WhistleIQ EOI — app styles, built on the marketing brand kit
   ============================================================ */

@font-face { font-family:'Inter';   font-style:normal; font-weight:400; font-display:swap; src:url('../fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family:'Inter';   font-style:normal; font-weight:500; font-display:swap; src:url('../fonts/inter-500.woff2') format('woff2'); }
@font-face { font-family:'Inter';   font-style:normal; font-weight:600; font-display:swap; src:url('../fonts/inter-600.woff2') format('woff2'); }
@font-face { font-family:'Inter';   font-style:normal; font-weight:700; font-display:swap; src:url('../fonts/inter-700.woff2') format('woff2'); }
@font-face { font-family:'Manrope'; font-style:normal; font-weight:400; font-display:swap; src:url('../fonts/manrope-400.woff2') format('woff2'); }
@font-face { font-family:'Manrope'; font-style:normal; font-weight:600; font-display:swap; src:url('../fonts/manrope-600.woff2') format('woff2'); }
@font-face { font-family:'Manrope'; font-style:normal; font-weight:700; font-display:swap; src:url('../fonts/manrope-700.woff2') format('woff2'); }
@font-face { font-family:'Manrope'; font-style:normal; font-weight:800; font-display:swap; src:url('../fonts/manrope-800.woff2') format('woff2'); }

:root {
  --color-primary: #AC94E2;
  --color-primary-600: #8E73D1;
  --color-primary-700: #6F58B5;
  --color-ink: #372B54;
  --color-ink-2: #2A2142;
  --color-brand-purple: #74449A;
  --color-brand-purple-dk: #5B3479;
  --color-lilac: #F5F1FF;
  --color-lilac-2: #ECE4FB;
  --color-charcoal: #111827;
  --color-grey: #6B7280;
  --color-grey-light: #E5E7EB;
  --color-grey-bg: #F9FAFB;
  --color-success: #16A34A;
  --color-warning: #F59E0B;
  --color-error: #DC2626;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  --font-display: 'Manrope', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --container: 1100px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
}

* { box-sizing: border-box; }
body {
  margin: 0; font-family: var(--font-sans); color: var(--color-charcoal);
  background: var(--color-lilac); font-size: 15px; line-height: 1.55;
  display: flex; min-height: 100vh; flex-direction: column;
}
.wrap { max-width: var(--container); margin: 0 auto; padding: 0 20px; width: 100%; }
main.wrap { flex: 1; padding-top: 28px; padding-bottom: 48px; }

h1, h2, h3 { font-family: var(--font-display); color: var(--color-ink); line-height: 1.25; }
h1 { font-size: 1.7rem; font-weight: 800; margin: 0 0 6px; }
h2 { font-size: 1.25rem; font-weight: 700; margin: 26px 0 10px; }
h3 { font-size: 1.05rem; font-weight: 700; margin: 18px 0 8px; }
a { color: var(--color-primary-700); }
.muted { color: var(--color-grey); }
.small { font-size: 13px; }

/* Header / footer */
.site-header { background: var(--color-ink); }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; padding-bottom: 12px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { height: 30px; width: auto; display: block; }
.brand-tag {
  font-family: var(--font-display); font-weight: 800; font-size: 12px; letter-spacing: 1.5px;
  color: var(--color-ink); background: var(--color-primary); border-radius: 6px; padding: 2px 8px;
}
.site-nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.site-nav a { color: var(--color-lilac-2); text-decoration: none; font-weight: 500; font-size: 14px; }
.site-nav a:hover { color: #fff; }
.user-chip { color: var(--color-primary); font-size: 13px; font-weight: 600; }
.site-footer { background: transparent; color: var(--color-grey); font-size: 12px; padding: 18px 0 26px; }
.site-footer a { color: var(--color-grey); }

/* Cards / panels */
.card {
  background: #fff; border: 1px solid var(--color-lilac-2); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(55,43,84,.06);
}
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card h2, .card h3 { margin-top: 0; }

/* Forms */
label { display: block; font-weight: 600; font-size: 14px; color: var(--color-ink); margin: 14px 0 4px; }
label .req { color: var(--color-error); }
.help { font-size: 13px; color: var(--color-grey); margin: 2px 0 4px; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=date], input[type=search],
input[type=datetime-local], input[type=number], select, textarea {
  width: 100%; max-width: 560px; padding: 9px 12px; font: inherit;
  border: 1px solid var(--color-grey-light); border-radius: var(--radius-sm); background: #fff;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--color-primary); border-color: var(--color-primary); }
.choice-row { display: flex; align-items: flex-start; gap: 8px; margin: 6px 0; font-weight: 400; }
.choice-row input { margin-top: 3px; }
fieldset { border: 0; padding: 0; margin: 0; }

.btn {
  display: inline-block; background: var(--color-brand-purple); color: #fff; border: 0; cursor: pointer;
  font: 700 14px var(--font-sans); padding: 10px 20px; border-radius: var(--radius-sm); text-decoration: none;
}
.btn:hover { background: var(--color-brand-purple-dk); }
.btn-secondary { background: #fff; color: var(--color-brand-purple); border: 1px solid var(--color-brand-purple); }
.btn-secondary:hover { background: var(--color-lilac); }
.btn-danger { background: var(--color-error); }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn[disabled]:hover { background: var(--color-brand-purple); }
.link-btn { background: none; border: 0; color: var(--color-lilac-2); cursor: pointer; font: 500 14px var(--font-sans); padding: 0; }
.link-btn:hover { color: #fff; }
.inline-form { display: inline; }

/* Flash + errors */
.flash { border-radius: var(--radius-sm); padding: 11px 14px; margin-bottom: 16px; font-weight: 500; }
.flash-ok { background: #dcfce7; color: #14532d; border: 1px solid #bbf7d0; }
.flash-err { background: #fee2e2; color: #7f1d1d; border: 1px solid #fecaca; }
.field-error { color: var(--color-error); font-size: 13px; margin-top: 3px; }

/* Tables */
table.list { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--color-lilac-2); }
table.list th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--color-grey); background: var(--color-grey-bg); padding: 10px 12px; }
table.list td { padding: 10px 12px; border-top: 1px solid var(--color-lilac-2); vertical-align: top; }
table.list tr:hover td { background: var(--color-lilac); }

/* Status / stage chips */
.chip { display: inline-block; border-radius: 999px; font-size: 12px; font-weight: 700; padding: 3px 11px; white-space: nowrap; }
.chip-new           { background: var(--color-lilac-2); color: var(--color-ink); }
.chip-under_review  { background: #e0e7ff; color: #3730a3; }
.chip-possible      { background: #fef3c7; color: #92400e; }
.chip-yes           { background: #dcfce7; color: #14532d; }
.chip-not_suited    { background: #f3f4f6; color: #4b5563; }
.chip-offered       { background: #ede9fe; color: #5b21b6; }
.chip-confirmed     { background: var(--color-success); color: #fff; }
.chip-declined      { background: #fee2e2; color: #991b1b; }
.chip-offer_expired { background: #fef3c7; color: #92400e; }
.chip-unsuccessful  { background: #f3f4f6; color: #4b5563; }
.chip-withdrawn     { background: #f3f4f6; color: #9ca3af; }
.chip-draft  { background: var(--color-grey-light); color: var(--color-grey); }
.chip-open   { background: #dcfce7; color: #14532d; }
.chip-closed { background: #fee2e2; color: #991b1b; }
.chip-archived { background: #f3f4f6; color: #9ca3af; }

/* Messages thread */
.thread { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 75%; border-radius: var(--radius); padding: 10px 14px; }
.msg-admin { background: var(--color-lilac-2); align-self: flex-start; }
.msg-applicant { background: #dcfce7; align-self: flex-end; }
.msg .meta { font-size: 11px; color: var(--color-grey); margin-top: 4px; }

/* Role tabs on the applications list */
.role-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px;
  border-bottom: 2px solid var(--color-lilac-2); padding-bottom: 0; }
.role-tab { display: inline-flex; align-items: baseline; gap: 7px; text-decoration: none;
  padding: 9px 16px; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  color: var(--color-grey); font-weight: 600; font-size: 14px; border: 2px solid transparent;
  border-bottom: 0; margin-bottom: -2px; }
.role-tab:hover { color: var(--color-ink); background: var(--color-lilac); }
.role-tab.is-active { background: #fff; color: var(--color-ink);
  border-color: var(--color-lilac-2); border-bottom: 2px solid #fff; }
.role-tab b { font-family: var(--font-display); font-size: 16px; color: var(--color-brand-purple); }
.role-tab-new { background: var(--color-brand-purple); color: #fff; border-radius: 999px;
  padding: 1px 8px; font-size: 11px; font-weight: 700; }

/* Rich text editor */
.rt { max-width: 560px; }
.rt-toolbar { display: none; gap: 4px; flex-wrap: wrap; align-items: center;
  border: 1px solid var(--color-grey-light); border-bottom: 0;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0; padding: 6px 8px; background: var(--color-grey-bg); }
.rt-toolbar button { background: #fff; border: 1px solid var(--color-grey-light); border-radius: 6px;
  padding: 3px 9px; font: 500 13px var(--font-sans); color: var(--color-ink); cursor: pointer; }
.rt-toolbar button:hover { border-color: var(--color-primary); color: var(--color-brand-purple); }
.rt-sep { width: 1px; height: 18px; background: var(--color-grey-light); margin: 0 2px; }
.rt-editor { display: none; min-height: 140px; max-height: 420px; overflow-y: auto;
  border: 1px solid var(--color-grey-light); border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 10px 12px; background: #fff; font: inherit; line-height: 1.55; }
.rt-editor:focus { outline: 2px solid var(--color-primary); border-color: var(--color-primary); }
.rt-editor p { margin: 0 0 .6em; }
.rt-editor p:last-child { margin-bottom: 0; }
.rt-editor ul, .rt-editor ol { margin: 0 0 .6em; padding-left: 22px; }
.rt-editor.rt-empty::before { content: attr(data-placeholder); color: var(--color-grey); }
.rt-ready .rt-toolbar, .rt-ready .rt-editor { display: flex; }
.rt-ready .rt-editor { display: block; }
.rt-ready .rt-fallback { display: none; }

/* Description as rendered to applicants */
.rt-content p { margin: 0 0 .7em; }
.rt-content ul, .rt-content ol { margin: 0 0 .7em; padding-left: 22px; }
.rt-content li { margin: 3px 0; }
.rt-content a { color: var(--color-primary-700); }

/* Expandable profile detail */
.profile-more { margin-top: 14px; border-top: 1px solid var(--color-lilac-2); padding-top: 12px; }
.profile-more summary { cursor: pointer; font-weight: 600; color: var(--color-primary-700); font-size: 14px; }
.profile-more summary::marker { color: var(--color-primary); }
.profile-more summary:hover { color: var(--color-brand-purple); }
.profile-more-body { padding-top: 6px; }
.profile-more-body h3 { font-size: .95rem; margin: 12px 0 4px; }
.profile-more-body ul { margin: 0; padding-left: 20px; font-size: 14px; }
.profile-more-body li { margin: 4px 0; }

/* Misc */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--color-lilac-2); }
.avatar-lg { width: 72px; height: 72px; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 4px 14px; font-size: 14px; }
.kv dt { color: var(--color-grey); font-weight: 500; margin: 0; }
.kv dd { margin: 0; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.notice { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 14px; font-size: 14px; }
.count-badges { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0 16px; }
.count-badge { background: #fff; border: 1px solid var(--color-lilac-2); border-radius: var(--radius-sm); padding: 8px 14px; text-align: center; }
.count-badge b { display: block; font-size: 20px; font-family: var(--font-display); color: var(--color-ink); }
.count-badge span { font-size: 12px; color: var(--color-grey); }

/* Auth pages */
.auth-wrap { max-width: 420px; margin: 48px auto; }
.auth-wrap .brand-stack { text-align: center; margin-bottom: 22px; }
.auth-wrap .brand-stack img { height: 64px; }

@media (max-width: 640px) {
  .kv { grid-template-columns: 1fr; }
  .msg { max-width: 95%; }
}

/* "Log in as" support banner: loud on purpose, so it's never forgotten */
.support-banner { background: var(--color-warning); color: var(--color-charcoal); font-size: 14px; }
.support-banner-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 9px; padding-bottom: 9px; }
.support-banner .btn { background: var(--color-charcoal); }
.support-banner .btn:hover { background: #000; }
.support-results td { vertical-align: middle; }

/* Multi-tournament application form: one block per tournament */
.pick-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin: 6px 0 4px; }
.pick-tournament { border: 1px solid var(--color-lilac-2); border-radius: var(--radius-sm); padding: 12px 14px 8px; margin: 0; background: var(--color-grey-bg); min-width: 0; }
.pick-tournament legend { float: left; width: 100%; padding: 0; margin: 0 0 6px; display: flex; flex-direction: column; gap: 1px; }
.pick-tournament legend + * { clear: both; }
.tournament-list { margin: 0; padding-left: 18px; }
.tournament-list li { margin: 2px 0; }
.tournament-row { border-top: 1px solid var(--color-lilac-2); padding: 10px 0; }
.tournament-row:first-of-type { border-top: 0; }
.tournament-fields { display: grid; gap: 0 12px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

/* Preference ranking on the application form */
.pref-block { margin-top: 18px; padding: 12px 14px; border: 1px solid var(--color-lilac-2); border-radius: var(--radius-sm); background: #fff; }
.pref-block > label:first-child { margin-top: 0; }
.pref-list { margin: 8px 0 4px; padding-left: 0; list-style-position: inside; }
.pref-list li { padding: 6px 0; border-bottom: 1px solid var(--color-lilac-2); overflow: hidden; }
.pref-list li:last-child { border-bottom: 0; }
.pref-list li::marker { font-weight: 700; color: var(--color-brand-purple); }
.pref-list li .pref-move { float: right; display: inline-flex; gap: 4px; }
.pref-list li .pref-label { line-height: 30px; }
.pref-move .btn { padding: 2px 9px; }
.pref-move .btn[disabled] { opacity: .3; }
.rank-chip { display: inline-block; font-size: 11px; font-weight: 700; color: var(--color-brand-purple); background: var(--color-lilac); border-radius: 999px; padding: 1px 8px; margin-left: 4px; white-space: nowrap; }
.limit-one { color: #92400e; background: #fef3c7; }

/* Groups & access */
.group-box { border: 1px solid var(--color-lilac-2); border-radius: var(--radius-sm); background: var(--color-grey-bg); padding: 10px 14px; margin: 10px 0; }
.person-chip { display: inline-flex; align-items: center; gap: 4px; background: #fff; border: 1px solid var(--color-lilac-2); border-radius: 999px; padding: 2px 4px 2px 10px; margin: 2px 4px 2px 0; font-size: 13px; }
.person-chip .muted { font-size: 12px; padding-right: 6px; }
.chip-x { border: 0; background: none; color: var(--color-grey); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 6px; }
.chip-x:hover { color: var(--color-error); }
.group-chip { display: inline-block; font-size: 11px; font-weight: 700; color: var(--color-ink); background: var(--color-lilac-2); border-radius: 999px; padding: 1px 8px; margin-left: 4px; white-space: nowrap; }
.other-group { color: var(--color-grey); font-style: italic; }

/* Confirmation shown as a pop-up when a save keeps you in place */
.flash.flash-toast { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 50; margin: 0;
  max-width: min(560px, calc(100vw - 32px)); box-shadow: 0 6px 24px rgba(17, 24, 39, .18); transition: opacity .6s, transform .6s; }
.flash.flash-toast-out { opacity: 0; transform: translate(-50%, -8px); }

/* Internal notes */
.note { border-left: 3px solid var(--color-lilac-2); padding: 8px 0 8px 12px; margin: 10px 0; scroll-margin-top: 80px; }
.note-for-me { border-left-color: var(--color-brand-purple); background: var(--color-lilac); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding-right: 10px; }
.note:target { box-shadow: 0 0 0 2px var(--color-primary); border-radius: var(--radius-sm); }
.note-meta { font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.note-body { margin: 4px 0; white-space: normal; }
.note-tags { margin-top: 4px; }
.tag-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 12px; }
.tag-picker .choice-row { margin: 3px 0; }

/* Elements hidden by script stay hidden even if a class gives them a display value */
[hidden] { display: none !important; }
.chip-tag { background: #e0f2fe; color: #075985; }

/* Review tags editor */
.tag-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--color-lilac-2); }
.tag-row.tag-hidden input[type=text] { color: var(--color-grey); font-style: italic; }

/* Officiating history */
.history-share { margin-top: 18px; padding: 12px 14px; border: 1px solid var(--color-lilac-2); border-radius: var(--radius-sm); background: var(--color-grey-bg); }
.history-share > label:first-child { margin-top: 0; }
.history-list { list-style: none; margin: 4px 0 10px; padding: 0; }
.history-list li { padding: 5px 0; border-bottom: 1px solid var(--color-lilac-2); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.history-list li:last-child { border-bottom: 0; }

/* International phone: country dropdown + number */
.phone-intl { display: flex; gap: 8px; flex-wrap: wrap; }
.phone-intl select { flex: 0 1 230px; min-width: 0; }
.phone-intl input { flex: 1 1 180px; min-width: 0; }
.choice-row.pick-blocked { color: var(--color-grey); opacity: .55; }

/* Unavailable dates question */
.unavail { display: grid; gap: 8px; margin-top: 4px; }
.unavail-row { border: 1px solid var(--color-lilac-2); border-radius: var(--radius-sm); padding: 8px 12px; background: var(--color-grey-bg); }
.unavail-dates { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.unavail-dates input[type=date] { width: auto; flex: 0 1 170px; min-width: 0; }

/* Targets panel */
.table-scroll { overflow-x: auto; }
.targets-table td { white-space: nowrap; }
.targets-table th { white-space: normal; vertical-align: bottom; }
.target-input { width: 80px; padding: 4px 8px; }
.targets .gap { color: #92400e; font-weight: 700; }
.targets .met { color: var(--color-success); font-weight: 700; }
.target-bar { height: 5px; background: var(--color-lilac-2); border-radius: 99px; margin-top: 4px; width: 90px; overflow: hidden; }
.target-bar span { display: block; height: 100%; background: var(--color-success); }

/* Conditional questions */
.logic { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--color-lilac-2); }
.logic-row { margin: 8px 0 0; align-items: center; }
.logic-row select { width: auto; max-width: 260px; padding: 5px 8px; font-size: 13px; }
.logic-chip { display: inline-block; font-size: 11px; font-weight: 600; color: #075985; background: #e0f2fe; border-radius: 999px; padding: 1px 8px; margin-left: 4px; }
.logic-chip.logic-warn { color: #92400e; background: #fef3c7; }

/* Multi-select dropdown (data-msel). Without JS it's the plain tick list. */
.msel { position: relative; max-width: 560px; }
.msel-on > .msel-list { margin: 0; }
.msel-box {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 42px; padding: 5px 36px 5px 8px;
  border: 1px solid var(--color-grey-light); border-radius: var(--radius-sm); background: #fff; cursor: pointer; position: relative;
}
.msel-box::after {
  content: ''; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; margin-top: -6px;
  border-right: 1.5px solid var(--color-ink); border-bottom: 1.5px solid var(--color-ink); transform: rotate(45deg);
}
.msel-open .msel-box::after { transform: rotate(-135deg); margin-top: -2px; }
.msel-open .msel-box, .msel-box:focus-within { outline: 2px solid var(--color-primary); border-color: var(--color-primary); }
.msel-chips { display: contents; }
.msel-chip {
  display: inline-flex; align-items: center; gap: 2px; background: var(--color-lilac); color: var(--color-ink);
  border: 1px solid var(--color-lilac-2); border-radius: 999px; padding: 1px 4px 1px 10px; font-size: 14px; line-height: 1.6;
}
.msel-x { border: 0; background: none; cursor: pointer; font-size: 17px; line-height: 1; padding: 0 5px; color: var(--color-grey); border-radius: 50%; }
.msel-x:hover, .msel-x:focus-visible { color: var(--color-error); }
.msel-toggle { flex: 1 1 120px; border: 0; background: none; font: inherit; text-align: left; padding: 4px; cursor: pointer; color: var(--color-charcoal); }
.msel-toggle:focus { outline: none; }
.msel-has .msel-toggle { color: var(--color-grey); font-size: 14px; }
.msel-panel {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); background: #fff;
  border: 1px solid var(--color-lilac-2); border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(55,43,84,.16); padding: 8px;
}
.msel-panel[hidden] { display: none !important; }
.msel-search { margin-bottom: 6px; max-width: none; }
.msel-on .msel-list { max-height: 260px; overflow-y: auto; padding: 0 4px; overscroll-behavior: contain; }
.msel-on .msel-list .choice-row { margin: 0; padding: 6px 4px; border-radius: 4px; cursor: pointer; }
.msel-on .msel-list .choice-row:hover { background: var(--color-lilac); }
.msel-none { margin: 8px 4px; color: var(--color-grey); font-size: 14px; }
.msel-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--color-lilac-2); margin-top: 6px; padding-top: 8px; }
.msel-count { font-size: 13px; color: var(--color-grey); }

/* EOIs lodged through a campaign's private link */
.rank-chip.invite-chip { background: #FEF3C7; color: #92400E; border-color: #FDE68A; }

/* Roles offered: list + edit mode */
.role-row { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--color-lilac-2); }
.role-row:last-of-type { border-bottom: 0; }
.role-row .group-chip { margin: 0; }
.group-chip.group-none { background: #F3F4F6; color: var(--color-grey); }
.role-edit-row { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end; padding: 10px 0; border-bottom: 1px solid var(--color-lilac-2); }
.role-move { display: flex; gap: 4px; align-self: flex-end; padding-bottom: 2px; }
.role-move .btn { padding: 4px 9px; }
.role-move .btn:disabled { opacity: .35; cursor: default; }
.role-field { margin: 0; font-weight: 400; }
.role-field span { display: block; font-size: 12px; font-weight: 600; color: var(--color-grey); margin-bottom: 2px; }
.role-name { flex: 1 1 220px; }
.role-code input { width: 90px; }
.role-cap input { width: 90px; }
.role-group select { width: auto; max-width: 240px; }
.role-remove { align-self: flex-end; margin-bottom: 2px; }

/* Applicant profile card, photo prompt and profile page */
.profile-card { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--color-lilac-2); border-radius: var(--radius-sm); background: var(--color-lilac); }
.profile-card-main { flex: 1 1 200px; min-width: 0; }
.profile-card-main .small { overflow-wrap: anywhere; }
.avatar-initials { display: inline-flex; align-items: center; justify-content: center; background: var(--color-primary); color: #fff; font-weight: 700; border-radius: 50%; }
.avatar.avatar-initials { font-size: 17px; }
.avatar-xl { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.avatar-xl.avatar-initials { font-size: 34px; }
.photo-prompt { margin-top: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: #FEF3C7; color: #78350F; font-size: 14px; line-height: 1.5; }
.photo-prompt .btn { margin-top: 8px; display: inline-block; }
.profile-photo-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.field-pair { display: flex; gap: 12px; flex-wrap: wrap; }
.field-pair > div { flex: 1 1 220px; min-width: 0; }
.profile-edit h2 { font-size: 18px; margin: 22px 0 4px; }
.profile-photo-prompt { flex: 1 1 240px; min-width: 0; }
.profile-photo-prompt .photo-prompt { margin-top: 0; }

/* Officiating history: WMH records chip, outcome badge and expandable report */
.history-list li.history-item { display: block; }
.history-row { display: flex; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; }
.src-chip { display: inline-block; font-size: 11px; font-weight: 700; color: #92400E; background: #FEF3C7; border-radius: 999px; padding: 1px 8px; margin-left: 4px; white-space: nowrap; }
.report-details { margin: 6px 0 2px; }
.report-details > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.report-details > summary::-webkit-details-marker { display: none; }
.report-details > summary::after { content: '▸'; color: var(--color-grey); font-size: 12px; }
.report-details[open] > summary::after { content: '▾'; }
.outcome-pill { display: inline-flex; align-items: baseline; gap: 6px; background: var(--color-ink); color: #fff; border-radius: 999px; padding: 3px 12px; font-size: 13px; }
.outcome-pill b { font-size: 17px; }
.outcome-none { background: var(--color-grey); }
.report-toggle { color: var(--color-primary-700, #5B21B6); text-decoration: underline; }
.report-body { margin: 8px 0 6px; padding: 10px 12px; border-left: 3px solid var(--color-primary); background: var(--color-lilac); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.report-table { margin: 0 0 8px; max-width: 520px; }
.report-table th.num, .report-table td.num { text-align: right; width: 70px; }
.report-text p { margin: 2px 0 0; white-space: normal; }

/* Applicant edits: flag in the list and what-changed panel */
.rank-chip.edited-chip { background: #DBEAFE; color: #1E3A8A; text-decoration: none; }
.edit-flag { border-color: #93C5FD; background: #EFF6FF; }
.edit-entry { margin: 8px 0 0; }
.edit-entry ul { margin: 2px 0 0; padding-left: 18px; }
.edit-entry li { margin: 3px 0; }
.chg-val { background: #fff; border: 1px solid var(--color-lilac-2); border-radius: 4px; padding: 0 4px; }
.chg-arrow { color: var(--color-grey); margin: 0 2px; }
.edit-history > summary { cursor: pointer; }

/* Applicant: roles grouped by tournament; withdrawn roles on the form */
.tournament-block { padding: 10px 0; border-bottom: 1px solid var(--color-lilac-2); }
.tournament-block:last-of-type { border-bottom: 0; }
.pick-withdrawn { color: var(--color-grey); text-decoration: line-through; }
.pick-withdrawn .small { text-decoration: none; display: inline-block; }

/* Delete application (folded) and the deletion log */
.delete-card { border-color: #fecaca; }
.delete-card > summary { cursor: pointer; list-style: none; }
.delete-card > summary::-webkit-details-marker { display: none; }
.dellog-snapshot dl { margin: 6px 0 0; }

/* Other team's roles on an application: where they're up to */
.cross-team { margin: 0; padding-left: 18px; font-size: 14px; }
.cross-team li { margin: 3px 0; }
.cross-team .chip { margin-left: 4px; }

/* Bulk offers */
.bulk-group { font-size: 15px; margin: 16px 0 4px; }
.bulk-row { padding: 6px 4px; border-bottom: 1px solid var(--color-lilac-2); margin: 0; }
.bulk-flag { display: inline-block; font-size: 12px; border-radius: 4px; padding: 1px 6px; margin-top: 3px; }
.bulk-flag-block { background: #fee2e2; color: #991b1b; }
.bulk-flag-warn { background: #fef3c7; color: #92400e; }
.bulk-flag-info { background: #e0f2fe; color: #075985; }
.bulk-settings { margin-top: 16px; padding-top: 6px; border-top: 1px solid var(--color-lilac-2); }
.bulk-note { border-left: 3px solid var(--color-lilac-2); margin: 0 0 10px; padding: 6px 14px; color: #374151; }
.bulk-progress { height: 10px; background: var(--color-lilac-2); border-radius: 999px; overflow: hidden; max-width: 520px; }
.bulk-progress span { display: block; height: 100%; background: var(--color-primary); }
.chip-bulk_offer { background: #dcfce7; color: #166534; }

/* Sending state, and the message you just sent */
.sending-status { color: var(--color-grey); margin: 6px 0 0; }
.msg:target { outline: 2px solid var(--color-primary); outline-offset: 2px; }
button[aria-disabled="true"] { opacity: .7; cursor: progress; }

/* Confirmed officials report */
.report-preview { border: 1px solid var(--color-lilac-2); border-radius: var(--radius-sm); padding: 14px 16px; background: #fff; overflow-x: auto; }
.report-warn { background: #FEF3C7; border-color: #FDE68A; color: #78350F; }

/* Choice options: active / retired */
.options-panel { margin: 10px 0 4px; padding: 10px 12px; border: 1px solid var(--color-lilac-2); border-radius: var(--radius-sm); background: #fff; }
.opt-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 6px 0; border-bottom: 1px solid var(--color-lilac-2); }
.opt-row:last-of-type { border-bottom: 0; }
.opt-row .opt-edit { display: inline-flex; gap: 6px; flex: 1 1 260px; }
.opt-row .opt-edit input { max-width: 360px; padding: 5px 8px; }
.opt-row-retired .opt-label { color: var(--color-grey); text-decoration: line-through; }
.opt-chip { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.opt-active { background: #dcfce7; color: #166534; }
.opt-retired { background: #f3f4f6; color: #6b7280; }
.opt-replace > summary { list-style: none; display: inline-block; cursor: pointer; }
.opt-replace > summary::-webkit-details-marker { display: none; }
.opt-replace[open] { flex-basis: 100%; }
.opt-add { margin-top: 8px; }
.choice-row.option-retired { color: var(--color-grey); }

/* Long option lists, folded */
.opt-list > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.opt-list > summary::-webkit-details-marker { display: none; }
.opt-list[open] > summary .btn::after { content: ' ▴'; }
.opt-filter { max-width: 360px; margin: 6px 0; }
.opt-list .opt-row[hidden] { display: none !important; }

/* Targets per role: tournament heading rows and group totals */
.targets-table tr.targets-tournament th { background: var(--color-lilac); text-align: left; font-size: 14px; color: var(--color-ink); padding-top: 10px; }
.targets-table tr.targets-group td { background: #faf8ff; border-top: 1px solid var(--color-lilac-2); }
.targets-table tr.targets-role td:nth-child(2) { padding-left: 14px; }

/* One offer per tournament */
.offer-clash { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* Reference questions (form) and reference checks (application page) */
.ref-set { display: grid; gap: 10px; }
.ref-item { border: 1px solid var(--color-border, #e5e7eb); border-radius: 8px; padding: 8px 12px 10px; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px 12px; }
.ref-item legend { font-size: 13px; font-weight: 600; padding: 0 4px; }
.ref-field { display: flex; flex-direction: column; gap: 2px; min-width: 0; margin: 0; font-weight: 400; }
.ref-field input, .ref-field select { width: 100%; margin: 0; }
.chip-muted { background: #f3f4f6; color: #4b5563; }
.ref-check { border-top: 1px solid var(--color-border, #e5e7eb); padding: 12px 0; }
.ref-check:first-of-type { border-top: 0; }
.ref-check-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.ref-outcome { background: var(--color-grey-bg, #f9fafb); border-radius: 6px; padding: 8px 10px; margin: 6px 0; }
.ref-check details { margin-top: 8px; }
.ref-check details > summary { cursor: pointer; }
.ref-chip { text-decoration: none; }
.ref-chip.ref-notsent { background: #fef3c7; color: #92400e; }
.ref-chip.ref-awaiting { background: #ede9fe; color: #5b21b6; }
.ref-chip.ref-done { background: #dcfce7; color: #166534; }

/* Organisation logo beside the campaign heading (EOI form, application, campaign page) */
.org-head { display: flex; gap: 16px; align-items: center; margin-bottom: 8px; }
.org-head h1 { margin: 0 0 2px; }
.org-logo { width: 64px; height: 64px; object-fit: contain; flex: 0 0 auto; }
.org-logo.org-logo-sm { width: 22px; height: 22px; }
@media (max-width: 600px) { .org-logo:not(.org-logo-sm) { width: 48px; height: 48px; } .org-head { gap: 12px; } }

/* Replying to messages */
a.message-alert { display: block; text-decoration: none; color: inherit; border-color: var(--color-brand-purple); }
a.message-alert:hover { background: var(--color-lilac-2, #ede9fe); }
/* Applicant: a message waiting for their reply. Stronger than an ordinary notice, and it stays until they reply. */
a.message-alert.action-needed { display: flex; gap: 12px; align-items: flex-start; background: #fef3c7; border: 2px solid #f59e0b; color: #78350f; padding: 14px 16px; font-size: 1.02rem; }
a.message-alert.action-needed:hover { background: #fde68a; }
a.message-alert .ma-icon { font-size: 1.4rem; line-height: 1; }
a.message-alert .ma-go { display: inline-block; margin-left: 6px; font-weight: 700; text-decoration: underline; }
.awaiting-you { margin-top: 12px; padding: 8px 12px; background: #fef3c7; border: 1px solid #f59e0b; border-radius: 8px; color: #78350f; font-size: 14px; }
button.linklike { background: none; border: 0; padding: 0; margin-left: 8px; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }
.msg.msg-new { box-shadow: 0 0 0 2px var(--color-brand-purple, #74449A); }
.reply-form { scroll-margin-top: 80px; border-radius: 8px; transition: box-shadow .3s; }
.reply-form.reply-highlight { box-shadow: 0 0 0 3px var(--color-brand-purple, #74449A); }
a.reply-flag { display: inline-block; background: #fef3c7; color: #92400e; border: 1px solid #f59e0b; border-radius: 999px; padding: 1px 10px; font-size: 12px; font-weight: 700; text-decoration: none; margin-left: 4px; }
a.reply-flag:hover { background: #fde68a; }
.reply-waiting-note { margin-top: 14px; }
.reply-waiting-note .inline-form { margin-left: 6px; }

/* Offer check window */
.offer-dialog { border: 0; border-radius: 12px; padding: 20px 22px; max-width: 560px; width: calc(100% - 32px); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 60px rgba(17, 24, 39, .3); }
.offer-summary { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 12px 0 0; }
.offer-summary dt { margin: 0; color: var(--color-muted, #6b7280); font-size: 13px; padding-top: 2px; }
.offer-summary dd { margin: 0; }
@media (max-width: 420px) { .offer-summary { grid-template-columns: 1fr; gap: 2px; } .offer-summary dd { margin-bottom: 6px; } }
.offer-dialog::backdrop { background: rgba(17, 24, 39, .45); }
.offer-summary dt { white-space: nowrap; }
.offer-review { border-color: var(--color-brand-purple); }
.offer-review .inline-form { margin-right: 8px; }
.appointment-row { padding: 10px 0; border-top: 1px solid var(--color-lilac-2, #ede9fe); }
.appointment-row:first-of-type { border-top: 0; padding-top: 0; }

/* EB approval */
.approval-group { font-size: 15px; margin: 16px 0 4px; }
.approval-list td { vertical-align: top; }
.manual-approve summary { cursor: pointer; color: var(--color-brand-purple, #74449A); }
.manual-approve form { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.manual-approve input[type=text] { flex: 1 1 240px; margin: 0; }
.approval-request { border-bottom: 1px solid var(--color-lilac-2, #ede9fe); margin-bottom: 10px; }

/* Offer check: target already met (a warning, the offer can still go) */
.target-over { margin-top: 4px; padding: 6px 10px; border-radius: 8px; background: #fef3c7; border: 1px solid #fde68a; color: #92400e; font-size: 13px; }
/* Conflict of interest: view-only applications */
.coi-notice { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.coi-chip { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
/* Activity log on an application */
.activity-list td { vertical-align: top; }
.activity-list .act-via { display: block; color: #9a3412; font-size: 12px; }
@media (max-width: 640px) {
  .activity-list, .activity-list tbody, .activity-list tr, .activity-list td { display: block; width: auto; }
  .activity-list tr:first-child { display: none; }
  .activity-list tr { padding: 8px 0; border-bottom: 1px solid var(--color-lilac-2, #ece4fb); }
  table.list.activity-list td { border: 0; padding: 1px 0; }
  .activity-list td:empty { display: none; }
}

/* Help and user guide (help.php) */
.guide { max-width: 860px; }
.guide-lead { font-size: 17px; line-height: 1.6; color: var(--color-ink); margin: 6px 0 0; }
.guide-jump { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.guide-jump .card { margin: 0; text-decoration: none; color: var(--color-ink); display: flex; flex-direction: column; gap: 6px; }
.guide-jump .card:hover { border-color: var(--color-primary); }
.guide-jump strong { font-family: var(--font-display); color: var(--color-brand-purple-dk); }
.guide-jump span { font-size: 13px; color: var(--color-grey); line-height: 1.45; }
.guide-section { padding: 24px 26px; scroll-margin-top: 16px; }
.guide-section h2 { font-size: 24px; margin-bottom: 8px; }
.guide-section h3 { font-size: 17px; margin: 22px 0 6px; color: var(--color-brand-purple-dk); scroll-margin-top: 16px; }
.guide-section p, .guide-section li { line-height: 1.6; }
.guide-section li { margin-bottom: 6px; }
.guide-section .ui { font-weight: 600; color: var(--color-ink); background: var(--color-lilac); border-radius: 4px; padding: 0 4px; white-space: nowrap; }
.guide-flow { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 10px; }
.guide-flow li { counter-increment: step; position: relative; padding-left: 40px; }
.guide-flow li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--color-brand-purple); color: #fff; font-weight: 700; font-size: 14px; display: grid; place-items: center; }
.guide-tip { background: var(--color-lilac); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 14px; }
.guide-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 6px 0 12px; }
.guide-table th, .guide-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--color-grey-light); vertical-align: top; }
.guide-table th { color: var(--color-grey); font-weight: 600; }
.guide details { border-top: 1px solid var(--color-grey-light); padding: 10px 0; }
.guide details summary { cursor: pointer; font-weight: 600; color: var(--color-ink); }
.guide details p { margin: 8px 0 0; }
@media (max-width: 900px) { .guide-section .ui { white-space: normal; } }
@media (max-width: 640px) { .guide-section { padding: 18px 16px; } }
