body {
  margin: 0;
  font-family: sans-serif;
  background-color: #f0f0f0;
  color: #333;
}

/* Header */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 1rem;
  background-color: #f5f5f5;
  height: 64px;
}

.header-left {
  display: flex;
  align-items: center;
}

.site-logo {
  height: 80px;
  margin: 0 0 0 0;
  display: block;
}

.site-title {
  font-size: 1.8rem;
  margin: 0;
  font-family: 'Playfair Display', serif;
  letter-spacing: 1.2px;
  padding-bottom: 2px;
}

/* Nav */
.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  font-weight: bold;
  color: #333;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: #e8cbc2;
}

/* Footer */
.site-footer {
  text-align: center;
  font-size: 0.8rem;
  padding: 2rem 1rem;
  color: #777;
}

/* Main Layout */
.main-content {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 2rem;
}

/* Universal box */
.box {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  padding: 2rem;
  margin-bottom: 2rem;
}

/* Typography */
h2, h3 {
  margin-top: 0;
  color: #111;
}

/* Flex sections */
.flex-four {
  display: flex;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 2rem;
}

.flex-four > div {
  flex: 1;
  min-width: 250px;
}

/* Card sections */
.card-section .card-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.card {
  flex: 1 1 48%;
  background: #fff;
  border: 1px solid #ddd;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.card-full {
  margin-top: 2rem;
  background: #fff;
  border: 1px solid #ddd;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Centered CTA box */
.centered-box {
  text-align: center;
}

.cta-button {
  background-color: #111;
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  text-decoration: none;
  display: inline-block;
  margin-top: 1rem;
}

.cta-button:hover {
  background-color: #222;
}

/* Links */
a {
  color: #0077cc;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  color: #e8cbc2;
}

.flex-four {
  display: flex;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 2rem;
  padding: 0 1rem; /* Ensures space on left/right inside box */
}

.flex-four {
  display: flex;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 0;
}

.flex-four .panel {
  flex: 1;
  min-width: 250px;
  padding: 0 1.25rem;
  border-right: 1px solid #e4e4e4;
  box-sizing: border-box;
}

.flex-four .panel:last-child {
  border-right: none;
}

.flex-four > div {
  flex: 1;
  min-width: 250px;
}

.hero-box {
  background-color: #fefefe;
  border-left: 4px solid #333;
  font-family: Georgia, serif;
  padding: 1.75rem 2rem;
  margin: 2rem auto;
  max-width: 800px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
  border-radius: 6px;
}

.hero-box h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111;
  margin-bottom: 0.5rem;
}

.hero-box p {
  font-size: 1rem;
  color: #444;
  margin: 0;
  line-height: 1.6;
}

/* Hero Box */
.hero-box {
  background-color: #fefefe;
  border-left: 4px solid #e8cbc2;
  font-family: Georgia, serif;
  padding: 1.75rem 2rem;
  margin: 2rem auto;
  max-width: 800px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
  border-radius: 6px;
}

/* CTA / Centered Box */
.centered-box {
  text-align: center;
}

.cta-button {
  background-color: #111;
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  text-decoration: none;
  display: inline-block;
  margin-top: 1rem;
  transition: background-color 0.3s ease;
}

.cta-button:hover {
  background-color: #222;
}

/* Contact Box */
.contact-box {
  text-align: center;
}

.contact-box a {
  color: #0077cc;
  text-decoration: none;
}

.contact-box a:hover {
  text-decoration: underline;
}

/* Optional: slight vertical separation between .panel blocks */
.flex-four .panel {
  padding: 0 1rem;
  border-right: 1px solid #e4e4e4;
}

.flex-four .panel:last-child {
  border-right: none;
}

.flex-four > .panel:last-child {
  border-right: none;
}

.card-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 2rem;
}

