:root {
  --blue-900: #0b3559;
  --blue-800: #0f4c81;
  --blue-700: #16609e;
  --blue-100: #e6f0fa;
  --blue-50: #f3f8fd;

  --green-800: #145c4e;
  --green-700: #0d9488;
  --green-600: #1e7e6b;
  --green-100: #e4f4f0;
  --green-50: #f2faf8;

  --amber-700: #9a5b13;
  --amber-100: #fef3c7;
  --red-700: #b91c1c;
  --red-100: #fee2e2;

  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --bg-page: #f4f7fa;
  --white: #ffffff;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 4px 14px rgba(15, 76, 129, 0.08);
  --shadow-lg: 0 14px 34px rgba(15, 23, 42, 0.16);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 15px;
}

body {
  margin: 0;
  background-color: var(--bg-page);
  color: var(--slate-800);
  font-family: 'Cairo', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.92rem;
  line-height: 1.58;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

html[dir="ltr"] body {
  font-family: 'Inter', 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.ltr-inline {
  direction: ltr;
  unicode-bidi: isolate;
}

.container {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: 14px;
}

.hidden {
  display: none !important;
}

.mt-lg {
  margin-top: 18px;
}

/* Top Safety & Privacy Bar (non-sticky for more viewport space) */
.top-safety-bar {
  background: linear-gradient(90deg, var(--blue-900), var(--green-800));
  color: var(--white);
  font-size: 0.76rem;
  padding-block: 5px;
}

.top-safety-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.safety-text {
  opacity: 0.95;
  font-weight: 500;
  line-height: 1.35;
}

.safety-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-crisis-pill,
.btn-privacy-pill {
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.14);
  color: var(--white);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.73rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.16s ease;
}

.btn-crisis-pill {
  background: rgba(185, 28, 28, 0.85);
  border-color: rgba(254, 202, 202, 0.55);
}

.btn-crisis-pill:hover {
  background: #991b1b;
}

.btn-privacy-pill:hover {
  background: rgba(255, 255, 255, 0.24);
}

/* Compact Sticky Header */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--slate-200);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-block: 8px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.btn-menu-toggle {
  display: none;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--slate-300);
  background: var(--slate-100);
  color: var(--blue-900);
  border-radius: var(--radius-sm);
  padding: 5px 9px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.brand-emblem {
  flex-shrink: 0;
  display: flex;
}

.brand-logo-img {
  border-radius: 8px;
  display: block;
}

.brand-titles {
  min-width: 0;
}

.brand-name {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--blue-900);
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-tagline {
  margin: 1px 0 0;
  font-size: 0.74rem;
  color: var(--green-800);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-notes-toggle,
.btn-lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.btn-notes-toggle {
  background: var(--green-50);
  color: var(--green-800);
  border: 1px solid var(--green-600);
}

.btn-notes-toggle:hover {
  background: var(--green-100);
}

.badge-count {
  background: var(--green-700);
  color: var(--white);
  border-radius: 999px;
  padding: 0 6px;
  font-size: 0.72rem;
  line-height: 1.45;
}

.btn-lang-switch {
  background: var(--blue-800);
  color: var(--white);
  border: 1px solid var(--blue-800);
}

.btn-lang-switch:hover {
  background: var(--blue-900);
}

.lang-flag {
  background: rgba(255, 255, 255, 0.22);
  padding: 0 5px;
  border-radius: 4px;
  font-size: 0.72rem;
}

/* Search Strip */
.search-strip {
  background: var(--blue-50);
  border-top: 1px solid var(--slate-200);
  border-bottom: 1px solid var(--slate-200);
  padding-block: 7px;
}

.search-strip-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  flex: 1 1 260px;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  inset-inline-start: 11px;
  pointer-events: none;
  font-size: 0.82rem;
}

#globalSearchInput {
  width: 100%;
  padding: 6px 34px;
  border: 1px solid var(--slate-300);
  border-radius: 999px;
  background: var(--white);
  color: var(--slate-900);
  font-family: inherit;
  font-size: 0.83rem;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}

#globalSearchInput:focus {
  border-color: var(--blue-700);
  box-shadow: 0 0 0 3px rgba(22, 96, 158, 0.14);
}

