/* ==========================================================================
   FixDesk stylesheet
   Colours are CSS custom properties; Admin > Settings > Appearance overrides
   them through a small <style> block printed by the layouts.
   ========================================================================== */

@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900; src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2-variations"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900; src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-display: swap; font-weight: 200 800; src: url("../fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2-variations"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-display: swap; font-weight: 200 800; src: url("../fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2") format("woff2-variations"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;

  /* brand */
  --brand: #3A3FD1;
  --brand-hover: #2F33B4;
  --brand-ink: #3A3FD1;          /* brand used as text */
  --brand-soft: #EDEEFC;
  --brand-soft-2: #DCDEFA;
  --accent: #CF480C;              /* ember, decorative + text on light */
  --accent-fill: #B53D08;         /* AA fill for buttons, white text */
  --accent-fill-hover: #9C3406;
  --accent-soft: #FDEFE7;
  --accent-ink: #B53D08;

  /* neutrals */
  --bg: #F5F6FA;
  --bg-alt: #EEF0F7;
  --surface: #FFFFFF;
  --surface-2: #F8F9FC;
  --surface-3: #F0F2F8;
  --border: #E2E5EE;
  --border-strong: #CED3E0;
  --text: #141831;
  --text-2: #444B69;
  --muted: #6A7090;
  --faint: #9AA0B8;
  --invert-bg: #141831;
  --invert-text: #FFFFFF;

  /* semantic */
  --ok: #1D7F4A;  --ok-soft: #E6F4EC;
  --warn: #9A5B00; --warn-soft: #FFF3DC;
  --bad: #C2302B; --bad-soft: #FDECEB;
  --info: #2C64C9; --info-soft: #E8F0FD;

  /* charts */
  --c1: #3A3FD1; --c2: #CF480C; --c3: #8E94B4; --c4: #A5A9EE;

  --shadow-sm: 0 1px 2px rgba(20,24,49,.06);
  --shadow: 0 1px 2px rgba(20,24,49,.05), 0 4px 14px rgba(20,24,49,.06);
  --shadow-lg: 0 2px 6px rgba(20,24,49,.06), 0 18px 40px rgba(20,24,49,.12);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --header-h: 68px;
  --container: 1200px;
  color-scheme: light;
}

[data-theme="dark"] {
  --brand: #4C52E6;
  --brand-hover: #5D63F0;
  --brand-ink: #9A9EFF;
  --brand-soft: #1E2350;
  --brand-soft-2: #2A3070;
  --accent: #F0814F;
  --accent-fill: #B53D08;
  --accent-fill-hover: #C9470C;
  --accent-soft: #3A2116;
  --accent-ink: #F49A70;

  --bg: #0B1020;
  --bg-alt: #0F1528;
  --surface: #141A2E;
  --surface-2: #181F36;
  --surface-3: #1E2640;
  --border: #252E4A;
  --border-strong: #333E60;
  --text: #E8EAF6;
  --text-2: #B9BEDA;
  --muted: #8C93B4;
  --faint: #626A8C;
  --invert-bg: #E8EAF6;
  --invert-text: #0B1020;

  --ok: #5CC98C;  --ok-soft: #12301F;
  --warn: #F2B544; --warn-soft: #33270E;
  --bad: #FF7B72; --bad-soft: #3A1717;
  --info: #79A6FF; --info-soft: #15264A;

  --c1: #7479F5; --c2: #F0814F; --c3: #5B6386; --c4: #3D4396;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 6px 16px rgba(0,0,0,.25);
  --shadow-lg: 0 2px 8px rgba(0,0,0,.4), 0 20px 44px rgba(0,0,0,.45);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font-ui); font-size: 15px; line-height: 1.55;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg { max-width: 100%; }
