/* ==========================================================================
   The Nurse Bridge — app-client stylesheet
   Scope: logged-in / product surfaces (diagnostic, signup, login, dashboard,
   drill, progress, vocab, review). Self-contained — does not depend on the
   marketing styles.css. "Unity/brass" dark theme: calm, physician-signed,
   phone-first, big touch targets.
   ========================================================================== */

:root {
  /* dark cinematic ink — matches /css/site.css */
  --bg: #080a0e;
  --panel: #10151d;
  --panel-raised: #161c26;
  --hairline: rgba(224, 184, 119, 0.16);
  --track: #1c2230;
  --text: #e8edf4;
  --muted: #8a94a3;
  --heading: #fdf7ec;

  --gold: #e0b877;
  --gold-bright: #f4d59a;
  --gold-deep: #b98f4e;
  --gold-dim: #9a7a48;

  --correct: #7aa88a;
  --correct-bg: rgba(122, 168, 138, 0.12);
  --incorrect: #c76a5a;
  --incorrect-bg: rgba(199, 106, 90, 0.12);

  --font-serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  --font-mono: 'Cascadia Code', 'Cascadia Mono', Consolas, 'SF Mono', monospace;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow-card: 0 1px 0 rgba(0, 0, 0, 0.4), 0 20px 50px -24px rgba(0, 0, 0, 0.75);
  --tap: 48px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* signature film-grain texture — matches /css/site.css .grain, kept subtle so it
   never competes with quiz/exam legibility */
body::before {
  content: "";
  position: fixed;
  inset: -120px;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.86' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: nb-grain 0.5s steps(3) infinite;
}
@keyframes nb-grain {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-6%, 4%); }
  66% { transform: translate(5%, -5%); }
  100% { transform: translate(-3%, 2%); }
}
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}

body > * {
  position: relative;
  z-index: 1;
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--gold-bright);
  text-decoration: underline;
}

h1,
h2,
h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--heading);
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

h1 { font-size: clamp(1.9rem, 4.2vw, 2.75rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.2rem; }

p {
  margin: 0 0 1em;
}

.nb-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.nb-eyebrow::before {
  content: "";
  width: 20px;
  height: 1px;
  background: var(--gold-deep);
  display: inline-block;
}

.nb-muted {
  color: var(--muted);
}

/* ---------- layout shell ---------- */

.nb-shell {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px 64px;
  flex: 1;
}

.nb-shell-wide {
  max-width: 920px;
}

/* ---------- nav ---------- */

#nb-nav {
  border-bottom: 1px solid var(--hairline);
  background: rgba(6, 8, 12, 0.9);
  backdrop-filter: saturate(140%) blur(10px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nb-nav-inner {
  max-width: 920px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.nb-logo {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--heading);
  letter-spacing: 0.01em;
}

.nb-logo:hover {
  color: var(--gold);
  text-decoration: none;
}

.nb-nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nb-nav-links a {
  color: var(--muted);
  font-size: 0.88rem;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease;
}

.nb-nav-links a:hover {
  color: var(--text);
  text-decoration: none;
}

.nb-nav-links a.active {
  color: var(--gold);
}

.nb-nav-logout {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
  min-height: 38px;
}

.nb-nav-logout:hover {
  color: var(--text);
  border-color: var(--gold-dim);
}

/* ---------- footer ---------- */

#nb-footer {
  border-top: 1px solid var(--hairline);
  margin-top: 40px;
}

.nb-footer-inner {
  max-width: 920px;
  margin: 0 auto;
  padding: 20px 16px 32px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

.nb-footer-inner p {
  margin: 0 0 8px;
}

.nb-footer-links a {
  color: var(--muted);
}

.nb-footer-links a:hover {
  color: var(--gold);
}

/* ---------- cards / panels ---------- */

.nb-card {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.nb-card + .nb-card {
  margin-top: 16px;
}

.nb-card-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.nb-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 640px) {
  .nb-grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- buttons ---------- */

.nb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hairline);
  background: var(--panel-raised);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.05s ease;
  text-decoration: none;
}

.nb-btn:hover {
  border-color: var(--gold-dim);
  text-decoration: none;
}

.nb-btn:active {
  transform: translateY(1px);
}

.nb-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.nb-btn-primary {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  border-color: var(--gold);
  color: #1a1206;
  font-weight: 600;
  box-shadow: 0 10px 30px -14px rgba(224, 184, 119, 0.55);
}

.nb-btn-primary:hover {
  border-color: var(--gold-bright);
  background: linear-gradient(180deg, #ffe6bd, var(--gold-bright));
}

.nb-btn-block {
  width: 100%;
}

.nb-btn-lg {
  padding: 16px 24px;
  font-size: 1.05rem;
}

.nb-btn-ghost {
  background: transparent;
  border-color: var(--hairline);
  color: var(--muted);
}

.nb-btn-ghost:hover {
  color: var(--text);
}

/* ---------- forms ---------- */

.nb-field {
  margin-bottom: 16px;
}

.nb-field label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.nb-field input,
.nb-field select {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font-body);
}

.nb-field input:focus,
.nb-field select:focus {
  outline: none;
  border-color: var(--gold-dim);
}

.nb-field-hint {
  margin-top: 6px;
  font-size: 0.76rem;
  color: var(--muted);
}

.nb-check-row {
  margin-top: 4px;
}

.nb-check-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.4;
}

