:root {
  --bg: #000000;
  --bg-elevated: #0d0d0d;
  --bg-accent: #1a0505;
  --ink: #ffffff;
  --muted: #b8b8b8;
  --line: #3a3a3a;
  --brand: #dd0000;
  --brand-bright: #ff0000;
  --brand-soft: #ff8484;
  --brand-dark: #990000;
  --warn: #ff8484;
  --ok: #7dffa0;
  --card: rgba(12, 12, 12, 0.92);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  --font-display: "Roboto", "Segoe UI", sans-serif;
  --font-body: "Roboto", "Segoe UI", Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--font-body);
  background: var(--bg);
}

body {
  background:
    radial-gradient(ellipse at 85% 20%, rgba(221, 0, 0, 0.18) 0%, transparent 45%),
    radial-gradient(ellipse at 10% 80%, rgba(80, 0, 0, 0.35) 0%, transparent 40%),
    linear-gradient(180deg, #000000 0%, #0a0000 55%, #000000 100%);
  background-attachment: fixed;
}

a { color: var(--brand-soft); }
a:hover { color: #ffffff; }

.app-shell {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

.app-shell:has(.console-shell) {
  width: min(1180px, calc(100% - 2rem));
}

.console-shell {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.console-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.console-header h1 {
  margin: 0;
}

.role-pill {
  background: rgba(221, 0, 0, 0.2);
  border: 1px solid var(--brand);
  color: #fff;
}

.console-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.75rem;
}

.console-nav-btn {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.78rem;
  font-weight: 700;
}

.console-nav-btn:hover {
  color: #fff;
  border-color: var(--line);
}

.console-nav-btn.active {
  color: #fff;
  border-color: var(--brand);
  background: rgba(221, 0, 0, 0.15);
}

.console-panel {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 1.25rem 1.35rem 1.5rem;
  box-shadow: var(--shadow);
}

.console-panel h2 {
  margin-top: 0;
}

.console-gate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.console-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  padding: 1.1rem 1.2rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.stat-card {
  border: 1px solid var(--line);
  padding: 0.9rem 1rem;
  background: rgba(0, 0, 0, 0.35);
}

.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.stat-value {
  margin-top: 0.35rem;
  font-size: 1.35rem;
  font-weight: 700;
}

.hierarchy-box {
  margin-top: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
}

.hierarchy-list {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
  line-height: 1.55;
}

.hierarchy-list strong {
  color: var(--ink);
}

.branch-picker {
  display: block;
  max-width: 28rem;
  margin: 0.75rem 0 1rem;
}

.role-scope-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.35rem 0.75rem;
  margin: 0.75rem 0 1rem;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  padding: 0.75rem;
}

.topbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.7rem;
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem 0.95rem;
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid #222;
  border-bottom: 2px solid var(--brand);
}

.topbar-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.brand-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.8vw, 1.9rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-bright);
  margin: 0;
  font-weight: 700;
  line-height: 1.15;
}

.brand span {
  display: block;
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: #ffffff;
  font-weight: 600;
  margin-top: 0.15rem;
}

.account-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  min-width: 0;
}

.account-email {
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 16rem;
}

.logout-btn {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 0.45rem 1rem;
  background: var(--brand);
  color: #fff;
  border: 0;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 0.78rem;
}

.logout-btn:hover {
  background: var(--brand-bright);
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.nav-left {
  display: flex;
  align-items: center;
  min-height: 2.2rem;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
}

.nav-vest {
  min-width: 9.5rem;
}

button.secondary.active,
.nav-vest.active {
  background: var(--brand);
  color: #fff;
}

.panel {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 0;
  padding: 1.4rem 1.5rem 1.6rem;
  animation: rise 420ms ease both;
}

.panel-tile {
  padding-top: 2.5rem;
}

.tile-close {
  position: absolute;
  top: 0.4rem;
  right: 0.45rem;
  z-index: 3;
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 0.75rem;
  color: var(--brand-bright);
  font-weight: 700;
}

h1 { font-size: 1.7rem; color: var(--brand-bright); }
h2 {
  font-size: 1.15rem;
  margin-top: 1.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--brand);
  color: var(--brand-bright);
}

