/* Brolly Help Center — standalone stylesheet for the public server-rendered KB
   pages (support.brolly.io). Deliberately independent of the SPA bundle; token
   values copied from src/design/brolly-tokens.css (light theme). */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&family=Fira+Sans:wght@600;700;800;900&display=swap');

:root {
  --bg-app: #f8fafc;
  --bg-surface: #fff;
  --bg-input: #f1f5f9;
  --fg: #121926;
  --fg-secondary: #4b5565;
  --fg-muted: #697586;
  --accent: #2dd4bf;
  --accent-strong: #14b8a6;
  --accent-subtle: rgba(45, 212, 191, 0.16);
  --success: #039855;
  --success-bg: #ecfdf3;
  --border-default: #e3e8ef;
  --border-subtle: #eef2f6;
  --shadow-md: 0 6px 18px rgba(8, 10, 30, 0.08);
  --shadow-lg: 0 16px 38px rgba(8, 10, 30, 0.14);
  --font-display: 'Fira Sans', system-ui, sans-serif;
  --font-body: 'Poppins', system-ui, sans-serif;
  --max: 1080px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg-app);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
}
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--fg); letter-spacing: -0.01em; }
img { max-width: 100%; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* ---- header ---- */
.site-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  position: sticky; top: 0; z-index: 10;
}
.site-header .wrap { display: flex; align-items: center; gap: 12px; height: 60px; }
.site-header .brand { display: inline-flex; align-items: center; gap: 9px; color: var(--fg); font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.site-header .brand:hover { text-decoration: none; }
.site-header nav { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.site-header nav a { font-size: 13.5px; font-weight: 500; color: var(--fg-secondary); }

/* ---- hero ---- */
.hero {
  background:
    radial-gradient(520px 260px at 18% 0%, rgba(45, 212, 191, 0.14), transparent 70%),
    radial-gradient(520px 260px at 85% 10%, rgba(89, 37, 220, 0.10), transparent 70%),
    var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  text-align: center;
  padding: 58px 24px 52px;
}
.hero h1 { margin: 0 0 12px; font-size: 40px; line-height: 1.1; }
.hero p { margin: 0 auto 26px; max-width: 480px; color: var(--fg-secondary); font-size: 16px; }
.hero .search { position: relative; max-width: 520px; margin: 0 auto; }
.hero .search svg { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--fg-muted); }
.hero .search input {
  width: 100%; background: var(--bg-surface); border: 1px solid var(--border-default);
  border-radius: 13px; padding: 16px 18px 16px 50px; font-family: var(--font-body);
  font-size: 15.5px; color: var(--fg); outline: none; box-shadow: var(--shadow-md);
}
.hero .search input:focus { border-color: var(--accent); }
.hero .chips { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 16px; flex-wrap: wrap; }
.hero .chips span { font-size: 12.5px; color: var(--fg-muted); }
.hero .chips a {
  background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: 999px;
  padding: 5px 13px; font-weight: 500; font-size: 12.5px; color: var(--fg-secondary);
}
.hero .chips a:hover { border-color: var(--accent); color: var(--accent-strong); text-decoration: none; }

/* ---- search dropdown (typeahead) ---- */
.search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 20;
  background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: 13px;
  box-shadow: var(--shadow-lg); overflow: hidden; text-align: left;
}
.search-results a { display: block; padding: 12px 18px; border-bottom: 1px solid var(--border-subtle); }
.search-results a:last-child { border-bottom: none; }
.search-results a:hover { background: var(--bg-app); text-decoration: none; }
.search-results .t { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--fg); }
.search-results .c { font-size: 12px; color: var(--fg-muted); margin-top: 2px; }

/* ---- sections / cards ---- */
.section { padding: 44px 0 12px; }
.section h2 { font-size: 20px; margin: 0 0 16px; }
.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cat-card {
  display: block; background: var(--bg-surface); border: 1px solid var(--border-default);
  border-radius: 16px; padding: 22px; color: inherit;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--accent); text-decoration: none; }
.cat-card .icon { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.cat-card .name { font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--fg); margin-bottom: 6px; }
.cat-card .desc { font-size: 13.5px; color: var(--fg-secondary); line-height: 1.5; }
.cat-card .count { font-size: 12.5px; color: var(--fg-muted); margin-top: 13px; }

.art-list { background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: 16px; overflow: hidden; }
.art-list a { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--border-subtle); color: inherit; }
.art-list a:last-child { border-bottom: none; }
.art-list a:hover { background: var(--bg-app); text-decoration: none; }
.art-list .dot { width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.art-list .t { font-family: var(--font-display); font-weight: 500; font-size: 14.5px; color: var(--fg); line-height: 1.35; }
.art-list .m { font-size: 12px; color: var(--fg-muted); margin-top: 2px; }
.art-list .chev { margin-left: auto; color: var(--fg-muted); flex-shrink: 0; }

/* ---- breadcrumbs ---- */
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg-muted); margin: 26px 0 18px; flex-wrap: wrap; }
.crumbs a { color: var(--fg-secondary); font-weight: 500; }

/* ---- article page ---- */
.article-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 48px; align-items: start; padding-bottom: 80px; }
.article-tag { font-weight: 600; font-size: 11px; padding: 3px 10px; border-radius: 999px; display: inline-block; }
article h1 { margin: 16px 0 12px; font-size: 34px; line-height: 1.15; letter-spacing: -0.02em; }
article .lede { margin: 0 0 8px; font-size: 16.5px; color: var(--fg-secondary); }
.byline { display: flex; align-items: center; gap: 14px; padding: 16px 0; margin: 18px 0 8px; border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); }
.byline .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-subtle); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: var(--accent-strong); flex-shrink: 0; }
.byline .who { font-size: 13.5px; font-weight: 600; }
.byline .when { font-size: 12px; color: var(--fg-muted); }

