/* 中小DXラボ ツールサイト共通スタイル
   外部フォント・外部スクリプトは使わない(閲覧者の情報を第三者のサーバに渡さないため)。
   配色はトークン(--*)で決め、ライト/ダークは prefers-color-scheme と html[data-theme] で切り替える。 */

/* ---------- tokens ---------- */
:root {
  color-scheme: light;
  --bg: #f7f7fb;
  --bg-tint: #eef0fb;
  --surface: #ffffff;
  --surface-2: #f3f4f9;
  --surface-3: #eceef6;
  --glass: rgba(255, 255, 255, 0.72);
  --input-bg: #ffffff;
  --text: #0e1124;
  --text-2: #363b55;
  --muted: #5a5f78;
  --border: rgba(14, 17, 36, 0.09);
  --border-strong: rgba(14, 17, 36, 0.17);
  --accent: #4f46e5;
  --accent-strong: #4338ca;
  --accent-soft: rgba(79, 70, 229, 0.08);
  --accent-soft-2: rgba(79, 70, 229, 0.16);
  --link: #4338ca;
  --link-hover: #312e81;
  --grad: linear-gradient(120deg, #6d5dfc 0%, #3b6ef6 48%, #0e8fb4 100%);
  --grad-text: linear-gradient(100deg, #5b4cf0 0%, #2557e0 50%, #0e7490 100%);
  --grad-btn: linear-gradient(180deg, #5d55f0 0%, #4a41dc 100%);
  --ok: #046c4e;
  --ok-bg: #e5f6ee;
  --ok-border: rgba(4, 108, 78, 0.22);
  --warn: #8a3b05;
  --warn-bg: #fff5e6;
  --warn-border: rgba(180, 83, 9, 0.25);
  --code-bg: #0c0f1d;
  --code-border: rgba(255, 255, 255, 0.06);
  --code-text: #e4e7f3;
  --code-bar: #121628;
  --inline-code-bg: rgba(79, 70, 229, 0.07);
  --inline-code-text: #3b2fc4;
  --mark: rgba(99, 102, 241, 0.18);
  --ring: rgba(99, 102, 241, 0.55);
  --shadow-sm: 0 1px 2px rgba(14, 17, 36, 0.05), 0 1px 1px rgba(14, 17, 36, 0.03);
  --shadow-md: 0 1px 2px rgba(14, 17, 36, 0.05), 0 8px 24px -8px rgba(30, 27, 90, 0.16);
  --shadow-lg: 0 2px 4px rgba(14, 17, 36, 0.04), 0 24px 60px -18px rgba(38, 32, 120, 0.28);
  --glow: rgba(99, 102, 241, 0.14);
  --hero-1: rgba(124, 108, 255, 0.36);
  --hero-2: rgba(59, 130, 246, 0.28);
  --hero-3: rgba(25, 195, 230, 0.26);
  --grid-line: rgba(14, 17, 36, 0.05);
  --font-sans: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "BIZ UDPGothic", "Noto Sans JP", "Noto Sans CJK JP", "Yu Gothic UI", Meiryo, system-ui, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "BIZ UDPGothic", "Noto Sans JP", "Noto Sans CJK JP", "Yu Gothic UI", Meiryo, system-ui, sans-serif;
  --font-mono: "Cascadia Code", "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, "BIZ UDGothic", monospace;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --w: 1200px;
  --gutter: 24px;
  --header-h: 60px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #090a12;
    --bg-tint: #10122a;
    --surface: #10121d;
    --surface-2: #151827;
    --surface-3: #1b1f31;
    --glass: rgba(12, 14, 24, 0.66);
    --input-bg: #0c0e18;
    --text: #eceef8;
    --text-2: #c6cadc;
    --muted: #979db6;
    --border: rgba(255, 255, 255, 0.075);
    --border-strong: rgba(255, 255, 255, 0.15);
    --accent: #8b8dff;
    --accent-strong: #a5b4fc;
    --accent-soft: rgba(129, 140, 248, 0.1);
    --accent-soft-2: rgba(129, 140, 248, 0.2);
    --link: #aab4ff;
    --link-hover: #d4d9ff;
    --grad: linear-gradient(120deg, #8b7bff 0%, #4f8bff 48%, #22c7e6 100%);
    --grad-text: linear-gradient(100deg, #b4a8ff 0%, #7aa7ff 50%, #4fd8f0 100%);
    --grad-btn: linear-gradient(180deg, #5d55f0 0%, #4a41dc 100%);
    --ok: #74e3b6;
    --ok-bg: rgba(16, 185, 129, 0.11);
    --ok-border: rgba(52, 211, 153, 0.24);
    --warn: #fcd27a;
    --warn-bg: rgba(245, 158, 11, 0.1);
    --warn-border: rgba(251, 191, 36, 0.24);
    --code-bg: #0f1222;
    --code-border: rgba(255, 255, 255, 0.1);
    --code-bar: #151a2e;
    --inline-code-bg: rgba(129, 140, 248, 0.12);
    --inline-code-text: #cdd3ff;
    --mark: rgba(129, 140, 248, 0.26);
    --ring: rgba(165, 180, 252, 0.7);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.5), 0 10px 30px -10px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.4), 0 30px 70px -20px rgba(0, 0, 0, 0.75);
    --glow: rgba(129, 140, 248, 0.14);
    --hero-1: rgba(124, 108, 255, 0.32);
    --hero-2: rgba(59, 130, 246, 0.22);
    --hero-3: rgba(25, 195, 230, 0.18);
    --grid-line: rgba(255, 255, 255, 0.045);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #090a12;
  --bg-tint: #10122a;
  --surface: #10121d;
  --surface-2: #151827;
  --surface-3: #1b1f31;
  --glass: rgba(12, 14, 24, 0.66);
  --input-bg: #0c0e18;
  --text: #eceef8;
  --text-2: #c6cadc;
  --muted: #979db6;
  --border: rgba(255, 255, 255, 0.075);
  --border-strong: rgba(255, 255, 255, 0.15);
  --accent: #8b8dff;
  --accent-strong: #a5b4fc;
  --accent-soft: rgba(129, 140, 248, 0.1);
  --accent-soft-2: rgba(129, 140, 248, 0.2);
  --link: #aab4ff;
  --link-hover: #d4d9ff;
  --grad: linear-gradient(120deg, #8b7bff 0%, #4f8bff 48%, #22c7e6 100%);
  --grad-text: linear-gradient(100deg, #b4a8ff 0%, #7aa7ff 50%, #4fd8f0 100%);
  --grad-btn: linear-gradient(180deg, #5d55f0 0%, #4a41dc 100%);
  --ok: #74e3b6;
  --ok-bg: rgba(16, 185, 129, 0.11);
  --ok-border: rgba(52, 211, 153, 0.24);
  --warn: #fcd27a;
  --warn-bg: rgba(245, 158, 11, 0.1);
  --warn-border: rgba(251, 191, 36, 0.24);
  --code-bg: #0f1222;
  --code-border: rgba(255, 255, 255, 0.1);
  --code-bar: #151a2e;
  --inline-code-bg: rgba(129, 140, 248, 0.12);
  --inline-code-text: #cdd3ff;
  --mark: rgba(129, 140, 248, 0.26);
  --ring: rgba(165, 180, 252, 0.7);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.5), 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.4), 0 30px 70px -20px rgba(0, 0, 0, 0.75);
  --glow: rgba(129, 140, 248, 0.14);
  --hero-1: rgba(124, 108, 255, 0.32);
  --hero-2: rgba(59, 130, 246, 0.22);
  --hero-3: rgba(25, 195, 230, 0.18);
  --grid-line: rgba(255, 255, 255, 0.045);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
  background: var(--bg);
  overflow-x: clip;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: 0.01em;
  font-feature-settings: "palt" 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-wrap: anywhere;
  overflow-x: clip;
}

/* ページ上部のうっすらしたグラデーション(全ページ共通の地) */
body::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 560px;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60% 70% at 12% 0%, var(--hero-1), transparent 70%),
    radial-gradient(50% 60% at 88% 0%, var(--hero-3), transparent 70%);
  opacity: 0.38;
}
:root[data-mode="dark"] body::before { opacity: 0.55; }
body.pg-home::before { opacity: 0; }

::selection { background: var(--accent-soft-2); }

img, svg { max-width: 100%; }

a {
  color: var(--link);
  text-decoration-line: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: color 0.15s var(--ease), text-decoration-color 0.15s var(--ease);
}
a:hover { color: var(--link-hover); text-decoration-color: currentColor; }

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 6px;
}

strong { font-weight: 700; color: var(--text); }

.wrap {
  width: 100%;
  max-width: calc(var(--w) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.25s var(--ease), background 0.25s var(--ease);
}
.site-header.is-scrolled { box-shadow: 0 6px 24px -14px rgba(14, 17, 36, 0.35); }
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 8px 20px;
  min-height: var(--header-h);
}
.site-header .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0;
  white-space: nowrap;
}
.brand-mark {
  flex: none;
  border-radius: 9px;
  box-shadow: 0 4px 14px -4px rgba(79, 70, 229, 0.55);
  transition: transform 0.35s var(--ease);
}
.site-header .brand:hover .brand-mark { transform: rotate(-6deg) scale(1.04); }
.brand-sub { color: var(--muted); font-weight: 500; }

.site-header nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  justify-content: flex-end;
  min-width: 0;
}
.site-header nav a {
  flex: none;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.site-header nav a:hover { background: var(--surface-3); color: var(--text); }
.site-header nav a[aria-current="page"] { background: var(--accent-soft-2); color: var(--text); }

.theme-toggle {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-2);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { color: var(--text); background: var(--surface-2); transform: none; box-shadow: var(--shadow-sm); }
.theme-toggle svg { grid-area: 1 / 1; transition: transform 0.4s var(--ease), opacity 0.25s var(--ease); }
.theme-toggle .i-moon { opacity: 0; transform: rotate(-60deg) scale(0.6); }
html[data-mode="dark"] .theme-toggle .i-sun { opacity: 0; transform: rotate(60deg) scale(0.6); }
html[data-mode="dark"] .theme-toggle .i-moon { opacity: 1; transform: none; }

@media (max-width: 1180px) {
  .site-header .wrap { flex-wrap: wrap; padding-top: 10px; padding-bottom: 0; }
  .site-header .brand { margin-right: auto; }
  .site-header nav {
    order: 3;
    flex: 1 0 100%;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 2px 0 8px;
    margin: 0 calc(var(--gutter) * -1);
    padding-left: calc(var(--gutter) - 10px);
    padding-right: var(--gutter);
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--gutter), #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(90deg, transparent 0, #000 var(--gutter), #000 calc(100% - 28px), transparent);
  }
  .site-header nav::-webkit-scrollbar { display: none; }
}