.card {
  flex: 1 1 48%;
  background: #fff;
  border: 1px solid #e2e2e2;
  padding: 1.5rem;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card h3 {
  margin-top: 0;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.card p {
  flex-grow: 1;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  color: #444;
}

.card a {
  font-size: 0.9rem;
  color: #0077cc;
  text-decoration: none;
  font-weight: 500;
}

.card a:hover {
  text-decoration: underline;
}

/* Optional: space between full-width cards too */
.card-full {
  background: #fff;
  border: 1px solid #e2e2e2;
  padding: 1.5rem;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  margin-top: 2rem;
}

.contact-box {
  text-align: center;
}

.contact-box p {
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: #444;
  line-height: 1.6;
}

.contact-info p {
  margin: 0.4rem 0;
}

.contact-info a {
  color: #0077cc;
  text-decoration: none;
}

.contact-info a:hover {
  text-decoration: underline;
}

.about-section {
  max-width: 800px;
  margin: 0 auto 2rem auto;
  font-family: Georgia, serif;
  line-height: 1.7;
  font-size: 1.05rem;
  color: #222;
  padding: 2rem;
  background-color: #fefefe;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
}

.about-section h2 {
  font-size: 1.6rem;
  margin-bottom: 1.25rem;
}

.about-section ul {
  padding-left: 1.5rem;
  margin: 1.5rem 0;
}

.about-section li {
  margin-bottom: 1rem;
}

.about-section strong {
  font-weight: 600;
}

body::before {
  content: "";
  position: fixed;
  top: -50px;
  right: -350px;
  left: auto;
  width: 1000px;
  height: 1000px;
  background-image: url('/static/logo_bg_rust.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: top left;
  z-index: 0;
  opacity: 0.55;
  pointer-events: none;
}

.main-content,
.about-section {
  position: relative;
  z-index: 1;
}

.logo-background {
  position: relative;
  background-image: url('/static/logo_bg.png'); /* adjust path as needed */
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 220px;
  opacity: 1;
}

.logo-background::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: inherit;
  background-repeat: inherit;
  background-position: inherit;
  background-size: inherit;
  opacity: 0.04; /* faint and subtle */
  z-index: 0;
  pointer-events: none;
}

.logo-background * {
  position: relative;
  z-index: 1;
}

.callout-left {
  text-align: left;
  padding-left: 2rem;
  padding-right: 2rem;
  max-width: 900px;
  margin: 3rem auto;
}

.callout-left h2 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.callout-left p {
  font-size: 1rem;
  color: #444;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.callout-left {
  padding: 2.5rem;
  background-color: #fefefe;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
  font-family: Georgia, serif;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.side-image {
  float: right;
  width: 240px;
  margin-left: 2rem;
  margin-bottom: 1rem;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.callout-left {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  background-color: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  flex-wrap: wrap;
}

.callout-text {
  flex: 1;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.callout-text h2 {
  margin-top: 0;
}

.callout-text p {
  margin: 1rem 0;
}

.cta-button {
  align-self: flex-start;
  margin-top: 1rem;
}

.side-image {
  max-width: 300px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.left-aligned {
  text-align: left;
  padding-left: 2rem;
  padding-right: 2rem;
}

.contact-box h3 {
  margin-top: 0;
  font-size: 1.4rem;
  font-weight: 600;
}

.contact-box p {
  font-size: 1rem;
  margin: 1rem 0;
  color: #333;
  line-height: 1.6;
}

.contact-info p {
  margin: 0.5rem 0;
}

.contact-info a {
  color: #0077cc;
  text-decoration: none;
}

.contact-info a:hover {
  text-decoration: underline;
}

.soft-section {
  background-color: #f0f0f0; /* matches your <body> background */
  box-shadow: none;
  border: none;
  padding: 2rem 0;
}

.card-row.independent-cards {
  display: flex;
  justify-content: space-between;
  flex-wrap: nowrap; /* prevent wrapping */
  gap: 2rem;
  max-width: 1200px;
  margin: 2rem auto;
}

.card-row.independent-cards .card {
  flex: 1 1 32%; /* fits 3 with gaps in 100% width */
  background: #fff;
  border: 1px solid #e2e2e2;
  padding: 1.5rem;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.contact-simple {
  max-width: 800px;
  margin: 4rem auto 2rem auto;
  padding: 0 2rem;
  text-align: left;
  font-family: Georgia, serif;
}

.contact-simple h3 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-top: 0;
}

.contact-simple p {
  font-size: 1rem;
  margin: 1rem 0;
  color: #333;
  line-height: 1.6;
}

.contact-simple a {
  color: #0077cc;
  text-decoration: none;
}

.contact-simple a:hover {
  text-decoration: underline;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin: 2rem 0;
}

.social-links img {
  width: 40px;
  height: 40px;
  transition: opacity 0.2s ease;
}

.social-links img:hover {
  opacity: 0.75;
}

.centered-box {
  text-align: center;
  padding: 2rem;
}

.cta-button {
  background-color: #111;
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  text-decoration: none;
  margin-top: 1rem;
  display: inline-block;
  transition: background-color 0.3s ease;
}

.cta-button:hover {
  background-color: #222;
}

.conditional-section {
  background-color: #f9f9f9;
  padding: 1rem;
  margin: 1rem 0;
  border-left: 4px solid #ddd;
  border-radius: 6px;
}

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.report-form input,
.report-form select,
.report-form textarea {
  padding: 0.75rem;
  font-size: 1.05rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  width: 100%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);  /* consistent shadow */
  outline: none;
  background-color: #fff;
  appearance: none; /* normalize dropdowns */
}

.report-form input:focus,
.report-form select:focus,
.report-form textarea:focus {
  border-color: #888;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.15);  /* soft glow on focus */
}

.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkbox-inline input[type="checkbox"] {
  margin: 0;
  transform: scale(1.2); /* optional: make it less tiny */
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
  margin: 0;
  transform: none;
  width: auto;
  height: auto;
}

.report-form select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  background-color: #fff;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%23666' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1rem;

  font-size: 1rem;
  padding: 0.75rem 2.5rem 0.75rem 0.75rem; /* top/right/bottom/left */
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
  height: 3rem; /* force it */
  line-height: 1.25rem;
}

.report-form input,
.report-form textarea {
  height: 3rem;
  padding: 0.75rem;
  font-size: 1rem;
  box-sizing: border-box;
}

.report-form textarea {
  min-height: 8rem; /* ~130px – taller than default */
  resize: vertical; /* still allows users to resize if they want */
  padding: 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
}

.form-preview {
  border: 1px solid #ccc;
  background: #f9f9f9;
  padding: 1rem;
  margin-top: 1rem;
}

.hidden { 
  display: none; 
}

.form-helper {
  font-size: 0.9rem;
  color: #666;
  margin: 0.25rem 0 1rem 0;
}

.fill-unknown {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 2px 10px;
  font-size: 0.85rem;
  background-color: #eee;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  color: #333;
}

.fill-unknown:hover {
  background-color: #ddd;
}

.form-group input + .fill-unknown,
.form-group textarea + .fill-unknown {
  display: inline-block;
  margin-left: 0;
}

.site-title a {
  color: inherit;
  text-decoration: none;
}

.callout-left {
  max-width: 710px;
  padding: 1.5rem 1.75rem;
  font-size: 0.90rem;
}

/* --- Mobile Optimizations --- */
@media (max-width: 768px) {

  .site-header {
    flex-direction: column;
    align-items: flex-start;
    height: auto;
    padding: 1rem;
  }

  .site-logo {
    height: 60px;
    margin-bottom: 0.5rem;
  }

  .nav-links {
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    padding-top: 1rem;
  }

  .main-content {
    padding: 1rem;
    margin: 1rem auto;
  }

  .hero-box {
    padding: 1.25rem;
    margin: 1rem auto;
    max-width: 100%;
  }

  .flex-four {
    flex-direction: column;
    gap: 1.25rem;
    padding: 0;
  }

  .flex-four .panel {
    border-right: none;
    padding: 0 0.5rem;
  }

  .callout-left {
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.5rem;
  }

  .side-image {
    float: none;
    margin: 0 auto;
    max-width: 100%;
  }

  .cta-button {
    width: 100%;
    text-align: center;
  }

  .card-row.independent-cards {
    flex-direction: column;
  }

  .card {
    flex: 1 1 100%;
  }

  .contact-simple {
    padding: 1rem;
  }

  .social-links {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .social-links img {
    width: 36px;
    height: 36px;
  }

  .site-title {
    font-size: 1.5rem;
  }

  h2, h3 {
    font-size: 1.25rem;
  }

  p, li {
    font-size: 1rem;
  }
}

.cta-button {
  display: block;
  max-width: 100%;
  padding: 0.75rem 1rem;
  box-sizing: border-box;
  text-align: center;
  margin: 1rem auto 0 auto;
}

.cta-button {
  background-color: #111;
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  text-decoration: none;
  display: inline-block;
  margin-top: 1rem;
  transition: background-color 0.3s ease;
  max-width: 280px;
  text-align: center;
}

/* ---------- MAP + TOOLTIP + ACTIVE STATES (HAS FILES) ---------- */

.map-container {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}

#us-map {
  width: 100%;
  height: auto;
  display: block;
}

/* Base states on the map */
#us-map .state {
  fill: #000000;            /* default black state fill */
  stroke: #555555;          /* subtle grey border for all states */
  stroke-width: 1;
  cursor: default;
  transition: fill 0.2s ease, opacity 0.2s ease, transform 0.1s ease, stroke 0.2s ease;
}

#us-map .state:hover {
  transform: translateY(-1px);
}

/* Tooltip showing state abbreviations */
.state-tooltip {
  position: absolute;
  background: rgba(0, 0, 0, 0.95);
  color: #ffffff;
  padding: 0.2rem 0.45rem;
  border-radius: 3px;
  font-size: 0.75rem;
  pointer-events: none;
  transform: translate(-50%, -140%);
  white-space: nowrap;
  z-index: 10;
}

/* ============================================================
   STATES THAT HAVE ARCHIVE FILES (COLORADO, ETC.)
   ============================================================ */
#us-map .state.state--has-files {
  fill: #CF9584 !important;    /* ERI rose accent color */
  stroke: #ffffff !important;  /* bold white outline */
  stroke-width: 2 !important;
  cursor: pointer;             /* only clickable states show pointer */
  opacity: 1;
}

#us-map .state.state--has-files:hover {
  fill: #b9796a !important;    /* darker rust on hover */
}