h3, .section-subhead {
  color: #ffffff;
  border-bottom: none;
}

.lead {
  color: var(--muted);
  margin: 0 0 1.2rem;
  max-width: 42rem;
}

.lead strong { color: #ffffff; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted);
}

input, select, textarea, button {
  font: inherit;
}

input, select, textarea {
  width: 100%;
  border: 1px solid #444;
  background: #111;
  color: #ffffff;
  border-radius: 0;
  padding: 0.65rem 0.7rem;
}

textarea { min-height: 110px; resize: vertical; }

input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(221, 0, 0, 0.55);
  border-color: var(--brand);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.1rem;
}

button, .btn {
  appearance: none;
  border: 0;
  border-radius: 0;
  background: var(--brand);
  color: #ffffff;
  padding: 0.7rem 1.05rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 160ms ease, color 160ms ease;
}

button:hover, .btn:hover { background: var(--brand-bright); }
button.secondary, .btn.secondary {
  background: transparent;
  color: #ffffff;
  border: 1px solid var(--brand);
}
button.secondary:hover, .btn.secondary:hover {
  background: var(--brand);
  color: #ffffff;
}
button.danger { background: var(--brand-dark); }
button:disabled { opacity: 0.55; cursor: not-allowed; }

.muted { color: var(--muted); }
.ok { color: var(--ok); font-weight: 700; }
.err { color: var(--warn); font-weight: 700; }

.banner {
  border: 1px solid #4a1010;
  background: var(--bg-accent);
  padding: 0.8rem 0.9rem;
  border-radius: 0;
  margin-bottom: 1rem;
  color: #ffffff;
}

.info-box p {
  margin: 0.55rem 0 0;
  color: #e8e8e8;
  font-size: 0.95rem;
  line-height: 1.45;
}

.info-list {
  margin: 0.55rem 0 0;
  padding-left: 1.2rem;
  line-height: 1.5;
  color: #e8e8e8;
}

.info-list.numbered {
  padding-left: 1.35rem;
}

.info-list li + li {
  margin-top: 0.45rem;
}

.signature-box {
  border: 1px solid var(--line);
  background: #0a0a0a;
  padding: 0.9rem;
  border-radius: 0;
  margin-bottom: 1rem;
}

#signatureCanvas,
#advocacySignatureCanvas,
#annexCSignatureCanvas,
#memberSignatureCanvas,
#guestSignatureCanvas,
#noticeSignatureCanvas {
  display: block;
  width: 100%;
  max-width: 640px;
  height: 180px;
  touch-action: none;
  background: #ffffff;
  border: 1px dashed #666;
  border-radius: 0;
  cursor: crosshair;
}

#advSigDrawPanel,
#annexCSigDrawPanel {
  background: #ffffff;
  padding: 0.65rem;
  border: 1px solid #ddd;
}

.wet-signature-block .wet-sig-lines {
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px dashed #666;
  background: #111;
  font-family: var(--font-display);
  letter-spacing: 0.02em;
  line-height: 1.9;
  color: #ffffff;
}

.upload-slot {
  margin: 0.35rem 0 0.9rem 1.6rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  background: #111;
  border-radius: 0;
}

.abr-evidence-preview {
  display: block;
  max-width: 100%;
  width: min(100%, 520px);
  margin-top: 0.75rem;
  border: 1px solid var(--line);
  background: #fff;
}

.safeguard-list {
  display: grid;
  gap: 0.65rem;
  margin: 0.35rem 0 0.9rem;
}

.safeguard-list .check-row {
  align-items: flex-start;
}

.upload-slot label {
  display: block;
  margin-bottom: 0.55rem;
}

.camera-block {
  margin-top: 0.5rem;
}