/* ---------- main & headings ---------- */
main { display: block; padding: 8px var(--gutter) 72px; }

h1, h2, h3 { font-family: var(--font-display); color: var(--text); }
h1 {
  font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem);
  line-height: 1.3;
  letter-spacing: -0.012em;
  font-weight: 800;
  margin: 28px 0 14px;
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  line-height: 1.45;
  letter-spacing: -0.005em;
  font-weight: 750;
  margin: 56px 0 14px;
  text-wrap: balance;
}
h3 { font-size: 1.08rem; line-height: 1.5; font-weight: 700; margin: 30px 0 8px; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.4em; }
li { margin: 0.3em 0; }
li::marker { color: var(--muted); }
ol > li::marker { font-variant-numeric: tabular-nums; font-weight: 600; }

.lead {
  color: var(--text-2);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.08rem);
  line-height: 1.85;
  max-width: 820px;
  margin: 0 0 24px;
}

.hint { color: var(--muted); font-size: 0.86rem; line-height: 1.7; margin: 4px 0 0; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- cards ---------- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin: 20px 0;
  box-shadow: var(--shadow-sm);
}
.card > h2:first-child, .card > h2:first-of-type { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }

/* カーソルの位置に光を足す(ui.js が --mx / --my を入れる) */
.tool-card::before, .guide-list > li.card::before, .link-grid a::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 0%), var(--glow), transparent 70%);
}
.tool-card:hover::before, .guide-list > li.card:hover::before, .link-grid a:hover::before { opacity: 1; }

