@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Libre+Franklin:wght@400;500;600;700;800&display=swap");

:root {
  --paper: #ece7dc;
  --paper-dark: #d9d1c3;

  --ink: #181715;
  --muted: #6d675f;

  --green: #4c5f49;
  --purple: #5b4969;

  --red: #8e211d;
  --red-bright: #d1342e;

  --line: rgba(24, 23, 21, 0.22);
  --line-strong: rgba(24, 23, 21, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  background: radial-gradient(circle at top, #292824, #0b0b0a 75%);
  font-family: "Libre Franklin", sans-serif;
  color: var(--ink);
  overflow-x: hidden;
}

/* ======================================
   DOSSIER CONTROLS & BINDER TOPBAR
====================================== */
.dossier-topbar {
  width: min(1080px, calc(100% - 34px));
  margin: 16px auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  z-index: 50;
  position: relative;
}

.binder-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.binder-tab {
  background: rgba(236, 231, 220, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #c9c3b6;
  font-family: "DM Mono", monospace;
  font-size: 0.68rem;
  padding: 8px 14px;
  cursor: pointer;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all 0.2s ease;
  border-radius: 4px 4px 0 0;
}

.binder-tab:hover {
  background: rgba(236, 231, 220, 0.35);
  color: #ffffff;
  transform: translateY(-2px);
}

.binder-tab.active {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
  font-weight: 700;
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.3);
}

.anomaly-controls {
  display: none !important;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.anomaly-label {
  font-family: "DM Mono", monospace;
  font-size: 0.55rem;
  color: #a8a095;
  letter-spacing: 0.12em;
}

.anomaly-btn {
  font-family: "DM Mono", monospace;
  font-size: 0.55rem;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: #d1cbc0;
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.15s ease;
}

.anomaly-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.anomaly-btn.active[data-level="none"] {
  background: var(--green);
  color: white;
  border-color: var(--green);
}

.anomaly-btn.active[data-level="boo"] {
  background: #395237;
  color: #bbf7be;
  border-color: #4c5f49;
}

.anomaly-btn.active[data-level="scary"] {
  background: var(--purple);
  color: #f2e2ff;
  border-color: var(--purple);
}

.anomaly-btn.active[data-level="booscary"] {
  background: var(--red);
  color: white;
  border-color: var(--red-bright);
  animation: pulseButton 1s infinite alternate;
}

@keyframes pulseButton {
  from { box-shadow: 0 0 4px var(--red); }
  to { box-shadow: 0 0 12px var(--red-bright); }
}

/* ======================================
   REPORT PAGE
====================================== */
.report-page {
  position: relative;
  width: min(1080px, calc(100% - 34px));
  min-height: calc(100vh - 80px);
  margin: 0 auto 30px;
  padding: clamp(20px, 3vw, 36px);
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.12), transparent),
    var(--paper);
  color: var(--ink);
  box-shadow: 0 25px 75px rgba(0, 0, 0, 0.42);
  transition: background 0.3s ease, filter 0.3s ease;
  border-radius: 0 0 4px 4px;
  display: flex;
  flex-direction: column;
}

.report-page::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
  background-image: radial-gradient(rgba(0, 0, 0, 0.45) 0.45px, transparent 0.6px);
  background-size: 7px 7px;
}

/* ======================================
   HEADER
====================================== */
.report-header {
  position: relative;
  z-index: 5;
  padding-bottom: 22px;
  border-bottom: 2px solid var(--ink);
}

.report-page.ai-mode .report-header {
  border-bottom: none;
  padding-bottom: 0;
  text-align: center;
}

.report-page.ai-mode #bookTitle {
  text-align: center;
  margin: 0 auto;
}

.agency-line {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  font-family: "DM Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}

.document-code {
  margin: 18px 0 8px;
  font-family: "DM Mono", monospace;
  font-size: 0.58rem;
  letter-spacing: 0.15em;
  color: var(--red);
  font-weight: 700;
}

h1 {
  position: relative;
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.6rem);
  line-height: 0.92;
  letter-spacing: -0.055em;
  text-transform: uppercase;
}

.header-meta {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  font-family: "DM Mono", monospace;
  font-size: 0.66rem;
}

.header-meta p {
  margin: 0;
}

/* ======================================
   LAYOUT
====================================== */
.report-shell {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(20px, 3vw, 40px);
  padding: 24px 0;
}