#photoVideo,
#photoPreview {
  display: block;
  width: 100%;
  max-width: 360px;
  margin-top: 0.5rem;
  border: 1px solid var(--line);
  background: #111;
  border-radius: 0;
}

#photoPreview {
  background: #111;
  object-fit: cover;
  max-height: 280px;
}

.file-capture-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--brand);
  background: transparent;
  color: #ffffff;
  font: inherit;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  font-size: 0.85rem;
}

.annex-table {
  margin-bottom: 1.25rem;
}

.annex-table table {
  min-width: 720px;
}

.annex-table th,
.annex-table td {
  vertical-align: top;
  font-size: 0.88rem;
}

.annex-table tbody tr td:not(:first-child) {
  min-width: 5.5rem;
  height: 2rem;
}

.otp-code {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 0.35em;
  color: var(--brand-bright);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.tab {
  background: #111;
  color: #ffffff;
  border: 1px solid var(--line);
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 0;
}
.tab.active {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
}

.member-invite-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.member-invite-form input {
  min-width: 10rem;
  flex: 1;
}

.member-notes-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  min-width: 12rem;
}
.member-notes-form textarea {
  width: 100%;
  min-height: 3.2rem;
  resize: vertical;
  font-size: 0.85rem;
  line-height: 1.35;
}
.member-notes-actions {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}
button.member-notes-save,
button.member-notes-edit,
button.member-notes-cancel {
  flex: 0 0 auto;
  width: auto !important;
  min-width: 0;
  padding: 0.2rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.1;
}
.member-reason-read {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.45rem;
}
.member-reason-text {
  margin: 0;
  flex: 1 1 10rem;
  white-space: pre-wrap;
  font-size: 0.85rem;
  line-height: 1.35;
  color: #e8e8e8;
}
.member-reason-cell {
  min-width: 14rem;
  max-width: 32rem;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #0a0a0a;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  border-bottom: 1px solid #2a2a2a;
  padding: 0.55rem 0.65rem;
  text-align: left;
  font-size: 0.9rem;
}

th {
  background: #160000;
  color: var(--brand-bright);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.78rem;
}

.exec-sign-table input {
  width: 100%;
  min-width: 5.5rem;
}

td { color: #e8e8e8; }

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.65rem;
  border: 1px solid var(--brand);
  color: #ffffff;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.section-subhead {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 1.1rem 0 0.55rem;
  color: #ffffff;
  font-weight: 700;
}

button.danger-text,
.btn.danger-text {
  background: transparent;
  color: var(--brand-soft);
  border: 1px solid transparent;
  padding: 0.25rem 0.45rem;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}

button.danger-text:hover {
  color: #ffffff;
  border-color: var(--brand);
  background: transparent;
}

code {
  background: #1a1a1a;
  border: 1px solid #333;
  padding: 0.1rem 0.35rem;
  color: var(--brand-soft);
}

@media (max-width: 980px) {
  .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .topbar { align-items: stretch; }
  .topbar-main { flex-direction: column; align-items: flex-start; }
  .account-links { width: 100%; justify-content: flex-start; }
  .account-email { max-width: 100%; }
  .brand-wrap { width: 100%; }
  .nav-links { justify-content: flex-end; }
  .nav-row { justify-content: space-between; }
  .choice-grid { grid-template-columns: 1fr; }
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.fieldset-block {
  border: 1px solid var(--line);
  padding: 0.85rem 1rem 1rem;
  margin: 0.85rem 0;
  background: rgba(255, 255, 255, 0.02);
}

.fieldset-block legend {
  padding: 0 0.35rem;
  color: var(--ink);
  font-weight: 500;
}

.choice-card {
  appearance: none;
  border: 1px solid var(--line);
  background: #0c0c0c;
  color: var(--ink);
  text-align: left;
  padding: 0.95rem 1.05rem 1.05rem;
  border-radius: 0;
  cursor: pointer;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.28rem;
  min-height: 8.75rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  transition: border-color 180ms ease, background 180ms ease;
}

.choice-card:hover {
  border-color: var(--brand);
  background: #140404;
}

.choice-kicker {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.3;
}

.choice-title {
  font-family: var(--font-display);
  font-size: 1.12rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand);
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
}

