/* ==========================================================================
   ISO Audit 2026 — Evidence Index
   Design language: an auditor's ledger. Navy spine, gold clause numerals,
   paper-white evidence cards. Motion is limited to the spine marker and
   accordion so the page stays calm under scrutiny.
   ========================================================================== */

:root {
  --ink: #0a1f44;
  --navy: #12305f;
  --navy-soft: #1c4380;
  --gold: #f2a900;
  --gold-dim: #c98d05;
  --gold-wash: #fdf4e0;
  --ember: #e85c1a;
  --paper: #f1f4f9;
  --card: #ffffff;
  --rail-bg: #ffffff;
  --rule: #dde4ee;
  --rule-soft: #eaeef5;
  --text: #14203a;
  --muted: #63718d;
  --ok: #17805a;
  --ok-bg: #e6f4ee;

  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Playfair Display", "Source Serif 4", Georgia, "Times New Roman", serif;
  --body-serif: "Source Serif 4", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --rail: 320px;
  --rail-min: 76px;
  --topbar: 64px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(10, 31, 68, 0.05), 0 2px 8px rgba(10, 31, 68, 0.045);
  --shadow-md: 0 4px 12px rgba(10, 31, 68, 0.07), 0 12px 32px rgba(10, 31, 68, 0.07);
  --shadow-lg: 0 18px 50px rgba(10, 31, 68, 0.2);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

::selection { background: rgba(109, 59, 209, 0.18); color: inherit; }

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

/* ------------------------------------------------------------------ topbar */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--topbar);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: #ffffff;
  border-bottom: 1px solid #e5e5e8;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand__logo {
  height: 38px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.brand__text { display: flex; flex-direction: column; line-height: 1.15; }

.brand__title {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 700;
  color: #09090b;
  letter-spacing: -0.2px;
}

.brand__sub {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #71717a;
  font-weight: 600;
}

.topbar__spacer { flex: 1; }

/* search */
.search {
  position: relative;
  width: min(380px, 34vw);
  flex-shrink: 1;
}