.nb-check-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-height: 20px;
  flex: none;
  margin: 1px 0 0;
  accent-color: var(--gold);
  background: var(--bg);
  border: 1px solid var(--hairline);
}

.nb-check-label a {
  color: var(--gold);
}

.nb-auth-card {
  max-width: 420px;
  margin: 40px auto;
  border-color: var(--hairline);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02) inset, 0 30px 70px -36px rgba(0, 0, 0, 0.85);
}

/* ---------- quiz item card ---------- */

.nb-item-domain {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.nb-item-stem {
  font-size: 1.08rem;
  line-height: 1.55;
  margin-bottom: 20px;
}

.nb-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nb-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  min-height: var(--tap);
  text-align: left;
  padding: 14px 16px;
  background: var(--panel-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.98rem;
  cursor: pointer;
  font-family: var(--font-body);
}

.nb-option:hover:not(:disabled) {
  border-color: var(--gold-dim);
}

.nb-option-key {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.nb-option.selected {
  border-color: var(--gold);
}

.nb-option.selected .nb-option-key {
  border-color: var(--gold);
  color: var(--gold);
}

.nb-option.is-correct {
  border-color: var(--correct);
  background: var(--correct-bg);
}

.nb-option.is-correct .nb-option-key {
  border-color: var(--correct);
  color: var(--correct);
}

.nb-option.is-incorrect {
  border-color: var(--incorrect);
  background: var(--incorrect-bg);
}

.nb-option.is-incorrect .nb-option-key {
  border-color: var(--incorrect);
  color: var(--incorrect);
}

.nb-option:disabled {
  cursor: default;
}

.nb-rationale {
  margin-top: 18px;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hairline);
  background: var(--bg);
}

.nb-rationale-byline {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}

.nb-rationale-text {
  font-size: 0.94rem;
  color: var(--text);
  line-height: 1.6;
}

.nb-item-footer {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- progress bar (linear) ---------- */

.nb-progressbar {
  height: 6px;
  width: 100%;
  background: var(--track);
  border-radius: 4px;
  overflow: hidden;
}

.nb-progressbar-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.nb-progress-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--muted);
  margin-bottom: 8px;
  font-family: var(--font-mono);
}

/* ---------- axis bars ---------- */

.nb-axis {
  margin-bottom: 16px;
}

.nb-axis:last-child {
  margin-bottom: 0;
}

.nb-axis-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.nb-axis-label {
  font-size: 0.88rem;
  color: var(--text);
}

.nb-axis-value {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.nb-axis-track {
  height: 10px;
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  overflow: hidden;
}

.nb-axis-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  transition: width 0.4s ease;
}

.nb-axis-fill.band-building {
  background: linear-gradient(90deg, #7a4a45, var(--incorrect));
}

.nb-axis-fill.band-approaching {
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
}

.nb-axis-fill.band-ready-provisional {
  background: linear-gradient(90deg, #3f7a4c, var(--correct));
}

/* ---------- domain mastery bars ---------- */

.nb-domain-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--hairline);
}

.nb-domain-row:last-child {
  border-bottom: none;
}

.nb-domain-name {
  font-size: 0.88rem;
}

.nb-domain-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nb-domain-track {
  width: 96px;
  height: 8px;
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  overflow: hidden;
}

.nb-domain-fill {
  height: 100%;
  background: var(--gold);
}

.nb-badge {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 20px;
  border: 1px solid var(--hairline);
  color: var(--muted);
  white-space: nowrap;
}

.nb-badge-ready-provisional {
  color: var(--correct);
  border-color: var(--correct);
}

.nb-badge-approaching {
  color: var(--gold);
  border-color: var(--gold-dim);
}

.nb-badge-building {
  color: var(--incorrect);
  border-color: var(--incorrect);
}

