/* =============================================================================
   DIETZ ENTERPRISES LLC -- Design System
   Future-industrial: rugged steel/concrete foundation with a technical,
   systems-readout layer on top. Restrained red on black/charcoal/white/gray.
   ============================================================================= */

:root {
  /* Brand palette */
  --c-black: #0a0b0d;
  --c-charcoal: #16181b;
  --c-charcoal-2: #1f2226;
  --c-gray-900: #2e3236;
  --c-gray-700: #4b5157;
  --c-gray-500: #767d84;
  --c-gray-300: #b7bcc1;
  --c-gray-100: #e7e8ea;
  --c-white: #ffffff;
  --c-red: #c8102e;
  --c-red-dark: #96091f;
  --c-red-bright: #ff2244;

  /* Semantic */
  --bg-page: var(--c-white);
  --bg-dark: var(--c-black);
  --bg-charcoal: var(--c-charcoal);
  --text-body: var(--c-charcoal);
  --text-muted: var(--c-gray-700);
  --text-inverse: var(--c-white);
  --border-subtle: var(--c-gray-100);

  /* Type */
  --font-brand: 'Dietz Block', 'Oswald', 'Arial Narrow', sans-serif;
  --font-display: 'Oswald', 'Arial Narrow', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;

  /* Layout */
  --wrap-max: 1280px;
  --radius-sm: 2px;
  --radius-md: 4px;
  --clip-corner: 18px;
  --shadow-md: 0 8px 24px rgba(0,0,0,0.18);
  --shadow-lg: 0 20px 48px rgba(0,0,0,0.28);
  --glow-red: 0 0 0 1px rgba(255,34,68,0.4), 0 0 28px rgba(255,34,68,0.35);
  --glow-red-sm: 0 0 16px rgba(255,34,68,0.4);
  --transition: 200ms ease;

  /* Technical grid texture used on dark sections */
  --grid-line: rgba(255,255,255,0.05);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Logo typeface. Accent only (hero titles) -- body and UI stay on Oswald/Inter. */
@font-face {
  font-family: 'Dietz Block';
  src: url('../fonts/DietzBlock-Regular.woff2') format('woff2'),
       url('../fonts/DietzBlock-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* -----------------------------------------------------------------------
   Reset
   ----------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
/* A class that sets display (.btn, .m-tabs a, ...) otherwise beats the
   browser default for [hidden], leaving "hidden" elements on screen. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text-body);
  background: var(--bg-page);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--c-black);
}
p { margin: 0 0 1em; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 1000;
  background: var(--c-red); color: #fff; padding: 12px 20px; font-weight: 600;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--c-red);
  outline-offset: 2px;
}

.wrap {
  max-width: var(--wrap-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* -----------------------------------------------------------------------
   Under-construction banner (Admin > Settings; blank hides it)
   ----------------------------------------------------------------------- */
.construction-banner {
  position: relative;
  background: var(--c-red-dark);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.4;
}
/* Hazard-stripe edge along the bottom */
.construction-banner::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: repeating-linear-gradient(135deg, var(--c-black) 0 10px, var(--c-red-bright) 10px 20px);
}
.construction-banner__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 14px;
  padding-top: 9px;
  padding-bottom: 13px;
  text-align: center;
}
.construction-banner__label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  white-space: nowrap;
}
.construction-banner__label::before { content: '// '; color: rgba(255,255,255,0.6); }
.construction-banner__text { color: rgba(255,255,255,0.88); }

/* -----------------------------------------------------------------------
   Top utility bar
   ----------------------------------------------------------------------- */
.top-bar {
  background: var(--c-black);
  color: var(--c-gray-300);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.top-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 40px;
}
.top-bar__phone {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-weight: 600;
}
.top-bar__phone .icon { width: 14px; height: 14px; fill: var(--c-red-bright); }
.top-bar__tagline { display: none; letter-spacing: 0.02em; }
.top-bar__tagline::before { content: '// '; color: var(--c-red); }
.top-bar__cta {
  color: var(--c-red-bright);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.74rem;
}
@media (min-width: 768px) {
  .top-bar__tagline { display: block; color: var(--c-gray-500); }
}

/* -----------------------------------------------------------------------
   Header / Navigation
   ----------------------------------------------------------------------- */
.site-header {
  background: var(--c-charcoal);
  border-bottom: 2px solid var(--c-red);
  box-shadow: 0 1px 0 rgba(255,34,68,0.25), 0 12px 30px -14px rgba(255,34,68,0.5);
  position: sticky;
  top: 0;
  z-index: 500;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
}
.brand__logo { height: 52px; width: auto; }
.brand--footer .brand__logo { height: 64px; }

