/* ══════════════════════════════════════════════
   CHRIST CONSCIOUSNESS CODES — MODULE STYLES
   Welcome landing · module switcher · clearing protocol
   ══════════════════════════════════════════════ */

/* ── WELCOME LANDING ── */
#welcome-screen { align-items: stretch; justify-content: stretch; min-height: 100vh; }
.welcome-shell {
  display: flex; flex-direction: column;
  width: 100%; min-height: 100vh;
  background: var(--bg-warm);
}
.welcome-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px; background: #fff; border-bottom: 1px solid var(--border);
  gap: 16px;
}
.welcome-logo { height: 48px; width: auto; flex-shrink: 0; max-width: 60vw; object-fit: contain; }
.welcome-header-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.welcome-signout { font-size: 10px !important; }
.welcome-body {
  flex: 1; max-width: 640px; width: 100%;
  margin: 0 auto; padding: 36px 28px 24px; text-align: left;
}
.welcome-eyebrow {
  font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--text-light); margin-bottom: 14px;
}
.welcome-title {
  font-family: 'Cormorant Garamond', serif; font-size: 34px;
  font-weight: 600; color: var(--text); line-height: 1.15; margin-bottom: 8px;
}
.welcome-intro {
  font-size: 14px; color: var(--text-mid); margin-bottom: 22px;
}
.welcome-actions {
  display: grid; grid-template-columns: 1fr; gap: 8px;
}
.welcome-action {
  text-align: left; background: #fff; border: 1px solid var(--border);
  border-radius: 5px; padding: 13px 16px; cursor: pointer;
  transition: border-color .2s, transform .15s, box-shadow .2s;
  font-family: 'DM Sans', sans-serif;
}
.welcome-action:hover {
  border-color: var(--coral);
  box-shadow: 0 3px 12px rgba(244,132,95,0.08);
  transform: translateY(-1px);
}
.welcome-action-eyebrow {
  font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--coral); margin-bottom: 4px; font-weight: 600;
}
.welcome-action-title {
  font-family: 'Cormorant Garamond', serif; font-size: 17px;
  color: var(--text); line-height: 1.3; margin-bottom: 2px; font-weight: 500;
}
.welcome-action-sub {
  font-size: 12px; color: var(--text-light);
}
.welcome-footer {
  text-align: center; padding: 20px;
  font-size: 10px; letter-spacing: 0.1em; color: var(--text-light);
}

/* ── MODULE SWITCHER (in app-header) ── */
.module-switcher {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--bg-warm); border: 1px solid var(--border); border-radius: 999px;
}
.module-pill {
  padding: 6px 16px; border: none; background: transparent;
  font-family: 'DM Sans', sans-serif; font-size: 11px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-light);
  border-radius: 999px; cursor: pointer; transition: all .2s;
}
.module-pill:hover { color: var(--text); }
.module-pill.active { background: var(--text); color: #fff; }
.header-center { text-align: center; flex: 1; }

/* ── MODULES ── */
.module { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow-y: auto; }
#module-codes { background: var(--bg-warm); }

/* ── CODES SHELL ── */
.codes-shell { flex: 1; }
.codes-page {
  max-width: 1080px; margin: 0 auto; padding: 36px 28px 80px;
}
.codes-narrow .codes-page,
.codes-page.codes-narrow,
.codes-narrow {
  max-width: 720px;
}

.codes-eyebrow {
  font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--text-light); margin-bottom: 8px;
}
.codes-title {
  font-family: 'Cormorant Garamond', serif; font-size: 38px;
  font-weight: 600; color: var(--text); line-height: 1.15; margin-bottom: 12px;
}
.codes-intro {
  font-size: 15px; line-height: 1.7; color: var(--text-mid); margin-bottom: 32px; max-width: 640px;
}
.codes-section-title {
  font-family: 'Cormorant Garamond', serif; font-size: 30px;
  font-weight: 600; color: var(--text); line-height: 1.2; margin-bottom: 14px;
}
.codes-body { font-size: 15px; line-height: 1.7; color: var(--text-mid); margin-bottom: 18px; }
.codes-muted { color: var(--text-light); }
.codes-loading { color: var(--text-light); padding: 24px 0; font-size: 14px; }