img { display: block; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--text); margin: 0 0 .5em; line-height: 1.2; letter-spacing: -.015em; }
h1 { font-size: 40px; font-weight: 800; }
h2 { font-size: 28px; font-weight: 750; }
h3 { font-size: 18px; font-weight: 700; }
h4 { font-size: 15px; font-weight: 700; }
p { margin: 0 0 1em; color: var(--text-2); }
small, .small { font-size: 13px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 13px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
.bi { line-height: 1; vertical-align: -.125em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.ml-auto { margin-left: auto; }
.mt-0{margin-top:0}.mt-1{margin-top:4px}.mt-2{margin-top:8px}.mt-3{margin-top:12px}.mt-4{margin-top:16px}.mt-6{margin-top:24px}.mt-8{margin-top:32px}
.mb-0{margin-bottom:0}.mb-2{margin-bottom:8px}.mb-3{margin-bottom:12px}.mb-4{margin-bottom:16px}.mb-6{margin-bottom:24px}
.grid { display: grid; gap: 20px; }
.g-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- buttons ---------- */
.btn {
  --h: 40px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 16px; border-radius: var(--radius-sm);
  font: 600 14px/1 var(--font-ui); white-space: nowrap; cursor: pointer;
  border: 1px solid transparent; background: var(--surface); color: var(--text);
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
  text-decoration: none !important;
}
.btn .bi { font-size: 16px; }
.btn-primary { background: var(--brand); color: var(--on-brand, #fff); box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 1px 2px rgba(20,24,49,.2); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-accent { background: var(--accent-fill); color: var(--on-accent, #fff); box-shadow: 0 1px 2px rgba(20,24,49,.2); }
.btn-accent:hover { background: var(--accent-fill-hover); }
.btn-outline { border-color: var(--border-strong); background: var(--surface); color: var(--text); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand-ink); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-soft { background: var(--brand-soft); color: var(--brand-ink); }
.btn-soft:hover { background: var(--brand-soft-2); }
.btn-danger { background: var(--bad-soft); color: var(--bad); }
.btn-ok { background: var(--ok); color: #fff; }
[data-theme="dark"] .btn-ok { color: #0B1020; }
.btn-sm { --h: 36px; padding: 0 12px; font-size: 13px; }
.btn-xs { --h: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 6px; }
.btn-lg { --h: 50px; padding: 0 24px; font-size: 15.5px; border-radius: var(--radius); }
.btn-block { width: 100%; }
.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center; flex: none;
  border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent;
  color: var(--text-2); cursor: pointer; font-size: 18px; position: relative;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.bordered { border-color: var(--border); background: var(--surface); }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); }
.theme-toggle .bi-sun { display: none; }
[data-theme="dark"] .theme-toggle .bi-sun { display: inline-block; }
[data-theme="dark"] .theme-toggle .bi-moon-stars { display: none; }

/* ---------- forms ---------- */
label, .label { display: block; font-weight: 600; font-size: 13.5px; color: var(--text); margin-bottom: 6px; }
.req { color: var(--accent-ink); }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.input, select.input, textarea.input {
  width: 100%; height: 42px; padding: 0 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: 400 14.5px var(--font-ui); transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 120px; padding: 10px 12px; line-height: 1.55; resize: vertical; }
select.input { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='%238C93B4' d='M1.6 5.2a.75.75 0 0 1 1.06 0L8 10.5l5.34-5.3a.75.75 0 1 1 1.06 1.06l-5.87 5.83a.75.75 0 0 1-1.06 0L1.6 6.27a.75.75 0 0 1 0-1.06Z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input::placeholder { color: var(--faint); }
.input-icon { position: relative; }
.input-icon > .bi { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon > .input { padding-left: 38px; }
.field { margin-bottom: 18px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; font-size: 14px; color: var(--text-2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: none; margin: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 22px; background: var(--border-strong); cursor: pointer; transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(18px); }
.input-group { display: flex; }
.input-group .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); min-width: 0; }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; height: 42px; }
.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 22px; text-align: center;
  background: var(--surface-2); color: var(--muted); font-size: 14px;
}
.dropzone .bi { font-size: 26px; color: var(--brand-ink); display: block; margin-bottom: 6px; }
.file-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 13px; color: var(--text-2); max-width: 100%; }
.file-chip .bi { color: var(--brand-ink); }

/* ---------- cards / surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h3 { margin: 0; font-size: 15.5px; }
.card-head .sub { font-size: 13px; color: var(--muted); }
.card-body { padding: 20px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.divider-list > * + * { border-top: 1px solid var(--border); }

/* ---------- badges / chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.badge .bi { font-size: 12px; }
.badge.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-brand { background: var(--brand-soft); color: var(--brand-ink); }
.b-accent { background: var(--accent-soft); color: var(--accent-ink); }
.b-ok { background: var(--ok-soft); color: var(--ok); }
.b-warn { background: var(--warn-soft); color: var(--warn); }
.b-bad { background: var(--bad-soft); color: var(--bad); }
.b-info { background: var(--info-soft); color: var(--info); }
.b-outline { background: transparent; border: 1px solid var(--border-strong); color: var(--text-2); }
.tag { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; border-radius: 6px; font-size: 12.5px; font-weight: 500; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border); }
.prio { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.prio i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.prio.urgent i { background: var(--bad); } .prio.high i { background: var(--accent); } .prio.normal i { background: var(--brand); } .prio.low i { background: var(--faint); }
.sla { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.sla.ok { background: var(--ok-soft); color: var(--ok); }
.sla.due { background: var(--warn-soft); color: var(--warn); }
.sla.over { background: var(--bad-soft); color: var(--bad); }
.sla.met { background: var(--surface-3); color: var(--muted); }

/* ---------- avatars ---------- */
.av { width: 36px; height: 36px; border-radius: 50%; flex: none; object-fit: cover; display: inline-grid; place-items: center; font: 700 13px var(--font-ui); color: #fff; background: var(--brand); position: relative; }
.av.sm { width: 28px; height: 28px; font-size: 11px; }
.av.xs { width: 22px; height: 22px; font-size: 9.5px; }
.av.lg { width: 48px; height: 48px; font-size: 16px; }
.av.xl { width: 72px; height: 72px; font-size: 24px; }
.av.a1 { background: #3A3FD1; } .av.a2 { background: #B53D08; } .av.a3 { background: #5B4B8A; } .av.a4 { background: #2F5E9E; } .av.a5 { background: #8A3B5C; } .av.a6 { background: #4A5470; }
.av-wrap { position: relative; display: inline-block; flex: none; }
.av-wrap .presence { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--ok); border: 2px solid var(--surface); }
.av-wrap .presence.away { background: var(--warn); }
.av-stack { display: flex; }
.av-stack > * { border: 2px solid var(--surface); margin-left: -8px; }
.av-stack > *:first-child { margin-left: 0; }

/* ---------- logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font: 800 20px var(--font-head); letter-spacing: -.02em; text-decoration: none !important; flex: none; }
.logo svg { width: 32px; height: 32px; flex: none; }
.logo b { color: var(--brand-ink); font-weight: 800; }

/* ==========================================================================
   PUBLIC LAYOUT
   ========================================================================== */
.site-header { position: sticky; top: 0; z-index: 50; height: var(--header-h); background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header .container { max-width: 1320px; height: 100%; display: flex; align-items: center; gap: 28px; }
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a, .main-nav .more-btn { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 550; font-size: 14.5px; white-space: nowrap; background: none; border: 0; cursor: pointer; font-family: inherit; text-decoration: none; }
.main-nav a:hover, .main-nav .more-btn:hover { background: var(--surface-3); color: var(--text); }
.main-nav a.active { color: var(--brand-ink); background: var(--brand-soft); }
.main-nav .more { display: none; position: relative; }
.header-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; min-width: 0; }
.header-tools > * { flex: none; }
.header-tools > .header-search { width: 240px; flex: 0 1 240px; min-width: 180px; container-type: inline-size; }
@container (max-width: 210px) { .header-search .kbd { display: none; } }
.header-search .input { height: 38px; background: var(--surface-2); font-size: 14px; }
.header-search-btn { display: none; }
.kbd { font: 600 11px var(--font-ui); color: var(--muted); border: 1px solid var(--border); border-radius: 5px; padding: 2px 6px; background: var(--surface); }
.header-search .kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
.burger { display: none; }

/* dropdown */
.dd { position: relative; }
.dd-menu { position: absolute; top: calc(100% + 8px); right: 0; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; display: none; z-index: 60; }
.dd.open > .dd-menu { display: block; }
.dd-menu a, .dd-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 6px; color: var(--text-2); font-size: 14px; font-weight: 500; background: none; border: 0; text-align: left; cursor: pointer; font-family: inherit; text-decoration: none; }
.dd-menu a:hover, .dd-menu button:hover { background: var(--surface-3); color: var(--text); }
.dd-menu .bi { color: var(--muted); font-size: 16px; }
.dd-menu .dd-sep { height: 1px; background: var(--border); margin: 6px 0; }
.dd-menu .dd-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 10px 4px; }

/* mobile drawer (public) */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(11,16,32,.5); z-index: 90; display: none; }
.mobile-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(340px, 88vw); background: var(--surface); z-index: 100; transform: translateX(105%); transition: transform .22s ease; display: flex; flex-direction: column; border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.nav-open .mobile-drawer { transform: none; }
.nav-open .drawer-backdrop { display: block; }
.mobile-drawer .drawer-head { height: 60px; display: flex; align-items: center; padding: 0 12px 0 20px; border-bottom: 1px solid var(--border); }
.mobile-drawer nav { padding: 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.mobile-drawer nav a { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 8px; color: var(--text); font-weight: 550; }
.mobile-drawer nav a .bi { color: var(--muted); font-size: 18px; }
.mobile-drawer nav a.active { background: var(--brand-soft); color: var(--brand-ink); }
.mobile-drawer .drawer-foot { margin-top: auto; padding: 16px; border-top: 1px solid var(--border); display: grid; gap: 10px; }

/* install banner */
.install-bar { background: var(--invert-bg); color: var(--invert-text); font-size: 13.5px; }
.install-bar .container { max-width: 1320px; display: flex; align-items: center; gap: 12px; min-height: 44px; padding-top: 6px; padding-bottom: 6px; }
.install-bar .app-ico { width: 26px; height: 26px; flex: none; }
.install-bar p { margin: 0; color: inherit; opacity: .92; }
.install-bar .btn { --h: 30px; font-size: 12.5px; padding: 0 12px; background: var(--surface); color: var(--text); }
[data-theme="dark"] .install-bar .btn { background: var(--bg); color: var(--text); }
.install-bar .close { color: inherit; opacity: .7; width: 32px; height: 32px; }
.install-bar .close:hover { background: rgba(127,127,127,.2); color: inherit; }
.install-bar.hidden { display: none; }

/* sections */
.section { padding: 88px 0; }
.section-sm { padding: 56px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 12px; }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head.center { text-align: center; margin-left: auto; margin-right: auto; }
.section-head h2 { font-size: 34px; }
.section-head p { font-size: 16.5px; }
.section-head.mb-0 { margin-bottom: 0; }
.lead { font-size: 18px; color: var(--text-2); }

/* hero */
.hero { position: relative; background: var(--surface); border-bottom: 1px solid var(--border); overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px); background-size: 48px 48px; opacity: .45; -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%); mask-image: linear-gradient(180deg, #000 0%, transparent 85%); }
.hero .container { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; padding-top: 80px; padding-bottom: 88px; }
.hero h1 { font-size: 54px; line-height: 1.06; letter-spacing: -.03em; margin-bottom: 18px; }
.hero h1 em { font-style: normal; color: var(--brand-ink); }
.hero .lead { max-width: 540px; margin-bottom: 28px; }
.hero-search { display: flex; align-items: center; gap: 8px; padding: 8px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: var(--shadow); max-width: 580px; }
.hero-search > .bi { font-size: 20px; color: var(--muted); margin-left: 10px; }
.hero-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 400 16px var(--font-ui); color: var(--text); height: 44px; }
.hero-search input::placeholder { color: var(--faint); }
.hero-popular { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13.5px; color: var(--muted); }
.hero-popular a { padding: 4px 10px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-weight: 500; border: 1px solid var(--border); }
.hero-trust { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 32px; font-size: 13.5px; color: var(--text-2); }
.hero-trust span { display: inline-flex; align-items: center; gap: 8px; }
.hero-trust .bi { color: var(--brand-ink); font-size: 16px; }

