/* ══════════════════════════════════════════════════════════════════════════
   CSRD Kunskapsbas — Light Theme
   Inspired by EFRAG (institutional clarity) + Infralogistic (Nordic corporate)
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Design Tokens ───────────────────────────────────────────────────────── */
:root {
  /* Surfaces */
  --white:   #FFFFFF;
  --bg:      #FAFBFD;
  --bg-alt:  #F0F5FA;
  --bg-warm: #F7F8FC;

  /* Navy */
  --navy:      #0B1F3F;
  --navy-mid:  #1A3356;
  --navy-soft: #2A4365;

  /* Blue accent — from Infralogistic */
  --blue:       #046BD2;
  --blue-hover: #0356AD;
  --blue-light: #E8F1FD;
  --blue-pale:  #F0F6FF;

  /* Text */
  --text:    #1E293B;
  --text-2:  #475569;
  --text-3:  #94A3B8;
  --text-4:  #CBD5E1;

  /* Borders */
  --bdr:     #E2E8F0;
  --bdr-hi:  #CBD5E1;

  /* ESRS category palette */
  --cross:   #3B82F6;  --cross-bg: #EFF6FF;
  --env:     #059669;  --env-bg:   #ECFDF5;
  --soc:     #0891B2;  --soc-bg:   #ECFEFF;
  --gov:     #7C3AED;  --gov-bg:   #F5F3FF;

  /* File type colors */
  --pdf-c:   #DC2626;  --pdf-bg:  #FEF2F2;
  --docx-c:  #2563EB;  --docx-bg: #EFF6FF;
  --xlsx-c:  #059669;  --xlsx-bg: #ECFDF5;

  /* Layout */
  --sidebar-w: 256px;
  --chat-w:    420px;
  --topbar-h:  60px;
  --container:  1200px;

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t:    0.18s;
  --t-md: 0.25s;

  /* Radius — from Infralogistic's clean 4px */
  --r-xs: 3px;
  --r-sm: 6px;
  --r:    8px;
  --r-lg: 12px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:    0 4px 16px rgba(0,0,0,0.07);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.10);
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* ── Focus Visibility (Accessibility) ───────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* ── Loading ─────────────────────────────────────────────────────────────── */
#loading {
  position: fixed; inset: 0;
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
  z-index: 300;
}
.loading-bar {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.loading-logo {
  font-size: 13px; font-weight: 800; letter-spacing: 0.25em;
  text-transform: uppercase; color: var(--navy);
}
.spinner {
  width: 28px; height: 28px;
  border: 2.5px solid var(--bdr);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-label { font-size: 13px; color: var(--text-3); font-weight: 500; }

/* ── App shell ───────────────────────────────────────────────────────────── */
#app { display: flex; height: 100vh; overflow: hidden; background: var(--bg); }

/* ══════════════════════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════════════════════ */
#sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--bdr);
  display: flex; flex-direction: column;
  overflow: hidden; z-index: 10;
}

.sidebar-brand {
  padding: 18px 16px 16px;
  border-bottom: 1px solid var(--bdr);
  display: flex; align-items: center; gap: 12px;
  transition: background var(--t) var(--ease);
}
.sidebar-brand:hover { background: var(--bg); }

.brand-gem {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: var(--r-sm);
  background: var(--navy);
  display: flex; align-items: center; justify-content: center;
  color: var(--white); font-size: 13px; font-weight: 800;
  letter-spacing: 0.04em;
}
.brand-text { min-width: 0; }
.brand-label {
  font-size: 9px; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 2px;
}
.brand-title {
  font-size: 14px; font-weight: 700; color: var(--navy); line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-subtitle { font-size: 10.5px; color: var(--text-3); margin-top: 1px; }

.sidebar-nav {
  flex: 1; overflow-y: auto; padding: 8px;
  scrollbar-width: thin; scrollbar-color: var(--bdr) transparent;
}
.nav-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-4);
  padding: 16px 10px 5px;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--text-2); font-size: 13px; font-weight: 500;
  cursor: pointer; position: relative;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
  user-select: none;
}
.nav-item::before {
  content: '';
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 0;
  background: var(--blue);
  border-radius: 0 3px 3px 0;
  transition: height var(--t) var(--ease);
}
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: var(--blue-light); color: var(--blue); font-weight: 600; }
.nav-item.active::before { height: 55%; }

.nav-icon { font-size: 15px; flex-shrink: 0; opacity: 0.55; width: 20px; text-align: center; transition: opacity var(--t); }
.nav-item:hover .nav-icon,
.nav-item.active .nav-icon { opacity: 1; }
.nav-label { flex: 1; }
.nav-count {
  font-size: 10px; font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg-alt); color: var(--text-3);
  border-radius: 20px; padding: 2px 8px;
  min-width: 24px; text-align: center;
}
.nav-item.active .nav-count { background: rgba(4,107,210,0.12); color: var(--blue); }

/* ══════════════════════════════════════════════════════════════════════════
   MAIN AREA
   ══════════════════════════════════════════════════════════════════════════ */
