/* ============================================================
 * Compass Pro — content pages theme
 *
 * Stand-alone CSS for the static policy pages (privacy policy,
 * refund policy). Mirrors the Android app's look: a pale
 * blue-grey ground, white cards, a navy top bar like the app's
 * hero cards (navy in light and dark alike), teal for accents
 * and links, and coral — the colour of north — only as a thin
 * line under the top bar. Flat ground, no gradients.
 * Light by default; a dark variant kicks in via
 * prefers-color-scheme so it tracks the OS just like the app's
 * system theme.
 *
 * Contrast: every text colour below is at least 4.5:1 against
 * the surface it sits on. #0FA08F (the app's teal) is 3.3:1 on
 * white, so in light it is used for marks and borders only and
 * link text takes the deeper --ab-link.
 * ============================================================ */

:root {
  /* Brand */
  --ab-navy: #13233B;           /* top bar (both themes share the navy family) */
  --ab-navy-deep: #0F1E33;      /* controls on the top bar */
  --ab-on-navy: #F5F1E8;        /* cream ink on navy */
  --ab-on-navy-teal: #2CC7B3;   /* teal that reads on navy */
  --ab-north: #F2552C;          /* coral — used sparingly */

  --ab-brand: #0FA08F;          /* teal — marks, borders, focus rings */
  --ab-brand-deep: #0B7F72;     /* pressed */
  --ab-brand-bright: #086A5F;   /* link hover (darker on light surfaces) */
  --ab-brand-tint: rgba(15, 160, 143, 0.14);
  --ab-link: #0A776B;           /* teal as text on light surfaces */

  /* Light surfaces */
  --ab-bg: #F3F5F8;             /* page ground: pale blue-grey */
  --ab-surface: #FFFFFF;        /* cards */
  --ab-surface-2: #EEF1F5;      /* nested / faq closed */
  --ab-border: #E3E7ED;
  --ab-border-strong: #CBD3DE;

  /* Text */
  --ab-text: #13233B;           /* headings / body strong */
  --ab-text-soft: #3D4B5F;      /* paragraph */
  --ab-text-muted: #5A6678;     /* meta */

  /* Shape */
  --ab-radius-lg: 22px;
  --ab-radius-md: 16px;
  --ab-radius-sm: 12px;
  --ab-radius-pill: 999px;

  /* Elevation */
  --ab-shadow-card: 0 1px 2px rgba(19, 35, 59, 0.04),
                    0 12px 32px -18px rgba(19, 35, 59, 0.22);
  --ab-shadow-glow: 0 8px 22px -8px rgba(15, 160, 143, 0.45);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ab-navy: #0F1E33;
    --ab-navy-deep: #0B1626;

    --ab-bg: #0A0F17;
    --ab-surface: #121A26;
    --ab-surface-2: #172131;
    --ab-border: #1E2838;
    --ab-border-strong: #2C394D;

    --ab-text: #EEF2F7;
    --ab-text-soft: #B9C4D2;
    --ab-text-muted: #9BA7B7;

    --ab-brand: #2CC7B3;
    --ab-brand-deep: #25AD9C;
    --ab-brand-bright: #5EDBCB;
    --ab-brand-tint: rgba(44, 199, 179, 0.16);
    --ab-link: #2CC7B3;

    --ab-shadow-card: 0 1px 2px rgba(0, 0, 0, 0.30),
                      0 16px 40px -20px rgba(0, 0, 0, 0.70);
    --ab-shadow-glow: 0 8px 22px -8px rgba(44, 199, 179, 0.45);
  }
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ab-bg);
  color: var(--ab-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans",
    "Noto Sans JP", "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.7;
  overflow-x: hidden;
}

/* Long English words / URLs must not blow out narrow phone widths. */
.ab-card p,
.ab-card li,
.ab-faq-answer,
.ab-faq-item summary {
  overflow-wrap: anywhere;
  word-break: break-word;
}

