/* =====================================================================
   IMTMA Policy Advocacy Tracker
   Direction F — Slate and indigo, layered enterprise.

   Cool blue-grey page. White panels floating on it with hairline
   borders and soft corners. Tinted panel headers. Indigo carries every
   primary action; ministry colour is a variable each tone class sets,
   which components and inline styles both read.
   ===================================================================== */

:root{
  /* ------------------------------------------------------------------
     Tokens lifted from the IMTMA website so the tracker is visibly part
     of the same product family rather than a separate tool.
     ------------------------------------------------------------------ */
  --ink:        #14152B;
  --ink-soft:   #262A4D;
  --steel:      #666D8F;
  --steel-2:    #9298B8;

  --brand:      #1B4F8F;   /* corporate blue */
  --brand-2:    #2E6FC0;
  --brand-deep: #123E6E;
  --brand-wash: #E3EDF9;
  --brand-tint: #F1F6FC;

  --mist:    #F4F7FB;
  --panel:   #FFFFFF;
  --panel-2: #FAFCFE;
  --line:    #DFE6EF;
  --line-2:  #EDF1F7;

  --ok:     #0EA672;  --ok-bg:     #E4F6EE;
  --warn:   #E08704;  --warn-bg:   #FCF1DE;
  --danger: #E0413C;  --danger-bg: #FBE9E8;
  --info:   #3068E6;  --info-bg:   #E7EEFC;

  --shadow-sm: 0 1px 2px rgba(20,21,43,.05), 0 2px 6px rgba(20,21,43,.05);
  --shadow:    0 2px 6px rgba(20,21,43,.05), 0 14px 34px rgba(20,21,43,.09);
  --shadow-lg: 0 24px 60px rgba(20,21,43,.18);
  --glow:      0 6px 16px rgba(27,79,143,.30);

  --r-xs:  8px;
  --r-sm:  11px;
  --r:     15px;
  --r-lg:  22px;
  --r-pill:999px;

  --f-display:Arial,"Helvetica Neue",Helvetica,sans-serif;
  --f-body:Arial,"Helvetica Neue",Helvetica,sans-serif;
  --f-mono:Consolas,"Courier New",ui-monospace,monospace;

  /* --- Names the existing markup and stylesheet already use --------- */
  --white:      var(--panel);
  --page:       var(--mist);
  --surface:    var(--panel-2);
  --surface-2:  var(--panel-2);
  --gray-100:   var(--line-2);
  --gray-200:   var(--line-2);
  --gray-300:   var(--line);
  --gray-500:   var(--steel);
  --gray-700:   var(--ink-soft);
  --gray-900:   var(--ink);

  --primary:       var(--brand);
  --primary-dark:  var(--brand-deep);
  --primary-mid:   var(--brand-2);
  --primary-light: var(--brand-wash);

  --success:       var(--ok);      --success-light: var(--ok-bg);
  --warning:       var(--warn);    --warning-light: var(--warn-bg);
  --accent:        var(--danger);  --accent-light:  var(--danger-bg);

  --ink-2:     var(--ink-soft);
  --seal:      var(--brand);
  --madder:    var(--danger);
  --brass:     var(--warn);
  --rule:      var(--line);
  --rule-soft: var(--line-2);
  --mono:      var(--f-mono);

  --radius:    var(--r);
  --radius-sm: var(--r-sm);
  --shadow-md: var(--shadow);

  /* Ministry tones, pitched into the corporate blue family so they read as one set */
  --tone-a:#1B4F8F; --tone-b:#2E6FC0; --tone-c:#B26A00; --tone-d:#5B4BA8;
  --tone-e:#C0392F; --tone-f:#0E7C8F; --tone-g:#8A5A33; --tone-h:#12805C;
  --tone-x:#5C6580;
}

/* Ministry tone classes set a local --tone that components and inline
   styles both read. They paint nothing themselves, so they are safe
   anywhere in the markup. */
.tone-a{ --tone:var(--tone-a); } .tone-b{ --tone:var(--tone-b); }
.tone-c{ --tone:var(--tone-c); } .tone-d{ --tone:var(--tone-d); }
.tone-e{ --tone:var(--tone-e); } .tone-f{ --tone:var(--tone-f); }
.tone-g{ --tone:var(--tone-g); } .tone-h{ --tone:var(--tone-h); }
.tone-x{ --tone:var(--tone-x); }

*,*::before,*::after{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; }

body{
  margin:0;
  font-family:var(--f-body);
  font-size:15px;
  line-height:1.6;
  color:var(--gray-900);
  background:var(--page);
  -webkit-font-smoothing:antialiased;
}

a{ color:var(--primary); text-decoration:none; }
a:hover{ text-decoration:underline; }
h1,h2,h3,h4{ margin:0; font-family:var(--f-display); font-weight:600; line-height:1.25; letter-spacing:-.01em; }
:focus-visible{ outline:2px solid var(--primary); outline-offset:2px; }
img{ max-width:100%; }

/* ================================================================= *
   SHELL AND TOP BAR
 * ================================================================= */
/* =====================================================================
   LAYOUT — fixed sidebar on the left, content to the right.
   Below 980px the sidebar slides in over the content instead.
   ===================================================================== */
.shell{ display:flex; min-height:100vh; }

