/* =========================================================================
   Nuqta help centre  ·  help.nuqta.co
   Theme aware styling for the help centre and the docked Nuqta Assistant.
   Palette ported from the agreed build plan. DM Sans (English), Amiri (Arabic).
   No webfonts are linked; both fall back to the system stack gracefully.
   ========================================================================= */

:root {
  --ground: #F4F2EE; --surface: #FFFFFF; --surface-2: #FBFAF7; --raise: #F8F9FA;
  --ink: #16232B; --text: #48535B; --muted: #6C757D; --faint: #9AA0A6;
  --line: #E6E1D8; --line-2: #EDE9E1; --accent: #2E86AB; --accent-strong: #236A88;
  --accent-deep: #174556; --accent-tint: #EAF4F8; --accent-wash: #F1F7FA;
  --good: #229C5B; --warn: #C67A12; --crit: #D2453B;
  --code-bg: #F3F0E9;
  --shadow: 0 1px 2px rgba(22,35,43,.05), 0 8px 24px rgba(22,35,43,.06);
  --shadow-lg: 0 4px 12px rgba(22,35,43,.08), 0 24px 60px rgba(22,35,43,.14);
  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 20px;
  --font: 'DM Sans', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, 'Amiri', sans-serif;
  --font-ar: 'Amiri', 'Noto Naskh Arabic', serif;
  --maxw: 1200px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0C1417; --surface: #121B1F; --surface-2: #0F181B; --raise: #162126;
    --ink: #EAF1F3; --text: #B7C0C4; --muted: #8B959A; --faint: #677176;
    --line: #223037; --line-2: #1B272D; --accent: #4FA9CC; --accent-strong: #6FBEDD;
    --accent-deep: #A9DBEC; --accent-tint: #12303B; --accent-wash: #10262F;
    --good: #37B26C; --warn: #D69A3C; --crit: #E5675C;
    --code-bg: #0E181C;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px rgba(0,0,0,.4);
    --shadow-lg: 0 6px 18px rgba(0,0,0,.5), 0 30px 70px rgba(0,0,0,.55);
  }
}
:root[data-theme="dark"] {
  --ground: #0C1417; --surface: #121B1F; --surface-2: #0F181B; --raise: #162126;
  --ink: #EAF1F3; --text: #B7C0C4; --muted: #8B959A; --faint: #677176;
  --line: #223037; --line-2: #1B272D; --accent: #4FA9CC; --accent-strong: #6FBEDD;
  --accent-deep: #A9DBEC; --accent-tint: #12303B; --accent-wash: #10262F;
  --good: #37B26C; --warn: #D69A3C; --crit: #E5675C;
  --code-bg: #0E181C;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px rgba(0,0,0,.4);
  --shadow-lg: 0 6px 18px rgba(0,0,0,.5), 0 30px 70px rgba(0,0,0,.55);
}
:root[data-theme="light"] {
  --ground: #F4F2EE; --surface: #FFFFFF; --surface-2: #FBFAF7; --raise: #F8F9FA;
  --ink: #16232B; --text: #48535B; --muted: #6C757D; --faint: #9AA0A6;
  --line: #E6E1D8; --line-2: #EDE9E1; --accent: #2E86AB; --accent-strong: #236A88;
  --accent-deep: #174556; --accent-tint: #EAF4F8; --accent-wash: #F1F7FA;
  --good: #229C5B; --warn: #C67A12; --crit: #D2453B;
  --code-bg: #F3F0E9;
  --shadow: 0 1px 2px rgba(22,35,43,.05), 0 8px 24px rgba(22,35,43,.06);
  --shadow-lg: 0 4px 12px rgba(22,35,43,.08), 0 24px 60px rgba(22,35,43,.14);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
h1, h2, h3, h4 { color: var(--ink); margin: 0; letter-spacing: -0.02em; text-wrap: balance; }
p { margin: 0; }
a { color: var(--accent-strong); text-underline-offset: 2px; }
button { font-family: inherit; }
.ar { font-family: var(--font-ar); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--ground) 84%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-in {
  max-width: var(--maxw); margin: 0 auto;
  padding: 13px 24px; display: flex; align-items: center; gap: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand .mark { color: var(--accent); height: 17px; width: auto; display: block; }
.brand .brand-label {
  font-size: 13px; color: var(--faint); font-weight: 500;
  padding-left: 11px; border-left: 1px solid var(--line);
}
.topbar .spacer { margin-left: auto; }
.topbar-link {
  font-size: 14px; font-weight: 500; color: var(--text);
  text-decoration: none; padding: 8px 10px; border-radius: var(--r-sm);
  transition: color .25s ease, background .25s ease;
}
.topbar-link:hover { color: var(--accent-strong); background: var(--surface-2); }

/* ------------------------------------------------------- topbar on mobile
   The brand label carries a left divider rule. When the header ran out of
   width the label wrapped onto two lines and that 1px divider stretched into
   a stray vertical line beside the logo. Everything in the bar is now kept on
   one line, and the label steps aside on the narrowest screens. */
.brand-label, .topbar-link { white-space: nowrap; }
.brand .mark { flex: none; }

@media (max-width: 560px) {
  .topbar-in { padding: 10px 16px; gap: 10px; }
  .topbar-link { font-size: 14px; padding: 8px; }
}
@media (max-width: 420px) {
  .brand .brand-label { display: none; }
}

/* Category behaviour on small screens lives at the end of this file. */
/* Matches the nuqta.co homepage toggle: borderless, sun and moon icons
   that cross-fade and rotate. */
.theme-toggle {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: 50%; cursor: pointer;
  color: var(--muted); position: relative; flex-shrink: 0;
  transition: color .3s ease;
}
.theme-toggle:hover { color: var(--accent); }
.theme-toggle svg {
  width: 18px; height: 18px; position: absolute;
  transition: opacity .3s ease, transform .4s cubic-bezier(0.25, 1, 0.5, 1);
}
/* Light: the moon shows (tap to go dark). */
.theme-toggle .icon-sun { opacity: 0; transform: rotate(-90deg) scale(0.5); }
.theme-toggle .icon-moon { opacity: 1; transform: rotate(0deg) scale(1); }
/* System dark, unless explicitly set to light: the sun shows. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { opacity: 1; transform: rotate(0deg) scale(1); }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { opacity: 0; transform: rotate(90deg) scale(0.5); }
}
/* Explicit toggles win over the system preference. */
:root[data-theme="dark"] .theme-toggle .icon-sun { opacity: 1; transform: rotate(0deg) scale(1); }
:root[data-theme="dark"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(90deg) scale(0.5); }
:root[data-theme="light"] .theme-toggle .icon-sun { opacity: 0; transform: rotate(-90deg) scale(0.5); }
:root[data-theme="light"] .theme-toggle .icon-moon { opacity: 1; transform: rotate(0deg) scale(1); }

/* ------------------------------------------------------------------ shell */
.shell {
  max-width: 860px; margin: 0 auto; padding: 30px 24px 96px;
}
/* Let the pill row scroll inside the help column instead of stretching
   the page sideways. */
.shell > * { min-width: 0; }
@media (max-width: 1020px) {
  .shell { grid-template-columns: 1fr; gap: 26px; }
}

/* ------------------------------------------------------------------- hero */
.hero { padding: 12px 0 22px; }
.eyebrow {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--accent-strong); font-weight: 700;
}
.hero h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem); line-height: 1.05; margin: 12px 0 0; font-weight: 700;
}
.hero .lead {
  font-size: clamp(1rem, 2vw, 1.12rem); color: var(--text); margin-top: 14px; max-width: 52ch;
}