.kb-body { margin-top: 22px; }
.kb-body p { font-size: 15.5px; line-height: 1.72; color: var(--fg-secondary); margin: 0 0 18px; }
.kb-body h2 { font-size: 21px; font-weight: 600; margin: 34px 0 14px; }
.kb-body h3 { font-size: 17px; font-weight: 600; margin: 26px 0 10px; }
.kb-body ul, .kb-body ol { margin: 0 0 20px; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.kb-body li { position: relative; padding-left: 26px; font-size: 15px; line-height: 1.6; color: var(--fg-secondary); }
.kb-body li:before { content: ''; position: absolute; left: 7px; top: 10px; width: 6px; height: 6px; border-radius: 2px; background: var(--accent); }
.kb-body img { border-radius: 12px; border: 1px solid var(--border-default); margin: 6px 0 22px; display: block; box-shadow: var(--shadow-md); }
.kb-body code { background: var(--bg-input); border-radius: 5px; padding: 2px 6px; font-size: 13.5px; }
.kb-body blockquote { margin: 0 0 18px; padding: 12px 18px; border-left: 3px solid var(--accent); background: var(--accent-subtle); border-radius: 0 10px 10px 0; }
.kb-body blockquote p { margin: 0; }

/* ---- helpful vote ---- */
.vote-card { display: flex; align-items: center; gap: 16px; margin-top: 34px; padding: 20px 22px; background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: 14px; flex-wrap: wrap; }
.vote-card .q { font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.vote-card .btns { display: flex; gap: 9px; margin-left: auto; }
.vote-card button {
  display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-body); font-weight: 600;
  font-size: 13px; padding: 8px 16px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--border-default); background: var(--bg-app); color: var(--fg-secondary);
}
.vote-card button:hover { border-color: var(--accent); }
.vote-card button.on-yes { border-color: var(--success); background: var(--success-bg); color: var(--success); }
.vote-card button.on-no { border-color: var(--accent); background: var(--accent-subtle); color: var(--accent-strong); }
.vote-card .thanks { font-size: 13px; color: var(--fg-muted); margin-left: auto; }

/* ---- article sidebar ---- */
.side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 18px; }
.side-card { background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: 14px; padding: 18px; }
.side-card .h { font-weight: 700; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-muted); margin-bottom: 13px; }
.side-card .row { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; font-size: 13px; }
.side-card .row:last-child { margin-bottom: 0; }
.side-card .row .k { color: var(--fg-muted); }
.side-card .row .v { font-weight: 600; color: var(--fg); text-align: right; }
.side-card .rel { display: flex; align-items: center; gap: 9px; padding: 8px 6px; border-radius: 8px; color: var(--fg-secondary); font-size: 13px; font-weight: 500; line-height: 1.3; }
.side-card .rel:hover { background: var(--bg-app); text-decoration: none; }
.side-card .rel .sq { width: 7px; height: 7px; border-radius: 2px; flex-shrink: 0; }

/* ---- contact strip ---- */
.contact-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 40px 0 70px; }
.contact-card { background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: 16px; padding: 24px; }
.contact-card.accent { background: linear-gradient(150deg, var(--accent-subtle), var(--bg-surface)); border-color: var(--accent); }
.contact-card .t { font-family: var(--font-display); font-weight: 600; font-size: 16px; margin-bottom: 6px; }
.contact-card p { margin: 0 0 16px; font-size: 13.5px; color: var(--fg-secondary); }
.contact-card a.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  background: var(--bg-app); border: 1px solid var(--border-default); border-radius: 10px; padding: 11px;
  font-weight: 600; font-size: 14px; color: var(--fg);
}
.contact-card a.btn:hover { border-color: var(--accent); text-decoration: none; }
.contact-card.accent a.btn { background: var(--accent); border: none; color: #fff; }
.contact-card.accent a.btn:hover { background: var(--accent-strong); }

/* ---- footer ---- */
.site-footer { border-top: 1px solid var(--border-default); background: var(--bg-surface); padding: 26px 0 34px; margin-top: 30px; }
.site-footer .wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.site-footer span, .site-footer a { font-size: 12.5px; color: var(--fg-muted); }
.site-footer .right { margin-left: auto; display: flex; gap: 18px; }

/* ---- category page ---- */
.cat-head { padding: 34px 0 8px; }
.cat-head h1 { margin: 0 0 8px; font-size: 32px; }
.cat-head p { margin: 0; color: var(--fg-secondary); max-width: 560px; }

/* ---- 404 / empty ---- */
.empty { text-align: center; padding: 90px 20px; color: var(--fg-muted); }
.empty h1 { font-size: 26px; margin: 0 0 10px; }

/* ---- responsive ---- */
@media (max-width: 900px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .article-grid { grid-template-columns: 1fr; gap: 0; }
  .side { position: static; margin-top: 34px; }
}
@media (max-width: 600px) {
  .hero h1 { font-size: 30px; }
  .cat-grid { grid-template-columns: 1fr; }
  .contact-strip { grid-template-columns: 1fr; }
  article h1 { font-size: 27px; }
  .site-header nav a.hide-sm { display: none; }
}
