/* 公開ページ（規約・使い方・ヘルプなど public/ の静的な HTML）の見た目。SPA の Tailwind は読まない。
   SPA の CSS はビルドのたびにファイル名のハッシュが変わり、静的な HTML からは指せない。
   色・角丸は app/tailwind.css のトークンを写したもの。あちらを変えたらここも合わせる。
   フォントは各ページが Google Fonts から読む。SPA の @fontsource も Vite がハッシュ付きの名前で出すので
   指せず、public/ に写すと Noto Sans JP の 124 個の分割ファイル（5MB）を二重に持つことになる */
:root {
  color-scheme: light;
  --background: oklch(1 0 0);
  --foreground: oklch(0.147 0.004 49.25);
  --card: oklch(1 0 0);
  --primary: oklch(0.488 0.243 264.376);
  --primary-foreground: oklch(0.97 0.014 254.604);
  --muted: oklch(0.97 0.001 106.424);
  --muted-foreground: oklch(0.553 0.013 58.071);
  --accent: oklch(0.97 0.001 106.424);
  --border: oklch(0.923 0.003 48.717);
  --ring: oklch(0.709 0.01 56.259);
  --link: var(--primary);
  --radius: 0.625rem;
}
:root.dark {
  color-scheme: dark;
  --background: oklch(0.147 0.004 49.25);
  --foreground: oklch(0.985 0.001 106.423);
  --card: oklch(0.216 0.006 56.043);
  --primary: oklch(0.424 0.199 265.638);
  --primary-foreground: oklch(0.97 0.014 254.604);
  --muted: oklch(0.268 0.007 34.298);
  --muted-foreground: oklch(0.709 0.01 56.259);
  --accent: oklch(0.268 0.007 34.298);
  --border: oklch(1 0 0 / 10%);
  --ring: oklch(0.553 0.013 58.071);
  --link: oklch(0.785 0.115 274.713);
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: "Noto Sans", "Noto Sans JP", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--foreground);
  background: var(--background);
  overflow-wrap: anywhere;
  padding-inline: env(safe-area-inset-left) env(safe-area-inset-right);
}
a {
  color: var(--link);
  text-underline-offset: 0.2em;
}
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

.container {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: 1rem;
}
@media (min-width: 40rem) {
  .container {
    padding-inline: 1.5rem;
  }
}

/* ボタン。shadcn の Button（size="lg"）と同じ寸法 */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  height: 2.25rem;
  padding-inline: 0.625rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
}
.button:hover {
  background: color-mix(in oklch, var(--primary) 80%, transparent);
}
.button-outline {
  border-color: var(--border);
  background: var(--background);
  color: var(--foreground);
}
.button-outline:hover {
  background: var(--muted);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklch, var(--background) 85%, transparent);
  backdrop-filter: blur(8px);
}
.site-header > .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  height: 3.5rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  color: var(--foreground);
  font-weight: 700;
  text-decoration: none;
  line-height: 1.2;
}
.brand-mark {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius);
  background: var(--primary-foreground);
  color: var(--primary);
}
.brand-mark svg {
  width: 1.125rem;
  height: 1.125rem;
}
.site-header nav {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.25rem;
}
.nav-link {
  padding: 0.375rem 0.75rem;
  border-radius: calc(var(--radius) * 0.8);
  color: var(--muted-foreground);
  font-size: 0.875rem;
  text-decoration: none;
}
.nav-link:hover {
  background: var(--muted);
  color: var(--foreground);
}
/* 390 の幅ではアプリ名とログインだけを残す。ヘルプへはフッターから行ける */
@media (max-width: 29.99rem) {
  .nav-link {
    display: none;
  }
}

.page {
  flex: 1;
  padding-top: 1.5rem;
  padding-bottom: 4rem;
}
@media (min-width: 40rem) {
  .page {
    padding-top: 2.5rem;
  }
}
.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.page-header h1 {
  margin: 0;
  font-size: 1.75rem;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -0.01em;
}
@media (min-width: 40rem) {
  .page-header h1 {
    font-size: 2rem;
  }
}
.lead {
  margin: 0.75rem 0 0;
  color: var(--muted-foreground);
  font-size: 1.0625rem;
}
.meta {
  margin: 0.5rem 0 0;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
}