/* ======================================
   CASE INDEX (SIDEBAR)
====================================== */
.case-index {
  padding-right: 18px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.index-label,
.section-label {
  margin: 0 0 6px;
  font-family: "DM Mono", monospace;
  font-size: 0.56rem;
  letter-spacing: 0.13em;
  color: var(--muted);
  text-transform: uppercase;
}

/* Search Box */
.search-wrapper {
  position: relative;
}

.search-input {
  width: 100%;
  padding: 8px 24px 8px 8px;
  font-family: "DM Mono", monospace;
  font-size: 0.62rem;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  border-radius: 2px;
}

.search-input:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--ink);
}

.search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: "DM Mono", monospace;
  font-size: 0.7rem;
  display: none;
}

/* Filter selector */
.chapter-filter-select {
  width: 100%;
  padding: 6px 4px;
  font-family: "DM Mono", monospace;
  font-size: 0.58rem;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  border-radius: 2px;
  cursor: pointer;
}

/* Case Strip Matrix */
.case-strip-container {
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.case-strip-container::-webkit-scrollbar {
  width: 4px;
}

.case-strip-container::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 2px;
}

.case-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}

.case-dot {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: rgba(255, 255, 255, 0.28);
  font-family: "DM Mono", monospace;
  font-size: 0.52rem;
  cursor: pointer;
  color: rgba(0, 0, 0, 0.65);
  transition: transform 0.15s ease, background 0.15s ease;
  padding: 0;
}

.case-dot:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
}

.case-dot.current {
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.case-dot.cleared {
  border-color: rgba(76, 95, 73, 0.65);
}

.case-dot.boo {
  border-color: rgba(76, 95, 73, 0.7);
  background: rgba(76, 95, 73, 0.12);
}

.case-dot.scary {
  border-color: rgba(91, 73, 105, 0.7);
  background: rgba(91, 73, 105, 0.12);
}

.case-dot.booscary {
  border-color: var(--red);
  background: rgba(142, 33, 29, 0.12);
}

/* Quick stats in sidebar */
.sidebar-stats {
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-family: "DM Mono", monospace;
  font-size: 0.55rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ======================================
   CONTENT AREA
====================================== */
.report-content {
  min-width: 0;
  transition: transform 0.1s ease, filter 0.1s ease;
}

.classification-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.classification-header h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3.2vw, 3rem);
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.status-stamp {
  padding: 8px 12px;
  border: 2px solid currentColor;
  transform: rotate(-3deg);
  font-family: "DM Mono", monospace;
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  white-space: nowrap;
  font-weight: 700;
}

.status-stamp.cleared {
  color: var(--green);
}

.status-stamp.boo {
  color: var(--green);
}

.status-stamp.scary {
  color: var(--purple);
}

.status-stamp.booscary {
  color: var(--red);
}

/* Integer Display */
.integer-display {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin: 18px 0 22px;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 14px;
}

.integer-display p {
  margin: 0;
  font-family: "DM Mono", monospace;
  font-size: 0.58rem;
  letter-spacing: 0.11em;
  color: var(--muted);
}

.integer-display strong {
  font-family: "DM Mono", monospace;
  font-size: clamp(2.8rem, 6vw, 5.2rem);
  line-height: 0.78;
  letter-spacing: -0.04em;
}

/* Rule Grid */
.rule-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 22px;
}

.rule-card {
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.22);
}

.rule-card span,
.rule-card strong,
.rule-card small {
  display: block;
}

