/* ==========================================================================
   DaedalMap catalog styles
   --------------------------------------------------------------------------
   The catalog browser (Packs, Feeds, Geometry, Projects index, storefront)
   and server-rendered entity profiles. Loaded after site.css on every page,
   so tokens and shared components come from there.
   ========================================================================== */

/* ==========================================================================
   17. CATALOG BROWSER
   --------------------------------------------------------------------------
   Shared archetype for every index-over-entities page: /packs, /feeds,
   /geometry, /research/projects. Structure is always the same - a filter bar,
   optional collapsible sections, and a responsive grid of entity cards.

   Page templates should contribute content, not chrome. If a page needs a
   visual variant, add a modifier here rather than a local <style> block.
   ========================================================================== */

/* Browser shell */
.catalog-browser {
  max-width: none;
  margin-top: 24px;
  padding: 0;
}

.catalog-library-body {
  margin-top: 20px;
  padding-inline: 2px;
}

/* Filter bar. Base is layout only; the two modifiers carry panel chrome. */
.catalog-bar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
}

.catalog-bar-panel {
  padding: 18px 22px 20px;
  border-top: 1px solid var(--line-soft);
  background: var(--bar-face);
}

.catalog-bar-boxed {
  padding: 18px 22px 20px;
  border: 1px solid rgba(116, 185, 224, 0.12);
  border-radius: 16px;
  background: var(--bar-face);
}

.catalog-search-wrap,
.catalog-filter-block {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}

