/* Rijjin Support (support.rijjin.com).

   Tokens are the legal pages' (app/web/legal/legal.css): the same palette, accent,
   warm and system font stacks. The theme follows the OS only; there is no toggle, so
   the light tokens sit on :root and the dark block redefines them. */

:root {
  --bg: #ffffff;
  --surface: #f6f8fa;
  --surface-2: #eef1f5;
  --text: #1a1d21;
  --muted: #5c6470;
  --border: #e2e5ea;
  --accent: #316ec3;
  --warm: #e66e0d;
  --link: #2860b4;
  --card: var(--bg);
  /* Text and glyphs that sit on the pale tiles: the tiles take the accent's tint,
     and these darker inks keep 4.5:1 on them. */
  --accent-ink: #2860b4;
  --warm-ink: #b85407;
  --accent-soft: color-mix(in srgb, var(--accent) 9%, var(--bg));
  --warm-soft: color-mix(in srgb, var(--warm) 9%, var(--bg));
  --mark: color-mix(in srgb, var(--warm) 22%, transparent);
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, .04), 0 1px 3px rgba(17, 24, 39, .05);
  --shadow-md: 0 2px 4px rgba(17, 24, 39, .04), 0 10px 24px -6px rgba(17, 24, 39, .12);
  --shadow-lg: 0 4px 10px rgba(17, 24, 39, .05), 0 24px 48px -12px rgba(17, 24, 39, .22);
  --hero-art-opacity: .62;
  --radius: 16px;
  --radius-sm: 10px;
  --gutter: 16px;
  --header-h: 56px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  --font-ja: -apple-system, BlinkMacSystemFont, "Hiragino Sans",
    "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", YuGothic,
    Meiryo, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a;
    --surface: #1c2024;
    --surface-2: #262b33;
    --text: #e8eaed;
    --muted: #9aa3ad;
    --border: #2c3238;
    --accent: #64a8ee;
    --warm: #f38a27;
    --link: #7cb8f2;
    --card: var(--surface);
    --accent-ink: var(--accent);
    --warm-ink: var(--warm);
    --accent-soft: color-mix(in srgb, var(--accent) 14%, var(--surface));
    --warm-soft: color-mix(in srgb, var(--warm) 12%, var(--surface));
    --mark: color-mix(in srgb, var(--warm) 34%, transparent);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, .25), 0 12px 28px -8px rgba(0, 0, 0, .5);
    --shadow-lg: 0 4px 10px rgba(0, 0, 0, .3), 0 24px 56px -12px rgba(0, 0, 0, .7);
    --hero-art-opacity: .7;
    color-scheme: dark;
  }
}

@media (min-width: 768px) {
  :root { --gutter: 32px; --header-h: 64px; }
}

/* ---------- base ---------- */

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Japanese: the CJK stack, more leading, a little tracking, proportional kana in
   headings and strict line breaking, with phrases kept whole where the browser can. */
:lang(ja) body, body:lang(ja) {
  font-family: var(--font-ja);
  font-size: 16px;
  line-height: 1.85;
  letter-spacing: .02em;
  line-break: strict;
  /* An opening 「 at the start of a line sits flush, not half an em in. */
  text-spacing-trim: trim-start;
}

/* Short Japanese text breaks between phrases, not inside a word. */
:lang(ja) :is(.topic-desc, .al-sum, .lede, .r-title) { word-break: auto-phrase; }

:lang(ja) :is(h1, h2, h3, .topic-title, .al-title, .r-title, .link-list a) {
  font-feature-settings: "palt";
  letter-spacing: .04em;
  word-break: auto-phrase;
}

main { flex: 1 0 auto; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }

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

h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }

.icon { width: 24px; height: 24px; flex: none; fill: currentColor; }

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

.skip {
  position: absolute;
  top: 8px; left: 8px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

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

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.home .site-header { border-bottom-color: transparent; }

/* Over the hero the header is clear; it takes its glass once the page scrolls. */
.home:not(.scrolled) .site-header {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.home.scrolled .site-header { border-bottom-color: color-mix(in srgb, var(--border) 70%, transparent); }

.header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
  color: var(--text);
  text-decoration: none;
  border-radius: 8px;
}

.brand img { display: block; height: 32px; width: auto; }

.brand-label {
  padding-left: 12px;
  border-left: 1px solid var(--border);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.005em;
  color: var(--muted);
  white-space: nowrap;
}

.header-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  min-width: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: normal;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}

