/* Googleフォーム アンケート分析ツール - Web UI
   デジタル庁ダッシュボードデザインテンプレート Blue パレットを適用
   参照: https://www.digital.go.jp/resources/dashboard-guidebook
   テーマJSON: /static/design/CustomThemeBlueDefault_2026.json
   （出典: digital-go-jp/policy-dashboard-assets） */

:root {
  /* Background */
  --bg: #ffffff;
  --surface: #ffffff;
  --control: #f5f5f7;
  --highlight: #0017c1;

  /* Text */
  --text: #1a1a1a;
  --text-body: #2f333b;
  --label: #5c6570;
  --muted: #5c6570;

  /* Blue palette (Digital Agency Dashboard Template Blue) */
  --blue-1200: #000060;
  --blue-900: #0017c1;
  --blue-600: #3460fb;
  --blue-400: #7096f8;
  --blue-200: #c5d7fb;
  --blue-50: #e8f1fe;

  --primary: var(--blue-900);
  --primary-dark: var(--blue-1200);
  --primary-hover: #0031b8;
  --accent: var(--blue-900);

  --border: #999999;
  --border-soft: #d9dde5;
  --gridline: #e6e6e6;
  --focus-yellow: #ffc700;

  --success: #0b6e4f;
  --error: #ce0000;
  --error-bg: #fdeeee;
  --info-bg: var(--blue-50);

  --shadow: none;
  --radius: 10px;
  --ad-bg: #f6f7f9;
  --ad-border: #d9dde5;
  --bg-soft: #f6f7f9;
  --font: "IBM Plex Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "BIZ UDPGothic", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --line: 1.8;

  /* Chart series (theme dataColors) */
  --chart-1: #0017c1;
  --chart-2: #3460fb;
  --chart-3: #7096f8;
  --chart-4: #c5d7fb;
  --chart-5: #e8f1fe;
  --chart-neg: #fe3939;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-body);
  line-height: var(--line);
  letter-spacing: 0.02em;
  font-feature-settings: "palt" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: 0.015em;
  color: var(--text);
}

a { color: var(--primary); text-decoration: underline; text-underline-offset: 0.15em; }
a:hover { color: var(--primary-hover); }
a:focus-visible {
  outline: 4px solid #000;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--focus-yellow);
}

.site-header {
  background: #fff;
  color: var(--text);
  padding: 0;
  border-bottom: 1px solid var(--border-soft);
}

.site-header .inner {
  max-width: 1440px;
  margin: 0 auto;
  min-height: 60px;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: nowrap;
  width: min(1440px, calc(100% - 0px));
  box-sizing: border-box;
}

.logo {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.logo:hover {
  color: var(--text);
  text-decoration: none;
}
.logo-title {
  display: block;
  color: var(--text);
  font-weight: 600;
  line-height: 1.3;
}
.logo-sub,
.logo span:not(.logo-title) {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.7rem;
  display: block;
  letter-spacing: 0.03em;
  line-height: 1.3;
}
.nav a {
  color: var(--text-body);
  margin-left: 0.85rem;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding-bottom: 0.15rem;
}
.nav a:hover {
  color: var(--primary);
  border-bottom-color: transparent;
  text-decoration: none;
}
.nav a[aria-current="page"] {
  color: var(--primary);
  border-bottom-color: transparent;
  font-weight: 600;
}
.nav a.btn-nav-analyze {
  display: inline-flex;
  align-items: center;
  margin-left: 0.85rem;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  background: var(--primary);
  color: #fff !important;
  font-weight: 600;
  border-bottom: none;
  text-decoration: none;
}
.nav a.btn-nav-analyze:hover {
  background: var(--primary-hover);
  color: #fff !important;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: nowrap;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.lang-switch__icon {
  width: 1rem;
  height: 1rem;
  margin: 0 0.15rem 0 0.4rem;
  color: var(--label);
  flex-shrink: 0;
}
.lang-switch button {
  appearance: none;
  border: none;
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.32rem 0.5rem;
  border-radius: 0;
  cursor: pointer;
  line-height: 1;
}
.lang-switch button.is-active {
  background: var(--blue-50);
  color: var(--primary);
}
.lang-switch button:focus-visible {
  outline: 4px solid #000;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--focus-yellow);
}

.icon {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
  flex-shrink: 0;
}
.icon--lg {
  width: 1.75rem;
  height: 1.75rem;
}
.icon--xl {
  width: 2.5rem;
  height: 2.5rem;
}
.icon-badge {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  background: var(--blue-50);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon-badge--step {
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  width: 2.75rem;
  height: 2.75rem;
}
.btn .icon {
  width: 1.05rem;
  height: 1.05rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0.5rem;
}
.section-title h2 {
  margin: 0;
}

.layout {
  --content-max: 1440px;
  --content-gutter: 1.5rem;
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0 0 2.5rem;
  display: block;
}

.layout.analysis-mode {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0.75rem 1rem 2rem;
}

.layout.analysis-mode #hero,
.layout.analysis-mode #tools,
.layout.analysis-mode #usecases,
.layout.analysis-mode #how-to,
.layout.analysis-mode #security,
.layout.analysis-mode #upload-section,
.layout.analysis-mode #faq {
  display: none;
}

/* 分析中も上部バナーは残す（収益化） */
.layout.analysis-mode .ad-banner {
  display: block;
  max-width: none;
  width: 100%;
  margin: 0 0 0.75rem;
  padding: 0.75rem 0;
  background: transparent;
  border: none;
}

@media (max-width: 900px) {
  .site-header .inner {
    flex-wrap: wrap;
    min-height: auto;
    padding: 0.65rem 1rem;
  }
  .nav a:not(.btn-nav-analyze) {
    display: none;
  }
  .nav a.btn-nav-analyze {
    margin-left: 0;
  }
  .layout {
    --content-gutter: 1rem;
  }
}

.layout.analysis-mode .main-content {
  max-width: none;
  margin: 0;
  width: 100%;
}

.layout.analysis-mode .card {
  padding: 1.25rem 1.5rem;
}

.layout.analysis-mode .table-wrap {
  max-width: 100%;
}

.main-content {
  width: 100%;
}

/* ランディング本文の共通幅 */
.page-content-width,
.hero__grid,
.landing-block > *,
.ad-banner > .ad-slot,
.main-content > #error-box,
.main-content > #status-bar,
.main-content > #schema-section,
.main-content > #analysis-section,
.main-content > #ai-guide-section {
  width: min(var(--content-max, 1440px), calc(100% - 2 * var(--content-gutter, 1.5rem)));
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.layout.analysis-mode .main-content > #error-box,
.layout.analysis-mode .main-content > #status-bar,
.layout.analysis-mode .main-content > #schema-section,
.layout.analysis-mode .main-content > #analysis-section,
.layout.analysis-mode .main-content > #ai-guide-section {
  width: 100%;
  max-width: none;
}

