/* ==========================================================================
   Dr Mohamed El Dahan — design system
   Ported from the Claude Design canvas (Homepage / Login / Logged In / Admin /
   Attendance / Notifications / Register / Reset / Status / Student Data /
   Subject / Video / Zoom Recordings / Recording Player / Zoom Videos Admin).

   Inline styles + style-hover / style-focus from the canvas are expressed here
   as real CSS so hover, focus and responsive states actually work.
   ========================================================================== */

/* --------------------------------------------------------------- tokens -- */
:root {
  --cream:        #F8F4EC;
  --surface:      #FFFDF8;
  --band:         #F1E9D9;
  --espresso:     #241610;
  --espresso-deep:#1B100C;

  --gold:         #A97C31;
  --gold-lt:      #C9A660;
  --gold-dk:      #7E5A1E;
  --gold-pale:    #E3D3AE;

  --ink:          #2B2320;
  --ink-2:        #4A403A;
  --muted:        #6F655C;
  --muted-2:      #8C8177;
  --placeholder:  #A79C92;

  --danger:       #A4442F;
  --ok:           #5E7343;

  --rule:         rgba(169,124,49,0.22);
  --rule-mid:     rgba(169,124,49,0.30);
  --rule-strong:  rgba(169,124,49,0.35);
  --rule-cta:     rgba(169,124,49,0.55);
  --wash:         rgba(169,124,49,0.045);
  --wash-on:      rgba(169,124,49,0.14);

  --on-dark:      rgba(248,244,236,0.45);
  --on-dark-mid:  rgba(248,244,236,0.60);
  --on-dark-hi:   rgba(248,244,236,0.78);
  --rule-dark:    rgba(248,244,236,0.12);

  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans:  'Manrope', system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;

  --shell: 1240px;
  --gut:   32px;
  --ease:  cubic-bezier(.4, 0, .2, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

/* Anchor targets clear the sticky nav bar.
   This lives on the targets rather than as `html { scroll-padding-top }`:
   scroll-padding also applies when an element is scrolled into view on
   focus, and the nav's own (visually hidden) checkbox sits inside that
   padded strip — so focusing it via the burger yanked the page upwards. */
section[id] { scroll-margin-top: 96px; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: var(--gold); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--gold-dk); }

img { max-width: 100%; }

::selection { background: var(--gold); color: var(--cream); }

input::placeholder,
textarea::placeholder { color: var(--placeholder); opacity: 1; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Page is a column so the footer sits at the bottom on short pages. */
.dh-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--cream);
}
.dh-page > main,
.dh-page > .dh-main { flex: 1; }

/* ---------------------------------------------------------------- shell -- */
.dh-shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--gut);
}
.dh-shell--wide   { max-width: 1320px; }
.dh-shell--xwide  { max-width: 1400px; }
.dh-shell--narrow { max-width: 1000px; }

/* --------------------------------------------------------------- ribbon -- */
/* Release announcement above the nav. Hidden by default; a tiny inline script
   in <head> adds .dh-ribbon-on to <html> only when it hasn't been dismissed,
   so anyone who already closed it never sees it flash on load. */
.dh-ribbon { display: none; }

.dh-ribbon-on .dh-ribbon {
  display: grid;
  grid-template-rows: 1fr;
  background: var(--espresso);
  color: var(--cream);
  transition: grid-template-rows .32s var(--ease), opacity .24s var(--ease);
}
.dh-ribbon-on .dh-ribbon.is-dismissed {
  grid-template-rows: 0fr;
  opacity: 0;
}

/* Padding lives on the row, not this grid item — padding always counts
   toward the track minimum and would stop 0fr collapsing to zero. */
.dh-ribbon__clip { min-height: 0; overflow: hidden; }

.dh-ribbon__row {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 12px var(--gut);
  display: flex;
  align-items: center;
  gap: 18px;
}
.dh-ribbon__main {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}
.dh-ribbon__badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-lt);
  white-space: nowrap;
}
.dh-ribbon__rule {
  height: 1px;
  width: 46px;
  flex: none;
  background: linear-gradient(90deg, rgba(201,166,96,0.7), rgba(201,166,96,0));
}
.dh-ribbon__text {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(248,244,236,0.72);
}
.dh-ribbon__close {
  flex: none;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(248,244,236,0.25);
  color: rgba(248,244,236,0.7);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1;
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.dh-ribbon__close:hover { border-color: var(--gold-lt); color: var(--gold-lt); }

@media (max-width: 640px) {
  .dh-ribbon__row { padding: 11px var(--gut); gap: 12px; }
  .dh-ribbon__main { flex-direction: column; align-items: flex-start; gap: 3px; }
  .dh-ribbon__rule { display: none; }
  .dh-ribbon__badge { letter-spacing: 0.18em; }
  .dh-ribbon__text { font-size: 12.5px; }
}

/* ------------------------------------------------------------------ nav -- */
.dh-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248,244,236,0.94);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
}
.dh-nav__inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--gut);
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.dh-nav--wide  .dh-nav__inner { max-width: 1320px; }
.dh-nav--xwide .dh-nav__inner { max-width: 1400px; }

.dh-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  color: var(--espresso);
}
.dh-brand:hover { color: var(--espresso); }
/* The crest is masked rather than <img>-ed so it can tint to any context
   colour (espresso on cream, gold on espresso) from a single source file. */