.rule-card span {
  font-family: "DM Mono", monospace;
  font-size: 0.52rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.rule-card strong {
  margin: 5px 0 3px;
  font-size: 0.88rem;
  line-height: 1.25;
}

.rule-card small {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.35;
}

/* Observation (Document Content) */
.observation {
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.observation-copy {
  margin: 0;
  line-height: 1.72;
  font-family: Georgia, serif;
  font-size: clamp(0.95rem, 1.35vw, 1.08rem);
}

.observation-copy p {
  margin: 0 0 14px;
}

.observation-copy p:last-child {
  margin-bottom: 0;
}

.observation-copy h3 {
  font-family: "Libre Franklin", sans-serif;
  font-size: 1.4rem;
  margin: 24px 0 10px;
  letter-spacing: -0.03em;
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
}

.observation-copy h4 {
  font-family: "Libre Franklin", sans-serif;
  font-size: 1.15rem;
  margin: 18px 0 8px;
}

.observation-copy h5,
.observation-copy h6 {
  font-family: "DM Mono", monospace;
  font-size: 0.85rem;
  text-transform: uppercase;
  margin: 14px 0 6px;
  color: var(--muted);
}

.observation-copy blockquote {
  margin: 16px 0;
  padding: 10px 16px;
  border-left: 3px solid var(--line-strong);
  background: rgba(0, 0, 0, 0.03);
  font-style: italic;
}

.observation-copy ul,
.observation-copy ol {
  margin: 12px 0;
  padding-left: 24px;
}

.observation-copy li {
  margin-bottom: 6px;
}

.inline-code {
  font-family: "DM Mono", monospace;
  font-size: 0.85em;
  background: rgba(0, 0, 0, 0.08);
  padding: 2px 5px;
  border-radius: 2px;
}

.dossier-link {
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.wiki-tag {
  font-family: "DM Mono", monospace;
  font-size: 0.75em;
  background: rgba(76, 95, 73, 0.15);
  color: var(--green);
  padding: 2px 6px;
  border-radius: 3px;
  margin: 0 2px;
}

.report-divider {
  border: none;
  border-top: 1px dashed var(--line-strong);
  margin: 20px 0;
}

/* Assessment */
.assessment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px 0;
}

.assessment span,
.assessment strong {
  display: block;
}

.assessment span {
  margin-bottom: 4px;
  font-family: "DM Mono", monospace;
  font-size: 0.54rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.assessment strong {
  font-size: 0.82rem;
  line-height: 1.3;
}

/* Warning Panel */
.warning-panel {
  display: none;
  padding: 14px 16px;
  gap: 14px;
  align-items: flex-start;
  border: 2px solid var(--red);
  background: rgba(142, 33, 29, 0.08);
  color: var(--red);
  margin-top: 16px;
}

.warning-panel.visible {
  display: flex;
}

.warning-symbol {
  font-size: 1.7rem;
  line-height: 1;
}

.warning-panel strong {
  display: block;
  margin-bottom: 4px;
  font-family: "DM Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.warning-panel p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--ink);
}

/* Administrative Note */
.administrative-note {
  margin: 18px 0 0;
  padding: 12px 16px;
  border-left: 3px solid var(--ink);
  background: rgba(0, 0, 0, 0.035);
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 0.86rem;
  line-height: 1.5;
}

/* ======================================
   NAVIGATION
====================================== */
.report-navigation {
  position: relative;
  z-index: 25;
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding-top: 20px;
  border-top: 2px solid var(--ink);
  margin-top: 20px;
}

.report-button {
  padding: 11px 18px;
  border: 1px solid var(--ink);
  font-family: "DM Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.15s ease;
}

.secondary-button {
  background: transparent;
  color: var(--ink);
}

.secondary-button:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.08);
}

.secondary-button:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.next-slot {
  min-width: 205px;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.next-button {
  width: 100%;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
}

.next-button:hover {
  background: #33312c;
}

/* Progress Track */
.progress-copy {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-family: "DM Mono", monospace;
  font-size: 0.52rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.progress-track {
  height: 6px;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar {
  display: block;
  width: 1%;
  height: 100%;
  background: var(--ink);
  transition: width 0.2s ease;
}

/* Footer */
.footer-message {
  position: relative;
  z-index: 5;
  margin: 14px 0 0;
  text-align: center;
  font-family: "DM Mono", monospace;
  font-size: 0.52rem;
  color: var(--muted);
  letter-spacing: 0.1em;
}

/* ======================================
   STATIC NOISE & GLITCH OVERLAYS
====================================== */
.static-overlay,
.scanlines,
.red-wash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  opacity: 0;
}

.static-overlay {
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.08),
    rgba(0, 0, 0, 0.17) 1px,
    transparent 2px,
    transparent 4px
  );
}

.scanlines {
  background: repeating-linear-gradient(
    180deg,
    transparent 0,
    transparent 3px,
    rgba(0, 0, 0, 0.13) 4px
  );
}

.red-wash {
  background: radial-gradient(
    circle at center,
    transparent 10%,
    rgba(110, 0, 0, 0.22)
  );
}

/* ======================================
   HAUNTING MODES
====================================== */
/* BOO */
.report-page.haunting-boo .report-content {
  animation: tinyShift 2s infinite;
}

.report-page.haunting-boo .glitch-target {
  text-shadow: 1px 0 rgba(0, 100, 80, 0.4);
}

/* SCARY */
.report-page.haunting-scary .static-overlay {
  opacity: 0.22;
  animation: staticFlicker 0.11s infinite;
}

.report-page.haunting-scary .report-content {
  animation: reportDrift 0.9s infinite;
}

.report-page.haunting-scary h1 {
  animation: headlineGlitch 0.9s infinite;
  text-shadow: -2px 0 rgba(120, 0, 130, 0.45), 2px 0 rgba(0, 90, 100, 0.4);
}

/* BOOSCARY */
.report-page.haunting-booscary {
  background: #d4cbc0;
}

.report-page.haunting-booscary .static-overlay {
  opacity: 0.42;
  animation: staticFlicker 0.055s infinite;
}

.report-page.haunting-booscary .scanlines {
  opacity: 0.36;
}

.report-page.haunting-booscary .red-wash {
  opacity: 0.9;
  animation: redPulse 0.8s infinite;
}

.report-page.haunting-booscary .report-content {
  animation: violentReportGlitch 0.5s infinite;
}

.report-page.haunting-booscary h1 {
  animation: severeHeadline 0.25s infinite;
  text-shadow: -4px 0 rgba(220, 30, 30, 0.55), 4px 0 rgba(35, 20, 100, 0.45);
}

.report-page.haunting-booscary .glitch-target {
  animation: textCorrupt 0.18s infinite;
}

.report-page.haunting-booscary .observation-copy {
  animation: paragraphCorrupt 0.7s infinite;
}

/* ======================================
   ESCAPING BUTTON
====================================== */
.next-button.escaping {
  position: fixed;
  z-index: 1000;
  width: auto;
  min-width: 190px;
  margin: 0;
  background: var(--red);
  color: white;
  border-color: var(--red);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6);
  transition: left 0.14s ease, top 0.14s ease;
}