.ad-slot {
  background: var(--ad-bg);
  border: 1px dashed var(--ad-border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
  overflow: hidden;
  min-height: 90px;
  position: relative;
}
.ad-slot > ins.adsbygoogle {
  display: block;
  width: 100%;
  min-height: 90px;
}
.ad-placeholder-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: var(--muted);
  font-size: 0.75rem;
  z-index: 0;
}
.ad-slot.is-loading .ad-placeholder-text {
  opacity: 0.85;
}
.ad-slot.is-filled {
  background: transparent;
  border-style: solid;
  border-color: transparent;
}
.ad-slot.is-filled .ad-placeholder-text {
  display: none;
}
.ad-slot.is-empty .ad-placeholder-text {
  opacity: 0.7;
}

.ad-banner {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0.85rem 0;
  background: var(--bg-soft);
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  box-sizing: border-box;
}
.ad-banner .ad-slot {
  min-height: 90px;
  max-height: none;
  background: #fff;
}
.main-content > .ad-banner {
  margin: 0;
  width: 100%;
}
.ad-sidebar .ad-slot { min-height: 280px; margin-bottom: 1rem; }
.ad-incontent { margin: 1.5rem 0; }
.ad-incontent .ad-slot { min-height: 100px; }

.ad-sticky-bottom {
  display: none;
  position: sticky;
  bottom: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--border-soft);
  padding: 0.5rem 1rem 0.75rem;
  width: 100%;
  box-sizing: border-box;
}
.ad-sticky-bottom:not(.hidden) {
  display: block;
}
.ad-sticky-bottom .ad-slot {
  max-width: 960px;
  margin: 0 auto;
  min-height: 90px;
}

.card {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: none;
  border: 1px solid var(--border-soft);
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  margin-bottom: 1.5rem;
}

.card h2 { margin: 0 0 0.5rem; font-size: 1.2rem; color: var(--text); }
.card .subtitle { color: var(--muted); font-size: 0.9rem; margin-bottom: 1rem; }

.hero {
  text-align: left;
  width: 100%;
  padding: 1.5rem 0 1.35rem;
  margin: 0;
  box-sizing: border-box;
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 1.5rem 1.75rem;
  align-items: center;
}
.hero-kicker {
  display: inline-block;
  margin: 0 0 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.06em;
}
.hero h1 {
  font-size: clamp(1.6rem, 2.1vw, 2.05rem);
  margin: 0 0 0.55rem;
  color: var(--text);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.01em;
  border-left: none;
  padding-left: 0;
}
.hero-lead {
  color: var(--text-body);
  max-width: 36rem;
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  line-height: 1.75;
  letter-spacing: 0.025em;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.25rem;
}
.hero-subactions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.65rem;
  align-items: center;
}
.hero-subactions a,
.hero-subactions button {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  background: none;
  border: none;
  padding: 0;
  color: var(--primary);
  cursor: pointer;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.hero-subactions a:hover,
.hero-subactions button:hover {
  color: var(--primary-hover);
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  margin: 0.7rem 0 0;
  padding: 0;
  list-style: none;
}
.trust-row li {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-body);
}
.trust-row li strong {
  color: var(--success);
  font-weight: 600;
}
.trust-check {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--success);
}