.dh-brand__mark {
  display: block;
  flex: none;
  height: 42px;
  width: 32.5px; /* keeps the 325 x 420 crest ratio */
  background-color: currentColor;
  -webkit-mask: url("/images/brand/logo-mark.png") center / contain no-repeat;
  mask: url("/images/brand/logo-mark.png") center / contain no-repeat;
}
.dh-brand__word {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--espresso);
  white-space: nowrap;
}

.dh-navlinks {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
  padding: 10px 0;
}
.dh-navlinks--tight { gap: 26px; }

/* On desktop the wrapper is transparent to layout, so the links stay direct
   flex items of .dh-navlinks. On mobile it becomes the clipped grid item
   that makes the open/close reveal animate to the exact content height. */
.dh-navlinks__inner { display: contents; }

.dh-navlink {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}
.dh-navlink:hover { color: var(--gold); }

.dh-navlink--cta {
  color: var(--espresso);
  border: 1px solid var(--rule-cta);
  border-radius: 999px;
  padding: 11px 24px;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.dh-navlink--cta:hover {
  background: var(--espresso);
  color: var(--cream);
  border-color: var(--espresso);
}

/* Mobile burger. The checkbox drives everything; it stays in the tab order
   (visually hidden rather than display:none) so the menu is keyboard-operable. */
.dh-nav__toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  margin: 0;
  pointer-events: none;
}
.dh-burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: none;
  border: 1px solid rgba(169,124,49,0.5);
  cursor: pointer;
  color: var(--espresso);
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.dh-burger:hover { border-color: var(--gold); }
.dh-nav__toggle:focus-visible ~ .dh-burger {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.dh-burger__box {
  position: relative;
  display: block;
  width: 18px;
  height: 12px;
}
.dh-burger__bar {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.8px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .3s var(--ease), opacity .18s var(--ease);
}
.dh-burger__bar:nth-child(1) { top: 0; }
.dh-burger__bar:nth-child(2) { top: 5.1px; }
.dh-burger__bar:nth-child(3) { top: 10.2px; }

/* Bars fold into an X. */
.dh-nav__toggle:checked ~ .dh-burger { border-color: var(--gold); }
.dh-nav__toggle:checked ~ .dh-burger .dh-burger__bar:nth-child(1) { transform: translateY(5.1px) rotate(45deg); }
.dh-nav__toggle:checked ~ .dh-burger .dh-burger__bar:nth-child(2) { opacity: 0; transform: scaleX(.35); }
.dh-nav__toggle:checked ~ .dh-burger .dh-burger__bar:nth-child(3) { transform: translateY(-5.1px) rotate(-45deg); }

/* Dark nav variant (recording player). Relative rather than static so the
   mobile dropdown still anchors to the bar. */
.dh-nav--dark {
  position: relative;
  top: auto;
  background: transparent;
  backdrop-filter: none;
  border-bottom: 1px solid var(--rule-dark);
}
.dh-nav--dark .dh-brand,
.dh-nav--dark .dh-brand__word { color: var(--cream); }
.dh-nav--dark .dh-navlink { color: var(--on-dark-mid); }
.dh-nav--dark .dh-navlink:hover { color: var(--gold-lt); }
.dh-nav--dark .dh-navlink--cta {
  color: var(--cream);
  border-color: rgba(248,244,236,0.35);
}
.dh-nav--dark .dh-navlink--cta:hover {
  background: transparent;
  border-color: var(--gold-lt);
  color: var(--gold-lt);
}
.dh-nav--dark .dh-burger { border-color: rgba(248,244,236,0.4); color: var(--cream); }
.dh-nav--dark .dh-burger:hover { border-color: var(--gold-lt); }
.dh-nav--dark .dh-nav__toggle:checked ~ .dh-burger { border-color: var(--gold-lt); }

/* --------------------------------------------------------------- typo --- */
.dh-eyebrow {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.dh-eyebrow__text {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
}
.dh-eyebrow__rule {
  height: 1px;
  flex: 1;
  max-width: 140px;
  background: linear-gradient(90deg, rgba(169,124,49,0.6), rgba(169,124,49,0));
}
.dh-eyebrow__rule--fixed { flex: none; width: 110px; }

.dh-dark .dh-eyebrow__text { color: var(--gold-lt); letter-spacing: 0.3em; }
.dh-dark .dh-eyebrow__rule { background: linear-gradient(90deg, rgba(201,166,96,0.7), rgba(201,166,96,0)); }

.dh-h1 {
  font-family: var(--serif);
  font-size: clamp(38px, 4.6vw, 62px);
  line-height: 1.04;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--espresso);
  margin: 0 0 24px;
}
.dh-h1--hero  { font-size: clamp(48px, 6.2vw, 86px); line-height: 0.98; }
.dh-h1--page  { font-size: clamp(34px, 4vw, 50px);   line-height: 1.05; }

.dh-h2 {
  font-family: var(--serif);
  font-size: clamp(34px, 4.2vw, 56px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--espresso);
  margin: 0;
}
.dh-h3 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  color: var(--espresso);
  margin: 0 0 10px;
  line-height: 1.2;
}
.dh-h4 {
  font-size: 17px;
  font-weight: 700;
  color: var(--espresso);
  margin: 0 0 12px;
  letter-spacing: 0.01em;
}

/* The gold full stop that closes every display heading. */
.dh-dot { color: var(--gold); }