#main {
  flex: 1; display: flex; flex-direction: column;
  min-width: 0; overflow: hidden;
  background: var(--bg);
  transition: margin-right var(--t-md) var(--ease);
}
#main.chat-open { margin-right: var(--chat-w); }

/* ── Topbar ──────────────────────────────────────────────────────────────── */
#topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--bdr);
  display: flex; align-items: center; gap: 14px; padding: 0 28px;
  flex-shrink: 0; z-index: 5;
}
.search-wrapper {
  flex: 1; max-width: 580px; position: relative; display: flex; align-items: center;
}
.search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); pointer-events: none;
}
#search {
  width: 100%; height: 40px; padding: 0 38px 0 42px;
  border: 1.5px solid var(--bdr); border-radius: 20px;
  background: var(--bg); color: var(--text); font-size: 14px;
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
#search:focus {
  border-color: var(--blue);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(4,107,210,0.10);
}
#search::placeholder { color: var(--text-4); }
#search-clear {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--bdr); color: var(--white);
  font-size: 10px; display: none;
  align-items: center; justify-content: center; cursor: pointer;
  transition: background var(--t) var(--ease);
}
#search-clear:hover { background: var(--text-3); }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; padding-right: 148px; }
.filter-select {
  height: 36px; padding: 0 12px;
  border: 1.5px solid var(--bdr); border-radius: var(--r-sm);
  background: var(--white); color: var(--text-2);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: border-color var(--t) var(--ease);
}
.filter-select:focus { border-color: var(--blue); }

/* Status dot */
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #22C55E; flex-shrink: 0;
}
.status-dot.offline { background: var(--text-4); }

/* ── Content area ────────────────────────────────────────────────────────── */
#content {
  flex: 1; overflow-y: auto; padding: 28px 32px 48px;
  scrollbar-width: thin; scrollbar-color: var(--bdr) transparent;
}
.section-block { margin-bottom: 8px; }
.section-block + .section-block { margin-top: 40px; }
.section-header { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.section-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-3);
}
.section-count {
  font-size: 12px; color: var(--text-4);
  font-family: 'JetBrains Mono', monospace;
}
.section-divider { flex: 1; height: 1px; background: var(--bdr); }

/* ══════════════════════════════════════════════════════════════════════════
   DOCUMENT CARDS
   ══════════════════════════════════════════════════════════════════════════ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.doc-card {
  background: var(--white);
  border-radius: var(--r);
  border: 1px solid var(--bdr);
  box-shadow: var(--shadow-xs);
  display: flex; flex-direction: column;
  overflow: hidden; cursor: pointer;
  transition: box-shadow var(--t) var(--ease), border-color var(--t) var(--ease), transform var(--t) var(--ease);
}
.doc-card:hover {
  border-color: var(--bdr-hi);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.card-stripe { height: 3px; flex-shrink: 0; }
.card-stripe.pdf  { background: var(--pdf-c); }
.card-stripe.docx { background: var(--docx-c); }
.card-stripe.xlsx { background: var(--xlsx-c); }

.card-body    { padding: 18px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.card-row     { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.card-title   { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.4; word-break: break-word; }
.badge {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  padding: 2px 8px; border-radius: var(--r-xs);
  flex-shrink: 0; text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
}
.badge.pdf  { background: var(--pdf-bg); color: var(--pdf-c); }
.badge.docx { background: var(--docx-bg); color: var(--docx-c); }
.badge.xlsx { background: var(--xlsx-bg); color: var(--xlsx-c); }

.card-cat { font-size: 12px; color: var(--text-3); }
.card-preview {
  font-size: 12.5px; color: var(--text-3); line-height: 1.65; flex: 1;
  overflow: hidden; display: -webkit-box;
  -webkit-box-orient: vertical; -webkit-line-clamp: 3; margin-top: 4px;
}
.card-footer {
  padding: 12px 18px; border-top: 1px solid var(--bdr);
  display: flex; align-items: center; justify-content: space-between;
}
.open-link {
  font-size: 13px; font-weight: 600; color: var(--blue);
  display: flex; align-items: center; gap: 4px;
  transition: gap var(--t) var(--ease);
}
.doc-card:hover .open-link { gap: 8px; }
.page-info { font-size: 11px; color: var(--text-4); font-family: 'JetBrains Mono', monospace; }

/* ══════════════════════════════════════════════════════════════════════════
   SEARCH RESULTS
   ══════════════════════════════════════════════════════════════════════════ */
.search-banner {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--bdr);
}
.search-banner-title { font-size: 16px; font-weight: 700; color: var(--text); }
.search-banner-count { font-size: 13px; color: var(--text-3); }

.result-card {
  background: var(--white);
  border-radius: var(--r); border: 1px solid var(--bdr);
  box-shadow: var(--shadow-xs);
  margin-bottom: 12px; overflow: hidden;
  transition: box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}
