/* =========================================================
   glossary-theater.css — Interactive Conceptual Atlas
   Governance by Signal
   ========================================================= */

[x-cloak] { display: none !important; }

/* ---------- Hero ---------- */
.gl-hero {
  background: linear-gradient(160deg, #1a5c57 0%, #133f3c 100%);
  color: #f4ebd6;
  padding: 5rem 1.5rem 3.5rem;
  text-align: center;
}
.gl-hero h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  margin: 0 0 0.5rem;
  color: #fff;
  font-weight: 600;
}
.gl-hero-master {
  font-style: italic;
  color: #d4a853;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  margin: 0.5rem auto 0.75rem;
  max-width: 720px;
}
.gl-hero-sub {
  color: #f4ebd6;
  opacity: 0.9;
  max-width: 720px;
  margin: 0.5rem auto 1.75rem;
  font-size: 1.02rem;
  line-height: 1.6;
}

/* ---------- Mode toggle ---------- */
.gl-mode {
  display: inline-flex;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(212,168,83,0.4);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
  margin: 0.5rem auto 0;
}
.gl-mode button {
  background: transparent;
  border: none;
  color: #f4ebd6;
  padding: 0.55rem 1.2rem;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.gl-mode button:hover { color: #d4a853; }
.gl-mode button.is-active {
  background: #d4a853;
  color: #1a3d3a;
}
.gl-mode-caption {
  margin: 1rem auto 0;
  max-width: 620px;
  color: #f4ebd6;
  font-size: 0.92rem;
  opacity: 0.85;
  line-height: 1.55;
  padding: 0 1rem;
}
.gl-mode-caption strong { color: #d4a853; }

/* ---------- Explore controls ---------- */
.gl-controls {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid #e8e3db;
  padding: 1rem 1.25rem;
}
.gl-controls-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.gl-search {
  flex: 1 1 260px;
  min-width: 220px;
  position: relative;
}
.gl-search input {
  width: 100%;
  border: 1px solid #d8d1c1;
  border-radius: 10px;
  padding: 0.7rem 1rem 0.7rem 2.4rem;
  font-size: 0.98rem;
  font-family: inherit;
  background: #fff;
  color: #1a3d3a;
  transition: border-color 0.15s;
}
.gl-search input:focus {
  outline: none;
  border-color: #1a5c57;
  box-shadow: 0 0 0 3px rgba(26,92,87,0.12);
}
.gl-search::before {
  content: '⌕';
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: #7a8a88;
  font-size: 1.1rem;
}
.gl-count {
  font-size: 0.85rem;
  color: #6a6458;
  font-weight: 500;
  white-space: nowrap;
}
.gl-sort {
  border: 1px solid #d8d1c1;
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  font-size: 0.9rem;
  background: #fff;
  color: #1a3d3a;
  font-family: inherit;
  cursor: pointer;
}
.gl-sort:focus { outline: 2px solid #1a5c57; outline-offset: 1px; }

.gl-chips {
  max-width: 1200px;
  margin: 0.85rem auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.gl-chip {
  background: #f4ebd6;
  color: #1a5c57;
  border: 1px solid #e3d8b9;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.gl-chip:hover { background: #ecdfb8; }
.gl-chip.is-active {
  background: #1a5c57;
  color: #d4a853;
  border-color: #1a5c57;
}
.gl-chip-count {
  opacity: 0.7;
  font-weight: 500;
  margin-left: 0.3rem;
}

/* ---------- Page body layout ---------- */
.gl-body {
  max-width: 1200px;
  margin: 2.5rem auto;
  padding: 0 1.25rem;
}
.gl-section-intro {
  max-width: 760px;
  margin: 0 auto 2rem;
  text-align: center;
}
.gl-section-intro h2 {
  font-family: 'Fraunces', Georgia, serif;
  color: #1a5c57;
  font-size: 1.9rem;
  margin: 0 0 0.5rem;
}
.gl-section-intro p {
  color: #4a4a4a;
  font-size: 1.02rem;
  line-height: 1.65;
  margin: 0;
}

/* ---------- Cluster headers (Atlas mode) ---------- */
.gl-cluster {
  margin-top: 2.5rem;
}
.gl-cluster:first-of-type { margin-top: 0; }
.gl-cluster-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid #d4a853;
}
.gl-cluster-header h3 {
  font-family: 'Fraunces', Georgia, serif;
  color: #1a5c57;
  font-size: 1.45rem;
  margin: 0;
}
.gl-cluster-header .gl-cluster-sub {
  color: #7a6f5a;
  font-size: 0.92rem;
  font-style: italic;
}

/* ---------- Term grid ---------- */
.gl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.1rem;
  align-items: start;          /* cards size to their own content; expanded ones don't stretch siblings */
  grid-auto-rows: min-content;
}

/* ---------- Term card ---------- */
.gl-card {
  background: #fff;
  border: 1px solid #e8e3db;
  border-radius: 12px;
  padding: 1.1rem 1.2rem;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  /* No min-height: each card sizes to its own content so expanded siblings don't stretch closed ones. */
  align-self: start;
}
.gl-card:hover {
  border-color: #1a5c57;
  box-shadow: 0 8px 24px rgba(26,92,87,0.08);
  transform: translateY(-1px);
}
.gl-card.is-expanded {
  border-color: #d4a853;
  box-shadow: 0 10px 30px rgba(212,168,83,0.18);
}
.gl-card-tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #d4a853;
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.gl-card h4 {
  font-family: 'Fraunces', Georgia, serif;
  color: #1a5c57;
  font-size: 1.22rem;
  margin: 0 0 0.5rem;
  line-height: 1.25;
}
.gl-card-def {
  color: #3d3d3d;
  font-size: 0.94rem;
  line-height: 1.55;
  margin: 0;
}
.gl-card-chev {
  align-self: flex-end;
  color: #1a5c57;
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 0.75rem;
}

/* ---------- Expanded detail body ---------- */
.gl-card-body {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px dashed #d8d1c1;
  display: grid;
  gap: 0.8rem;
}
.gl-field {
  font-size: 0.9rem;
  line-height: 1.55;
}
.gl-field-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #1a5c57;
  font-weight: 700;
  margin-bottom: 0.15rem;
}
.gl-field-body { color: #3d3d3d; }
.gl-field.gl-cue {
  background: #fff8e6;
  border-left: 3px solid #d4a853;
  padding: 0.55rem 0.75rem;
  border-radius: 0 6px 6px 0;
}
.gl-field.gl-cue .gl-field-label { color: #b58a3a; }
.gl-field.gl-cue .gl-field-body { color: #5a4a1f; font-style: italic; }

.gl-related {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.2rem;
}
.gl-related-pill {
  background: #eef5f4;
  color: #1a5c57;
  border: 1px solid #c9dedc;
  border-radius: 999px;
  padding: 0.22rem 0.65rem;
  font-size: 0.78rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s;
}
.gl-related-pill:hover {
  background: #1a5c57;
  color: #d4a853;
  border-color: #1a5c57;
}

.gl-context-btn {
  background: transparent;
  border: 1px solid #d8d1c1;
  color: #1a5c57;
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.25rem;
  align-self: flex-start;
}
.gl-context-btn:hover { background: #f4ebd6; }
.gl-context-note {
  background: #f8f4ea;
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  font-size: 0.88rem;
  color: #4a4a4a;
  line-height: 1.55;
  margin-top: 0.25rem;
}

/* ---------- Pattern card (Pattern Lab mode) ---------- */
.gl-pattern-card {
  background: #fff;
  border: 1px solid #e8e3db;
  border-radius: 14px;
  padding: 1.3rem 1.35rem;
  transition: all 0.18s;
}
.gl-pattern-card:hover { border-color: #8b3a3a; box-shadow: 0 8px 24px rgba(139,58,58,0.1); }
.gl-pattern-card .gl-card-tag { color: #8b3a3a; }
.gl-pattern-card h4 { color: #8b3a3a; }
.gl-pattern-toggle {
  display: inline-flex;
  margin: 0.85rem 0 0.6rem;
  background: #f4ebd6;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.gl-pattern-toggle button {
  background: transparent;
  border: none;
  padding: 0.4rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #6a6458;
  border-radius: 6px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.gl-pattern-toggle button.is-active {
  background: #1a5c57;
  color: #d4a853;
}
.gl-pattern-body {
  margin-top: 0.5rem;
  display: grid;
  gap: 0.75rem;
}
.gl-pattern-scenario {
  background: #fdf6f6;
  border-left: 3px solid #8b3a3a;
  padding: 0.7rem 0.9rem;
  border-radius: 0 8px 8px 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #3d3d3d;
}
.gl-pattern-scenario.is-correction {
  background: #f1f7f1;
  border-left-color: #2d7a4f;
}
.gl-pattern-scenario strong {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #8b3a3a;
  margin-bottom: 0.25rem;
  font-weight: 700;
}
.gl-pattern-scenario.is-correction strong { color: #2d7a4f; }

.gl-pattern-cue {
  background: #fff8e6;
  border-left: 3px solid #d4a853;
  padding: 0.55rem 0.8rem;
  border-radius: 0 6px 6px 0;
  font-size: 0.86rem;
  font-style: italic;
  color: #5a4a1f;
}
.gl-pattern-cue::before {
  content: '⚐ Notice this pattern if: ';
  font-style: normal;
  font-weight: 700;
  color: #b58a3a;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  display: block;
  margin-bottom: 0.2rem;
}

/* ---------- How to use section ---------- */
.gl-practice {
  background: #1a3d3a;
  color: #f4ebd6;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  margin-top: 3rem;
}
.gl-practice h2 {
  color: #d4a853;
  font-family: 'Fraunces', Georgia, serif;
  text-align: center;
  font-size: 1.75rem;
  margin: 0 0 0.5rem;
}
.gl-practice-sub {
  text-align: center;
  color: #f4ebd6;
  opacity: 0.85;
  max-width: 620px;
  margin: 0 auto 2rem;
}
.gl-practice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.1rem;
}
.gl-practice-item {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(212,168,83,0.3);
  border-radius: 10px;
  padding: 1.1rem 1.2rem;
}
.gl-practice-item h4 {
  color: #d4a853;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 0.5rem;
}
.gl-practice-item p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #f4ebd6;
}

/* ---------- Empty state ---------- */
.gl-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: #7a6f5a;
  font-style: italic;
}

/* ---------- Pull quote ---------- */
.gl-pullquote {
  max-width: 780px;
  margin: 3rem auto;
  text-align: center;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.3rem;
  font-style: italic;
  color: #1a5c57;
  line-height: 1.55;
  padding: 0 1.5rem;
  border-left: 3px solid #d4a853;
  border-right: 3px solid #d4a853;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .gl-card, .gl-chip, .gl-related-pill, .gl-pattern-card { transition: none !important; }
  .gl-card:hover, .gl-pattern-card:hover { transform: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 700px) {
  .gl-hero { padding: 3rem 1rem 2.5rem; }
  .gl-body { margin: 1.5rem auto; padding: 0 1rem; }
  .gl-grid { grid-template-columns: 1fr; }
  .gl-controls { padding: 0.85rem 1rem; }
  .gl-practice { padding: 1.8rem 1.25rem; }
}

/* =========================================================
   START HERE — guided entry paths
   ========================================================= */
.gl-starthere {
  max-width: 1180px;
  margin: 2rem auto 0;
  padding: 0 1.5rem;
}
.gl-starthere-inner {
  background: #f6f2e8;
  border: 1px solid #e4dcc7;
  border-left: 4px solid #d4a22a;
  border-radius: 10px;
  padding: 1.6rem 1.75rem 1.9rem;
}
.gl-starthere-title {
  margin: 0 0 0.25rem 0;
  font-size: 1.35rem;
  color: #1a5c57;
  letter-spacing: 0.01em;
}
.gl-starthere-sub {
  margin: 0 0 1.1rem 0;
  color: #5a5342;
  font-size: 0.98rem;
}
.gl-starthere-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.gl-starthere-card {
  text-align: left;
  background: #ffffff;
  border: 1px solid #e4dcc7;
  border-radius: 8px;
  padding: 1rem 1.1rem 1.1rem;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
  font: inherit;
  color: inherit;
}
.gl-starthere-card:hover,
.gl-starthere-card:focus-visible {
  transform: translateY(-2px);
  border-color: #d4a22a;
  box-shadow: 0 4px 14px rgba(26, 92, 87, 0.08);
  outline: none;
}
.gl-starthere-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #9b7a14;
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.gl-starthere-card h3 {
  margin: 0 0 0.35rem 0;
  font-size: 1.05rem;
  color: #1a5c57;
  line-height: 1.3;
}
.gl-starthere-card p {
  margin: 0 0 0.55rem 0;
  font-size: 0.92rem;
  color: #4a4a4a;
  line-height: 1.45;
}
.gl-starthere-terms {
  display: block;
  font-size: 0.8rem;
  color: #6b6652;
  font-style: italic;
  line-height: 1.4;
}

/* =========================================================
   RELATIONS — grouped (depends / interrupts / enables)
   ========================================================= */
.gl-relations {
  margin-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.gl-relgroup { display: block; }
.gl-relgroup-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b6652;
  font-weight: 700;
  margin-bottom: 0.3rem;
}
.gl-related-pill.is-depends {
  background: #eef5f4;
  border-color: #bcd6d3;
  color: #1a5c57;
}
.gl-related-pill.is-depends:hover {
  background: #dcebe8;
  border-color: #1a5c57;
}
.gl-related-pill.is-interrupts {
  background: #fbeeee;
  border-color: #e9c5c1;
  color: #8b2a1e;
}
.gl-related-pill.is-interrupts:hover {
  background: #f5d9d5;
  border-color: #8b2a1e;
}
.gl-related-pill.is-enables {
  background: #fdf6e3;
  border-color: #ead9a8;
  color: #8a6a10;
}
.gl-related-pill.is-enables:hover {
  background: #f6ebc6;
  border-color: #8a6a10;
}

/* =========================================================
   PATTERN LAB — Sounds like & Smallest correction
   ========================================================= */
.gl-soundslike {
  margin-top: 0.75rem;
  padding: 0.7rem 0.9rem 0.75rem;
  background: #fffaf0;
  border-left: 3px solid #d4a22a;
  border-radius: 4px;
}
.gl-soundslike-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9b7a14;
  font-weight: 700;
  margin-bottom: 0.3rem;
}
.gl-soundslike ul {
  margin: 0;
  padding-left: 1rem;
  list-style: none;
}
.gl-soundslike li {
  font-style: italic;
  color: #5a4a1a;
  font-size: 0.92rem;
  line-height: 1.45;
  margin: 0.15rem 0;
  position: relative;
  padding-left: 0.5rem;
}
.gl-soundslike li::before {
  content: "–";
  position: absolute;
  left: -0.2rem;
  color: #c49a1a;
}
.gl-smallest {
  margin-top: 0.75rem;
  padding: 0.65rem 0.9rem;
  background: #eef5f4;
  border-left: 3px solid #1a5c57;
  border-radius: 4px;
  font-size: 0.93rem;
  line-height: 1.5;
  color: #1a4540;
}
.gl-smallest-label {
  display: inline;
  font-weight: 700;
  color: #1a5c57;
  margin-right: 0.35rem;
}
.gl-smallest-body { display: inline; }

/* =========================================================
   Curated filter banner (Start Here active state)
   ========================================================= */
.gl-curated {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: linear-gradient(90deg, #fff8e4 0%, #fdf3d1 100%);
  border: 1px solid #ead9a8;
  border-left: 5px solid #d4a22a;
  border-radius: 10px;
  padding: 0.95rem 1.2rem;
  margin: 0 0 1.25rem 0;
  box-shadow: 0 2px 10px rgba(212, 162, 42, 0.08);
}
.gl-curated-main {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.gl-curated-eyebrow {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  background: #d4a22a;
  padding: 0.22rem 0.55rem;
  border-radius: 4px;
  font-weight: 700;
}
.gl-curated-label {
  font-size: 1rem;
  color: #1a5c57;
  font-weight: 600;
}
.gl-curated-count {
  font-size: 0.85rem;
  color: #6b6652;
}
.gl-curated-clear {
  background: #fff;
  border: 1px solid #d4a22a;
  color: #9b7a14;
  border-radius: 20px;
  padding: 0.45rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.gl-curated-clear:hover {
  background: #d4a22a;
  color: #fff;
}

/* Start Here: active state + CTA */
.gl-starthere-card.is-active {
  border-color: #d4a22a;
  background: #fffaeb;
  box-shadow: 0 4px 16px rgba(212, 162, 42, 0.18);
}
.gl-starthere-cta {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #1a5c57;
  letter-spacing: 0.01em;
}
.gl-starthere-card:hover .gl-starthere-cta { color: #9b7a14; }

/* Surprise me button */
.gl-surprise {
  background: #fff;
  border: 1px solid #e4dcc7;
  color: #9b7a14;
  border-radius: 20px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.gl-surprise:hover {
  background: #fdf3d1;
  border-color: #d4a22a;
  color: #8a6a10;
  transform: translateY(-1px);
}

/* =========================================================
   FOCUS MODE — Pattern Lab relationship tracing
   ========================================================= */
#pattern-view.is-focusing .gl-pattern-card {
  transition: opacity 0.35s ease, transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}
#pattern-view.is-focusing .gl-pattern-card[data-focus-role="dim"] {
  opacity: 0.22;
  filter: grayscale(0.3);
  transform: scale(0.985);
}
#pattern-view.is-focusing .gl-pattern-card[data-focus-role="dim"]:hover {
  opacity: 0.55;
}

/* The focal card — bold teal glow */
.gl-pattern-card[data-focus-role="focus"] {
  border-color: #1a5c57 !important;
  box-shadow: 0 0 0 3px rgba(26, 92, 87, 0.22), 0 14px 36px rgba(26, 92, 87, 0.18);
  transform: translateY(-2px) scale(1.01);
  z-index: 2;
}
.gl-pattern-card[data-focus-role="focus"]::before {
  content: "● focus";
  position: absolute;
  top: 0.6rem;
  right: 0.9rem;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #1a5c57;
  font-weight: 700;
}
.gl-pattern-card { position: relative; }

/* Related roles — colored rings + small labels */
.gl-pattern-card[data-focus-role="depends"],
.gl-pattern-card[data-focus-role="interrupted-by"] {
  border-color: #8b2a1e !important;
  box-shadow: 0 0 0 2px rgba(139, 42, 30, 0.22), 0 6px 20px rgba(139, 42, 30, 0.08);
}
.gl-pattern-card[data-focus-role="interrupts"],
.gl-pattern-card[data-focus-role="depended-on-by"] {
  border-color: #d4a22a !important;
  box-shadow: 0 0 0 2px rgba(212, 162, 42, 0.28), 0 6px 20px rgba(212, 162, 42, 0.10);
}
.gl-pattern-card[data-focus-role="enables"],
.gl-pattern-card[data-focus-role="enabled-by"] {
  border-color: #1a5c57 !important;
  box-shadow: 0 0 0 2px rgba(26, 92, 87, 0.22), 0 6px 20px rgba(26, 92, 87, 0.08);
}

.gl-pattern-card[data-focus-role]:not([data-focus-role=""]):not([data-focus-role="dim"])::after {
  position: absolute;
  top: 0.6rem;
  right: 0.9rem;
  font-size: 0.62rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.18rem 0.45rem;
  border-radius: 3px;
  background: #fff;
  border: 1px solid currentColor;
}
.gl-pattern-card[data-focus-role="depends"]::after         { content: "depends on"; color: #8b2a1e; }
.gl-pattern-card[data-focus-role="interrupted-by"]::after  { content: "interrupted by"; color: #8b2a1e; }
.gl-pattern-card[data-focus-role="interrupts"]::after      { content: "interrupts"; color: #9b7a14; }
.gl-pattern-card[data-focus-role="depended-on-by"]::after  { content: "depended on by"; color: #9b7a14; }
.gl-pattern-card[data-focus-role="enables"]::after         { content: "enables"; color: #1a5c57; }
.gl-pattern-card[data-focus-role="enabled-by"]::after      { content: "enabled by"; color: #1a5c57; }

/* Trace button */
.gl-trace-btn {
  margin: 0.65rem 0 0.25rem;
  background: #fff;
  border: 1px dashed #bcd6d3;
  color: #1a5c57;
  border-radius: 18px;
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  align-self: flex-start;
}
.gl-trace-btn:hover {
  background: #eef5f4;
  border-style: solid;
  border-color: #1a5c57;
  transform: translateY(-1px);
}
.gl-pattern-card[data-focus-role="focus"] .gl-trace-btn {
  background: #1a5c57;
  border-color: #1a5c57;
  color: #fff;
  border-style: solid;
}

/* Focus banner */
.gl-focus-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: linear-gradient(90deg, #0f3f3b 0%, #1a5c57 100%);
  color: #fdf6e3;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin: 0 0 1.3rem 0;
  box-shadow: 0 6px 22px rgba(26, 92, 87, 0.25);
  animation: focusIn 0.35s ease;
  /* Stay visible while scrolling the Pattern Lab so the map is always at a glance. */
  position: sticky;
  top: var(--gl-focus-top, 120px);
  z-index: 15;
  max-height: calc(100vh - var(--gl-focus-top, 120px) - 24px);
  overflow-y: auto;
}
.gl-focus-banner.is-stuck,
.gl-focus-banner:not(:first-child) {
  box-shadow: 0 10px 28px rgba(26, 92, 87, 0.35), 0 2px 0 rgba(253, 246, 227, 0.15) inset;
}
@media (max-width: 720px) {
  .gl-focus-banner { top: var(--gl-focus-top, 180px); max-height: calc(100vh - 180px - 16px); }
}
@keyframes focusIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.gl-focus-main {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.gl-focus-eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: #d4a22a;
  color: #1a3d39;
  padding: 0.22rem 0.55rem;
  border-radius: 4px;
  font-weight: 700;
}
.gl-focus-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
}
.gl-focus-stats {
  font-size: 0.85rem;
  color: #d8e8e6;
}
.gl-focus-stats strong { color: #fdf6e3; }
.gl-focus-clear {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(253, 246, 227, 0.4);
  color: #fdf6e3;
  border-radius: 20px;
  padding: 0.45rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.gl-focus-clear:hover {
  background: rgba(255,255,255,0.18);
  border-color: #fdf6e3;
}

@media (prefers-reduced-motion: reduce) {
  .gl-focus-banner { animation: none; }
  #pattern-view.is-focusing .gl-pattern-card { transition: none; }
}

/* =========================================================
   FOCUS MODE — expanded banner with wires + sibling role
   ========================================================= */
.gl-focus-banner { flex-direction: column; align-items: stretch; padding: 0.55rem 0.9rem; }
.gl-focus-banner.is-expanded { padding: 0.55rem 0.9rem 1rem; }
.gl-focus-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0;
}
.gl-focus-banner.is-expanded .gl-focus-head { margin-bottom: 0.7rem; }
.gl-focus-main { flex: 1 1 auto; min-width: 0; }
.gl-focus-statline {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  align-items: center;
  margin-left: 0.15rem;
}
.gl-focus-stat {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: #d8e8e6;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(253,246,227,0.18);
  padding: 0.14rem 0.5rem;
  border-radius: 10px;
  white-space: nowrap;
}
.gl-focus-stat strong { color: #fdf6e3; font-weight: 700; margin-right: 0.2rem; }
.gl-focus-stat.is-sibling { background: rgba(212,162,42,0.18); border-color: rgba(212,162,42,0.55); color: #f4e3b5; }
.gl-focus-stat.is-sibling strong { color: #fff5d6; }

.gl-focus-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}
.gl-focus-mini {
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(253, 246, 227, 0.35);
  color: #fdf6e3;
  border-radius: 14px;
  padding: 0.3rem 0.7rem;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.gl-focus-mini:hover { background: rgba(255,255,255,0.2); border-color: #fdf6e3; }
.gl-focus-banner .gl-focus-clear {
  padding: 0.25rem 0.55rem;
  font-size: 0.85rem;
  line-height: 1;
  border-radius: 14px;
}
.gl-focus-banner.is-compact { max-height: none; overflow: visible; }
.gl-focus-title { font-size: 1.02rem; }
.gl-focus-eyebrow { font-size: 0.62rem; padding: 0.16rem 0.45rem; }
.gl-focus-wires {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.gl-focus-wire {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.gl-focus-wire-label {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.22rem 0.55rem;
  border-radius: 4px;
  flex-shrink: 0;
  min-width: 112px;
  text-align: center;
}
.gl-focus-wire-label.is-depends    { background: rgba(255,255,255,0.12); color: #f5d9d5; border: 1px solid rgba(245, 217, 213, 0.5); }
.gl-focus-wire-label.is-interrupts { background: rgba(255,255,255,0.12); color: #f5d9d5; border: 1px solid rgba(245, 217, 213, 0.5); }
.gl-focus-wire-label.is-enables    { background: rgba(255,255,255,0.12); color: #d8e8e6; border: 1px solid rgba(216, 232, 230, 0.5); }
.gl-focus-wire-label.is-sibling    { background: #d4a22a; color: #1a3d39; border: 1px solid #d4a22a; }

.gl-focus-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.gl-focus-pill {
  background: rgba(255,255,255,0.94);
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 0.35rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.gl-focus-pill.is-depends    { color: #8b2a1e; border-color: #e9c5c1; }
.gl-focus-pill.is-interrupts { color: #8b2a1e; border-color: #e9c5c1; }
.gl-focus-pill.is-enables    { color: #1a5c57; border-color: #bcd6d3; }
.gl-focus-pill.is-sibling    { color: #9b7a14; border-color: #ead9a8; background: #fffaeb; }
.gl-focus-pill:hover {
  transform: translateY(-1px);
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.gl-focus-hint {
  margin: 0.85rem 0 0 0;
  font-size: 0.8rem;
  color: #c8dcd9;
  font-style: italic;
  line-height: 1.45;
}

/* Sibling role on pattern cards — gold ring, the hidden web made visible */
.gl-pattern-card[data-focus-role="sibling"] {
  border-color: #d4a22a !important;
  box-shadow: 0 0 0 2px rgba(212, 162, 42, 0.32), 0 6px 22px rgba(212, 162, 42, 0.14);
  opacity: 1 !important;
  filter: none !important;
  transform: none !important;
}
.gl-pattern-card[data-focus-role="sibling"]::after {
  content: "shares wiring";
  position: absolute;
  top: 0.6rem;
  right: 0.9rem;
  font-size: 0.62rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.18rem 0.45rem;
  border-radius: 3px;
  background: #fffaeb;
  border: 1px solid #d4a22a;
  color: #9b7a14;
}