/* ---------- verdict / readiness banner ---------- */

.nb-verdict {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  line-height: 1.5;
  margin-bottom: 8px;
}

.nb-basis {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.03em;
}

/* ---------- streak ---------- */

.nb-streak {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nb-streak-flame {
  font-size: 1.6rem;
  line-height: 1;
}

.nb-streak-count {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--text);
}

.nb-streak-label {
  font-size: 0.78rem;
  color: var(--muted);
}

/* ---------- dashboard stat tiles ---------- */

.nb-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 560px) {
  .nb-stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

.nb-stat {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.nb-stat-value {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--text);
}

.nb-stat-label {
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 2px;
}

/* ---------- history bar chart (pure CSS) ---------- */

.nb-history-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 140px;
  padding: 8px 0 0;
  border-bottom: 1px solid var(--hairline);
}

.nb-history-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 4px;
}

.nb-history-bar {
  width: 100%;
  max-width: 22px;
  background: var(--track);
  border-radius: 3px 3px 0 0;
  position: relative;
  overflow: hidden;
}

.nb-history-bar-correct {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--gold);
}

.nb-history-date {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--muted);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  height: 34px;
}

.nb-tips {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nb-tip {
  padding: 12px 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 0.88rem;
}

.nb-tip strong {
  color: var(--gold);
}

/* ---------- vocab flip card ---------- */

.nb-flip-scene {
  perspective: 1200px;
  max-width: 420px;
  margin: 0 auto;
}

.nb-flip-card {
  position: relative;
  min-height: 220px;
  cursor: pointer;
}

.nb-flip-face {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-card);
  padding: 28px 22px;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.nb-flip-face.nb-flip-back {
  display: none;
  background: var(--panel-raised);
  border-color: var(--gold-dim);
}

.nb-flip-card.is-flipped .nb-flip-face.nb-flip-front {
  display: none;
}

.nb-flip-card.is-flipped .nb-flip-face.nb-flip-back {
  display: flex;
}

.nb-flip-text {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  line-height: 1.4;
}

.nb-flip-lang {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.nb-flip-hint {
  text-align: center;
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--muted);
}

.nb-grade-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.nb-grade-btn {
  min-height: var(--tap);
  border-radius: var(--radius-sm);
  border: 1px solid var(--hairline);
  background: var(--panel-raised);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
}

.nb-grade-again {
  border-color: var(--incorrect);
  color: var(--incorrect);
}

.nb-grade-hard {
  border-color: var(--gold-dim);
  color: var(--gold-dim);
}

.nb-grade-good {
  border-color: var(--gold);
  color: var(--gold);
}

.nb-grade-easy {
  border-color: var(--correct);
  color: var(--correct);
}

/* ---------- tri-lingual vocab card (TOPNURSE-MASTER-DESIGN.md §2.1.D) ----------
   Filipino leads (left), English exam-register stays center, Francais is
   always rightmost (Quebec/OQLF track). Stacked on phone, side-by-side on
   >=768px. Any column whose fil/fr value is empty falls back to rendering
   the English text (via NB.escapeHtml + JS fallback) so the layout never
   breaks before the translation pass runs. */

.nb-tri-card {
  display: grid;
  gap: 14px;
  max-width: 900px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .nb-tri-card {
    grid-template-columns: 1fr 1fr 1fr;
    align-items: stretch;
  }
}

.nb-tri-col {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-card);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nb-tri-col-en {
  background: var(--panel-raised);
  border-color: var(--gold-dim);
}

.nb-tri-col-fr {
  border-color: var(--hairline);
}

.nb-tri-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nb-tri-label-lead {
  color: var(--gold);
}

.nb-tri-term {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  line-height: 1.3;
}

.nb-tri-def {
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.45;
}

.nb-tri-def.nb-tri-fallback,
.nb-tri-term.nb-tri-fallback {
  color: var(--muted);
  font-style: italic;
}

/* ---------- review console (founder) ---------- */

.nb-review-layout {
  display: grid;
  gap: 16px;
}

.nb-review-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.nb-kbd-hints {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.nb-kbd {
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--text);
}

.nb-review-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.nb-edit-field {
  margin-bottom: 14px;
}

.nb-edit-field label {
  display: block;
  font-size: 0.76rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.nb-edit-field textarea,
.nb-edit-field input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.92rem;
  padding: 10px 12px;
}

.nb-edit-field textarea {
  min-height: 70px;
  resize: vertical;
}

.nb-edit-option-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.nb-edit-option-row .nb-edit-key {
  width: 32px;
  font-family: var(--font-mono);
  color: var(--muted);
  text-align: center;
}

.nb-correct-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- toasts ---------- */

.nb-toast-root {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  width: calc(100% - 32px);
  max-width: 420px;
  align-items: center;
}

.nb-toast {
  background: var(--panel-raised);
  border: 1px solid var(--hairline);
  color: var(--text);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  box-shadow: var(--shadow-card);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  width: 100%;
  text-align: center;
}

.nb-toast-show {
  opacity: 1;
  transform: translateY(0);
}

.nb-toast-error {
  border-color: var(--incorrect);
  color: var(--incorrect);
}

/* ---------- misc states ---------- */

.nb-loading,
.nb-empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 16px;
  font-size: 0.9rem;
}