.preview-card {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 0.9rem 0.95rem 0.95rem;
}
.preview-label {
  margin: 0 0 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.55rem;
}
.preview-tags .tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--primary);
  background: var(--blue-50);
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
}
.preview-q {
  margin: 0 0 0.55rem;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0.02em;
  color: var(--text);
}
.bar-list { display: grid; gap: 0.35rem; margin-bottom: 0.75rem; }
.bar-row {
  display: grid;
  grid-template-columns: 4.8rem 1fr 2.8rem;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--text-body);
}
.bar-row span:last-child {
  text-align: right;
  font-weight: 600;
  color: var(--text-body);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "palt" 0;
}
.bar-track {
  height: 8px;
  background: #eef0f4;
  border-radius: 999px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
}
.mini-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
}
.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.7rem;
  min-width: 260px;
  letter-spacing: 0.02em;
}
.mini-table th,
.mini-table td {
  padding: 0.32rem 0.45rem;
  border-bottom: 1px solid var(--border-soft);
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "palt" 0;
}
.mini-table th:first-child,
.mini-table td:first-child {
  text-align: left;
  font-weight: 600;
  font-feature-settings: "palt" 1;
}
.mini-table thead th {
  background: var(--bg-soft);
  color: var(--muted);
  font-weight: 500;
}
.mini-table tbody tr:last-child td { border-bottom: 0; }
.mini-caption {
  margin: 0.4rem 0 0;
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; gap: 1.15rem; align-items: stretch; }
  .hero { padding: 1.1rem 0 1rem; }
  .hero h1 { font-size: clamp(1.65rem, 6vw, 1.95rem); }
}

.card--flush {
  border: none;
  padding-left: 0;
  padding-right: 0;
  padding-top: 0.5rem;
}
#upload-section.hero-upload {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}
#upload-section.hero-upload .section-title,
#upload-section.hero-upload > .subtitle:first-of-type {
  display: none;
}

.landing-block {
  width: 100%;
  margin: 0;
  padding: 2.75rem 0;
  border: none;
  background: transparent;
  box-sizing: border-box;
}
.landing-block--soft {
  background: var(--bg-soft);
  border-radius: 0;
  margin: 0;
  padding: 2.75rem 0;
}
.section-head {
  max-width: 40rem;
  margin-bottom: 1.35rem;
}
.section-head h2 {
  margin: 0 0 0.45rem;
  font-size: clamp(1.25rem, 1.8vw, 1.55rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
}
.section-head p {
  margin: 0;
  color: var(--text-body);
  font-size: 0.95rem;
  line-height: 1.8;
  letter-spacing: 0.025em;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}
.feature-card {
  display: block;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.1rem 1.05rem 1.15rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.feature-card:hover {
  border-color: var(--primary);
  background: #f8f9ff;
  text-decoration: none;
  color: inherit;
}
.feature-card:focus-visible {
  outline: 4px solid #000;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--focus-yellow);
}
.feature-icon {
  width: 26px;
  height: 26px;
  color: var(--primary);
  margin-bottom: 0.55rem;
  display: block;
}
.feature-card h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  line-height: 1.4;
}
.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.7;
  letter-spacing: 0.025em;
}
@media (max-width: 900px) {
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .feature-grid { grid-template-columns: 1fr; }
}

.use-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}
.use-item {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 0.95rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.025em;
  color: var(--text-body);
  line-height: 1.5;
}
@media (max-width: 900px) {
  .use-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .use-grid { grid-template-columns: 1fr; }
}

.security-box {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem 1.15rem;
  align-items: start;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 1.25rem 1.25rem;
}
.security-icon {
  width: 36px;
  height: 36px;
  color: var(--primary);
  flex-shrink: 0;
}
.security-box h2 {
  margin: 0 0 0.45rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}
.security-box p {
  margin: 0;
  color: var(--text-body);
  font-size: 0.92rem;
  line-height: 1.8;
  letter-spacing: 0.025em;
}
@media (max-width: 560px) {
  .security-box { grid-template-columns: 1fr; }
}

.site-footer__simple {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.1rem 2rem;
  margin-bottom: 1rem;
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1.5rem;
}
.site-footer__simple .logo-title {
  font-size: 1rem;
}
.site-footer .site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.05rem;
  border: none;
  padding: 0;
  justify-content: flex-start;
}
.site-footer .site-footer__meta {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem 0.25rem;
}

.ai-guide-panel {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem 1.25rem;
}

.marketing-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}
.marketing-step {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.1rem 1.05rem;
  background: #fff;
}
.marketing-step__num {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.08em;
  margin-bottom: 0.45rem;
  font-feature-settings: "tnum" 1, "palt" 0;
  font-family: var(--font-mono);
}
.marketing-step h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--text);
}
.marketing-step p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.7;
}
@media (max-width: 768px) {
  .marketing-steps { grid-template-columns: 1fr; }
}

.faq-accordion {
  display: grid;
  gap: 0.55rem;
  max-width: 52rem;
}
details.faq {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: #fff;
  padding: 0.8rem 1rem;
}
details.faq summary {
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  list-style: none;
  font-size: 0.92rem;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: "+";
  float: right;
  color: var(--muted);
  font-weight: 600;
}
details.faq[open] summary::after { content: "−"; }
details.faq p {
  margin: 0.7rem 0 0.1rem;
  color: var(--text-body);
  font-size: 0.9rem;
  line-height: 1.8;
  letter-spacing: 0.025em;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.85rem;
}
.tool-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 1.1rem 1.1rem 1.15rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.tool-card:hover {
  border-color: var(--blue-600);
  background: var(--blue-50);
  text-decoration: none;
}
.tool-card:focus-visible {
  outline: 4px solid #000;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--focus-yellow);
}
.tool-card__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.tool-card h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--primary);
  font-weight: 700;
  line-height: 1.4;
}
.tool-card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.55;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.feature {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 0.75rem;
  font-size: 0.85rem;
  text-align: left;
}

