@import url('https://netdna.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.css');

:root {

  --page-width: 100%;
  --container-padding: 1rem;

  --clr-accent-100: hsl(13, 100%, 96%);

  --clr-primary-500: hsl(228, 39%, 23%);  /* navy — headings / body text */
  --clr-primary-600: #e61e29;             /* brand red (logo) */
  --clr-primary-700: rgb(0,0,0);          /* black — nav bar */
  --clr-primary-400: rgb(219, 70, 63);    /* red — primary actions / table headers */
  --clr-accent-500: #a59a8e;

  --clr-accent-400: #424656;
  --clr-accent-350: #4b5165;
  --clr-accent-300: #A6ABBD;
  --clr-accent-250: #d2d4de;
  --clr-accent-200: #e8e9ee;
  --clr-background: #F6F9FF;
  --clr-error: #5A2F31;


  --clr-neutral-100: hsl(0 0% 100%);
  --clr-card:      var(--clr-neutral-100);
  --clr-neutral-900: hsl(232, 12%, 13%);

  --clr-info-background: #D4D4D7;

  --clr-table-border: #A6ABBD;
  --clr-table-header-background: var(--clr-primary-400);
  --clr-table-background: #D4D4D7;
  --clr-table-highlighted: #ADC9C6;
  --clr-table-zebra: #f3f6fd;   /* soft blue row tint (page-surface family) */
  --clr-table-hover: #eaf0fb;   /* row hover */
  --clr-table-divider: #eef1f7; /* hairline row divider */

  --clr-modal-border: var(--clr-accent-350);

  /* Semantic aliases (red/black/neutral brand) - direct values; prefer these in new/updated rules.
     Mirror the existing primary / accent colours; later batches migrate usages then drop old names. */
  --clr-red:       #e61e29;             /* brand red (logo) - primary actions */
  --clr-red-deep:  rgb(219, 70, 63);    /* deeper red - hover/active, table headers */
  --clr-maroon:      #7a1620;           /* deep maroon - destructive (Delete/Remove) */
  --clr-maroon-deep: #5e111a;           /* darker maroon - destructive hover/active */
  --clr-success:     #1f8a4c;           /* green - success toasts */
  --clr-black:     rgb(0, 0, 0);        /* nav bar / strong */
  --clr-ink:       hsl(228, 39%, 23%);  /* navy - body text and headings */
  --clr-surface:   #F6F9FF;             /* page background */
  --clr-grey-700:  #424656;
  --clr-grey-500:  #4b5165;
  --clr-grey-400:  #A6ABBD;
  --clr-grey-300:  #d2d4de;
  --clr-grey-200:  #e8e9ee;
  --clr-focus:     #e61e29;             /* keyboard focus ring (used from B5) */


  --ff-primary: 'Be Vietnam Pro', sans-serif;

  --ff-body: var(--ff-primary);
  --ff-heading: var(--ff-primary);

  --fw-regular: 400;
  --fw-semi-bold: 500;
  --fw-bold: 700;

  --fs-200: 0.7rem;
  --fs-300: 0.8125rem;
  --fs-400: 0.875rem;
  --fs-500: 0.9375rem;
  --fs-600: 1rem;
  --fs-615: 1.15rem;
  --fs-625: 1.25rem;
  --fs-650: 1.5rem;
  --fs-700: 1.875rem;
  --fs-800: 2.5rem;
  --fs-900: 3.5rem;

  --fs-body: var(--fs-600);
  --fs-primary-heading: var(--fs-650);
  --fs-secondary-heading: var(--fs-615);
  --fs-nav: var(--fs-600);
  --fs-button: var(--fs-600);
  --fs-input: var(--fs-600);
  --fs-error: var(--fs-650);
  

  --size-100: 0.25rem;
  --size-200: 0.5rem;
  --size-300: 0.75rem;
  --size-400: 1rem;
  --size-500: 1.5rem;
  --size-600: 2rem;
  --size-700: 3rem;
  --size-800: 4rem;
  --size-900: 5rem;

  --bdr-radius: 1rem;

  --clr-status-inspected: #2f6fb0;
  --clr-status-other:     #b9791f;
  --clr-status-action-bg:    #fdecea;
  --clr-status-installed-bg: #e7f4ec;
  --clr-status-inspected-bg: #e9f1fa;
  --clr-status-other-bg:     #f6eede;
  --clr-grey-600:     #666666;
  --clr-subgroup-bg:  #fafbfe;
  --shadow-card:   0 1px 3px rgba(0, 0, 0, 0.07);
  --shadow-toast:  0 10px 26px rgba(0, 0, 0, 0.16);
  --shadow-nav:    0 8px 20px rgba(0, 0, 0, 0.28);
  --shadow-login:  0 10px 30px rgba(0, 0, 0, 0.25);
  --shadow-list:   0 0.3em 1em rgba(0, 0, 0, 0.25);
  --shadow-popup:  0 6px 18px rgba(0, 0, 0, 0.28);
  --shadow-focus-input: 0 0 0 2px rgba(219, 70, 63, 0.15);
  --clr-backdrop:          rgba(0, 0, 0, 0.7);
  --clr-overlay-hover:     rgba(0, 0, 0, 0.07);
  --clr-overlay-sm:        rgba(0, 0, 0, 0.04);
  --clr-overlay-md:        rgba(0, 0, 0, 0.06);
  --clr-overlay-strong:    rgba(0, 0, 0, 0.5);
  --clr-lightbox-backdrop: rgba(0, 0, 0, 0.88);
  --clr-lightbox-ctrl-bg:  rgba(0, 0, 0, 0.45);
  --clr-lightbox-bar-end:  rgba(0, 0, 0, 0.55);
  --clr-lightbox-img-bg:   rgba(255, 255, 255, 0.04);
  --clr-skel-shimmer:      rgba(255, 255, 255, 0.65);
  --clr-chip-x-bg:         rgba(255, 255, 255, 0.25);
  --clr-chip-x-hover:      rgba(255, 255, 255, 0.45);

}

:root[data-theme="dark"] {
  --clr-surface:    #0f1119;
  --clr-background: #0f1119;
  --clr-card:       #1a1d2b;
  --clr-ink:        #dde0ee;
  --clr-primary-500: #dde0ee;
  --clr-grey-700:   #b0b4c8;
  --clr-grey-500:   #888da8;
  --clr-grey-600:   #9696aa;
  --clr-grey-400:   #565b72;
  --clr-grey-300:   #313550;
  --clr-grey-200:   #20243a;
  --clr-subgroup-bg:     #17192a;
  --clr-info-background: #282c40;
  --clr-modal-border:    #3a3f5c;
  --clr-table-border:      #2c3050;
  --clr-table-background:  #1e2138;
  --clr-table-zebra:       #1c1f32;
  --clr-table-hover:       #22263c;
  --clr-table-divider:     #1e2138;
  --clr-status-action-bg:    #2c1618;
  --clr-status-installed-bg: #14221a;
  --clr-status-inspected-bg: #12202e;
  --clr-status-other-bg:     #261c0c;
  --clr-red:       #c24b52;
  --clr-red-deep:  #ad404a;
  --clr-focus:     #c24b52;
  --shadow-card:        0 1px 4px rgba(0, 0, 0, 0.4);
  --shadow-focus-input: 0 0 0 2px rgba(194, 75, 82, 0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --clr-surface:    #0f1119;
    --clr-background: #0f1119;
    --clr-card:       #1a1d2b;
    --clr-ink:        #dde0ee;
    --clr-primary-500: #dde0ee;
    --clr-grey-700:   #b0b4c8;
    --clr-grey-500:   #888da8;
    --clr-grey-600:   #9696aa;
    --clr-grey-400:   #565b72;
    --clr-grey-300:   #313550;
    --clr-grey-200:   #20243a;
    --clr-subgroup-bg:     #17192a;
    --clr-info-background: #282c40;
    --clr-modal-border:    #3a3f5c;
    --clr-table-border:      #2c3050;
    --clr-table-background:  #1e2138;
    --clr-table-zebra:       #1c1f32;
    --clr-table-hover:       #22263c;
    --clr-table-divider:     #1e2138;
    --clr-status-action-bg:    #2c1618;
    --clr-status-installed-bg: #14221a;
    --clr-status-inspected-bg: #12202e;
    --clr-status-other-bg:     #261c0c;
    --clr-red:       #c24b52;
    --clr-red-deep:  #ad404a;
    --clr-focus:     #c24b52;
    --shadow-card:        0 1px 4px rgba(0, 0, 0, 0.4);
    --shadow-focus-input: 0 0 0 2px rgba(194, 75, 82, 0.4);
  }
}

@media (min-width: 50em) {
  :root {
    --fs-primary-heading: var(--fs-700);
    --fs-secondary-heading: var(--fs-650);


    --fs-nav: var(--fs-600);
  }
}

/* Box sizing rules */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Remove default margin */
*
{
  padding: 0;
  margin: 0;
  font: inherit;
}

/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role="list"],
ol[role="list"] {
  list-style: none;
}

/* Set core root defaults */
html:focus-within {
  scroll-behavior: smooth;
}

html,
body {
  height: 100%;
}

/* Set core body defaults */
body {
  text-rendering: optimizeSpeed;
  line-height: 1.5;
}

.bodySpacer {
  height: 1em;
}

/* A elements that don't have a class get default styles */
a:not([class]) {
  text-decoration-skip-ink: auto;
}

a:link,
a:visited,
a:hover,
a:active {
  text-decoration: none;
  color: var(--clr-primary-500);
}

/* Make images easier to work with */
img,
picture,
svg {
  max-width: 100%;
  display: block;
}

/* Remove all animations and transitions for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
  html:focus-within {
   scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/*Utility classes */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
  visibility: hidden;

}

.text-primary-400 {
  color: var(--clr-primary-400);
}

.text-accent-400 {
  color: var(--clr-accent-400);
}

.text-accent-100 {
  color: var(--clr-accent-100);
}

.text-neutral-100 {
  color: var(--clr-neutral-100);
}

.text-neutral-900 {
  color: var(--clr-neutral-900);
}

.bg-primary-400 {
  background-color: var(--clr-primary-400);
}

.bg-accent-400 {
  background-color: var(--clr-accent-400);
}

.bg-accent-100 {
  background-color: var(--clr-accent-100);
}

.bg-neutral-100 {
  background-color: var(--clr-card);
}

.bg-neutral-900 {
  background-color: var(--clr-neutral-900);
}

.fw-bold {  font-weight: var(--fw-bold);  }
.fw-semibold {  font-weight: var(--fw-semi-bold);  }
.fw-regular {  font-weight: var(--fw-regular);  }

.fs-primary-heading {
  font-size: var(--fs-primary-heading);
  line-height: 1.3;
}

/* Breadcrumb-style links inside a page heading: parent crumbs muted, current
   page (last link) emphasised, red on hover. */
.fs-primary-heading a {
  color: var(--clr-ink);
  text-decoration: none;
}

.fs-primary-heading a:not(:last-child) {
  color: var(--clr-grey-500);
  font-weight: var(--fw-regular);
}

.fs-primary-heading a:hover,
.fs-primary-heading a:focus-visible {
  color: var(--clr-red);
  text-decoration: underline;
}

/* Chevron separator between crumbs (the literal "->" arrows were removed). */
.fs-primary-heading a + a::before {
  content: "\203A";
  display: inline-block;
  margin: 0 0.5rem;
  color: var(--clr-grey-400);
  font-weight: var(--fw-regular);
}

