/* Deluxe Knowledge Hub v4 - Styles */
/* Deluxe Brand Guidelines — Light Theme */

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap');

:root {
  --bg: #F5F5F5;
  --surface: #FFFFFF;
  --primary: #05AFEE;
  --secondary: #FF9900;
  --text: #1E293B;
  --text-dim: #6B7280;
  --border: #E5E1DF;
  --border-strong: #D1CCC9;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;
  --nav-bg: #263371;
  --nav-text: #FFFFFF;
  --nav-text-dim: rgba(255,255,255,0.7);
  --heading-color: #263371;
  --link-color: #05AFEE;
  --highlight: #B2D8F0;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { overflow-x: hidden; max-width: 100vw; }

body {
  font-family: 'Open Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

a { color: var(--link-color); text-decoration: none; }
a:hover { text-decoration: underline; }

button {
  font-family: inherit; cursor: pointer; border: none;
  background: var(--primary); color: white;
  padding: 10px 20px; border-radius: 6px;
  font-size: 14px; font-weight: 600;
  transition: opacity 0.2s;
}
button:hover { opacity: 0.9; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

input, textarea, select {
  font-family: inherit; font-size: 14px; padding: 10px;
  border: 1px solid var(--border-strong); border-radius: 6px;
  background: #FFFFFF; color: var(--text); width: 100%;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(5,175,238,0.1);
}

input[readonly] { opacity: 0.6; cursor: not-allowed; }

/* App Layout — sidebar + main */
.app-layout {
  display: flex; min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 240px; min-width: 240px; background: var(--nav-bg);
  display: flex; flex-direction: column; justify-content: space-between;
  position: fixed; top: 0; left: 0; height: 100vh; z-index: 500;
  overflow-y: auto;
}
.sidebar-top { padding: 20px 16px 8px; }
.sidebar-logo { padding: 0 4px 16px; }
.sidebar-logo img { height: 36px; width: auto; }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav a, .sidebar-nav-link {
  display: flex; align-items: center; gap: 10px;
  color: var(--nav-text-dim); font-size: 14px; padding: 10px 12px;
  border-radius: 8px; text-decoration: none; transition: background 0.15s, color 0.15s;
}
.sidebar-nav a:hover, .sidebar-nav-link:hover { background: rgba(255,255,255,0.08); color: var(--nav-text); text-decoration: none; }
.sidebar-nav a.active, .sidebar-nav-link.active { background: rgba(255,255,255,0.12); color: #fff; font-weight: 600; }
.sidebar-nav a svg, .sidebar-nav-link svg { flex-shrink: 0; opacity: 0.7; }
.sidebar-nav a.active svg, .sidebar-nav-link.active svg { opacity: 1; }
.sidebar-divider { height: 1px; background: rgba(255,255,255,0.1); margin: 8px 4px; }
.sidebar-bottom { padding: 8px 16px 16px; }
.sidebar-bottom .sidebar-nav-link { padding: 8px 12px; font-size: 13px; }
.sidebar-user {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: 8px; margin-top: 4px;
}
.sidebar-user-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sidebar-user-name { color: var(--nav-text); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { color: var(--nav-text-dim); font-size: 11px; }
.sidebar-logout {
  color: var(--nav-text-dim); padding: 6px; border-radius: 6px;
  transition: background 0.15s, color 0.15s; flex-shrink: 0;
}
.sidebar-logout:hover { background: rgba(255,255,255,0.1); color: var(--nav-text); }

/* Sidebar collapse button — styled like a nav link */
.sidebar-collapse-btn {
  display: flex; align-items: center; gap: 10px;
  background: none; border: none; color: var(--nav-text-dim); cursor: pointer;
  padding: 8px 12px; margin-top: 4px; border-radius: 8px; font-size: 13px;
  width: 100%; transition: background 0.15s, color 0.15s;
}
.sidebar-collapse-btn:hover { background: rgba(255,255,255,0.08); color: var(--nav-text); }
.sidebar-collapse-btn .sidebar-collapse-icon { flex-shrink: 0; opacity: 0.7; }
.sidebar.collapsed .sidebar-collapse-btn { justify-content: center; padding: 10px; }
.sidebar.collapsed .sidebar-collapse-btn span { display: none; }
.sidebar.collapsed .sidebar-collapse-btn .sidebar-collapse-icon { transform: rotate(180deg); }

/* Sidebar collapsed state */
.sidebar.collapsed { width: 56px; min-width: 56px; transition: width 0.2s ease, min-width 0.2s ease; }
.sidebar { transition: width 0.2s ease, min-width 0.2s ease; }
.sidebar.collapsed .sidebar-nav a span,
.sidebar.collapsed .sidebar-bottom .sidebar-nav-link span,
.sidebar.collapsed .sidebar-logo,
.sidebar.collapsed .sidebar-user-info,
.sidebar.collapsed .sidebar-divider { display: none; }
.sidebar.collapsed .sidebar-nav a,
.sidebar.collapsed .sidebar-bottom .sidebar-nav-link { justify-content: center; padding: 10px; }
.sidebar.collapsed .sidebar-nav a svg,
.sidebar.collapsed .sidebar-bottom .sidebar-nav-link svg { margin: 0; }
.sidebar.collapsed .sidebar-top { padding: 12px 8px 8px; }
.sidebar.collapsed .sidebar-bottom { padding: 8px; }
.sidebar.collapsed .sidebar-user { justify-content: center; padding: 10px 0; }
.sidebar.collapsed .sidebar-logout { margin: 0 auto; }

/* Impersonation banner */
.impersonation-banner {
  background: #f59e0b; color: #000; padding: 6px 16px; font-size: 13px; font-weight: 500;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.impersonation-banner button {
  background: #fff; color: #000; border: none; padding: 4px 12px; border-radius: 4px;
  font-size: 12px; cursor: pointer; font-weight: 600;
}
.impersonation-banner button:hover { background: #f3f4f6; }

/* Main content area */
.main-content { flex: 1; margin-left: 240px; min-height: 100vh; display: flex; flex-direction: column; transition: margin-left 0.2s ease; }
.main-content.sidebar-collapsed { margin-left: 56px; }

/* Topbar (KB selector + mobile hamburger) */
.topbar {
  display: flex; align-items: center; background: #1a2455;
  border-bottom: 1px solid rgba(255,255,255,0.1); position: sticky; top: 0; z-index: 400;
}
.topbar .nav-hamburger { display: none; }
.topbar .kb-bar { flex: 1; border-bottom: none; }

/* Hamburger — hidden on desktop */
.nav-hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; padding: 8px; cursor: pointer;
}
.nav-hamburger span { display: block; width: 22px; height: 2px; background: #fff; border-radius: 2px; transition: 0.3s; }

/* Legacy compat — keep dropdown styles for any remaining uses */
.nav-dropdown-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  min-width: 200px; z-index: 600; overflow: hidden;
}
.nav-dropdown-menu.active { display: block; }
.nav-dropdown-menu a {
  display: block; padding: 10px 16px; color: var(--text);
  font-size: 13px; text-decoration: none; transition: background 0.15s;
}
.nav-dropdown-menu a:hover { background: var(--bg); text-decoration: none; }
.nav-dropdown-menu a.active { color: var(--primary); font-weight: 600; }
.nav-dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* Container */
.container { max-width: 1400px; margin: 0 auto; padding: 32px 24px; }

/* Hub Header */
.hub-header {
  display: flex; align-items: center; gap: 16px; margin-bottom: 24px;
}
.hub-header .search-box { flex: 1; }
.hub-actions { display: flex; gap: 12px; flex-shrink: 0; }

/* Department Groups */
.category-group { margin-bottom: 48px; }
.group-title {
  font-size: 18px; font-weight: 700; color: var(--heading-color);
  margin-bottom: 24px; padding-bottom: 12px;
  border-bottom: 2px solid var(--border-strong);
}
.non-classified .group-title { color: var(--text-dim); font-style: italic; }
.type-group { margin-bottom: 16px; }
.type-header {
  font-size: 11px; font-weight: 600; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px;
}

/* Article Rows */
.article-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 6px;
  margin-bottom: 8px; cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.article-row:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(5,175,238,0.08); }
.article-title { flex: 1; font-weight: 500; }
.team-chip {
  font-size: 11px; color: var(--text-dim);
  background: rgba(5,175,238,0.08);
  padding: 4px 8px; border-radius: 4px;
}
.view-count { font-size: 11px; color: var(--text-dim); }

/* Badges */
.type-badge, .status-badge, .risk-badge {
  font-size: 11px; font-weight: 600;
  padding: 4px 8px; border-radius: 4px;
  text-transform: uppercase; white-space: nowrap;
  display: inline-block;
}
.type-badge.info { background: #3b82f6; color: white; }
.type-badge.policy { background: #263371; color: white; }
.type-badge.program { background: #FF9900; color: white; }
.type-badge.process { background: #05AFEE; color: white; }
.type-badge.sop { background: #10b981; color: white; }
.type-badge.tutorial { background: #FFC900; color: #1E293B; }
.type-badge.template { background: #E63BE9; color: white; }

.status-badge.requested { background: #6b7280; color: white; }
.status-badge.draft { background: #3b82f6; color: white; }
.status-badge.for_approval { background: #f59e0b; color: white; }
.status-badge.on_hold { background: #ef4444; color: white; }
.status-badge.edit_required { background: #E63BE9; color: white; }
.status-badge.published { background: #10b981; color: white; }

.edit-required-banner {
  background: #fef3c7; border: 1px solid #f59e0b; border-radius: 8px;
  padding: 12px 16px; margin-bottom: 16px; font-size: 14px;
}
.edit-required-banner strong { color: #92400e; }

.risk-badge.low { background: #10b981; color: white; }
.risk-badge.medium { background: #f59e0b; color: white; }
.risk-badge.high { background: #ef4444; color: white; }

/* Priority Badges */
.priority-badge {
  font-size: 10px; font-weight: 600; padding: 2px 8px;
  border-radius: 4px; text-transform: uppercase;
  display: inline-block; white-space: nowrap;
}
.priority-badge.high { background: #fee2e2; color: #dc2626; }
.priority-badge.medium { background: #fef3c7; color: #d97706; }
.priority-badge.low { background: #dbeafe; color: #2563eb; }

/* Assignment Items */
.assignment-item {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px;
  gap: 16px;
}
.assignment-item-main { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.assignment-item-main strong { font-size: 15px; }
.assignment-item-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: flex-start; }
.assignment-status {
  font-size: 11px; font-weight: 600; padding: 2px 8px;
  border-radius: 4px; text-transform: uppercase;
  display: inline-block;
}
.assignment-status.pending { background: #6b7280; color: white; }
.assignment-status.in_progress { background: #3b82f6; color: white; }
.assignment-status.completed { background: #10b981; color: white; }
.assignment-status.dismissed { background: #ef4444; color: white; }

/* Assignment form rows */
.assignment-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.assignment-row {
  display: flex; gap: 8px; align-items: center;
  padding: 12px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 6px;
}
.assignment-row input { flex: 2; }
.assignment-row select { flex: 0 0 120px; width: 120px; }
.assignment-row .btn-sm { flex-shrink: 0; }

/* Article Viewer */
.article-actions-bar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; padding: 10px 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px;
}
.article-actions-right { display: flex; gap: 8px; align-items: center; }
.article-header { margin-bottom: 24px; }
.article-meta { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.article-title-main { font-size: 22px; font-weight: 700; margin-bottom: 12px; color: var(--heading-color); }
.article-purpose { font-size: 16px; color: var(--text-dim); margin-bottom: 24px; }

/* Favorite star button */
.fav-star-btn {
  background: none; border: none; font-size: 28px; cursor: pointer;
  color: var(--text-dim); line-height: 1; padding: 4px; transition: color 0.15s;
}
.fav-star-btn:hover { color: #f59e0b; }
.fav-star-btn.favorited { color: #f59e0b; }
.fav-star {
  font-size: 16px; color: var(--text-dim); cursor: pointer; flex-shrink: 0;
  transition: color 0.15s; padding: 0 2px;
}
.fav-star:hover { color: #f59e0b; }
.fav-star.favorited { color: #f59e0b; }

.governance-bar {
  background: var(--surface); padding: 16px; border-radius: 10px;
  border: 1px solid var(--border); margin-bottom: 24px;
  display: flex; gap: 24px; font-size: 12px; flex-wrap: wrap;
}
/* Mobile accordion for governance */
.governance-mobile { display: none; }
.governance-accordion {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; margin-bottom: 24px; overflow: hidden;
}
.governance-accordion-toggle {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; background: var(--surface); color: var(--heading-color);
  font-size: 14px; font-weight: 600; border: none; cursor: pointer;
}
.governance-chevron { transition: transform 0.2s; }
.governance-accordion.open .governance-chevron { transform: rotate(180deg); }
.governance-accordion-body {
  display: none; padding: 0 16px 16px; flex-direction: column; gap: 12px; font-size: 12px;
}
.governance-accordion.open .governance-accordion-body { display: flex; }
.governance-item { display: flex; flex-direction: column; gap: 4px; }
.governance-label {
  color: var(--text-dim); text-transform: uppercase;
  font-size: 11px; letter-spacing: 0.5px;
}
.governance-value { font-weight: 600; }

/* Article Layout (two-column) */
.article-layout { display: grid; grid-template-columns: 1fr 280px; gap: 32px; }
.article-main { min-width: 0; }
.article-sidebar {
  position: sticky; top: 80px; align-self: start;
  background: var(--surface); padding: 16px; border-radius: 10px;
  border: 1px solid var(--border);
}

/* KB Body */
.kb-body { font-size: 14px; line-height: 1.6; margin-bottom: 32px; overflow-x: auto; }
.kb-body h3 { font-size: 16px; font-weight: 700; margin: 24px 0 12px; color: var(--heading-color); }
.kb-body p { margin-bottom: 12px; }
.kb-body ul, .kb-body ol { margin-bottom: 12px; padding-left: 24px; }
.kb-body li { margin-bottom: 6px; }
.kb-body strong { font-weight: 600; color: var(--text); }
.kb-body table { width: 100%; border-collapse: collapse; margin: 16px 0; border: 1px solid var(--border-strong); }
.kb-body th, .kb-body td { border: 1px solid var(--border); padding: 10px 14px; text-align: left; font-size: 14px; }
.kb-body th { background: var(--bg); font-weight: 600; color: var(--heading-color); border-bottom: 2px solid var(--border-strong); }
.kb-body tr:nth-child(even) td { background: rgba(0,0,0,0.02); }
.kb-body tr:hover td { background: rgba(5,175,238,0.04); }

/* Exceptions */
.exceptions-block {
  background: rgba(239,68,68,0.05);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 10px; padding: 16px; margin-top: 24px;
}
.exceptions-block h3 { color: var(--error); margin-bottom: 12px; }

/* Link Sections (sidebar) */
.link-section { margin-bottom: 16px; }
.link-section h4 { font-size: 12px; text-transform: uppercase; color: var(--text-dim); margin-bottom: 8px; }
.linked-article {
  display: flex; align-items: center; gap: 8px;
  padding: 8px; border-radius: 4px; cursor: pointer;
  font-size: 13px; margin-bottom: 4px;
}
.linked-article:hover { background: rgba(5,175,238,0.08); }

/* Supplements */
.supplements-section { margin-top: 32px; border-top: 1px solid var(--border); padding-top: 24px; }
.supplements-section h3 { margin-bottom: 16px; }
.checklist { padding: 8px 0; }
.checklist-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.checklist-item input[type="checkbox"] { width: auto; margin-top: 3px; }

/* Supplement management */
.supplement-list { margin-bottom: 12px; }
.supplement-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 6px;
  margin-bottom: 6px;
}
.supplement-row span { flex: 1; }

/* Modal */
.modal {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 1000;
  align-items: flex-start; justify-content: center; padding: 24px;
  overflow-y: auto;
}
.modal.active { display: flex; }
.modal-content {
  background: var(--surface); border-radius: 10px;
  max-width: 900px; width: 100%;
  border: 1px solid var(--border);
  margin: 32px auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  max-height: calc(100vh - 64px);
  display: flex; flex-direction: column;
}
.modal-header {
  padding: 24px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface);
  border-radius: 10px 10px 0 0; z-index: 10;
  flex-shrink: 0;
}
.modal-title { font-size: 18px; font-weight: 600; color: var(--heading-color); }
.modal-close {
  background: none; color: var(--text-dim);
  padding: 0; font-size: 24px; width: 32px; height: 32px;
}
.modal-body { padding: 24px; overflow-y: auto; flex: 1; min-height: 0; }
.modal-footer {
  padding: 24px; border-top: 1px solid var(--border);
  display: flex; gap: 12px; justify-content: flex-end;
  flex-wrap: wrap; flex-shrink: 0;
}

/* Forms */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block; margin-bottom: 6px;
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-dim);
}
.form-hint { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

/* Buttons */
.btn-secondary {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-danger { background: var(--error); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-ai {
  background: var(--secondary); color: #fff;
  padding: 4px 8px; font-size: 11px; border-radius: 4px;
}
.btn-ai-sm {
  float: right; font-size: 10px; padding: 2px 8px;
  background: var(--secondary); color: #fff; border-radius: 3px;
  cursor: pointer; border: none; font-weight: 500;
}

/* Checkbox group */
.checkbox-group { display: flex; flex-wrap: wrap; gap: 8px; }
.checkbox-label {
  display: flex; align-items: center; gap: 4px;
  font-size: 13px; cursor: pointer;
}
.checkbox-label input[type="checkbox"] { width: auto; }

/* Search */
.search-box { position: relative; margin-bottom: 0; }
.search-results {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 6px; margin-top: 4px;
  max-height: 400px; overflow-y: auto; z-index: 100;
  display: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.search-results.active { display: block; }
.search-result-item {
  padding: 12px; border-bottom: 1px solid var(--border);
  cursor: pointer; display: flex; align-items: center; gap: 12px;
}
.search-result-item:hover { background: rgba(5,175,238,0.08); }

/* Tabs */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab-btn {
  background: var(--bg); color: var(--text-dim);
  border: 1px solid var(--border); padding: 8px 16px;
  font-size: 13px; border-radius: 6px 6px 0 0;
}
.tab-btn.active { background: var(--surface); color: var(--heading-color); border-bottom-color: var(--surface); font-weight: 600; }
.tab-content { display: none; padding: 16px 0; }
.tab-content.active { display: block; }

/* Tab count badges */
.tab-count {
  display: inline-block;
  background: var(--primary);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: 4px;
  min-width: 18px;
  text-align: center;
  line-height: 1.4;
}
.tab-btn.active .tab-count { background: var(--secondary); }

/* Editor Layout */
.editor-layout { display: grid; grid-template-columns: 1fr 280px; gap: 24px; }
.editor-main { min-width: 0; }
.editor-sidebar {
  background: var(--bg); padding: 16px; border-radius: 10px;
  border: 1px solid var(--border);
}

/* WYSIWYG */
.wysiwyg-toolbar {
  display: flex; gap: 4px; flex-wrap: wrap;
  padding: 8px; background: var(--bg);
  border: 1px solid var(--border-strong); border-bottom: none;
  border-radius: 6px 6px 0 0;
}
.wysiwyg-toolbar button {
  padding: 4px 8px; font-size: 12px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 4px;
}
.wysiwyg-toolbar button:hover { border-color: var(--primary); }
.wysiwyg-editor {
  min-height: 200px; padding: 12px; font-size: 14px; line-height: 1.6;
  border: 1px solid var(--border-strong); border-radius: 0 0 6px 6px;
  background: var(--surface); color: var(--text);
  overflow-y: auto; max-height: 400px;
}
.wysiwyg-editor:focus { outline: none; border-color: var(--primary); }
.wysiwyg-editor h3 { font-size: 16px; font-weight: 700; margin: 12px 0 8px; color: var(--heading-color); }
.wysiwyg-editor p { margin-bottom: 8px; }
.wysiwyg-editor ul, .wysiwyg-editor ol { padding-left: 24px; margin-bottom: 8px; }
.wysiwyg-editor img { max-width: 100%; height: auto; border-radius: 6px; margin: 8px 0; }
.wysiwyg-editor table { width: 100%; border-collapse: collapse; margin: 12px 0; border: 1px solid var(--border-strong); }
.wysiwyg-editor th, .wysiwyg-editor td { border: 1px solid var(--border-strong); padding: 8px 12px; text-align: left; font-size: 13px; min-width: 60px; }
.wysiwyg-editor th { background: var(--bg); font-weight: 600; color: var(--heading-color); }
.wysiwyg-editor tr:nth-child(even) td { background: rgba(0,0,0,0.02); }
.wysiwyg-editor .video-embed { margin: 12px 0; }
.wysiwyg-editor .video-wrapper {
  position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;
  border-radius: 6px; background: #000;
}
.wysiwyg-editor .video-wrapper iframe {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;
}

/* Article viewer images and videos */
.article-body img { max-width: 100%; height: auto; border-radius: 6px; margin: 8px 0; }
.article-body .video-embed, .article-content .video-embed { margin: 12px 0; }
.article-body .video-wrapper, .article-content .video-wrapper {
  position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;
  border-radius: 6px; background: #000;
}
.article-body .video-wrapper iframe, .article-content .video-wrapper iframe {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;
}
.wysiwyg-source {
  font-family: monospace; font-size: 13px;
  border: 1px solid var(--border-strong); border-radius: 0 0 6px 6px;
  min-height: 200px; max-height: 400px;
}

/* Wizard */
.wizard-progress { display: flex; gap: 8px; margin-bottom: 24px; }
.wizard-step {
  flex: 1; text-align: center; padding: 8px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; font-size: 13px; color: var(--text-dim);
}
.wizard-step.active { background: var(--primary); color: white; border-color: var(--primary); }
.wizard-step.done { background: rgba(5,175,238,0.15); color: var(--primary); border-color: var(--primary); }

/* Classification card */
.classification-card {
  background: var(--bg); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 16px; margin-bottom: 24px;
}
.classification-result { display: flex; flex-direction: column; gap: 12px; }
.classification-row { display: flex; align-items: center; gap: 12px; }
.classification-row .form-label { width: 120px; margin: 0; flex-shrink: 0; }

/* Draft preview */
.draft-preview { margin-bottom: 24px; }
.draft-preview h3 { margin-bottom: 12px; }

/* Inbox */
.inbox-list { display: flex; flex-direction: column; gap: 12px; }
.inbox-item {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px;
  gap: 16px;
}
.inbox-item-main { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.inbox-item-main strong { font-size: 15px; }
.inbox-item-main > .type-badge, .inbox-item-main > .status-badge, .inbox-item-main > .risk-badge, .inbox-item-main > .priority-badge { align-self: flex-start; }
.inbox-item-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: flex-start; }

/* Link Manager */
.link-manager-tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.link-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.link-row span { flex: 1; }
.add-link-row { display: flex; gap: 8px; margin-top: 12px; }
.add-link-row select { flex: 1; }

/* Settings */
.settings-section { margin-bottom: 32px; }
.settings-section h3 { margin-bottom: 12px; color: var(--heading-color); }
.tag-list { display: flex; flex-direction: column; gap: 6px; }
.tag-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 6px;
}

/* Data Table */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
.data-table th, .data-table td {
  padding: 10px 12px; text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table th {
  font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-dim);
  font-weight: 600; white-space: nowrap;
}
.data-table tr:hover { background: rgba(5,175,238,0.04); }

/* Account */
.account-card {
  background: var(--surface); padding: 24px; border-radius: 12px;
  border: 1px solid var(--border); margin-bottom: 20px;
}
.account-card-header {
  display: flex; align-items: center; gap: 16px; margin-bottom: 20px;
  padding-bottom: 20px; border-bottom: 1px solid var(--border);
}
.account-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; flex-shrink: 0;
}
.account-card-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.account-card-field {
  display: flex; flex-direction: column; gap: 4px;
}
.account-card-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-secondary);
}
.account-card-value { font-size: 14px; color: var(--text); }
.account-card-title {
  margin: 0 0 8px; color: var(--heading-color); font-size: 16px;
}
@media (max-width: 600px) {
  .account-card-grid { grid-template-columns: 1fr; }
  .account-card { padding: 16px; }
  .account-card-header { flex-direction: column; text-align: center; }
}

/* Chat */
.chat-container { display: flex; flex-direction: column; height: calc(100vh - 80px); }
.chat-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.chat-messages {
  flex: 1; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px; margin-bottom: 16px;
  min-height: 300px;
}
.chat-msg { margin-bottom: 16px; }
.chat-msg-user .chat-msg-content {
  background: var(--primary); color: white;
  padding: 10px 14px; border-radius: 10px 10px 0 10px;
  display: inline-block; max-width: 80%; margin-left: auto;
  float: right; clear: both;
}
.chat-msg-assistant .chat-msg-content {
  background: var(--bg); color: var(--text);
  padding: 10px 14px; border-radius: 10px 10px 10px 0;
  display: inline-block; max-width: 80%;
  clear: both;
}
.chat-msg-assistant .chat-msg-content p { margin-bottom: 8px; }
.chat-msg-assistant .chat-msg-content ul, .chat-msg-assistant .chat-msg-content ol { padding-left: 20px; margin-bottom: 8px; }
.chat-input-bar { display: flex; gap: 12px; }
.chat-input-bar input { flex: 1; }
.chat-input-bar button { flex-shrink: 0; }

/* Chat citation links (inline) */
.chat-citation-link {
  color: var(--primary); font-weight: 600;
  text-decoration: underline; text-decoration-style: dotted;
  text-underline-offset: 2px; cursor: pointer;
}
.chat-citation-link:hover { color: var(--secondary); text-decoration-style: solid; }

/* Chat sources section */
.chat-sources {
  margin-top: 12px; padding-top: 10px;
  border-top: 1px solid var(--border);
}
.chat-sources-title {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-dim); margin-bottom: 0;
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px;
  user-select: none;
}
.chat-sources-title::-webkit-details-marker { display: none; }
.chat-sources-title::before {
  content: ''; display: inline-block; width: 0; height: 0;
  border-left: 5px solid var(--text-dim); border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  transition: transform 0.15s;
}
.chat-sources[open] > .chat-sources-title::before { transform: rotate(90deg); }
.chat-sources[open] > .chat-sources-title { margin-bottom: 8px; }
.chat-source-card {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 6px;
  background: rgba(5,175,238,0.06); border: 1px solid var(--border);
  margin-bottom: 4px; cursor: pointer; text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}
.chat-source-card:hover {
  border-color: var(--primary); background: rgba(5,175,238,0.12);
  text-decoration: none;
}
.chat-source-name { flex: 1; font-size: 13px; font-weight: 500; color: var(--text); }
.chat-source-arrow { font-size: 14px; color: var(--text-dim); }

/* Toast */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  padding: 12px 20px; border-radius: 6px;
  font-size: 14px; font-weight: 600; color: white;
  z-index: 2000; animation: toastIn 0.3s ease;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--error); }
.toast-info { background: var(--info); }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* AI Overlay */
.ai-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 1100;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.ai-overlay-box {
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 12px; width: 100%; max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  max-height: 80vh; display: flex; flex-direction: column;
}
.ai-overlay-header {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  flex-shrink: 0;
}
.ai-overlay-title { font-size: 16px; font-weight: 600; color: var(--secondary); }
.ai-overlay-body { padding: 24px; overflow-y: auto; flex: 1; min-height: 0; }
.ai-overlay-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; gap: 12px; justify-content: flex-end;
}

/* AI Presets */
.ai-preset-list { display: flex; flex-direction: column; gap: 8px; }
.ai-preset-btn {
  text-align: left; padding: 12px 16px; font-size: 14px; font-weight: 500;
  background: var(--bg); color: var(--text); border: 1px solid var(--border-strong);
  border-radius: 8px; transition: border-color 0.2s, background 0.2s;
}
.ai-preset-btn:hover { border-color: var(--secondary); background: rgba(255,153,0,0.08); }

/* AI Progress */
.ai-progress { text-align: center; padding: 16px 0; }
.ai-spinner {
  width: 40px; height: 40px; margin: 0 auto 16px;
  border: 3px solid var(--border-strong); border-top-color: var(--secondary);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.ai-progress-msg { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.ai-progress-hint { font-size: 12px; color: var(--text-dim); margin-bottom: 16px; }
.ai-progress-bar {
  height: 4px; background: var(--bg); border-radius: 2px; overflow: hidden;
}
.ai-progress-bar-fill {
  height: 100%; width: 0%; background: var(--secondary); border-radius: 2px;
  animation: aiProgress 25s ease-out forwards;
}
@keyframes aiProgress {
  0% { width: 0%; }
  30% { width: 40%; }
  60% { width: 65%; }
  80% { width: 80%; }
  100% { width: 92%; }
}

/* AI Error */
.ai-error { text-align: center; padding: 16px 0; }
.ai-error-icon {
  width: 48px; height: 48px; margin: 0 auto 12px;
  background: var(--error); color: white; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700;
}
.ai-error-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.ai-error-msg {
  font-size: 13px; color: var(--text-dim); line-height: 1.5;
  word-break: break-word; max-height: 120px; overflow-y: auto;
  background: var(--bg); padding: 12px; border-radius: 6px;
  text-align: left; margin-top: 8px;
}

/* Acknowledgment Banner */
.ack-banner {
  background: #FFF7ED;
  border: 2px solid var(--secondary);
  border-radius: 10px;
  padding: 24px;
  margin-top: 32px;
  text-align: center;
}
.ack-banner h3 {
  color: var(--heading-color);
  margin-bottom: 8px;
  font-size: 18px;
}
.ack-banner p {
  color: var(--text-dim);
  margin-bottom: 16px;
  font-size: 14px;
}
.ack-timer {
  margin-bottom: 16px;
}
.ack-timer-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}
.ack-timer-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 1s linear;
}
.ack-timer-text {
  font-size: 13px;
  color: var(--text-dim);
}
.btn-ack {
  background: var(--border);
  color: var(--text-dim);
  padding: 12px 32px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: not-allowed;
}
.btn-ack:disabled { opacity: 0.6; }
.btn-ack-ready {
  background: var(--success) !important;
  color: white !important;
  cursor: pointer !important;
  opacity: 1 !important;
}
.ack-banner-done {
  background: #F0FDF4;
  border-color: var(--success);
}
.ack-banner-done p {
  color: var(--success);
  font-weight: 600;
  margin-bottom: 0;
}

/* Empty state */
.empty-state { text-align: center; padding: 48px; color: var(--text-dim); }

/* Text utilities */
.text-dim { color: var(--text-dim); }

/* Login */
.login-container {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center; padding: 24px;
  background: var(--bg);
}
.login-box {
  background: var(--surface); padding: 48px;
  border-radius: 10px; border: 1px solid var(--border);
  width: 100%; max-width: 400px; text-align: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
.login-logo { max-width: 240px; margin: 0 auto 32px; }
.login-logo img { width: 100%; height: auto; }
.login-title { font-size: 22px; font-weight: 700; margin-bottom: 24px; color: var(--heading-color); }
.login-form { text-align: left; }
.login-error {
  background: rgba(239,68,68,0.1); color: var(--error);
  padding: 12px; border-radius: 6px;
  margin-bottom: 16px; font-size: 12px;
}
.login-success {
  background: rgba(16,185,129,0.1); color: #059669;
  padding: 12px; border-radius: 6px;
  margin-bottom: 16px; font-size: 12px;
}
.signup-domains-hint {
  text-align: center; margin-top: 16px; font-size: 11px;
  color: var(--text-dim); line-height: 1.6;
}

/* Analytics */
.analytics-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 20px; text-align: center;
}
.analytics-num { font-size: 32px; font-weight: 700; color: var(--heading-color); }
.analytics-label { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .5px; margin-top: 4px; }
.analytics-pct {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 600;
}
.analytics-pct.good { background: rgba(16,185,129,.15); color: #059669; }
.analytics-pct.ok { background: rgba(245,158,11,.15); color: #d97706; }
.analytics-pct.low { background: rgba(239,68,68,.15); color: #dc2626; }

/* KB Selector Top Bar */
.kb-bar { background: #1a2455; border-bottom: 1px solid rgba(255,255,255,0.1); }
.kb-bar-inner { max-width: 1400px; margin: 0 auto; padding: 0 24px; display: flex; gap: 0; }
.kb-tab {
  background: none; color: rgba(255,255,255,0.6); border: none; padding: 10px 20px;
  font-size: 13px; font-weight: 600; border-bottom: 2px solid transparent; cursor: pointer;
  transition: color 0.2s, border-color 0.2s; border-radius: 0;
}
.kb-tab:hover { color: rgba(255,255,255,0.9); opacity: 1; }
.kb-tab.active { color: #fff; border-bottom-color: var(--primary); }

/* Public KB Homepage */
.public-kb-header { text-align: center; padding: 40px 0 32px; }
.public-kb-header h1 { font-size: 28px; color: var(--heading-color); margin-bottom: 8px; }
.public-kb-header p { color: var(--text-dim); font-size: 16px; }
.public-kb-search { max-width: 600px; margin: 24px auto 0; }
.public-kb-actions { display: flex; justify-content: center; gap: 12px; margin-top: 20px; }
.public-kb-categories { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; margin-top: 32px; }
.public-kb-category-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 24px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.public-kb-category-card:hover { border-color: var(--primary); box-shadow: 0 4px 16px rgba(5,175,238,0.08); }
.public-kb-category-card h3 {
  color: var(--heading-color); margin-bottom: 16px; font-size: 16px; font-weight: 700;
  padding-bottom: 12px; border-bottom: 2px solid var(--border);
}
.public-kb-article-link {
  display: block; padding: 10px 0; border-bottom: 1px solid var(--border);
  color: var(--text); cursor: pointer; font-size: 14px;
  transition: color 0.2s, padding-left 0.2s;
}
.public-kb-article-link:hover { color: var(--primary); padding-left: 4px; text-decoration: none; }
.public-kb-article-link:last-child { border-bottom: none; }
.public-kb-empty {
  text-align: center; padding: 64px 24px; color: var(--text-dim);
}
.public-kb-empty .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.public-kb-empty h3 { color: var(--heading-color); margin-bottom: 8px; }

/* Public KB Article View */
.public-article-container { max-width: 900px; margin: 0 auto; }
.public-article-header { margin-bottom: 32px; }
.public-article-header h1 {
  font-size: 26px; font-weight: 700; color: var(--heading-color); margin-bottom: 8px;
}
.public-article-category {
  font-size: 13px; color: var(--text-dim); display: inline-block;
  background: rgba(5,175,238,0.08); padding: 4px 10px; border-radius: 4px;
}
.public-article-body {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 32px; line-height: 1.7;
}
.public-article-body h3 { font-size: 16px; font-weight: 700; margin: 24px 0 12px; color: var(--heading-color); }
.public-article-body p { margin-bottom: 12px; }
.public-article-body ul, .public-article-body ol { margin-bottom: 12px; padding-left: 24px; }
.public-article-body li { margin-bottom: 6px; }
.public-article-body img { max-width: 100%; height: auto; border-radius: 6px; margin: 8px 0; }

/* Public KB Editor Modal */
.pkb-editor-layout { display: flex; flex-direction: column; gap: 20px; }

/* Public KB Settings */
.settings-table { width: 100%; border-collapse: collapse; }
.settings-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-dim); padding: 8px 12px; border-bottom: 2px solid var(--border); }
.settings-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.settings-table tr:last-child td { border-bottom: none; }
.settings-table select { font-size: 13px; }

.pkb-settings-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 24px; margin-bottom: 24px;
}
.pkb-settings-card h4 {
  font-size: 16px; font-weight: 700; color: var(--heading-color); margin-bottom: 16px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.pkb-categories-list { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; }
.pkb-category-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
}
.pkb-category-row span { font-size: 14px; }
.pkb-add-category { display: flex; gap: 8px; margin-top: 12px; }
.pkb-add-category input { flex: 1; }

/* Analytics clickable */
.analytics-clickable { color: var(--primary); cursor: pointer; text-decoration: underline; font-weight: 600; }
.analytics-clickable:hover { color: var(--heading-color); }

/* Keywords */
.keywords-section { margin-bottom: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.keywords-list { display: flex; gap: 6px; flex-wrap: wrap; }
.keyword-chip {
  font-size: 11px; padding: 4px 10px; background: rgba(5,175,238,0.1);
  color: var(--primary); border-radius: 12px; border: 1px solid rgba(5,175,238,0.2);
}
.keywords-bottom { margin-top: 24px; margin-bottom: 0; padding-top: 16px; border-top: 1px solid var(--border); }

/* Notification badges */
.notification-badge { padding: 8px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.notification-badge.sent { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.3); color: #065f46; }
.notification-badge.not-sent { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.3); color: #92400e; }

/* Post-publish actions */
.post-publish-actions { display: flex; flex-direction: column; gap: 8px; }
.pp-action-btn {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  cursor: pointer; text-align: left; transition: all 0.2s; width: 100%;
}
.pp-action-btn:hover:not(:disabled) { border-color: var(--primary); background: rgba(5,175,238,0.04); transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.pp-action-btn:disabled { cursor: default; }
.pp-action-btn.pp-done { border-color: #10b981; background: rgba(16,185,129,0.06); }
.pp-icon { font-size: 24px; flex-shrink: 0; }
.pp-label { font-size: 14px; font-weight: 600; color: var(--text); display: block; }
.pp-desc { font-size: 12px; color: var(--text-dim); display: block; margin-top: 2px; }
.pp-suggestions { display: flex; flex-direction: column; gap: 8px; max-height: 350px; overflow-y: auto; }
.pp-suggestion-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 8px; cursor: pointer; transition: background 0.15s;
}
.pp-suggestion-item:hover { background: var(--surface); }
.pp-suggestion-item input[type="checkbox"] { margin-top: 4px; flex-shrink: 0; width: 16px; height: 16px; min-width: 16px; accent-color: var(--primary); }
.pp-suggestion-item > div { flex: 1; min-width: 0; }

/* Icon-only buttons */
.btn-icon {
  padding: 8px; display: inline-flex; align-items: center; justify-content: center;
  line-height: 1;
}
.btn-icon svg { display: block; }

/* Share Button */
.share-wrapper { position: relative; display: inline-block; }
.btn-share {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-share:hover { border-color: var(--primary); color: var(--primary); }
.share-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  min-width: 180px; z-index: 600; overflow: hidden;
  animation: dropIn 0.15s ease-out;
}
.share-menu.active { display: block; }
.share-option {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; color: var(--text); font-size: 13px;
  text-decoration: none; transition: background 0.15s;
}
.share-option:hover { background: var(--bg); text-decoration: none; }
.share-option svg { flex-shrink: 0; }

/* Chat Thinking Animation */
.chat-thinking {
  display: flex; gap: 6px; padding: 4px 0; align-items: center;
}
.chat-thinking span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-dim); display: block;
  animation: chatBounce 1.4s ease-in-out infinite;
}
.chat-thinking span:nth-child(2) { animation-delay: 0.2s; }
.chat-thinking span:nth-child(3) { animation-delay: 0.4s; }
@keyframes chatBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* Inbox Due Articles - centered button */
.inbox-item-due { align-items: center; }
.inbox-item-actions-center { align-items: center; align-self: center; }

/* Department Multiselect */
.dept-multiselect { position: relative; }
.dept-ms-selected {
  display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; min-height: 4px;
}
.dept-ms-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(5,175,238,0.1); color: var(--primary);
  border: 1px solid rgba(5,175,238,0.2);
  padding: 2px 8px; border-radius: 12px; font-size: 11px;
}
.dept-ms-chip button {
  background: none; border: none; color: var(--primary);
  padding: 0 2px; font-size: 14px; cursor: pointer;
  line-height: 1;
}
.dept-ms-search {
  padding: 6px 10px; font-size: 12px; border-radius: 6px;
}
.dept-ms-dropdown {
  display: none; position: absolute; left: 0; right: 0; top: 100%;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  max-height: 180px; overflow-y: auto; z-index: 200;
  margin-top: 4px;
}
.dept-ms-option {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; font-size: 12px; cursor: pointer;
  transition: background 0.1s;
}
.dept-ms-option:hover { background: var(--bg); }
.dept-ms-option input[type="checkbox"] { width: auto; flex-shrink: 0; }

/* Hamburger Menu & Sidebar Overlay (hidden on desktop) */
.nav-hamburger {
  display: none; background: none; border: none; padding: 8px;
  cursor: pointer; flex-direction: column; gap: 5px;
  width: 36px; height: 36px; justify-content: center; align-items: center;
}
.nav-sidebar-overlay { display: none; }
.nav-hamburger span {
  display: block; width: 20px; height: 2px; background: var(--nav-text);
  border-radius: 1px; transition: all 0.3s;
}
.nav-hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-hamburger.active span:nth-child(2) { opacity: 0; }
.nav-hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Compact filters and search bars — override global width:100% */
.inbox-search-bar input, .inbox-search-bar select {
  font-size: 12px; padding: 4px 8px; height: 30px; width: auto;
}
.inbox-search-bar input { max-width: 200px; }
.inbox-search-bar select { max-width: 180px; }

/* ============================================================
   FLOATING CHAT WIDGET
   ============================================================ */

/* Floating action button */
.chat-widget-btn {
  position: fixed; bottom: 24px; right: 24px; z-index: 1500;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--primary); color: #fff; border: none;
  box-shadow: 0 4px 16px rgba(5,175,238,0.35);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  padding: 0;
}
.chat-widget-btn:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(5,175,238,0.45); background: var(--primary); color: #fff; }
.chat-widget-btn.hidden { display: none; }

/* Chat panel */
.chat-widget {
  position: fixed; bottom: 88px; right: 24px; z-index: 1500;
  width: 380px; max-height: 520px;
  transition: width 0.2s, max-height 0.2s;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  background: var(--bg);
  display: none; flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
}
.chat-widget.active { display: flex; }

/* Header */
.chat-widget-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: var(--nav-bg); color: #fff;
  min-height: 44px; flex-shrink: 0;
}
.chat-widget-title { font-size: 14px; font-weight: 600; }
.chat-widget-header-actions { display: flex; gap: 4px; }
.cw-header-btn {
  background: none; border: none; color: rgba(255,255,255,0.7); cursor: pointer;
  width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.cw-header-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* Quick actions */
.chat-widget-quick-actions {
  display: flex; gap: 6px; padding: 8px 12px;
  overflow-x: auto; flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  scrollbar-width: none;
}
.chat-widget-quick-actions::-webkit-scrollbar { display: none; }
.cw-pill {
  white-space: nowrap; padding: 5px 12px;
  border-radius: 16px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text);
  font-size: 12px; cursor: pointer; flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.cw-pill:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Messages area */
.chat-widget-messages {
  flex: 1; overflow-y: auto; padding: 12px;
  min-height: 200px; max-height: 340px;
  display: flex; flex-direction: column; gap: 10px;
}
.chat-widget-messages .empty-state { margin: auto; }
.chat-widget-messages .empty-state p { font-size: 13px; color: var(--text-dim); }

/* Reuse existing chat message styles */
.chat-widget-messages .chat-msg { margin-bottom: 0; }
.chat-widget-messages .chat-msg-content { font-size: 13px; max-width: 100%; }
.chat-widget-messages .chat-msg-user .chat-msg-content { font-size: 13px; }
.chat-widget-messages .chat-msg-assistant .chat-msg-content { font-size: 13px; }

/* Input bar */
.chat-widget-input {
  display: flex; gap: 8px; padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface); flex-shrink: 0;
}
.chat-widget-input input {
  flex: 1; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; font-size: 13px; background: var(--bg);
  outline: none; min-width: 0;
}
.chat-widget-input input:focus { border-color: var(--primary); }
.chat-widget-input button {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--primary); color: #fff; border: none;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  padding: 0; flex-shrink: 0;
}
.chat-widget-input button:hover { opacity: 0.9; background: var(--primary); color: #fff; }

/* Expanded state */
.chat-widget.expanded { width: 600px; max-height: 700px; }
.chat-widget.expanded .chat-widget-messages { max-height: 520px; }

/* Hide widget button when on full chat page */
body.page-chat .chat-widget-btn,
body.page-chat .chat-widget { display: none !important; }

/* Responsive — Mobile-first utilities */
.mobile-grid-1 { grid-template-columns: 1fr !important; }

@media (max-width: 768px) {
  /* Mobile — sidebar is hidden, toggled via hamburger */
  .sidebar {
    left: -280px; width: 260px; min-width: 260px;
    transition: left 0.3s ease; box-shadow: none; z-index: 600;
  }
  .sidebar.mobile-open { left: 0; box-shadow: 4px 0 24px rgba(0,0,0,0.3); }
  .main-content, .main-content.sidebar-collapsed { margin-left: 0; }
  .sidebar-collapse-btn { display: none; }
  .topbar .nav-hamburger { display: flex; padding: 8px 12px; }
  .nav-sidebar-overlay {
    display: none; position: fixed; top: 0; left: 0;
    width: 100vw; height: 100vh; background: rgba(0,0,0,0.4);
    z-index: 599;
  }

  /* Prevent mobile zoom on focus */
  input, textarea, select { font-size: 16px; }

  /* KB Bar */
  .kb-bar-inner { padding: 0 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .kb-tab { padding: 8px 12px; font-size: 12px; white-space: nowrap; flex-shrink: 0; }

  /* Container */
  .container { padding: 16px 12px; max-width: 100%; overflow-x: hidden; }
  .main-content { overflow-x: hidden; }

  /* Hub */
  .hub-header { flex-direction: column; gap: 12px; align-items: stretch; }
  .hub-header .search-box { width: 100%; }
  .hub-actions { width: 100%; display: flex; gap: 8px; }
  .hub-actions button { flex: 1; font-size: 12px; padding: 8px 12px; min-width: 0; }
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; padding-bottom: 4px; }
  .tab-btn { white-space: nowrap; flex-shrink: 0; padding: 6px 10px; font-size: 11px; }
  .tab-count { font-size: 9px; padding: 1px 5px; min-width: 16px; }

  /* Department groups */
  .category-group { margin-bottom: 32px; }
  .group-title { font-size: 16px; margin-bottom: 16px; padding-bottom: 8px; }

  /* Article Rows — title on top, meta below */
  .article-row { flex-wrap: wrap; padding: 10px 12px; gap: 4px 8px; }
  .article-title { font-size: 13px; width: 100%; order: -1; flex: none; }
  .type-badge { font-size: 10px; padding: 2px 6px; }
  .view-count { font-size: 10px; margin-left: auto; }
  .team-chip { font-size: 10px; padding: 3px 6px; }
  .fav-star { font-size: 14px; }

  /* Article Viewer */
  .article-actions-bar { flex-direction: column; gap: 8px; align-items: stretch; padding: 10px 12px; }
  .article-actions-right { flex-wrap: wrap; justify-content: flex-start; gap: 6px; width: 100%; }
  .article-actions-right .btn-sm { padding: 6px 10px; font-size: 11px; flex: 1; min-width: 0; text-align: center; }
  .article-title-main { font-size: 18px; }
  .article-purpose { font-size: 14px; }
  .governance-desktop { display: none; }
  .governance-mobile { display: block; }
  .article-layout { grid-template-columns: 1fr; gap: 16px; }
  .article-sidebar { position: static; }
  .article-meta { gap: 6px; }

  /* Editor */
  .editor-layout { grid-template-columns: 1fr; }
  .editor-sidebar { order: -1; }
  .wysiwyg-toolbar { gap: 2px; }
  .wysiwyg-toolbar button { padding: 4px 6px; font-size: 11px; }

  /* Inbox */
  .inbox-item { flex-direction: column; gap: 10px; align-items: stretch; padding: 12px; }
  .inbox-item-due { align-items: stretch; }
  .inbox-item-main strong { font-size: 14px; }
  .inbox-item-actions { align-self: stretch; flex-wrap: wrap; }
  .inbox-item-actions .btn-sm { flex: 1; text-align: center; min-width: 0; }
  .inbox-item-actions-center { align-self: stretch; }
  .inbox-search-bar { flex-wrap: wrap !important; }
  .inbox-search-bar input, .inbox-search-bar select { width: 100% !important; max-width: 100% !important; }
  .inbox-list { gap: 8px; }

  /* Assignment items */
  .assignment-item { flex-direction: column; gap: 8px; }
  .assignment-item-actions { align-self: flex-start; flex-wrap: wrap; }
  .assignment-row { flex-direction: column; gap: 8px; }
  .assignment-row select { flex: none; width: 100%; }

  /* Chat */
  .chat-container { height: calc(100vh - 120px); }
  .chat-msg-user .chat-msg-content,
  .chat-msg-assistant .chat-msg-content { max-width: 95%; }
  .chat-input-bar { gap: 8px; }
  .chat-input-bar button { padding: 10px 14px; font-size: 13px; }

  /* Modal */
  .modal { padding: 8px; }
  .modal-content { margin: 8px auto; max-height: calc(100vh - 16px); border-radius: 8px; max-width: 100% !important; }
  .modal-header { padding: 14px 16px; }
  .modal-title { font-size: 16px; }
  .modal-body { padding: 16px; }
  .modal-footer { padding: 14px 16px; flex-wrap: wrap; }
  .modal-footer button { flex: 1; min-width: 80px; font-size: 13px; }

  /* AI Overlay */
  .ai-overlay { padding: 12px; }
  .ai-overlay-box { max-width: 100%; }
  .ai-overlay-header { padding: 14px 16px; }
  .ai-overlay-body { padding: 16px; }

  /* Toast */
  .toast { left: 12px; right: 12px; bottom: 12px; text-align: center; font-size: 13px; }

  /* Search results dropdown */
  .search-box { z-index: 200; }
  .search-results { max-height: 60vh; z-index: 300; }
  .search-result-item { padding: 10px; gap: 8px; font-size: 13px; }

  /* Public KB */
  .public-kb-header h1 { font-size: 22px; }
  .public-kb-header p { font-size: 14px; }
  .public-kb-categories { grid-template-columns: 1fr; gap: 16px; }
  .public-kb-actions { flex-direction: column; gap: 8px; }
  .public-kb-actions button { width: 100%; }
  .public-article-body { padding: 16px; }
  .public-article-header h1 { font-size: 20px; }

  /* Settings & Data Tables */
  .table-wrap { -webkit-overflow-scrolling: touch; margin: 0 -12px; padding: 0 12px; }
  .data-table { font-size: 12px; min-width: 600px; }
  .data-table th, .data-table td { padding: 8px 6px; }
  .settings-section { margin-bottom: 24px; }

  /* Analytics */
  .analytics-card { padding: 12px; }
  .analytics-num { font-size: 24px; }

  /* Legal */
  .legal-container { padding: 16px 12px; }
  .legal-intro-card, .legal-form-card { padding: 20px; }

  /* Share — anchor right to prevent overflow */
  .share-menu { right: 0; left: auto; min-width: 160px; }
  .share-wrapper { position: static; }
  .article-actions-right { position: relative; }
  .article-actions-right .share-menu { position: absolute; right: 0; top: 100%; }

  /* Wizard */
  .wizard-progress { flex-direction: column; gap: 4px; }
  .wizard-step { padding: 6px; font-size: 12px; }

  /* Acknowledgment */
  .ack-banner { padding: 16px; }
  .ack-banner h3 { font-size: 16px; }

  /* Classification */
  .classification-row { flex-direction: column; gap: 4px; }
  .classification-row .form-label { width: auto; }

  /* Impersonation banner */
  .impersonation-banner { flex-wrap: wrap; font-size: 12px; gap: 8px; }

  /* Supplement rows */
  .supplement-row { flex-wrap: wrap; }

  /* Link rows */
  .link-row { flex-wrap: wrap; }
  .add-link-row { flex-direction: column; }

  /* Checklist */
  .checklist-item { font-size: 13px; }

  /* Keywords */
  .keywords-section { font-size: 12px; }

  /* Dept multiselect */
  .dept-ms-dropdown { max-height: 200px; }

  /* Post-publish actions */
  .pp-action-btn { padding: 12px 14px; }
  .pp-label { font-size: 13px; }

  /* Notification badges */
  .notification-badge { font-size: 12px; padding: 6px 12px; }

  /* Inline grid overrides for JS-rendered grids */
  .analytics-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .detail-grid { grid-template-columns: 1fr !important; }
  .editor-grid { grid-template-columns: 1fr !important; }
  .assign-row-grid { grid-template-columns: 1fr !important; }
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }
  [style*="grid-template-columns:repeat(4"],
  [style*="grid-template-columns: repeat(4"] { grid-template-columns: repeat(2, 1fr) !important; }
  [style*="grid-template-columns:repeat(3"],
  [style*="grid-template-columns: repeat(3"] { grid-template-columns: 1fr !important; }
  [style*="grid-template-columns:1fr 260px"],
  [style*="grid-template-columns: 1fr 260px"],
  [style*="grid-template-columns:1fr 280px"],
  [style*="grid-template-columns: 1fr 280px"] { grid-template-columns: 1fr !important; }
  [style*="grid-template-columns:1fr 120px 1fr auto"],
  [style*="grid-template-columns: 1fr 120px 1fr auto"] { grid-template-columns: 1fr !important; }

  /* Login */
  .login-box { padding: 24px 16px; }
  .login-title { font-size: 18px; }
  .login-logo { max-width: 180px; margin-bottom: 24px; }

  /* Chat widget — full-screen on mobile */
  .chat-widget-btn { bottom: 16px; right: 16px; width: 48px; height: 48px; }
  #cwExpandBtn { display: none; }
  .chat-widget {
    bottom: 0; left: 0; right: 0; top: 0;
    width: 100% !important; max-height: 100% !important;
    border-radius: 0; border: none;
  }
  .chat-widget-messages { max-height: none; min-height: 0; flex: 1; }
}

/* Extra small screens */
@media (max-width: 480px) {
  .container { padding: 12px 8px; }
  body { font-size: 13px; }

  /* Even smaller buttons */
  button { padding: 8px 14px; font-size: 13px; }
  .btn-sm { padding: 5px 10px; font-size: 11px; }

  /* Tabs — horizontally scrollable */
  .tabs { gap: 2px; padding-bottom: 2px; }
  .tab-btn { padding: 6px 10px; font-size: 11px; }
  .tab-count { font-size: 9px; padding: 1px 5px; min-width: 14px; }

  /* Article row tighter */
  .article-row { padding: 8px 10px; }
  .article-title { font-size: 12px; }
  .type-badge, .status-badge, .risk-badge { font-size: 10px; padding: 3px 6px; }

  /* Hub header */
  .hub-actions { flex-direction: column; }
  .hub-actions button { width: 100%; }

  /* Inbox */
  .inbox-item { padding: 12px; }
  .inbox-item-main strong { font-size: 13px; }

  /* Settings */
  .data-table th { font-size: 10px; }
  .data-table td { font-size: 11px; }

  /* Analytics */
  .analytics-num { font-size: 20px; }
  .analytics-label { font-size: 10px; }
  [style*="grid-template-columns:repeat(4"],
  [style*="grid-template-columns: repeat(4"] { grid-template-columns: repeat(2, 1fr) !important; }

  /* Search box */
  .search-box input { font-size: 14px; padding: 8px 10px; }

  /* Form */
  .form-group { margin-bottom: 14px; }

  /* Chat messages */
  .chat-msg-user .chat-msg-content,
  .chat-msg-assistant .chat-msg-content { max-width: 100%; font-size: 13px; }
  .chat-input-bar { flex-direction: column; }
  .chat-input-bar button { width: 100%; }

  /* KB Bar tighter */
  .kb-tab { padding: 6px 10px; font-size: 11px; }

  /* Login */
  .login-box { padding: 20px 12px; }
  .login-title { font-size: 16px; margin-bottom: 16px; }
  .login-logo { max-width: 160px; margin-bottom: 20px; }
}

/* Help Center */
.help-page { padding-bottom: 48px; }
.help-header { text-align: center; margin-bottom: 32px; padding-top: 8px; }
.help-header h1 { font-size: 28px; font-weight: 700; color: var(--heading-color); margin: 0 0 6px; }
.help-header .text-dim { font-size: 15px; margin: 0; }

.help-nav { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 36px; padding: 16px; background: var(--bg); border-radius: 10px; border: 1px solid var(--border); }
.help-nav a { padding: 6px 14px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--text-dim); text-decoration: none; transition: all 0.15s; }
.help-nav a:hover { background: var(--primary); color: #fff; }

.help-section { margin-bottom: 40px; }
.help-section-icon { font-size: 28px; margin-bottom: 4px; }
.help-section h2 { font-size: 20px; font-weight: 700; color: var(--heading-color); margin: 0 0 16px; padding-bottom: 8px; border-bottom: 2px solid var(--border); }

.help-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.help-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 20px; transition: box-shadow 0.15s; }
.help-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.help-card.full-width { grid-column: 1 / -1; }
.help-card h4 { margin: 0 0 8px; font-size: 15px; font-weight: 600; color: var(--heading-color); }
.help-card p { margin: 0 0 8px; font-size: 13px; color: var(--text); line-height: 1.6; }
.help-card ul { margin: 4px 0 8px; padding-left: 20px; font-size: 13px; color: var(--text); line-height: 1.7; }
.help-card li { margin-bottom: 2px; }

.help-pipeline { display: flex; align-items: flex-start; gap: 0; flex-wrap: wrap; margin: 16px 0 8px; justify-content: center; }
.help-pipeline-step { text-align: center; flex: 1; min-width: 140px; max-width: 200px; }
.help-pipeline-step p { font-size: 12px; color: var(--text-dim); margin: 6px 0 0; }
.help-pipeline-arrow { font-size: 22px; color: var(--text-dim); padding: 8px 6px 0; }
.help-pip-badge { display: inline-block; padding: 4px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.help-pip-badge.requested { background: #fef3c7; color: #92400e; }
.help-pip-badge.draft { background: #e0f2fe; color: #0369a1; }
.help-pip-badge.for-approval { background: #fce7f3; color: #9d174d; }
.help-pip-badge.published { background: #d1fae5; color: #065f46; }

@media (max-width: 600px) {
  .help-nav { gap: 4px; padding: 12px; }
  .help-nav a { font-size: 12px; padding: 5px 10px; }
  .help-card-grid { grid-template-columns: 1fr; }
  .help-pipeline { flex-direction: column; align-items: center; }
  .help-pipeline-arrow { transform: rotate(90deg); padding: 4px 0; }
}

/* Beta Badge */
.beta-badge {
  display: inline-block;
  background: #FF9900;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  vertical-align: middle;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Legal Advisor */
.legal-container { max-width: 800px; margin: 0 auto; padding: 32px 20px 48px; }
.legal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.legal-header h1 { margin: 0; }
.legal-intro-card, .legal-form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 24px;
}
.legal-disclaimer {
  background: #fffbeb;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  padding: 16px;
  font-size: 14px;
  color: #92400e;
}
.legal-disclaimer-footer {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 12px;
  color: #991b1b;
  margin-top: 24px;
}
.legal-risk-banner {
  text-align: center;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 24px;
}
.legal-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
}
.legal-section h3 { margin: 0 0 12px; color: var(--heading-color); font-size: 16px; }
.legal-section p { margin: 0; color: var(--text-secondary); line-height: 1.6; }
.legal-section ul, .legal-section ol { margin: 0; padding-left: 20px; color: var(--text-secondary); line-height: 1.8; }
.legal-section-success { border-left: 4px solid #16a34a; }
.legal-section-danger { border-left: 4px solid #dc2626; }
.legal-section-info { border-left: 4px solid #2563eb; }
.legal-response-level {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 18px; font-weight: 700; margin-bottom: 8px;
}
.legal-response-level-badge {
  display: inline-block; padding: 3px 10px; border-radius: 6px;
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.3px;
}
.legal-safe-reply {
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px;
  padding: 16px; margin-top: 12px; position: relative;
}
.legal-safe-reply pre {
  margin: 0; white-space: pre-wrap; font-family: inherit;
  font-size: 14px; line-height: 1.7; color: #1e293b;
}
.legal-copy-btn {
  position: absolute; top: 8px; right: 8px;
  background: #16a34a; color: #fff; border: none;
  border-radius: 6px; padding: 6px 14px; font-size: 12px;
  font-weight: 600; cursor: pointer;
}
.legal-copy-btn:hover { background: #15803d; }

.tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  cursor: help;
  margin-left: 4px;
  vertical-align: middle;
  position: relative;
}
.tooltip-icon[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  white-space: normal;
  text-transform: none;
  letter-spacing: normal;
  width: 280px;
  z-index: 1000;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.tooltip-icon[data-tooltip]:hover::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1e293b;
  z-index: 1000;
  pointer-events: none;
}

/* Print */
@media print {
  .sidebar, .topbar, .kb-bar, .modal, .governance-bar, button, .article-actions-bar, .article-sidebar, .supplements-section, .ack-banner { display: none !important; }
  .main-content { margin-left: 0 !important; }
  body { background: white; color: black; }
  .kb-body { color: black; }
  .kb-body h3 { color: #263371; }
  .article-layout { grid-template-columns: 1fr; }
}