.search__input {
  width: 100%;
  height: 38px;
  padding: 0 14px 0 38px;
  border-radius: var(--r-md);
  border: 1px solid #e4e4e7;
  background: #f4f4f5;
  color: #09090b;
  font-family: var(--sans);
  font-size: 13.5px;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.search__input::placeholder { color: #a1a1aa; }

.search__input:focus {
  outline: none;
  border-color: #18181b;
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(24, 24, 27, 0.08);
}

.search__icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: #71717a;
  pointer-events: none;
}

.search__results {
  position: absolute;
  top: 46px;
  left: 0;
  right: 0;
  background: #ffffff;
  border-radius: var(--r-md);
  border: 1px solid #e4e4e7;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  max-height: 60vh;
  overflow-y: auto;
  display: none;
}

.search__results.is-open { display: block; }

.search__hit {
  display: block;
  padding: 11px 15px;
  text-decoration: none;
  border-bottom: 1px solid #f4f4f5;
}

.search__hit:last-child { border-bottom: 0; }
.search__hit:hover { background: #f4f4f5; }

.search__hit-title { font-weight: 600; font-size: 13.5px; color: #09090b; }
.search__hit-meta { font-size: 11.5px; color: #71717a; margin-top: 2px; }
.search__empty { padding: 16px; font-size: 13px; color: #71717a; text-align: center; }

/* topbar actions */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #e4e4e7;
  background: #f4f4f5;
  color: #18181b;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease);
}

.pill:hover { background: #e4e4e7; border-color: #d4d4d8; color: #09090b; }

.pill--gold {
  background: #18181b;
  border-color: #18181b;
  color: #ffffff;
}

.pill--gold:hover { background: #27272a; border-color: #27272a; color: #ffffff; }

.mode-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  color: #18181b;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.sidebar-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid #e4e4e7;
  background: #f4f4f5;
  color: #18181b;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease);
}

.sidebar-toggle-btn:hover {
  background: #e4e4e7;
  border-color: #d4d4d8;
  color: #09090b;
}

.hamburger {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid #e4e4e7;
  background: #f4f4f5;
  color: #18181b;
  cursor: pointer;
  place-items: center;
}

/* ----------------------------------------------------------------- sidebar */
.layout {
  display: flex;
  padding-top: var(--topbar);
  min-height: 100vh;
  transition: all 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.rail {
  width: var(--rail);
  flex-shrink: 0;
  position: fixed;
  top: var(--topbar);
  bottom: 0;
  left: 0;
  background: #f8f9fa;
  border-right: 1px solid #e5e5e8;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 40px;
  z-index: 50;
  transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.25s ease;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.02);
}

.rail::-webkit-scrollbar { width: 6px; }
.rail::-webkit-scrollbar-thumb { background: #d4d4d8; border-radius: 3px; }
.rail::-webkit-scrollbar-thumb:hover { background: #a1a1aa; }

/* sidebar header */
.rail__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #e5e5e8;
  background: #f8f9fa;
  position: sticky;
  top: 0;
  z-index: 10;
}

.rail__header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.rail__header-logo {
  height: 28px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.rail__header-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #09090b;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


.rail__collapse-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #52525b;
  cursor: pointer;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}

.rail__collapse-btn:hover {
  background: #e4e4e7;
  color: #09090b;
}

/* coverage meter — clean light ChatGPT styling */
.meter {
  padding: 14px 16px;
  margin: 12px 14px 6px;
  background: #ffffff;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.meter__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.meter__label {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #71717a;
  font-weight: 700;
}

.meter__value {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 800;
  color: #09090b;
  line-height: 1;
}

.meter__track {
  height: 6px;
  border-radius: 999px;
  background: #f4f4f5;
  overflow: hidden;
}

.meter__fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #18181b, #0a1f44);
  transition: width 0.9s var(--ease);
}

.meter__facts {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: #71717a;
}

.meter__facts b { color: #18181b; font-weight: 700; }

/* sections */
.rail__section { padding: 14px 0 4px; }

.rail__section-title {
  padding: 0 16px 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8e8e93;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rail__section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e5e5e8;
}

/* folder node */
.node { position: relative; }

.node__row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin: 2px 8px;
  border-radius: 8px;
  color: #27272a;
  text-decoration: none;
  cursor: pointer;
  border-left: 0;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}

.node__row:hover {
  background: #ececec;
  color: #09090b;
}

.node__row.is-active {
  background: #18181b;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.node__caret {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: #71717a;
  transition: transform 0.22s var(--ease), color 0.16s var(--ease);
}

.node__row:hover .node__caret { color: #18181b; }
.node__row.is-active .node__caret { color: #ffffff; }

.node__caret.is-open { transform: rotate(90deg); }
.node__caret.is-leaf { visibility: hidden; }

.node__no {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: #4b5563;
  min-width: 28px;
  flex-shrink: 0;
}

.node__row.is-active .node__no { color: #f4f4f5; }

.node__title {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
}

.node__row.is-active .node__title {
  font-weight: 600;
  color: #ffffff;
}

.node__count {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  min-width: 22px;
  height: 19px;
  padding: 0 6px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #e4e4e7;
  color: #3f3f46;
  flex-shrink: 0;
}

.node__row:hover .node__count {
  background: #d4d4d8;
  color: #18181b;
}

.node__row.is-active .node__count {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

/* nested children */
.node__children {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.28s var(--ease);
  border-left: 1.5px solid #e4e4e7;
  margin-left: 20px;
  padding-left: 2px;
}

.node__children.is-open { max-height: 1600px; }

.node__children .node__row {
  padding-left: 10px;
  margin: 2px 6px;
}

.node__children .node__title { font-size: 12.5px; }

/* drive link + evidence rows inside a folder */
.leaf {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  margin: 2px 6px;
  border-radius: 8px;
  color: #52525b;
  text-decoration: none;
  font-size: 12.4px;
  transition: color 0.16s var(--ease), background 0.16s var(--ease);
}

.leaf:hover { color: #09090b; background: #ececec; }
.leaf svg { flex-shrink: 0; opacity: 0.75; }
.leaf span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaf--drive { color: #2563eb; font-weight: 600; }
.leaf--drive:hover { color: #1d4ed8; background: #eff6ff; }

.rail__add {
  margin: 14px 14px 0;
  width: calc(100% - 28px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  border-radius: 8px;
  border: 1px dashed #a1a1aa;
  background: transparent;
  color: #18181b;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
}

.rail__add:hover { background: #e4e4e7; border-color: #18181b; }

/* Collapsed layout (Min Mode) */
.layout.is-collapsed .rail {
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
}

.layout.is-collapsed .main {
  margin-left: 0;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 40px;
  padding-right: 40px;
}

/* -------------------------------------------------------------------- main */
.main {
  flex: 1;
  margin-left: var(--rail);
  min-width: 0;
  padding: 30px 38px 90px;
  transition: margin-left 0.3s cubic-bezier(0.22, 0.61, 0.36, 1), padding 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}


.crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.crumb a { text-decoration: none; }
.crumb a:hover { color: var(--ink); text-decoration: underline; }
.crumb__sep { opacity: 0.45; }

/* folder header */
.head {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 26px 30px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  margin-bottom: 26px;
}

.head::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--gold), var(--ember));
}

.head__top {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

.head__no {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ember);
  background: rgba(232, 92, 26, 0.09);
  border: 1px solid rgba(232, 92, 26, 0.24);
  padding: 4px 11px;
  border-radius: 999px;
  flex-shrink: 0;
  margin-top: 6px;
}

.head__body { flex: 1; min-width: 240px; }

.head__eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.head__title {
  font-family: var(--serif);
  font-size: clamp(24px, 3vw, 33px);
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 12px;
}

.head__actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--rule);
  background: var(--card);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.12s var(--ease);
}

.btn:hover { border-color: var(--muted); background: #f7f9fc; }
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.btn--primary:hover { background: var(--navy); border-color: var(--navy); }

.btn--gold {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}

.btn--gold:hover { background: #ffb81a; border-color: #ffb81a; }

.btn--ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn--ghost:hover { background: var(--paper); color: var(--text); }

.btn--danger { color: #b3261e; }
.btn--danger:hover { background: #fdeceb; border-color: #f3c0bd; }

.btn--sm { height: 32px; padding: 0 12px; font-size: 12.5px; }

/* section label above record list */
.strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
}

.strip__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.strip__rule { flex: 1; height: 1px; background: var(--rule); }

/* record card = one remarks block + its evidence */
.record {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  overflow: hidden;
  transition: box-shadow 0.2s var(--ease);
}

.record:hover { box-shadow: var(--shadow-md); }

.record__head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--rule-soft);
  background: linear-gradient(180deg, #fbfcfe, #fff);
}

.record__index {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--navy);
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.record__remarks {
  flex: 1;
  font-size: 14.2px;
  color: var(--text);
  white-space: pre-line;
  line-height: 1.62;
  min-width: 0;
}

.record__remarks:empty::before {
  content: "No remarks recorded.";
  color: var(--muted);
  font-style: italic;
}

.record__tools { display: flex; gap: 4px; flex-shrink: 0; }

.record__body { padding: 20px 24px 22px; }

/* evidence tiles */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 14px;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: #fcfdff;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.tile:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.tile__thumb {
  height: 128px;
  background: var(--paper);
  overflow: hidden;
  border-bottom: 1px solid var(--rule-soft);
}

.tile__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tile__main { display: flex; gap: 11px; padding: 13px 14px; flex: 1; }

.tile__icon {
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  flex-shrink: 0;
  text-transform: uppercase;
  background: var(--paper);
  color: var(--navy);
  border: 1px solid var(--rule);
}

.tile__icon[data-ext="pdf"] { background: #fdecea; color: #c0392b; border-color: #f6cfca; }
.tile__icon[data-ext="xlsx"], .tile__icon[data-ext="xls"], .tile__icon[data-ext="csv"] { background: #e7f5ee; color: #17805a; border-color: #c4e6d5; }
.tile__icon[data-ext="docx"], .tile__icon[data-ext="doc"] { background: #e8f0fd; color: #1a56c4; border-color: #c7d9f8; }
.tile__icon[data-ext="pptx"], .tile__icon[data-ext="ppt"] { background: #fdf0e6; color: #d1620a; border-color: #f7d6b8; }

.tile__text { min-width: 0; flex: 1; }

.tile__title {
  font-size: 13.2px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
  word-break: break-word;
}

.tile__desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.5;
}

.tile__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 14px;
  border-top: 1px solid var(--rule-soft);
  background: #fff;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}

.tag--ok { background: var(--ok-bg); color: var(--ok); }
.tag--pending { background: #fdf3e0; color: #a8720a; }
.tag--file { background: #eaf0fb; color: var(--navy); }

.tile__tools { display: flex; gap: 2px; }

.icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.icon-btn:hover { background: var(--paper); color: var(--ink); }
.icon-btn--danger:hover { background: #fdeceb; color: #b3261e; }

/* the plus tile — admin's add affordance, same grid as the evidence tiles */
.tile--add {
  border: 1.5px dashed var(--rule);
  background: transparent;
  align-items: center;
  justify-content: center;
  min-height: 128px;
  gap: 8px;
  padding: 22px;
  cursor: pointer;
  font-family: var(--sans);
  color: var(--muted);
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease), color 0.18s var(--ease);
}

.tile--add:hover {
  border-color: var(--gold);
  background: rgba(242, 169, 0, 0.06);
  color: var(--ink);
  transform: none;
  box-shadow: none;
}

.tile--add .plus {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--paper);
  color: var(--navy);
  transition: background 0.18s var(--ease), color 0.18s var(--ease), transform 0.2s var(--ease);
}

.tile--add:hover .plus { background: var(--gold); color: var(--ink); transform: rotate(90deg); }

.tile--add span { font-size: 13px; font-weight: 600; }
.tile--add small { font-size: 11.5px; color: var(--muted); }

/* add-a-remarks-block row */
.add-record {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  border: 1.5px dashed var(--rule);
  border-radius: var(--r-lg);
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease), color 0.18s var(--ease);
}

.add-record:hover { border-color: var(--gold); background: rgba(242, 169, 0, 0.06); color: var(--ink); }

/* empty state */
.empty {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 60px 30px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.empty__mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--paper);
  color: var(--navy);
}

.empty h3 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--ink);
}

.empty p { color: var(--muted); font-size: 14px; margin: 0 0 18px; }

/* ------------------------------------------------------------------- modal */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 31, 68, 0.5);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.overlay.is-open { display: flex; }

.modal {
  width: min(560px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  animation: rise 0.22s var(--ease);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--rule-soft);
}

.modal__title {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}

.modal__body { padding: 20px 24px; }

.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--rule-soft);
}

.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }

.field__label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.field__hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

.input, .textarea, .select {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: #fcfdff;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--text);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(242, 169, 0, 0.16);
}

.textarea { min-height: 108px; resize: vertical; line-height: 1.6; }

/* file drop */
.drop {
  border: 1.5px dashed var(--rule);
  border-radius: var(--r-md);
  padding: 22px;
  text-align: center;
  cursor: pointer;
  background: #fcfdff;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}

.drop:hover, .drop.is-hot { border-color: var(--gold); background: rgba(242, 169, 0, 0.06); }
.drop input { display: none; }
.drop__icon { color: var(--navy); margin-bottom: 8px; }
.drop__text { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.drop__sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

.drop__preview {
  display: none;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.drop__preview.is-on { display: flex; }
.drop__preview img { width: 52px; height: 52px; object-fit: cover; border-radius: var(--r-sm); }
.drop__preview .name { font-size: 13px; font-weight: 600; word-break: break-all; }
.drop__preview .size { font-size: 11.5px; color: var(--muted); font-family: var(--mono); }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* toast */
.toasts {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 250px;
  padding: 13px 16px;
  border-radius: var(--r-md);
  background: var(--ink);
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: rise 0.22s var(--ease);
}

.toast--ok { border-left: 3px solid var(--ok); }
.toast--bad { border-left: 3px solid var(--ember); }

/* ------------------------------------------------------------------- login */
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1000px 520px at 15% -10%, rgba(242, 169, 0, 0.14), transparent 60%),
    radial-gradient(900px 480px at 100% 110%, rgba(232, 92, 26, 0.12), transparent 60%),
    var(--ink);
}

.auth__card {
  width: min(410px, 100%);
  background: var(--card);
  border-radius: 20px;
  padding: 34px;
  box-shadow: var(--shadow-lg);
}

.auth__mark {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, var(--gold), var(--ember));
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 18px;
}

.auth__title {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 6px;
}

.auth__sub { color: var(--muted); font-size: 14px; margin: 0 0 24px; }

.auth__error {
  background: #fdeceb;
  border: 1px solid #f3c0bd;
  color: #b3261e;
  padding: 10px 13px;
  border-radius: var(--r-md);
  font-size: 13px;
  margin-bottom: 16px;
}

.auth__back {
  display: block;
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}

.auth__back:hover { color: var(--ink); }

/* scrim for mobile drawer */
.scrim {
  position: fixed;
  inset: var(--topbar) 0 0 0;
  background: rgba(10, 31, 68, 0.45);
  z-index: 45;
  display: none;
}

.scrim.is-open { display: block; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  :root { --rail: 292px; }
  .main { padding: 26px 24px 80px; }
}

@media (max-width: 860px) {
  .hamburger { display: grid; }
  .search { width: 100%; order: 3; }
  .search__results { max-height: 50vh; }
  .rail {
    transform: translateX(-100%);
    transition: transform 0.26s var(--ease);
    width: 300px;
    box-shadow: var(--shadow-lg);
  }
  .rail.is-open { transform: none; }
  .main { margin-left: 0; padding: 22px 16px 70px; }
  .brand__sub { display: none; }
  .head { padding: 22px 20px; }
  .record__head, .record__body { padding-left: 18px; padding-right: 18px; }
  .tiles { grid-template-columns: 1fr; }
  .topbar { gap: 12px; padding: 0 14px; }
  .pill span { display: none; }
  .pill { padding: 0 12px; }
}

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

/* Phones: the topbar wraps so the search field gets a full-width second row. */
@media (max-width: 620px) {
  :root { --topbar: 116px; }
  .topbar {
    flex-wrap: wrap;
    height: var(--topbar);
    align-content: center;
    padding: 10px 14px;
    row-gap: 10px;
  }
  .topbar__spacer { display: none; }
  .brand { flex: 1; min-width: 0; }
  .brand__title { font-size: 17px; }
  .search { order: 5; flex-basis: 100%; }
  .mode-tag { order: 4; }
  .rail { width: min(320px, 88vw); }
  .head__title { font-size: 22px; }
  .head__actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* ==========================================================================
   v2 — light shell, JGI branding, minimisable rail, Excel view
   Loaded last so these rules win over the earlier navy-topbar block.
   ========================================================================== */

/* ------------------------------------------------------------- topbar */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--rule);
  gap: 14px;
  padding: 0 18px;
  box-shadow: 0 1px 2px rgba(10, 31, 68, 0.04);
}

.brand__logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: contain;
  flex-shrink: 0;
  background: #fff;
}

.brand__title { color: var(--ink); font-size: 18px; }
.brand__sub { color: var(--muted); }

.icon-square {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: var(--r-md);
  border: 1px solid var(--rule);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.16s var(--ease), color 0.16s var(--ease), border-color 0.16s var(--ease);
}

.icon-square:hover { background: var(--paper); color: var(--ink); border-color: #c9d3e2; }
.icon-square.hamburger { display: none; }

/* view switch — folders vs the workbook layout */
.viewswitch {
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--rule);
  flex-shrink: 0;
}

.viewswitch__item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 15px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.16s var(--ease), color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}

.viewswitch__item:hover { color: var(--ink); }

.viewswitch__item.is-on {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 1px 3px rgba(10, 31, 68, 0.22);
}

/* search on a light bar */
.search__input {
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--text);
  height: 38px;
}

.search__input::placeholder { color: var(--muted); }

.search__input:focus {
  border-color: var(--gold);
  background: var(--card);
  box-shadow: 0 0 0 3px rgba(242, 169, 0, 0.15);
}

.search__icon { color: var(--muted); }

.pill {
  border-color: var(--rule);
  color: var(--text);
  height: 38px;
}

.pill:hover { background: var(--paper); border-color: #c9d3e2; }
.pill--gold { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.pill--gold:hover { background: #ffb81a; border-color: #ffb81a; }

.mode-tag {
  background: var(--gold-wash);
  border-color: #f0d79b;
  color: #96690a;
}

/* --------------------------------------------------------------- rail */
.rail {
  background: var(--rail-bg);
  border-right: 1px solid var(--rule);
  transition: width 0.24s var(--ease), transform 0.24s var(--ease);
}

.rail::-webkit-scrollbar-thumb { background: #cdd6e4; }

.meter {
  border-bottom: 1px solid var(--rule-soft);
  padding: 18px 20px 16px;
}

.meter__label { color: var(--muted); }
.meter__value { color: var(--ink); }
.meter__track { background: var(--rule); }
.meter__facts { color: var(--muted); }
.meter__facts b { color: var(--ink); }

.rail__section-title { color: var(--muted); }
.rail__section-title::after { background: var(--rule); }

.node__row { color: var(--text); border-left-width: 3px; }
.node__row:hover { background: var(--paper); color: var(--ink); }

.node__row.is-active {
  background: var(--ink);
  border-left-color: var(--gold);
  color: #fff;
}

.node__row.is-active .node__no { color: var(--gold); }
.node__caret { color: #97a3b8; }
.node__row.is-active .node__caret { color: rgba(255, 255, 255, 0.7); }
.node__no { color: var(--ember); }

.node__count { background: var(--paper); color: var(--muted); border: 1px solid var(--rule); }
.node__row.is-active .node__count { background: var(--gold); color: var(--ink); border-color: var(--gold); }

.node__children { border-left-color: var(--rule); }
.leaf { color: var(--muted); }
.leaf:hover { color: var(--ink); background: var(--paper); }
.leaf--drive { color: var(--navy); font-weight: 500; }
.leaf--drive:hover { color: var(--ember); }

.rail__add { border-color: #ecd9a6; color: var(--gold-dim); }
.rail__add:hover { background: var(--gold-wash); border-color: var(--gold); color: #96690a; }

/* ----------------------------------------------- minimised rail (icon mode) */
.layout.is-min .rail { width: var(--rail-min); }
.layout.is-min .main { margin-left: var(--rail-min); }

.layout.is-min .meter__label,
.layout.is-min .meter__facts,
.layout.is-min .rail__section-title,
.layout.is-min .node__title,
.layout.is-min .node__caret,
.layout.is-min .node__children,
.layout.is-min .rail__add span,
.layout.is-min .leaf span { display: none; }

.layout.is-min .meter { padding: 14px 10px 12px; text-align: center; }
.layout.is-min .meter__row { justify-content: center; margin-bottom: 7px; }
.layout.is-min .meter__value { font-size: 17px; }
.layout.is-min .meter__track { height: 4px; }

.layout.is-min .rail__section { padding: 10px 0 2px; border-top: 1px solid var(--rule-soft); }
.layout.is-min .rail__section:first-of-type { border-top: 0; }

.layout.is-min .node__row {
  justify-content: center;
  align-items: center;
  padding: 0 6px;
  min-height: 46px;
  gap: 0;
  position: relative;
  margin: 2px 8px;
  border-radius: var(--r-md);
  border-left: 0;
}

.layout.is-min .node__row.is-active { border-left: 0; }

.layout.is-min .node__no {
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.02em;
}

/* the count rides the corner as a small dot-badge, clear of the numeral */
.layout.is-min .node__count {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 15px;
  height: 15px;
  font-size: 9px;
  padding: 0 3px;
  line-height: 1;
  border: 0;
  background: var(--rule);
  color: var(--muted);
}

.layout.is-min .node__row.is-active .node__count { background: var(--gold); color: var(--ink); }

.layout.is-min .rail__add { width: calc(100% - 24px); margin-inline: 12px; }

/* The rail scrolls, so a ::after tooltip would be clipped — app.js positions
   a fixed-position tooltip on <body> instead. */
.railtip {
  position: fixed;
  z-index: 200;
  background: var(--ink);
  color: #fff;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  max-width: 260px;
  box-shadow: var(--shadow-md);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 0.14s var(--ease);
}

.railtip.is-on { opacity: 1; }

.railtip__no {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}

/* ---------------------------------------------------------- main surface */
.head::before { background: linear-gradient(180deg, var(--gold), var(--ember)); }
.record__index { background: var(--ink); }
.tile:hover { border-color: var(--gold); }

/* ============================================================ Excel view */
.sheet-page {
  padding: 26px 30px 80px;
  max-width: 1560px;
  margin: 0 auto;
  padding-top: calc(var(--topbar) + 26px);
}

.sheet-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.sheet-head__eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
}

.sheet-head__title {
  font-family: var(--serif);
  font-size: clamp(25px, 3vw, 34px);
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 7px;
  line-height: 1.15;
}

.sheet-head__note {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  max-width: 60ch;
}

.sheet-head__tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.sheet-filter { position: relative; }

.sheet-filter__input {
  height: 38px;
  width: 240px;
  padding: 0 13px 0 36px;
  border-radius: var(--r-md);
  border: 1px solid var(--rule);
  background: var(--card);
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--text);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.sheet-filter__input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(242, 169, 0, 0.15);
}

.sheet-filter__icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.sheet-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 16px;
  font-family: var(--mono);
}

.sheet-stats b { color: var(--ink); font-weight: 700; }

.sheet-stats__dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #b9c3d4;
}

.sheet-wrap {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: auto;
  max-height: calc(100vh - var(--topbar) - 210px);
}

.sheet {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.2px;
}

.sheet__th {
  position: sticky;
  top: 0;
  z-index: 5;
  text-align: left;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 12px 14px;
  white-space: nowrap;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.sheet__th:last-child { border-right: 0; }
.sheet__th--1 { width: 78px; }
.sheet__th--2 { width: 21%; }
.sheet__th--3 { width: 20%; }
.sheet__th--4 { width: 27%; }

.sheet__section td {
  background: var(--gold-wash);
  color: var(--ink);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 10px 14px;
  border-top: 1px solid #f0dcae;
  border-bottom: 1px solid #f0dcae;
  position: sticky;
  top: 41px;
  z-index: 4;
}

.sheet__cell {
  padding: 12px 14px;
  vertical-align: top;
  border-bottom: 1px solid var(--rule-soft);
  border-right: 1px solid var(--rule-soft);
}

.sheet__cell:last-child { border-right: 0; }
.sheet__row:hover > .sheet__cell { background: #f8fafd; }

.sheet__cell--no { text-align: center; }

.sheet__sl {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ember);
  background: rgba(232, 92, 26, 0.08);
  border: 1px solid rgba(232, 92, 26, 0.2);
  border-radius: 999px;
  padding: 3px 9px;
}

.sheet__folder {
  display: block;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.45;
  position: relative;
}

.sheet__folder:hover { color: var(--ember); text-decoration: underline; }

.sheet__nest {
  position: absolute;
  left: -11px;
  top: 8px;
  width: 7px;
  height: 7px;
  border-left: 1.5px solid var(--rule);
  border-bottom: 1.5px solid var(--rule);
  border-bottom-left-radius: 3px;
}

.sheet__link {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--navy);
  text-decoration: none;
  line-height: 1.45;
  font-weight: 500;
}

.sheet__link svg { flex-shrink: 0; margin-top: 3px; opacity: 0.75; }
.sheet__link:hover { color: var(--ember); text-decoration: underline; }

.sheet__cell--remarks { white-space: pre-line; color: var(--text); line-height: 1.6; }
.sheet__blank { color: #b3bccd; }

.sheet__files { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }

.sheet__file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  line-height: 1.4;
}

.sheet__file:hover .sheet__file-name { color: var(--ember); text-decoration: underline; }
.sheet__file--pending { color: var(--muted); }
.sheet__file-name { word-break: break-word; font-size: 12.8px; }

.sheet__ext {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 6px;
  border-radius: 5px;
  background: var(--paper);
  color: var(--navy);
  border: 1px solid var(--rule);
  min-width: 34px;
  text-align: center;
}

.sheet__ext[data-ext="pdf"] { background: #fdecea; color: #c0392b; border-color: #f6cfca; }
.sheet__ext[data-ext="xlsx"], .sheet__ext[data-ext="xls"], .sheet__ext[data-ext="csv"] { background: #e7f5ee; color: #17805a; border-color: #c4e6d5; }
.sheet__ext[data-ext="docx"], .sheet__ext[data-ext="doc"] { background: #e8f0fd; color: #1a56c4; border-color: #c7d9f8; }
.sheet__ext[data-ext="pptx"], .sheet__ext[data-ext="ppt"] { background: #fdf0e6; color: #d1620a; border-color: #f7d6b8; }
.sheet__ext[data-ext="png"], .sheet__ext[data-ext="jpg"], .sheet__ext[data-ext="jpeg"] { background: #f0eafd; color: #6633c7; border-color: #ddd0f8; }

.sheet__pending {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: #fdf3e0;
  color: #a8720a;
}

.sheet-empty { padding: 40px; text-align: center; color: var(--muted); font-size: 14px; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1180px) {
  .viewswitch__item span { display: none; }
  .viewswitch__item { padding: 0 12px; }
}

@media (max-width: 860px) {
  .icon-square.hamburger { display: grid; }
  #railMin { display: none; }
  .sheet-page { padding: calc(var(--topbar) + 18px) 14px 70px; }
  .sheet-wrap { max-height: none; border-radius: var(--r-md); }
  .sheet-head { align-items: flex-start; }
  .sheet-filter__input { width: 100%; }
  .sheet-filter { flex: 1 1 200px; }

  /* the table becomes stacked cards — a 5-column grid never works on a phone */
  .sheet thead { display: none; }
  .sheet, .sheet tbody, .sheet tr, .sheet td { display: block; width: 100%; }

  .sheet__section td {
    position: static;
    border-radius: var(--r-sm);
    margin: 14px 0 10px;
  }

  .sheet__row {
    border: 1px solid var(--rule);
    border-radius: var(--r-md);
    margin-bottom: 10px;
    overflow: hidden;
    background: var(--card);
  }

  .sheet__cell {
    border-right: 0;
    border-bottom: 1px solid var(--rule-soft);
    padding: 11px 13px;
  }

  .sheet__cell:last-child { border-bottom: 0; }
  .sheet__cell--no { text-align: left; padding-bottom: 0; border-bottom: 0; }

  .sheet__cell--remarks::before,
  .sheet__cell--files::before,
  .sheet__cell--link::before {
    display: block;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 5px;
  }

  .sheet__cell--link::before { content: "Folder link"; }
  .sheet__cell--remarks::before { content: "Remarks"; }
  .sheet__cell--files::before { content: "Hyperlinks"; }
  .sheet__folder { font-size: 15px; padding-left: 0 !important; }
  .sheet__nest { display: none; }
}

/* ------------------------------- evidence tile: file and link side by side */
.tile { position: relative; }

.tile__title { display: block; text-decoration: none; }

/* The title covers the whole card, so the tile stays one big click target
   while the footer chips remain separately clickable above it. */
.tile__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: var(--r-md);
}

.tile__link:hover { color: var(--ember); }

.tile__tags { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.tile__chip {
  position: relative;
  z-index: 2;
  text-decoration: none;
  transition: filter 0.15s var(--ease);
}

.tile__chip:hover { filter: brightness(0.94); text-decoration: underline; }
.tile__chip svg { width: 11px; height: 11px; }

.tile__tools { position: relative; z-index: 2; }

/* the same pairing inside the Excel view */
.sheet__also {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--ok-bg);
  color: var(--ok);
  text-decoration: none;
  white-space: nowrap;
}

.sheet__also:hover { text-decoration: underline; }

/* Modal: file and link are complementary, not alternatives. */
.divider--and::before, .divider--and::after { background: var(--rule); }
.divider--and { color: var(--gold-dim); }

/* ==========================================================================
   v3 — opening sequence, sectioned rail, step-through nav, formal type
   ========================================================================== */

/* ------------------------------------------------------ brand lockup */
.brand { gap: 11px; }

.brand__wordmark { height: 30px; width: auto; display: block; flex-shrink: 0; }
.brand__mark-sm { height: 30px; width: 30px; border-radius: 50%; display: none; flex-shrink: 0; }

.brand__divider {
  width: 1px;
  height: 26px;
  background: var(--rule);
  flex-shrink: 0;
}

.brand__title { font-family: var(--serif); font-size: 17px; letter-spacing: 0.01em; }
.brand__sub { font-size: 9.5px; letter-spacing: 0.16em; }

/* ---------------------------------------------- sectioned, collapsible rail */
.rail { padding-top: 10px; }

.group { border-bottom: 1px solid var(--rule-soft); }
.group:last-of-type { border-bottom: 0; }

.group__head {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 13px 18px;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  transition: color 0.16s var(--ease), background 0.16s var(--ease);
}

.group__head:hover { color: var(--ink); background: var(--paper); }

.group__caret {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #9aa6bb;
  transition: transform 0.24s var(--ease);
}

.group.is-open .group__caret { transform: rotate(90deg); }

.group__title { flex: 1; line-height: 1.4; }

.group__count {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--rule);
  color: var(--muted);
  flex-shrink: 0;
}

.group__body {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s var(--ease), opacity 0.24s var(--ease);
  opacity: 0;
  padding-bottom: 0;
}

.group.is-open > .group__body { max-height: 3000px; opacity: 1; padding-bottom: 8px; }

/* Focus on the chosen branch: everything else recedes. Kept as a fade rather
   than a true blur — blurred text next to sharp text is hard to scan back to. */
.rail.has-active .group:not(.is-open) .group__head { opacity: 0.5; }
.rail.has-active .node:not(.is-on-path) > .node__row { opacity: 0.48; }
.rail:hover.has-active .group:not(.is-open) .group__head,
.rail:hover.has-active .node:not(.is-on-path) > .node__row { opacity: 1; }
.rail.has-active .node > .node__row { transition: opacity 0.22s var(--ease); }

/* -------------------------------------------------------- step-through nav */
.stepper {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
}

.stepper__btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--card);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
  min-width: 0;
}

.stepper__btn:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.stepper__btn--next { justify-self: end; text-align: right; }
.stepper__btn--next .stepper__text { align-items: flex-end; }

.stepper__arrow {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  flex-shrink: 0;
  transition: background 0.18s var(--ease);
}

.stepper__btn:hover .stepper__arrow { background: var(--gold); color: var(--ink); }

.stepper__text { display: flex; flex-direction: column; min-width: 0; }

.stepper__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.stepper__name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 30ch;
}

.stepper__count {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

/* ------------------------------------------------------ opening sequence */
.intro {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(1100px 620px at 18% -12%, rgba(242, 169, 0, 0.16), transparent 62%),
    radial-gradient(900px 520px at 105% 112%, rgba(232, 92, 26, 0.14), transparent 60%),
    #071634;
}

.intro[hidden] { display: none; }

.intro.is-out { animation: introOut 0.75s var(--ease) forwards; }

@keyframes introOut {
  to { opacity: 0; visibility: hidden; }
}

.intro__grain {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 3px 3px;
  pointer-events: none;
}

.intro__stage {
  position: relative;
  width: min(780px, 88vw);
  min-height: 300px;
  display: grid;
  place-items: center;
  text-align: center;
}

.intro__scene {
  grid-area: 1 / 1;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.intro__scene.is-on { visibility: visible; animation: sceneIn 0.9s var(--ease) forwards; }
.intro__scene.is-off { visibility: visible; animation: sceneOut 0.42s var(--ease) forwards; }

@keyframes sceneIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

@keyframes sceneOut {
  from { opacity: 1; transform: none; filter: blur(0); }
  to { opacity: 0; transform: translateY(-12px) scale(1.02); filter: blur(5px); visibility: hidden; }
}

/* Scene 1 — the wordmark rushes forward out of the dark.
   The zoom lives on the wrapper and the colour filter on the image: a keyframe
   that animates `filter` replaces the property outright, so putting both on one
   element silently drops the white-out and the navy logo vanishes on navy. */
/* No plate: make_light_logo.py writes a dark-background variant of the artwork
   (disc goes white, JGi goes navy, gold dot untouched), so the logo sits
   straight on the backdrop. A CSS invert cannot do this — it would flatten the
   disc and its letters to the same white. */
.intro__zoom { display: block; }

.intro__scene.is-on .intro__zoom { animation: markZoom 1.6s var(--ease) both; }

@keyframes markZoom {
  0% { opacity: 0; transform: scale(0.28) rotate(-8deg); }
  60% { opacity: 1; }
  74% { transform: scale(1.06) rotate(0deg); }
  100% { opacity: 1; transform: scale(1); }
}

.intro__wordmark {
  display: block;
  width: clamp(250px, 40vw, 500px);
  height: auto;
  filter: drop-shadow(0 20px 50px rgba(0, 0, 0, 0.45));
}

.intro__scene[data-scene="1"] .intro__rule { animation: sceneIn 0.9s var(--ease) 1s both; }

.intro__kicker {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(11px, 1.5vw, 13px);
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
}

.intro__line {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(30px, 6vw, 58px);
  line-height: 1.1;
  color: #fff;
}

.intro__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(38px, 8vw, 86px);
  line-height: 1.02;
  letter-spacing: -0.015em;
  color: #fff;
}

.intro__sub {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(12px, 1.7vw, 15px);
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.intro__rule {
  display: block;
  width: clamp(120px, 22vw, 230px);
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.intro__names {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.intro__names li {
  font-family: var(--serif);
  font-size: clamp(20px, 3.4vw, 32px);
  font-weight: 500;
  color: #fff;
}

.intro__scene.is-on .intro__names li { animation: sceneIn 0.7s var(--ease) both; animation-delay: calc(0.3s + var(--i) * 0.22s); }

.intro__skip {
  position: absolute;
  top: 24px;
  right: 26px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
}

.intro__skip:hover { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.5); }

.intro__progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
}

.intro__progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--gold), var(--ember));
}

/* ------------------------------------------------------------ formal type */
.head__title { letter-spacing: -0.01em; }
.record__remarks { font-family: var(--body-serif); font-size: 15px; line-height: 1.68; }
.sheet__cell--remarks { font-family: var(--body-serif); font-size: 14px; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  .brand__sub { display: none; }
}

@media (max-width: 900px) {
  .brand__wordmark { display: none; }
  .brand__mark-sm { display: block; }
  .brand__divider { display: none; }
}

@media (max-width: 860px) {
  .stepper { grid-template-columns: 1fr; gap: 10px; }
  .stepper__btn { justify-content: flex-start; }
  .stepper__btn--next { justify-self: stretch; flex-direction: row-reverse; text-align: left; }
  .stepper__btn--next .stepper__text { align-items: flex-start; }
  .stepper__count { order: 3; text-align: center; }
  .stepper__name { max-width: 100%; white-space: normal; }
  .intro__skip { top: 16px; right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .intro { display: none !important; }
}

/* ------------------------------------- in-memory database warning + empty state */
.mockbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  padding: 10px 18px;
  background: #4a2c00;
  color: #ffe6b0;
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
  border-top: 2px solid var(--gold);
}

.mockbar strong { color: var(--gold); }

.mockbar code {
  font-family: var(--mono);
  font-size: 11.5px;
  background: rgba(255, 255, 255, 0.12);
  padding: 1px 5px;
  border-radius: 4px;
}

.empty__actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.empty p code {
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 1px 6px;
  border-radius: 5px;
}

.empty__hint { font-size: 12.5px; color: var(--muted); margin: 0; }

/* ==========================================================================
   v4 — vivid refresh
   A colour pass over the whole shell: a navy→indigo→violet brand gradient,
   warmer golds, and small pops of azure / teal / pink. Structure and class
   names are untouched — this layer only re-skins surfaces and rebuilds the
   opening sequence, so nothing in the templates or JS has to change.
   ========================================================================== */
:root {
  --indigo: #3f3d9e;
  --violet: #6d3bd1;
  --azure: #1c7ed6;
  --teal: #0ca678;
  --pink: #e64980;
  --gold-warm: #ffc32b;

  --brand-grad: linear-gradient(135deg, #16356b 0%, #3f3d9e 52%, #6d3bd1 100%);
  --brand-grad-soft: linear-gradient(135deg, #1d3f79, #4b46b0);
  --gold-grad: linear-gradient(135deg, #ffc32b, #ef7a0c);
  --sunrise: linear-gradient(135deg, #f2a900, #e8590c);
  --glow-violet: 0 10px 30px rgba(109, 59, 209, 0.28);
}

/* a softly tinted, living background instead of flat paper */
body {
  background:
    radial-gradient(920px 520px at 100% -6%, rgba(109, 59, 209, 0.07), transparent 60%),
    radial-gradient(760px 480px at -8% 6%, rgba(28, 126, 214, 0.07), transparent 55%),
    radial-gradient(680px 520px at 50% 120%, rgba(242, 169, 0, 0.05), transparent 60%),
    var(--paper);
  background-attachment: fixed;
}

/* -------------------------------------------------------------- topbar */
.topbar {
  position: relative;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(1.4) blur(10px);
  box-shadow: 0 1px 0 rgba(16, 33, 71, 0.05), 0 8px 24px -18px rgba(16, 33, 71, 0.4);
}

/* a slim brand-gradient hairline under the bar ties the whole shell together */
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, #16356b, #3f3d9e, #6d3bd1, #f2a900);
  opacity: 0.9;
}

.brand__logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #fff, 0 2px 8px rgba(16, 33, 71, 0.28);
}

.brand__text { gap: 1px; }

.brand__eyebrow {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--violet);
}

.brand__title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 0.005em;
}

.brand__sub { font-size: 9.5px; letter-spacing: 0.14em; color: var(--muted); }

/* admin pill gets the warm gradient */
.pill--gold {
  background: var(--gold-grad);
  border-color: transparent;
  color: #3a2400;
  box-shadow: 0 2px 10px -2px rgba(232, 89, 12, 0.5);
}

.pill--gold:hover { filter: brightness(1.05); background: var(--gold-grad); border-color: transparent; }

.viewswitch__item.is-on { background: var(--brand-grad-soft); box-shadow: var(--glow-violet); }

/* --------------------------------------------------------------- rail */
.rail {
  background: linear-gradient(180deg, #fbfcff, #f5f7fc);
}

.meter {
  background: linear-gradient(160deg, #ffffff, #f6f4ff);
  border: 1px solid #e7e3fb;
  box-shadow: 0 6px 20px -14px rgba(63, 61, 158, 0.5);
}

.meter__value {
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.meter__fill { background: linear-gradient(90deg, #3f3d9e, #6d3bd1, #f2a900); }

/* a coloured dot leads each rail section header */
.group__head { gap: 10px; }

.group__title { position: relative; }

.group__head::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--violet);
  box-shadow: 0 0 0 3px rgba(109, 59, 209, 0.14);
  order: -1;
  margin-left: -2px;
}

.group:nth-of-type(3n + 1) .group__head::before { background: var(--azure); box-shadow: 0 0 0 3px rgba(28, 126, 214, 0.14); }
.group:nth-of-type(3n + 2) .group__head::before { background: var(--teal); box-shadow: 0 0 0 3px rgba(12, 166, 121, 0.14); }
.group:nth-of-type(3n + 3) .group__head::before { background: var(--pink); box-shadow: 0 0 0 3px rgba(230, 73, 128, 0.14); }

.group.is-open .group__head { color: var(--ink); }

.node__row:hover { background: rgba(109, 59, 209, 0.07); color: var(--ink); }

.node__row.is-active {
  background: var(--brand-grad);
  border-left-color: var(--gold-warm);
  color: #fff;
  box-shadow: var(--glow-violet);
}

.node__row.is-active .node__no,
.node__row.is-active .node__count { color: #fff; }
.node__row.is-active .node__count { background: rgba(255, 255, 255, 0.22); border-color: transparent; }

.leaf--drive { color: var(--azure); }
.leaf--drive:hover { color: var(--indigo); background: rgba(28, 126, 214, 0.08); }

.rail__add { border-color: #d9d2f7; color: var(--violet); }
.rail__add:hover { background: rgba(109, 59, 209, 0.08); border-color: var(--violet); color: var(--indigo); }

/* --------------------------------------------------------- main surface */
.crumb span[style] { color: var(--violet) !important; }

.head {
  background: linear-gradient(150deg, #ffffff 60%, #f7f4ff);
  border-color: #e9e5fb;
  box-shadow: 0 16px 40px -28px rgba(63, 61, 158, 0.55), var(--shadow-sm);
}

.head::before { width: 5px; background: linear-gradient(180deg, #f2a900, #e8590c, #6d3bd1); }

.head__eyebrow {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(109, 59, 209, 0.1);
  color: var(--violet);
  letter-spacing: 0.1em;
}

.head__no {
  color: #fff;
  background: var(--sunrise);
  border: 0;
  box-shadow: 0 4px 12px -3px rgba(232, 89, 12, 0.55);
}

/* buttons */
.btn--primary {
  background: var(--brand-grad-soft);
  border-color: transparent;
  box-shadow: 0 6px 16px -8px rgba(63, 61, 158, 0.7);
}

.btn--primary:hover { filter: brightness(1.08); background: var(--brand-grad-soft); border-color: transparent; }

.btn--gold {
  background: var(--gold-grad);
  border-color: transparent;
  color: #3a2400;
  box-shadow: 0 6px 16px -8px rgba(232, 89, 12, 0.6);
}

.btn--gold:hover { filter: brightness(1.06); background: var(--gold-grad); border-color: transparent; }

.strip__label {
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.strip__rule { background: linear-gradient(90deg, rgba(109, 59, 209, 0.35), transparent); }

/* evidence tiles — a coloured accent grows in on hover */
.tile { background: linear-gradient(180deg, #ffffff, #fbfaff); }

.tile::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--brand-grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
  z-index: 3;
}

.tile:hover { border-color: var(--violet); box-shadow: 0 18px 40px -22px rgba(109, 59, 209, 0.6); }
.tile:hover::before { transform: scaleX(1); }
.tile__link:hover { color: var(--violet); }

.tile--add::before { display: none; }
.tile--add:hover { border-color: var(--violet); background: rgba(109, 59, 209, 0.05); color: var(--indigo); }
.tile--add:hover .plus { background: var(--brand-grad); color: #fff; transform: rotate(90deg); }

.add-record:hover { border-color: var(--violet); background: rgba(109, 59, 209, 0.05); color: var(--indigo); }

.record__index { background: var(--brand-grad-soft); }
.record:hover { box-shadow: 0 18px 44px -30px rgba(63, 61, 158, 0.55), var(--shadow-md); }

.stepper__btn:hover { border-color: var(--violet); box-shadow: 0 14px 34px -24px rgba(109, 59, 209, 0.7); }
.stepper__btn:hover .stepper__arrow { background: var(--brand-grad); color: #fff; }
.stepper__arrow { background: var(--brand-grad-soft); }

/* excel view — brand-gradient header */
.sheet__th { background: linear-gradient(120deg, #16356b, #3f3d9e, #6d3bd1); }
.sheet__folder:hover { color: var(--violet); }
.sheet__link { color: var(--azure); }
.sheet__link:hover { color: var(--violet); }

/* focus ring picks up the brand violet */
:focus-visible { outline-color: var(--violet); }
.input:focus, .textarea:focus, .select:focus,
.search__input:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(109, 59, 209, 0.16);
}

/* ------------------------------------------------------------- login */
.auth {
  background:
    radial-gradient(1100px 560px at 12% -12%, rgba(109, 59, 209, 0.5), transparent 58%),
    radial-gradient(900px 520px at 105% 112%, rgba(242, 169, 0, 0.32), transparent 58%),
    radial-gradient(700px 500px at 60% 60%, rgba(28, 126, 214, 0.3), transparent 60%),
    #0a1636;
}

.auth__card {
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 30px 80px -30px rgba(6, 16, 46, 0.8);
}

.auth__mark { background: var(--brand-grad); color: #fff; box-shadow: var(--glow-violet); }

.auth__title {
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ========================================================= cinematic intro */
.intro {
  background:
    radial-gradient(1200px 700px at 20% -10%, rgba(109, 59, 209, 0.55), transparent 60%),
    radial-gradient(900px 600px at 100% 110%, rgba(232, 92, 26, 0.4), transparent 58%),
    radial-gradient(800px 620px at 70% 30%, rgba(28, 126, 214, 0.4), transparent 60%),
    #060f2b;
}

/* three slow-drifting colour clouds give the backdrop depth and motion */
.intro__aurora {
  position: absolute;
  inset: -20%;
  pointer-events: none;
  background:
    radial-gradient(closest-side, rgba(109, 59, 209, 0.55), transparent) 12% 22% / 46% 46% no-repeat,
    radial-gradient(closest-side, rgba(242, 169, 0, 0.42), transparent) 82% 30% / 40% 40% no-repeat,
    radial-gradient(closest-side, rgba(28, 126, 214, 0.45), transparent) 55% 84% / 50% 50% no-repeat;
  filter: blur(28px);
  animation: introDrift 16s ease-in-out infinite alternate;
}

@keyframes introDrift {
  0% { transform: translate3d(-3%, -2%, 0) scale(1); }
  50% { transform: translate3d(4%, 3%, 0) scale(1.08); }
  100% { transform: translate3d(-2%, 4%, 0) scale(1.04); }
}

.intro__grain { opacity: 0.35; }

/* the opening logo sits straight on the backdrop — no card. A soft feathered
   glow behind it (not a hard plate) lifts the dark disc and black wordmark off
   the dark aurora just enough to stay readable. */
.intro__plate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: clamp(18px, 3vw, 32px) clamp(26px, 5vw, 50px);
}

.intro__plate::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(ellipse 62% 58% at 50% 50%,
    rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.6) 45%, rgba(255, 255, 255, 0) 74%);
  filter: blur(16px);
}

.intro__logo {
  position: relative;
  z-index: 1;
  display: block;
  width: clamp(230px, 42vw, 460px);
  height: auto;
}

/* title in gradient ink */
.intro__title {
  background: linear-gradient(100deg, #ffe08a 0%, #ffffff 42%, #d6c4ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 8px 40px rgba(109, 59, 209, 0.4);
}

.intro__kicker {
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.intro__sub { color: rgba(255, 255, 255, 0.8); }

.intro__progress span { background: linear-gradient(90deg, #ffc32b, #ef7a0c, #6d3bd1); }

.intro__skip {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(6px);
}

.intro__skip:hover { background: rgba(255, 255, 255, 0.2); }

@media (prefers-reduced-motion: reduce) {
  .intro__aurora { animation: none; }
}

/* ==========================================================================
   v5 — official JAIN wordmark in the top bar
   jain.png is the full horizontal lockup (JGi disc + "JAIN Deemed-to-be
   University"), so it is shown at its natural aspect ratio rather than being
   forced into the round-mark slot the earlier layers assumed.
   ========================================================================== */
.brand { gap: 12px; }

.brand__logo {
  height: 34px;
  width: auto;
  max-width: 210px;
  border-radius: 0;
  background: none;
  box-shadow: none;
  object-fit: contain;
}

.brand__divider {
  display: block;
  width: 1px;
  height: 30px;
  background: var(--rule);
  flex-shrink: 0;
}

@media (max-width: 620px) {
  .brand__logo { height: 30px; max-width: 150px; }
  .brand__divider { display: none; }
}

/* ==========================================================================
   v6 — mobile top bar: stop the wordmark, title and view switch overlapping
   On narrow screens the JAIN wordmark alone stands in for the brand; the
   redundant "ISO Audit 2026" text lockup is dropped (the breadcrumb still
   names it), the view switch collapses to icons, and search takes its own
   full-width row. --topbar is raised to match the two-row height so the
   fixed bar never sits on top of the page content.
   ========================================================================== */
@media (max-width: 860px) {
  :root { --topbar: 110px; }

  .topbar {
    flex-wrap: wrap;
    height: var(--topbar);
    align-content: center;
    row-gap: 10px;
    padding: 10px 14px;
    gap: 10px;
  }

  .topbar__spacer { display: none; }

  /* brand = the JAIN logo only */
  .brand { flex: 0 0 auto; gap: 0; min-width: 0; }
  .brand__text,
  .brand__divider { display: none; }
  .brand__logo { height: 30px; max-width: 148px; }

  /* view switch as icons, stays on the first row */
  .viewswitch { order: 3; }
  .viewswitch__item span { display: none; }
  .viewswitch__item { padding: 0 12px; }

  /* admin / sign-out on the first row, right side */
  .pill { order: 4; }
  .pill span { display: none; }
  .pill { padding: 0 12px; }
  .mode-tag { order: 4; }

  /* search gets its own full-width second row */
  .search { order: 5; flex: 1 1 100%; width: 100%; }
}

@media (max-width: 430px) {
  .brand__logo { height: 27px; max-width: 116px; }
  .viewswitch__item { padding: 0 10px; }
}