/* Option D — the top page heading is a dark bar that continues from the nav:
   full width (breaks out of .content's 1rem padding), rounded bottom corners,
   smaller text, light crumbs on dark. Scoped to the top heading only
   (.fs-primary-heading is reused for inner sub-headings/button rows). */
.content > .sites-top:not(.padding-block-400) {
  margin: -1rem -1rem 1.5rem;
  padding: 0.65rem 1.25rem;
  background-color: var(--clr-grey-200);
  border-bottom: 1px solid var(--clr-grey-300);
  align-items: center;
}

.content > .sites-top:not(.padding-block-400) .fs-primary-heading {
  font-size: 0.875rem; /* keep the breadcrumb no larger than the main nav */
  line-height: 1.4;
}

.content > .sites-top:not(.padding-block-400) .fs-primary-heading a:last-child {
  font-weight: var(--fw-bold);
}

.fs-secondary-heading {
  font-size: var(--fs-secondary-heading);
  font-weight: var(--fw-bold);
}

.fs-300 {  font-size: var(--fs-300); }
.fs-400 { font-size: var(--fs-400); }
.fs-500 { font-size: var(--fs-500); }
.fs-600 { font-size: var(--fs-600); }
.fs-650 { font-size: var(--fs-650); }

.center { text-align: center;}

.padding-block-400 {
  padding-block: var(--size-400);
}

.padding-block-900 {
  padding-block: var(--size-900);
}

/* Button system (red/black brand, with hierarchy):
   .button            = PRIMARY   — solid red (Add New, Save, Confirm)
   .button--secondary = SECONDARY — ghost red: outline, fills on hover (View, Edit, Drawing Access)
   .button.modal-cancel = solid black (modal Cancel)
   .button--danger    = DESTRUCTIVE — solid deep maroon (Delete, Remove) */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  border: 2px solid var(--clr-red);
  cursor: pointer;
  border-radius: 0.75rem;
  padding: 1em 1.25em;
  font-weight: var(--fw-bold);
  font-size: var(--fs-button);
  line-height: 1;
  color: var(--clr-neutral-100);
  background-color: var(--clr-red);
}

/* Drawing map control group (Zoom Out + Expand Map sit together on the left) */
.map-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

/* Icon-only action button (square; pairs with --secondary/--danger for colour) */
.button--icon {
  padding: 0;
  width: 2.5em;
  height: 2.5em;
  flex: 0 0 auto;
}

.button svg {
  flex: 0 0 auto;
}

.buttonSpacing {
  margin-bottom: 1em;
}

.input {
  border: none;
  border-radius: 100vmax;
  padding: 1em 2em;
  font-weight: var(--fw-bold);
  font-size: var(--fs-input);
  line-height: 1;
}

.button[data-type="inverted"] {
  background-color: var(--clr-card);
  color: var(--clr-accent-400);
}

.button:hover,
.button:focus-visible{
  background: var(--clr-red-deep);
  border-color: var(--clr-red-deep);
}

.button:focus-visible {
  outline: 3px solid var(--clr-focus);
  outline-offset: 2px;
}

.button[data-type="inverted"]:hover,
.button[data-type="inverted"]:focus-visible {
  background-color: var(--clr-card);
  color: var(--clr-accent-300);
}

/* SECONDARY — ghost red: outline, fills red on hover (View, Edit, Drawing Access) */
.button--secondary {
  background-color: transparent;
  border-color: var(--clr-red);
  color: var(--clr-red);
}
.button--secondary:hover,
.button--secondary:focus-visible {
  background-color: var(--clr-red);
  border-color: var(--clr-red);
  color: var(--clr-neutral-100);
}

/* Modal Cancel — solid black */
.button.modal-cancel {
  background-color: var(--clr-black);
  border-color: var(--clr-black);
  color: var(--clr-neutral-100);
}
.button.modal-cancel:hover,
.button.modal-cancel:focus-visible {
  background-color: var(--clr-ink);
  border-color: var(--clr-ink);
}

/* DESTRUCTIVE — solid deep maroon (Delete, Remove) */
.button--danger {
  background-color: var(--clr-maroon);
  border-color: var(--clr-maroon);
  color: var(--clr-neutral-100);
}
.button--danger:hover,
.button--danger:focus-visible {
  background-color: var(--clr-maroon-deep);
  border-color: var(--clr-maroon-deep);
  color: var(--clr-neutral-100);
}

/* General Styling */
/* body {
  
  width: var(--page-width);

  padding: 0;
  margin: 0;
  font-size: var(--fs-body);
  font-family: var(--ff-body);
  color: var(--clr-primary-400);
} */

body {
	margin: 0;
	background: var(--clr-background);
	font-size: var(--fs-body);
  font-family: var(--ff-body);
  color: var(--clr-primary-500);
}

.content {
  padding-top: 1rem; /* header is position:sticky and in normal flow, so no fixed offset needed */
  padding-left: 1rem;
  padding-right: 1rem;
  /* height: 200vh; */
  /* background-blend-mode: multiply;
  background-size: cover;
  display: grid;
  place-items: center; */
}

.right{
  text-align: right;
}

/* navigation styles start here */

header {
  display: grid;
  grid-template-columns: 1fr 60px 60px;
  padding-right: 1rem;
  background: var(--clr-primary-700);
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 1100; /* above Leaflet's map controls (z-index 1000) so they don't overlap the sticky nav */
  width: 100%;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

footer {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding-right: 1rem;
  color: var(--clr-accent-100);
  background: var(--clr-primary-500);
  text-align: center;
  margin-top: 2rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

/* Toast notifications (success/error). Rendered server-side then positioned and
   auto-dismissed by js/toasts.js — error top-centre, success top-right. */
.toast-stack {
  position: fixed;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
}

.toast-stack--center {
  top: calc(64px + 0.6rem);
  left: 50%;
  transform: translateX(-50%);
  width: min(440px, 92vw);
}

.toast-stack--right {
  top: calc(64px + 0.6rem);
  right: 0.9rem;
  width: min(340px, 90vw);
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.85rem;
  margin-bottom: 0.6rem; /* fallback spacing before JS moves it into a stack */
  background-color: var(--clr-card);
  border: 1px solid var(--clr-grey-300);
  border-radius: 0.75rem;
  box-shadow: var(--shadow-toast);
  position: relative;
  overflow: hidden;
  font-size: var(--fs-600);
  color: var(--clr-ink);
}

.toast-stack .toast { margin-bottom: 0; }

.toast--error { border-left: 4px solid var(--clr-red); }
.toast--success { border-left: 4px solid var(--clr-success); }

.toast__icon { flex: 0 0 auto; display: flex; }
.toast--error .toast__icon { color: var(--clr-red); }
.toast--success .toast__icon { color: var(--clr-success); }

.toast__body { flex: 1; line-height: 1.35; }
.toast__body ul { margin: 0; padding-left: 1.1rem; list-style: disc; }

.toast__close {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.55;
}
.toast__close:hover,
.toast__close:focus-visible { opacity: 1; }

.toast__bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  transform-origin: left;
}
.toast--error .toast__bar { background-color: var(--clr-red); }
.toast--success .toast__bar { background-color: var(--clr-success); }

.toast--countdown .toast__bar {
  animation-name: toastCountdown;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}
@keyframes toastCountdown {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}


/*** Checkbox Nav Default Styling ***/
.checkbox-menu {
  position: absolute !important;
  top: -9999px !important;
  left: -9999px !important;
}

.checkbox-menu-nav {
  position: absolute;
  text-align: left;
  top: calc(100% + 0.4rem);
  left: 0;
  background: var(--clr-primary-700);
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-nav);
  transform: scale(1, 0);
  transform-origin: top;
  transition: transform 400ms ease-in-out;
}

.checkbox-menu-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.checkbox-menu-nav li {
  margin-bottom: 1em;
  margin-left: 1em;
}

.checkbox-menu-nav li:last-child {
  margin-bottom: 0; /* balance against the dropdown's bottom padding */
}

.checkbox-menu-nav a {
  color: var(--clr-accent-100);
  text-decoration: none;
  font-size: 1.2rem;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 150ms ease-in-out;
}

.checkbox-menu-nav a:hover {
  color: var(--clr-primary-600);
}
/*** END Checkbox Nav Default Styling ***/

/*** Header Profile Icon ***/
#profile-button {
  margin-top: 8px;
  width: 48px;
  height:48px;
  font-weight: var(--fw-bold);
  font-size: var(--fs-button);
  color: var(--clr-neutral-100);
  background-color: var(--clr-accent-400);
  border-radius: 50px;
  overflow:hidden;
  /* float:left; */
}

#profile-button:hover,
#profile-button:hover label span {
  cursor: pointer;
  background: var(--clr-accent-300);
  color: var(--clr-accent-400);
}

#profile-button label {
  cursor: pointer;
}

#profile-button label span {
  color: var(--clr-accent-300);
  text-align: center;
  padding: 12px 0px;
  display: block;
}

#profile-button label input {
  position:absolute;
  top:-20px;
}

#profile-button input:checked + span {
  background-color: var(--clr-accent-300);
  color: var(--clr-accent-100);
}

.header-profile-nav {
  left: auto;
  right: 0.75rem;
}

.profile-button-checkbox:checked ~ .header-profile-nav {
  transform: scale(1,1);
}

.profile-button-checkbox:checked ~ .header-profile-nav a {
  opacity: 1;
  transition: opacity 250ms ease-in-out 250ms;
}

/*** END Header Profile Icon ***/


/*** Header Search Icon ***/
#search-button {
  margin-top: 8px;
  width: 48px;
  height:48px;
  font-weight: var(--fw-bold);
  font-size: var(--fs-button);
  color: var(--clr-neutral-100);
  background-color: var(--clr-accent-400);
  border-radius: 50px;
  overflow:hidden;
  grid-column: 2 / 3;
}

#search-button:hover,
#search-button:hover label span {
  cursor: pointer;
  background: var(--clr-accent-300);
  color: var(--clr-accent-400);
}

#search-button label {
  cursor: pointer;
  /* float:left; */
  /* width:4.0em; */
}

#search-button label span {
  color: var(--clr-accent-300);
  text-align: center;
  padding: 0px 0px;
  display: block;
}

#search-button label input {
  position:absolute;
  top:-20px;
}

#search-button input:checked + span {
  background-color: var(--clr-accent-300);
  color: var(--clr-accent-100);
}

.header-search-nav {
  left: auto;
  right: 0.75rem;
  padding: 1rem;
}

.search-button-checkbox:checked ~ .header-search-nav {
  transform: scale(1,1);
}

.search-button-checkbox:checked ~ .header-search-nav a {
  opacity: 1;
  transition: opacity 250ms ease-in-out 250ms;
}

/*** END Header Search Icon ***/


/*** Header Main Nav ***/
.nav-toggle:focus ~ .nav-toggle-label {
  outline: 3px solid rgba(lightblue, .75);
}

.nav-toggle-label {
  cursor: pointer;
  position: absolute;
  top: 0;
  left: 0;
  margin-left: 1em;
  height: 100%;
  display: flex;
  align-items: center;
}

.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
  display: block;
  background: var(--clr-accent-100);
  height: 2px;
  width: 2em;
  border-radius: 2px;
  position: relative;
}

.nav-toggle-label span::before,
.nav-toggle-label span::after {
  content: '';
  position: absolute;
}

.nav-toggle-label span::before {
  bottom: 7px;
}

.nav-toggle-label span::after {
  top: 7px;
}