/* hero visual (product composition) */
.hero-visual { position: relative; min-height: 520px; }
.hv-card { position: absolute; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.hv-main { top: 0; left: 0; right: 40px; padding: 0; }
.hv-main .hv-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.hv-msg { display: flex; gap: 12px; padding: 16px 18px; }
.hv-msg + .hv-msg { border-top: 1px solid var(--border); }
.hv-msg p { margin: 4px 0 0; font-size: 14px; }
.hv-msg.agent { background: var(--surface-2); }
.hv-csat { right: 0; bottom: 30px; width: 260px; padding: 16px 18px; }
.hv-sla { left: -24px; bottom: 0; width: 230px; padding: 14px 16px; }
.stars { display: inline-flex; gap: 3px; color: #E8A317; font-size: 16px; }
.stars .off { color: var(--border-strong); }
.meter { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.meter.accent > i { background: var(--accent); }
.meter.ok > i { background: var(--ok); }
.meter.warn > i { background: var(--warn); }
.meter.bad > i { background: var(--bad); }

/* categories */
.cat-card { display: flex; flex-direction: column; gap: 6px; padding: 22px; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; text-decoration: none !important; }
.cat-card:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.cat-ico { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font-size: 20px; background: var(--brand-soft); color: var(--brand-ink); margin-bottom: 10px; }
.cat-ico.accent { background: var(--accent-soft); color: var(--accent-ink); }
.cat-card h3 { margin: 0; font-size: 16.5px; }
.cat-card p { margin: 0; font-size: 14px; }
.cat-card .meta { margin-top: 10px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

.article-list a { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: var(--text); font-weight: 550; font-size: 14.5px; text-decoration: none; }
.article-list a:hover { background: var(--surface-2); color: var(--brand-ink); }
.article-list a .bi-file-earmark-text { color: var(--muted); font-size: 17px; }
.article-list a .bi-chevron-right { margin-left: auto; color: var(--faint); font-size: 13px; }
.article-list a .views { margin-left: auto; font-size: 12.5px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.article-list a .views + .bi-chevron-right { margin-left: 8px; }

/* steps */
.step { padding: 26px; position: relative; }
.step .num { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font: 800 15px var(--font-head); background: var(--invert-bg); color: var(--invert-text); margin-bottom: 16px; }
.step h3 { font-size: 17px; }
.step p { margin: 0; font-size: 14.5px; }

/* stats band */
.stats-band { background: var(--invert-bg); color: var(--invert-text); border-radius: var(--radius-xl); padding: 44px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.stats-band .stat b { display: block; font: 800 38px var(--font-head); letter-spacing: -.02em; }
.stats-band .stat span { font-size: 14px; opacity: .75; }
[data-theme="dark"] .stats-band { background: var(--surface); color: var(--text); border: 1px solid var(--border); }

/* pricing */
.billing-toggle { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.billing-toggle button { height: 38px; padding: 0 18px; border-radius: 999px; border: 0; background: none; font: 600 14px var(--font-ui); color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.billing-toggle button.on { background: var(--brand); color: var(--on-brand, #fff); }
.billing-toggle .save { font-size: 11.5px; padding: 2px 7px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-ink); }
.billing-toggle button.on .save { background: rgba(255,255,255,.2); color: #fff; }
.plan { padding: 28px; display: flex; flex-direction: column; position: relative; }
.plan.featured { border: 2px solid var(--brand); box-shadow: var(--shadow-lg); }
.plan .ribbon { position: absolute; top: -13px; left: 28px; background: var(--brand); color: var(--on-brand, #fff); font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; }
.plan h3 { font-size: 19px; margin-bottom: 4px; }
.plan .price { display: flex; align-items: baseline; gap: 6px; margin: 18px 0 4px; }
.plan .price b { font: 800 44px var(--font-head); letter-spacing: -.03em; color: var(--text); }
.plan .price span { color: var(--muted); font-size: 14.5px; }
.plan .price-note { font-size: 13px; color: var(--muted); min-height: 20px; }
.plan ul { list-style: none; padding: 0; margin: 22px 0 26px; display: grid; gap: 11px; font-size: 14.5px; color: var(--text-2); }
.plan li { display: flex; gap: 10px; align-items: flex-start; }
.plan li .bi { color: var(--brand-ink); font-size: 16px; margin-top: 2px; }
.plan li.off { color: var(--faint); }
.plan li.off .bi { color: var(--faint); }
.plan .btn { margin-top: auto; }
.yearly-only { display: none; }
.is-yearly .yearly-only { display: inline; }
.is-yearly .monthly-only { display: none; }
.renew-note { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; color: var(--text-2); }
.renew-note .bi { color: var(--brand-ink); }

/* comparison table */
.compare { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.compare th, .compare td { padding: 14px 18px; border-bottom: 1px solid var(--border); text-align: center; }
.compare th:first-child, .compare td:first-child { text-align: left; color: var(--text); }
.compare thead th { font: 700 15px var(--font-head); background: var(--surface-2); }
.compare tr.group td { background: var(--surface-2); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); text-align: left; }
.compare .bi-check-lg { color: var(--brand-ink); font-size: 18px; }
.compare .bi-dash { color: var(--faint); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* faq */
.faq details { border-bottom: 1px solid var(--border); }
.faq summary { list-style: none; cursor: pointer; padding: 18px 4px; font-weight: 650; font-size: 15.5px; display: flex; justify-content: space-between; gap: 16px; align-items: center; color: var(--text); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "\F4FE"; font-family: "bootstrap-icons"; color: var(--muted); font-weight: 400; transition: transform .15s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 4px 18px; margin: 0; }

/* CTA */
.cta { border-radius: var(--radius-xl); background: var(--brand); color: var(--on-brand, #fff); padding: 52px; display: flex; align-items: center; gap: 32px; position: relative; overflow: hidden; }
.cta::after { content: ""; position: absolute; right: -60px; top: -60px; width: 280px; height: 280px; border-radius: 50%; border: 48px solid rgba(255,255,255,.07); }
.cta h2 { color: var(--on-brand, #fff); font-size: 32px; margin-bottom: 8px; }
.cta p { color: rgba(255,255,255,.85); margin: 0; font-size: 16.5px; }
.cta .btn-white { background: #fff; color: #23278F; }
.cta .btn-line { border: 1px solid rgba(255,255,255,.45); color: var(--on-brand, #fff); background: transparent; }
.cta .btns { display: flex; gap: 12px; margin-left: auto; position: relative; z-index: 1; flex-wrap: wrap; }

/* footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 64px 0 28px; font-size: 14.5px; }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr) 1.4fr; gap: 32px; }
.site-footer h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.site-footer ul a { color: var(--text-2); }
.site-footer ul a:hover { color: var(--brand-ink); }
.social { display: flex; gap: 6px; flex-wrap: wrap; }
.social a { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; border: 1px solid var(--border); color: var(--text-2); font-size: 16px; background: var(--surface); text-decoration: none; }
.social a:hover { color: var(--on-brand, #fff); background: var(--brand); border-color: var(--brand); }
.app-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: var(--surface-2); }
.app-card .row { gap: 10px; }
.footer-bottom { margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--border); display: flex; gap: 16px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 13.5px; }
.footer-bottom .links { display: flex; gap: 18px; flex-wrap: wrap; margin-left: auto; }
.footer-bottom a { color: var(--muted); }
select.lang-select { height: 36px; width: auto; font-size: 13.5px; padding-left: 10px; }

/* page header (inner public pages) */
.page-hero { background: var(--surface); border-bottom: 1px solid var(--border); padding: 56px 0 48px; }
.page-hero.center { text-align: center; }
.page-hero h1 { font-size: 40px; margin-bottom: 10px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13.5px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--text-2); }
.crumbs .bi { font-size: 11px; }

/* KB article */
.kb-layout { display: grid; grid-template-columns: 240px minmax(0,1fr) 260px; gap: 40px; align-items: start; }
.toc { position: sticky; top: calc(var(--header-h) + 24px); font-size: 14px; }
.toc h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.toc a { display: block; padding: 7px 12px; color: var(--text-2); border-left: 2px solid var(--border); text-decoration: none; }
.toc a.active { color: var(--brand-ink); border-left-color: var(--brand); font-weight: 600; background: var(--brand-soft); border-radius: 0 6px 6px 0; }
.toc a.sub { padding-left: 24px; font-size: 13.5px; }
.prose { font-size: 16px; line-height: 1.75; color: var(--text-2); }
.prose h2 { font-size: 24px; margin: 40px 0 12px; scroll-margin-top: 90px; }
.prose h3 { font-size: 18px; margin: 28px 0 10px; }
.prose p { color: var(--text-2); margin-bottom: 1.1em; }
.prose ol, .prose ul { padding-left: 22px; margin: 0 0 1.2em; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--muted); font-weight: 600; }
.prose code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .86em; background: var(--surface-3); border: 1px solid var(--border); padding: 1px 6px; border-radius: 5px; color: var(--text); }
.prose strong { color: var(--text); }
.callout { display: flex; gap: 14px; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); margin: 20px 0; font-size: 15px; line-height: 1.6; }
.callout .bi { font-size: 18px; margin-top: 2px; }
.callout.info { background: var(--brand-soft); border-color: transparent; }
.callout.info .bi { color: var(--brand-ink); }
.callout.warn { background: var(--warn-soft); border-color: transparent; }
.callout.warn .bi { color: var(--warn); }
.callout p { margin: 0; color: var(--text); }
.shot { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); padding: 18px; margin: 20px 0; }
.helpful { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 22px 24px; }
.helpful .btn.on { background: var(--brand); color: var(--on-brand, #fff); border-color: var(--brand); }

/* chat widget */
.chat-launcher { position: fixed; right: 24px; bottom: 24px; width: 60px; height: 60px; border-radius: 50%; background: var(--brand); color: var(--on-brand, #fff); display: grid; place-items: center; font-size: 26px; border: 0; cursor: pointer; box-shadow: var(--shadow-lg); z-index: 70; }
.chat-widget { position: fixed; right: 24px; bottom: 96px; width: 380px; max-height: min(640px, calc(100vh - 120px)); background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; z-index: 71; }
.chat-widget.closed { display: none; }
.cw-head { background: var(--brand); color: var(--on-brand, #fff); padding: 18px 18px 16px; }
.cw-head h4 { color: var(--on-brand, #fff); margin: 0; font-size: 16px; }
.cw-head p { color: rgba(255,255,255,.82); margin: 2px 0 0; font-size: 13px; }
.cw-head .icon-btn { color: var(--on-brand, #fff); }
.cw-head .icon-btn:hover { background: rgba(255,255,255,.14); color: var(--on-brand, #fff); }
.cw-tabs { display: flex; gap: 4px; padding: 8px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.cw-tabs button { flex: 1; height: 34px; border: 0; border-radius: 8px; background: none; font: 600 13px var(--font-ui); color: var(--muted); cursor: pointer; }
.cw-tabs button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.cw-body { padding: 16px; overflow-y: auto; flex: 1; }
.cw-foot { border-top: 1px solid var(--border); padding: 10px; display: flex; gap: 8px; align-items: center; }
.cw-foot input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: 400 14px var(--font-ui); height: 38px; padding: 0 6px; }
.bubble { max-width: 82%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.5; }
.bubble.them { background: var(--surface-3); color: var(--text); border-bottom-left-radius: 4px; }
.bubble.me { background: var(--brand); color: var(--on-brand, #fff); border-bottom-right-radius: 4px; margin-left: auto; }
.msg-row { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 10px; }
.msg-row.me { justify-content: flex-end; }
.msg-time { font-size: 11.5px; color: var(--faint); margin: 2px 0 12px; }
.msg-row.me + .msg-time { text-align: right; }
.typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); opacity: .6; }
.sys-line { text-align: center; font-size: 12px; color: var(--muted); margin: 10px 0 14px; display: flex; align-items: center; gap: 10px; }
.sys-line::before, .sys-line::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* auth */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-side { background: var(--invert-bg); color: var(--invert-text); padding: 48px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
[data-theme="dark"] .auth-side { background: var(--surface); color: var(--text); border-right: 1px solid var(--border); }
.auth-side .logo { color: inherit; }
.auth-side .logo b { color: #A5A9FF; }
[data-theme="dark"] .auth-side .logo b { color: var(--brand-ink); }
.auth-side h2 { color: inherit; font-size: 34px; line-height: 1.15; max-width: 460px; }
.auth-side p { color: inherit; opacity: .78; max-width: 440px; }
.auth-quote { margin-top: auto; border-top: 1px solid rgba(127,127,127,.3); padding-top: 28px; }
.auth-quote blockquote { margin: 0 0 16px; font: 600 18px/1.5 var(--font-head); max-width: 480px; }
.auth-main { display: flex; flex-direction: column; padding: 32px 48px; background: var(--bg); }
.auth-main .top { display: flex; align-items: center; gap: 8px; }
.auth-form { width: 100%; max-width: 420px; margin: auto; padding: 32px 0; }
.auth-form h1 { font-size: 30px; }
.oauth { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 22px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-mini { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid rgba(127,127,127,.25); }
.auth-mini .bi { font-size: 20px; color: #A5A9FF; }
[data-theme="dark"] .auth-mini .bi { color: var(--brand-ink); }
.auth-mini b { display: block; font-size: 15px; }
.auth-mini span { font-size: 13.5px; opacity: .75; }

/* ==========================================================================
   APP LAYOUT (customer / agent / admin)
   ========================================================================== */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(to right, var(--surface) 0 251px, var(--border) 251px 252px, var(--bg) 252px); }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 80; }
.sidebar .sb-head { height: 64px; display: flex; align-items: center; padding: 0 18px; border-bottom: 1px solid var(--border); flex: none; gap: 8px; }
.sidebar .sb-head .logo { font-size: 19px; }
.sidebar .sb-head .logo svg { width: 30px; height: 30px; }
.sb-role { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 7px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-ink); margin-left: auto; }
.sb-nav { padding: 14px 12px; overflow-y: auto; flex: 1; }
.sb-group { font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); padding: 14px 10px 6px; }
.sb-group:first-child { padding-top: 2px; }
.sb-link { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 10px; border-radius: 8px; color: var(--text-2); font-weight: 550; font-size: 14.5px; text-decoration: none !important; white-space: nowrap; }
.sb-link .bi { font-size: 17px; color: var(--muted); width: 20px; text-align: center; flex: none; }
.sb-link:hover { background: var(--surface-3); color: var(--text); }
.sb-link.active { background: var(--brand-soft); color: var(--brand-ink); }
.sb-link.active .bi { color: var(--brand-ink); }
.sb-link .count { margin-left: auto; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); }
.sb-link.active .count { background: var(--brand); color: var(--on-brand, #fff); }
.sb-link .count.hot { background: var(--accent-fill); color: var(--on-accent, #fff); }
.sb-foot { border-top: 1px solid var(--border); padding: 14px; flex: none; }
.sb-plan { border-radius: var(--radius); padding: 14px; background: var(--brand-soft); }
.sb-plan b { color: var(--text); font-size: 14px; }
.sb-plan p { margin: 4px 0 10px; font-size: 12.5px; }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 8px; }
.sb-user b { display: block; font-size: 13.5px; color: var(--text); line-height: 1.3; }
.sb-user span { font-size: 12px; color: var(--muted); }
.sb-close { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 40; height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 28px; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar .page-title { font: 700 18px var(--font-head); color: var(--text); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .t-search { width: 320px; margin-left: auto; }
.topbar .t-search .input { height: 38px; background: var(--surface-2); font-size: 14px; }
.topbar .t-tools { display: flex; align-items: center; gap: 6px; }
.topbar .t-search + .t-tools { margin-left: 0; }
.t-tools .me { display: flex; align-items: center; gap: 8px; padding: 3px 4px 3px 3px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; margin-left: 6px; }
.t-tools .me span { font-size: 13.5px; font-weight: 600; color: var(--text); padding-right: 8px; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--text-2); background: var(--surface); white-space: nowrap; }
.status-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.app-burger { display: none; }
.content { padding: 28px; width: 100%; max-width: 1480px; }
.content.full { max-width: none; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: 26px; margin: 0 0 4px; }
.page-head p { margin: 0; color: var(--muted); }
.page-head .actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

/* KPI */
.kpi { padding: 20px; }
.kpi .k-top { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.kpi .k-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); font-size: 16px; }
.kpi .k-ico.accent { background: var(--accent-soft); color: var(--accent-ink); }
.kpi .k-ico.ok { background: var(--ok-soft); color: var(--ok); }
.kpi .k-ico.warn { background: var(--warn-soft); color: var(--warn); }
.kpi .k-val { font: 800 30px var(--font-head); letter-spacing: -.02em; margin: 14px 0 4px; color: var(--text); }
.kpi .k-val small { font-size: 15px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.kpi .k-delta { font-size: 13px; color: var(--muted); }
.up { color: var(--ok); font-weight: 700; }
.down { color: var(--bad); font-weight: 700; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button, .tabs a { height: 44px; padding: 0 14px; border: 0; background: none; font: 600 14px var(--font-ui); color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.tabs button:hover, .tabs a:hover { color: var(--text); }
.tabs .on { color: var(--brand-ink); border-bottom-color: var(--brand); }
.tabs .count { font-size: 11.5px; padding: 1px 7px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); }
.tabs .on .count { background: var(--brand-soft); color: var(--brand-ink); }
.tab-panel { display: none; }
.tab-panel.on { display: block; }
.seg { display: inline-flex; padding: 3px; background: var(--surface-3); border-radius: 8px; gap: 2px; }
.seg button { height: 32px; padding: 0 12px; border: 0; border-radius: 6px; background: none; font: 600 13px var(--font-ui); color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* data table */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 11px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl .t-main { color: var(--text); font-weight: 600; }
.tbl .t-sub { font-size: 12.5px; color: var(--muted); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl th.num { text-align: right; }
.tbl .chk { width: 40px; }
.tbl input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand); }
.tkt-subject { color: var(--text); font-weight: 600; display: block; }
.tkt-subject:hover { color: var(--brand-ink); }
.tkt-meta { font-size: 12.5px; color: var(--muted); }
.unread .tkt-subject::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); margin-right: 8px; vertical-align: 2px; }
.cell-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-user b { display: block; color: var(--text); font-weight: 600; font-size: 14px; }
.cell-user span:not(.av) { font-size: 12.5px; color: var(--muted); }

.toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.toolbar .input { height: 36px; font-size: 13.5px; }
.toolbar select.input { width: auto; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font: 600 13px var(--font-ui); cursor: pointer; white-space: nowrap; }
.filter-chip.on { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-soft); }
.pager { display: flex; align-items: center; gap: 6px; padding: 14px 16px; border-top: 1px solid var(--border); font-size: 13.5px; color: var(--muted); flex-wrap: wrap; }
.pager .pg { display: flex; gap: 4px; margin-left: auto; }
.pager .pg button { min-width: 34px; height: 34px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: 600 13px var(--font-ui); cursor: pointer; }
.pager .pg button.on { background: var(--brand); color: var(--on-brand, #fff); border-color: var(--brand); }

/* timeline / thread */
.thread { display: flex; flex-direction: column; gap: 16px; }
.post { display: flex; gap: 14px; }
.post .post-body { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.post .post-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.post .post-head b { color: var(--text); font-size: 14.5px; }
.post .post-head time { font-size: 12.5px; color: var(--muted); margin-left: auto; }
.post .post-text { padding: 16px 18px; font-size: 14.5px; line-height: 1.7; color: var(--text-2); }
.post .post-text p { margin: 0 0 .8em; }
.post .post-text p:last-child { margin: 0; }
.post .post-files { padding: 0 18px 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.post.staff .post-body { border-color: var(--brand-soft-2); }
.post.staff .post-head { background: var(--brand-soft); border-radius: var(--radius-lg) var(--radius-lg) 0 0; border-bottom-color: var(--brand-soft-2); }
.post.note .post-body { background: var(--warn-soft); border-color: transparent; }
.post.note .post-head { border-bottom-color: rgba(154,91,0,.15); }
.post.note .post-text { color: var(--text); }
.event-line { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); padding-left: 50px; }
.event-line .bi { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--surface-3); border: 1px solid var(--border); font-size: 12px; color: var(--text-2); }
.event-line b { color: var(--text-2); font-weight: 600; }

.composer { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.composer .tabs { padding: 0 12px; }
.composer textarea { border: 0; width: 100%; min-height: 130px; padding: 14px 18px; font: 400 14.5px/1.6 var(--font-ui); resize: vertical; background: transparent; color: var(--text); outline: none; }
.composer .c-tools { display: flex; align-items: center; gap: 4px; padding: 10px 12px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.composer .c-tools .icon-btn { width: 36px; height: 36px; font-size: 16px; }
.composer.note-mode { background: var(--warn-soft); }
.fmt-bar { display: flex; gap: 2px; padding: 6px 10px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.fmt-bar .icon-btn { width: 34px; height: 34px; font-size: 15px; }

.alert { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: var(--radius); font-size: 14px; border: 1px solid transparent; }
.alert .bi { font-size: 18px; flex: none; }
.alert.collision { background: var(--accent-soft); color: var(--text); border-color: rgba(207,72,12,.25); }
.alert.collision .bi { color: var(--accent-ink); }
.alert.info { background: var(--brand-soft); color: var(--text); }
.alert.info .bi { color: var(--brand-ink); }
.alert.warn { background: var(--warn-soft); color: var(--text); }
.alert.warn .bi { color: var(--warn); }
.alert.ok { background: var(--ok-soft); color: var(--text); }
.alert.ok .bi { color: var(--ok); }

/* side panel definition list */
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); margin: 0; }
.kv dd { margin: 0; color: var(--text); font-weight: 550; text-align: right; overflow-wrap: anywhere; }
.panel-sec { padding: 18px 20px; border-bottom: 1px solid var(--border); }
.panel-sec:last-child { border-bottom: 0; }
.panel-sec h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.panel-sec h4 a { margin-left: auto; text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 600; }
.timer { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); }
.timer + .timer { margin-top: 8px; }
.timer .t-ring { width: 40px; height: 40px; flex: none; }
.timer b { display: block; font-size: 14px; color: var(--text); }
.timer span { font-size: 12.5px; color: var(--muted); }

/* workspace (agent ticket / chat) */
.app.rail { grid-template-columns: 72px minmax(0, 1fr); background: linear-gradient(to right, var(--surface) 0 71px, var(--border) 71px 72px, var(--bg) 72px); }
.app.rail .sidebar .sb-head { padding: 0; justify-content: center; }
.app.rail .sidebar .logo span, .app.rail .sb-role, .app.rail .sb-group, .app.rail .sb-link span, .app.rail .sb-link .count, .app.rail .sb-user div { display: none; }
.app.rail .sb-nav { padding: 12px 10px; }
.app.rail .sb-link { justify-content: center; padding: 0; height: 44px; position: relative; }
.app.rail .sb-link .bi { font-size: 19px; }
.app.rail .sb-link .count.hot { display: block; position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 10.5px; line-height: 18px; }
.app.rail .sb-foot { padding: 12px 0; display: flex; justify-content: center; }
.app.rail .sb-user { padding: 0; }
.workspace { display: grid; grid-template-columns: 320px minmax(0, 1fr) 330px; height: calc(100vh - 64px); min-height: 640px; }
.ws-col { min-width: 0; overflow-y: auto; }
.ws-list { border-right: 1px solid var(--border); background: var(--surface); }
.ws-center { background: var(--bg); display: flex; flex-direction: column; }
.ws-side { border-left: 1px solid var(--border); background: var(--surface); }
.ws-list-head { padding: 14px 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.mini-tkt { display: block; padding: 14px 16px; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none !important; border-left: 3px solid transparent; }
.mini-tkt:hover { background: var(--surface-2); }
.mini-tkt.on { background: var(--brand-soft); border-left-color: var(--brand); }
.mini-tkt .r1 { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.mini-tkt .r1 time { margin-left: auto; }
.mini-tkt b { display: block; color: var(--text); font-size: 14px; margin: 4px 0 6px; font-weight: 600; line-height: 1.35; }
.mini-tkt .r3 { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ws-thread-head { padding: 16px 24px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 3; }
.ws-thread-head h2 { font-size: 19px; margin: 0; }
.ws-thread-body { padding: 20px 24px; flex: 1; }
.ws-mobile-tabs { display: none; }

/* chat console */
.chat-console .ws-center .conv { flex: 1; padding: 24px; overflow-y: auto; }
.chat-q { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none !important; border-left: 3px solid transparent; }
.chat-q:hover { background: var(--surface-2); }
.chat-q.on { background: var(--brand-soft); border-left-color: var(--brand); }
.chat-q b { color: var(--text); font-size: 14px; }
.chat-q p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.chat-q .when { font-size: 12px; color: var(--muted); margin-left: auto; white-space: nowrap; }
.wait { font-size: 11.5px; font-weight: 700; color: var(--accent-ink); }
.chat-console .bubble { max-width: 70%; }
.chat-input { background: var(--surface); border-top: 1px solid var(--border); padding: 12px 16px; }
.chat-input textarea { width: 100%; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text); font: 400 14.5px var(--font-ui); padding: 10px 12px; min-height: 64px; resize: none; outline: none; }
.chat-input textarea:focus { border-color: var(--brand); }

/* charts */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--font-ui); font-size: 11px; fill: var(--muted); }
.chart .grid-l { stroke: var(--border); stroke-width: 1; }
.chart .axis-l { stroke: var(--border-strong); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.donut-wrap { display: flex; align-items: center; gap: 24px; }
.donut-wrap svg { width: 150px; height: 150px; flex: none; }
.bar-row { display: grid; grid-template-columns: 130px minmax(0,1fr) 54px; gap: 12px; align-items: center; font-size: 13.5px; }
.bar-row + .bar-row { margin-top: 12px; }
.bar-row .num { text-align: right; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

/* settings */
.settings-layout { display: grid; grid-template-columns: 230px minmax(0,1fr); gap: 28px; align-items: start; }
.settings-nav { position: sticky; top: 88px; display: grid; gap: 2px; }
.settings-nav button { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 12px; border-radius: 8px; border: 0; background: none; font: 600 14px var(--font-ui); color: var(--text-2); cursor: pointer; text-align: left; white-space: nowrap; }
.settings-nav button .bi { color: var(--muted); font-size: 16px; }
.settings-nav button:hover { background: var(--surface-3); }
.settings-nav button.on { background: var(--surface); color: var(--brand-ink); box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.settings-nav button.on .bi { color: var(--brand-ink); }
.set-row { display: grid; grid-template-columns: 260px minmax(0,1fr); gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--border); }
.set-row:last-child { border-bottom: 0; }
.set-row .set-label b { display: block; color: var(--text); font-size: 14.5px; }
.set-row .set-label span { font-size: 13px; color: var(--muted); }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.swatch { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; background: var(--surface); cursor: pointer; }
.swatch.on { border: 2px solid var(--brand); padding: 9px; }
.swatch .sw-bar { display: flex; height: 40px; border-radius: 7px; overflow: hidden; margin-bottom: 8px; }
.swatch .sw-bar i { flex: 1; }
.swatch b { font-size: 13.5px; color: var(--text); display: flex; align-items: center; justify-content: space-between; }
.color-field { display: flex; align-items: center; gap: 10px; padding: 6px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); }
.color-field i { width: 30px; height: 30px; border-radius: 6px; flex: none; border: 1px solid rgba(0,0,0,.08); }
.color-field input { border: 0; outline: 0; background: transparent; color: var(--text); font: 500 14px ui-monospace, Menlo, monospace; width: 100%; min-width: 0; }
.theme-choice { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.theme-choice label { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; cursor: pointer; margin: 0; font-weight: 600; }
.theme-choice label.on { border: 2px solid var(--brand); padding: 9px; }
.theme-choice .prev { height: 70px; border-radius: 6px; margin-bottom: 8px; border: 1px solid var(--border); display: grid; grid-template-columns: 30% 1fr; overflow: hidden; }
.sn-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.sn-row:last-child { border-bottom: 0; }
.sn-row .handle { color: var(--faint); cursor: grab; font-size: 18px; touch-action: none; }
.sn-ico { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; font-size: 17px; color: #fff; flex: none; }
.sn-row .input { height: 38px; font-size: 13.5px; }
.icon-upload { width: 96px; height: 96px; border-radius: 20px; border: 1.5px dashed var(--border-strong); display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 12px; background: var(--surface-2); flex: none; }

/* misc */
.empty-ill { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); font-size: 24px; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 20px; }
.list-item + .list-item { border-top: 1px solid var(--border); }
.copy-field { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); }
.copy-field code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 13px ui-monospace, Menlo, monospace; color: var(--text); }
.gw-logo { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; font: 800 14px var(--font-head); color: #fff; flex: none; letter-spacing: -.02em; }
.gw-option { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; background: var(--surface); margin: 0; font-weight: 500; }
.gw-option.on { border: 2px solid var(--brand); padding: 13px; background: var(--brand-soft); }
.gw-option b { display: block; font-size: 14px; color: var(--text); }
.gw-option span:not(.gw-logo) { font-size: 12.5px; color: var(--muted); }
.gw-option input { margin-left: auto; accent-color: var(--brand); width: 18px; height: 18px; flex: none; }
.receipt-thumb { width: 52px; height: 64px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); display: grid; place-items: center; color: var(--muted); font-size: 20px; flex: none; position: relative; overflow: hidden; }
.receipt-thumb::before { content: ""; position: absolute; left: 8px; right: 8px; top: 10px; height: 3px; background: var(--border-strong); box-shadow: 0 8px 0 var(--border-strong), 0 16px 0 var(--border), 0 24px 0 var(--border); border-radius: 2px; }
.receipt-thumb .bi { position: relative; margin-top: 26px; font-size: 14px; }
.csat-card { text-align: center; padding: 28px; }
.csat-faces { display: flex; justify-content: center; gap: 10px; margin: 18px 0; flex-wrap: wrap; }
.csat-faces button { width: 56px; height: 56px; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 24px; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.csat-faces button.on { border: 2px solid var(--brand); color: var(--brand-ink); background: var(--brand-soft); }
.csat-faces button span { display: block; }
.star-rate { display: inline-flex; gap: 6px; font-size: 30px; color: var(--border-strong); }
.star-rate button { background: none; border: 0; padding: 2px; color: inherit; cursor: pointer; font-size: inherit; line-height: 1; }
.star-rate button.on { color: #E8A317; }
.suggest { border: 1px solid var(--brand-soft-2); background: var(--brand-soft); border-radius: var(--radius-lg); }
.suggest a { display: flex; gap: 12px; padding: 12px 14px; border-radius: 8px; color: var(--text); text-decoration: none; background: var(--surface); border: 1px solid var(--border); }
.suggest a + a { margin-top: 8px; }
.suggest a:hover { border-color: var(--brand); }
.suggest a .bi { color: var(--brand-ink); font-size: 18px; margin-top: 1px; }
.suggest a b { display: block; font-size: 14px; font-weight: 600; }
.suggest a span { font-size: 12.5px; color: var(--muted); }
.radio-cards { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
.radio-cards label { display: flex; align-items: center; justify-content: center; gap: 8px; height: 42px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: 13.5px; cursor: pointer; margin: 0; background: var(--surface); }
.radio-cards label.on { border: 2px solid var(--brand); color: var(--brand-ink); background: var(--brand-soft); }
.radio-cards input { display: none; }
.hours-grid { display: grid; grid-template-columns: 120px auto 1fr; gap: 10px 16px; align-items: center; font-size: 14px; }
.hours-grid .times { display: flex; align-items: center; gap: 8px; color: var(--muted); min-width: 0; }
.hours-grid .times .input { height: 36px; width: 140px; min-width: 0; flex: 0 1 140px; font-size: 13.5px; }
.overview-card { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; color: inherit; text-decoration: none !important; }
.overview-card:hover { border-color: var(--brand); }
.overview-card b { color: var(--text); font-size: 15px; display: flex; align-items: center; gap: 8px; }
.overview-card span { font-size: 13px; color: var(--muted); }
.overview-card code { font-size: 12px; color: var(--brand-ink); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1359px) {
  .header-search { display: none; }
  .header-search-btn { display: inline-grid; }
}
/* Header fit levels: fixdesk.js adds fit-1..fit-5 to .site-header only while its content is still wider than the bar
   (a signed-in user's extra buttons, longer translations or site name). fit-1 shows "Install app" as an icon; fit-2..5
   are the same steps as the breakpoints below (search icon, compact, "More", burger). */
.site-header.fit-1 .header-tools .btn-install span { display: none; }
.site-header.fit-1 .header-tools .btn-install { padding: 0 10px; }
.site-header.fit-2 .header-search { display: none; }
.site-header.fit-2 .header-search-btn { display: inline-grid; }
.site-header.fit-3 .container { gap: 16px; }
.site-header.fit-3 .main-nav a, .site-header.fit-3 .main-nav .more-btn { padding: 0 9px; font-size: 14px; }
.site-header.fit-4 .main-nav .nav-extra { display: none; }
.site-header.fit-4 .main-nav .more { display: block; }
.site-header.fit-5 .main-nav, .site-header.fit-5 .hide-m { display: none; }
.site-header.fit-5 .burger { display: inline-grid; }
.site-header.fit-5 .header-tools { gap: 4px; }
@media (max-width: 1279px) {
  .site-header .container { gap: 16px; }
  .main-nav a, .main-nav .more-btn { padding: 0 9px; font-size: 14px; }
  .header-tools .btn-install span { display: none; }
  .header-tools .btn-install { padding: 0 10px; }
  .hero h1 { font-size: 46px; }
  .workspace { grid-template-columns: 280px minmax(0,1fr) 300px; }
  .kb-layout { grid-template-columns: 210px minmax(0,1fr); }
  .kb-layout .kb-aside { grid-column: 2; }
  .topbar .t-search { width: 240px; }
}
@media (max-width: 1099px) {
  .main-nav .nav-extra { display: none; }
  .main-nav .more { display: block; }
  .hero .container { grid-template-columns: 1fr; gap: 48px; }
  .hero-visual { max-width: 560px; }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-grid .f-brand { grid-column: 1 / -1; }
  .footer-grid .f-app { grid-column: span 3; }
  .g-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .stats-band { grid-template-columns: repeat(2, 1fr); }
  .workspace { grid-template-columns: 0 minmax(0,1fr) 300px; }
  .workspace .ws-list { display: none; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; display: flex; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
  .set-row { grid-template-columns: 1fr; gap: 10px; }
  .topbar .t-search { display: none; }
  .topbar .t-search-btn { display: inline-grid !important; }
  .topbar .t-tools,
  .topbar .t-search + .t-tools { margin-left: auto; }
}
@media (max-width: 979px) {
  :root { --header-h: 60px; }
  .main-nav, .site-header .hide-m { display: none; }
  .burger { display: inline-grid; }
  .header-tools { gap: 4px; }
  .g-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .section { padding: 64px 0; }
  .kb-layout { grid-template-columns: 1fr; }
  .kb-layout .toc { position: static; }
  .kb-layout .kb-aside { grid-column: auto; }
  .kb-toc-col { display: none; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .cta { flex-direction: column; align-items: flex-start; padding: 36px; }
  .cta .btns { margin-left: 0; }

  /* app shell → off-canvas sidebar */
  .app, .app.rail { grid-template-columns: minmax(0,1fr); background: var(--bg); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(290px, 86vw); transform: translateX(-105%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .nav-open .sidebar { transform: none; }
  .app.rail .sidebar .logo span, .app.rail .sb-role, .app.rail .sb-group, .app.rail .sb-link span, .app.rail .sb-link .count, .app.rail .sb-user div { display: initial; }
  .app.rail .sb-link .count { display: inline-block; position: static; margin-left: auto; min-width: 0; height: auto; line-height: inherit; padding: 1px 8px; font-size: 12px; }
  .app.rail .sb-link { justify-content: flex-start; padding: 0 10px; height: 40px; }
  .app.rail .sidebar .sb-head { padding: 0 18px; justify-content: flex-start; }
  .app.rail .sb-nav { padding: 14px 12px; }
  .app.rail .sb-foot { padding: 14px; display: block; }
  .app.rail .sb-user { padding: 6px; }
  .app.rail .sb-user div { display: block; }
  .sb-close { display: inline-grid; margin-left: auto; }
  .sb-role { margin-left: 0; }
  .topbar { height: 60px; padding: 0 12px 0 16px; gap: 6px; }
  .topbar .page-title { font-size: 16.5px; }
  .topbar .t-tools { margin-left: auto; gap: 2px; }
  .t-tools .me span, .t-tools .hide-m { display: none; }
  .t-tools .me { margin-left: 2px; padding: 2px; }
  .app-burger { display: inline-grid; }
  .content { padding: 20px 16px; }

  .workspace { grid-template-columns: minmax(0,1fr); height: auto; min-height: 0; }
  .workspace .ws-side { border-left: 0; border-top: 1px solid var(--border); }
  .ws-col { overflow: visible; }
  .ws-mobile-tabs { display: flex; position: sticky; top: 60px; z-index: 5; background: var(--surface); padding: 0 12px; }
  .ws-thread-head { position: static; padding: 16px; }
  .ws-thread-body { padding: 16px; }
  .chat-console .ws-list { display: none; }
}
@media (max-width: 767px) {
  body { font-size: 14.5px; }
  h1 { font-size: 30px; }
  .container { padding: 0 16px; }
  .site-header .container { gap: 8px; }
  .logo { font-size: 19px; }
  .install-bar .container { gap: 10px; }
  .install-bar p .hide-xs { display: none; }
  .hero .container { padding-top: 44px; padding-bottom: 56px; }
  .hero h1 { font-size: 36px; }
  .lead { font-size: 16.5px; }
  .hero-search { padding: 6px; }
  .hero-search > .bi { margin-left: 6px; }
  .hero-search .btn { padding: 0 14px; }
  .hero-search .btn span { display: none; }
  .hero-visual { min-height: 0; display: grid; gap: 14px; }
  .hv-card { position: static; width: auto !important; }
  .hv-main { right: 0; }
  .section-head h2 { font-size: 27px; }
  .g-2, .g-3, .g-4 { grid-template-columns: minmax(0,1fr); }
  .kpis.g-4 { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
  .kpis .kpi { padding: 14px; }
  .kpis .kpi .k-val { font-size: 23px; margin-top: 10px; }
  .kpis .kpi .k-top { font-size: 12.5px; }
  .kpis .k-ico { width: 30px; height: 30px; font-size: 14px; }
  .stats-band { padding: 28px; gap: 20px; }
  .stats-band .stat b { font-size: 28px; }
  .cta { padding: 28px 22px; }
  .cta h2 { font-size: 25px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid .f-app { grid-column: 1 / -1; }
  .footer-bottom .links { margin-left: 0; }
  .page-hero { padding: 36px 0 32px; }
  .page-hero h1 { font-size: 30px; }
  .plan { padding: 24px; }
  .page-head h1 { font-size: 22px; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .card-body { padding: 16px; }
  .card-head { padding: 14px 16px; flex-wrap: wrap; }
  .card-pad { padding: 18px; }
  .chat-widget { right: 12px; left: 12px; width: auto; bottom: 88px; }
  .chat-launcher { right: 16px; bottom: 16px; }
  .auth-main { padding: 20px 16px; }
  .oauth { grid-template-columns: 1fr; }
  .radio-cards { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .compare th, .compare td { padding: 12px 10px; font-size: 13px; }
  .donut-wrap { flex-direction: column; align-items: flex-start; }
  .bar-row { grid-template-columns: 100px minmax(0,1fr) 46px; }
  .hours-grid { grid-template-columns: 1fr auto; }
  .hours-grid .times { grid-column: 1 / -1; }
  .hours-grid .times .input { width: 100%; }
  .theme-choice { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
  .theme-choice label { font-size: 12.5px; padding: 8px; }
  .theme-choice label.on { padding: 7px; }
  .post { gap: 10px; }
  .post > .av, .post > .av-wrap { display: none; }
  .event-line { padding-left: 0; }
  .post .post-head time { margin-left: 0; width: 100%; }
  .sn-row { flex-wrap: wrap; }
  .sn-row .sn-url { order: 5; flex-basis: 100%; }
  .chat-console .bubble { max-width: 85%; }
  .helpful { padding: 18px; }
  .toolbar .grow { flex-basis: 100%; }
  .pager .pg { margin-left: 0; }

  /* responsive tables → cards */
  .rtable thead { display: none; }
  .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; }
  .rtable tr { padding: 12px 16px; border-bottom: 1px solid var(--border); }
  .rtable tr:last-child { border-bottom: 0; }
  .rtable tbody tr:hover td { background: none; }
  .rtable td { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 6px 0; border: 0; text-align: right; min-height: 34px; }
  .rtable td::before { content: attr(data-label); font-size: 12.5px; font-weight: 600; color: var(--muted); text-align: left; flex: none; white-space: nowrap; }
  .rtable td.num { text-align: right; }
  .rtable td.td-main { display: block; text-align: left; padding: 2px 0 8px; }
  .rtable td.td-main::before { display: none; }
  .rtable td.chk { display: none; }
  .rtable td.td-actions { justify-content: flex-end; }
  .rtable td.td-actions::before { content: none; }
  .rtable td > .cell-user { justify-content: flex-end; text-align: right; }
}
@media (max-width: 400px) {
  .hero h1 { font-size: 32px; }
  .logo { font-size: 18px; gap: 8px; }
  .logo svg { width: 28px; height: 28px; }
  .kpis.g-4 { gap: 10px; }
  .csat-faces button { width: 48px; height: 48px; }
  .footer-grid { gap: 24px 16px; }
}
@media (max-width: 767px) { .chart text { font-size: 19px; } }
@media (max-width: 979px) { .split { grid-template-columns: minmax(0,1fr) !important; } }
@media (max-width: 767px) {
  .cat-grid { grid-template-columns: repeat(2, minmax(0,1fr)) !important; gap: 12px; }
  .cat-grid .cat-card { padding: 16px; }
  .cat-grid .cat-card p { display: none; }
  .cat-grid .cat-card h3 { font-size: 14.5px; }
  .cat-grid .cat-ico { width: 38px; height: 38px; font-size: 17px; margin-bottom: 6px; }
  .cat-grid .cat-card .meta { margin-top: 4px; }
  .article-list a .views { display: none; }
  .article-list a .views + .bi-chevron-right { margin-left: auto; }
}
@media (max-width: 767px) {
  .chat-widget { inset: 0; width: auto; max-height: none; border-radius: 0; border: 0; z-index: 120; }
  .chat-launcher:has(+ .chat-widget:not(.closed)) { display: none; }
}
@media (max-width: 767px) {
  .alert-cta { flex-wrap: wrap; }
  .alert-cta > .grow { flex: 1 1 calc(100% - 40px); }
  .alert-cta > .btn { margin-left: 30px; }
}
@media (max-width: 767px) {
  .stat3 { grid-template-columns: repeat(3, minmax(0,1fr)) !important; gap: 8px !important; }
  .stat3 > .card { padding: 10px !important; font-size: 13px; }
}
@media (min-width: 768px) { .tbl td.td-main { min-width: 250px; } }
@media (max-width: 767px) {
  .chat-head { flex-wrap: wrap; }
  .chat-head > .grow { flex: 1 1 calc(100% - 60px); }
}
@media (max-width: 767px) {
  .rtable td.td-main > .cell-user { justify-content: flex-start; text-align: left; }
  .hours-grid .times .input { flex: 1 1 0; width: auto; }
}
.gw-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
.gw-grid > .list-item { border-top: 1px solid var(--border); }
.gw-grid > .list-item:nth-child(-n+2) { border-top: 0; }
.gw-grid > .list-item:nth-child(odd) { border-right: 1px solid var(--border); }
@media (max-width: 979px) {
  .gw-grid { grid-template-columns: minmax(0,1fr); }
  .gw-grid > .list-item:nth-child(2) { border-top: 1px solid var(--border); }
  .gw-grid > .list-item:nth-child(odd) { border-right: 0; }
}
@media (max-width: 767px) { .keep2 { grid-template-columns: repeat(2, minmax(0,1fr)) !important; } }
.tag-bars .bar-row { grid-template-columns: 140px minmax(0,1fr) 46px; }
@media (min-width: 980px) { .dd-demo-open > .dd-menu { display: block; } }
@media (max-width: 767px) { .cmp-to { display: none !important; } }
