/* ============================================================
   AI Fan Growth Intelligence — Design System
   白基調 / ネイビー文字 / AI:ブルー→パープル / ファン:ティール / 成長:コーラル
   ============================================================ */

:root {
  --bg: #f7f8fb;
  --bg-white: #ffffff;
  --ink: #1b2a4a;
  --ink-soft: #4a5878;
  --ink-mute: #7c88a3;
  --line: #e4e8f0;
  --ai-grad: linear-gradient(135deg, #3b6ef5 0%, #7c4df0 100%);
  --ai-blue: #3b6ef5;
  --ai-purple: #7c4df0;
  --fan: #0eae95;
  --fan-soft: #e2f6f2;
  --growth: #f2703c;
  --growth-soft: #feefe8;
  --risk: #d94848;
  --risk-soft: #fdecec;
  --blue-soft: #ecf1fe;
  --purple-soft: #f2edfd;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(27, 42, 74, 0.04), 0 4px 16px rgba(27, 42, 74, 0.06);
  --shadow-hover: 0 2px 4px rgba(27, 42, 74, 0.06), 0 10px 28px rgba(27, 42, 74, 0.12);
  --maxw: 1400px;
  --font: "Inter", "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--ai-grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.brand small {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-mute);
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-nav a,
.main-nav button {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 10px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav button:hover {
  background: var(--blue-soft);
  color: var(--ai-blue);
}

.main-nav .nav-active {
  color: var(--ai-blue);
  background: var(--blue-soft);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 72px 0 40px;
  background:
    radial-gradient(720px 360px at 12% -10%, rgba(59, 110, 245, 0.10), transparent 65%),
    radial-gradient(720px 360px at 88% -10%, rgba(124, 77, 240, 0.10), transparent 65%),
    #ffffff;
  border-bottom: 1px solid var(--line);
}

.hero-brand-msg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--purple-soft);
  color: var(--ai-purple);
  font-size: 13px;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 999px;
  margin-bottom: 22px;
}

.hero h1 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0.01em;
  margin-bottom: 18px;
}

.hero h1 .grad-text {
  background: var(--ai-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  font-size: 16px;
  color: var(--ink-soft);
  max-width: 640px;
  margin-bottom: 34px;
}

/* ---------- Search box ---------- */
.search-panel {
  background: var(--bg-white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  max-width: 880px;
}

.search-field-wrap { position: relative; }

.search-field {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 0 18px;
  background: #fbfcfe;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-field:focus-within {
  border-color: var(--ai-blue);
  box-shadow: 0 0 0 4px rgba(59, 110, 245, 0.12);
  background: #fff;
}

.search-field i { color: var(--ink-mute); font-size: 16px; }

.search-field input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  padding: 15px 0;
  min-width: 0;
}

.search-field input::placeholder { color: #a4aec4; }

.autocomplete {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-hover);
  z-index: 50;
  overflow: hidden;
  display: none;
}

.autocomplete.open { display: block; }

.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 16px;
  border: none;
  background: none;
  text-align: left;
  font-size: 15px;
  color: var(--ink);
  transition: background 0.12s;
}

.autocomplete-item:hover,
.autocomplete-item.active { background: var(--blue-soft); }

.autocomplete-item .ac-cat {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-mute);
  flex-shrink: 0;
}

.autocomplete-empty {
  padding: 14px 16px;
  color: var(--ink-mute);
  font-size: 14px;
}

/* ---------- Category tabs ---------- */
.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.cat-tab {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 999px;
  transition: all 0.15s;
}

.cat-tab:hover { border-color: var(--ai-blue); color: var(--ai-blue); }

.cat-tab.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* ---------- Selection panel ---------- */
.selection-panel {
  margin-top: 22px;
  border-top: 1px dashed var(--line);
  padding-top: 22px;
  display: none;
}

.selection-panel.open { display: block; }

.selection-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.selection-head .sel-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-mute);
  letter-spacing: 0.05em;
}

.selected-ip-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--blue-soft);
  border: 1px solid rgba(59, 110, 245, 0.25);
  border-radius: 12px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 15px;
}

.competitor-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.competitor-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  background: #fff;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
}

.competitor-check input { accent-color: var(--ai-blue); width: 16px; height: 16px; cursor: pointer; }

.competitor-check.checked {
  border-color: var(--ai-blue);
  background: var(--blue-soft);
  color: var(--ink);
}