/* ======================================
   CORRUPTION MESSAGE OVERLAY
====================================== */
.corruption-message {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  font-family: "DM Mono", monospace;
  font-size: clamp(1.2rem, 3.5vw, 2.6rem);
  letter-spacing: 0.15em;
  text-align: center;
  color: rgba(142, 33, 29, 0.95);
  background: rgba(0, 0, 0, 0.75);
  padding: 20px 30px;
  border: 2px solid var(--red);
  box-shadow: 0 0 30px rgba(142, 33, 29, 0.6);
  transition: opacity 0.1s ease;
}

.corruption-message.visible {
  opacity: 1;
}

/* ======================================
   KEYFRAME ANIMATIONS
====================================== */
@keyframes tinyShift {
  0%, 96%, 100% { transform: translateX(0); }
  97% { transform: translateX(1px); }
}

@keyframes reportDrift {
  0%, 93%, 100% { transform: translate(0); }
  95% { transform: translate(-1px, 1px); }
  97% { transform: translate(1px, 0); }
}

@keyframes staticFlicker {
  0% { opacity: 0.1; }
  50% { opacity: 0.4; }
  100% { opacity: 0.18; }
}

@keyframes headlineGlitch {
  0%, 88%, 100% { transform: translateX(0); }
  90% { transform: translateX(-2px); }
  93% { transform: translateX(3px); }
  96% { transform: translateX(-1px); }
}

@keyframes severeHeadline {
  0%, 80%, 100% { transform: translate(0); }
  82% { transform: translate(-4px, 1px) skewX(1deg); }
  87% { transform: translate(3px, -2px) skewX(-2deg); }
  92% { transform: translate(-2px, 1px); }
}

@keyframes violentReportGlitch {
  0%, 86%, 100% { transform: translate(0); }
  88% { transform: translate(2px, -1px); }
  91% { transform: translate(-3px, 2px); }
  95% { transform: translate(1px, -1px); }
}

@keyframes textCorrupt {
  0%, 75%, 100% { transform: translateX(0); }
  80% { transform: translateX(-2px); }
  90% { transform: translateX(2px); }
}

@keyframes paragraphCorrupt {
  0%, 92%, 100% { filter: blur(0); }
  94% { filter: blur(1.2px); }
}