.result-card:hover { box-shadow: var(--shadow); border-color: var(--bdr-hi); }
.result-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px 8px; cursor: pointer; }
.result-title { font-size: 14px; font-weight: 600; color: var(--text); flex: 1; }
.result-cat   { font-size: 12px; color: var(--text-3); padding: 0 18px 12px; }
.result-excerpts { border-top: 1px solid var(--bdr); }
.excerpt {
  padding: 12px 18px; border-bottom: 1px solid var(--bdr);
  cursor: pointer; transition: background var(--t) var(--ease);
}
.excerpt:last-child { border-bottom: none; }
.excerpt:hover { background: var(--blue-pale); }
.excerpt-pg {
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 5px;
  font-family: 'JetBrains Mono', monospace;
}
.excerpt-text { font-size: 13px; color: var(--text-2); line-height: 1.7; }
mark { background: #FEF08A; color: var(--text); padding: 0 2px; border-radius: 2px; }

.empty-state { text-align: center; padding: 80px 20px; }
.empty-icon  { font-size: 48px; margin-bottom: 16px; opacity: 0.25; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.empty-text  { font-size: 13px; color: var(--text-3); }

/* ══════════════════════════════════════════════════════════════════════════
   SOURCE / RESOURCE CARDS
   ══════════════════════════════════════════════════════════════════════════ */
.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.source-card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--white); border-radius: var(--r);
  border: 1px solid var(--bdr); box-shadow: var(--shadow-xs);
  padding: 22px; text-decoration: none; color: inherit;
  transition: box-shadow var(--t) var(--ease), border-color var(--t) var(--ease), transform var(--t) var(--ease);
}
.source-card:hover { box-shadow: var(--shadow); border-color: var(--bdr-hi); transform: translateY(-2px); }
.source-card-top  { display: flex; align-items: center; justify-content: space-between; }
.source-card-icon { font-size: 24px; line-height: 1; }
.source-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 20px;
  background: var(--blue-light); color: var(--blue);
  border: 1px solid rgba(4,107,210,0.15);
}
.source-card-name { font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.35; }
.source-card-desc { font-size: 12.5px; color: var(--text-2); line-height: 1.65; flex: 1; }
.source-card-url  {
  font-size: 11px; color: var(--text-4); word-break: break-all;
  overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
}
.source-card-link { font-size: 13px; font-weight: 600; color: var(--blue); margin-top: 2px; }
.source-card:hover .source-card-link { text-decoration: underline; }

/* ── Chat links ──────────────────────────────────────────────────────────── */
.chat-link { color: var(--blue); text-decoration: underline; }
.chat-link:hover { color: var(--navy); }
.msg.assistant .chat-link { color: var(--blue); }

/* ══════════════════════════════════════════════════════════════════════════
   GLOBAL AI BUTTON
   ══════════════════════════════════════════════════════════════════════════ */
#global-chat-btn {
  position: fixed; top: 12px; right: 24px; z-index: 150;
  display: flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 16px;
  background: var(--navy); color: var(--white);
  border: none; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: background var(--t) var(--ease), box-shadow var(--t) var(--ease);
  box-shadow: var(--shadow-sm);
}
#global-chat-btn:hover { background: var(--navy-mid); box-shadow: var(--shadow); }
#global-chat-btn.active { background: var(--blue); }

/* ══════════════════════════════════════════════════════════════════════════
   CHAT PANEL
   ══════════════════════════════════════════════════════════════════════════ */
#chat-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: var(--chat-w);
  background: var(--white); border-left: 1px solid var(--bdr);
  box-shadow: -4px 0 24px rgba(0,0,0,0.08);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--t-md) var(--ease);
  z-index: 160;
}
#chat-panel.open { transform: translateX(0); }

.chat-head {
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px; height: var(--topbar-h);
  border-bottom: 1px solid var(--bdr); flex-shrink: 0;
}
.chat-head-gem {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: var(--r-sm);
  background: var(--blue-light);
  display: flex; align-items: center; justify-content: center;
  color: var(--blue);
}
.chat-head-text { flex: 1; }
.chat-head-title { font-size: 14px; font-weight: 700; color: var(--text); }
.chat-head-sub {
  font-size: 11px; color: var(--text-3); margin-top: 1px;
  font-family: 'JetBrains Mono', monospace;
}
.chat-x {
  width: 30px; height: 30px; border-radius: var(--r-sm);
  color: var(--text-3); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.chat-x:hover { background: var(--bg); color: var(--text); }

.key-banner {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px;
  background: #FFFBEB;
  border-bottom: 1px solid #FDE68A;
  font-size: 12.5px; color: #92400E;
}
.key-banner a { font-weight: 600; text-decoration: underline; cursor: pointer; }

#chat-msgs {
  flex: 1; overflow-y: auto; padding: 20px 16px;
  display: flex; flex-direction: column; gap: 14px;
  scrollbar-width: thin; scrollbar-color: var(--bdr) transparent;
}
.chat-welcome { text-align: center; padding: 24px 8px 8px; }
.chat-welcome-icon {
  width: 52px; height: 52px; border-radius: var(--r-lg);
  background: var(--blue-light);
  display: flex; align-items: center; justify-content: center;
  color: var(--blue); margin: 0 auto 14px;
}
.chat-welcome-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.chat-welcome-desc  { font-size: 13px; color: var(--text-2); line-height: 1.65; }
.suggestions { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; }
.suggestion {
  padding: 10px 13px; text-align: left;
  background: var(--bg); border: 1px solid var(--bdr);
  border-radius: var(--r-sm);
  font-size: 13px; color: var(--text-2);
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease);
}
.suggestion:hover { background: var(--blue-light); border-color: rgba(4,107,210,0.2); color: var(--blue); }