.clear-search-btn {
  position: absolute;
  inset-inline-end: 8px;
  background: var(--slate-200);
  border: none;
  border-radius: 50%;
  width: 21px;
  height: 21px;
  cursor: pointer;
  color: var(--slate-700);
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-scope-pills {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 1px;
}

.search-scope-pills::-webkit-scrollbar {
  display: none;
}

.scope-pill {
  border: 1px solid var(--slate-300);
  background: var(--white);
  color: var(--slate-700);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.scope-pill.active {
  background: var(--blue-800);
  color: var(--white);
  border-color: var(--blue-800);
}

/* Primary Nav Tabs */
.main-nav {
  background: var(--white);
}

.nav-tabs {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-block: 6px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--slate-600);
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.16s ease;
}

.nav-tab:hover {
  background: var(--slate-100);
  color: var(--blue-800);
}

.nav-tab.active {
  background: var(--blue-100);
  color: var(--blue-900);
  border-color: #bfdbfe;
}

/* Workspace & Cards */
.main-workspace {
  padding-block: 14px 56px;
}

.card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

/* Compact Collapsible Identity Banner */
.identity-banner {
  padding: 12px 14px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #ffffff 0%, #f1f7fc 60%, #eef9f6 100%);
  border-inline-start: 4px solid var(--blue-800);
}

.identity-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.identity-head-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 260px;
}

.identity-avatar {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--blue-800), var(--green-700));
  color: var(--white);
  font-size: 1.35rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.identity-badges {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}

.identity-head-info h2 {
  margin: 0;
  font-size: 0.96rem;
  color: var(--blue-900);
  line-height: 1.3;
}

.identity-toggle-btn {
  flex-shrink: 0;
}

.identity-collapsible {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--slate-200);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}

.identity-collapsible.collapsed {
  display: none;
}

.identity-collapsible p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--slate-700);
}

.identity-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(76px, 1fr));
  gap: 6px;
}

.stat-chip {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  text-align: center;
}

.stat-chip strong {
  display: block;
  font-size: 0.96rem;
  color: var(--blue-800);
  line-height: 1.2;
}

.stat-chip span {
  font-size: 0.7rem;
  color: var(--slate-600);
  font-weight: 600;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.71rem;
  font-weight: 700;
}

.badge-blue {
  background: var(--blue-100);
  color: var(--blue-900);
}

.badge-green {
  background: var(--green-100);
  color: var(--green-800);
}

.badge-amber {
  background: var(--amber-100);
  color: var(--amber-700);
}

.badge-red {
  background: var(--red-100);
  color: var(--red-700);
}

.badge-slate {
  background: var(--slate-100);
  color: var(--slate-700);
}

/* Sections & Panels */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.section-header h2 {
  margin: 0 0 3px;
  font-size: 1.12rem;
  color: var(--blue-900);
}

.section-subtitle {
  margin: 0;
  color: var(--slate-600);
  font-size: 0.84rem;
}

.section-collapse-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-row-with-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.filter-row-with-actions .filter-bar {
  margin-bottom: 0;
}

/* Filter Bars & Subtabs */
.filter-bar,
.subtab-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.filter-btn,
.subtab-btn {
  border: 1px solid var(--slate-300);
  background: var(--white);
  color: var(--slate-700);
  border-radius: 999px;
  padding: 5px 11px;
  font-family: inherit;
  font-size: 0.79rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.subtab-btn {
  border-radius: var(--radius-sm);
  padding: 7px 12px;
}

.filter-btn:hover,
.subtab-btn:hover {
  border-color: var(--blue-700);
  color: var(--blue-800);
}

.filter-btn.active,
.subtab-btn.active {
  background: var(--blue-800);
  color: var(--white);
  border-color: var(--blue-800);
}

.subpanel {
  display: none;
}

.subpanel.active {
  display: block;
}

/* Disclaimers */
.clinical-disclaimer-box {
  background: var(--blue-50);
  border: 1px solid #bfdbfe;
  border-inline-start: 4px solid var(--blue-800);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  margin-bottom: 14px;
  font-size: 0.83rem;
  color: var(--slate-800);
}

.clinical-disclaimer-box.info-box {
  background: var(--green-50);
  border-color: #a7f3d0;
  border-inline-start-color: var(--green-700);
}

.clinical-disclaimer-box.warning-box {
  background: #fffbeb;
  border-color: #fde68a;
  border-inline-start-color: var(--amber-700);
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 12px;
}

.entry-card {
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition: box-shadow 0.16s ease, border-color 0.16s ease;
}

.entry-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #93c5fd;
}