.header-action:hover {
  background: var(--surface);
  border-color: color-mix(in srgb, var(--border) 50%, var(--muted));
  text-decoration: none;
}

.header-action .icon { width: 18px; height: 18px; color: var(--muted); }

/* The search trigger on inner pages: an icon on a phone, a field-like pill wider up. */
.search-trigger { padding: 0 11px; }
.search-trigger .label, .search-trigger kbd { display: none; }

@media (min-width: 768px) {
  .search-trigger {
    justify-content: flex-start;
    width: 280px;
    padding: 0 8px 0 12px;
    color: var(--muted);
    font-weight: 500;
  }
  .search-trigger .label { display: inline; margin-right: auto; }
  .search-trigger kbd { display: inline-flex; }
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font: 600 12px/1 var(--font);
}

/* ---------- language picker ---------- */

/* rijjin.com's own dropdown: a globe and a caret, opening a menu of every language in its
   own tongue with a tick on the one shown (`.lang-picker` in app/web/legal/legal.css,
   `LanguagePicker` in app/lib/main.dart). The chip takes the header buttons' height and
   radius, as rijjin.com's takes its Sign in chip's, so the two read as one row of controls.
   A <details>, so it works with no script; site.js closes it. */

.lang-picker { position: relative; display: inline-block; }

.lang-picker > summary {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  list-style: none;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.lang-picker > summary::-webkit-details-marker { display: none; }
.lang-picker > summary:hover {
  background: var(--surface);
  border-color: color-mix(in srgb, var(--border) 50%, var(--muted));
}
.lang-picker > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.lang-picker .glyph { flex: none; width: 18px; height: 18px; fill: var(--muted); }

.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  min-width: 168px;
  margin: 0;
  padding: 8px 0;
  list-style: none;
  border-radius: 12px;
  background: var(--surface);
  /* Material elevation 8: the menu is lifted by shadow, not outlined. */
  box-shadow: 0 1px 3px rgba(0, 0, 0, .30), 0 4px 8px 3px rgba(0, 0, 0, .15);
}

/* The footer's opens upward, from the button's left edge where the footer stacks. */
.lang-picker.up .lang-menu { top: auto; bottom: calc(100% + 6px); }
@media (max-width: 599px) { .lang-picker.up .lang-menu { right: auto; left: 0; } }

.lang-menu li { margin: 0; }

.lang-picker .lang-item,
.lang-picker .lang-item:hover {
  display: flex;
  align-items: center;
  width: 100%;
  height: 44px;
  padding: 0 16px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.lang-picker .lang-item:hover,
.lang-picker .lang-item:focus-visible {
  background: color-mix(in srgb, var(--text) 8%, transparent);
  outline: none;
}

/* A fixed slot ahead of the label, so the two endonyms line up whether or not one is ticked. */
.lang-picker .tick { flex: none; width: 22px; height: 16px; padding-right: 6px; fill: var(--accent); }
.lang-picker .tick.empty { visibility: hidden; }

/* ---------- hero (home) ---------- */

.hero {
  position: relative;
  isolation: isolate;
  z-index: 2;
  margin-top: calc(-1 * var(--header-h));
  padding: calc(var(--header-h) + 64px) 0 40px;
}

.hero-art {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: var(--hero-art-opacity);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 45%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 45%, transparent 100%);
}

.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 40%;
  display: block;
}

/* A soft pool of page colour behind the words, so the relief never fights them. */
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 52%;
  width: min(900px, 100%);
  height: 360px;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--bg) 80%, transparent),
    color-mix(in srgb, var(--bg) 0%, transparent));
}

.hero-inner {
  max-width: 720px;
  text-align: center;
}

.hero h1 {
  margin: 0 0 28px;
  font-size: clamp(30px, 7.4vw, 50px);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -.028em;
}

