/* ================================================
   H&S Learning Toolkit — Stylesheet
   ================================================ */

:root {
  --navy:       #1a2e44;
  --navy-light: #243b55;
  --navy-dark:  #111f2e;
  --amber:      #f0a500;
  --amber-dark: #c98800;
  --teal:       #0d9488;
  --teal-dark:  #0f766e;
  --green:      #2d8a4e;
  --red:        #c0392b;
  --orange:     #e67e22;
  --text:       #1a2e44;
  --text-muted: #6b7c93;
  --border:     #d0dae8;
  --bg:         #f4f7fb;
  --bg-card:    #ffffff;
  --sidebar-w:  240px;
  --topbar-h:   72px;
  --radius:     8px;
  --shadow:     0 2px 8px rgba(26,46,68,.10);
  --shadow-md:  0 4px 16px rgba(26,46,68,.15);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* ---- Screens ---- */
.screen { display: none; }
.screen.active { display: block; }
.hidden { display: none !important; }

/* ---- Responsive vars ---- */
@media (min-width: 1200px) {
  :root { --sidebar-w: 240px; }
}

/* ================================================
   LOGIN
   ================================================ */
#screen-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 60%, var(--navy-light) 100%);
  padding: 1.5rem;
}
#screen-login.active { display: flex; }

.login-wrap {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.login-logo { margin-bottom: 1.25rem; }
.login-logo svg { filter: drop-shadow(0 2px 6px rgba(0,0,0,.2)); }

.login-wrap h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: .25rem;
}

.login-sub {
  color: var(--text-muted);
  font-size: .875rem;
  margin-bottom: 2rem;
}

.login-hint {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: 1rem;
}
.login-disclaimer {
  font-size: .74rem;
  color: var(--text-muted);
  margin-top: 1.25rem;
  text-align: center;
  line-height: 1.5;
}
.login-disclaimer a { color: inherit; text-decoration: underline; }
.login-legal {
  font-size: .72rem;
  color: var(--text-muted);
  margin-top: .75rem;
  text-align: center;
  opacity: .7;
}
.login-legal a { color: inherit; text-decoration: underline; }
.btn-link {
  background: none;
  border: none;
  color: var(--amber-dark);
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.field-pass-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.field-pass-wrap input {
  flex: 1;
  padding-right: 2.8rem;
}
.btn-pass-toggle {
  position: absolute;
  right: .6rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: .25rem;
  color: var(--text-muted);
  line-height: 1;
  display: flex;
  align-items: center;
}
.btn-pass-toggle:hover { color: var(--navy); }

.error-msg {
  color: var(--red);
  font-size: .85rem;
  margin-top: .75rem;
}

/* ================================================
   APP LAYOUT
   ================================================ */
#screen-app { display: none; }
#screen-app.active { display: block; }

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1rem;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.topbar-home {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--amber);
  padding: .4rem .6rem .4rem .2rem;
  margin-left: .5rem;
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-shrink: 0;
}
.topbar-home:hover { opacity: .8; }
.topbar-brand {
  font-size: .95rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .01em;
  white-space: nowrap;
}
.topbar-nav-link {
  font-size: .9rem;
  font-weight: 600;
  color: rgba(255,255,255,.8);
  text-decoration: none;
  white-space: nowrap;
  padding: .25rem .5rem;
  border-radius: 4px;
}
.topbar-nav-link:hover { color: #fff; background: rgba(255,255,255,.1); }

.topbar-back {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--text-muted);
  padding: 0 .5rem 0 0;
  line-height: 1;
  flex-shrink: 0;
}
.topbar-back:hover { color: var(--text); }

.topbar-title {
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: .4rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}
.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all .2s;
}

.icon-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: .4rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: background .15s;
}
.icon-btn:hover { background: rgba(255,255,255,.15); }

/* Lock / account dropdown */
.topbar-lock-wrap {
  position: relative;
}
.lock-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0,0,0,.14);
  min-width: 190px;
  z-index: 300;
  overflow: hidden;
}
.lock-menu.hidden { display: none; }
.lock-menu-user {
  padding: .65rem 1rem;
  font-size: .82rem;
  font-weight: 700;
  color: var(--navy);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lock-menu-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  width: 100%;
  padding: .65rem 1rem;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text);
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  text-align: left;
  transition: background .12s;
}
.lock-menu-item:last-child { border-bottom: none; }
.lock-menu-item:hover { background: rgba(26,46,68,.05); }
.lock-menu-item--danger { color: var(--red, #dc2626); }
.lock-menu-item--danger:hover { background: rgba(220,38,38,.06); }

/* Sidebar */
.sidenav {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--navy);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 150;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform .25s ease;
}
.sidenav.open { transform: translateX(0); }

.nav-logo {
  padding: 1.25rem 1.25rem .75rem;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.4);
}

.nav-list { list-style: none; flex: 1; padding-bottom: 1rem; }

.nav-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem 1.25rem;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: .9rem;
  transition: background .15s, color .15s;
  border-left: 3px solid transparent;
}
.nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-link.active {
  background: rgba(240,165,0,.12);
  color: var(--amber);
  border-left-color: var(--amber);
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-divider { height: 1px; background: rgba(255,255,255,.1); margin: .5rem 1rem; }

.nav-group { list-style: none; display: none; }
.nav-group.active { display: block; }

.nav-group-label {
  display: block;
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.4);
  padding: .9rem 1.25rem .3rem;
}

.nav-empty-state {
  position: absolute;
  top: 22%;
  left: 0;
  right: 0;
  transform: translateY(-22%);
  padding: 1.5rem;
  text-align: center;
  color: rgba(255,255,255,.25);
  font-size: .8rem;
  line-height: 1.6;
  pointer-events: none;
}
.nav-empty-state svg { display: block; margin: 0 auto .75rem; opacity: .4; }

.nav-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.45);
  padding: .9rem 1.25rem .4rem;
  gap: .4rem;
}
.nav-group-toggle:hover { color: rgba(255,255,255,.75); }

.nav-group-chevron {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  transition: transform .25s ease;
  transform: rotate(-90deg);
}
.nav-group-toggle.open .nav-group-chevron {
  transform: rotate(0deg);
}

.nav-group-items {
  list-style: none;
}

.nav-footer {
  padding: 1rem 1.25rem;
  font-size: .7rem;
  color: rgba(255,255,255,.3);
  border-top: 1px solid rgba(255,255,255,.08);
}
.nav-footer-link { color: rgba(255,255,255,.5); text-decoration: none; }
.nav-footer-link:hover { color: rgba(255,255,255,.85); text-decoration: underline; }

/* Overlay */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 140;
}

/* Page wrap */
.page-wrap {
  margin-top: var(--topbar-h);
  padding: 1.5rem 1rem;
  min-height: calc(100vh - var(--topbar-h));
  transition: margin-left .25s;
}

/* On large screens: always show sidebar */
@media (min-width: 900px) {
  .sidenav { transform: translateX(0) !important; }
  .menu-toggle { display: none; }
  .page-wrap { margin-left: var(--sidebar-w); padding: 2rem 2.5rem; }
  .nav-overlay { display: none !important; }
}

@media (min-width: 1200px) {
  .page-wrap { margin-left: var(--sidebar-w); }
}

@media (min-width: 1400px) {
  .page-wrap { padding: 2.5rem 3.5rem; }
}

/* ================================================
   PAGE STYLES
   ================================================ */
.page { max-width: 1140px; margin: 0 auto; }

.page-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.page-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--navy);
  flex: 1;
  min-width: 0;
  border-left: 3px solid var(--amber);
  padding-left: .6rem;
}
.subtitle {
  color: var(--text-muted);
  font-size: .875rem;
  width: 100%;
  margin-top: -.75rem;
  margin-bottom: .5rem;
}

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

/* ================================================
   BUTTONS
   ================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1.1rem;
  border-radius: 6px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--amber); color: var(--navy-dark); border-color: var(--amber); }
.btn-primary:hover { background: var(--amber-dark); border-color: var(--amber-dark); }
.btn-outline { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover { background: var(--border); color: var(--text); }
.btn-danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm { padding: .3rem .7rem; font-size: .8rem; }
.btn-full { width: 100%; justify-content: center; }

/* ================================================
   FORMS
   ================================================ */
.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .35rem;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  padding: .6rem .8rem;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: .925rem;
  color: var(--text);
  background: var(--bg-card);
  transition: border-color .15s;
  font-family: inherit;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(240,165,0,.15);
}
.field textarea { resize: vertical; min-height: 80px; }
.field-hint {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: .5rem;
  line-height: 1.4;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr 1fr; } }

/* form-group / form-grid-2 — used by AMP and other card-based forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .8rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: .35rem; }
.form-group input,
.form-group textarea,
.form-group select,
.form-input,
.form-select,
.form-textarea { width: 100%; padding: .6rem .8rem; border: 1.5px solid var(--border); border-radius: 6px; font-size: .925rem; color: var(--text); background: var(--bg-card); transition: border-color .15s; font-family: inherit; }
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus,
.form-input:focus,
.form-select:focus,
.form-textarea:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(240,165,0,.15); }
.form-group textarea,
.form-textarea { resize: vertical; min-height: 80px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .form-grid-2 { grid-template-columns: 1fr; } }
.form-section-title { font-size: .75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; padding-bottom: .5rem; margin-bottom: .75rem; border-bottom: 1px solid var(--border); margin-top: 1.25rem; }
.form-section-title:first-child { margin-top: 0; }

fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  background: var(--bg-card);
}
legend {
  padding: 0 .5rem;
  font-weight: 700;
  font-size: .9rem;
  color: var(--navy);
}

/* ================================================
   DASHBOARD
   ================================================ */

/* Hero welcome banner — split panel */
.dash-hero {
  background: var(--bg);
  color: var(--text);
  border: 2px solid var(--navy);
  border-top: 3px solid var(--amber);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
/* Left: greeting */
.dash-hero-left {
  flex: 1 1 auto;
  padding: .6rem 2rem 0;
  position: relative;
  display: flex;
  flex-direction: column;
}
.dash-hero-brand-tag {
  display: inline-flex;
  align-self: flex-start;
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  background: var(--amber);
  color: var(--navy);
  padding: .2rem .65rem;
  border-radius: 999px;
  margin-bottom: .6rem;
}
.dash-hero-inner {
  margin-top: .9rem;
}
.dash-hero-left-footer {
  margin-top: auto;
  margin-left: -2rem;
  margin-right: -2rem;
  height: 34px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  font-size: .58rem;
  color: var(--text-muted);
  letter-spacing: .04em;
}
/* Right: stat rotator — acts as positioning context */
.dash-hero-right {
  position: relative;
  min-height: 156px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
}
@media (min-width: 640px) {
  .dash-hero { flex-direction: row; }
  .dash-hero-left { flex: 0 0 52%; padding: .6rem 2rem 0; }
  .dash-hero-inner { margin-top: 1.4rem; }
  .dash-hero-right { flex: 1 1 auto; border-top: none; border-left: 1px solid var(--border); min-height: 170px; }
}

/* Workspace summary panel (dashboard right side) */
.dash-hero-right.dash-ws-summary {
  position: static;
  min-height: 0;
  cursor: default;
  display: flex;
  flex-direction: column;
  padding: 0;
  gap: 0;
  overflow: hidden;
}
.dash-ws-summary-body { flex: 1; overflow-y: auto; }
.dash-ws-sum-stat {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem .85rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .12s;
  font-size: .83rem;
  color: var(--text);
}
.dash-ws-sum-stat:hover { background: var(--bg); }
.dash-ws-sum-stat .dash-ws-num { font-weight: 700; font-size: .85rem; color: var(--navy); min-width: 1.5rem; }
.dash-ws-sum-stat .dash-ws-lbl { flex: 1; }
.dash-ws-sum-stat .dash-ws-arrow { color: var(--text-muted); flex-shrink: 0; }
.dash-ws-browse-btn {
  display: block;
  width: 100%;
  padding: .65rem .85rem;
  background: var(--navy);
  color: #fff;
  font-size: .8rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-align: center;
  transition: background .15s;
  flex-shrink: 0;
}
.dash-ws-browse-btn:hover { background: var(--navy-mid); }
.dash-ws-label {
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: .85rem 1rem .25rem;
  flex-shrink: 0;
}
.dash-ws-search-bar {
  padding: .3rem .75rem .5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.dash-ws-search-bar input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .38rem .7rem;
  font-size: .82rem;
  outline: none;
  background: var(--bg);
  color: var(--text);
  box-sizing: border-box;
}
.dash-ws-search-bar input:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 2px rgba(26,46,68,.12);
}
.dash-ws-body {
  overflow-y: auto;
  flex: 1;
  overscroll-behavior: contain;
}
.ws-cat-section { display: block; }
.ws-cat-section.ws-hidden { display: none; }
.ws-cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .42rem .75rem;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  background: var(--bg-subtle, #f5f6f8);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  user-select: none;
  position: sticky;
  top: 0;
  z-index: 1;
}
.ws-cat-header:hover { background: var(--border); }
.ws-cat-count {
  font-size: .68rem;
  background: var(--border);
  border-radius: 999px;
  padding: .1rem .4rem;
  color: var(--text-muted);
}
.ws-cat-tools { display: block; }
.ws-cat-tools.collapsed { display: none; }
.ws-pinned .ws-cat-header { display: none; }
.dash-ws-stat {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem .75rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .12s;
}
.dash-ws-stat:last-child { border-bottom: none; }
.dash-ws-stat:hover { background: rgba(26,46,68,.05); }
.dash-ws-stat.ws-hidden { display: none; }
.dash-ws-num {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--navy);
  line-height: 1;
  min-width: 2rem;
  text-align: right;
}
.dash-ws-lbl {
  flex: 1;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-muted);
}
.dash-ws-arrow {
  color: var(--text-muted);
  flex-shrink: 0;
}
.dash-ws-stat:hover .dash-ws-arrow { color: var(--navy); }
@media (min-width: 640px) {
  .dash-hero-right.dash-ws-panel {
    border-top: none;
    border-left: 1px solid var(--border);
    height: 480px;
  }
}

