/* Candlestick Chart & Pattern — support & privacy pages.
   Static, dependency-free, no cookies, no analytics. */

:root {
  color-scheme: light dark;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #f9fbfd;
  --text: #14181f;
  --muted: #5b6573;
  --border: #e3e8ef;
  --accent: #0f766e;
  --accent-ink: #ffffff;
  --accent-soft: #e6f4f1;
  --warn: #b45309;
  --warn-soft: #fff7ed;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 28px rgba(16, 24, 40, 0.06);
  --max: 860px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f14;
    --surface: #111821;
    --surface-2: #0f1620;
    --text: #e7edf5;
    --muted: #9aa7b6;
    --border: #22303e;
    --accent: #2dd4bf;
    --accent-ink: #04201d;
    --accent-soft: #0f2a28;
    --warn: #fbbf24;
    --warn-soft: #2a1f0a;
    --shadow: none;
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  width: min(100% - 40px, var(--max));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible,
summary:focus-visible,
.button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.brand-mark {
  width: 28px;
  height: 28px;
  color: var(--accent);
  flex: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-text strong {
  font-size: 14px;
}

.brand-text > span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 1px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.site-nav a:hover {
  color: var(--text);
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.site-nav .lang {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--text);
  font-weight: 600;
}

.site-nav .lang:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.hero {
  padding: 56px 0 22px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 14px;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.14;
  letter-spacing: -0.025em;
}

.lede {
  margin: 0 0 22px;
  max-width: 68ch;
  font-size: 17px;
  color: var(--muted);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.meta li {
  margin: 0;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  background: var(--surface);
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.button:hover {
  filter: brightness(1.05);
}

.button.secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.button.secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.card {
  margin: 18px 0;
  padding: clamp(20px, 4vw, 30px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card > :first-child {
  margin-top: 0;
}

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

h2 {
  margin: 0 0 14px;
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

h3 {
  margin: 22px 0 8px;
  font-size: 16px;
  line-height: 1.4;
}

p {
  margin: 0 0 12px;
}

ul,
ol {
  margin: 0 0 14px;
  padding-left: 1.25em;
}

li {
  margin: 6px 0;
}

li > ul,
li > ol {
  margin-top: 6px;
  margin-bottom: 6px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  vertical-align: middle;
}

.badge.free {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge.paid {
  background: #eef2ff;
  color: #3730a3;
}

@media (prefers-color-scheme: dark) {
  .badge.paid {
    background: #1e1b4b;
    color: #c7d2fe;
  }
}

.edition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
  margin-top: 4px;
}

.edition {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.edition h3 {
  margin: 10px 0 6px;
  font-size: 16px;
}

.edition p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
}

.edition a {
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.edition a:hover {
  text-decoration: underline;
}

.edition-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
}

.edition-links a + a {
  color: var(--muted);
}

.note {
  margin: 14px 0;
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: var(--accent-soft);
  font-size: 14px;
}

.note.warn {
  border-left-color: var(--warn);
  background: var(--warn-soft);
}

.note p:last-child {
  margin-bottom: 0;
}

details {
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

details:first-of-type {
  border-top: 0;
  padding-top: 0;
}

summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  list-style: none;
  cursor: pointer;
  font-weight: 650;
  line-height: 1.5;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  flex: none;
  margin-top: 3px;
}

details[open] summary::after {
  content: "–";
}

details > *:not(summary) {
  margin-top: 10px;
}

.table-wrap {
  overflow-x: auto;
  margin: 12px 0 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 520px;
}

th,
td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

tr:last-child td {
  border-bottom: 0;
}

th {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
  background: var(--surface-2);
}

td:first-child {
  font-weight: 600;
}

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

.contact-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 8px 0 4px;
}

.email {
  font-size: 16px;
  font-weight: 800;
  word-break: break-all;
}

.faq-group {
  margin-top: 8px;
}

.anchor-target {
  scroll-margin-top: 88px;
}

footer.site-footer {
  margin-top: 48px;
  padding: 28px 0 44px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px 28px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
  text-decoration: underline;
}

.lang-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.lang-card {
  display: block;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.lang-card:hover {
  border-color: var(--accent);
}

.lang-card strong {
  display: block;
  font-size: 20px;
  margin-bottom: 4px;
}

.lang-card span {
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 620px) {
  .wrap {
    width: min(100% - 28px, var(--max));
  }

  .header-inner {
    min-height: 62px;
    gap: 12px;
  }

  .brand-text strong {
    font-size: 13px;
  }

  .brand-text > span {
    display: none;
  }

  .site-nav {
    gap: 12px;
    font-size: 13px;
  }

  .site-nav .lang {
    padding: 5px 10px;
  }

  .hero {
    padding-top: 36px;
  }

  .lede {
    font-size: 16px;
  }

  .card {
    border-radius: 12px;
  }

  table {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media print {
  .site-header,
  .site-footer,
  .hero-actions,
  .skip-link {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  .card {
    box-shadow: none;
    border-color: #ccc;
    break-inside: avoid;
  }

  a {
    color: #000;
  }
}


/* Language switching */
html[data-lang="en"] [data-ja],
html[data-lang="en"] [data-zh],
html[data-lang="ja"] [data-en],
html[data-lang="ja"] [data-zh],
html[data-lang="zh"] [data-en],
html[data-lang="zh"] [data-ja] {
  display: none !important;
}

#en,
#ja {
  scroll-margin-top: 88px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.lang-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.lang-switch button:hover {
  color: var(--text);
}

.lang-switch button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}

.lang-switch button[aria-pressed="true"]:hover {
  color: var(--accent-ink);
}

@media (max-width: 620px) {
  .lang-switch button {
    font-size: 11px;
    padding: 5px 8px;
  }
}