:lang(ja) .hero h1 { font-size: clamp(26px, 6.6vw, 42px); line-height: 1.3; letter-spacing: .02em; }

@media (min-width: 768px) {
  .hero { padding: calc(var(--header-h) + 88px) 0 104px; }
  .hero h1 { margin-bottom: 32px; }
}

/* ---------- search ---------- */

.search { position: relative; text-align: left; }

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box > .icon {
  position: absolute;
  left: 18px;
  width: 22px;
  height: 22px;
  color: var(--muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 56px;
  padding: 0 52px 0 50px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 17px;
  letter-spacing: normal;
  box-shadow: var(--shadow-md);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.search-input::placeholder { color: var(--muted); opacity: 1; }
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }

.search-input:focus { outline: none; border-color: var(--accent); box-shadow: var(--shadow-md), 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }

.search-box kbd { position: absolute; right: 16px; }
.search-box .search-clear {
  position: absolute;
  right: 8px;
  display: none;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  border: 0; border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.search-box .search-clear:hover { background: var(--surface); }
.search-box .search-clear .icon { width: 20px; height: 20px; }
.search.has-query .search-clear { display: inline-flex; }
.search.has-query kbd { display: none; }

@media (max-width: 767px) {
  .search-box kbd { display: none; }
}

@media (min-width: 768px) {
  .search-input { height: 60px; font-size: 18px; }
}

.results {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: min(60vh, 520px);
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-lg);
}

.results[hidden] { display: none; }

.results li { margin: 0; }

.result {
  display: block;
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
}

.result:hover, [aria-selected="true"] > .result { background: var(--accent-soft); text-decoration: none; }

.r-title { display: block; font-weight: 600; line-height: 1.35; }
.r-meta { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.r-snip {
  display: -webkit-box;
  margin-top: 4px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--muted);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

mark {
  background: var(--mark);
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.results-empty, .results-head {
  padding: 12px 14px;
  font-size: 15px;
  color: var(--muted);
}
.results-head { padding-bottom: 4px; font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
:lang(ja) .results-head { text-transform: none; letter-spacing: .04em; }

/* The search dialog, opened from the header on every page but home. */
.search-dialog {
  width: min(680px, calc(100vw - 2 * var(--gutter)));
  max-width: none;
  max-height: none;
  margin: 10vh auto auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  overflow: visible;
}

.search-dialog::backdrop {
  background: color-mix(in srgb, #0b0d10 42%, transparent);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.search-dialog .results { position: static; margin-top: 8px; max-height: 62vh; }

.dialog-close .label { display: none; }
@media (max-width: 767px) { .dialog-close .label { display: inline; } }

.dialog-close {
  position: absolute;
  top: -48px;
  right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border: 0; border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  color: var(--text);
  cursor: pointer;
}

@media (max-width: 767px) {
  .search-dialog {
    width: 100vw;
    height: 100dvh;
    margin: 0;
    padding: 12px var(--gutter);
    background: var(--bg);
  }
  .search-dialog::backdrop { background: var(--bg); }
  .search-dialog .search-box { margin-right: 76px; }
  .search-dialog .dialog-close {
    top: 12px;
    right: calc(var(--gutter) - 8px);
    width: auto;
    height: 56px;
    padding: 0 8px;
    background: none;
    color: var(--link);
    font: inherit;
    font-size: 17px;
    font-weight: 500;
  }
  .search-dialog .dialog-close .icon { display: none; }
  .search-dialog .results {
    max-height: calc(100dvh - 92px);
    border: 0;
    box-shadow: none;
    padding: 0;
  }
  .search-dialog .result { padding-inline: 4px; }
}

.dialog-keys {
  display: none;
  gap: 16px;
  justify-content: flex-end;
  margin: 10px 4px 0;
  font-size: 12.5px;
  color: color-mix(in srgb, #fff 82%, transparent);
}
.dialog-keys span { display: inline-flex; align-items: center; gap: 6px; }
.dialog-keys kbd { background: transparent; color: inherit; border-color: color-mix(in srgb, #fff 40%, transparent); }
.dialog-keys .icon { width: 14px; height: 14px; }
@media (min-width: 768px) { .dialog-keys { display: flex; } }

/* ---------- sections ---------- */

.section { padding-block: 8px 36px; }
.section + .section { padding-top: 0; }

.section-title {
  margin: 0 0 18px;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -.015em;
}

:lang(ja) .section-title { font-size: 20px; letter-spacing: .04em; }

@media (min-width: 768px) {
  .section { padding-bottom: 72px; }
  .section-title { font-size: 24px; margin-bottom: 22px; }
}

/* ---------- topic cards ---------- */

.topics {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
}

.topics li + li { border-top: 1px solid var(--border); }

.topic {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 14px 14px 14px 16px;
  color: var(--text);
  text-decoration: none;
  transition: background-color .15s ease;
}

.topic:hover { background: var(--surface); text-decoration: none; }
.topic:focus-visible { outline-offset: -2px; border-radius: 0; }

.topic-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.topic-icon .icon { width: 22px; height: 22px; }

.topic-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.topic-title { font-size: 17px; font-weight: 600; line-height: 1.3; }
.topic-desc { margin-top: 3px; font-size: 14.5px; line-height: 1.45; color: var(--muted); }
:lang(ja) .topic-desc { font-size: 13.5px; line-height: 1.6; }
.topic-count { display: none; }
.topic-chevron { width: 20px; height: 20px; color: var(--muted); opacity: .7; }

@media (min-width: 720px) {
  .topics {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    border: 0;
    background: none;
    overflow: visible;
  }
  .topics li + li { border-top: 0; }
  .topic {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    height: 100%;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow-sm);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
  }
  .topic:hover {
    background: var(--card);
    border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
  }
  .topic:focus-visible { outline-offset: 2px; border-radius: var(--radius); }
  .topic-icon { width: 48px; height: 48px; border-radius: 14px; }
  .topic-icon .icon { width: 26px; height: 26px; }
  .topic-title { font-size: 18px; }
  .topic-desc { margin-top: 6px; font-size: 15px; line-height: 1.5; }
  :lang(ja) .topic-desc { font-size: 14px; line-height: 1.7; }
  .topic-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: auto;
    padding-top: 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
  }
  .topic-count .icon { width: 18px; height: 18px; transition: transform .18s ease; }
  .topic:hover .topic-count .icon { transform: translateX(3px); }
  .topic-body { flex: 1; }
  .topic-chevron { display: none; }
}

@media (min-width: 1000px) {
  .topics { grid-template-columns: repeat(3, 1fr); gap: 20px; }
}

/* ---------- link lists (popular, related, a topic's articles) ---------- */

.link-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
}

.link-list li + li { border-top: 1px solid var(--border); }

.link-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 14px 14px 14px 18px;
  color: var(--text);
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  transition: background-color .15s ease;
}

.link-list a:hover { background: var(--surface); }
.link-list a:focus-visible { outline-offset: -2px; border-radius: 0; }
.link-list a > span { flex: 1; min-width: 0; }
.link-list .icon { width: 20px; height: 20px; color: var(--muted); opacity: .7; }

@media (min-width: 900px) {
  .link-list.cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 0;
  }
  .link-list.cols li { border-top: 1px solid var(--border); }
  .link-list.cols li:nth-child(-n+2) { border-top: 0; }
  .link-list.cols li:nth-child(odd) { border-right: 1px solid var(--border); }
}

/* An article list with summaries: a topic's page. */
.article-list a { align-items: flex-start; padding-block: 18px; }
.article-list a > .icon { margin-top: 2px; }
.al-title { display: block; font-size: 17px; font-weight: 600; line-height: 1.35; }
.al-sum { display: block; margin-top: 4px; font-size: 15px; font-weight: 400; line-height: 1.5; color: var(--muted); }
:lang(ja) .al-title { font-size: 16px; }
:lang(ja) .al-sum { font-size: 14px; line-height: 1.7; }

/* ---------- contact ---------- */

.contact {
  display: grid;
  gap: 16px;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}

.contact-head { display: flex; gap: 14px; align-items: flex-start; }

.contact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--warm-soft);
  color: var(--warm-ink);
}

.contact h2 { margin: 0 0 4px; font-size: 19px; line-height: 1.35; letter-spacing: -.01em; }
:lang(ja) .contact h2 { font-size: 18px; letter-spacing: .04em; }
.contact p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--muted); }
:lang(ja) .contact p { font-size: 14px; line-height: 1.8; }