.dash-hero-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  position: relative;
}
.dash-hero-avatar {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--amber);
  color: #1a2e44;
  font-size: 1.6rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: -.01em;
  box-shadow: 0 0 0 4px rgba(240,165,0,.25);
}
.dash-hero-text { flex: 1; min-width: 0; }
.dash-hero-greeting {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: .4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--navy);
}
.dash-hero-date {
  font-size: .85rem;
  font-weight: 400;
  color: var(--text-muted);
}
.dash-hero-org {
  font-size: .78rem;
  font-weight: 500;
  margin-top: .2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-muted);
}
.dash-hero-prompt {
  margin-top: .75rem;
  margin-bottom: 0;
  font-size: .78rem;
  opacity: .65;
}
/* Dashboard context panel (replaces greeting) */
.dash-context {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .35rem;
  padding: .5rem 0 .75rem;
}
.dash-ctx-label {
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
}
.dash-ctx-date {
  font-size: .82rem;
  color: var(--text-muted);
}
.dash-ctx-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: .2rem 0;
}
.dash-ctx-icon { color: var(--navy); flex-shrink: 0; }
.dash-ctx-meta { flex: 1; min-width: 0; }
.dash-ctx-type {
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--amber);
}
.dash-ctx-title {
  font-size: .98rem;
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-ctx-continue {
  display: inline-flex;
  align-self: flex-start;
  font-size: .78rem;
  font-weight: 600;
  color: var(--navy);
  border: 1.5px solid var(--navy);
  border-radius: 6px;
  padding: .28rem .75rem;
  background: transparent;
  cursor: pointer;
  transition: background .15s, color .15s;
  margin-top: .1rem;
}
.dash-ctx-continue:hover { background: var(--navy); color: #fff; }
.dash-ctx-org {
  font-size: .72rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0 2rem .6rem;
}
.dash-ctx-suggestions {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: .2rem;
}
.dash-ctx-btn {
  text-align: left;
  font-size: .82rem;
  font-weight: 600;
  color: var(--navy);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: .4rem 0;
  cursor: pointer;
  transition: color .15s;
}
.dash-ctx-btn:last-child { border-bottom: none; }
.dash-ctx-btn:hover { color: var(--amber); }

/* Resume last-page label */
.dash-ctx-page-resume {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--navy);
  margin: .2rem 0 .6rem;
  line-height: 1.25;
}

/* Alert strip (open near misses / due reviews) */
.dash-alerts-strip { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .75rem; }
.dash-alert {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 1rem;
  border-radius: var(--radius);
  font-size: .84rem;
  line-height: 1.3;
}
.dash-alert--amber { background: #fff8e6; border: 1px solid #f0a50066; color: #7a4a00; }
.dash-alert--blue  { background: #e8f4fd; border: 1px solid #0891b255; color: #065a80; }
.dash-alert > div  { flex: 1; }
.dash-alert svg    { flex-shrink: 0; }
.dash-alert-btn {
  background: none;
  border: none;
  font-weight: 700;
  font-size: .8rem;
  cursor: pointer;
  white-space: nowrap;
  padding: 0;
}
.dash-alert--amber .dash-alert-btn { color: #a36200; }
.dash-alert--blue   .dash-alert-btn { color: #0891b2; }
.dash-alert--backup { background: #f0fdf4; border: 1px solid #16a34a55; color: #14532d; }
.dash-alert--backup .dash-alert-btn { color: #16a34a; }
.dash-alert--red { background: #fef2f2; border: 1px solid #dc262655; color: #7f1d1d; }
.dash-alert--red .dash-alert-btn { color: #dc2626; }

/* ── Committed record banner ─────────────────────────────────────────────── */
.record-committed-banner {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  background: #ecfdf5;
  border: 1px solid #16a34a55;
  border-radius: var(--radius);
  padding: .85rem 1.1rem;
  margin-bottom: 1.25rem;
  font-size: .87rem;
  color: #14532d;
  line-height: 1.45;
}
.record-committed-banner svg { flex-shrink: 0; margin-top: .1rem; stroke: #16a34a; }
.btn-commit {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1.1rem;
  background: #92400e;
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: .87rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-commit:hover { background: #78350f; }

/* ── Follow-up notes ─────────────────────────────────────────────────────── */
.record-followup-section { margin-top: 2rem; padding-top: 1.5rem; border-top: 2px solid var(--border); }
.followup-heading { font-size: 1rem; font-weight: 700; color: var(--text-main); margin-bottom: 1rem; }
.followup-note { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem; margin-bottom: .75rem; }
.followup-note-meta { font-size: .78rem; color: var(--text-muted); margin-bottom: .35rem; }
.followup-note-text { font-size: .9rem; line-height: 1.5; white-space: pre-wrap; }
.followup-empty { font-size: .87rem; color: var(--text-muted); margin-bottom: .75rem; }
.followup-add { display: flex; flex-direction: column; gap: .5rem; margin-top: .75rem; }
.followup-add .btn { align-self: flex-start; }

/* Onboarding modal */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .75);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
  overflow-y: auto;
}
.onboarding-modal {
  background: #fff;
  border-radius: 12px;
  padding: 2rem 2rem;
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  max-width: 660px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.onboarding-logo { font-weight: 800; font-size: 1rem; color: #1a2e44; margin-bottom: 1rem; }
.onboarding-title { font-size: 1.2rem; font-weight: 800; color: #1a2e44; margin-bottom: 1.25rem; line-height: 1.3; }
.onboarding-items { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.5rem; }
.onboarding-item { display: flex; gap: .9rem; align-items: flex-start; }
.onboarding-item-icon { width: 22px; height: 22px; flex-shrink: 0; color: #1a2e44; margin-top: .1rem; }
.onboarding-item strong { display: block; font-size: .9rem; color: #1a2e44; margin-bottom: .2rem; }
.onboarding-item p { font-size: .82rem; color: #6b7280; line-height: 1.55; margin: 0; }
.onboarding-check-label {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  background: #fef9ec;
  border: 1px solid #f0a50055;
  border-radius: 8px;
  padding: .85rem 1rem;
  margin-bottom: 1.25rem;
  cursor: pointer;
}
.onboarding-check-label input { margin-top: .2rem; flex-shrink: 0; width: 16px; height: 16px; accent-color: #1a2e44; }
.onboarding-check-label span { font-size: .82rem; color: #374151; line-height: 1.6; }
.onboarding-btn { width: 100%; }

/* Mobile warning banner on login screen */
.mobile-warning-banner {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  background: #fffbeb;
  border: 1px solid #f0a500;
  border-radius: 8px;
  padding: .85rem 1rem;
  margin-bottom: 1.25rem;
  font-size: .85rem;
  line-height: 1.5;
  color: #374151;
}
.mobile-warning-banner svg { flex-shrink: 0; color: #f0a500; margin-top: .15rem; }
.mobile-warning-banner strong { display: block; color: #1a2e44; margin-bottom: .2rem; font-size: .88rem; }
.mobile-warning-banner p { margin: 0; color: #6b7280; }
.mobile-warning-banner > div { flex: 1; }
.mobile-warning-dismiss {
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  font-size: 1rem;
  padding: 0;
  flex-shrink: 0;
  line-height: 1;
}
.mobile-warning-dismiss:hover { color: #374151; }

/* Video of the Day card */
.dash-vid-day { padding: 1rem 1.25rem; margin-bottom: 0; }
.dash-vid-day-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--navy);
  margin: .5rem 0 .35rem;
  line-height: 1.35;
}
.dash-vid-day-desc {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: .75rem;
}

/* HSE Stat of the Day */
.dash-stat-day {
  background: var(--navy);
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
  margin-bottom: 1rem;
  color: #fff;
}
.dash-stat-day-num {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: .35rem;
}
.dash-stat-day-stmt { font-size: .9rem; line-height: 1.4; opacity: .9; margin-bottom: .2rem; }
.dash-stat-day-sub  { font-size: .76rem; opacity: .6; font-style: italic; }
.dash-settings-link {
  background: none;
  border: none;
  cursor: pointer;
  font-size: inherit;
  padding: 0;
  color: var(--amber);
  text-decoration: underline;
}

/* Section label */
.dash-section-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--text-muted);
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.dash-section-label::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 13px;
  background: var(--amber);
  border-radius: 2px;
  flex-shrink: 0;
}

/* Stats strip */
.stats-strip {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}
.stats-strip-item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .9rem 1rem;
  border-right: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
  min-width: 0;
}
.stats-strip-item:last-child { border-right: none; }
.stats-strip-item:hover { background: var(--bg); }
.stats-strip-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stats-strip-icon svg { width: 20px; height: 20px; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stats-strip-body { min-width: 0; }
.stats-strip-num { display: block; font-size: 1.6rem; font-weight: 800; line-height: 1; }
.stats-strip-label { display: block; font-size: .68rem; color: var(--text-muted); margin-top: .2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats-strip-item--ra    .stats-strip-icon { background: rgba(26,46,68,.1);   color: #1a2e44; }
.stats-strip-item--ra    .stats-strip-num  { color: #1a2e44; }
.stats-strip-item--nm    .stats-strip-icon { background: rgba(230,126,34,.13); color: #e67e22; }
.stats-strip-item--nm    .stats-strip-num  { color: #e67e22; }
.stats-strip-item--notes .stats-strip-icon { background: rgba(22,163,74,.11); color: #16a34a; }
.stats-strip-item--notes .stats-strip-num  { color: #15803d; }
@media (max-width: 380px) {
  .stats-strip { flex-direction: column; }
  .stats-strip-item { border-right: none; border-bottom: 1px solid var(--border); }
  .stats-strip-item:last-child { border-bottom: none; }
}

/* Quick action grid */
.qa-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .65rem;
  margin-bottom: 1.25rem;
}
@media (min-width: 500px) { .qa-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .qa-grid { grid-template-columns: repeat(4, 1fr); } }

.qa-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: .9rem .65rem .75rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .45rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--navy);
  text-align: center;
  transition: border-color .15s, box-shadow .15s, transform .12s;
  box-shadow: var(--shadow);
}
.qa-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
@media (min-width: 500px) { .qa-card { padding: 1.1rem .75rem .9rem; gap: .55rem; font-size: .8rem; } }

.qa-icon-wrap {
  width: 40px; height: 40px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  transition: transform .12s;
}
.qa-card:hover .qa-icon-wrap { transform: scale(1.08); }
.qa-icon-wrap svg { width: 20px; height: 20px; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (min-width: 500px) { .qa-icon-wrap { width: 44px; height: 44px; border-radius: 12px; } .qa-icon-wrap svg { width: 22px; height: 22px; } }

/* Per-card accent colours */
.qa-card--ra    { border-top: 3px solid #1a2e44; }
.qa-card--ra    .qa-icon-wrap { background: rgba(26,46,68,.14); }
.qa-card--ra    .qa-icon-wrap svg { stroke: #1a2e44; }
.qa-card--ra:hover { border-color: #1a2e44; background: rgba(26,46,68,.025); }

.qa-card--riddor { border-top: 3px solid #dc2626; }
.qa-card--riddor .qa-icon-wrap { background: rgba(220,38,38,.13); }
.qa-card--riddor .qa-icon-wrap svg { stroke: #dc2626; }
.qa-card--riddor:hover { border-color: #dc2626; background: rgba(220,38,38,.025); }

.qa-card--note  { border-top: 3px solid #16a34a; }
.qa-card--note  .qa-icon-wrap { background: rgba(22,163,74,.14); }
.qa-card--note  .qa-icon-wrap svg { stroke: #16a34a; }
.qa-card--note:hover { border-color: #16a34a; background: rgba(22,163,74,.025); }

.qa-card--ref   { border-top: 3px solid #7c3aed; }
.qa-card--ref   .qa-icon-wrap { background: rgba(124,58,237,.13); }
.qa-card--ref   .qa-icon-wrap svg { stroke: #7c3aed; }
.qa-card--ref:hover { border-color: #7c3aed; background: rgba(124,58,237,.025); }

.qa-card--hub   { border-top: 3px solid #0891b2; }
.qa-card--hub   .qa-icon-wrap { background: rgba(8,145,178,.14); }
.qa-card--hub   .qa-icon-wrap svg { stroke: #0891b2; }
.qa-card--hub:hover { border-color: #0891b2; background: rgba(8,145,178,.025); }

.qa-card--nm    { border-top: 3px solid #e67e22; }
.qa-card--nm    .qa-icon-wrap { background: rgba(230,126,34,.14); }
.qa-card--nm    .qa-icon-wrap svg { stroke: #e67e22; }
.qa-card--nm:hover { border-color: #e67e22; background: rgba(230,126,34,.025); }

.qa-card--video { border-top: 3px solid #f0a500; }
.qa-card--video .qa-icon-wrap { background: rgba(240,165,0,.1); }
.qa-card--video .qa-icon-wrap svg { stroke: #b45309; }
.qa-card--video:hover { border-color: #f0a500; }

/* Near miss list */
.nm-info-card { display: flex; gap: 1rem; align-items: flex-start; }
.nm-info-icon { flex-shrink: 0; width: 40px; height: 40px; border-radius: 10px; background: rgba(230,126,34,.12); color: #e67e22; display: flex; align-items: center; justify-content: center; }
.nm-info-body { display: flex; flex-direction: column; gap: .3rem; }
.nm-info-title { font-size: .95rem; color: var(--text); }
.nm-info-text { margin: 0; font-size: .875rem; color: var(--text-muted); line-height: 1.6; }
.nm-riddor-link { display: inline-flex; align-items: center; gap: .25rem; font-size: .8rem; color: var(--navy); font-weight: 600; text-decoration: none; }
.nm-riddor-link:hover { text-decoration: underline; }

/* Near miss cards */
.nm-card { display: flex; align-items: stretch; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; cursor: pointer; transition: box-shadow .15s, border-color .15s; margin-bottom: .5rem; }
.nm-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.08); border-color: var(--navy); }
.nm-card-accent { width: 5px; flex-shrink: 0; }
.nm-accent--none     { background: var(--border); }
.nm-accent--minor    { background: #2d8a4e; }
.nm-accent--moderate { background: #e67e22; }
.nm-accent--serious  { background: #d35400; }
.nm-accent--critical { background: #c0392b; }
.nm-accent--fatal    { background: #7b1c1c; }
.nm-card-content { flex: 1; padding: .75rem 1rem; display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.nm-card-header { display: flex; align-items: flex-start; gap: .5rem; }
.nm-card-title { flex: 1; font-weight: 600; font-size: .95rem; color: var(--text); min-width: 0; }
.nm-card-meta { font-size: .8rem; color: var(--text-muted); }
.nm-card-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .15rem; }

/* Near miss badges */
.nm-badge { display: inline-block; font-size: .7rem; font-weight: 700; padding: 2px 7px; border-radius: 4px; color: #fff; }
.nm-badge--riddor { background: #c0392b; }
.nm-badge--check  { background: #e67e22; }

.nm-cat-badge { display: inline-block; font-size: .7rem; font-weight: 600; padding: 2px 7px; border-radius: 4px; background: rgba(26,46,68,.08); color: var(--navy); border: 1px solid rgba(26,46,68,.15); }

.nm-sev-badge { display: inline-block; font-size: .7rem; font-weight: 700; padding: 2px 7px; border-radius: 4px; color: #fff; }
.nm-sev--minor    { background: #2d8a4e; }
.nm-sev--moderate { background: #e67e22; }
.nm-sev--serious  { background: #d35400; }
.nm-sev--critical { background: #c0392b; }
.nm-sev--fatal    { background: #7b1c1c; }

.nm-status-badge { display: inline-block; font-size: .7rem; font-weight: 600; padding: 2px 7px; border-radius: 4px; }
.nm-status--open        { background: rgba(26,46,68,.08); color: var(--navy); border: 1px solid rgba(26,46,68,.2); }
.nm-status--in_progress { background: rgba(240,165,0,.15); color: #92610a; border: 1px solid rgba(240,165,0,.35); }
.nm-status--closed      { background: rgba(45,138,78,.12); color: #1d5c34; border: 1px solid rgba(45,138,78,.3); }
.nm-status--reviewed    { background: rgba(45,183,166,.12); color: #197a6e; border: 1px solid rgba(45,183,166,.3); }

/* Near miss empty state */
.nm-empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 2.5rem 1rem; gap: .75rem; }
.nm-empty-icon { width: 72px; height: 72px; border-radius: 50%; background: rgba(230,126,34,.1); color: #e67e22; display: flex; align-items: center; justify-content: center; }
.nm-empty-title { margin: 0; font-size: 1.1rem; font-weight: 700; color: var(--text); }
.nm-empty-body { margin: 0; font-size: .9rem; color: var(--text-muted); line-height: 1.65; max-width: 420px; }
.nm-empty-cta { margin-top: .5rem; }
.nm-feature-chips { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; margin-top: .25rem; }
.nm-feature-chip { font-size: .72rem; font-weight: 600; padding: .22rem .6rem; border-radius: 20px; background: rgba(26,46,68,.07); color: var(--text-muted); letter-spacing: .01em; }

/* ── Contents / Sitemap ── */
.contents-sections { display: flex; flex-direction: column; gap: 1.5rem; margin-top: 1rem; }
.contents-group-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: .5rem; padding-bottom: .35rem; border-bottom: 1px solid var(--border); }
.contents-group-items { display: flex; flex-direction: column; gap: .35rem; }
.contents-item { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; text-align: left; transition: border-color .15s, box-shadow .15s; width: 100%; }
.contents-item:hover { border-color: var(--navy); box-shadow: 0 2px 8px rgba(26,46,68,.08); }
.contents-item-title { font-weight: 700; font-size: .92rem; color: var(--navy); flex: 0 0 auto; min-width: 160px; }
.contents-item-desc { font-size: .82rem; color: var(--text-muted); line-height: 1.45; flex: 1; }
.contents-item-arrow { font-size: .85rem; color: var(--text-muted); flex-shrink: 0; margin-left: auto; }
@media (max-width: 600px) {
  .contents-item { flex-wrap: wrap; }
  .contents-item-title { min-width: auto; width: 100%; margin-bottom: .15rem; }
  .contents-item-arrow { display: none; }
}

/* ── Stat rotator (slides live inside .dash-hero-right) ── */
.dash-rotator-brand {
  position: absolute;
  top: .85rem;
  right: 1rem;
  font-size: .58rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: .03em;
  pointer-events: none;
  z-index: 1;
  opacity: .6;
}
.dash-rotator-brand span { color: var(--amber-dark); }

.dash-rotator-slide {
  position: absolute;
  inset: 0;
  bottom: 36px;
  padding: .6rem .9rem 1rem;
  opacity: 0;
  transition: opacity .5s ease;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  z-index: 1;
}
.dash-rotator-slide.active { opacity: 1; pointer-events: auto; }

.dash-rotator-tag {
  display: inline-flex;
  align-self: flex-start;
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  background: var(--accent, rgba(255,255,255,.2));
  color: #fff;
  padding: .2rem .6rem;
  border-radius: 999px;
  opacity: .9;
}
.dash-rotator-body {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex: 1;
}
.dash-rotator-num {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 900;
  color: var(--numcol, #fff);
  line-height: 1;
  letter-spacing: -.03em;
  flex-shrink: 0;
  white-space: nowrap;
}
.dash-rotator-text { min-width: 0; }
.dash-rotator-stmt {
  font-size: .83rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.4;
  margin-bottom: .25rem;
}
.dash-rotator-sub {
  font-size: .7rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.dash-rotator-nav {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 34px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  z-index: 2;
}
.dash-rotator-source {
  font-size: .58rem;
  color: var(--text-muted);
  letter-spacing: .03em;
}
.dash-rotator-controls {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.dash-rotator-arrow {
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  border-radius: 4px;
  transition: color .15s, background .15s;
}
.dash-rotator-arrow:hover { color: var(--navy); background: rgba(26,46,68,.08); }
.dash-rotator-dots {
  display: flex;
  align-items: center;
  gap: .35rem;
}
.dash-rotator-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(26,46,68,.2);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background .3s, width .3s, border-radius .3s;
}
.dash-rotator-dot.active {
  background: var(--navy);
  width: 16px;
  border-radius: 3px;
}

/* ── HSE news gateway cards ───────────────────── */
.dash-news-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .75rem;
  margin-bottom: 1.5rem;
}
@media (min-width: 540px) { .dash-news-grid { grid-template-columns: repeat(3, 1fr); } }

.dash-news-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.1rem 1rem;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s, transform .12s;
  width: 100%;
}
.dash-news-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.dash-news-cat {
  display: inline-block;
  align-self: flex-start;
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: #fff;
  padding: .2rem .6rem;
  border-radius: 999px;
}
.dash-news-headline {
  font-size: .88rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.35;
}
.dash-news-desc {
  font-size: .75rem;
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
}
.dash-news-link {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .72rem;
  font-weight: 600;
  color: var(--navy);
  margin-top: .2rem;
}

/* ── Workspace divider ───────────────────────── */
.dash-workspace-divider {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin: .25rem 0 1.25rem;
}
.dash-workspace-divider::before,
.dash-workspace-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.dash-workspace-divider span {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Study tip card */
.dash-tip { margin-top: 1.25rem; margin-bottom: 1.25rem; border-left: 3px solid var(--amber); }
.dash-tip-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.dash-tip-label { display: flex; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--amber-dark); }
.dash-tip-refresh { display: inline-flex; align-items: center; gap: .3rem; background: none; border: 1px solid var(--border); border-radius: 4px; padding: .2rem .55rem; font-size: .72rem; color: var(--text-muted); cursor: pointer; transition: border-color .15s, color .15s; }
.dash-tip-refresh:hover { border-color: var(--navy); color: var(--navy); }
.dash-tip-section { font-size: .7rem; color: var(--text-muted); margin-bottom: .25rem; }
.dash-tip-term { font-size: .9rem; font-weight: 700; color: var(--navy-dark); margin-bottom: .35rem; }
.dash-tip-def { font-size: .82rem; color: var(--text); line-height: 1.6; }

/* ================================================
   HOME / LANDING PAGE
   ================================================ */

.home-hero {
  background: var(--bg);
  color: var(--text);
  border: 2px solid var(--navy);
  border-top: 3px solid var(--amber);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.75rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}
.home-hero-left {
  padding: 2rem 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .65rem;
  position: relative;
}
.home-hero-tag {
  display: inline-flex;
  align-self: flex-start;
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  background: var(--amber);
  color: var(--navy);
  padding: .25rem .75rem;
  border-radius: 999px;
}
.home-hero-greeting {
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-muted);
}
.home-hero-title {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -.02em;
  color: var(--navy);
}
.home-hero-sub {
  font-size: .85rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 420px;
}
.home-hero-right {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  position: relative;
}
.home-hero-stat-label {
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-muted);
}
.home-hero-stat-num {
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.04em;
}
.home-hero-stat-tag {
  display: inline-flex;
  align-self: flex-start;
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #fff;
  padding: .2rem .65rem;
  border-radius: 999px;
}
.home-hero-stat-stmt {
  font-size: .88rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.45;
}
.home-hero-stat-sub {
  font-size: .72rem;
  color: var(--text-muted);
  line-height: 1.45;
}
@media (min-width: 640px) {
  .home-hero { flex-direction: row; }
  .home-hero-left { flex: 1 1 55%; padding: 2.25rem 2.5rem 2rem; }
  .home-hero-right { flex: 0 0 45%; border-top: none; border-left: 1px solid var(--border); }
}

/* Section label */
.home-section-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--text-muted);
  margin-bottom: .9rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.home-section-label::before {
  content: '';
  display: inline-block;
  width: 3px; height: 13px;
  background: var(--teal);
  border-radius: 2px;
  flex-shrink: 0;
}

/* Three pathway cards */
.home-paths {
  display: grid;
  grid-template-columns: 1fr;
  gap: .85rem;
  margin-bottom: 1.75rem;
}
@media (min-width: 560px) { .home-paths { grid-template-columns: repeat(3, 1fr); } }

.home-profile-nudge { margin-bottom: 1.25rem; padding: .85rem 1rem; border-left: 3px solid var(--primary); }
.home-profile-nudge-inner { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.home-profile-nudge-inner svg { flex-shrink: 0; color: var(--primary); }
.home-profile-nudge-inner > div { flex: 1; min-width: 0; }
.home-profile-nudge-inner strong { display: block; font-size: .88rem; margin-bottom: .15rem; }
.home-profile-nudge-inner span { font-size: .82rem; color: var(--text-muted); }
.home-profile-nudge-btn { font-size: .82rem; padding: .35rem .85rem; white-space: nowrap; }
.home-profile-nudge-dismiss { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 1rem; padding: .2rem .4rem; line-height: 1; flex-shrink: 0; }

.home-path {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem 1.2rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  text-align: left;
  transition: box-shadow .15s, transform .12s, border-color .15s;
  box-shadow: var(--shadow);
}
.home-path:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.home-path-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: .4rem;
  transition: transform .15s;
}
.home-path:hover .home-path-icon { transform: scale(1.1); }
.home-path-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.home-path-title { font-size: 1rem; font-weight: 700; color: var(--navy); }
.home-path-desc { font-size: .8rem; color: var(--text-muted); line-height: 1.6; flex: 1; }
.home-path-cta { display: flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 700; margin-top: .2rem; }

.home-path--study { border-top: 3px solid var(--teal); }
.home-path--study .home-path-icon { background: rgba(13,148,136,.15); color: var(--teal); }
.home-path--study .home-path-cta { color: var(--teal); }
.home-path--study:hover { border-color: var(--teal); box-shadow: 0 4px 16px rgba(13,148,136,.15); }

.home-path--ref { border-top: 3px solid var(--amber); }
.home-path--ref .home-path-icon { background: rgba(240,165,0,.15); color: #c98800; }
.home-path--ref .home-path-cta { color: #c98800; }
.home-path--ref:hover { border-color: var(--amber); box-shadow: 0 4px 16px rgba(240,165,0,.15); }

.home-path--tools { border-top: 3px solid var(--navy); }
.home-path--tools .home-path-icon { background: rgba(26,46,68,.1); color: var(--navy); }
.home-path--tools .home-path-cta { color: var(--navy); }
.home-path--tools:hover { border-color: var(--navy); box-shadow: 0 4px 16px rgba(26,46,68,.12); }

/* Two-column lower section */
.home-two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: .85rem;
  margin-bottom: 1.5rem;
}
@media (min-width: 640px) { .home-two-col { grid-template-columns: 3fr 2fr; align-items: start; } }

.home-topic { padding: 1.5rem; }
.home-topic-eyebrow {
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--teal);
  margin-bottom: .5rem;
}
.home-topic-section { font-size: .72rem; color: var(--text-muted); margin-bottom: .2rem; }
.home-topic-term { font-size: 1.05rem; font-weight: 800; color: var(--navy); margin-bottom: .5rem; }
.home-topic-def { font-size: .82rem; color: var(--text); line-height: 1.65; margin-bottom: 1rem; }
.home-topic-link {
  background: none; border: none; cursor: pointer;
  font-size: .78rem; font-weight: 700; color: var(--teal);
  padding: 0;
}
.home-topic-link:hover { color: var(--teal-dark); text-decoration: underline; }

.home-news-card {
  background: linear-gradient(135deg, #1a2e44 0%, #1e3a58 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.5rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  text-align: left;
  border: none;
  width: 100%;
  transition: opacity .15s;
  box-shadow: var(--shadow-md);
}
.home-news-card:hover { opacity: .92; }
.home-news-eyebrow {
  display: flex; align-items: center; gap: .4rem;
  font-size: .62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--amber);
}
.home-news-title { font-size: .95rem; font-weight: 700; line-height: 1.4; }
.home-news-desc { font-size: .78rem; opacity: .6; line-height: 1.55; flex: 1; }
.home-news-cta { font-size: .78rem; font-weight: 700; color: var(--amber); }
.home-news-live {
  font-size: .75rem; opacity: .75; line-height: 1.45;
  border-top: 1px solid rgba(255,255,255,.12);
  padding-top: .65rem; margin-top: .1rem;
  display: flex; align-items: flex-start; gap: .45rem;
}
.home-news-live:empty { display: none; }
.home-news-live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--amber); flex-shrink: 0; margin-top: .32em;
}

/* Recent activity list */
.recent-list { display: flex; flex-direction: column; gap: .5rem; }
.recent-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .7rem 1rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  cursor: pointer;
  transition: border-color .15s;
}
.recent-item:hover { border-color: var(--amber); }
.recent-item-icon { color: var(--navy); flex-shrink: 0; opacity: .7; }
.recent-item-body { flex: 1; min-width: 0; }
.recent-item-title { font-weight: 600; font-size: .875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-item-meta { font-size: .75rem; color: var(--text-muted); }
.recent-item-arrow { color: var(--text-muted); flex-shrink: 0; }
.empty-state { color: var(--text-muted); font-size: .875rem; text-align: center; padding: 2rem; }

.dash-activity-empty { display: flex; align-items: flex-start; gap: 1rem; background: var(--bg-card); border: 1px dashed var(--border); border-radius: 10px; padding: 1.1rem 1.25rem; }
.dash-activity-empty-icon { flex-shrink: 0; width: 44px; height: 44px; border-radius: 10px; background: rgba(26,46,68,.07); color: var(--navy); display: flex; align-items: center; justify-content: center; opacity: .7; }
.dash-activity-empty-body { flex: 1; }
.dash-activity-empty-body strong { display: block; font-size: .9rem; color: var(--text); margin-bottom: .3rem; }
.dash-activity-empty-body p { margin: 0; font-size: .83rem; color: var(--text-muted); line-height: 1.55; }

/* ================================================
   HSE LIBRARY
   ================================================ */
.search-bar { margin-bottom: 1rem; }

/* Sticky search + filter bar — pins below topbar while scrolling long lists */
.sticky-controls {
  position: sticky;
  top: var(--topbar-h);
  z-index: 20;
  background: var(--bg);
  padding: .6rem 0 .25rem;
  margin: 0 -1rem;
  padding-left: 1rem;
  padding-right: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
}
.sticky-controls .search-bar { margin-bottom: .6rem; }
.sticky-controls .series-tabs { margin-bottom: 0; }
.search-bar input {
  width: 100%;
  padding: .7rem 1rem .7rem 2.5rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .925rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: .8rem center;
}
.search-bar input:focus { outline: none; border-color: var(--amber); }
.voice-search-btn { background: none; border: none; padding: .3rem; color: var(--text-muted); cursor: pointer; border-radius: 4px; display: flex; align-items: center; justify-content: center; transition: color .15s; flex-shrink: 0; }
.voice-search-btn:not(.vs-inline) { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); }
.voice-search-btn:hover { color: var(--navy); }
.voice-search-btn.listening { color: #cc0000; animation: voice-pulse .8s ease-in-out infinite; }
@keyframes voice-pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

/* HSE Library intro card */
.lib-intro-card {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--navy);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  margin-bottom: 1.1rem;
  font-size: .82rem;
}
.lib-intro-icon {
  color: var(--navy);
  flex-shrink: 0;
  margin-top: .1rem;
}
.lib-intro-title {
  font-weight: 700;
  color: var(--navy);
  margin-bottom: .25rem;
  font-size: .82rem;
}
.lib-intro-text { color: var(--text-muted); line-height: 1.5; }
.lib-intro-text a { color: var(--navy); }

.series-tabs {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.series-tab {
  padding: .35rem .85rem;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  transition: all .15s;
}
.series-tab.active { background: var(--amber); color: var(--navy-dark); border-color: var(--amber); }
.series-tab:hover:not(.active) { border-color: var(--navy); color: var(--navy); }
.series-tab-count { font-size: .68rem; font-weight: 700; opacity: .65; margin-left: .2rem; }

.series-banner {
  padding: .9rem 1.1rem;
  border-radius: var(--radius);
  font-size: .875rem;
  line-height: 1.55;
  margin-bottom: 1rem;
  border-left: 4px solid;
}
.banner-acop   { background: #fff8e1; border-color: var(--amber); color: #5a4000; }
.banner-regs   { background: #e8f0fe; border-color: #3b6bbf; color: #1a3060; }
.banner-topics { background: #e8f5e9; border-color: var(--green); color: #1a4a2a; }
.banner-indg   { background: #f3f4f6; border-color: var(--text-muted); color: var(--text); }
.banner-hsg    { background: #f3f4f6; border-color: var(--text-muted); color: var(--text); }
.series-banner strong { display: block; margin-bottom: .35rem; font-size: .9rem; }

.pub-list { display: flex; flex-direction: column; gap: .5rem; }

@media (min-width: 900px) {
  .pub-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
    align-items: start;
  }
}

.pub-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .9rem 1.1rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: .75rem;
  box-shadow: var(--shadow);
}
.pub-code {
  font-size: .75rem;
  font-weight: 800;
  color: var(--amber-dark);
  background: rgba(240,165,0,.1);
  padding: .2rem .5rem;
  border-radius: 4px;
  white-space: nowrap;
  margin-top: 2px;
}
.pub-count { font-size: .78rem; color: var(--text-muted); margin: .25rem 0 .6rem; }
.pub-hl { background: #fff3b0; color: inherit; padding: 0 1px; border-radius: 2px; font-style: normal; }
.pub-subj-badge { display: inline-block; font-size: .68rem; font-weight: 600; padding: .1rem .4rem; border-radius: 3px; background: rgba(26,46,68,.08); color: var(--navy); border: 1px solid rgba(26,46,68,.15); margin-bottom: .25rem; }
.pub-title { font-weight: 600; font-size: .9rem; color: var(--navy); }
.pub-desc { font-size: .8rem; color: var(--text-muted); margin-top: .2rem; }
.pub-topics-expand { margin-top: .45rem; }
.pub-topics-expand summary { font-size: .75rem; font-weight: 600; color: var(--navy); opacity: .65; cursor: pointer; user-select: none; list-style: none; display: inline-flex; align-items: center; gap: .3rem; }
.pub-topics-expand summary::after { content: '▾'; font-size: .65rem; transition: transform .15s; }
.pub-topics-expand[open] summary::after { transform: rotate(-180deg); }
.pub-topics-expand summary::-webkit-details-marker { display: none; }
.pub-topics-expand summary:hover { opacity: 1; color: var(--amber-dark); }
.pub-topics-list { margin: .4rem 0 .1rem .9rem; padding: 0; list-style: disc; }
.pub-topics-list li { font-size: .78rem; color: var(--text-muted); line-height: 1.5; padding: .1rem 0; }
.pub-link {
  font-size: .8rem;
  color: var(--amber-dark);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
  padding: .3rem .6rem;
  border-radius: 4px;
  border: 1.5px solid var(--amber);
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: .25rem;
  align-self: start;
}
.pub-link:hover { background: var(--amber); color: var(--navy-dark); }

/* HSE.gov.uk links — green */
.pub-link-hse { color: #1a6b35; border-color: #2d8a4e; }
.pub-link-hse:hover { background: #2d8a4e; color: #fff; }

/* legislation.gov.uk links — purple */
.pub-link-leg { color: #5b2d8e; border-color: #7c3dbf; }
.pub-link-leg:hover { background: #7c3dbf; color: #fff; }

.link-external { color: var(--amber-dark); font-size: .85rem; text-decoration: none; font-weight: 600; }
.link-external:hover { text-decoration: underline; }

/* ================================================
   RIDDOR
   ================================================ */
/* RIDDOR legal framework card */
.riddor-law-card { border-left: 4px solid var(--navy); padding: 1rem 1.25rem; margin-bottom: 1rem; }
.riddor-law-header { display: flex; align-items: center; gap: .75rem; margin-bottom: .9rem; flex-wrap: wrap; }
.riddor-law-header strong { font-size: .95rem; color: var(--navy-dark); }
.riddor-law-badge { background: var(--navy); color: #fff; font-size: .68rem; font-weight: 700; padding: .2rem .55rem; border-radius: 3px; letter-spacing: .03em; }
.riddor-law-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem .75rem; margin-bottom: .9rem; }
@media (max-width: 580px) { .riddor-law-grid { grid-template-columns: 1fr; } }
.riddor-law-item { background: var(--bg); border-radius: 6px; padding: .55rem .7rem; }
.riddor-law-label { display: block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-bottom: .2rem; }
.riddor-law-val { font-size: .8rem; color: var(--text); line-height: 1.55; }

/* HSE contact bar */
.riddor-contact-bar { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.riddor-contact-item { flex: 1; min-width: 180px; display: flex; align-items: flex-start; gap: .55rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: .7rem .85rem; }
.riddor-contact-item svg { flex-shrink: 0; color: var(--navy); margin-top: 2px; }
.riddor-contact-item > div { display: flex; flex-direction: column; gap: .1rem; }
.riddor-contact-label { font-size: .7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; font-weight: 600; }
.riddor-contact-item strong { font-size: .88rem; color: var(--navy-dark); }
.riddor-contact-item a { font-size: .82rem; color: var(--navy); }

/* Reporting timescales reference */
.riddor-timescales { margin-bottom: 1rem; }
.riddor-timescales summary { font-weight: 600; font-size: .88rem; color: var(--navy-dark); cursor: pointer; list-style: none; display: flex; align-items: center; gap: .5rem; }
.riddor-timescales summary::before { content: '▶'; font-size: .65rem; color: var(--text-muted); transition: transform .2s; }
.riddor-timescales[open] summary::before { transform: rotate(90deg); }
.riddor-ts-body { margin-top: .85rem; }
.riddor-ts-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.riddor-ts-table th { background: var(--navy); color: #fff; padding: .45rem .65rem; text-align: left; font-size: .72rem; font-weight: 600; letter-spacing: .03em; }
.riddor-ts-table td { padding: .45rem .65rem; border-bottom: 1px solid var(--border); vertical-align: top; line-height: 1.45; }
.riddor-ts-reportable td { background: #fdf6f6; }
.riddor-ts-reportable td:first-child { border-left: 3px solid var(--red); }
.riddor-ts-record td { background: #f6f8fd; }
.riddor-ts-record td:first-child { border-left: 3px solid var(--navy); }
.riddor-ts-legend { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-top: .65rem; font-size: .75rem; color: var(--text-muted); }
.riddor-legend-reportable { color: var(--red); font-weight: 600; }
.riddor-legend-record { color: var(--navy); font-weight: 600; }

.riddor-schedule-list { margin: 0; padding-left: 1.35rem; font-size: .82rem; line-height: 1.55; }
.riddor-schedule-list li { margin-bottom: .4rem; }

/* Decision tool heading */
.riddor-tree-heading { margin-bottom: .75rem; }
.riddor-tree-heading h3 { font-size: .95rem; color: var(--navy-dark); margin: 0; }

.riddor-tree { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }

.riddor-node {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.riddor-question { font-weight: 700; color: var(--navy); margin-bottom: 1rem; font-size: 1rem; }
.riddor-sub { font-size: .85rem; color: var(--text-muted); margin-bottom: 1rem; line-height: 1.5; }
.riddor-options { display: flex; gap: .75rem; flex-wrap: wrap; }
.riddor-opt {
  padding: .55rem 1.2rem;
  border: 2px solid var(--navy);
  border-radius: 6px;
  background: transparent;
  color: var(--navy);
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  transition: all .15s;
}
.riddor-opt:hover { background: var(--navy); color: #fff; }
.riddor-opt.selected { background: var(--navy); color: #fff; }

.riddor-result {
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1rem;
}
.riddor-result.reportable { background: #fdf0f0; border: 2px solid var(--red); }
.riddor-result.not-reportable { background: #f0fdf4; border: 2px solid var(--green); }
.riddor-result.investigate { background: #fff8e6; border: 2px solid var(--orange); }
.riddor-result h3 { font-size: 1.1rem; margin-bottom: .75rem; }
.riddor-result.reportable h3 { color: var(--red); }
.riddor-result.not-reportable h3 { color: var(--green); }
.riddor-result.investigate h3 { color: var(--orange); }
.riddor-result ul { padding-left: 1.25rem; margin: .5rem 0; }
.riddor-result li { margin-bottom: .4rem; font-size: .9rem; }

/* ================================================
   RISK ASSESSMENT
   ================================================ */
.risk-matrix { width: 100%; border-collapse: collapse; margin: .75rem 0; font-size: .82rem; }
.risk-matrix th, .risk-matrix td { padding: .4rem .6rem; border: 1px solid var(--border); text-align: center; }
.risk-matrix th { background: var(--navy); color: #fff; font-weight: 600; }
.risk-low      { background: #d4edda; color: #155724; font-weight: 600; }
.risk-med      { background: #fff3cd; color: #856404; font-weight: 600; }
.risk-high     { background: #f8d7da; color: #721c24; font-weight: 600; }
.risk-extreme  { background: #6b21a8; color: #fff;    font-weight: 700; }
.risk-critical { background: #c0392b; color: #fff;    font-weight: 700; }

.risk-score-display {
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
  padding: .4rem;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.guidance-note {
  border-left: 4px solid var(--amber);
  background: rgba(240,165,0,.06);
}
.guidance-note ol { padding-left: 1.25rem; margin: .75rem 0; }
.guidance-note li { margin-bottom: .3rem; font-size: .875rem; }

/* Competency notice — shown once on new forms */
.competency-notice {
  display: flex;
  gap: .85rem;
  padding: 1rem 1.1rem;
  background: #fffbeb;
  border: 1px solid #f59e0b;
  border-left: 4px solid #d97706;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
}
.competency-notice-icon { color: #d97706; flex-shrink: 0; padding-top: .15rem; }
.competency-notice-body { flex: 1; display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.competency-notice-title { font-weight: 700; color: #92400e; font-size: .92rem; }
.competency-notice-reg { font-size: .76rem; font-weight: 600; color: #b45309; letter-spacing: .01em; }
.competency-notice-text { font-size: .84rem; color: #78350f; margin: 0; line-height: 1.55; }
.competency-notice-dismiss {
  align-self: flex-start;
  background: none;
  border: 1px solid #d97706;
  border-radius: var(--radius);
  padding: .3rem .85rem;
  font-size: .78rem;
  color: #b45309;
  cursor: pointer;
  margin-top: .25rem;
  transition: background .15s, color .15s;
}
.competency-notice-dismiss:hover { background: #d97706; color: #fff; }

/* ── Presentation Mode ──────────────────────────────────────────────────────── */
.present-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: #0f172a; color: #f8fafc;
  display: flex; flex-direction: column; outline: none;
}
.present-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: .65rem 1.25rem; background: rgba(255,255,255,.04);
  font-size: .82rem; color: rgba(255,255,255,.45); gap: 1rem;
}
.present-dots { display: flex; gap: .35rem; align-items: center; flex: 1; justify-content: center; flex-wrap: wrap; }
.present-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.2); transition: background .2s; }
.present-dot.active { background: #60a5fa; }
.present-exit {
  background: none; border: 1px solid rgba(255,255,255,.18);
  border-radius: 6px; color: rgba(255,255,255,.65);
  padding: .2rem .65rem; font-size: .8rem; cursor: pointer; white-space: nowrap;
}
.present-exit:hover { background: rgba(255,255,255,.08); }
.present-slide {
  flex: 1; display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  text-align: center; padding: 2rem 8%;
}
.present-label {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .12em;
  color: rgba(255,255,255,.35); margin-bottom: 1.25rem;
}
.present-title {
  font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; line-height: 1.2; margin-bottom: 1rem;
}
.present-meta { font-size: clamp(.9rem, 2vw, 1.2rem); color: rgba(255,255,255,.5); }
.present-point-num {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .1em;
  color: #60a5fa; margin-bottom: 1.5rem; font-weight: 600;
}
.present-point-text {
  font-size: clamp(1.6rem, 4.5vw, 3rem); font-weight: 500; line-height: 1.5;
  max-width: 960px;
}
.present-end-icon { font-size: 3.5rem; color: #4ade80; margin-bottom: .75rem; }
.present-nav {
  display: flex; justify-content: space-between; padding: 1rem 1.25rem;
  background: rgba(255,255,255,.03); gap: .75rem;
}
.present-prev, .present-next {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14);
  color: #f8fafc; border-radius: 8px; padding: .65rem 1.75rem;
  font-size: 1rem; cursor: pointer; transition: background .15s;
}
.present-prev:hover:not([disabled]), .present-next:hover { background: rgba(255,255,255,.14); }
.present-prev[disabled] { opacity: .25; cursor: default; }
.present-next { background: #1e40af; border-color: #1e40af; font-weight: 600; }
.present-next:hover { background: #1d4ed8; }

/* ── Digital Signatures ─────────────────────────────────────────────────────── */
.sig-list { display: flex; flex-direction: column; gap: .45rem; margin-bottom: .75rem; min-height: 1.5rem; }
.sig-entry { display: flex; align-items: center; gap: .6rem; padding: .45rem .75rem; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: var(--radius); flex-wrap: wrap; }
.sig-name { font-weight: 600; font-size: .9rem; flex: 1; min-width: 120px; }
.sig-role-badge { font-size: .73rem; background: #dcfce7; color: #15803d; border-radius: 4px; padding: .1rem .45rem; font-weight: 600; white-space: nowrap; }
.sig-meta { font-size: .76rem; color: var(--text-muted); white-space: nowrap; }
.sig-remove { color: var(--text-muted); flex-shrink: 0; }
.sig-empty { font-size: .84rem; color: var(--text-muted); font-style: italic; margin: 0; }
.sig-add-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.sig-name-input { flex: 1; min-width: 160px; border: 1px solid var(--border); border-radius: var(--radius); padding: .45rem .65rem; font-size: .9rem; background: var(--surface); color: var(--text); }
.sig-role-select { border: 1px solid var(--border); border-radius: var(--radius); padding: .45rem .5rem; font-size: .85rem; background: var(--surface); color: var(--text); }
.sig-legal-note { font-size: .73rem; color: var(--text-muted); margin-top: .6rem; font-style: italic; }

.ra-list { display: flex; flex-direction: column; gap: .75rem; }
.ra-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color .15s;
}
.ra-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.1); }
.hsmgmt-card { border-left: 3px solid var(--navy); }
.ra-card-info { flex: 1; min-width: 0; }
.ra-card-title { font-weight: 700; font-size: .95rem; color: var(--navy); }
.ra-card-meta { font-size: .78rem; color: var(--text-muted); margin-top: .2rem; }
.ra-risk-badge {
  font-size: .75rem;
  font-weight: 700;
  padding: .25rem .6rem;
  border-radius: 4px;
  flex-shrink: 0;
}
.badge-low      { background: #d4edda; color: #155724; }
.badge-med      { background: #fff3cd; color: #856404; }
.badge-high     { background: #f8d7da; color: #721c24; }
.badge-extreme  { background: #6b21a8; color: #fff; }
.badge-critical { background: #c0392b; color: #fff; }

/* ================================================
   NOTES
   ================================================ */
.notes-controls { display: flex; gap: .75rem; align-items: center; margin-bottom: .75rem; }

.notes-list { display: flex; flex-direction: column; gap: .75rem; }
.note-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius);
  padding: .9rem 1.1rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: box-shadow .15s;
}
.note-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.1); }

.note-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .35rem; }
.note-card-badges { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.note-type-badge { font-size: .68rem; font-weight: 700; padding: .15rem .45rem; border-radius: 3px; }
.note-sev-badge { font-size: .68rem; font-weight: 700; padding: .15rem .45rem; border-radius: 3px; border: 1px solid; background: transparent; }

.note-card-title { font-weight: 700; font-size: .92rem; color: var(--navy-dark); }
.note-card-meta { font-size: .75rem; color: var(--text-muted); margin-top: .2rem; }
.note-card-preview { font-size: .82rem; color: var(--text-muted); margin-top: .4rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.note-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .45rem; }
.note-tag { font-size: .68rem; background: var(--bg); border: 1px solid var(--border); border-radius: 3px; padding: .1rem .4rem; color: var(--text-muted); }

/* Note form grid */
.note-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 560px) { .note-form-grid { grid-template-columns: 1fr; } }
.note-form-grid .field { margin-bottom: 0; }

.voice-toolbar { display: flex; flex-wrap: wrap; gap: .5rem .85rem; margin-bottom: .6rem; }
.voice-toolbar-group { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.voice-offline-tag { font-size: .65rem; font-weight: 700; color: #2d8a4e; background: #2d8a4e18; border: 1px solid #2d8a4e44; border-radius: 3px; padding: .1rem .35rem; }
.voice-online-tag  { font-size: .65rem; font-weight: 700; color: var(--navy); background: var(--navy-light, #e8ecf2); border: 1px solid var(--border); border-radius: 3px; padding: .1rem .35rem; }
.voice-status { font-size: .78rem; color: var(--text-muted); }
.voice-status.listening { color: var(--red); font-weight: 600; }
#btn-voice.listening { background: var(--navy); color: #fff; border-color: var(--navy); }
#btn-record.listening { background: var(--red); color: #fff; border-color: var(--red); }

/* ================================================
   PHOTOS
   ================================================ */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}
.photo-card {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: box-shadow .15s;
}
.photo-card:hover { box-shadow: var(--shadow-md); }
.photo-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.photo-card-info { padding: .5rem .6rem; background: var(--bg-card); }
.photo-card-site { font-size: .78rem; font-weight: 600; color: var(--navy); }
.photo-card-date { font-size: .72rem; color: var(--text-muted); }

.photo-previews { display: flex; gap: .5rem; flex-wrap: wrap; margin: .75rem 0; }
.photo-previews img { height: 80px; width: 80px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }

.photo-intro-card { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1rem; }
.photo-intro-icon { flex-shrink: 0; width: 40px; height: 40px; border-radius: 10px; background: rgba(240,165,0,.12); color: var(--amber); display: flex; align-items: center; justify-content: center; }
.photo-empty-state { grid-column: 1 / -1; }

/* ================================================
   SETTINGS
   ================================================ */
.settings-section { margin-bottom: 1rem; }
.settings-section h3 { font-size: .95rem; margin-bottom: 1rem; color: var(--navy); }
.settings-section .btn { margin-right: .5rem; margin-top: .25rem; }
.msg { font-size: .85rem; margin-top: .75rem; padding: .5rem .75rem; border-radius: 6px; }
.msg.success { background: #d4edda; color: #155724; }
.msg.error { background: #f8d7da; color: #721c24; }
.settings-about-desc { font-size: .9rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 1rem; }
.settings-feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; margin-bottom: 1rem; }
.settings-feature { display: flex; align-items: center; gap: .6rem; font-size: .82rem; color: var(--text); line-height: 1.3; }
.settings-feature-icon { font-size: 1.2rem; flex-shrink: 0; }
.settings-feature small { color: var(--text-muted); font-size: .75rem; }
.settings-about-links { display: flex; gap: 1rem; margin-bottom: .75rem; }
.settings-about-link { font-size: .83rem; color: var(--navy); font-weight: 600; text-decoration: none; }
.settings-about-link:hover { text-decoration: underline; }
.settings-disclaimer { font-size: .78rem; color: var(--text-muted); line-height: 1.5; margin: 0; }
.storage-counts { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .6rem; margin-bottom: .85rem; }
.storage-count-item { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem .75rem; }
.storage-count-num { display: block; font-size: 1.35rem; font-weight: 800; color: var(--navy-dark); line-height: 1.1; }
.storage-count-label { display: block; font-size: .72rem; color: var(--text-muted); margin-top: .15rem; }
.storage-bar-wrap { height: 7px; background: var(--border); border-radius: 99px; overflow: hidden; margin-top: .75rem; }
.storage-bar { height: 100%; background: var(--navy); border-radius: 99px; transition: width .4s; }
.storage-bar--warn { background: #f59e0b; }
.storage-usage-text { font-size: .77rem; color: var(--text-muted); margin: .4rem 0 0; }
.storage-warn { font-size: .78rem; font-weight: 600; color: #92400e; background: #fef3c7; border: 1px solid #fcd34d; border-radius: 6px; padding: .45rem .65rem; margin-top: .5rem; line-height: 1.4; }
.storage-warn--critical { color: #7f1d1d; background: #fee2e2; border-color: #fca5a5; }

/* ================================================
   MODAL
   ================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.hidden { display: none !important; }

.modal {
  background: var(--bg-card);
  border-radius: 12px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 8px 40px rgba(0,0,0,.25);
}
.modal-header {
  display: flex;
  align-items: center;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { flex: 1; font-size: 1rem; color: var(--navy); }
.modal-body { padding: 1.25rem 1.5rem; font-size: .9rem; line-height: 1.6; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}

/* ================================================
   UTILITY
   ================================================ */
.risk-matrix-guide { overflow-x: auto; }
.risk-matrix-guide h4 { font-size: .85rem; color: var(--text-muted); margin-bottom: .4rem; }

.ra-form-fields { display: flex; flex-direction: column; }

/* Scrollbar styling */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Sidenav scrollbar — visible against navy */
.sidenav::-webkit-scrollbar { width: 10px; }
.sidenav::-webkit-scrollbar-track { background: rgba(255,255,255,.05); }
.sidenav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.25); border-radius: 8px; }
.sidenav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.45); }

/* ================================================
   RESPONSIVE — MOBILE  (≤ 600px)
   ================================================ */
@media (max-width: 600px) {
  /* Layout */
  .page-wrap { padding: 1rem .85rem; }

  /* Page header — title full-width, buttons wrap to next line */
  .page-header { flex-wrap: wrap; gap: .5rem; }
  .page-header h2 { font-size: 1.2rem; width: 100%; flex: none; }

  /* Forms */
  fieldset { padding: 1rem .85rem; }
  .field-row { grid-template-columns: 1fr; }

  /* Risk matrix — shrink text and cells so it fits */
  .risk-matrix { font-size: .72rem; }
  .risk-matrix th,
  .risk-matrix td { padding: .25rem .3rem; }

  /* RIDDOR — full-width buttons, easier to tap */
  .riddor-opt { width: 100%; min-height: 44px; }
  .riddor-options { flex-direction: column; }

  /* Dashboard stat numbers */
  .stat-num { font-size: 1.6rem; }

  /* HSE pub cards — drop link to own row on mobile */
  .pub-item { grid-template-columns: auto 1fr; }
  .pub-link { grid-column: 1 / -1; text-align: center; }

  /* General touch targets */
  .btn { min-height: 44px; }
  .nav-link { padding: .85rem 1.25rem; }
  .series-tab { padding: .45rem .9rem; min-height: 38px; }

  /* Settings — stack data-management buttons */
  .settings-section .btn { display: block; width: 100%; margin-right: 0; margin-bottom: .5rem; }
}

/* ================================================
   RESPONSIVE — TABLET  (601px – 899px)
   ================================================ */
@media (min-width: 601px) and (max-width: 899px) {
  .page-wrap { padding: 1.5rem 1.25rem; }

  /* Risk assessments and notes — 2-column card list */
  .ra-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
    align-items: start;
  }
  .notes-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
    align-items: start;
  }

  /* HSE Library cards go 2-column earlier */
  .pub-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
    align-items: start;
  }

  /* RIDDOR buttons — comfortable width, not full-width */
  .riddor-opt { min-height: 44px; }
}

/* ================================================
   QUICK REFERENCE
   ================================================ */
/* ─── GLOSSARY ─────────────────────────────────────────────────────────── */
.glossary-alpha { display: flex; flex-wrap: wrap; gap: .35rem; margin: .75rem 0 1rem; }
.alpha-btn { font-size: .78rem; font-weight: 700; padding: .2rem .55rem; border-radius: 5px; border: 1.5px solid rgba(240,165,0,.3); background: rgba(240,165,0,.07); color: var(--amber-dark); cursor: pointer; transition: all .12s; min-width: 2rem; text-align: center; }
.alpha-btn:hover { background: rgba(240,165,0,.15); border-color: var(--amber-dark); }
.alpha-btn.active { background: var(--amber-dark); border-color: var(--amber-dark); color: #fff; }
.glossary-list { display: flex; flex-direction: column; gap: .5rem; }
.glossary-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; border-left: 3px solid var(--amber); }
.glossary-header { margin-bottom: .35rem; line-height: 1.5; }
.glossary-abbr { display: inline-block; font-size: .75rem; font-weight: 800; color: var(--amber-dark); background: rgba(240,165,0,.1); border-radius: 4px; padding: .2rem .5rem; white-space: nowrap; vertical-align: middle; margin-right: .4rem; }
.glossary-fullname { display: inline-block; font-size: .68rem; font-weight: 600; color: var(--navy); background: rgba(26,46,68,.08); border: 1px solid rgba(26,46,68,.15); border-radius: 3px; padding: .1rem .4rem; vertical-align: middle; }
.glossary-def { font-size: .85rem; color: var(--text); line-height: 1.65; }

.ref-accordion { display: flex; flex-direction: column; gap: .5rem; margin-top: 1rem; }

.contact-cards { display: flex; flex-direction: column; gap: .6rem; margin-top: 1rem; }
.contact-card { display: flex; align-items: center; gap: 1rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.contact-card:hover { border-color: var(--navy); box-shadow: 0 2px 8px rgba(26,46,68,.1); }
.contact-card-icon { flex-shrink: 0; width: 40px; height: 40px; border-radius: 10px; background: rgba(26,46,68,.06); display: flex; align-items: center; justify-content: center; color: var(--navy); }
.contact-card-body { flex: 1; min-width: 0; }
.contact-card-title { font-size: .92rem; font-weight: 700; color: var(--navy); margin-bottom: .15rem; }
.contact-card-desc { font-size: .8rem; color: var(--text-muted); line-height: 1.45; }
.contact-card-arrow { flex-shrink: 0; stroke: var(--text-muted); }
.contact-card:hover .contact-card-arrow { stroke: var(--navy); }
.contact-note { font-size: .8rem; color: var(--text-muted); margin-top: 1.25rem; }
.contact-note a { color: var(--text-muted); }

.courses-coming-card { margin-bottom: 1rem; }
.courses-coming-icon { margin-bottom: .85rem; }
.courses-coming-card h3, .courses-partner-card h3 { font-size: 1rem; font-weight: 700; color: var(--navy); margin-bottom: .6rem; }
.courses-coming-card p, .courses-partner-card p { font-size: .875rem; color: var(--text-muted); line-height: 1.7; margin-bottom: .55rem; }
.courses-coming-card p:last-child, .courses-partner-card p:last-child { margin-bottom: 0; }
.courses-enquire-btn { display: inline-block; margin-top: .85rem; font-size: .85rem; }

.ref-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.ref-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .9rem 1rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--navy);
}
.ref-header:hover { background: rgba(240,165,0,.05); }
.ref-vid-row { display: flex; flex-wrap: wrap; gap: .35rem; padding: .3rem 1rem .45rem; border-top: 1px solid var(--border); background: rgba(240,165,0,.04); }

.ref-title { font-size: .95rem; font-weight: 700; flex: 1; }
.ref-cat-badge { font-size: .65rem; font-weight: 600; padding: .15rem .45rem; border-radius: 3px; border: 1px solid; white-space: nowrap; flex-shrink: 0; }

.ref-chevron {
  flex-shrink: 0;
  stroke: var(--text-muted);
  transition: transform .2s ease;
}
.ref-section.open .ref-chevron { transform: rotate(180deg); }

.ref-content { display: none; padding: 0 1rem 1rem; }
.ref-section.open .ref-content { display: block; }

.ref-header-row { display: flex; align-items: stretch; }
.ref-header-row .ref-header { flex: 1; width: auto; }

.vid-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .28rem .65rem;
  margin: auto .65rem auto 0;
  background: #fff8e6;
  color: #a36200;
  border: 1px solid #f0a50055;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1;
  transition: background .15s, color .15s, border-color .15s;
}
.vid-chip:hover { background: #f0a500; color: #fff; border-color: #f0a500; }

.page-vid-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: .25rem 0 .75rem; }
.page-ext-links { display: flex; flex-wrap: wrap; gap: .5rem .75rem; margin-top: .4rem; }
.page-ext-link { font-size: .78rem; color: var(--navy); text-decoration: none; font-weight: 500; }
.page-ext-link:hover { text-decoration: underline; }

/* School of Excellence examples accordion */
.examples-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: .75rem 0;
  overflow: hidden;
}
.examples-section-toggle {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .85rem 1.1rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.examples-section-toggle::-webkit-details-marker { display: none; }
.examples-section-toggle::before {
  content: '▶';
  font-size: .65rem;
  color: var(--text-muted);
  transition: transform .2s;
  flex-shrink: 0;
}
.examples-section[open] > .examples-section-toggle::before { transform: rotate(90deg); }
.examples-section-title { font-weight: 700; font-size: .88rem; color: var(--navy); flex: 1; }
.examples-section-badge { font-size: .72rem; color: var(--text-muted); white-space: nowrap; }
.examples-list { border-top: 1px solid var(--border); }
.example-card { border-bottom: 1px solid var(--border); }
.example-card:last-child { border-bottom: none; }
.example-card-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem .6rem;
  padding: .7rem 1.1rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.example-card-summary::-webkit-details-marker { display: none; }
.example-card-summary::before {
  content: '▶';
  font-size: .6rem;
  color: var(--text-muted);
  transition: transform .2s;
  flex-shrink: 0;
}
.example-card[open] > .example-card-summary::before { transform: rotate(90deg); }
.example-num { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); white-space: nowrap; }
.example-card-title { font-weight: 600; font-size: .875rem; color: var(--navy); flex: 1; }
.example-badge { font-size: .68rem; font-weight: 700; padding: .15rem .5rem; border-radius: 999px; white-space: nowrap; }
.example-badge--inspect  { background: rgba(26,46,68,.1);   color: var(--navy); }
.example-badge--hazard   { background: rgba(201,136,0,.12); color: #a36200; }
.example-badge--assess   { background: rgba(45,138,78,.1);  color: #1a5c32; }
.example-badge--vehicle  { background: rgba(59,107,191,.12);color: #1e4b9e; }
.example-badge--critical { background: rgba(185,28,28,.1);  color: #b91c1c; }
.example-badge--chemical { background: rgba(109,40,217,.1); color: #5b21b6; }
.example-badge--moderate { background: rgba(180,83,9,.1);   color: #92400e; }
.example-badge--height   { background: rgba(201,136,0,.12); color: #a36200; }
.example-badge--serious  { background: rgba(185,28,28,.1);  color: #b91c1c; }
.example-badge--good     { background: rgba(45,138,78,.1);  color: #1a5c32; }
.example-badge--simple   { background: rgba(26,46,68,.1);   color: var(--navy); }
.example-badge--matrix   { background: rgba(59,107,191,.12);color: #1e4b9e; }
.example-badge--low      { background: rgba(45,138,78,.1);  color: #1a5c32; }
.example-badge--med      { background: rgba(201,136,0,.12); color: #a36200; }
.example-badge--high     { background: rgba(185,28,28,.1);  color: #b91c1c; }
.example-card-body { padding: .75rem 1.1rem 1rem; border-top: 1px solid var(--border); background: var(--bg); }
.example-photo-illus { margin-bottom: 1rem; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.example-field { display: grid; grid-template-columns: 130px 1fr; gap: .3rem .75rem; padding: .35rem 0; border-bottom: 1px solid var(--border); font-size: .82rem; }
.example-field:last-child { border-bottom: none; }
.example-field-label { font-weight: 700; color: var(--navy); padding-top: .05rem; }
.example-field-value { color: var(--text); line-height: 1.6; }

.ref-list { margin: 0; }
.ref-list dt {
  font-weight: 700;
  font-size: .83rem;
  color: var(--navy);
  margin-top: .85rem;
  padding: .3rem .6rem;
  background: var(--bg);
  border-left: 3px solid var(--amber);
  border-radius: 0 4px 4px 0;
  letter-spacing: .01em;
}
.ref-list dt:first-child { margin-top: 0; }
.ref-list dd {
  margin: .4rem 0 0;
  font-size: .84rem;
  color: var(--text-muted);
  line-height: 1.6;
  padding: 0 .25rem;
}

.ref-badge {
  display: inline-block;
  padding: .25rem .65rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: .8rem;
}

/* ── Fire Extinguisher Grid ─────────────────────────────────────────────────── */
.ext-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: .75rem;
  margin-bottom: .5rem;
}
.ext-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .8rem .9rem;
  font-size: .82rem;
}
.ext-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  margin-bottom: .4rem;
  flex-shrink: 0;
}
.ext-type { font-weight: 700; font-size: .95rem; color: var(--text); margin-bottom: .1rem; }
.ext-label-colour { font-size: .72rem; color: var(--text-muted); margin-bottom: .35rem; }
.ext-use { color: var(--text); margin-bottom: .3rem; line-height: 1.4; }
.ext-not { font-size: .78rem; color: var(--red); margin-bottom: .3rem; line-height: 1.4; }
.ext-note { font-size: .78rem; color: var(--text-muted); line-height: 1.4; }
.ext-class-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .82rem;
  padding: .2rem 0;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.ext-class-row:last-of-type { border-bottom: none; }
.ext-class-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  font-size: .76rem;
  flex-shrink: 0;
}

/* ================================================
   HSE NEWS
   ================================================ */

/* Page hero */
.news-page-hero {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-bottom: 1rem;
}
.news-hero-left {
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
}
.news-hero-tag {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: .25em .7em;
  background: #b91c1c;
  color: #fff;
  border-radius: 999px;
  margin-bottom: .6rem;
}
.news-hero-title {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--navy);
  margin: 0 0 .4rem;
}
.news-hero-desc {
  font-size: .82rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}
.news-hero-right {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding: 1rem 1.5rem;
}
@media (min-width: 640px) {
  .news-page-hero { flex-direction: row; }
  .news-hero-left { flex: 1 1 55%; border-bottom: none; border-right: 1px solid var(--border); padding: 1.75rem 1.75rem 1.5rem; }
  .news-hero-right { flex: 0 0 45%; flex-direction: column; padding: 1.5rem; gap: .4rem; }
}

/* Quick links in hero */
.news-quick-link {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--navy);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .45rem .8rem;
  text-decoration: none;
  transition: border-color .15s, background .15s, color .15s;
  white-space: nowrap;
}
.news-quick-link:hover { border-color: var(--navy); background: var(--navy); color: #fff; }

/* Meta bar */
.news-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  font-size: .78rem;
  color: var(--text-muted);
  margin-bottom: .5rem;
}

/* Filter tabs */
.news-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  margin-bottom: 1rem;
}
.news-filter-tab {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .75rem;
  font-weight: 600;
  padding: .3rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.news-filter-tab:hover { border-color: var(--navy); color: var(--navy); }
.news-filter-tab.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.news-tab-count {
  font-size: .65rem;
  background: rgba(255,255,255,.25);
  border-radius: 999px;
  padding: 0 .4em;
  line-height: 1.6;
  font-weight: 700;
}
.news-filter-tab:not(.active) .news-tab-count { background: rgba(26,46,68,.1); color: var(--navy); }

/* Cards list */
.news-list {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.news-loading {
  color: var(--text-muted);
  font-size: .875rem;
  padding: 2rem;
  text-align: center;
}

/* Card as clickable link */
.news-card {
  display: flex;
  flex-direction: row;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.news-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 18px rgba(0,0,0,.1);
  border-color: rgba(26,46,68,.2);
}

/* Left accent bar — colour by category */
.news-card-accent {
  width: 5px;
  flex-shrink: 0;
  background: #6b7280;
}
.news-card--prosecution .news-card-accent { background: #b91c1c; }
.news-card--guidance    .news-card-accent { background: var(--navy); }
.news-card--statistics  .news-card-accent { background: #0369a1; }
.news-card--campaign    .news-card-accent { background: #b45309; }
.news-card--research    .news-card-accent { background: #6d28d9; }

.news-card-body {
  flex: 1;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  min-width: 0;
}

.news-card-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.news-cat-badge {
  display: inline-block;
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .15em .55em;
  border-radius: 3px;
  color: #fff;
  white-space: nowrap;
}
.news-cat-badge.cat-prosecution { background: #b91c1c; }
.news-cat-badge.cat-guidance    { background: var(--navy); }
.news-cat-badge.cat-statistics  { background: #0369a1; }
.news-cat-badge.cat-campaign    { background: #b45309; }
.news-cat-badge.cat-research    { background: #6d28d9; }
.news-cat-badge.cat-general     { background: #6b7280; }

.news-date {
  font-size: .72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.news-card-title {
  font-size: .93rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.4;
}
.news-card:hover .news-card-title { color: var(--amber-dark); }

.news-excerpt {
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.news-card-cta {
  margin-top: auto;
  padding-top: .35rem;
  font-size: .75rem;
  font-weight: 600;
  color: var(--amber-dark);
  display: flex;
  align-items: center;
  gap: .25rem;
}

/* Featured first card */
.news-card--featured {
  border-color: rgba(26,46,68,.2);
}
.news-card--featured .news-card-accent { width: 6px; }
.news-card--featured .news-card-title { font-size: 1.1rem; }
.news-card--featured .news-card-body { padding: 1.25rem 1.35rem; }

@media (min-width: 700px) {
  .news-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .7rem;
    align-items: start;
  }
  .news-card--featured { grid-column: 1 / -1; }
  .news-card--featured .news-card-title { font-size: 1.2rem; }
}

/* Pagination */
.news-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0 .5rem;
  border-top: 1px solid var(--border);
  margin-top: .5rem;
}
.news-pag-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .5rem 1rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.news-pag-btn:hover:not(:disabled) { border-color: var(--navy); box-shadow: var(--shadow); }
.news-pag-btn:disabled { visibility: hidden; }
.news-pag-info { font-size: .78rem; color: var(--text-muted); font-weight: 500; }

/* Search bar */
.news-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: .75rem;
}
.news-search-icon {
  position: absolute;
  left: .8rem;
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
}
.news-search-input {
  width: 100%;
  padding: .55rem .55rem .55rem 2.4rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  font-size: .85rem;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.news-search-input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(26,46,68,.1); }
.news-search-input::placeholder { color: var(--text-muted); }
.news-search-clear {
  position: absolute;
  right: .6rem;
  background: none;
  border: none;
  font-size: .8rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: .2rem .4rem;
  border-radius: 4px;
  line-height: 1;
}
.news-search-clear:hover { color: var(--navy); background: rgba(26,46,68,.07); }

/* "New" badge on recent articles */
.news-badge-new {
  display: inline-block;
  font-size: .6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .15em .5em;
  border-radius: 3px;
  background: #16a34a;
  color: #fff;
  vertical-align: middle;
}

/* Relative timestamp */
.news-reltime {
  font-size: .72rem;
  color: var(--text-muted);
  font-weight: 500;
  cursor: default;
}

/* Category context banner */
.news-cat-context {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  border-left: 4px solid #1a2e44;
  border-radius: 0 6px 6px 0;
  padding: .7rem 1rem;
  margin-bottom: .85rem;
  font-size: .82rem;
  color: var(--text);
  line-height: 1.5;
}
.news-cat-context.hidden { display: none; }
.news-ctx-icon { font-size: 1.1rem; flex-shrink: 0; line-height: 1.4; }

.hse-news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.hse-news-resource-card {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow .15s, border-color .15s;
}
.hse-news-resource-card:hover { box-shadow: var(--shadow-md); border-color: var(--navy); }
.hse-news-resource-label { font-weight: 700; font-size: .95rem; color: var(--navy); }
.hse-news-resource-desc { font-size: .82rem; color: var(--text-muted); line-height: 1.55; flex: 1; }
.hse-news-resource-cta { font-size: .78rem; font-weight: 600; color: var(--amber-dark); margin-top: .25rem; }
.hse-news-section-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); margin: 2rem 0 .75rem; }
.hse-news-signup-note { font-size: .8rem; color: var(--text-muted); margin-top: 1.25rem; }
.hse-news-signup-note a { color: var(--navy); }

/* Bulletin subscribe card */
.hse-bulletin-card { display: flex; align-items: center; gap: 1rem; background: var(--bg-card); border: 1px solid var(--border); border-left: 3px solid var(--amber); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.25rem; text-decoration: none; color: var(--text); transition: box-shadow .15s; }
.hse-bulletin-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.hse-bulletin-icon { flex-shrink: 0; width: 36px; height: 36px; background: rgba(240,165,0,.12); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--amber-dark); }
.hse-bulletin-body { flex: 1; min-width: 0; }
.hse-bulletin-title { font-size: .9rem; font-weight: 700; color: var(--navy); margin-bottom: .2rem; }
.hse-bulletin-desc { font-size: .8rem; color: var(--text-muted); line-height: 1.5; }
.hse-bulletin-cta { flex-shrink: 0; font-size: .8rem; font-weight: 700; color: var(--amber-dark); white-space: nowrap; }
@media (max-width: 480px) { .hse-bulletin-card { flex-wrap: wrap; } .hse-bulletin-cta { width: 100%; } }

/* Live feed */
.hse-feed-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; gap: .75rem; flex-wrap: wrap; }
.hse-feed-status { font-size: .78rem; color: var(--text-muted); display: flex; align-items: center; gap: .4rem; }
.hse-status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.hse-status-dot--live    { background: #16a34a; box-shadow: 0 0 0 2px rgba(22,163,74,.2); }
.hse-status-dot--cached  { background: #d97706; }
.hse-status-dot--offline { background: #9ca3af; }
.hse-status-dot--loading { background: #9ca3af; animation: pulse-dot 1.2s infinite; }
@keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:.35} }

.hse-feed-list { display: grid; grid-template-columns: 1fr; gap: .75rem; margin-bottom: .5rem; }
@media (min-width: 680px) { .hse-feed-list { grid-template-columns: repeat(2, 1fr); } }

.hse-feed-skeleton {
  height: 100px;
  background: linear-gradient(90deg, var(--bg) 25%, var(--border) 50%, var(--bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

.hse-feed-loading { font-size: .875rem; color: var(--text-muted); padding: 1.5rem 0; text-align: center; }
.hse-feed-offline-note { font-size: .875rem; color: var(--text-muted); padding: .75rem 1rem; background: var(--bg); border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: .75rem; grid-column: 1/-1; }
.hse-feed-offline-grid { margin-top: 0; }
.hse-feed-card {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow .15s, border-color .15s;
}
.hse-feed-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.hse-feed-card-meta { display: flex; align-items: center; gap: .6rem; }
.hse-feed-type-badge { font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: .15rem .55rem; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; }
.hse-feed-date { font-size: .75rem; color: var(--text-muted); }
.hse-feed-title { font-size: .9rem; font-weight: 700; color: var(--navy); line-height: 1.4; }
.hse-feed-desc { font-size: .8rem; color: var(--text-muted); line-height: 1.55; }
.hse-feed-cta { font-size: .75rem; font-weight: 600; color: var(--amber-dark); margin-top: .1rem; }

/* ─── H&S Study Guide ─── */
.guide-disclaimer-inline {
  font-size: .75rem;
  color: var(--text-muted);
  font-style: italic;
  margin: .35rem 0 .85rem;
  line-height: 1.5;
}

.guide-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.guide-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  align-items: start;
}
.guide-col {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
@media (max-width: 600px) {
  .guide-columns { grid-template-columns: 1fr; }
}

.pub-item.guide-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  gap: 0;
  cursor: pointer;
  border-left: none;
  border-top: 3px solid var(--amber-dark);
  transition: box-shadow .15s;
}
.guide-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.1); }

.guide-card-head {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .75rem 1rem;
  background: rgba(26,46,68,.04);
  border-bottom: 1px solid rgba(26,46,68,.07);
}

.guide-head-title {
  flex: 1;
  min-width: 0;
  font-size: .875rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.guide-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  background: var(--amber-dark);
  color: #fff;
  border-radius: 50%;
  font-size: .8rem;
  font-weight: 800;
  flex-shrink: 0;
}

.guide-card-body {
  padding: .65rem 1rem .85rem;
}

.guide-chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform .2s ease;
}
.guide-card.open .guide-chevron {
  transform: rotate(180deg);
}

/* Element description — always visible */
.guide-desc {
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: .4rem 0 0;
}
.guide-meta { display:flex; flex-wrap:wrap; align-items:center; gap:.3rem; margin:.5rem 0 0; }
.guide-meta-count { font-size:.7rem; color:var(--text-muted); padding-right:.2rem; }
.guide-meta-ref { font-size:.68rem; font-weight:600; padding:.12rem .4rem; border-radius:3px; background:rgba(26,46,68,.07); color:var(--navy); border:1px solid rgba(26,46,68,.15); max-width:120px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.guide-meta-quiz { font-size:.68rem; font-weight:600; padding:.12rem .4rem; border-radius:3px; background:rgba(240,165,0,.12); color:var(--amber-dark); border:1px solid rgba(240,165,0,.3); }

/* Category top border */
.guide-card[data-cat="mgmt"]      { border-top-color: #1a2e44; }
.guide-card[data-cat="health"]    { border-top-color: #2d8a4e; }
.guide-card[data-cat="workplace"] { border-top-color: #3b6bbf; }

/* Category-coloured regulation chips */
.guide-meta-ref--mgmt      { background:rgba(26,46,68,.09);   color:#1a2e44; border-color:rgba(26,46,68,.22); }
.guide-meta-ref--health    { background:rgba(45,138,78,.1);   color:#2d8a4e; border-color:rgba(45,138,78,.25); }
.guide-meta-ref--workplace { background:rgba(59,107,191,.1);  color:#3b6bbf; border-color:rgba(59,107,191,.25); }

/* Category legend */
.guide-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: .4rem 0 .9rem;
}
.guide-legend-item {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-muted);
}
.guide-legend-item::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}
.guide-legend-item[data-cat="mgmt"]::before      { background: #1a2e44; }
.guide-legend-item[data-cat="health"]::before    { background: #2d8a4e; }
.guide-legend-item[data-cat="workplace"]::before { background: #3b6bbf; }

/* Collapsible detail section */
.guide-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease, margin .3s ease;
}
.guide-card.open .guide-detail {
  max-height: 3000px;
  margin-top: .75rem;
}

.hs-topics-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin: .75rem 0 .35rem;
  display: flex;
  align-items: center;
  gap: .35rem;
}
.hs-topics-label::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  flex-shrink: 0;
}
.guide-detail > .hs-topics-label:first-child { margin-top: 0; }

.guide-topics {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.guide-topics li {
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.5;
  padding-left: .9rem;
  position: relative;
}
.guide-topics li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--amber-dark);
}

/* Expandable topic items */
.guide-topic-item { padding-left: 0; }
.guide-topic-item::before { display: none; }
.guide-topic-item details summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: baseline;
  gap: .5rem;
  padding: .1rem 0;
}
.guide-topic-item details summary::-webkit-details-marker { display: none; }
.guide-topic-item details summary::before {
  content: '▶';
  font-size: .6rem;
  color: var(--amber-dark);
  flex-shrink: 0;
  transition: transform .18s;
}
.guide-topic-item details[open] summary::before { transform: rotate(90deg); }
.guide-topic-body {
  padding: .5rem .5rem .45rem 1rem;
  border-left: 2px solid var(--amber);
  margin: .25rem 0 .35rem;
}
.guide-topic-body p {
  margin: 0 0 .5rem;
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.guide-topic-body p:last-child { margin-bottom: 0; }

/* Legislation reference badges */
.leg-refs { display: flex; flex-wrap: wrap; gap: .35rem; }
.leg-ref-badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 600;
  background: var(--navy);
  color: #fff;
  border-radius: 3px;
  padding: .15rem .45rem;
  line-height: 1.4;
  text-decoration: none;
}
a.leg-ref-link {
  cursor: pointer;
  transition: background .15s, transform .1s;
}
a.leg-ref-link:hover {
  background: var(--amber);
  color: var(--navy);
  transform: translateY(-1px);
}

/* Inline legislation source link (superscript ↗) */
.reg-ref-q {
  display: inline;
  font-size: .58rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--navy);
  opacity: .55;
  vertical-align: super;
  line-height: 0;
  margin-left: 1px;
  transition: opacity .15s, color .15s;
}
.reg-ref-q:hover { opacity: 1; color: var(--amber-dark); }

/* Clickable regulation badge (policy, CDM etc.) */
a.policy-law-badge, a.cdm-badge {
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, color .15s;
}
a.policy-law-badge:hover, a.cdm-badge:hover {
  background: var(--amber);
  color: var(--navy);
}

/* Refs header with ? button */
.leg-refs-header { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.leg-refs-header .hs-topics-label { margin-bottom: 0; }
.leg-ref-info-btn {
  width: 17px; height: 17px;
  border-radius: 50%;
  border: 1.5px solid var(--text-muted);
  background: none;
  color: var(--text-muted);
  font-size: .65rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  transition: border-color .15s, color .15s;
}
.leg-ref-info-btn:hover { border-color: var(--navy); color: var(--navy); }

/* Hint box */
.leg-ref-hint {
  background: #fffbeb;
  border-left: 3px solid var(--amber);
  border-radius: 0 4px 4px 0;
  padding: .55rem .75rem;
  font-size: .75rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: .5rem;
}
.leg-ref-hint.hidden { display: none; }

/* HSE resource links */
.guide-links { display: flex; flex-direction: column; gap: .3rem; }
.guide-link {
  font-size: .78rem;
  color: var(--navy);
  text-decoration: none;
  line-height: 1.5;
}
.guide-link:hover { text-decoration: underline; }

mark {
  background: rgba(240,165,0,.35);
  color: var(--navy-dark);
  border-radius: 2px;
  padding: 0 1px;
}

/* ─── Knowledge Check Quiz ─── */
.guide-header-right { display:flex; align-items:center; gap:6px; flex-shrink:0; }
.quiz-score-chip {
  display: inline-flex; align-items: center;
  font-size: .7rem; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
  flex-shrink: 0;
}
.quiz-score-chip.chip-pass { background:#d4edda; color:#155724; }
.quiz-score-chip.chip-fair { background:#fff3cd; color:#856404; }
.quiz-score-chip.chip-low  { background:#f8d7da; color:#721c24; }

.quiz-section {
  border-top: 1px solid var(--border);
  margin-top: 1rem;
  padding-top: .875rem;
}
.quiz-open-btn { font-size: .78rem; }
.quiz-area { margin-top: .75rem; }

.quiz-questions {}
.quiz-q { margin-bottom: 1.1rem; }
.quiz-q-text {
  font-size: .85rem; font-weight: 600; color: var(--text);
  margin-bottom: .5rem; line-height: 1.45;
  display: flex; align-items: flex-start; gap: .4rem;
}
.quiz-q-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.4rem; height: 1.4rem;
  background: var(--navy); color: #fff; border-radius: 3px;
  font-size: .7rem; font-weight: 700; flex-shrink: 0; margin-top: .05rem;
}
.quiz-opts { display: flex; flex-direction: column; gap: .3rem; padding-left: .25rem; }
.quiz-opt-label {
  display: flex; align-items: flex-start; gap: .5rem;
  font-size: .82rem; color: var(--text); padding: .3rem .5rem;
  border-radius: 5px; cursor: pointer; line-height: 1.4;
  transition: background .12s;
}
.quiz-opt-label:hover { background: rgba(0,0,0,.04); }
.quiz-opt-label input[type="radio"] { margin-top: .18rem; flex-shrink: 0; accent-color: var(--navy); }
.quiz-opt-label.quiz-opt--correct { background: #d4edda; color: #155724; font-weight: 600; border-radius: 5px; }
.quiz-opt-label.quiz-opt--wrong   { background: #f8d7da; color: #721c24; border-radius: 5px; }

.quiz-result {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  margin-top: .75rem; padding: .75rem 1rem;
  background: var(--bg); border-radius: 6px; border: 1px solid var(--border);
}
.quiz-score-badge {
  font-size: 1.15rem; font-weight: 800;
  padding: .3rem .85rem; border-radius: 6px; flex-shrink: 0;
}
.quiz-score--pass { background: #d4edda; color: #155724; }
.quiz-score--fair { background: #fff3cd; color: #856404; }
.quiz-score--low  { background: #f8d7da; color: #721c24; }
.quiz-result-msg  { font-size: .82rem; color: var(--text-muted); flex: 1; min-width: 0; }

/* RA Template Picker */
.ra-template-grid { display:grid; grid-template-columns:1fr 1fr; gap:1rem; margin-top:1.25rem; }
@media (max-width:600px) { .ra-template-grid { grid-template-columns:1fr; } }
.ra-template-card { background:var(--bg-card); border:2px solid var(--border); border-radius:10px; padding:1.5rem; text-align:left; cursor:pointer; transition:border-color .15s, box-shadow .15s; width:100%; }
.ra-template-card:hover { border-color:var(--amber); box-shadow:0 3px 14px rgba(0,0,0,.09); }
.ra-template-card h3 { margin:0 0 .5rem; font-size:1rem; color:var(--navy-dark); }
.ra-template-card p { font-size:.83rem; color:var(--text-muted); margin:0 0 .85rem; line-height:1.55; }
.ra-tpl-tag { font-size:.72rem; font-weight:600; background:var(--bg); border:1px solid var(--border); padding:.2rem .55rem; border-radius:3px; color:var(--text-muted); }

/* RA list page — Five Steps card */
.ra-five-steps { padding: 1rem 1.1rem; margin-bottom: 0; }
.ra-five-steps-title { font-size: .9rem; margin-bottom: .6rem; }
.ra-steps-ref { font-size: .75rem; font-weight: 400; color: var(--text-muted); margin-left: .4rem; background: var(--bg); border: 1px solid var(--border); padding: .1rem .4rem; border-radius: 3px; }
.ra-steps-list { padding-left: 1.35rem; display: flex; flex-direction: column; gap: .45rem; font-size: .83rem; line-height: 1.5; margin-bottom: .75rem; }
.ra-steps-list li strong { color: var(--navy-dark); }

/* RA list page — Worked Examples */
.ra-examples-section { margin: 1.5rem 0 0; }
.ra-examples-header-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .3rem; }
.ra-examples-header-row h3 { font-size: .95rem; font-weight: 600; color: var(--navy-dark); }
.ra-examples-sub { font-size: .8rem; color: var(--text-muted); margin-bottom: .85rem; }
.ra-examples-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; }
@media (max-width: 700px) { .ra-examples-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 440px) { .ra-examples-grid { grid-template-columns: 1fr; } }
.ra-example-card { display: flex; flex-direction: column; gap: .25rem; padding: .85rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card); transition: box-shadow .15s, border-color .15s; }
.ra-example-card:hover { box-shadow: var(--shadow-md); border-color: var(--navy); }
.ra-example-icon { font-size: 1.5rem; line-height: 1; }
.ra-example-sector { font-weight: 600; font-size: .85rem; margin-top: .1rem; }
.ra-example-desc { font-size: .76rem; color: var(--text-muted); line-height: 1.4; flex: 1; }
.ra-example-actions { display: flex; align-items: center; gap: .65rem; margin-top: .4rem; flex-wrap: wrap; }
.ra-example-load { background: var(--navy); color: #fff; border: none; border-radius: 4px; font-size: .72rem; font-weight: 700; padding: .3rem .7rem; cursor: pointer; transition: opacity .15s; }
.ra-example-load:hover { opacity: .85; }
.ra-example-pdf { font-size: .72rem; color: var(--text-muted); text-decoration: none; font-weight: 600; }
.ra-example-pdf:hover { color: var(--navy); }
.ra-starter-banner { background: rgba(26,46,68,.07); border-left: 3px solid var(--navy); border-radius: 0 6px 6px 0; padding: .75rem 1rem; font-size: .82rem; color: var(--navy); margin-bottom: 1rem; line-height: 1.5; }
.ra-autosave-status { font-size: .75rem; color: var(--text-muted); white-space: nowrap; }

/* RA 5x5 matrix reference card */
.ra-matrix-ref { padding: 0; overflow: hidden; margin-bottom: 0; }
.ra-matrix-ref summary { padding: .85rem 1rem; font-size: .88rem; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; color: var(--navy-dark); }
.ra-matrix-ref summary::-webkit-details-marker { display: none; }
.ra-matrix-ref summary::after { content: '▾'; font-size: .8rem; color: var(--text-muted); }
.ra-matrix-ref[open] summary::after { content: '▴'; }
.ra-matrix-ref summary:hover { background: var(--bg); }
.ra-matrix-ref-body { padding: .25rem 1rem 1rem; }
.ra-matrix-ref-hint { font-size: .83rem; color: var(--text-muted); margin-bottom: .65rem; }

/* RA blank template download row */
.ra-templates-row { display: flex; align-items: center; gap: .6rem; margin-top: .85rem; flex-wrap: wrap; }
.ra-templates-label { font-size: .78rem; color: var(--text-muted); font-weight: 500; }
.ra-template-dl { font-size: .78rem; font-weight: 600; color: var(--navy); border: 1px solid var(--border); border-radius: 4px; padding: .25rem .6rem; text-decoration: none; background: var(--bg-card); transition: border-color .15s, background .15s; }
.ra-template-dl:hover { border-color: var(--navy); background: var(--bg); }

/* RA list page — Your Assessments */
.ra-your-section { margin-top: 1.5rem; }
.ra-your-section h3 { font-size: .95rem; font-weight: 600; color: var(--navy-dark); margin-bottom: .75rem; }

/* Header actions (Print + Save button group) */
.header-actions { display: flex; gap: .5rem; align-items: center; }

/* N/A toggles on fieldsets */
.na-label { font-size: .75rem; font-weight: normal; color: var(--text-muted); margin-left: .75rem; cursor: pointer; user-select: none; }
.na-label input[type="checkbox"] { margin-right: .25rem; cursor: pointer; vertical-align: middle; }
.na-body.na-active { opacity: .35; pointer-events: none; user-select: none; }

/* Linked Records section */
.linked-records { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .linked-records { grid-template-columns: 1fr; } }
.linked-col-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); }
.linked-note-card { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: .45rem .7rem; margin-bottom: .35rem; }
.linked-record-title { font-size: .82rem; font-weight: 600; color: var(--navy-dark); }
.linked-record-meta { font-size: .75rem; color: var(--text-muted); margin-top: .1rem; }
.linked-photo-list { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .25rem; }
.linked-photo-thumb { width: 80px; }
.linked-photo-thumb img { width: 80px; height: 60px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); display: block; }
.linked-photo-thumb .linked-record-meta { font-size: .7rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.linked-empty { font-size: .8rem; color: var(--text-muted); font-style: italic; margin: .25rem 0 0; }
/* Photo upload widget */
.photo-fieldset { margin-top: 1rem; }
.photo-preview-grid { display: flex; flex-wrap: wrap; gap: .75rem; margin: .75rem 0; }
.photo-preview-item { position: relative; width: 120px; }
.photo-preview-item img { width: 120px; height: 90px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); display: block; }
.photo-cap-input { width: 100%; margin-top: .3rem; padding: .25rem .4rem; font-size: .72rem; border: 1px solid var(--border); border-radius: 4px; background: var(--input-bg); color: var(--text); box-sizing: border-box; }
.photo-remove-btn { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.6); color: #fff; border: none; border-radius: 50%; width: 20px; height: 20px; font-size: 14px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.photo-upload-controls { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .25rem; }
.photo-upload-label { display: flex; align-items: center; gap: .4rem; }
.photo-empty-hint { font-size: .8rem; color: var(--text-muted); font-style: italic; margin: 0; width: 100%; }

/* Global Photo FAB */
.global-photo-fab { position: fixed; bottom: 5rem; right: 1.25rem; z-index: 1200; width: 52px; height: 52px; border-radius: 50%; background: var(--primary); color: #fff; border: none; box-shadow: 0 4px 16px rgba(0,0,0,.35); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform .15s, box-shadow .15s; }
.global-photo-fab:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.global-photo-fab svg { width: 24px; height: 24px; }
.global-photo-overlay { position: fixed; inset: 0; z-index: 1210; background: rgba(0,0,0,.45); }
.global-photo-overlay.hidden { display: none; }
.global-photo-panel { position: fixed; bottom: 0; left: 0; right: 0; z-index: 1220; background: var(--card-bg); border-radius: 1rem 1rem 0 0; box-shadow: 0 -4px 24px rgba(0,0,0,.25); padding: 0 0 env(safe-area-inset-bottom,0); max-height: 85vh; overflow-y: auto; transform: translateY(100%); transition: transform .25s cubic-bezier(.4,0,.2,1); }
.global-photo-panel:not(.hidden) { transform: translateY(0); }
.global-photo-panel.hidden { transform: translateY(100%); pointer-events: none; }
@media (min-width: 600px) { .global-photo-panel { left: auto; right: 1.5rem; width: 400px; border-radius: 1rem; bottom: 5.5rem; max-height: 70vh; } }
.global-photo-panel-header { display: flex; align-items: center; gap: .5rem; padding: 1rem 1rem .75rem; border-bottom: 1px solid var(--border); }
.global-photo-panel-title { font-weight: 600; font-size: 1rem; flex: 1; }
.global-photo-panel-sub { font-size: .78rem; color: var(--text-muted); }
.global-photo-close { background: none; border: none; font-size: 1.2rem; color: var(--text-muted); cursor: pointer; line-height: 1; padding: .2rem .4rem; margin-left: auto; }
.global-photo-panel-body { padding: .75rem 1rem 1rem; }
.global-photo-input-row { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; }
.global-photo-pick-btn { display: flex; align-items: center; gap: .4rem; flex: 1; justify-content: center; min-width: 130px; }
.global-photo-desc-row { display: flex; gap: .5rem; align-items: center; margin-bottom: .75rem; }
.global-photo-preview { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.global-photo-preview img { width: 80px; height: 60px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.global-photo-recent-label { font-size: .75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: .4rem; }
.global-photo-recent { display: flex; flex-wrap: wrap; gap: .5rem; }
.global-photo-recent img { width: 64px; height: 48px; object-fit: cover; border-radius: 5px; border: 1px solid var(--border); cursor: pointer; }
.global-photo-recent-empty { font-size: .8rem; color: var(--text-muted); font-style: italic; }

/* Global Media FAB — tab strip */
.global-media-tabs { display: flex; gap: .5rem; padding: .75rem 1rem .25rem; border-bottom: 1px solid var(--border); }
.global-media-tab { background: none; border: 1.5px solid var(--border); border-radius: 20px; padding: .3rem .85rem; font-size: .82rem; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.global-media-tab--active { background: var(--primary); color: #fff; border-color: var(--primary); }
.global-media-pane { display: block; }
.global-media-pane.hidden { display: none; }
/* Audio tab within Global FAB */
.global-audio-rec-row { display: flex; align-items: center; gap: .6rem; margin-bottom: .75rem; }
.global-audio-rec-btn { display: flex; align-items: center; gap: .4rem; }
.global-audio-rec-btn--active { background: var(--danger, #c0392b) !important; color: #fff !important; border-color: var(--danger, #c0392b) !important; }
.global-audio-timer { font-size: .85rem; font-variant-numeric: tabular-nums; color: var(--primary); font-weight: 600; min-width: 3ch; }
.global-audio-desc-row { display: flex; gap: .5rem; align-items: center; margin-bottom: .75rem; }
.global-audio-preview { margin-bottom: .75rem; }
.global-audio-preview audio { width: 100%; border-radius: 6px; }
.global-audio-recent-label { font-size: .75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: .4rem; }
.global-audio-recent { display: flex; flex-direction: column; gap: .5rem; }
.global-audio-recent-item { background: var(--bg, #f5f7fa); border: 1px solid var(--border); border-radius: 6px; padding: .5rem .65rem; }
.global-audio-recent-item audio { width: 100%; height: 32px; }
.global-audio-recent-meta { font-size: .72rem; color: var(--text-muted); margin-bottom: .25rem; }
.global-audio-recent-empty { font-size: .8rem; color: var(--text-muted); font-style: italic; }

/* Inline audio fieldset (in forms) */
.audio-fieldset { margin-top: 1rem; }
.audio-clips-list { display: flex; flex-direction: column; gap: .6rem; margin-bottom: .6rem; }
.audio-clip-item { background: var(--bg, #f5f7fa); border: 1px solid var(--border); border-radius: 6px; padding: .5rem .65rem; display: flex; flex-direction: column; gap: .25rem; }
.audio-clip-player { width: 100%; height: 32px; }
.audio-clip-meta { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.audio-clip-dur { font-size: .72rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.audio-clip-remove { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: .8rem; padding: .1rem .3rem; border-radius: 3px; line-height: 1; }
.audio-clip-remove:hover { color: var(--danger, #c0392b); background: rgba(192,57,43,.08); }
.audio-controls { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.audio-rec-btn { display: flex; align-items: center; gap: .4rem; }
.audio-rec-btn--active { background: var(--danger, #c0392b) !important; color: #fff !important; border-color: var(--danger, #c0392b) !important; animation: pulse-red 1s ease-in-out infinite; }
.audio-rec-timer { font-size: .82rem; font-variant-numeric: tabular-nums; color: var(--danger, #c0392b); font-weight: 600; min-width: 3ch; }
.audio-empty-hint { font-size: .8rem; color: var(--text-muted); font-style: italic; margin: 0 0 .4rem; }
@keyframes pulse-red { 0%,100% { opacity:1; } 50% { opacity:.65; } }

.linked-hint { font-size: .78rem; color: var(--text-muted); margin-top: .75rem; }
.field-optional { font-size: .75rem; font-weight: normal; color: var(--text-muted); }
.audio-badge { font-size: .8rem; margin-left: .4rem; opacity: .75; }
.offline-hint { font-size: .75rem; color: var(--text-muted); margin: .2rem 0 .4rem; line-height: 1.4; }

/* Resource Hub */
.disclaimer-card {
  border-left: 4px solid var(--amber);
  background: rgba(240,165,0,.08);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  font-size: .85rem;
  line-height: 1.6;
  color: var(--text-muted);
}
.disclaimer-card strong {
  display: block;
  color: var(--amber-dark);
  margin-bottom: .35rem;
  font-size: .9rem;
}
.cat-badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  padding: .2rem .55rem;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: .15rem;
}
.hub-card-footer { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.hub-reg-badge { font-size: .7rem; font-weight: 700; padding: .15rem .45rem; border-radius: 3px; background: rgba(240,165,0,.12); color: var(--amber-dark); border: 1px solid rgba(240,165,0,.3); white-space: nowrap; }
.hub-inapp-btn { font-size: .74rem; font-weight: 600; padding: .2rem .55rem; border-radius: 4px; border: 1.5px solid var(--navy); color: var(--navy); background: none; cursor: pointer; transition: background .15s, color .15s; }
.hub-inapp-btn:hover { background: var(--navy); color: #fff; }
.hub-guide-btn { font-size: .74rem; font-weight: 600; padding: .2rem .55rem; border-radius: 4px; border: 1.5px solid var(--amber-dark); color: var(--amber-dark); background: none; cursor: pointer; transition: background .15s, color .15s; }
.hub-guide-btn:hover { background: var(--amber-dark); color: #fff; }

.hub-highlights-expand { margin-top: .35rem; margin-bottom: .35rem; }
.hub-highlights-expand:not([open]) .hub-highlights { display: none; }
.hub-highlights-expand summary { font-size: .75rem; font-weight: 600; color: var(--navy); opacity: .65; cursor: pointer; user-select: none; list-style: none; display: inline-flex; align-items: center; gap: .3rem; }
.hub-highlights-expand summary::after { content: '▾'; font-size: .65rem; transition: transform .15s; }
.hub-highlights-expand[open] summary::after { transform: rotate(-180deg); }
.hub-highlights-expand summary::-webkit-details-marker { display: none; }
.hub-highlights-expand summary:hover { opacity: 1; color: var(--amber-dark); }
.hub-card { background: var(--bg-card); border: 1px solid var(--border); border-left: 4px solid; border-radius: var(--radius); padding: .9rem 1rem; box-shadow: var(--shadow); display: flex; flex-direction: column; min-width: 0; }
.hub-card-head { display: flex; align-items: center; gap: .45rem; margin-bottom: .4rem; flex-wrap: wrap; }
.hub-cat-pill { font-size: .68rem; font-weight: 600; padding: .1rem .4rem; border-radius: 3px; border: 1px solid; white-space: nowrap; }
.hub-card-title { font-size: .9rem; font-weight: 700; color: var(--navy); margin-bottom: .25rem; line-height: 1.3; }
.hub-card-desc { font-size: .8rem; color: var(--text-muted); line-height: 1.5; margin-bottom: .4rem; }
.hub-highlights { list-style: none; margin: 0 0 .5rem; display: flex; flex-direction: column; gap: .2rem; }
.hub-highlights li { font-size: .78rem; color: var(--text); line-height: 1.4; padding-left: 1rem; position: relative; }
.hub-highlights li::before { content: ''; position: absolute; left: 0; top: .45em; width: 5px; height: 5px; border-radius: 50%; background: var(--amber); }
.hub-card-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding-top: .45rem; margin-top: auto; }
.hub-ext-btn { font-size: .78rem; font-weight: 600; color: var(--amber-dark); background: transparent; border: 1.5px solid var(--amber); text-decoration: none; padding: .3rem .65rem; border-radius: 4px; transition: all .15s; white-space: nowrap; margin-left: auto; }
.hub-ext-btn:hover { background: var(--amber); color: var(--navy-dark); }

/* ── CDM 2015 ────────────────────────────────────────────────────────────────── */
.cdm-law-card { border-left: 4px solid var(--navy); padding: 1rem 1.25rem; margin-bottom: 1.25rem; }
.cdm-law-header { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; font-size: .95rem; }
.cdm-law-icon { font-size: 1.1rem; }
.cdm-law-card p { font-size: .875rem; color: var(--text-muted); line-height: 1.6; margin-bottom: .65rem; }
.cdm-law-badges { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.cdm-badge { font-size: .72rem; font-weight: 600; background: var(--navy); color: #fff; padding: .2rem .55rem; border-radius: 3px; }

/* Notification checker */
.cdm-notify-card { margin-bottom: 1.5rem; border-left: 4px solid var(--amber); }
.cdm-notify-header { display: flex; align-items: center; gap: .5rem; font-size: .9rem; margin-bottom: .4rem; }
.cdm-notify-intro { font-size: .83rem; color: var(--text-muted); margin-bottom: 1rem; line-height: 1.55; }
.cdm-notify-checks { display: flex; flex-direction: column; gap: .75rem; }
.cdm-check-group { background: var(--bg); border-radius: 6px; padding: .75rem 1rem; display: flex; flex-direction: column; gap: .6rem; }
.cdm-check-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--navy-dark); margin-bottom: .1rem; }
.cdm-check-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.cdm-check-row span { font-size: .84rem; line-height: 1.5; flex: 1; }
.cdm-check-sub { padding-left: 1rem; border-left: 2px solid var(--border); }
.cdm-check-sub-hidden { display: none; }
.cdm-check-or { text-align: center; font-size: .78rem; font-weight: 600; color: var(--text-muted); letter-spacing: .06em; }
.cdm-yn-group { display: flex; gap: .4rem; flex-shrink: 0; }
.cdm-yn { padding: .3rem .85rem; font-size: .8rem; font-weight: 600; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card); color: var(--text-muted); cursor: pointer; }
.cdm-yn:hover { border-color: var(--navy); color: var(--navy); }
.cdm-yn.active[data-val="y"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.cdm-yn.active[data-val="n"] { background: var(--bg-alt); color: var(--text); border-color: var(--border); }

/* ── Global Search ─────────────────────────────────────────────────────────── */
.topbar-right {
  display: flex;
  align-items: center;
  gap: .25rem;
  flex-shrink: 0;
  margin-left: auto;
}

.topbar-search-btn {
  flex-shrink: 0;
}

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(10, 20, 35, .6);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: clamp(3rem, 10vh, 7rem);
  backdrop-filter: blur(3px);
}

.search-modal {
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  width: min(620px, calc(100vw - 2rem));
  max-height: min(520px, calc(100vh - 8rem));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.search-input-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .9rem 1rem;
  border-bottom: 1px solid var(--border);
}

.search-modal-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-modal-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  color: var(--text);
  background: transparent;
}
.search-modal-input::placeholder { color: var(--text-muted); }

.search-modal-close {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .15rem .45rem;
  font-size: .72rem;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1.6;
}
.search-modal-close:hover { border-color: var(--navy); color: var(--navy); }

.search-results {
  overflow-y: auto;
  padding: .5rem 0 .75rem;
  flex: 1;
}

.search-hint {
  font-size: .875rem;
  color: var(--text-muted);
  text-align: center;
  padding: 1.5rem 1rem;
}

.search-group {
  padding: .5rem 0 .25rem;
}

.search-group-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  padding: .2rem 1rem .4rem;
}

.search-result-item {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: .55rem 1rem;
  cursor: pointer;
  border-radius: 0;
  transition: background .1s;
}
.search-result-item:hover,
.search-result-item.active {
  background: var(--bg);
}
.search-result-item.active { outline: 2px solid var(--navy); outline-offset: -2px; }

.search-result-title {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.search-result-desc {
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.search-ext-link {
  color: var(--navy);
  font-weight: 600;
  text-decoration: underline;
  white-space: nowrap;
}
.search-ext-link:hover { color: var(--teal); }

@media (max-width: 480px) {
  .search-overlay { padding-top: 1.5rem; align-items: flex-start; }
  .search-modal { width: 100vw; max-height: calc(100vh - 1.5rem); border-radius: 12px 12px 0 0; margin-top: auto; }
}
.cdm-notify-result { margin-top: 1rem; padding: .85rem 1rem; border-radius: var(--radius); font-size: .84rem; line-height: 1.55; }
.cdm-notify-result.hidden { display: none; }
.cdm-notify-required { background: #fef2f2; border: 1px solid #fca5a5; color: #7f1d1d; }
.cdm-notify-required strong { display: block; margin-bottom: .3rem; }
.cdm-notify-required a { color: #b91c1c; }
.cdm-notify-not-required { background: #f0fdf4; border: 1px solid #86efac; color: #14532d; }
.cdm-notify-not-required strong { display: block; margin-bottom: .3rem; }
.cdm-single-note { font-size: .85rem; line-height: 1.6; margin-bottom: .5rem; }
.cdm-single-note strong { display: block; margin-bottom: .35rem; color: var(--navy); }
.cdm-single-note p { color: var(--text); margin-bottom: 0; }

/* Section headings */
.cdm-section-title { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin: 1.5rem 0 .75rem; }

/* Duty holder cards */
.cdm-duty-grid { display: grid; grid-template-columns: 1fr; gap: .75rem; margin-bottom: 1.5rem; }
@media (min-width: 700px) { .cdm-duty-grid { grid-template-columns: 1fr 1fr; } }
.cdm-duty-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.cdm-duty-header { display: flex; align-items: baseline; gap: .6rem; margin-bottom: .45rem; }
.cdm-duty-num { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: .15rem .45rem; border-radius: 3px; white-space: nowrap; color: #fff; }
a.cdm-duty-num { text-decoration: none; cursor: pointer; transition: opacity .15s; }
a.cdm-duty-num:hover { opacity: .75; }
.cdm-duty-name { font-size: .95rem; font-weight: 700; color: var(--navy-dark); }
.cdm-client     .cdm-duty-num { background: #1a2e44; }
.cdm-pd         .cdm-duty-num { background: #2d6a8a; }
.cdm-pc         .cdm-duty-num { background: #2d8a4e; }
.cdm-designer   .cdm-duty-num { background: #c98800; }
.cdm-contractor .cdm-duty-num { background: #8e44ad; }
.cdm-client     { border-left: 3px solid #1a2e44; }
.cdm-pd         { border-left: 3px solid #2d6a8a; }
.cdm-pc         { border-left: 3px solid #2d8a4e; }
.cdm-designer   { border-left: 3px solid #c98800; }
.cdm-contractor { border-left: 3px solid #8e44ad; }
.cdm-duty-who { font-size: .78rem; color: var(--text-muted); line-height: 1.5; margin-bottom: .6rem; font-style: italic; }
.cdm-duty-list { padding-left: 1.1rem; display: flex; flex-direction: column; gap: .3rem; }
.cdm-duty-list li { font-size: .82rem; line-height: 1.5; }
.cdm-duty-note { margin-top: .65rem; font-size: .77rem; background: var(--bg); border-radius: 4px; padding: .4rem .65rem; color: var(--text-muted); border-left: 2px solid var(--amber); }

/* Phase guide */
.cdm-phases { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1.5rem; }
.cdm-phase { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.cdm-phase summary { padding: .9rem 1.1rem; cursor: pointer; list-style: none; display: flex; align-items: center; gap: .75rem; }
.cdm-phase summary::-webkit-details-marker { display: none; }
.cdm-phase summary::after { content: '▾'; font-size: .8rem; color: var(--text-muted); margin-left: auto; }
.cdm-phase[open] summary::after { content: '▴'; }
.cdm-phase summary:hover { background: var(--bg); }
.cdm-phase-num { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: var(--navy); color: #fff; padding: .15rem .5rem; border-radius: 3px; white-space: nowrap; }
.cdm-phase-name { font-size: .9rem; font-weight: 600; color: var(--navy-dark); }
.cdm-phase-body { padding: .25rem 1.1rem 1.1rem; }
.cdm-phase-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 680px) { .cdm-phase-grid { grid-template-columns: 1fr 1fr; } }
.cdm-phase-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--navy-dark); margin-bottom: .5rem; }
.cdm-phase-body ul { padding-left: 1.1rem; display: flex; flex-direction: column; gap: .3rem; }
.cdm-phase-body li { font-size: .83rem; line-height: 1.5; }
.cdm-doc-mini { background: var(--bg); border-radius: 6px; padding: .75rem; font-size: .82rem; border-left: 3px solid var(--navy); }
.cdm-doc-mini strong { display: block; margin-bottom: .35rem; color: var(--navy-dark); }
.cdm-doc-mini p { margin: 0; color: var(--text-muted); line-height: 1.55; }

/* Key documents grid */
.cdm-docs-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: .65rem; margin-bottom: 1.5rem; }
@media (max-width: 540px) { .cdm-docs-grid { grid-template-columns: 1fr; } }
.cdm-welfare-details { margin-top: 1.25rem; }
.cdm-welfare-body { padding-top: .75rem; }
.cdm-welfare-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: .65rem; }
@media (max-width: 540px) { .cdm-welfare-grid { grid-template-columns: 1fr; } }
.cdm-welfare-item { background: var(--bg); border-radius: 6px; padding: .7rem .9rem; }
.cdm-welfare-title { font-size: .82rem; font-weight: 700; color: var(--navy-dark); margin-bottom: .25rem; }
.cdm-welfare-desc { font-size: .775rem; color: var(--text-muted); line-height: 1.45; }
.cdm-doc-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; }
.cdm-doc-title { font-size: .88rem; font-weight: 700; color: var(--navy-dark); margin-bottom: .55rem; }
.cdm-doc-row { display: flex; justify-content: space-between; gap: .5rem; font-size: .78rem; padding: .2rem 0; border-bottom: 1px solid var(--border); }
.cdm-doc-row:last-child { border-bottom: none; }
.cdm-doc-row span { color: var(--text-muted); }
.cdm-doc-row strong { text-align: right; }

/* ── H&S Policy ─────────────────────────────────────────────────────────────── */
.policy-law-card { border-left: 4px solid var(--navy); padding: 1rem 1.25rem; margin-bottom: 1.25rem; }
.policy-law-header { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; font-size: .95rem; }
.policy-law-icon { font-size: 1.1rem; }
.policy-law-card p { font-size: .875rem; color: var(--text-muted); line-height: 1.6; margin-bottom: .65rem; }
.policy-law-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.policy-law-badge { font-size: .72rem; font-weight: 600; background: var(--navy); color: #fff; padding: .2rem .55rem; border-radius: 3px; }

.policy-parts-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: .75rem; margin-bottom: 1.5rem; }
@media (max-width:600px) { .policy-parts-grid { grid-template-columns: 1fr; } }
.policy-part-card { border-radius: var(--radius); padding: 1rem; color: #fff; }
.policy-part-1 { background: var(--navy); }
.policy-part-2 { background: var(--amber-dark); }
.policy-part-3 { background: var(--green); }
.policy-part-num { font-size: .72rem; font-weight: 700; opacity: .8; text-transform: uppercase; letter-spacing: .05em; margin-bottom: .25rem; }
.policy-part-name { font-size: .95rem; font-weight: 700; margin-bottom: .4rem; }
.policy-part-desc { font-size: .78rem; opacity: .9; line-height: 1.45; }

.policy-guide { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1.5rem; }
.policy-section { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.policy-section summary { padding: .9rem 1.1rem; font-size: .9rem; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; color: var(--navy-dark); }
.policy-section summary::-webkit-details-marker { display: none; }
.policy-section summary::after { content: '▾'; font-size: .8rem; color: var(--text-muted); }
.policy-section[open] summary::after { content: '▴'; }
.policy-section summary:hover { background: var(--bg); }
.policy-section-1 { border-left: 3px solid var(--navy); }
.policy-section-2 { border-left: 3px solid var(--amber-dark); }
.policy-section-3 { border-left: 3px solid #2d8a4e; }
.policy-section-4 { border-left: 3px solid var(--amber); }
.policy-section-1 summary:hover { background: rgba(26,46,68,.04); }
.policy-section-2 summary:hover { background: rgba(201,136,0,.04); }
.policy-section-3 summary:hover { background: rgba(45,138,78,.04); }
.policy-section-4 summary:hover { background: rgba(240,165,0,.04); }
.policy-section-body { padding: .25rem 1.1rem 1.1rem; }
.policy-intro { font-size: .855rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 1rem; }

.policy-guide-items { display: flex; flex-direction: column; gap: .85rem; }
.policy-guide-item { background: var(--bg); border-radius: 6px; padding: .75rem 1rem; }
.policy-item-label { display: block; font-size: .78rem; font-weight: 700; color: var(--navy-dark); text-transform: uppercase; letter-spacing: .04em; margin-bottom: .45rem; }
.policy-guide-item ul { padding-left: 1.15rem; display: flex; flex-direction: column; gap: .3rem; }
.policy-guide-item li { font-size: .835rem; line-height: 1.5; }

.policy-example-block { margin-top: 1.25rem; border: 1.5px dashed var(--border); border-radius: 8px; overflow: hidden; }
.policy-example-label { background: rgba(26,46,68,.05); padding: .5rem 1rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.policy-example-body { padding: 1rem 1.25rem; font-size: .83rem; line-height: 1.65; color: var(--text); }
.policy-example-body p, .policy-example-body ul { margin: 0 0 .65rem; }
.policy-example-body ul { padding-left: 1.35rem; }
.policy-example-body li { margin-bottom: .3rem; }
.policy-example-co { font-size: .9rem; }
.policy-example-section-head { font-weight: 700; font-size: .85rem; color: var(--navy); margin-bottom: .5rem; text-decoration: underline; }
.policy-example-sig { margin-top: 1rem; border-top: 1px solid var(--border); padding-top: .85rem; display: flex; flex-direction: column; gap: .45rem; font-size: .82rem; }
.policy-example-line { display: inline-block; border-bottom: 1px solid #999; }
.policy-arrangements-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: .65rem; }
@media (max-width:600px) { .policy-arrangements-grid { grid-template-columns: 1fr; } }
.policy-arrangement-item { background: var(--bg); border-radius: 6px; padding: .7rem .9rem; }
.policy-arrangement-topic { font-size: .82rem; font-weight: 600; color: var(--navy-dark); margin-bottom: .25rem; }
.policy-arrangement-detail { font-size: .775rem; color: var(--text-muted); line-height: 1.45; }

.policy-full-example { border: 1.5px solid var(--border); border-radius: 8px; overflow: hidden; margin-top: .75rem; }
.policy-full-header { background: var(--navy); color: #fff; padding: .75rem 1.25rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .35rem; }
.policy-full-co { font-size: .95rem; font-weight: 700; }
.policy-full-ver { font-size: .72rem; opacity: .75; }
.policy-full-part { padding: 1rem 1.25rem; border-top: 1px solid var(--border); font-size: .835rem; line-height: 1.65; color: var(--text); }
.policy-full-part:first-of-type { border-top: none; }
.policy-full-part p, .policy-full-part ul { margin: 0 0 .6rem; }
.policy-full-part ul { padding-left: 1.35rem; }
.policy-full-part li { margin-bottom: .25rem; }
.policy-full-part-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--navy); background: rgba(26,46,68,.05); margin: -1rem -1.25rem .85rem; padding: .45rem 1.25rem; border-bottom: 1px solid var(--border); }
.policy-org-table { width: 100%; border-collapse: collapse; font-size: .82rem; margin-top: .25rem; }
.policy-org-table th { background: rgba(26,46,68,.07); padding: .45rem .75rem; text-align: left; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--navy); border-bottom: 2px solid var(--border); }
.policy-org-table td { padding: .55rem .75rem; vertical-align: top; border-bottom: 1px solid var(--border); line-height: 1.5; }
.policy-org-table td:first-child { white-space: nowrap; font-weight: 600; color: var(--navy-dark); width: 28%; }
.policy-org-table td em { display: block; font-size: .72rem; color: var(--text-muted); font-weight: 400; }
@media (max-width:500px) { .policy-org-table td:first-child { width: auto; white-space: normal; } }

.policy-resources { padding: 1rem 1.25rem; }
.policy-resources strong { display: block; margin-bottom: .65rem; font-size: .9rem; }
.policy-resources-links { display: flex; gap: .6rem; flex-wrap: wrap; }
.policy-resource-btn { font-size: .8rem; font-weight: 600; padding: .4rem .85rem; border: 1px solid var(--border); border-radius: 5px; text-decoration: none; color: var(--navy); background: var(--bg-card); transition: border-color .15s, background .15s; }
.policy-resource-btn:hover { border-color: var(--navy); background: var(--bg); }
.policy-resource-example { background: var(--green); color: #fff; border-color: var(--green); }
.policy-resource-example:hover { background: #236b3c; border-color: #236b3c; color: #fff; }
.policy-resource-dl { background: var(--navy); color: #fff; border-color: var(--navy); }
.policy-resource-dl:hover { background: var(--navy-dark); border-color: var(--navy-dark); color: #fff; }

/* ── Video Library ──────────────────────────────────────────────────────────── */

/* Footer bar with YouTube channel link + attribution */
.vid-footer-bar { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: .75rem; }
.vid-footer-yt { display: flex; align-items: center; gap: .85rem; }
.vid-footer-yt svg { flex-shrink: 0; }
.vid-footer-yt strong { display: block; font-size: .88rem; color: var(--navy-dark); margin-bottom: .2rem; }
.vid-footer-yt p { font-size: .8rem; color: var(--text-muted); margin: 0; }
.vid-footer-yt a { color: var(--navy); }
.vid-footer-attr { font-size: .73rem; color: var(--text-muted); line-height: 1.55; margin: 0; }
.vid-footer-attr a { color: var(--navy); }

/* Video card grid — 2 columns with descriptions */
.vid-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 1rem; }
@media (max-width: 540px) { .vid-grid { grid-template-columns: 1fr; } }

.vid-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; text-align: left; padding: 0; transition: box-shadow .15s, border-color .15s; width: 100%; display: flex; flex-direction: column; }
.vid-card:hover { box-shadow: var(--shadow-md); border-color: var(--navy); }

.vid-thumb-wrap { position: relative; aspect-ratio: 16/9; overflow: hidden; background: #111; flex-shrink: 0; }
.vid-thumb { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .2s; }
.vid-card:hover .vid-thumb { opacity: .85; }
.vid-play-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.vid-play-btn { width: 46px; height: 46px; background: rgba(0,0,0,.62); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.15rem; padding-left: 4px; transition: background .15s; }
.vid-card:hover .vid-play-btn { background: #c00; }

.vid-card-body { padding: .9rem 1rem 1rem; display: flex; flex-direction: column; flex: 1; }
.vid-card-badges { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; margin-bottom: .5rem; }
.vid-cat-badge { display: inline-block; font-size: .7rem; font-weight: 600; padding: .15rem .45rem; border-radius: 3px; align-self: flex-start; }
.vid-source-badge { display: inline-block; font-size: .68rem; font-weight: 600; padding: .15rem .4rem; border-radius: 3px; background: #e8f0e9; color: #2d6a35; border: 1px solid #b8d9bc; align-self: flex-start; }
.vid-title { font-size: .88rem; font-weight: 700; line-height: 1.4; color: var(--navy-dark); margin-bottom: .4rem; }
.vid-desc { font-size: .79rem; color: var(--text-muted); line-height: 1.55; margin-bottom: .65rem; flex: 1; }
.vid-watch-cta { font-size: .78rem; font-weight: 600; color: var(--navy); align-self: flex-start; margin-top: auto; }

/* Footer link below grid */
.vid-channel-footer { margin-top: 1.75rem; padding-top: 1rem; border-top: 1px solid var(--border); text-align: center; font-size: .8rem; color: var(--text-muted); }
.vid-channel-footer a { color: var(--navy); }

/* Detail / player view */
.vid-detail { display: flex; flex-direction: column; gap: 1rem; }

.vid-back-btn { display: inline-flex; align-items: center; gap: .35rem; background: none; border: 1px solid var(--border); border-radius: var(--radius); padding: .45rem .85rem; font-size: .82rem; color: var(--navy); cursor: pointer; align-self: flex-start; transition: background .15s, border-color .15s; }
.vid-back-btn:hover { background: var(--bg); border-color: var(--navy); }

.vid-player-wrap { width: 100%; max-width: 820px; margin: 0 auto; }
.vid-player-ratio { position: relative; aspect-ratio: 16/9; background: #000; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md); }
.vid-player-ratio iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }

.vid-detail-info { max-width: 820px; margin: 0 auto; width: 100%; }
.vid-detail-meta { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-bottom: .15rem; }
.vid-detail-title { font-size: 1.05rem; font-weight: 700; color: var(--navy-dark); margin: .5rem 0 .5rem; line-height: 1.4; }
.vid-detail-desc { font-size: .85rem; color: var(--text); line-height: 1.65; margin-bottom: .75rem; }
.vid-detail-attr { font-size: .75rem; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: .6rem; }
.vid-detail-attr a { color: var(--navy); }

/* OGL attribution line inside disclaimer card */
.disclaimer-ogl { margin-top: .6rem; padding-top: .6rem; border-top: 1px solid rgba(240,165,0,.25); font-size: .8rem; }
.disclaimer-ogl a { color: var(--amber-dark); }

/* Site-wide footer */
.app-footer {
  margin-top: 3rem;
  padding: .5rem 1.5rem;
  font-size: .68rem;
  color: #94a3b8;
  text-align: center;
}
.app-footer a { color: #94a3b8; text-decoration: none; }
.app-footer a:hover { color: var(--navy); }
.app-footer-disclaimer { color: #b0bec5; font-style: italic; margin-bottom: .35rem; max-width: 640px; margin-left: auto; margin-right: auto; }

/* Exit confirmation panel */
.exit-panel-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 9998;
  display: flex; align-items: flex-end; justify-content: center;
}
.exit-panel-overlay.hidden { display: none; }
.exit-panel {
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 1.25rem 1.5rem 2.25rem;
  width: 100%;
  box-shadow: 0 -4px 24px rgba(0,0,0,.14);
}
@media (min-width: 540px) {
  .exit-panel-overlay { align-items: center; padding: 1rem; }
  .exit-panel { border-radius: 12px; max-width: 420px; padding: 1.5rem 1.75rem; }
}
.exit-panel-label {
  font-size: .67rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); margin: 0 0 .65rem;
}
.exit-panel-domain {
  display: inline-block; font-size: .75rem; font-weight: 700;
  background: rgba(26,46,68,.08); color: var(--navy);
  padding: .2rem .65rem; border-radius: 999px; margin-bottom: .75rem;
}
.exit-panel-msg { font-size: .875rem; color: var(--text); margin: 0 0 1.25rem; line-height: 1.5; }
.exit-panel-actions { display: flex; gap: .65rem; flex-direction: column; }
@media (min-width: 400px) {
  .exit-panel-actions { flex-direction: row; }
}
.exit-panel-go {
  flex: 1; display: block; text-align: center; padding: .65rem 1.25rem;
  background: var(--navy); color: #fff; border-radius: 6px;
  text-decoration: none; font-weight: 700; font-size: .875rem; border: none; cursor: pointer;
}
.exit-panel-go:hover { opacity: .9; }
.exit-panel-stay {
  flex: 0 0 auto; display: block; text-align: center; padding: .65rem 1.25rem;
  background: transparent; border: 1.5px solid var(--border);
  color: var(--text); border-radius: 6px; font-weight: 600;
  font-size: .875rem; cursor: pointer; white-space: nowrap;
}
.exit-panel-stay:hover { background: var(--bg-card); }

/* ── Shared form utilities ──────────────────────────────────────────────────── */
.fields-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 500px) { .fields-row { grid-template-columns: 1fr; } }

.fieldset-hint { font-size: .82rem; color: var(--text-muted); line-height: 1.55; margin: -.25rem 0 .75rem; }
.hint-text { font-size: .82rem; color: var(--text-muted); line-height: 1.55; margin-bottom: .75rem; }
.starter-notice { background: rgba(26,46,68,.06); border-left: 3px solid var(--navy); border-radius: 0 6px 6px 0; padding: .65rem 1rem; font-size: .82rem; color: var(--navy); margin-bottom: 1rem; line-height: 1.5; }
.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; padding-top: .5rem; }
.btn-back { background: none; border: 1px solid var(--border); border-radius: var(--radius); padding: .4rem .85rem; font-size: .82rem; cursor: pointer; color: var(--navy); transition: background .15s, border-color .15s; }
.btn-back:hover { background: var(--bg); border-color: var(--navy); }

/* ── List header ────────────────────────────────────────────────────────────── */
.list-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.list-header h3 { margin: 0; }

/* ── Worked example starter cards ──────────────────────────────────────────── */
.ra-starters-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; margin-top: .5rem; }
.ra-starter-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; gap: .45rem; }
.ra-starter-icon { font-size: 1.5rem; line-height: 1; }
.ra-starter-label { font-size: .88rem; font-weight: 700; color: var(--navy-dark); line-height: 1.3; }
.ra-starter-desc { font-size: .78rem; color: var(--text-muted); line-height: 1.5; flex: 1; }

/* ── Task Starters grid (RA list page) ──────────────────────────────────────── */
.ra-task-starters-section { margin: 1.5rem 0 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card); }
.ra-task-starters-section > summary { cursor: pointer; padding: .85rem 1rem; font-size: .9rem; font-weight: 600; color: var(--navy-dark); list-style: none; display: flex; align-items: center; gap: .5rem; }
.ra-task-starters-section > summary::before { content: '▶'; font-size: .65rem; color: var(--text-muted); transition: transform .2s; }
.ra-task-starters-section[open] > summary::before { transform: rotate(90deg); }
.ra-task-starters-section > summary::-webkit-details-marker { display: none; }
.ra-ts-body { padding: 0 1rem 1rem; }
.ra-ts-filter-row { display: flex; gap: .5rem; margin-bottom: .75rem; flex-wrap: wrap; }
.ra-ts-search { flex: 1; min-width: 160px; padding: .42rem .65rem; font-size: .82rem; border: 1px solid var(--border); border-radius: 5px; background: var(--bg); color: var(--text); }
.ra-ts-cat { padding: .42rem .65rem; font-size: .82rem; border: 1px solid var(--border); border-radius: 5px; background: var(--bg); color: var(--text); }
.ra-ts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .5rem; }
.ra-ts-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: .7rem .8rem; display: flex; flex-direction: column; gap: .3rem; }
.ra-ts-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .35rem; min-height: 1.6rem; }
.ra-ts-sector { font-size: .67rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; line-height: 1.3; flex: 1; }
.ra-ts-title { font-size: .81rem; font-weight: 600; color: var(--navy-dark); line-height: 1.4; flex: 1; }
.ra-ts-load { margin-top: .35rem; align-self: flex-start; }
.ra-ts-count { font-size: .74rem; color: var(--text-muted); margin-top: .5rem; min-height: 1em; }
@media (max-width: 500px) { .ra-ts-grid { grid-template-columns: 1fr 1fr; } }

/* ── Live Field Additions (RA form) ─────────────────────────────────────────── */
.fa-entries-list { margin-bottom: .75rem; }
.fa-no-entries { font-size: .82rem; color: var(--text-muted); font-style: italic; padding: .4rem 0; }
.fa-entry { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: .6rem .8rem; margin-bottom: .45rem; }
.fa-entry-header { display: flex; align-items: center; gap: .5rem; margin-bottom: .3rem; flex-wrap: wrap; }
.fa-entry-ts { font-size: .7rem; color: var(--text-muted); margin-left: auto; white-space: nowrap; }
.fa-entry-text { font-size: .84rem; color: var(--text); line-height: 1.5; white-space: pre-wrap; }
.fa-badge { display: inline-block; font-size: .67rem; font-weight: 700; padding: .1rem .42rem; border-radius: 3px; letter-spacing: .01em; }
.fa-badge-start   { background: #dcfce7; color: #166534; }
.fa-badge-hazard  { background: #fef2f2; color: #b91c1c; }
.fa-badge-control { background: #eff6ff; color: #1d4ed8; }
.fa-badge-obs     { background: #fef9c3; color: #854d0e; }
.fa-badge-end     { background: #f0fdf4; color: #15803d; }
.fa-add-form { border-top: 1px solid var(--border); padding-top: .85rem; margin-top: .25rem; }
.fa-add-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .5rem; flex-wrap: wrap; }
.fa-ts-preview { font-size: .74rem; color: var(--text-muted); }
.fa-lock-note { font-size: .73rem; color: var(--text-muted); margin-top: .6rem; font-style: italic; border-left: 3px solid var(--border); padding-left: .55rem; line-height: 1.5; }
.fa-unsaved-note { font-size: .82rem; color: var(--text-muted); font-style: italic; }

/* ── Record list (Management Plans, H&S Policy) ─────────────────────────────── */
.mgmt-plan-list { display: flex; flex-direction: column; }
.mgmt-plan-item { display: flex; align-items: center; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--border); }
.mgmt-plan-item:last-child { border-bottom: none; }
.mgmt-plan-info { flex: 1; min-width: 0; }
.mgmt-plan-title { font-size: .9rem; font-weight: 600; color: var(--navy-dark); margin-bottom: .2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mgmt-plan-meta { font-size: .775rem; color: var(--text-muted); display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; line-height: 1.4; }
.mgmt-plan-actions { display: flex; gap: .4rem; flex-shrink: 0; }
@media (max-width: 500px) { .mgmt-plan-item { flex-wrap: wrap; } .mgmt-plan-actions { width: 100%; } }

/* ── Method Statements ───────────────────────────────────────────────────────── */
.ms-info-card { padding: 1rem 1.1rem; }
.ms-info-body strong { display: block; margin-bottom: .35rem; font-size: .9rem; color: var(--navy-dark); }
.ms-info-body p { font-size: .82rem; color: var(--text-muted); line-height: 1.6; }
.ms-starters-section { margin: 1.5rem 0 0; }
.ms-starters-section > summary { cursor: pointer; font-size: .9rem; font-weight: 600; color: var(--navy-dark); list-style: none; display: flex; align-items: center; gap: .5rem; padding: .85rem 1rem; }
.ms-starters-section > summary::before { content: '▶'; font-size: .65rem; color: var(--text-muted); transition: transform .2s; }
.ms-starters-section[open] > summary::before { transform: rotate(90deg); }
.ms-starters-section > summary::-webkit-details-marker { display: none; }
.ms-starters-body { padding: 0 1rem 1rem; }
.ms-starters-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .65rem; margin-top: .5rem; }
.ms-starter-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem; display: flex; flex-direction: column; gap: .35rem; }
.ms-starter-title { font-size: .87rem; font-weight: 700; color: var(--navy-dark); }
.ms-starter-desc { font-size: .76rem; color: var(--text-muted); line-height: 1.4; flex: 1; }
.ms-your-section { margin-top: 1.5rem; }
.ms-your-section h3 { font-size: .95rem; font-weight: 600; color: var(--navy-dark); margin-bottom: .75rem; }
.ms-list { display: flex; flex-direction: column; gap: .4rem; }
.ms-card { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; transition: box-shadow .15s; }
.ms-card:hover { box-shadow: var(--shadow-md); }
.ms-card-info { flex: 1; min-width: 0; }
.ms-card-title { font-size: .88rem; font-weight: 600; color: var(--navy-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-card-meta { font-size: .75rem; color: var(--text-muted); margin-top: .1rem; }
.ms-hazard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 600px) { .ms-hazard-grid { grid-template-columns: 1fr; } }
.ms-steps-list { display: flex; flex-direction: column; gap: .75rem; margin-top: .5rem; }
.ms-step-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.ms-step-header { display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem; background: var(--bg-card); border-bottom: 1px solid var(--border); }
.ms-step-num { display: inline-flex; align-items: center; justify-content: center; width: 1.4rem; height: 1.4rem; background: var(--navy); color: #fff; border-radius: 50%; font-size: .7rem; font-weight: 700; flex-shrink: 0; }
.ms-step-name { flex: 1; border: none; background: transparent; font-size: .87rem; font-weight: 600; color: var(--navy-dark); padding: .1rem .25rem; outline: none; font-family: inherit; }
.ms-step-name:focus { background: var(--bg); border-radius: 3px; outline: 1px solid var(--navy); }
.ms-step-remove { flex-shrink: 0; }
.ms-step-detail { width: 100%; border: none; padding: .65rem .75rem; font-family: inherit; font-size: .84rem; line-height: 1.55; color: var(--text); background: transparent; resize: vertical; min-height: 100px; outline: none; display: block; }
.ms-step-detail:focus { background: rgba(26,46,68,.02); }
.ms-user-templates-section { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.ms-user-templates-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: .15rem; }
.ms-user-template-card { border-color: var(--navy); background: rgba(26,46,68,.03); }
.ms-template-actions { display: flex; align-items: center; gap: .5rem; margin-top: .2rem; }
.ms-template-actions .ra-example-load { flex: 1; }
@media (max-width: 500px) { .ms-starters-grid { grid-template-columns: 1fr; } }

/* ── Review date badges ──────────────────────────────────────────────────────── */
.review-badge { display: inline-block; font-size: .7rem; font-weight: 700; padding: .15rem .45rem; border-radius: 3px; }
.review-overdue { background: #fef2f2; color: #b91c1c; border: 1px solid #fca5a5; }
.review-soon    { background: #fffbeb; color: #92400e; border: 1px solid #fcd34d; }

/* ── Dashboard: Reviews Due section ─────────────────────────────────────────── */
.reviews-list { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 1.5rem; }
.review-item { display: flex; align-items: center; gap: 1rem; padding: .85rem 1rem; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .15s; }
.review-item:last-child { border-bottom: none; }
.review-item:hover { background: var(--bg); }
.review-item--overdue { background: #fff9f9; }
.review-item--overdue:hover { background: #fef2f2; }
.review-item--soon { background: var(--bg-card); }
.review-item-left { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.review-item-type { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.review-item-title { font-size: .88rem; font-weight: 600; color: var(--navy-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.review-item-right { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; color: var(--text-muted); }
.review-item-date { font-size: .78rem; }

/* ── Quick action cards: Policy + Plan ──────────────────────────────────────── */
.qa-card--policy { border-top: 3px solid #2d8a4e; }
.qa-card--policy .qa-icon-wrap { background: rgba(45,138,78,.13); }
.qa-card--policy .qa-icon-wrap svg { stroke: #2d8a4e; }
.qa-card--policy:hover { border-color: #2d8a4e; background: rgba(45,138,78,.025); }

.qa-card--plan   { border-top: 3px solid #c98800; }
.qa-card--plan   .qa-icon-wrap { background: rgba(201,136,0,.12); }
.qa-card--plan   .qa-icon-wrap svg { stroke: #c98800; }
.qa-card--plan:hover { border-color: #c98800; background: rgba(201,136,0,.025); }

/* ── Smart Suggestions ───────────────────────────────────────────────────────── */
.smart-sugg-bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  background: #f0f7ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: .4rem .65rem;
  margin-top: .35rem;
  font-size: .78rem;
}
.smart-sugg-label { color: #3b5a8a; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.smart-sugg-chips { display: flex; flex-wrap: wrap; gap: .3rem; flex: 1; }
.smart-sugg-chip {
  background: #fff;
  border: 1px solid #93c5fd;
  border-radius: 999px;
  padding: .18rem .65rem;
  font-size: .73rem;
  font-weight: 600;
  color: #1d4ed8;
  cursor: pointer;
  transition: background .12s, border-color .12s;
  white-space: nowrap;
}
.smart-sugg-chip:hover { background: #dbeafe; border-color: #3b82f6; }
.smart-sugg-chip--used { opacity: .45; cursor: default; }
.smart-sugg-dismiss { background: none; border: none; color: #6b7280; font-size: 1rem; line-height: 1; cursor: pointer; padding: 0 .2rem; flex-shrink: 0; }
.smart-sugg-dismiss:hover { color: var(--navy); }

/* ── Settings: toggle switch ─────────────────────────────────────────────────── */
.settings-toggle-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.25rem; }
.settings-toggle-info { flex: 1; min-width: 0; }
.settings-toggle-label { font-weight: 600; font-size: .9rem; color: var(--navy); margin-bottom: .2rem; }
.settings-toggle-desc { font-size: .8rem; color: var(--text-muted); line-height: 1.5; }
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; margin-top: .1rem; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: #d1d5db; border-radius: 999px; cursor: pointer; transition: background .2s; }
.toggle-slider::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle-switch input:checked + .toggle-slider { background: var(--navy); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── Cross-record links ──────────────────────────────────────────────────────── */
.nm-badge--ra { background: #e8f4fd; color: #1565a8; border: 1px solid #b3d4f5; }
.nm-linked-section { margin-top: 1.5rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; }
.nm-linked-header { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: .75rem; }
.nm-ra-link-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem; }
.nm-ra-link-info { flex: 1; min-width: 0; }
.linked-nm-row:hover { background: var(--bg); }

/* ── RIDDOR Report Form ──────────────────────────────────────────────────────── */
.riddor-report-notice {
  background: #fdf0ef;
  border-left: 4px solid #c0392b;
  border-radius: var(--radius);
  padding: .85rem 1.1rem;
  font-size: .85rem;
  color: #5a1a14;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}
.riddor-report-notice a { color: #c0392b; }

/* ── Accident / Incident Record Cards ───────────────────────────────────────── */
.acc-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}
.acc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .15s, transform .15s;
}
.acc-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.1); transform: translateY(-2px); }
.acc-card-accent { height: 4px; background: #b71c1c; }
.acc-card-content {
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.acc-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
}
.acc-card-title { font-weight: 600; font-size: .95rem; color: var(--text); flex: 1; }
.acc-badge { border-radius: 99px; padding: .18rem .6rem; font-size: .72rem; font-weight: 600; white-space: nowrap; }
.acc-badge--low  { background: #dcfce7; color: #166534; }
.acc-badge--med  { background: #fef9c3; color: #854d0e; }
.acc-badge--high { background: #fee2e2; color: #991b1b; }
.acc-card-meta { font-size: .78rem; color: var(--muted); display: flex; gap: .65rem; flex-wrap: wrap; align-items: center; }
.acc-riddor-flag { color: #dc2626; font-weight: 600; font-size: .75rem; }
.acc-committed-flag { color: #16a34a; font-weight: 600; font-size: .75rem; }
.acc-card-actions { display: flex; gap: .5rem; margin-top: .35rem; flex-wrap: wrap; }

/* Quick Action — Accident Record */
.qa-card--acc    { border-top: 3px solid #b71c1c; }
.qa-card--acc    .qa-icon-wrap { background: rgba(183,28,28,.13); }
.qa-card--acc    .qa-icon-wrap svg { stroke: #b71c1c; }
.qa-card--acc:hover { border-color: #b71c1c; background: rgba(183,28,28,.025); }

/* ── Toolbox Talk Cards ──────────────────────────────────────────────────────── */
.tbt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .15s, transform .15s;
}
.tbt-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.1); transform: translateY(-2px); }
.tbt-card-accent {
  height: 4px;
  background: #1565c0;
}
.tbt-card-content {
  padding: 1rem 1.1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.tbt-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
}
.tbt-card-title {
  font-weight: 600;
  font-size: .95rem;
  color: var(--text);
  flex: 1;
}
.tbt-card-meta {
  font-size: .78rem;
  color: var(--muted);
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}
.tbt-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .25rem;
}
.tbt-card-tags .tag {
  background: #e3f2fd;
  color: #1565c0;
  border-radius: 99px;
  padding: .15rem .55rem;
  font-size: .72rem;
  font-weight: 500;
}

.field-hint {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: .3rem;
  line-height: 1.4;
}

/* ── Training Records ───────────────────────────────────────────────────────── */
.tr-filter-row {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.tr-list { display: flex; flex-direction: column; gap: .6rem; }
.tr-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: box-shadow .15s, transform .15s;
}
.tr-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.1); transform: translateY(-1px); }
.tr-card-main { flex: 1; min-width: 0; }
.tr-card-person { font-weight: 600; font-size: .92rem; color: var(--text); }
.tr-card-role { font-weight: 400; color: var(--text-muted); }
.tr-card-course { font-size: .95rem; color: var(--text); margin: .15rem 0; }
.tr-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem .75rem;
  font-size: .76rem;
  color: var(--text-muted);
  margin-top: .35rem;
  align-items: center;
}
.tr-cat-chip {
  background: #e8f0fe;
  color: #1a56c4;
  border-radius: 99px;
  padding: .1rem .5rem;
  font-size: .72rem;
  font-weight: 500;
}
.tr-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .4rem;
  flex-shrink: 0;
}
.tr-badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  padding: .2rem .55rem;
  border-radius: 99px;
  text-align: center;
  line-height: 1.3;
}
.tr-badge small { font-weight: 400; font-size: .68rem; display: block; }
.insp-cat-chip {
  background: #e8f5e9;
  color: #1b6b2e;
  border-radius: 99px;
  padding: .1rem .5rem;
  font-size: .72rem;
  font-weight: 500;
}
.tr-badge--overdue { background: #fde8e8; color: var(--red); }
.tr-badge--soon    { background: #fff3cd; color: #7a5600; }
.tr-badge--valid   { background: #e6f4ea; color: #1e7e34; }
.tr-badge--none    { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }

/* ── AMP / COSHH shared row styles ───────────────────────────────────────────── */
.acm-row { border: 1px solid var(--border); border-radius: 8px; padding: 1rem; margin-bottom: .75rem; background: var(--bg); }
.acm-row-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.acm-row-num { font-weight: 600; font-size: .85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.btn-link-danger { background: none; border: none; color: var(--red); font-size: .8rem; cursor: pointer; padding: 0; text-decoration: underline; }
.btn-link-danger:hover { opacity: .75; }
.coshh-routes-row { display: flex; flex-wrap: wrap; gap: .4rem .85rem; margin-top: .3rem; }
.coshh-route-check { display: flex; align-items: center; gap: .3rem; font-size: .85rem; cursor: pointer; }
.coshh-route-check input { width: auto; accent-color: var(--navy); }

/* ── Contractor RAMS / Site Audit performance rows ───────────────────────────── */
.crams-perf-row { display: flex; align-items: flex-start; gap: .75rem; padding: .5rem 0; border-bottom: 1px solid var(--border); }
.crams-perf-row:last-child { border-bottom: none; }
.crams-perf-label { flex: 1; font-size: .875rem; color: var(--text); padding-top: .4rem; }
.crams-perf-controls { display: flex; gap: .5rem; align-items: center; flex-shrink: 0; }
@media (max-width: 600px) {
  .crams-perf-row { flex-direction: column; gap: .4rem; }
  .crams-perf-controls { width: 100%; }
  .crams-perf-controls .form-input { flex: 1; }
}

/* ── Action Tracker ──────────────────────────────────────────────────────────── */
.action-sticky-filters {
  position: sticky;
  top: var(--topbar-h);
  z-index: 20;
  background: var(--bg);
  padding: .6rem 0 .25rem;
  margin-bottom: .5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
}
.action-summary-bar { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.action-sum-stat {
  flex: 1 1 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  padding: .9rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-top-width: 3px;
  background: var(--surface);
  cursor: pointer;
  transition: box-shadow .15s, transform .12s;
}
.action-sum-stat:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.action-sum-num { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.action-sum-lbl { font-size: .73rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.action-sum--open    { border-top-color: #dc2626; }
.action-sum--open    .action-sum-num { color: #dc2626; }
.action-sum--prog    { border-top-color: #ca8a04; }
.action-sum--prog    .action-sum-num { color: #ca8a04; }
.action-sum--closed  { border-top-color: #16a34a; }
.action-sum--closed  .action-sum-num { color: #16a34a; }
.action-sum--overdue { border-top-color: #991b1b; background: #fff5f5; }
.action-sum--overdue .action-sum-num { color: #991b1b; }

.action-filter-row { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; align-items: center; }
.action-filter-group { display: flex; gap: .3rem; flex-wrap: wrap; }
.action-filter-btn, .action-prio-btn {
  padding: .3rem .75rem;
  border-radius: 99px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
}
.action-filter-btn:hover, .action-prio-btn:hover { border-color: #0f766e; color: #0f766e; }
.action-filter-btn.active, .action-prio-btn.active { background: #0f766e; border-color: #0f766e; color: #fff; }

.action-card {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  margin-bottom: .75rem;
  transition: box-shadow .15s, transform .12s;
}
.action-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.action-card--overdue { border-color: #fca5a5; background: #fff9f9; }
.action-card-bar { width: 5px; flex-shrink: 0; }
.action-card-body { flex: 1; padding: .9rem 1rem; display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.action-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.action-card-title { font-weight: 600; font-size: .93rem; color: var(--text); flex: 1; min-width: 0; }
.action-s-badge { border-radius: 99px; padding: .18rem .6rem; font-size: .72rem; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.action-s--open   { background: #fee2e2; color: #991b1b; }
.action-s--prog   { background: #fef9c3; color: #854d0e; }
.action-s--closed { background: #dcfce7; color: #166534; }
.action-card-meta { display: flex; flex-wrap: wrap; gap: .6rem; font-size: .78rem; color: var(--muted); }
.action-prio-chip { font-weight: 600; font-size: .75rem; }
.action-overdue-lbl { color: #dc2626; font-weight: 600; }
.action-card-notes { font-size: .82rem; color: var(--muted); font-style: italic; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.action-card-btns { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .2rem; }

/* Quick Action — Action Tracker */
.qa-card--actions    { border-top: 3px solid #0f766e; }
.qa-card--actions    .qa-icon-wrap { background: rgba(15,118,110,.13); }
.qa-card--actions    .qa-icon-wrap svg { stroke: #0f766e; }
.qa-card--actions:hover { border-color: #0f766e; background: rgba(15,118,110,.025); }

/* ── DSE Assessment ──────────────────────────────────────────────────────────── */
.dse-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.dse-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; }
.dse-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.1); transform: translateY(-2px); }
.dse-card-accent { height: 4px; background: #0369a1; }
.dse-card-content { padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .4rem; }
.dse-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.dse-card-title { font-weight: 600; font-size: .95rem; color: var(--text); flex: 1; }
.dse-badge { border-radius: 99px; padding: .18rem .6rem; font-size: .72rem; font-weight: 600; white-space: nowrap; }
.dse-badge--ok    { background: #dcfce7; color: #166534; }
.dse-badge--warn  { background: #fef9c3; color: #854d0e; }
.dse-badge--alert { background: #fee2e2; color: #991b1b; }
.dse-card-meta { font-size: .78rem; color: var(--muted); display: flex; gap: .65rem; flex-wrap: wrap; }
.dse-card-actions { display: flex; gap: .5rem; margin-top: .35rem; flex-wrap: wrap; }

.form-hint-banner {
  background: #eff6ff;
  border-left: 4px solid #0369a1;
  border-radius: var(--radius);
  padding: .85rem 1.1rem;
  font-size: .84rem;
  color: #1e3a5f;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}
.dse-q-table { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: .25rem; }
.dse-q-header { display: flex; justify-content: space-between; align-items: center; background: #f3f4f6; padding: .45rem 1rem; font-size: .73rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.dse-q-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .55rem 1rem; border-top: 1px solid var(--border); }
.dse-q-label { flex: 1; font-size: .85rem; color: var(--text); }
.dse-q-opts { display: flex; gap: .75rem; flex-shrink: 0; }
.dse-radio-lbl { display: flex; align-items: center; gap: .3rem; font-size: .82rem; cursor: pointer; white-space: nowrap; color: var(--text); }
@media (max-width: 560px) {
  .dse-q-row { flex-direction: column; align-items: flex-start; gap: .4rem; }
}

/* Quick Action — DSE */
.qa-card--dse    { border-top: 3px solid #0369a1; }
.qa-card--dse    .qa-icon-wrap { background: rgba(3,105,161,.13); }
.qa-card--dse    .qa-icon-wrap svg { stroke: #0369a1; }
.qa-card--dse:hover { border-color: #0369a1; background: rgba(3,105,161,.025); }

/* Quick Action — Toolbox Talk */
.qa-card--tbt { border-top-color: #1565c0; }
.qa-card--tbt .qa-card-icon { color: #1565c0; }

/* ── Investigation Report ─────────────────────────────────────────────────── */
.inv-level-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-top: .5rem; }
.inv-level-card { display: flex; align-items: center; gap: .5rem; padding: .6rem .75rem; border: 2px solid var(--border); border-radius: var(--radius); cursor: pointer; font-weight: 600; font-size: .88rem; transition: border-color .15s, background .15s; }
.inv-level-card input[type="radio"] { accent-color: currentColor; flex-shrink: 0; }
.inv-level-minimal { color: #6b7280; } .inv-level-minimal:has(input:checked) { border-color: #6b7280; background: #f3f4f6; }
.inv-level-low     { color: #2d8a4e; } .inv-level-low:has(input:checked)     { border-color: #2d8a4e; background: #d1fae5; }
.inv-level-medium  { color: #d97706; } .inv-level-medium:has(input:checked)  { border-color: #d97706; background: #fef3c7; }
.inv-level-high    { color: #dc2626; } .inv-level-high:has(input:checked)    { border-color: #dc2626; background: #fee2e2; }
.inv-tbl-wrap { overflow-x: auto; }
.inv-action-table { width: 100%; border-collapse: collapse; font-size: .875rem; min-width: 540px; }
.inv-action-table th { background: var(--surface-alt, #f0f4f8); padding: .4rem .6rem; border: 1px solid var(--border); text-align: left; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); }
.inv-action-table td { padding: .4rem .5rem; border: 1px solid var(--border); vertical-align: top; }
.inv-action-table td input, .inv-action-table td textarea { width: 100%; }
.inv-team-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.inv-team-table th { background: var(--surface-alt, #f0f4f8); padding: .4rem .6rem; border: 1px solid var(--border); text-align: left; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); }
.inv-team-table td { padding: .4rem .5rem; border: 1px solid var(--border); vertical-align: top; }
.inv-team-table td input { width: 100%; }
@media (max-width: 600px) { .inv-level-grid { grid-template-columns: 1fr 1fr; } }

/* ── Fire Risk Assessment ─────────────────────────────────────────────────── */
.fra-haz-group-head { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #fff; background: #2d4a6a; padding: .35rem .75rem; margin-top: .75rem; border-radius: 3px 3px 0 0; }
.fra-haz-row { display: grid; grid-template-columns: 160px 1fr 130px; gap: .5rem; align-items: start; padding: .5rem 0; border-bottom: 1px solid var(--border); }
.fra-haz-row:last-child { border-bottom: none; }
.fra-haz-label { font-size: .85rem; font-weight: 500; padding-top: .45rem; line-height: 1.3; }
.fra-haz-body textarea { width: 100%; }
.fra-haz-action { display: flex; align-items: center; gap: .4rem; font-size: .82rem; padding-top: .45rem; cursor: pointer; white-space: nowrap; }
.fra-haz-action input { accent-color: var(--red, #dc2626); }
.fra-action-table .fra-ar-pri { width: 100%; font-size: .82rem; }
.fra-tag { background: #c0392b !important; }
@media (max-width: 700px) { .fra-haz-row { grid-template-columns: 1fr; } .fra-haz-label { padding-top: 0; } }

/* ── Witness Interview Q&A rows ───────────────────────────────────────────── */
.wit-qa-row {
  display: grid;
  grid-template-columns: 24px 1fr 64px 28px;
  gap: .5rem;
  align-items: start;
  padding: .6rem 0;
  border-bottom: 1px solid var(--border);
}
.wit-qa-row:last-child { border-bottom: none; }
.wit-qa-num { font-size: .8rem; font-weight: 700; color: var(--text-muted); padding-top: .6rem; text-align: center; }
.wit-qa-fields { display: flex; flex-direction: column; gap: .35rem; }
.wit-qa-fields textarea { width: 100%; }
.wit-qa-initials input { width: 100%; text-align: center; }
.wit-qa-del { margin-top: .4rem; }

/* ── Generic record-row (shared across list views) ───────────────────────── */
.record-list { display: flex; flex-direction: column; gap: .5rem; margin-top: .5rem; }
.record-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem; flex-wrap: wrap; }
.record-row-main { flex: 1; min-width: 0; }
.record-row-title { font-size: .95rem; font-weight: 600; margin-bottom: .25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.record-row-meta { display: flex; flex-wrap: wrap; gap: .4rem .75rem; font-size: .8rem; color: var(--text-muted); align-items: center; }
.record-tag { display: inline-block; padding: .1rem .45rem; border-radius: 3px; background: var(--primary); color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .03em; }
.record-row-actions { display: flex; gap: .4rem; flex-shrink: 0; }

/* Policy Library */
.policy-lib-page { max-width: 100%; }
.policy-lib-stats { display: flex; gap: .75rem; flex-wrap: wrap; margin: .75rem 0 1rem; }
.policy-lib-stat { background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; padding: .6rem 1rem; display: flex; flex-direction: column; align-items: center; min-width: 90px; }
.policy-lib-stat--green { border-color: #27ae60; background: rgba(39,174,96,.07); }
.policy-lib-stat--amber { border-color: #f39c12; background: rgba(243,156,18,.07); }
.policy-lib-stat--grey  { border-color: #95a5a6; background: rgba(149,165,166,.07); }
.policy-lib-stat-num { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.policy-lib-stat-lbl { font-size: .72rem; color: var(--text-muted); margin-top: .2rem; text-align: center; }
.policy-lib-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.policy-lib-tab { padding: .35rem .8rem; border-radius: 20px; border: 1px solid var(--border); background: var(--card-bg); color: var(--text); cursor: pointer; font-size: .82rem; transition: background .15s; }
.policy-lib-tab--active, .policy-lib-tab:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.policy-lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .75rem; }
.policy-lib-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; padding: .85rem 1rem; cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.policy-lib-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.12); border-color: var(--primary); }
.policy-lib-card-top { display: flex; align-items: center; gap: .4rem; margin-bottom: .35rem; }
.policy-lib-cat-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.policy-lib-cat-lbl { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.policy-lib-card-name { font-weight: 600; font-size: .95rem; line-height: 1.3; margin-bottom: .4rem; }
.policy-lib-card-meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.policy-lib-status { font-size: .72rem; padding: .15rem .45rem; border-radius: 4px; font-weight: 600; }
.policy-lib-date { font-size: .72rem; color: var(--text-muted); }
.policy-lib-owner { font-size: .75rem; color: var(--text-muted); margin-top: .3rem; }
.pol-content-ta { min-height: 90px; width: 100%; box-sizing: border-box; font-family: inherit; line-height: 1.55; }

/* ── Split Screen ─────────────────────────────────────────────────────────── */
.split-btn {
  display: none;
  align-items: center;
  gap: .35rem;
  background: none;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 5px;
  color: #fff;
  cursor: pointer;
  padding: .28rem .6rem;
  font-size: .74rem;
  letter-spacing: .04em;
  opacity: .75;
  transition: opacity .15s, background .15s, border-color .15s;
  flex-shrink: 0;
}
.split-btn:hover { opacity: 1; background: rgba(255,255,255,.12); }
.split-btn.is-active { background: rgba(255,255,255,.18); opacity: 1; border-color: rgba(255,255,255,.55); }
@media (min-width: 900px) { .split-btn { display: flex; } }

.page-wrap.split-active {
  display: flex !important;
  flex-direction: row;
  padding: 0 !important;
  height: calc(100vh - var(--topbar-h));
  overflow: hidden;
  gap: 0;
}
.page-wrap.split-active #page-content {
  flex: 0 0 50%;
  overflow-y: auto;
  padding: 1.75rem 1.5rem;
  border-right: 2px solid var(--border);
  box-sizing: border-box;
  height: 100%;
}
#split-left-panel {
  flex: 0 0 50%;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--surface);
}
#split-left-panel #page-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.75rem 1.5rem;
  height: auto;
  border-right: none;
}
/* Active panel indicator */
#split-left-panel.split-focused .split-toolbar,
#split-panel.split-focused .split-toolbar {
  border-top: 2px solid var(--amber, #f0a500);
}

#split-confirm-bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .65rem;
  background: rgba(245,158,11,.13);
  border-bottom: 1px solid var(--amber, #f0a500);
  font-size: .8rem;
  flex-shrink: 0;
}
#split-confirm-bar span { flex: 1; line-height: 1.4; }
#split-confirm-bar button { flex-shrink:0; padding:.25rem .7rem; border-radius:5px; border:1px solid var(--border); background:var(--card); cursor:pointer; font-size:.78rem; }
#split-confirm-bar #split-confirm-yes { background:var(--amber,#f0a500); color:#1a2e44; border-color:var(--amber,#f0a500); font-weight:600; }

.split-left-disc {
  font-size: .71rem;
  background: rgba(245,158,11,.07);
  border-bottom: 1px solid var(--border);
  padding: .3rem .65rem;
  display: none;
}
.page-wrap.split-active .app-footer { display: none; }

/* Draggable divider */
#split-divider {
  flex: 0 0 5px;
  background: var(--border);
  cursor: col-resize;
  height: 100%;
  transition: background .15s;
  position: relative;
  z-index: 10;
}
#split-divider:hover, #split-divider.dragging { background: var(--amber, #f0a500); }

/* Sidebar hidden in split mode */
.sidenav.split-hidden { display: none; }
@media (min-width: 900px) {
  .page-wrap.split-nav-hidden { margin-left: 0 !important; }
}

#split-panel {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--surface);
}
.split-toolbar {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .65rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.split-search-wrap { position: relative; flex: 1; min-width: 0; }
.split-tool-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .32rem .65rem;
  font-size: .84rem;
  background: var(--surface);
  color: var(--text);
  outline: none;
  box-sizing: border-box;
}
.split-tool-input:focus { border-color: var(--accent); }
.split-ac {
  position: fixed;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 7px;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  max-height: 260px;
  overflow-y: auto;
  z-index: 1100;
}
.split-ac-item {
  padding: .45rem .85rem;
  cursor: pointer;
  font-size: .84rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.split-ac-item:hover, .split-ac-item.hi { background: var(--hover); }
.split-tbtn {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-muted);
  cursor: pointer;
  padding: .28rem .5rem;
  font-size: .78rem;
  transition: background .12s, color .12s;
  white-space: nowrap;
  line-height: 1.4;
}
.split-tbtn:hover { background: var(--hover); color: var(--text); }
.split-disclaimer {
  font-size: .71rem;
  color: var(--text-muted);
  padding: .35rem .75rem;
  background: rgba(245,158,11,.07);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  line-height: 1.45;
}
#split-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.75rem 1.5rem;
}

/* Print */
@media print {
  .sidenav, .topbar, .btn, .voice-toolbar { display: none !important; }
  .page-wrap { margin: 0 !important; padding: 0 !important; }
}

/* ─── Rec Card (universal batch-tool list card) ─────────────────────────────── */
.rec-list { display: flex; flex-direction: column; gap: .35rem; margin-top: .75rem; }
.rec-card {
  display: flex;
  align-items: center;
  gap: .85rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--navy);
  border-radius: var(--radius);
  padding: .65rem 1rem;
  cursor: pointer;
  transition: box-shadow .15s, border-left-color .15s, background .15s;
  background-image: linear-gradient(to right, rgba(26,46,68,.03) 0%, transparent 60%);
}
.rec-card:hover { box-shadow: var(--shadow); border-left-color: var(--teal); background-image: linear-gradient(to right, rgba(13,148,136,.06) 0%, transparent 60%); }
.rec-card-title { flex: 1; font-weight: 600; font-size: .92rem; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-card-meta { font-size: .78rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50%; }
@media (max-width: 540px) { .rec-card { flex-direction: column; align-items: flex-start; gap: .2rem; } .rec-card-meta { max-width: 100%; white-space: normal; } }

/* ─── Work File ─────────────────────────────────────────────────────────────── */
.wf-meta-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .85rem; padding: .6rem 0 .8rem; font-size: .85rem; color: var(--text-muted); border-bottom: 1px solid var(--border); margin-bottom: .75rem; }
.wf-meta-item strong { color: var(--text); }
.wf-description { font-size: .9rem; line-height: 1.55; color: var(--text-muted); margin-bottom: 1rem; }
.wf-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.wf-tab { padding: .4rem .9rem; border-radius: 20px; border: 1px solid var(--border); background: var(--card-bg); color: var(--text); cursor: pointer; font-size: .85rem; display: flex; align-items: center; gap: .35rem; transition: background .15s; }
.wf-tab--active, .wf-tab:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.wf-badge { background: rgba(255,255,255,.25); border-radius: 10px; padding: .05rem .4rem; font-size: .72rem; font-weight: 700; }
.wf-tab--active .wf-badge { background: rgba(255,255,255,.3); }
.wf-tab:not(.wf-tab--active) .wf-badge { background: var(--border); color: var(--text-muted); }
.wf-pane-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.wf-pane-header h3 { font-size: 1rem; margin: 0; }
.wf-inline-form { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; padding: .6rem; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; margin-bottom: .75rem; }
.wf-inline-form input { padding: .4rem .6rem; border: 1px solid var(--border); border-radius: 6px; font-size: .85rem; background: var(--card-bg); color: var(--text); min-width: 100px; }
.wf-people-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .6rem; }
.wf-person-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; padding: .75rem .9rem; position: relative; }
.wf-person-name { font-weight: 600; font-size: .95rem; }
.wf-person-role { font-size: .82rem; color: var(--primary); margin: .15rem 0; }
.wf-person-contact { font-size: .78rem; color: var(--text-muted); }
.wf-person-ts { font-size: .72rem; color: var(--text-muted); margin-top: .35rem; }
.wf-person-del { position: absolute; top: .5rem; right: .5rem; background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: .9rem; padding: .1rem .3rem; border-radius: 4px; }
.wf-person-del:hover { color: #e74c3c; background: #fde8e8; }
.wf-link-form { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: .75rem; margin-bottom: .75rem; }
.wf-link-form label { display: block; font-size: .85rem; margin-bottom: .4rem; }
.wf-link-form select { width: 100%; max-width: 340px; padding: .4rem .6rem; border: 1px solid var(--border); border-radius: 6px; background: var(--card-bg); color: var(--text); font-size: .85rem; margin-bottom: .5rem; }
.wf-link-results { margin-top: .5rem; }
.wf-link-candidates { display: flex; flex-direction: column; gap: .3rem; max-height: 260px; overflow-y: auto; }
.wf-link-cand { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .5rem .75rem; background: var(--card-bg); border: 1px solid var(--border); border-radius: 6px; cursor: pointer; font-size: .85rem; transition: border-color .15s; }
.wf-link-cand:hover { border-color: var(--primary); }
.wf-link-cand--linked { opacity: .55; cursor: default; }
.wf-link-cand-title { flex: 1; font-weight: 500; }
.wf-link-cand-date { font-size: .75rem; color: var(--text-muted); white-space: nowrap; }
.wf-link-cand-done { font-size: .72rem; color: #27ae60; font-weight: 600; white-space: nowrap; }
.wf-records-list { display: flex; flex-direction: column; gap: .4rem; }
.wf-rec-row { display: flex; align-items: center; gap: .75rem; padding: .55rem .8rem; background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; font-size: .85rem; }
.wf-rec-tool { font-size: .72rem; background: var(--primary); color: #fff; border-radius: 4px; padding: .1rem .45rem; white-space: nowrap; }
.wf-rec-title { flex: 1; font-weight: 500; }
.wf-rec-ts { font-size: .75rem; color: var(--text-muted); white-space: nowrap; }
.wf-rec-del { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: .9rem; padding: .1rem .3rem; border-radius: 4px; }
.wf-rec-del:hover { color: #e74c3c; background: #fde8e8; }
.wf-log-list { display: flex; flex-direction: column; gap: .35rem; }
.wf-log-entry { display: flex; gap: .75rem; align-items: flex-start; padding: .5rem .75rem; border-radius: 6px; font-size: .85rem; border-left: 3px solid var(--border); background: var(--card-bg); }
.wf-log-created,.wf-log-updated { border-left-color: #2980b9; }
.wf-log-person_added { border-left-color: #27ae60; }
.wf-log-person_removed { border-left-color: #e74c3c; }
.wf-log-record_linked { border-left-color: var(--primary); }
.wf-log-record_unlinked { border-left-color: #e67e22; }
.wf-log-note { border-left-color: #8e44ad; }
.wf-log-ts { font-size: .72rem; color: var(--text-muted); white-space: nowrap; min-width: 120px; }
.wf-log-detail { flex: 1; color: var(--text); }
.wf-list-card { cursor: pointer; }
.btn-icon { background: none; border: none; cursor: pointer; }