.entry-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.entry-badges-group {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  align-items: center;
}

.card-fold-btn {
  border: 1px solid var(--slate-200);
  background: var(--slate-100);
  color: var(--slate-700);
  border-radius: 999px;
  padding: 2px 9px;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.card-fold-btn:hover {
  background: var(--blue-100);
  color: var(--blue-900);
}

.entry-title {
  margin: 7px 0 3px;
  font-size: 0.97rem;
  color: var(--blue-900);
  line-height: 1.35;
}

.entry-bilingual-term {
  margin: 0 0 6px;
  font-size: 0.78rem;
  color: var(--green-800);
  font-weight: 600;
}

.entry-summary {
  margin: 0;
  font-size: 0.84rem;
  color: var(--slate-600);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.entry-card.is-expanded .entry-summary {
  -webkit-line-clamp: unset;
}

.card-inline-details {
  margin-top: 9px;
  padding: 10px 11px;
  border-radius: var(--radius-sm);
  background: var(--blue-50);
  border: 1px solid #dbeafe;
  font-size: 0.81rem;
  color: var(--slate-700);
}

.card-inline-details h4 {
  margin: 7px 0 3px;
  font-size: 0.82rem;
  color: var(--blue-900);
}

.card-inline-details h4:first-child {
  margin-top: 0;
}

.card-inline-details ul {
  margin: 0;
  padding-inline-start: 16px;
}

.card-inline-details li {
  margin-bottom: 3px;
}

.entry-card-actions {
  display: flex;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--slate-100);
}

/* Buttons */
.btn-primary,
.btn-secondary {
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-family: inherit;
  font-size: 0.81rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.btn-primary {
  background: var(--blue-800);
  color: var(--white);
  border: 1px solid var(--blue-800);
}

.btn-primary:hover {
  background: var(--blue-900);
}

.btn-secondary {
  background: var(--white);
  color: var(--slate-700);
  border: 1px solid var(--slate-300);
}

.btn-secondary:hover {
  background: var(--slate-100);
  border-color: var(--slate-400);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.77rem;
}

.btn-xs {
  padding: 4px 9px;
  font-size: 0.74rem;
}

.flex-1 {
  flex: 1;
}

/* Two-Column Grid & Collapsible Clinical Checklists */
.two-col-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 14px;
}

.tool-card {
  padding: 15px;
}

.tool-card h3 {
  margin: 0 0 4px;
  color: var(--blue-900);
  font-size: 1rem;
}

.tool-card-sub {
  margin: 0 0 12px;
  font-size: 0.82rem;
  color: var(--slate-600);
}

.checklist-group {
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  margin-bottom: 8px;
  background: var(--slate-100);
}

details.checklist-group summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--blue-800);
  font-size: 0.88rem;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

details.checklist-group summary::-webkit-details-marker {
  display: none;
}

details.checklist-group summary::after {
  content: '▾';
  font-size: 0.85rem;
  color: var(--slate-500);
  transition: transform 0.15s ease;
}

details.checklist-group[open] summary::after {
  transform: rotate(180deg);
}

details.checklist-group[open] summary {
  margin-bottom: 7px;
}

.checklist-group h4 {
  margin: 0 0 6px;
  color: var(--blue-800);
  font-size: 0.88rem;
}

.checklist-items {
  margin: 0;
  padding-inline-start: 16px;
  font-size: 0.83rem;
  color: var(--slate-700);
}

.checklist-items li {
  margin-bottom: 4px;
}

.interactive-check-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.83rem;
  margin-bottom: 5px;
  cursor: pointer;
}

.interactive-check-item input {
  margin-top: 3px;
  accent-color: var(--green-700);
}

.mse-counter-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--green-100);
  color: var(--green-800);
  font-size: 0.74rem;
  font-weight: 700;
}

/* Report Builder */
.report-workspace {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 14px;
  align-items: start;
}

.report-sidebar {
  padding: 14px;
}

