/* ====================================================================
   Feature cards - shared across the v2 module pages (collection,
   curatorial, publishing, workflows, trust).

   Each card renders in the product's own component language (the
   collection primitives: soft radius, #e5e5e5 hairline, muted zinc
   tokens, lucide icons), dropped into the editorial broadsheet page the
   way a product screenshot is. All literal hex, mirroring
   apps/web/src/components/collection/primitives.tsx.
   ==================================================================== */

.cards.app {
  align-items: stretch;
}

/* Keep product-card interiors usable before the mobile breakpoint. */
@media (max-width: 1024px) {
  .cards.app.build,
  .cards.app.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .cards.app.build,
  .cards.app.four,
  .cards.app.two {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Pull a following feature row up toward the one above it. */
.chapter-tight {
  padding-top: 0;
}

.acard {
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
}
.acard.drop {
  border-style: dashed;
}
.acard h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #171717;
  line-height: 1.25;
}
.acard-desc {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.5;
  color: #525252;
}
.acard-foot {
  margin-top: auto;
  padding-top: 18px;
}
.acard-sep {
  height: 1px;
  border: 0;
  background: #ececec;
  margin: 0 0 16px;
}
.acard-ui {
  height: 210px;
  font-size: 13px;
}

/* Record rows / field list. */
.rec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.rec-name {
  font-size: 13px;
  font-weight: 600;
  color: #171717;
}
.app-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 6px;
  background: #f0f0f0;
  padding: 3px 8px;
  font-size: 11.5px;
  color: #525252;
  white-space: nowrap;
}
.rec-field {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid #f0f0f0;
}
.rec-field .k {
  color: #737373;
}
.rec-field .v {
  font-weight: 500;
  color: #262626;
  font-variant-numeric: tabular-nums;
}
.rec-suggest {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background: #fafafa;
}
.rec-suggest .lbl {
  font-size: 11.5px;
  color: #a3a3a3;
}
.rec-suggest .val {
  margin-top: 2px;
  font-weight: 500;
  color: #171717;
  font-variant-numeric: tabular-nums;
}
.rec-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

/* Buttons. */
.app-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: default;
}
.app-btn.primary {
  background: #171717;
  color: #fff;
}
.app-btn.ghost {
  border: 1px solid #e5e5e5;
  background: #fff;
  color: #404040;
}

/* Linked entity rows + authority badges. */
.link-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background: #fff;
}
.link-row + .link-row {
  margin-top: 8px;
}
.link-tile {
  flex: none;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #f5f5f5;
  color: #737373;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.link-main {
  flex: 1;
  min-width: 0;
}
.link-name {
  font-size: 13px;
  font-weight: 600;
  color: #171717;
  line-height: 1.3;
}
.link-sub {
  font-size: 12px;
  color: #737373;
  line-height: 1.3;
}
.auth-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.auth-row .app-badge b {
  font-weight: 600;
  color: #a3a3a3;
}

/* Search input + result matches. */
.app-input {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background: #fff;
  color: #737373;
}
.app-input svg {
  flex: none;
  width: 15px;
  height: 15px;
}
.app-input .q {
  color: #171717;
  font-size: 13px;
}
.app-input .caret {
  width: 1px;
  height: 15px;
  background: #171717;
  margin-left: -3px;
}
.match-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}
.match-row:last-child {
  border-bottom: 0;
}
.match-thumb {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 4px;
  border: 1px solid #e5e5e5;
  background: repeating-linear-gradient(
    45deg,
    #efefef,
    #efefef 2px,
    #f7f7f7 2px,
    #f7f7f7 5px
  );
}
.match-name {
  font-size: 13px;
  font-weight: 500;
  color: #262626;
  line-height: 1.3;
}
.match-why {
  font-size: 12px;
  color: #a3a3a3;
  line-height: 1.3;
}
.match-why b {
  font-weight: 600;
  color: #525252;
}

/* Dashed dropzone holding accepted formats. */
.dropzone {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  height: 100%;
  padding: 16px;
  border: 1px dashed #d4d4d4;
  border-radius: 10px;
  background: #fafafa;
}
.fmt-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fmt {
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11.5px;
  color: #737373;
  background: #fff;
}
.drop-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #171717;
}
.drop-cta svg {
  width: 15px;
  height: 15px;
}

/* Header action button with a hovering cursor. */
.research-wrap {
  position: relative;
  display: inline-flex;
}
.research-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  background: #171717;
  color: #fff;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 500;
}
.research-btn svg {
  width: 13px;
  height: 13px;
}
.cursor {
  position: absolute;
  right: -7px;
  bottom: -9px;
  width: 16px;
  height: 16px;
  pointer-events: none;
  filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.28));
}