/* ----------------------------------------------------------------- search */
.search {
  margin-top: 22px; position: relative; display: flex; align-items: center;
}
.search .icon {
  position: absolute; left: 16px; color: var(--faint); font-size: 18px;
  pointer-events: none; display: grid; place-items: center;
}
.search input {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 15px 46px 15px 46px; box-shadow: var(--shadow);
  /* A flex item defaults to min-width:auto, so an input refuses to shrink
     below its intrinsic size. iOS Safari derives that from the default 20
     character size plus this padding, which pushed .search wider than a
     phone screen: the document overflowed, Safari zoomed out to fit, and the
     viewport-width topbar then covered only part of the screen while the
     chat panel's border showed as a hairline down the left. Removing the
     floor lets it shrink on every engine. */
  min-width: 0; flex: 1 1 auto;
}
.search input::placeholder { color: var(--faint); }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.search .clear {
  position: absolute; right: 12px; border: 0; background: var(--surface-2); color: var(--muted);
  width: 26px; height: 26px; border-radius: 50%; cursor: pointer; font-size: 15px;
  display: none; place-items: center; line-height: 1;
}
.search.has-value .clear { display: grid; }
.search .clear:hover { color: var(--ink); }

/* ------------------------------------------------------------- categories */
.cats-wrap { position: relative; margin: 20px 0 4px; }
.cats {
  margin: 0; display: flex; gap: 8px;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; -ms-overflow-style: none;
}
.cats::-webkit-scrollbar { display: none; }
/* fade the clipped edge so off-screen categories read as "more this way" */
.cats.can-right {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent);
}
.cats.can-left {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 44px);
  mask-image: linear-gradient(to right, transparent, #000 44px);
}
.cats.can-left.can-right {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 44px, #000 calc(100% - 44px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 44px, #000 calc(100% - 44px), transparent);
}
.cats-nudge {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 30px; height: 30px; border-radius: 50%; padding: 0;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  box-shadow: var(--shadow); cursor: pointer; display: none; place-items: center;
}
.cats-nudge.show { display: grid; }
.cats-nudge.left { left: -8px; }
.cats-nudge.right { right: -8px; }
.cats-nudge:hover { color: var(--accent); border-color: var(--accent); }
.cat {
  flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font-size: 13.5px; font-weight: 550; padding: 8px 14px; border-radius: 999px;
  cursor: pointer; white-space: nowrap; transition: all .15s ease;
}
.cat:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); color: var(--ink); }
.cat.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* --------------------------------------------------------------- articles */
.results-meta { margin: 22px 0 8px; font-size: 13px; color: var(--muted); }
.group-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700;
  color: var(--faint); margin: 26px 0 12px;
}
.group-title:first-child { margin-top: 4px; }
.articles { display: flex; flex-direction: column; gap: 10px; }

