*{box-sizing:border-box;}
html,body{margin:0;}
body{
  background:linear-gradient(180deg, var(--theme-wash), var(--paper) 620px);
  color:var(--ink); font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size:16px; line-height:1.5; -webkit-font-smoothing:antialiased;
}
h1{font-size:clamp(2rem,2.6vw,2.5rem);font-weight:650;letter-spacing:-.045em;line-height:1.18;text-wrap:balance;margin:0;}
h2{font-size:1.125rem;font-weight:650;letter-spacing:-.025em;margin:0;}
h3{font-size:1rem;font-weight:650;margin:0;}
p{margin:0;}
a{color:inherit;text-decoration:none;}
button{font-family:inherit;cursor:pointer;}
button:disabled{cursor:not-allowed;opacity:.5;}
/* Disabled fields have to *look* disabled. Only buttons were covered, so a
   locked <select> -- the Voting choices and Response type ones, which lock
   themselves once a category has votes so existing votes can't be
   reinterpreted -- rendered identically to a working one: white, full opacity,
   normal cursor. Clicking it did nothing and looked like a broken dropdown
   rather than a deliberate lock, explanatory note underneath notwithstanding. */
input:disabled,select:disabled,textarea:disabled{
  cursor:not-allowed;background:var(--paper);color:var(--muted);border-color:var(--border);
}
img{max-width:100%;}
[hidden]{display:none!important;}
input,select,textarea{font:inherit;}
input:not([type=radio]):not([type=checkbox]),select,textarea{
  width:100%;border:1px solid var(--input);background:#fff;border-radius:var(--radius);
  padding:11px 13px;color:var(--ink);font-size:14px;
}
input:focus,select:focus,textarea:focus{outline:2px solid var(--primary);outline-offset:1px;}

/* Chromium's customisable <select> lets the open dropdown be styled like the rest
   of the app instead of falling back to the OS menu, while keeping the real
   element's keyboard and screen-reader behaviour. Browsers without it simply get
   the plain native dropdown, so nothing breaks. */
@supports (appearance: base-select) {
  select,::picker(select){appearance:base-select;}
  select::picker-icon{color:var(--muted);transition:transform .15s;}
  select:open::picker-icon{transform:rotate(180deg);}
  /* Drop the list below the field, flipping above it only when there isn't room.
     This used to be `span-block-end`, which rendered the list UPWARD from the
     field: with ten departments on the People page the top of the list ran off
     the top of the viewport, and `overflow:hidden` then cut the last entries off
     with no scrollbar -- "People & Culture" and "Technology" simply could not be
     picked. Hence both the reposition and the switch to scrolling. */
  ::picker(select){
    position-area:block-end span-inline-end;position-try-fallbacks:flip-block;
    /* Never narrower than the field, but free to grow to fit the longest entry.
       Pinning it to the field's width made options like "Front of House" overflow
       and put a horizontal scrollbar under the list. */
    min-width:anchor-size(width);width:max-content;max-width:min(90vw,360px);
    margin-block:4px 0;
    background:#fff;border:1px solid var(--ink);border-radius:var(--radius);
    box-shadow:0 12px 32px rgba(19,37,59,.14);padding:0;
    max-height:min(320px,60vh);overflow-y:auto;overflow-x:hidden;
  }
  option{
    display:flex;align-items:center;gap:10px;padding:11px 14px;
    font-size:.9rem;color:var(--ink);
  }
  option:hover{background:var(--theme-wash);}
  option:checked{background:var(--theme-soft);color:var(--theme-text);}
  option::checkmark{order:1;margin-left:auto;color:var(--theme-text);}
}