.report-sidebar h3 {
  margin: 0 0 10px;
  font-size: 0.94rem;
  color: var(--blue-900);
}

.template-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.template-item-btn {
  text-align: start;
  padding: 9px 11px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.template-item-btn strong {
  display: block;
  font-size: 0.84rem;
  color: var(--slate-800);
}

.template-item-btn span {
  display: block;
  font-size: 0.74rem;
  color: var(--slate-500);
  margin-top: 2px;
}

.template-item-btn.active {
  background: var(--blue-50);
  border-color: var(--blue-800);
}

.report-saved-info {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--slate-200);
  font-size: 0.76rem;
  color: var(--slate-600);
}

.report-editor-pane {
  padding: 16px;
}

.report-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--slate-200);
  margin-bottom: 14px;
}

.report-toolbar-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--blue-900);
}

.report-toolbar-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.report-form {
  display: grid;
  gap: 12px;
}

.form-row-two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--slate-700);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--slate-900);
  background: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--blue-700);
  box-shadow: 0 0 0 3px rgba(22, 96, 158, 0.12);
}

/* Research Launcher & Trusted Portals */
.research-launcher-card {
  padding: 15px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #ffffff, var(--blue-50));
}

.research-bar {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.research-bar input {
  flex: 1 1 240px;
  padding: 8px 12px;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
}

.portal-sublinks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.portal-sublink {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--blue-800);
  background: var(--blue-50);
  border: 1px solid #bfdbfe;
  padding: 3px 9px;
  border-radius: 999px;
  text-decoration: none;
}

.portal-sublink:hover {
  background: var(--blue-100);
}

.crisis-detail-card {
  padding: 16px;
  border-inline-start: 4px solid var(--red-700);
  background: #fffafa;
}

.privacy-detail-card {
  padding: 16px;
  border-inline-start: 4px solid var(--green-700);
  background: var(--green-50);
}

/* Floating Back-to-Top Button */
.back-to-top-btn {
  position: fixed;
  bottom: 18px;
  inset-inline-end: 16px;
  z-index: 60;
  border: 1px solid var(--blue-800);
  background: rgba(15, 76, 129, 0.94);
  color: var(--white);
  border-radius: 999px;
  padding: 7px 13px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: transform 0.16s ease, background 0.16s ease;
}

.back-to-top-btn:hover {
  background: var(--blue-900);
  transform: translateY(-2px);
}

/* Mobile Quick Navigation Drawer */
.mobile-nav-drawer {
  width: 100%;
  max-width: 340px;
  height: 100%;
  background: var(--white);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.mobile-nav-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mobile-nav-item {
  width: 100%;
  text-align: start;
  border: 1px solid var(--slate-200);
  background: var(--white);
  color: var(--slate-800);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-nav-item.active {
  background: var(--blue-50);
  border-color: var(--blue-800);
  color: var(--blue-900);
}

.mobile-nav-sub {
  padding-inline-start: 28px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--slate-700);
  background: var(--slate-100);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.56);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  z-index: 100;
}

.modal-dialog {
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.modal-compact {
  max-width: 580px;
}

.modal-header {
  padding: 13px 16px;
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  background: var(--blue-50);
}

.modal-header h3 {
  margin: 4px 0 2px;
  color: var(--blue-900);
  font-size: 1.05rem;
}

.modal-bilingual-sub {
  margin: 0;
  font-size: 0.82rem;
  color: var(--green-800);
  font-weight: 700;
}

.modal-badges {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.modal-close {
  border: 1px solid var(--slate-300);
  background: var(--white);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 0.92rem;
  flex-shrink: 0;
}

.modal-body {
  padding: 16px;
  overflow-y: auto;
  font-size: 0.87rem;
}

.detail-block {
  margin-bottom: 13px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--slate-100);
}

.detail-block:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.detail-block h4 {
  margin: 0 0 5px;
  color: var(--blue-800);
  font-size: 0.92rem;
}

.detail-block ul {
  margin: 0;
  padding-inline-start: 18px;
}

.detail-block li {
  margin-bottom: 4px;
}

.modal-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--slate-200);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--slate-100);
}