/* ── PROTOCOL STEP HEAD ── */
.codes-protocol-head { margin-bottom: 24px; }
.codes-protocol-eyebrow {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-light); margin-bottom: 8px;
}
.codes-exit {
  background: none; border: 1px solid var(--border); border-radius: 999px;
  width: 24px; height: 24px; line-height: 22px; padding: 0;
  font-size: 11px; color: var(--text-light); cursor: pointer;
}
.codes-exit:hover { border-color: var(--coral); color: var(--coral); }
.codes-progress-bar {
  height: 3px; background: var(--border); border-radius: 999px; overflow: hidden;
}
.codes-progress-fill { height: 100%; background: var(--coral); transition: width .3s; }

/* ── LANDING ACTIONS ── */
.codes-actions {
  display: grid; grid-template-columns: 1fr; gap: 12px; max-width: 640px;
}
.codes-action {
  text-align: left; background: #fff; border: 1px solid var(--border);
  border-radius: 6px; padding: 22px 24px; cursor: pointer;
  transition: border-color .2s, transform .15s, box-shadow .2s;
  font-family: 'DM Sans', sans-serif;
}
.codes-action:hover:not([disabled]) {
  border-color: var(--coral);
  box-shadow: 0 4px 16px rgba(244,132,95,0.10);
  transform: translateY(-1px);
}
.codes-action[disabled] { opacity: .55; cursor: not-allowed; }
.codes-action-primary { border-color: var(--coral); }
.codes-action-eyebrow {
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--coral); margin-bottom: 8px; font-weight: 600;
}
.codes-action-title {
  font-family: 'Cormorant Garamond', serif; font-size: 22px;
  color: var(--text); line-height: 1.25; margin-bottom: 6px; font-weight: 500;
}
.codes-action-sub { font-size: 13px; color: var(--text-light); }

/* ── DIAGRAMS ── */
.codes-diagram {
  display: block; width: 100%; max-width: 600px; height: auto;
  margin: 8px auto 24px;
}
.codes-diagram-img { max-width: 720px; }

