/* =========================
   Sonansu Sensei - site css
   ========================= */
/* =========================
   Sonansu Sensei - site css
   ========================= */

@import url("https://fonts.googleapis.com/css2?family=Zen+Kaku+Gothic+New:wght@400;500;700;900&display=swap");

/* ===== Design System ===== */
:root {
  /* fonts */
  --font: "Zen Kaku Gothic New", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP",
    "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;

  /* layout */
  --max: 1040px;
  --header-h: 72px;

  /* radius / shadow */
  --radius: 18px;
  --radius-sm: 14px;
  --shadow: 0 18px 60px rgba(2, 6, 23, 0.12);

  /* ===== Light theme defaults ===== */
  --bg: #f8fafc;
  --bg-accent: #eef2ff;

  --surface: rgba(15, 23, 42, 0.06);
  --surface-2: rgba(15, 23, 42, 0.10);

  --text-strong: #020617;
  --text: #0f172a;
  --text-soft: rgba(15, 23, 42, 0.82);
  --text-faint: rgba(15, 23, 42, 0.60);
  --muted: var(--text-soft);
  --muted-2: var(--text-faint);

  --border: rgba(15, 23, 42, 0.14);

  --primary: #2563eb;
  --primary-2: #1d4ed8;

  --ok: #16a34a;
  --ok-bg: rgba(22, 163, 74, 0.12);

  --warn: #f59e0b;
  --bad: #ef4444;
}



:root {
  color-scheme: light dark;
}

/* Force theme (for in-app browsers that ignore prefers-color-scheme) */
:root[data-theme="dark"] {
  --bg: #0b1020;
  --bg-accent: #0f172a;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-2: rgba(255, 255, 255, 0.09);
  --text-strong: #ffffff;
  --text: #f6f9fd;
  --text-soft: #dbe5f1;
  --text-faint: #afbfd2;
  --muted: var(--text-soft);
  --muted-2: var(--text-faint);
  --border: rgba(226, 232, 240, 0.14);
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  --primary: #60a5fa;
  --primary-2: #3b82f6;
  --ok: #22c55e;
  --ok-bg: rgba(34, 197, 94, 0.14);
  --warn: #f59e0b;
  --bad: #ef4444;
  color-scheme: dark;
}



/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020;
    --bg-accent: #0f172a;
    --surface: rgba(255, 255, 255, 0.06);
    --surface-2: rgba(255, 255, 255, 0.09);

    --text-strong: #ffffff;
    --text: #f6f9fd;
    --text-soft: #dbe5f1;
    --text-faint: #afbfd2;
    --muted: var(--text-soft);
    --muted-2: var(--text-faint);

    --border: rgba(226, 232, 240, 0.14);
    --shadow: 0 18px 60px rgba(0, 0, 0, 0.45);

    --primary: #60a5fa;
    --primary-2: #3b82f6;

    --ok: #22c55e;
    --ok-bg: rgba(34, 197, 94, 0.14);
    --warn: #f59e0b;
    --bad: #ef4444;

  }
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  line-height: 1.75;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(37, 99, 235, 0.14), transparent 60%),
    radial-gradient(900px 500px at 85% 0%, rgba(124, 58, 237, 0.10), transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-accent) 100%);

  /* Footer を画面下に押し下げるための Flex layout */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

.site-footer {
  margin-top: auto;
}


a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

/* ---- Layout helpers ---- */
:root[data-theme="dark"] .site-header {
  background: rgba(11, 16, 32, 0.65);
}

.container {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.skip-link:focus {
  left: 16px;
  z-index: 9999;
}


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


/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  min-height: var(--header-h, 72px);
  isolation: isolate;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.70);
  backdrop-filter: blur(14px);
}

.site-header,
.header-inner {
  overflow: visible;
}

@media (prefers-color-scheme: dark) {
  .site-header {
    background: rgba(11, 16, 32, 0.65);
  }
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h, 72px);
  padding: 14px 0;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: flex-end;
  gap: 0;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand-logo {
  height: calc(var(--header-h, 72px) - 10px);
  max-height: 72px;
  width: auto;
  max-width: min(420px, 100%);
  display: block;
  transform: translateY(10px);
}

.brand-text {
  display: inline-flex;
  /* 1列にする */
  flex-direction: row;
  align-items: baseline;
  gap: 10px;
  line-height: 1.1;
  white-space: nowrap;
  /* 折り返さない */
}

.brand-sub {
  font-size: 14px;
  /* 小さすぎたので戻す */
  opacity: .85;
  font-weight: 600;
}

/* ドロワーは左寄せの方が見やすい */
.nav-drawer a {
  justify-content: flex-start;
}



.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav a {
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
}

.nav a:hover {
  background: var(--surface);
  border-color: var(--border);
  text-decoration: none;
  color: var(--text);
}

/* ---- Docs header (nav dropdown) ---- */
.docs-header .brand {
  align-items: center;
}

.docs-header .brand-logo {
  height: calc(var(--header-h, 72px) - 24px);
  max-height: 52px;
  transform: none;
}

.docs-header .nav-group {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.docs-header .nav-group-summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.docs-header .nav-group-summary::-webkit-details-marker {
  display: none;
}

.docs-header .nav-group-summary::after {
  content: "▾";
  font-size: 12px;
  opacity: 0.7;
}

.docs-header .nav-group[open] .nav-group-summary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.docs-header .nav-group-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg);
  box-shadow: var(--shadow);
  display: grid;
  gap: 4px;
  z-index: 20;
}

.docs-header .nav-group:not([open]) .nav-group-menu {
  display: none;
}

.docs-header .nav-group-menu a {
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--muted);
}

.docs-header .nav-group-menu a:hover {
  background: var(--surface);
  color: var(--text);
}

.docs-nav-drawer .nav-drawer-title {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 8px 10px 4px;
}

/* ---- Docs layout ---- */
.page-teacher-docs .docs-layout {
  display: grid;
  gap: 18px;
  align-items: start;
}

.page-teacher-docs .docs-sidenav-card {
  padding: 14px;
}

.page-teacher-docs .docs-sidenav-title {
  margin: 0 0 10px;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.page-teacher-docs .docs-sidenav-links {
  display: grid;
  gap: 6px;
}

.page-teacher-docs .docs-sidenav-group {
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 2px 0;
}

.page-teacher-docs .docs-sidenav-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  cursor: pointer;
  list-style: none;
}

.page-teacher-docs .docs-sidenav-group-title::-webkit-details-marker {
  display: none;
}

.page-teacher-docs .docs-sidenav-group-title::marker {
  content: "";
}

.page-teacher-docs .docs-sidenav-group-title::after {
  content: "▸";
  font-size: 0.75rem;
  color: var(--muted-2);
  transition: transform 0.18s ease;
}

.page-teacher-docs .docs-sidenav-group[open] .docs-sidenav-group-title::after {
  transform: rotate(90deg);
}

.page-teacher-docs .docs-sidenav-group-links {
  display: grid;
  gap: 6px;
  padding-bottom: 6px;
}

.page-teacher-docs .docs-sidenav-links a {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: var(--muted);
}

.page-teacher-docs .docs-sidenav-links a.docs-sidenav-sub {
  padding-left: 22px;
  font-size: 0.95rem;
  position: relative;
}

.page-teacher-docs .docs-sidenav-links a.docs-sidenav-sub::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 6px;
  height: 1px;
  background: var(--border);
}

.page-teacher-docs .docs-sidenav-links a:hover {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  text-decoration: none;
}

.page-teacher-docs .docs-section {
  background: transparent;
  border: none;
  padding: 0;
}