/* ============================================================
   STATES WITH NO FILES YET (remain black, not clickable)
   ============================================================ */
#us-map .state:not(.state--has-files) {
  cursor: default;
  pointer-events: none;        /* can't click inactive states */
}

/* ===============================
   Standard ERI Pill Button
   =============================== */

.eri-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;

  padding: 0.6rem 1.15rem;
  border-radius: 999px;
  position: relative;

  font-size: 0.95rem;
  font-weight: 520;
  letter-spacing: 0.01em;

  text-decoration: none;
  color: rgba(24,24,24,0.92);

  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.22);

  box-shadow: 0 6px 18px rgba(0,0,0,0.12);

  transition:
    transform 0.14s ease,
    box-shadow 0.14s ease,
    border-color 0.14s ease;
}

.eri-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(0,0,0,0.18);
  border-color: rgba(0,0,0,0.32);
}

/* The glow lives on a pseudo-element so the text never scales */
.eri-attention-pulse::after {
  content: "";
  position: absolute;
  inset: -12px;               /* how far the glow extends */
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.25;
}

/* =================================================
   Attention pulse for "Pull my memories"
   (first-time only, JS-controlled)
   ================================================= */

@keyframes eri-attention-ring {
  0% {
    opacity: 0.25;
    box-shadow:
      0 0 0 0 rgba(232,203,194,0.00),
      0 0 0 0 rgba(232,203,194,0.00);
    transform: scale(1);
    filter: blur(0px);
  }
  55% {
    opacity: 1;
    box-shadow:
      0 0 0 12px rgba(232,203,194,0.38),
      0 0 46px 24px rgba(232,203,194,0.55);
    transform: scale(1.03);
    filter: blur(0.5px);
  }
  100% {
    opacity: 0.25;
    box-shadow:
      0 0 0 0 rgba(232,203,194,0.00),
      0 0 0 0 rgba(232,203,194,0.00);
    transform: scale(1);
    filter: blur(0px);
  }
}