.msg { display: flex; flex-direction: column; gap: 5px; max-width: 92%; }
.msg.user      { align-self: flex-end; align-items: flex-end; }
.msg.assistant { align-self: flex-start; align-items: flex-start; }
.bubble { padding: 10px 14px; border-radius: var(--r); font-size: 13.5px; line-height: 1.7; }
.msg.user .bubble {
  background: var(--navy); color: var(--white);
  border-bottom-right-radius: 3px;
}
.msg.assistant .bubble {
  background: var(--bg); border: 1px solid var(--bdr);
  color: var(--text); border-bottom-left-radius: 3px;
}
.bubble strong { font-weight: 700; }

.sources { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.source-tag {
  font-size: 11px; font-weight: 500; padding: 3px 10px; border-radius: 20px;
  background: var(--blue-light); color: var(--blue); border: 1px solid rgba(4,107,210,0.15);
  cursor: pointer; transition: background var(--t) var(--ease);
}
.source-tag:hover { background: rgba(4,107,210,0.15); }

.thinking-bubble {
  padding: 10px 14px; border-radius: var(--r); border-bottom-left-radius: 3px;
  background: var(--bg); border: 1px solid var(--bdr);
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; color: var(--text-3); font-style: italic;
}
.dots span {
  display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: var(--text-4); animation: pulse 1.2s infinite;
}
.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes pulse { 0%,80%,100% { opacity: 0.25; transform: scale(0.75); } 40% { opacity: 1; transform: scale(1); } }

.ai-disclaimer {
  padding: 8px 16px; flex-shrink: 0;
  font-size: 11px; color: var(--text-3); line-height: 1.5;
  background: var(--bg-alt); border-top: 1px solid var(--bdr);
}
.chat-footer {
  padding: 14px 16px; border-top: 1px solid var(--bdr);
  display: flex; flex-direction: column; gap: 10px; flex-shrink: 0;
}
#chat-input {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--bdr); border-radius: var(--r-sm);
  background: var(--bg); color: var(--text);
  resize: none; min-height: 68px; max-height: 140px;
  font-size: 13.5px; line-height: 1.5;
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease);
}
#chat-input:focus { border-color: var(--blue); background: var(--white); }
#chat-input::placeholder { color: var(--text-4); }
.chat-actions { display: flex; align-items: center; justify-content: space-between; }
.chat-hint { font-size: 11px; color: var(--text-4); }
#send-btn {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: var(--blue); color: var(--white);
  border-radius: var(--r-sm);
  transition: background var(--t) var(--ease), opacity var(--t) var(--ease);
}
#send-btn:hover:not(:disabled) { background: var(--blue-hover); }
#send-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.attach-btn {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; flex-shrink: 0;
  background: transparent; color: var(--text-3);
  border-radius: var(--r-sm); border: 1px solid var(--bdr);
  cursor: pointer; transition: all var(--t) var(--ease);
}
.attach-btn:hover { background: var(--bg-1); color: var(--blue); border-color: var(--blue); }

.chat-drop-overlay {
  display: none; position: absolute; inset: 0;
  background: rgba(4, 107, 210, 0.08);
  border: 2px dashed var(--blue);
  border-radius: var(--r-lg);
  z-index: 50; align-items: center; justify-content: center;
  pointer-events: none;
}
.chat-drop-overlay.visible { display: flex; }
.chat-drop-content {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--blue); font-size: 14px; font-weight: 600;
}

