/* Obsidian スタートガイド — 白ベースのガラス UI。モバイル優先。 */

:root {
  color-scheme: light;
  --bg: #f6f4fc;
  --surface: #ffffff;
  --ink: #1c1830;
  --ink-2: #433c5c;
  --ink-3: #686283;
  --ink-4: #a49fbb; /* 罫線・飾り専用（文字に使わない） */
  --line: rgba(40, 24, 110, 0.09);
  --line-2: rgba(40, 24, 110, 0.15);
  --brand: #7c5cf0;
  --brand-ink: #5b3ed4;
  --brand-deep: #4a2fb8;
  --brand-2: #a991ff;
  --brand-soft: rgba(124, 92, 240, 0.08);
  --brand-soft-2: rgba(124, 92, 240, 0.15);
  --mint: #0a7466;
  --mint-soft: rgba(15, 154, 138, 0.1);
  --amber: #8a5c00;
  --amber-soft: rgba(230, 160, 20, 0.14);
  --rose: #c8325f;
  --rose-soft: rgba(224, 69, 123, 0.1);
  --sky: #2368c4;
  --sky-soft: rgba(47, 127, 224, 0.1);
  --glass-bg: linear-gradient(160deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.6));
  --glass-blur: blur(22px) saturate(185%);
  --glass-border: rgba(255, 255, 255, 0.9);
  --glass-shadow: 0 1px 1px rgba(40, 24, 110, 0.04), 0 10px 30px rgba(60, 40, 150, 0.09);
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 -1px 0 rgba(124, 92, 240, 0.07);
  --lift-shadow: 0 2px 4px rgba(40, 24, 110, 0.05), 0 18px 44px rgba(70, 45, 170, 0.16);
  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --r-xs: 8px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --font: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  --num: "Inter", "Noto Sans JP", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --header-h: 58px;
  --tabbar-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --gutter: 16px;
  --content-w: 760px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: 0.02em;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
a { color: var(--brand-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--brand-deep); }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { line-height: 1.4; letter-spacing: 0.01em; margin: 0; color: var(--ink); }
ul, ol { margin: 0 0 1em; padding-left: 1.4em; }
li + li { margin-top: 0.3em; }
code {
  font-family: var(--mono);
  font-size: 0.88em;
  padding: 0.12em 0.42em;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  overflow-wrap: anywhere;
}
hr { border: 0; height: 1px; background: var(--line); margin: 2rem 0; }
::selection { background: rgba(124, 92, 240, 0.22); }

:focus-visible {
  outline: 2.5px solid var(--brand);
  outline-offset: 2px;
  border-radius: 10px;
}

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

.skip-link {
  position: fixed;
  left: 12px; top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; color: #fff; }

/* ───────── 背景 ───────── */

.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(255, 255, 255, 0.9), transparent 70%),
    var(--bg);
}
.aurora i {
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  border-radius: 50%;
  will-change: transform;
  animation: drift 26s ease-in-out infinite alternate;
}
.aurora i:nth-child(1) {
  left: -28vmax; top: -30vmax;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.42), rgba(167, 139, 250, 0) 62%);
}
.aurora i:nth-child(2) {
  right: -32vmax; top: 10vh;
  background: radial-gradient(circle, rgba(240, 171, 252, 0.3), rgba(240, 171, 252, 0) 62%);
  animation-duration: 32s;
  animation-delay: -8s;
}
.aurora i:nth-child(3) {
  left: 10vw; bottom: -42vmax;
  background: radial-gradient(circle, rgba(125, 211, 252, 0.26), rgba(125, 211, 252, 0) 62%);
  animation-duration: 38s;
  animation-delay: -14s;
}
.aurora::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(91, 62, 212, 0.13) 1px, transparent 1.2px);
  background-size: 24px 24px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, rgba(0, 0, 0, 0.35) 40%, transparent 85%);
  mask-image: linear-gradient(to bottom, #000 0, rgba(0, 0, 0, 0.35) 40%, transparent 85%);
}
@keyframes drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(6vmax, 4vmax, 0) scale(1.08); }
  100% { transform: translate3d(-4vmax, 7vmax, 0) scale(0.96); }
}

/* ───────── ガラス ───────── */

.glass {
  position: relative;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-inset), var(--glass-shadow);
}
.glass::before {
  /* 光の反射。ポインタに合わせて動く（--mx/--my） */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 20%) var(--my, 0%), rgba(255, 255, 255, 0.7), transparent 42%);
  opacity: 0.55;
  transition: opacity 0.3s var(--ease);
}
.glass::after {
  /* 縁だけ光らせる（液体ガラスの縁の屈折） */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background: linear-gradient(140deg, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0.25) 28%, rgba(124, 92, 240, 0.2) 62%, rgba(255, 255, 255, 0.85));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: rgba(255, 255, 255, 0.96); }
}

/* ───────── 全体の骨組み ───────── */

.shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 max(10px, env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
  border-radius: 0;
  border-width: 0 0 1px;
  border-color: rgba(255, 255, 255, 0.75);
  transition: box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}
.topbar.is-flat { box-shadow: var(--glass-inset); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.brand:hover { color: var(--ink); }
.brand-mark {
  flex: none;
  width: 30px; height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #9b7dff, #5b3ed4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 6px 16px rgba(91, 62, 212, 0.35);
}
.brand-mark svg { width: 18px; height: 18px; }
.brand-text { display: grid; line-height: 1.2; min-width: 0; }
.brand-text b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { font-size: 11px; font-weight: 600; color: var(--ink-3); letter-spacing: 0.04em; }

.topbar .spacer { flex: 1; }

.icon-btn {
  position: relative;
  flex: none;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--ink-2);
  transition: background 0.2s var(--ease), transform 0.25s var(--spring), color 0.2s;
}
.icon-btn:hover { background: var(--brand-soft); color: var(--brand-ink); }
.icon-btn:active { transform: scale(0.9); }
.icon-btn svg { width: 22px; height: 22px; }