/* 和文で 1 行 40 字ほどに収める */
.prose {
  max-width: 42rem;
}
.prose h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.25rem;
  line-height: 1.5;
  font-weight: 700;
}
.prose h3 {
  margin: 2rem 0 0.5rem;
  font-size: 1.0625rem;
  line-height: 1.5;
  font-weight: 700;
}
.prose h4 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1rem;
  font-weight: 700;
}
.prose .page-header + h2 {
  margin-top: 0;
}
.prose p,
.prose ul,
.prose ol {
  margin: 0 0 1em;
}
.prose ul,
.prose ol {
  padding-left: 1.5em;
}
.prose li + li {
  margin-top: 0.25em;
}
.prose .card-grid,
.prose .steps {
  padding-left: 0;
}
.prose li::marker {
  color: var(--muted-foreground);
}
.prose section + section {
  margin-top: 3rem;
}
.prose section > h2 {
  margin-top: 0;
}

.breadcrumb {
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted-foreground);
}
.breadcrumb li + li::before {
  content: "/";
  margin-right: 0.5rem;
  color: var(--border);
}
.breadcrumb a {
  color: inherit;
  text-decoration: none;
}
.breadcrumb a:hover {
  color: var(--foreground);
  text-decoration: underline;
}
.breadcrumb [aria-current="page"] {
  color: var(--foreground);
}

.card-grid {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 40rem) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 64rem) {
  .page > .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin: 0;
  padding: 1.25rem;
  border-radius: calc(var(--radius) * 1.4);
  background: var(--card);
  box-shadow: 0 0 0 1px color-mix(in oklch, var(--foreground) 10%, transparent);
  font-size: 0.9375rem;
  line-height: 1.7;
}
.prose .card + .card {
  margin-top: 0;
}
.card h2,
.prose .card h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  font-weight: 600;
}
.card p,
.card ul {
  margin: 0;
  color: var(--muted-foreground);
}
.card ul {
  margin-top: 0.25rem;
  padding-left: 1.25em;
}
.card .meta {
  margin-top: auto;
  padding-top: 0.5rem;
}
.card .button {
  margin-top: 0.5rem;
}
/* 見出しのリンクでカード全体を押せるようにする */
.card h2 a {
  color: var(--foreground);
  text-decoration: none;
}
.card h2 a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.card:has(h2 a):hover {
  box-shadow: 0 0 0 1px color-mix(in oklch, var(--primary) 50%, transparent);
}
.card h2 a:focus-visible {
  outline: none;
}
.card:has(h2 a:focus-visible) {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.steps {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
@media (min-width: 40rem) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.prose .steps li {
  margin: 0;
  padding: 1.25rem;
  border-radius: calc(var(--radius) * 1.4);
  background: var(--card);
  box-shadow: 0 0 0 1px color-mix(in oklch, var(--foreground) 10%, transparent);
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.75rem;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 700;
  line-height: 1;
}
.prose .steps h4 {
  margin: 0;
  font-size: 1rem;
}
.steps p {
  margin: 0.25rem 0 0;
  color: var(--muted-foreground);
  font-size: 0.9375rem;
}

.doc-layout {
  display: grid;
  gap: 2.5rem;
}
@media (min-width: 64rem) {
  .doc-layout {
    grid-template-columns: minmax(0, 42rem) 16rem;
    justify-content: space-between;
    align-items: start;
  }
  .doc-nav {
    position: sticky;
    top: 5rem;
  }
}
.doc-nav {
  padding: 1rem;
  border-radius: calc(var(--radius) * 1.4);
  background: var(--card);
  box-shadow: 0 0 0 1px color-mix(in oklch, var(--foreground) 10%, transparent);
  font-size: 0.875rem;
}
.doc-nav h2 {
  margin: 0 0 0.5rem;
  padding-inline: 0.625rem;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  font-weight: 600;
}
.doc-nav ul {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.doc-nav a {
  display: block;
  padding: 0.375rem 0.625rem;
  border-radius: calc(var(--radius) * 0.8);
  color: var(--foreground);
  line-height: 1.5;
  text-decoration: none;
}
.doc-nav a:hover {
  background: var(--muted);
}
.doc-nav a[aria-current="page"] {
  background: var(--muted);
  font-weight: 600;
}

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 0.875rem;
}
.site-footer > .container {
  padding-block: 2rem;
}
.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-footer a {
  color: inherit;
  text-decoration: none;
}
.site-footer a:hover {
  color: var(--foreground);
  text-decoration: underline;
}
.site-footer a[aria-current="page"] {
  color: var(--foreground);
  font-weight: 600;
}
.site-footer p {
  margin: 1rem 0 0;
  font-size: 0.8125rem;
}