.sidebar{
  position:fixed; top:0; left:0; bottom:0; z-index:120;
  width:250px; flex:0 0 250px;
  display:flex; flex-direction:column;
  background:linear-gradient(180deg, #1B4F8F 0%, #17457E 58%, #123E6E 100%);
  border-right:1px solid rgba(255,255,255,.08);
  overflow-y:auto;
}

.brand{
  display:flex; align-items:center; gap:.7rem;
  padding:1.25rem 1.15rem;
  border-bottom:1px solid rgba(255,255,255,.14);
  text-decoration:none; color:#fff; flex:0 0 auto;
}
.brand:hover{ text-decoration:none; }
.brand-mark{ display:flex; align-items:center; flex:0 0 auto; }
.brand-mark img{
  height:36px; width:auto; display:block;
  background:#fff; padding:5px 7px; border-radius:var(--r-xs);
}
.brand-wordmark{ font-size:1.12rem; font-weight:700; color:#fff; }
.brand-text{ display:flex; flex-direction:column; min-width:0; line-height:1.2; }
.brand-name{ font-size:1.05rem; font-weight:700; color:#fff; }
.brand-sub{ font-size:.8rem; color:rgba(255,255,255,.72); margin-top:.12rem; }

.sidenav{
  flex:1 1 auto;
  padding:.9rem .7rem 1.2rem;
  display:flex; flex-direction:column; gap:.12rem;
}
.nav-group{
  display:block; margin:1.15rem .55rem .4rem;
  font-size:.73rem; font-weight:700;
  letter-spacing:.12em; text-transform:uppercase; color:rgba(255,255,255,.58);
}
.nav-group:first-child{ margin-top:.2rem; }

.nav-item{
  display:flex; align-items:center; gap:.5rem;
  padding:.62rem .85rem;
  color:rgba(255,255,255,.86); text-decoration:none;
  font-weight:500; font-size:.97rem;
  border-radius:var(--r-sm);
  white-space:nowrap;
  transition:background .15s ease, color .15s ease;
}
.nav-item:hover{ background:rgba(255,255,255,.12); color:#fff; text-decoration:none; }
.nav-item.is-active{
  background:#fff;
  color:var(--brand-deep); font-weight:700;
  box-shadow:0 2px 8px rgba(0,0,0,.18);
}
.nav-item.is-active:hover{ color:#fff; }
.nav-count{
  margin-left:auto; min-width:1.25rem; padding:.05rem .38rem;
  border-radius:var(--r-pill); background:var(--danger); color:#fff;
  font-size:.68rem; font-weight:700; text-align:center; line-height:1.55;
}
.nav-item.is-active .nav-count{ background:var(--brand); color:#fff; }

.sidebar-foot{
  flex:0 0 auto;
  padding:.7rem;
  border-top:1px solid rgba(255,255,255,.14);
  background:rgba(0,0,0,.14);
}
.sidebar-user{
  display:flex; align-items:center; gap:.6rem;
  padding:.35rem .45rem .6rem;
}
.sidebar-user-text{ display:flex; flex-direction:column; min-width:0; line-height:1.25; }
.sidebar-user-name{
  font-size:.92rem; font-weight:600; color:#fff;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.sidebar-user-role{
  font-size:.72rem; font-weight:600; letter-spacing:.06em;
  text-transform:uppercase; color:rgba(255,255,255,.66);
}
.nav-item.is-signout{ color:#FFC9C6; }
.nav-item.is-signout:hover{ background:rgba(224,65,60,.28); color:#fff; }

.account-avatar{
  flex:0 0 auto; width:36px; height:36px; border-radius:50%;
  background:rgba(255,255,255,.2); border:1px solid rgba(255,255,255,.3);
  color:#fff; display:flex; align-items:center; justify-content:center;
  font-size:.92rem; font-weight:700;
  box-shadow:0 4px 10px rgba(27,79,143,.28);
}

.main{
  flex:1 1 auto;
  margin-left:250px;
  width:calc(100% - 250px);
  max-width:1480px;
  padding:1.6rem 1.75rem 3rem;
}

/* Hamburger, hidden until the sidebar collapses */
.nav-toggle{
  display:none;
  position:fixed; top:.85rem; left:.85rem; z-index:140;
  width:42px; height:42px; padding:0;
  background:var(--panel); border:1px solid var(--line);
  border-radius:var(--r-sm); box-shadow:var(--shadow-sm);
  cursor:pointer;
  flex-direction:column; align-items:center; justify-content:center; gap:4px;
}
.nav-toggle span{
  display:block; width:18px; height:2px;
  background:var(--ink); border-radius:2px;
}
.nav-scrim{
  display:none; position:fixed; inset:0; z-index:110;
  background:rgba(20,21,43,.45);
}

@media (max-width:980px){
  .sidebar{
    transform:translateX(-100%);
    transition:transform .22s ease;
    box-shadow:var(--shadow-lg);
  }
  .sidebar.is-open{ transform:translateX(0); }
  .main{ margin-left:0; width:100%; padding:4.2rem 1.1rem 3rem; }
  .nav-toggle{ display:flex; }
  .nav-scrim:not([hidden]){ display:block; }
}


/* ================================================================= *
   PAGE HEAD
 * ================================================================= */
.page-head{
  display:flex; align-items:flex-end; justify-content:space-between;
  gap:1.5rem; flex-wrap:wrap; margin-bottom:1.4rem;
}
.page-head > div:first-child{ flex:1 1 auto; min-width:0; }
.page-actions{ display:flex; gap:.55rem; flex-wrap:wrap; flex:0 0 auto; margin:0; }

.eyebrow{
  display:block; font-size:.7rem; font-weight:600;
  letter-spacing:.13em; text-transform:uppercase;
  color:var(--gray-500); margin-bottom:.35rem;
}
.page-title{ font-size:1.7rem; letter-spacing:-.015em; margin:0; }
.page-sub{ margin:.3rem 0 0; color:var(--gray-500); font-size:.93rem; }
.lede{ font-size:1rem; color:var(--gray-700); line-height:1.7; }

/* ================================================================= *
   METRIC CARDS
   Children are <span>, so they must be forced to block.
 * ================================================================= */
.metrics{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(205px,1fr));
  gap:.85rem; margin-bottom:1.4rem;
}
.metric{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--r-sm);
  padding:1rem 1.15rem 1.1rem;
  box-shadow:var(--shadow);
  min-width:0;
  position:relative;
}
.metric::before{
  content:""; position:absolute; left:1.15rem; top:0;
  width:26px; height:3px; border-radius:0 0 3px 3px;
  background:var(--tone, var(--primary));
}
.metric-label{
  display:block;
  font-size:.775rem; font-weight:500;
  color:var(--gray-500); margin-bottom:.35rem; line-height:1.4;
}
.metric-value{
  display:block;
  font-size:1.95rem; font-weight:600;
  line-height:1.15; letter-spacing:-.02em;
  color:var(--gray-900);
  font-variant-numeric:tabular-nums;
  margin-bottom:.3rem;
}
.metric-note{ display:block; font-size:.8rem; color:var(--gray-500); line-height:1.45; }

/* ================================================================= *
   PANELS — tinted header, white body
 * ================================================================= */
.panel{
  background:var(--white);
  border:1px solid var(--gray-300);
  border-radius:var(--radius);
  margin-bottom:1.1rem;
  overflow:hidden;
  box-shadow:var(--shadow-sm);
}
.panel-head{
  padding:.7rem 1.2rem;
  border-bottom:1px solid var(--gray-300);
  background:var(--surface-2);
  display:flex; align-items:center; justify-content:space-between; gap:1rem;
}
.panel-head h2{
  font-size:.74rem; font-weight:600;
  letter-spacing:.11em; text-transform:uppercase;
  color:var(--gray-500); margin:0;
}
.panel-head .small,.panel-head a,.panel-head .code{ font-size:.8rem; }
.panel-body,.panel-pad{ padding:1.2rem; }
.panel-foot{
  padding:.75rem 1.2rem; background:var(--surface-2);
  border-top:1px solid var(--gray-300);
  font-size:.85rem; color:var(--gray-500);
}

/* ================================================================= *
   BAR CHARTS
   Track and fill are <span>, so they must be forced to block.
 * ================================================================= */
.barlist{ display:block; }
.barrow{
  display:grid;
  grid-template-columns:minmax(0,1fr) 3rem 120px;
  align-items:center; gap:1rem;
  padding:.55rem 0;
  border-bottom:1px solid var(--gray-200);
}
.barrow:last-child{ border-bottom:0; }
.barlabel{
  font-size:.9rem; color:var(--gray-900); min-width:0;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.barlabel a{ color:var(--gray-900); }
.barlabel a:hover{ color:var(--primary); }
.barvalue{
  text-align:right; font-size:.9rem; font-weight:600;
  color:var(--gray-900); font-variant-numeric:tabular-nums;
}
.bartrack{
  display:block; position:relative; height:7px;
  background:var(--gray-200); border-radius:4px; overflow:hidden;
}
.barfill{
  display:block; height:100%;
  background:var(--tone, var(--primary));
  border-radius:4px; min-width:3px;
}

/* ================================================================= *
   REGISTER RECORDS
 * ================================================================= */
.record{
  background:var(--white);
  border:1px solid var(--gray-300);
  border-left:3px solid var(--tone, var(--gray-500));
  border-radius:var(--radius);
  padding:1rem 1.15rem;
  margin-bottom:.7rem;
  box-shadow:var(--shadow);
}
.record:hover{ box-shadow:var(--shadow-md); }
.record-top{ display:flex; align-items:center; gap:.55rem; flex-wrap:wrap; margin-bottom:.4rem; }
.record-ministry{
  font-size:.7rem; font-weight:700;
  letter-spacing:.1em; text-transform:uppercase; color:var(--gray-500);
}
.record-title{ font-size:1.05rem; font-weight:600; line-height:1.35; margin:0 0 .28rem; }
.record-title a{ color:var(--gray-900); }
.record-title a:hover{ color:var(--primary); }
.record-sub{ font-size:.88rem; color:var(--gray-500); margin:0 0 .55rem; }
.record-meta{
  display:flex; gap:1rem; flex-wrap:wrap;
  font-size:.78rem; color:var(--gray-500);
  padding-top:.6rem; border-top:1px solid var(--gray-200);
}
.record-actions{ display:flex; gap:.45rem; flex-wrap:wrap; }

/* ================================================================= *
   GAZETTE FILE NUMBER
 * ================================================================= */
.stamp{
  display:inline-block; font-family:var(--mono); font-size:.8rem;
  color:var(--gray-700); background:var(--gray-100);
  border:1px solid var(--gray-300); border-radius:var(--radius-sm);
  padding:.3rem .55rem; word-break:break-word;
}
.stamp-label{
  display:block; font-size:.64rem; font-weight:600;
  letter-spacing:.12em; text-transform:uppercase;
  color:var(--gray-500); margin-bottom:.2rem;
}

/* ================================================================= *
   BADGES — soft pills
 * ================================================================= */
.badge{
  display:inline-block; padding:.22rem .65rem;
  border-radius:var(--r-pill); font-size:.72rem; font-weight:600;
  white-space:nowrap;
  background:var(--gray-100); color:var(--gray-700);
}
.badge-seal   { background:var(--primary-light); color:var(--primary); }
.badge-indigo { background:var(--primary-light); color:var(--primary); }
.badge-brass  { background:var(--warning-light); color:var(--warning); }
.badge-madder { background:var(--accent-light);  color:var(--accent); }
.badge-grey   { background:var(--gray-100);      color:var(--gray-500); }

/* ================================================================= *
   BUTTONS
 * ================================================================= */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:.4rem;
  padding:.55rem 1.1rem;
  border:1px solid var(--line); border-radius:var(--r-pill);
  background:var(--white); color:var(--gray-900);
  font-family:inherit; font-size:.89rem; font-weight:500;
  cursor:pointer; text-decoration:none; white-space:nowrap;
  transition:background .15s ease, border-color .15s ease;
}
.btn:hover{ background:var(--gray-100); border-color:var(--gray-500); text-decoration:none; }
.btn-primary{
  background:linear-gradient(145deg, var(--brand-2), var(--brand-deep));
  border-color:transparent; color:#fff; box-shadow:var(--glow);
}
.btn-primary:hover{
  background:linear-gradient(145deg, var(--brand), var(--brand-deep));
  box-shadow:0 8px 22px rgba(27,79,143,.38); transform:translateY(-1px);
}
.btn-danger{ background:var(--white); border-color:var(--gray-300); color:var(--accent); }
.btn-danger:hover{ background:var(--accent); border-color:var(--accent); color:var(--white); }
.btn-ghost{ background:transparent; border-color:transparent; color:var(--gray-700); }
.btn-ghost:hover{ background:var(--gray-100); border-color:var(--gray-300); }
.btn-sm{ padding:.32rem .7rem; font-size:.82rem; }
.btn-block{ display:flex; width:100%; }

/* ================================================================= *
   FORMS
 * ================================================================= */
.field{ margin-bottom:1.1rem; min-width:0; }
.field label,.check label,.checkline label{
  display:block; margin-bottom:.35rem;
  font-weight:500; font-size:.87rem; color:var(--gray-900);
}
input[type=text],input[type=email],input[type=password],input[type=date],
input[type=number],input[type=search],input[type=url],select,textarea{
  width:100%; padding:.6rem .85rem;
  border:1px solid var(--line); border-radius:var(--r-sm);
  background:var(--white); font-family:inherit; font-size:.9rem; color:var(--gray-900);
}
textarea{ min-height:6.5rem; resize:vertical; line-height:1.6; }
input:focus,select:focus,textarea:focus{
  outline:none; border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-light);
}
.hint{ font-size:.8rem; color:var(--gray-500); margin-top:.28rem; }
.filters{ display:grid; grid-template-columns:repeat(auto-fit, minmax(175px,1fr)); gap:.9rem; }
.filters .field{ margin-bottom:0; }
.check{ margin-bottom:.75rem; }
.checkline{ display:flex; gap:.55rem; align-items:flex-start; margin-bottom:.65rem; font-size:.9rem; }
.checkline input{ width:auto; margin-top:.3rem; flex:0 0 auto; }
.checkline label{ display:inline; margin-bottom:0; font-weight:400; }

.grid-2{ display:grid; grid-template-columns:repeat(auto-fit, minmax(235px,1fr)); gap:0 1.2rem; }
.grid-3{ display:grid; grid-template-columns:repeat(auto-fit, minmax(185px,1fr)); gap:0 1.2rem; }
.cluster{ display:flex; gap:.55rem; flex-wrap:wrap; align-items:center; }
.split{ display:grid; grid-template-columns:minmax(0,2fr) minmax(0,1fr); gap:1.1rem; align-items:start; }

/* ================================================================= *
   TABLES
 * ================================================================= */
.table-wrap{ overflow-x:auto; }
table.data{ width:100%; border-collapse:collapse; font-size:.9rem; }
table.data th{
  padding:.65rem 1.05rem; text-align:left;
  background:var(--surface-2);
  font-size:.7rem; font-weight:600;
  letter-spacing:.1em; text-transform:uppercase; color:var(--gray-500);
  border-bottom:1px solid var(--gray-300); white-space:nowrap;
}
table.data td{ padding:.7rem 1.05rem; border-bottom:1px solid var(--gray-200); vertical-align:top; }
table.data tbody tr:last-child td{ border-bottom:0; }
table.data tbody tr:hover{ background:var(--gray-100); }
table.data tr.row-high{ background:var(--accent-light); }
table.data tr.row-low{ color:var(--gray-500); }
.num{ text-align:right; font-variant-numeric:tabular-nums; }

/* ================================================================= *
   ALERTS AND NOTICES
 * ================================================================= */
.alert{
  padding:.8rem 1.1rem; border-radius:var(--radius-sm);
  margin-bottom:1.1rem; font-size:.9rem;
  border:1px solid var(--gray-300); border-left:3px solid var(--gray-500);
  background:var(--white);
}
.alert-success{ background:var(--success-light); border-color:#CDE3D9; border-left-color:var(--success); }
.alert-error  { background:var(--accent-light);  border-color:#F0D3D1; border-left-color:var(--accent); }
.alert-warn,
.alert-warning{ background:var(--warning-light); border-color:#EFDFC0; border-left-color:var(--warning); }
.alert-info   { background:var(--primary-light); border-color:#D3DAF0; border-left-color:var(--primary); }

.notice{
  padding:.8rem 1.1rem; border-radius:var(--radius-sm);
  background:var(--warning-light); border:1px solid #EFDFC0;
  font-size:.9rem; margin-bottom:1.1rem;
}
.notice-title{ display:block; font-weight:600; margin-bottom:.15rem; }
.notice-body{ color:var(--gray-700); }
.rail-note{
  background:var(--primary-light); border-left:3px solid var(--primary);
  border-radius:0 var(--radius-sm) var(--radius-sm) 0;
  padding:.7rem .95rem; font-size:.9rem; color:var(--gray-700);
}

/* ================================================================= *
   FACTS, PROSE, DOCUMENTS, EMPTY STATES
 * ================================================================= */
.facts{ margin:0; display:grid; grid-template-columns:auto 1fr; gap:.5rem 1.15rem; font-size:.9rem; }
.facts dt{
  font-size:.7rem; font-weight:600; letter-spacing:.1em;
  text-transform:uppercase; color:var(--gray-500); padding-top:.18rem;
}
.facts dd{ margin:0; color:var(--gray-900); }

.prose{ font-size:.92rem; color:var(--gray-700); line-height:1.7; }
.prose p{ margin:0 0 .75rem; }
.prose p:last-child{ margin-bottom:0; }

.doclink{
  display:flex; align-items:center; gap:.65rem;
  padding:.65rem .85rem; border:1px solid var(--gray-300);
  border-radius:var(--radius-sm); margin-bottom:.45rem;
  background:var(--white); font-size:.9rem;
}
.doclink:hover{ border-color:var(--primary); background:var(--primary-light); text-decoration:none; }
.doclink .ext{
  font-family:var(--mono); font-size:.63rem; font-weight:700;
  letter-spacing:.06em; text-transform:uppercase;
  background:var(--primary); color:var(--white);
  padding:.22rem .4rem; border-radius:3px; flex:0 0 auto;
}

.empty{ text-align:center; padding:2.75rem 1rem; color:var(--gray-500); }
.empty-mark{
  display:block; font-size:.7rem; font-weight:600;
  letter-spacing:.16em; text-transform:uppercase;
  color:var(--gray-500); margin-bottom:.55rem;
}

/* ================================================================= *
   PAGINATION
 * ================================================================= */
.pager{ display:flex; align-items:center; justify-content:space-between; gap:1rem; flex-wrap:wrap; margin:1.1rem 0 1.6rem; }
.pager-count{ font-size:.84rem; color:var(--gray-500); }
.pager-links{ display:flex; gap:.28rem; flex-wrap:wrap; }
.pager-links a,.pager-links span{
  display:inline-block; padding:.35rem .7rem;
  border:1px solid var(--gray-300); border-radius:var(--radius-sm);
  background:var(--white); font-size:.86rem; color:var(--gray-700);
}
.pager-links a:hover{ border-color:var(--primary); color:var(--primary); text-decoration:none; }
.pager-links .is-current{ background:var(--primary); border-color:var(--primary); color:var(--white); }

/* ================================================================= *
   SIGN-IN — centred card over a slowly drifting field

   Four decorative layers sit behind the card: three blurred orbs that
   float on their own timings, and a faint grid. All are transform or
   opacity animations so the compositor handles them, and all are
   switched off under prefers-reduced-motion by the global rule.
 * ================================================================= */
.auth{
  position:relative;
  min-height:100vh;
  display:flex; align-items:center; justify-content:center;
  padding:2.5rem 1.5rem;
  background:#141B31;
  overflow:hidden;
  isolation:isolate;
}

.auth-orb{
  position:absolute;
  border-radius:50%;
  filter:blur(80px);
  pointer-events:none;
  will-change:transform;
  z-index:0;
}
.auth-orb-1{
  width:460px; height:460px;
  background:#3B4C8F; opacity:.75;
  top:-14%; left:-8%;
  animation:orbDriftA 24s ease-in-out infinite alternate;
}
.auth-orb-2{
  width:400px; height:400px;
  background:#6B4A8F; opacity:.6;
  bottom:-16%; right:-6%;
  animation:orbDriftB 30s ease-in-out infinite alternate;
}
.auth-orb-3{
  width:330px; height:330px;
  background:#1A6470; opacity:.5;
  top:52%; left:58%;
  animation:orbDriftC 26s ease-in-out infinite alternate;
}

@keyframes orbDriftA{
  0%   { transform:translate3d(0,0,0) scale(1); }
  50%  { transform:translate3d(90px,60px,0) scale(1.12); }
  100% { transform:translate3d(40px,140px,0) scale(.95); }
}
@keyframes orbDriftB{
  0%   { transform:translate3d(0,0,0) scale(1); }
  50%  { transform:translate3d(-110px,-70px,0) scale(1.15); }
  100% { transform:translate3d(-50px,-150px,0) scale(.92); }
}
@keyframes orbDriftC{
  0%   { transform:translate3d(0,0,0) scale(.95); }
  50%  { transform:translate3d(-80px,70px,0) scale(1.2); }
  100% { transform:translate3d(70px,-60px,0) scale(1); }
}

/* Faint engineering grid, drifting one cell over the full cycle */
.auth-grid{
  position:absolute; inset:-60px;
  background-image:
    linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px);
  background-size:52px 52px;
  pointer-events:none; z-index:0;
  animation:gridDrift 40s linear infinite;
  mask-image:radial-gradient(ellipse at center, #000 35%, transparent 78%);
  -webkit-mask-image:radial-gradient(ellipse at center, #000 35%, transparent 78%);
}
@keyframes gridDrift{
  from { transform:translate3d(0,0,0); }
  to   { transform:translate3d(52px,52px,0); }
}

.auth-card{
  position:relative; z-index:1;
  width:100%; max-width:25rem;
  background:var(--white);
  border:1px solid rgba(255,255,255,.14);
  border-radius:14px;
  padding:2.5rem 2.25rem;
  box-shadow:0 20px 50px rgba(9,13,28,.5), 0 2px 8px rgba(9,13,28,.3);
  text-align:center;
  animation:cardRise .5s cubic-bezier(.22,.9,.3,1) both;
}
@keyframes cardRise{
  from { opacity:0; transform:translate3d(0,14px,0); }
  to   { opacity:1; transform:translate3d(0,0,0); }
}

.auth-card .brand-mark{ display:inline-flex; height:auto; margin:0 auto 1.5rem; }
.auth-card .brand-mark img{ height:64px; }
.auth-card .brand-mark .wordmark{ font-size:1.6rem; }

.auth-title{
  font-size:1.5rem; font-weight:600;
  letter-spacing:-.015em; line-height:1.25;
  margin:0 0 .4rem; color:var(--gray-900);
}
.auth-tagline{
  font-size:.88rem; color:var(--gray-500);
  line-height:1.55; margin:0 0 1.85rem;
}

.auth-card form{ margin:0; text-align:left; }
.auth-card .field{ margin-bottom:1rem; }
.auth-card .alert{ margin-bottom:1.15rem; text-align:left; }
.auth-card .btn-block{ margin-top:1.25rem; padding:.62rem 1rem; font-size:.95rem; }
.auth-card .hint{
  margin-top:1.6rem; padding-top:1.25rem;
  border-top:1px solid var(--gray-200);
  font-size:.83rem; line-height:1.6; color:var(--gray-500);
  text-align:center;
}

.install-head{ max-width:46rem; margin:0 auto 1.6rem; }

/* ================================================================= *
   UTILITIES
 * ================================================================= */
.mono{ font-family:var(--mono); }
.code{ font-family:var(--mono); font-size:.76rem; letter-spacing:.05em; color:var(--gray-500); }
.tiny{ font-size:.76rem; }
.small{ font-size:.85rem; }
.muted{ color:var(--gray-500); }
.strong{ font-weight:600; }
.center{ text-align:center; }
.right{ text-align:right; }
.nowrap{ white-space:nowrap; }
.wrap{ max-width:52rem; margin-inline:auto; }
/* install.php has no .main wrapper, so give it its own page padding */
body > .wrap{ padding:2.5rem 1.5rem; }
.mark{ background:#FBF0C4; padding:0 .15em; border-radius:2px; }

/* ================================================================= *
   RESPONSIVE
 * ================================================================= */
@media (max-width:1100px){ .split{ grid-template-columns:1fr; } }

@media (max-width:900px){
  
  .brand{ padding:.6rem 0; }
  
  .nav-item{ padding:.42rem .7rem; font-size:.86rem; }
  .main{ padding:1.15rem 1rem 2.5rem; }
  .page-head{ align-items:flex-start; }
  .page-title{ font-size:1.42rem; }
  .metrics{ grid-template-columns:repeat(auto-fit, minmax(155px,1fr)); gap:.65rem; }
  .metric-value{ font-size:1.6rem; }
  .barrow{ grid-template-columns:minmax(0,1fr) 2.4rem 76px; gap:.65rem; }
}

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

/* ================================================================= *
   PRINT
 * ================================================================= */
@media print{
  .topbar,.no-print,.page-actions,.pager,.record-actions{ display:none !important; }
  body{ background:var(--white); font-size:11pt; }
  .main{ padding:0; max-width:none; }
  .panel,.metric,.record{ box-shadow:none; border:1px solid #999; break-inside:avoid; }
  .panel-head,table.data th{ background:#F0F0F0; }
  a{ color:#000; text-decoration:none; }
  .barfill{ background:#555 !important; }
}

/* =====================================================================
   MEMBER DASHBOARD
   Built around the question a member actually arrives with: what has
   changed, and what closes soon. The hero carries identity and standing
   figures; urgency gets its own strip; the register reads as a timeline.
   ===================================================================== */

/* --- Hero band --------------------------------------------------- */
.hero{
  position:relative; overflow:hidden;
  background:linear-gradient(120deg, #1B4F8F 0%, #23609F 55%, #2E6FC0 115%);
  border-radius:var(--r-lg);
  padding:2rem 2.1rem;
  margin-bottom:1.1rem;
  color:#fff;
  box-shadow:var(--shadow);
}
.hero::after{
  content:""; position:absolute; right:-90px; top:-110px;
  width:340px; height:340px; border-radius:50%;
  background:rgba(255,255,255,.08); pointer-events:none;
}
.hero-top{
  display:flex; align-items:flex-start; justify-content:space-between;
  gap:1.5rem; flex-wrap:wrap; position:relative; z-index:1;
}
.hero-greeting{
  display:block; font-size:.7rem; font-weight:600;
  letter-spacing:.14em; text-transform:uppercase;
  color:rgba(255,255,255,.74); margin-bottom:.3rem;
}
.hero-name{ font-size:1.75rem; font-weight:600; letter-spacing:-.02em; margin:0; color:#fff; }
.hero-meta{ font-size:.9rem; color:rgba(255,255,255,.94); margin:.25rem 0 0; }
.hero-actions{ display:flex; gap:.5rem; flex-wrap:wrap; }
.hero-actions .btn{
  background:rgba(255,255,255,.14); border-color:rgba(255,255,255,.3); color:#fff;
}
.hero-actions .btn:hover{ background:rgba(255,255,255,.24); border-color:rgba(255,255,255,.45); color:#fff; }
.hero-actions .btn-primary{ background:#fff; border-color:#fff; color:var(--brand-deep); box-shadow:none; }
.hero-actions .btn-primary:hover{ background:#EAF1FA; border-color:#EAF1FA; color:var(--brand-deep); }

.hero-stats{
  display:flex; flex-wrap:wrap; gap:0;
  margin-top:1.5rem; padding-top:1.25rem;
  border-top:1px solid rgba(255,255,255,.2);
  position:relative; z-index:1;
}
.hero-stat{
  flex:1 1 130px; min-width:0;
  padding-right:1.4rem; margin-right:1.4rem;
  border-right:1px solid rgba(255,255,255,.18);
}
.hero-stat:last-child{ border-right:0; margin-right:0; padding-right:0; }
.hero-stat-value{
  display:block; font-size:1.55rem; font-weight:600;
  line-height:1.15; color:#fff; font-variant-numeric:tabular-nums;
}
.hero-stat-label{
  display:block; font-size:.79rem; color:rgba(255,255,255,.94);
  margin-top:.15rem; line-height:1.35;
}

/* --- Attention strip --------------------------------------------- */
.attention{ margin-bottom:1.1rem; }
.attention-head{
  display:flex; align-items:baseline; justify-content:space-between;
  gap:1rem; margin-bottom:.6rem;
}
.attention-head h2{
  font-size:.74rem; font-weight:600;
  letter-spacing:.11em; text-transform:uppercase; color:var(--gray-500); margin:0;
}
.attention-grid{
  display:grid; grid-template-columns:repeat(auto-fit, minmax(232px,1fr)); gap:.7rem;
}
.deadline{
  display:block;
  background:var(--panel); border:1px solid var(--line);
  border-top:3px solid var(--gray-500);
  border-radius:var(--r-sm);
  padding:.9rem 1.05rem 1rem;
  text-decoration:none; color:inherit;
  box-shadow:var(--shadow-sm);
  transition:box-shadow .15s ease, transform .15s ease;
}
.deadline:hover{ text-decoration:none; box-shadow:var(--shadow); transform:translateY(-2px); }
.deadline.is-urgent{ border-top-color:var(--accent); }
.deadline.is-soon{ border-top-color:var(--warning); }
.deadline-days{
  display:inline-block; font-size:.68rem; font-weight:700;
  letter-spacing:.07em; text-transform:uppercase;
  padding:.16rem .45rem; border-radius:3px; margin-bottom:.45rem;
  background:var(--gray-100); color:var(--gray-700);
}
.deadline.is-urgent .deadline-days{ background:var(--accent-light); color:var(--accent); }
.deadline.is-soon .deadline-days{ background:var(--warning-light); color:var(--warning); }
.deadline-title{
  display:block; font-size:.93rem; font-weight:600;
  line-height:1.35; color:var(--gray-900); margin-bottom:.35rem;
}
.deadline:hover .deadline-title{ color:var(--primary); }
.deadline-meta{ font-size:.75rem; color:var(--gray-500); }

/* --- Register timeline ------------------------------------------- */
.feed{ position:relative; padding-left:1.4rem; }
.feed::before{
  content:""; position:absolute; left:5px; top:.6rem; bottom:.6rem;
  width:1px; background:var(--gray-300);
}
.feed-item{ position:relative; padding:0 0 1.15rem; }
.feed-item:last-child{ padding-bottom:0; }
.feed-item::before{
  content:""; position:absolute; left:-1.4rem; top:.4rem;
  width:11px; height:11px; border-radius:50%;
  background:var(--tone, var(--primary));
  box-shadow:0 0 0 3px var(--white);
}
.feed-head{ display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; margin-bottom:.25rem; }
.feed-ministry{
  font-size:.68rem; font-weight:700; letter-spacing:.11em;
  text-transform:uppercase; color:var(--tone, var(--gray-500));
}
.feed-title{ font-size:1rem; font-weight:600; line-height:1.38; margin:0 0 .35rem; }
.feed-title a{ color:var(--gray-900); }
.feed-title a:hover{ color:var(--primary); }
.feed-meta{ display:flex; gap:.85rem; flex-wrap:wrap; font-size:.76rem; color:var(--gray-500); }

/* --- Tracking list ------------------------------------------------ */
.track{ display:block; }
.track-item{
  display:block; padding:.6rem 0;
  border-bottom:1px solid var(--gray-200); text-decoration:none;
}
.track-item:last-child{ border-bottom:0; }
.track-item:hover{ text-decoration:none; }
.track-title{
  display:block; font-size:.87rem; font-weight:500;
  color:var(--gray-900); line-height:1.4; margin-bottom:.18rem;
}
.track-item:hover .track-title{ color:var(--primary); }
.track-meta{ display:flex; align-items:center; gap:.45rem; font-size:.74rem; color:var(--gray-500); }
.track-dot{ width:7px; height:7px; border-radius:50%; background:var(--tone, var(--gray-500)); flex:0 0 auto; }

/* --- Notification list -------------------------------------------- */
.notif{ display:block; }
.notif-item{
  display:block; padding:.65rem 1.2rem;
  border-bottom:1px solid var(--gray-200); text-decoration:none;
}
.notif-item:last-child{ border-bottom:0; }
.notif-item:hover{ background:var(--gray-100); text-decoration:none; }
.notif-item.is-unread{ background:var(--primary-light); }
.notif-item.is-unread:hover{ background:#E1E6F5; }
.notif-title{
  display:block; font-size:.85rem; color:var(--gray-900);
  line-height:1.45; margin-bottom:.15rem;
}
.notif-item.is-unread .notif-title{ font-weight:600; }
.notif-time{ font-size:.73rem; color:var(--gray-500); }

@media (max-width:900px){
  .hero{ padding:1.35rem 1.35rem; }
  .hero-name{ font-size:1.45rem; }
  .hero-stat{
    flex:1 1 44%; border-right:0; padding-right:0; margin-right:0;
    padding-bottom:.8rem;
  }
  .hero-stat-value{ font-size:1.3rem; }
}

/* =====================================================================
   ANALYTICS DASHBOARD
   Richer instrumentation: trend cards with sparklines, an engagement
   funnel, an area chart and ranked leaderboards. Every chart is inline
   SVG drawn in PHP, so nothing is fetched from a CDN.
   ===================================================================== */

/* --- Trend stat cards --------------------------------------------- */
.stats{
  display:grid; grid-template-columns:repeat(auto-fit, minmax(238px,1fr));
  gap:.85rem; margin-bottom:1.1rem;
}
.statcard{
  position:relative; overflow:hidden;
  background:var(--panel); border:1px solid var(--line);
  border-radius:var(--r); padding:1.15rem 1.25rem .5rem;
  box-shadow:var(--shadow-sm);
  transition:box-shadow .18s ease, transform .18s ease;
}
.statcard:hover{ box-shadow:var(--shadow); transform:translateY(-2px); }
.statcard-label{
  display:block; font-size:.75rem; font-weight:500;
  color:var(--gray-500); margin-bottom:.5rem;
}
.statcard-row{ display:flex; align-items:baseline; gap:.6rem; flex-wrap:wrap; }
.statcard-value{
  font-size:2rem; font-weight:600; line-height:1;
  letter-spacing:-.025em; color:var(--gray-900);
  font-variant-numeric:tabular-nums;
}
.statcard-delta{
  display:inline-flex; align-items:center; gap:.18rem;
  font-size:.76rem; font-weight:600;
  padding:.16rem .42rem; border-radius:20px;
  background:var(--gray-100); color:var(--gray-500);
}
.statcard-delta.is-up  { background:var(--success-light); color:var(--success); }
.statcard-delta.is-down{ background:var(--accent-light);  color:var(--accent); }
.statcard-note{
  display:block; font-size:.76rem; color:var(--gray-500);
  margin-top:.3rem; line-height:1.4;
}
.statcard-spark{ display:block; margin:.5rem -1.2rem -.5rem; width:calc(100% + 2.4rem); }

/* --- Engagement funnel -------------------------------------------- */
.funnel{ display:flex; flex-direction:column; gap:.55rem; }
.funnel-step{ display:grid; grid-template-columns:1fr auto; gap:.3rem .9rem; align-items:baseline; }
.funnel-label{ font-size:.87rem; color:var(--gray-900); }
.funnel-count{
  font-size:.87rem; font-weight:600; color:var(--gray-900);
  font-variant-numeric:tabular-nums; text-align:right;
}
.funnel-bar{
  grid-column:1 / -1; height:26px; border-radius:5px;
  background:var(--gray-200); overflow:hidden; position:relative;
}
.funnel-fill{
  display:block; height:100%; border-radius:5px;
  background:linear-gradient(90deg, var(--brand-deep) 0%, var(--brand-2) 100%);
  display:flex; align-items:center; justify-content:flex-end;
  padding-right:.5rem; min-width:2.4rem;
}
.funnel-pct{ font-size:.72rem; font-weight:600; color:#fff; white-space:nowrap; }
.funnel-drop{
  font-size:.72rem; color:var(--gray-500);
  grid-column:1 / -1; margin:-.15rem 0 .1rem;
}

/* --- Reach ring ---------------------------------------------------- */
.ring-wrap{ display:flex; align-items:center; gap:1.25rem; flex-wrap:wrap; }
.ring{ flex:0 0 auto; }
.ring-legend{ flex:1 1 130px; min-width:0; }
.ring-legend-item{
  display:flex; align-items:center; gap:.5rem;
  font-size:.83rem; padding:.28rem 0;
  border-bottom:1px solid var(--gray-200);
}
.ring-legend-item:last-child{ border-bottom:0; }
.ring-swatch{ width:9px; height:9px; border-radius:2px; flex:0 0 auto; }
.ring-legend-value{ margin-left:auto; font-weight:600; font-variant-numeric:tabular-nums; }

/* --- Ranked leaderboard -------------------------------------------- */
.rank{ display:block; }
.rank-item{
  display:grid; grid-template-columns:1.6rem 1fr auto;
  gap:.75rem; align-items:center;
  padding:.6rem 0; border-bottom:1px solid var(--gray-200);
  text-decoration:none;
}
.rank-item:last-child{ border-bottom:0; }
.rank-item:hover{ text-decoration:none; }
.rank-num{
  font-size:.76rem; font-weight:700; color:var(--gray-500);
  font-variant-numeric:tabular-nums; text-align:center;
}
.rank-item:nth-child(1) .rank-num{ color:var(--primary); }
.rank-body{ min-width:0; }
.rank-title{
  display:block; font-size:.87rem; font-weight:500;
  color:var(--gray-900); line-height:1.35;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.rank-item:hover .rank-title{ color:var(--primary); }
.rank-meta{ display:block; font-size:.74rem; color:var(--gray-500); margin-top:.1rem; }
.rank-bar{ width:66px; height:5px; border-radius:3px; background:var(--gray-200); overflow:hidden; }
.rank-fill{ display:block; height:100%; border-radius:3px; background:var(--tone, var(--primary)); }

/* --- Activity stream ----------------------------------------------- */
.stream{ display:block; }
.stream-item{
  display:flex; gap:.7rem; align-items:flex-start;
  padding:.6rem 0; border-bottom:1px solid var(--gray-200);
}
.stream-item:last-child{ border-bottom:0; }
.avatar{
  flex:0 0 auto; width:30px; height:30px; border-radius:50%;
  background:var(--primary-light); color:var(--primary);
  display:flex; align-items:center; justify-content:center;
  font-size:.7rem; font-weight:700; letter-spacing:.02em;
}
.stream-body{ min-width:0; flex:1; }
.stream-text{ font-size:.85rem; color:var(--gray-700); line-height:1.45; }
.stream-text strong{ color:var(--gray-900); font-weight:600; }
.stream-time{ font-size:.73rem; color:var(--gray-500); margin-top:.1rem; }

/* --- Chart frames --------------------------------------------------- */
.chart{ display:block; width:100%; height:auto; }
.chart-legend{
  display:flex; gap:1.1rem; flex-wrap:wrap;
  margin-top:.7rem; font-size:.76rem; color:var(--gray-500);
}
.chart-legend span{ display:flex; align-items:center; gap:.35rem; }
.chart-legend i{ width:9px; height:9px; border-radius:2px; display:inline-block; }

/* --- Sector chips ---------------------------------------------------- */
.chips{ display:flex; flex-wrap:wrap; gap:.4rem; }
.chip{
  display:inline-flex; align-items:center; gap:.4rem;
  padding:.28rem .7rem; border-radius:var(--r-pill);
  background:var(--mist); border:1px solid var(--line-2);
  font-size:.78rem; font-weight:500; color:var(--steel); text-decoration:none;
}
.chip:hover{ background:var(--primary-light); border-color:var(--primary); color:var(--primary); text-decoration:none; }
.chip b{ font-weight:700; font-variant-numeric:tabular-nums; }

@media (max-width:900px){
  .stats{ grid-template-columns:1fr 1fr; gap:.6rem; }
  .statcard{ padding:.85rem .9rem .4rem; }
  .statcard-value{ font-size:1.5rem; }
  .statcard-spark{ margin:.4rem -.9rem -.4rem; width:calc(100% + 1.8rem); }
}

/* =====================================================================
   MEMBER ACTIONS
   The single most important thing a member does is say whether a
   notification affects their business. That action must be obvious,
   and its selected state must be unmistakable.
   ===================================================================== */

/* --- Selected state. Previously .is-on had no rules at all, so
       clicking Interested changed nothing on screen. ----------------- */
.btn.is-on{
  background:linear-gradient(145deg, var(--brand-2), var(--brand-deep));
  border-color:transparent; color:#fff; font-weight:600;
  box-shadow:var(--glow);
}
.btn.is-on:hover{
  background:linear-gradient(145deg, var(--brand), var(--brand-deep));
  color:#fff;
}
.btn.is-on::before{ content:"✓"; font-weight:700; margin-right:.1rem; }

/* --- Segmented choice: does this affect your business? ------------- */
.choice-label{
  display:block; font-size:.88rem; font-weight:600;
  color:var(--ink); margin-bottom:.6rem;
}
.choice{
  display:grid; grid-template-columns:repeat(3, 1fr);
  gap:.4rem; margin:0 0 .9rem;
}
.choice button{
  display:flex; flex-direction:column; align-items:center; gap:.2rem;
  padding:.7rem .5rem;
  border:1.5px solid var(--line); border-radius:var(--r-sm);
  background:var(--panel); color:var(--steel);
  font-family:inherit; font-size:.8rem; font-weight:600;
  cursor:pointer; text-align:center; line-height:1.25;
  transition:border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease;
}
.choice button:hover{ border-color:var(--brand-2); color:var(--brand); transform:translateY(-1px); }
.choice button .choice-mark{ font-size:1.05rem; line-height:1; }
.choice button.is-on{
  background:linear-gradient(145deg, var(--brand-2), var(--brand-deep));
  border-color:transparent; color:#fff; box-shadow:var(--glow);
}
.choice button.is-on:hover{ color:#fff; }
.choice-hint{ font-size:.78rem; color:var(--steel); line-height:1.5; margin:0 0 .85rem; }

/* --- Toggle rows for save / updates -------------------------------- */
.toggle-row{
  display:flex; align-items:center; justify-content:space-between; gap:.8rem;
  padding:.65rem .8rem; margin-bottom:.45rem;
  border:1px solid var(--line); border-radius:var(--r-sm);
  background:var(--panel-2);
}
.toggle-row .toggle-text{ min-width:0; }
.toggle-row .toggle-title{ display:block; font-size:.85rem; font-weight:600; color:var(--ink); }
.toggle-row .toggle-note{ display:block; font-size:.75rem; color:var(--steel); margin-top:.1rem; }
.toggle-row button{ flex:0 0 auto; }

/* --- Register card actions: the primary action is unmissable ------- */
.record{ transition:box-shadow .18s ease, transform .18s ease; }
.record:hover{ box-shadow:var(--shadow); transform:translateY(-2px); }
.record-actions .btn{ padding:.42rem .95rem; font-size:.83rem; }
.record-actions .btn-open{
  background:linear-gradient(145deg, var(--brand-2), var(--brand-deep));
  border-color:transparent; color:#fff; font-weight:600; box-shadow:var(--glow);
}
.record-actions .btn-open:hover{ color:#fff; box-shadow:0 8px 22px rgba(27,79,143,.38); }
.record-actions .btn-save{ border-color:var(--line); color:var(--steel); }
.record-actions .btn-save:hover{ border-color:var(--brand-2); color:var(--brand); background:var(--brand-tint); }

/* --- Getting started strip for a member with no history ----------- */
.onboard{
  background:linear-gradient(135deg, var(--brand-tint), var(--brand-wash));
  border:1px solid #DDD5FA; border-radius:var(--r);
  padding:1.35rem 1.5rem; margin-bottom:1.1rem;
}
.onboard h2{
  font-family:var(--f-display); font-size:1.08rem;
  color:var(--ink); margin:0 0 .35rem;
}
.onboard p{ font-size:.88rem; color:var(--ink-soft); margin:0 0 1rem; max-width:62ch; line-height:1.6; }
.onboard-steps{
  display:grid; grid-template-columns:repeat(auto-fit, minmax(190px,1fr));
  gap:.8rem; margin-bottom:1.05rem;
}
.onboard-step{
  background:rgba(255,255,255,.7); border:1px solid rgba(255,255,255,.9);
  border-radius:var(--r-sm); padding:.8rem .9rem;
}
.onboard-num{
  display:inline-flex; align-items:center; justify-content:center;
  width:22px; height:22px; border-radius:50%;
  background:var(--brand); color:#fff;
  font-size:.72rem; font-weight:700; margin-bottom:.45rem;
}
.onboard-step b{ display:block; font-size:.85rem; color:var(--ink); margin-bottom:.15rem; }
.onboard-step span{ display:block; font-size:.78rem; color:var(--steel); line-height:1.45; }

/* --- Position banner on the scheme detail page --------------------- */
.position{
  display:flex; align-items:center; gap:.6rem; flex-wrap:wrap;
  padding:.7rem .95rem; border-radius:var(--r-sm);
  font-size:.87rem; margin-bottom:.9rem;
}
.position.is-interested{ background:var(--brand-wash); color:var(--brand-deep); }
.position.is-following { background:var(--info-bg);     color:var(--info); }
.position.is-none      { background:var(--warn-bg);     color:var(--warn); }

@media (max-width:640px){
  .choice{ grid-template-columns:1fr; }
  .choice button{ flex-direction:row; justify-content:center; gap:.4rem; }
}

/* =====================================================================
   ACCOUNT MENU
   Deliberately has no Settings entry: there is no member settings page,
   and member accounts are maintained by the secretariat.
   ===================================================================== */
.nav-count{
  display:inline-block; min-width:1.1rem; margin-left:.35rem;
  padding:.05rem .35rem; border-radius:var(--r-pill);
  background:var(--danger); color:#fff;
  font-size:.68rem; font-weight:700; text-align:center; line-height:1.5;
}






.account-avatar{
  flex:0 0 auto; width:36px; height:36px; border-radius:50%;
  background:rgba(255,255,255,.2); border:1px solid rgba(255,255,255,.3);
  color:#fff; display:flex; align-items:center; justify-content:center;
  font-size:.92rem; font-weight:700;
  box-shadow:0 4px 10px rgba(27,79,143,.28);
}



@media (max-width:900px){
  
  
}

/* =====================================================================
   SCHEME RECORD PAGE
   The record is a document, so it opens like one: a masthead carrying
   the ministry's colour, then the facts a member checks first, then
   the reading matter. Actions sit in a rail that follows the page.
   ===================================================================== */
.record-head{
  position:relative; overflow:hidden;
  background:linear-gradient(125deg, #1B4F8F 0%, #23609F 58%, #2E6FC0 125%);
  border-radius:var(--r-lg);
  padding:1.9rem 2.1rem;
  margin-bottom:1rem; color:#fff;
  box-shadow:var(--shadow);
}
.record-head::before{
  content:""; position:absolute; left:0; top:0; bottom:0; width:5px;
  background:var(--tone, var(--brand-2));
}
.record-head::after{
  content:""; position:absolute; right:-90px; top:-120px;
  width:330px; height:330px; border-radius:50%;
  background:rgba(255,255,255,.07); pointer-events:none;
}
.record-head-top{
  display:flex; justify-content:space-between; align-items:flex-start;
  gap:1.5rem; flex-wrap:wrap; position:relative; z-index:1;
}
.record-eyebrow{
  display:flex; align-items:center; gap:.55rem; flex-wrap:wrap;
  font-size:.72rem; font-weight:700; letter-spacing:.12em;
  text-transform:uppercase; color:rgba(255,255,255,.76);
  margin-bottom:.5rem;
}
.record-eyebrow .mono{ color:rgba(255,255,255,.92); letter-spacing:.04em; }
.record-title{
  font-family:var(--f-display);
  font-size:1.6rem; font-weight:700; line-height:1.28;
  letter-spacing:-.015em; color:#fff; margin:0; max-width:56ch;
}
.record-chips{ display:flex; gap:.4rem; flex-wrap:wrap; margin-top:.9rem; position:relative; z-index:1; }
.record-chip{
  display:inline-flex; align-items:center; gap:.3rem;
  padding:.24rem .7rem; border-radius:var(--r-pill);
  background:rgba(255,255,255,.16); border:1px solid rgba(255,255,255,.28);
  font-size:.75rem; font-weight:600; color:#fff;
}
.record-chip.is-alert{ background:var(--danger); border-color:transparent; color:#fff; }
.record-chip.is-warn { background:var(--warn);   border-color:transparent; color:#fff; }
.record-head .btn{ background:rgba(255,255,255,.14); border-color:rgba(255,255,255,.3); color:#fff; }
.record-head .btn:hover{ background:rgba(255,255,255,.24); border-color:rgba(255,255,255,.45); color:#fff; }

/* --- Facts strip, the things a member checks first ---------------- */
.factstrip{
  display:grid; grid-template-columns:repeat(auto-fit, minmax(158px,1fr));
  gap:0; margin-bottom:1.1rem;
  background:var(--panel); border:1px solid var(--line);
  border-radius:var(--r); overflow:hidden; box-shadow:var(--shadow-sm);
}
.fact{ padding:.9rem 1.15rem; border-right:1px solid var(--line-2); }
.fact:last-child{ border-right:0; }
.fact-label{
  display:block; font-size:.74rem; font-weight:700;
  letter-spacing:.02em; color:var(--steel); margin-bottom:.26rem;
}
.fact-value{ display:block; font-size:1.02rem; font-weight:700; color:var(--ink); line-height:1.35; }
.fact-value.is-alert{ color:var(--danger); }
.fact-value.is-warn { color:var(--warn); }
.fact-note{ display:block; font-size:.72rem; color:var(--steel); margin-top:.1rem; }

/* --- Reference plate ---------------------------------------------- */
.refplate{
  display:flex; align-items:flex-start; gap:.85rem;
  padding:.95rem 1.15rem; margin-bottom:1.1rem;
  background:var(--brand-tint);
  border:1px solid #DFD9FA; border-left:4px solid var(--tone, var(--brand));
  border-radius:var(--r-sm);
}
.refplate-label{
  font-size:.78rem; font-weight:700; letter-spacing:.01em;
  color:var(--steel); display:block; margin-bottom:.28rem;
}
.refplate-value{
  font-family:var(--f-mono); font-size:.95rem; font-weight:600;
  color:var(--ink); word-break:break-all;
}

/* --- Section cards ------------------------------------------------- */
.section{
  background:var(--panel); border:1px solid var(--line);
  border-radius:var(--r); margin-bottom:1rem; overflow:hidden;
  box-shadow:var(--shadow-sm);
}
.section-head{
  display:flex; align-items:center; justify-content:space-between; gap:1rem;
  padding:.95rem 1.35rem; border-bottom:1px solid var(--line);
  background:var(--brand-tint);
}
.section-head h2{
  font-size:.92rem; font-weight:700; letter-spacing:.01em;
  color:var(--brand-deep); margin:0;
}
.section-body{ padding:1.25rem; }
.section-body.prose{ font-size:.95rem; line-height:1.7; color:var(--ink-soft); }
.section-body.prose p{ margin:0 0 .85rem; }
.section-body.prose p:last-child{ margin-bottom:0; }

/* --- Sticky action rail -------------------------------------------- */
.rail{ position:sticky; top:1.1rem; }

/* --- Watch summary -------------------------------------------------- */
.watchers{
  display:flex; align-items:center; gap:.75rem;
  padding:.8rem 1.15rem; background:var(--panel-2);
  border-top:1px solid var(--line-2); font-size:.8rem; color:var(--steel);
}
.watchers b{ color:var(--ink); font-weight:700; }

@media (max-width:980px){
  .record-head{ padding:1.4rem 1.4rem; }
  .record-title{ font-size:1.28rem; }
  .fact{ border-right:0; border-bottom:1px solid var(--line-2); }
  .rail{ position:static; }
}

/* Text fallback used by brand_logo() when no logo image is present. */
.wordrule{
  display:block; font-size:.72rem; font-weight:500;
  letter-spacing:.02em; color:var(--steel); line-height:1.35;
}

/* =====================================================================
   FAVOURITE STAR
   A filled amber star is the one place colour steps outside the brand
   blue, because that is the convention people already know.
   ===================================================================== */
.star{ font-size:1.02em; line-height:1; }
.btn-save .star,
.record-actions .btn-save .star{ color:var(--steel-2); }
.btn-save.is-on,
.btn.is-on.btn-save{
  background:#FFF6E0; border-color:#F2CE7A; color:#8A5A00;
  box-shadow:none;
}
.btn-save.is-on:hover{ background:#FDEFCE; border-color:#E9BF5C; color:#7A4F00; }
.btn-save.is-on::before{ content:none; }
.btn-save.is-on .star{ color:#F5A623; }
.toggle-row .btn.is-on .star{ color:#F5A623; }
.toggle-row .btn.is-on{
  background:#FFF6E0; border-color:#F2CE7A; color:#8A5A00; box-shadow:none;
}
.toggle-row .btn.is-on::before{ content:none; }

/* =====================================================================
   REGISTER VIEW MODES
   Comfortable keeps the summary and reference plate; compact drops to
   one line per record so a long register can be scanned quickly.
   ===================================================================== */
.viewbar{
  display:flex; align-items:center; justify-content:space-between;
  gap:1rem; flex-wrap:wrap; margin-bottom:.75rem;
}
.viewtoggle{
  display:inline-flex; padding:3px;
  background:var(--line-2); border:1px solid var(--line);
  border-radius:var(--r-pill);
}
.viewtoggle a{
  display:inline-flex; align-items:center; gap:.35rem;
  padding:.34rem .85rem; border-radius:var(--r-pill);
  font-size:.82rem; font-weight:600; color:var(--steel);
  text-decoration:none; transition:background .15s, color .15s;
}
.viewtoggle a:hover{ color:var(--brand); text-decoration:none; }
.viewtoggle a.is-on{ background:var(--panel); color:var(--brand-deep); box-shadow:var(--shadow-sm); }

/* Compact rows */
.rows{
  background:var(--panel); border:1px solid var(--line);
  border-radius:var(--r); overflow:hidden; box-shadow:var(--shadow-sm);
}
.row-rec{
  display:grid;
  grid-template-columns:auto 1fr auto auto;
  gap:.9rem; align-items:center;
  padding:.7rem 1.1rem;
  border-bottom:1px solid var(--line-2);
  border-left:3px solid var(--tone, var(--brand));
  text-decoration:none; color:inherit;
}
.row-rec:last-child{ border-bottom:0; }
.row-rec:hover{ background:var(--brand-tint); text-decoration:none; }
.row-ministry{
  font-size:.68rem; font-weight:700; letter-spacing:.08em;
  text-transform:uppercase; color:var(--tone, var(--steel));
  width:82px; flex:0 0 auto;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.row-main{ min-width:0; }
.row-title{
  display:block; font-size:.9rem; font-weight:600; color:var(--ink);
  line-height:1.35; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.row-rec:hover .row-title{ color:var(--brand); }
.row-sub{
  display:block; font-family:var(--f-mono); font-size:.72rem;
  color:var(--steel); margin-top:.12rem;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.row-date{ font-size:.76rem; color:var(--steel); white-space:nowrap; }
.row-star{
  font-size:1.05rem; line-height:1; color:var(--line);
  width:1.3rem; text-align:center;
}
.row-star.is-on{ color:#F5A623; }

@media (max-width:820px){
  .row-rec{ grid-template-columns:1fr auto; gap:.5rem .7rem; }
  .row-ministry{ width:auto; grid-column:1 / -1; }
  .row-date{ display:none; }
}

/* =====================================================================
   RECORD CONTENT
   One card, hairline-separated parts. Short entries were each getting
   their own bordered box, which made a two-line record look scattered.
   ===================================================================== */
.subsection{ padding:1.15rem 1.35rem; border-top:1px solid var(--line-2); }
.subsection:first-child{ border-top:0; }
.subsection-label{
  display:block; font-size:.82rem; font-weight:700;
  letter-spacing:.02em; color:var(--ink); margin-bottom:.45rem;
}
.subsection-body{ font-size:.97rem; line-height:1.72; color:var(--ink-soft); }
.subsection-body p{ margin:0 0 .8rem; }
.subsection-body p:last-child{ margin-bottom:0; }

/* Who it affects — a grid, not grey micro-text at the foot of a rail */
.affects{
  display:grid; grid-template-columns:repeat(auto-fit, minmax(210px,1fr));
  gap:0;
}
.affect{ padding:1rem 1.35rem; border-top:1px solid var(--line-2); border-right:1px solid var(--line-2); }
.affect:last-child{ border-right:0; }
.affect-label{
  display:block; font-size:.78rem; font-weight:700;
  letter-spacing:.01em; color:var(--steel); margin-bottom:.3rem;
}
.affect-value{ display:block; font-size:.97rem; font-weight:500; line-height:1.5; color:var(--ink); }
.affect.is-wide{ grid-column:1 / -1; border-right:0; }
.affect.is-wide .affect-value{ font-weight:700; font-size:1.02rem; }

@media (max-width:820px){
  .affect{ border-right:0; }
}

/* =====================================================================
   CONFIRMATION DIALOG
   Shown after a member sends feedback or asks for help, so the action
   gets a clear acknowledgement rather than a banner they may scroll past.
   ===================================================================== */
.modal-scrim{
  position:fixed; inset:0; z-index:400;
  background:rgba(20,21,43,.5);
  display:flex; align-items:center; justify-content:center;
  padding:1.5rem;
  animation:scrimIn .18s ease both;
}
@keyframes scrimIn{ from{ opacity:0; } to{ opacity:1; } }

.modal{
  width:100%; max-width:24rem;
  background:var(--panel); border-radius:var(--r);
  box-shadow:var(--shadow-lg);
  padding:1.75rem 1.75rem 1.5rem;
  text-align:center;
  animation:modalIn .22s cubic-bezier(.3,1.2,.5,1) both;
}
@keyframes modalIn{
  from{ opacity:0; transform:translate3d(0,12px,0) scale(.97); }
  to  { opacity:1; transform:translate3d(0,0,0) scale(1); }
}
.modal-mark{
  width:52px; height:52px; margin:0 auto 1rem;
  border-radius:50%; background:var(--ok-bg);
  display:flex; align-items:center; justify-content:center;
}
.modal-mark svg{ width:26px; height:26px; stroke:var(--ok); stroke-width:2.5; fill:none; }
.modal h2{
  font-size:1.15rem; font-weight:700; color:var(--ink);
  margin:0 0 .45rem; letter-spacing:-.01em;
}
.modal p{
  font-size:.92rem; line-height:1.6; color:var(--steel);
  margin:0 0 1.35rem;
}
.modal .btn{ min-width:7rem; }

/* Helper text under a form control. */
.field-note{
  display:block; margin-top:.35rem;
  font-size:.8rem; color:var(--steel); line-height:1.45;
}

/* =====================================================================
   BUSY STATE
   SMTP can take several seconds. Without this the page looks frozen and
   people click Send again, which is how duplicate submissions happen.
   ===================================================================== */
.btn.is-busy{ pointer-events:none; opacity:.85; }
.btn .spinner{
  display:inline-block; width:.85em; height:.85em;
  margin-right:.45rem; vertical-align:-.1em;
  border:2px solid rgba(255,255,255,.4);
  border-top-color:#fff; border-radius:50%;
  animation:spin .6s linear infinite;
}
.btn:not(.btn-primary) .spinner{
  border-color:rgba(27,79,143,.25); border-top-color:var(--brand);
}
@keyframes spin{ to{ transform:rotate(360deg); } }

.form-busy{
  display:flex; align-items:center; gap:.5rem;
  margin-top:.7rem; font-size:.85rem; color:var(--steel);
}
@media (prefers-reduced-motion:reduce){
  .btn .spinner{ animation-duration:2s; }
}

/* =====================================================================
   REQUEST QUEUES
   A list you can scan, and a detail page you work in. Editing every row
   inline made a queue of twenty an unusable wall of textareas.
   ===================================================================== */
.queue{
  background:var(--panel); border:1px solid var(--line);
  border-radius:var(--r); overflow:hidden; box-shadow:var(--shadow-sm);
}
.qrow{
  display:grid;
  grid-template-columns:1fr 9rem 8rem 7rem;
  gap:1rem; align-items:center;
  padding:.85rem 1.15rem;
  border-bottom:1px solid var(--line-2);
  border-left:3px solid transparent;
  text-decoration:none; color:inherit;
}
.qrow:last-child{ border-bottom:0; }
.qrow:hover{ background:var(--brand-tint); text-decoration:none; }
.qrow.is-open{ border-left-color:var(--warn); }
.qrow.is-done{ border-left-color:var(--ok); }
.qrow-main{ min-width:0; }
.qrow-scheme{
  display:block; font-size:.68rem; font-weight:700; letter-spacing:.08em;
  text-transform:uppercase; color:var(--steel-2); margin-bottom:.2rem;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.qrow-body{
  display:block; font-size:.93rem; font-weight:600; color:var(--ink);
  line-height:1.4; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.qrow:hover .qrow-body{ color:var(--brand); }
.qrow-who{
  display:block; font-size:.78rem; color:var(--steel); margin-top:.18rem;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.qrow-cell{ font-size:.8rem; color:var(--steel); }
.qrow-when{ font-size:.78rem; color:var(--steel-2); white-space:nowrap; }

/* Detail */
.reqcard{
  background:var(--panel); border:1px solid var(--line);
  border-radius:var(--r); box-shadow:var(--shadow-sm); margin-bottom:1rem;
}
.reqcard-head{
  padding:1rem 1.35rem; border-bottom:1px solid var(--line);
  background:var(--brand-tint);
  display:flex; align-items:center; justify-content:space-between; gap:1rem; flex-wrap:wrap;
}
.reqcard-head h2{ font-size:.92rem; font-weight:700; color:var(--brand-deep); margin:0; }
.reqcard-body{ padding:1.35rem; }
.reqmsg{
  font-size:.97rem; line-height:1.72; color:var(--ink-soft);
  white-space:pre-wrap; margin:0;
}
.whobar{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr));
  border-top:1px solid var(--line-2);
}
.whobar > div{ padding:.85rem 1.35rem; border-right:1px solid var(--line-2); }
.whobar > div:last-child{ border-right:0; }
.whobar-label{
  display:block; font-size:.7rem; font-weight:700; letter-spacing:.02em;
  color:var(--steel); margin-bottom:.22rem;
}
.whobar-value{ display:block; font-size:.92rem; color:var(--ink); }
.whobar-value a{ color:var(--brand); }

@media (max-width:820px){
  .qrow{ grid-template-columns:1fr auto; }
  .qrow-cell{ display:none; }
  .whobar > div{ border-right:0; border-bottom:1px solid var(--line-2); }
}

/* Pending-approval badge. */
.badge-amber{ background:#FBEED3; color:#8A5A00; }