.competitor-note {
  font-size: 12.5px;
  color: var(--ink-mute);
  margin-bottom: 16px;
}

.competitor-note .warn { color: var(--risk); font-weight: 700; }

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--ai-grad);
  color: #fff;
  border: none;
  font-size: 16px;
  font-weight: 700;
  padding: 15px 34px;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(88, 92, 242, 0.32);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(88, 92, 242, 0.4); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: var(--ink);
  border: 1.5px solid var(--line);
  font-size: 14px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 12px;
  transition: all 0.15s;
}

.btn-secondary:hover { border-color: var(--ai-blue); color: var(--ai-blue); }

.btn-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: #fff;
  border: none;
  font-size: 13.5px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 11px;
  transition: background 0.15s, transform 0.15s;
}

.btn-card:hover { background: var(--ai-blue); transform: translateY(-1px); }

/* ---------- Section base ---------- */
.section { padding: 72px 0; }

.section-head { margin-bottom: 34px; }

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ai-blue);
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.section-title {
  font-size: clamp(21px, 2.6vw, 28px);
  font-weight: 800;
  line-height: 1.4;
}

.section-desc {
  color: var(--ink-soft);
  margin-top: 10px;
  max-width: 640px;
}

/* ---------- IP cards ---------- */
.ip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.ip-card {
  background: var(--bg-white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}

.ip-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(59, 110, 245, 0.35);
}

.ip-card-top { display: flex; align-items: center; gap: 14px; }