.article {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow); overflow: hidden;
}
.article-head {
  width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer;
  display: flex; align-items: center; gap: 14px; padding: 17px 18px; color: var(--ink);
}
.article-head .q { flex: 1; font-size: 15.5px; font-weight: 600; line-height: 1.4; }
.article-head .chev {
  flex: none; color: var(--faint); font-size: 15px; line-height: 1;
  transition: transform .28s ease;
}
.article.open .article-head .chev { transform: rotate(90deg); color: var(--accent); }
.article-head:hover .q { color: var(--accent-strong); }

/* smooth expand / collapse via grid rows */
.article-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s ease; }
.article.open .article-body { grid-template-rows: 1fr; }
.article-body > .inner { overflow: hidden; min-height: 0; }
.article-copy {
  padding: 0 18px 20px; font-size: 14.8px; color: var(--text); line-height: 1.68;
  border-top: 1px solid var(--line-2); margin-top: 0; padding-top: 16px;
}
.article-copy p { margin: 0 0 12px; max-width: 68ch; }
.article-copy p:last-child { margin-bottom: 0; }
.article-copy strong { color: var(--ink); font-weight: 650; }
.article-copy ul { margin: 4px 0 14px; padding-left: 20px; }
.article-copy li { margin-bottom: 6px; }
.article-copy .lvl { color: var(--accent-strong); font-weight: 650; }
mark {
  background: color-mix(in srgb, var(--warn) 26%, transparent); color: inherit;
  border-radius: 3px; padding: 0 1px;
}

.noresults {
  display: none; text-align: center; padding: 48px 20px; color: var(--muted);
  border: 1px dashed var(--line); border-radius: var(--r-lg); background: var(--surface-2);
}
.noresults.show { display: block; }
.noresults h3 { font-size: 1.05rem; margin-bottom: 6px; }
.noresults .cta {
  margin-top: 14px; display: inline-flex; gap: 7px; align-items: center;
  background: var(--accent); color: #fff; border: 0; border-radius: 10px;
  padding: 10px 15px; font-size: 13.5px; font-weight: 600; cursor: pointer;
}

/* ==================================================================== chat
   The docked Nuqta Assistant. It sits in the layout, not in a corner bubble.
   ========================================================================= */
/* Floating popup, opened by the launcher bubble. */
.chat-rail {
  position: fixed; right: 24px; bottom: 96px; z-index: 70;
  width: 380px; max-width: calc(100vw - 32px);
  opacity: 0; transform: translateY(14px) scale(0.98); pointer-events: none;
  /* visibility, not just opacity: an opacity-0 layer is still painted, and on
     iOS Safari the panel's 1px border bled through as a hairline down the
     left of the screen. Delayed so the close animation still runs. */
  visibility: hidden;
  transition: opacity .22s ease, transform .22s cubic-bezier(0.25, 1, 0.5, 1),
              visibility 0s linear .22s;
}
.chat-rail.open {
  opacity: 1; transform: none; pointer-events: auto;
  visibility: visible; transition-delay: 0s;
}
@media (max-width: 560px) {
  .chat-rail { right: 12px; left: 12px; bottom: 84px; width: auto; max-width: none; }
}