.main-nav {
  position: absolute;
  text-align: left;
  top: calc(100% + 0.4rem);
  left: 0.75rem;
  width: min(300px, 85vw);
  background: var(--clr-primary-400);
  border-radius: 0.75rem;
  box-shadow: var(--shadow-nav);
  transform: scale(1, 0);
  transform-origin: top;
  transition: transform 400ms ease-in-out;
}

.main-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-nav li {
  margin-bottom: 1em;
  margin-left: 1em;
}

.main-nav a {
  color: var(--clr-accent-100);
  text-decoration: none;
  font-size: var(--fs-nav);
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 150ms ease-in-out;
}

.main-nav a:hover {
  /* mobile hamburger overlay has a red background — use black so the text stays legible */
  color: var(--clr-black);
}


.nav-toggle:checked ~ nav {
  transform: scale(1,1);
}

.nav-toggle:checked ~ nav a {
  opacity: 1;
  transition: opacity 250ms ease-in-out 250ms;
}


/*** END Header Main Nav ***/

/*** Header Search Form ***/
.search-div {
  background: var(--clr-card);
  padding: 1rem;
}

.search-div form {
  color: var(--clr-grey-600);
  display: flex;
  padding: 2px;
  border: 1px solid currentColor;
  border-radius: 5px;
}

.search-div input[type="search"] {
  border: none;
  background: transparent;
  margin: 0;
  padding: 7px 8px;
  font-size: 14px;
  color: inherit;
  border: 1px solid transparent;
  border-radius: inherit;
}

.search-div input[type="search"]::placeholder {
  color: var(--clr-primary-400);
}

.search-div button[type="submit"] {
  text-indent: -999px;
  overflow: hidden;
  width: 40px;
  padding: 0;
  margin: 0;
  border: 1px solid transparent;
  border-radius: inherit;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' class='bi bi-search' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'%3E%3C/path%3E%3C/svg%3E") no-repeat center;
  cursor: pointer;
  opacity: 0.7;
}

.search-div button[type="submit"]:hover {
  opacity: 1;
}

.search-div button[type="submit"]:focus,
.search-div input[type="search"]:focus {
  /* box-shadow: 0 0 3px 0 #1183d6;
  border-color: #1183d6; */
  outline: none;
}
/*** END Header Search Form ***/






.logo {
  display: block;
  margin-left: 4rem; /* clears the hamburger toggle on mobile; reduced on desktop */
}

.logo a { display: inline-block; line-height: 0; }
.logo img {
  max-width: 128px;
  max-height: 64px;
}

.button-round {
  width: 48px;
  height:48px;
  border-radius: 50px;
  border:none;
  margin: 0;
  padding: 0;
}

.header-profile-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

#profile-button {
  grid-column: 3 / 4;
}

/*** Login Page ***/
.login-body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100%;
  /* color: #fff;   */
  background: var(--clr-accent-400);
  background: -webkit-linear-gradient(to top, ar(--clr-accent-400) , ar(--clr-accent-300)); /* Chrome 10-25, Safari 5.1-6 */
  background: linear-gradient(to top, var(--clr-accent-400) , var(--clr-accent-300)); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
}

/* Login card — matches the app's modern card style: white, soft shadow, rounded.
   The logo PNG has a white wordmark (built for the dark nav), so it sits on a dark
   header strip here to stay legible on the white card. */
.login {
  background: var(--clr-card);
  border-radius: 0.75rem;
  box-shadow: var(--shadow-login);
  width: min(420px, 92vw);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.login-logo {
  display: flex;
  padding: 1.5rem;
  margin: 0;
  align-items: center;
  justify-content: center;
  background-color: var(--clr-accent-400);
}

.login-logo img {
  max-width: 170px;
  max-height: 90px;
}

.login-item {
  color: var(--clr-ink);
  padding: 1.75rem 2rem 2rem;
  margin: 0;
}

.login-item input {
  font: inherit;
  margin: 0;
  outline: 0;
}

.form-login-field {
  display: flex;
  margin-bottom: 1rem;
}

/* Icon "addon" on the left of each field (replaces the old FontAwesome label glyphs). */
.form-login-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  flex: 0 0 auto;
  color: var(--clr-neutral-100);
  background-color: var(--clr-accent-400);
  border-radius: 0.5rem 0 0 0.5rem;
}

.form-login input[type="text"],
.form-login input[type="password"] {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  padding: 0.85rem 1rem;
  color: var(--clr-ink);
  background-color: var(--clr-card);
  border: 1px solid var(--clr-grey-300);
  border-left: none;
  border-radius: 0 0.5rem 0.5rem 0;
}
.form-login input[type="text"]:focus,
.form-login input[type="password"]:focus {
  border-color: var(--clr-primary-400);
  box-shadow: var(--shadow-focus-input);
}
/* Browser autofill restyles inputs (its own font/yellow background) until focus — pin our font,
   ink text and white background so an auto-filled field matches a typed one. */
.form-login input:-webkit-autofill,
.form-login input:-webkit-autofill:hover,
.form-login input:-webkit-autofill:focus,
.form-login input:-webkit-autofill:active {
  font: inherit !important;
  -webkit-text-fill-color: var(--clr-ink);
  -webkit-box-shadow: 0 0 0 1000px var(--clr-card) inset;
  box-shadow: 0 0 0 1000px var(--clr-card) inset;
  caret-color: var(--clr-ink);
  transition: background-color 9999s ease-in-out 0s;
}

/* Submit — brand-red button with the log-in icon and sentence-case label. */
.form-login-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  width: 100%;
  cursor: pointer;
  padding: 0.85rem 1rem;
  font-weight: var(--fw-bold);
  font-size: var(--fs-button);
  color: var(--clr-neutral-100);
  background-color: var(--clr-primary-600);
  border: none;
  border-radius: 0.5rem;
}
.form-login-submit:focus-visible,
.form-login-submit:hover {
  background-color: var(--clr-primary-400);
}
.form-login-submit svg { flex: 0 0 auto; }

.form-login-field:last-child {
  margin-bottom: 0;
}

.form-login-hidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}
/*** END Login Page ***/



/* @media screen and (min-width: 920px) { */
@media screen and (min-width: 1210px) {
  .nav-toggle-label {
    display: none;
  }

  header {
    /* display: grid; */
    grid-template-columns: auto 1.5rem minmax(700px, 5fr) 60px 60px;
  }
  
  .logo {
    /* padding-left: 2rem; */
    grid-column: 1 / 2;
    margin-left: 1.25rem; /* hamburger is hidden on desktop, so the logo can sit tighter */
  }

  #search-button {
    grid-column: 4 / 5;
  } 

  #profile-button {
    grid-column: 5 / 6;
  }

  
  /*** Header Main Nav ***/
  .main-nav {
      /* add Edge support */
    position: relative;
    text-align: left;
    transition: none;
    transform: scale(1,1);
    background: none;
    top: initial;
    left: initial;
    /* end Edge support */
    
    grid-column: 3 / 4;
    display: flex;
    align-items: center;
  }
  
  .main-nav ul {
    display: flex;
  }
  
  .main-nav li {
    margin-left: 1.4em;
    margin-bottom: 0;
  }

  .main-nav a {
    opacity: 1;
    position: relative;
    font-size: 0.9375rem;
    white-space: nowrap;
  }
  
  .main-nav a::before {
    content: '';
    display: block;
    height: 5px;
    background: var(--clr-primary-600);
    position: absolute;
    top: -.75em;
    left: 0;
    right: 0;
    transform: scale(0, 1);
    transition: transform ease-in-out 250ms;
  }
  
  .main-nav a:hover::before {
    transform: scale(1,1);
  }

  /* Desktop nav sits on the black header — keep the red hover (the black mobile
     override above would be invisible here). */
  .main-nav a:hover {
    color: var(--clr-primary-600);
  }
  /*** END Header Main Nav ***/
}

/*** SITES PAGE ***/
.sites-top {
  /* display: grid;
  grid-template-columns: 1fr 1fr; */
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

.sites-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin: 1rem 0;
  padding: 0.5rem 0.75rem;
  background-color: var(--clr-grey-200);
  border-radius: 0.5rem;
}

/* Shared centered company-filter bar (super-admin); centers the picker the same on every admin page. */
.company-filter-bar {
  justify-content: center;
}

.sites-search > div {
  display: flex;
  align-items: center;
}

.sites-search a {
  font-weight: var(--fw-bold);
  font-size: var(--fs-300);
  color: var(--clr-grey-700);
  text-decoration: none;
}

.sites-search a:hover,
.sites-search a:focus-visible {
  color: var(--clr-red);
  text-decoration: underline;
}

.sites-info {
  margin-top: 1rem;
  margin-bottom: 1rem;
  padding-left: 1rem;
  padding-right: 1rem;
  background-color: var(--clr-card);
  border: 1px solid var(--clr-grey-300);
  border-radius: 0.75rem;
  box-shadow: var(--shadow-card);
}

.sites-info-menu {
  margin-top: 0rem;
  border-top: none;
}

.sites-info > div {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  width: 100%;
}

.sites-info > div > div {
  display: flex;
  flex-direction: column;
  flex-basis: 100%;
  flex: 1;
}

.sites-info > div > div:first-child {
  max-width: 180px;
  font-weight: var(--fw-bold);
  text-align: left;
  margin-right: 1rem;
  min-width: 180px;
}

.sites-info > div > div:nth-child(n+2){
  min-width: 190px;
}

@media (min-width: 449px){
  .sites-info > div > div:first-child {
    text-align: right;
  }
}

.sites-info-menu-filter > div {
  margin-bottom: 1rem;
}

.sites-info-menu-filter > div > div {
  flex: 0;
}
/* let the value column (status buttons / operative picker / dates) grow instead of staying narrow */
.sites-info-menu-filter > div > div:not(:first-child) {
  flex: 1 1 auto;
  min-width: 20rem;
  align-items: flex-start; /* don't stretch inputs to the full column width */
}
/* but keep the individual inputs/pickers a sensible width (the column width is for the status buttons) */
.sites-info-menu-filter input[type="date"],
.sites-info-menu-filter input[type="time"] { max-width: 12rem; width: 100%; padding: 0.5rem 0.75rem; }
.sites-info-menu-filter .token-select { width: 100%; max-width: 40rem; }

.sites-info-menu-filter > div:nth-last-child(2) > div:last-child {
  /* Filter and Reset Buttons */
  flex-direction: row;
}



#sites-menu-wrapper {
  margin-top: 1rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  background-color: var(--clr-card);
  border: 1px solid var(--clr-grey-300);
  border-radius: 0.75rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  width: 100%;
}

#sites-menu-wrapper > div {
  display: flex;
  flex-direction: column;
  flex-basis: auto;
  flex-wrap: nowrap;
  padding-right: 2em;
}

/* tab links: keep the icon next to the label (not stacked above it) */
#sites-menu-wrapper > div > a {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  white-space: nowrap;
}
#sites-menu-wrapper > div > a svg { flex: none; }

/* #sites-menu-wrapper > div:first-child {
  font-weight: var(--fw-bold);
} */


.pin-history {
  margin-top: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background-color: var(--clr-card);
  border: 1px solid var(--clr-grey-300);
  border-radius: 0.75rem;
  box-shadow: var(--shadow-card);
}

.pin-history-none {
  font-size: var(--fs-650);
  font-weight: var(--fw-bold);
  text-align: center;
}

.pin-history-top-row {
  border-bottom: 2px var(--clr-neutral-900) solid;  
}