.page-width{width:100%;max-width:1536px;margin-inline:auto;padding-inline:clamp(1.25rem,3.2vw,3rem);}
.eyebrow{text-transform:uppercase;letter-spacing:.13em;font-size:.75rem;font-weight:650;color:#607188;}
.muted{color:var(--muted);}
.tabular{font-variant-numeric:tabular-nums;}

.button{display:inline-flex;align-items:center;justify-content:center;gap:9px;min-height:44px;padding:11px 17px;border:1px solid transparent;border-radius:var(--radius);font-size:.875rem;font-weight:600;white-space:nowrap;}
.button.primary{background:var(--primary);color:#fff;box-shadow:0 2px 3px rgba(19,37,59,.05);}
.button.primary:hover{background:var(--primary-hover);}
.button.secondary{background:#fff;border-color:#dce3ed;color:#43516a;}
.button.secondary:hover{background:#f8fafc;border-color:#bcc9d9;}
.button.lime{background:var(--lime);color:var(--accent-ink);}
.button.lime:hover{background:var(--lime-hover);}
.button.danger{background:#fff;border-color:#f0c9cb;color:var(--danger);}
.button.block{width:100%;justify-content:center;}
.button.small{min-height:34px;padding:7px 13px;font-size:.8rem;}
.button-ghost{display:inline-flex;align-items:center;gap:7px;background:none;border:none;color:var(--theme-text);font-weight:650;font-size:.875rem;padding:0;}
.button-ghost:disabled{opacity:.45;cursor:default;}

.icon-button{width:40px;height:40px;border-radius:var(--radius);border:none;background:none;color:#607188;display:inline-flex;align-items:center;justify-content:center;position:relative;}
.icon-button:hover{background:var(--theme-soft);color:var(--theme-text);}

.tag{display:inline-flex;align-items:center;gap:5px;padding:5px 9px;font-size:.75rem;font-weight:550;color:#5c6b82;background:#eef2f7;border-radius:var(--radius);white-space:nowrap;}
.tag.green{color:var(--theme-text);background:var(--theme-soft);}
.tag.amber{color:#885719;background:#fff2dc;}
.you-tag{background:var(--primary);color:#fff;font-size:.65rem;font-weight:800;border-radius:9px;padding:1px 7px;margin-left:6px;}

.avatar{width:38px;height:38px;border-radius:var(--radius);display:inline-flex;align-items:center;justify-content:center;font-weight:650;font-size:.75rem;flex:none;overflow:hidden;}
.avatar img{width:100%;height:100%;object-fit:cover;}
.avatar.small{width:32px;height:32px;font-size:.7rem;}
.avatar.large{width:62px;height:62px;font-size:1.25rem;}
.avatar.xl{width:85px;height:85px;font-size:1.75rem;border-radius:8px;}
.avatar.mint{background:var(--mint-bg);color:var(--mint-ink);}
.avatar.blue{background:var(--blue-bg);color:var(--blue-ink);}
.avatar.pink{background:var(--pink-bg);color:var(--pink-ink);}
.avatar.gold{background:var(--gold-bg);color:var(--gold-ink);}
.avatar.lilac{background:var(--lilac-bg);color:var(--lilac-ink);}

.panel{background:var(--card);border:1px solid var(--border);border-radius:var(--radius);}
.panel-head{padding:16px 18px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;}
.panel-body{padding:18px;}
.panel-head .head-icon{color:#9aa6b8;display:inline-flex;}

/* The MB anchor mark: the real PNG asset, masked so it inherits the text colour. */
.anchor-mark{display:inline-block;flex:none;vertical-align:-2px;background-color:currentColor;
  -webkit-mask:url(../assets/images/anchor-mark.png) center/contain no-repeat;
  mask:url(../assets/images/anchor-mark.png) center/contain no-repeat;}

.form-field{display:flex;flex-direction:column;gap:6px;margin-bottom:14px;}
.form-field label{font-size:.8rem;font-weight:600;color:#43516a;}
.form-row{display:flex;gap:12px;flex-wrap:wrap;}
.form-row > .form-field{flex:1;min-width:160px;}

.empty-state{text-align:center;padding:56px 20px;color:var(--muted);}
.empty-state h3{color:#44546e;font-size:1.05rem;font-weight:650;margin:16px 0 10px;}
.empty-state p{font-size:.9rem;line-height:1.6;max-width:64ch;margin:0 auto;}
.spinner{width:18px;height:18px;border:2px solid var(--theme-border);border-top-color:var(--theme-text);border-radius:50%;animation:spin 1s linear infinite;display:inline-block;}
@keyframes spin{to{transform:rotate(360deg);}}
/* The loading card, ported from the reference project. It is written straight
   into each page's <main>, so it is on screen before any script runs -- the
   point of a loading state is that it is the first thing painted, not
   something JavaScript gets around to. The same card carries the failure
   message when the campaign can't be fetched. */
.app-loading{min-height:65svh;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:20px;padding:35px;max-width:760px;width:calc(100% - 40px);margin:40px auto;background:var(--card);border:1px solid var(--border);border-radius:var(--radius);box-shadow:0 15px 45px #18345204;}
.app-loading .anchor-mark,.app-loading>svg{color:var(--primary);width:46px;height:46px;}
.app-loading h1{font-size:2rem;font-weight:550;margin:0;}
.app-loading p{color:var(--muted);line-height:1.8;font-size:1rem;margin:0;max-width:540px;}
.loading-anchor{animation:float 2s infinite ease-in-out;}
@keyframes float{0%,100%{transform:translateY(0);}50%{transform:translateY(-7px);}}
@media (prefers-reduced-motion: reduce){ .loading-anchor{animation:none;} }
@media (max-width: 760px){
  .app-loading{min-height:55svh;margin-block:24px;padding:30px 22px;}
  .app-loading h1{font-size:1.75rem;}
  .app-loading p{font-size:.9rem;}
}
@keyframes pulse{0%,100%{opacity:1;}50%{opacity:.55;}}

@media (max-width: 900px){
  .grid-2{grid-template-columns:1fr!important;}
  .stats-grid{grid-template-columns:repeat(2,1fr)!important;}
}
@media (max-width: 560px){
  .card-grid, .people-grid, .badge-grid{grid-template-columns:1fr 1fr!important;}
}