/* ======================================
   AI CHAT VIEW
====================================== */
.ai-chat-view {
  position: relative;
  z-index: 4;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 480px;
  padding: 24px 0;
  width: 100%;
  box-sizing: border-box;
}

.ai-chat-view:not(.has-messages) .chat-messages-container {
  display: none !important;
}

.ai-chat-view.has-messages {
  justify-content: flex-start;
  min-height: auto;
}

/* Chat Messages Thread */
.chat-messages-container {
  width: 100%;
  max-width: 880px;
  max-height: 520px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 10px 16px 10px;
  scroll-behavior: smooth;
  margin: 0 auto;
  box-sizing: border-box;
}

.chat-messages-container:empty {
  display: none;
  min-height: 0;
  padding: 0;
  margin: 0;
}

.chat-messages-container::-webkit-scrollbar {
  width: 5px;
}

.chat-messages-container::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 2px;
}

.chat-msg {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 88%;
  animation: messageSlideIn 0.25s ease-out;
}

@keyframes messageSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-msg.user {
  align-self: flex-end;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 18px;
  border-radius: 12px 12px 2px 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.chat-msg.user .msg-meta {
  color: rgba(236, 231, 220, 0.6);
  justify-content: flex-end;
}

.chat-msg.user .msg-badge {
  background: rgba(236, 231, 220, 0.2);
  color: var(--paper);
}

.chat-msg.user .msg-body p {
  color: var(--paper);
  font-family: "Libre Franklin", sans-serif;
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0;
}

.chat-msg.ai {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--line);
  border-left: 3.5px solid var(--red);
  padding: 16px 20px;
  border-radius: 4px 12px 12px 12px;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.05);
}

.msg-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "DM Mono", monospace;
  font-size: 0.54rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.msg-badge {
  background: rgba(142, 33, 29, 0.12);
  color: var(--red);
  padding: 2px 6px;
  border-radius: 2px;
  font-weight: 700;
}

.msg-body {
  font-family: Georgia, serif;
  font-size: 0.96rem;
  line-height: 1.68;
  color: var(--ink);
}

.msg-body p {
  margin: 0 0 10px;
}

.msg-body p:last-child {
  margin-bottom: 0;
}

.msg-body ul, .msg-body ol {
  margin: 8px 0 12px;
  padding-left: 22px;
}

.msg-body li {
  margin-bottom: 5px;
}

.msg-body strong {
  font-family: "Libre Franklin", sans-serif;
  color: var(--ink);
}

/* Clickable segment reference buttons in AI chat */
.inline-seg-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 4px 4px 4px 0;
  padding: 4px 8px;
  background: rgba(142, 33, 29, 0.08);
  border: 1px solid var(--red);
  color: var(--red);
  font-family: "DM Mono", monospace;
  font-size: 0.64rem;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.inline-seg-link:hover {
  background: var(--red);
  color: white;
  transform: translateY(-1px);
}

/* Central Interaction Box (Prompt Chips + Input) */
.chat-interaction-box {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-sizing: border-box;
}

/* Suggestion Chips Centered */
.chat-prompt-suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  width: 100%;
  text-align: center;
}

.prompt-chip {
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-family: "DM Mono", monospace;
  font-size: 0.58rem;
  padding: 6px 12px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  letter-spacing: 0.02em;
}

.prompt-chip:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  transform: translateY(-1px);
}

.prompt-chip.clear-chip {
  background: rgba(142, 33, 29, 0.08);
  border-color: rgba(142, 33, 29, 0.35);
  color: var(--red);
}

.prompt-chip.clear-chip:hover {
  background: var(--red);
  color: #ffffff;
  border-color: var(--red);
  transform: translateY(-1px);
}

/* Chat Input Bar with Arrow Button Centered */
.chat-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: rgba(255, 255, 255, 0.75);
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
  padding: 8px 12px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  width: 100%;
  box-sizing: border-box;
}

.chat-input-wrapper:focus-within {
  border-color: var(--ink);
  background: #ffffff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.chat-textarea {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: Georgia, serif;
  font-size: 0.96rem;
  line-height: 1.45;
  color: var(--ink);
  resize: none;
  max-height: 140px;
  min-height: 26px;
  padding: 2px 0;
}

.chat-textarea::placeholder {
  color: var(--muted);
  font-style: italic;
  font-size: 0.88rem;
}