.pin-history-title {
  font-weight: var(--fw-bold);
  font-size: var(--fs-625);
  line-height: 3rem;
  vertical-align: middle;
  padding-right: 0.5rem;
}

.pin-history-title-history {

  font-weight: var(--fw-regular);
  font-size: var(--fs-600);
  line-height: 3rem;
  vertical-align: middle;
  padding-top: 2px;
}

.pin-history-row-divider {
  padding-top: 1rem;
  border-bottom: 2px var(--clr-accent-400) solid;
  font-size: var(--fs-615);
  font-weight: var(--fw-bold);
}

.pin-history > div {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  width: 100%;
}

.pin-history-row {
  flex-wrap: wrap;
  width: 100%;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.pin-history-element {
  min-width: 150px;
  margin-top: 1rem;
  width: 25%;
}

.pin-history-element > div:first-child {
  font-weight: var(--fw-bold);
}

.pin-history-element-third {
  min-width: 200px;
  margin-top: 1rem;
  width: 33%;
}

.pin-history-element-third > div:first-child {
  font-weight: var(--fw-bold);
}



  /*** END SITES PAGE ***/

.table-search-form {
  display: flex;
  min-width: 220px;
  padding: 2px;
  background: var(--clr-card);
  border: 1px solid var(--clr-grey-300);
  border-radius: 0.5rem;
}

.table-search-form input[type="search"] {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  margin: 0;
  padding: 7px 10px;
  font-size: 14px;
  color: var(--clr-ink);
  border-radius: inherit;
  font-weight: var(--fw-bold);
}

.table-search-form input[type="search"]::placeholder {
  color: var(--clr-grey-400);
}

.table-search-form input[type="search"]:focus {
  outline: none;
}

/*** START TABLE STYLING ***/
td.no-content {
  font-size: var(--fs-650);
  font-weight: var(--fw-bold);
  text-align: center;

}

/* FS/FD tag + linked breadcrumb path, used in the Reports and Drawing Access
   tables so a row links to its drawing and shows the fire type at a glance. */
.fire-tag {
  display: inline-block;
  font-size: 0.72em;
  font-weight: var(--fw-bold);
  letter-spacing: 0.03em;
  line-height: 1;
  padding: 0.3em 0.45em;
  border-radius: 0.35em;
  color: var(--clr-neutral-100);
  vertical-align: 0.1em;
  margin-right: 0.15em;
}
.fire-tag--fs { background: var(--clr-primary-400); } /* Fire Stopping — brand red */
.fire-tag--fd { background: var(--clr-accent-400); }  /* Fire Doors — slate */
/* Left-align breadcrumb cells (table td defaults to centre) so the FS/FD tags
   line up down the column — Reports "Name" and Drawing Access. */
td.cell-breadcrumb { text-align: left; }
.breadcrumb-link { text-decoration: none; color: inherit; }

/* Grouped, collapsible Drawing Access list (per-user): Site > Building > drawings. */
.da-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.da-toolbar-left { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.da-summary { color: var(--clr-grey-500); font-size: 0.9rem; }

/* Reports list search/filter (js/reportsFilter.js) */
.reports-filter { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; flex: 1 1 38rem; }
.reports-filter__search { flex: 1 1 24rem; min-width: 16rem; padding: 0.6rem 0.85rem; font-size: 1rem; }
.reports-filter__types { display: inline-flex; gap: 0.35rem; flex-wrap: wrap; }
.reports-filter__type { padding: 0.45rem 0.85rem; }
/* active type button: solid (filled) to read as selected, vs the ghost default */
.reports-filter__type.is-active { background: var(--clr-primary-400); color: var(--clr-neutral-100); border-color: var(--clr-primary-400); }
.reports-filter__empty { padding: 1rem; }

/* Filter panel: status multi-select toggle buttons (drawing > Filter). Compact so several sit next to
   each other; each carries its status colour (dot + border when off, filled when on). The checkbox is
   visually hidden; clicking the label toggles it. --stc = the status colour for that button. */
.filter-btns { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.filter-btn__cb { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.filter-btn {
  --stc: var(--clr-grey-400);
  cursor: pointer;
  padding: 0.5rem 0.85rem; /* match the date/time + text input height */
  font-size: 0.9rem;
  gap: 0.45em;
  border-color: var(--stc);
  color: var(--clr-primary-500, #233);
  background: transparent;
}
.filter-btn::before { content: ""; width: 0.7em; height: 0.7em; border-radius: 50%; background: var(--stc); flex: none; }
.filter-btn__cb:checked + .filter-btn { background: var(--stc); border-color: var(--stc); color: var(--clr-neutral-100); }
.filter-btn__cb:checked + .filter-btn::before { background: var(--clr-neutral-100); }
.filter-btn__cb:focus-visible + .filter-btn { outline: 2px solid var(--stc); outline-offset: 2px; }
/* status palette (matches the pins-table status pills / pin-count key) */
.filter-btn.st-1 { --stc: var(--clr-primary-400); }
.filter-btn.st-2 { --stc: var(--clr-success); }
.filter-btn.st-3 { --stc: var(--clr-status-inspected); }
.filter-btn.st-4 { --stc: var(--clr-grey-400); }
.filter-btn.st-5 { --stc: var(--clr-status-other); }
.da-selectall { display: inline-flex; align-items: center; gap: 0.4em; font-size: 0.9rem; cursor: pointer; }
.da-selectall input { cursor: pointer; }
.da-groups {
  border: 1px solid var(--clr-grey-300);
  border-radius: 0.75rem;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  background: var(--clr-card);
}
.da-group,
.da-subgroup {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  border: none;
  border-top: 1px solid var(--clr-table-divider);
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.da-group { padding: 0.8em 1rem; background: var(--clr-card); }
.da-subgroup { padding: 0.55em 1rem 0.55em 2.4rem; background: var(--clr-subgroup-bg); font-size: 0.95rem; }
/* Reports: when a Building tier is present the Drawing tier sits one level deeper. */
.da-subgroup--l2 { padding-left: 3.8rem; }
.da-site:first-child .da-group { border-top: none; }
.da-group:hover,
.da-subgroup:hover { background: var(--clr-table-hover); }
.da-name { font-weight: var(--fw-bold); }
.da-subgroup .da-name { font-weight: 600; }
.da-count {
  margin-left: auto;
  color: var(--clr-grey-400);
  font-size: 0.85rem;
  font-weight: var(--fw-regular);
}
.da-chev {
  width: 1.05em;
  height: 1.05em;
  flex: 0 0 auto;
  color: var(--clr-grey-400);
  transition: transform 0.15s;
}
.da-site.open > .da-group .da-chev,
.da-sub.open > .da-subgroup .da-chev { transform: rotate(90deg); }
.da-site-body,
.da-sub-body { display: none; }
.da-site.open > .da-site-body { display: block; }
.da-sub.open > .da-sub-body { display: block; }
.da-row {
  display: flex;
  align-items: center;
  padding: 0.55em 1rem 0.55em 3.8rem;
  border-top: 1px solid var(--clr-table-divider);
  font-size: 0.92rem;
}
.da-row:nth-child(even) { background: var(--clr-table-zebra); }
.da-row:hover { background: var(--clr-table-hover); }
.da-row .da-cb { margin-left: auto; }

/* Report leaf rows (Reports page): a download-type button + date + creator in aligned columns. */
.rep-row {
  display: grid;
  grid-template-columns: 7.5rem 12rem 1fr;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.45em 1rem 0.45em 3.8rem;
  border-top: 1px solid var(--clr-table-divider);
  font-size: 0.92rem;
}
.rep-row:nth-child(even) { background: var(--clr-table-zebra); }
.rep-row:hover { background: var(--clr-table-hover); }
.rep-row .rep-type { text-decoration: none; }
.rep-row .rep-type .button { width: 100%; }
.rep-row .rep-date { color: var(--clr-ink); white-space: nowrap; }
.rep-row .rep-by { color: var(--clr-grey-500); }
.rep-row--l3 { padding-left: 5.2rem; } /* under a Building > Drawing nesting */
@media (max-width: 640px) {
  .rep-row { grid-template-columns: 1fr; gap: 0.25rem; padding-left: 2.4rem; }
}
.breadcrumb-link:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--clr-grey-400); padding-inline: 0.1em; }

/* Shared action-cell: right-aligned, evenly-spaced action buttons in list
   tables — replaces ad-hoc <br> stacking / .buttonSpacing for uniform rows and
   even heights (B3d). Works on desktop (table-cell) and the mobile card layout. */
.cell-actions {
  text-align: right;
}

.cell-actions .button {
  margin: 0.3rem 0 0.3rem 0.5rem;
  vertical-align: middle;
}

  table {
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
    padding: 0;
    margin-top: 1rem;
    width: 100%;
    table-layout: fixed;
    background-color: var(--clr-card);
    border: 1px solid var(--clr-grey-300);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-card);
    overflow: hidden; /* clip the header/last-row corners to the radius */
  }

  table caption {
    font-size: 1.5em;
    margin: .5em 0 .75em;
  }

  table tr:nth-child(even){
    background-color: var(--clr-table-zebra);
  }

  table th,
  table td {
    padding: .7em .625em;
    text-align: center;
    border-bottom: 1px solid var(--clr-table-divider);
  }

  /* Smaller body text across all data tables (matches the pin band / status sizing); the header
     row keeps its larger uppercase size (set on `table th` below). */
  table td {
    font-size: 0.85rem;
  }

  table tbody tr:last-child td {
    border-bottom: none;
  }

  table tbody tr:hover td {
    background-color: var(--clr-table-hover);
  }

  table th {
    background-color: var(--clr-card);
    color: var(--clr-ink);
    border-bottom: 2px solid var(--clr-red);
    font-size: 0.9rem; /* a touch bigger than the 0.85rem body cells */
    letter-spacing: .1em;
    text-transform: uppercase;
  }

  table th a { color: inherit; }

  th a.sort-by { 
    padding-right: 18px;
    position: relative;
  }
  a.sort-by:before,
  a.sort-by:after {
    border: 4px solid transparent;
    content: "";
    display: block;
    height: 0;
    right: 5px;
    top: 50%;
    position: absolute;
    width: 0;
  }
  a.sort-by:before {
    border-bottom-color: var(--clr-grey-600);
    margin-top: -9px;
  }
  a.sort-by:after {
    border-top-color: var(--clr-grey-600);
    margin-top: 1px;
  }
  a.sort-by-selected-asc:before {
    border-bottom-color: var(--clr-black);
  }
  a.sort-by-selected-desc:after {
    border-top-color: var(--clr-black);
  }

  @media screen and (max-width: 600px) {
    table {
      border: 0;
    }
  
    table caption {
      font-size: 1.3em;
    }
    
    table thead {
      border: none;
      clip: rect(0 0 0 0);
      height: 1px;
      margin: -1px;
      overflow: hidden;
      padding: 0;
      position: absolute;
      width: 1px;
    }
    
    table tr {
      border-bottom: 3px solid var(--clr-table-border);
      display: block;
      margin-bottom: .625em;
    }
    
    table td {
      border-bottom: 1px solid var(--clr-table-border);
      display: flow-root; /* contain the floated ::before label so an EMPTY cell keeps its height
                             (a collapsed cell drew its border-bottom through the floated label) */
      font-size: .8em;
      text-align: right;
    }
    
    td.no-content {
      text-align: center;
    }

    table td::before {
      /*
      * aria-label has no advantage, it won't be read inside a table
      content: attr(aria-label);
      */
      content: attr(data-label);
      float: left;
      font-weight: bold;
      text-transform: uppercase;
    }
    
    table td:last-child {
      border-bottom: 0;
    }
  }
  /*** END TABLE STYLING ***/



  .modal-block,
  .modal-block-heading,
  .modal-block-footer,
  .modal-block-content {
    padding-left: 1rem;
    padding-right: 1rem;
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
  }

/* Lock the page scroll while a modal is open (see js/modal.js syncModalScrollLock). */
body.modal-open { overflow: hidden; }

.modal-container {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--clr-black);
  background-color: var(--clr-backdrop);
}

.modal-block {
  display: flex;
  flex-direction: column;
  background-color: var(--clr-background);
  border: 1px solid var(--clr-accent-400);
  box-shadow: 0.5em 0.5em 0.5em var(--clr-accent-400);
  overflow: hidden;
  max-height: 95%;
  border-radius: 0.75rem; /* match the site's card/panel rounding */
  width: 750px;
  max-width: 95%;
  vertical-align: initial;
  /* padding: 0.3rem; */
}

.modal-form{
  display: flex;
  flex-direction: column;
  flex: 1 1;
  overflow-x: hidden;
  overflow: hidden;
}

.modal-block-heading {
  /* padding: 0.3rem; */
  display: flex;
  flex-direction: row;
  justify-content: space-between;

  border-bottom: 1px solid var(--clr-modal-border);
}

.modal-block-close {
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--clr-grey-500);
  opacity: 0.7;
}

.modal-block-close:hover,
.modal-block-close:focus-visible {
  opacity: 1;
  color: var(--clr-red);
}

.modal-block-content {
  /* padding: 1rem; */
  width: 100%;
  /* display: flex; */
  flex-direction: column;
  flex: 1 1;

  overflow: auto;
  overflow-x: hidden;
}
/* A token-select dropdown is absolutely positioned, so a short modal's scrolling content area would
   clip it (only ~1 option showed). Reserve height so the open dropdown is visible. */
.modal-block-content:has(.token-select) { min-height: 24rem; }

.modal-error-msg {
  display: flex;
  justify-content: center;
  color: var(--clr-error);
  font-weight: var(--fw-bold);
  font-size: var(--fs-error);
  padding: 1rem;
  border: 1px solid var(--clr-error);
  margin-bottom: 1rem;
}

.move-warning {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  color: var(--clr-error);
  font-size: var(--fs-error);
  padding: 1rem;
  border: 1px solid var(--clr-error);
  margin-top: 1rem;
}

/* Keep the icon a consistent size and on the first line (flex won't shrink it). */
.move-warning svg {
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.1rem;
}

/* Calm variant: shown when a move affects nobody (reassurance, not an alarm). */
.move-warning--info {
  color: inherit;
  border-color: var(--clr-modal-border);
  background: var(--clr-info-background);
}

/* Persistent super-admin global-scope warning strip; sits above page content. */
.banner-global {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--clr-red);
  border-left-width: 4px;
  border-radius: 4px;
  background: rgba(230, 30, 41, 0.08);
  color: inherit;
  font-size: 0.95rem;
  line-height: 1.35;
}