.dh-lede {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(19px, 2vw, 24px);
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 38px;
  max-width: 34ch;
  text-wrap: pretty;
}
.dh-body {
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink-2);
  margin: 0 0 24px;
  max-width: 58ch;
  text-wrap: pretty;
}
.dh-note {
  font-size: 15px;
  line-height: 1.8;
  color: var(--muted);
  margin: 0 0 40px;
  max-width: 52ch;
  text-wrap: pretty;
}
.dh-quote {
  margin: 0;
  padding-left: 26px;
  border-left: 1px solid var(--rule-cta);
  font-family: var(--serif);
  font-style: italic;
  font-size: 21px;
  line-height: 1.55;
  color: var(--espresso);
  max-width: 34ch;
}

/* --------------------------------------------------------------- dark --- */
.dh-dark {
  position: relative;
  background: var(--espresso);
  color: var(--cream);
  overflow: hidden;
}
.dh-dark::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 88% 18%, rgba(169,124,49,0.30), rgba(36,22,16,0) 62%);
  pointer-events: none;
}
.dh-dark > * { position: relative; }
.dh-dark .dh-h1,
.dh-dark .dh-h2,
.dh-dark .dh-h3 { color: var(--cream); }
.dh-dark .dh-lede { color: var(--on-dark-hi); }

/* Full-page dark shell (status screens, recording player). */
.dh-page--dark {
  position: relative;
  background: var(--espresso);
  color: var(--cream);
  overflow: hidden;
}
.dh-page--dark::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(100% 70% at 50% 0%, rgba(169,124,49,0.28), rgba(36,22,16,0) 60%);
  pointer-events: none;
}
.dh-page--dark > * { position: relative; }
.dh-page--dark .dh-h1 { color: var(--cream); }
.dh-page--dark .dh-lede { color: var(--on-dark-hi); }
.dh-page--dark .dh-brand,
.dh-page--dark .dh-brand__word { color: var(--cream); }
.dh-page--player { background: var(--espresso-deep); }
.dh-page--player::before { content: none; }

/* Centred eyebrow with a rule on each side (status screens). */
.dh-eyebrow--center { justify-content: center; }
.dh-eyebrow--center .dh-eyebrow__text { color: var(--gold-lt); letter-spacing: 0.3em; }
.dh-eyebrow--center .dh-eyebrow__rule { flex: none; width: 48px; }
.dh-eyebrow--center .dh-eyebrow__rule:first-child {
  background: linear-gradient(90deg, rgba(201,166,96,0), rgba(201,166,96,0.7));
}
.dh-eyebrow--center .dh-eyebrow__rule:last-child {
  background: linear-gradient(90deg, rgba(201,166,96,0.7), rgba(201,166,96,0));
}

/* ------------------------------------------------------------- sections -- */
.dh-section      { padding: 110px 0; background: var(--cream); }
.dh-section--sm  { padding: 76px 0; }
.dh-section--lg  { padding: 130px 0; }
.dh-section--band {
  background: var(--band);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.dh-section--dark { padding: 120px 0 110px; }

.dh-sectionhead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 36px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

/* ---------------------------------------------------------------- grid --- */
.dh-grid { display: grid; gap: 20px; }
.dh-grid--auto  { grid-template-columns: repeat(auto-fit,  minmax(min(100%, 250px), 1fr)); }
.dh-grid--cards { grid-template-columns: repeat(auto-fit,  minmax(min(100%, 280px), 1fr)); }
.dh-grid--tiles { grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 14px; }
.dh-grid--split {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 72px;
  align-items: center;
}
.dh-grid--aside {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 56px;
  align-items: start;
}
.dh-grid--fields { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }

/* --------------------------------------------------------------- values -- */
.dh-values {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 0;
}
.dh-value { padding: 0 34px; border-left: 1px solid var(--rule-mid); }
.dh-value__num {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 20px;
}
.dh-value p {
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--muted);
  margin: 0;
  text-wrap: pretty;
}

/* ---------------------------------------------------------------- stats -- */
.dh-stats { display: flex; gap: 40px; flex-wrap: wrap; }
.dh-stat__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}
.dh-stat__value {
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 700;
  color: var(--espresso);
  line-height: 1;
}
.dh-dark .dh-stat__label { color: rgba(248,244,236,0.5); }
.dh-dark .dh-stat__value { color: var(--cream); font-size: 34px; }

/* ---------------------------------------------------------------- card --- */
.dh-card {
  background: var(--surface);
  border: 1px solid var(--rule-mid);
}
.dh-card--pad { padding: 38px; }
.dh-card--form { padding: 44px; max-width: 860px; }

/* Framed portrait: offset gold rule behind the image. */
.dh-frame { position: relative; max-width: 420px; }
.dh-frame::before {
  content: "";
  position: absolute;
  inset: 28px -28px -28px 28px;
  border: 1px solid rgba(169,124,49,0.5);
}
.dh-frame > img,
.dh-frame > .dh-frame__inner {
  position: relative;
  display: block;
  width: 100%;
}
.dh-frame > img { height: 520px; object-fit: cover; object-position: 50% 15%; }

/* Dark stat panel that sits inside a .dh-frame (the "30+ assistants" card). */
.dh-statcard {
  position: relative;
  background: var(--espresso);
  height: 480px;
  padding: 44px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.dh-statcard__kicker,
.dh-statcard__foot {
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-lt);
  font-weight: 700;
}
.dh-statcard__foot { letter-spacing: 0.2em; color: rgba(248,244,236,0.4); font-weight: 400; }
.dh-statcard__num {
  font-family: var(--serif);
  font-size: 76px;
  line-height: 0.92;
  font-weight: 700;
  color: var(--cream);
  letter-spacing: -0.02em;
}
.dh-statcard__cap {
  margin: 14px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 21px;
  line-height: 1.45;
  color: rgba(248,244,236,0.72);
}

