/* sakutool.jp 共通スタイル (モバイルファースト) */

:root {
  --color-bg: #ffffff;
  --color-text: #1f2430;
  --color-muted: #6b7280;
  --color-primary: #4338ca;
  --color-primary-dark: #362f9e;
  --color-primary-light: #eef0fd;
  --color-accent: #0ea5a4;
  --color-border: #e5e7eb;
  --color-surface: #f7f8fc;
  --cat-text: #2563eb;
  --cat-text-bg: #eff6ff;
  --cat-create: #7c3aed;
  --cat-create-bg: #f5f3ff;
  --cat-life: #0d9488;
  --cat-life-bg: #f0fdfa;
  --max-width: 720px;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.05), 0 1px 1px rgba(17, 24, 39, 0.03);
  --shadow-md: 0 4px 14px rgba(31, 36, 48, 0.08), 0 1px 3px rgba(31, 36, 48, 0.06);
  --shadow-lg: 0 10px 30px rgba(31, 36, 48, 0.12), 0 2px 6px rgba(31, 36, 48, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic",
    "Meiryo", system-ui, -apple-system, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-primary);
}

img {
  max-width: 100%;
}

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

/* ヘッダー */
.site-header {
  border-bottom: 1px solid var(--color-border);
  padding: 14px 0;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfe 100%);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header .logo {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--color-text);
}