/* ── ORIENTATION SLIDESHOW ── */
.codes-slideshow { margin: 8px auto 24px; max-width: 760px; width: 100%; }
.codes-slide-frame {
  position: relative; display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--border); border-radius: 4px;
  padding: 12px; min-height: 240px;
}
.codes-slide-img {
  display: block; max-width: 100%; max-height: 480px; height: auto; margin: 0 auto;
  border-radius: 3px;
}
.codes-slide-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.95); border: 1px solid var(--border);
  font-size: 22px; line-height: 36px; color: var(--text-mid);
  cursor: pointer; transition: all .15s; z-index: 2;
  font-family: 'DM Sans', sans-serif; font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.codes-slide-arrow:hover:not(:disabled) {
  background: var(--coral); color: #fff; border-color: var(--coral);
}
.codes-slide-arrow:disabled { opacity: 0.3; cursor: not-allowed; }
.codes-slide-arrow-prev { left: 8px; }
.codes-slide-arrow-next { right: 8px; }
.codes-slide-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px; padding: 0 4px; gap: 16px;
}
.codes-slide-dots { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.codes-slide-dot {
  width: 9px; height: 9px; border-radius: 50%;
  border: 1px solid var(--border); background: #fff; cursor: pointer;
  padding: 0; transition: all .15s;
}
.codes-slide-dot:hover { border-color: var(--coral); }
.codes-slide-dot-active { background: var(--coral); border-color: var(--coral); }
.codes-slide-count {
  font-size: 11px; letter-spacing: 0.12em; color: var(--text-light); font-weight: 600;
}

/* ── BUTTONS / NAV ── */
.codes-nav {
  display: flex; gap: 12px; justify-content: space-between;
  margin-top: 32px; flex-wrap: wrap;
}
.codes-btn {
  padding: 12px 22px; border-radius: 4px; cursor: pointer;
  font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  border: 1px solid transparent; transition: all .2s;
}
.codes-btn-primary { background: var(--coral); color: #fff; border-color: var(--coral); }
.codes-btn-primary:hover { background: #e06b45; }
.codes-btn-primary[disabled] { background: #ccc; border-color: #ccc; cursor: not-allowed; }
.codes-btn-ghost { background: #fff; color: var(--text-mid); border-color: var(--border); }
.codes-btn-ghost:hover { border-color: var(--coral); color: var(--coral); }
.codes-btn-large { padding: 16px 28px; font-size: 13px; }

/* ── STEP 1 — STORY ── */
.codes-textarea {
  width: 100%; padding: 16px; border: 1px solid var(--border); border-radius: 4px;
  font-family: 'DM Sans', sans-serif; font-size: 15px; line-height: 1.7;
  color: var(--text); background: #fff; resize: vertical; min-height: 240px;
}
.codes-textarea:focus { outline: none; border-color: var(--teal); }
.codes-savehint {
  font-size: 11px; color: var(--text-light); height: 18px;
  letter-spacing: 0.1em; text-transform: uppercase; margin-top: 6px;
}

/* ── STEP 2 — FACTS / MEANINGS ── */
.codes-fm-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  background: var(--border); border: 1px solid var(--border); border-radius: 4px;
  padding: 1px; margin-bottom: 16px;
}
.codes-fm-head {
  background: #f5f3ed; padding: 10px 12px;
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-light); font-weight: 600;
}
.codes-fm-input {
  background: #fff; border: none; padding: 12px;
  font-family: 'DM Sans', sans-serif; font-size: 14px; line-height: 1.6;
  color: var(--text); resize: vertical; min-height: 60px;
}
.codes-fm-input:focus { outline: 2px solid var(--teal); outline-offset: -2px; }
.codes-btn-add { font-size: 11px; padding: 8px 16px; }

/* ── STEP 3 — AGREEMENT CARDS ── */
.codes-cards {
  display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 24px;
}
.codes-card {
  background: #fff; border: 1px solid var(--border); border-radius: 6px;
  padding: 16px 20px; text-align: left; cursor: pointer;
  font-family: 'DM Sans', sans-serif; transition: all .2s;
  position: relative;
}
.codes-card:hover { border-color: var(--coral); }
.codes-card-selected {
  border-color: var(--coral); border-width: 2px;
  background: #fff8f4; padding: 15px 19px;
}
.codes-card-cleared { opacity: .55; }
.codes-card-cleared:not(.codes-card-selected) .codes-card-text { text-decoration: line-through; }
.codes-card-check {
  position: absolute; top: 10px; right: 14px;
  font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--teal); font-weight: 600;
}
.codes-card-text {
  font-size: 16px; line-height: 1.5; color: var(--text);
}
.codes-refine { margin-bottom: 20px; }
.codes-label {
  display: block; font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--text-light); margin-bottom: 6px;
}
.codes-input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 4px;
  font-family: 'DM Sans', sans-serif; font-size: 15px; color: var(--text); background: #fff;
}
.codes-input:focus { outline: none; border-color: var(--teal); }