/* ---------- buttons ---------- */
button, .btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: 0.01em;
  color: #fff;
  background: var(--grad-btn);
  border: 1px solid rgba(40, 30, 160, 0.6);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 1px 2px rgba(20, 16, 90, 0.25), 0 6px 18px -8px rgba(79, 70, 229, 0.7);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease), filter 0.2s var(--ease), background 0.2s var(--ease);
}
button:hover, .btn:hover { color: #fff; filter: brightness(1.08); transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 2px 4px rgba(20, 16, 90, 0.2), 0 12px 26px -10px rgba(79, 70, 229, 0.8); }
button:active, .btn:active { transform: translateY(0) scale(0.985); }
button:disabled, button:disabled:hover { opacity: 0.45; cursor: not-allowed; transform: none; filter: none; }
button.secondary, .btn-ghost {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
}
button.secondary:hover, .btn-ghost:hover { color: var(--text); background: var(--surface-2); box-shadow: var(--shadow-md); filter: none; }
.buttons { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }

.btn { min-height: 46px; padding: 10px 20px; font-size: 0.96rem; border-radius: 12px; }
.btn-arrow { transition: transform 0.2s var(--ease); }
.btn:hover .btn-arrow { transform: translateX(3px); }

/* ---------- home: hero ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  align-items: center;
  gap: 48px;
  padding: 72px 0 64px;
  isolation: isolate;
}
.hero-bg {
  position: absolute;
  z-index: -1;
  top: -80px;
  bottom: -40px;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  overflow: hidden;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(70% 75% at 50% 35%, #000 30%, transparent 78%);
  mask-image: radial-gradient(70% 75% at 50% 35%, #000 30%, transparent 78%);
}
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.blob {
  position: absolute;
  width: 46vw;
  max-width: 720px;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.9;
  animation: drift 22s var(--ease) infinite alternate;
}
.blob.b1 { background: radial-gradient(circle, var(--hero-1), transparent 65%); top: -18%; left: 8%; }
.blob.b2 { background: radial-gradient(circle, var(--hero-2), transparent 65%); top: 4%; right: 6%; animation-delay: -7s; animation-duration: 26s; }
.blob.b3 { background: radial-gradient(circle, var(--hero-3), transparent 65%); bottom: -30%; left: 38%; animation-delay: -13s; animation-duration: 30s; }
@keyframes drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(4%, 6%, 0) scale(1.08); }
  100% { transform: translate3d(-5%, -3%, 0) scale(0.96); }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 22px;
  padding: 5px 12px 5px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-2);
  background: var(--glass);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.eyebrow-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 0 3px var(--accent-soft-2);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 6px transparent; } }

.hero h1 {
  font-size: clamp(2.15rem, 1.3rem + 3.6vw, 3.75rem);
  line-height: 1.14;
  letter-spacing: -0.025em;
  font-weight: 800;
  margin: 0 0 22px;
}
.grad {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.hero .lead { font-size: clamp(1rem, 0.95rem + 0.25vw, 1.1rem); max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 22px; }
.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  list-style: none;
  padding: 0;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}
.hero-points li { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.hero-points li::before {
  content: "";
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--ok-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2l2.2 2.2 4.8-4.8' fill='none' stroke='%2310b981' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
  box-shadow: inset 0 0 0 1px var(--ok-border);
}

.hero-visual { position: relative; perspective: 1400px; }
.window {
  position: relative;
  background: linear-gradient(180deg, rgba(20, 24, 44, 0.92), rgba(9, 11, 22, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(79, 70, 229, 0.08), 0 40px 120px -40px rgba(79, 70, 229, 0.55);
  overflow: hidden;
  transform: rotateY(-9deg) rotateX(5deg) translateZ(0);
  transform-origin: 60% 50%;
  transition: transform 0.8s var(--ease);
}
.hero-visual:hover .window { transform: rotateY(-3deg) rotateX(2deg); }
.window::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.09), transparent 38%);
}
.window-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.025);
}
.window-bar span { width: 11px; height: 11px; border-radius: 50%; background: #3a3f57; }
.window-bar span:nth-child(1) { background: #ff5f57; }
.window-bar span:nth-child(2) { background: #febc2e; }
.window-bar span:nth-child(3) { background: #28c840; }
.window-bar em { margin-left: 10px; font-style: normal; font-family: var(--font-mono); font-size: 12px; color: #9aa3c4; }
pre.window-code {
  margin: 0;
  padding: 20px 22px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 13.5px;
  line-height: 1.75;
  color: #dfe3f5;
}
.t-k, pre .tk { color: #a9b6ff; }
.t-s, pre .ts { color: #7ee2c5; }
.t-p, pre .tp { color: #8a91b4; }
pre .tn { color: #f9b97a; }
.window-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-family: var(--font-mono);
  font-size: 12px;
  color: #9aa3c4;
}
.ok-dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 10px #34d399; }
.float-chip {
  position: absolute;
  padding: 7px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  background: var(--glass);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  white-space: nowrap;
  animation: float 7s ease-in-out infinite;
}
.chip-a { top: -18px; right: 6%; }
.chip-b { bottom: -18px; right: 8%; animation-delay: -3.5s; }
@keyframes float { 50% { transform: translateY(-8px); } }

/* ---------- home: sections ---------- */
.section-title {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem);
  letter-spacing: -0.015em;
  margin: 56px 0 22px;
}
.section-kicker {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.tool-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.tool-list > li { margin: 0; }
.tool-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}
.tool-list > li:first-child { grid-column: span 2; }
.tool-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  box-shadow: var(--shadow-lg);
}
.tool-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: var(--accent);
  background: linear-gradient(140deg, var(--accent-soft-2), var(--accent-soft));
  box-shadow: inset 0 0 0 1px var(--accent-soft-2);
  transition: transform 0.3s var(--ease);
}
.tool-card:hover .tool-icon { transform: scale(1.06) rotate(-4deg); }
.tool-card h3 { margin: 18px 0 8px; font-size: 1.06rem; line-height: 1.5; padding-right: 28px; }
.tool-card h3 a { color: var(--text); text-decoration: none; }
.tool-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: 1; }
.tool-card h3 a:focus-visible { outline: none; }
.tool-card:has(h3 a:focus-visible) { outline: 2px solid var(--ring); outline-offset: 3px; }
.tool-card h3::after {
  content: "→";
  position: absolute;
  top: 24px;
  right: 24px;
  color: var(--muted);
  font-weight: 500;
  transition: transform 0.25s var(--ease), color 0.25s var(--ease);
}
.tool-card:hover h3::after { transform: translateX(4px); color: var(--accent); }
.tool-card p { color: var(--muted); font-size: 0.9rem; line-height: 1.8; margin: 0; }
.tool-card code { font-size: 0.85em; }

