:root {
  --accent: #16a2e0;
  --accent-dark: #0f86bd;
  --brand-green: #0db352;
  --ink: #1c2530;
  --muted: #67727e;
  --line: #e6eaef;
  --bg: #f5f7fa;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(17,24,39,.04), 0 8px 24px rgba(17,24,39,.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", "Apple Color Emoji", sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

a { color: var(--accent-dark); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -.02em;
  color: var(--ink);
  text-decoration: none;
}
.brand-logo { width: 28px; height: 28px; flex: none; }
.brand span { color: var(--brand-green); font-weight: 600; }

.lang-switch select {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--card)
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2367727e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>")
    no-repeat right 10px center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 34px 8px 12px;
  cursor: pointer;
}
.lang-switch select:focus-visible { outline: 2px solid var(--accent); }

/* ---------- hero ---------- */
.hero {
  text-align: center;
  padding: 56px 20px 40px;
  background: linear-gradient(180deg, #eaf6fd 0%, var(--bg) 100%);
}
.hero-logo {
  display: block;
  width: 76px;
  height: 76px;
  border-radius: 18px;
  margin: 0 auto 16px;
  box-shadow: var(--shadow);
}
.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(26px, 4vw, 38px);
  letter-spacing: -.02em;
}
.hero-note {
  max-width: 560px;
  margin: 0 auto 26px;
  color: var(--muted);
  font-size: 15px;
}
.searchbox {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 620px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 18px;
  box-shadow: var(--shadow);
  transition: box-shadow .2s, border-color .2s;
}
.searchbox:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(22,162,224,.15);
}
.searchbox svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.searchbox input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 16px;
  padding: 12px 0;
  color: var(--ink);
}

/* ---------- layout ---------- */
#kb {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}
#no-results {
  text-align: center;
  color: var(--muted);
  padding: 40px 0;
  font-size: 16px;
}

/* ---------- category ---------- */
.cat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}
.cat-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
  color: var(--ink);
}
.cat-head .ico { width: 22px; height: 22px; color: var(--accent); flex: none; }
.cat-name { font-weight: 700; font-size: 17px; flex: 1; }
.cat-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg);
  border-radius: 999px;
  padding: 2px 9px;
}
.cat-head .chev { width: 20px; height: 20px; color: var(--muted); transition: transform .25s; flex: none; }
.cat--collapsed .cat-head .chev { transform: rotate(-90deg); }

.cat-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .28s ease; }
.cat--collapsed .cat-body { grid-template-rows: 0fr; }
/* while searching, keep every category visually open without touching its manual state */
body.searching .cat--collapsed .cat-body { grid-template-rows: 1fr; }
.cat-inner { overflow: hidden; min-height: 0; border-top: 1px solid var(--line); }

/* contact disambiguation callout (which Arise app this supports) */
.cat-note {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: #eaf6fd;
  border-bottom: 1px solid var(--line);
}
.cat-note-logo { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.cat-note p { margin: 0; font-size: 14px; color: var(--muted); }

/* ---------- article ---------- */
.art { border-bottom: 1px solid var(--line); }
.art:last-child { border-bottom: 0; }
.art-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
  color: var(--ink);
}
.art-head:hover { background: #fafbfc; }
.art-title { flex: 1; font-size: 15.5px; }
.art-title mark { background: #fff2ab; color: inherit; border-radius: 3px; padding: 0 1px; }
.art-head .chev { width: 18px; height: 18px; color: var(--muted); transition: transform .25s; flex: none; }
.art--open .art-head { color: var(--accent-dark); }
.art--open .art-head .chev { transform: rotate(180deg); color: var(--accent); }

.art-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .25s ease; }
.art--open .art-body { grid-template-rows: 1fr; }
.art-inner { overflow: hidden; min-height: 0; }
.art-inner > :first-child { margin-top: 0; }
.art-inner { padding: 0 20px; color: #36414d; font-size: 15px; }
.art--open .art-inner { padding-bottom: 18px; }
.art-inner p { margin: 0 0 12px; }
.art-inner p:last-child { margin-bottom: 0; }
.art-inner a { word-break: break-word; }

@media (max-width: 540px) {
  .hero { padding: 40px 16px 28px; }
  #kb { padding: 20px 14px 48px; }
  .cat-head, .art-head { padding-left: 16px; padding-right: 16px; }
  .art-inner { padding-left: 16px; padding-right: 16px; }
}