.catalog-control-label {
  color: rgba(167, 191, 206, 0.58);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.catalog-search-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 46px;
  padding: 10px 15px;
  background: var(--input-face);
  border: 1px solid rgba(116, 185, 224, 0.22);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

.catalog-search-input::placeholder {
  color: rgba(140, 190, 230, 0.4);
}

.catalog-search-input:focus {
  border-color: rgba(110, 196, 255, 0.45);
}

/* Date range filter (/packs). Resolved server-side with the MCP coverage rule. */
.catalog-time-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.catalog-time-fields .catalog-search-input {
  width: 140px;
  flex: 0 1 140px;
}

.catalog-time-status {
  margin: 12px 2px 0;
  color: rgba(167, 191, 206, 0.8);
  font-size: 13px;
}

.catalog-time-status.is-error {
  color: #f0a58a;
}

.catalog-group-heading {
  grid-column: 1 / -1;
  margin: 12px 0 0;
  color: rgba(167, 191, 206, 0.7);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Category pills */
.catalog-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.catalog-pill {
  padding: 8px 15px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(116, 185, 224, 0.2);
  background: var(--pill-face);
  color: rgba(167, 191, 206, 0.78);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.catalog-pill:hover {
  border-color: rgba(110, 196, 255, 0.4);
  color: var(--blue-bright);
}

.catalog-pill.active {
  background: var(--blue-soft);
  border-color: var(--blue-line);
  color: var(--blue);
}

.catalog-pill-count {
  margin-left: 6px;
  color: currentColor;
  font-size: 0.9em;
  opacity: 0.58;
}

/* Collapsible section wrapper (details/summary) */
.catalog-section {
  margin-top: 20px;
  border: 1px solid rgba(116, 185, 224, 0.14);
  border-radius: 16px;
  overflow: hidden;
}

.catalog-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  background: var(--head-face);
  transition: background 0.12s;
}

.catalog-section-head::-webkit-details-marker {
  display: none;
}

.catalog-section-head:hover {
  background: var(--head-face-hover);
}

.catalog-section-label {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.catalog-section-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #d8eaf8;
}

.catalog-section-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.catalog-section-count {
  font-size: 11px;
  color: rgba(167, 191, 206, 0.5);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.catalog-section-toggle {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(140, 190, 230, 0.4);
  font-size: 12px;
  transition: transform 0.18s;
}

.catalog-section-toggle::before {
  content: "+";
  display: block;
  line-height: 1;
}

details[open] > .catalog-section-head .catalog-section-toggle::before {
  content: "-";
}

.catalog-section-body {
  padding: 20px;
  border-top: 1px solid var(--line-soft);
}

.crosswalk-family {
  margin-top: 12px;
}

.crosswalk-systems {
  margin: 0;
  padding-left: 1.25rem;
}

.crosswalk-system + .crosswalk-system {
  margin-top: 12px;
}

.crosswalk-system span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

.detail-crosswalks .crosswalk-system summary {
  color: var(--cyan);
  cursor: pointer;
  font-weight: 600;
}

.detail-crosswalks .crosswalk-system summary:hover,
.detail-crosswalks .crosswalk-system summary:focus-visible {
  text-decoration: underline;
}

.detail-crosswalks .crosswalk-system .detail-table-wrap {
  margin-top: 12px;
}

/* Card grid */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  position: relative;
  z-index: 1;
}

.catalog-grid-wide {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.catalog-loading {
  color: rgba(110, 196, 255, 0.4);
  font-size: 14px;
  grid-column: 1/-1;
}

.catalog-empty {
  grid-column: 1/-1;
  padding: 40px 0;
  text-align: center;
  color: rgba(140, 190, 230, 0.4);
  font-size: 14px;
}

/* Entity card */
.catalog-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  box-sizing: border-box;
  padding: 22px;
  background: var(--card-face);
  border: 1px solid var(--card-line);
  border-radius: var(--radius-md);
  box-shadow: var(--card-inset);
  overflow: hidden;
  position: relative;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.catalog-card[hidden] {
  display: none !important;
}

.catalog-card:hover,
.catalog-card:focus-within {
  transform: translateY(-2px);
  border-color: var(--card-line-hover);
  background: var(--card-face-hover);
}

/* Badges tucked into the card's top-right corner. Offsets match the card's own
   22px padding so the first badge shares a top edge with the title and the
   stack lines up with the card's right content edge - inset them further and
   the badges read as floating above a card that is taller than it needs to be. */
.catalog-card-badges {
  position: absolute;
  top: 22px;
  right: 22px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: calc(100% - 44px);
}

/* Stacked variant: one badge per line, right-aligned, filling from the top.
   Nothing is pinned to a slot, so a card carrying a single badge still sits
   at the top of the corner rather than below empty rows. */
.catalog-card-badges-stack {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: flex-end;
}

/* Stacked badges are read as words rather than codes, so they keep the casing
   they were written with - "Download", "Live", "MCP" - instead of being
   shouted. Inline chip rows elsewhere on a card stay uppercase. */
.catalog-card-badges-stack .catalog-badge {
  text-transform: none;
  letter-spacing: 0.04em;
}

/* Cards using the stack keep their text clear of the badge column instead of
   reserving headroom above it, so the stack costs no vertical space. */
.catalog-card-badged {
  --badge-gutter: 4.75rem;
}

.catalog-card-badged .catalog-card-header,
.catalog-card-badged .catalog-card-head,
.catalog-card-badged > .catalog-card-title,
.catalog-card-badged .catalog-source-row {
  padding-right: var(--badge-gutter);
}

.catalog-card-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
  min-height: 0;
}

.catalog-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.catalog-card-header {
  display: block;
}

/* Inline row of badges/chips inside a card body (not the footer) */
.catalog-chip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.catalog-card-title {
  margin: 0;
}

/* The card title link owns the whole-card hit area via ::before. Any other
   interactive element inside the card needs position/z-index above it -
   .catalog-card-main and the link classes below already do. */
.catalog-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.catalog-card-name-lg {
  font-size: 16px;
  text-transform: none;
  letter-spacing: 0.02em;
}

.catalog-card-name::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  z-index: 0;
}

/* The title link is the click target across a geometry country card. Its
   overlay sits above display-only rows, while footer links keep their own
   destinations. */
.catalog-card-clickable {
  cursor: pointer;
}

.catalog-card-clickable .catalog-card-name::before {
  z-index: 2;
}

.catalog-card-clickable .catalog-card-footer {
  z-index: 3;
}

.catalog-card-name:hover {
  color: var(--blue-bright);
}

.catalog-card-desc {
  margin: 0;
  font-size: 13px;
  color: rgba(167, 191, 206, 0.78);
  line-height: 1.5;
  flex: 1;
  position: relative;
  z-index: 1;
}

.catalog-card-desc-roomy {
  color: rgba(188, 211, 226, 0.72);
  line-height: 1.65;
}

/* Source attribution row */
.catalog-source-row {
  display: grid;
  gap: 4px;
  position: relative;
  z-index: 1;
}

.catalog-source-kicker {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(167, 191, 206, 0.5);
}

.catalog-source-link,
.catalog-source-label {
  color: var(--blue-text);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  overflow-wrap: anywhere;
  position: relative;
  z-index: 1;
}

.catalog-source-label {
  color: rgba(200, 232, 255, 0.86);
}

.catalog-source-link:hover {
  color: var(--blue-bright);
}

/* Key/value metadata rows inside a card */

.catalog-meta-row {
  display: grid;
  grid-template-columns: minmax(86px, 0.42fr) minmax(0, 1fr);
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}

.catalog-meta-row span {
  color: rgba(167, 191, 206, 0.48);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.catalog-meta-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: rgba(237, 244, 251, 0.84);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 500;
}

/* Card footer */
.catalog-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
  position: relative;
  z-index: 1;
}