.site-header .logo span {
  background: linear-gradient(120deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.site-header nav {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
}

.site-header nav a {
  text-decoration: none;
  color: var(--color-muted);
  font-weight: 600;
  transition: color 0.15s ease;
}

.site-header nav a:hover {
  color: var(--color-primary);
}

/* パンくず */
.breadcrumb {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin: 14px 0;
}

.breadcrumb a {
  color: var(--color-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* メイン */
main {
  min-height: 60vh;
  padding: 8px 0 40px;
}

h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 8px 0 4px;
}

h2 {
  font-size: 1.12rem;
  font-weight: 700;
  margin: 30px 0 10px;
}

.lead {
  color: var(--color-muted);
  font-size: 0.92rem;
  margin: 0 0 20px;
}

/* ヒーロー (トップページ) */
.hero {
  position: relative;
  text-align: center;
  padding: 34px 0 10px;
}

.hero h1 {
  font-size: 1.65rem;
  line-height: 1.5;
  margin: 0 0 12px;
}

.hero h1 .hero-em {
  display: inline-block;
  background: linear-gradient(120deg, var(--color-primary), var(--color-accent));
  color: #fff;
  padding: 2px 14px;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
}

/* ヒーローの浮遊装飾 (画像不使用・CSSのみ) */
.hero-shape {
  position: absolute;
  pointer-events: none;
  border-radius: 3px;
  opacity: 0.7;
  animation: float 7s ease-in-out infinite alternate;
}

.hero-shape.s1 { width: 14px; height: 14px; background: #818cf8; transform: rotate(24deg); top: 12px; left: 4%; }
.hero-shape.s2 { width: 10px; height: 10px; background: #f472b6; border-radius: 50%; top: 60px; right: 6%; animation-delay: 1.2s; }
.hero-shape.s3 { width: 12px; height: 12px; background: #34d399; transform: rotate(45deg); bottom: 20px; left: 10%; animation-delay: 2.4s; }
.hero-shape.s4 { width: 9px; height: 9px; background: #fbbf24; border-radius: 50%; top: 20px; right: 18%; animation-delay: 0.6s; }
.hero-shape.s5 { width: 12px; height: 12px; background: #60a5fa; transform: rotate(12deg); bottom: 4px; right: 12%; animation-delay: 1.8s; }

@keyframes float {
  from { translate: 0 0; }
  to { translate: 0 -12px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-shape { animation: none; }
}

.hero .catch {
  color: var(--color-muted);
  font-size: 0.95rem;
  margin: 0 0 16px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 22px;
}

.hero-badges .badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #166534;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  padding: 4px 12px;
}

/* ツール検索ボックス (トップページ) */
.tool-search {
  position: relative;
  margin: 0 0 14px;
}

.tool-search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #9ca3af;
}

.tool-search input[type="text"] {
  width: 100%;
  padding: 15px 18px 15px 46px;
  font-size: 1rem;
  border: 1.5px solid transparent;
  border-radius: 999px;
  background: #fff;
  color: var(--color-text);
  font-family: inherit;
  box-shadow: var(--shadow-md);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tool-search input[type="text"]:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

/* カテゴリ絞り込みピル (トップページ) */
.cat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 6px;
}

.cat-pills .pill {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-muted);
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.cat-pills .pill:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.cat-pills .pill.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* ツールカード (トップページ) */
.tool-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 16px 0 22px;
}

.tool-card {
  display: block;
  border: none;
  border-radius: 18px;
  padding: 18px 18px 16px;
  text-decoration: none;
  color: #fff;
  box-shadow: var(--shadow-md);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.tool-card:hover,
.tool-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  filter: brightness(1.06);
}

/* カードごとのビビッド配色 */
.tool-card.tc-violet { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.tool-card.tc-teal { background: linear-gradient(135deg, #14b8a6, #0f766e); }
.tool-card.tc-blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.tool-card.tc-orange { background: linear-gradient(135deg, #f97316, #c2410c); }
.tool-card.tc-rose { background: linear-gradient(135deg, #f43f5e, #be123c); }
.tool-card.tc-emerald { background: linear-gradient(135deg, #10b981, #047857); }
.tool-card.tc-indigo { background: linear-gradient(135deg, #6366f1, #4f46e5); }

.tool-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.tool-icon {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.tool-arrow {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.9);
  transition: transform 0.16s ease;
}

.tool-card:hover .tool-arrow {
  transform: translateX(4px);
}

.tool-card h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
}

.tool-card p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.88);
}

/* 実績バー (トップページ) */
.stats-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 10px;
  background: var(--color-surface);
  border-radius: 16px;
  padding: 20px 16px;
  margin: 26px 0 8px;
  text-align: center;
}

.stats-bar .stat .num {
  display: block;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: linear-gradient(120deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stats-bar .stat .label {
  display: block;
  font-size: 0.76rem;
  color: var(--color-muted);
  font-weight: 600;
}

@media (min-width: 640px) {
  .stats-bar {
    grid-template-columns: repeat(4, 1fr);
  }
}

.no-results {
  display: none;
  text-align: center;
  color: var(--color-muted);
  font-size: 0.9rem;
  padding: 28px 0;
}

@media (min-width: 640px) {
  .tool-grid {
    grid-template-columns: 1fr 1fr;
  }
  .hero h1 {
    font-size: 1.9rem;
  }
}

/* FAQ (トップページ) */
.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin: 0 0 10px;
  background: #fff;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 13px 16px;
  list-style: none;
  position: relative;
  padding-right: 36px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: var(--color-muted);
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item .faq-body {
  padding: 0 16px 14px;
  font-size: 0.87rem;
  color: var(--color-muted);
}

/* フォーム部品 */
.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #374151;
}

textarea,
input[type="text"],
input[type="number"],
input[type="date"],
select {
  width: 100%;
  padding: 11px 13px;
  font-size: 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--color-text);
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea:focus,
input:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.btn {
  display: inline-block;
  padding: 12px 22px;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.btn:hover {
  background: var(--color-primary-dark);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(1px);
  box-shadow: var(--shadow-sm);
}

.btn.secondary {
  background: #fff;
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
  box-shadow: none;
}

.btn.secondary:hover {
  background: var(--color-primary-light);
  box-shadow: none;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

.color-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  cursor: pointer;
  padding: 0;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.color-swatch:hover {
  transform: scale(1.08);
}

.color-swatch.selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.result-area {
  margin-top: 24px;
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* 広告スロット (AdSenseポリシー §10 準拠) */
.ad-slot {
  margin: 32px 0;
}

.ad-label {
  text-align: center;
  font-size: 0.7rem;
  color: #9ca3af;
  margin: 0 0 8px;
  letter-spacing: 0.08em;
}

.ad-placeholder {
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  border: 1.5px dashed #d7dae3;
  border-radius: var(--radius);
  color: #b0b6bf;
  font-size: 0.8rem;
  text-align: center;
  padding: 12px;
}

/* 早見表テーブル */
table.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin: 12px 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

table.compare th,
table.compare td {
  border: 1px solid var(--color-border);
  padding: 7px 8px;
  text-align: center;
}

table.compare th {
  background: var(--color-surface);
  font-weight: 700;
}

table.compare tr.current {
  background: var(--color-primary-light);
  font-weight: 700;
}

/* フッター */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 26px 0 32px;
  font-size: 0.8rem;
  color: var(--color-muted);
  background: var(--color-surface);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 12px;
  margin-bottom: 18px;
}

.footer-col h4 {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 8px;
  letter-spacing: 0.04em;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-col a {
  color: var(--color-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-col a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.site-footer .copyright {
  border-top: 1px solid var(--color-border);
  padding-top: 14px;
  margin: 0;
}

.site-footer .footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}

.site-footer .footer-links a {
  color: var(--color-muted);
  transition: color 0.15s ease;
}

.site-footer .footer-links a:hover {
  color: var(--color-primary);
}

/* 内部リンク (回遊導線) */
.related-tools {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

.related-tools ul {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

@media (min-width: 640px) {
  .related-tools ul {
    grid-template-columns: 1fr 1fr;
  }
}

.related-tools a {
  display: block;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.related-tools a::after {
  content: " →";
  color: var(--color-muted);
}

.related-tools a:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: #d9dcf5;
  text-decoration: none;
}

/* ユーティリティ */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.canvas-wrap {
  width: 100%;
  overflow-x: auto;
  text-align: center;
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 14px;
}

.canvas-wrap canvas {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: var(--shadow-lg);
}

.notice-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 0.85rem;
  margin: 16px 0;
}

/* 運行情報ステータス行 */
.train-line-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}

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

.train-status-dot {
  flex: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  margin-top: 5px;
  background: #9ca3af;
}

.train-status-dot.status-normal {
  background: #22c55e;
}

.train-status-dot.status-delay {
  background: #f59e0b;
}

.train-status-dot.status-stop {
  background: #ef4444;
}

.train-line-name {
  font-weight: 700;
  font-size: 0.92rem;
  margin: 0 0 2px;
}

.train-line-text {
  font-size: 0.85rem;
  color: var(--color-text);
  margin: 0;
}

.train-updated-at {
  font-size: 0.75rem;
  color: var(--color-muted);
  margin: 10px 0 0;
}