.contact-actions { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: normal;
  text-decoration: none;
  white-space: nowrap;
  transition: filter .15s ease;
}
.button:hover { filter: brightness(1.08); text-decoration: none; }
.button .icon { width: 20px; height: 20px; }

@media (prefers-color-scheme: dark) {
  .button { color: #0e1a2b; }
}

@media (max-width: 767px) {
  .contact-head { flex-direction: column; gap: 12px; }
}

@media (min-width: 768px) {
  .contact { grid-template-columns: 1fr auto; align-items: center; padding: 28px 32px; column-gap: 32px; }
  .contact-actions { flex-direction: column; align-items: flex-end; gap: 10px; }
}

/* ---------- inner pages ---------- */

.page {
  display: grid;
  gap: 40px;
  padding-block: 24px 64px;
}

@media (min-width: 1000px) {
  .page {
    grid-template-columns: 264px minmax(0, 1fr);
    gap: 64px;
    padding-block: 40px 96px;
  }
}

.page-main { min-width: 0; max-width: 720px; }

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 4px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
  font-size: 14px;
  color: var(--muted);
}

.crumbs li { display: inline-flex; align-items: center; gap: 4px; }
.crumbs li + li::before {
  content: "";
  width: 16px; height: 16px;
  background: currentColor;
  opacity: .6;
  -webkit-mask: var(--chev) center / 16px no-repeat;
  mask: var(--chev) center / 16px no-repeat;
}
.crumbs a { color: var(--muted); text-decoration: none; padding: 4px 0; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }
.crumbs [aria-current] { color: var(--text); font-weight: 500; }