.nb-center {
  text-align: center;
}

.nb-cta-block {
  text-align: center;
  padding: 24px 0 4px;
}

.nb-divider {
  height: 1px;
  background: var(--hairline);
  margin: 20px 0;
  border: none;
}

.nb-cap-indicator {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--muted);
}

.nb-cap-indicator.is-low {
  color: var(--incorrect);
}

.nb-btn-sm {
  min-height: 36px;
  padding: 8px 14px;
  font-size: 0.82rem;
}

/* ---------- field picker chips (drill) ---------- */

.nb-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.nb-chip {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  padding: 9px 14px;
  min-height: 38px;
  border-radius: 20px;
  border: 1px solid var(--hairline);
  background: var(--panel-raised);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

.nb-chip:hover {
  border-color: var(--gold-dim);
  color: var(--text);
}

.nb-chip.active {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(224, 184, 119, 0.14);
}

.nb-chip-count {
  opacity: 0.65;
  margin-left: 5px;
}

/* ---------- readiness dial ---------- */

.nb-dial {
  --pct: 0;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: conic-gradient(var(--gold) calc(var(--pct) * 1%), var(--track) 0);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.nb-dial-inner {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.nb-dial-value {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  color: var(--text);
}

.nb-dial-label {
  font-size: 0.64rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

/* ---------- improvement badge ---------- */

.nb-improve-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--correct);
  color: var(--correct);
}

.nb-improve-badge.is-flat {
  border-color: var(--hairline);
  color: var(--muted);
}

.nb-improve-badge.is-negative {
  border-color: var(--incorrect);
  color: var(--incorrect);
}

/* ---------- weekly readiness table (progress) ---------- */

.nb-weekly-table {
  width: 100%;
  border-collapse: collapse;
}

.nb-weekly-table th,
.nb-weekly-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--hairline);
  font-size: 0.85rem;
  white-space: nowrap;
}

.nb-weekly-table th {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.nb-weekly-table tr:last-child td {
  border-bottom: none;
}

.nb-weekly-bar-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 140px;
}

.nb-weekly-bar-track {
  flex: 1;
  height: 8px;
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  overflow: hidden;
  min-width: 70px;
}

.nb-weekly-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
}

/* ---------- tutor chat ---------- */

.nb-chat-shell {
  display: flex;
  flex-direction: column;
  min-height: 60vh;
}

.nb-chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 2px 2px 16px;
  min-height: 220px;
}

.nb-chat-msg {
  max-width: 84%;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.nb-chat-msg-user {
  align-self: flex-end;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #1a1206;
  border-bottom-right-radius: 4px;
}

.nb-chat-msg-assistant {
  align-self: flex-start;
  background: var(--panel-raised);
  border: 1px solid var(--hairline);
  border-bottom-left-radius: 4px;
}

.nb-chat-msg-assistant.is-offline {
  border-color: var(--gold-dim);
}

.nb-chat-offline-tag {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 6px;
}

.nb-chat-empty {
  text-align: center;
  color: var(--muted);
  padding: 32px 16px;
}

.nb-chat-empty p {
  margin: 0 0 8px;
}

.nb-chat-form {
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--hairline);
  padding-top: 14px;
}

.nb-chat-input {
  flex: 1;
  min-height: 48px;
  max-height: 160px;
  resize: vertical;
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 12px 14px;
}

.nb-chat-input:focus {
  outline: none;
  border-color: var(--gold-dim);
}

.nb-chat-input:disabled {
  opacity: 0.5;
}

/* ---------- exam mode (drill-room, timed) ---------- */

.nb-exam-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.nb-exam-header-left .nb-eyebrow {
  margin-bottom: 4px;
}

.nb-exam-count {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--text);
}

.nb-exam-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nb-exam-clock {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* ---------- exam identity header (EXAM-FIDELITY-02) ---------- */

.nb-exam-identity {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
}

.nb-exam-identity-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.nb-exam-label {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--heading);
}