.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: 0;
  padding: 10px;
}
.nav-toggle__bar {
  width: 24px; height: 2px; background: #fff; display: block;
  transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.primary-nav {
  position: fixed;
  inset: 76px 0 0 0;
  background: var(--c-charcoal);
  transform: translateX(100%);
  transition: transform var(--transition);
  overflow-y: auto;
}
.primary-nav.is-open { transform: translateX(0); }
.primary-nav ul { padding: 12px 24px 40px; }
.primary-nav > ul > li { border-bottom: 1px solid rgba(255,255,255,0.08); }
.primary-nav a {
  display: block;
  padding: 16px 4px;
  color: var(--c-gray-100);
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.95rem;
}
.primary-nav a.is-active { color: var(--c-red-bright); }
.primary-nav .dropdown { padding-left: 16px; }
.primary-nav .dropdown a { font-size: 0.88rem; color: var(--c-gray-300); padding: 10px 4px; }
.primary-nav .nav-cta { color: var(--c-red-bright); }

@media (min-width: 1024px) {
  .nav-toggle { display: none; }
  .primary-nav {
    position: static;
    inset: auto;
    transform: none;
    background: transparent;
    overflow: visible;
  }
  .primary-nav ul { padding: 0; display: flex; align-items: center; gap: 4px; }
  .primary-nav > ul > li { border-bottom: 0; position: relative; }
  .primary-nav a { padding: 26px 14px; font-size: 0.86rem; position: relative; }
  .primary-nav a.is-active::after,
  .primary-nav a:hover::after {
    content: ''; position: absolute; left: 14px; right: 14px; bottom: 20px; height: 2px;
    background: var(--c-red-bright); box-shadow: var(--glow-red-sm);
  }
  .primary-nav .nav-cta {
    background: var(--c-red);
    color: #fff !important;
    margin-left: 8px;
  }
  .primary-nav .nav-cta::after { display: none !important; }
  .primary-nav .dropdown {
    position: absolute;
    top: 100%; left: 0;
    min-width: 220px;
    background: var(--c-charcoal-2);
    box-shadow: var(--shadow-lg);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  }
  .has-dropdown:hover .dropdown,
  .has-dropdown:focus-within .dropdown {
    opacity: 1; visibility: visible; transform: translateY(0);
  }
  .primary-nav .dropdown a { padding: 12px 20px; }
}

/* -----------------------------------------------------------------------
   Flash messages
   ----------------------------------------------------------------------- */
.flash-stack { padding-top: 16px; display: grid; gap: 10px; }
.flash {
  padding: 14px 18px;
  border-left: 4px solid var(--c-gray-500);
  background: var(--c-gray-100);
  font-weight: 500;
}
.flash--success { border-color: #1c7a3d; background: #eaf6ee; }
.flash--error { border-color: var(--c-red); background: #fbeaec; }

/* -----------------------------------------------------------------------
   Buttons
   ----------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 30px;
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.85rem;
  border: 2px solid transparent;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  min-height: 48px;
}
.btn--primary { background: var(--c-red); color: #fff; }
.btn--primary:hover, .btn--primary:focus-visible { background: var(--c-red-dark); box-shadow: var(--glow-red); }
.btn--dark { background: var(--c-black); color: #fff; border-color: rgba(255,255,255,0.08); }
.btn--dark:hover { background: var(--c-charcoal-2); }
.btn--outline { background: transparent; border-color: currentColor; }
.btn--outline-light { background: transparent; border-color: rgba(255,255,255,0.6); color: #fff; }
.btn--outline-light:hover { border-color: var(--c-red-bright); background: rgba(255,34,68,0.08); box-shadow: var(--glow-red-sm); }
.btn--block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

/* -----------------------------------------------------------------------
   Section scaffolding
   ----------------------------------------------------------------------- */
.section { padding: 88px 0; }
.section--tight { padding: 56px 0; }
.section--dark {
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 100% 48px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 48px 100%,
    var(--c-black);
  color: var(--c-gray-100);
}
.section--dark h2, .section--dark h3 { color: #fff; }
.section--charcoal {
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 100% 48px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 48px 100%,
    var(--c-charcoal);
  color: var(--c-gray-100);
}
.section--charcoal h2, .section--charcoal h3 { color: #fff; }
.section--gray { background: var(--c-gray-100); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  color: var(--c-red);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.78rem;
  margin-bottom: 14px;
}
.eyebrow::before { content: ''; width: 30px; height: 2px; background: var(--c-red); box-shadow: var(--glow-red-sm); }

.section-head { max-width: 760px; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.section-head p { color: var(--text-muted); font-size: 1.05rem; }
.section--dark .section-head p, .section--charcoal .section-head p { color: var(--c-gray-300); }

.section-number {
  font-family: var(--font-mono);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 700;
  color: var(--c-gray-100);
  line-height: 1;
  margin-bottom: -0.3em;
}
.section--dark .section-number, .section--charcoal .section-number { color: rgba(255,255,255,0.06); }

/* -----------------------------------------------------------------------
   Hero
   ----------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 640px;
  height: calc(100vh - 116px);
  max-height: 820px;
  display: flex;
  align-items: center;
  color: #fff;
  background: linear-gradient(180deg, rgba(11,11,12,0.55) 0%, rgba(11,11,12,0.55) 100%), var(--c-charcoal);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px) 0 0 / 100% 56px,
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px) 0 0 / 56px 100%;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.2) 70%, transparent 100%);
  z-index: 1;
}
.hero::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.35) 45%, rgba(0,0,0,0.72) 100%);
  z-index: 1;
}
.hero__inner { position: relative; z-index: 2; padding: 48px 0; width: 100%; }
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase;
  font-size: 0.8rem; color: var(--c-gray-100); margin-bottom: 22px;
}
.hero__eyebrow::before {
  content: ''; width: 9px; height: 9px; background: var(--c-red-bright);
  box-shadow: var(--glow-red-sm); flex-shrink: 0;
}
.hero h1 {
  color: #fff;
  font-family: var(--font-brand);
  font-size: clamp(2.2rem, 7vw, 5.2rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  margin-bottom: 20px;
  max-width: 16ch;
}
.hero p.lede {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--c-gray-100);
  max-width: 60ch;
  margin-bottom: 36px;
}
.hero .btn-row { margin-bottom: 8px; }

.hero--placeholder { background: repeating-linear-gradient(135deg, var(--c-charcoal), var(--c-charcoal) 22px, var(--c-charcoal-2) 22px, var(--c-charcoal-2) 44px); }

/* Generic industrial placeholder for any missing photo */
.img-placeholder {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(135deg, var(--c-gray-900), var(--c-gray-900) 18px, var(--c-charcoal-2) 18px, var(--c-charcoal-2) 36px);
  color: var(--c-gray-300);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.76rem;
  text-align: center;
  width: 100%;
  min-height: 220px;
}
.img-placeholder::before {
  content: '';
  position: absolute; inset: 0;
  border: 2px solid var(--c-red);
  opacity: 0.5;
}
.img-placeholder span { position: relative; padding: 12px; max-width: 22ch; }
.img-placeholder span::before { content: '// '; color: var(--c-red-bright); }

/* -----------------------------------------------------------------------
   Intro / stats
   ----------------------------------------------------------------------- */
.intro-grid {
  display: grid;
  gap: 40px;
}
@media (min-width: 900px) {
  .intro-grid { grid-template-columns: 1.1fr 0.9fr; align-items: start; gap: 64px; }
}
.intro-grid p { font-size: 1.08rem; color: var(--text-muted); }
.stat-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-top: 8px; }
.stat {
  border-left: 3px solid var(--c-red);
  padding: 6px 0 6px 18px;
}
.stat strong { display: block; font-family: var(--font-mono); font-size: 1.9rem; color: var(--c-black); }
.stat span { color: var(--text-muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* -----------------------------------------------------------------------
   Cards: divisions, services, equipment
   ----------------------------------------------------------------------- */
.card-grid {
  display: grid;
  gap: 28px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .card-grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) {
  .card-grid--3 { grid-template-columns: repeat(3, 1fr); }
  .card-grid--2 { grid-template-columns: repeat(2, 1fr); }
}

.division-card {
  position: relative;
  background: var(--c-charcoal);
  color: #fff;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--clip-corner)), calc(100% - var(--clip-corner)) 100%, 0 100%);
  transition: box-shadow var(--transition);
}
.division-card:hover, .division-card:focus-visible { box-shadow: var(--glow-red); }
.division-card__media {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
}
.division-card__media.img-placeholder { position: absolute; inset: 0; min-height: 0; }
.division-card::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.15) 65%);
}
.division-card__body { position: relative; z-index: 2; padding: 28px; }
.division-card__num {
  font-family: var(--font-mono); color: var(--c-red-bright); font-weight: 700;
  font-size: 0.85rem; letter-spacing: 0.06em; margin-bottom: 8px; display: block;
}
.division-card__num::before { content: '['; opacity: 0.6; }
.division-card__num::after { content: ']'; opacity: 0.6; }
.division-card h3 { color: #fff; font-size: 1.5rem; margin-bottom: 10px; }
.division-card p { color: var(--c-gray-300); margin-bottom: 18px; }
.division-card .btn { padding: 12px 22px; font-size: 0.78rem; }
.division-card:hover .division-card__media { transform: scale(1.04); }
.division-card__media { transition: transform 400ms ease; }

.service-card {
  border: 1px solid var(--border-subtle);
  background: #fff;
  display: flex;
  flex-direction: column;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--clip-corner)), calc(100% - var(--clip-corner)) 100%, 0 100%);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.service-card:hover { border-color: var(--c-red-bright); box-shadow: var(--glow-red-sm); }
.service-card__media { aspect-ratio: 4 / 3; overflow: hidden; }
.service-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms ease; }
.service-card:hover .service-card__media img { transform: scale(1.05); }
.service-card__body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.service-card__division { color: var(--c-red); font-size: 0.75rem; font-weight: 700; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.service-card h3 { font-size: 1.2rem; margin-bottom: 10px; }
.service-card p { color: var(--text-muted); font-size: 0.95rem; flex: 1; }
.service-card__link { margin-top: 14px; font-weight: 600; color: var(--c-black); display: inline-flex; align-items: center; gap: 6px; }
.service-card__link:hover { color: var(--c-red); }

.equipment-card {
  border: 1px solid var(--border-subtle);
  background: #fff;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--clip-corner)), calc(100% - var(--clip-corner)) 100%, 0 100%);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.equipment-card:hover { border-color: var(--c-red-bright); box-shadow: var(--glow-red-sm); }
.equipment-card__media { aspect-ratio: 16 / 10; overflow: hidden; }
.equipment-card__media img { width: 100%; height: 100%; object-fit: cover; }
.equipment-card__body { padding: 22px; }
.equipment-card__category { color: var(--c-red); font-size: 0.72rem; font-weight: 700; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; }
.equipment-card h3 { font-size: 1.1rem; margin: 6px 0 8px; }
.equipment-card p { color: var(--text-muted); font-size: 0.92rem; }

/* -----------------------------------------------------------------------
   Project gallery
   ----------------------------------------------------------------------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}
.filter-btn {
  padding: 10px 20px;
  border: 2px solid var(--c-gray-100);
  background: transparent;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.78rem;
  min-height: 44px;
  transition: all var(--transition);
}
.filter-btn.is-active, .filter-btn:hover { background: var(--c-black); color: #fff; border-color: var(--c-red); box-shadow: var(--glow-red-sm); }

.project-card {
  position: relative;
  overflow: hidden;
  background: var(--c-charcoal);
  aspect-ratio: 4 / 3;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--clip-corner)), calc(100% - var(--clip-corner)) 100%, 0 100%);
  transition: box-shadow var(--transition);
}
.project-card:hover { box-shadow: var(--glow-red); }
.project-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms ease; }
.project-card__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 60%);
  display: flex; align-items: flex-end; padding: 22px; color: #fff;
}
.project-card__division { color: var(--c-red-bright); font-family: var(--font-mono); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; display: block; margin-bottom: 6px; }
.project-card h3 { color: #fff; font-size: 1.1rem; margin-bottom: 4px; }
.project-card__loc { color: var(--c-gray-300); font-size: 0.85rem; }
.project-card:hover img { transform: scale(1.06); }

.project-gallery { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .project-gallery { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .project-gallery { grid-template-columns: repeat(3, 1fr); } }

.project-detail__gallery { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px) { .project-detail__gallery { grid-template-columns: repeat(3, 1fr); } }
.project-detail__gallery figure { margin: 0; aspect-ratio: 4/3; overflow: hidden; cursor: zoom-in; }
.project-detail__gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--transition); }
.project-detail__gallery img:hover { transform: scale(1.03); }

.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox.is-open { display: flex; }
.lightbox img { max-width: 100%; max-height: 84vh; }
.lightbox__close {
  position: absolute; top: 18px; right: 18px; background: transparent; border: 0;
  color: #fff; font-size: 2rem; line-height: 1; padding: 10px;
}
.lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.1); border: 0; color: #fff; font-size: 1.8rem; padding: 16px 12px; }
.lightbox__nav--prev { left: 12px; }
.lightbox__nav--next { right: 12px; }

/* -----------------------------------------------------------------------
   Detail page scaffolding (divisions / services / projects)
   ----------------------------------------------------------------------- */
.detail-hero {
  position: relative;
  color: #fff;
  min-height: 46vh;
  display: flex;
  align-items: flex-end;
  background: var(--c-charcoal);
  background-size: cover;
  background-position: center;
  border-bottom: 2px solid var(--c-red);
  overflow: hidden;
}
.detail-hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px) 0 0 / 100% 48px,
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px) 0 0 / 48px 100%;
  mask-image: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.6) 60%, rgba(0,0,0,0.9) 100%);
}
.detail-hero::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.85), rgba(0,0,0,0.3));
}
.detail-hero__inner { position: relative; z-index: 2; padding-bottom: 40px; width: 100%; }
.detail-hero h1 { color: #fff; font-family: var(--font-brand); font-weight: 400; font-size: clamp(1.9rem, 4.5vw, 3.2rem); margin-bottom: 10px; }
.detail-hero__meta { display: flex; flex-wrap: wrap; gap: 18px; color: var(--c-gray-300); font-family: var(--font-mono); font-size: 0.85rem; }

.breadcrumbs { padding: 16px 0; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; font-size: 0.85rem; color: var(--text-muted); }
.breadcrumbs li:not(:last-child)::after { content: '/'; margin-left: 6px; color: var(--c-gray-300); }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--c-red); }
.breadcrumbs li[aria-current] { color: var(--c-black); font-weight: 600; }