.link-grid {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.link-grid li { margin: 0; }
.link-grid a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 100%;
  padding: 14px 18px;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.6;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.link-grid a::after { content: "→"; flex: none; color: var(--muted); transition: transform 0.2s var(--ease), color 0.2s var(--ease); }
.link-grid a:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.link-grid a:hover::after { transform: translateX(3px); color: var(--accent); }

.band {
  margin-top: 56px;
  padding: 32px;
  overflow: hidden;
  border: 1px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(120deg, rgba(124, 108, 255, 0.55), rgba(59, 130, 246, 0.25) 45%, rgba(25, 195, 230, 0.55)) border-box;
}
.band::after {
  content: "";
  position: absolute;
  right: -120px;
  top: -140px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--hero-1), transparent 70%);
  pointer-events: none;
}
.band h2 { position: relative; margin-top: 0; }
.band p { position: relative; max-width: 760px; color: var(--text-2); }

/* ---------- forms ---------- */
form { margin: 0; }
fieldset {
  min-width: 0;
  margin: 0;
  padding: 20px 0;
  border: 0;
  border-top: 1px solid var(--border);
}
.tool-input > form > fieldset:first-child, .tool-input > form > :first-child { border-top: 0; padding-top: 0; }
#full-only > fieldset:first-child { border-top: 1px solid var(--border); }
legend {
  float: left;
  width: 100%;
  padding: 0;
  margin: 0 0 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
}
legend + * { clear: both; }
fieldset:has(> .opt > input[type="radio"]):not(:has(> :not(legend, .opt))) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}
fieldset:has(> .opt > input[type="radio"]):not(:has(> :not(legend, .opt))) > legend { grid-column: 1 / -1; margin-bottom: 4px; }

