/* ============================================================
   result-embed.css — 仮面履歴パネル Kawaii スタイル
   ============================================================ */

#result-embed {
  margin: 0;
  padding: 16px;
  background: linear-gradient(160deg, #fff3f8 0%, #fce8f2 100%);
  color: #4a2d3c;
  font-family: "M PLUS Rounded 1c", "Noto Sans JP", system-ui, sans-serif;
  border-radius: 18px;
}

#result-embed p {
  color: inherit;
  margin: 0 0 6px;
}

#result-embed p:last-child {
  margin-bottom: 0;
}

/* ── セクション共通スタイル ── */
#result-embed .result-header,
#result-embed .result-section,
#result-embed .result-footer {
  background: rgba(255, 252, 254, 0.96);
  border: 1px solid rgba(255, 170, 210, 0.28);
  border-radius: 18px;
  padding: 16px;
  margin: 0 auto 14px;
  max-width: 960px;
  box-sizing: border-box;
  box-shadow: 0 8px 28px rgba(200, 120, 160, 0.1);
}

#result-embed a {
  color: #d05888;
  text-decoration: none;
}

#result-embed a:hover {
  text-decoration: underline;
}

/* ── ヘッダー ── */
#result-embed .result-header h1 {
  margin: 0 0 8px;
  font-size: 20px;
  font-family: inherit;
  font-weight: 800;
  background: linear-gradient(135deg, #4a2d3c, #8c3568);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#result-embed .result-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

#result-embed .result-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 170, 210, 0.3);
  background: linear-gradient(135deg, #fff6fa, #ffecf4);
  color: #5d394c;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

#result-embed .result-link:hover {
  border-color: #ff7aaa;
  color: #c44880;
  transform: translateY(-1px);
}

/* ── ユーザー情報 ── */
#result-embed .result-user-info .user-line {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 6px;
  font-size: 14px;
  margin: 4px 0;
}

#result-embed .label { color: #9d7888; }
#result-embed .value.small { font-size: 12px; color: #b09aaa; }

/* ── セクション見出し ── */
#result-embed .result-section h2 {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 7px;
}

#result-embed .result-section h2::before {
  content: "✦";
  font-size: 0.7em;
  color: #ff7aaa;
  flex-shrink: 0;
}

/* ── サマリーカード ── */
#result-embed .mask-summary,
#result-embed .history-card {
  background: linear-gradient(145deg, #fff8fb, #fff0f7);
  border: 1px solid rgba(255, 170, 210, 0.26);
  border-radius: 14px;
  padding: 12px;
}

#result-embed .mask-metrics { display: flex; gap: 16px; color: #9d7888; font-size: 14px; }
#result-embed .mask-names { font-weight: 700; font-size: 15px; margin-bottom: 6px; color: #4a2d3c; }
#result-embed .mask-rows { display: flex; flex-direction: column; gap: 8px; }

#result-embed .mask-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 170, 210, 0.22);
  background: linear-gradient(135deg, #fff5fa, #ffeef5);
  transition: transform 0.15s ease;
}

#result-embed .mask-row:hover {
  transform: translateX(3px);
}

#result-embed .mask-row-name { font-weight: 700; font-size: 15px; }
#result-embed .mask-row-metrics { display: flex; gap: 14px; color: #9d7888; font-size: 14px; white-space: nowrap; }
#result-embed .mask-row.placeholder { color: #b09aaa; justify-content: center; }

/* ── 履歴リスト ── */
#result-embed .history-list { display: flex; flex-direction: column; gap: 10px; }

#result-embed .history-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #9d7888;
}

#result-embed .history-date { font-weight: 700; color: #4a2d3c; }
#result-embed .history-row { margin: 6px 0; }
#result-embed .history-label { color: #9d7888; font-size: 13px; }
#result-embed .history-value { color: #5d394c; font-size: 14px; }
#result-embed .metric { margin-left: 8px; color: #9d7888; font-size: 12px; }
#result-embed .narrative-block { white-space: pre-wrap; line-height: 1.68; }

/* ── 履歴アクション ── */
#result-embed .history-actions {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

/* ── ネクストステップカード ── */
#result-embed .next-step-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 170, 210, 0.24);
  background: linear-gradient(145deg, #fff8fb, #fff0f6);
}

#result-embed .next-step-card + .next-step-card {
  margin-top: 10px;
}

#result-embed .next-step-actions {
  justify-content: flex-start;
  margin-top: 2px;
}

#result-embed .omokage-text { white-space: pre-wrap; line-height: 1.68; }

/* ── フッター ── */
#result-embed .result-footer { text-align: right; }

#result-embed button.back-btn {
  background: linear-gradient(135deg, #ff7aaa, #e0508a);
  color: #fff5f9;
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(224, 80, 138, 0.24);
  transition: transform 0.2s ease, filter 0.2s ease;
}

#result-embed button.back-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

/* ── 会話ログ ── */
#result-embed .conversation-log {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#result-embed .conversation-log .turn {
  background: linear-gradient(145deg, #fff8fb, #fff4f9);
  border: 1px solid rgba(255, 170, 210, 0.24);
  border-radius: 12px;
  padding: 10px 12px;
}

#result-embed .conversation-log .turn-meta {
  font-size: 12px;
  color: #9d7888;
  margin-bottom: 4px;
}

#result-embed .conversation-log .turn-body {
  white-space: pre-wrap;
  line-height: 1.6;
  font-size: 14px;
  color: #4a2d3c;
}

#result-embed .conversation-log .turn.user .turn-body {
  color: #c44870;
}

#result-embed .conversation-log .placeholder {
  color: #b09aaa;
  margin: 0;
}

/* ── レスポンシブ ── */
@media (max-width: 640px) {
  #result-embed .result-user-info .user-line { grid-template-columns: 1fr; }
  #result-embed .mask-metrics { flex-direction: column; gap: 6px; }
  #result-embed .mask-row { flex-direction: column; align-items: flex-start; }
  #result-embed .mask-row-metrics { white-space: normal; }
  #result-embed .history-card-header { flex-direction: column; align-items: flex-start; gap: 4px; }
}