.page-teacher-docs .docs-card-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.page-teacher-docs .docs-card {
  grid-column: auto;
  display: grid;
  gap: 10px;
  padding: 18px;
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 16px 36px rgba(2, 6, 23, 0.22);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.page-teacher-docs .docs-card:hover {
  transform: translateY(-2px);
  border-color: rgba(96, 165, 250, 0.35);
  background: rgba(96, 165, 250, 0.08);
}

.page-teacher-docs .docs-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.page-teacher-docs .docs-card p {
  margin: 0;
}

.page-teacher-docs .docs-card-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #e2e8f0;
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

@media (min-width: 961px) {
  .page-teacher-docs .docs-layout {
    grid-template-columns: minmax(200px, 240px) 1fr;
  }

  .page-teacher-docs .docs-sidenav {
    position: sticky;
    top: calc(var(--header-h, 72px) + 16px);
  }

  body.layout-sidebar.page-teacher-docs .docs-sidenav {
    top: var(--sidebar-safe, 16px);
  }
}



/* ---- Mobile drawer ---- */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .06);
  color: var(--text);
}

.nav-toggle__bars {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  position: relative;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.nav-toggle__bars::before {
  top: -6px;
}

.nav-toggle__bars::after {
  top: 6px;
}

.nav-wrap {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: 1fr min(320px, 86vw);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}

.nav-wrap .nav-drawer {
  grid-column: 2;
  height: 100%;
  padding: 18px 16px calc(24px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-left: 1px solid var(--border);
  box-shadow: -18px 0 40px rgba(2, 6, 23, 0.28);
  display: grid;
  align-content: start;
  gap: 6px;
  overflow-y: auto;
  transform: translateX(18px);
  transition: transform .18s ease;
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  opacity: 0;
  pointer-events: none;
  background: rgba(2, 6, 23, 0.46);
  transition: opacity .18s ease;
}

html.nav-open .nav-wrap {
  opacity: 1;
  pointer-events: auto;
}

html.nav-open .nav-wrap .nav-drawer {
  transform: translateX(0);
}

html.nav-open .nav-backdrop {
  opacity: 1;
  pointer-events: auto;
}


@media (prefers-reduced-motion: reduce) {

  .nav-wrap,
  .nav-wrap .nav-drawer {
    transition: none;
  }
}

/* ---- Typography ---- */
h1,
h2,
h3 {
  line-height: 1.25;
  margin: 0 0 10px;
}

h1 {
  font-size: clamp(26px, 3.2vw, 38px);
  letter-spacing: -0.02em;
}

h2 {
  font-size: 20px;
}

p {
  margin: 0 0 14px;
  color: var(--muted);
}


.lead {
  font-size: 1.05rem;
  color: var(--muted);
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}

/* ---- UI pieces ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 700;
  font-size: 12px;
  color: var(--text-soft);
}

.badge-updated .badge-label {
  color: var(--text-faint);
}

/* Beta badge */
.badge-beta {
  border-color: rgba(245, 158, 11, 0.28);
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

:root[data-theme="dark"] .badge-beta {
  border-color: rgba(245, 158, 11, 0.30);
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
}

/* Remote badge */
.badge--remote {
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid rgba(34, 197, 94, 0.28);
  font-weight: 800;
}


/* Discord-like embed preview */
.discord-embed {
  display: grid;
  grid-template-columns: 4px 1fr;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 16px;
  overflow: hidden;
  margin-top: 12px;
}

.discord-embed__bar {
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
}

.discord-embed__body {
  padding: 14px 14px 12px;
}

.discord-embed__title {
  font-weight: 800;
  margin: 0 0 6px;
}

.discord-embed__desc {
  margin: 0;
  color: var(--muted);
}

.discord-embed__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

@media (max-width: 640px) {
  .discord-embed__fields {
    grid-template-columns: 1fr;
  }
}

.discord-embed__field {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
}

.discord-embed__name {
  font-weight: 800;
  font-size: 12px;
  color: var(--muted-2);
}

.discord-embed__value {
  margin: 6px 0 0;
  color: var(--text);
}

.discord-embed__footer {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--muted-2);
}


.badge-ok {
  border-color: rgba(22, 163, 74, 0.25);
  background: var(--ok-bg);
  color: var(--ok);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--ok);
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.10);
}

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

.btn-row.pager {
  align-items: center;
}

.pager-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  font-variant-numeric: tabular-nums;
}


.pager-btn {
  min-width: 44px;
  justify-content: center;
  font-weight: 900;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.pager-label {
  min-width: 56px;
  text-align: center;
  font-weight: 800;
  letter-spacing: 0.02em;
}


.pager-btn.is-disabled,
.pager-btn[aria-disabled="true"],
.pager-btn[data-disabled="1"] {
  opacity: 0.35;
  pointer-events: none;
  filter: grayscale(1);
}


.btn-sm {
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
}




/* 極小端末でも3列維持 */
@media (max-width: 380px) {
  .quick-icon {
    filter:
      drop-shadow(0 10px 18px rgba(0, 0, 0, .35))
      /* 影 */
      drop-shadow(0 0 10px rgba(255, 255, 255, .22));
    /* 白グロー（縁取りっぽい） */
  }

}




.quick-icon {
  width: 64px;
  /* 判別しやすいサイズ */
  height: 64px;
  border-radius: 18px;
  object-fit: contain;

  /* 透過PNGの“枠っぽい暗さ”は box-shadow(矩形) が原因になりやすい */
  box-shadow: none;

  /* αに沿う影に寄せる（うっすら縁取り兼ねる） */
  filter:
    drop-shadow(0 10px 18px rgba(0, 0, 0, .22)) drop-shadow(0 0 12px rgba(255, 255, 255, .26));
}


/* 稼働中の“もあもあ”をアイコンに重ねる */
.status-dot {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--ok);
  border: 2px solid var(--surface);
}

.status-dot::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
  animation: statusPulse 1.6s ease-out infinite;
}

@keyframes statusPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
  }

  70% {
    box-shadow: 0 0 0 12px rgba(34, 197, 94, 0.00);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.00);
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-dot::after {
    animation: none;
  }
}

.quick-label {
  font-weight: 800;
  color: var(--text);
  font-size: 13px;
  text-align: center;
  line-height: 1.2;
}

/* 極小端末：3列維持しつつ少し縮める */
@media (max-width: 380px) {
  .quick-grid {
    gap: 10px;
  }

  .quick-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
  }

  .quick-label {
    font-size: 12px;
  }
}

/* 余裕がある幅：少し大きく */
@media (min-width: 860px) {
  .quick-icon {
    width: 72px;
    height: 72px;
    border-radius: 20px;
  }

  .quick-label {
    font-size: 14px;
  }
}


/* Diary index layout */
.diary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 16px;
}

@media (min-width: 860px) {
  .diary-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* 追加：3枚カード用 */
.card.span-5 {
  grid-column: span 5;
}

.card.span-7 {
  grid-column: span 7;
}

.card.span-6 {
  grid-column: span 6;
}



/* Buttons: stack vertically when needed */
.btn-row.btn-stack {
  flex-direction: column;
  align-items: stretch;
}

.btn-row.btn-stack .btn {
  width: 100%;
}


.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-weight: 700;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.20);
}

.btn:hover {
  filter: brightness(1.03);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
  box-shadow: none;
}

.btn-ghost:hover {
  background: var(--surface);
}

/* ---- Utilities (missing classes used in HTML) ---- */
.muted {
  color: var(--text-soft);
}

.muted-2 {
  color: var(--text-faint);
}

.text-strong {
  color: var(--text-strong);
}

.text-soft {
  color: var(--text-soft);
}

.text-faint {
  color: var(--text-faint);
}

.small {
  font-size: 0.85rem;
}

.btn-sm {
  padding: 8px 10px;
  font-size: 12px;
  border-radius: 12px;
}

.btn-soft {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
  box-shadow: none;
}

.btn-soft:hover {
  background: var(--surface);
}

.badge.soft {
  background: var(--surface-2);
}

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

.card-head h2,
.card-head h3 {
  margin: 0;
}

/* ---- Cards / sections ---- */
.hero {
  padding: 54px 0 18px;
}

@media (min-width: 761px) {
  body.layout-sidebar .hero {
    padding-top: var(--sidebar-safe, 16px);
  }
}


.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  padding: 22px;
  box-shadow: var(--shadow);
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.hero-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  column-gap: 12px;
  row-gap: 8px;
  margin-bottom: 10px;
}