.search-pill {
  display: none;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 10px 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink-3);
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.25s var(--spring);
}
.search-pill:hover { border-color: rgba(124, 92, 240, 0.4); box-shadow: 0 0 0 4px var(--brand-soft); }
.search-pill svg { width: 18px; height: 18px; }
.search-pill kbd { margin-left: 18px; }

.main {
  min-width: 0;
  padding: calc(var(--header-h) + 18px) max(var(--gutter), env(safe-area-inset-right)) calc(var(--tabbar-h) + var(--safe-b) + 40px) max(var(--gutter), env(safe-area-inset-left));
}
.view {
  width: 100%;
  max-width: var(--content-w);
  margin: 0 auto;
  outline: none;
}

/* 下のタブ（スマホ） */
.tabbar {
  position: fixed;
  z-index: 45;
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  bottom: calc(10px + var(--safe-b));
  height: var(--tabbar-h);
  border-radius: 26px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 6px;
  isolation: isolate;
}
.tab {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  border-radius: 20px;
  color: var(--ink-3);
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: color 0.25s var(--ease), transform 0.3s var(--spring);
}
.tab svg { width: 23px; height: 23px; transition: transform 0.4s var(--spring); }
.tab:active { transform: scale(0.92); }
.tab[aria-current="page"] { color: var(--brand-deep); }
.tab[aria-current="page"] svg { transform: translateY(-1px) scale(1.06); }
.tab-indicator {
  position: absolute;
  z-index: 0;
  top: 6px; bottom: 6px; left: 6px;
  width: calc((100% - 12px) / 5);
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(237, 231, 255, 0.9));
  box-shadow: inset 0 1px 0 #fff, 0 4px 14px rgba(91, 62, 212, 0.18), 0 0 0 1px rgba(124, 92, 240, 0.12);
  transform: translateX(calc(var(--i, 0) * 100%)) scaleX(var(--sx, 1));
  transition: transform 0.55s var(--spring), width 0.3s var(--ease), opacity 0.2s;
}
.tab-indicator.is-hidden { opacity: 0; }

/* 横のメニュー（PC） */
.sidebar { display: none; }

/* 目次（大きい画面） */
.toc { display: none; }

@media (min-width: 768px) {
  :root { --gutter: 28px; }
  .search-pill { display: inline-flex; }
  .topbar .search-btn { display: none; }
  .main { padding-top: calc(var(--header-h) + 30px); }
}

@media (min-width: 1024px) {
  :root { --header-h: 0px; }
  .shell { grid-template-columns: 280px minmax(0, 1fr); }
  .topbar, .tabbar { display: none; }
  .sidebar {
    position: sticky;
    top: 0;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 22px 16px 18px;
    border-radius: 0;
    border-width: 0 1px 0 0;
    overflow-y: auto;
  }
  .sidebar .brand { padding: 4px 8px 14px; }
  .sidebar .search-pill { display: flex; width: 100%; margin-bottom: 10px; }
  .sidebar .search-pill kbd { margin-left: auto; }
  .main { padding: 44px 40px 80px; }
}

@media (min-width: 1360px) {
  .shell { grid-template-columns: 280px minmax(0, 1fr) 240px; }
  .toc {
    display: block;
    position: sticky;
    top: 0;
    height: 100dvh;
    overflow-y: auto;
    padding: 48px 18px 24px 4px;
  }
}

.nav-group { margin: 10px 0 2px; padding: 0 10px; font-size: 11px; font-weight: 800; letter-spacing: 0.12em; color: var(--ink-3); }
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 14px;
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: background 0.2s var(--ease), color 0.2s, transform 0.25s var(--spring);
}
.nav-link svg { width: 20px; height: 20px; flex: none; color: var(--ink-3); transition: color 0.2s; }
.nav-link:hover { background: rgba(255, 255, 255, 0.7); color: var(--ink); }
.nav-link:active { transform: scale(0.98); }
.nav-link[aria-current="page"] {
  color: var(--brand-deep);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(240, 235, 255, 0.92));
  box-shadow: inset 0 1px 0 #fff, 0 4px 14px rgba(91, 62, 212, 0.12), 0 0 0 1px rgba(124, 92, 240, 0.12);
}
.nav-link[aria-current="page"] svg { color: var(--brand); }
.nav-link .count { margin-left: auto; font-family: var(--num); font-size: 12px; color: var(--ink-3); font-weight: 700; }
.sidebar-foot { margin-top: auto; padding: 14px 10px 0; font-size: 12px; color: var(--ink-3); line-height: 1.7; }
.sidebar-foot a { color: var(--ink-3); }

.toc-title { font-size: 11px; font-weight: 800; letter-spacing: 0.12em; color: var(--ink-3); margin: 0 0 10px 12px; }
.toc a {
  display: block;
  padding: 5px 12px;
  border-left: 2px solid var(--line);
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.55;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
}
.toc a.lv3 { padding-left: 24px; font-size: 12.5px; }
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--brand-deep); border-color: var(--brand); font-weight: 700; }

/* ───────── ページの見出し ───────── */

.page-head { margin: 4px 0 26px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 4px 12px 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 0 1px var(--line);
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-ink);
  letter-spacing: 0.06em;
}
.eyebrow::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft-2);
}
.page-head h1 {
  font-size: clamp(26px, 7vw, 38px);
  font-weight: 900;
  letter-spacing: 0.01em;
  line-height: 1.3;
  outline: none;
}
.page-head .lead {
  margin: 12px 0 0;
  color: var(--ink-2);
  font-size: 15.5px;
}
.page-head .meta { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }

.section { margin: 40px 0; }
.section:first-child { margin-top: 0; }
.section > h2, .h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: clamp(20px, 5.4vw, 25px);
  font-weight: 900;
}
.section > h2 .num {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 10px;
  font-family: var(--num);
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, #9b7dff, #5b3ed4);
  box-shadow: 0 6px 14px rgba(91, 62, 212, 0.28);
}
.section h3, .h3 { font-size: 17.5px; font-weight: 800; margin: 22px 0 10px; }
.muted { color: var(--ink-3); }
.small { font-size: 13.5px; }
.lead-text { color: var(--ink-2); }

/* ───────── カード ───────── */

.card {
  position: relative;
  border-radius: var(--r-lg);
  padding: 18px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.74));
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-inset), var(--glass-shadow);
}
.card + .card { margin-top: 12px; }
.card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: transform 0.35s var(--spring), box-shadow 0.35s var(--ease);
}
.card-link:hover { color: inherit; transform: translateY(-3px); box-shadow: var(--glass-inset), var(--lift-shadow); }
.card-link:active { transform: translateY(0) scale(0.985); transition-duration: 0.12s; }

.grid { display: grid; gap: 12px; }
.grid > .card + .card { margin-top: 0; }
@media (min-width: 560px) {
  .grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 560px) and (max-width: 899px) {
  .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.tile { display: flex; gap: 14px; align-items: flex-start; }
.tile-icon {
  flex: none;
  width: 44px; height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--brand-ink);
  background: linear-gradient(160deg, #fff, #efe9ff);
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgba(124, 92, 240, 0.14), 0 6px 14px rgba(91, 62, 212, 0.12);
}
.tile-icon svg { width: 22px; height: 22px; }
.tile-icon.mint { color: var(--mint); background: linear-gradient(160deg, #fff, #e3f7f3); box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgba(15, 154, 138, 0.16), 0 6px 14px rgba(15, 154, 138, 0.12); }
.tile-icon.amber { color: var(--amber); background: linear-gradient(160deg, #fff, #fdf1d8); box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgba(200, 140, 10, 0.18), 0 6px 14px rgba(200, 140, 10, 0.12); }
.tile-icon.rose { color: var(--rose); background: linear-gradient(160deg, #fff, #fde6ee); box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgba(224, 69, 123, 0.16), 0 6px 14px rgba(224, 69, 123, 0.1); }
.tile-icon.sky { color: var(--sky); background: linear-gradient(160deg, #fff, #e3eefc); box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgba(47, 127, 224, 0.16), 0 6px 14px rgba(47, 127, 224, 0.1); }
.tile-body { min-width: 0; flex: 1; }
.tile-title { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 16.5px; line-height: 1.45; }
.tile-desc { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); line-height: 1.7; }
.tile .chev { flex: none; align-self: center; width: 20px; height: 20px; color: var(--ink-4); transition: transform 0.3s var(--spring), color 0.2s; }
.card-link:hover .chev { transform: translateX(3px); color: var(--brand); }

/* ───────── ボタン ───────── */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 20px;
  border-radius: 14px;
  border: 0;
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.3s var(--spring), box-shadow 0.3s var(--ease), background 0.2s;
  -webkit-user-select: none;
  user-select: none;
}
.btn svg { width: 19px; height: 19px; flex: none; }
.btn:active { transform: scale(0.96); transition-duration: 0.1s; }
.btn-primary {
  color: #fff;
  background: linear-gradient(160deg, #7556e8 0%, #6447dc 55%, #5537cc 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 8px 22px rgba(91, 62, 212, 0.35);
}
.btn-primary:hover { color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 12px 30px rgba(91, 62, 212, 0.45); transform: translateY(-1px); }
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.35) 45%, transparent 60%);
  transform: translateX(-120%);
  transition: transform 0.8s var(--ease);
}
.btn-primary:hover::after { transform: translateX(120%); }
.btn-glass {
  color: var(--brand-deep);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(244, 240, 255, 0.85));
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgba(124, 92, 240, 0.2), 0 6px 16px rgba(91, 62, 212, 0.1);
}
.btn-glass:hover { color: var(--brand-deep); box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgba(124, 92, 240, 0.35), 0 10px 22px rgba(91, 62, 212, 0.16); }
.btn-ghost { color: var(--ink-2); background: transparent; box-shadow: 0 0 0 1px var(--line-2); }
.btn-ghost:hover { color: var(--ink); background: rgba(255, 255, 255, 0.7); }
.btn-sm { min-height: 40px; padding: 6px 14px; font-size: 13.5px; border-radius: 12px; }
.btn-block { display: flex; width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ───────── チップ・バッジ ───────── */

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 calc(var(--gutter) * -1) 18px;
  padding: 4px var(--gutter) 6px;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent 100%);
}
.chips::-webkit-scrollbar { display: none; }
@media (min-width: 1024px) { .chips { flex-wrap: wrap; margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; -webkit-mask-image: none; mask-image: none; } }
.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 15px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 0 1px var(--line-2);
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.25s var(--ease), color 0.2s, box-shadow 0.25s, transform 0.3s var(--spring);
}
.chip:hover { box-shadow: 0 0 0 1px rgba(124, 92, 240, 0.35); }
.chip:active { transform: scale(0.94); }
.chip[aria-pressed="true"] {
  color: #fff;
  background: linear-gradient(160deg, #7556e8, #5b3ed4);
  box-shadow: 0 6px 16px rgba(91, 62, 212, 0.3);
}
.chip .n { font-family: var(--num); font-size: 12px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: var(--brand-deep);
  background: var(--brand-soft-2);
}
.badge.must { color: #fff; background: linear-gradient(160deg, #7556e8, #5b3ed4); }
.badge.rec { color: var(--mint); background: var(--mint-soft); }
.badge.adv { color: var(--amber); background: var(--amber-soft); }
.badge.warn { color: var(--rose); background: var(--rose-soft); }
.badge.info { color: var(--sky); background: var(--sky-soft); }
.badge.gray { color: var(--ink-2); background: rgba(40, 24, 110, 0.07); }

kbd, .kbd {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 7px;
  font-family: var(--num);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  background: linear-gradient(180deg, #fff, #f3f1fa);
  box-shadow: inset 0 -1.5px 0 rgba(40, 24, 110, 0.12), 0 0 0 1px var(--line-2);
  line-height: 1;
}

/* ───────── コールアウト（Obsidian 風） ───────── */

.callout {
  --c: var(--brand);
  --cbg: var(--brand-soft);
  position: relative;
  margin: 16px 0;
  padding: 14px 16px 14px 16px;
  border-radius: var(--r-md);
  background: var(--cbg);
  border-left: 3px solid var(--c);
}
.callout-title { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--c); font-size: 14.5px; margin-bottom: 4px; }
.callout-title svg { width: 18px; height: 18px; }
.callout > :last-child { margin-bottom: 0; }
.callout p { font-size: 14.5px; }
.callout.tip { --c: var(--mint); --cbg: var(--mint-soft); }
.callout.warn { --c: var(--amber); --cbg: var(--amber-soft); }
.callout.danger { --c: var(--rose); --cbg: var(--rose-soft); }
.callout.info { --c: var(--sky); --cbg: var(--sky-soft); }
.callout.note .callout-title { color: var(--brand-deep); }

/* ───────── ホーム ───────── */

.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  padding: 22px 20px 20px;
  margin-bottom: 18px;
}
.hero-top { display: flex; align-items: center; gap: 16px; }
.hero h1 { font-size: clamp(25px, 7vw, 36px); font-weight: 900; line-height: 1.3; outline: none; }
.hero .sub { margin: 6px 0 0; color: var(--ink-2); font-size: 14px; font-weight: 600; }
.graph {
  position: relative;
  height: 210px;
  margin: 14px -8px 4px;
  border-radius: 20px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(124, 92, 240, 0.08), transparent 70%);
}
.graph svg { width: 100%; height: 100%; overflow: visible; }
.graph .edge { stroke: rgba(124, 92, 240, 0.28); stroke-width: 1.2; }
.graph .node circle { fill: #fff; stroke: var(--brand); stroke-width: 1.6; filter: drop-shadow(0 3px 6px rgba(91, 62, 212, 0.25)); transition: r 0.3s var(--spring); }
.graph .node.core circle { fill: url(#gcore); stroke: none; }
.graph .node text { font-size: 11.5px; font-weight: 700; fill: var(--ink-2); paint-order: stroke; stroke: rgba(255, 255, 255, 0.95); stroke-width: 4px; stroke-linejoin: round; }
.graph .node.core text { font-size: 12.5px; fill: var(--brand-deep); font-weight: 800; }
.graph .node { cursor: pointer; }
.graph .node:hover circle, .graph .node:focus-visible circle { stroke-width: 2.4; }
.graph .node:focus { outline: none; }
.graph .node:focus-visible text { fill: var(--brand-deep); }

.progress-card { display: flex; gap: 16px; align-items: center; }
.ring { position: relative; flex: none; width: 84px; height: 84px; }
.ring svg { width: 84px; height: 84px; transform: rotate(-90deg); }
.ring .track { fill: none; stroke: rgba(124, 92, 240, 0.12); stroke-width: 8; }
.ring .bar { fill: none; stroke: url(#ringg); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 1.2s var(--ease); }
.ring .label { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; line-height: 1.1; }
.ring .label b { font-family: var(--num); font-size: 21px; font-weight: 800; color: var(--ink); }
.ring .label small { display: block; font-size: 10px; color: var(--ink-3); font-weight: 700; }
.next-step .k { font-size: 12px; font-weight: 800; color: var(--brand-ink); letter-spacing: 0.06em; }
.next-step .t { font-weight: 800; font-size: 16.5px; line-height: 1.5; margin: 2px 0 8px; }

.levels { display: grid; gap: 12px; counter-reset: lv; }
.level { display: flex; gap: 14px; align-items: stretch; }
.level-rail { position: relative; flex: none; width: 40px; display: flex; flex-direction: column; align-items: center; }
.level-dot {
  position: relative;
  z-index: 1;
  width: 40px; height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-family: var(--num);
  font-weight: 800;
  font-size: 16px;
  color: var(--brand-deep);
  background: linear-gradient(160deg, #fff, #efe9ff);
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgba(124, 92, 240, 0.2), 0 6px 14px rgba(91, 62, 212, 0.12);
  transition: background 0.4s, color 0.3s;
}
.level.is-done .level-dot { color: #fff; background: linear-gradient(160deg, #8d70ff, #5b3ed4); }
.level-rail::after {
  content: "";
  position: absolute;
  top: 44px; bottom: -14px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(to bottom, rgba(124, 92, 240, 0.35), rgba(124, 92, 240, 0.08));
}
.level:last-child .level-rail::after { display: none; }
.level .card { flex: 1; min-width: 0; }
.level-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.level-head b { font-size: 16.5px; font-weight: 800; }
.level-bar { height: 6px; border-radius: 6px; background: rgba(124, 92, 240, 0.1); overflow: hidden; margin: 10px 0 2px; }
.level-bar i { display: block; height: 100%; width: var(--p, 0%); border-radius: inherit; background: linear-gradient(90deg, #a991ff, #5b3ed4); transition: width 1s var(--ease); }

/* ───────── 手順 ───────── */

.step-list { display: grid; gap: 12px; }
.step { padding: 0; overflow: hidden; }
.step-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 16px 14px;
}
.check {
  position: relative;
  flex: none;
  width: 30px; height: 30px;
  margin-top: 1px;
  border-radius: 10px;
  border: 0;
  display: grid;
  place-items: center;
  background: #fff;
  box-shadow: inset 0 0 0 2px rgba(124, 92, 240, 0.35);
  transition: background 0.3s var(--ease), box-shadow 0.3s, transform 0.35s var(--spring);
}
.check svg { width: 18px; height: 18px; color: #fff; }
.check svg path { stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset 0.35s var(--ease) 0.05s; }
.check::after { content: ""; position: absolute; inset: -8px; }
.check:active { transform: scale(0.85); }
.check[aria-checked="true"] { background: linear-gradient(160deg, #8d70ff, #5b3ed4); box-shadow: 0 6px 14px rgba(91, 62, 212, 0.3); }
.check[aria-checked="true"] svg path { stroke-dashoffset: 0; }
.check.pop { animation: pop 0.5s var(--spring); }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.22); } 100% { transform: scale(1); } }
.step-title { flex: 1; min-width: 0; }
.step-title .k { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: var(--brand-ink); letter-spacing: 0.04em; }
.step-title h3 { margin: 2px 0 0; font-size: 17px; font-weight: 800; line-height: 1.5; }
.step.is-done .step-title h3 { color: var(--ink-3); }
.step-toggle { flex: none; align-self: center; }
.step-toggle svg { transition: transform 0.4s var(--spring); }
.step.is-open .step-toggle svg { transform: rotate(180deg); }
.step-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.45s var(--ease);
}
.step.is-open .step-body { grid-template-rows: 1fr; }
.step-body > div { overflow: hidden; }
.step-inner { padding: 0 16px 18px 58px; font-size: 15px; color: var(--ink-2); }
.step-inner > :first-child { margin-top: 0; }
.step-inner ol, .step-inner ul { padding-left: 1.3em; }
.step-inner li::marker { color: var(--brand); font-weight: 800; }
@media (max-width: 420px) { .step-inner { padding-left: 16px; } }

.os-tabs { margin: 10px 0 14px; }

/* セグメント切替 */
.seg {
  position: relative;
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 4px;
  border-radius: 14px;
  background: rgba(40, 24, 110, 0.06);
  box-shadow: inset 0 1px 2px rgba(40, 24, 110, 0.06);
  isolation: isolate;
  max-width: 100%;
}
.seg button {
  position: relative;
  z-index: 1;
  min-height: 40px;
  padding: 4px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink-3);
  white-space: nowrap;
  transition: color 0.25s;
}
.seg button[aria-pressed="true"] { color: var(--brand-deep); }
.seg .seg-thumb {
  position: absolute;
  z-index: 0;
  top: 4px; bottom: 4px; left: 4px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(40, 24, 110, 0.12), 0 0 0 1px rgba(124, 92, 240, 0.1);
  transition: transform 0.45s var(--spring), width 0.3s var(--ease);
}

/* ───────── プロンプト ───────── */

.env-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 16px;
  border-radius: var(--r-md);
  margin-bottom: 18px;
}
.env-bar .env-text { flex: 1; min-width: 0; font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.env-bar .env-text b { color: var(--ink); }
.env-bar .env-text .path { display: block; font-family: var(--mono); font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.prompt-card .tile-title .badge { margin-left: auto; }

.prompt-box {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 248, 255, 0.92));
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgba(124, 92, 240, 0.18), 0 14px 34px rgba(60, 40, 150, 0.1);
}
.prompt-box-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.prompt-box-head .dots { display: flex; gap: 6px; }
.prompt-box-head .dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(124, 92, 240, 0.25); }
.prompt-box-head .dots i:nth-child(2) { background: rgba(124, 92, 240, 0.18); }
.prompt-box-head .dots i:nth-child(3) { background: rgba(124, 92, 240, 0.11); }
.prompt-box-head .name { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 800; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prompt-text {
  margin: 0;
  padding: 18px 18px 22px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.85;
  color: var(--ink);
  max-height: 560px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.prompt-box.is-expanded .prompt-text { max-height: none; }
.prompt-text .v { color: var(--brand-deep); background: var(--brand-soft-2); border-radius: 5px; padding: 0 3px; font-weight: 700; }
.prompt-text .h { font-weight: 800; color: var(--ink); }
.prompt-fade {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 90px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 12px;
  background: linear-gradient(to bottom, rgba(250, 248, 255, 0), rgba(250, 248, 255, 0.98) 70%);
}
.prompt-box.is-expanded .prompt-fade, .prompt-box.no-fade .prompt-fade { display: none; }

.copy-btn.is-done { background: linear-gradient(160deg, #0e8475, #0b7a6d); box-shadow: 0 8px 20px rgba(15, 154, 138, 0.35); }
.copy-btn .ico-done { display: none; }
.copy-btn.is-done .ico-copy { display: none; }
.copy-btn.is-done .ico-done { display: block; animation: pop 0.45s var(--spring); }

.sticky-copy {
  position: fixed;
  z-index: 44;
  left: 16px; right: 16px;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 20px);
  display: flex;
  justify-content: center;
  pointer-events: none;
  transform: translateY(16px);
  opacity: 0;
  transition: transform 0.45s var(--spring), opacity 0.3s;
}
.sticky-copy.is-shown { transform: none; opacity: 1; }
.sticky-copy .btn { pointer-events: auto; min-width: 220px; }
@media (min-width: 1024px) { .sticky-copy { bottom: 28px; left: 280px; } }

.vars { display: grid; gap: 12px; margin: 0 0 16px; }
.field label { display: block; font-size: 13px; font-weight: 800; color: var(--ink-2); margin-bottom: 6px; }
.field .hint { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; line-height: 1.6; }
.input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 13px;
  border: 0;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 2px rgba(40, 24, 110, 0.06), 0 0 0 1px var(--line-2);
  font-size: 16px;
  transition: box-shadow 0.2s;
}
.input:focus { outline: none; box-shadow: inset 0 1px 2px rgba(40, 24, 110, 0.06), 0 0 0 2px var(--brand), 0 0 0 6px var(--brand-soft-2); }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.6; }
.input.mono { font-family: var(--mono); font-size: 16px; }

.kv { display: grid; gap: 10px; margin: 0; }
.kv > div { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: baseline; }
.kv dt { font-size: 12.5px; font-weight: 800; color: var(--ink-3); }
.kv dd { margin: 0; font-size: 14.5px; }

.flow { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; counter-reset: f; }
.flow li { position: relative; padding: 0 0 14px 40px; margin: 0; counter-increment: f; font-size: 14.5px; color: var(--ink-2); }
.flow li::before {
  content: counter(f);
  position: absolute;
  left: 0; top: 1px;
  width: 26px; height: 26px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-family: var(--num);
  font-size: 12.5px;
  font-weight: 800;
  color: var(--brand-deep);
  background: var(--brand-soft-2);
}
.flow li::after { content: ""; position: absolute; left: 12px; top: 31px; bottom: 2px; width: 2px; background: rgba(124, 92, 240, 0.14); border-radius: 2px; }
.flow li:last-child::after { display: none; }
.flow li b { color: var(--ink); }

/* ───────── 機能・プラグイン ───────── */

.feature-card .tile-title { flex-wrap: wrap; }
.feature-card .use { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(124, 92, 240, 0.06); font-size: 13.5px; color: var(--ink-2); line-height: 1.7; }
.feature-card .use b { color: var(--brand-deep); }
.feat-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ───────── 実務の流れ ───────── */

.timeline { position: relative; display: grid; gap: 14px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 21px; top: 24px; bottom: 24px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(to bottom, #a991ff, rgba(124, 92, 240, 0.1));
  transform-origin: top;
  transform: scaleY(var(--tl, 0));
  transition: transform 0.2s linear;
}
.tl-item { position: relative; display: flex; gap: 14px; }
.tl-dot {
  position: relative;
  z-index: 1;
  flex: none;
  width: 44px; height: 44px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(160deg, #8d70ff, #5b3ed4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 8px 18px rgba(91, 62, 212, 0.3);
}
.tl-dot svg { width: 21px; height: 21px; }
.tl-item .card { flex: 1; min-width: 0; }
.tl-item h3 { margin: 0 0 4px; font-size: 17px; }
.tl-uses { display: grid; gap: 8px; margin-top: 12px; }
.tl-use { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.65; color: var(--ink-2); }
.tl-use .lb { flex: none; min-width: 76px; padding: 2px 8px; border-radius: 8px; text-align: center; font-size: 11.5px; font-weight: 800; color: var(--brand-deep); background: var(--brand-soft-2); }
.tl-use .lb.skill { color: var(--mint); background: var(--mint-soft); }
.tl-use .lb.ai { color: var(--sky); background: var(--sky-soft); }
.tl-use .lb.op { color: var(--amber); background: var(--amber-soft); }

/* ───────── パック ───────── */

.pack-hero { display: grid; gap: 14px; }
.pack-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; }
.stat {
  display: grid;
  min-width: 92px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 0 1px var(--line);
  line-height: 1.3;
}
.stat b { font-family: var(--num); font-size: 20px; font-weight: 800; }
.stat small { font-size: 11.5px; color: var(--ink-3); font-weight: 700; }
.hash { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); word-break: break-all; line-height: 1.6; }

.explorer { display: grid; gap: 12px; }
@media (min-width: 900px) { .explorer { grid-template-columns: 260px minmax(0, 1fr); align-items: start; } }
.tree.glass::after, .sidebar.glass::after { display: none; }
.tree { padding: 8px; border-radius: var(--r-lg); max-height: 70vh; overflow: auto; }
@media (max-width: 899px) { .tree { max-height: 340px; } }
.tree ul { list-style: none; margin: 0; padding: 0 0 0 14px; }
.tree > ul { padding-left: 0; }
.tree li { margin: 0; }
.tree-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 40px;
  padding: 4px 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  text-align: left;
  font-size: 13.5px;
  color: var(--ink-2);
  transition: background 0.15s;
}
.tree-row:hover { background: rgba(124, 92, 240, 0.07); }
.tree-row[aria-current="true"] { background: var(--brand-soft-2); color: var(--brand-deep); font-weight: 800; }
.tree-row svg { width: 16px; height: 16px; flex: none; color: var(--ink-3); }
.tree-row .tw { transition: transform 0.3s var(--spring); }
.tree li.is-closed > .tree-row .tw { transform: rotate(-90deg); }
.tree li.is-closed > ul { display: none; }
.tree-row .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-row.dir { font-weight: 700; color: var(--ink); }

.preview { padding: 0; overflow: hidden; border-radius: var(--r-lg); }
.preview-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 800; color: var(--ink-2); }
.preview-head .path { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-body { padding: 18px 18px 24px; max-height: 72vh; overflow: auto; }

/* Markdown の表示（読み取りビュー風） */
.md { font-size: 15px; color: var(--ink); line-height: 1.85; }
.md h1 { font-size: 24px; font-weight: 900; margin: 0 0 14px; }
.md h2 { font-size: 19px; font-weight: 800; margin: 26px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.md h3 { font-size: 16.5px; font-weight: 800; margin: 20px 0 8px; }
.md h4 { font-size: 15px; font-weight: 800; margin: 16px 0 6px; }
.md p { margin: 0 0 0.9em; }
.md ul, .md ol { margin: 0 0 1em; }
.md li.task { list-style: none; margin-left: -1.3em; display: flex; gap: 8px; align-items: flex-start; }
.md li.task i { flex: none; width: 17px; height: 17px; margin-top: 5px; border-radius: 5px; box-shadow: inset 0 0 0 1.6px rgba(124, 92, 240, 0.5); }
.md li.task.done i { background: var(--brand); box-shadow: none; }
.md pre {
  margin: 0 0 1em;
  padding: 14px 16px;
  border-radius: 12px;
  overflow: auto;
  background: #f4f1fd;
  box-shadow: inset 0 0 0 1px var(--line);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink-2);
  white-space: pre;
}
.md pre code { padding: 0; background: none; color: inherit; font-size: inherit; word-break: normal; }
.md table { width: 100%; border-collapse: collapse; margin: 0 0 1.2em; font-size: 13.5px; display: block; overflow-x: auto; }
.md th, .md td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.md th { font-weight: 800; color: var(--ink); background: rgba(124, 92, 240, 0.05); white-space: nowrap; }
.md blockquote { margin: 0 0 1em; padding: 4px 14px; border-left: 3px solid var(--brand-2); color: var(--ink-2); }
.md .wl { color: var(--brand-ink); font-weight: 600; text-decoration: none; border-bottom: 1px dashed rgba(124, 92, 240, 0.4); }
.md .tag { display: inline-block; padding: 0 8px; border-radius: 999px; background: var(--brand-soft-2); color: var(--brand-deep); font-size: 12.5px; font-weight: 700; }
.props { margin: 0 0 18px; padding: 10px 12px; border-radius: 12px; background: rgba(124, 92, 240, 0.045); box-shadow: inset 0 0 0 1px var(--line); }
.props-title { font-size: 11.5px; font-weight: 800; color: var(--ink-3); letter-spacing: 0.08em; margin: 0 0 6px 2px; }
.props-row { display: grid; grid-template-columns: minmax(80px, 34%) 1fr; gap: 10px; padding: 4px 2px; font-size: 13px; border-top: 1px solid var(--line); }
.props-row:first-of-type { border-top: 0; }
.props-row .k { color: var(--ink-3); font-weight: 700; display: flex; gap: 6px; align-items: center; }
.props-row .val { color: var(--ink); word-break: break-word; }
.props-row .val .tag { margin: 0 4px 2px 0; }

/* ───────── 辞典 ───────── */

.dict-search { position: relative; margin-bottom: 14px; }
.dict-search svg { position: absolute; left: 14px; top: 50%; width: 19px; height: 19px; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.dict-search .input { padding-left: 42px; }
.term { padding: 14px 16px; }
.term + .term { margin-top: 10px; }
.term dt { font-weight: 800; font-size: 16px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.term dt small { font-size: 12px; color: var(--ink-3); font-weight: 700; }
.term dd { margin: 4px 0 0; font-size: 14.5px; color: var(--ink-2); line-height: 1.75; }
.cheat { display: grid; gap: 0; border-radius: var(--r-lg); overflow: hidden; }
.cheat-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 11px 16px; align-items: center; border-top: 1px solid var(--line); font-size: 14px; }
.cheat-row:first-child { border-top: 0; }
.cheat-row code { white-space: pre-wrap; word-break: break-word; }
.cheat.md-cheat .cheat-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.cheat-row .keys { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; justify-content: flex-end; font-size: 12px; color: var(--ink-3); }
.empty { padding: 26px 16px; text-align: center; color: var(--ink-3); font-size: 14px; }

/* ───────── シート（下から出る） ───────── */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(28, 24, 48, 0.28);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease);
}
.scrim.is-open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed;
  z-index: 90;
  left: 0; right: 0; bottom: 0;
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  border-radius: 28px 28px 0 0;
  transform: translateY(105%);
  transition: transform 0.5s var(--ease), visibility 0s linear 0.5s;
  padding-bottom: var(--safe-b);
  visibility: hidden;
}
.sheet.is-open { transform: none; visibility: visible; transition: transform 0.5s var(--ease), visibility 0s; }
.sheet.is-dragging { transition: none; }
.sheet-grip { flex: none; display: grid; place-items: center; height: 26px; cursor: grab; touch-action: none; }
.sheet-grip::before { content: ""; width: 42px; height: 5px; border-radius: 5px; background: rgba(40, 24, 110, 0.18); }
.sheet-head { flex: none; display: flex; align-items: flex-start; gap: 10px; padding: 0 12px 10px 20px; }
.sheet-head h2 { flex: 1; min-width: 0; font-size: 20px; font-weight: 900; padding-top: 6px; outline: none; }
.sheet-body { flex: 1; overflow-y: auto; padding: 4px 20px 24px; overscroll-behavior: contain; }
@media (min-width: 768px) {
  .sheet {
    left: 50%; right: auto; bottom: auto; top: 50%;
    width: min(620px, calc(100vw - 48px));
    max-height: min(80dvh, 760px);
    border-radius: 28px;
    transform: translate(-50%, -46%) scale(0.96);
    opacity: 0;
    transition: transform 0.45s var(--spring), opacity 0.25s var(--ease), visibility 0s linear 0.45s;
  }
  .sheet.is-open { transform: translate(-50%, -50%); opacity: 1; transition: transform 0.45s var(--spring), opacity 0.25s var(--ease), visibility 0s; }
  .sheet-grip { height: 14px; }
  .sheet-grip::before { display: none; }
}

/* ───────── 検索（コマンドパレット風） ───────── */

.palette {
  position: fixed;
  z-index: 95;
  left: 10px; right: 10px;
  top: calc(10px + env(safe-area-inset-top, 0px));
  max-height: calc(var(--vvh, 100dvh) - 20px);
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  overflow: hidden;
  transform: translateY(-14px) scale(0.98);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.4s var(--spring), opacity 0.2s var(--ease), visibility 0s linear 0.4s;
}
.palette.is-open { transform: none; opacity: 1; visibility: visible; transition: transform 0.4s var(--spring), opacity 0.2s var(--ease); }
@media (min-width: 768px) { .palette { left: 50%; right: auto; top: 12vh; width: 640px; max-height: 72vh; transform: translate(-50%, -14px) scale(0.98); } .palette.is-open { transform: translate(-50%, 0); } }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--line); }
.palette-input svg { width: 20px; height: 20px; color: var(--brand); flex: none; }
.palette-input input::-webkit-search-cancel-button, .dict-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
.palette-input input { flex: 1; min-width: 0; height: 48px; border: 0; background: transparent; font-size: 17px; outline: none; }
.palette-list { flex: 1; overflow-y: auto; padding: 6px; overscroll-behavior: contain; }
.palette-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 12px;
  border-radius: 14px;
  color: var(--ink);
  text-decoration: none;
  transition: background 0.12s;
}
.palette-item:hover { color: var(--ink); }
.palette-item[aria-selected="true"] { background: var(--brand-soft-2); }
.palette-item .pi-ico { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: rgba(124, 92, 240, 0.1); color: var(--brand-ink); }
.palette-item .pi-ico svg { width: 17px; height: 17px; }
.palette-item .pi-body { min-width: 0; flex: 1; line-height: 1.45; }
.palette-item .pi-t { display: block; font-weight: 800; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-item .pi-s { display: block; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-item mark { background: rgba(124, 92, 240, 0.2); color: inherit; border-radius: 3px; padding: 0 1px; }
.palette-foot { display: flex; gap: 14px; padding: 8px 16px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--ink-3); }
@media (max-width: 767px) { .palette-foot { display: none; } }

/* ───────── トースト ───────── */

.toast {
  position: fixed;
  z-index: 99;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 26px);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 32px);
  padding: 10px 18px 10px 12px;
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  background: rgba(28, 24, 48, 0.88);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 34px rgba(28, 24, 48, 0.3);
  transform: translate(-50%, 20px) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.45s var(--spring), opacity 0.25s;
}
.toast.is-shown { transform: translate(-50%, 0); opacity: 1; }
.toast .ok { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #22b59f; }
.toast .ok svg { width: 15px; height: 15px; }
@media (min-width: 1024px) { .toast { bottom: 30px; } }

/* ───────── スケルトン ───────── */

.skeleton-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  overflow: hidden;
  background: var(--bg);
  transition: opacity 0.5s var(--ease), visibility 0s linear 0.5s;
}
.skeleton-screen.is-gone { opacity: 0; visibility: hidden; }
.skeleton-screen { animation: skOut 0.4s ease 8s forwards; }
@keyframes skOut { to { opacity: 0; visibility: hidden; } }
.sk {
  border-radius: 12px;
  background: linear-gradient(100deg, rgba(124, 92, 240, 0.07) 30%, rgba(255, 255, 255, 0.95) 50%, rgba(124, 92, 240, 0.07) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.5s linear infinite;
}
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.sk-top { position: absolute; left: 0; right: 0; top: 0; height: 58px; display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.8); background: rgba(255, 255, 255, 0.5); }
.sk-body { max-width: 760px; margin: 0 auto; padding: 82px 16px 0; display: grid; gap: 14px; }
.sk-card { border-radius: 22px; padding: 18px; background: rgba(255, 255, 255, 0.6); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9), 0 10px 30px rgba(60, 40, 150, 0.06); display: grid; gap: 10px; }
.sk-tabs { position: absolute; left: 12px; right: 12px; bottom: calc(10px + var(--safe-b)); height: 66px; border-radius: 26px; background: rgba(255, 255, 255, 0.65); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9), 0 10px 30px rgba(60, 40, 150, 0.08); display: grid; grid-template-columns: repeat(5, 1fr); padding: 14px 10px; gap: 14px; }
.sk-side { display: none; }
@media (min-width: 1024px) {
  .sk-top, .sk-tabs { display: none; }
  .sk-side { display: grid; align-content: start; gap: 12px; position: absolute; left: 0; top: 0; bottom: 0; width: 280px; padding: 24px 18px; background: rgba(255, 255, 255, 0.5); border-right: 1px solid rgba(255, 255, 255, 0.8); }
  .sk-body { margin-left: calc(280px + max(40px, (100vw - 280px - 760px) / 2)); padding-top: 46px; }
}
.view-loading { display: grid; gap: 14px; }