.nb-format-badge {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  white-space: nowrap;
}

.nb-timing-line,
.nb-length-line {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.5;
}

.nb-itemtype-note {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

.nb-itemtype-note a {
  color: var(--gold);
}

/* ==========================================================================
   Top Nurse — WU-6 FIRST-PLAYABLE SCAFFOLD (TOPNURSE-MASTER-DESIGN.md §1.1/§4)
   Placeholder FFT-homage chrome ONLY — pixel-stepped frames + monospace
   accents built from the existing brass/gold token set, no real art assets.
   Real pixel/painterly art is a separate LOOK-gated work-unit; this scaffold
   must read as "the game, undressed" so it never gets mistaken for final art.
   ========================================================================== */

.tn-shell {
  display: grid;
  gap: 20px;
}

@media (min-width: 900px) {
  .tn-shell {
    grid-template-columns: 300px 1fr;
    align-items: start;
  }
}

/* Pixel-stepped frame: an 8-bit dialog-box corner cut applied over the
   existing .nb-card look, using only tokens already in :root. */
.tn-pixel-panel {
  clip-path: polygon(
    0 10px, 10px 10px, 10px 0,
    calc(100% - 10px) 0, calc(100% - 10px) 10px, 100% 10px,
    100% calc(100% - 10px), calc(100% - 10px) calc(100% - 10px), calc(100% - 10px) 100%,
    10px 100%, 10px calc(100% - 10px), 0 calc(100% - 10px)
  );
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--gold-dim), var(--shadow-card);
}

.tn-hud {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tn-portrait-frame {
  width: 96px;
  height: 96px;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: var(--gold-dim);
  background:
    repeating-conic-gradient(var(--panel-raised) 0% 25%, var(--panel) 0% 50%) 0 0 / 16px 16px;
  border: 1px solid var(--hairline);
}

.tn-portrait-caption {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 4px;
}

.tn-hud-section-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 14px 0 8px;
}

.tn-hud-section-title:first-of-type {
  margin-top: 0;
}

.tn-stat-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 0.86rem;
  margin-bottom: 6px;
}

.tn-stat-line strong {
  font-family: var(--font-serif);
  color: var(--heading);
}

.tn-jp-bar,
.tn-xp-bar {
  height: 8px;
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.tn-jp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
}

.tn-xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4a6a7a, #7aa8c4);
}

.tn-skill-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 0.82rem;
}

.tn-skill-row + .tn-skill-row {
  border-top: 1px solid var(--hairline);
}

.tn-skill-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tn-skill-unlocked .tn-skill-name::before {
  content: "\2726";
  color: var(--gold);
  margin-right: 6px;
}

.tn-skill-progress-track {
  width: 60px;
  height: 6px;
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  overflow: hidden;
  flex: none;
}

.tn-skill-progress-fill {
  height: 100%;
  background: var(--gold-dim);
}

.tn-skill-ready {
  border-color: var(--gold);
}

.tn-skill-ready .tn-skill-progress-fill {
  background: var(--gold);
}

.tn-debuff-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--incorrect);
  background: var(--incorrect-bg);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  margin-bottom: 8px;
}

.tn-debuff-glyph {
  font-size: 1.1rem;
  flex: none;
}

.tn-equipment-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tn-equipment-chip {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 4px 8px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  color: var(--muted);
}

/* ---------- mission panel ---------- */

.tn-mission-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 6px;
}

.tn-stage-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 4px 10px;
  border: 1px solid var(--hairline);
  border-radius: 20px;
  color: var(--muted);
}

.tn-role-badge {
  color: var(--gold);
  border-color: var(--gold-dim);
}

.tn-beat-text {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  margin: 10px 0 18px;
  padding: 12px 14px;
  border-left: 2px solid var(--gold-dim);
  background: var(--bg);
}

.tn-jp-delta {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--gold);
  margin-top: 10px;
}

.tn-flourish-banner {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gold);
  background: rgba(224, 184, 119, 0.1);
  font-size: 0.86rem;
  color: var(--gold-bright);
  animation: tn-aura-pulse 1.1s ease-out;
}

@keyframes tn-aura-pulse {
  0% { box-shadow: 0 0 0 0 rgba(224, 184, 119, 0.55); }
  70% { box-shadow: 0 0 0 14px rgba(224, 184, 119, 0); }
  100% { box-shadow: 0 0 0 0 rgba(224, 184, 119, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .tn-flourish-banner { animation: none; }
}

.tn-mission-progress {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 10px;
}