.hero-head h1 {
  min-width: 0;
}

.hero-head .badge {
  white-space: nowrap;
  justify-self: end;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.hero-status {
  margin-top: 12px;
}

.download-metric {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.download-metric-label {
  color: var(--text-faint);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.download-metric-value {
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

/* “最終更新”の幅を詰める（スマホで右端固定しやすくする） */


/* “最終更新”の幅を詰める（スマホで右端固定しやすくする） */
.badge-updated .badge-label::after {
  content: ":";
  margin-left: 4px;
}

@media (max-width: 520px) {
  .badge-updated {
    padding: 6px 10px;
    gap: 6px;
    font-size: 12px;
  }

  .badge-updated .badge-label {
    display: none;
    /* 文字を落として幅を稼ぐ */
  }

  .download-metric {
    width: 100%;
    justify-content: space-between;
  }
}



.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  padding: 18px 0 56px;
}

.card {
  grid-column: span 12;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

@media (min-width: 860px) {
  .card.span-4 {
    grid-column: span 4;
    /* 追加：PCで3列 */
  }

  .card.span-5 {
    grid-column: span 5;
  }

  .card.span-7 {
    grid-column: span 7;
  }

  .card.span-6 {
    grid-column: span 6;
  }
}

/* PC狭幅（761–1099px）は常に1カラムに倒して崩れにくくする */
@media (min-width: 761px) and (max-width: 1099px) {

  .card.span-4,
  .card.span-5,
  .card.span-6,
  .card.span-7 {
    grid-column: span 12;
  }
}


.card h2 {
  margin-bottom: 12px;
}

.list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.list li {
  margin: 8px 0;
}

code,
kbd,
samp,
pre {
  font-family: var(--mono);
}

:not(pre)>code,
:not(pre)>kbd,
:not(pre)>samp {
  display: inline-block;
  max-width: 100%;
  font-size: 0.95em;
  line-height: 1.45;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.22em 0.56em;
  border-radius: 10px;
  color: var(--text);
  vertical-align: middle;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

pre {
  margin: 14px 0;
  padding: 16px 18px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

pre code {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.72;
  white-space: pre;
}

/* KPI */
.kpi {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

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

.kpi-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
}

.kpi-num {
  font-size: 1.2rem;
  font-weight: 800;
}

.kpi-label {
  color: var(--text-faint);
  font-size: .95rem;
}

/* FAQ */
.faq {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 16px;
  padding: 10px 12px;
  margin: 10px 0;
}

.faq>summary {
  cursor: pointer;
  font-weight: 700;
}

.faq p {
  margin: 10px 0 0;
}


/* Timeline */
/* Timeline */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline li {
  position: relative;
  padding: 10px 10px 10px 22px;
  border-left: 2px solid var(--border);
  margin-left: 10px;
  color: var(--muted);
}

.timeline li.is-hidden {
  display: none;
}

.timeline-toggle-wrap {
  margin-top: 12px;
  display: flex;
}

.timeline-toggle {
  gap: 6px;
}

/* default marker (future / not started) */
.timeline li::before {
  content: "";
  position: absolute;
  left: -9px;
  top: 14px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 2px solid var(--primary);
}

/* label pill */
.timeline .ver {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  color: var(--text);
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  margin-right: 8px;
}

/* ---- status: DONE (check) ---- */
/* ---- status: DONE (check) ---- */
/* まずはマーカー全体を少し大きめに（16px → 18px） */
.timeline li::before {
  /* 既に定義があるはずなので、ここは上書きになる位置に置くか、
     既存の値を 18px に変更してください */
  width: 18px;
  height: 18px;
  left: -10px;
  /* サイズ変更に合わせて微調整 */
  top: 13px;
  /* 文字行の中心に合うように微調整 */
}

/* DONE: サイトのUIに合わせて「丸みのあるチェック」をSVGで描画 */
.timeline li.is-done::before {
  content: "";
  background: linear-gradient(180deg, rgba(34, 197, 94, 1), rgba(16, 185, 129, 1));
  border-color: rgba(34, 197, 94, 0.9);
  box-shadow: 0 10px 24px rgba(34, 197, 94, 0.18);

  /* チェック（白・丸みのある線） */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4.2 10.6l3.2 3.3 8.1-8.2' fill='none' stroke='%23ffffff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 12px;
}

.timeline li.is-done .ver {
  border-color: rgba(34, 197, 94, 0.45);
  background: var(--ok-bg);
  color: var(--ok);
}


/* ---- status: IN PROGRESS (pulsing dot) ---- */
.timeline li.is-progress::before {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.45);
  animation: timelinePulse 1.6s ease-out infinite;
}

.timeline li.is-progress .ver {
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.10);
  color: var(--primary);
}

.timeline .ver .ver-label {
  font-weight: 900;
  opacity: .95;
}


@keyframes timelinePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.45);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(37, 99, 235, 0.00);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.00);
  }
}

@media (prefers-reduced-motion: reduce) {
  .timeline li.is-progress::before {
    animation: none;
  }
}

/* ---- status: FUTURE (keep hollow marker, slightly muted) ---- */
.timeline li.is-future::before {
  background: var(--surface);
  border-color: rgba(37, 99, 235, 0.55);
}

.timeline li.is-future .ver {
  background: var(--surface);
  color: var(--muted-2);
}


/* Article */
.article {
  padding: 26px 0 56px;
}

.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  padding: 22px;
  box-shadow: var(--shadow);
}

.article-card :where(h2, h3, h4) {
  scroll-margin-top: 88px;
}

.article-toc,
.article-inline-ad {
  margin: 22px 0;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.96));
}

:root[data-theme="dark"] .article-toc,
:root[data-theme="dark"] .article-inline-ad {
  background: linear-gradient(180deg, rgba(18, 26, 49, 0.82), rgba(11, 16, 32, 0.92));
}

.article-toc-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.article-toc-title {
  margin: 0;
  font-size: 1rem;
}

.article-toc-meta {
  margin: 0;
  font-size: 0.86rem;
}

.article-toc-list {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 9px;
}

.article-toc-item--h3 {
  margin-left: 0.9rem;
  list-style-type: circle;
}

.article-toc a,
.article-toc-link {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.article-toc a:hover,
.article-toc a:focus-visible,
.article-toc-link:hover,
.article-toc-link:focus-visible {
  color: var(--text-strong);
  border-color: currentColor;
}

.article-inline-ad {
  display: grid;
  gap: 10px;
}

.article-ad-label {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-faint);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.article-ad-slot {
  display: block;
  width: 100%;
  min-height: 140px;
}

.content-ad-card {
  min-width: 0;
}

.content-ad-card ins {
  display: block;
  width: 100%;
}

.page-blog .blog-ad-inline,
.page-blog .blog-ad-rail {
  display: none;
}

.page-blog.has-blog-inline-ad .blog-ad-inline {
  display: block;
  margin: 0;
}

.page-blog.has-blog-inline-ad .blog-ad-inline ins {
  display: block;
  width: 100%;
}

.blog-ad-placeholder {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border: 1px dashed rgba(96, 165, 250, 0.55);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(96, 165, 250, 0.10), rgba(255, 255, 255, 0.03));
  color: var(--muted);
}

.blog-ad-placeholder strong {
  color: var(--text);
}

.blog-ad-placeholder-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.16);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.page-blog.has-blog-rail-ad .article-card,
.page-blog.has-blog-rail-ad .card {
  min-width: 0;
}

@media (min-width: 1280px) {
  .page-blog.layout-sidebar.has-blog-rail-ad .container {
    width: min(calc(var(--max) + 332px), calc(100% - 32px));
  }

  .page-blog.has-blog-rail-ad .blog-main-layout,
  .page-blog.page-blog-article.has-blog-rail-ad .blog-article-layout {
    display: grid;
    gap: 22px;
    align-items: start;
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  .page-blog.has-blog-rail-ad .blog-ad-rail {
    display: block;
    position: sticky;
    top: var(--sidebar-safe, 16px);
  }

  .page-blog.has-blog-rail-ad .blog-ad-rail ins {
    display: block;
    width: 100%;
  }

  .page-blog.has-blog-rail-ad .blog-ad-inline {
    display: none;
  }
}

.article-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
  color: var(--text-faint);
  font-size: 13px;
}