.ip-avatar {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.ip-avatar.av-sm { width: 40px; height: 40px; font-size: 16px; border-radius: 12px; }
.ip-avatar.av-lg { width: 62px; height: 62px; font-size: 25px; border-radius: 18px; }

.av-sports { background: linear-gradient(135deg, #0e9ea5, #0eae76); }
.av-character { background: linear-gradient(135deg, #f2703c, #ef4d7f); }
.av-game { background: linear-gradient(135deg, #3b6ef5, #29b0e8); }
.av-idol { background: linear-gradient(135deg, #7c4df0, #d44df0); }

.ip-card-name { font-size: 18px; font-weight: 800; line-height: 1.3; }

.cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  margin-top: 4px;
}

.cat-badge.b-sports { background: var(--fan-soft); color: #0b8a76; }
.cat-badge.b-character { background: var(--growth-soft); color: #d15a25; }
.cat-badge.b-game { background: var(--blue-soft); color: var(--ai-blue); }
.cat-badge.b-idol { background: var(--purple-soft); color: var(--ai-purple); }

.ip-card-desc {
  font-size: 13.5px;
  color: var(--ink-soft);
  flex: 1;
}

.ip-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.ip-card-meta {
  font-size: 12.5px;
  color: var(--ink-mute);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---------- About section ---------- */
.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.about-card {
  background: var(--bg-white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.about-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  margin-bottom: 16px;
}

.about-card h3 { font-size: 17px; font-weight: 800; margin-bottom: 10px; }
.about-card p { font-size: 14px; color: var(--ink-soft); }

.about-banner {
  margin-top: 28px;
  background: var(--ai-grad);
  border-radius: var(--radius);
  color: #fff;
  padding: 40px 36px;
  text-align: center;
}

.about-banner .msg {
  font-size: clamp(18px, 2.4vw, 24px);
  font-weight: 800;
  line-height: 1.7;
}

.about-banner .sub {
  margin-top: 12px;
  font-size: 14px;
  opacity: 0.85;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 30px 0;
}

.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--ink-mute);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 12px;
  box-shadow: var(--shadow-hover);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 300;
  max-width: 90vw;
  text-align: center;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============================================================
   Analysis loader
   ============================================================ */
.analysis-loader {
  position: fixed;
  inset: 0;
  background: rgba(249, 250, 253, 0.97);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transition: opacity 0.4s;
}

.analysis-loader.hide { opacity: 0; pointer-events: none; }

.loader-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-hover);
  padding: 40px;
  width: 100%;
  max-width: 520px;
}

.loader-ip {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}

.loader-ip-name { font-size: 19px; font-weight: 800; }
.loader-ip-cat { font-size: 13px; color: var(--ink-mute); }

.loader-bar-track {
  height: 8px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
  margin-bottom: 26px;
}

.loader-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: var(--ai-grad);
  transition: width 0.45s ease;
}

.loader-steps { display: flex; flex-direction: column; gap: 14px; }

.loader-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-mute);
  transition: color 0.3s;
}

.loader-step .step-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: transparent;
  flex-shrink: 0;
  transition: all 0.3s;
}

.loader-step.doing { color: var(--ai-blue); }
.loader-step.doing .step-icon {
  border-color: var(--ai-blue);
  border-top-color: transparent;
  animation: spin 0.7s linear infinite;
}

.loader-step.done { color: var(--ink); }
.loader-step.done .step-icon {
  background: var(--fan);
  border-color: var(--fan);
  color: #fff;
  animation: none;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* skeleton */
.skeleton-rows { margin-top: 26px; display: flex; flex-direction: column; gap: 10px; }
.skeleton {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #eef1f7 25%, #f8fafd 50%, #eef1f7 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ============================================================
   Dashboard
   ============================================================ */
.dashboard { opacity: 0; transform: translateY(10px); transition: opacity 0.5s, transform 0.5s; }
.dashboard.reveal { opacity: 1; transform: none; }

.dash-section { padding: 44px 0 12px; }
.dash-section:last-of-type { padding-bottom: 72px; }

.dash-sec-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.dash-sec-num {
  font-size: 12px;
  font-weight: 800;
  color: var(--ai-blue);
  letter-spacing: 0.1em;
}

.dash-sec-title { font-size: 21px; font-weight: 800; }
.dash-sec-sub { font-size: 13.5px; color: var(--ink-mute); width: 100%; margin-top: -6px; }

/* --- summary header --- */
.summary-bar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 30px 0;
}

.summary-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.summary-id { display: flex; align-items: center; gap: 16px; flex: 1; min-width: 260px; }

.summary-name { font-size: 24px; font-weight: 800; line-height: 1.3; }

.summary-competitors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.comp-chip {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 3px 10px;
  border-radius: 999px;
}

.comp-chip-label { font-size: 12px; color: var(--ink-mute); font-weight: 700; align-self: center; }

/* --- KPI cards --- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.kpi-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  position: relative;
  border-top: 4px solid transparent;
}

.kpi-card.k-ai { border-top-color: var(--ai-blue); }
.kpi-card.k-sov { border-top-color: var(--ai-purple); }
.kpi-card.k-fan { border-top-color: var(--fan); }
.kpi-card.k-growth { border-top-color: var(--growth); }

.kpi-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 10px;
}

.kpi-value-row { display: flex; align-items: baseline; gap: 8px; }

.kpi-value { font-size: 44px; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.kpi-unit { font-size: 13px; color: var(--ink-mute); font-weight: 600; }

.kpi-meta { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.kpi-rank {
  font-size: 12.5px;
  font-weight: 700;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  padding: 3px 10px;
  border-radius: 999px;
}

.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

.t-up { background: var(--fan-soft); color: #0b8a76; }
.t-flat { background: #eef1f7; color: var(--ink-soft); }
.t-room { background: var(--growth-soft); color: #d15a25; }

.kpi-desc { font-size: 12.5px; color: var(--ink-mute); margin-top: 12px; line-height: 1.6; }

/* tooltip */
.tip-wrap { position: relative; display: inline-flex; margin-left: auto; }

.tip-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-mute);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.tip-btn:hover, .tip-btn:focus { border-color: var(--ai-blue); color: var(--ai-blue); }

.tip-pop {
  position: absolute;
  bottom: calc(100% + 10px);
  right: -8px;
  width: 240px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
  padding: 12px 14px;
  border-radius: 10px;
  box-shadow: var(--shadow-hover);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.15s, transform 0.15s;
  z-index: 60;
}

.tip-pop::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 14px;
  border: 6px solid transparent;
  border-top-color: var(--ink);
}

.tip-wrap:hover .tip-pop,
.tip-wrap:focus-within .tip-pop { opacity: 1; transform: none; }

/* --- Insight --- */
.insight-card {
  margin-top: 24px;
  background: linear-gradient(135deg, #eef3ff 0%, #f4efff 100%);
  border: 1px solid rgba(124, 77, 240, 0.18);
  border-radius: var(--radius);
  padding: 30px 32px;
  display: flex;
  gap: 20px;
}

.insight-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--ai-grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  flex-shrink: 0;
}

.insight-label {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ai-purple);
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.insight-text {
  font-size: 16.5px;
  font-weight: 600;
  line-height: 2;
}

/* --- Growth matrix --- */
.matrix-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
}

.matrix-chart-wrap { position: relative; height: 480px; }

.matrix-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-soft);
}

.matrix-legend span { display: inline-flex; align-items: center; gap: 7px; }

.legend-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }

