/* ISD house look, adapted from isdept.ai (navy, gold, Source Serif / Source Sans). */
:root {
  --white: #FFFFFF;
  --navy: #015478;
  --navy-alt: #01405c;
  --cta: #2365ed;
  --cta-hover: #218aff;
  --cta-active: #1b54c9;
  --ink: #141517;
  --text: #1a1a1a;
  --muted: #666666;
  --red: #d9001b;
  --border: #E5E7EB;
  --gold: #C7A172;
  --soft: #F7F8FA;
  --font-head: "Source Serif Pro", "Source Serif 4", "Noto Serif", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", "Source Sans Pro", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max: 1200px;
  --radius: 8px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: var(--soft);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.4em;
  color: var(--ink);
}
h1 { font-size: 2rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 0.95rem; color: var(--navy); letter-spacing: 0.02em; margin-bottom: 0.6em; }
p { margin: 0 0 0.8em; }
a { color: var(--cta); text-decoration: none; }
a:hover { color: var(--cta-hover); }
.wrap { width: min(100% - 2.4rem, var(--max)); margin-inline: auto; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

.site-header {
  background: var(--navy);
  color: #fff;
  padding: 0.85rem 0;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: center; gap: 0.7rem; color: #fff; }
.brand-name {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.55rem;
  letter-spacing: 0.01em;
}
.brand-ai {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(255,255,255,0.45);
  border-radius: 0.3em;
  padding: 0.22em 0.55em;
}
.header-meta { color: rgba(255,255,255,0.7); font-size: 0.85rem; }

.toolbar { background: #fff; border-bottom: 1px solid var(--border); }
.toolbar-inner {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.85rem;
  padding: 0.85rem 0;
}
.field { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.78rem; color: var(--muted); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.field input, .field select {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  background: #fff;
  min-width: 9rem;
}
.presets { display: flex; gap: 0.3rem; }
.presets button {
  font-family: var(--font-body);
  font-size: 0.85rem;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 20px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  color: var(--navy);
}
.presets button:hover, .presets button.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn {
  display: inline-block;
  background: var(--cta);
  color: #fff;
  border: 2px solid var(--cta);
  border-radius: 30px;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
}
.btn:hover { background: var(--cta-active); border-color: var(--cta-active); }

.login { padding: 3rem 0 4rem; }
.login h1 { margin-bottom: 0.4em; }
.login form { display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; max-width: 24rem; }
.error { color: var(--red); font-size: 0.9rem; }

main { padding: 2rem 0 4rem; }
.eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.5rem;
}
.lede { color: var(--muted); max-width: 46rem; margin-bottom: 1.6rem; }

.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}
.kpi {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 0.95rem;
}
.kpi .label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.kpi .value { font-family: var(--font-head); font-size: 1.85rem; font-weight: 600; color: var(--navy); margin-top: 0.15rem; line-height: 1.15; }
.kpi .sub { font-size: 0.8rem; color: var(--muted); margin-top: 0.15rem; }

.hero-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem 1.35rem;
  margin-bottom: 1.15rem;
}
.hero-card#sec-interest,
.hero-card#sec-sources,
.hero-card#sec-paths {
  border-top: 3px solid var(--navy);
}
.card-head { margin-bottom: 0.9rem; }
.card-head p { color: var(--muted); font-size: 0.92rem; margin: 0; max-width: 46rem; }
.card-head { display: block; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.path { font-weight: 600; color: var(--ink); }
.bar { display: inline-block; height: 6px; background: var(--navy); border-radius: 3px; vertical-align: middle; margin-right: 0.4rem; }
.bar.gold { background: var(--gold); }
.bar.cta { background: var(--cta); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.bars { display: flex; flex-direction: column; gap: 0.45rem; }
.bar-row { display: grid; grid-template-columns: minmax(8rem, 16rem) 1fr auto; gap: 0.55rem; align-items: center; font-size: 0.92rem; }
.bar-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .track { background: var(--soft); border-radius: 4px; height: 10px; overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--navy); border-radius: 4px; }
.bar-row .fill.search { background: var(--cta); }
.bar-row .fill.campaign { background: var(--gold); }
.bar-row .fill.ai { background: #01405c; }
.bar-row .fill.social { background: #218aff; }
.bar-row .fill.direct { background: #8aa0ad; }
.bar-row .fill.referral { background: var(--navy-alt); }
.bar-row .n { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.85rem; min-width: 4.5rem; text-align: right; }
.badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 3px;
  padding: 0.1em 0.4em;
  margin-right: 0.3em;
  background: var(--soft);
  color: var(--navy);
  border: 1px solid var(--border);
}

.path-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.4rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.path-item:last-child { border-bottom: 0; }
.step {
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.25rem 0.55rem;
  font-weight: 600;
}
.step.conv {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.arrow { color: var(--gold); font-weight: 700; }
.path-count { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.88rem; white-space: nowrap; flex-shrink: 0; }

.perk-note {
  background: #fff8ee;
  border: 1px solid #ead7b5;
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-bottom: 1.15rem;
  color: var(--ink);
}
.perk-note strong { color: var(--navy); }

.lang-tabs { display: flex; gap: 0.3rem; margin-top: 0.7rem; }
.lang-tabs button {
  font-family: var(--font-body);
  font-size: 0.85rem;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 20px;
  padding: 0.3rem 0.8rem;
  cursor: pointer;
  color: var(--navy);
}
.lang-tabs button.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }
.summary-body { font-size: 1.05rem; line-height: 1.65; max-width: 50rem; }
.summary-body[lang="ja"], .summary-body[lang="zh"] { line-height: 1.8; }
.actions { margin: 1rem 0 0; padding-left: 1.2rem; }
.actions li { margin: 0.35rem 0; }

.secondary { display: grid; grid-template-columns: 1fr 1fr; gap: 1.15rem; }
.secondary .hero-card { margin: 0; }
.secondary #sec-daily,
.secondary #sec-devices { grid-column: 1 / -1; }

.daily { display: flex; align-items: stretch; gap: 0.5rem; height: 200px; padding-top: 0.4rem; }
.daily .col { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; height: 200px; }
.daily .col .stack {
  width: 70%;
  max-width: 52px;
  height: 150px;
  min-height: 150px;
  flex: none;
  background: var(--soft);
  border-radius: 5px 5px 0 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}
.daily .col .pv { display: none; }
.daily .col .stack.f-10 { background: linear-gradient(to top, var(--navy) 0 10%, var(--soft) 10% 100%); }
.daily .col .stack.f-20 { background: linear-gradient(to top, var(--navy) 0 20%, var(--soft) 20% 100%); }
.daily .col .stack.f-30 { background: linear-gradient(to top, var(--navy) 0 30%, var(--soft) 30% 100%); }
.daily .col .stack.f-40 { background: linear-gradient(to top, var(--navy) 0 40%, var(--soft) 40% 100%); }
.daily .col .stack.f-50 { background: linear-gradient(to top, var(--navy) 0 50%, var(--soft) 50% 100%); }
.daily .col .stack.f-60 { background: linear-gradient(to top, var(--navy) 0 60%, var(--soft) 60% 100%); }
.daily .col .stack.f-70 { background: linear-gradient(to top, var(--navy) 0 70%, var(--soft) 70% 100%); }
.daily .col .stack.f-80 { background: linear-gradient(to top, var(--navy) 0 80%, var(--soft) 80% 100%); }
.daily .col .stack.f-90 { background: linear-gradient(to top, var(--navy) 0 90%, var(--soft) 90% 100%); }
.daily .col .stack.f-100 { background: linear-gradient(to top, var(--navy) 0 100%, var(--soft) 100% 100%); }
.daily .col .val { font-size: 0.7rem; color: var(--navy); font-variant-numeric: tabular-nums; font-weight: 600; margin-top: 0.3rem; }
.daily .col .lbl { font-size: 0.68rem; color: var(--muted); margin-top: 0.1rem; }

.foot { margin-top: 2.5rem; color: var(--muted); font-size: 0.82rem; border-top: 1px solid var(--border); padding-top: 1rem; }

@media (max-width: 900px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .split, .secondary { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 1fr; }
  h1 { font-size: 1.6rem; }
}