.faq-list {
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}
.faq-item {
  margin: 0;
  padding: 0;
}
.faq-item dt {
  margin: 0 0 0.35rem;
  font-weight: 700;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.5;
}
.faq-item dd {
  margin: 0;
  color: var(--text-body);
  font-size: 0.95rem;
  line-height: 1.75;
}
.upload-sample-links a {
  font-weight: 500;
}

.how-to-section .dads-steps--wide {
  margin-top: 1rem;
}
.how-to-cta {
  margin: 1.25rem 0 0;
}

.sidebar-quick h2 {
  font-size: 1rem;
}
.sidebar-quick-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.sidebar-quick-list a {
  font-size: 0.9rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.sidebar-quick-list a:hover {
  border-bottom-color: var(--primary);
}

.design-credit {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
}
.design-credit a { color: var(--muted); }

.upload-zone {
  background: #fff;
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1rem 1rem 0.9rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--primary);
  background: #f8f9ff;
}

.upload-zone input { display: none; }
.upload-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin: 0 auto 0.4rem;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--primary);
}
.upload-icon .icon {
  width: 1.75rem;
  height: 1.75rem;
}
.upload-zone .upload-title {
  margin: 0 0 0.2rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
}
.upload-zone .upload-hint {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}
.upload-zone .upload-formats {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}
.upload-sample-links {
  margin: 0.55rem 0 0;
  text-align: center;
  font-size: 0.8rem;
}

.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.tab {
  padding: 0.6rem 1rem;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-family: inherit;
}

.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.35rem; color: var(--muted); }
select, button.btn { font-family: inherit; font-size: 0.9rem; }

