/* Glynce Help Center — Bevel-style layout, Glynce colors. */
:root {
  --ink: #14223b;
  --muted: #5f6b80;
  --faint: #8b95a7;
  --rule: #e6e9f0;
  --bg: #fbfcfe;
  --card: #ffffff;
  --blue: #3b82f6;
  --blue-dark: #2563eb;
  --blue-soft: #e8f0fe;
  --shadow: 0 1px 2px rgba(20,34,59,0.04), 0 6px 20px rgba(20,34,59,0.06);
  --shadow-hover: 0 2px 4px rgba(20,34,59,0.06), 0 12px 30px rgba(20,34,59,0.10);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: clip;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--blue-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Top brand bar ───────────────────────────────────────────── */
header.kb-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(1.3) blur(10px);
  -webkit-backdrop-filter: saturate(1.3) blur(10px);
  border-bottom: 1px solid var(--rule);
}
header.kb-bar .wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 13px max(20px, env(safe-area-inset-right)) 13px max(20px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 14px;
}
header.kb-bar .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
header.kb-bar .brand:hover { text-decoration: none; }
header.kb-bar .brand img { width: 26px; height: 26px; border-radius: 7px; }
header.kb-bar .divider { width: 1px; height: 22px; background: var(--rule); }
header.kb-bar .kb-label { color: var(--muted); font-size: 15px; font-weight: 600; }
header.kb-bar nav { margin-left: auto; font-size: 14px; }
header.kb-bar nav a { color: var(--muted); margin-left: 18px; }
header.kb-bar nav a:hover { color: var(--blue-dark); text-decoration: none; }

/* ── Hero with search (seamless: sits on the page, no band) ───── */
.hero {
  text-align: center;
  padding: 54px 20px 14px;
}
.hero h1 {
  margin: 0 0 24px;
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.hero .search {
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}
.hero .search input {
  width: 100%;
  font-size: 16px;
  color: var(--ink);
  padding: 15px 18px 15px 46px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%238b95a7' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4-4'/%3E%3C/svg%3E") 16px 50% no-repeat;
  box-shadow: var(--shadow);
  outline: none;
}
.hero .search input::placeholder { color: var(--faint); }
.hero .search input:focus { border-color: var(--blue); box-shadow: var(--shadow), 0 0 0 3px rgba(74,144,226,0.18); }

/* Search results dropdown */
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: var(--shadow-hover);
  overflow: hidden;
  text-align: left;
  z-index: 30;
  display: none;
}
.search-results.open { display: block; }
.search-results a {
  display: block;
  padding: 12px 16px;
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
}
.search-results a:last-child { border-bottom: none; }
.search-results a:hover { background: var(--blue-soft); text-decoration: none; }
.search-results .r-title { display: block; font-weight: 600; font-size: 15px; }
.search-results .r-cat { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.search-results .r-empty { padding: 14px 16px; color: var(--muted); font-size: 14px; }

/* ── Page container ──────────────────────────────────────────── */
.container { max-width: 1040px; margin: 0 auto; padding: 44px max(20px, env(safe-area-inset-right)) 80px max(20px, env(safe-area-inset-left)); }
.container.narrow { max-width: 940px; }

/* Breadcrumb */
.crumbs { font-size: 14px; color: var(--muted); margin: 0 0 22px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--blue-dark); }
.crumbs .sep { margin: 0 8px; color: var(--faint); }
.crumbs .here { color: var(--ink); }

/* ── Section labels (home) ───────────────────────────────────── */
.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 18px;
}

/* ── Popular articles (home) ─────────────────────────────────── */
.popular { margin-bottom: 40px; }
.popular-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.popular-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 11px;
  padding: 15px 17px;
  color: var(--ink);
  font-weight: 600;
  font-size: 15.5px;
  line-height: 1.35;
  box-shadow: var(--shadow);
  transition: box-shadow .16s ease, border-color .16s ease, transform .16s ease;
}
.popular-item:hover { text-decoration: none; box-shadow: var(--shadow-hover); border-color: #d8deea; transform: translateY(-1px); }
.popular-item svg { flex: none; width: 19px; height: 19px; color: var(--blue-dark); }

/* ── Category grid (home) ────────────────────────────────────── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.cat-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 28px 26px;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
  text-align: center;
}
.cat-card:hover { text-decoration: none; box-shadow: var(--shadow-hover); transform: translateY(-2px); border-color: #d8deea; }
.cat-icon {
  width: 52px; height: 52px;
  margin: 0 auto 16px;
  border-radius: 13px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  display: flex; align-items: center; justify-content: center;
}
.cat-icon svg { width: 26px; height: 26px; }
.cat-card h2 { margin: 0 0 6px; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.cat-card p { margin: 0 0 14px; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.cat-count { font-size: 13px; color: var(--faint); display: inline-flex; align-items: center; gap: 6px; }
.cat-count svg { width: 14px; height: 14px; }

/* ── Category page (article list) ────────────────────────────── */
.cat-head h1 { margin: 0 0 6px; font-size: 34px; font-weight: 800; letter-spacing: -0.02em; }
.cat-head p { margin: 0 0 28px; color: var(--muted); font-size: 16px; }

.article-list { display: flex; flex-direction: column; gap: 12px; }
.article-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 18px 20px;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: box-shadow .16s ease, border-color .16s ease;
}
.article-row:hover { text-decoration: none; box-shadow: var(--shadow-hover); border-color: #d8deea; }
.article-row .doc {
  flex: none;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  display: flex; align-items: center; justify-content: center;
}
.article-row .doc svg { width: 17px; height: 17px; }
.article-row .txt { min-width: 0; }
.article-row .a-title { font-weight: 700; font-size: 16.5px; letter-spacing: -0.01em; }
.article-row .a-ex { color: var(--muted); font-size: 14.5px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }

/* ── Article page ────────────────────────────────────────────── */
.article-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
  align-items: start;
}
.article-layout.no-toc { grid-template-columns: 1fr; gap: 0; }
.toc {
  position: sticky;
  top: 92px;
  font-size: 14px;
}
.toc .toc-label {
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 12px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--rule); }
.toc li { margin: 0; }
.toc a {
  display: block;
  padding: 6px 0 6px 16px;
  margin-left: -2px;
  border-left: 2px solid transparent;
  color: var(--muted);
  line-height: 1.4;
}
.toc a:hover { color: var(--blue-dark); text-decoration: none; }
.toc a.active { color: var(--blue-dark); border-left-color: var(--blue-dark); font-weight: 600; }