.choice-copy {
  color: var(--muted);
  line-height: 1.4;
  font-size: 0.86rem;
  font-weight: 400;
  margin-top: 0.15rem;
}

.stack-checks {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0.4rem 0 0.9rem;
}

.check-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.55rem;
  font-weight: 500;
  color: #ffffff;
  font-size: 0.92rem;
  line-height: 1.4;
}

.check-row input {
  width: auto;
  margin-top: 0.2rem;
  flex: 0 0 auto;
}

.is-hidden {
  display: none !important;
}

.home-hero {
  margin-bottom: 0.35rem;
}

.home-hero h1 {
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  margin-bottom: 0.2rem;
}

.home-hero .tagline {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.78rem;
  margin: 0 0 0.4rem;
}

.home-hero .lead {
  margin-bottom: 0;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.id-photo-block {
  margin: 0.75rem 0 1.2rem;
  padding: 0.9rem;
  border: 1px solid var(--brand);
  background: #0a0a0a;
}

.id-photo-block h3 {
  margin: 0 0 0.4rem;
}

.id-photo-frame {
  width: min(100%, 280px);
  aspect-ratio: 3 / 4;
  margin: 0.75rem auto;
  border: 2px solid var(--brand);
  background: #111;
  overflow: hidden;
  position: relative;
}

.id-photo-frame video,
.id-photo-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.id-photo-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.id-photo-placeholder[hidden],
.id-photo-frame video[hidden],
.id-photo-frame img[hidden] {
  display: none !important;
}

.photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.photo-actions [hidden] {
  display: none !important;
}

.photo-actions button {
  flex: 1 1 160px;
  min-height: 48px;
}

.photo-status {
  margin: 0.55rem 0 0;
  color: var(--ok);
  font-weight: 700;
}

.waiver-legal {
  border: 1px solid var(--line);
  background: #0a0a0a;
  padding: 0.9rem 1rem;
  margin: 0.75rem 0 1rem;
  max-height: 22rem;
  overflow: auto;
  line-height: 1.55;
  font-size: 0.92rem;
}

.login-split {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.guest-entry {
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
}

@media (max-width: 640px) {
  #memberSignatureCanvas,
  #guestSignatureCanvas,
  #noticeSignatureCanvas {
    height: 150px;
  }

  .id-photo-frame {
    width: min(100%, 320px);
  }

  .photo-actions button {
    width: 100%;
    flex: 1 1 100%;
  }

  .resources-split {
    grid-template-columns: 1fr;
  }

  .notebook {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .nb-col {
    max-height: none;
  }

  .nb-sources,
  .nb-right {
    max-height: 22rem;
  }

  .chat-drawer {
    width: min(100vw - 1rem, 420px);
    right: 0.5rem;
    left: 0.5rem;
  }
}

.resource-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.resource-row-actions button {
  width: auto;
  padding: 0.28rem 0.55rem;
  font-size: 0.72rem;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell:has(.notebook) {
  width: min(1440px, calc(100% - 1.25rem));
}

#view.panel-notebook {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.notebook {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 0.75rem;
  min-height: calc(100vh - 8.5rem);
  align-items: stretch;
}

.nb-col {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(100vh - 8.5rem);
  overflow: hidden;
}

.nb-col-head,
.nb-chat-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.9rem 1rem 0.65rem;
  border-bottom: 1px solid var(--line);
}

.nb-chat-bar .actions {
  align-items: center;
}

.nb-back {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.55rem;
  font-weight: 400;
  line-height: 1;
  text-transform: none;
  letter-spacing: 0;
}

.nb-back:hover,
.nb-back:focus {
  background: transparent;
  color: #fff;
}

.nb-col-head h2,
.nb-chat-bar h2,
.nb-reader h2,
.nb-reader-empty h2 {
  margin: 0;
  border: 0;
  padding: 0;
  font-size: 0.95rem;
}

.nb-sources {
  padding-bottom: 0.75rem;
}

.nb-filter {
  display: block;
  padding: 0.7rem 1rem 0.4rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.nb-filter input {
  width: 100%;
  margin-top: 0.3rem;
}

#nbSourceList {
  overflow: auto;
  padding: 0 0.65rem 0.5rem;
  flex: 1;
}

.nb-source-group {
  margin: 0.85rem 0.35rem 0.4rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-soft);
  border: 0;
  padding: 0;
}