/* IMPORTANT:
   Do NOT animate the button itself (keeps text stable). */
.eri-attention-pulse {
  transform: none !important;
}

/* Animate ONLY the pseudo-element ring */
.eri-attention-pulse::after {
  animation: eri-attention-ring 1.2s ease-in-out infinite;
}

/* Stop ring when user interacts (don’t fade the whole button) */
.eri-attention-pulse:hover::after,
.eri-attention-pulse:focus-visible::after {
  animation: none;
  opacity: 0;
}

/* half-width pill for section CTAs */
.eri-pill--half {
  width: 50%;
  max-width: 420px;   /* prevents it from getting goofy on wide screens */
  justify-content: center;
}

.note-text{
  font-size: 0.82rem;
  opacity: 0.85;
}



/* =========================================================
   ERI REPORT FLOW + MEMORY CANVAS (CLEAN / SINGLE SOURCE)
   Tray ABOVE canvas + aligned controls + no hint overlap
   ========================================================= */

.eri-flow { max-width: 980px; margin: 0 auto; }
.eri-step { padding: 1.1rem 0; }
.eri-step__title { margin: 0 0 .55rem 0; }

.eri-helper { margin: .35rem 0 .75rem 0; opacity: .88; line-height: 1.6; }
.eri-helper--em { font-style: italic; opacity: 0.76; }