.catalog-card-footer-split {
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: nowrap;
}

.catalog-card-meta-line {
  font-size: 11px;
  color: rgba(167, 191, 206, 0.56);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.catalog-card-link {
  margin-left: auto;
  font-size: 12px;
  color: var(--blue);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  position: relative;
  z-index: 1;
}

.catalog-card-link:hover {
  color: var(--blue-bright);
}

.catalog-card-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  margin-left: auto;
}

/* Badges. Base plus status modifiers shared across catalog surfaces. */
.catalog-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid rgba(116, 185, 224, 0.18);
}

.catalog-badge-sm {
  padding: 3px 8px;
  font-size: 9px;
  letter-spacing: 0.12em;
  pointer-events: auto;
}

.catalog-badge-good {
  color: #9ce7bd;
  background: rgba(96, 205, 151, 0.11);
  border-color: rgba(96, 205, 151, 0.28);
}

.catalog-badge-live {
  color: #a9f0ba;
  background: rgba(86, 214, 120, 0.1);
  border-color: rgba(86, 214, 120, 0.32);
}

/* Pack card surface tags: Explore orange, Research purple, Live green. */
.catalog-badge-explore {
  color: #ffc27a;
  background: rgba(214, 116, 28, 0.16);
  border-color: rgba(255, 160, 70, 0.42);
}

.catalog-badge-research {
  color: #d3bfff;
  background: rgba(163, 123, 255, 0.12);
  border-color: rgba(163, 123, 255, 0.32);
}

/* Same amber as the Modes/Data nav dropdown triggers. */
.catalog-badge-download {
  color: var(--amber);
  background: rgba(255, 190, 92, 0.14);
  border-color: rgba(255, 190, 92, 0.42);
}

.catalog-badge-neutral {
  color: rgba(200, 232, 255, 0.82);
  background: rgba(99, 185, 255, 0.08);
  border-color: rgba(99, 185, 255, 0.18);
}

.catalog-badge-info {
  background: var(--blue-soft);
  border-color: rgba(99, 185, 255, 0.3);
  color: #9fd7ff;
}

/* Stage badge the catalog deliberately does not surface */

.catalog-badge-soft {
  background: rgba(167, 191, 206, 0.08);
  border-color: rgba(167, 191, 206, 0.18);
  color: rgba(188, 211, 226, 0.78);
}

/* Purple - MCP publication on /packs, forecast feeds on /feeds. One rule so
   the two surfaces cannot drift to different purples. */
.catalog-badge-mcp,
.catalog-badge-forecast {
  color: #d3bfff;
  background: rgba(163, 123, 255, 0.12);
  border-color: rgba(163, 123, 255, 0.32);
}

.catalog-badge-quiet {
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(99, 185, 255, 0.88);
  background: var(--blue-faint);
  border-color: rgba(99, 185, 255, 0.14);
}

/* Inline action button used inside cards (routes into an app surface) */
.catalog-card-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(99, 185, 255, 0.52);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(99, 185, 255, 0.24), rgba(41, 111, 164, 0.22));
  box-shadow: inset 0 1px 0 rgba(220, 243, 255, 0.12), 0 5px 15px rgba(0, 0, 0, 0.14);
  color: #d7f0ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  z-index: 1;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.catalog-card-button:hover {
  background: linear-gradient(180deg, rgba(116, 205, 255, 0.34), rgba(48, 128, 189, 0.3));
  border-color: rgba(157, 224, 255, 0.76);
  color: #fff;
  transform: translateY(-1px);
}

/* Full-width promo link to a sibling catalog surface */
.catalog-crosslink {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
  padding: 22px 26px;
  background: var(--card-face);
  border: 1px solid rgba(116, 185, 224, 0.18);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}

.catalog-crosslink:hover {
  transform: translateY(-2px);
  border-color: rgba(116, 185, 224, 0.34);
  background: var(--card-face-hover);
}

.catalog-crosslink-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.catalog-crosslink-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(167, 191, 206, 0.6);
}

.catalog-crosslink-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

/* Marker hero: an unordered side rail used for compact orientation and proof. */
.catalog-marker-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(20rem, 0.95fr);
  gap: var(--sp-8);
  align-items: center;
  min-height: 20rem;
  padding-top: var(--sp-6);
  padding-bottom: var(--sp-8);
}

.catalog-marker-copy {
  max-width: 44rem;
  padding-top: var(--sp-12);
}