/* Footer */
/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.94);
  position: relative;
}

/*
  Mobile bottom shortcut bar
  - Hidden by default (desktop/pc)
  - Enabled and styled in /css/mobile.css
*/
.mobile-bottom-nav {
  display: none;
}

.site-right-rail {
  display: none;
}

.layout-main-shell,
.layout-main-column,
.layout-page-aside,
.layout-shell {
  min-width: 0;
}

.layout-page-aside {
  display: none;
}


@media (prefers-color-scheme: dark) {
  .site-footer {
    background: rgba(11, 16, 32, 0.96);
  }
}

.footer-inner {
  padding: 18px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted-2);
  font-size: 13px;
}

:root[data-theme="dark"] .site-footer {
  background: rgba(11, 16, 32, 0.96);
}



.btn-sm {
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
}

/* ---- Home quick links ---- */
.launch-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 840px) {
  .launch-grid {
    grid-template-columns: 1fr;
  }
}

.launch-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  text-decoration: none;
}

.launch-btn:hover {
  text-decoration: none;
  background: var(--surface);
}

.app-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  flex: 0 0 auto;
  object-fit: cover;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.18);
}

.launch-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.launch-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.launch-title-row .badge {
  margin: 0;
}

.launch-title {
  font-weight: 800;
  letter-spacing: -0.01em;
}

.launch-sub {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Hero dock (quick links) ---- */
.hero-dock {
  margin-top: 14px;
  padding: 12px;
  border-radius: calc(var(--radius) + 6px);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.55);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

:root[data-theme="dark"] .hero-dock {
  background: rgba(11, 16, 32, 0.45);
}

.dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 8px;
  border-radius: 16px;
  text-decoration: none;
}

.dock-item:hover {
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

.dock-icon-wrap {
  position: relative;
  display: inline-flex;

  /* 台座（=読めるようにする本体） */
  width: 74px;
  height: 74px;
  padding: 7px;
  /* 内側余白＝リング太さ */
  border-radius: 999px;
  /* 円 */
  overflow: hidden;
  /* 透過PNGを円でクリップ */
  background: rgba(255, 255, 255, 0.10);
  /* 薄いアイコンでも輪郭が出る */
  border: 1px solid var(--border);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.dock-icon {
  width: 100%;
  height: 100%;
  display: block;
  /* 余計な隙間防止 */
  border-radius: 999px;
  /* 円 */
  object-fit: cover;

  /* 透過PNGでも中身が薄い場合の補正 */
  filter: contrast(1.18) saturate(1.12);

}

/* 稼働中ドットは台座の外周に置く（見切れ防止） */
.status-dot {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--ok);
  border: 2px solid var(--surface);
}


.dock-label {
  font-weight: 800;
  color: var(--text);
  font-size: 13px;
  line-height: 1.1;
  text-align: center;
}

/* 台座（プレート）で輪郭を出す */
.dock-icon-wrap {
  position: relative;
  display: inline-flex;
}

.dock-icon-wrap::before {
  content: "";
  position: absolute;
  inset: -8px;
  /* アイコンの周りに余白（見た目が締まる） */
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

/* アイコン自体：白縁＋コントラスト補正 */
.dock-icon {
  position: relative;
  z-index: 1;
  width: 68px;
  /* ベースを少し上げる */
  height: 68px;
  border-radius: 20px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.14);
  /* 薄いアイコンでも輪郭が出る */
  filter: contrast(1.18) saturate(1.12);
  /* ここが効く */
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.18);
}

/* 極小端末でも 64px を死守（56に落とさない） */
@media (max-width: 380px) {
  .hero-dock {
    gap: 8px;
    padding: 10px;
  }

  .dock-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
  }

  .dock-icon-wrap::before {
    inset: -7px;
    border-radius: 20px;
  }

  .dock-label {
    font-size: 12px;
  }

  .dock-icon-wrap {
    width: 70px;
    height: 70px;
    padding: 6px;
  }

}


/* PCだけ中央を少し強調（見た目と導線の両立） */
@media (min-width: 860px) {
  .dock-item.is-primary {
    transform: translateY(-4px);
  }

  .dock-item.is-primary .dock-icon {
    width: 84px;
    height: 84px;
    border-radius: 22px;
  }

  .dock-item.is-primary .dock-label {
    font-size: 14px;
  }
}


/* ---- Home news ---- */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.section-head h2 {
  margin: 0;
}

.news {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.news a {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  flex-wrap: wrap;
}

.news a:hover {
  text-decoration: none;
  background: var(--surface);
}

.news time {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
  flex: 0 0 auto;
}

.news-title {
  color: var(--text-strong);
  min-width: 0;
}

@media (max-width: 480px) {
  .news a {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 720px) {
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* --- hero head: badgeを右端固定（スマホでも落ちない） --- */
.hero-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px 12px;
  margin-bottom: 10px;
}

.hero-head h1 {
  min-width: 0;
}

.hero-head .badge {
  justify-self: end;
  white-space: nowrap;
}

/* “最終更新”バッジを詰める（狭い端末で幅を稼ぐ） */
.badge-updated {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 520px) {
  .badge-updated .badge-label {
    display: none;
    /* 文字を消して日付だけに */
  }
}


.hero-head .badge {
  white-space: nowrap;
}

/* =========================
   Mobile Side Rail (常時表示)
   ========================= */

/* ルールをグローバルに定義しておく（メディアクエリが効かない環境でも暴れないように） */
.side-rail {
  display: none;
}

.rail-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 6px;
  border-radius: 16px;
  color: var(--text);
  border: 1px solid transparent;
}

.rail-link:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
  text-decoration: none;
}

.rail-icon {
  width: 66px;
  height: 66px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: visible;
}

.rail-icon img {
  width: 66px;
  height: 66px;
  object-fit: contain;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, .35));
  transform: scale(var(--rail-icon-scale, 1));
  transform-origin: center;
}

.rail-label {
  font-weight: 800;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  line-height: 1.1;
}

.rail-badge {
  position: absolute;
  right: -6px;
  top: -8px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  backdrop-filter: blur(10px);
}

@media (max-width: 760px) {

  /* 右側に“箱なし”で常駐（本文に被せる） */
  .side-rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;

    position: fixed;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);

    width: auto;
    padding: 0;

    /* 箱（背景/枠）を完全に消す */
    background: transparent;
    border: none;
    border-radius: 0;
    backdrop-filter: none;
    box-shadow: none;

    z-index: 70;
    pointer-events: none;
    /* バー自体は邪魔しない */
  }

  .side-rail .rail-link {
    pointer-events: auto;
    /* ボタンだけ押せる */
  }

  /* ホバーはモバイルでは“無し”寄りに */
  .side-rail .rail-link:hover {
    background: transparent;
    border-color: transparent;
  }

  /* アイコンを少し大きく */
  .side-rail .rail-icon {
    width: 76px;
    height: 76px;
    border-radius: 0;
    background: transparent;
    border: none;
  }

  /* 透過PNGの視認性を上げる */
  .side-rail .rail-icon img {
    width: 76px;
    height: 76px;
    object-fit: contain;
    filter:
      drop-shadow(0 16px 28px rgba(0, 0, 0, .55)) drop-shadow(0 0 10px rgba(0, 0, 0, .35));
  }

  /* ラベルを“強く”する（影で縁取りっぽく） */
  .side-rail .rail-label {
    font-size: 13px;
    /* 少し上げる */
    font-weight: 900;
    /* 太く */
    color: rgba(255, 255, 255, .92);
    letter-spacing: 0.02em;

    /* 擬似縁取り（複数シャドウで囲む） */
    text-shadow:
      0 2px 10px rgba(0, 0, 0, .65),
      -1px 0 rgba(0, 0, 0, .55),
      1px 0 rgba(0, 0, 0, .55),
      0 -1px rgba(0, 0, 0, .55),
      0 1px rgba(0, 0, 0, .55);
  }

  /* 日記は一番下固定 */
  .side-rail .rail-link--diary {
    margin-top: auto;
  }

  /* 本文は被せてOK（余白なし） */
  main {
    padding-right: 0;
  }

  /* ステータスドットは存在感強めに（お好みで） */
  .side-rail .status-dot {
    right: 6px;
    top: 6px;
    bottom: auto;
    border-color: rgba(11, 16, 32, 0.85);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, .30);
  }
}