.eri-label { display:block; margin:.8rem 0 .35rem; }
.eri-input { width: 100%; box-sizing: border-box; }

.eri-step__actions{
  display:flex;
  gap:.6rem;
  margin-top:.95rem;
  flex-wrap:wrap;
  align-items:center;
}

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

.eri-summary{
  margin-top:.95rem;
  padding:.9rem 1rem;
  border-radius:14px;
  border:1px solid rgba(0,0,0,.14);
  background:rgba(255,255,255,.45);
}

.eri-summary__edit{ margin-top:.65rem; }
.eri-prewrap{ white-space: pre-wrap; }
.eri-micro{ font-size:0.82rem; opacity:0.75; }

/* Optional calm callout block */
.eri-callout{
  margin: .75rem 0 1rem 0;
  padding: 1rem 1.05rem;
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.55);
  box-shadow: 0 10px 26px rgba(0,0,0,.06);
}

.eri-callout__title{
  margin: 0 0 .45rem 0;
  font-weight: 750;
  letter-spacing: .2px;
}

.eri-callout__body{
  margin: 0 0 .55rem 0;
  opacity: .88;
  line-height: 1.6;
}

.eri-callout__body:last-child{ margin-bottom: 0; }



/* ----------------------------
   Controls row (aligned)
   ---------------------------- */
.eri-canvas__controls{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  align-items: end;
  margin: .85rem 0 .65rem 0;
}

#eri-extract{
  height: 44px;
  justify-self: start;
  min-width: 240px;
}

.eri-canvas__add{
  display:flex;
  gap:.6rem;
  align-items:end;
  justify-content: flex-end;
}

#eri-custom-token{
  height: 44px;
  min-width: min(520px, 52vw);
}

#eri-add-token{
  height: 44px;
  padding: 0 1rem;
}

/* Nudges row */
.eri-canvas__nudges{
  display:flex;
  align-items:center;
  gap: .9rem;
  flex-wrap: wrap;
  margin: .35rem 0 1rem 0;
}

/* ----------------------------
   Tray ABOVE canvas (your ask)
   ---------------------------- */
.eri-canvas-tray{
  margin: .65rem 0 1rem 0;
  border-radius: 18px;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.45);
  box-shadow: 0 10px 26px rgba(0,0,0,.06);
  padding: .85rem;
}

.eri-tray-head{
  margin-bottom: .6rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid rgba(0,0,0,.08);
}

.eri-tray-title{
  font-weight: 800;
  font-size: 1.05rem;
  margin: 0 0 .15rem 0;
}

.eri-tray-sub{
  font-size: .88rem;
  opacity: .70;
  margin: 0;
}

.eri-tokenbank{
  margin-top: .75rem;
  padding: .75rem;
  border-radius: 14px;
  border: 1px dashed rgba(0,0,0,.18);
  background: rgba(255,255,255,.50);
  max-height: 240px;
  overflow: auto;

  display:flex;
  flex-wrap:wrap;
  gap:.55rem;
}

/* ----------------------------
   Dropzone / Canvas
   (reserve a header band so text never stacks)
   ---------------------------- */
#eri-dropzone{
  position: relative;
  border-radius: 18px;
  border: 2px solid rgba(0,0,0,0.14);
  background: rgba(255,255,255,0.55);

  min-height: 65vh;
  overflow: auto;

  /* reserve top space for guide + hint */
  padding: 18px 18px 18px 34px;
}

/* Grid */
#eri-dropzone::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius:18px;
  background-image:
    linear-gradient(to right, rgba(0,0,0,0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0,0,0,0.03) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events:none;
  opacity:.70;
}


/* ----------------------------
   Tokens
   ---------------------------- */
.eri-token{
  display:inline-flex;
  align-items:center;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.14);
  background: rgba(255,255,255,.88);
  box-shadow: 0 10px 22px rgba(0,0,0,0.10);
  user-select:none;
  max-width: min(860px, 92%);

  padding: .48rem .78rem;
  max-width: 100%;
}