.opt {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 8px 0;
  font-size: 0.93rem;
  line-height: 1.65;
}
.opt label { flex: 1; cursor: pointer; padding-top: 1px; }

/* チェックボックス → スイッチ */
.opt input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  position: relative;
  width: 38px;
  height: 22px;
  margin: 1px 0 0;
  border-radius: 999px;
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--border-strong);
  cursor: pointer;
  transition: background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.opt input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 0 0 0.5px rgba(0, 0, 0, 0.05);
  transition: transform 0.25s var(--ease);
}
.opt input[type="checkbox"]:checked { background: var(--grad-btn); box-shadow: inset 0 0 0 1px rgba(40, 30, 160, 0.4); }
.opt input[type="checkbox"]:checked::before { transform: translateX(16px); }
.opt input[type="checkbox"]:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

/* ラジオ → 選べるタイル */
.opt:has(> input[type="radio"]) {
  margin: 0 0 8px;
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
fieldset[style*="grid"] .opt, fieldset:has(> .opt > input[type="radio"]) > .opt { margin: 0; }
.opt:has(> input[type="radio"]):hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border-strong)); }
.opt:has(> input[type="radio"]:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-sm);
}
.opt:has(> input[type="radio"]:focus-visible) { outline: 2px solid var(--ring); outline-offset: 2px; }
.opt:has(> input[type="radio"]) label::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.opt input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  border-radius: 50%;
  background: var(--input-bg);
  box-shadow: inset 0 0 0 1.5px var(--border-strong);
  cursor: pointer;
  transition: box-shadow 0.2s var(--ease);
}
.opt input[type="radio"]:checked { box-shadow: inset 0 0 0 5.5px var(--accent); background: #fff; }
.opt input[type="radio"]:focus-visible { outline: none; }

label.field { display: block; margin: 16px 0 6px; font-size: 0.86rem; font-weight: 650; color: var(--text-2); }
legend + label.field { margin-top: 0; }

input[type="text"], input[type="number"], select, textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s var(--ease);
}
input[type="text"]:hover, input[type="number"]:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border-strong)); }
input[type="text"]:focus, input[type="number"]:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft-2);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.8; }
input:disabled, select:disabled, textarea:disabled { opacity: 0.5; cursor: not-allowed; }
input[type="number"] { font-variant-numeric: tabular-nums; }
select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 38px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%237b80a0' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}
textarea { min-height: 0; resize: vertical; line-height: 1.6; }
input.wide { max-width: 100%; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }

/* ---------- tool pages ---------- */
.tool-panel { padding: 28px; margin-top: 28px; }
.tool-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.tool-output {
  min-width: 0;
  padding: 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.tool-output > h3:first-child, .tool-output > :first-child, .tool-output > [hidden]:first-child + h3 { margin-top: 0; }
.tool-output > h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
}
.tool-output > h3::before {
  content: "";
  flex: none;
  width: 42px;
  height: 10px;
  background:
    radial-gradient(circle at 5px 5px, #ff5f57 4.5px, transparent 5px),
    radial-gradient(circle at 21px 5px, #febc2e 4.5px, transparent 5px),
    radial-gradient(circle at 37px 5px, #28c840 4.5px, transparent 5px);
}
.tool-output .buttons { margin-bottom: 4px; }
.tool-output .result-list { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 4px 16px; }
.tool-output .result-list li:last-child { border-bottom: 0; }
.tool-output #res-total {
  font-size: 1.25rem;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
@media (min-width: 1080px) {
  .tool-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.04fr); gap: 32px; align-items: start; }
  .tool-output { position: sticky; top: calc(var(--header-h) + 20px); }
  .tool-output pre { max-height: min(62vh, 640px); }
}
.pg-tool main > section:not(.tool-panel), .pg-tool main > aside { max-width: 860px; }

/* ---------- code ---------- */
pre, code, kbd, samp { font-family: var(--font-mono); }
pre {
  position: relative;
  margin: 14px 0;
  padding: 16px 18px;
  overflow: auto;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--code-text);
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), var(--shadow-sm);
  tab-size: 2;
  scrollbar-color: #2f3552 transparent;
}
pre code { color: inherit; background: none; padding: 0; border: 0; font-size: inherit; white-space: pre; overflow-wrap: normal; }
pre:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
:not(pre) > code {
  padding: 0.12em 0.42em;
  font-size: 0.86em;
  color: var(--inline-code-text);
  background: var(--inline-code-bg);
  border: 1px solid var(--accent-soft);
  border-radius: 6px;
  overflow-wrap: anywhere;
}
a > code { color: inherit; }