select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.15rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
}
.btn:focus-visible {
  outline: 4px solid #000;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--focus-yellow);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; text-decoration: none; }
.btn-secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { background: #f2f2f2; text-decoration: none; }
.btn-accent {
  background: #fff;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-accent:hover { background: var(--blue-50); text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin-bottom: 1rem; }
.metric { background: var(--blue-50); border-radius: 8px; padding: 0.75rem; text-align: center; }
.metric .value { font-size: 1.4rem; font-weight: 700; color: var(--primary); }
.metric .label { font-size: 0.75rem; color: var(--muted); }

.table-wrap { overflow-x: auto; margin: 1rem 0; -webkit-overflow-scrolling: touch; }
table.data-table { width: 100%; min-width: 480px; border-collapse: collapse; font-size: 0.85rem; }
table.data-table th, table.data-table td { border: 1px solid var(--border); padding: 0.5rem 0.65rem; text-align: right; }
table.data-table th:first-child, table.data-table td:first-child { text-align: left; }
table.data-table thead { background: #eef3f8; }

table.data-table td.cell-high {
  background: #c0c0c0;
  font-weight: 700;
  text-decoration: none;
  color: #000;
}
table.data-table td.cell-low {
  background: #fff;
  font-style: normal;
  font-weight: 400;
  color: #000;
  text-decoration: underline;
}
table.data-table.apa-table {
  font-family: "Times New Roman", "Yu Mincho", serif;
  border-collapse: collapse;
}
table.data-table.apa-table thead th {
  border-top: 2px solid #000;
  border-bottom: 1px solid #000;
  background: #fff;
}
table.data-table.apa-table tbody tr:last-child td {
  border-bottom: 2px solid #000;
}
.option-editor {
  min-width: 180px;
}
.opt-pair {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 3px;
}
.opt-pair .opt-val {
  width: 48px;
  padding: 0.25rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.78rem;
  text-align: center;
}
.opt-pair .opt-eq {
  font-size: 0.78rem;
  color: var(--muted);
  flex-shrink: 0;
}
.opt-pair .opt-lbl {
  flex: 1;
  min-width: 60px;
  padding: 0.25rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.78rem;
}
.opt-del {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #f5f5f5;
  color: #c00;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}
.opt-del:hover { background: #fdecea; }
.opt-add {
  width: 100%;
  padding: 0.2rem;
  border: 1px dashed var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}
.opt-add:hover { background: #f0f7fc; }

/* --- 欠損値モード --- */
.schema-missing {
  font-size: 0.78rem;
  padding: 0.2rem 0.3rem;
  min-width: 100px;
}
.schema-condition-cell {
  min-width: 260px;
  max-width: 340px;
}
.schema-condition-cell select {
  width: 100%;
  min-width: 160px;
  padding: 0.25rem 0.35rem;
  font-size: 0.78rem;
}
.condition-join-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 6px;
}
.condition-join-row label {
  font-size: 0.7rem;
  color: var(--muted);
  margin: 0;
}
.condition-rules {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.condition-rule {
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  padding: 6px;
  background: #fafcfe;
}
.condition-rule-head {
  display: flex;
  gap: 4px;
  align-items: center;
}
.condition-rule-remove {
  flex: 0 0 auto;
  border: 1px solid #d0d7e2;
  background: #fff;
  color: #64748b;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  line-height: 1;
}
.condition-rule-remove:hover:not(:disabled) {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #f0c4c4;
}
.condition-rule-remove:disabled {
  opacity: 0.35;
  cursor: default;
}
.condition-rule-add {
  margin-top: 6px;
  border: 1px dashed #9bb6d0;
  background: #f5f9fc;
  color: #1e5a8a;
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  font-size: 0.72rem;
  cursor: pointer;
  width: 100%;
}
.condition-rule-add:hover {
  background: #eaf3fa;
}
.condition-values-wrap {
  margin-top: 6px;
}
.condition-values {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.condition-values.empty {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}
.condition-chip {
  border: 1px solid #c5d3e0;
  background: #f7fafc;
  color: #334155;
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  font-size: 0.72rem;
  cursor: pointer;
  line-height: 1.3;
}
.condition-chip:hover {
  background: #eef5fb;
  border-color: #9bb6d0;
}
.condition-chip.active {
  background: #1f6f9f;
  border-color: #1f6f9f;
  color: #fff;
  font-weight: 600;
}

/* --- 合算グループエディタ --- */
.group-editor { min-width: 200px; }
.grp-pair {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 3px;
}
.grp-pair .grp-vals {
  width: 80px;
  padding: 0.25rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.78rem;
}
.grp-pair .grp-lbl {
  flex: 1;
  min-width: 70px;
  padding: 0.25rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.78rem;
}
.grp-add {
  width: 100%;
  padding: 0.2rem;
  border: 1px dashed var(--border);
  border-radius: 4px;
  background: transparent;
  color: #38a169;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}
.grp-add:hover { background: #f0fcf5; }

.face-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  margin: 0.2rem;
  background: #f0f3f6;
  border-radius: 6px;
  font-size: 0.85rem;
}
.face-order-list {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.3rem;
}
.face-order-row {
  display: flex;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}
.face-order-index {
  min-width: 1.2rem;
  font-weight: 700;
  color: var(--muted);
}
.face-order-label {
  flex: 1;
}
.face-order-btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 4px;
  width: 1.6rem;
  height: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.face-order-btn:hover {
  background: #e8eef4;
}
.type-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border: 1px solid #888;
  border-radius: 3px;
  color: #333;
}
.question-header {
  background: #e8e8e8;
  padding: 0.5rem 0.75rem;
  font-weight: 700;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-bottom: none;
  margin-top: 1rem;
}
.simple-tab-block .table-wrap {
  margin-bottom: 1.25rem;
}
.simple-table thead th {
  background: #e8e8e8;
  text-align: center;
}
.simple-table td:nth-child(2),
.simple-table td:nth-child(3),
.simple-table th:nth-child(2),
.simple-table th:nth-child(3) {
  text-align: right;
}
table.data-table th.option-header {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  white-space: nowrap;
  min-width: 2.2em;
  max-width: 3em;
  padding: 0.6rem 0.35rem;
  vertical-align: bottom;
}
table.data-table .highlight-legend {
  caption-side: bottom;
  text-align: left;
  font-size: 0.78rem;
  color: var(--muted);
  padding-top: 0.5rem;
}
#report-chart img,
#freq-chart img,
#cross-chart img {
  max-width: 100%;
  height: auto;
}

.chart-wrap { text-align: center; margin: 1rem 0; }
.chart-wrap img { max-width: 100%; height: auto; border: none; border-radius: 0; }
.headline { font-size: 1.05rem; font-weight: 600; color: var(--primary-dark); margin: 0.5rem 0; }

.status-bar {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.status-bar.visible { display: flex; }
.status-bar__body { flex: 1; min-width: 0; }
.status-bar__body #status-text { display: block; margin-bottom: 0.45rem; font-weight: 700; color: var(--text); }

.progress-track {
  width: 100%;
  height: 0.5rem;
  background: #e8e8e8;
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar {
  width: 40%;
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  animation: progress-slide 1.2s ease-in-out infinite;
}
@keyframes progress-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-soft);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
  display: inline-block;
  box-sizing: border-box;
  vertical-align: middle;
}
.spinner-lg {
  width: 40px;
  height: 40px;
  border-width: 3px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

.processing-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(26, 26, 26, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.processing-overlay.hidden { display: none !important; }
.processing-overlay__panel {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.processing-overlay__panel .spinner {
  margin: 0 auto;
}
.processing-overlay__panel .progress-track {
  width: 100%;
}
.processing-overlay__panel p {
  margin: 1rem 0 0.75rem;
  font-weight: 700;
  color: var(--text);
}
.processing-overlay__hint {
  margin: 0.85rem 0 0 !important;
  font-weight: 400 !important;
  font-size: 0.85rem;
  color: var(--muted) !important;
}

body.is-processing {
  overflow: hidden;
}

.alert-error { background: var(--error-bg); color: var(--error); border: 1px solid #ffbbbb; }
.alert-info { background: var(--info-bg); color: var(--blue-1200); border: 1px solid var(--blue-200); }
.hidden { display: none !important; }

.checkbox-list {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem;
}

.checkbox-list label {
  font-weight: 400;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.25rem 0;
  cursor: pointer;
  font-size: 0.88rem;
  line-height: 1.35;
}

.select-toolbar {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin: 0.35rem 0 0.4rem;
}

.btn-sm {
  padding: 0.28rem 0.65rem;
  font-size: 0.78rem;
  border-radius: 6px;
}

.item-col {
  color: var(--muted);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.82em;
}

.item-lab {
  color: var(--text);
}

.site-footer {
  max-width: 1600px;
  margin: 2rem auto;
  padding: 1.75rem 1.5rem 2.5rem;
  text-align: left;
  color: var(--text-body);
  font-size: 0.875rem;
  border-top: 1px solid var(--border);
  background: #fff;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem 2rem;
}

.site-footer h2 {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
  color: var(--text);
}

.site-footer p,
.site-footer address {
  margin: 0 0 0.45rem;
  font-style: normal;
  line-height: 1.7;
  color: var(--muted);
}

.site-footer .cite-box {
  margin: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-soft);
  border-left: 4px solid var(--primary);
  background: #f8f8fb;
  color: var(--text-body);
}

.site-footer .cite-url {
  display: inline-block;
  margin-top: 0.35rem;
  font-weight: 700;
  word-break: break-all;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-soft);
}
.site-footer__meta {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.8rem;
}
.site-footer__meta a,
.app-version-link {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.site-footer__meta a:hover,
.app-version-link:hover {
  color: var(--text);
}

.dads-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.dads-steps li {
  display: grid;
  grid-template-columns: 2.75rem 1fr;
  gap: 0.85rem;
  align-items: start;
  padding: 1rem;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: #fff;
}

.dads-steps .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
}
.dads-steps .step-num .icon {
  width: 1.25rem;
  height: 1.25rem;
}

.dads-steps .step-body {
  font-size: 0.95rem;
  color: var(--text-body);
  line-height: 1.7;
}
.dads-steps .step-body strong {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--text);
  font-size: 1rem;
}

.legal-page {
  max-width: 42rem;
  margin: 2rem auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.legal-page h1 {
  border-left: 4px solid var(--primary);
  padding-left: 0.75rem;
}

/* ---------- 文書ページ（運営情報・プライバシー・変更履歴）デモUI準拠 ---------- */
.page-doc {
  background: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.page-doc .nav a[aria-current="page"] {
  color: var(--primary);
  font-weight: 600;
}

.doc-main {
  flex: 1;
  padding: 1.5rem 0 3rem;
  background: var(--bg);
}
.doc-layout {
  width: min(100% - 2.5rem, 860px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.doc-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.03em;
  margin-bottom: 1.25rem;
}
.doc-breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}
.doc-breadcrumb a:hover { color: var(--primary); }

.doc-hero {
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-soft);
}
.doc-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.doc-hero h1 {
  margin: 0 0 0.45rem;
  font-size: clamp(1.55rem, 2.2vw, 1.9rem);
  font-weight: 600;
  letter-spacing: 0.015em;
  color: var(--text);
  border: none;
  padding: 0;
}
.doc-updated {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.03em;
}
.doc-lead {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-body);
  line-height: 1.85;
  letter-spacing: 0.025em;
  max-width: 40rem;
}

.doc-toc {
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin-bottom: 2rem;
}
.doc-toc__title {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.doc-toc ol {
  margin: 0;
  padding-left: 1.2rem;
}
.doc-toc li {
  margin: 0.25rem 0;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}
.doc-toc a {
  font-weight: 500;
  text-decoration: none;
}
.doc-toc a:hover { text-decoration: underline; }

.doc-section {
  margin-bottom: 2rem;
}
.doc-section h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text);
  scroll-margin-top: 1.25rem;
}
.doc-section h3 {
  margin: 1.1rem 0 0.45rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.doc-section p,
.doc-section li {
  color: var(--text-body);
  font-size: 0.92rem;
  line-height: 1.85;
  letter-spacing: 0.025em;
}
.doc-section p { margin: 0 0 0.75rem; }
.doc-section ul,
.doc-list {
  margin: 0 0 0.75rem;
  padding-left: 1.25rem;
}
.doc-list {
  display: grid;
  gap: 0.35rem;
}

.doc-meta {
  margin: 0.75rem 0 0;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.doc-meta__row {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.9rem;
}
.doc-meta__row:last-child { border-bottom: 0; }
.doc-meta__row dt {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.03em;
}
.doc-meta__row dd {
  margin: 0;
  color: var(--text-body);
  line-height: 1.7;
  letter-spacing: 0.02em;
  word-break: break-word;
}
@media (max-width: 560px) {
  .doc-meta__row { grid-template-columns: 1fr; gap: 0.25rem; }
}

.doc-callout {
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.1rem;
  margin: 0.75rem 0 1rem;
}
.doc-callout__title {
  margin: 0 0 0.35rem !important;
  font-weight: 600 !important;
  font-size: 0.92rem !important;
  letter-spacing: 0.02em;
  color: var(--text) !important;
}
.doc-callout p { margin: 0 0 0.5rem; }
.doc-callout p:last-child { margin-bottom: 0; }
.doc-callout__url {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0;
  word-break: break-all;
  font-weight: 500;
}

.doc-code {
  margin: 0.5rem 0 1rem;
  padding: 0.85rem 1rem;
  background: #f3f4f6;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  letter-spacing: 0;
  overflow-x: auto;
  color: var(--text-body);
  white-space: pre-wrap;
}

.doc-address {
  font-style: normal;
  color: var(--text-body);
  font-size: 0.9rem;
  line-height: 1.8;
  letter-spacing: 0.02em;
  margin: 0.5rem 0 0.75rem;
}

.doc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-soft);
}

.page-doc .site-footer {
  max-width: none;
  margin: 0;
  padding: 1.75rem 0 1.5rem;
}
.page-doc .site-footer__links {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.schema-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }

table.schema-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
table.schema-table th, table.schema-table td { border: 1px solid var(--border); padding: 0.4rem 0.5rem; vertical-align: middle; }
table.schema-table thead { background: #eef3f8; position: sticky; top: 0; }
table.schema-table input[type="text"] { width: 100%; min-width: 120px; padding: 0.35rem; border: 1px solid var(--border); border-radius: 4px; }
table.schema-table select { width: 100%; min-width: 130px; padding: 0.35rem; font-size: 0.82rem; }
table.schema-table .col-header { font-family: monospace; font-size: 0.78rem; color: var(--primary-dark); white-space: nowrap; }
#schema-table-wrap { max-height: calc(100vh - 230px); overflow: auto; }

.info-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  margin-left: 0.25rem;
  border-radius: 50%;
  background: #d8e6f3;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  font-style: italic;
  cursor: help;
  position: relative;
  vertical-align: middle;
  user-select: none;
}

.info-tip::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translateX(-50%);
  width: max-content;
  max-width: 260px;
  white-space: normal;
  padding: 0.55rem 0.7rem;
  background: #1a2332;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 400;
  font-style: normal;
  line-height: 1.45;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 60;
}

/* 右端の列では左寄せにして見切れを防ぐ */
.info-tip.tip-left::after {
  left: auto;
  right: 0;
  transform: none;
}

.info-tip:hover::after,
.info-tip:focus::after {
  opacity: 1;
  visibility: visible;
}

.download-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.btn-accent:hover { background: var(--blue-50); }

table.combined-table td .cell-count {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1.3;
}
table.combined-table td .cell-pct {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.3;
}
table.combined-table td.cell-high .cell-pct,
table.combined-table td.cell-low .cell-pct {
  color: inherit;
}

/* 任意クロス APA風（実数/比率の上下段） */
table.apa-pair-table {
  font-family: "Yu Gothic", "Hiragino Sans", sans-serif;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.78rem;
  line-height: 1.35;
  width: max-content;
  min-width: 100%;
}
table.apa-pair-table thead th {
  border: none;
  border-top: 2px solid #000;
  background: #fff;
  font-weight: 700;
  padding: 0.4rem 0.45rem;
  text-align: center;
  vertical-align: middle;
}
table.apa-pair-table thead tr.apa-option-row th {
  border-bottom: 1px solid #000;
}
table.apa-pair-table th.apa-cross-head {
  white-space: normal;
  max-width: 42em;
  font-size: 0.8rem;
  text-align: left;
  padding: 0.5rem 0.65rem;
}
table.apa-pair-table th.apa-corner {
  white-space: nowrap;
  font-size: 0.75rem;
}
table.apa-pair-table th.option-header {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  white-space: normal;
  max-height: 12em;
  min-width: 2.2em;
  font-weight: 500;
  font-size: 0.72rem;
  vertical-align: bottom;
}
table.apa-pair-table tbody td,
table.apa-pair-table tbody th {
  border: none;
  padding: 0.2rem 0.45rem;
  vertical-align: middle;
  background: #fff;
}
table.apa-pair-table tbody tr.row-pct td,
table.apa-pair-table tbody tr.row-pct th {
  background: #fff;
}
table.apa-pair-table tbody td {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
table.apa-pair-table tbody tr.row-overall.row-pct + tr.row-category td,
table.apa-pair-table tbody tr.row-overall.row-pct + tr.row-category th {
  border-top: none;
}
table.apa-pair-table tbody tr:last-child td,
table.apa-pair-table tbody tr:last-child th {
  border-bottom: 2px solid #000;
}
table.apa-pair-table th.section-label {
  text-align: center;
  vertical-align: middle;
  font-weight: 700;
  white-space: normal;
  padding: 0.35rem 0.5rem;
  min-width: 5em;
  max-width: 10em;
  background: #fff;
  color: #1a2332;
}
table.apa-pair-table th.section-overall {
  background: #fff;
}
table.apa-pair-table th.category-label {
  text-align: left;
  font-weight: 600;
  white-space: pre-line;
  max-width: 16em;
  background: #fff;
}
table.apa-pair-table tr.row-pct th.category-label {
  background: #fff;
}
table.apa-pair-table td.col-n,
table.apa-pair-table thead th.col-n {
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
}
table.apa-pair-table tbody tr.section-last td,
table.apa-pair-table tbody tr.section-last th {
  border-bottom: 1px solid #000;
}
table.apa-pair-table td.cell-high {
  font-weight: 700;
  background: #c0c0c0;
  text-decoration: none;
}
table.apa-pair-table td.cell-low {
  font-style: normal;
  color: #000;
  text-decoration: underline;
  background: #fff;
}

table.open-text-table td.open-text-answer {
  text-align: left;
  white-space: pre-wrap;
  max-width: 48em;
}
.open-text-card .question-header {
  margin-bottom: 0.25rem;
}

table.merged-faces-table {
  font-family: "Times New Roman", "Yu Mincho", serif;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.78rem;
  line-height: 1.35;
  width: max-content;
  min-width: 100%;
}
table.merged-faces-table tbody td,
table.merged-faces-table tbody th {
  border: none;
  padding: 0.22rem 0.5rem;
  background: #fff;
  vertical-align: middle;
}
table.merged-faces-table thead th {
  border-top: 2px solid #000;
  border-bottom: 1px solid #000;
  border-left: none;
  border-right: none;
  background: #fff;
  font-weight: 700;
  padding: 0.35rem 0.5rem;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
}
table.merged-faces-table tbody td {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
table.merged-faces-table tbody tr:last-child td,
table.merged-faces-table tbody tr:last-child th {
  border-bottom: 2px solid #000;
}
table.merged-faces-table th.section-label {
  text-align: center;
  vertical-align: middle;
  font-weight: 700;
  white-space: normal;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  padding: 0.35rem 0.55rem;
  min-width: 4.5em;
  max-width: 7em;
  background: #fff;
  color: #1a2332;
}
table.merged-faces-table th.section-overall {
  background: #fff;
}
table.merged-faces-table th.category-label {
  text-align: left;
  font-weight: 500;
  white-space: pre-line;
  max-width: 14em;
}
table.merged-faces-table tr.row-pct td,
table.merged-faces-table tr.row-pct th {
  background: #fff;
}
table.merged-faces-table tr.row-pct th.section-label {
  background: #fff;
}
table.merged-faces-table td.col-n,
table.merged-faces-table thead th.col-n {
  text-align: right;
  font-weight: 600;
  min-width: 4.5em;
}
table.merged-faces-table tr.section-last td,
table.merged-faces-table tr.section-last th {
  border-bottom: 1px solid #000;
}
table.merged-faces-table tr.section-spacer td {
  border: none;
  height: 0.65rem;
  padding: 0;
  background: transparent;
}
table.merged-faces-table tr.row-overall th,
table.merged-faces-table tr.row-overall td {
  font-weight: 700;
  background: #fff;
}
table.merged-faces-table td.cell-high {
  background: #c0c0c0;
  color: #000;
  font-weight: 700;
  text-decoration: none;
}
table.merged-faces-table td.cell-low {
  background: #fff;
  color: #000;
  font-style: normal;
  text-decoration: underline;
}
table.merged-faces-table .highlight-legend {
  caption-side: bottom;
  text-align: left;
  font-size: 0.7rem;
  color: #555;
  padding-top: 0.35rem;
  font-family: var(--font);
}

.dnd-cross-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(320px, 1.4fr);
  gap: 1rem;
  align-items: stretch;
  max-height: min(70vh, 640px);
}
@media (max-width: 900px) {
  .dnd-cross-layout {
    grid-template-columns: 1fr;
    max-height: none;
  }
  .dnd-pool-panel,
  .dnd-combos-panel {
    max-height: min(50vh, 420px);
  }
}
.dnd-pool-panel,
.dnd-combos-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: min(70vh, 640px);
}
.dnd-combos-toolbar {
  justify-content: space-between;
  flex-shrink: 0;
  margin-bottom: 0.4rem;
}
.dnd-pool {
  flex: 1 1 auto;
  max-height: none;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem;
  background: #f7fafc;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-height: 120px;
  align-content: flex-start;
}
.dnd-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 1px solid #9bb6d0;
  background: #fff;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  cursor: grab;
  max-width: 100%;
  line-height: 1.3;
  user-select: none;
}
.dnd-chip:active { cursor: grabbing; }
.dnd-chip.is-face {
  border-color: #2d8f6f;
  background: #f1faf6;
}
.dnd-chip .chip-x {
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  padding: 0 0.1rem;
}
.dnd-combos {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.25rem;
  scroll-behavior: smooth;
}
.dnd-combo-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
  background: #fff;
}
.dnd-combo-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
}
.dnd-dropzone {
  min-height: 52px;
  border: 1.5px dashed #9bb6d0;
  border-radius: 8px;
  padding: 0.4rem;
  background: #fafcfe;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
}
.dnd-dropzone.drag-over {
  border-color: var(--primary);
  background: #e8f2fa;
}
.dnd-dropzone-label {
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0 0 0.2rem;
}
.dnd-drop-hint {
  color: var(--muted);
  font-size: 0.75rem;
  padding: 0.25rem;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0,0,0,0.2);
  border: 1px solid var(--border-soft);
  padding: 2rem 1.75rem;
  min-width: 320px;
  max-width: 440px;
  width: min(440px, calc(100vw - 2rem));
  text-align: center;
  position: relative;
}
.modal-box--download { max-width: 480px; }
.modal-close-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: #999;
  cursor: pointer;
  line-height: 1;
}
.modal-close-btn:hover { color: #333; }
.modal-spinner-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 1rem 0;
  width: 100%;
}
.modal-spinner-area .spinner {
  width: 36px;
  height: 36px;
  border-width: 3px;
  margin: 0 auto;
}
.modal-spinner-area .progress-track {
  width: 100%;
}
.modal-spinner-area p {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
}
.modal-ready-area { padding: 0.5rem 0; }
.modal-ready-area.hidden { display: none; }
.modal-done-icon {
  font-size: 2.5rem;
  color: var(--primary);
  margin: 0 0 0.5rem;
  font-weight: 700;
}
.modal-ready-area p {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: var(--text);
}
.modal-ad-caption {
  font-size: 0.8rem !important;
  color: var(--muted) !important;
  margin: 0 0 0.5rem !important;
}
.modal-reward-status {
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  color: var(--primary) !important;
  margin: 0 0 0.65rem !important;
  min-height: 1.35em;
}
.modal-download-btn:disabled,
.modal-download-btn.is-locked {
  opacity: 0.55;
  cursor: not-allowed;
}
.modal-ad-slot {
  margin: 0.5rem 0 1rem;
  min-height: 100px;
  border: 1px dashed var(--border-soft);
  border-radius: var(--radius);
  background: #f8f8fb;
  overflow: hidden;
  padding: 0.35rem;
}
.modal-download-btn {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
}

.ai-guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.ai-prompt-box {
  margin-top: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  background: #f8fafc;
}

.ai-prompt-box pre {
  margin: 0.5rem 0 0;
  padding: 1rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 420px;
  overflow: auto;
}