/* -------------------------------------------------------------- buttons -- */
.dh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 54px;
  padding: 0 32px;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: center;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.dh-btn--primary { background: var(--espresso); color: var(--cream); border-color: var(--espresso); }
.dh-btn--primary:hover { background: var(--gold); color: var(--cream); border-color: var(--gold); }

.dh-btn--gold { background: var(--gold); color: var(--cream); border-color: var(--gold); }
.dh-btn--gold:hover { background: var(--gold-lt); color: var(--espresso); border-color: var(--gold-lt); }

.dh-btn--ghost { background: transparent; color: var(--espresso); border-color: var(--rule-cta); }
.dh-btn--ghost:hover { background: var(--espresso); color: var(--cream); border-color: var(--espresso); }

.dh-btn--on-dark { background: transparent; color: var(--cream); border-color: rgba(248,244,236,0.35); }
.dh-btn--on-dark:hover { border-color: var(--gold-lt); color: var(--gold-lt); }

.dh-btn--sm { height: 48px; padding: 0 26px; font-size: 11px; }
.dh-btn--block { width: 100%; height: 56px; }
.dh-btn:disabled { opacity: .55; cursor: not-allowed; }

/* Small inline table actions. */
.dh-minibtn {
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
  background: transparent;
  border: 1px solid rgba(169,124,49,0.4);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.dh-minibtn:hover { border-color: var(--gold); color: var(--gold-dk); }
.dh-minibtn--on { background: var(--wash-on); border-color: var(--gold); color: var(--gold-dk); }
.dh-minibtn--danger { border-color: rgba(164,68,47,0.45); color: var(--danger); }
.dh-minibtn--danger:hover { background: rgba(164,68,47,0.10); border-color: var(--danger); color: var(--danger); }

/* Text button that reads as a link (Forgot? / Show password). */
.dh-linkbtn {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  transition: color .2s var(--ease);
}
.dh-linkbtn:hover { color: var(--gold-dk); }

/* Back link with the ← arrow. */
.dh-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------- pills --- */
.dh-pills { display: flex; gap: 10px; flex-wrap: wrap; }
.dh-pill {
  min-width: 78px;
  height: 46px;
  padding: 0 26px;
  cursor: pointer;
  border-radius: 999px;
  background: transparent;
  border: 1px solid rgba(169,124,49,0.45);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: all .25s var(--ease);
}
.dh-pill:hover { border-color: var(--gold); color: var(--gold-dk); }
.dh-pill.is-on { background: var(--espresso); border-color: var(--espresso); color: var(--cream); }

/* ---------------------------------------------------------------- tabs --- */
.dh-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--rule-mid);
}
.dh-tab {
  padding: 16px 22px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: all .2s var(--ease);
}
.dh-tab:hover { color: var(--espresso); }
.dh-tab.is-on { border-bottom-color: var(--gold); color: var(--espresso); font-weight: 700; }

/* --------------------------------------------------------------- forms --- */
.dh-field { display: flex; flex-direction: column; gap: 9px; margin-bottom: 18px; }
.dh-field--last { margin-bottom: 0; }

.dh-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.dh-label__hint {
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--muted);
}

.dh-input,
.dh-select,
.dh-textarea {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--espresso);
  outline: none;
  transition: border-color .2s var(--ease);
}
.dh-textarea {
  height: auto;
  padding: 14px 16px;
  line-height: 1.7;
  resize: vertical;
}
.dh-input:focus,
.dh-select:focus,
.dh-textarea:focus { border-color: var(--gold); outline: none; }

/* Fields sitting on a cream card read better with the cream fill. */
.dh-card .dh-input,
.dh-card .dh-select,
.dh-card .dh-textarea { background: var(--cream); }

.dh-select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23A97C31' stroke-width='2.2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

.dh-check {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink-2);
}
.dh-check input { width: 16px; height: 16px; accent-color: var(--gold); margin: 0; flex: none; }

/* Subject checkbox tiles (register). */
.dh-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--rule-mid);
  transition: all .2s var(--ease);
}
.dh-choice:hover { border-color: var(--gold); }
.dh-choice input { width: 16px; height: 16px; accent-color: var(--gold); margin: 0; flex: none; }
.dh-choice__label { font-family: var(--serif); font-size: 19px; font-weight: 700; color: var(--espresso); }
.dh-choice:has(input:checked) { background: var(--wash-on); border-color: var(--gold); }

.dh-error {
  margin: 0 0 18px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--danger);
}

/* Re-skin the PhoneInput widget (public/js/phone-input.js) to match.
   Loaded after phone-input.css so these win. */
.phone-input-container {
  height: 52px;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  background: var(--surface);
}
.phone-input-container:focus-within { border-color: var(--gold); }
.country-code-selector {
  background: var(--surface);
  border-right: 1px solid var(--rule-strong);
  font-family: var(--sans);
  color: var(--espresso);
}
.country-code-selector:hover { background: var(--wash); }
.country-code-selector:focus { background: var(--wash-on); color: var(--gold-dk); outline: none; }
.country-code-text { font-size: 15px; color: var(--espresso); }
.phone-number-input {
  background: var(--surface);
  border: none;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--espresso);
}
.phone-number-input:focus { outline: none; }
.phone-number-input::placeholder { color: var(--placeholder); }
.country-dropdown {
  background: var(--surface);
  border: 1px solid var(--gold);
  border-radius: 0;
}
.country-option { font-family: var(--sans); font-size: 14px; color: var(--ink-2); }
.country-option:hover { background: var(--wash); }
.phone-validation-error { color: var(--danger); font-size: 13px; }