.nb-source-list {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.nb-source {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: stretch;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.03);
}

.nb-source.active {
  border-color: var(--brand);
  background: rgba(221, 0, 0, 0.16);
}

.nb-check {
  display: flex;
  align-items: center;
  padding: 0 0.45rem;
}

.nb-source button {
  width: 100%;
  justify-content: space-between;
  gap: 0.5rem;
  background: transparent;
  border: 0;
  color: #fff;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  text-align: left;
  padding: 0.55rem 0.65rem 0.55rem 0;
}

.nb-source button:hover {
  background: transparent;
  color: #fff;
}

.nb-source-title {
  display: block;
  font-size: 0.82rem;
  line-height: 1.3;
}

.nb-source-foot {
  padding: 0.55rem 1rem 0;
  font-size: 0.78rem;
}

.nb-center {
  min-width: 0;
}

.nb-chat {
  border: 0;
  background: transparent;
  min-height: 0;
  height: 100%;
  padding: 0;
}

.nb-hero {
  margin: auto;
  max-width: 34rem;
  text-align: center;
  padding: 1.5rem 1rem 2rem;
}

.nb-kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brand-soft);
  font-weight: 700;
  font-size: 0.78rem;
  margin: 0 0 0.4rem;
}

.nb-hero h2 {
  margin: 0 0 0.55rem;
  border: 0;
  padding: 0;
  font-size: 1.55rem;
  text-transform: none;
  letter-spacing: 0.02em;
}

.nb-prompts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.55rem;
  margin-top: 1.15rem;
}

.nb-prompt {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid #333;
  color: #fff;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  padding: 0.85rem 0.8rem;
  font-size: 0.88rem;
  min-height: 3.2rem;
}

.nb-prompt:hover {
  border-color: var(--brand-bright);
  background: rgba(221, 0, 0, 0.18);
}

.nb-chat .chat-transcript {
  min-height: 0;
  max-height: none;
  flex: 1;
  padding: 1rem 1.1rem;
}

.nb-composer {
  margin: 0 1rem 0.35rem;
  padding: 0.55rem;
  border: 1px solid #444;
  background: #080808;
}

.nb-composer textarea {
  min-height: 52px;
  border: 0;
  background: transparent;
}