/* Object / asset rows with a status tick. */
.obj-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}
.obj-row:last-child {
  border-bottom: 0;
}
.obj-tile {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 5px;
  border: 1px solid #e5e5e5;
  background: repeating-linear-gradient(
    45deg,
    #efefef,
    #efefef 2px,
    #f7f7f7 2px,
    #f7f7f7 5px
  );
}
.obj-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
  color: #262626;
}
.obj-check {
  flex: none;
  display: flex;
  color: #16a34a;
}
.obj-check.pending {
  color: #c4c4c4;
}
.obj-check svg {
  width: 16px;
  height: 16px;
}

/* Node graph (light, product tokens). */
.connect-graph {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.connect-graph svg {
  width: 100%;
  height: 100%;
  display: block;
}
.connect-graph .wire {
  fill: none;
  stroke: #e0e0e0;
  stroke-width: 1.4;
}
.connect-graph .stub {
  fill: #fff;
  stroke: #d4d4d4;
  stroke-width: 1.2;
}
.connect-graph .ring {
  fill: #fff;
  stroke: #d4d4d4;
  stroke-width: 2;
}
.connect-graph .pill rect {
  fill: none;
  stroke: #e5e5e5;
  stroke-width: 1;
}
.connect-graph .pill text {
  fill: #a3a3a3;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
}
.connect-graph .pill.active rect {
  fill: #fff;
  stroke: #171717;
}
.connect-graph .pill.active text {
  fill: #171717;
}

/* Segmented control + instance panel. */
.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid #e5e5e5;
  border-radius: 9px;
  background: #f5f5f5;
}
.seg span {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: #737373;
}
.seg span.on {
  background: #fff;
  color: #171717;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.host-panel {
  margin-top: 14px;
}

/* Export / target rows. */
.exp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background: #fff;
}
.exp-row + .exp-row {
  margin-top: 8px;
}
.exp-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
  color: #262626;
}
.exp-type {
  font-size: 11.5px;
  color: #a3a3a3;
}
.exp-dl {
  flex: none;
  display: flex;
  color: #737373;
}
.exp-dl svg {
  width: 15px;
  height: 15px;
}

/* Change-history timeline. */
.hist {
  position: relative;
}
.hist::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 14px;
  bottom: 40px;
  width: 1px;
  background: #e5e5e5;
}
.hist-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 6px 0;
}
.hist-dot {
  flex: none;
  margin-top: 3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid #d4d4d4;
  background: #fff;
}
.hist-dot.on {
  border-color: #171717;
  background: #171717;
}
.hist-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.hist-val {
  font-size: 13px;
  font-weight: 500;
  color: #262626;
  font-variant-numeric: tabular-nums;
}
.hist-meta {
  font-size: 11.5px;
  color: #a3a3a3;
  white-space: nowrap;
}
.hist-actions {
  margin-top: 10px;
  padding-left: 21px;
}

/* Connected materials - a scattered mess that gets cleaned up into piles
   and connected. Light adaptation of the doc-piles idea: absolutely
   positioned card divs moved by JS with a CSS transition, lifecycle glow
   via class, connectors on an SVG overlay. */