.matrix-mobile-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.mm-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 12.5px;
}

.mm-card.is-target { border-color: var(--ai-blue); background: var(--blue-soft); }

.mm-name { font-weight: 800; font-size: 13.5px; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }

.mm-row { display: flex; justify-content: space-between; color: var(--ink-soft); }
.mm-row b { color: var(--ink); }

/* --- AI model cards --- */
.theme-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }

.theme-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 999px;
}

.theme-chip.strong { background: var(--fan-soft); color: #0b8a76; }
.theme-chip.weak { background: var(--risk-soft); color: var(--risk); }

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

.ai-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.18s, border-color 0.18s;
}

.ai-card:hover { box-shadow: var(--shadow-hover); }
.ai-card.expanded { border-color: rgba(59, 110, 245, 0.4); }

.ai-card-main {
  width: 100%;
  border: none;
  background: none;
  text-align: left;
  padding: 22px;
  font-family: inherit;
  color: inherit;
}

.ai-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }

.ai-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  flex-shrink: 0;
}

.ai-chatgpt { background: #10a37f; }
.ai-gemini { background: linear-gradient(135deg, #4285f4, #9b72cb); }
.ai-claude { background: #d97757; }
.ai-perplexity { background: #20808d; }

.ai-name { font-weight: 800; font-size: 15.5px; }

.ai-expand-hint { margin-left: auto; color: var(--ink-mute); font-size: 13px; transition: transform 0.25s; }
.ai-card.expanded .ai-expand-hint { transform: rotate(180deg); }

.ai-score-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.ai-score { font-size: 34px; font-weight: 800; line-height: 1; }
.ai-score-label { font-size: 12px; color: var(--ink-mute); font-weight: 600; }

.ai-score-bar { height: 6px; background: #eef1f7; border-radius: 99px; overflow: hidden; margin-bottom: 16px; }
.ai-score-fill { height: 100%; border-radius: 99px; background: var(--ai-grad); }

.ai-facts { display: flex; flex-direction: column; gap: 11px; }

.ai-fact { font-size: 12.5px; line-height: 1.6; }

.ai-fact .f-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 3px;
}

.f-strong { color: #0b8a76; }
.f-weak { color: var(--risk); }
.f-rival { color: var(--ai-purple); }
.f-reason { color: var(--ink-mute); }

.ai-fact p { color: var(--ink-soft); }

.ai-card-detail {
  display: none;
  border-top: 1px dashed var(--line);
  padding: 20px 22px 24px;
  background: #fbfcfe;
}

.ai-card.expanded .ai-card-detail { display: block; }

.ai-detail-block { margin-bottom: 16px; }
.ai-detail-block:last-child { margin-bottom: 0; }

.ai-detail-label {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--ai-blue);
  letter-spacing: 0.06em;
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-detail-block p { font-size: 13px; color: var(--ink-soft); line-height: 1.7; }

.ai-questions { list-style: none; display: flex; flex-direction: column; gap: 7px; }

.ai-questions li {
  font-size: 12.5px;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 12px;
  line-height: 1.55;
}

.ai-questions li::before { content: "Q. "; font-weight: 800; color: var(--ai-blue); }

/* --- Fan demand cards --- */
.demand-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.demand-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  border-left: 4px solid var(--fan);
}

.demand-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }

.demand-title { font-size: 16.5px; font-weight: 800; flex: 1; min-width: 160px; line-height: 1.45; }

.demand-badges { display: flex; gap: 7px; flex-wrap: wrap; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge.heat-high { background: var(--fan-soft); color: #0b8a76; }
.badge.heat-mid { background: #eef1f7; color: var(--ink-soft); }
.badge.trend-up { background: var(--growth-soft); color: #d15a25; }
.badge.trend-surge { background: var(--risk-soft); color: var(--risk); }
.badge.trend-flat { background: #eef1f7; color: var(--ink-soft); }

.demand-audience {
  font-size: 12.5px;
  color: var(--ink-mute);
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
}

.demand-row { display: flex; gap: 12px; margin-bottom: 12px; }
.demand-row:last-child { margin-bottom: 0; }

.demand-row-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.dr-voice .demand-row-icon { background: var(--fan-soft); color: #0b8a76; }
.dr-biz .demand-row-icon { background: var(--growth-soft); color: #d15a25; }

.demand-row .dr-label { font-size: 11.5px; font-weight: 800; color: var(--ink-mute); letter-spacing: 0.04em; }
.demand-row .dr-text { font-size: 13.5px; color: var(--ink-soft); line-height: 1.65; }

/* --- Action cards --- */
.action-list { display: flex; flex-direction: column; gap: 18px; }

.action-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.18s;
}

.action-card:hover { box-shadow: var(--shadow-hover); }

.action-main {
  width: 100%;
  border: none;
  background: none;
  text-align: left;
  padding: 24px 26px;
  font-family: inherit;
  color: inherit;
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.action-priority {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  background: var(--growth-soft);
  color: var(--growth);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 800;
}

.action-priority .p-num { font-size: 21px; line-height: 1; }
.action-priority .p-label { font-size: 9px; letter-spacing: 0.08em; }

.action-card:first-child .action-priority { background: var(--growth); color: #fff; }

.action-title { font-size: 17.5px; font-weight: 800; line-height: 1.45; margin-bottom: 8px; }

.action-issue { font-size: 13.5px; color: var(--ink-soft); line-height: 1.65; }
.action-issue b { color: var(--risk); font-weight: 700; }

.action-meta { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.diff-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 999px;
}

.diff-low { background: var(--fan-soft); color: #0b8a76; }
.diff-mid { background: #fdf3e2; color: #b07615; }
.diff-high { background: var(--risk-soft); color: var(--risk); }

.action-expand-hint { color: var(--ink-mute); font-size: 14px; margin-left: auto; align-self: center; transition: transform 0.25s; flex-shrink: 0; }
.action-card.expanded .action-expand-hint { transform: rotate(180deg); }

.action-detail {
  display: none;
  border-top: 1px dashed var(--line);
  background: #fbfcfe;
  padding: 24px 26px;
}

.action-card.expanded .action-detail { display: block; }

.action-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.ad-block h4 {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--ai-blue);
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ad-block p { font-size: 13.5px; color: var(--ink-soft); line-height: 1.75; }

.ad-steps { list-style: none; display: flex; flex-direction: column; gap: 8px; }

.ad-steps li {
  font-size: 13px;
  color: var(--ink-soft);
  display: flex;
  gap: 9px;
  line-height: 1.6;
}

.ad-steps li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--growth);
  margin-top: 8px;
  flex-shrink: 0;
}

.ad-evidence {
  grid-column: 1 / -1;
  background: var(--blue-soft);
  border: 1px solid rgba(59, 110, 245, 0.2);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.7;
}

.ad-evidence b { color: var(--ai-blue); }

/* --- CTA bottom --- */
.dash-cta {
  margin-top: 40px;
  text-align: center;
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Error state --- */
.error-hero {
  text-align: center;
  padding: 90px 24px 50px;
}

.error-icon {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  background: var(--risk-soft);
  color: var(--risk);
  font-size: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 22px;
}

.error-hero h1 { font-size: 25px; font-weight: 800; margin-bottom: 12px; }
.error-hero p { color: var(--ink-soft); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1100px) {
  .ip-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .ai-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
  .matrix-mobile-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .container, .header-inner, .summary-inner, .footer-inner { padding-left: 18px; padding-right: 18px; }
  .hero { padding: 48px 0 32px; }
  .section { padding: 52px 0; }
  .search-panel { padding: 18px; }
  .ip-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr; }
  .ai-grid { grid-template-columns: 1fr; }
  .demand-grid { grid-template-columns: 1fr; }
  .matrix-mobile-cards { grid-template-columns: 1fr; }
  .matrix-chart-wrap { height: 340px; }
  .action-detail-grid { grid-template-columns: 1fr; }
  .action-main { padding: 18px; gap: 13px; }
  .action-detail { padding: 18px; }
  .insight-card { flex-direction: column; padding: 22px; gap: 14px; }
  .insight-text { font-size: 15px; }
  .kpi-value { font-size: 38px; }
  .summary-name { font-size: 20px; }
  .main-nav a, .main-nav button { padding: 7px 9px; font-size: 12.5px; }
  .brand { font-size: 13px; }
  .brand small { display: none; }
  .loader-card { padding: 26px; }
}