.nb-send {
  min-width: 4.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.nb-disclaimer {
  margin: 0 1.1rem 0.85rem;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.nb-thinking {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
}

.nb-thinking strong {
  display: block;
  font-size: 0.9rem;
}

.nb-thinking .muted {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
}

.nb-spinner {
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.12rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: nb-spin 0.7s linear infinite;
  flex: 0 0 auto;
}

.nb-spinner-btn {
  width: 0.9rem;
  height: 0.9rem;
  margin: 0;
  border-width: 2px;
}

.nb-progress {
  height: 3px;
  margin-top: 0.75rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.nb-progress span {
  display: block;
  width: 40%;
  height: 100%;
  background: var(--brand);
  animation: nb-progress 1.2s ease-in-out infinite;
}

@keyframes nb-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes nb-progress {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(280%);
  }
}

.nb-notice {
  padding: 0.55rem 1rem 0;
  color: var(--brand-soft);
}

.cite-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  margin: 0 0.12rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  border: 0;
  background: var(--brand);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
  vertical-align: 0.15em;
}

.cite-num:hover {
  background: var(--brand-bright);
}

.nb-right {
  padding: 0;
}

.nb-reader,
.nb-reader-empty {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  padding: 0.9rem 1rem 1rem;
}

.nb-cite-hit {
  background: rgba(221, 0, 0, 0.28);
  color: #fff;
  padding: 0.05em 0;
}
.nb-reader .resource-text {
  flex: 1;
  min-height: 0;
  max-height: none;
}

.nb-quote {
  margin: 0 0 0.75rem;
  padding: 0.7rem 0.8rem;
  border-left: 3px solid var(--brand);
  background: rgba(221, 0, 0, 0.12);
  color: #f3f3f3;
  font-size: 0.88rem;
  line-height: 1.45;
}

.resource-doc-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0 0 1.1rem;
}

.resource-doc-btn {
  width: 100%;
  justify-content: space-between;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #333;
  color: #fff;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  text-align: left;
}

.resource-doc-btn:hover,
.resource-doc-btn.active {
  background: rgba(221, 0, 0, 0.18);
  border-color: var(--brand);
}

.resource-reader-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.resource-reader-head h2 {
  margin-top: 0;
}

.resource-text {
  white-space: pre-wrap;
  overflow: auto;
  max-height: min(48vh, 28rem);
  background: #050505;
  border: 1px solid var(--line);
  padding: 0.9rem 1rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  line-height: 1.5;
  color: #e8e8e8;
}

.chat-panel {
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  padding: 0.9rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  min-height: 28rem;
}

.chat-panel-head h2 {
  margin-top: 0;
  border-bottom: 0;
  padding-bottom: 0;
}

.chat-transcript {
  flex: 1;
  overflow: auto;
  min-height: 14rem;
  max-height: 22rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 0.4rem 0 0.8rem;
}

.chat-empty {
  color: var(--muted);
  padding: 0.4rem 0.2rem 0.2rem;
}

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.chat-suggestions button {
  background: transparent;
  border: 1px solid #444;
  color: #fff;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  padding: 0.45rem 0.7rem;
  font-size: 0.82rem;
}

.chat-suggestions button:hover {
  border-color: var(--brand);
  background: rgba(221, 0, 0, 0.2);
}

.chat-bubble {
  max-width: 92%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  line-height: 1.45;
  font-size: 0.92rem;
}

.chat-bubble-text p {
  margin: 0 0 0.65rem;
}

.chat-bubble-text p:last-child {
  margin-bottom: 0;
}

.chat-h {
  margin: 0.85rem 0 0.35rem;
  border: 0;
  padding: 0;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-soft);
}

.chat-h:first-child {
  margin-top: 0;
}

.chat-list {
  margin: 0 0 0.7rem;
  padding-left: 1.15rem;
}

.chat-list li {
  margin: 0.25rem 0;
}

.chat-user {
  align-self: flex-end;
  background: rgba(221, 0, 0, 0.18);
  border-color: var(--brand);
}

.chat-assistant {
  align-self: flex-start;
  background: #0a0a0a;
  max-width: 100%;
}

.chat-cites {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.chat-cite {
  background: transparent;
  border: 1px solid #555;
  color: var(--brand-soft);
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.45rem;
}

.chat-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  align-items: end;
}

.chat-composer textarea {
  min-height: 64px;
  margin: 0;
}

.chat-fab {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 40;
  box-shadow: var(--shadow);
  text-transform: none;
  letter-spacing: 0.03em;
  padding: 0.7rem 0.95rem;
  font-size: 0.82rem;
}

.chat-drawer {
  position: fixed;
  right: 1.1rem;
  bottom: 4.6rem;
  width: min(420px, calc(100vw - 1.5rem));
  z-index: 41;
  background: #0b0b0b;
  border: 1px solid var(--brand);
  box-shadow: var(--shadow);
}