.cem-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.cem-links {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.cem-links line {
  stroke: #171717;
  stroke-width: 0.5;
  stroke-opacity: 0;
  transition: stroke-opacity 0.55s ease;
}
.cem-links line.on {
  stroke-opacity: 0.24;
}
.cem-links circle {
  fill: none;
  stroke: #16a34a;
  stroke-width: 0.6;
  opacity: 0;
}
.cem-links circle.flash {
  animation: cemPulse 0.85s ease-out;
}
@keyframes cemPulse {
  0% {
    r: 0;
    opacity: 0.85;
  }
  70% {
    r: 5;
    opacity: 0.4;
  }
  100% {
    r: 10;
    opacity: 0;
  }
}
.cem-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26px;
  height: 42px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transform: translate(-50%, -50%);
  transition: left 0.75s cubic-bezier(0.16, 1, 0.3, 1),
    top 0.75s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.75s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.45s ease;
  will-change: left, top, transform;
}
.cem-card.linked {
  box-shadow: 0 0 0 1.5px rgba(22, 163, 74, 0.5), 0 2px 8px rgba(0, 0, 0, 0.12);
}
.cem-tile {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: #f0f0f0;
  color: #737373;
  font-size: 5.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cem-line {
  height: 2px;
  border-radius: 1px;
  background: #ececec;
}
.cem-line.s {
  width: 70%;
}
.cem-label {
  position: absolute;
  transform: translateX(-50%);
  font-size: 10.5px;
  font-weight: 600;
  color: #525252;
  background: #f0f0f0;
  border-radius: 6px;
  padding: 2px 8px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.cem-label.on {
  opacity: 1;
}

/* Source caption above a node-graph hub (e.g. Curatorial → audiences). */
.connect-graph text.cap {
  fill: #737373;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  font-family: inherit;
}

/* ---- Publishing surfaces ------------------------------------------- */

/* Browsable thumbnail grid (online collection). */
.tgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 58px;
  gap: 7px;
}
.tgrid .cell {
  border-radius: 5px;
  border: 1px solid #e5e5e5;
  background: repeating-linear-gradient(
    45deg,
    #efefef,
    #efefef 2px,
    #f7f7f7 2px,
    #f7f7f7 6px
  );
}

/* Browser frame (exhibition site preview). */
.bframe {
  display: flex;
  flex-direction: column;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.bframe-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border-bottom: 1px solid #f0f0f0;
  background: #fafafa;
}
.bframe-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e0e0e0;
}
.bframe-url {
  margin-left: 6px;
  flex: 1;
  height: 16px;
  border-radius: 4px;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 9.5px;
  color: #a3a3a3;
}
.bframe-hero {
  height: 82px;
  background: repeating-linear-gradient(
    45deg,
    #ececec,
    #ececec 3px,
    #f6f6f6 3px,
    #f6f6f6 8px
  );
}
.bframe-cap {
  padding: 11px 13px;
}
.bframe-title {
  font-size: 13px;
  font-weight: 600;
  color: #171717;
}
.bframe-line {
  margin-top: 7px;
  height: 6px;
  border-radius: 3px;
  background: #ececec;
}
.bframe-line.s {
  width: 68%;
}

/* Chat bubbles (conversational assistant). */
.chat {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bubble {
  max-width: 86%;
  padding: 8px 10px;
  border-radius: 11px;
  font-size: 12px;
  line-height: 1.4;
}
.bubble.q {
  align-self: flex-end;
  background: #171717;
  color: #fff;
  border-bottom-right-radius: 3px;
}
.bubble.a {
  align-self: flex-start;
  background: #f5f5f5;
  color: #262626;
  border-bottom-left-radius: 3px;
}
.cite {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  font-size: 10px;
  color: #737373;
  border: 1px solid #e5e5e5;
  border-radius: 5px;
  padding: 2px 7px;
  background: #fff;
}
.cite b {
  color: #171717;
  font-weight: 600;
}

/* Audio player (generative audio guides). */
.player {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background: #fff;
}
.player-btn {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #171717;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.player-btn svg {
  width: 12px;
  height: 12px;
}
.wave {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 26px;
}
.wave i {
  flex: 1;
  background: #d4d4d4;
  border-radius: 1px;
}
.wave i.on {
  background: #171717;
}

/* Meter / poll bars (audience apps). */
.meter {
  margin-top: 10px;
}
.meter:first-child {
  margin-top: 0;
}
.meter-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
  font-size: 12px;
  color: #262626;
}
.meter-top .pct {
  color: #737373;
  font-variant-numeric: tabular-nums;
}
.meter-track {
  height: 7px;
  border-radius: 4px;
  background: #f0f0f0;
  overflow: hidden;
}
.meter-fill {
  height: 100%;
  background: #171717;
  border-radius: 4px;
}

/* Language list (multilingual). */
.lang-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid #f0f0f0;
}
.lang-row:last-child {
  border-bottom: 0;
}
.lang-code {
  flex: none;
  width: 26px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #737373;
}
.lang-text {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  color: #a3a3a3;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.lang-row.on .lang-code {
  color: #171717;
}
.lang-row.on .lang-text {
  color: #262626;
}

/* Column chart (audience analytics). */
.chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 132px;
}
.chart .col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  height: 100%;
}
.chart .bar {
  width: 100%;
  background: #e5e5e5;
  border-radius: 3px 3px 0 0;
}
.chart .col.hi .bar {
  background: #171717;
}
.chart .lbl {
  font-size: 10px;
  color: #737373;
}

/* ---- Workflows surfaces -------------------------------------------- */

/* Icons sitting inside a link-tile (segments, media types, etc.). */
.link-tile svg {
  width: 15px;
  height: 15px;
}

/* Before -> after change list (cleanup & normalization). */
.diff-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 12.5px;
}
.diff-row:last-child {
  border-bottom: 0;
}
.diff-before {
  color: #a3a3a3;
  text-decoration: line-through;
  text-decoration-color: #d4d4d4;
  white-space: nowrap;
}
.diff-arrow {
  flex: none;
  color: #c4c4c4;
}
.diff-after {
  color: #171717;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