/* Fields on the dark sign-in card. */
.dh-field--on-dark .dh-label { color: var(--gold-lt); letter-spacing: 0.22em; }
.dh-field--on-dark .dh-input {
  background: transparent;
  border-color: rgba(248,244,236,0.25);
  color: var(--cream);
}
.dh-field--on-dark .dh-input::placeholder { color: rgba(248,244,236,0.45); }
.dh-field--on-dark .dh-input:focus { border-color: var(--gold-lt); }

/* Tab panels (admin console). */
.dh-tabpanel { display: none; }
.dh-tabpanel.is-on { display: block; }

/* Chapter multiselect — the existing dropdown contract, restyled. */
.dh-multiselect { position: relative; }
.dh-multiselect__display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  height: 52px;
  padding: 0 16px;
  background: var(--cream);
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  cursor: pointer;
  font-size: 15px;
  color: var(--espresso);
}
.dh-multiselect__display::after {
  content: "";
  width: 14px;
  height: 14px;
  flex: none;
  background-color: var(--gold);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.dh-multiselect__dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 60;
  max-height: 300px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--gold);
  border-top: none;
}
.multiselect-option {
  padding: 13px 16px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-2);
  border-top: 1px solid var(--rule);
}
.multiselect-option:first-child { border-top: none; }
.multiselect-option:hover { background: var(--wash); }
.multiselect-option.selected {
  background: var(--wash-on);
  color: var(--gold-dk);
  font-weight: 700;
}

/* Inline result banner (assign-group). The script rewrites className to
   "alert alert-success" / "alert alert-danger", so those carry the styling. */
.alert {
  display: none;
  padding: 14px 16px;
  margin-bottom: 22px;
  font-size: 14px;
  line-height: 1.6;
  border-radius: 2px;
}
.alert-success { background: var(--wash-on); color: var(--gold-dk); border: 1px solid var(--rule-strong); }
.alert-danger  { background: rgba(164,68,47,0.10); color: var(--danger); border: 1px solid rgba(164,68,47,0.35); }

/* --------------------------------------------------------------- tiles --- */
/* Subject / lecture selection buttons inside a POST form. */
.dh-tile {
  display: block;
  width: 100%;
  text-align: left;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  cursor: pointer;
  font-family: var(--sans);
  transition: all .2s var(--ease);
}
.dh-tile:hover { border-color: var(--gold); background: #fff; }
.dh-tile__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 34px;
}
.dh-tile__num {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  color: var(--gold-lt);
  line-height: 1;
}
.dh-tile__tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 5px 10px;
  white-space: nowrap;
  background: var(--wash-on);
  color: var(--gold-dk);
  border: none;
}
.dh-tile__title {
  display: block;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  color: var(--espresso);
  line-height: 1.15;
  margin-bottom: 10px;
}
.dh-tile__meta { display: block; font-size: 13.5px; line-height: 1.7; color: var(--muted); }

.dh-tile.is-locked,
.dh-tile:disabled {
  background: transparent;
  border-color: var(--rule);
  cursor: not-allowed;
}
.dh-tile.is-locked:hover,
.dh-tile:disabled:hover { background: transparent; border-color: var(--rule); }
.dh-tile.is-locked .dh-tile__num,
.dh-tile:disabled .dh-tile__num { color: rgba(169,124,49,0.4); }
.dh-tile.is-locked .dh-tile__title,
.dh-tile:disabled .dh-tile__title { color: var(--muted); }
.dh-tile.is-locked .dh-tile__meta,
.dh-tile:disabled .dh-tile__meta { color: var(--muted-2); }
.dh-tile.is-locked .dh-tile__tag,
.dh-tile:disabled .dh-tile__tag {
  background: transparent;
  color: var(--muted-2);
  border: 1px solid var(--rule-mid);
}

/* Compact chapter tile (subject page). */
.dh-chip {
  display: block;
  width: 100%;
  text-align: left;
  padding: 22px 20px;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-left: 3px solid var(--gold);
  border-radius: 0;
  cursor: pointer;
  font-family: var(--sans);
  transition: all .2s var(--ease);
}
.dh-chip:hover { border-color: var(--gold); background: #fff; }
.dh-chip__tag {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}
.dh-chip__title {
  display: block;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--espresso);
}
.dh-chip:disabled,
.dh-chip.is-locked {
  background: transparent;
  border-color: var(--rule);
  border-left-color: var(--rule);
  cursor: not-allowed;
}
.dh-chip:disabled .dh-chip__tag,
.dh-chip.is-locked .dh-chip__tag { color: var(--muted); }
.dh-chip:disabled .dh-chip__title,
.dh-chip.is-locked .dh-chip__title { color: var(--muted); }