.chat-drawer .chat-panel {
  border: 0;
  min-height: 24rem;
  max-height: min(70vh, 36rem);
}

.chat-drawer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 2.6rem 0 0.85rem;
}

.chat-drawer-close {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.55rem;
  font-weight: 400;
  line-height: 1;
  text-transform: none;
  letter-spacing: 0;
}

.chat-drawer-close:hover,
.chat-drawer-close:focus {
  background: transparent;
  color: #fff;
}

.vest-disclaimer-banner p {
  margin: 0.4rem 0 0;
}

.vest-photo-frame {
  width: min(100%, 340px);
  aspect-ratio: 3 / 4;
}

.vest-busy {
  margin-top: 0.75rem;
}

.vest-result {
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
  margin-top: 1.35rem;
  padding: 1rem 1.05rem 1.1rem;
  border: 1px solid var(--line);
  background: #0a0a0a;
}

.traffic-light {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  padding: 0.55rem 0.45rem;
  background: #111;
  border: 1px solid #333;
}

.traffic-light .lamp {
  display: block;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  opacity: 0.22;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.45);
}

.traffic-light .lamp.red { background: #c62828; }
.traffic-light .lamp.amber { background: #f9a825; }
.traffic-light .lamp.green { background: #2e7d32; }

.traffic-light .lamp.on {
  opacity: 1;
  box-shadow: 0 0 10px currentColor, inset 0 0 0 2px rgba(0, 0, 0, 0.35);
}

.traffic-light .lamp.red.on { box-shadow: 0 0 12px #c62828; }
.traffic-light .lamp.amber.on { box-shadow: 0 0 12px #f9a825; }
.traffic-light .lamp.green.on { box-shadow: 0 0 12px #2e7d32; }

.vest-result-copy {
  min-width: 0;
  flex: 1;
}

.vest-light-label {
  margin: 0 0 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
}

.vest-result-copy h2 {
  margin-bottom: 0.45rem;
}

.vest-result-copy h3 {
  margin-top: 0.9rem;
  font-size: 0.85rem;
}

.vest-result-copy ul {
  margin: 0.35rem 0 0;
  padding-left: 1.15rem;
}

.vest-disclaimer {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.vest-photo-note {
  margin: 0.55rem 0 0;
  font-size: 0.88rem;
}

.vest-annotate {
  position: relative;
  display: block;
  max-width: min(100%, 28rem);
  margin: 0.75rem 0 1rem;
  border: 1px solid #7c3aed;
  background: #111;
}

.vest-annotate img {
  display: block;
  width: 100%;
  height: auto;
}

.vest-highlight {
  position: absolute;
  box-sizing: border-box;
  border: 3px solid #c084fc;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.65);
  pointer-events: auto;
}

.vest-highlight.is-active {
  border-color: #e9d5ff;
  box-shadow: 0 0 0 2px #c084fc, 0 0 10px rgba(192, 132, 252, 0.55);
}

.vest-highlight-n {
  position: absolute;
  top: -0.7rem;
  left: -0.15rem;
  min-width: 1.15rem;
  padding: 0.05rem 0.28rem;
  background: #c084fc;
  color: #111;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.vest-issue-list {
  list-style: none;
  margin: 0.45rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.vest-issue-item {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  cursor: default;
}

.vest-issue-n {
  flex: 0 0 auto;
  min-width: 1.2rem;
  padding: 0.05rem 0.28rem;
  background: #c084fc;
  color: #111;
  font-size: 0.75rem;
  font-weight: 800;
  text-align: center;
}

.vest-issue-item.is-active .vest-issue-n {
  background: #e9d5ff;
}

.vest-result-green { border-color: #2e7d32; }
.vest-result-amber { border-color: #f9a825; }
.vest-result-red { border-color: #c62828; }

@media (max-width: 640px) {
  .vest-result {
    flex-direction: column;
  }
}