.prose { max-width: 76ch; font-size: 1.05rem; color: var(--text-body); }
.prose h2 { font-size: 1.6rem; margin-top: 1.4em; }

.meta-list { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin: 28px 0; }
.meta-list dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--c-red); font-weight: 700; margin-bottom: 4px; }
.meta-list dd { margin: 0; font-weight: 600; }

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-block; padding: 6px 14px; background: var(--c-gray-100);
  font-family: var(--font-mono); font-size: 0.76rem; font-weight: 600; color: var(--text-body);
  transition: background var(--transition), color var(--transition);
}
a.tag:hover { background: var(--c-black); color: #fff; }

/* -----------------------------------------------------------------------
   CTA banner
   ----------------------------------------------------------------------- */
.cta-banner {
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 100% 48px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 48px 100%,
    var(--c-black);
  color: #fff;
  padding: 64px 0;
  text-align: center;
  position: relative;
  border-top: 2px solid var(--c-red);
  box-shadow: 0 -1px 0 rgba(255,34,68,0.25), 0 -20px 40px -20px rgba(255,34,68,0.35) inset;
}
.cta-banner h2 { color: #fff; font-size: clamp(1.7rem, 4vw, 2.6rem); margin-bottom: 14px; }
.cta-banner p { color: var(--c-gray-300); max-width: 60ch; margin: 0 auto 28px; }
.cta-banner .btn-row { justify-content: center; }

/* -----------------------------------------------------------------------
   Forms
   ----------------------------------------------------------------------- */
.form-grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid--2 { grid-template-columns: 1fr 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 0.9rem; }
.field .required { color: var(--c-red); }
.field input,
.field select,
.field textarea {
  border: 2px solid var(--c-gray-100);
  padding: 14px 16px;
  font-family: inherit;
  font-size: 1rem;
  background: #fff;
  min-height: 48px;
  transition: border-color var(--transition);
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--c-red); outline: none; }
.field small { color: var(--text-muted); font-size: 0.82rem; }
.field-error { color: var(--c-red); font-size: 0.85rem; font-weight: 600; }
.field.has-error input, .field.has-error textarea, .field.has-error select { border-color: var(--c-red); }

.radio-row { display: flex; flex-wrap: wrap; gap: 18px; }
.radio-option { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.radio-option input { min-height: auto; width: 18px; height: 18px; }

.file-drop {
  border: 2px dashed var(--c-gray-300);
  padding: 28px;
  text-align: center;
  color: var(--text-muted);
}

/* Honeypot -- visually and semantically hidden from real users */
.hp-field { position: absolute; left: -9999px; top: -9999px; }

.form-panel {
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-top: 3px solid var(--c-red);
  padding: 36px;
  box-shadow: var(--shadow-md);
}

/* -----------------------------------------------------------------------
   Footer
   ----------------------------------------------------------------------- */
.site-footer { background: var(--c-charcoal); color: var(--c-gray-300); padding-top: 64px; }
.site-footer__grid {
  display: grid; gap: 40px;
  grid-template-columns: 1fr;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
@media (min-width: 800px) { .site-footer__grid { grid-template-columns: 1.4fr 1fr 1fr 1.2fr; } }
.site-footer h3 { color: #fff; font-size: 0.95rem; letter-spacing: 0.06em; margin-bottom: 16px; }
.site-footer__col ul { display: grid; gap: 10px; }
.site-footer__col a:hover { color: #fff; }
.brand--footer { margin-bottom: 14px; }
.site-footer__social { display: flex; gap: 10px; margin-top: 18px; }
.site-footer__social a {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,0.25); font-size: 0.75rem; font-weight: 700;
}
.site-footer__contact { margin-bottom: 18px; }
.site-footer__legal {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px;
  padding: 22px 24px; font-size: 0.8rem; color: var(--c-gray-500);
}
.dev-credit { opacity: 0.7; }
.dev-credit a { color: var(--c-gray-500); }

/* -----------------------------------------------------------------------
   Misc: empty states, pagination, scroll reveal
   ----------------------------------------------------------------------- */
.empty-state {
  border: 2px dashed var(--c-gray-300);
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}
.empty-state h3 { color: var(--c-gray-700); }

.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 40px; }
.pagination a, .pagination span {
  min-width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-subtle); font-weight: 600;
}
.pagination a:hover { border-color: var(--c-black); }
.pagination .is-current { background: var(--c-black); color: #fff; border-color: var(--c-black); }

[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 600ms ease, transform 600ms ease; }
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; }
}

.text-center { text-align: center; margin-left: auto; margin-right: auto; }

/* =============================================================================
   ACCOUNTS -- sign in / register and the signed-in account area
   ============================================================================= */

/* Top-bar account link. The label is hidden on narrow screens so the bar keeps
   phone + account + CTA on one line. */
.top-bar__account {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--c-gray-300);
  font-weight: 600;
  white-space: nowrap;
}
.top-bar__account:hover { color: #fff; }
.top-bar__account .icon { width: 14px; height: 14px; fill: currentColor; }
.top-bar__account span { display: none; }
@media (min-width: 560px) { .top-bar__account span { display: inline; } }

.btn--sm { padding: 9px 16px; font-size: 0.78rem; }

/* Compact action button for table rows. Mirrors the admin panel's .btn-mini
   so the same row markup reads correctly in both places. */
.btn-mini {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 6px 12px; font-size: 0.78rem; font-weight: 600; white-space: nowrap;
  border: 1px solid var(--border-subtle); background: transparent;
  color: var(--text-body); cursor: pointer; font-family: inherit;
}
.btn-mini:hover { border-color: var(--c-black); }
.btn-mini.btn--primary { background: var(--c-red); border-color: var(--c-red); color: #fff; }
.btn-mini.btn--primary:hover { background: var(--c-red-dark); border-color: var(--c-red-dark); }

/* Status pills, matching the vocabulary used in the admin panel. */
.status-pill {
  display: inline-block; padding: 3px 10px; font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em; background: var(--c-gray-100);
  color: var(--text-muted); border-radius: var(--radius-sm);
}
.status-pill--new { background: #fde9c8; color: #7a4a00; }
.status-pill--contacted { background: #d8e8fb; color: #164a8c; }
.status-pill--quoted { background: #e1d8fb; color: #4a1d8c; }
.status-pill--won { background: #d7f3df; color: #146228; }
.status-pill--lost, .status-pill--spam { background: #f7d7da; color: #8c1621; }

/* --- Sign in / register --------------------------------------------------- */
.auth-wrap { max-width: 480px; margin: 0 auto; }
.auth-wrap--wide { max-width: 680px; }
.auth-title { font-size: 1.6rem; margin: 0 0 8px; }
.auth-sub { color: var(--text-muted); margin: 0 0 24px; }
.auth-alt { margin: 22px 0 0; font-size: 0.92rem; }
.auth-alt a { color: var(--c-red); font-weight: 600; text-decoration: underline; }
.auth-note { margin: 10px 0 0; font-size: 0.85rem; color: var(--text-muted); }
.auth-note a { color: var(--c-red); font-weight: 600; }

.auth-tabs { display: flex; gap: 0; margin: 0 0 22px; border-bottom: 2px solid var(--border-subtle); }
.auth-tab {
  padding: 11px 20px; font-weight: 600; font-size: 0.9rem; color: var(--text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.auth-tab:hover { color: var(--text-body); }
.auth-tab.is-active { color: var(--c-red); border-bottom-color: var(--c-red); }

.auth-notice {
  background: #fff8e6; border-left: 3px solid #e0a800; padding: 14px 16px;
  font-size: 0.88rem; margin-bottom: 22px;
}
.auth-notice strong { display: block; margin-bottom: 3px; }

/* --- Signed-in account area ----------------------------------------------- */
.account-layout { display: grid; gap: 32px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .account-layout { grid-template-columns: 220px 1fr; } }

.account-nav { border: 1px solid var(--border-subtle); padding: 20px; }
@media (min-width: 900px) { .account-nav { position: sticky; top: 24px; } }
.account-nav__heading {
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.06em;
  font-size: 0.78rem; color: var(--text-muted); margin: 0 0 12px;
}
.account-nav ul { list-style: none; margin: 0; padding: 0; }
.account-nav li a {
  display: block; padding: 9px 12px; font-size: 0.9rem; font-weight: 500;
  border-left: 2px solid transparent; color: var(--text-body);
}
.account-nav li a:hover { background: var(--c-gray-100); }
.account-nav li a.is-active { border-left-color: var(--c-red); color: var(--c-red); font-weight: 600; }
.account-nav__logout {
  display: block; margin-top: 16px; padding-top: 16px; font-size: 0.85rem; font-weight: 600;
  border-top: 1px solid var(--border-subtle); color: var(--text-muted);
}
.account-nav__logout:hover { color: var(--c-red); }

.account-main { min-width: 0; }
.account-head { margin-bottom: 28px; }
.account-head h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin: 0 0 6px; }
.account-head p { color: var(--text-muted); margin: 0; font-size: 0.95rem; }

.account-type-pill {
  display: inline-block; padding: 2px 9px; font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; border-radius: var(--radius-sm);
  background: var(--c-gray-100); color: var(--text-muted);
}
.account-type-pill--employee { background: var(--c-black); color: #fff; }

.account-cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 28px; }
.account-card { border: 1px solid var(--border-subtle); border-left: 3px solid var(--c-red); padding: 18px; }
.account-card strong { display: block; font-family: var(--font-display); font-size: 1.5rem; line-height: 1.2; }
.account-card span { color: var(--text-muted); font-size: 0.85rem; }

.account-panel { border: 1px solid var(--border-subtle); padding: 24px; margin-bottom: 24px; }
.account-panel__head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin-bottom: 18px;
}
.account-panel__head h2 { font-size: 1rem; margin: 0; }
.account-subhead { font-size: 0.85rem; margin: 22px 0 8px; color: var(--text-muted); }
.account-prose { margin: 0; line-height: 1.7; }

.account-list { list-style: none; margin: 0; padding: 0; }
.account-list li + li { border-top: 1px solid var(--border-subtle); }
.account-list a {
  display: flex; flex-direction: column; gap: 6px; padding: 14px 0;
}
.account-list a:hover .account-list__title { color: var(--c-red); }
.account-list__title { font-weight: 600; font-size: 0.95rem; }
.account-list__meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  color: var(--text-muted); font-size: 0.82rem;
}

.account-detail-list { display: grid; gap: 14px; margin: 0; grid-template-columns: 1fr; }
@media (min-width: 640px) { .account-detail-list { grid-template-columns: 1fr 1fr; } }
.account-detail-list dt {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); margin-bottom: 3px;
}
.account-detail-list dd { margin: 0; font-weight: 500; }

.account-empty { text-align: center; padding: 28px 16px; border: 2px dashed var(--border-subtle); }
.account-empty p { color: var(--text-muted); margin: 0 0 14px; }
.account-empty__hint { font-size: 0.85rem; margin-bottom: 0 !important; }

/* =============================================================================
   MAINTENANCE -- employee equipment maintenance area
   The .m-badge classes are mirrored in admin/assets/css/admin.css so the
   shared helpers in includes/maintenance-ui.php render in both panels.
   ============================================================================= */

.m-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 2px solid var(--border-subtle); margin-bottom: 26px; }
.m-tabs a {
  padding: 10px 18px; font-weight: 600; font-size: 0.9rem; color: var(--text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap;
}
.m-tabs a:hover { color: var(--text-body); }
.m-tabs a.is-active { color: var(--c-red); border-bottom-color: var(--c-red); }

.m-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 22px; }
.m-narrow { max-width: 820px; }
.m-muted { color: var(--text-muted); font-size: 0.82rem; }

/* Two-column working layout: main content plus a sidebar of small panels. */
.m-grid { display: grid; gap: 24px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1000px) { .m-grid { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); } }
.m-col-main, .m-col-side { min-width: 0; }

/* --- Status badges -------------------------------------------------------- */
.m-badge {
  display: inline-block; padding: 3px 9px; font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em; border-radius: var(--radius-sm);
  background: var(--c-gray-100); color: var(--text-muted); white-space: nowrap;
}
.m-badge--overdue { background: #f7d7da; color: #8c1621; }
.m-badge--due_soon { background: #fde9c8; color: #7a4a00; }
.m-badge--never { background: #d8e8fb; color: #164a8c; }
.m-badge--ok { background: #d7f3df; color: #146228; }
.m-badge--none { background: var(--c-gray-100); color: var(--text-muted); }

/* --- Tables --------------------------------------------------------------- */
.m-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.m-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.m-table th {
  text-align: left; font-family: var(--font-display); text-transform: uppercase;
  font-size: 0.72rem; letter-spacing: 0.05em; color: var(--text-muted);
  padding: 10px 12px 10px 0; border-bottom: 2px solid var(--border-subtle);
}
.m-table td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--border-subtle); vertical-align: top; font-size: 0.9rem; }
.m-table tbody tr:hover td { background: #fafafa; }
.m-table tfoot td { border-bottom: 0; border-top: 2px solid var(--border-subtle); }
.m-row--muted td { opacity: 0.55; }
.m-row-actions { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; }

.m-unit-link { display: block; }
.m-unit-link strong { display: block; font-family: var(--font-display); font-size: 1rem; }
.m-unit-link span { color: var(--text-muted); font-size: 0.85rem; }
.m-unit-link:hover strong { color: var(--c-red); }

/* --- Unit header ---------------------------------------------------------- */
.m-unit-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 20px; flex-wrap: wrap; margin-bottom: 22px;
}
.m-unit-head__number {
  font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--c-red); margin: 0 0 2px;
}
.m-unit-head h1 { font-size: clamp(1.4rem, 3vw, 2rem); margin: 0 0 6px; }
.m-unit-head__meta { color: var(--text-muted); margin: 0; font-size: 0.9rem; }
.m-unit-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- Meter ---------------------------------------------------------------- */
.m-meter-current { margin: 0 0 16px; }
.m-meter { font-family: var(--font-display); font-size: 1.6rem; }
.m-meter--none { font-size: 1rem; color: var(--text-muted); }
.m-meter__age { display: block; font-size: 0.78rem; color: var(--text-muted); font-family: var(--font-body); }

/* --- Small forms ---------------------------------------------------------- */
.m-filter-bar { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin-bottom: 20px; }
.m-filter-bar .field { margin-bottom: 0; }
.m-inline-form { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin-top: 18px; }
.m-inline-form .field { margin-bottom: 0; }
.m-stack-form { display: grid; gap: 14px; margin-top: 14px; }
.m-stack-form .field { margin-bottom: 0; }

.m-fieldset { border: 1px solid var(--border-subtle); padding: 18px; margin-top: 24px; }
.m-fieldset legend {
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.05em;
  font-size: 0.8rem; padding: 0 8px;
}
.m-part-row { display: grid; gap: 12px; grid-template-columns: 1fr; margin-bottom: 14px; }
@media (min-width: 720px) { .m-part-row { grid-template-columns: 1.1fr 1.4fr 0.5fr 0.6fr; } }
.m-part-row .field { margin-bottom: 0; }
.m-part-row label { font-size: 0.78rem; color: var(--text-muted); }

.m-task-banner { background: var(--c-gray-100); border-left: 3px solid var(--c-red); padding: 14px 16px; margin-bottom: 22px; }
.m-task-banner strong { display: block; margin-bottom: 4px; }
.m-task-banner p { margin: 4px 0 0; font-size: 0.88rem; }

/* --- Lists ---------------------------------------------------------------- */
.m-detail-list { display: grid; gap: 12px; margin: 0; }
.m-detail-list dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.m-detail-list dd { margin: 2px 0 0; font-weight: 500; font-size: 0.92rem; }

.m-part-list, .m-doc-list { list-style: none; margin: 0; padding: 0; }
.m-part-list li, .m-doc-list li { padding: 10px 0; border-bottom: 1px solid var(--border-subtle); font-size: 0.88rem; }
.m-part-list li:last-child, .m-doc-list li:last-child { border-bottom: 0; }
.m-part-number { font-family: var(--font-mono); font-weight: 600; display: block; }
.m-part-desc { display: block; }
.m-doc-list a { font-weight: 600; color: var(--c-red); text-decoration: underline; }
.m-link-danger {
  background: none; border: 0; padding: 0; cursor: pointer; font-size: 0.78rem;
  color: var(--text-muted); text-decoration: underline; font-family: inherit;
}
.m-link-danger:hover { color: var(--c-red); }

.m-photo-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.m-photo-grid img { width: 100%; height: 120px; object-fit: cover; display: block; border: 1px solid var(--border-subtle); }

.account-card--alert { border-left-color: var(--c-red); }
.account-card--alert strong { color: var(--c-red); }

/* =============================================================================
   TIME CLOCK
   ============================================================================= */

.tc-hero {
  background: var(--c-charcoal); color: #fff; padding: 34px 28px; text-align: center;
  margin-bottom: 24px; border-left: 4px solid var(--c-gray-700);
}
.tc-hero--on { border-left-color: var(--c-red); }
.tc-hero__label {
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--c-gray-300); margin: 0 0 8px;
}
.tc-hero--on .tc-hero__label { color: var(--c-red-bright); }
.tc-hero h1 { font-size: clamp(2rem, 7vw, 3rem); margin: 0 0 6px; color: #fff; }
.tc-hero__sub { color: var(--c-gray-300); margin: 0 0 24px; font-size: 0.92rem; }

/* Four fixed slots. Every action always occupies the same position whatever
   the state, so a button never moves under a thumb between page loads. */
.tc-buttons {
  display: grid; gap: 12px; grid-template-columns: 1fr; max-width: 440px; margin: 0 auto;
}
@media (min-width: 520px) { .tc-buttons { grid-template-columns: 1fr 1fr; } }
.tc-action { display: flex; flex-direction: column; gap: 5px; }

/* Deliberately oversized: these get pressed with gloves on, in daylight. */
.tc-btn {
  display: block; width: 100%; padding: 18px 20px;
  font-family: var(--font-display); font-size: 1.1rem; text-transform: uppercase;
  letter-spacing: 0.06em; font-weight: 600; color: #fff;
  border: 2px solid transparent; cursor: pointer; transition: none;
}
.tc-btn--in { background: var(--c-red); }
.tc-btn--in:hover { background: var(--c-red-dark); box-shadow: var(--glow-red); }
.tc-btn--out { background: transparent; border-color: rgba(255,255,255,0.55); }
.tc-btn--out:hover { border-color: #fff; background: rgba(255,255,255,0.08); }
.tc-btn--break { background: #a4700d; }
.tc-btn--break:hover { background: #7d5509; }
.tc-btn--resume { background: #1c7a3d; }
.tc-btn--resume:hover { background: #14602e; }

/* Not just hidden -- visibly present, visibly unavailable, and it says why.
   Pointer events are off so a stray tap does not even register. */
.tc-btn--disabled,
.tc-btn[disabled] {
  background: transparent; border-color: rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.32); cursor: not-allowed; pointer-events: none;
  box-shadow: none;
}
.tc-btn.is-sending { opacity: 0.6; cursor: progress; }
.tc-btn__why {
  font-size: 0.72rem; line-height: 1.35; color: rgba(255,255,255,0.45);
  text-align: left; padding: 0 2px;
}

.tc-break-banner {
  background: #fff8e6; border-left: 4px solid #a4700d; padding: 14px 16px;
  margin-bottom: 24px; font-size: 0.9rem;
}
.tc-break-banner strong { display: block; margin-bottom: 3px; }

.tc-punch-list { list-style: none; margin: 0; padding: 0; }
.tc-punch-list li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 9px 0; border-top: 1px solid var(--border-subtle); font-size: 0.85rem;
}
.tc-punch-list li:first-child { border-top: 0; }
.tc-punch-list li.is-refused { color: var(--text-muted); }
.tc-punch-list__time { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted); min-width: 118px; }
.tc-punch-list__action { font-weight: 600; min-width: 92px; }
.tc-punch-list__reason { flex: 1 1 100%; font-size: 0.78rem; color: var(--text-muted); }
.tc-equip-form { display: grid; gap: 16px; margin-top: 16px; }
.tc-equip-form .field { margin-bottom: 0; }
.tc-meter-unit { color: var(--text-muted); font-weight: 400; }

/* Equipment recorded on the current shift */
.tc-equip-card { border: 1px solid var(--border-subtle); padding: 16px; margin-bottom: 14px; }
.tc-equip-card:last-child { margin-bottom: 0; }
.tc-equip-card__head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.tc-equip-card__unit strong { display: block; font-family: var(--font-display); font-size: 1.05rem; }
.tc-equip-card__unit span { color: var(--text-muted); font-size: 0.85rem; }
.tc-equip-card__unit:hover strong { color: var(--c-red); }
.tc-equip-card__meter { text-align: right; white-space: nowrap; }
.tc-equip-card__meter strong { display: block; font-family: var(--font-display); font-size: 1.15rem; }
.tc-equip-card__meter span { color: var(--text-muted); font-size: 0.78rem; }
.tc-equip-card__note { margin: 10px 0 0; font-size: 0.88rem; }
.tc-equip-card__warn {
  margin: 10px 0 0; padding: 9px 12px; font-size: 0.82rem;
  background: #fff8e6; border-left: 3px solid #e0a800;
}
.tc-equip-card__clear { margin: 12px 0 0; font-size: 0.88rem; color: var(--text-muted); }
.tc-equip-card__clear .m-badge { margin-right: 8px; }

.tc-due-list { list-style: none; margin: 14px 0 0; padding: 0; }
.tc-due-list li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px 0; border-top: 1px solid var(--border-subtle);
}
.tc-due-list__task { font-weight: 600; font-size: 0.9rem; }
.tc-due-list__detail { color: var(--text-muted); font-size: 0.8rem; flex: 1 1 auto; }

/* History */
.tc-week-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  margin: 26px 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--c-black);
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.05em;
  font-size: 0.82rem;
}
.tc-week-head strong { font-size: 1rem; }
.tc-shift { margin-bottom: 16px; }
.tc-shift__head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.tc-shift__hours { text-align: right; white-space: nowrap; }
.tc-shift__hours strong { display: block; font-family: var(--font-display); font-size: 1.15rem; }
.tc-shift__note { margin: 10px 0 0; font-size: 0.88rem; }
.tc-shift__equip { width: 100%; border-collapse: collapse; margin-top: 12px; }
.tc-shift__equip td {
  padding: 8px 10px 8px 0; border-top: 1px solid var(--border-subtle);
  font-size: 0.86rem; vertical-align: top;
}
.tc-shift__equip .nowrap { white-space: nowrap; color: var(--text-muted); }

/* =============================================================================
   STOCK ROOM / SCANNING
   ============================================================================= */

.sc-scanner { border-left: 4px solid var(--c-red); }
.sc-scan-form .field { margin-bottom: 0; }
.sc-scan-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; }
.sc-scan-row input[type=text] { flex: 1 1 220px; min-width: 0; font-size: 1.05rem; }
.sc-scan-row .btn { white-space: nowrap; }

/* Camera viewfinder, revealed only when BarcodeDetector exists. */
.sc-camera { margin-top: 18px; }
.sc-camera video {
  width: 100%; max-height: 340px; background: var(--c-black);
  object-fit: cover; display: block; border: 2px solid var(--c-red);
}
.sc-camera__bar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  flex-wrap: wrap; background: var(--c-charcoal); color: var(--c-gray-100);
  padding: 10px 14px; font-size: 0.85rem;
}

.sc-part__head {
  display: flex; justify-content: space-between; gap: 20px;
  align-items: flex-start; flex-wrap: wrap; margin-bottom: 18px;
}
.sc-part__number { font-family: var(--font-mono); font-size: 0.85rem; letter-spacing: 0.08em; color: var(--c-red); margin: 0 0 2px; }
.sc-part__head h2 { margin: 0 0 4px; font-size: 1.15rem; }
.sc-part__qty { text-align: right; }
.sc-part__qty strong { display: block; font-family: var(--font-display); font-size: 2.4rem; line-height: 1; }

.sc-move-form {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end;
  padding: 16px; background: var(--c-gray-100); margin-bottom: 20px;
}
.sc-move-form .field { margin-bottom: 0; flex: 1 1 160px; }
.sc-move-form .field--narrow { flex: 0 1 110px; }

.sc-fits { list-style: none; margin: 0; padding: 0; }
.sc-fits li { padding: 9px 0; border-top: 1px solid var(--border-subtle); font-size: 0.9rem; }
.sc-fits a:hover strong { color: var(--c-red); }
.sc-fits .m-muted { margin-left: 8px; }

.sc-orphan-note {
  background: #fff8e6; border-left: 3px solid #a4700d;
  padding: 12px 14px; font-size: 0.88rem; margin-top: 16px;
}
.sc-orphan-note strong { display: block; margin-bottom: 2px; }

.sc-candidates { list-style: none; margin: 0 0 18px; padding: 0; }
.sc-candidates li {
  display: flex; justify-content: space-between; gap: 14px; align-items: baseline;
  padding: 10px 0; border-top: 1px solid var(--border-subtle); flex-wrap: wrap;
}
.sc-candidates a:hover .m-part-number { color: var(--c-red); }

.sc-barcode-list { list-style: none; margin: 0; padding: 0; }
.sc-barcode-list li { padding: 9px 0; border-bottom: 1px solid var(--border-subtle); font-size: 0.86rem; }
.sc-barcode-list li:last-child { border-bottom: 0; }

.sc-recent { list-style: none; margin: 0; padding: 0; }
.sc-recent li { padding: 9px 0; border-top: 1px solid var(--border-subtle); font-size: 0.85rem; }
.sc-recent li:first-child { border-top: 0; }
.sc-recent a { font-family: var(--font-mono); font-weight: 600; }
.sc-recent a:hover { color: var(--c-red); }

.sc-in { color: #146228; font-weight: 700; }
.sc-out { color: #8c1621; font-weight: 700; }

/* On-hand count shown against a part on the machine page. */
.m-part-row-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.m-part-row-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.sc-qty { font-family: var(--font-display); font-size: 1.15rem; white-space: nowrap; }
.sc-qty small { font-family: var(--font-body); font-size: 0.7rem; color: var(--text-muted); font-weight: 400; }
.sc-qty--ok { color: #146228; }
.sc-qty--low { color: #7a4a00; }
.sc-qty--out { color: #8c1621; }

/* =============================================================================
   JOB SITES
   ============================================================================= */

/* Today's dispatch, shown at the top of the clock. Deliberately loud: it is
   the first thing a crew member needs to see. */
.jb-today {
  background: var(--c-charcoal); color: var(--c-gray-100);
  border-left: 4px solid var(--c-red); padding: 22px 24px; margin-bottom: 24px;
}
.jb-today__label {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--c-red-bright); margin: 0 0 6px;
}
.jb-today h2 { color: #fff; font-size: 1.3rem; margin: 0 0 6px; }
.jb-today h3 {
  color: #fff; font-size: 0.8rem; letter-spacing: 0.06em; margin: 0 0 6px;
}
.jb-today__customer { color: var(--c-gray-300); margin: 0 0 14px; font-size: 0.9rem; }
.jb-today__scope {
  background: rgba(255,255,255,0.06); border-left: 3px solid var(--c-red-bright);
  padding: 14px 16px; margin: 18px 0 0;
}
.jb-today__scope p { margin: 0; line-height: 1.65; }
.jb-today__site-notes, .jb-today__equipment {
  margin: 14px 0 0; font-size: 0.88rem; color: var(--c-gray-300);
}
.jb-today__site-notes strong, .jb-today__equipment strong { color: #fff; }
.jb-today__tagged { margin: 16px 0 0; }
.jb-today form { margin-top: 16px; }

/* Directions: one big button plus the other map apps. */
.jb-directions { margin: 0 0 14px; }
.jb-directions__address { margin: 0 0 12px; font-size: 1rem; }
.jb-today .jb-directions__address { color: #fff; }
.jb-directions__go { min-width: 190px; justify-content: center; }
.jb-directions__alts {
  display: inline-flex; flex-wrap: wrap; gap: 14px; margin-left: 14px;
  font-size: 0.82rem;
}
.jb-directions__alts a { text-decoration: underline; color: inherit; opacity: 0.75; }
.jb-directions__alts a:hover { opacity: 1; color: var(--c-red-bright); }
.jb-directions--compact .jb-directions__go { min-width: 0; padding: 8px 16px; font-size: 0.8rem; }
@media (max-width: 540px) {
  .jb-directions__go { display: block; width: 100%; }
  .jb-directions__alts { margin: 12px 0 0; }
}

.jb-contact { margin: 0 0 12px; font-size: 0.92rem; }
.jb-contact__tel { font-weight: 700; text-decoration: underline; }
.jb-today .jb-contact__tel { color: var(--c-red-bright); }

/* Job cards on the crew-facing list */
.jb-card { border: 1px solid var(--border-subtle); padding: 18px; margin-bottom: 14px; }
.jb-card__head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: baseline; }
.jb-card__number { font-family: var(--font-mono); font-size: 0.8rem; color: var(--c-red); }

/* Component type label on a unit's component list. */
.mc-type {
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.05em;
  font-size: 0.75rem; color: var(--c-red);
}

/* Unit photo tile. */
.mu-photo { margin: 0; }
.mu-photo img { width: 100%; height: 120px; object-fit: cover; display: block; border: 1px solid var(--border-subtle); }
.mu-photo figcaption { font-size: 0.78rem; margin-top: 4px; }
.mu-photo form { margin-top: 2px; }