.chat-doc-banner {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; margin: 0;
  background: rgba(4, 107, 210, 0.06);
  border-bottom: 1px solid rgba(4, 107, 210, 0.15);
  font-size: 12px; color: var(--blue); flex-shrink: 0;
}
.chat-doc-banner .doc-name {
  font-weight: 600; flex: 1; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.chat-doc-banner .doc-remove {
  cursor: pointer; opacity: 0.6; font-size: 14px;
  transition: opacity var(--t) var(--ease);
}
.chat-doc-banner .doc-remove:hover { opacity: 1; }

.msg.system { align-self: center; align-items: center; max-width: 100%; }
.msg.system .bubble {
  background: rgba(4, 107, 210, 0.06); border: 1px solid rgba(4, 107, 210, 0.15);
  color: var(--blue); font-size: 12.5px; text-align: center;
  border-radius: var(--r); padding: 10px 16px;
}

.doc-actions {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px;
}
.doc-action-btn {
  padding: 7px 14px;
  font-size: 12.5px; font-weight: 500; font-family: inherit;
  color: var(--blue); background: rgba(4, 107, 210, 0.06);
  border: 1px solid rgba(4, 107, 210, 0.2);
  border-radius: 100px; cursor: pointer;
  transition: all var(--t) var(--ease);
  white-space: nowrap;
}
.doc-action-btn:hover {
  background: rgba(4, 107, 210, 0.14);
  border-color: var(--blue);
}

/* ══════════════════════════════════════════════════════════════════════════
   MODAL
   ══════════════════════════════════════════════════════════════════════════ */
.overlay {
  position: fixed; inset: 0;
  background: rgba(11, 31, 63, 0.35);
  display: none; align-items: center; justify-content: center;
  z-index: 200; backdrop-filter: blur(3px);
}
.overlay.open { display: flex; }
.modal {
  background: var(--white); border: 1px solid var(--bdr);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  padding: 36px; width: 440px; max-width: 92vw;
  animation: modal-in 0.2s var(--ease) both;
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.97) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-icon {
  width: 44px; height: 44px; border-radius: var(--r);
  background: var(--blue-light);
  display: flex; align-items: center; justify-content: center;
  color: var(--blue); margin-bottom: 18px;
}
.modal-title { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.modal-desc  { font-size: 14px; color: var(--text-2); line-height: 1.65; margin-bottom: 24px; }
.modal-desc strong { color: var(--text); }
.field-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 6px;
}
.modal-input {
  width: 100%; height: 44px; padding: 0 14px;
  border: 1.5px solid var(--bdr); border-radius: var(--r-sm);
  background: var(--bg); color: var(--text);
  font-size: 13px; font-family: 'JetBrains Mono', monospace;
  transition: border-color var(--t) var(--ease); margin-bottom: 24px;
}
.modal-input:focus { border-color: var(--blue); }
.modal-input::placeholder { color: var(--text-4); }
.modal-btns { display: flex; gap: 10px; justify-content: flex-end; }
.btn-ghost {
  height: 40px; padding: 0 20px;
  border: 1.5px solid var(--bdr); border-radius: var(--r-sm);
  font-size: 13px; font-weight: 600; color: var(--text-2); background: var(--white);
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease);
}
.btn-ghost:hover { background: var(--bg); border-color: var(--bdr-hi); }
.btn-solid {
  height: 40px; padding: 0 24px;
  background: var(--blue); color: var(--white);
  border-radius: var(--r-sm); font-size: 13px; font-weight: 700;
  transition: background var(--t) var(--ease);
}
.btn-solid:hover { background: var(--blue-hover); }

/* ══════════════════════════════════════════════════════════════════════════
   LANDING PAGE
   ══════════════════════════════════════════════════════════════════════════ */
#landing {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column;
  align-items: center;
  overflow-y: auto;
  background: var(--white);
}

/* Subtle hero background pattern */
.landing-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(4,107,210,0.06) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 10%, rgba(5,150,105,0.04) 0%, transparent 50%),
    linear-gradient(180deg, var(--white) 0%, var(--bg-alt) 100%);
}

/* ── Landing top nav ─────────────────────────────────────────────────────── */
.landing-nav {
  position: sticky; top: 0; z-index: 5;
  width: 100%; background: rgba(255,255,255,0.92);
  border-bottom: 1px solid var(--bdr);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.landing-nav-inner {
  max-width: var(--container); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 48px; height: 56px;
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
}
.nav-brand-mark {
  font-size: 13px; font-weight: 800; letter-spacing: 0.2em;
  color: var(--navy); text-transform: uppercase;
}
.nav-brand-sep {
  width: 1px; height: 18px; background: var(--bdr);
}
.nav-brand-name {
  font-size: 14px; font-weight: 600; color: var(--text-2);
}
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-admin-link {
  font-size: 12px; font-weight: 500; color: var(--text-3);
  text-decoration: none; letter-spacing: 0.03em;
  padding: 10px 12px; min-height: 44px; display: inline-flex; align-items: center;
  border: 1px solid var(--bdr);
  border-radius: 4px;
  transition: color var(--t) var(--ease), border-color var(--t) var(--ease);
}
.nav-admin-link:hover { color: var(--text-2); border-color: var(--bdr-hi); }

/* ── Landing inner ───────────────────────────────────────────────────────── */
.landing-inner {
  position: relative; z-index: 1;
  width: 100%; max-width: var(--container);
  padding: 80px 48px 64px;
  display: flex; flex-direction: column; gap: 64px;
}

/* ── Hero section — Infralogistic-inspired ───────────────────────────────── */
.landing-header {
  text-align: center; max-width: 720px; margin: 0 auto;
  animation: fade-up 0.6s var(--ease) both;
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.landing-eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 24px;
  padding: 5px 14px; border-radius: 20px;
  background: var(--bg-alt); border: 1px solid var(--bdr);
}
.eyebrow-pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: #22C55E;
  animation: dot-pulse 2.5s ease-in-out infinite;
}
@keyframes dot-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.landing-title {
  font-size: clamp(32px, 4.5vw, 52px);
  font-weight: 800; color: var(--navy);
  letter-spacing: -0.025em; line-height: 1.15;
  margin-bottom: 20px;
}
.landing-sub {
  font-size: 17px; color: var(--text-2); font-weight: 400;
  line-height: 1.65; max-width: 540px; margin: 0 auto 32px;
}
.landing-actions {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px;
}
.landing-cta {
  display: inline-flex; align-items: center; gap: 10px;
  height: 50px; padding: 0 32px;
  background: var(--blue); color: var(--white);
  border-radius: 4px;
  font-size: 15px; font-weight: 700;
  border: none; cursor: pointer;
  transition: background var(--t) var(--ease), transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
  box-shadow: 0 2px 12px rgba(4,107,210,0.25);
}
.landing-cta:hover {
  background: var(--blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(4,107,210,0.30);
}
.landing-cta svg { transition: transform var(--t) var(--ease); }
.landing-cta:hover svg { transform: translateX(3px); }
.landing-cta-alt {
  background: var(--navy); box-shadow: 0 2px 12px rgba(11,31,63,0.25);
}
.landing-cta-alt:hover {
  background: #14305a; box-shadow: 0 6px 24px rgba(11,31,63,0.30);
}
.landing-cta-meta { font-size: 12px; color: var(--text-3); width: 100%; text-align: center; }

/* ── ESRS section ────────────────────────────────────────────────────────── */
.esrs-section {
  width: 100%;
  animation: fade-up 0.6s 0.12s var(--ease) both;
}
.esrs-section-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 24px; padding-bottom: 16px;
  border-bottom: 2px solid var(--navy);
}
.esrs-section-left {}
.esrs-section-title {
  font-size: 22px; font-weight: 700; color: var(--navy);
  line-height: 1.2; margin-bottom: 4px;
}
.esrs-section-sub { font-size: 13px; color: var(--text-3); }
.esrs-section-count {
  font-size: 12px; color: var(--text-3); white-space: nowrap;
  font-family: 'JetBrains Mono', monospace;
}