/* ── STEP 4 — ENERGY / FIELD GRIDS ── */
.codes-grid-energy,
.codes-grid-field {
  display: grid;
  grid-template-columns: 180px repeat(4, 1fr);
  gap: 8px;
  background: var(--border); border: 1px solid var(--border); border-radius: 6px;
  padding: 1px; margin-bottom: 18px;
}
.codes-grid-headcell {
  background: #f5f3ed; padding: 10px 12px;
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-light); font-weight: 600; text-align: center;
}
.codes-grid-rowlabel {
  background: #f5f3ed; padding: 12px;
  display: flex; flex-direction: column; align-items: stretch;
  gap: 8px;
}
.codes-row-num {
  display: inline-flex; align-items: center; justify-content: center;
  align-self: flex-start;
  min-width: 32px; height: 32px; padding: 0 10px;
  background: var(--text); color: #fff;
  border-radius: 4px;
  font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 700;
  letter-spacing: 0.04em;
}
.codes-row-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px; font-weight: 500;
  color: var(--text); line-height: 1.25;
  word-break: break-word;
}
.codes-cell { background: #fff; padding: 10px; }
.codes-itemlist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.codes-item {
  background: #fff; border: 1px solid var(--border); border-radius: 4px;
  transition: border-color .15s;
}
.codes-item:hover { border-color: rgba(244,132,95,0.4); }
.codes-item-row {
  display: flex; align-items: stretch; gap: 0;
}
.codes-item-clear {
  display: flex; align-items: center; justify-content: center;
  width: 36px; flex-shrink: 0;
  background: none; border: none; border-right: 1px solid var(--border);
  cursor: pointer; padding: 0;
  border-radius: 4px 0 0 4px;
  transition: background .15s;
}
.codes-item-clear:hover { background: var(--bg-warm); }
.codes-item-check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border: 1.5px solid var(--border); border-radius: 3px;
  color: transparent; font-size: 11px; font-weight: 700; flex-shrink: 0;
  transition: all .15s;
}
.codes-item-disclose {
  flex: 1; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 9px 12px;
  background: none; border: none; cursor: pointer;
  font-family: 'DM Sans', sans-serif; font-size: 13px;
  color: var(--text); text-align: left; line-height: 1.3;
  border-radius: 0 4px 4px 0;
  transition: background .15s;
}
.codes-item-disclose:hover { background: var(--bg-warm); }
.codes-item-name { flex: 1; min-width: 0; }
.codes-item-caret {
  display: inline-block; color: var(--text-light); font-size: 11px;
  transition: transform .2s;
  flex-shrink: 0;
}
.codes-item-expanded .codes-item-caret { transform: rotate(180deg); }
.codes-item-cleared .codes-item-check {
  background: var(--teal); border-color: var(--teal); color: #fff;
}
.codes-item-cleared .codes-item-name {
  text-decoration: line-through; color: var(--text-light);
}
.codes-item-desc {
  display: none;
  font-size: 12.5px; color: var(--text-mid); line-height: 1.6;
  padding: 10px 14px 12px;
  border-top: 1px solid var(--border); background: var(--bg-warm);
  border-radius: 0 0 4px 4px;
}
.codes-item-expanded .codes-item-desc { display: block; }
.codes-item-expanded { border-color: var(--coral); }
.codes-callout {
  background: #fff; border-left: 3px solid var(--teal);
  padding: 14px 18px; margin: 16px 0;
  font-size: 13px; line-height: 1.6; color: var(--text-mid); border-radius: 4px;
}
.codes-retest {
  font-size: 12px; color: var(--text-light); margin: 14px 0 0;
  letter-spacing: 0.05em;
}

/* ── STEP 5 — ANCHOR ── */
.codes-anchor-frame {
  background: #fff; border: 1px solid var(--border); border-radius: 6px;
  padding: 24px; margin: 16px 0;
}
.codes-anchor-fixed {
  font-family: 'Cormorant Garamond', serif; font-size: 24px;
  color: var(--text); margin-bottom: 12px; font-weight: 500;
}
.codes-anchor-input {
  width: 100%; padding: 14px 0; border: none; border-bottom: 2px solid var(--border);
  font-family: 'Cormorant Garamond', serif; font-size: 24px;
  color: var(--coral); background: transparent;
  font-weight: 500;
}
.codes-anchor-input:focus { outline: none; border-bottom-color: var(--coral); }
.codes-anchor-input::placeholder { color: var(--text-light); font-style: italic; }
.codes-examples {
  margin: 16px 0; font-size: 14px;
}
.codes-examples summary {
  cursor: pointer; font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--text-light); padding: 8px 0;
}
.codes-examples summary:hover { color: var(--coral); }
.codes-examples ul {
  list-style: none; padding: 14px 0 0; display: flex; flex-direction: column; gap: 10px;
}
.codes-examples li {
  background: #fff; padding: 12px 16px; border-radius: 4px; border: 1px solid var(--border);
  line-height: 1.6;
}

/* ── STEP 6 / COMPLETION ── */
.codes-retest-buttons {
  display: flex; flex-direction: column; gap: 12px; margin: 24px 0;
}
.codes-retest-buttons .codes-btn { width: 100%; }
.codes-celebrate {
  text-align: center; font-size: 36px; padding: 24px 0 8px;
}
.codes-summary { list-style: none; padding: 0; margin: 24px 0; display: flex; flex-direction: column; gap: 12px; }
.codes-summary li {
  background: #fff; border: 1px solid var(--border); border-radius: 6px;
  padding: 16px 20px;
}
.codes-summary-eyebrow {
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-light); margin-bottom: 8px; font-weight: 600;
}
.codes-summary-lie {
  font-size: 14px; color: var(--text-mid); margin-bottom: 6px;
}
.codes-summary-lie::before { content: '"'; }
.codes-summary-lie::after { content: '"'; }
.codes-summary-anchor {
  font-family: 'Cormorant Garamond', serif; font-size: 18px;
  color: var(--coral); line-height: 1.4;
}