/* Notes Drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  z-index: 110;
  display: flex;
  justify-content: flex-end;
}

.notes-drawer {
  width: 100%;
  max-width: 500px;
  height: 100%;
  background: var(--white);
  display: flex;
  flex-direction: column;
  padding: 16px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--slate-200);
}

.drawer-header h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--blue-900);
}

.drawer-subtitle {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--slate-600);
}

.drawer-privacy-alert {
  margin-block: 10px;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  background: #fffbeb;
  border: 1px solid #fde68a;
  font-size: 0.78rem;
  color: var(--amber-700);
  font-weight: 600;
}

.note-form {
  display: grid;
  gap: 9px;
  padding: 11px;
  background: var(--slate-100);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.note-form-actions {
  display: flex;
  gap: 8px;
}

.notes-list-header {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.notes-search-input {
  flex: 1 1 160px;
  padding: 6px 10px;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.82rem;
}

.notes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.note-item {
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--white);
}

.note-item-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.note-item h4 {
  margin: 4px 0;
  font-size: 0.9rem;
  color: var(--blue-900);
}

.note-item-sub {
  margin: 0 0 5px;
  font-size: 0.78rem;
  color: var(--green-800);
  font-weight: 600;
}

.note-item p {
  margin: 0 0 5px;
  font-size: 0.82rem;
  color: var(--slate-700);
  white-space: pre-wrap;
}

.note-item-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

/* Case Study Reveal Box */
.case-analysis-box {
  margin-top: 10px;
  padding: 10px 11px;
  border-radius: var(--radius-sm);
  background: var(--blue-50);
  border: 1px solid #bfdbfe;
  font-size: 0.82rem;
}

/* Footer */
.site-footer {
  background: var(--white);
  border-top: 1px solid var(--slate-200);
  padding-block: 14px;
  color: var(--slate-600);
  font-size: 0.8rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-inner p {
  margin: 2px 0 0;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 18px;
  inset-inline-start: 16px;
  background: var(--blue-900);
  color: var(--white);
  padding: 8px 15px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.83rem;
  font-weight: 600;
  z-index: 200;
}

/* Print Styles */
.print-only {
  display: none;
}

@media print {
  body > *:not(#printReportContainer) {
    display: none !important;
  }

  #printReportContainer {
    display: block !important;
    padding: 20px;
    color: #000;
    background: #fff;
    font-size: 11.5pt;
    line-height: 1.55;
  }

  .print-header {
    border-bottom: 2px solid #0f4c81;
    padding-bottom: 10px;
    margin-bottom: 16px;
  }

  .print-header h1 {
    margin: 0;
    font-size: 15pt;
    color: #0f4c81;
  }

  .print-field {
    margin-bottom: 12px;
    page-break-inside: avoid;
  }

  .print-field h3 {
    margin: 0 0 4px;
    font-size: 11pt;
    color: #145c4e;
    border-bottom: 1px solid #cbd5e1;
  }

  .print-field p {
    margin: 0;
    white-space: pre-wrap;
  }

  .print-footer {
    margin-top: 24px;
    padding-top: 10px;
    border-top: 1px solid #94a3b8;
    font-size: 9pt;
    color: #475569;
  }
}

/* Scale Quick Helper */
.scale-helper-box {
  background: var(--blue-50);
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid #bfdbfe;
}

.scale-helper-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.scale-helper-controls input[type="number"] {
  width: 96px;
  padding: 5px 8px;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
}

/* Responsive Mobile-First Tweaks */
@media (max-width: 900px) {
  .btn-menu-toggle {
    display: inline-flex;
  }

  .identity-collapsible {
    grid-template-columns: 1fr;
  }

  .identity-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .report-workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  html {
    font-size: 14px;
  }

  .container {
    padding-inline: 11px;
  }

  .brand-name {
    font-size: 0.8rem;
  }

  .brand-tagline {
    display: none;
  }

  .brand-logo-img {
    width: 28px;
    height: 28px;
  }

  .btn-notes-toggle,
  .btn-lang-switch {
    padding: 5px 8px;
    font-size: 0.74rem;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .two-col-grid {
    grid-template-columns: 1fr;
  }

  .back-to-top-btn {
    bottom: 14px;
    inset-inline-end: 12px;
    padding: 6px 11px;
    font-size: 0.74rem;
  }
}