/* ESRS cards — Infralogistic service card style with centered code "icon" */
.esrs-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.esrs-card {
  position: relative; border-radius: var(--r); padding: 24px 20px 18px;
  background: var(--white);
  border: 1px solid var(--bdr);
  box-shadow: var(--shadow-xs);
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 6px;
  overflow: hidden; text-decoration: none;
  transition: box-shadow var(--t) var(--ease), border-color var(--t) var(--ease), transform var(--t) var(--ease);
}
.esrs-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.esrs-card:hover {
  transform: translateY(-3px);
  border-color: var(--bdr-hi);
  box-shadow: var(--shadow);
}

/* Category variants */
.esrs-cross::before { background: var(--cross); }
.esrs-cross:hover   { background: var(--cross-bg); }
.esrs-cross .esrs-code    { color: var(--cross); background: var(--cross-bg); }
.esrs-cross .esrs-cat-tag { background: var(--cross-bg); color: var(--cross); border-color: rgba(59,130,246,0.2); }

.esrs-env::before { background: var(--env); }
.esrs-env:hover   { background: var(--env-bg); }
.esrs-env .esrs-code    { color: var(--env); background: var(--env-bg); }
.esrs-env .esrs-cat-tag { background: var(--env-bg); color: var(--env); border-color: rgba(5,150,105,0.2); }

.esrs-soc::before { background: var(--soc); }
.esrs-soc:hover   { background: var(--soc-bg); }
.esrs-soc .esrs-code    { color: var(--soc); background: var(--soc-bg); }
.esrs-soc .esrs-cat-tag { background: var(--soc-bg); color: var(--soc); border-color: rgba(8,145,178,0.2); }

.esrs-gov::before { background: var(--gov); }
.esrs-gov:hover   { background: var(--gov-bg); }
.esrs-gov .esrs-code    { color: var(--gov); background: var(--gov-bg); }
.esrs-gov .esrs-cat-tag { background: var(--gov-bg); color: var(--gov); border-color: rgba(124,58,237,0.2); }

.esrs-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px; font-weight: 700; letter-spacing: 0.02em; line-height: 1;
  width: 56px; height: 56px; border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 6px;
}
.esrs-name {
  font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.3;
}
.esrs-desc {
  font-size: 12px; color: var(--text-3); line-height: 1.6; flex: 1; margin-top: 4px;
}
.esrs-cat-tag {
  display: inline-block;
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 20px; border: 1px solid; margin-top: 8px;
}
.esrs-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; width: 100%; }
.esrs-link-arrow {
  font-size: 14px; opacity: 0; color: var(--text-3);
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}
.esrs-card:hover .esrs-link-arrow { opacity: 1; transform: translate(2px, -2px); }