.eri-tokenbank .eri-token{
  position: relative; /* tray tokens flow normally */
  cursor: grab;
}

#eri-dropzone .eri-token{
  position: absolute; /* canvas tokens float */
  cursor: grab;
  z-index: 3;
}

.eri-token:active{ cursor: grabbing; }

.eri-token__text{
  display:block;
  white-space: normal;      /* allow wrapping */
  overflow: visible;        /* no clipping */
  text-overflow: clip;      /* no ellipsis */
  max-width: none;          /* let the card define width */
  line-height: 1.35;
}

/* Ranked: leave room for badge */
.eri-token--ranked{
  padding-left: 2.05rem;
}

.eri-token--ranked::before{
  content: attr(data-order);
  position:absolute;
  left: 0.62rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.12rem;
  height: 1.12rem;
  border-radius: 999px;
  display:grid;
  place-items:center;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(0,0,0,0.22);
  opacity: 0.9;
}

/* Menu button (⋯) */
.eri-token__menuBtn{
  appearance:none;
  border: 1px solid rgba(0,0,0,.20);
  background: rgba(255,255,255,.85);
  cursor:pointer;
  opacity:0.9;
  font-size:1.05rem;
  line-height:1;
  padding:.12rem .45rem;
  border-radius:10px;
}

.eri-token__menuBtn:hover{ opacity:1; }

/* Menu panel MUST be above all tokens */
.eri-token__menuPanel{
  position:absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  padding: .6rem .6rem;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.14);
  background: rgba(255,255,255,.98);
  box-shadow: 0 18px 38px rgba(0,0,0,0.14);
  z-index: 9999;
}

/* Actions */
.eri-token__action{
  appearance:none;
  width: 100%;
  text-align:left;
  border: 1px solid rgba(0,0,0,.14);
  background: rgba(255,255,255,.92);
  border-radius: 12px;
  padding: .44rem .6rem;
  cursor:pointer;
  font-size: .9rem;
  margin: .25rem 0;
}

.eri-token__action:hover{
  background: rgba(255,255,255,1);
}

/* Confidence states */
.eri-token--uncertain{ border-style: dashed; }
.eri-token--certain{ border-width: 2px; }

/* Inline editor (if your JS uses it) */
.eri-token__edit{
  width: 320px;
  max-width: 74vw;
  min-height: 2.2rem;
  resize: vertical;
  padding: .45rem .55rem;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.18);
  font-size: 0.95rem;
  line-height: 1.3;
  background: #fff;
  outline: none;
}

/* ----------------------------
   Responsive
   ---------------------------- */
@media (max-width: 920px){
  .eri-canvas__controls{
    grid-template-columns: 1fr;
  }

  #eri-extract{
    width: 100%;
    justify-self: stretch;
  }

  .eri-canvas__add{
    justify-content: stretch;
  }

  #eri-custom-token{
    min-width: 0;
    flex: 1 1 auto;
    width: 100%;
  }

  #eri-dropzone{
    min-height: 58vh;
  }

  .eri-tokenbank{
    max-height: 220px;
  }
}

.eri-canvas-help{
  margin-top: .4rem;
}
.eri-canvas-help .eri-micro{
  margin-top: .25rem;
}

.eri-canvas-meta{
  margin: .55rem 0 .45rem 0;
}

/* Inline sentence buttons should match size */
.eri-helper--inline .eri-pill {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  line-height: 1.2;
  min-height: 2.2rem;          /* 👈 forces equal height */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  cursor: pointer;
}

/* Remove half-width behavior ONLY in inline context */
.eri-helper--inline .eri-pill--half {
  min-width: unset;
  width: auto;
}

/* Subtle emphasis for primary inline action */
.eri-helper--inline #eri-extract {
  box-shadow:
    0 0 0 1px rgba(232,203,194,0.35),
    0 4px 14px rgba(232,203,194,0.25);
}

/* =========================================================
   Inline helper sentence: force both buttons to match
   (override global #eri-extract sizing)
   ========================================================= */

.eri-helper--inline #eri-extract,
.eri-helper--inline #eri-missing {
  height: 44px !important;         /* match your system height */
  min-height: 44px !important;
  padding: 0 1rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  vertical-align: middle !important;
  cursor: pointer !important;      /* finger hand */
}