.page-title {
  margin: 0;
  font-size: clamp(28px, 6vw, 40px);
  line-height: 1.18;
  letter-spacing: -.025em;
}

:lang(ja) .page-title { font-size: clamp(24px, 5.4vw, 34px); line-height: 1.4; letter-spacing: .03em; }

.lede {
  margin: 14px 0 0;
  font-size: 19px;
  line-height: 1.55;
  color: var(--muted);
}

:lang(ja) .lede { font-size: 16.5px; line-height: 1.85; }

.topic-head { display: flex; flex-direction: column; gap: 18px; margin-bottom: 28px; }
.topic-head .topic-icon { width: 56px; height: 56px; border-radius: 16px; }
.topic-head .topic-icon .icon { width: 30px; height: 30px; }
.topic-head .lede { margin-top: 10px; }

/* The sidebar: every topic on a topic's page; the topic's articles on an article. */
.sidebar { display: none; }

@media (min-width: 1000px) {
  .sidebar {
    display: block;
    position: sticky;
    top: calc(var(--header-h) + 40px);
    align-self: start;
    max-height: calc(100vh - var(--header-h) - 64px);
    overflow-y: auto;
  }
}

.sidebar h2 {
  margin: 0 0 10px;
  padding-left: 12px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}
:lang(ja) .sidebar h2 { text-transform: none; letter-spacing: .06em; font-size: 13px; }

.sidebar ul { margin: 0; padding: 0; list-style: none; }

.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.4;
  text-decoration: none;
}
:lang(ja) .sidebar a { font-size: 14px; }
.sidebar a:hover { background: var(--surface); }
.sidebar a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.sidebar .icon { width: 20px; height: 20px; color: var(--muted); }
.sidebar a[aria-current="page"] .icon { color: var(--accent-ink); }
.sidebar .back { margin-bottom: 8px; color: var(--muted); font-size: 14px; }

/* ---------- article ---------- */

.article { font-size: 17px; line-height: 1.7; }
:lang(ja) .article { font-size: 16px; line-height: 1.95; }

.article > :first-child { margin-top: 0; }
.article-head { margin-bottom: 32px; padding-bottom: 28px; border-bottom: 1px solid var(--border); }

.article h2 {
  margin: 40px 0 12px;
  font-size: 22px;
  line-height: 1.35;
  letter-spacing: -.012em;
}
:lang(ja) .article h2 { font-size: 19px; letter-spacing: .04em; }