.chat-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: all 0.18s ease;
}

.chat-send-btn:hover:not(:disabled) {
  background: var(--red);
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 4px 10px rgba(142, 33, 29, 0.4);
}

.chat-send-btn:active:not(:disabled) {
  transform: scale(0.94);
}

.chat-send-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.send-arrow-icon {
  width: 18px;
  height: 18px;
  transition: transform 0.15s ease;
}

.chat-send-btn:hover:not(:disabled) .send-arrow-icon {
  transform: translateX(2px);
}

/* Typing Indicator Animation */
.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  animation: typingBounce 1.2s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-5px); opacity: 1; }
}

/* ======================================
   TABLET (max-width: 860px)
====================================== */
@media (max-width: 860px) {
  .report-shell {
    grid-template-columns: 1fr;
  }

  .case-index {
    padding-right: 0;
    padding-bottom: 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .case-strip {
    grid-template-columns: repeat(15, 1fr);
  }

  .report-navigation {
    grid-template-columns: 1fr 1fr;
  }

  .progress-wrapper {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .dossier-topbar {
    margin: 4px auto 0;
    width: 100%;
    padding: 0 6px;
    gap: 4px;
  }

  .binder-tabs {
    gap: 3px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: 100%;
  }

  .binder-tabs::-webkit-scrollbar {
    display: none;
  }

  .binder-tab {
    padding: 3px 8px;
    font-size: 0.6rem;
    line-height: 1.1;
    white-space: nowrap;
    flex-shrink: 0;
  }
}

/* ======================================
   MOBILE (max-width: 600px)
====================================== */
@media (max-width: 600px) {
  body {
    background: var(--paper);
  }

  .dossier-topbar {
    margin: 2px auto 0;
    width: 100%;
    padding: 0 4px;
    gap: 2px;
  }

  .binder-tabs {
    gap: 2px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: 100%;
    padding: 0;
  }

  .binder-tabs::-webkit-scrollbar {
    display: none;
  }

  .binder-tab {
    padding: 2px 6px;
    font-size: 0.54rem;
    line-height: 1;
    letter-spacing: 0.02em;
    border-radius: 3px 3px 0 0;
    white-space: nowrap;
    flex-shrink: 0;
    height: auto;
    min-height: unset;
  }

  .binder-tab:hover {
    transform: none;
  }

  .report-page {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 16px;
    box-shadow: none;
    border-radius: 0;
  }

  .agency-line {
    flex-direction: column;
    gap: 4px;
  }

  h1 {
    font-size: clamp(2.2rem, 12vw, 3.8rem);
  }

  .header-meta {
    flex-direction: column;
    gap: 4px;
  }

  .case-strip {
    grid-template-columns: repeat(8, 1fr);
  }

  .classification-header {
    flex-direction: column;
    gap: 12px;
  }

  .integer-display {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .rule-grid,
  .assessment {
    grid-template-columns: 1fr;
  }

  .report-navigation {
    grid-template-columns: 1fr;
  }

  .progress-wrapper {
    grid-column: auto;
    grid-row: auto;
  }

  .report-button,
  .next-slot {
    width: 100%;
  }
}

/* ======================================
   DOCUMENT & PHOTO ATTACHMENT STYLES
====================================== */
.chat-attachment-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1.5px dashed var(--line-strong);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  animation: fadeIn 0.2s ease-out;
}

.attachment-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.attachment-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.attachment-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.attachment-name {
  font-family: Georgia, serif;
  font-weight: bold;
  font-size: 0.9rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachment-meta {
  font-family: "Courier New", monospace;
  font-size: 0.75rem;
  color: var(--muted);
}

.attachment-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.attachment-btn-action {
  background: var(--paper);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: 0.75rem;
  font-family: inherit;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.attachment-btn-action:hover {
  background: var(--ink);
  color: var(--paper);
}

.attachment-remove-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  padding: 4px 6px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.attachment-remove-btn:hover {
  color: var(--red);
  background: rgba(142, 33, 29, 0.1);
}

/* Chat Attach (Paperclip) Button */
.chat-attach-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: all 0.18s ease;
}

.chat-attach-btn:hover {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.05);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

/* Drag & Drop Visual State */
.ai-chat-view.drag-over {
  outline: 3px dashed var(--red);
  outline-offset: -8px;
  background-color: rgba(142, 33, 29, 0.04) !important;
}

/* Document Badge in User Chat Message */
.user-doc-attachment-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.06);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 4px 8px;
  margin-bottom: 8px;
  font-size: 0.82rem;
  font-family: Georgia, serif;
}

/* Modal for Document Text Review */
.doc-text-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fadeIn 0.18s ease-out;
}

