:root {
  color-scheme: light dark;
  --paper: #f2e8d5;
  --paper-deep: #e8d7bc;
  --ink: #221a17;
  --muted: #74655d;
  --line: rgba(70, 45, 34, 0.2);
  --rust: #8c3f2d;
  --rust-strong: #6f2d20;
  --surface: rgba(255, 252, 246, 0.48);
  --content: 760px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-serif, "Songti SC", "Noto Serif CJK SC", Georgia, serif;
  font-size: 17px;
  line-height: 1.75;
}

a {
  color: var(--rust-strong);
  text-decoration-color: rgba(140, 63, 45, 0.35);
  text-underline-offset: 0.24em;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

a:hover {
  color: var(--rust);
  text-decoration-color: currentColor;
}

a:focus-visible {
  outline: 3px solid rgba(140, 63, 45, 0.35);
  outline-offset: 5px;
  border-radius: 2px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 12px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 11px;
}

.header-links,
.language-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
  align-items: center;
  gap: 18px;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.82rem;
}

.header-links a,
.language-links a { text-decoration: none; white-space: nowrap; }

.language-menu { position: relative; flex-shrink: 0; }

.language-menu summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 8px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}

.language-menu summary::-webkit-details-marker { display: none; }
.language-menu summary:focus-visible { outline: 2px solid var(--rust); outline-offset: 2px; border-radius: 4px; }
.language-chevron { width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.language-menu[open] .language-chevron { transform: translateY(2px) rotate(225deg); }

.language-options {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 12px 32px rgba(34, 26, 23, 0.15);
}

.language-options a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 6px;
  color: var(--ink);
  font-size: 0.88rem;
}

.language-options a:hover,
.language-options a[aria-current="page"] { background: var(--line); }
.language-options a[aria-current="page"]::after { content: "✓"; color: var(--rust-strong); }

html:lang(ja) body {
  font-family: ui-serif, "Hiragino Mincho ProN", "Yu Mincho", serif;
}

html:lang(ja) h1 { word-break: keep-all; overflow-wrap: anywhere; }