.catalog-marker-hero .catalog-marker-copy > .eyebrow {
  position: absolute;
  top: calc(var(--sp-8) + var(--sp-3));
  left: clamp(1.5rem, 5vw, 4rem);
  margin-bottom: 0;
}

.catalog-marker-panel {
  padding: var(--sp-2) 0 var(--sp-2) var(--sp-8);
}

.catalog-markers {
  display: grid;
}

.catalog-marker {
  display: grid;
  grid-template-columns: var(--sp-4) minmax(0, 1fr);
  gap: var(--sp-3);
  align-items: center;
  padding: var(--sp-3) 0;
}

.catalog-marker::before {
  content: "";
  width: var(--sp-4);
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--amber));
}

.catalog-marker + .catalog-marker {
  border-top: 1px solid var(--line-soft);
}

.catalog-marker p {
  margin: 0;
}

.catalog-marker strong,
.catalog-marker small {
  display: block;
}

.catalog-marker strong {
  color: var(--text-strong);
  font-size: var(--text-body);
  line-height: 1.3;
}

.catalog-marker small {
  margin-top: var(--sp-1);
  color: var(--muted);
  font-size: var(--text-label);
  line-height: 1.5;
}

.catalog-marker-link {
  grid-template-columns: var(--sp-4) minmax(0, 1fr) auto;
  margin-inline: calc(var(--sp-3) * -1);
  padding-inline: var(--sp-3);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 160ms ease, box-shadow 160ms ease;
}

.catalog-marker-link strong,
.catalog-marker-action {
  color: var(--cyan);
}

.catalog-marker-action {
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.catalog-marker-link:hover,
.catalog-marker-link:focus-visible {
  background: var(--cyan-soft);
  box-shadow: var(--glow-cyan);
  outline: none;
}

.catalog-marker-link:hover strong,
.catalog-marker-link:focus-visible strong {
  color: var(--text-strong);
}

.catalog-hero-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 34px;
}

/* Three-up reference link row below a catalog */

@media (max-width: 980px) {
  .catalog-marker-hero {
    grid-template-columns: 1fr;
  }

  .catalog-marker-panel {
    padding: var(--sp-6) 0 0;
    border-top: 1px solid var(--line-soft);
  }

  .catalog-hero-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .catalog-marker-hero .catalog-marker-copy > .eyebrow {
    left: var(--sp-6);
  }
}

@media (max-width: 860px) {
  

  .catalog-section-label {
    display: grid;
    gap: 6px;
  }
}

@media (max-width: 600px) {
  .catalog-hero-grid {
    grid-template-columns: 1fr;
  }

  .catalog-grid,
  .catalog-grid-wide {
    grid-template-columns: minmax(0, 1fr);
  }

  

  .catalog-section-head {
    padding: 14px 16px;
  }

  .catalog-section-body {
    padding: 14px;
  }

  .catalog-bar-panel,
  .catalog-bar-boxed {
    padding: 16px;
  }

  .catalog-meta-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (max-width: 430px) {
  .catalog-card-footer-split {
    align-items: stretch;
    flex-direction: column;
  }

  .catalog-card-actions {
    align-items: flex-start;
    margin-left: 0;
  }
}

/* ==========================================================================
   19. ENTITY PROFILE
   --------------------------------------------------------------------------
   Shared archetype for the detail page under any catalog surface:
   /packs/{id}, /feeds/{id}, /geometry/{id}.

   Structure is always the same - a hero with metadata tags and CTAs, a main
   column of document blocks, and a sticky sidebar of key/value facts. These
   pages exist to show the data, so the chrome stays quiet and identical
   across all three.

   Page templates contribute content, not chrome. New visual elements go here.
   ========================================================================== */

/* --- Metadata tags ------------------------------------------------------- */

.profile-tag {
  background: rgba(99, 185, 255, 0.1);
  border: 1px solid rgba(99, 185, 255, 0.2);
  color: var(--blue);
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 20px;
}

.profile-tag-ok {
  color: var(--status-live);
  background: rgba(43, 125, 95, 0.18);
  border-color: rgba(114, 225, 185, 0.28);
}

.profile-tag-warn {
  color: #ffcf6b;
  background: rgba(161, 106, 16, 0.2);
  border-color: rgba(255, 207, 107, 0.32);
}

.profile-tag-err {
  color: #ff9b8f;
  background: rgba(125, 47, 43, 0.18);
  border-color: rgba(255, 155, 143, 0.24);
}

/* --- Call-to-action buttons ---------------------------------------------- */

.profile-btn-alt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(99, 185, 255, 0.12);
  border: 1px solid rgba(99, 185, 255, 0.4);
  border-radius: 8px;
  color: var(--profile-link);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.profile-btn-alt:hover {
  background: rgba(99, 185, 255, 0.2);
  color: var(--profile-text-bright);
}

/* --- Sidebar cards ------------------------------------------------------- */

.profile-card {
  background: var(--profile-panel);
  border: 1px solid var(--profile-line);
  border-radius: 10px;
  padding: 16px 18px;
}

.profile-card h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--profile-label);
  margin: 0 0 6px;
}