/* ── SAVE STATUS PILL (toggleClear feedback) ── */
.codes-save-status {
  position: fixed; bottom: 20px; right: 20px;
  padding: 10px 16px; border-radius: 999px;
  font-family: 'DM Sans', sans-serif; font-size: 12px;
  font-weight: 600; letter-spacing: 0.06em;
  background: var(--text); color: #fff;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  opacity: 0; pointer-events: none;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s;
  z-index: 200;
}
.codes-save-status-visible { opacity: 1; transform: translateY(0); }
.codes-save-status-pending { background: var(--text); }
.codes-save-status-ok { background: var(--teal); }
.codes-save-status-error { background: #c62828; }

/* ── STICKY STEP HEAD (used on Step 4 Energy / Field) ── */
.codes-sticky-head {
  position: sticky; top: 0; z-index: 30;
  margin: 0 -28px 14px; padding: 12px 28px 10px;
  background: var(--bg-warm);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 12px -10px rgba(0,0,0,0.18);
}
.codes-sticky-head .codes-active-agreement { margin-bottom: 10px; }
.codes-sticky-head .codes-section-title { margin-bottom: 0; font-size: 22px; }

/* ── ACTIVE AGREEMENT BANNER ── */
.codes-active-agreement {
  background: #fff8f4; border: 1px solid #f4cdb6; border-radius: 6px;
  padding: 14px 18px; margin-bottom: 22px;
}
.codes-active-eyebrow {
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--coral); font-weight: 600; margin-bottom: 6px;
}
.codes-active-text {
  font-family: 'Cormorant Garamond', serif; font-size: 20px; color: var(--text); line-height: 1.3;
}

/* ── HISTORY ── */
.codes-history-list { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.codes-history-item {
  background: #fff; border: 1px solid var(--border); border-radius: 6px;
  padding: 16px 20px; cursor: pointer; text-align: left;
  font-family: 'DM Sans', sans-serif; transition: border-color .2s, box-shadow .2s;
  display: block; width: 100%;
}
.codes-history-item-inprogress { border-left: 3px solid var(--coral); }
.codes-history-badge {
  display: inline-block; margin-left: 6px;
  background: var(--coral); color: #fff;
  padding: 2px 7px; border-radius: 999px;
  font-size: 9px; letter-spacing: 0.12em; font-weight: 700;
  vertical-align: middle;
}
.codes-history-badge-done { background: var(--teal); }
.codes-history-preview-empty { color: var(--text-light); font-style: italic; }
.codes-history-stage {
  font-family: 'Cormorant Garamond', serif;
  font-size: 14px; font-style: italic; color: var(--text-mid);
  margin: 8px 0 4px; line-height: 1.4;
}
.codes-history-agreements {
  list-style: none; padding: 0; margin: 8px 0;
  font-size: 12.5px; line-height: 1.5;
  border-left: 2px solid var(--border); padding-left: 10px;
}
.codes-history-agreements li {
  padding: 4px 0; color: var(--text-mid);
}
.codes-history-lie {
  font-style: italic; color: var(--text-light); text-decoration: line-through;
}
.codes-history-anchor {
  font-family: 'Cormorant Garamond', serif;
  color: var(--text); font-weight: 500;
}
.codes-history-item:hover {
  border-color: var(--coral);
  box-shadow: 0 4px 16px rgba(244,132,95,0.08);
}
.codes-history-date {
  font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--coral); font-weight: 600; margin-bottom: 6px;
}
.codes-history-preview {
  font-size: 14px; color: var(--text); line-height: 1.5; margin-bottom: 6px;
}
.codes-history-meta { font-size: 12px; color: var(--text-light); }