/* ── Landing footer ──────────────────────────────────────────────────────── */
.landing-footer {
  text-align: center; padding: 0 0 32px;
  animation: fade-up 0.6s 0.24s var(--ease) both;
}
.landing-footer-hint { font-size: 12px; color: var(--text-4); letter-spacing: 0.04em; }
.landing-footer-ai { display: block; font-size: 11px; color: var(--text-4); margin-top: 6px; opacity: 0.7; }
.landing-footer-links { display: flex; gap: 16px; justify-content: center; margin-top: 8px; }
.landing-footer-links a { padding: 8px 4px; min-height: 44px; display: inline-flex; align-items: center; }
.admin-link {
  display: inline-block;
  font-size: 11px; color: var(--text-3); letter-spacing: 0.04em;
  opacity: 0.6; transition: opacity 0.2s, color 0.2s;
  text-decoration: none;
}
.admin-link:hover { opacity: 1; color: var(--blue); }

/* ── Logo in nav ─────────────── */
.nav-brand-logo {
  height: 24px; width: auto; object-fit: contain;
}
.brand-gem-logo {
  width: 100%; height: 100%; object-fit: contain;
  border-radius: var(--r-sm);
}

/* ══════════════════════════════════════════════════════════════════════════
   ANALYSE SECTION
   ══════════════════════════════════════════════════════════════════════════ */
.analyse-wrap { display: flex; flex-direction: column; gap: 24px; max-width: 820px; margin: 0 auto; padding-bottom: 40px; }
.analyse-intro { font-size: 14px; color: var(--text-2); line-height: 1.7; }
.drop-zone {
  border: 2px dashed var(--bdr-hi); border-radius: var(--r-lg);
  padding: 56px 32px; text-align: center; cursor: pointer;
  background: var(--bg-alt);
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease);
  position: relative;
}
.drop-zone.drag-over { border-color: var(--blue); background: var(--blue-pale); }
.drop-zone-icon  { font-size: 36px; margin-bottom: 14px; opacity: 0.5; }
.drop-zone-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.drop-zone-sub   { font-size: 13px; color: var(--text-3); }
.drop-zone-sub strong { color: var(--blue); cursor: pointer; }
.drop-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.analyse-status {
  display: flex; align-items: center; gap: 12px; padding: 16px 20px;
  border-radius: var(--r); background: var(--bg-alt); border: 1px solid var(--bdr);
  font-size: 13px; color: var(--text-2);
}
.analyse-status .spinner { width: 18px; height: 18px; border-width: 2px; flex-shrink: 0; }
.analysis-result {
  background: var(--white); border: 1px solid var(--bdr);
  border-radius: var(--r); padding: 28px 32px;
  line-height: 1.75; font-size: 14px; color: var(--text-2);
}
.analysis-result h2 {
  font-size: 13px; font-weight: 700; color: var(--blue);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin: 24px 0 8px; padding-bottom: 8px;
  border-bottom: 1px solid var(--bdr);
}
.analysis-result h2:first-child { margin-top: 0; }
.analysis-result ul, .analysis-result ol { padding-left: 20px; margin: 8px 0; display: flex; flex-direction: column; gap: 4px; }
.analysis-result li { color: var(--text-2); }
.analysis-result strong { color: var(--text); font-weight: 700; }
.analysis-result p { margin: 6px 0; }
.analysis-filename {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 20px;
}
.analyse-reset {
  height: 38px; padding: 0 20px; border-radius: var(--r-sm);
  background: var(--white); border: 1.5px solid var(--bdr);
  color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease);
}
.analyse-reset:hover { background: var(--bg); border-color: var(--bdr-hi); }

.analyse-buttons {
  display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px;
}
.analyse-gap-btn {
  height: 38px; padding: 0 20px; border-radius: var(--r-sm);
  background: var(--blue); border: 1.5px solid var(--blue);
  color: var(--white); font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: inherit;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease);
}
.analyse-gap-btn:hover { background: var(--blue-hover); border-color: var(--blue-hover); }

/* ══════════════════════════════════════════════════════════════════════════
   COOKIE CONSENT BANNER
   ══════════════════════════════════════════════════════════════════════════ */
#cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 250;
  background: var(--white);
  border-top: 1px solid var(--bdr);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.08);
  animation: slide-up 0.3s var(--ease) both;
}
@keyframes slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.cookie-inner {
  max-width: 960px; margin: 0 auto;
  padding: 20px 32px;
  display: flex; align-items: center; gap: 24px;
}
.cookie-text { flex: 1; }
.cookie-text strong { font-size: 14px; color: var(--text); display: block; margin-bottom: 4px; }
.cookie-text p { font-size: 13px; color: var(--text-2); line-height: 1.6; margin: 0; }
.cookie-text a { color: var(--blue); text-decoration: underline; }
.cookie-btns { display: flex; gap: 8px; flex-shrink: 0; }
.cookie-btn {
  height: 40px; padding: 0 20px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1.5px solid transparent;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease);
}
.cookie-btn-accept { background: var(--blue); color: var(--white); border-color: var(--blue); }
.cookie-btn-accept:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.cookie-btn-decline { background: var(--white); color: var(--text-2); border-color: var(--bdr); }
.cookie-btn-decline:hover { background: var(--bg); border-color: var(--bdr-hi); }

@media (max-width: 480px) {
  .cookie-inner { flex-direction: column; padding: 16px; gap: 14px; }
  .cookie-btns { width: 100%; }
  .cookie-btn { flex: 1; }
}