.article {
  max-width: 720px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 40px 44px 44px;
}
.article h1 { margin: 0 0 6px; font-size: 30px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.article .updated { color: var(--faint); font-size: 13.5px; margin: 0 0 26px; }
.article h2 { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; margin: 34px 0 12px; scroll-margin-top: 92px; }
.article p { margin: 0 0 14px; }
.article ul, .article ol { padding-left: 22px; margin: 0 0 16px; }
.article li { margin: 0 0 7px; }
.article li::marker { color: var(--blue); }
.article strong { color: var(--ink); }
.article .note {
  margin: 22px 0 0;
  padding: 14px 16px;
  background: var(--blue-soft);
  border-radius: 10px;
  font-size: 15px;
  color: #33456a;
}
.article .table-wrap { overflow-x: auto; margin: 16px 0 20px; }
.article table { width: 100%; border-collapse: collapse; font-size: 15px; }
.article th, .article td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--rule); }
.article thead th { background: var(--blue-soft); color: var(--ink); font-weight: 700; }
.article tbody tr:last-child td { border-bottom: none; }

/* Helpful + still have questions */
.article-foot { max-width: 720px; margin: 40px 0 0; }
.helpful {
  text-align: center;
  padding: 26px 0 6px;
}
.helpful p { font-weight: 700; margin: 0 0 14px; }
.helpful .btns { display: inline-flex; gap: 12px; }
.helpful button {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 9px 18px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.helpful button:hover { border-color: var(--blue); }
.helpful button svg { width: 16px; height: 16px; }
.helpful .thanks { color: var(--muted); font-size: 14.5px; }

.still {
  margin-top: 42px;
  border-top: 1px solid var(--rule);
  padding-top: 30px;
}
.still h2 { font-size: 22px; font-weight: 800; margin: 0 0 8px; }
.still p { margin: 0; color: var(--muted); }

/* Related / prev-next within category */
.sib { margin-top: 30px; font-size: 14.5px; color: var(--muted); }
.sib a { font-weight: 600; }

/* ── Footer ──────────────────────────────────────────────────── */
footer.kb-foot {
  border-top: 1px solid var(--rule);
  background: var(--card);
  font-size: 13px;
  color: var(--muted);
}
footer.kb-foot .wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 22px max(20px, env(safe-area-inset-right)) calc(22px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
footer.kb-foot a { color: var(--muted); }
footer.kb-foot a:hover { color: var(--blue-dark); }
footer.kb-foot nav a { margin-left: 18px; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 860px) {
  .article-layout { grid-template-columns: 1fr; gap: 0; }
  .toc { display: none; }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .hero { padding: 38px 18px 8px; }
  .hero h1 { font-size: 30px; }
  .container { padding: 30px 18px 60px; }
  .cat-grid { grid-template-columns: 1fr; gap: 14px; }
  .popular-grid { grid-template-columns: 1fr; gap: 10px; }
  .cat-card { padding: 22px 20px; }
  .cat-head h1 { font-size: 27px; }
  .article { padding: 26px 22px 30px; border-radius: 14px; }
  .article h1 { font-size: 25px; }
  header.kb-bar .kb-label { display: none; }
  header.kb-bar .divider { display: none; }
}

/* ── Dark mode ───────────────────────────────────────────────────
   Follows the OS setting. Palette sampled from the app's cool-charcoal
   dark theme (page #1F2125, card #33353D, ring #3F4047). Because the whole
   sheet is variable-driven, most of dark mode is just re-pointing the tokens;
   the rest fixes the few spots that hardcode a light value. */
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f4f5f8;
    --muted: #aeb3be;
    --faint: #969ba8;
    --rule: #3f4047;
    --bg: #1f2125;
    --card: #33353d;
    --blue: #4a90e2;
    --blue-dark: #6fa9ec;
    --blue-soft: rgba(74, 144, 226, 0.15);
    --shadow: 0 1px 2px rgba(0,0,0,0.28), 0 6px 20px rgba(0,0,0,0.30);
    --shadow-hover: 0 2px 4px rgba(0,0,0,0.34), 0 14px 34px rgba(0,0,0,0.46);
  }

  /* Translucent bar over the charcoal page instead of white. */
  header.kb-bar { background: rgba(31,33,37,0.82); }

  /* Hover ring a step brighter than the resting #3F4047 stroke. */
  .cat-card:hover,
  .article-row:hover,
  .popular-item:hover { border-color: #4a4c55; }

  /* Note callout: light text on the tinted-blue surface. */
  .article .note { color: #d3dcea; }
}