/* ── SESSION DETAIL ── */
.codes-detail-actions { display: flex; gap: 10px; margin: 12px 0 24px; }
.codes-detail-h {
  font-family: 'Cormorant Garamond', serif; font-size: 22px;
  margin: 28px 0 12px; color: var(--text); font-weight: 600;
  border-bottom: 1px solid var(--border); padding-bottom: 6px;
}
.codes-detail-body {
  font-size: 14px; line-height: 1.75; color: var(--text-mid);
  background: #fff; padding: 16px 20px; border-radius: 6px; border: 1px solid var(--border);
  white-space: pre-wrap;
}
.codes-detail-fm {
  width: 100%; border-collapse: collapse; background: #fff;
  border: 1px solid var(--border); border-radius: 6px; overflow: hidden;
}
.codes-detail-fm th, .codes-detail-fm td {
  padding: 10px 14px; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--border); font-size: 13px; line-height: 1.6;
}
.codes-detail-fm th {
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-light); background: #f5f3ed; font-weight: 600;
}
.codes-detail-fm tr:last-child td { border-bottom: none; }
.codes-detail-attempt {
  background: #fff; border: 1px solid var(--border); border-radius: 6px;
  padding: 16px 20px; margin-bottom: 12px;
}
.codes-detail-attempt-num {
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--coral); font-weight: 600; margin-bottom: 8px;
}
.codes-detail-attempt-lie,
.codes-detail-attempt-anchor,
.codes-detail-attempt-cleared {
  font-size: 14px; color: var(--text-mid); line-height: 1.6; margin-bottom: 6px;
}
.codes-print-header { display: none; }
.codes-print-brand { font-family: 'Cormorant Garamond', serif; font-size: 18px; }
.codes-print-meta { font-size: 11px; color: var(--text-light); margin-top: 4px; }

/* ── RESPONSIVE ── */
@media (max-width: 880px) {
  .codes-page { padding: 24px 16px 60px; }
  .codes-title { font-size: 32px; }
  .codes-section-title { font-size: 24px; }
  .welcome-body { padding: 40px 20px 32px; }
  .welcome-title { font-size: 32px; }
  .module-switcher { padding: 3px; }
  .module-pill { padding: 5px 12px; font-size: 10px; }
  .codes-fm-grid { grid-template-columns: 1fr; }
  .codes-fm-head:nth-child(1)::after { content: ' / Meaning'; }
  .codes-fm-head:nth-child(2) { display: none; }
  /* Energy & Field grids: stack rows on mobile */
  .codes-grid-energy,
  .codes-grid-field {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .codes-grid-headcell:not(:first-child) { display: none; }
  .codes-grid-rowlabel {
    background: var(--text); color: #fff;
    border-radius: 4px; margin-top: 8px;
    flex-direction: row; align-items: center; gap: 10px;
  }
  .codes-grid-rowlabel .codes-row-num {
    background: rgba(255,255,255,0.2); color: #fff;
  }
  .codes-grid-rowlabel .codes-row-name { color: #fff; }
  .codes-cell { padding: 8px 12px; }
  .codes-cell::before {
    content: attr(data-col-label); display: block;
    font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--text-light); margin-bottom: 4px; font-weight: 600;
  }
  .codes-anchor-fixed { font-size: 20px; }
  .codes-anchor-input { font-size: 20px; }
}

/* ── PRINT ── */
@media print {
  /* When printing a codes session: show only the printable section */
  body.printing-codes-session #loading-screen,
  body.printing-codes-session #login-screen,
  body.printing-codes-session #welcome-screen,
  body.printing-codes-session #reset-screen,
  body.printing-codes-session #assessment-screen,
  body.printing-codes-session .app-header,
  body.printing-codes-session .tab-nav,
  body.printing-codes-session #module-assessment,
  body.printing-codes-session #admin-banner,
  body.printing-codes-session .codes-noprint {
    display: none !important;
  }
  body.printing-codes-session #app-screen {
    display: block !important;
  }
  body.printing-codes-session #module-codes {
    display: block !important; background: #fff !important;
  }
  body.printing-codes-session .codes-print-header {
    display: block !important;
    padding-bottom: 12px; margin-bottom: 16px;
    border-bottom: 1px solid #000;
  }
  body.printing-codes-session .codes-page { max-width: 100% !important; padding: 0 !important; }
  body.printing-codes-session .codes-detail-attempt,
  body.printing-codes-session .codes-detail-body,
  body.printing-codes-session .codes-detail-fm {
    border: 1px solid #000 !important; box-shadow: none !important;
    page-break-inside: avoid;
  }
}