/* ══════════════════════════════════════════════════════════════════════════
   HAMBURGER BUTTON & SIDEBAR OVERLAY (hidden on desktop)
   ══════════════════════════════════════════════════════════════════════════ */
#hamburger {
  display: none; /* shown via media query */
  position: fixed; top: 12px; left: 12px; z-index: 200;
  width: 44px; height: 44px;
  background: var(--white); border: 1px solid var(--bdr);
  border-radius: var(--r-sm); box-shadow: var(--shadow-sm);
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  cursor: pointer; padding: 0;
}
#hamburger span {
  display: block; width: 20px; height: 2px;
  background: var(--navy); border-radius: 2px;
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}
#hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#hamburger.open span:nth-child(2) { opacity: 0; }
#hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

#sidebar-overlay {
  display: none; position: fixed; inset: 0; z-index: 9;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* ══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — Tablet (≤ 768px)
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Hamburger visible */
  #hamburger { display: flex; }

  /* Sidebar becomes slide-out drawer */
  #sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 280px; z-index: 180;
    transform: translateX(-100%);
    transition: transform var(--t-md) var(--ease);
    box-shadow: none;
  }
  #sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.12);
  }
  #sidebar-overlay.open { display: block; }

  /* Main takes full width */
  #main { margin-left: 0 !important; }
  #main.chat-open { margin-right: 0; }

  /* Topbar — account for hamburger */
  #topbar { padding: 0 16px 0 64px; gap: 10px; }
  .topbar-right { padding-right: 0; }

  /* Content area */
  #content { padding: 20px 16px 32px; }

  /* Card grids — 2 columns on tablet */
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
  .source-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .esrs-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }

  /* Chat panel — full screen on tablet */
  #chat-panel { width: 100vw; }

  /* Global chat button */
  #global-chat-btn { top: 12px; right: 12px; height: 44px; padding: 0 14px; font-size: 12px; }

  /* Landing page */
  .landing-nav-inner { padding: 0 20px; height: 52px; }
  .landing-inner { padding: 48px 20px 40px; gap: 40px; }
  .landing-title { font-size: clamp(26px, 5vw, 36px); }
  .landing-sub { font-size: 15px; }
  .landing-cta { height: 48px; padding: 0 24px; font-size: 14px; }

  /* Bigger touch targets */
  .nav-item { padding: 12px 10px; font-size: 14px; }
  .suggestion { padding: 14px; font-size: 14px; }
  .filter-select { height: 40px; font-size: 14px; }
  #search { height: 44px; font-size: 15px; }

  /* Analyse */
  .analyse-wrap { padding: 0 4px 32px; }
  .analysis-result { padding: 20px; }
  .drop-zone { padding: 40px 20px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — Phone (≤ 480px)
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  /* Single column cards */
  .card-grid { grid-template-columns: 1fr; }
  .source-grid { grid-template-columns: 1fr; }
  .esrs-grid { grid-template-columns: 1fr 1fr; gap: 10px; }

  /* Content */
  #content { padding: 16px 12px 28px; }

  /* Topbar compact */
  #topbar { height: 52px; padding: 0 12px 0 60px; }
  .search-wrapper { max-width: none; }
  .topbar-right { gap: 4px; }
  .filter-select { padding: 0 8px; font-size: 13px; }

  /* Landing hero */
  .landing-inner { padding: 32px 16px 32px; gap: 32px; }
  .landing-title { font-size: clamp(24px, 7vw, 32px); }
  .landing-sub { font-size: 14px; margin-bottom: 24px; }
  .landing-actions { flex-direction: column; width: 100%; }
  .landing-cta { width: 100%; justify-content: center; height: 52px; font-size: 15px; }
  .landing-nav-inner { padding: 0 16px; }

  /* ESRS section */
  .esrs-section-header { flex-direction: column; align-items: flex-start; gap: 4px; }
  .esrs-card { padding: 18px 14px 14px; }
  .esrs-code { width: 44px; height: 44px; font-size: 14px; }

  /* Chat panel full screen */
  #chat-panel { width: 100vw; }
  .chat-footer { padding: 12px; }
  #chat-input { min-height: 56px; font-size: 16px; /* prevents iOS zoom */ }
  .chat-hint { display: none; }
  .suggestion { padding: 14px 12px; font-size: 14px; }

  /* Global chat button */
  #global-chat-btn {
    top: auto; bottom: 16px; right: 16px;
    height: 48px; padding: 0 18px;
    border-radius: 24px; box-shadow: var(--shadow-lg);
    font-size: 13px;
  }

  /* Buttons touch-friendly */
  .btn-ghost, .btn-solid { height: 44px; font-size: 14px; }
  .modal { padding: 24px; }
  .modal-title { font-size: 18px; }

  /* Analyse */
  .drop-zone { padding: 32px 16px; }
  .drop-zone-title { font-size: 15px; }
  .analyse-buttons { flex-direction: column; }
  .analyse-gap-btn { width: 100%; text-align: center; }
  .analyse-reset { width: 100%; }
}
