/* ============================================================
   PIM page — product detail peek, attribute grid, lifecycle
============================================================ */

:root {
  --pim: #2F8F72;        /* deep sea-green for PIM */
  --pim-tint: color-mix(in srgb, #2F8F72 14%, transparent);
}

/* shared subnav */
.subnav {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 65px;
  z-index: 40;
}
.subnav-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 12px var(--pad-x);
  overflow-x: auto;
}
.subnav-eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.subnav-inner a {
  text-decoration: none;
  color: var(--muted);
  font-size: 13.5px;
  white-space: nowrap;
  padding: 4px 0;
}
.subnav-inner a:hover { color: var(--ink); }
.subnav-inner a.active {
  color: var(--ink);
  font-weight: 500;
  border-bottom: 1.5px solid var(--ink);
  padding-bottom: 2px;
}

.kicker.pim { background: var(--pim-tint); border-color: rgba(47,143,114,0.35); color: #7CC8AF; }
.kicker .dot.pim { background: var(--pim); box-shadow: 0 0 0 3px rgba(47,143,114,0.22); }
.hero-pim .display { font-size: clamp(54px, 8.6vw, 112px); line-height: 0.94; }

/* ============================================================
   HERO PEEK — 11-tab product detail view
============================================================ */
.pim-peek .peek-frame { max-width: 1180px; }

.pd-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-card);
  flex-wrap: wrap;
}
.pd-thumb {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2A2A26 0%, #1A1A17 100%);
  display: grid;
  place-items: center;
  color: rgba(255,255,255,0.85);
  font-family: var(--f-mono);
  font-size: 10px;
  flex-shrink: 0;
}
.pd-id { display: flex; flex-direction: column; gap: 2px; min-width: 180px; }
.pd-id b { font-size: 15px; font-weight: 600; letter-spacing: -0.015em; }
.pd-id span { font-size: 11.5px; color: var(--muted); }
.pd-spacer { flex: 1; }
.pd-ring {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.pd-ring i {
  width: 34px; height: 34px;
  border-radius: 50%;
  background:
    radial-gradient(closest-side, var(--bg-card) 74%, transparent 75% 100%),
    conic-gradient(var(--pim) 94%, rgba(var(--ink-rgb),0.10) 0);
  display: grid;
  place-items: center;
  font-family: var(--f-mono);
  font-size: 9px;
  font-style: normal;
  color: var(--ink);
}
.pd-ring span { font-size: 11.5px; color: var(--muted); }

.pd-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 14px 0;
  border-bottom: 1px solid var(--line);
  background: var(--bg-card);
  overflow-x: auto;
  scrollbar-width: none;
}
.pd-tabs::-webkit-scrollbar { display: none; }
.pd-tab {
  font-size: 12px;
  color: var(--muted);
  padding: 7px 11px;
  border-radius: 8px 8px 0 0;
  white-space: nowrap;
}
.pd-tab.active {
  color: var(--ink);
  font-weight: 500;
  background: var(--pim-tint);
  border-bottom: 2px solid var(--pim);
}

.pd-body {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 0;
  background: var(--bg-card);
}
.pd-form { padding: 18px; display: flex; flex-direction: column; gap: 9px; }
.pd-field {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  align-items: center;
  padding: 9px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 12.5px;
}
.pd-field span { color: var(--muted); }
.pd-field b { font-weight: 500; }
.pd-field .mono { font-size: 11.5px; }
.pd-langs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  padding-top: 4px;
}
.pd-langs i {
  font-style: normal;
  font-family: var(--f-mono);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(var(--ink-rgb),0.06);
}
.pd-langs i.on { background: var(--pim-tint); color: var(--pim); }

.pd-rail {
  border-left: 1px solid var(--line);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-soft);
}
.pd-rail-h {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.pd-ch { display: flex; flex-direction: column; gap: 5px; }
.pd-ch-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
}
.pd-ch-top span { display: inline-flex; align-items: center; gap: 8px; }
.pd-ch-top .mono { font-size: 11px; color: var(--muted); }
.pd-bar {
  height: 4px;
  border-radius: 2px;
  background: rgba(var(--ink-rgb),0.08);
  overflow: hidden;
}
.pd-bar > span { display: block; height: 100%; background: var(--pim); border-radius: 2px; }
.pd-bar > span.warn { background: var(--warn); }
.pd-warn {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 11.5px;
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent);
  border-radius: 8px;
  padding: 8px 10px;
  line-height: 1.45;
}

@media (max-width: 860px){
  .pd-body { grid-template-columns: 1fr; }
  .pd-rail { border-left: none; border-top: 1px solid var(--line); }
  .pd-field { grid-template-columns: 105px 1fr; }
}

/* ============================================================
   STAT STRIP
============================================================ */
.pim-trust { padding: 50px 0 30px; }
.trust-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(20px, 4vw, 60px);
  padding-top: 30px;
  border-top: 1px solid var(--line);
}
@media (max-width: 720px){ .trust-stats { grid-template-columns: 1fr 1fr; gap: 30px; } }
.ts { display: flex; flex-direction: column; gap: 6px; }
.ts b {
  font-weight: 500;
  font-size: clamp(34px, 4.2vw, 52px);
  letter-spacing: -0.035em;
  line-height: 1;
}
.ts span { font-size: 13.5px; color: var(--muted); }