/* ───────── 表示アニメーション ───────── */

.reveal { opacity: 0; transform: translateY(14px); }
.reveal.is-in { opacity: 1; transform: none; transition: opacity 0.6s var(--ease), transform 0.7s var(--ease); transition-delay: var(--d, 0s); }

.view.is-entering > * { animation: viewIn 0.55s var(--ease) both; }
.view.is-entering > *:nth-child(2) { animation-delay: 0.05s; }
.view.is-entering > *:nth-child(3) { animation-delay: 0.1s; }
.view.is-entering > *:nth-child(n + 4) { animation-delay: 0.14s; }
@keyframes viewIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

::view-transition-old(root) { animation: 0.2s var(--ease) both vtOut; }
::view-transition-new(root) { animation: 0.38s var(--ease) both vtIn; }
@keyframes vtOut { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vtIn { from { opacity: 0; transform: translateY(10px); } }

/* ───────── その他 ───────── */

.foot {
  margin-top: 56px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.8;
}
.foot a { color: var(--ink-3); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 30px; }
.pager a { padding: 12px 14px; }
.pager small { display: block; font-size: 11.5px; color: var(--ink-3); font-weight: 700; }
.pager b { font-size: 14.5px; }
.pager .next { text-align: right; grid-column: 2; }

body[data-os="mac"] .os-win,
body[data-os="win"] .os-mac { display: none; }

.inline-icon { display: inline-block; width: 1.1em; height: 1.1em; vertical-align: -0.18em; }
.nowrap { white-space: nowrap; }
.mt0 { margin-top: 0 !important; }
.mb0 { margin-bottom: 0 !important; }
.center { text-align: center; }

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

@media print {
  .topbar, .tabbar, .sidebar, .toc, .aurora, .sticky-copy, .skeleton-screen { display: none !important; }
  .main { padding: 0; }
  .prompt-text { max-height: none; }
}