.article h3 { margin: 28px 0 8px; font-size: 18px; line-height: 1.4; }
.article p { margin: 0 0 16px; }
.article ul { margin: 0 0 16px; padding-left: 1.3em; }
.article li { margin: 8px 0; }
.article li::marker { color: var(--muted); }
.article strong { font-weight: 600; }

/* Numbered steps: a circled number per step, joined by a hairline. */
.steps {
  counter-reset: step;
  margin: 8px 0 24px;
  padding: 0;
  list-style: none;
}

.steps > li {
  position: relative;
  counter-increment: step;
  margin: 0;
  padding: 0 0 22px 48px;
  min-height: 32px;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -1px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.steps > li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 14.5px;
  top: 35px;
  bottom: 5px;
  width: 1px;
  background: var(--border);
}

.steps > li > :last-child { margin-bottom: 0; }
.steps > li:last-child { padding-bottom: 4px; }
:lang(ja) .steps > li::before { top: 0; }

/* A label the app shows. In Japanese it sits in 「」, as Japanese UI copy does. */
.ui { font-weight: 600; color: var(--text); }

/* A message the app shows, in the quotation marks the macro writes. */
q.msg { quotes: none; font-style: normal; }
q.msg::before, q.msg::after { content: none; }

/* A menu path: each stop a chip, joined by chevrons. */
.path .stop {
  display: inline-block;
  margin: 1px 0;
  padding: 0 8px;
  border-radius: 7px;
  background: var(--surface-2);
  font-size: .92em;
  font-weight: 600;
  line-height: 1.75;
  white-space: nowrap;
}

.path .chev {
  display: inline-block;
  width: 1em;
  height: 1em;
  margin: 0 2px;
  vertical-align: -.16em;
  background: var(--muted);
  -webkit-mask: var(--chev) center / 1em no-repeat;
  mask: var(--chev) center / 1em no-repeat;
}

.glyph { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -.2em; fill: currentColor; }

.note {
  display: flex;
  gap: 12px;
  margin: 16px 0 20px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 15.5px;
  line-height: 1.6;
}
:lang(ja) .note { font-size: 14.5px; line-height: 1.85; }
.note > .icon { width: 20px; height: 20px; margin-top: 2px; color: var(--accent-ink); }
.note.warm > .icon { color: var(--warm-ink); }
.note > div > :last-child { margin-bottom: 0; }
.note p { margin: 0 0 8px; }

.article-contact { margin-top: 48px; }

.related { margin-top: 48px; }
.related .section-title { font-size: 19px; margin-bottom: 14px; }
@media (min-width: 1000px) { .related.more { display: none; } }
:lang(ja) .related .section-title { font-size: 18px; }

/* ---------- 404 ---------- */

/* 404.html carries both languages; the head script marks <html lang="ja"> for a
   /ja/ path. display: contents keeps each half in the body's column layout. */
.only-en, html[lang="ja"] .only-ja { display: contents; }
.only-ja, html[lang="ja"] .only-en { display: none; }

.lost { padding-block: 72px 96px; max-width: 640px; }
.lost .code { margin: 0 0 8px; font-size: 14px; font-weight: 700; letter-spacing: .08em; color: var(--warm-ink); }
.lost .search { margin-top: 28px; }

/* ---------- footer ---------- */

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--muted);
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  padding-block: 28px 40px;
}

.footer-row .copy { display: flex; flex-direction: column; gap: 4px; margin-right: auto; }
.footer-row .credit { font-size: 12px; line-height: 1.5; opacity: .9; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }
.site-footer nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }

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

/* ---------- motion, print ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0s !important;
    animation-duration: 0s !important;
    scroll-behavior: auto !important;
  }
  .topic:hover { transform: none; }
}

@media print {
  .site-header, .sidebar, .search, .contact, .related, .site-footer, .hero-art { display: none; }
  body { background: #fff; color: #000; }
  .page { display: block; }
}

:root { --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.6 12 8 7.4 9.4 6 15.4 12 9.4 18 8 16.6Z'/%3E%3C/svg%3E"); }