html:lang(ko) body {
  font-family: ui-serif, "AppleMyungjo", "Noto Serif CJK KR", serif;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.page {
  display: grid;
  grid-template-columns: minmax(170px, 230px) minmax(0, var(--content));
  gap: clamp(44px, 8vw, 110px);
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(64px, 10vw, 126px) 0 110px;
}

.rail {
  position: sticky;
  top: 116px;
  align-self: start;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

.rail .eyebrow,
.hero .eyebrow {
  margin: 0 0 14px;
  color: var(--rust);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.rail nav {
  display: grid;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.rail nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.86rem;
}

.rail nav a:hover { color: var(--rust); }

.content { min-width: 0; }

.hero {
  padding-bottom: clamp(56px, 8vw, 92px);
  animation: rise-in 520ms ease both;
}

h1,
h2,
h3 {
  line-height: 1.2;
  text-wrap: balance;
}

h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(2.7rem, 7vw, 5.9rem);
  letter-spacing: -0.055em;
}

.lede {
  max-width: 610px;
  margin: 26px 0 0;
  color: var(--muted);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(1.02rem, 2vw, 1.23rem);
}

.updated {
  display: inline-block;
  margin-top: 24px;
  color: var(--muted);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.8rem;
}

section {
  padding: 44px 0 48px;
  border-top: 1px solid var(--line);
  animation: rise-in 520ms ease both;
  animation-delay: 80ms;
}

section h2 {
  margin: 0 0 22px;
  font-size: clamp(1.55rem, 3vw, 2.15rem);
}

section h3 {
  margin: 30px 0 10px;
  font-size: 1.05rem;
}

p { margin: 0 0 18px; }

ul,
ol {
  margin: 18px 0 0;
  padding-left: 1.35em;
}

li + li { margin-top: 9px; }

.notice {
  margin: 24px 0;
  padding: 20px 0 20px 22px;
  border-left: 3px solid var(--rust);
  color: var(--muted);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

.support-action {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  margin-top: 8px;
  padding: 0 18px;
  border: 1px solid var(--rust);
  border-radius: 999px;
  color: var(--rust-strong);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

button.support-action {
  background: transparent;
  cursor: pointer;
}

.email-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 24px;
}

.email-actions .support-action { margin-top: 0; }

.secondary-action {
  border-color: var(--line);
  color: var(--ink);
}

.support-email {
  overflow-wrap: anywhere;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(1.05rem, 3vw, 1.35rem);
  font-weight: 700;
}

.faq-list { display: grid; gap: 0; }

.faq-item {
  padding: 0 0 28px;
  border: 0;
  animation: none;
}

.faq-item + .faq-item {
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.faq-item h3 { margin-top: 0; }

html.homadebar-app .site-header,
html.homadebar-app .rail {
  display: none;
}

html.homadebar-app .page {
  display: block;
  width: min(var(--content), calc(100% - 32px));
  padding-top: 24px;
}

html.homadebar-app .hero { padding-bottom: 44px; }

.support-action:hover {
  background: var(--rust);
  color: #fffaf2;
  transform: translateY(-1px);
}

.placeholder {
  color: var(--rust-strong);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px clamp(20px, 5vw, 72px) 38px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.78rem;
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171311;
    --paper-deep: #251d19;
    --ink: #f2e8d8;
    --muted: #b9a99e;
    --line: rgba(242, 232, 216, 0.16);
    --rust: #d0785c;
    --rust-strong: #e69a7c;
    --surface: rgba(39, 31, 27, 0.55);
  }
}

@media (max-width: 760px) {
  .site-header {
    align-items: flex-start;
    min-height: auto;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .brand span { display: none; }
  .header-links { gap: 12px; font-size: 0.76rem; }

  .page {
    display: block;
    width: min(100% - 36px, var(--content));
    padding-top: 56px;
  }

  .rail {
    position: static;
    margin-bottom: 48px;
  }

  .rail nav {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .rail nav a { white-space: nowrap; }
  h1 { font-size: clamp(2.7rem, 15vw, 4.2rem); }
  html:lang(ja) h1 { font-size: clamp(2.4rem, 11vw, 3.6rem); }
  .site-footer { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Policy and support follow the app's classic bar palette (SkinPalette.homeBar). */
.document-page {
  --paper: #f2f5f2;
  --paper-deep: #e7ede8;
  --ink: #202d28;
  --muted: #52665b;
  --line: #cad5cd;
  --rust: #245846;
  --rust-strong: #245846;
  --surface: #f3f5f3;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

html:lang(ja) .document-page,
html:lang(ko) .document-page {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

.document-page a { text-decoration-color: color-mix(in srgb, var(--rust) 40%, transparent); }
.document-page a:focus-visible { outline-color: var(--rust); }
.document-page .support-action:hover { color: var(--paper); }
.document-page .brand span { display: inline; }
.document-page .hero,
.document-page section { animation: none; }
.document-page .site-header { flex-wrap: wrap; gap: 8px 24px; }
.document-page .site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding-bottom: calc(36px + env(safe-area-inset-bottom, 0px));
}

html.homadebar-app .document-page .site-header {
  display: flex;
  position: relative;
  top: auto;
  backdrop-filter: none;
  background: var(--paper);
}

html.homadebar-app .document-page .page {
  padding-top: 32px;
  padding-bottom: 40px;
}

@media (max-width: 760px) {
  .document-page { font-size: 16px; }
  .document-page .site-header { padding: 14px 20px; align-items: center; }
  .document-page .brand { font-size: 15px; }
  .document-page .header-links { gap: 8px 16px; }
  .document-page h1 { font-size: clamp(2.2rem, 9vw, 3.2rem); letter-spacing: -0.035em; }
  html:lang(ja) .document-page h1 { font-size: clamp(2rem, 8vw, 3rem); }
  .document-page .site-footer span { overflow-wrap: anywhere; }
}

@media (prefers-color-scheme: dark) {
  .document-page {
    --paper: #17241f;
    --paper-deep: #202f27;
    --ink: #edf2ee;
    --muted: #b5c8bc;
    --line: #3a5144;
    --rust: #9cc8ae;
    --rust-strong: #9cc8ae;
    --surface: #25312c;
  }
}