.profile-grid {
  display: grid;
  gap: 10px;
}

.profile-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.profile-row > span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--profile-label);
}

.profile-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--blue);
  text-decoration: none;
}

.profile-link:hover {
  color: var(--profile-value);
}

/* --- Document blocks ----------------------------------------------------- */

.profile-block {
  background: var(--profile-panel-mid);
  border: 1px solid var(--profile-line);
  border-radius: 10px;
  padding: 18px 20px;
}

.profile-block h2,
.profile-block h3 {
  margin-top: 0;
}

/* --- Tables -------------------------------------------------------------- */

.profile-table-sub {
  margin-top: 4px;
  color: rgba(160, 210, 255, 0.52);
  font-size: 12px;
}

/* --- Snapshot stats ------------------------------------------------------ */

.profile-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.profile-stat {
  background: rgba(14, 38, 66, 0.55);
  border: 1px solid var(--profile-line);
  border-radius: 8px;
  padding: 14px 16px;
}

.profile-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--profile-label);
  margin-bottom: 6px;
}

.profile-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--profile-text-bright);
  line-height: 1.2;
}

.profile-stat-sub {
  font-size: 11px;
  color: rgba(160, 210, 255, 0.55);
  margin-top: 3px;
}

.profile-api-note {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--profile-line-soft);
  font-size: 12px;
  color: rgba(160, 210, 255, 0.6);
  line-height: 1.5;
}

.profile-api-note code {
  background: rgba(99, 185, 255, 0.08);
  border: 1px solid rgba(99, 185, 255, 0.14);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12px;
  color: var(--profile-link);
}

/* --- Profile variants ----------------------------------------------------
   Treatments that only one profile surface needs today, kept in the shared
   namespace so a second surface can adopt them without another copy-paste. */

/* ==========================================================================
   PORTRAIT MOBILE FLOW - catalog and profile rules
   ========================================================================== */

@media (max-width: 760px) {
  .catalog-marker-hero {
    min-height: 0;
    gap: var(--sp-5);
  }

  .catalog-marker-copy {
    padding-top: var(--sp-10);
  }

  .catalog-marker-panel {
    padding-top: var(--sp-4);
  }

  .catalog-marker-link {
    grid-template-columns: var(--sp-4) minmax(0, 1fr);
  }

  .catalog-marker-action {
    grid-column: 2;
    white-space: normal;
  }
}

@media (max-width: 600px) {
  .catalog-browser {
    margin-top: var(--sp-4);
  }

  .catalog-section-head {
    align-items: stretch;
    flex-direction: column;
    gap: var(--sp-2);
  }

  .catalog-section-meta {
    justify-content: space-between;
    width: 100%;
  }

  .catalog-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 8px 13px;
  }

  .catalog-card {
    min-height: 0;
    padding: 18px;
  }

  .catalog-card-badges,
  .catalog-card-badges-stack {
    position: static;
    max-width: none;
    flex-flow: row wrap;
    justify-content: flex-start;
    align-items: center;
  }

  .catalog-card-badged .catalog-card-header,
  .catalog-card-badged .catalog-card-head,
  .catalog-card-badged > .catalog-card-title,
  .catalog-card-badged .catalog-source-row {
    padding-right: 0;
  }

  .catalog-card-footer,
  .catalog-card-footer-split {
    align-items: stretch;
    flex-direction: column;
  }

  .catalog-card-link,
  .catalog-card-actions {
    align-items: flex-start;
    margin-left: 0;
  }

  .catalog-card-button {
    justify-content: center;
    min-height: 2.75rem;
    width: 100%;
  }

  .profile-card,
  .profile-block {
    padding: var(--sp-4);
  }

  .profile-row {
    grid-template-columns: 1fr;
    gap: 3px;
    padding-top: 10px;
    border-top: 1px solid var(--profile-line-soft);
  }

  .profile-row:first-child {
    padding-top: 0;
    border-top: 0;
  }

  .profile-stat-grid {
    grid-template-columns: 1fr;
  }
}