.banner-global__icon {
  flex: 0 0 auto;
  display: inline-flex;
  color: var(--clr-red);
}

.banner-global__icon svg {
  width: 1.4rem;
  height: 1.4rem;
}

.banner-global__body strong {
  color: var(--clr-red);
}

/* Move-Drawing wizard: inline "+ New" create panels under each pick-or-create level. */
.md-new-toggle {
  margin-top: 0.4rem;
}

.md-new-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding: 0.75rem;
  border: 1px solid var(--clr-modal-border, #ccc);
  border-radius: 4px;
}

.md-new-hint {
  font-size: var(--fs-small, 0.85rem);
  opacity: 0.8;
}

.modal-block-footer {
  /* padding: 0.3rem; */
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--clr-modal-border);
  flex-wrap: wrap;
  align-items: center;
}

/* Drag-and-drop file upload (js/dropzone.js). Progressive enhancement around <input type=file>. */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  border: 2px dashed var(--clr-accent-400, #999);
  border-radius: 6px;
  background: var(--clr-background, #fff);
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, background-color .15s;
}
.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--clr-red);
  outline: none;
}
.dropzone--over {
  border-color: var(--clr-red);
  background: var(--clr-overlay-sm);
}
.dropzone--filled {
  border-style: solid;
}
.dropzone__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.dropzone__prompt {
  color: var(--clr-grey-500, #555);
  font-size: 0.95rem;
}
.dropzone__link {
  color: var(--clr-red);
  text-decoration: underline;
}
.dropzone__preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}
.dropzone__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  max-width: 160px;
}
.dropzone__item img {
  max-width: 140px;
  max-height: 140px;
  border-radius: 4px;
  border: 1px solid var(--clr-accent-400, #ccc);
}
.dropzone__fileicon {
  font-size: 2.5rem;
  line-height: 1;
}
.dropzone__meta {
  font-size: 0.8rem;
  color: var(--clr-ink, #222);
  word-break: break-all;
}

/* Searchable select (js/searchableSelect.js): type-to-filter combobox over a hidden native <select>. */
.ss { position: relative; }
.ss__native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.ss__input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--clr-grey-300, #bbb);
  /* border-radius inherited from the global form-control rule */
}
.ss__list {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 2px;
  z-index: 50;
  max-height: 240px;
  overflow-y: auto;
  background: var(--clr-background, #fff);
  border: 1px solid var(--clr-accent-400, #ccc);
  border-radius: 0.5rem;
  box-shadow: var(--shadow-list);
}
.ss__opt {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
}
.ss__opt:hover,
.ss__opt--active {
  background: var(--clr-overlay-hover);
}

/* Token/chips multi-select (js/tokenSelect.js): chips + type-ahead over hidden native checkboxes. */
.token-select { position: relative; }
.token-select__native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.token-select__control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--clr-grey-300, #bbb);
  border-radius: 0.5rem;
  background: var(--clr-background, #fff);
  cursor: text;
}
.token-select__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.2rem 0.15rem 0.55rem;
  background: var(--clr-accent-400, #2a6db0);
  color: var(--clr-neutral-100);
  border-radius: 1rem;
  font-size: 0.85rem;
  line-height: 1.4;
}
.token-select__chip-x {
  border: 0;
  background: var(--clr-chip-x-bg);
  color: var(--clr-neutral-100);
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.token-select__chip-x:hover { background: var(--clr-chip-x-hover); }
.token-select__input {
  flex: 1;
  min-width: 8rem;
  border: 0;
  outline: none;
  padding: 0.25rem;
  background: transparent;
}
.token-select__list {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 2px;
  z-index: 50;
  max-height: 260px;
  overflow-y: auto;
  background: var(--clr-background, #fff);
  border: 1px solid var(--clr-accent-400, #ccc);
  border-radius: 0.5rem;
  box-shadow: var(--shadow-list);
}
.token-select__opt {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
}
.token-select__opt:hover,
.token-select__opt--active {
  background: var(--clr-overlay-hover);
}
.token-select__empty {
  padding: 0.5rem 0.75rem;
  color: var(--clr-grey-500, #777);
  font-style: italic;
}

/* "attach" mode: existing upload boxes (pin-form photo buckets) become drop targets without
   restructuring; just a highlight while dragging over. */
.dropzone-attach {
  border-radius: 6px;
  transition: outline-color .15s, background-color .15s;
}
.dropzone-attach__hint {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--clr-grey-500, #777);
}
.dropzone-attach__hint strong { color: var(--clr-primary-500, #333); }
.dropzone-attach.dropzone--over .dropzone-attach__hint { color: var(--clr-red); }
.dropzone-attach.dropzone--over {
  outline: 2px dashed var(--clr-red);
  outline-offset: 3px;
  background: var(--clr-overlay-sm);
}

/* Confirm dialog: keep the two buttons side by side (equal width) even on mobile, with the icon left
   of the label — instead of wrapping/stacking. */
.confirm-modal .modal-block-footer {
  flex-wrap: nowrap;
  gap: 0.5rem;
  padding: 0.5rem;
  align-items: stretch; /* equal-height buttons even if one label wraps */
}
.confirm-modal .modal-block-footer .button {
  flex: 1 1 0;
  margin: 0;
}

.modal-upload-status {
  flex: 1;
}

.modal-cancel {
  background-color: transparent;
  color: var(--clr-primary-500);
  margin-right: 1rem;
}

.modal-block-content > div > ul {
  list-style-type: none;
}

.modal-block-content > div > ul > li {
  display: flex;
  flex-wrap: wrap;
  padding-bottom: 1rem;
}

.modal-block-content > div > ul > li > label {
  flex: 1;
  /* min-width: 180px; */
  text-align: left;
  padding-right: 1rem;
  font-weight: var(--fw-bold);
}

/* Consistent rounded corners on text-like form controls site-wide (modal + pin forms were square).
   Excludes checkboxes/radios/file/buttons; login/search inputs keep their own radius (higher specificity). */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="image"]):not([type="range"]):not([type="color"]),
textarea,
select {
  border-radius: 0.5rem;
}

.modal-block-content > div > ul > li > input,
.modal-block-content > div > ul > li > select,
.modal-block-content > div > ul > li > textarea {
  flex: 2;
  /* min-width: 180px; */
  padding: 0 0.5rem 0 0.5rem;
}

.modal-block-content > div > ul > li > input[type=checkbox] {
  min-width: 10px; /* Causes it to center if not unset */
  width: 10px; /* Causes it to center if not unset */
}

@media (min-width: 449px){
  .modal-block-content > div > ul > li > label {
    text-align: right;
  }
}

@media (min-width: 50em){
  .modal-block,
  .modal-block-heading,
  .modal-block-footer,
  .modal-block-content {
    padding: 1rem;
  }

  .modal-block {
    max-height: 75%;
  }

  /* .formRow .question {
    text-align: left;
  } */
}

/* required form items asterisk */
ul > li> label > span {
  color: var(--clr-red);
}

#modalSitesAddFormContent {
  /* width: 100%; */
}

.formRow,
.formPinRow {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  padding-bottom: 1rem;
  width: 100%;
}

.formRow .question,
.formPinRow .question {
  display: flex;
  flex: 0 0 100%;
  flex-direction: column;
  margin-right: 1rem;
  text-align: left;
  font-weight: var(--fw-bold);
}

.formRow .question { min-width: 180px; }

.formRow .question > label > span,
.formPinRow .question > label > span {
  color: var(--clr-red);
}

/* .answer / inputs / checkbox are shared by both row types (modal add/edit = .formRow,
   pin survey = .formPinRow); only .formPinRow's card chrome + heading size differ (below). */
.formRow .answer,
.formPinRow .answer {
  display: flex;
  flex-direction: column;
  flex: 1 1 180px;
  align-items: flex-start;
}

.formRow .answer input,
.formRow .answer select,
.formRow .answer textarea,
.formPinRow .answer input,
.formPinRow .answer select,
.formPinRow .answer textarea {
  min-width: 180px;
  width: 100%;
  padding: 0 0.5rem;
}

.formRow .answer input[type=checkbox],
.formPinRow .answer input[type=checkbox] {
  min-width: unset; /* unset, else it centres */
  width: unset;
  margin-left: 5px;
  margin-top: 4px;
  transform: scale(1.5);
  cursor: pointer;
}

/* Visible keyboard focus on form controls (a11y) — uses the brand focus ring. */
.formRow .answer input:focus-visible,
.formRow .answer select:focus-visible,
.formRow .answer textarea:focus-visible,
.formPinRow .answer input:focus-visible,
.formPinRow .answer select:focus-visible,
.formPinRow .answer textarea:focus-visible {
  outline: 2px solid var(--clr-focus);
  outline-offset: 1px;
}

.question-notes {
  font-weight: var(--fw-regular);
  font-size: var(--fs-300);
}

.question-notes-small {
  font-weight: var(--fw-regular);
  font-size: var(--fs-200);
}

.answer-notes {
  margin-top: 5px;
  color: var(--clr-red);
  font-size: var(--fs-300);
}

.answer-inline {
  display: inline-block !important;
}

@media (min-width: 600px){
  .formRow .question,
  .formPinRow .question {
    text-align: right;
    flex: initial;
  }
}

.center {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.pin-note {
  font-size: var(--size-400);
  font-weight: var(--fw-regular);
  color: var(--clr-red);
}



/* .formPinRow = the shared row layout (above) + a card wrapper and a larger heading. */
.formPinRow {
  background-color: var(--clr-card);
  border: 1px solid var(--clr-grey-300);
  border-radius: 0.75rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 1rem;
  padding: 1rem; /* overrides the base padding-bottom */
}

.formPinRow .question {
  min-width: 250px;
  font-size: var(--fs-secondary-heading);
  margin-top: -0.3rem;
}

/* .formPinRow .answer, its inputs and checkbox are shared with .formRow (see above);
   only these pin-specific overrides remain. */
.formPinRow .answer-text {
  margin-top: -0.3rem;
  justify-content: center;
  font-size: var(--fs-secondary-heading);
}

.formPinRow .answer input[type=submit]{
  min-width: unset;
  width: unset;
}

.formPinRow .answer input[type=number]{
  min-width: unset;
  width: unset;
  font-size: var(--fs-button);
}

@media (min-width: 600px){
  /* text-align/flex are shared with .formRow above; these are the pin-card-only extras. */
  .formPinRow .question {
    max-width: 250px;
    overflow-wrap: break-word;
  }

  .formPinRow .answer-button {
    margin-top: -0.7rem;
  }
}

.answer-photos {
  flex-direction: row !important;
}

.formPinRowTitle {
  background-color: var(--clr-accent-400);
  color: var(--clr-accent-200);
  font-size: var(--fs-700);
  font-weight: var(--fw-bold);
  justify-content: center;
}

/* Tile sections — heading + responsive grid of clean-white link cards.
   Used on Settings, Downloads and the Recycle Bin landing (B3e). */
.tile-section {
  margin-bottom: 2rem;
}

.tile-section__title {
  font-size: var(--fs-secondary-heading);
  font-weight: var(--fw-bold);
  color: var(--clr-ink);
  margin-bottom: 0.75rem;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

/* A single card that should size to its content on one line (e.g. Downloads) */
.tile-grid--inline {
  display: flex;
  flex-wrap: wrap;
}

.tile-grid--inline .tile-card {
  white-space: nowrap;
}

.tile-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 3rem;
  padding: 0.85rem 1rem;
  background-color: var(--clr-card);
  border: 1px solid var(--clr-grey-300);
  border-radius: 0.75rem;
  box-shadow: var(--shadow-card);
  color: var(--clr-ink);
  font-weight: var(--fw-bold);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.tile-card:hover,
.tile-card:focus-visible {
  border-color: var(--clr-red);
  color: var(--clr-red);
}

#drawing-map {
  width: 100%;
  height: clamp(420px, 72vh, 820px);
  border-radius: 0.75rem;
  overflow: hidden; /* clip Leaflet tiles/image to the rounded corners */
}

.drawing-map-large {
  height: clamp(460px, 82vh, 1100px);
}

/* Fullscreen map mode (toggled on the main survey view) */
body.map-fullscreen {
  overflow: hidden;
}

body.map-fullscreen #drawing-map {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 1200;
  border-radius: 0;
}

.map-fs-exit {
  display: none;
}

body.map-fullscreen .map-fs-exit {
  display: inline-block;
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 1300;
}



.leaflet-div-icon {
	background: transparent;
	border: none;
}

.leaflet-marker-icon .number {
	position: relative;
	top: -30px;
  left: 5px;
	font-size: 14px;
  color: var(--clr-neutral-100);
  font-weight: var(--fw-bold);
	width: 22px;
	text-align: center;
}

/* .number{
	position: relative;
	top: -30px;
  left: 5px;
	/* font-size: 1em; */
  /* font-size: 1vw;
  color: var(--clr-neutral-100);
  font-weight: var(--fw-bold);
	width: 0.5rem;
  max-width: 0.5rem;
	text-align: center;
} */

.number {
  left: 3px;
  position: absolute;
  top: 7px;
  width: 24px;
}

.number-sub {
  font-size: 9px !important;
  line-height: 1;
  text-align: center;
  word-break: break-all;
}

.number-sub-new {
  margin-top: 5px;
}

.leaflet-popup-content {
  max-width: 250px;
}

.leaflet-popup-content p {
  margin-block-start: 0em;
  margin-block-end: 0em;
}

.leaflet-popup-content a,
.leaflet-popup-content a:visited,
.leaflet-popup-content a:hover,
.leaflet-popup-content a:active {
  color: var(--clr-primary-400);
  font-weight: var(--fw-bold);
}

.leaflet-popup-content a:hover {
  color: var(--clr-primary-500);
}

/* .checkboxButtons {
  display: flex;
  flex-wrap: wrap;
}

.checkboxButtons label {
  margin-right: 1rem;
  margin-bottom: 1rem;
  cursor: pointer;

  border: none;
  border: 1px solid var(--clr-accent-400);
  border-radius: 100vmax;
  padding: 1em 1.25em;
  font-size: var(--fs-button);
  line-height: 1;
  color: var(--clr-neutral-100);
  background-color: var(--clr-accent-400);
}

.checkboxButtons input {
  width: 0px;
  display: none;
}

.checkboxButtons input[type=checkbox]:checked + label {
  
  font-style: normal;
  font-weight: bolder;
  color: var(--clr-primary-400);
  border: 1px solid var(--clr-primary-400);
  background-color: var(--clr-neutral-400);

  
} */



.radioButtons input[type=radio]:checked + label,
.radioButtons input[type=checkbox]:checked + label {
  
  font-style: normal;
  color: var(--clr-primary-400);
  border: 1px solid var(--clr-primary-400);
  background-color: var(--clr-neutral-400);

  
}

.radioButtons {
  display: flex;
  flex-wrap: wrap;
}

/* Number-field + option-pill answer (Proximity to): lay the input and the pill
   group out as a wrapping flex row with a consistent 1rem gap, so they align
   side-by-side on desktop and keep the same spacing when the pills wrap (mobile)
   — avoids the inline-block overlap the pills had before. */
.formPinRow .answer.answer-inline-flex {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1rem;
}

.radioButtons label {
  display: inline-flex;
  align-items: center;
  gap: .45em;
  margin-right: 1rem;
  margin-bottom: 1rem;
  cursor: pointer;

  border: none;
  border: 1px solid var(--clr-accent-400);
  border-radius: 0.75rem;
  padding: 1em 1.25em;
  font-size: var(--fs-button);
  line-height: 1;
  color: var(--clr-neutral-100);
  background-color: var(--clr-accent-400);
}

.radioButtons input {
  width: 0px;
  display: none;
  visibility: hidden;
}

.submitButtons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

#pinFormError {
  width: 90%;
  margin: 1em;
  opacity: 0;
  transition: all 2s linear;
  display: none !important;
  visibility: hidden;
}

#pinFormError.fade {
  opacity: 1;
  display: block !important;
  visibility: visible;
}

/* Drawing-access list (now a standard paginated table) — larger tick box */
#drawingAccessTable input[type=checkbox] {
  transform: scale(1.5);
  cursor: pointer;
}

.twoColumnWrapper {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  width: 100%;
}

.twoColumnRow {
  width: 50%;
  padding-right: 1em;
}

hr {
  margin-top: 1em;
  margin-bottom: 1em;
  border: 2px solid;
}

.showPhoto:hover{
  cursor: pointer;
}

.showPhotoMultiple {
  margin-right: 1em;
  margin-bottom: 1em;
}

.reportPageTitleRow {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  /* border-bottom: 1px solid var(--clr-accent-350); */
  /* padding: 1em; */
  /* font-size: var(--fs-650); */
  padding-bottom: 0.5em;
}

.reportPageTitleRow input[type=checkbox] {
  transform: scale(1.5);
  margin-right: 10px;
}

.reportPageTitleRow input[type=checkbox]:hover {
  cursor: pointer;
}

.reportPageTitleRow label:hover {
  cursor: pointer;
}

.reportPageInput {
  margin-left: 10px;
}

.reportPageInput input[type=number] {
  width: 4em;
  min-width: 4em;
}

.filter-title {
  font-weight: var(--fw-bold);
}


.upload__box {
  /* padding: 40px; */
}

.upload__inputfile {
  width: .1px;
  height: .1px;
  opacity: 0;
  display: none;
  visibility: hidden;
  z-index: -1;
}

.upload__btn {
  display: inline-block;
  font-weight: 600;
  color: var(--clr-neutral-100);
  text-align: center;
  min-width: 116px;
  padding: 5px;
  transition: all .3s ease;
  cursor: pointer;
  border: 2px solid;
  background-color: var(--clr-primary-400);
  border-color: var(--clr-primary-400);
  border-radius: 10px;
  line-height: 26px;
  font-size: 14px;
}

.upload__btn:hover {
  background-color: unset;
  color: var(--clr-primary-400);
  transition: all .3s ease;
}

.upload__btn-box {
  margin-top: 1em;
  margin-bottom: 10px;
}

.upload__img-wrap {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -10px;
}

.upload__img-box {
  width: 200px;
  padding: 0 10px;
  margin-top: 2em;
  margin-bottom: 12px;
}

.upload__img-close {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--clr-overlay-strong);
  position: absolute;
  top: 10px;
  right: 10px;
  text-align: center;
  line-height: 24px;
  z-index: 1;
  cursor: pointer;
}

.upload__img-close:after {
    content: '\2716';
    font-size: 14px;
    color: var(--clr-neutral-100);
}

.upload__img-bg {
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  position: relative;
  padding-bottom: 100%;
}

.anchor{display: block; position: relative; top: -100px; visibility: hidden;}

.no-content {
  font-size: var(--fs-650);
  font-weight: var(--fw-bold);
  text-align: center;
}
/* List pagination bar (pagination.js) */
.pagination-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  /* 3-zone spread on one line: per-page (left), nav (centre), info (right).
     NB: do NOT use margin:auto on the children here — an auto-margined flex
     item expands to fill its whole line, which forced each zone onto its own
     row when the bar wraps. space-between gives the same spread and stays on
     one line. */
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding-block: var(--size-300, 1rem);
  /* Bars are injected into varied containers (e.g. the drawing Reports/Access
     tabs sit inside a .sites-info card, whose `> div > div` rule otherwise
     forces children to flex-direction:column and caps the first at 180px) —
     keep our own full-width single-row layout regardless of ancestor rules. */
  flex-direction: row !important;
  max-width: none !important;
  font-weight: var(--fw-regular) !important;
  text-align: left !important;
  font-variant-numeric: tabular-nums; /* equal-width digits so 1/2/.. don't change width */
}
/* When only one zone is present (typically just the count), keep it on the right. */
.pagination-bar:has(> :only-child) { justify-content: flex-end; }
.pagination-bar .pagination-nav { white-space: nowrap; }
.pagination-bar .pagination-perpage { white-space: nowrap; }
/* min-widths stop the controls jumping as the digit count grows (Page 1→10, 1–20→21–40). */
.pagination-bar .pagination-info { white-space: nowrap; opacity: 0.8; min-width: 9em; text-align: right; }
.pagination-bar .pagination-page { display: inline-block; min-width: 7em; text-align: center; }
.pagination-bar .pagination-btn {
  display: inline-block;
  padding: 0.2em 0.6em;
  margin-inline: 0.1em;
  text-decoration: none;
  border: 1px solid currentColor;
  border-radius: 0.25em;
}
.pagination-bar .pagination-btn.disabled { opacity: 0.35; pointer-events: none; }
.pagination-bar .pagination-page { padding-inline: 0.5em; }
.pagination-bar select { margin-inline: 0.3em; }

/* Numbered page buttons (windowed): clickable pages + a highlighted current page. */
.pagination-bar .pagination-num {
  display: inline-block;
  min-width: 2.1em;
  padding: 0.25em 0.45em;
  margin-inline: 0.12em;
  text-align: center;
  border: 1px solid var(--clr-grey-300, #ccc);
  border-radius: 0.4em;
  text-decoration: none;
  color: var(--clr-primary-500, #233);
  line-height: 1.4;
}
.pagination-bar a.pagination-num:hover { background: var(--clr-overlay-md); }
.pagination-bar .pagination-num.active {
  border: 2px solid var(--clr-primary-500, #233);
  font-weight: var(--fw-bold, 700);
  cursor: default;
}
.pagination-bar .pagination-ellipsis { display: inline-block; padding-inline: 0.3em; opacity: 0.6; }


/* ===== Dashboard (index.php) ============================================================= */
.dash { min-width: 0; }

/* head: right-aligned "Updated … · Refresh" (replaces the breadcrumb on this page) */
.dash-head { display: flex; justify-content: flex-end; align-items: center; margin-bottom: 1rem; }
.dash-updated { color: var(--clr-grey-500); font-size: 0.82rem; display: inline-flex; align-items: center; gap: 0.6rem; }
.dash-refresh-btn { display: inline-flex; align-items: center; gap: 0.35em; color: var(--clr-primary-400); text-decoration: none; font-weight: 600; border: none; background: none; font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
.dash-refresh-btn:hover { text-decoration: underline; }
.dash-refresh-btn svg { width: 1em; height: 1em; }
.dash-updated { display: inline-flex; align-items: center; gap: 0.9rem; }
/* pause/play icon swap */
.dash-pause-btn .ico-pause, .dash-pause-btn .ico-play { display: inline-flex; }
.dash-pause-btn .ico-play { display: none; }
.dash-pause-btn.is-paused .ico-pause { display: none; }
.dash-pause-btn.is-paused .ico-play { display: inline-flex; }
.dash-pause-btn.is-paused { color: var(--clr-grey-500); }

/* KPI cards */
.dash-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.dash-kpi {
  display: flex; flex-direction: column; gap: 0.35rem; padding: 1rem 1.1rem;
  text-decoration: none; color: inherit; background: var(--clr-card);
  border: 1px solid var(--clr-grey-300); border-radius: 0.75rem; box-shadow: var(--shadow-card);
}
a.dash-kpi:hover { background: var(--clr-table-hover); }
.dash-kpi-ico { width: 2.1rem; height: 2.1rem; border-radius: 0.55rem; display: flex; align-items: center; justify-content: center; color: var(--clr-neutral-100); background: var(--clr-accent-400); }
.dash-kpi--fs .dash-kpi-ico { background: var(--clr-primary-400); }
.dash-kpi--fd .dash-kpi-ico { background: var(--clr-accent-400); }
.dash-kpi-num { font-size: 1.7rem; font-weight: 800; line-height: 1; }
.dash-kpi-lab { font-size: 0.8rem; color: var(--clr-grey-500); }

/* quick actions row */
.dash-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1.5rem; }

/* window selector */
.dash-winbar { display: flex; align-items: center; gap: 0.5rem 0.75rem; flex-wrap: wrap; margin: 0 0 1rem; }
.dash-winbar-lab { color: var(--clr-grey-500); font-size: 0.9rem; }
/* keep the window buttons together as a contiguous group below the label; the group itself wraps
   internally on small screens (6 options don't fit one row on mobile) rather than orphaning one */
.dash-win-btns { display: inline-flex; flex-wrap: wrap; gap: 0.5rem; }
.dash-win-btn { border: 1px solid var(--clr-grey-300); background: var(--clr-card); color: var(--clr-ink); border-radius: 0.5rem; padding: 0.35em 0.8em; font: inherit; font-size: 0.85rem; cursor: pointer; white-space: nowrap; }
.dash-win-btn:hover { background: var(--clr-table-hover); }
.dash-win-btn.is-active { background: var(--clr-primary-400); border-color: var(--clr-primary-400); color: var(--clr-neutral-100); }

/* survey progress card */
.dash-progs { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.5rem; }
.dash-prog-head { font-size: 0.9rem; margin-bottom: 0.35rem; }
.dash-prog-head b { float: right; color: var(--clr-success); }
.dash-prog-bar { height: 10px; border-radius: 6px; background: var(--clr-table-divider); overflow: hidden; }
.dash-prog-bar span { display: block; height: 100%; background: var(--clr-success); border-radius: 6px; }
.dash-prog-sub { font-size: 0.78rem; color: var(--clr-grey-500); margin-top: 0.3rem; }
.dash-outstanding { display: flex; flex-direction: column; gap: 0.55rem; font-size: 0.88rem; color: var(--clr-grey-500); }
.dash-out-row { display: flex; align-items: center; gap: 0.5rem 1.75rem; flex-wrap: wrap; }
.dash-outstanding b { color: var(--clr-ink); font-weight: 800; }

/* trend sparkline (with a y-scale + gridlines so the magnitude is clear) */
.dash-spark-wrap { display: flex; gap: 0.5rem; align-items: stretch; }
.dash-spark-yaxis { display: flex; flex-direction: column; justify-content: space-between; height: 64px; min-width: 1.6rem; text-align: right; font-size: 0.7rem; color: var(--clr-grey-400); font-variant-numeric: tabular-nums; }
.dash-spark-col { flex: 1; min-width: 0; }
.dash-spark-area { position: relative; height: 64px; border-top: 1px solid var(--clr-table-divider); border-bottom: 1px solid var(--clr-table-divider); }
.dash-spark-area::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dashed var(--clr-table-divider); }
.dash-spark { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.dash-spark-bar { flex: 1 1 0; min-width: 2px; background: var(--clr-accent-400); border-radius: 2px 2px 0 0; opacity: 0.85; }
.dash-spark-bar:hover { opacity: 1; background: var(--clr-primary-400); }
.dash-spark-axis { display: flex; justify-content: space-between; margin-top: 0.35rem; font-size: 0.75rem; color: var(--clr-grey-400); }
@media (max-width: 640px) { .dash-progs { grid-template-columns: 1fr; } }

/* cards + pairs */
.dash-card { background: var(--clr-card); border: 1px solid var(--clr-grey-300); border-radius: 0.75rem; box-shadow: var(--shadow-card); padding: 1.1rem 1.25rem; margin-bottom: 1.25rem; }
.dash-card h2 { font-size: 1rem; margin: 0 0 0.9rem; }
.dash-h2-note { font-weight: var(--fw-regular); color: var(--clr-grey-500); font-size: 0.82rem; }

/* info "i" button + click-revealed explanation popover on card headings */
.dash-info-wrap { position: relative; display: inline-flex; vertical-align: middle; }
.dash-info { border: none; background: none; padding: 0; margin-left: 0.35rem; color: var(--clr-grey-400); cursor: pointer; line-height: 0; }
.dash-info:hover, .dash-info:focus-visible { color: var(--clr-primary-400); }
.dash-info svg { width: 1.05em; height: 1.05em; }
.dash-info-pop { display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 50; width: max-content; max-width: 260px; overflow: hidden; background: var(--clr-ink); color: var(--clr-neutral-100); font-size: 0.78rem; font-weight: var(--fw-regular); line-height: 1.4; text-transform: none; letter-spacing: normal; padding: 0.55rem 0.7rem 0.7rem; border-radius: 0.45rem; box-shadow: var(--shadow-popup); }
.dash-info-wrap.open .dash-info-pop { display: block; }
/* Countdown bar that depletes over the 10s auto-close (matches the toast bar). Re-runs each time the
   popover is shown because toggling .open switches the popover from display:none to block. */
.dash-info-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; transform-origin: left; background: var(--clr-primary-400); }
.dash-info-wrap.open .dash-info-pop .dash-info-bar { animation: toastCountdown 10s linear forwards; }
@media (prefers-reduced-motion: reduce) { .dash-info-bar { display: none; } }
/* On mobile, anchor the popover to the viewport (fixed bottom sheet) so it can't overflow the right
   edge and trigger horizontal scroll regardless of where the icon sits. */
@media (max-width: 640px) {
  .dash-info-wrap.open .dash-info-pop {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    top: auto;
    width: auto;
    max-width: none;
  }
}
.dash-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.dash-pair > .dash-card { min-width: 0; }

/* card header with a right-aligned control (e.g. the operatives count toggle) */
.dash-card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.9rem; flex-wrap: wrap; }
.dash-card-head h2 { margin: 0; }
.dash-seg { display: inline-flex; border: 1px solid var(--clr-grey-300); border-radius: 0.5rem; overflow: hidden; }
.dash-seg-btn { border: none; background: var(--clr-card); color: var(--clr-ink); font: inherit; font-size: 0.8rem; padding: 0.3em 0.7em; cursor: pointer; }
.dash-seg-btn + .dash-seg-btn { border-left: 1px solid var(--clr-grey-300); }
.dash-seg-btn:hover { background: var(--clr-table-hover); }
.dash-seg-btn.is-active { background: var(--clr-primary-400); color: var(--clr-neutral-100); }

/* status donut */
.dash-status-body { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.dash-donut { width: 140px; height: 140px; border-radius: 50%; position: relative; flex: 0 0 auto; }
.dash-donut-hole { position: absolute; inset: 24%; background: var(--clr-card); border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.dash-donut-hole b { font-size: 1.4rem; font-weight: 800; line-height: 1; color: var(--clr-primary-400); }
.dash-donut-hole span { font-size: 0.68rem; color: var(--clr-grey-500); margin-top: 0.15rem; }
.dash-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; }
.dash-legend--col { flex-direction: column; gap: 0.35rem; align-items: flex-start; }
.dash-legend div { display: flex; align-items: center; gap: 0.45rem; font-size: 0.85rem; }
.dash-legend b { font-variant-numeric: tabular-nums; }
.dash-dot { width: 0.7rem; height: 0.7rem; border-radius: 50%; flex: 0 0 auto; }
.dash-dot.st-action { background: var(--clr-primary-400); }
.dash-dot.st-installed { background: var(--clr-success); }
.dash-dot.st-inspected { background: var(--clr-status-inspected); }
.dash-dot.st-noaction { background: var(--clr-grey-400); }
.dash-dot.st-other { background: var(--clr-status-other); }

/* operatives table */
.dash-ops-wrap { overflow-x: auto; }
/* min-width so on narrow screens the wrapper scrolls instead of squeezing/clipping the last column */
.dash-ops { width: 100%; min-width: 34rem; border-collapse: collapse; font-size: 0.85rem; }
.dash-ops th, .dash-ops td { padding: 0.4rem 0.5rem; text-align: center; white-space: nowrap; }
.dash-ops th:first-child, .dash-ops td:first-child { text-align: left; white-space: normal; overflow-wrap: anywhere; word-break: break-word; padding-right: 0.9rem; }
.dash-ops thead th { border-bottom: 2px solid var(--clr-red); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.02em; color: var(--clr-ink); white-space: normal; vertical-align: bottom; line-height: 1.15; }
.dash-ops thead th:not(:first-child) { min-width: 3.4rem; }
.dash-ops thead th:first-child { white-space: nowrap; } /* "Operative"/"Drawing" shouldn't break */
.dash-ops tbody tr:nth-child(even) { background: var(--clr-table-zebra); }
.dash-ops .dash-ops-name { font-weight: 600; }
.dash-ops td { font-weight: 600; }
.dash-ops td.st-action { color: var(--clr-primary-400); }
.dash-ops td.st-installed { color: var(--clr-success); }
.dash-ops td.st-inspected { color: var(--clr-status-inspected); }
.dash-ops td.st-noaction { color: var(--clr-grey-500); }
.dash-ops td.st-other { color: var(--clr-status-other); }
.dash-ops td.dash-zero { color: var(--clr-grey-400); font-weight: 400; }
.dash-ops td.dash-ops-total { font-weight: 800; color: var(--clr-ink); }
.dash-ops td.dash-ops-when { color: var(--clr-grey-400); font-weight: 400; white-space: normal; min-width: 4.5rem; }

/* sites needing attention */
.dash-attn-count { margin-left: auto; white-space: nowrap; color: var(--clr-primary-400); font-weight: 700; font-size: 0.85rem; }

/* recent lists */
.dash-list .dash-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.55rem 0; border-top: 1px solid var(--clr-table-divider); font-size: 0.9rem; flex-wrap: wrap; }
.dash-list .dash-row:first-of-type { border-top: none; }
.dash-row-path { min-width: 0; }
.dash-row-when { margin-left: auto; color: var(--clr-grey-400); white-space: nowrap; font-size: 0.82rem; }
.dash-statuses { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.dash-chip { font-size: 0.72rem; font-weight: 700; padding: 0.2em 0.5em; border-radius: 1em; white-space: nowrap; }
.dash-chip.st-action { background: var(--clr-status-action-bg); color: var(--clr-primary-600); }
.dash-chip.st-installed { background: var(--clr-status-installed-bg); color: var(--clr-success); }
.dash-chip.st-inspected { background: var(--clr-status-inspected-bg); color: var(--clr-status-inspected); }
.dash-chip.st-noaction { background: var(--clr-table-divider); color: var(--clr-grey-500); }
.dash-chip.st-other { background: var(--clr-status-other-bg); color: var(--clr-status-other); }

@media (max-width: 900px) {
  .dash-pair { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .dash-kpis { grid-template-columns: repeat(2, 1fr); }

  /* Stack the wide dashboard tables into rows of label : value so nothing runs off-screen
     (the generic table-stacking rules lose to .dash-ops's specificity, so restate here). */
  .dash-ops-wrap { overflow-x: visible; }
  .dash-ops { min-width: 0; }
  .dash-ops thead { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); }
  .dash-ops tbody tr { display: block; border: 1px solid var(--clr-grey-300); border-radius: 0.6rem; padding: 0.3rem 0.7rem; margin-bottom: 0.6rem; background: var(--clr-card); }
  .dash-ops tbody tr:nth-child(even) { background: var(--clr-card); }
  .dash-ops td { display: flex; justify-content: space-between; align-items: center; gap: 1rem; text-align: right; white-space: normal; padding: 0.3rem 0; }
  .dash-ops td::before { content: attr(data-label); font-weight: 600; color: var(--clr-grey-500); text-align: left; text-transform: none; }
  .dash-ops td.dash-ops-name { display: block; text-align: left; font-size: 0.95rem; border-bottom: 1px solid var(--clr-table-divider); padding-bottom: 0.45rem; margin-bottom: 0.2rem; }
  .dash-ops td.dash-ops-name::before { content: none; }
}

/* Dashboard skeleton (first-paint placeholder while #dashBody loads via AJAX) */
.skel { position: relative; overflow: hidden; background: var(--clr-table-divider); border-radius: 0.4rem; }
.skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, var(--clr-skel-shimmer), transparent); animation: skelShimmer 1.2s infinite; }
@keyframes skelShimmer { 100% { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .skel::after { animation: none; } }
.skel-kpi { height: 5.5rem; border-radius: 0.75rem; }
.skel-winbar { height: 2.2rem; width: 22rem; max-width: 100%; margin-bottom: 1rem; }
.skel-line { height: 0.85rem; margin: 0.55rem 0; }
.skel-line.skel-title { height: 1.1rem; width: 40%; margin-bottom: 1.1rem; }
.dash-card .skel-line:last-child { width: 70%; }

/* "Total Pins" hierarchy band (sites/buildings/floors/drawings lists) — a full-width strip at the
   bottom of each row: a total, a status-coloured proportion bar (hover a segment for its count) and
   an always-visible coloured legend of the per-status counts. */
.pincount { font-size: 0.8rem; }
.pincount-total { margin-bottom: 0.25rem; white-space: nowrap; }
.pincount-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--clr-table-divider); }
.pincount-bar span { display: block; height: 100%; }
.pincount-bar .st-1 { background: var(--clr-primary-400); }
.pincount-bar .st-2 { background: var(--clr-success); }
.pincount-bar .st-3 { background: var(--clr-status-inspected); }
.pincount-bar .st-4 { background: var(--clr-grey-400); }
.pincount-bar .st-5 { background: var(--clr-status-other); }
.pincount-legend { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin-top: 0.35rem; color: var(--clr-grey-500); }
.pincount-key { display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap; }
.pincount-key i { width: 0.7rem; height: 0.7rem; border-radius: 0.2rem; flex: 0 0 auto; }
.pincount-key i.st-1 { background: var(--clr-primary-400); }
.pincount-key i.st-2 { background: var(--clr-success); }
.pincount-key i.st-3 { background: var(--clr-status-inspected); }
.pincount-key i.st-4 { background: var(--clr-grey-400); }
.pincount-key i.st-5 { background: var(--clr-status-other); }
.pincount-skelbar { height: 12px; border-radius: 6px; }
.skel-num { display: inline-block; width: 1.8rem; height: 0.8rem; vertical-align: middle; border-radius: 0.25rem; }