/* Kill the global min-width only in the inline sentence */
.eri-helper--inline #eri-extract {
  min-width: 0 !important;
  width: auto !important;

  /* subtle emphasis glow (calm) */
  box-shadow:
    0 0 0 1px rgba(232,203,194,0.45),
    0 6px 18px rgba(232,203,194,0.28) !important;
}

.eri-pill--small{
  height: 36px;
  padding: 0 .85rem;
  font-size: .85rem;
  cursor: pointer;
}

/* =========================================================
   Stop page jump when "Saved." flashes
   ========================================================= */
#eri-canvas-saved{
  display: block;       /* so height applies */
  min-height: 1.2em;    /* reserve one text line */
  margin: .15rem 0 .25rem 0;
}

/* Stop the browser from scrolling the page while dragging tokens */
#eri-dropzone,
#eri-dropzone .eri-token{
  touch-action: none;          /* critical */
}

#eri-dropzone{
  overscroll-behavior: contain; /* prevents scroll chaining */
}


/* =========================================================
   Canvas count badge (top-right inside canvas)
   ========================================================= */
#eri-dropzone .eri-dropzone__count{
  position: absolute;
  top: 10px;
  right: 14px;
  z-index: 4;
  pointer-events: none;

  padding: .25rem .55rem;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(0,0,0,.10);
  box-shadow: 0 8px 18px rgba(0,0,0,.06);
}

/* =========================================================
   Long down arrow on left side of canvas (FINAL)
   ========================================================= */
#eri-dropzone .eri-dropzone__arrow{
  position: absolute;
  left: 14px;              /* nudged off edge */
  top: 28px;               /* clears top radius */
  bottom: 28px;            /* clears bottom radius */
  width: 2px;
  background: rgba(0,0,0,.18);
  border-radius: 2px;
  z-index: 2;
  pointer-events: none;
  opacity: .22;
}

#eri-dropzone .eri-dropzone__arrow::after{
  content:"";
  position:absolute;
  left: 50%;
  bottom: -2px;            /* visually centers above curve */
  transform: translateX(-50%);

  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid rgba(0,0,0,.35);
}



/* =========================================================
   Canvas temporal labels (Early / Later)
   ========================================================= */

#eri-dropzone .eri-dropzone__arrow-label{
  position: absolute;
  left: 4px;
  font-size: .82rem;
  letter-spacing: .04em;
  color: rgba(0,0,0,.55);
  opacity: .35;
  pointer-events: none;
  user-select: none;
}

#eri-dropzone .eri-dropzone__arrow-label--top{
  top: 6px;
}

#eri-dropzone .eri-dropzone__arrow-label--bottom{
  bottom: 6px;
}

/* Big centered hint (only until first drop) */
#eri-dropzone .eri-dropzone__emptyHint{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1;                 /* below tokens (tokens are z-index 3) */
  pointer-events: none;       /* never blocks dragging */
  user-select: none;

  font-size: clamp(1.25rem, 2.2vw, 2rem);
  font-weight: 650;
  letter-spacing: .02em;
  color: rgba(0,0,0,.55);
  opacity: .16;               /* subtle */
  text-align: center;
  padding: 2rem;
}

#eri-dropzone .eri-dropzone__emptyHint.is-hidden{
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 220ms ease, transform 220ms ease;
}

/* Vertically center instruction between callout and tray */
.eri-canvas-bridge {
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.eri-canvas-bridge__text {
  align-self: center;
  margin: 0;
}

/* ===== Fix: tray header subtext breathing room ===== */
.eri-tray-head{
  padding-top: 0.15rem !important;
  padding-bottom: 0.85rem !important;   /* more space above divider */
  margin-bottom: 0.75rem !important;
}

.eri-tray-title{
  margin-bottom: 0.35rem !important;    /* space between title + sub */
  line-height: 1.15 !important;
}

.eri-tray-sub{
  margin-top: 0 !important;
  margin-bottom: 0.10rem !important;    /* keep it off the divider */
  line-height: 1.35 !important;
  display: block !important;
}

/* Add breathing room between tray text and input */
.eri-tray-head {
  column-gap: 1.55rem;
}

.eri-tray-head__right{
  margin-top: .55rem;
}

/* Viewport holds the surface */
#eri-dropzone{
  overflow: hidden; /* important: pan inside, not page scrollbars */
}