/* Maximised: the conversation takes the screen, so long threads, forms and
   screenshots have room. The header keeps the same controls. */
.chat-rail.max {
  top: 24px; right: 24px; bottom: 24px; left: 24px;
  width: auto; max-width: 900px; margin-inline: auto;
}
.chat-rail.max .chat { height: 100%; }
/* the launcher sits under the maximised panel, so the header chevron closes */
body.chat-open.chat-max .launcher { display: none; }
body.chat-open.chat-max { overflow: hidden; }
@media (max-width: 560px) {
  .chat-rail.max { top: 0; right: 0; bottom: 0; left: 0; max-width: none; }
  .chat-rail.max .chat { border-radius: 0; border-left: 0; border-right: 0; height: 100%; }
  /* clear the notch and the home indicator */
  .chat-rail.max .chat-head { padding-top: calc(13px + env(safe-area-inset-top)); }
  .chat-rail.max .consent { margin-bottom: calc(10px + env(safe-area-inset-bottom)); }
}

.chat {
  display: flex; flex-direction: column;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-xl); box-shadow: var(--shadow-lg); overflow: hidden;
  height: min(560px, calc(100vh - 140px));
  height: min(560px, calc(100dvh - 140px));
}
@media (max-width: 560px) { .chat { height: min(72vh, calc(100vh - 108px)); height: min(72dvh, calc(100dvh - 108px)); } }

/* Launcher bubble, bottom-right, in the Nuqta teal. */
.launcher {
  position: fixed; right: 24px; bottom: 24px; z-index: 71;
  width: 60px; height: 60px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--accent); color: #fff; display: grid; place-items: center;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 45%, transparent), 0 2px 6px rgba(0,0,0,.15);
  transition: transform .2s ease;
}
.launcher:hover { transform: scale(1.05); }
.launcher:active { transform: scale(0.97); }
.launcher svg { position: absolute; width: 26px; height: 26px; transition: opacity .2s ease, transform .3s cubic-bezier(0.25,1,0.5,1); }
.launcher .launcher-close { opacity: 0; transform: rotate(-90deg) scale(0.6); }
.launcher.open .launcher-open { opacity: 0; transform: rotate(90deg) scale(0.6); }
.launcher.open .launcher-close { opacity: 1; transform: none; }
@media (max-width: 560px) { .launcher { right: 16px; bottom: 16px; width: 56px; height: 56px; } }
/* While the chat is open on a phone, the page behind must not scroll —
   without this, gestures at the message list's edges chain to the body. */
@media (max-width: 560px) {
  body.chat-open { overflow: hidden; }
}