/* Status pill (soft-tinted, status-coloured) — used in the viewdrawing pins list Status cell,
   matching the dashboard's chip scheme. Keyed by status id 1–5. */
.status-pill { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 0.2em 0.6em; border-radius: 1em; white-space: nowrap; background: var(--clr-table-divider); color: var(--clr-grey-500); }
.status-pill.st-1 { background: var(--clr-status-action-bg); color: var(--clr-primary-600); }
.status-pill.st-2 { background: var(--clr-status-installed-bg); color: var(--clr-success); }
.status-pill.st-3 { background: var(--clr-status-inspected-bg); color: var(--clr-status-inspected); }
.status-pill.st-4 { background: var(--clr-table-divider); color: var(--clr-grey-500); }
.status-pill.st-5 { background: var(--clr-status-other-bg); color: var(--clr-status-other); }

/* Image lightbox (js/lightbox.js) — full-viewport overlay, image fit-to-screen (no awkward scroll),
   prev/next for grouped sets, click-to-zoom to 100% with drag-pan. */
.lightbox-lock { overflow: hidden; }
.lightbox { position: fixed; inset: 0; z-index: 2000; display: none; align-items: center; justify-content: center; background: var(--clr-lightbox-backdrop); }
.lightbox.is-open { display: flex; }
.lightbox-stage { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.lightbox-img { max-width: 94vw; max-height: 88vh; object-fit: contain; cursor: zoom-in; user-select: none; -webkit-user-drag: none; background: var(--clr-lightbox-img-bg); }
.lightbox-img.is-zoomed { max-width: none; max-height: none; cursor: grab; }
.lightbox-img.is-loading { opacity: 0.35; }
.lightbox-close, .lightbox-nav {
  position: absolute; z-index: 1; display: flex; align-items: center; justify-content: center;
  background: var(--clr-lightbox-ctrl-bg); color: var(--clr-neutral-100); border: none; cursor: pointer; line-height: 1;
  border-radius: 0.5rem; transition: background 0.15s ease;
}
.lightbox-close:hover, .lightbox-nav:hover, .lightbox-close:focus-visible, .lightbox-nav:focus-visible { background: var(--clr-primary-400); outline: none; }
.lightbox-close { top: 0.9rem; right: 0.9rem; width: 2.6rem; height: 2.6rem; font-size: 1.8rem; }
.lightbox-nav { top: 50%; transform: translateY(-50%); width: 3rem; height: 4rem; font-size: 2.4rem; }
.lightbox-prev { left: 0.6rem; }
.lightbox-next { right: 0.6rem; }
.lightbox-nav[hidden] { display: none; }
.lightbox-bar {
  position: absolute; bottom: 0; left: 0; right: 0; display: flex; gap: 1rem; justify-content: space-between;
  align-items: center; padding: 0.7rem 1.1rem; color: var(--clr-neutral-100); font-size: 0.85rem;
  background: linear-gradient(to top, var(--clr-lightbox-bar-end), transparent);
}
.lightbox-counter { white-space: nowrap; opacity: 0.85; font-variant-numeric: tabular-nums; }
/* Any image opted into the lightbox is clickable. */
img[data-lightbox] { cursor: zoom-in; }
@media (max-width: 640px) {
  .lightbox-nav { width: 2.4rem; height: 3.2rem; font-size: 2rem; }
  .lightbox-close { width: 2.4rem; height: 2.4rem; }
}

/* Banded list tables (hierarchy lists with a full-width pin band per item). Each item is a data row
   plus a following .pinrow band; drop the global zebra so the pair reads as one unit, keep a divider
   only beneath the band, and highlight the whole item on hover. */
.table--banded tbody tr { background: transparent; }
.table--banded tbody tr td { border-bottom: 0; }
.table--banded tbody tr.pinrow > td { border-top: 0; border-bottom: 1px solid var(--clr-table-divider); padding: 0 1.25rem 0.7rem; text-align: left; }
.table--banded tbody tr:last-child td { border-bottom: 0; }
.table--banded tbody tr:hover td,
.table--banded tbody tr:hover + tr.pinrow td,
.table--banded tbody tr.pinrow:hover td,
.table--banded tbody tr:has(+ tr.pinrow:hover) td { background-color: var(--clr-table-hover); } /* hovering the band highlights its data row too */
.table--banded tbody tr.pinrow .pincount { width: 100%; }

.theme-toggle {
  background: none; border: none; cursor: pointer; color: var(--clr-neutral-100);
  display: flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; border-radius: 50%; margin-top: 8px; padding: 0; flex: none;
}
.theme-toggle:hover { background: rgba(255, 255, 255, 0.12); }
.theme-toggle__sun { display: none; }
.theme-toggle__moon { display: flex; }
[data-theme="dark"] .theme-toggle__sun { display: flex; }
[data-theme="dark"] .theme-toggle__moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-toggle__sun { display: flex; }
  :root:not([data-theme]) .theme-toggle__moon { display: none; }
}