/* ============================================================
   COMPLETENESS VISUAL
============================================================ */
.cmpl-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.cmpl-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 16px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.cmpl-h .mono { font-size: 11px; color: var(--muted); }
.cmpl-rows { padding: 6px 16px 12px; }
.cmpl-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.cmpl-row:last-child { border-bottom: none; }
.cmpl-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
}
.cmpl-top span { display: inline-flex; align-items: center; gap: 8px; }
.cmpl-top .mono { font-size: 11px; color: var(--muted); }
.cmpl-foot {
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================================
   ATTRIBUTE TYPES GRID
============================================================ */
.attr-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 980px){ .attr-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px){ .attr-grid { grid-template-columns: 1fr; } }
.attr-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.attr-card b { font-size: 14px; font-weight: 600; letter-spacing: -0.015em; }
.attr-card .mono { font-size: 10.5px; color: var(--muted); }
.attr-ex {
  margin-top: 4px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-mid);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attr-more {
  border-style: dashed;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* ============================================================
   VARIANTS VISUAL
============================================================ */
.vx-card {
  width: 100%;
  max-width: 430px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.vx-axes { display: flex; flex-direction: column; gap: 8px; }
.vx-axis {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 12px;
}
.vx-axis .mono { color: var(--muted); font-size: 10.5px; width: 52px; }
.vx-chip {
  font-family: var(--f-mono);
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}
.vx-chip.on { background: var(--pim-tint); border-color: rgba(47,143,114,0.35); color: var(--pim); }
.vx-arrow {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.vx-arrow::before, .vx-arrow::after {
  content: "";
  flex: 1;
  border-top: 1px dashed var(--line);
}
.vx-rows { display: flex; flex-direction: column; }
.vx-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 12.5px;
}
.vx-row:last-child { border-bottom: none; }
.vx-row .mono { font-size: 11px; color: var(--muted); }
.vx-row.dim { color: var(--muted); }

/* ============================================================
   LIFECYCLE + AUDIT (dark section)
============================================================ */
.lc-flow {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.lc-stage {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  color: rgba(255,255,255,0.65);
}
.lc-stage.on {
  background: rgba(110,210,122,0.14);
  border-color: rgba(110,210,122,0.4);
  color: #6ED27A;
}
.lc-arr { color: rgba(255,255,255,0.35); font-size: 12px; }

.audit-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  width: 100%;
  position: relative;
}
.audit-card::before {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,0.012) 0 2px, transparent 2px 6px);
  pointer-events: none;
}
.au-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid var(--line-light);
  position: relative;
}
.au-name { font-family: var(--f-mono); font-size: 12px; color: rgba(255,255,255,0.85); }
.au-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: #6ED27A;
}
.au-live i {
  width: 7px; height: 7px;
  background: #6ED27A;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(110,210,122,0.20);
  animation: pulse 1.4s ease-in-out infinite;
}
.au-row {
  display: grid;
  grid-template-columns: 74px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 11px 18px;
  border-bottom: 1px dashed rgba(255,255,255,0.06);
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  position: relative;
}
.au-row:last-child { border-bottom: none; }
.au-t { color: rgba(255,255,255,0.55); font-family: var(--f-mono); font-size: 11px; }
.au-what b { font-weight: 500; }
.au-what span { color: rgba(255,255,255,0.55); }
.au-tag {
  font-family: var(--f-mono);
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
}
.au-tag.pub { background: rgba(110,210,122,0.15); color: #6ED27A; }
.au-tag.roll { background: rgba(217,119,87,0.2); color: #E8A088; }
@media (max-width: 720px){
  .au-row { grid-template-columns: 1fr auto; }
  .au-row .au-t { display: none; }
}

/* ============================================================
   IMPORT MAPPING VISUAL
============================================================ */
.imp-card {
  width: 100%;
  max-width: 430px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.imp-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 9px;
  align-items: center;
}
.imp-src, .imp-dst {
  font-family: var(--f-mono);
  font-size: 11px;
  padding: 8px 10px;
  border-radius: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.imp-src { background: var(--bg-soft); border: 1px solid var(--line); color: var(--muted); }
.imp-dst { background: var(--pim-tint); border: 1px solid rgba(47,143,114,0.3); color: var(--pim); }
.imp-arr { color: var(--pim); font-size: 12px; }
.imp-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

/* light tick variant */
.tick.light li { color: rgba(255,255,255,0.78); }
.tick.light li::before { background: var(--bg-card); }
.tick.light li::after { border-color: var(--ink); }

/* ============================================================
   COMPARE
============================================================ */
.compare-table { padding: 0; overflow: hidden; }
.cmp-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.cmp-row:last-child { border-bottom: none; }
.cmp-row > span { display: inline-flex; align-items: center; gap: 8px; }
.cmp-row .hl {
  background: rgba(var(--ink-rgb),0.04);
  margin: -16px 0;
  padding: 16px 14px;
  font-weight: 500;
}
.cmp-row.cmp-head {
  background: var(--bg-soft);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 14px 24px;
}
.cmp-row.cmp-head .hl {
  background: var(--ink);
  color: var(--bg);
  margin: -14px 0;
  padding: 14px 14px;
}
.cmp-row .dim { color: var(--muted-2); }
.cmp-row .dim.partial { color: var(--warn); }
.cmp-row .dt { width: 9px; height: 9px; }
.cmp-foot {
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
  margin: 32px auto 0;
  max-width: 720px;
}
@media (max-width: 720px){
  .cmp-row { grid-template-columns: 1.4fr 1fr 1fr 1fr; padding: 12px 14px; font-size: 12.5px; }
  .cmp-row.cmp-head { padding: 12px 14px; }
  .cmp-row .hl { padding: 12px 8px; margin: -12px 0; }
}

.foot-cols a.on { color: #fff; }

/* ── White mode (html[data-theme="light"]) overrides ── */
html[data-theme="light"] {
  --pim-tint: #E4F2EC;
}
html[data-theme="light"] .kicker.pim {
  border-color: rgba(47,143,114,0.22);
  color: #1C5943;
}
html[data-theme="light"] .pd-thumb { background: linear-gradient(135deg, #E8EDE9 0%, #D7E2DB 100%); color: #1C5943; }