.chat-head {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 15px; background: var(--surface); border-bottom: 1px solid var(--line-2);
}
.chat-logo { display: grid; place-items: center; flex: none; width: 42px; height: 42px; }
.chat-logo img { height: 16px; width: auto; display: block; }
.chat-title { min-width: 0; margin-right: auto; }
.chat-title .name { font-weight: 650; color: var(--ink); font-size: 14.5px; line-height: 1.15; }
.chat-title .sub {
  font-size: 11.5px; color: var(--muted); margin-top: 2px;
  display: flex; align-items: center; gap: 6px;
}
.chat-title .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); flex: none; }
.chat-reset {
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 9px; padding: 6px 10px; font-size: 12px; cursor: pointer; font-weight: 550;
}
.chat-reset:hover { color: var(--ink); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.chat-min {
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  width: 30px; height: 30px; border-radius: 9px; cursor: pointer; font-size: 12px;
  display: grid; place-items: center; flex: none; line-height: 1;
  transition: transform .2s ease;
}
.chat-min:hover { color: var(--ink); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.chat-max {
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  width: 30px; height: 30px; border-radius: 9px; cursor: pointer;
  display: grid; place-items: center; flex: none; padding: 0;
}
.chat-max:hover { color: var(--ink); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.chat-max svg { width: 14px; height: 14px; display: block; grid-area: 1 / 1; }
.chat-max .ic-min { display: none; }
.chat-rail.max .chat-max .ic-max { display: none; }
.chat-rail.max .chat-max .ic-min { display: block; }
.chat.min .chat-max { display: none; }
.chat.min { height: auto; min-height: 0; max-height: none; }
.chat.min .chat-scroll, .chat.min .composer, .chat.min .consent, .chat.min .chat-reset { display: none; }
.chat.min .chat-head { cursor: pointer; }
.chat.min .chat-min { transform: rotate(180deg); }

.chat-scroll {
  flex: 1; overflow-y: auto; padding: 16px 14px 8px;
  display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth;
  overscroll-behavior: contain;
}
.chat-scroll::-webkit-scrollbar { width: 8px; }
.chat-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
/* soft bottom fade while more of the conversation sits below the fold */
.chat-scroll.can-down {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent);
}

.greet {
  text-align: center; font-size: 12.5px; color: var(--muted); padding: 2px 14px 2px;
}

.msg-list { display: flex; flex-direction: column; gap: 10px; }

.bubble-row { display: flex; flex-direction: column; gap: 3px; }
.bubble {
  max-width: 90%; padding: 11px 14px; border-radius: 16px;
  font-size: 14px; line-height: 1.5; word-wrap: break-word; overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.bubble.agent, .bubble.system {
  align-self: flex-start; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-2); border-bottom-left-radius: 5px;
}
.bubble.system {
  background: var(--accent-wash); border-color: color-mix(in srgb, var(--accent) 22%, var(--line-2));
  color: var(--text); font-size: 13.5px;
}
.bubble.visitor {
  align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 5px;
}
.bubble .shots { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.bubble .shots img { width: 74px; height: 74px; object-fit: cover; border-radius: 8px; }
.meta {
  font-size: 10.5px; color: var(--faint); padding: 0 4px;
}
.bubble-row.mine .meta { align-self: flex-end; }

/* quick reply pills */
.pills-intro { font-size: 12px; color: var(--faint); font-weight: 600; margin: 4px 4px 0; }
.pills { display: flex; flex-direction: column; gap: 8px; }
.pill {
  text-align: left; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 11px 14px; font-size: 13px; color: var(--ink);
  cursor: pointer; display: flex; align-items: center; gap: 9px; transition: all .15s ease;
}
.pill:hover { border-color: var(--accent); background: var(--accent-wash); }
.pill .emoji { font-size: 15px; line-height: 1; flex: none; }
.pill .h { color: var(--muted); font-weight: 400; font-size: 12px; }

/* pre chat and bug forms */
.form-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 15px; box-shadow: var(--shadow);
}
.form-card .fh {
  display: flex; align-items: center; gap: 8px; font-weight: 650; color: var(--ink); font-size: 14.5px;
}
.form-card .fsub { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.field-label { font-size: 12px; color: var(--muted); font-weight: 600; margin: 14px 0 6px; }
.field {
  width: 100%; font: inherit; font-size: 14px; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px;
}
.field::placeholder { color: var(--faint); }
.field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); background: var(--surface); }
textarea.field { resize: vertical; min-height: 76px; line-height: 1.5; }
.field-err { font-size: 11.5px; color: var(--crit); margin-top: 6px; display: none; }
.field-err.show { display: block; }

.bug-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.bug-chip {
  font-size: 12.5px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); cursor: pointer; transition: all .14s ease;
}
.bug-chip:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.bug-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 560; }

.dropzone {
  margin-top: 8px; border: 1.5px dashed var(--line); border-radius: 10px; padding: 14px;
  font-size: 12.5px; color: var(--muted); text-align: center; cursor: pointer; background: var(--surface-2);
}
.dropzone:hover { border-color: var(--accent); color: var(--accent-strong); }
.shot-previews { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.shot-thumb { position: relative; width: 62px; height: 62px; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); }
.shot-thumb img { width: 100%; height: 100%; object-fit: cover; }
.shot-thumb .rm {
  position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff; border: 0; cursor: pointer; font-size: 12px;
  display: grid; place-items: center; line-height: 1;
}
.shot-thumb.busy::after {
  content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.35);
  background-image: linear-gradient(90deg, transparent, rgba(255,255,255,.25), transparent);
  background-size: 200% 100%; animation: shimmer 1.1s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.btn-row { display: flex; gap: 8px; margin-top: 14px; }