.doc-text-modal-content {
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  border-radius: 8px;
  width: 100%;
  max-width: 800px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.doc-text-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1.5px solid var(--line-strong);
  background: rgba(0, 0, 0, 0.02);
}

.doc-text-modal-header h3 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 1.1rem;
  color: var(--ink);
}

.doc-modal-close {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--muted);
  padding: 2px 6px;
}

.doc-modal-close:hover {
  color: var(--red);
}

.doc-text-modal-body {
  padding: 16px 18px;
  flex: 1;
  overflow-y: auto;
}

.doc-extracted-textarea {
  width: 100%;
  height: 380px;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  padding: 12px;
  font-family: Georgia, serif;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink);
  box-sizing: border-box;
  border-radius: 4px;
  resize: vertical;
}

.doc-extracted-textarea:focus {
  outline: none;
  border-color: var(--ink);
}

.doc-text-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-top: 1.5px solid var(--line-strong);
  background: rgba(0, 0, 0, 0.02);
}

.doc-modal-meta {
  font-family: "Courier New", monospace;
  font-size: 0.8rem;
  color: var(--muted);
}

.save-doc-btn {
  padding: 8px 16px;
  font-size: 0.85rem;
  cursor: pointer;
}

/* ======================================
   ANOMALY STAMP ANIMATION & OVERLAY
====================================== */
.anomaly-stamp-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(18, 18, 18, 0.55);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.anomaly-stamp-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transform-origin: center center;
}