/* Legend swatches. */
.dh-legend { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.dh-legend__item { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.dh-legend__swatch { width: 11px; height: 11px; background: var(--gold); flex: none; }
.dh-legend__swatch--off { background: transparent; border: 1px solid rgba(169,124,49,0.45); }

/* ------------------------------------------------------------- grades --- */
.dh-chartcard {
  background: var(--surface);
  border: 1px solid var(--rule-mid);
  padding: 52px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 56px;
  align-items: center;
}
.dh-chartcard__chart { width: 100%; max-width: 400px; justify-self: center; }
.dh-chartcard__chart svg { width: 100%; display: block; }

.dh-sessions { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 20px; }
.dh-session {
  padding: 4px 0;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #A79C92;
  transition: all .2s var(--ease);
}
.dh-session:hover { color: var(--ink-2); }
.dh-session.is-on { border-bottom-color: var(--gold); color: var(--espresso); }

.dh-gradetitle {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 700;
  color: var(--espresso);
  margin: 0 0 26px;
}

.dh-legendrows { display: flex; flex-direction: column; gap: 16px; max-width: 340px; }
.dh-legendrow {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.dh-legendrow:last-child { padding-bottom: 0; border-bottom: none; }
.dh-legendrow__swatch { width: 14px; height: 14px; flex: none; }
.dh-legendrow__name { flex: 1; font-size: 15px; font-weight: 600; color: var(--espresso); }
.dh-legendrow__count { font-size: 15px; color: var(--muted); }
.dh-legendrow__pct {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--espresso);
  min-width: 56px;
  text-align: right;
}

@media (max-width: 780px) {
  .dh-chartcard { padding: 26px 22px; gap: 36px; }
  .dh-gradetitle { font-size: 26px; }
}

/* Utility the sign-in status messages rely on. */
.hidden { display: none !important; }

/* ------------------------------------------------------------- resource -- */
.dh-resource {
  display: block;
  padding: 34px;
  background: var(--surface);
  border: 1px solid var(--rule-mid);
  transition: border-color .2s var(--ease);
}
.dh-resource:hover { border-color: var(--gold); }
.dh-resource__num {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  color: var(--gold-lt);
  line-height: 1;
  margin-bottom: 26px;
}
.dh-resource h3 { font-family: var(--serif); font-size: 23px; font-weight: 700; color: var(--espresso); margin: 0 0 10px; line-height: 1.2; }
.dh-resource p  { margin: 0; font-size: 14px; line-height: 1.75; color: var(--muted); text-wrap: pretty; }

/* --------------------------------------------------------------- table --- */
.dh-tablewrap {
  background: var(--surface);
  border: 1px solid var(--rule-mid);
  overflow-x: auto;
}
.dh-table { width: 100%; border-collapse: collapse; }
.dh-table th {
  padding: 18px 22px;
  text-align: left;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--band);
  border-bottom: 1px solid var(--rule-mid);
}
.dh-table td {
  padding: 18px 22px;
  font-size: 14.5px;
  color: var(--ink);
  border-top: 1px solid rgba(169,124,49,0.18);
  text-align: left;
  white-space: nowrap;
}
.dh-table tbody tr:nth-child(odd) { background: var(--wash); }
.dh-table .is-index { color: var(--muted-2); width: 56px; }
.dh-table .is-code  { font-family: var(--serif); font-size: 18px; font-weight: 700; }
.dh-table .is-name  { font-weight: 600; white-space: normal; min-width: 180px; }
.dh-table .is-muted { color: var(--ink-2); }
.dh-table .is-desc  { color: var(--muted); white-space: normal; min-width: 260px; line-height: 1.65; }
.dh-table .is-yes   { font-weight: 700; color: var(--ok); }
.dh-table .is-no    { font-weight: 700; color: var(--danger); }
.dh-table .is-actions { padding-top: 12px; padding-bottom: 12px; min-width: 300px; }
.dh-table__actions { display: flex; gap: 8px; flex-wrap: nowrap; }

.dh-empty {
  border: 1px solid var(--rule-mid);
  background: var(--surface);
  padding: 80px 32px;
  text-align: center;
}
.dh-empty h2 {
  font-family: var(--serif);
  font-style: italic;
  font-size: 26px;
  font-weight: 400;
  color: var(--espresso);
  margin: 0 0 10px;
}
.dh-empty p { margin: 0; font-size: 15px; color: var(--muted); }

/* --------------------------------------------------------- notifications -- */
.dh-feed { background: var(--surface); border: 1px solid var(--rule-mid); }
.dh-feed--scroll { max-height: 380px; overflow: auto; }
.dh-feed__head {
  padding: 30px 32px 22px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.dh-feed__head h2 { font-family: var(--serif); font-size: 26px; font-weight: 700; color: var(--espresso); margin: 0; }
.dh-feed__count { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.dh-feed__item { padding: 26px 32px; border-top: 1px solid rgba(169,124,49,0.2); }
.dh-feed__item:first-child { border-top: none; }
.dh-feed__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}
.dh-feed__date {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
.dh-feed__text {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--ink);
  white-space: pre-line;
  text-wrap: pretty;
}
/* Two-column variant used on the subject page. */
.dh-feed__item--split { display: flex; gap: 28px; flex-wrap: wrap; padding: 24px 30px; }
.dh-feed__item--split .dh-feed__date { min-width: 190px; padding-top: 3px; }
.dh-feed__item--split .dh-feed__text { flex: 1; min-width: 220px; }

/* ----------------------------------------------------------- accordion --- */
.dh-acc { display: flex; flex-direction: column; gap: 12px; }
.dh-acc__item {
  background: var(--surface);
  border: 1px solid var(--rule-mid);
  border-left: 3px solid var(--rule-mid);
  transition: border-color .2s var(--ease);
}
.dh-acc__item.is-open { border-color: var(--gold); border-left-color: var(--gold); }
.dh-acc__btn {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  padding: 22px 26px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--sans);
}
.dh-acc__num { font-family: var(--serif); font-size: 22px; font-weight: 700; color: var(--gold-lt); min-width: 52px; }
.dh-acc__label { flex: 1; min-width: 0; }
.dh-acc__title { display: block; font-size: 17px; font-weight: 600; color: var(--espresso); margin-bottom: 5px; }
.dh-acc__date  { display: block; font-size: 13px; letter-spacing: 0.06em; color: var(--muted); }
.dh-acc__chev {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: none;
  color: var(--gold);
  border: 1px solid var(--rule-strong);
  transition: transform .25s var(--ease);
}
.dh-acc__item.is-open .dh-acc__chev { transform: rotate(180deg); }
.dh-acc__body {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height .35s var(--ease), opacity .25s var(--ease);
}
.dh-acc__item.is-open .dh-acc__body { max-height: 520px; opacity: 1; }
.dh-acc__inner { padding: 0 26px 26px; border-top: 1px solid rgba(169,124,49,0.2); }
.dh-acc__inner p { margin: 24px 0 26px; font-size: 15.5px; line-height: 1.8; color: var(--ink-2); max-width: 62ch; text-wrap: pretty; }

/* -------------------------------------------------------------- player --- */
.dh-player { background: var(--espresso-deep); border: 1px solid var(--rule-strong); }
.dh-player--black { background: #000; }
.dh-player__frame { position: relative; aspect-ratio: 16 / 9; width: 100%; }
.dh-player__frame > iframe,
.dh-player__frame > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.dh-crumbs {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-2);
  flex-wrap: wrap;
}
.dh-crumbs > span:last-child { color: var(--espresso); }
.dh-dark .dh-crumbs,
.dh-page--dark .dh-crumbs { color: rgba(248,244,236,0.5); }
.dh-page--dark .dh-crumbs > span:last-child { color: var(--cream); }

/* Attendance status line in the lecture aside. */
.dh-statusrow {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 0;
  border-top: 1px solid rgba(169,124,49,0.2);
}
.dh-dot-ind {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
  background: transparent;
  border: 1px solid rgba(169,124,49,0.5);
}
.dh-dot-ind.is-on { background: var(--gold); border: none; }
.dh-statusrow__title { display: block; font-size: 15.5px; font-weight: 600; color: var(--espresso); margin-bottom: 3px; }
.dh-statusrow__note  { display: block; font-size: 13px; color: var(--muted); }

.dh-hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--gold-dk);
  background: var(--wash-on);
  padding: 14px 16px;
}