/* mobile bottom nav: default hidden (enabled in /css/mobile.css) */
.mobile-bottom-nav {
  display: none;
}

/* README 右下コーナー画像 */
/* README 右下コーナー画像（カード右下固定） */
.readme-card--has-corner {
  position: relative;
}

/* 右下に画像を置く分、本文が被らないように余白を確保 */
.readme-wrap--has-corner {
  padding-right: calc(clamp(72px, 8vw, 128px) * 0.45 + 22px);
  padding-bottom: calc(clamp(72px, 8vw, 128px) + 26px);
}

.readme-corner {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: clamp(72px, 8vw, 128px);
  height: auto;
  opacity: 0.95;
  pointer-events: none;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35));
}

/* モバイルは少し小さく */
@media (max-width: 600px) {
  .readme-wrap--has-corner {
    padding-right: 36px;
    padding-bottom: 116px;
  }

  .readme-corner {
    right: 12px;
    bottom: 12px;
    width: 96px;
    opacity: 0.9;
  }
}


/* =========================
   Desktop Sidebar (global)
   ========================= */
@media (min-width: 761px) {
  :root {
    --sidebar-w: 260px;
    --sidebar-gap: 18px;
    --sidebar-left: 18px;
    --sidebar-safe: 16px;
    --sidebar-bottom-safe: clamp(68px, 8vh, 96px);
    --layout-sidebar-shell: calc(var(--sidebar-left) + var(--sidebar-w) + var(--sidebar-gap));
    --layout-right-rail-w: 320px;
    --layout-right-rail-gap: 18px;
  }

  body.layout-sidebar {
    padding-left: var(--layout-sidebar-shell);
    overflow-x: hidden;
  }


  .site-sidebar {
    position: fixed;
    top: var(--sidebar-safe);
    left: var(--sidebar-left);
    width: var(--sidebar-w);
    max-height: calc(100vh - var(--sidebar-safe) - var(--sidebar-bottom-safe));
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    z-index: 20;
  }

  .sidebar-card {
    padding: 14px 14px 16px;
  }

  .side-brand {
    display: grid;
    place-items: center;
    text-decoration: none;
    margin-bottom: 12px;
  }

  .side-logo {
    width: 100%;
    max-width: 230px;
    height: auto;
    display: block;
  }

  .side-nav {
    display: grid;
    gap: 8px;
  }

  .side-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 14px;
    text-decoration: none;
    color: var(--text);
    border: 1px solid transparent;
    background: transparent;
    font-weight: 700;
  }

  .side-nav-link:hover {
    background: var(--surface-2);
    border-color: rgba(99, 102, 241, 0.18);
  }

  .side-nav-link--summary {
    cursor: pointer;
    list-style: none;
  }

  details.side-group {
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    overflow: hidden;
  }

  details.side-group[open] .side-nav-link--summary {
    background: rgba(99, 102, 241, 0.10);
    border-color: rgba(99, 102, 241, 0.25);
  }

  .side-sub {
    display: grid;
    gap: 6px;
    padding: 8px 10px 10px;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
  }

  .side-nav-link--sub {
    font-weight: 650;
    opacity: 0.95;
    padding: 9px 10px;
    border-radius: 12px;
    background: transparent;
  }

  .side-nav-link--sub:hover {
    background: var(--surface-2);
  }

  .side-nav-link.is-disabled,
  .side-nav-link[aria-disabled="true"] {
    opacity: 0.45;
    pointer-events: none;
  }

  .layout-sidebar .container {
    margin-left: 0;
    margin-right: auto;
    padding-left: 16px;
    padding-right: 16px;
  }

  .layout-sidebar .site-footer {
    --sidebar-pad: calc(var(--sidebar-left) + var(--sidebar-w) + var(--sidebar-gap));
    display: block;
    margin-left: calc(-1 * var(--sidebar-pad));
    width: calc(100% + var(--sidebar-pad));
    padding-left: var(--sidebar-pad);
  }

  @media (min-width: 1440px) {

    body.layout-sidebar:not(.page-home)>main.container,
    body.layout-sidebar.layout-shell-ready:not(.page-home)>.layout-shell>main.container,
    body.layout-sidebar:not(.page-home)>.site-footer .container {
      width: min(calc(var(--max) + var(--layout-right-rail-w) + var(--layout-right-rail-gap)), calc(100% - 32px));
    }

    body.layout-sidebar.layout-shell-ready:not(.page-home)>.site-footer .container {
      width: min(calc(var(--max) + var(--layout-right-rail-w) + var(--layout-right-rail-gap)),
          calc(100% - var(--sidebar-left) - var(--sidebar-w) - var(--sidebar-gap) - 32px));
    }

    body.layout-sidebar:not(.page-home) .layout-main-shell {
      display: grid;
      grid-template-columns: minmax(0, 1fr) var(--layout-right-rail-w);
      gap: var(--layout-right-rail-gap);
      align-items: start;
    }

    body.layout-sidebar:not(.page-home) .layout-page-aside {
      display: grid;
      gap: 14px;
      align-content: start;
      align-self: start;
      position: sticky;
      top: var(--layout-rail-top, var(--sidebar-safe, 16px));
      height: calc(100vh - var(--layout-rail-top, var(--sidebar-safe, 16px)) - var(--layout-rail-bottom, 18px));
      padding-top: 0;
      box-sizing: border-box;
    }

    body.layout-sidebar:not(.page-home) .layout-page-aside .site-right-rail {
      display: block;
      position: static;
      height: 100%;
      margin-top: 0;
    }

    body.layout-sidebar:not(.page-home) .layout-page-aside .site-right-rail-scroll {
      display: grid;
      gap: 14px;
      align-content: start;
      height: 100%;
      max-height: 100%;
      overflow-y: auto;
      overscroll-behavior: contain;
      scrollbar-gutter: stable;
      padding-right: 6px;
      padding-bottom: 8px;
      margin-right: -6px;
    }

    .site-right-rail-card {
      min-width: 0;
    }

    .site-right-rail-card h3 {
      margin: 0 0 12px;
      font-size: 1.18rem;
    }

    .site-right-rail .shortcut {
      display: grid;
      gap: 12px;
    }

    .site-right-rail .shortcut .btn {
      width: 100%;
      min-height: 44px;
    }

    .site-right-rail .social-link {
      justify-content: flex-start;
      gap: 12px;
      padding: 12px 14px;
      min-height: 52px;
      text-align: left;
      font-weight: 800;
    }

    .site-right-rail .social-icon {
      width: 34px;
      height: 34px;
      flex: 0 0 auto;
      display: grid;
      place-items: center;
      border-radius: 12px;
      border: 1px solid rgba(255, 255, 255, 0.1);
      background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
      color: var(--text);
    }

    .site-right-rail .social-icon svg {
      width: 18px;
      height: 18px;
      display: block;
      fill: currentColor;
    }

    .site-right-rail .social-label {
      min-width: 0;
      overflow-wrap: anywhere;
    }

    .site-right-rail .social-link--youtube .social-icon {
      border-color: rgba(255, 0, 51, 0.28);
      background: linear-gradient(180deg, rgba(255, 0, 51, 0.16), rgba(255, 0, 51, 0.08));
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    }

    .site-right-rail .social-link--youtube:hover .social-icon {
      border-color: rgba(255, 0, 51, 0.42);
      background: linear-gradient(180deg, rgba(255, 0, 51, 0.22), rgba(255, 0, 51, 0.12));
    }

    .site-right-rail .social-link--donate .social-icon {
      border-color: rgba(245, 158, 11, 0.28);
      background: linear-gradient(180deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.1));
      color: #fde68a;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    }

    .site-right-rail .social-link--donate:hover .social-icon {
      border-color: rgba(245, 158, 11, 0.42);
      background: linear-gradient(180deg, rgba(245, 158, 11, 0.28), rgba(245, 158, 11, 0.16));
    }

    .site-right-rail .social-link--discord .social-icon {
      border-color: rgba(88, 101, 242, 0.28);
      background: linear-gradient(180deg, rgba(88, 101, 242, 0.2), rgba(88, 101, 242, 0.1));
      color: #dbe4ff;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    }

    .site-right-rail .social-link--discord:hover .social-icon {
      border-color: rgba(88, 101, 242, 0.42);
      background: linear-gradient(180deg, rgba(88, 101, 242, 0.28), rgba(88, 101, 242, 0.16));
    }
  }

  /* =========================
   Status table (shared)
   ========================= */
  .status-table {
    display: grid;
    gap: 10px;
    margin-top: 10px;
  }

  .status-row {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    text-decoration: none;
    color: var(--text);
  }

  /* mini variant: for hero card */
  .status-row--mini {
    grid-template-columns: 52px 1fr;
    padding: 10px 12px;
    border-radius: 14px;
  }

  .status-row--mini .status-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  .status-row--mini .status-icon {
    width: 34px;
    height: 34px;
  }

  .status-row--mini .status-name {
    font-size: 14px;
  }

  .status-row--mini .status-detail {
    font-size: 12px;
  }


  .status-row:hover {
    border-color: rgba(99, 102, 241, 0.35);
    background: rgba(99, 102, 241, 0.10);
  }

  .status-row:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.22);
  }

  .info-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
  }

  .info-table th,
  .info-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    text-align: left;
  }

  .info-table th {
    width: min(220px, 34%);
    color: var(--text);
    font-weight: 700;
  }

  .info-table td {
    color: var(--muted);
    line-height: 1.7;
  }

  @media (max-width: 760px) {

    .info-table,
    .info-table tbody,
    .info-table tr,
    .info-table th,
    .info-table td {
      display: block;
      width: 100%;
    }

    .info-table tr {
      padding: 12px 0;
      border-bottom: 1px solid var(--border);
    }

    .info-table th,
    .info-table td {
      border-bottom: 0;
      padding: 6px 0;
    }

    .info-table th {
      width: 100%;
    }
  }

  .status-icon-wrap {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    display: grid;
    place-items: center;
  }

  .status-icon {
    width: 44px;
    height: 44px;
    object-fit: contain;
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.18));
  }

  .status-dot-mini {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 2px solid var(--surface);
    background: #64748b;
  }

  .status-dot-mini.is-online,
  .status-dot-mini.is-ok {
    background: var(--ok);
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.16);
  }

  .status-dot-mini.is-degraded,
  .status-dot-mini.is-warn {
    background: var(--warn);
    box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.16);
  }

  .status-dot-mini.is-offline,
  .status-dot-mini.is-bad {
    background: var(--bad);
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.16);
  }

  .status-dot-mini.is-unknown {
    background: #64748b;
    box-shadow: none;
  }

  .status-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
  }

  .status-name {
    font-weight: 850;
    letter-spacing: 0.2px;
  }

  .status-detail {
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .status-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    padding: 2px 10px;
    font-weight: 900;
    font-size: 12px;
    border-radius: 999px;
    border: 1px solid rgba(99, 102, 241, 0.28);
    background: rgba(99, 102, 241, 0.14);
    color: var(--text);
  }

  .status-more:hover {
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .14);
  }

  .pager {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
  }

  .pager-btn {
    min-width: 44px;
    justify-content: center;
    font-weight: 900;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  }

  .pager-btn.is-disabled {
    opacity: 0.35;
    pointer-events: none;
    filter: grayscale(1);
  }

  /* =========================
   Patch: 2026-01-24
   ========================= */

  /* 「いま\nす」みたいな不自然な分割を避ける */
  .nowrap {
    white-space: nowrap;
  }

  /* スマホ（横持ちで幅が出ても）カードを2列にしない */
  @media (hover: none) and (pointer: coarse) {

    .card.span-4,
    .card.span-5,
    .card.span-6,
    .card.span-7 {
      grid-column: span 12 !important;
    }
  }

  /* ---- About drawer (About me) ---- */
  .about-drawer {
    position: fixed;
    inset: 0;
    z-index: 80;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
  }

  /* 1) 背景を濃く：見えない問題を解消 */
  .about-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, .84);
    opacity: 0;
    transition: opacity .18s ease;
  }

  /* 共通：縦長でも破綻しないように「外枠は最大高さ」「中だけスクロール」 */
  .about-sheet {
    position: absolute;
    overflow: hidden;
    /* 外枠は隠す */
    display: flex;
    /* ヘッダ + ボディを縦積み */
    flex-direction: column;
    grid-column: auto;
    /* .card の grid 影響を切る */

    opacity: 0;
    transition: transform .22s ease, opacity .22s ease;
  }

  /* .card の padding を活かしつつ、本文だけスクロールさせる */
  .about-body {
    overflow: auto;
    min-height: 0;
    /* flex 内でスクロールを成立させる要点 */
    padding-right: 2px;
    /* スクロールバーで文字が潰れない安全弁 */

    padding-bottom: 2px;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    overflow-wrap: anywhere;
  }

  /* About body typography: 長文でも読みやすく */
  .about-body p,
  .about-body ul,
  .about-body ol {
    margin: 0 0 12px;
  }

  .about-body p {
    line-height: 1.8;
    color: var(--text);
    text-wrap: pretty;
  }

  .about-body ul,
  .about-body ol {
    padding-left: 1.2em;
    color: var(--text);
  }

  .about-body li {
    margin: 6px 0;
    line-height: 1.7;
  }

  .about-body ul ul,
  .about-body ol ol,
  .about-body ul ol,
  .about-body ol ul {
    margin-top: 8px;
    margin-bottom: 0;
  }

  .about-body p.muted,
  .about-body .muted {
    color: var(--muted);
  }

  .about-body .muted-2 {
    color: var(--muted-2);
  }

  .about-body strong {
    color: var(--text);
    font-weight: 900;
  }


  /* モバイル：左からスライド（今の挙動を維持） */
  @media (max-width: 760px) {
    .about-sheet {
      top: 14px;
      bottom: 14px;
      left: 14px;

      width: min(420px, calc(100vw - 28px));
      max-height: calc(100vh - 28px);

      transform: translateX(-22px);
    }

    html.about-open .about-sheet,
    html.migration-open #migration-drawer .about-sheet {
      transform: translateX(0);
      opacity: 1;
    }
  }

  /* PC：中央モーダル（縦長でも破綻しない） */
  @media (min-width: 761px) {
    .about-sheet {
      left: 50%;
      top: 50%;

      width: min(640px, calc(100vw - 64px));
      max-height: calc(100vh - 64px);

      transform: translate(-50%, -50%) scale(.98);
    }

    html.about-open .about-sheet,
    html.migration-open #migration-drawer .about-sheet {
      transform: translate(-50%, -50%) scale(1);
      opacity: 1;
    }
  }

  .about-hr {
    margin: 14px 0;
    border: 0;
    height: 1px;
    background: var(--border);
    opacity: .85;
  }

  .about-note {
    margin-top: 14px;
  }

  .page-about .about-page-body,
  .page-contact .contact-page-shell {
    overflow: visible;
    padding-right: 0;
  }

  .page-about .about-page-body {
    max-width: 74ch;
  }

  .page-contact .contact-page-shell {
    max-width: 960px;
  }



  /* ---- About contact form ---- */
  .about-subtitle {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 900;
  }

  /* Topic headings: "Text ----"（文字の中央付近から右へ線） */
  .about-topic {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 10px;
    font-style: italic;
    letter-spacing: 0.02em;
  }

  .about-topic::after {
    content: "";
    height: 1px;
    flex: 1;
    background: var(--border);
    opacity: 0.85;
  }

  /* What is P?：ロゴっぽい印象（Font stack / spacing / weight） */
  .about-topic--logo {
    font-size: 1.25rem;
    font-weight: 950;
  }

  .about-topic-logo {
    font-family: ui-serif, Georgia, "Times New Roman", Times, serif;
  }

  .about-topic-logoP {
    font-weight: 1000;
    letter-spacing: 0.06em;
  }

  /* History tree（縦線ツリー） */
  .about-tree {
    list-style: none;
    padding-left: 0;
    margin: 0 0 12px;
    position: relative;
  }

  .about-tree::before {
    content: "";
    position: absolute;
    left: 11px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--border);
    opacity: 0.85;
  }

  .about-tree li {
    position: relative;
    padding-left: 32px;
    margin: 10px 0;
  }

  .about-tree li::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 0.62em;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--surface);
    border: 2px solid var(--primary);
  }

  .about-tree-date {
    display: inline-block;
    margin-right: 10px;
    min-width: 9.2ch;
    font-weight: 900;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    color: var(--muted);
  }

  @media (max-width: 760px) {
    .about-tree-date {
      min-width: 0;
    }
  }


  .about-contact {
    margin-top: 12px;
  }

  .about-tabs {
    display: flex;
    gap: 8px;
    margin: 10px 0 12px;
    padding: 4px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface-2);
  }

  .about-tab {
    flex: 1;
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 9px 10px;
    border-radius: 12px;
    font-weight: 900;
    cursor: pointer;
  }

  .about-tab:hover {
    filter: brightness(1.03);
  }

  .about-tab.is-active {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    box-shadow: 0 12px 22px rgba(37, 99, 235, 0.18);
  }

  .about-pane {
    margin-top: 6px;
  }

  .about-form {
    display: grid;
    gap: 10px;
    margin-top: 10px;
  }

  .about-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  @media (min-width: 761px) {
    .about-grid-2 {
      grid-template-columns: 1fr 1fr;
    }
  }

  .about-field {
    display: grid;
    gap: 6px;
  }

  .about-label {
    font-size: 0.86rem;
    color: var(--muted);
    font-weight: 800;
  }

  .about-input,
  .about-select,
  .about-textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    outline: none;
  }

  .about-textarea {
    resize: vertical;
  }

  .about-input::placeholder,
  .about-textarea::placeholder {
    color: var(--muted-2);
  }

  .about-input:focus,
  .about-select:focus,
  .about-textarea:focus {
    border-color: rgba(37, 99, 235, 0.55);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
  }

  .about-form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 6px;
  }

  .purchase-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.7;
  }

  .purchase-consent input[type="checkbox"] {
    margin-top: 2px;
    flex: 0 0 auto;
  }

  .purchase-panel-inline {
    margin-top: 18px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.10), rgba(255, 255, 255, 0.03));
  }

  .purchase-panel-inline h2 {
    margin: 0 0 10px;
    font-size: 1.08rem;
  }

  .purchase-panel-inline>p {
    margin: 0 0 12px;
  }

  .purchase-panel-inline> :last-child {
    margin-bottom: 0;
  }

  .purchase-status-box,
  .purchase-result {
    margin-top: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  }

  .purchase-result code {
    display: inline-block;
    margin-top: 8px;
    font-size: 1rem;
    font-weight: 800;
  }

  .license-order-list {
    display: grid;
    gap: 10px;
    margin-top: 10px;
  }

  .license-order-card {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
  }

  .license-order-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
  }

  .license-order-card code {
    display: inline-block;
    margin-top: 8px;
  }

  .about-toast {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font-weight: 800;
  }

  .about-toast.is-warn {
    border-color: rgba(244, 63, 94, 0.40);
  }


  /* open state */
  html.about-open {
    overflow: hidden;
  }

  html.migration-open {
    overflow: hidden;
  }


  html.about-open .about-drawer {
    opacity: 1;
    pointer-events: auto;
  }

  html.migration-open #migration-drawer {
    opacity: 1;
    pointer-events: auto;
  }

  html.about-open .about-backdrop {
    opacity: 1;
  }

  html.migration-open #migration-drawer .about-backdrop {
    opacity: 1;
  }

  @media (prefers-reduced-motion: reduce) {

    .about-drawer,
    .about-backdrop,
    .about-sheet {
      transition: none !important;
    }
  }

  /* =========================
   Readability refinements
   - Keep the original look
   - Slightly reduce visual density
   ========================= */

  html {
    font-size: 17px;
  }

  body {
    line-height: 1.82;
    letter-spacing: 0.01em;
    font-weight: 500;
  }

  h1,
  h2,
  h3 {
    text-wrap: balance;
    color: var(--text-strong);
  }

  @media (min-width: 761px) {
    :root {
      --max: 980px;
    }

    body.page-home {
      --max: 1040px;
    }

    body.layout-sidebar {
      --layout-rail-top: var(--sidebar-safe, 16px);
      --layout-rail-bottom: 18px;
      padding-left: calc(var(--sidebar-left) + var(--sidebar-w) + var(--sidebar-gap));
      overflow-x: hidden;
    }

    body.layout-sidebar>.site-sidebar {
      position: fixed;
      top: var(--layout-rail-top);
      left: var(--sidebar-left);
      width: var(--sidebar-w);
      height: calc(100vh - var(--layout-rail-top) - var(--layout-rail-bottom));
      max-height: none;
      overflow: visible;
      will-change: transform;
      z-index: 20;
    }

    body.layout-sidebar>main {
      min-width: 0;
    }

    body.layout-sidebar>.site-sidebar>.sidebar-card {
      display: flex;
      flex-direction: column;
      width: 100%;
      height: 100%;
      max-height: 100%;
      padding: 14px 14px 16px;
      overflow: visible;
    }

    body.layout-sidebar>.site-sidebar .sidebar-scroll {
      display: flex;
      flex: 1 1 auto;
      min-height: 0;
      flex-direction: column;
      overflow-y: auto;
      overscroll-behavior: contain;
      scrollbar-gutter: stable;
      padding-right: 6px;
      padding-bottom: 8px;
      margin-right: -6px;
    }

    body.layout-sidebar>.site-footer {
      --sidebar-pad: calc(var(--sidebar-left) + var(--sidebar-w) + var(--sidebar-gap));
      display: block;
      margin-left: calc(-1 * var(--sidebar-pad));
      width: calc(100% + var(--sidebar-pad));
      padding-left: var(--sidebar-pad);
    }

    body.layout-sidebar>.site-footer .container {
      width: min(var(--max), calc(100% - 32px));
      margin-left: 0;
      margin-right: auto;
      padding-left: 16px;
      padding-right: 16px;
    }

    body.layout-sidebar .side-nav-link--summary {
      cursor: pointer;
      pointer-events: auto;
    }

    body.layout-sidebar details.side-group {
      overflow: hidden;
    }

    body.layout-sidebar details.side-group>summary::-webkit-details-marker {
      display: none;
    }

    body.layout-sidebar .hero {
      padding-top: var(--layout-rail-top);
    }

    body.layout-sidebar.layout-shell-ready {
      padding-left: 0;
    }

    body.layout-sidebar.layout-shell-ready>.layout-shell {
      flex: 1 0 auto;
      display: grid;
      grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
      gap: var(--sidebar-gap);
      align-items: start;
      width: 100%;
      padding-left: var(--sidebar-left);
      padding-right: 18px;
    }

    body.layout-sidebar.layout-shell-ready>.layout-shell>.site-sidebar {
      position: sticky;
      top: var(--layout-rail-top);
      left: auto;
      width: var(--sidebar-w);
      height: calc(100vh - var(--layout-rail-top) - var(--layout-rail-bottom));
      max-height: none;
      overflow: visible;
      transform: none !important;
      will-change: auto;
    }

    body.layout-sidebar.layout-shell-ready>.layout-shell>main {
      min-width: 0;
    }

    body.layout-sidebar.layout-shell-ready>.layout-shell>.site-sidebar>.sidebar-card {
      display: flex;
      flex-direction: column;
      width: 100%;
      height: 100%;
      max-height: 100%;
      padding: 14px 14px 16px;
      overflow: visible;
    }

    body.layout-sidebar.layout-shell-ready>.layout-shell>.site-sidebar .sidebar-scroll {
      display: flex;
      flex: 1 1 auto;
      min-height: 0;
      flex-direction: column;
      overflow-y: auto;
      overscroll-behavior: contain;
      scrollbar-gutter: stable;
      padding-right: 6px;
      padding-bottom: 8px;
      margin-right: -6px;
    }

    body.layout-sidebar.layout-shell-ready>.site-footer {
      margin-left: 0;
      width: 100%;
      padding-left: 0;
    }

    body.layout-sidebar.layout-shell-ready>.site-footer .container {
      width: min(var(--max), calc(100% - var(--sidebar-left) - var(--sidebar-w) - var(--sidebar-gap) - 32px));
      margin-left: calc(var(--sidebar-left) + var(--sidebar-w) + var(--sidebar-gap));
      margin-right: 18px;
    }
  }

  @media (max-width: 760px) {
    html {
      font-size: 16px;
    }
  }

  main :where(.hero-card p, .card p, .status-detail, .readme-wrap p) {
    max-width: 66ch;
  }

  .article-card :where(p, li) {
    max-width: none;
  }

  .hero-card,
  .card,
  .article-card {
    padding: clamp(20px, 2.2vw, 28px);
  }

  .hero-head,
  .card-head,
  .article-meta {
    margin-bottom: 16px;
  }

  .hero-card p,
  .card p,
  .article-card p {
    line-height: 1.8;
    font-size: 1.03rem;
    font-weight: 500;
  }

  body.page-home .hero-body p {
    color: var(--text-strong);
  }

  body.page-home .home-section-lead {
    color: var(--text);
  }

  .article-card a:not(.article-toc-link) {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.16em;
  }

  .article-card a:not(.article-toc-link):hover,
  .article-card a:not(.article-toc-link):focus-visible {
    color: var(--primary-2);
  }

  .card>:last-child,
  .hero-card>:last-child,
  .article-card>:last-child {
    margin-bottom: 0;
  }

  .list {
    padding-left: 1.15rem;
  }

  .list li {
    margin: 12px 0;
    line-height: 1.78;
    font-size: 1.02rem;
    font-weight: 500;
  }

  .news {
    gap: 14px;
  }

  .news a {
    align-items: flex-start;
    gap: 8px 14px;
    padding: 14px 16px;
  }

  .news-title {
    line-height: 1.55;
    font-size: 1.02rem;
    font-weight: 600;
  }

  .status-row {
    gap: 14px;
    padding: 16px 18px;
  }

  .status-name {
    color: var(--text-strong);
    line-height: 1.35;
    font-weight: 800;
    font-size: 1.02rem;
  }

  .status-detail {
    line-height: 1.5;
    font-size: 0.96rem;
    font-weight: 500;
  }

  .article-card {
    overflow-wrap: anywhere;
  }

  .hero-head h1 {
    font-size: clamp(30px, 3.6vw, 42px);
  }

  .card h2,
  .section-head h2,
  .card-head h2 {
    font-size: 1.28rem;
  }

  .timeline li {
    padding: 12px 12px 12px 24px;
    line-height: 1.75;
    font-size: 1rem;
  }

  .timeline .ver {
    font-size: 0.78rem;
    padding: 4px 10px;
  }

  .status-cell {
    gap: 6px;
  }

  .readme-wrap {
    font-size: 1rem;
    line-height: 1.82;
  }

  .muted {
    color: var(--text-soft);
    font-weight: 500;
  }

  .muted-2 {
    color: var(--text-faint);
    font-weight: 500;
  }

  .pc-desc,
  .timeline li,
  .readme-wrap,
  .status-detail,
  .news a,
  .about-body p {
    font-weight: 500;
  }

  .pc-title {
    color: var(--text-strong);
  }

  .text-soft,
  .text-faint {
    font-weight: 500;
  }

  @media (max-width: 760px) {

    .hero-card,
    .card,
    .article-card {
      padding: 18px;
    }

    .article-toc,
    .article-inline-ad {
      padding: 16px;
    }

    .hero-actions,
    .btn-row {
      gap: 8px;
    }

    .news a {
      padding: 12px 13px;
    }
  }

  @media (min-width: 761px) {
    body.layout-sidebar {
      --layout-footer-stop-gap: 80px;
    }
  }

  @media (min-width: 1440px) {
    body.layout-sidebar:not(.page-home) .layout-page-aside {
      position: sticky;
      top: var(--sidebar-safe, 16px);
      margin-top: var(--sidebar-safe, 16px);
      height: auto !important;
      max-height: none !important;
      overflow: visible !important;
      align-self: start;
    }

    body.layout-sidebar:not(.page-home) .layout-page-aside .site-right-rail {
      height: auto !important;
      max-height: none !important;
      overflow: visible !important;
    }

    body.layout-sidebar:not(.page-home) .layout-page-aside .site-right-rail-scroll {
      display: grid;
      gap: 14px;
      align-content: start;
      height: auto !important;
      max-height: none !important;
      overflow: visible !important;
      padding-right: 0 !important;
      padding-bottom: 0 !important;
      margin-right: 0 !important;
    }
  }
}