.codeblock { position: relative; margin: 14px 0; }
.codeblock > pre { margin: 0; padding-top: 40px; }
.codeblock::before {
  content: attr(data-label);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1;
  height: 32px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: #8990b0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--code-bar);
  border-radius: var(--radius) var(--radius) 0 0;
  pointer-events: none;
}
.copy-btn {
  position: absolute;
  top: 4px;
  right: 6px;
  z-index: 2;
  min-height: 24px;
  padding: 2px 10px;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #c8cdea;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  box-shadow: none;
}
.copy-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.12); box-shadow: none; transform: none; filter: none; }
.copy-btn.is-done { color: #7ee2c5; border-color: rgba(126, 226, 197, 0.4); }

/* ---------- status / badges / notes ---------- */
.status {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 6px 0 10px;
  font-size: 0.88rem;
  color: var(--muted);
}
.status::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 0.62em; border-radius: 50%; background: var(--muted); }
.status.ok { color: var(--ok); }
.status.ok::before { background: #10b981; box-shadow: 0 0 0 3px var(--ok-bg); }
.status.ng { color: var(--warn); }
.status.ng::before { background: #f59e0b; box-shadow: 0 0 0 3px var(--warn-bg); }

.badge {
  display: inline-block;
  padding: 2px 9px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.5;
  border-radius: 999px;
  white-space: nowrap;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok-border); }
.badge.warn { background: var(--warn-bg); color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn-border); white-space: normal; }

.note {
  position: relative;
  margin: 16px 0;
  padding: 14px 16px 14px 44px;
  color: var(--text-2);
  font-size: 0.92rem;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius);
}
.note::before {
  content: "!";
  position: absolute;
  left: 14px;
  top: 15px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: #d97706;
  border-radius: 50%;
}
.note p { margin: 0 0 6px; }
.note p:last-child { margin: 0; }

.result-list { list-style: none; padding: 0; margin: 0; }
.result-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 16px;
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.result-list .val { font-weight: 750; font-variant-numeric: tabular-nums; font-family: var(--font-display); }

/* ---------- tables ---------- */
.table-scroll {
  margin: 16px 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.9rem; line-height: 1.7; }
th, td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
th {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-2);
  background: var(--surface-2);
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background 0.15s var(--ease); }
tbody tr:hover { background: var(--accent-soft); }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
:not(.table-scroll) > table { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }

.ts-table { min-width: 760px; }
.ts-table th:nth-child(1) { width: 26%; }
.ts-table th:nth-child(2), .ts-table th:nth-child(3) { width: 26%; }
.ts-table .badge { white-space: normal; border-radius: 8px; }
.source-list { margin: 6px 0 0; padding-left: 1.1em; }
.source-list li { margin: 2px 0; }

/* ---------- details / FAQ ---------- */
details {
  margin: 10px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
details[open] { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
summary {
  position: relative;
  display: block;
  padding: 14px 48px 14px 18px;
  font-weight: 650;
  line-height: 1.6;
  cursor: pointer;
  list-style: none;
  border-radius: inherit;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 9px;
  height: 9px;
  margin-top: -6px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.25s var(--ease), margin 0.25s var(--ease);
}
details[open] > summary::after { transform: rotate(225deg); margin-top: -1px; }
summary:hover { color: var(--accent-strong); }
details > :not(summary) { margin-left: 18px; margin-right: 18px; }
details > :last-child:not(summary) { margin-bottom: 16px; }
details > p { color: var(--text-2); }
details[open] > summary + * { animation: reveal 0.3s var(--ease); }
@keyframes reveal { from { opacity: 0; transform: translateY(-4px); } }
.tool-output details { background: var(--surface); }
.tool-output details > .result-list { margin-bottom: 8px; }

/* ---------- callouts & asides ---------- */
.summary-box {
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  background:
    radial-gradient(120% 140% at 0% 0%, var(--accent-soft-2), transparent 55%),
    var(--surface);
}
.summary-box h2, .tool-cta h2, .related h2, .follow-box h2, .paid-cta h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.02rem;
  margin: 0 0 10px;
}
.summary-box h2::before, .tool-cta h2::before {
  content: "";
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--grad) ;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect width='24' height='24' rx='7'/%3E%3C/svg%3E") center / contain no-repeat;
  box-shadow: 0 4px 12px -4px rgba(79, 70, 229, 0.6);
}
.summary-box h2::before {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 12.5l3.2 3.2L17 9' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat,
    var(--grad);
  -webkit-mask: none;
}
.summary-box ul { margin: 6px 0 0; padding-left: 1.2em; }
.summary-box ul.offer-list { padding-left: 0; margin-top: 14px; }
.summary-box li { margin: 0.45em 0; }
.summary-box li::marker { color: var(--accent); }

