/* ── DETAIL PANEL CONTENT ── */

.back-btn {
  color: var(--accent-developing);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: opacity var(--transition);
}

.back-btn:hover { opacity: 0.7; }

.action-btn {
  background: var(--bg-input);
  border: none;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.action-btn:hover {
  background: var(--border);
  color: var(--text-primary);
}

.action-btn.primary {
  background: var(--accent-developing);
  color: #fff;
}

.action-btn.primary:hover {
  background: #005EC2;
}

.action-btn.danger {
  background: rgba(255,59,48,0.08);
  color: #C0392B;
  margin-left: auto;
}

.action-btn.danger:hover {
  background: rgba(255,59,48,0.15);
  color: #A93226;
}

/* ── PASSPORT ── */
.detail-wrap {
  padding: 0;
}

.passport {
  background: var(--bg-card);
}

/* passport header */
.pass-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 28px 28px 24px;
  border-bottom: 1px solid var(--border);
}

.pass-avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 24px;
  color: #fff;
  flex-shrink: 0;
}

.pass-name {
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.4px;
  color: var(--text-primary);
  line-height: 1.2;
}

.pass-tagline {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.pass-signal-badge {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  flex-shrink: 0;
}

.pass-signal-badge.early      { background: rgba(255,159,10,0.12); color: #C07600; }
.pass-signal-badge.developing { background: rgba(0,113,227,0.10); color: #0058B8; }
.pass-signal-badge.strong     { background: rgba(48,209,88,0.12); color: #1A8C3A; }

/* meta row */
.pass-meta-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.pass-meta-cell {
  padding: 16px 20px;
  border-right: 1px solid var(--border);
}

.pass-meta-cell:last-child { border-right: none; }

.pmc-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  text-transform: uppercase;
  margin-bottom: 5px;
}

.pmc-value {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
}

/* info table */
.info-table {
  border-bottom: 1px solid var(--border);
}

.info-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  border-bottom: 1px solid var(--border);
}

.info-row:last-child { border-bottom: none; }

.ir-key {
  padding: 14px 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  text-transform: uppercase;
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  background: var(--bg);
}

.ir-val {
  padding: 14px 20px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* metric dots */
.metric-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}

.metric-dot.green  { background: var(--accent-strong); }
.metric-dot.yellow { background: var(--accent-early); }
.metric-dot.red    { background: #FF3B30; }

/* scores block */
.scores-block {
  padding: 24px 24px 20px;
  border-bottom: 1px solid var(--border);
}

.scores-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  text-transform: uppercase;
  margin-bottom: 16px;
}

.scores-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.score-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.si-icon {
  font-size: 17px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.si-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  text-transform: uppercase;
}

.si-value {
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.3px;
  color: var(--text-primary);
  line-height: 1;
  margin-top: 2px;
}

.si-value span {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 400;
}

.si-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.si-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

/* alert blocks */
.alert-block {
  display: flex;
  gap: 14px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}

.ab-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-block.risk   .ab-icon { background: rgba(255,59,48,0.10); color: #FF3B30; }
.alert-block.why    .ab-icon { background: rgba(0,113,227,0.10); color: #0071E3; }
.alert-block.action .ab-icon { background: rgba(255,159,10,0.12); color: #C07600; }
.alert-block.notes  .ab-icon { background: var(--bg); color: var(--text-tertiary); border: 1px solid var(--border); }

.ab-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  text-transform: uppercase;
  margin-bottom: 5px;
}

.ab-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.ab-italic { font-style: italic; }

/* snapshot footer */
.snapshot {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.snap-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  text-transform: uppercase;
  white-space: nowrap;
}

.snap-scores {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.snap-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 12px;
  border-left: 2px solid var(--accent-developing);
}

.snap-item b {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.2px;
}

.snap-item span {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 500;
}

/* pass footer */
.pass-footer {
  display: flex;
  justify-content: space-between;
  padding: 16px 24px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.pass-footer b { color: var(--text-secondary); font-weight: 600; }

/* standalone detail page */
.detail-main { background: var(--bg); }

.detail-wrap.standalone {
  padding: 28px 32px;
  max-width: 840px;
}

.detail-wrap.standalone .passport {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

/* ════════════════════════════════════════
   MOBILE detail panel content (≤ 768px)
   ════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── passport header ── */
  .pass-header {
    padding: 20px 16px 18px;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .pass-avatar { width: 46px; height: 46px; font-size: 20px; border-radius: 12px; }
  .pass-name { font-size: 19px; }
  .pass-tagline { font-size: 12px; }
  .pass-signal-badge { font-size: 11px; padding: 5px 11px; }

  /* ── 4-col meta → 2×2 grid ── */
  .pass-meta-row { grid-template-columns: repeat(2, 1fr); }
  .pass-meta-cell { padding: 11px 14px; }
  .pass-meta-cell:nth-child(2)  { border-right: none; }
  .pass-meta-cell:nth-child(3)  { border-right: 1px solid var(--border); border-top: 1px solid var(--border); }
  .pass-meta-cell:nth-child(4)  { border-right: none; border-top: 1px solid var(--border); }

  /* ── action buttons ── */
  .pass-actions {
    padding: 10px 14px !important;
    flex-wrap: wrap;
    gap: 8px !important;
  }
  .pass-actions .action-btn { flex: 1; min-width: 80px; text-align: center; }

  /* ── info table: label stacks above value ── */
  .info-row { grid-template-columns: 1fr; }
  .ir-key {
    padding: 9px 16px 5px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    font-size: 10px;
  }
  .ir-val { padding: 8px 16px 14px; font-size: 13px; }

  /* ── scores: 4-col → 2×2 ── */
  .scores-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .scores-block { padding: 18px 14px; }
  .score-item { padding: 14px; }
  .si-icon { width: 30px; height: 30px; font-size: 15px; margin-bottom: 6px; }
  .si-value { font-size: 19px; }

  /* ── alert blocks ── */
  .alert-block { padding: 12px 16px; }
  .ab-icon { width: 30px; height: 30px; font-size: 14px; border-radius: 8px; }
  .ab-text { font-size: 13px; }

  /* ── snapshot row → column ── */
  .snapshot { flex-direction: column; gap: 12px; padding: 14px 16px; }
  .snap-scores { gap: 14px; flex-wrap: wrap; }
  .snap-item b { font-size: 13px; }
  .snap-item span { font-size: 10px; }

  /* ── footer ── */
  .pass-footer { padding: 12px 16px; font-size: 11px; }

  /* ── standalone page ── */
  .detail-wrap.standalone { padding: 12px; max-width: 100%; }
}