/* Toggled by moreDetailsAttendance() on the lecture page. */
.popuptext { display: none; }
.popuptext.show { display: block; }

/* --------------------------------------------------------------- modal --- */
.dh-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(36,22,16,0.62);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.dh-modal.is-open { display: flex; }
.dh-modal__box {
  width: 100%;
  max-width: 720px;
  background: var(--surface);
  border: 1px solid rgba(169,124,49,0.4);
  max-height: 86vh;
  overflow: auto;
}
.dh-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 34px;
  border-bottom: 1px solid var(--rule);
}
.dh-modal__head h2 { font-family: var(--serif); font-size: 26px; font-weight: 700; color: var(--espresso); margin: 0; }
.dh-modal__close {
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid rgba(169,124,49,0.4);
  color: var(--ink-2);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.dh-modal__close:hover { border-color: var(--gold); color: var(--gold-dk); }
.dh-modal__body { padding: 34px; }

/* -------------------------------------------------------------- footer --- */
.dh-footer { background: var(--espresso); padding: 44px 0; }
.dh-footer__inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--gut);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.dh-footer--wide  .dh-footer__inner { max-width: 1320px; }
.dh-footer--xwide .dh-footer__inner { max-width: 1400px; }
.dh-footer__line {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-dark);
  margin: 0;
}
.dh-footer__line a { color: var(--gold-lt); }
.dh-footer__line a:hover { color: var(--gold-pale); }

/* Outlined footer used on the dark recording player. */
.dh-footer--outline { background: transparent; border-top: 1px solid var(--rule-dark); padding: 34px 0; }