.btn {
  flex: 1; border: 0; border-radius: 10px; padding: 11px; font-size: 13.5px; font-weight: 600;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-primary:disabled { opacity: .55; cursor: default; }
.btn-ghost { flex: 0 0 auto; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.btn-ghost:hover { color: var(--ink); }

/* composer */
.composer {
  margin: 8px; border: 1.5px solid var(--line); border-radius: 16px;
  padding: 8px 8px 8px 14px; display: flex; align-items: flex-end; gap: 8px;
  background: var(--surface); transition: border-color .15s ease;
}
.composer:focus-within { border-color: var(--accent); }
.composer-tools { display: flex; padding: 8px 12px 0; }
.bug-entry {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 999px; background: transparent;
  color: var(--muted); font: inherit; font-size: 12px; font-weight: 600;
  padding: 5px 12px; cursor: pointer; min-height: 28px;
}
.bug-entry:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-wash); }
.composer textarea {
  flex: 1; border: 0; background: transparent; resize: none; font: inherit; font-size: 14px;
  color: var(--ink); max-height: 120px; padding: 7px 0; line-height: 1.45;
}
.composer textarea:focus { outline: none; }
.composer textarea::placeholder { color: var(--faint); }
.composer .send {
  flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--accent);
  cursor: pointer; display: grid; place-items: center;
}
.composer .send:disabled { opacity: .4; cursor: default; }
.composer .send svg { display: block; }

.consent {
  margin: 0 8px 10px; background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 11px; padding: 9px 12px; font-size: 10.6px; line-height: 1.5; color: var(--muted);
}

/* subtle entrance for freshly added bubbles */
@media (prefers-reduced-motion: no-preference) {
  .bubble-row { animation: rise .22s ease; }
  @keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
  .article, .cat, .pill { transition: all .15s ease; }
}

/* -------------------------------------------------------------- footer bar */
.foot {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px 48px;
  color: var(--muted); font-size: 12.5px;
}
.foot a { color: var(--accent-strong); }


/* =========================================================================
   Categories on small screens
   Nine topics behind a sideways swipe means most of the navigation is
   invisible, and wrapping them costs roughly a third of the viewport. On
   phones the strip is replaced by the platform's own picker: one row, one
   tap, and the native wheel that people already know. The chips stay on
   larger screens where they all fit.
   ========================================================================= */
.cats-select { display: none; }

/* Above the phone breakpoint the chips stay, but they wrap. The full strip
   needs about 1385px, so on any normal laptop it used to scroll sideways and
   slice a topic through the middle. Wrapping costs one extra row and puts
   every topic on screen. */
@media (min-width: 701px) {
  .cats {
    flex-wrap: wrap;
    overflow: visible;
    row-gap: 8px;
    -webkit-mask-image: none !important;
    mask-image: none !important;
  }
  .cats > * { flex: 0 0 auto; }
  .cats-nudge { display: none !important; }
}

@media (max-width: 700px) {
  .cats-wrap { display: none; }

  .cats-select {
    display: block; width: 100%; margin: 20px 0 4px;
    min-height: 44px; padding: 11px 40px 11px 14px;
    font-family: inherit; font-size: 15px; font-weight: 500;
    color: var(--ink); background-color: var(--surface);
    border: 1px solid var(--line); border-radius: var(--r);
    -webkit-appearance: none; appearance: none;
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 11px 7px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' fill='none' stroke='%236C757D' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
  .cats-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
}

/* =========================================================================
   Chat: arriving replies and jump to latest
   The reveal is presentation only. A reply from the team arrives complete
   over the poll, and is written out word by word so a new answer catches the
   eye instead of appearing fully formed between blinks.
   ========================================================================= */
.bubble-text { white-space: pre-wrap; }

.bubble-row.is-arriving .bubble::after {
  content: ""; display: inline-block; vertical-align: text-bottom;
  width: 2px; height: 1em; margin-left: 2px;
  background: currentColor; opacity: .55;
  animation: chat-caret 1s steps(2, start) infinite;
}
@keyframes chat-caret { 50% { opacity: 0; } }

.chat-jump {
  position: absolute; left: 50%; bottom: 84px; z-index: 5;
  transform: translate(-50%, 6px);
  width: 34px; height: 34px; padding: 0;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--surface); color: var(--muted);
  box-shadow: var(--shadow); cursor: pointer;
  opacity: 0; pointer-events: none;
  transition: opacity .22s ease, transform .22s cubic-bezier(.25,1,.5,1), color .2s ease;
}
.chat-jump.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.chat-jump:hover { color: var(--accent); border-color: var(--accent); }
.chat-jump svg { width: 17px; height: 17px; }

@media (prefers-reduced-motion: reduce) {
  .bubble-row.is-arriving .bubble::after { animation: none; }
  .chat-jump { transition: none; }
}