a {
  color: var(--ab-link);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover { color: var(--ab-brand-bright); }

/* Links inside running text carry an underline too, so they do not depend on colour alone. */
.ab-card a,
.ab-faq-answer a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

::selection {
  background: var(--ab-brand-tint);
  color: var(--ab-text);
}

/* ============================================================
 * Page scaffold
 * ============================================================ */
.ab-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ----- Top bar (navy in both themes, like the app's hero cards) ----- */
.ab-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--ab-navy);
  border-bottom: 2px solid var(--ab-north);
}

.ab-topbar-inner {
  max-width: 920px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.ab-back {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(245, 241, 232, 0.08);
  border: 1px solid rgba(245, 241, 232, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ab-on-navy-teal);
  font-size: 1.2rem;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.ab-back:hover {
  background: var(--ab-on-navy-teal);
  border-color: var(--ab-on-navy-teal);
  color: var(--ab-navy-deep);
}
/* The arrow points the other way in right-to-left pages. */
[dir="rtl"] .ab-back { transform: scaleX(-1); }

.ab-topbar h1 {
  font-size: 1.2rem;
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ab-on-navy);
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.ab-brandmark {
  flex: none;
  display: inline-flex;
  align-items: center;
}
.ab-brandmark img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: block;
  /* The icon's ground is the same navy as the bar; a hairline keeps its shape. */
  box-shadow: 0 0 0 1px rgba(245, 241, 232, 0.22);
}

/* ----- Language switcher ----- */
.ab-lang-switch {
  margin-inline-start: auto;
  flex: none;
  display: flex;
  align-items: center;
}
.ab-lang-switch select {
  background-color: var(--ab-navy-deep);
  border: 1px solid rgba(245, 241, 232, 0.24);
  color: var(--ab-on-navy);
  padding: 8px 30px 8px 12px;
  border-radius: var(--ab-radius-sm);
  font-size: 0.85rem;
  max-width: 46vw;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%232CC7B3' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 9px center;
}
[dir="rtl"] .ab-lang-switch select {
  padding: 8px 12px 8px 30px;
  background-position: left 9px center;
}
.ab-lang-switch select:focus {
  outline: none;
  border-color: var(--ab-on-navy-teal);
  box-shadow: 0 0 0 3px rgba(44, 199, 179, 0.28);
}
.ab-lang-switch select option {
  background-color: #FFFFFF;
  color: #13233B;
}

/* ----- Content ----- */
.ab-content {
  flex: 1;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 32px 24px 24px;
}

.ab-card {
  background: var(--ab-surface);
  border: 1px solid var(--ab-border);
  border-radius: var(--ab-radius-lg);
  box-shadow: var(--ab-shadow-card);
  padding: 32px 36px;
  margin-bottom: 22px;
}

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

.ab-card h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 32px 0 14px;
  color: var(--ab-text);
  padding-inline-start: 14px;
  border-inline-start: 4px solid var(--ab-brand);
  line-height: 1.4;
}
.ab-card h3 {
  font-size: 1.08rem;
  font-weight: 700;
  margin: 24px 0 10px;
  color: var(--ab-text);
}

.ab-card p,
.ab-card li {
  color: var(--ab-text-soft);
  font-size: 0.97rem;
  line-height: 1.8;
}
.ab-card strong { color: var(--ab-text); }

.ab-card ol,
.ab-card ul {
  padding-inline-start: 1.4rem;
  margin: 12px 0;
}
.ab-card li { margin-bottom: 6px; }

.ab-card ul li::marker { color: var(--ab-brand); }

.ab-card table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 0.93rem;
}
.ab-card th,
.ab-card td {
  border: 1px solid var(--ab-border);
  padding: 8px 10px;
  text-align: start;
  vertical-align: top;
  color: var(--ab-text-soft);
}
.ab-card th {
  background: var(--ab-surface-2);
  color: var(--ab-text);
}

