@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;900&display=swap");

/* ==========================================================================
   AISupportChat.pro — PHP edition stylesheet
   Modern theme: crisp typography, quiet neutrals, refined accent, soft cards
   ========================================================================== */

:root {
  --brand: #2457e6;
  --brand-dark: #1b3fae;
  --brand-soft: #eef2ff;
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -12px rgba(15, 23, 42, .12);
  --shadow-lg: 0 2px 4px rgba(15, 23, 42, .05), 0 20px 40px -20px rgba(15, 23, 42, .22);
  --green: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;
  --font: var(--site-font, "Roboto", "Inter", "Segoe UI", system-ui, -apple-system, sans-serif);
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
.ln-section[id] { scroll-margin-top: 88px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.02em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
code { font-family: var(--mono); font-size: .9em; background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 780px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: var(--mono); }
.inline { display: inline; }
.eyebrow {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 16px;
}
.stack { display: flex; flex-direction: column; gap: 12px; }

/* --------------------------------------------------------------------------
   Dark mode
   -------------------------------------------------------------------------- */
html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f1f5f9;
  --ink-soft: #cbd5e1;
  --muted: #94a3b8;
  --line: #243244;
  --bg: #0b1220;
  --card: #101a2c;
  --brand-soft: rgba(36, 87, 230, .22);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .5);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, .45), 0 20px 40px -20px rgba(0, 0, 0, .65);
}
html[data-theme="dark"] .site-nav { background: rgba(11, 18, 32, .85); }
html[data-theme="dark"] .hero { background: radial-gradient(1200px 500px at 75% -10%, rgba(36, 87, 230, .18), transparent 60%); }
html[data-theme="dark"] .input,
html[data-theme="dark"] select.input,
html[data-theme="dark"] .newsletter-row input { background: #0d1626; color: var(--ink); }
html[data-theme="dark"] .table tbody tr:hover { background: rgba(255, 255, 255, .025); }
html[data-theme="dark"] .mock-row { background: #1e293b; }
html[data-theme="dark"] .dot { background: #334155; }
html[data-theme="dark"] .op-row,
html[data-theme="dark"] .cat-row,
html[data-theme="dark"] .logo-preview { background: #0d1626; }
html[data-theme="dark"] .badge { background: #16233a; color: #cbd5e1; }
html[data-theme="dark"] .badge-low { background: #16233a; color: #cbd5e1; }
/* Dark-mode badge contrast: the light-mode blue-on-blue (pending/normal) and
   bright boxes are replaced with dark-tinted chips + light text. */
html[data-theme="dark"] .badge-pending,
html[data-theme="dark"] .badge-normal { background: rgba(37, 87, 230, .22); border-color: rgba(96, 141, 255, .35); color: #a9c1ff; }
html[data-theme="dark"] .badge-open { background: rgba(245, 158, 11, .14); border-color: rgba(245, 158, 11, .3); color: #fcd34d; }
html[data-theme="dark"] .badge-high,
html[data-theme="dark"] .badge-danger { background: rgba(239, 68, 68, .16); border-color: rgba(239, 68, 68, .32); color: #fca5a5; }
html[data-theme="dark"] .badge-resolved,
html[data-theme="dark"] .badge-success { background: rgba(16, 185, 129, .16); border-color: rgba(16, 185, 129, .32); color: #6ee7b7; }
html[data-theme="dark"] .badge-unverified { background: rgba(245, 158, 11, .14); border-color: rgba(245, 158, 11, .3); color: #fcd34d; }
/* Dark-mode flash + brand text on brand-soft backgrounds: keep the text a
   light blue on a dark tint instead of dark-blue-on-dark-blue. */
html[data-theme="dark"] .flash-info { background: rgba(37, 87, 230, .22); border-color: rgba(96, 141, 255, .35); color: #a9c1ff; }
html[data-theme="dark"] .portal-nav-link.active,
html[data-theme="dark"] .portal-tabs a.active,
html[data-theme="dark"] .stat-tone-blue { background: rgba(37, 87, 230, .22); color: #a9c1ff; }
html[data-theme="dark"] .msg-agent { background: #0d1626; }
html[data-theme="dark"] .admin-sidebar { background: #0d1626; }
html[data-theme="dark"] .admin-brand-sub,
html[data-theme="dark"] .admin-nav-group { color: #64748b; }
html[data-theme="dark"] .admin-nav-link { color: #cbd5e1; }
html[data-theme="dark"] .html-toolbar { background: #0d1626; }
html[data-theme="dark"] .html-toolbar select,
html[data-theme="dark"] .tool-btn { background: #101a2c; color: var(--ink); }
html[data-theme="dark"] .html-content:focus { box-shadow: inset 0 0 0 3px rgba(36, 87, 230, .3); }
html[data-theme="dark"] .theme-toggle::before { content: "☀️"; }

/* --------------------------------------------------------------------------
   Customer portal (matches the original product design)
   -------------------------------------------------------------------------- */
.hidden { display: none !important; }
.capitalize { text-transform: capitalize; }
.portal-shell { display: flex; min-height: 100vh; background: var(--bg); }
.portal-sidebar {
  width: 248px; flex-shrink: 0;
  display: flex; flex-direction: column;
  padding: 20px 16px;
  border-right: 1px solid var(--line);
  background: var(--card);
  position: sticky; top: 0; height: 100vh;
}
.portal-brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; color: inherit; text-decoration: none; }
.portal-brand:hover { text-decoration: none; }
.portal-brand-name { display: block; font-weight: 800; letter-spacing: -.02em; font-size: 15px; }
.portal-brand-sub { display: block; font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.portal-nav-group { padding: 14px 12px 4px; font-size: .66rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.portal-nav { display: flex; flex-direction: column; gap: 2px; }
.portal-side-links { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.portal-nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px;
  color: var(--muted); font-size: .9rem; font-weight: 600; text-decoration: none;
  transition: background .12s, color .12s;
}
.portal-nav-link:hover { background: var(--brand-soft); color: var(--ink); text-decoration: none; }
.portal-nav-link.active { background: var(--brand-soft); color: var(--brand); }
.portal-nav-count {
  margin-left: auto;
  min-width: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: .72rem;
  font-weight: 800;
  text-align: center;
  line-height: 1.3;
}
.portal-sidebar-foot { margin-top: auto; border-radius: 16px; border: 1px solid var(--line); background: var(--bg); padding: 12px 14px; }
.portal-user-name { font-size: .82rem; font-weight: 800; margin: 0; }
.portal-sidebar-foot .muted { font-size: .74rem; margin: 2px 0 0; }
.portal-signout { margin-top: 10px; }
.portal-signout button { border: 0; background: none; padding: 0; font-size: .78rem; font-weight: 700; color: var(--muted); cursor: pointer; }
.portal-signout button:hover { color: var(--red); }
.portal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.portal-topbar {
  height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 32px; border-bottom: 1px solid var(--line); background: var(--card);
}
.portal-topbar-eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--brand); margin: 0 0 6px; }
.portal-topbar h1 { margin: 2px 0 0; font-size: 1.25rem; }
.portal-topbar-actions { display: flex; gap: 10px; }
.portal-tabs { display: none; }
.portal-content { flex: 1; width: 100%; max-width: 1152px; margin: 0 auto; padding: 28px 32px 48px; }
.portal-overview-head { max-width: 560px; }
.portal-overview-head h2 { font-size: 1.9rem; margin: 4px 0 8px; }
.portal-overview-head .muted { font-size: .92rem; }
.portal-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 26px; }
.portal-card { border: 1px solid var(--line); background: var(--card); border-radius: 16px; padding: 20px; }
.portal-card h3 { margin: 0 0 4px; font-size: 1rem; }
.portal-card .muted { font-size: .8rem; }
.portal-stat-icon { width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: .85rem; }
.stat-tone-blue { background: var(--brand-soft); color: var(--brand); }
.stat-tone-violet { background: #f5f3ff; color: #7c3aed; }
.stat-tone-emerald { background: #ecfdf5; color: #059669; }
html[data-theme="dark"] .stat-tone-violet { background: rgba(124, 58, 237, .18); color: #c4b5fd; }
html[data-theme="dark"] .stat-tone-emerald { background: rgba(16, 185, 129, .16); color: #6ee7b7; }
.portal-stat-value { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; margin: 10px 0 2px; }
.portal-stat-label { font-size: .78rem; font-weight: 600; color: var(--muted); margin: 0; }
.portal-grid-2 { display: grid; grid-template-columns: 1.1fr .9fr; gap: 20px; margin-top: 24px; align-items: start; }
.portal-card-head { margin-bottom: 12px; }
.portal-card-dark { background: #0f172a; color: #fff; border-radius: 16px; padding: 24px; }
html[data-theme="dark"] .portal-card-dark { background: #0d1626; }
.portal-dark-icon { width: 40px; height: 40px; border-radius: 12px; background: rgba(255, 255, 255, .1); color: #bfdbfe; display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.portal-card-dark h3 { color: #fff; margin: 14px 0 6px; font-size: 1.15rem; }
.portal-card-dark p { color: #cbd5e1; font-size: .88rem; line-height: 1.6; }
.portal-dark-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.dark-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-radius: 12px; border: 0; background: #fff; color: #0f172a; font-weight: 700; font-size: .8rem; text-decoration: none; }
.dark-btn:hover { text-decoration: none; background: #eff6ff; }
.dark-btn-outline { background: transparent; border: 1px solid rgba(255, 255, 255, .2); color: #fff; }
.dark-btn-outline:hover { background: rgba(255, 255, 255, .08); }
.conv-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.conv-row:last-child { border-bottom: 0; }
.conv-row:hover { text-decoration: none; }
.conv-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.embed-code-row { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.embed-code-row .btn { flex-shrink: 0; }
.embed-code-row-top { align-items: flex-start; }
.embed-code {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem;
  color: var(--ink);
}
.embed-code-multi {
  white-space: pre;
  max-height: 220px;
  overflow: auto;
}

/* Install options in Helpdesk settings: JS / HTML / WordPress plugin */
.embed-option {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}
.embed-option-head { display: flex; align-items: flex-start; gap: 10px; }
.embed-option-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.embed-option-head strong { display: block; font-size: .88rem; }
.embed-option-head p { margin: 2px 0 0; }
.embed-option .embed-code-row { margin-top: 0; }

/* Submit ticket page */
.page-eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); margin-bottom: 16px; }
.submit-layout { max-width: 920px; }
.submit-grid { display: grid; grid-template-columns: 1.35fr .85fr; gap: 20px; align-items: start; }
.submit-card { padding: 26px; }
.submit-card .form-row-2 { margin-top: 2px; }
.submit-card > div { margin-top: 16px; }
.submit-card .input, .submit-card select.input { height: 44px; }
.submit-card textarea.input { height: auto; }
.submit-actions { display: flex; align-items: center; gap: 14px; margin-top: 20px; }
.submit-actions .btn { min-width: 150px; }
.priority-seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px;
}
.priority-opt { position: relative; display: flex; cursor: pointer; }
.priority-opt input { position: absolute; opacity: 0; pointer-events: none; }
.priority-opt span {
  flex: 1;
  text-align: center;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  transition: background .15s ease, color .15s ease;
}
.priority-opt:hover span { color: var(--ink); }
.priority-opt input:checked + span { background: var(--card); color: var(--brand); box-shadow: 0 1px 4px rgba(15, 23, 42, .08); }
.submit-side { display: flex; flex-direction: column; gap: 16px; }
.card-eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); margin: 0 0 16px; }
.step-list { list-style: none; margin: 0; padding: 0; }
.step-list li { display: flex; gap: 12px; padding: 10px 0; }
.step-list li + li { border-top: 1px dashed var(--line); }
.step-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  font-weight: 800;
}
.step-list strong { display: block; font-size: .88rem; }
.step-list p { margin: 2px 0 0; }
.btn-block { width: 100%; }
@media (max-width: 760px) {
  .submit-grid { grid-template-columns: 1fr; }
  .submit-actions { flex-direction: column; align-items: stretch; }
  .submit-actions .btn { width: 100%; }
}

/* Admin changelog */
.changelog-list { display: flex; flex-direction: column; gap: 16px; max-width: 820px; }
.changelog-entry h2 { margin: 8px 0 10px; font-size: 1.05rem; }
.changelog-meta { display: flex; align-items: center; gap: 10px; }
.changelog-version {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .03em;
}
.changelog-notes { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.changelog-notes li { font-size: .86rem; line-height: 1.6; color: var(--ink-soft); }
.conv-row strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; color: var(--ink); }
.portal-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.portal-page-head h2 { font-size: 1.75rem; margin: 4px 0 8px; }
.portal-page-head .muted { font-size: .92rem; }
.portal-content-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 20px; margin-top: 22px; align-items: start; }
.post-list { display: flex; flex-direction: column; gap: 10px; }
.post-item { display: block; border: 1px solid var(--line); background: var(--card); border-radius: 16px; padding: 14px 16px; text-decoration: none; color: inherit; transition: border-color .12s, background .12s; }
.post-item:hover { border-color: var(--muted); text-decoration: none; }
.post-item.active { border-color: var(--brand); background: var(--brand-soft); }
.post-item strong { font-size: .9rem; display: block; color: var(--ink); }
.post-item p { margin: 6px 0 0; font-size: .78rem; line-height: 1.5; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-attach { display: inline-block; margin-top: 8px; font-size: .72rem; font-weight: 700; color: var(--brand); }
.post-article h3 { font-size: 1.4rem; margin-top: 4px; }
.post-article .badge { margin-top: 8px; }
.post-body { margin: 10px 0 0; white-space: pre-wrap; font-size: .92rem; line-height: 1.7; color: var(--ink-soft); }
.post-attach-link { display: flex; align-items: center; gap: 6px; margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: var(--bg); font-size: .82rem; font-weight: 700; color: var(--brand); text-decoration: none; }
.post-comments { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; }
.comment-list { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.comment-row { background: var(--bg); border-radius: 12px; padding: 10px 14px; }
.comment-row strong { font-size: .8rem; display: block; color: var(--ink); }
.comment-row p { font-size: .8rem; color: var(--ink-soft); margin: 4px 0 0; }
.comment-form { display: flex; gap: 8px; }
.empty-post { display: flex; align-items: center; justify-content: center; min-height: 240px; text-align: center; padding: 24px; }
.msg-shell { display: grid; grid-template-columns: 300px 1fr; min-height: 540px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--card); margin-top: 22px; }
.msg-list { border-right: 1px solid var(--line); }
.ticket-list-item { display: block; width: 100%; border-bottom: 1px solid var(--line); padding: 14px 16px; text-align: left; text-decoration: none; color: inherit; }
.ticket-list-item:last-child { border-bottom: 0; }
.ticket-list-item:hover { background: var(--bg); text-decoration: none; }
.ticket-list-item.active { background: var(--brand-soft); }
.ticket-list-item strong { font-size: .9rem; color: var(--ink); display: block; }
.ticket-list-item p { margin: 4px 0 8px; }
.msg-thread-wrap { display: flex; flex-direction: column; min-width: 0; }
.msg-thread-head { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.msg-thread-head h3 { margin: 2px 0 0; font-size: 1rem; }
.chat-thread { display: flex; flex-direction: column; gap: 14px; padding: 20px; max-height: 430px; overflow-y: auto; flex: 1; }
.chat-msg { display: flex; }
.chat-msg.customer { justify-content: flex-end; }
.chat-msg.agent { justify-content: flex-start; }
.chat-bubble { max-width: 78%; border-radius: 16px; padding: 10px 14px; font-size: .88rem; line-height: 1.55; }
.chat-bubble.customer { background: var(--brand); color: #fff; border-top-right-radius: 4px; }
.chat-bubble.agent { background: var(--bg); border: 1px solid var(--line); border-top-left-radius: 4px; color: var(--ink-soft); }
.chat-bubble small { display: block; font-size: .68rem; font-weight: 700; opacity: .75; margin-bottom: 3px; }
.chat-composer { display: flex; gap: 10px; border-top: 1px solid var(--line); padding: 14px; background: var(--bg); }

/* Custom homepage sections editor (admin) */
.section-editor { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; background: var(--bg); }
.section-editor-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.section-editor-head strong { flex: 1; min-width: 0; }
.section-editor-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.section-editor .form-row-2 { margin-top: 12px; }
.section-add { align-items: end; }

/* Admin table extras */
.badge-published { background: #ecfdf5; color: #059669; border-color: #a7f3d0; }
html[data-theme="dark"] .badge-published { background: rgba(16, 185, 129, .16); color: #6ee7b7; border-color: transparent; }
.badge-draft { background: #fffbeb; color: #b45309; border-color: #fde68a; }
html[data-theme="dark"] .badge-draft { background: rgba(245, 158, 11, .14); color: #fbbf24; border-color: transparent; }

/* Knowledge base (customer portal) */
.kb-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.kb-filter-tabs { display: inline-flex; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.kb-filter-tab { border: 0; background: transparent; color: var(--muted); font: 600 .78rem/1 system-ui, sans-serif; padding: 7px 12px; border-radius: 9px; cursor: pointer; transition: background .12s ease, color .12s ease; }
.kb-filter-tab span { opacity: .7; font-weight: 500; }
.kb-filter-tab:hover { color: var(--ink); }
.kb-filter-tab.active { background: var(--brand); color: #fff; }
.kb-search { max-width: 240px; }
.kb-item { display: flex; flex-direction: column; gap: 6px; }
.kb-item-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.kb-category { display: inline-block; padding: 2px 8px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); font-size: .68rem; font-weight: 700; }
.kb-form-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.kb-edit-actions { display: flex; align-items: center; gap: 8px; }
.kb-delete-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.kb-delete-row .muted { margin: 0; }
.table-actions { white-space: nowrap; text-align: right; }
.table-actions form { display: inline-flex; }

/* Portal responsive */
@media (max-width: 900px) {
  .portal-sidebar { display: none; }
  .portal-tabs { display: flex; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--card); overflow-x: auto; }
  .portal-tabs a { padding: 8px 14px; border-radius: 10px; font-size: .85rem; font-weight: 700; color: var(--muted); text-decoration: none; white-space: nowrap; }
  .portal-tabs a.active { background: var(--brand-soft); color: var(--brand); }
  .portal-topbar { padding: 0 16px; }
  .portal-content { padding: 20px 16px 40px; }
  .portal-grid-2, .portal-content-grid { grid-template-columns: 1fr; }
  .msg-shell { grid-template-columns: 1fr; }
  .msg-list { display: none; }
}

/* Package manager report */
.upd-list { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.upd-list li { position: relative; padding-left: 22px; font-size: .84rem; line-height: 1.5; }
.upd-list li::before { position: absolute; left: 0; top: 0; font-weight: 800; }
.upd-ok::before { content: "✓"; color: var(--green); }
.upd-warn::before { content: "!"; color: var(--amber); }
.upd-err::before { content: "✕"; color: var(--red); }
.upd-group { margin-bottom: 14px; }
.upd-group + .upd-group { border-top: 1px solid var(--line); padding-top: 14px; }
.upd-title-fail { color: var(--amber); }
.upd-list code { background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; font-size: .78rem; }

/* Custom page rendering */
.custom-page h1, .custom-page h2, .custom-page h3 { color: var(--ink); }
.custom-page p { color: var(--ink-soft); }
.custom-page img { border-radius: 12px; }
.custom-page a { color: var(--brand); }

/* Theme toggle button (public + admin) */
.theme-toggle {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  padding: 0;
  transition: border-color .15s, background .15s;
}
.theme-toggle:hover { border-color: var(--brand); background: var(--brand-soft); }
.theme-toggle::before { content: "🌙"; }
.theme-toggle-fixed { position: fixed; top: 16px; right: 16px; z-index: 60; background: var(--card); box-shadow: var(--shadow); }

/* --------------------------------------------------------------------------
   Admin sidebar extras
   -------------------------------------------------------------------------- */
.admin-nav-group {
  display: block;
  padding: 14px 12px 4px;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #64748b;
}
.admin-nav-external { color: #94a3b8; font-size: .84rem; }
.sidebar-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.sidebar-actions .theme-toggle { border-color: #334155; }
.sidebar-actions .btn-link { color: #94a3b8; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s, transform .06s, box-shadow .15s;
  background: var(--card);
  color: var(--ink);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 4px 14px -6px var(--brand); }
.btn-primary:hover { background: var(--brand-dark); color: #fff; text-decoration: none; }
.btn-outline { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.btn-danger { background: #fef2f2; border-color: #fecaca; color: var(--red); }
.btn-danger:hover { background: var(--red); border-color: var(--red); color: #fff; text-decoration: none; }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: #eef2ff; text-decoration: none; }
.btn-lg { padding: 13px 26px; font-size: 1rem; border-radius: 12px; }
.btn-sm { padding: 5px 10px; font-size: .8rem; }
.btn-block { width: 100%; }
.btn-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 600;
  font-size: .85rem;
  color: var(--brand);
  cursor: pointer;
  text-decoration: none;
}
.btn-link:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  font: inherit;
  font-size: .92rem;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input.small { padding: 6px 9px; font-size: .82rem; }
textarea.input { resize: vertical; line-height: 1.55; }
.color-input { width: 52px; height: 40px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; }
select.input { cursor: pointer; }
.field-label { font-size: .78rem; font-weight: 600; letter-spacing: .02em; color: var(--ink-soft); margin: 4px 0 0; }
.check-label { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 500; cursor: pointer; }
.check-label input { accent-color: var(--brand); width: 16px; height: 16px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.upload-row { display: flex; gap: 10px; align-items: center; }
.upload-row .input { flex: 1; }
.otp-input {
  font-family: var(--mono);
  font-size: 1.6rem !important;
  letter-spacing: .45em;
  text-align: center;
  padding: 14px !important;
}

/* --------------------------------------------------------------------------
   Flash messages
   -------------------------------------------------------------------------- */
.flash {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 500;
  margin-bottom: 14px;
  border: 1px solid;
}
.flash-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.flash-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.flash-info { background: var(--brand-soft); border-color: #c7d7fe; color: #1e40af; }
.flash-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }

/* --------------------------------------------------------------------------
   Landing page (matches the original product design)
   -------------------------------------------------------------------------- */
.public-landing {
  min-height: 100vh;
  color: var(--ln-body-color, #020617);
  font-family: var(--ln-font-body, inherit);
  font-size: var(--ln-body-size, inherit);
  overflow-x: hidden;
}
.ln-nav {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 20px 0;
}
.ln-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.ln-brand:hover { text-decoration: none; }
.ln-logo {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; color: #fff;
  box-shadow: 0 8px 20px rgba(36, 87, 230, .25);
  overflow: hidden;
}
.ln-logo img { width: 100%; height: 100%; object-fit: cover; }
.ln-name { display: block; font-family: var(--hd-title-font, inherit); font-size: var(--hd-title-size, 15px); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; color: var(--hd-title-color, inherit); }
.ln-sub { display: block; font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #94a3b8; }
.ln-links { display: flex; align-items: center; gap: 2px; }
.ln-links a { padding: 8px 12px; border-radius: 12px; font-family: var(--hd-menu-font, inherit); font-size: var(--hd-menu-size, 14px); font-weight: 700; color: var(--hd-menu-color, #64748b); transition: background .15s, color .15s; }
.ln-links a:hover { background: #fff; color: #020617; text-decoration: none; }
.ln-actions { display: flex; align-items: center; gap: 8px; }
.ln-signin { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 12px; font-size: 14px; font-weight: 700; color: #475569; transition: background .15s, color .15s; }
.ln-signin:hover { background: #fff; color: #020617; text-decoration: none; }

/* Shared header (public-header.php) — sticky on sub-pages, inline on the landing. */
.page-body .ln-nav {
  position: sticky;
  top: 0;
  z-index: 80;
  padding-top: 14px;
  padding-bottom: 14px;
  background: rgba(248, 250, 252, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(226, 232, 240, .7);
}
html[data-theme="dark"] .page-body .ln-nav { background: rgba(11, 18, 32, .92); border-bottom-color: #243244; }
@media (max-width: 960px) {
  .ln-nav { flex-wrap: wrap; }
  .ln-links { flex-wrap: wrap; }
}

.ln-hero {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  /* Top space keeps the hero clear of the landing header (the “red line” zone).
     v1.0.46: brought down two more lines. */
  padding: 152px 20px 100px;
}
.ln-hero-grid { position: relative; display: grid; grid-template-columns: .9fr 1.1fr; gap: 56px; align-items: flex-start; }
.ln-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid;
  font-size: var(--ln-eyebrow-size, 11px);
  font-family: var(--ln-eyebrow-font, inherit);
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 22px;
}
.ln-h1 { max-width: 560px; font-size: var(--ln-h-size, 3.4rem); font-weight: 800; line-height: 1.03; letter-spacing: -.05em; margin: 0; font-family: var(--ln-font-heading, inherit); color: var(--ln-h-color, inherit); }
.ln-hero-desc { margin: 24px 0 0; max-width: 460px; font-size: 17px; line-height: 1.75; color: var(--ln-body-color, #64748b); }
.ln-hero-btns { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.ln-btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 22px;
  border-radius: 12px; border: 0;
  color: #fff; font-weight: 700; font-size: 14px;
  text-decoration: none; cursor: pointer;
  box-shadow: 0 10px 24px rgba(36, 87, 230, .22);
  transition: opacity .15s, transform .06s;
}
.ln-btn-primary:hover { opacity: .9; text-decoration: none; }
.ln-btn-outline {
  display: inline-flex; align-items: center;
  height: 48px; padding: 0 22px;
  border-radius: 12px; border: 1px solid #e2e8f0;
  background: #fff; color: #334155; font-weight: 700; font-size: 14px;
  text-decoration: none; box-shadow: 0 1px 2px rgba(15,23,42,.05);
  transition: background .15s, border-color .15s;
}
.ln-btn-outline:hover { background: #f8fafc; border-color: #cbd5e1; text-decoration: none; }
.ln-hero-checks { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 30px; font-size: 12px; font-weight: 700; color: #94a3b8; }
.ln-hero-checks span { display: inline-flex; align-items: center; gap: 6px; }
.ln-hero-checks svg { color: #10b981; }

/* Inbox mockup */
.ln-hero-visual { position: relative; }
.ln-mock {
  position: relative;
  border-radius: 1.6rem;
  border: 1px solid rgba(226, 232, 240, .9);
  background: #fff;
  padding: 8px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, .12);
}
.ln-mock-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid rgba(226,232,240,.8); }
.ln-mock-brand { display: flex; align-items: center; gap: 10px; }
.ln-mock-logo { width: 28px; height: 28px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.ln-mock-title { font-size: 12px; font-weight: 800; }
.ln-mock-muted { color: #94a3b8; font-weight: 400; }
.ln-mock-dots { display: flex; gap: 6px; }
.ln-mock-dots i { width: 8px; height: 8px; border-radius: 50%; background: #e2e8f0; }
.ln-mock-body { display: grid; grid-template-columns: .8fr 1.2fr; overflow: hidden; border-radius: 0 0 1.2rem 1.2rem; background: #f7f8fb; }
.ln-mock-side { background: #fff; border-right: 1px solid rgba(226,232,240,.8); padding: 12px; }
.ln-mock-skeleton { height: 28px; border-radius: 9px; background: #f8fafc; margin-bottom: 12px; }
.ln-mock-ticket { border-radius: 12px; padding: 12px; margin-bottom: 4px; position: relative; }
.ln-mock-ticket.active { background: #eff6ff; }
.ln-mock-ticket-name { display: block; font-size: 10px; font-weight: 800; color: #334155; padding-right: 14px; }
.ln-mock-ticket.active .ln-mock-ticket-name { color: #2457e6; }
.ln-mock-ticket p { margin: 4px 0 0; font-size: 9px; color: #94a3b8; }
.ln-mock-ticket-dot { position: absolute; right: 12px; top: 14px; width: 10px; height: 10px; border-radius: 50%; background: #2457e6; }
.ln-mock-ticket-dot.dim { background: #cbd5e1; }
.ln-mock-pane { min-height: 325px; padding: 20px; }
.ln-mock-id { font-size: 9px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 4px; }
.ln-mock-pane-head { display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid #f1f5f9; padding-bottom: 16px; }
.ln-mock-pane-head h3 { margin: 0; font-size: 14px; font-weight: 800; color: #0f172a; }
.ln-mock-meta { margin: 4px 0 0; font-size: 9px; color: #94a3b8; }
.ln-mock-open { border-radius: 999px; background: #eff6ff; padding: 4px 9px; font-size: 9px; font-weight: 800; color: #1d4ed8; }
.ln-mock-thread { margin-top: 24px; display: flex; flex-direction: column; gap: 20px; }
.ln-mock-msg { display: flex; gap: 10px; }
.ln-mock-msg.customer { justify-content: flex-start; }
.ln-mock-msg.agent { justify-content: flex-end; flex-direction: row-reverse; }
.ln-mock-avatar { width: 28px; height: 28px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 800; flex-shrink: 0; }
.ln-mock-avatar.mc { background: #dbeafe; color: #1d4ed8; }
.ln-mock-avatar.ai { background: #0f172a; color: #fff; }
.ln-mock-bubble { max-width: 78%; padding: 12px; font-size: 10px; line-height: 1.65; color: #475569; background: #fff; border-radius: 12px 12px 12px 3px; box-shadow: 0 1px 2px rgba(15,23,42,.06); border: 1px solid #f1f5f9; }
.ln-mock-bubble.agent { color: #fff; border-radius: 12px 12px 3px 12px; border: 0; }
.ln-mock-reply { margin-top: 32px; height: 36px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; border-radius: 12px; border: 1px solid #e2e8f0; background: #fff; font-size: 9px; color: #94a3b8; box-shadow: 0 1px 2px rgba(15,23,42,.05); }
.ln-mock-send { width: 24px; height: 24px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.ln-mock-float {
  position: absolute;
  left: -22px; bottom: -20px;
  display: flex; align-items: center; gap: 10px;
  border-radius: 16px; border: 1px solid #e2e8f0;
  background: #fff; padding: 13px 15px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .1);
}
.ln-mock-float-icon { width: 32px; height: 32px; border-radius: 12px; background: #ecfdf5; color: #059669; display: inline-flex; align-items: center; justify-content: center; }
.ln-mock-float strong { display: block; font-size: 10px; color: #1e293b; }
.ln-mock-float small { display: block; font-size: 9px; color: #94a3b8; }
.ln-desk-stats { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 20px; border-bottom: 1px solid rgba(226,232,240,.8); background: #fff; }
.ln-desk-stat { font-size: 10px; color: #94a3b8; border: 1px solid #e2e8f0; border-radius: 999px; padding: 4px 10px; }
.ln-desk-stat b { color: #334155; }
.ln-mock-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ln-mock-btn { display: inline-flex; align-items: center; font-size: 9px; font-weight: 800; padding: 7px 11px; border-radius: 9px; border: 1px solid #e2e8f0; color: #334155; background: #fff; }
.ln-mock-btn.primary { color: #fff; border-color: transparent; }

/* Operator desk split section */
.ln-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 56px; align-items: center; }
.ln-split-copy h2 { font-size: var(--ln-h-size, 2.25rem); font-weight: 800; letter-spacing: -.03em; margin: 8px 0 12px; font-family: var(--ln-font-heading, inherit); color: var(--ln-h-color, inherit); }
.ln-split-copy .muted { font-size: 16px; line-height: 1.7; }
.ln-checklist { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.ln-checklist li { display: flex; gap: 11px; align-items: flex-start; font-size: 15px; line-height: 1.6; color: var(--ln-body-color, #475569); }
.ln-checklist li svg { color: #10b981; flex-shrink: 0; margin-top: 3px; }
html[data-theme="dark"] .ln-desk-stats { background: #0d1626; border-color: #1e293b; }
html[data-theme="dark"] .ln-desk-stat { border-color: #243244; }
html[data-theme="dark"] .ln-desk-stat b { color: #e2e8f0; }
html[data-theme="dark"] .ln-mock-btn { background: #101a2c; border-color: #243244; color: #cbd5e1; }
html[data-theme="dark"] .ln-checklist li { color: #cbd5e1; }

/* Sections */
.ln-section { padding: 64px 0; }
.ln-section-tinted { background: rgba(255, 255, 255, .7); border-block: 1px solid rgba(226, 232, 240, .7); }
.ln-section-center { text-align: center; }
.ln-container { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.ln-section-head { max-width: 640px; margin-bottom: 44px; }
.ln-section-center .ln-section-head { margin-inline: auto; }
.ln-section-head h2 { font-size: var(--ln-h-size, 2.25rem); font-weight: 800; letter-spacing: -.03em; margin: 8px 0 12px; font-family: var(--ln-font-heading, inherit); color: var(--ln-h-color, inherit); }
.ln-section-head .muted { font-size: 16px; line-height: 1.7; }
.ln-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: var(--ln-eyebrow-size, 11px); font-weight: 800; letter-spacing: .16em; text-transform: uppercase; margin: 0 0 16px; }
.ln-hero .ln-eyebrow { margin-bottom: 22px; }

.ln-card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.ln-card {
  border-radius: 16px; border: 1px solid rgba(226, 232, 240, .9);
  background: #fff; padding: 24px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, .04);
  transition: transform .15s, box-shadow .15s;
}
.ln-card:hover { transform: translateY(-3px); box-shadow: 0 18px 50px rgba(15, 23, 42, .09); }
.ln-card-icon { width: 40px; height: 40px; border-radius: 12px; background: #f1f5f9; display: flex; align-items: center; justify-content: center; margin-bottom: 20px; }
.ln-card:hover .ln-card-icon { background: #eff6ff; }
.ln-card h3 { font-size: 16px; font-weight: 800; margin: 0 0 8px; font-family: var(--ln-font-heading, inherit); color: var(--ln-h-color, inherit); }
.ln-card p { margin: 0; font-size: 14px; line-height: 1.7; color: var(--ln-body-color, #64748b); }
.ln-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.ln-step {
  border-radius: 16px; border: 1px solid rgba(226, 232, 240, .9);
  background: #fff; padding: 24px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, .04);
  transition: transform .15s;
}
.ln-step:hover { transform: translateY(-3px); }
.ln-step-num { width: 40px; height: 40px; border-radius: 12px; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; margin-bottom: 20px; box-shadow: 0 8px 20px rgba(36, 87, 230, .2); }
.ln-step h3 { font-size: 16px; font-weight: 800; margin: 0 0 8px; font-family: var(--ln-font-heading, inherit); color: var(--ln-h-color, inherit); }
.ln-step p { margin: 0; font-size: 14px; line-height: 1.7; color: var(--ln-body-color, #64748b); }
.ln-plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; align-items: stretch; }
.ln-plan {
  position: relative;
  display: flex; flex-direction: column;
  border-radius: 18px; border: 1px solid rgba(226, 232, 240, .9);
  background-color: #fff;
  padding: 30px 28px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, .05);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.ln-plan::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--brand); opacity: .32;
  border-radius: 18px 18px 0 0;
  pointer-events: none;
}
.ln-plan:hover { transform: translateY(-5px); box-shadow: 0 22px 55px rgba(15, 23, 42, .13); border-color: #c7d2fe; }
.ln-plan.featured {
  border-color: transparent; color: #fff;
  transform: translateY(-6px);
  box-shadow: 0 0 0 4px rgba(36, 87, 230, .13), 0 28px 70px rgba(36, 87, 230, .38);
  background-image: radial-gradient(130% 100% at 85% -10%, rgba(255, 255, 255, .22), transparent 55%);
}
.ln-plan.featured:hover { transform: translateY(-9px) scale(1.01); box-shadow: 0 0 0 4px rgba(36, 87, 230, .2), 0 34px 85px rgba(36, 87, 230, .48); }
.ln-plan.featured::before { opacity: 0; }
.ln-plan-badge {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: #fff; color: #2457e6;
  border-radius: 999px; padding: 4px 13px;
  font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(15,23,42,.08); white-space: nowrap;
}
.ln-plan-name { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #94a3b8; margin: 0; }
.ln-plan-name.on-brand { color: rgba(219, 234, 254, .9); }
.ln-plan-price { display: flex; align-items: baseline; gap: 6px; margin-top: 12px; }
.ln-plan-price span { font-size: 2.4rem; font-weight: 800; letter-spacing: -.03em; }
.ln-plan-price small { font-size: 12px; font-weight: 700; color: #94a3b8; }
.ln-plan-price span.on-brand { color: #fff; }
.ln-plan-price small.on-brand { color: rgba(219, 234, 254, .9); }
.ln-plan-tagline { margin: 8px 0 0; font-size: 14px; line-height: 1.6; color: #64748b; }
.ln-plan-tagline.on-brand { color: rgba(219, 234, 254, .9); }
.ln-plan ul { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.ln-plan li { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; }
.ln-plan-check { color: #10b981; display: inline-flex; margin-top: 2px; }
.ln-plan-check.on-brand { color: rgba(219, 234, 254, .95); }
.ln-plan.featured li span.ln-plan-text-brand { color: #fff; }
.ln-plan li span:last-child { color: #334155; }
/* The featured plan card sits on the brand color in BOTH themes. Force every
   text element white so nothing can ever fall back to a dark-on-blue state in
   light mode (a recurring specificity bug). */
.ln-plan.featured .ln-plan-name,
.ln-plan.featured .ln-plan-price span,
.ln-plan.featured .ln-plan-price small,
.ln-plan.featured .ln-plan-tagline,
.ln-plan.featured li span:last-child,
.ln-plan.featured li span.ln-plan-text-brand,
.ln-plan.featured .ln-plan-check,
html[data-theme="light"] .ln-plan.featured .ln-plan-name,
html[data-theme="light"] .ln-plan.featured .ln-plan-price span,
html[data-theme="light"] .ln-plan.featured .ln-plan-price small,
html[data-theme="light"] .ln-plan.featured .ln-plan-tagline,
html[data-theme="light"] .ln-plan.featured li span:last-child,
html[data-theme="light"] .ln-plan.featured li span.ln-plan-text-brand,
html[data-theme="light"] .ln-plan.featured .ln-plan-check {
  color: #fff !important;
}
.ln-plan.featured .ln-plan-price small,
.ln-plan.featured .ln-plan-tagline,
.ln-plan.featured .ln-plan-check { opacity: .92; }
.ln-plan-cta {
  margin-top: 32px; height: 44px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 12px; border: 0;
  color: #fff; font-weight: 800; font-size: 14px;
  text-decoration: none; cursor: pointer;
  box-shadow: 0 8px 18px rgba(36, 87, 230, .2);
  transition: opacity .15s;
}
.ln-plan-cta:hover { opacity: .9; text-decoration: none; }
.ln-plan-cta.white { background: #fff; color: #2457e6; box-shadow: none; }
.ln-plan-cta.white:hover { background: #eff6ff; }
.ln-cta-wrap { max-width: 620px; margin: 0 auto; }
.ln-cta-icon { width: 48px; height: 48px; border-radius: 16px; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; }
.ln-cta-wrap h2 { font-size: var(--ln-h-size, 2.25rem); font-weight: 800; letter-spacing: -.03em; margin: 0 0 16px; font-family: var(--ln-font-heading, inherit); color: var(--ln-h-color, inherit); }
.ln-cta-wrap .muted { font-size: 15px; line-height: 1.7; margin-bottom: 28px; }
.ln-newsletter { display: flex; align-items: center; justify-content: space-between; gap: 40px; flex-wrap: wrap; padding-block: 14px; }
.ln-newsletter-copy { max-width: 420px; }
.ln-newsletter-copy h2 { font-size: var(--ln-h-size, 24px); font-weight: 800; letter-spacing: -.02em; margin: 8px 0 10px; font-family: var(--ln-font-heading, inherit); color: var(--ln-h-color, inherit); }
.ln-newsletter-copy .muted { font-size: 14px; line-height: 1.7; }
.ln-newsletter-form { display: flex; gap: 8px; width: 100%; max-width: 420px; }
.ln-newsletter-form input {
  flex: 1; min-width: 0;
  height: 44px; padding: 0 16px;
  border-radius: 12px; border: 1px solid #e2e8f0;
  background: #fff; font: inherit; font-size: 14px; color: #1e293b;
  box-shadow: 0 1px 2px rgba(15,23,42,.05); outline: none;
}
.ln-newsletter-form input:focus { border-color: #93c5fd; box-shadow: 0 0 0 4px rgba(59, 130, 246, .08); }
.ln-newsletter-form button {
  height: 44px; padding: 0 20px;
  border-radius: 12px; border: 0;
  color: #fff; font: inherit; font-weight: 800; font-size: 14px;
  cursor: pointer; transition: opacity .15s;
}
.ln-newsletter-form button:hover { opacity: .9; }

/* Landing FAQ (details/summary accordion) */
.ln-faq { display: grid; gap: 12px; max-width: 720px; margin: 0 auto; }
.ln-faq-item { border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.04); overflow: hidden; }
.ln-faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; font-weight: 700; font-size: 15px; cursor: pointer; list-style: none; }
.ln-faq-item summary::-webkit-details-marker { display: none; }
.ln-faq-item summary svg { flex-shrink: 0; color: #94a3b8; transition: transform .2s; }
.ln-faq-item[open] summary svg { transform: rotate(180deg); }
.ln-faq-item p { margin: 0; padding: 0 18px 16px; font-size: 14px; line-height: 1.7; color: #64748b; }
.ln-footer { border-top: 1px solid rgba(226, 232, 240, .7); padding: 24px; text-align: center; font-size: 12px; font-weight: 500; color: #94a3b8; }

/* Landing dark mode */
html[data-theme="dark"] .public-landing { color: #f1f5f9; }
html[data-theme="dark"] .ln-links a,
html[data-theme="dark"] .ln-signin { color: #94a3b8; }
html[data-theme="dark"] .ln-links a:hover,
html[data-theme="dark"] .ln-signin:hover { background: rgba(255, 255, 255, .06); color: #f1f5f9; }
/* Custom header colors are only meaningful in light mode — restore readable dark-mode text. */
html[data-theme="dark"] .ln-name { color: #f1f5f9; }
html[data-theme="dark"] .ln-links a { color: #94a3b8; }
/* The hero pill keeps its inline brand-colored text — flip it to light text on a dark pill in dark mode. */
html[data-theme="dark"] .ln-eyebrow { color: #bfdbfe !important; border-color: rgba(148, 163, 184, .28) !important; background-color: rgba(36, 50, 68, .55) !important; }
html[data-theme="dark"] .ln-hero-desc,
html[data-theme="dark"] .ln-card p,
html[data-theme="dark"] .ln-step p,
html[data-theme="dark"] .ln-section-head .muted,
html[data-theme="dark"] .ln-cta-wrap .muted,
html[data-theme="dark"] .ln-newsletter-copy .muted { color: #94a3b8; }
html[data-theme="dark"] .ln-btn-outline { background: #101a2c; border-color: #243244; color: #e2e8f0; }
html[data-theme="dark"] .ln-btn-outline:hover { background: #16233a; }
html[data-theme="dark"] .ln-section-tinted,
html[data-theme="dark"] .ln-section-newsletter { background: rgba(16, 26, 44, .6); border-color: rgba(36, 50, 68, .8); }
html[data-theme="dark"] .ln-faq-item { background: rgba(16, 26, 44, .6); border-color: #243244; }
html[data-theme="dark"] .ln-faq-item summary { color: #f1f5f9; }
html[data-theme="dark"] .ln-faq-item p { color: #94a3b8; }
/* Admin SEO page */
.seo-file-list { display: grid; gap: 8px; }
.seo-file-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; font-size: 13px; }
.seo-file-row .ok { color: #059669; font-weight: 700; }
.seo-file-row .missing { color: #d97706; font-weight: 700; }
.seo-file-row code { font-size: 12px; }
.seo-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.faq-row { display: grid; gap: 8px; padding: 12px; border: 1px solid #e2e8f0; border-radius: 12px; background: #f8fafc; }
html[data-theme="dark"] .seo-file-row { background: #0f172a; border-color: #243244; }
html[data-theme="dark"] .faq-row { background: rgba(16, 26, 44, .5); border-color: #243244; }
html[data-theme="dark"] .ln-card,
html[data-theme="dark"] .ln-step,
html[data-theme="dark"] .ln-plan { background: #101a2c; border-color: #243244; }
html[data-theme="dark"] .ln-card:hover,
html[data-theme="dark"] .ln-step:hover { box-shadow: 0 18px 50px rgba(0, 0, 0, .45); }
html[data-theme="dark"] .ln-card-icon { background: #16233a; }
html[data-theme="dark"] .ln-card h3,
html[data-theme="dark"] .ln-step h3 { color: #f1f5f9; }
html[data-theme="dark"] { --page-bg: #0b1220 !important; }
html[data-theme="dark"] .ln-mock { background: #0d1626; border-color: #243244; }
html[data-theme="dark"] .ln-mock-dots i { background: #334155; }
html[data-theme="dark"] .ln-mock-avatar.mc { background: rgba(36, 87, 230, .32); color: #9bbcff; }
html[data-theme="dark"] .ln-mock-avatar.ai { background: #334155; }
html[data-theme="dark"] .ln-mock-open { background: rgba(36, 87, 230, .28); color: #9bbcff; }
html[data-theme="dark"] .ln-mock-id { color: #9bbcff; }
html[data-theme="dark"] .ln-mock-ticket p { color: #64748b; }
html[data-theme="dark"] .ln-plan-name,
html[data-theme="dark"] .ln-plan-price small { color: #94a3b8; }
html[data-theme="dark"] .ln-plan li span:last-child { color: #cbd5e1; }
html[data-theme="dark"] .ln-plan-tagline { color: #94a3b8; }
html[data-theme="dark"] .ln-plan li { color: #e2e8f0; }
html[data-theme="dark"] .ln-newsletter-form input::placeholder { color: #64748b; }
html[data-theme="dark"] .ln-hero-checks { color: #64748b; }
html[data-theme="dark"] .ln-mock-title,
html[data-theme="dark"] .ln-mock-pane h3,
html[data-theme="dark"] .ln-mock-float strong,
html[data-theme="dark"] .ln-card h3,
html[data-theme="dark"] .ln-step h3 { color: #f1f5f9; }
html[data-theme="dark"] .ln-mock-head,
html[data-theme="dark"] .ln-mock-side { background: #101a2c; border-color: #243244; }
html[data-theme="dark"] .ln-mock-body { background: #0b1220; }
html[data-theme="dark"] .ln-mock-skeleton { background: #16233a; }
html[data-theme="dark"] .ln-mock-ticket-name { color: #cbd5e1; }
html[data-theme="dark"] .ln-mock-ticket.active { background: rgba(36, 87, 230, .2); }
html[data-theme="dark"] .ln-mock-ticket.active .ln-mock-ticket-name { color: #9bbcff; }
html[data-theme="dark"] .ln-mock-ticket-dot { background: #9bbcff; }
html[data-theme="dark"] .ln-mock-ticket-dot.dim { background: #334155; }
html[data-theme="dark"] .ln-mock-pane-head { border-color: #1e293b; }
html[data-theme="dark"] .ln-mock-pane-head h3 { color: #f1f5f9; }
html[data-theme="dark"] .ln-mock-bubble { background: #16233a; border-color: #243244; color: #cbd5e1; }
html[data-theme="dark"] .ln-mock-reply { background: #0d1626; border-color: #243244; }
html[data-theme="dark"] .ln-mock-float { background: #101a2c; border-color: #243244; }
html[data-theme="dark"] .ln-mock-float strong { color: #f1f5f9; }
html[data-theme="dark"] .ln-newsletter-form input { background: #0d1626; border-color: #243244; color: #f1f5f9; }
html[data-theme="dark"] .ln-footer { border-color: rgba(36, 50, 68, .8); }

/* Landing hero — single column on small screens (was missing). */
@media (max-width: 960px) {
  .ln-hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .ln-hero { padding-top: 92px; padding-bottom: 64px; }
  .ln-mock-float { left: 8px; }
}
@media (max-width: 640px) {
  .ln-h1 { font-size: 2.35rem; }
  .ln-hero-checks { gap: 6px 12px; }
}

/* --------------------------------------------------------------------------
   Site navigation + public pages
   -------------------------------------------------------------------------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  font-size: .85rem;
  letter-spacing: .02em;
}
.brand-logo { height: 34px; width: auto; max-width: 140px; object-fit: contain; border-radius: 8px; }
.brand-name { font-size: 1rem; letter-spacing: -.01em; }
.nav-links { display: flex; gap: 26px; font-size: .92rem; font-weight: 500; }
.nav-links a { color: var(--ink-soft); }
.nav-links a:hover { color: var(--brand); text-decoration: none; }
.nav-actions { display: flex; align-items: center; gap: 10px; }

/* Hero */
.hero { padding: 84px 0 72px; background: radial-gradient(1200px 500px at 75% -10%, var(--brand-soft), transparent 60%); }
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(2.2rem, 4.6vw, 3.4rem); margin-bottom: .35em; }
.hero .highlight { color: var(--brand); }
.hero-desc { font-size: 1.1rem; color: var(--ink-soft); max-width: 540px; }
.hero-actions { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.hero-visual { position: relative; }
.ticket-card.mock {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: rotate(-1.5deg);
}
.mock-head { display: flex; gap: 7px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #dbe1ea; }
.mock-body { padding: 20px 16px; display: flex; flex-direction: column; gap: 12px; }
.mock-row { height: 12px; border-radius: 6px; background: #eef2f7; width: 55%; }
.mock-row.wide { width: 88%; }
.mock-row.short { width: 38%; }
.chat-bubble.mock {
  position: absolute;
  bottom: -22px;
  left: -26px;
  background: var(--brand);
  color: #fff;
  padding: 13px 18px;
  border-radius: 14px 14px 14px 4px;
  font-size: .92rem;
  font-weight: 500;
  box-shadow: 0 12px 28px -10px var(--brand);
}

/* Sections */
.section { padding: 72px 0; }
.section-alt { background: var(--card); border-block: 1px solid var(--line); }
.section-head { max-width: 640px; margin: 0 auto 44px; text-align: center; }
.section-head h2 { font-size: 1.9rem; }
.section-head .muted { font-size: 1rem; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.feature-card p { color: var(--muted); margin: 0; }
.feature-icon {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 800;
  margin-bottom: 16px;
}
.offer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.offer-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
}
.offer-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.offer-card h3 { margin: 0 0 8px; }
.offer-card p { color: var(--muted); margin: 0; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step { text-align: center; padding: 20px; }
.step p { color: var(--muted); max-width: 260px; margin: 0 auto; }
.step-num {
  width: 46px; height: 46px;
  margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.pricing-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow);
}
.pricing-card.featured {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand), var(--shadow-lg);
  position: relative;
}
.pricing-card.featured::before {
  content: "Most popular";
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 99px;
}
.price { font-size: 2.4rem; font-weight: 800; letter-spacing: -.03em; }
.plan-features { list-style: none; margin: 6px 0 18px; padding: 0; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.plan-features li { display: flex; align-items: center; gap: 9px; font-size: .92rem; color: var(--ink-soft); }
.plan-features li::before { content: "✓"; color: var(--green); font-weight: 800; }

.cta-band { background: linear-gradient(120deg, var(--brand-dark), var(--brand)); }
.cta-inner { padding: 64px 24px; text-align: center; color: #fff; }
.cta-inner h2 { font-size: 2rem; margin-bottom: .3em; }
.cta-inner p { opacity: .85; margin-bottom: 26px; }

.site-footer { background: #0f172a; color: #cbd5e1; padding: 44px 0; }
html[data-theme="dark"] .site-footer { background: #0d1626; color: #cbd5e1; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.footer-inner p { margin: 0; }
.newsletter-form { max-width: 420px; width: 100%; }
.newsletter-row { display: flex; gap: 8px; }
.newsletter-row input {
  flex: 1;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid #334155;
  background: #1e293b;
  color: #fff;
  font: inherit;
}
.newsletter-note { font-size: .78rem; color: #94a3b8; margin-top: 8px; }

/* --------------------------------------------------------------------------
   Page body (portal / ticket / catalog)
   -------------------------------------------------------------------------- */
.page-body { background: var(--bg); }
.page-body .site-nav { position: static; }
.page-head { padding: 34px 0 18px; }
.page-head h1 { margin-bottom: .15em; }
.ticket-title-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ticket-num { color: var(--muted); font-family: var(--mono); font-size: .9rem; }
.ticket-row-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.ticket-list { display: flex; flex-direction: column; gap: 10px; }
.ticket-row {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: border-color .15s, transform .1s;
}
.ticket-row:hover { border-color: var(--brand); text-decoration: none; transform: translateY(-1px); }
.ticket-row-main strong { display: block; }
.ticket-row-main .muted { font-size: .82rem; }

/* Catalog */
.catalog-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.catalog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.catalog-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform .15s, box-shadow .15s;
}
.catalog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); text-decoration: none; }
.catalog-card h3 { margin: 0; }
.catalog-card p { color: var(--muted); font-size: .9rem; margin: 0; }
.catalog-card-top { display: flex; justify-content: space-between; align-items: center; }
.tag, .chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: .72rem;
  font-weight: 600;
}
.check-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 99px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: .82rem;
  font-weight: 600;
}
.prose { line-height: 1.75; color: var(--ink-soft); }
.still-stuck { background: var(--brand-soft); border-radius: var(--radius); padding: 20px; }

/* --------------------------------------------------------------------------
   Auth page
   -------------------------------------------------------------------------- */
.auth-body { background: radial-gradient(1000px 500px at 50% -10%, var(--brand-soft), var(--bg) 60%); min-height: 100vh; }
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 38px 34px;
}
.auth-brand { display: flex; justify-content: center; margin-bottom: 22px; }
.auth-brand img { height: 42px; }
.auth-card h1 { font-size: 1.45rem; text-align: center; }
.auth-card .muted { text-align: center; }
.auth-card form { margin-top: 18px; }
.auth-card .btn-block { margin-top: 4px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .8rem; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-foot { text-align: center; font-size: .82rem; color: var(--muted); margin: 18px 0 0; }
.dev-code-box {
  text-align: center;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 16px;
  margin: 14px 0;
}
.dev-code-label { display: block; font-size: .78rem; font-weight: 600; color: #92400e; margin-bottom: 6px; }
.dev-code {
  display: inline-block;
  font-family: var(--mono);
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: .35em;
  color: #2457e6;
  background: #fff;
  border: 1px dashed #f59e0b;
  border-radius: 10px;
  padding: 8px 18px 8px 22px;
}
.dev-code-note { display: block; font-size: .75rem; color: #92400e; margin-top: 8px; }

/* --------------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------------- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: capitalize;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--line);
}
.badge-open { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.badge-pending { background: var(--brand-soft); border-color: #c7d7fe; color: #1e40af; }
.badge-resolved { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.badge-priority { text-transform: none; }
.badge-unverified { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.badge-low { background: #f1f5f9; border-color: var(--line); color: var(--muted); }
.badge-normal { background: var(--brand-soft); border-color: #c7d7fe; color: #1e40af; }
.badge-high { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.badge-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.badge-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }

.portal-impersonate-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; font-size: .84rem;
  background: #fffbeb; border-bottom: 1px solid #fde68a; color: #92400e;
}
html[data-theme="dark"] .portal-impersonate-bar { background: rgba(251, 191, 36, .12); border-bottom-color: rgba(251, 191, 36, .25); color: #fcd34d; }
.portal-impersonate-bar a { font-weight: 700; color: inherit; text-decoration: none; white-space: nowrap; }
.portal-impersonate-bar a:hover { text-decoration: underline; }

/* Customers page */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
.card-title { font-size: .95rem; font-weight: 800; margin: 0 0 14px; }
.detail-list { margin: 0; display: grid; gap: 12px; }
.detail-list > div { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: baseline; }
.detail-list dt { font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.detail-list dd { margin: 0; font-size: .92rem; word-break: break-word; }
.table-wrap { padding: 6px 0 0; }
.pagination { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   Channels (portal helpdesk settings)
   -------------------------------------------------------------------------- */
.channel-row { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--bg); }
.channel-row-head { margin-bottom: 10px; }
.channel-row-head .muted { margin: 4px 0 0; }
.channel-badge {
  display: inline-block; padding: 3px 12px; border-radius: 99px;
  font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}
.channel-tg { background: #e0f2fe; border: 1px solid #bae6fd; color: #075985; }
.channel-wa { background: #dcfce7; border: 1px solid #bbf7d0; color: #166534; }
.channel-fb { background: #dbeafe; border: 1px solid #bfdbfe; color: #1e40af; }
.channel-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 38px; }

/* --------------------------------------------------------------------------
   Onboarding wizard
   -------------------------------------------------------------------------- */
.onboarding-wrap { padding-top: 40px; padding-bottom: 80px; max-width: 980px; }
.onboarding-head { margin-bottom: 26px; }
.onboarding-head h1 { margin: 6px 0 8px; font-size: 2rem; letter-spacing: -.03em; }
.onboarding-grid { display: grid; grid-template-columns: 240px 1fr; gap: 22px; align-items: start; }
@media (max-width: 820px) { .onboarding-grid { grid-template-columns: 1fr; } }
.onboarding-rail { display: flex; flex-direction: column; gap: 8px; position: sticky; top: 24px; }
@media (max-width: 820px) { .onboarding-rail { position: static; flex-direction: row; overflow-x: auto; } }
.onb-step {
  display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px;
  border: 1px solid transparent; color: var(--muted); text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
.onb-step:hover { background: var(--bg); text-decoration: none; color: var(--ink); }
.onb-step.active { background: var(--brand-soft); border-color: #c7d7fe; color: var(--ink); }
.onb-step.done .onb-step-num { background: #10b981; color: #fff; border-color: transparent; }
.onb-step-num {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--line);
  font-size: .8rem; font-weight: 800;
}
.onb-step strong { display: block; font-size: .88rem; line-height: 1.25; }
.onb-step small { font-size: .72rem; }
.onboarding-panel { padding: 26px; }
.onb-panel-head { margin-bottom: 20px; }
.onb-panel-head h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-size: 1.15rem; }
.onb-option { border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 16px; background: var(--bg); }
.onb-option-head h3 { margin: 8px 0 4px; font-size: .95rem; }
.onb-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px;
  font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  background: var(--brand-soft); border: 1px solid #c7d7fe; color: #1e40af;
}
.onb-chip-brand { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.onb-download-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.onb-locked { border: 1px dashed var(--line); border-radius: 14px; padding: 20px; background: var(--bg); }
.onb-plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 820px) { .onb-plans { grid-template-columns: 1fr; } }
.onb-plan {
  position: relative; border: 1px solid var(--line); border-radius: 16px; padding: 20px 18px;
  display: flex; flex-direction: column; background: var(--card);
}
.onb-plan.featured { border: 2px solid var(--plan-accent, var(--brand)); box-shadow: 0 18px 40px -18px rgba(15,23,42,.18); }
.onb-plan-tag {
  position: absolute; top: -10px; left: 14px; padding: 2px 10px; border-radius: 99px;
  background: var(--plan-accent, var(--brand)); color: #fff; font-size: .68rem; font-weight: 800;
  letter-spacing: .05em; text-transform: uppercase;
}
.onb-plan h3 { margin: 0 0 2px; font-size: 1rem; }
.onb-plan-price strong { font-size: 1.6rem; letter-spacing: -.03em; }
.onb-plan-price small { color: var(--muted); font-size: .8rem; }
.onb-plan ul { list-style: none; margin: 12px 0 16px; padding: 0; display: grid; gap: 7px; flex: 1; }
.onb-plan ul li { display: flex; gap: 8px; align-items: flex-start; font-size: .84rem; color: var(--ink); }
.onb-plan ul svg { color: #10b981; flex-shrink: 0; margin-top: 2px; }
.onb-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.onboarding-skip { text-align: center; margin-top: 18px; }

/* --------------------------------------------------------------------------
   Admin shell
   -------------------------------------------------------------------------- */
.admin-body { background: var(--bg); }
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 252px;
  flex-shrink: 0;
  background: #0f172a;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.admin-brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 18px; color: #fff; text-decoration: none; }
.admin-brand:hover { text-decoration: none; }
.admin-brand .brand-mark { background: var(--brand); }
.admin-brand-name { display: block; font-weight: 700; font-size: .95rem; color: #fff; }
.admin-brand-sub { display: block; font-size: .72rem; color: #94a3b8; }
.admin-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.admin-nav-link {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: #cbd5e1;
  font-size: .9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .12s, color .12s;
}
.admin-nav-link:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
.admin-nav-link.active { background: var(--brand); color: #fff; }
.admin-sidebar-foot { border-top: 1px solid #334155; padding-top: 14px; margin-top: 14px; }
.admin-user { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.admin-user-meta strong { display: block; font-size: .85rem; color: #fff; }
.admin-user-meta .muted { color: #94a3b8; font-size: .75rem; }
.admin-sidebar-foot .btn-link { color: #94a3b8; }
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-content { flex: 1; padding: 30px 34px 20px; max-width: 1240px; width: 100%; margin: 0 auto; }
.admin-footer {
  padding: 16px 34px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  font-size: .8rem;
  color: var(--muted);
}
.admin-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.admin-head h1 { margin: 0; font-size: 1.6rem; }

.avatar {
  width: 34px; height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: .78rem;
}

/* Cards + grids */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.card-head { margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 22px; }
.stat-grid-4 { grid-template-columns: repeat(4, 1fr); }
.stat-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  color: inherit;
  text-decoration: none;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
a.stat-card:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow-lg); text-decoration: none; }
.stat-label { display: block; font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.stat-value { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }
.accent-amber .stat-value { color: var(--amber); }
.accent-blue .stat-value { color: var(--brand); }
.accent-emerald .stat-value { color: var(--green); }
.admin-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.admin-grid-2 > .card { margin-bottom: 20px; }

/* Traffic chart */
.traffic-card { margin-bottom: 20px; }
.traffic-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.traffic-head h2 { margin: 0; }
.range-switch { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 99px; padding: 3px; }
.range-btn {
  padding: 5px 14px;
  border-radius: 99px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}
.range-btn:hover { text-decoration: none; color: var(--ink); }
.range-btn.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.chart { display: flex; align-items: flex-end; gap: 3px; height: 190px; padding-top: 10px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.chart-bars { display: flex; align-items: flex-end; gap: 2px; width: 100%; height: 160px; justify-content: center; }
.bar { width: 8px; border-radius: 4px 4px 0 0; min-height: 2px; transition: height .3s; }
.bar-views { background: var(--brand); opacity: .85; }
.bar-uniques { background: var(--green); opacity: .7; }
.chart-label { font-size: .62rem; color: var(--muted); white-space: nowrap; }
.chart-legend { display: flex; gap: 18px; align-items: center; font-size: .8rem; color: var(--muted); margin-top: 12px; }
.legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.dot-views { background: var(--brand); }
.dot-uniques { background: var(--green); }

/* Lists + tables */
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}
.list-row:last-child { border-bottom: 0; }
.list-row:hover { text-decoration: none; }
.list-row-main strong { display: block; font-size: .92rem; }
.list-row-main .muted { font-size: .8rem; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th {
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbfd; }
.table-subject { font-weight: 600; color: var(--ink); }
.table-name { display: block; font-weight: 500; }
.table-name + .muted { font-size: .78rem; }
.th-right { text-align: right !important; }
.td-right { text-align: right; white-space: nowrap; }
.table-row-open td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.table-row-pending td:first-child { box-shadow: inset 3px 0 0 var(--brand); }

.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.filter-bar .input:first-child { flex: 1; min-width: 200px; }
.filter-bar select.input { width: auto; }

.empty { text-align: center; padding: 40px 20px; }
.empty h3 { margin-bottom: .2em; }
.empty.small { padding: 24px; }

/* Message thread */
.thread { display: flex; flex-direction: column; gap: 16px; }
.msg { padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); max-width: 86%; }
.msg-customer { background: var(--brand-soft); border-color: #c7d7fe; align-self: flex-start; }
.msg-agent { background: #f8fafc; align-self: flex-end; }
.msg-head { display: flex; justify-content: space-between; gap: 12px; font-size: .82rem; margin-bottom: 5px; }
.msg-body { white-space: pre-wrap; font-size: .93rem; }
.reply-box { margin-top: 20px; }
.reply-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.reply-actions .btn-primary { margin-left: auto; }

/* Ticket detail layout */
.ticket-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.ticket-main { display: flex; flex-direction: column; gap: 20px; }
.ticket-side { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 20px; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; font-size: .88rem; align-items: baseline; }
.kv .muted { font-size: .78rem; }

/* Team page */
.op-row, .cat-row { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 10px; background: #fbfcfe; }
.op-grid { display: flex; align-items: center; gap: 12px; }
.op-fields { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.op-fields .input { width: 100%; }
.op-fields .muted { font-size: .78rem; }
.op-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.op-controls select.input { width: auto; }
.cat-fields { display: flex; gap: 10px; align-items: center; }
.cat-row > .input { margin-top: 8px; }
.cat-controls { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.add-box { border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 12px; }
.add-box summary { cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--brand); }
.add-form { margin-top: 12px; }
.add-form input[type="color"] { width: 52px; }

/* Catalog admin */
.catalog-item { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 10px; }
.catalog-item summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; cursor: pointer; list-style: none; }
.catalog-item summary::-webkit-details-marker { display: none; }
.catalog-item summary strong { display: block; }
.catalog-item[open] summary { border-bottom: 1px solid var(--line); }
.catalog-edit { padding: 15px; }

/* Settings */
.settings-layout { display: grid; grid-template-columns: 210px 1fr; gap: 24px; align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: 3px; position: sticky; top: 20px; }
.settings-nav-link {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
}
.settings-nav-link:hover { background: var(--card); border: 1px solid var(--line); padding: 8px 11px; text-decoration: none; }
.settings-nav-link.active { background: var(--brand); color: #fff; }
.settings-panel { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.settings-panel form > .btn-primary { align-self: flex-start; margin-top: 4px; }
.logo-row { display: flex; gap: 20px; align-items: flex-start; }
.logo-preview {
  width: 150px; height: 100px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  padding: 10px;
  background: #fbfcfe;
}
.logo-preview img { max-height: 80px; max-width: 130px; object-fit: contain; }
.plan-editor { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 15px; display: flex; flex-direction: column; gap: 10px; }
.plan-editor-head { display: flex; justify-content: space-between; align-items: center; }
.ai-key-row { display: grid; grid-template-columns: 220px 1fr; gap: 12px; align-items: center; }
.ai-key-row .field-label { margin: 0; }

/* Frontend links */
.frontend-links { display: flex; flex-direction: column; }

/* HTML editor (newsletter) */
.html-editor { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.html-toolbar {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.html-toolbar select, .html-toolbar input[type="color"] { height: 30px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: .8rem; }
.tool-btn {
  width: 30px; height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font: inherit;
  font-size: .82rem;
  cursor: pointer;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tool-btn:hover { border-color: var(--brand); color: var(--brand); }
.tool-btn.active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.toolbar-sep { width: 1px; height: 22px; background: var(--line); margin: 0 3px; }
.html-content {
  min-height: 220px;
  max-height: 460px;
  overflow-y: auto;
  padding: 14px 16px;
  font-size: .95rem;
  line-height: 1.65;
  outline: none;
}
.html-content:focus { box-shadow: inset 0 0 0 3px var(--brand-soft); }
.html-source { border: 0; border-radius: 0; min-height: 220px; font-family: var(--mono); font-size: .84rem; }

/* Modal */
.modal {
  border: 0;
  border-radius: 18px;
  padding: 26px;
  max-width: 460px;
  width: calc(100vw - 40px);
  box-shadow: var(--shadow-lg);
}
.modal::backdrop { background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px); }
.modal h2 { margin-top: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.key-help-steps { margin: 10px 0 16px; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: .9rem; line-height: 1.55; color: var(--ink-soft); }
.key-help-steps li::marker { color: var(--brand); font-weight: 700; }

.bulk-bar { display: flex; align-items: center; gap: 12px; padding-top: 12px; }

/* Misc admin */
.quick-links { display: flex; flex-direction: column; gap: 8px; }
.row-actions { display: inline-flex; gap: 6px; }
.inbox { padding: 8px; overflow-x: auto; }
.inbox .table td, .inbox .table th { padding: 11px 10px; }
.inbox { overflow-x: auto; }

/* Responsive */
@media (max-width: 960px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; }
  .admin-sidebar-foot { border: 0; padding: 0; margin: 0; }
  .admin-content { padding: 20px 16px; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .stat-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .admin-grid-2, .ticket-layout, .settings-layout { grid-template-columns: 1fr; }
  .ticket-side { position: static; }
  .hero-inner, .feature-grid, .offer-grid, .steps, .pricing-grid, .catalog-grid { grid-template-columns: 1fr; }
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .chat-bubble.mock { left: 8px; }
  .ai-key-row { grid-template-columns: 1fr; gap: 4px; }
}

/* ---- Footer widget blocks + copyright line (v1.0.19) ----
   Overrides placed last so they win the cascade over any legacy .sf-* rules.
   Admin: System settings -> Header & footer. */
/* v1.0.47 - WordPress-style footer: four widget columns with headings, left-aligned,
   plus a bottom bar for the links row and the copyright line. */
body .site-footer .sf-widgets { max-width: 1240px; margin: 0 auto; padding: 44px 20px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px 32px; align-items: start; }
body .site-footer .sf-widget { text-align: left; }
body .site-footer .sf-widget[data-align="center"] { text-align: center; }
body .site-footer .sf-widget[data-align="right"] { text-align: right; }
body .site-footer .sf-widget-heading { margin: 0 0 12px; font-size: .82rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #f1f5f9; font-family: var(--fw-font, inherit); }
body .site-footer .sf-widget-text { display: block; font-size: var(--fw-size, 13px); line-height: 1.7; font-weight: 500; font-family: var(--fw-font, inherit); color: var(--fw-color, #cbd5e1); }
body .site-footer .sf-powered-link { color: var(--fw-color, #cbd5e1); text-decoration: underline; text-underline-offset: 2px; }
body .site-footer .sf-powered-link:hover { color: #fff; }
body .site-footer .sf-bottom { max-width: 1240px; margin: 34px auto 0; padding: 18px 20px 26px; border-top: 1px solid rgba(148, 163, 184, .22); }
body .site-footer .sf-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 22px;
  padding: 0 0 14px;
}
.sf-links a {
  color: #cbd5e1;
  font-size: .82rem;
  font-weight: 500;
  text-decoration: none;
  transition: color .15s ease;
}
.sf-links a:hover { color: #fff; text-decoration: none; }
html[data-theme="light"] .sf-links a { color: #64748b; }
/* Footer links placed under a widget column (System settings -> Header & footer) */
body .site-footer .sf-widget-links { margin: 12px 0 0; display: flex; flex-direction: column; gap: 8px; }
body .site-footer .sf-widget-links a {
  color: var(--fw-color, #cbd5e1);
  font-size: var(--fw-size, 13px);
  font-weight: 500;
  font-family: var(--fw-font, inherit);
  line-height: 1.5;
  text-decoration: none;
  transition: color .15s ease;
}
body .site-footer .sf-widget-links a:hover { color: #fff; text-decoration: none; }
html[data-theme="light"] body .site-footer .sf-widget-links a { color: #64748b; }
html[data-theme="light"] body .site-footer .sf-widget-links a:hover { color: var(--brand); }
html[data-theme="light"] .sf-links a:hover { color: var(--brand); }
.sf-copyright-line { max-width: 1240px; margin: 0 auto; padding: 0 20px; text-align: center; }
body .site-footer .sf-copyright-line[data-align="left"] { text-align: left; }
body .site-footer .sf-copyright-line[data-align="right"] { text-align: right; }
body .site-footer .sf-copyright-text { font-size: var(--fw-size, 11px); font-family: var(--fw-font, inherit); color: var(--fw-color, #cbd5e1); opacity: .75; }
@media (max-width: 900px) {
  body .site-footer .sf-widgets { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  body .site-footer .sf-widgets { grid-template-columns: 1fr; padding-top: 30px; }
}

/* 4-column form row (Header & footer tab) */
.form-row-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 14px; }
@media (max-width: 900px) {
  .form-row-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .form-row-4 { grid-template-columns: 1fr; }
}

/* Header/footer menu-link editors (System settings → Header & footer) */
.menu-link-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.menu-link-row .input { flex: 1; min-width: 0; }
.menu-link-row .btn-sm { flex-shrink: 0; }
@media (max-width: 620px) {
  .menu-link-row { flex-wrap: wrap; }
  .menu-link-row .input { flex: 1 1 100%; }
}


/* Ticket attachments */
.ticket-attach { margin-top: 8px; }
.ticket-attach a { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; font-size: .8rem; font-weight: 600; color: var(--brand); background: var(--brand-soft); border: 1px solid #c7d7fe; border-radius: 8px; padding: 5px 10px; text-decoration: none; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ticket-attach a:hover { background: #e8eefc; }

/* Internal notes (staff-only) */
.msg-note { align-self: stretch !important; max-width: 100% !important; background: #fffbeb; border: 1px dashed #e8c268; }
.msg-note .msg-head { justify-content: flex-start; }
.msg-note .msg-body { color: #6b5b2e; font-size: .9rem; }
.note-tag { display: inline-flex; align-items: center; background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; border-radius: 99px; padding: 2px 8px; margin-right: 6px; }
.note-box { border: 1px dashed var(--line); }
.note-summary { cursor: pointer; font-weight: 600; font-size: .88rem; color: #92400e; }

/* Inbox bulk actions */
.bulk-col { width: 34px; text-align: center; }
.bulk-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-top: 1px solid var(--line); background: var(--bg); }
.bulk-bar .input { width: auto; }
.bulk-bar select.input { min-width: 150px; }

/* Portal chat composer attachment button */
.chat-attach-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; font-size: 1rem; flex-shrink: 0; }
.chat-attach-btn:hover { border-color: var(--brand); }

html[data-theme="dark"] .msg-note { background: #2a2413; border-color: #8a6d2a; }
html[data-theme="dark"] .msg-note .msg-body { color: #e6d9ae; }
html[data-theme="dark"] .note-tag { background: #3a2f10; color: #fcd34d; border-color: #8a6d2a; }
html[data-theme="dark"] .note-summary { color: #fcd34d; }
html[data-theme="dark"] .ticket-attach a { background: #16233a; border-color: #34508c; }