.tool-cta {
  border: 1px solid var(--ok-border);
  background:
    radial-gradient(120% 140% at 100% 0%, var(--ok-bg), transparent 60%),
    var(--surface);
}
.tool-cta h2::before {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M13 4L6 13.5h5L10 20l7-9.5h-5L13 4z' fill='white'/%3E%3C/svg%3E") center / 16px no-repeat,
    linear-gradient(135deg, #10b981, #0e8fb4);
  -webkit-mask: none;
  box-shadow: 0 4px 12px -4px rgba(16, 185, 129, 0.6);
}

.related ul { list-style: none; padding: 0; margin: 6px 0 0; }
.related li {
  margin: 0;
  padding: 11px 0;
  border-top: 1px solid var(--border);
  font-size: 0.93rem;
  line-height: 1.7;
}
.related li:first-child { border-top: 0; padding-top: 4px; }
.related li > a { font-weight: 600; text-decoration: none; color: var(--text); }
.related li > a:hover { color: var(--accent-strong); text-decoration: underline; }
.related .hint { display: inline-block; margin-top: 2px; }
.tag {
  display: inline-block;
  margin-left: 8px;
  padding: 0 8px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.75;
  color: var(--muted);
  vertical-align: 0.1em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  white-space: nowrap;
}

/* 有料の本・記事(はっきり「有料」と分かるように、見出しの前にラベルを付ける) */
.paid-cta {
  padding: 26px 28px;
  overflow: hidden;
  border: 1px solid transparent;
  background:
    radial-gradient(90% 120% at 100% 0%, var(--accent-soft-2), transparent 55%) padding-box,
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, #8b7bff, #4f8bff 45%, #22c7e6) border-box;
  box-shadow: var(--shadow-md), 0 24px 60px -30px rgba(79, 70, 229, 0.45);
}
.paid-cta h2 { flex-wrap: wrap; font-size: 1.1rem; }
.paid-cta h2::before {
  content: "有料コンテンツ";
  content: "有料コンテンツ" / "";
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
  background: var(--grad);
  border-radius: 999px;
  box-shadow: 0 4px 12px -4px rgba(79, 70, 229, 0.7);
}
.paid-cta > p { color: var(--text-2); font-size: 0.93rem; }
.paid-cta > p.hint { color: var(--muted); font-size: 0.85rem; }
.offer-list { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 10px; }
.offer-list li {
  position: relative;
  margin: 0;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.offer-list li:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border-strong)); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.offer-list a { font-weight: 700; font-size: 0.98rem; color: var(--text); text-decoration: none; }
.offer-list a::after { content: " ↗"; color: var(--accent); font-weight: 600; }
.offer-list a:hover { color: var(--accent-strong); text-decoration: underline; }
.offer-list .tag {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: var(--accent-soft-2);
  font-variant-numeric: tabular-nums;
}
.offer-list .hint { display: inline-block; margin-top: 6px; }

.follow-box {
  padding: 24px 26px;
  background:
    radial-gradient(80% 140% at 0% 100%, var(--accent-soft), transparent 60%),
    var(--surface);
}
.follow-box h2::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 4px var(--ok-bg);
}
.follow-box p { margin: 4px 0; color: var(--text-2); font-size: 0.93rem; }
.follow-links { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 14px 0 0; }
.follow-links li { margin: 0; }
.follow-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--text);
  text-decoration: none;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.follow-links a::after { content: "↗"; color: var(--muted); font-size: 0.85em; }
.follow-links a:hover { color: var(--text); background: var(--surface); border-color: var(--accent); transform: translateY(-1px); }