/* The pan/zoom surface (everything draggable sits here) */
#eri-canvas-surface{
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
  will-change: transform;
}

/* Tokens should position relative to the surface now */
#eri-canvas-surface .eri-token{
  position: absolute;
}

/* ===== Token wrapping (no truncation) ===== */
.eri-token{
  max-width: min(560px, 86%);   /* prevents 1-mile-wide pills */
  border-radius: 16px;          /* looks good when multi-line */
  align-items: flex-start;      /* multi-line alignment */
}

.eri-token__text{
  white-space: normal;
  overflow-wrap: anywhere;      /* wrap even long strings */
  word-break: break-word;
  max-width: 100%;
}

/* Viewport: never grows, never shifts page */
#eri-dropzone {
  position: relative;
  height: 520px;       /* pick your intended canvas height */
  overflow: hidden;    /* critical to prevent layout creep */
}

/* World: this is what you zoom */
#eri-canvas-surface {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;  /* top-left */
}

/* ============================
   Print preview modal
   ============================ */
.eri-canvas-actions{
  display:flex;
  align-items:center;
  gap:.85rem;
  flex-wrap:wrap;
  margin:.85rem 0 .35rem 0;
}

.eri-canvas-actions__hint{
  opacity:.75;
}

.eri-modal{
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.eri-modal[hidden]{
  display:none;
}

.eri-modal__backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.45);
}

.eri-modal__panel{
  position: relative;
  width: min(980px, calc(100vw - 2rem));
  max-height: min(82vh, 820px);
  margin: 6vh auto;
  border-radius: 18px;
  background: rgba(255,255,255,.98);
  border: 1px solid rgba(0,0,0,.14);
  box-shadow: 0 24px 80px rgba(0,0,0,.35);
  overflow: hidden;
  display:flex;
  flex-direction:column;
}

.eri-modal__head{
  display:flex;
  justify-content:space-between;
  gap:1rem;
  padding: .95rem 1rem;
  border-bottom: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.92);
}

.eri-modal__title{
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom:.15rem;
}

.eri-modal__sub{
  margin:0;
}

.eri-modal__body{
  padding: 1rem;
  overflow:auto;
}

.eri-preview{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: .95rem;
  line-height: 1.55;
  white-space: pre-wrap;
  user-select: text;
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(245,245,245,.65);
}

.eri-modal__foot{
  display:flex;
  gap:.75rem;
  justify-content:flex-end;
  padding: .9rem 1rem 1rem 1rem;
  border-top: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.92);
}

@media print{
  .eri-modal__head,
  .eri-modal__foot{
    display:none !important;
  }
  .eri-modal__backdrop{
    display:none !important;
  }
  .eri-modal__panel{
    width: 100% !important;
    max-height: none !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
  }
  .eri-preview{
    border:none !important;
    background: transparent !important;
    padding: 0 !important;
  }
}

.eri-captured{
  margin-bottom: .8rem;
}
.eri-captured__list{
  display:flex;
  flex-wrap:wrap;
  gap:.5rem;
  margin-top:.35rem;
}
.eri-chip{
  display:inline-flex;
  align-items:center;
  gap:.5rem;
  max-width: 100%;
  padding:.45rem .6rem;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.14);
  background: rgba(255,255,255,.85);
}
.eri-chip__text{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  max-width: 520px;
  font-size:.85rem;
}
.eri-chip__x{
  border:none;
  background:transparent;
  cursor:pointer;
  font-size:1rem;
  line-height:1;
  opacity:.75;
}
.eri-chip__x:hover{ opacity:1; }

/* ============================
   Step locking (do NOT disable)
   ============================ */

/* Makes completed-step controls non-interactive but still submit */
.eri-locked {
  pointer-events: none;
  opacity: 0.78;
  filter: saturate(0.9);
}

/* Keep them looking "complete", not broken */
.eri-locked,
.eri-locked:focus,
.eri-locked:focus-visible {
  outline: none !important;
}

/* Optional: subtle "locked" feel on inputs inside a locked step */
.eri-step .eri-locked {
  background-color: rgba(255,255,255,0.70);
}

/* Optional: keep select arrow from looking weird when locked */
.eri-step select.eri-locked {
  background-color: rgba(255,255,255,0.70);
}