/* Tall centred footer (homepage). */
.dh-footer--tall { padding: 76px 0 40px; }
.dh-footer--tall .dh-footer__inner { flex-direction: column; text-align: center; gap: 0; }
.dh-footer__mark {
  display: block;
  height: 96px;
  width: 74px;
  margin: 0 auto 30px;
  background-color: var(--gold-lt);
  -webkit-mask: url("/images/brand/logo-mark.png") center / contain no-repeat;
  mask: url("/images/brand/logo-mark.png") center / contain no-repeat;
}
.dh-socials { display: flex; justify-content: center; gap: 30px; margin-bottom: 34px; }
.dh-social {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(201,166,96,0.4);
  border-radius: 50%;
  color: rgba(248,244,236,0.75);
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.dh-social:hover { border-color: var(--gold-lt); color: var(--gold-lt); }
.dh-footer__divider {
  height: 1px;
  max-width: 420px;
  margin: 0 auto 30px;
  background: linear-gradient(90deg, rgba(201,166,96,0), rgba(201,166,96,0.5), rgba(201,166,96,0));
}

/* Generic masked crest, sized by a modifier. */
.dh-mark {
  display: block;
  flex: none;
  background-color: currentColor;
  -webkit-mask: url("/images/brand/logo-mark.png") center / contain no-repeat;
  mask: url("/images/brand/logo-mark.png") center / contain no-repeat;
}
.dh-mark--md { height: 70px; width: 54px; }

/* Inline contact links used on dark hero sections. */
.dh-contacts { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.dh-contact {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-dark-mid);
}
.dh-contact:hover { color: var(--gold-lt); }

/* --------------------------------------------------------------- utils --- */
.dh-stack  { display: flex; flex-direction: column; gap: 12px; }
.dh-row    { display: flex; gap: 12px; flex-wrap: wrap; }
.dh-center { display: flex; align-items: center; justify-content: center; }
.dh-mt-sm  { margin-top: 26px; }
.dh-mt     { margin-top: 40px; }
.dh-mt-lg  { margin-top: 48px; }
.dh-mb     { margin-bottom: 40px; }
.dh-minw0  { min-width: 0; }
.dh-sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------- responsive --- */
@media (max-width: 980px) {
  .dh-value { border-left: none; border-top: 1px solid var(--rule-mid); padding: 30px 0 0; }
  .dh-value:first-child { border-top: none; padding-top: 0; }
}

@media (max-width: 780px) {
  :root { --gut: 20px; }

  .dh-burger { display: flex; margin-left: auto; }
  .dh-brand__word { font-size: 15px; }
  .dh-brand__mark { height: 34px; width: 26px; }

  /* The menu is an overlay panel anchored under the bar rather than an extra
     flex line inside it — so opening it cannot change the bar's height and the
     logo stays put.

     The reveal animates grid-template-rows 0fr -> 1fr, which resolves to the
     exact content height. max-height can't: it has to be guessed high, so the
     panel finishes opening well before the transition ends and a scrollbar
     flickers in and out on the way. Only two properties animate here, and the
     border and shadow ride the opacity fade rather than switching state. */
  .dh-navlinks {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: grid;
    grid-template-rows: 0fr;
    gap: 0;
    padding: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--rule);
    box-shadow: 0 18px 30px -18px rgba(36,22,16,0.35);
    opacity: 0;
    visibility: hidden;
    transition:
      grid-template-rows .3s var(--ease),
      opacity .2s var(--ease),
      visibility 0s linear .3s;
  }
  .dh-nav__toggle:checked ~ .dh-navlinks {
    grid-template-rows: 1fr;
    opacity: 1;
    visibility: visible;
    transition:
      grid-template-rows .3s var(--ease),
      opacity .2s var(--ease),
      visibility 0s;
  }

  .dh-navlinks__inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    overflow: hidden;
    /* Horizontal padding only: padding is outside the content box, so it is
       always part of the track's minimum and would stop 0fr reaching zero.
       The bottom gap is a child margin, which min-height:0 lets collapse. */
    padding: 0 var(--gut);
  }
  .dh-navlinks__inner > :last-child { margin-bottom: 16px; }

  .dh-navlinks__inner > .dh-navlink {
    padding: 14px 0;
    border-top: 1px solid rgba(169,124,49,0.2);
    text-align: left;
  }
  .dh-navlinks__inner > .dh-navlink:first-child { border-top: none; }
  .dh-navlinks__inner > .dh-navlink--cta {
    width: 100%;
    margin-top: 12px;
    padding: 15px 20px;
    border-radius: 2px;
    border: 1px solid var(--rule-cta);
    text-align: center;
  }

  .dh-nav--dark .dh-navlinks {
    background: var(--espresso-deep);
    border-bottom-color: var(--rule-dark);
  }
  .dh-nav--dark .dh-navlinks__inner > .dh-navlink { border-top-color: rgba(248,244,236,0.14); }
  .dh-nav--dark .dh-navlinks__inner > .dh-navlink--cta { border-color: rgba(248,244,236,0.35); }

  .dh-section     { padding: 72px 0; }
  .dh-section--lg { padding: 84px 0; }
  .dh-section--sm { padding: 56px 0; }
  .dh-grid--split { gap: 48px; }
  .dh-grid--aside { gap: 40px; }
  .dh-card--pad,
  .dh-card--form  { padding: 26px 22px; }
  .dh-frame       { max-width: none; }
  .dh-frame::before { inset: 16px -16px -16px 16px; }
  .dh-frame > img { height: 380px; }
  .dh-stats       { gap: 28px; }
  .dh-stat__value { font-size: 34px; }
  .dh-footer__inner { flex-direction: column; align-items: flex-start; gap: 12px; }
  .dh-footer--tall .dh-footer__inner { align-items: center; }
  .dh-modal       { padding: 16px; }
  .dh-modal__head { padding: 22px; }
  .dh-modal__body { padding: 22px; }
  .dh-feed__item  { padding: 22px; }
  .dh-feed__head  { padding: 24px 22px 18px; }
  .dh-feed__item--split { padding: 20px 22px; gap: 12px; }
  .dh-feed__item--split .dh-feed__date { min-width: 0; }
  .dh-acc__btn    { padding: 18px; gap: 14px; }
  .dh-acc__num    { min-width: 40px; font-size: 19px; }
  .dh-acc__inner  { padding: 0 18px 20px; }
  .dh-tile        { padding: 24px; }
  .dh-tile__top   { margin-bottom: 24px; }
  .dh-grid--tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

@media (max-width: 520px) {
  .dh-btn { width: 100%; }
  .dh-row > .dh-btn { width: auto; flex: 1 1 auto; }
  .dh-tabs { gap: 0; }
  .dh-tab  { padding: 14px 14px; font-size: 11px; letter-spacing: 0.12em; }
}

@media print {
  .dh-nav, .dh-footer, .dh-btn, .dh-back { display: none !important; }
  body { background: #fff; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