/* ---------- guides: breadcrumb, article, toc ---------- */
.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
  padding: 0;
  margin: 22px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.breadcrumb li { margin: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: 8px; color: var(--border-strong); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb [aria-current="page"] { color: var(--text-2); }

.article-meta {
  display: inline-block;
  margin: 0 0 18px;
  padding: 6px 12px;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.article-layout { display: grid; grid-template-columns: minmax(0, 1fr); }
article { min-width: 0; font-size: 1.03rem; line-height: 1.95; }
article > h1 { margin-top: 18px; }
article > h2 { scroll-margin-top: calc(var(--header-h) + 24px); }
article > h2::before {
  content: "";
  display: block;
  width: 28px;
  height: 3px;
  margin-bottom: 14px;
  border-radius: 3px;
  background: var(--grad);
}
article > p, article > ul, article > ol { color: var(--text-2); }
article > ul > li::marker { color: var(--accent); }
article strong { background: linear-gradient(transparent 64%, var(--mark) 64%); padding: 0 1px; }
article section > h2 { scroll-margin-top: calc(var(--header-h) + 24px); }
article table { font-size: 0.88rem; }

.toc-wrap { min-width: 0; }
.toc {
  margin: 8px 0 20px;
  background: var(--surface);
}
.toc > summary { font-size: 0.86rem; letter-spacing: 0.04em; padding-top: 11px; padding-bottom: 11px; }
.toc ol {
  list-style: none;
  margin: 0 14px 14px;
  padding: 0 0 0 0;
  border-left: 1px solid var(--border-strong);
  counter-reset: toc;
}
.toc li { margin: 0; }
.toc a {
  display: block;
  margin-left: -1px;
  padding: 5px 8px 5px 14px;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.toc a:hover { color: var(--text); }
.toc a.is-active { color: var(--text); font-weight: 650; border-left-color: var(--accent); background: linear-gradient(90deg, var(--accent-soft), transparent); }

@media (min-width: 1200px) {
  .article-layout {
    grid-template-columns: minmax(0, 800px) 236px;
    justify-content: space-between;
    gap: 56px;
  }
  .article-layout > article { grid-column: 1; grid-row: 1; }
  .toc-wrap {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    position: sticky;
    top: calc(var(--header-h) + 28px);
    max-height: calc(100vh - var(--header-h) - 48px);
    overflow: auto;
    scrollbar-width: thin;
    padding-top: 22px;
  }
  .toc { margin: 0; background: transparent; border: 0; box-shadow: none; }
  .toc[open] { box-shadow: none; }
  .toc > summary { padding: 0 0 10px; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.12em; color: var(--muted); }
  .toc > summary::after { right: 4px; width: 7px; height: 7px; }
  .toc ol { margin: 0; }
  .toc[open] > summary + * { animation: none; }
}
.pg-guide main > aside, .pg-guide main > section { max-width: 800px; }
.pg-guide .breadcrumb, .pg-guides .breadcrumb, .pg-books .breadcrumb { max-width: 760px; }

/* 読んだ位置のバー(ui.js) */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  height: 2px;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: var(--grad);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.6);
  pointer-events: none;
}

/* ---------- guides index & lists ---------- */
.guide-list {
  list-style: none;
  padding: 0;
  margin: 20px 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.guide-list > li { margin: 0; }
.guide-list > li.card {
  display: flex;
  flex-direction: column;
  padding: 20px 22px;
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}
.guide-list > li.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.guide-list h2, .guide-list h3 { margin: 0 0 8px; font-size: 1rem; line-height: 1.6; }
.guide-list h2 a, .guide-list h3 a { color: var(--text); text-decoration: none; }
.guide-list h2 a:hover, .guide-list h3 a:hover { color: var(--accent-strong); text-decoration: underline; }
.guide-list p { margin: 0 0 6px; color: var(--muted); font-size: 0.88rem; line-height: 1.8; }
.guide-list p.hint { margin-top: auto; padding-top: 10px; font-size: 0.8rem; border-top: 1px dashed var(--border); }

.tool-list:not(:has(.tool-card)) { display: block; }

/* ---------- books / about: reading width ---------- */
.pg-books main > *, .pg-about main > * { max-width: 860px; }
.pg-books main > h2 { padding-top: 6px; }
.pg-books main > h2::before, .pg-about main > h2::before {
  content: "";
  display: block;
  width: 28px;
  height: 3px;
  margin-bottom: 14px;
  border-radius: 3px;
  background: var(--grad);
}
.pg-books main > p, .pg-about main > p, .pg-about main > ul { color: var(--text-2); }

/* ---------- footer ---------- */
.site-footer {
  position: relative;
  margin-top: 24px;
  padding: 40px 0 56px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.85;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, transparent, var(--bg-tint));
}
.site-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  width: min(560px, 80vw);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.6;
}
.site-footer .wrap > p { max-width: 860px; margin: 0 0 8px; }
.site-footer .wrap > p:first-child { font-weight: 600; color: var(--text-2); }
.site-footer a { color: var(--text-2); }
.site-footer a:hover { color: var(--text); }

/* ---------- toast (ui.js) ---------- */
.toast-host {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 80;
  display: grid;
  gap: 8px;
  justify-items: center;
  width: max-content;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.5;
  color: #f1f3ff;
  background: rgba(16, 18, 32, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  animation: toast-in 0.35s var(--ease) both;
}
.toast::before {
  content: "";
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #10b981 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2l2.2 2.2 4.8-4.8' fill='none' stroke='white' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.toast.is-warn::before { background-color: #d97706; background-image: none; }
.toast.is-out { animation: toast-out 0.3s var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(0.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(0.98); } }

/* ---------- reveal on scroll (ui.js adds .reveal only when motion is OK) ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 40px; padding: 48px 0 40px; }
  .hero-visual { max-width: 560px; }
  .window { transform: none; }
  .tool-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  :root { --gutter: 16px; }
  body { font-size: 15.5px; }
  .tool-list, .link-grid, .guide-list { grid-template-columns: minmax(0, 1fr); }
  .tool-list > li:first-child { grid-column: auto; }
  .card { padding: 18px; border-radius: 16px; }
  .tool-panel { padding: 16px; }
  .tool-output { padding: 14px; }
  .band, .paid-cta, .follow-box { padding: 20px 18px; }
  .hero { padding: 32px 0 28px; }
  .hero h1 { font-size: clamp(2rem, 1.2rem + 4.2vw, 2.4rem); }
  .hero-actions .btn { flex: 1 1 auto; }
  .chip-a { right: 8px; top: -14px; }
  .chip-b { right: 8px; bottom: -34px; }
  pre.window-code { font-size: 12.5px; padding: 16px; }
  article { font-size: 1rem; line-height: 1.9; }
  h2 { margin-top: 44px; }
  .section-title { margin-top: 44px; }
  .opt:has(> input[type="radio"]) { padding: 10px 12px; }
  fieldset:has(> .opt > input[type="radio"]):not(:has(> :not(legend, .opt))) { grid-template-columns: minmax(0, 1fr); }
  th, td { padding: 9px 11px; }
  .tag { margin-left: 4px; }
}

@media (hover: none) {
  .tool-card:hover, .guide-list > li.card:hover, .link-grid a:hover, .offer-list li:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .window, .hero-visual:hover .window { transform: none; }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-header, .theme-toggle, .read-progress, .toast-host, .hero-bg, .hero-visual, .copy-btn, .toc-wrap { display: none !important; }
  body::before { display: none; }
  pre { white-space: pre-wrap; }
}
