/* Record card — specific styles for the atomic record object.
   Layout: photo on top, body below. Width is set by parent. */

.record-card {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--r-surface);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.record-card[data-safe="true"] {
  box-shadow: var(--shadow-card-soft);
  border-color: rgba(74, 84, 80, 0.22);
}

/* Photo */
.record-photo {
  position: relative;
  aspect-ratio: 5 / 3;
  background: var(--surface);
  overflow: hidden;
}
.record-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.record-photo-ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background-image: repeating-linear-gradient(
    135deg,
    rgba(21, 32, 26, 0.05) 0,
    rgba(21, 32, 26, 0.05) 1px,
    transparent 1px,
    transparent 10px
  ), var(--surface);
  color: var(--hint);
  font-size: 13px;
}

/* Verified seal on photo corner — teal, small. Only when verified+unchanged. */
.record-seal {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border-radius: 999px;
  padding: 4px;
  display: flex;
  box-shadow: 0 4px 12px rgba(21, 32, 26, 0.12);
}

/* Safe-read-only banner — bottom of photo, neutral grey, calm */
.record-safe-banner {
  position: absolute;
  left: 14px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  color: var(--grey-ink);
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(21, 32, 26, 0.08);
}

/* Body */
.record-body {
  padding: 22px 24px 22px;
}
.record-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--hint);
}
.record-meta-dot {
  color: var(--hint);
  font-size: 11px;
}

/* Kcal — the only normatively verified number. Shown with a real ± range. */
.record-kcal {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.record-kcal-num-wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
}
.record-cal-num {
  font-size: 38px;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.record-cal-pm {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-family: var(--serif);
  font-size: 18px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.005em;
}
.record-cal-pm-sym {
  font-size: 16px;
  margin-right: 1px;
  position: relative;
  top: -1px;
}
.record-cal-pm-v {
  font-size: 18px;
}
.record-cal-unit {
  font-size: 13.5px;
  color: var(--hint);
  font-family: var(--grotesk);
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-left: 1px;
}
.record-cls-pill {
  font-feature-settings: "ss01" on;
}
.record-cls-issuer {
  margin-left: 4px;
  font-weight: 400;
  opacity: 0.85;
}

/* Untrusted / unknown: number greyed, no ±, calmer baseline weight */
.record-card[data-safe="true"] .record-cal-num,
.record-card[data-source-class="unknown"] .record-cal-num {
  color: var(--grey-ink);
}

/* Macros — secondary tier. App-entered, NEVER verified by the protocol.
   Visually demoted and explicitly tagged so a verified seal cannot be
   misread as endorsing the macros. */
.record-macros {
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--r-medium);
}
.record-macros-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}
.record-macros-label {
  font-family: var(--grotesk);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--hint);
}
.record-macros-tag {
  font-family: var(--grotesk);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--hint);
  font-weight: 500;
  font-style: normal;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--hairline);
  white-space: nowrap;
}
.record-macros-row {
  display: flex;
  gap: 22px;
  align-items: baseline;
}
.macro {
  display: flex;
  align-items: baseline;
  gap: 7px;
}
.macro-letter {
  font-family: var(--grotesk);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: var(--hint);
}
.macro-g {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 400;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.macro-unit {
  font-family: var(--grotesk);
  font-size: 11px;
  font-weight: 500;
  color: var(--hint);
  margin-left: 1px;
}

/* Provenance */
.record-prov {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 22px;
}
.record-prov.compact {
  grid-template-columns: 1fr;
  gap: 10px;
}
.prov-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.prov-label {
  font-family: var(--grotesk);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hint);
  font-weight: 600;
}
.prov-value {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.prov-sub {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.35;
}

.pill-icon {
  display: inline-flex;
  align-items: center;
}

/* Technical details */
.record-tech-toggle {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: none;
  padding: 6px 0;
  color: var(--hint);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: 4px;
}
.record-tech-toggle:hover { color: var(--muted); }
.record-tech-chev { margin-left: 2px; opacity: 0.7; display: inline-flex; }

.record-tech {
  margin-top: 10px;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--r-medium);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tech-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  font-size: 12.5px;
}
.tech-k {
  color: var(--hint);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.tech-v {
  color: var(--muted);
  word-break: break-all;
}

@media (max-width: 480px) {
  .record-body { padding: 20px 20px; }
  .record-cal-num { font-size: 34px; }
  .record-macros-row { gap: 16px; }
  .record-prov { grid-template-columns: 1fr; gap: 12px; }
  .tech-row { grid-template-columns: 88px 1fr; }
}