/* ==========================================================================
   Contact / About form — global (mobile-first)
   .about-* styles were trapped inside @media (min-width: 761px) above.
   This block makes them work on all screen sizes.
   ========================================================================== */

.about-contact {
  margin-top: 12px;
}

.about-tabs {
  display: flex;
  gap: 8px;
  margin: 10px 0 12px;
  padding: 4px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.about-tab {
  flex: 1;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 9px 6px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 900;
  cursor: pointer;
  line-height: 1.4;
}

@media (min-width: 400px) {
  .about-tab {
    padding: 9px 10px;
    font-size: 1rem;
  }
}

.about-tab:hover {
  filter: brightness(1.03);
}

.about-tab.is-active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: 0 12px 22px rgba(37, 99, 235, 0.18);
}

.about-pane {
  margin-top: 6px;
}

.about-form {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.about-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 560px) {
  .about-grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.about-field {
  display: grid;
  gap: 6px;
}

.about-label {
  font-size: 0.86rem;
  color: var(--muted);
  font-weight: 800;
}

.about-input,
.about-select,
.about-textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.about-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23afbfd2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.about-textarea {
  resize: vertical;
}

.about-input::placeholder,
.about-textarea::placeholder {
  color: var(--muted-2);
}

.about-input:focus,
.about-select:focus,
.about-textarea:focus {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
}

.about-form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.about-note {
  margin-top: 14px;
}

.page-about .about-page-body {
  max-width: 74ch;
}

.page-contact .contact-page-shell {
  max-width: 960px;
}
/* ==========================================================================
   Mobile header — written directly in style.css so it works regardless of
   whether the browser respects media="" attributes on <link> tags.
   These rules come LAST in the cascade and override pc.css safely via @media.
   ========================================================================== */

@media (max-width: 760px) {
  /* Core layout */
  html, body { overflow-x: clip; }
  .site-sidebar { display: none; }

  /* Show the hamburger button (display:none globally, and in pc.css) */
  .nav-toggle { display: flex !important; }

  /* Force-show site-header on mobile even if pc.css applied display:none */
  .site-header { display: block !important; }

  /* Compact header bar */
  .header-inner {
    padding: 0 16px;
    min-height: 56px;
  }

  /* Smaller logo, reset desktop translateY */
  .site-header .brand-logo {
    height: 36px;
    transform: none;
  }

  /* Nav drawer divider */
  .nav-drawer hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 4px 2px;
  }

  /* Push content below sticky header */
  main {
    padding-top: 64px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }

  /* Hero: reduce top padding to avoid double-spacing after main padding-top */
  .hero { padding-top: 16px; }
}