.ab-card code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--ab-surface-2);
  color: var(--ab-text);
  padding: 0.1em 0.35em;
  border-radius: 6px;
}

.ab-effective {
  color: var(--ab-text-muted);
  font-size: 0.85rem;
  margin-top: 30px;
  padding-top: 16px;
  border-top: 1px solid var(--ab-border);
}

/* Lead paragraph in the FAQ intro card */
.ab-intro {
  margin: 0;
  color: var(--ab-text-soft);
}

/* ============================================================
 * FAQ accordion
 * ============================================================ */
.ab-faq-item {
  background: var(--ab-surface);
  border: 1px solid var(--ab-border);
  border-radius: var(--ab-radius-md);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--ab-shadow-card);
  transition: border-color 0.2s ease;
}
.ab-faq-item[open] {
  border-color: var(--ab-brand);
}
.ab-faq-item summary {
  cursor: pointer;
  padding: 18px 22px;
  font-weight: 600;
  color: var(--ab-text);
  font-size: 1rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
}
.ab-faq-item summary::-webkit-details-marker { display: none; }
.ab-faq-item summary::after {
  content: "";
  flex: none;
  margin-inline-start: auto;
  width: 22px;
  height: 22px;
  background: var(--ab-brand);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 5v14M5 12h14' stroke='black' stroke-width='2.4' stroke-linecap='round'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 5v14M5 12h14' stroke='black' stroke-width='2.4' stroke-linecap='round'/></svg>") center / contain no-repeat;
  transition: transform 0.25s ease;
}
.ab-faq-item[open] summary::after {
  transform: rotate(135deg);
}
.ab-faq-item summary:hover { color: var(--ab-link); }

.ab-faq-answer {
  padding: 0 22px 20px;
  color: var(--ab-text-soft);
  font-size: 0.95rem;
  line-height: 1.8;
}
.ab-faq-answer > :first-child { margin-top: 0; }
.ab-faq-answer ol,
.ab-faq-answer ul { padding-inline-start: 1.3rem; }
.ab-faq-answer li { margin-bottom: 6px; }
.ab-faq-answer strong { color: var(--ab-text); }

/* ============================================================
 * Footer nav (also embeddable on the top page)
 * ============================================================ */
.ab-footer-nav {
  background: var(--ab-surface);
  border-top: 1px solid var(--ab-border);
  padding: 32px 24px;
  margin-top: 8px;
}
.ab-footer-nav-inner {
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  text-align: center;
}
.ab-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 26px;
}
.ab-footer-links a {
  color: var(--ab-text-soft);
  font-size: 0.92rem;
  font-weight: 500;
}
.ab-footer-links a:hover { color: var(--ab-link); }
.ab-footer-copy {
  color: var(--ab-text-muted);
  font-size: 0.82rem;
  margin: 0;
}
.ab-footer-copy a { color: var(--ab-text-muted); }
.ab-footer-copy a:hover { color: var(--ab-link); }

/* ============================================================
 * Responsive
 * ============================================================ */
@media (max-width: 600px) {
  .ab-content { padding: 22px 14px 16px; }
  .ab-card { padding: 22px 18px; border-radius: var(--ab-radius-md); }
  .ab-topbar-inner { padding: 10px 14px; gap: 10px; }
  .ab-topbar h1 { font-size: 1.05rem; }
  .ab-card h2 { font-size: 1.18rem; }
  .ab-card h3 { font-size: 1rem; }
  .ab-lang-switch select { font-size: 0.8rem; padding: 7px 26px 7px 10px; }
  [dir="rtl"] .ab-lang-switch select { padding: 7px 10px 7px 26px; }
  .ab-faq-item summary { padding: 15px 16px; font-size: 0.96rem; }
  .ab-faq-answer { padding: 0 16px 16px; font-size: 0.92rem; }
}