.stamp-meta-header {
  font-family: "DM Mono", "Courier New", monospace;
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.3em;
  color: #ffffff;
  text-transform: uppercase;
  background: #111111;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  padding: 6px 20px;
  border-radius: 4px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.stamp-seal-frame {
  border: 4.5px solid currentColor;
  border-radius: 8px;
  padding: 16px 36px;
  background: rgba(255, 255, 255, 0.96);
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  position: relative;
  transition: all 0.2s ease;
}

.stamp-seal-frame.seal-cleared {
  color: #1a6d38;
  border-color: #1a6d38;
  box-shadow: 0 0 35px rgba(26, 109, 56, 0.45);
}

.stamp-seal-frame.seal-boo {
  color: #a36200;
  border-color: #a36200;
  box-shadow: 0 0 35px rgba(163, 98, 0, 0.45);
}

.stamp-seal-frame.seal-scary {
  color: #b01b1b;
  border-color: #b01b1b;
  box-shadow: 0 0 45px rgba(176, 27, 27, 0.5);
}

.stamp-seal-frame.seal-booscary {
  color: #820000;
  border-color: #820000;
  background: #fff5f5;
  box-shadow: 0 0 50px rgba(130, 0, 0, 0.65);
}

.stamp-seal-inner {
  border: 2px dashed currentColor;
  padding: 12px 28px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stamp-main-title {
  font-family: "DM Mono", "Courier New", monospace;
  font-size: 3.2rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  line-height: 1;
}

.stamp-sub-title {
  font-family: Georgia, serif;
  font-size: 1.05rem;
  font-weight: bold;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stamp-footer-line {
  font-family: "DM Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  opacity: 0.85;
  margin-top: 4px;
}

/* Animations */
.stamp-slam-animate {
  animation: stampSlamEffect 0.42s cubic-bezier(0.18, 0.89, 0.32, 1.25) forwards;
}

@keyframes stampSlamEffect {
  0% {
    transform: scale(2.8) rotate(-18deg);
    opacity: 0;
  }
  60% {
    transform: scale(0.94) rotate(-5deg);
    opacity: 1;
  }
  80% {
    transform: scale(1.03) rotate(-7deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(-6deg);
    opacity: 1;
  }
}

.stamp-fade-out {
  animation: stampFadeOutEffect 0.45s ease-out forwards;
}

@keyframes stampFadeOutEffect {
  0% {
    opacity: 1;
    transform: scale(1) rotate(-6deg);
  }
  100% {
    opacity: 0;
    transform: scale(1.08) rotate(-6deg);
  }
}

/* Permanent Stamp Badge in Chat Message */
.chat-stamp-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid currentColor;
  padding: 5px 12px;
  border-radius: 4px;
  font-family: "DM Mono", monospace;
  font-size: 0.8rem;
  font-weight: bold;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transform: rotate(-1.5deg);
}

.chat-stamp-badge.cleared { color: #1a6d38; border-color: #1a6d38; }
.chat-stamp-badge.boo { color: #a36200; border-color: #a36200; }
.chat-stamp-badge.scary { color: #b01b1b; border-color: #b01b1b; }
.chat-stamp-badge.booscary { color: #820000; border-color: #820000; background: #fff5f5; }

.chat-stamp-label {
  opacity: 0.75;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
}

.chat-stamp-val {
  font-weight: 900;
  font-size: 0.88rem;
}

/* Dossier Markdown Tables */
.table-container {
  width: 100%;
  overflow-x: auto;
  margin: 18px 0;
  border-radius: 4px;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.dossier-table {
  width: 100%;
  border-collapse: collapse;
  font-family: Georgia, serif;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink);
}

.dossier-table th {
  background: rgba(0, 0, 0, 0.04);
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 14px;
  border-bottom: 2px solid var(--line-strong);
  text-align: left;
  color: var(--ink);
}

.dossier-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.dossier-table tr:last-child td {
  border-bottom: none;
}

.dossier-table tr:nth-child(even) td {
  background: rgba(0, 0, 0, 0.015);
}

/* ======================================
   BOOKS CATALOG VIEW (ВКЛАДКА ВСІ ПІДРУЧНИКИ)
====================================== */
.books-catalog-view {
  width: 100%;
  animation: fadeIn 0.25s ease-out;
  padding: 8px 0 24px;
}

.catalog-intro-banner {
  background: rgba(0, 0, 0, 0.025);
  border: 1.5px dashed var(--line-strong);
  border-radius: 6px;
  padding: 20px 24px;
  margin-bottom: 24px;
}

.catalog-badge {
  display: inline-block;
  font-family: "DM Mono", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.05);
  padding: 3px 8px;
  border-radius: 3px;
  margin-bottom: 10px;
}

.catalog-heading {
  font-family: Georgia, serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 8px 0;
  line-height: 1.25;
}

.catalog-description {
  font-size: 0.95rem;
  line-height: 1.55;
  color: #4a453e;
  margin: 0;
  font-family: Georgia, serif;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 20px;
}

.catalog-card {
  background: #ffffff;
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  position: relative;
}

.catalog-card:hover {
  transform: translateY(-3px);
  border-color: var(--ink);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.catalog-card:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.catalog-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.catalog-card-badge {
  font-family: "DM Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 700;
}

.catalog-card-count {
  font-family: "DM Mono", monospace;
  font-size: 0.68rem;
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink);
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: bold;
}

.catalog-card-title-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}

.catalog-card-icon {
  font-size: 2.2rem;
  line-height: 1;
  flex-shrink: 0;
}

.catalog-card-title-group {
  flex: 1;
}

.catalog-card-title {
  font-family: Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 4px 0;
  line-height: 1.3;
}

.catalog-card-author {
  font-family: "DM Mono", monospace;
  font-size: 0.74rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.catalog-card-desc {
  font-size: 0.88rem;
  line-height: 1.5;
  color: #4a453e;
  margin: 0 0 16px 0;
  flex: 1;
}

.catalog-card-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.catalog-topic-tag {
  font-family: "DM Mono", monospace;
  font-size: 0.62rem;
  background: rgba(0, 0, 0, 0.04);
  color: #555047;
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.catalog-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  margin-top: auto;
}

.catalog-card-agency {
  font-family: "DM Mono", monospace;
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.catalog-open-btn {
  background: var(--ink);
  color: var(--paper);
  border: none;
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.catalog-card:hover .catalog-open-btn {
  background: #000000;
  color: #ffffff;
  transform: translateX(2px);
}

@media (max-width: 600px) {
  .catalog-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .catalog-card {
    padding: 16px 16px;
  }
  .catalog-heading {
    font-size: 1.3rem;
  }
  .catalog-intro-banner {
    padding: 14px 16px;
    margin-bottom: 16px;
  }
}
