* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #f5f5f5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Landing/chat mode switching.
   - body.landing  → show the centered welcome screen, hide the chat layout.
   - body.chat     → the original chat layout (messages + bottom input). */
body.landing #messages,
body.landing #input-area { display: none; }
body.chat #landing { display: none; }
body.chat { height: 100vh; }

body > header {
  background: #1a1a2e;
  color: #eee;
  padding: 12px 20px;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 auto;
}

.nav-links {
  display: flex;
  gap: 20px;
  align-items: center;
}

.nav-link {
  color: #eee;
  text-decoration: none;
  transition: opacity 0.2s;
}

.nav-link:hover {
  opacity: 0.8;
}

#messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg {
  border-radius: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  padding: 10px 14px;
}

.msg.user {
  align-self: flex-end;
  background: #1a1a2e;
  color: #fff;
}

.msg.assistant {
  align-self: flex-start;
  background: #fff;
  color: #222;
  border: 1px solid #ddd;
}

.msg.error {
  align-self: center;
  background: #fee;
  color: #900;
  border: 1px solid #fcc;
  font-size: 14px;
}

.msg.tool-info {
  align-self: center;
  background: #eef6ff;
  color: #456;
  border: 1px solid #cde;
  font-size: 13px;
  max-width: 90%;
}

#input-area {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  background: #fff;
  border-top: 1px solid #ddd;
}

#input-area textarea {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  resize: none;
  min-height: 44px;
  max-height: 120px;
}

#input-area textarea:focus {
  outline: none;
  border-color: #1a1a2e;
}

#input-area button {
  padding: 10px 20px;
  background: #1a1a2e;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
}

#input-area button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.typing {
  align-self: flex-start;
  color: #888;
  font-style: italic;
  padding: 8px 14px;
  flex-shrink: 0;
}

.typing-bar {
  margin-top: 6px;
  width: 120px;
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  overflow: hidden;
}

.typing-bar::after {
  content: "";
  display: block;
  width: 40%;
  height: 100%;
  background: #1a1a2e;
  border-radius: 2px;
  animation: typing-slide 1.2s ease-in-out infinite;
}

@keyframes typing-slide {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(200%); }
  100% { transform: translateX(-100%); }
}

.debug-entry {
  background: #1a1a2e;
  color: #cfd8dc;
  font-family: "SF Mono", "Cascadia Mono", "Consolas", monospace;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 6px;
  white-space: pre-wrap;
  word-break: break-all;
}

/* About page styles */
main {
  flex: 1;
  overflow-y: auto;
}

.about-section {
  max-width: 800px;
  margin: 30px auto;
  padding: 20px;
}

.about-section h1 {
  font-size: 24px;
  margin-bottom: 20px;
  color: #1a1a2e;
}

.about-section h2 {
  font-size: 18px;
  margin-top: 25px;
  margin-bottom: 10px;
  color: #333;
}

.about-section p {
  line-height: 1.6;
  color: #444;
  margin-bottom: 10px;
}

.about-section ul {
  margin-left: 20px;
  line-height: 1.8;
  color: #444;
}

.about-section li {
  margin-bottom: 8px;
}

.about-section.logos {
  display: flex;
  justify-content: center;
}

.tool-details {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

.tool-details[open] {
  background: #fafafa;
}

.tool-details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  color: #1a1a2e;
  list-style: none;
}

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

.tool-details summary:hover {
  color: #333;
}

.tool-details summary::before {
  content: "▶ ";
  font-size: 12px;
  margin-right: 5px;
  display: inline-block;
  transition: transform 0.2s;
}

.tool-details[open] summary::before {
  transform: rotate(90deg);
}

.tool-description {
  margin-top: 10px;
  padding-left: 15px;
  color: #555;
  line-height: 1.6;
}

.about-section a {
  color: #1a1a2e;
  text-decoration: none;
}

.about-section a:hover {
  text-decoration: underline;
}

.msg summary {
  cursor: pointer;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  font-style: italic;
  margin-bottom: 5px;
}

.msg.user summary { color: rgba(255,255,255,0.8); }
.msg.user summary::after { background: rgba(255,255,255,0.3); }

.msg.error summary { color: #900; }
.msg.error summary::after { background: #fcc; }

/* Table and chart messages start collapsed (see addMessage in chat.js). Give
   their summaries a rotating disclosure triangle and an "expand" hint so it's
   obvious there's content to open. Mirrors the .tool-details summary pattern. */
.msg.table > summary,
.msg.chart > summary {
  display: flex;
  align-items: center;
  list-style: none;
}

.msg.table > summary::-webkit-details-marker,
.msg.chart > summary::-webkit-details-marker {
  display: none;
}

.msg.table > summary::before,
.msg.chart > summary::before {
  content: "▶";
  font-size: 10px;
  margin-right: 6px;
  flex: 0 0 auto;
  font-style: normal;
  transition: transform 0.2s;
}

.msg.table[open] > summary::before,
.msg.chart[open] > summary::before {
  transform: rotate(90deg);
}

/* "Tap to expand" hint inside the collapsed summary; hidden once opened. */
.msg.table .expand-hint,
.msg.chart .expand-hint {
  margin-left: 8px;
  font-style: normal;
  font-weight: 400;
  font-size: 11px;
  opacity: 0.7;
}

.msg.table[open] .expand-hint,
.msg.chart[open] .expand-hint {
  display: none;
}

.msg.force {
  align-self: stretch;
  max-width: 100%;
  background: #ffffcc;
  color: #130436;
  border: 1px solid #111050;
}

.msg.table {
  max-width: 100%;
  background: #97c2f2;
  color: #130436;
  border: 1px solid #111050;
}

.msg.table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  display: table;
  white-space: normal;
  border: 1px solid #75adec;
}

.msg.table th,
.msg.table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #75adec;
}

.msg.table th {
  background: #75adec;
  color: #130436;
  font-weight: 600;
}

.msg.table tr:hover td {
  background: #85b8f0;
}

/* Hide data rows beyond the preview limit until "show all" is toggled. The
   .show-all class is added to the <table> by the toggle button. */
.msg.table table:not(.show-all) tr.table-row-hidden {
  display: none;
}

/* "Download CSV" links live in the table footer (.table-actions), so they
   only appear once the table is expanded -- not in the collapsed header. */
.msg.table .table-actions {
  margin-top: 8px;
  text-align: right;
}

.msg.table .table-download {
  margin-left: 10px;
  font-style: normal;
  font-weight: 600;
  color: #130436;
  text-decoration: underline;
}

.msg.table .table-download:hover {
  opacity: 0.75;
}

/* "Show all / Show less" toggle at the bottom of a collapsed table. */
.msg.table .table-toggle {
  display: block;
  margin: 8px auto 0;
  padding: 4px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #130436;
  background: #75adec;
  border: 1px solid #5a96d8;
  border-radius: 6px;
  cursor: pointer;
}

.msg.table .table-toggle:hover {
  background: #85b8f0;
}

.msg.chart {
  align-self: stretch;
  max-width: 100%;
  background: #97c2f2;
  color: #130436;
  border: 1px solid #111050;
}

.msg.chart canvas {
  background: #fff;
  border-radius: 6px;
}

/* Export buttons in the chart message header (inside <summary>). Styled to
   match the table-download links, but as <button>s because the file is
   generated at click time. */
.msg.chart .chart-export {
  margin-left: 10px;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: #474545;
  background: none;
  border: none;
  text-decoration: underline;
  cursor: pointer;
}

.msg.chart .chart-export:hover {
  opacity: 0.75;
}

/* Disabled while showing click feedback ("Copied!" / "Failed"). */
.msg.chart .chart-export:disabled {
  cursor: default;
  opacity: 0.6;
}

.msg.sources {
  text-align: right;
  font-style: italic;
  font-size: 13px;
}

.msg.sources span {
  margin-right: 5px;
  font-weight: bold;
}

.msg.chart-actions {
  text-align: left;
  font-size: 13px;
  line-height: 1;
  padding: 2px;
}

/* Markdown rendered content */
.markdown {
  white-space: normal;
}

/* "Download this answer (markdown)" button under an assistant reply. It is an
   <a download> (the shared builder in download.js emits .table-download) but
   styled as a button, matching the table "Show all" toggle so it stands out
   against the white message background. */
.msg.assistant .answer-actions {
  margin-top: 8px;
  font-size: 13px;
  text-align: right;
}

.msg.assistant .table-download {
  display: inline-block;
  padding: 4px 14px;
  font-style: normal;
  font-weight: 600;
  color: #130436;
  background: #75adec;
  border: 1px solid #5a96d8;
  border-radius: 6px;
  text-decoration: none;
}

.msg.assistant .table-download:hover {
  background: #85b8f0;
}

/* "Copy answer" shares the download link's pill styling but is a <button>
   (nothing to download; it writes to the clipboard at click time), so reset
   the browser button font and add spacing between the two controls. */
.msg.assistant button.table-download {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  margin-right: 8px;
}

/* Disabled while showing click feedback ("Copied!" / "Copy failed"). */
.msg.assistant button.table-download:disabled {
  cursor: default;
  opacity: 0.7;
}

.markdown p {
  margin-bottom: 0.5em;
}

.markdown p:last-child {
  margin-bottom: 0;
}

.markdown ul, .markdown ol {
  margin: 0.3em 0 0.5em 1.5em;
}

.markdown li {
  margin-bottom: 0.2em;
}

.markdown h1, .markdown h2, .markdown h3 {
  margin: 0.6em 0 0.3em;
}

.markdown h1 { font-size: 1.3em; }
.markdown h2 { font-size: 1.15em; }
.markdown h3 { font-size: 1.05em; }

.markdown code {
  background: rgba(0,0,0,0.06);
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 0.9em;
}

.markdown pre {
  background: rgba(0,0,0,0.06);
  padding: 8px 12px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 0.4em 0;
}

.markdown pre code {
  background: none;
  padding: 0;
}

.markdown a {
  color: #1a5fb4;
  text-decoration: underline;
}

.markdown strong {
  font-weight: 600;
}

.markdown table {
  border-collapse: collapse;
  margin: 0.4em 0;
  font-size: 0.9em;
}

.markdown th, .markdown td {
  border: 1px solid #ddd;
  padding: 4px 8px;
}

.markdown th {
  background: rgba(0,0,0,0.04);
}

.markdown blockquote {
  border-left: 3px solid #ccc;
  padding-left: 10px;
  margin: 0.4em 0;
  color: #555;
}

/* ---------- Tools drawer ---------- */

.nav-button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: #eee;
}

.tools-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(720px, 90vw);
  background: #fff;
  box-shadow: -4px 0 16px rgba(0,0,0,0.15);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 200;
  display: flex;
  flex-direction: column;
}

.tools-drawer.open {
  transform: translateX(0);
}

.tools-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 150;
}

.tools-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
}

.tools-drawer-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.tools-close {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #888;
  padding: 0 4px;
}

.tools-close:hover {
  color: #222;
}

.tools-content {
  overflow-y: auto;
  padding: 16px 20px;
  flex: 1;
}

.tools-loading,
.tools-empty,
.tools-error {
  color: #888;
  font-style: italic;
}

.tools-error {
  color: #900;
}

.tools-group {
  margin-bottom: 22px;
}

.tools-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  padding: 10px 16px;
}

.tools-group-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #000000;
}

.tools-group-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 10px 0;
}

.tools-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  border-radius: 10px;
  text-decoration: none;
  border: 1px solid transparent;
  background: #eee;
  color: #333;
  transition: opacity 0.15s;
}

.tools-badge:hover {
  opacity: 0.8;
}

/* Colour per known label.  Unknown labels keep the default grey style. */
.tools-badge--homepage,
.tools-badge--home { background: #e7f0fb; color: #1f4d8a; border-color: #c5d9ef; }
.tools-badge--documentation,
.tools-badge--docs { background: #eaf6ed; color: #2d6b3c; border-color: #c4e2cc; }
.tools-badge--repository,
.tools-badge--source,
.tools-badge--source-code { background: #f3eaf8; color: #6a3a8a; border-color: #d9c5e6; }
.tools-badge--issues,
.tools-badge--bug-tracker,
.tools-badge--bugs { background: #fde9e7; color: #8a2c22; border-color: #f1c4be; }
.tools-badge--changelog,
.tools-badge--release-notes { background: #fef6e0; color: #7a5c00; border-color: #ecdba4; }
.tools-badge--funding { background: #fff0f5; color: #8a2752; border-color: #efc2d4; }

/* Resource actions row: a clear download button plus an optional source link.
   Kept visually distinct from the grey metadata tags above it. */
.resource-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 8px 0 4px 0;
}

.resource-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  background: #1f4d8a;
  color: #fff;
  border: 1px solid #1a4378;
  transition: background 0.15s;
}

.resource-download:hover {
  background: #17407a;
}

.resource-download-icon {
  display: inline-flex;
  line-height: 0;
}

.resource-source {
  font-size: 12px;
  color: #1f4d8a;
  text-decoration: none;
}

.resource-source:hover {
  text-decoration: underline;
}

.tools-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tools-list li {
  margin: 0;
}

.tools-tool {
  border-bottom: 1px solid #f3f3f3;
  padding: 6px 0;
}

.tools-tool summary {
  cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  color: #1a1a2e;
  padding: 4px 0;
  list-style: none;
}

.tools-tool summary::-webkit-details-marker {
  display: none;
}

.tools-tool summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 6px;
  color: #888;
  transition: transform 0.15s;
}

.tools-tool[open] summary::before {
  transform: rotate(90deg);
}

.tools-tool-desc {
  margin: 6px 0 6px 16px;
  padding: 8px 10px;
  background: #fafafa;
  border-left: 3px solid #ddd;
  font-size: 12.5px;
  line-height: 1.5;
  color: #333;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: inherit;
}

/* ---------- Landing (homepage) ---------- */

#landing {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 24px 48px;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(26,26,46,0.06), transparent 60%),
    radial-gradient(800px 400px at 80% 110%, rgba(151,194,242,0.25), transparent 60%),
    #f7f8fb;
}

.landing-hero {
  width: 100%;
  max-width: 720px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.landing-ai-labs-logo {
  display: block;
  width: 350px;
  height: auto;
}

.landing-title {
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1a1a2e;
  line-height: 1.1;
  margin: 0;
}

.landing-tagline {
  font-size: 17px;
  line-height: 1.55;
  color: #555;
  max-width: 600px;
  margin: 0;
}

.landing-intro {
  width: 100%;
  max-width: 520px;
  color: #252525;
  font-size: 13px;
  line-height: 1.3;
  text-align: left;
}

.landing-intro p + p {
  margin-top: 18px;
}

.landing-intro a {
  color: inherit;
  font-weight: 600;
}

.landing-invitation {
  color: #252525;
  font-size: 13px;
}

.landing-search {
  width: 100%;
  display: flex;
  align-items: stretch;
  gap: 0;
  background: #fff;
  border: 1px solid #d8dae3;
  border-radius: 999px;
  padding: 6px 6px 6px 22px;
  box-shadow: 0 8px 28px rgba(20, 30, 60, 0.08), 0 1px 2px rgba(20, 30, 60, 0.04);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.landing-search:focus-within {
  border-color: #1a1a2e;
  box-shadow: 0 12px 32px rgba(20, 30, 60, 0.12), 0 1px 2px rgba(20, 30, 60, 0.06);
}

.landing-search-input {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  font: inherit;
  font-size: 16px;
  line-height: 1.45;
  padding: 12px 0;
  background: transparent;
  color: #1a1a2e;
  min-height: 24px;
  max-height: 160px;
}

.landing-search-input::placeholder {
  color: #8b91a3;
}

.landing-search-btn {
  flex-shrink: 0;
  padding: 0 22px;
  border: none;
  border-radius: 999px;
  background: #1a1a2e;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.landing-search-btn:hover:not(:disabled) {
  background: #2a2a4a;
}

.landing-search-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.landing-meta {
  font-size: 14px;
  color: #6b7280;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  align-items: center;
}

.landing-meta a,
.link-button {
  color: #1a5fb4;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.landing-meta a:hover,
.link-button:hover { text-decoration: underline; }

.landing-meta .dot { color: #c8ccd6; }

/* Plugin / data-source cards */

.landing-plugins {
  width: 100%;
  max-width: 1040px;
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

.landing-plugins-loading,
.landing-plugins-error {
  grid-column: 1 / -1;
  text-align: center;
  font-style: italic;
  color: #888;
  padding: 24px;
}

.landing-plugins-error { color: #8a2c22; }

.plugin-card {
  background: #fff;
  border: 1px solid #e3e5ec;
  border-radius: 14px;
  padding: 20px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 1px 2px rgba(20, 30, 60, 0.03);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.plugin-card:hover {
  transform: translateY(-2px);
  border-color: #c7cbd6;
  box-shadow: 0 12px 24px rgba(20, 30, 60, 0.07);
}

.plugin-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.plugin-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0;
}

.plugin-card-count {
  font-size: 12px;
  color: #8b91a3;
  white-space: nowrap;
}

.plugin-card-desc {
  font-size: 13.5px;
  line-height: 1.5;
  color: #555;
  margin: 0;
}

.plugin-card-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8b91a3;
  margin: 4px 0 0 0;
}

.plugin-card-chips {
  display: flex;
  flex-direction: column;
  gap: 6px;
  /* Cap the list so plugins with many sample questions do not stretch the
     card; ~42px per one-line chip, so 250px shows at least 6 before
     scrolling. */
  max-height: 250px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #c7d3ee transparent;
}

.plugin-card-chips::-webkit-scrollbar { width: 6px; }
.plugin-card-chips::-webkit-scrollbar-thumb {
  background: #c7d3ee;
  border-radius: 3px;
}

.plugin-card-chips .chip { flex-shrink: 0; }

.plugin-card-limitations {
  padding: 12px 14px;
  border: 1px solid #e3e7f0;
  border-radius: 10px;
  background: #f8f9fc;
  color: #555;
  font-size: 12.5px;
  line-height: 1.45;
}

.plugin-card-limitations .plugin-card-section-label {
  margin: 0 0 6px;
}

.plugin-card-limitations ul {
  margin: 0;
  padding-left: 18px;
}

.plugin-card-limitations li + li {
  margin-top: 4px;
}

.chip {
  text-align: left;
  background: #f4f6fb;
  border: 1px solid #e3e7f0;
  color: #1a1a2e;
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.chip:hover {
  background: #e9eef8;
  border-color: #c7d3ee;
}

.chip::before {
  content: "› ";
  color: #6b7280;
  font-weight: 600;
}

.plugin-card-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 6px;
}

.plugin-card-footer .tools-badge { font-size: 11px; }

.landing-footer {
  margin-top: 48px;
  max-width: 720px;
  text-align: center;
  font-size: 13px;
  color: #8b91a3;
  line-height: 1.55;
}

.landing-footer a {
  color: #1a5fb4;
  text-decoration: none;
}

.landing-footer a:hover { text-decoration: underline; }

@media (max-width: 600px) {
  .landing-ai-labs-logo { width: 148px; }
  .landing-title { font-size: 32px; }
  .landing-tagline { font-size: 15px; }
  .landing-search { padding: 4px 4px 4px 16px; }
  .landing-search-btn { padding: 10px 16px; font-size: 14px; }
  #landing { padding: 32px 16px 24px; }
}

/* ---------- Language switcher (in the page nav) ---------- */

.lang-switcher {
  display: inline-flex;
  gap: 2px;
  margin-left: 12px;
  padding: 2px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
}

.lang-btn {
  background: none;
  border: none;
  color: #cdd0d8;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 4px 9px;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}

.lang-btn:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.lang-btn.is-active {
  background: #fff;
  color: #1a1a2e;
}


/* ---------- Open Knowledge visual identity ---------- */

:root {
  --okfn-cyan: #00d1ff;
  --okfn-cyan-dark: #00a9cf;
  --okfn-ink: #111111;
  --okfn-charcoal: #2d2d2d;
  --okfn-paper: #ffffff;
  --okfn-soft: #f4fbfd;
  --okfn-line: #cbd8dc;
  --okfn-footer-border: #4b4b4b;
  --okfn-footer-text: #f3f3f3;
  --okfn-footer-muted: #bdbdbd;
}

body {
  background: var(--okfn-paper);
  color: var(--okfn-ink);
}

body > header {
  background: var(--okfn-cyan);
  color: var(--okfn-ink);
  padding: 10px 28px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.14);
}

.nav {
  width: 100%;
  max-width: none;
}

.nav-link,
.nav-button {
  color: var(--okfn-ink);
  font-weight: 600;
}

#landing {
  padding: 72px 24px 64px;
  background: #f7f7f7;
}

.landing-hero {
  max-width: 820px;
  gap: 22px;
}

.landing-title {
  color: var(--okfn-ink);
  font-size: clamp(42px, 5vw, 60px);
  font-weight: 800;
  letter-spacing: -0.035em;
}

.landing-tagline {
  max-width: 650px;
  color: #383838;
  font-size: 16px;
}

.landing-intro {
  max-width: 520px;
  color: #252525;
  font-size: 13px;
}

.landing-search {
  max-width: 760px;
  border: 1.5px solid var(--okfn-ink);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.18);
}

.landing-search:focus-within {
  border-color: var(--okfn-cyan-dark);
  box-shadow: 0 0 0 3px rgba(0, 209, 255, 0.2), 0 3px 0 rgba(0, 0, 0, 0.18);
}

.dataset-scope {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px 8px;
  margin-bottom: 25px;
  padding: 6px 12px;
  color: #33484e;
  background: #e7f7fa;
  border: 1px solid #bfdee4;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.35;
}

.dataset-scope p:not(:last-child) {
  margin-bottom: 10px;
}

.dataset-scope-label::after {
  content: ":";
}

.landing-search-btn {
  background: var(--okfn-ink);
}

.landing-search-btn:hover:not(:disabled) {
  background: #333;
}

.landing-meta {
  color: #555;
}

.landing-meta a,
.link-button,
.landing-footer a {
  color: #006f86;
  font-weight: 600;
}

.landing-plugins {
  max-width: 900px;
  margin-top: 54px;
}

.plugin-card {
  border: 1px solid var(--okfn-line);
  border-radius: 6px;
  box-shadow: none;
}

.plugin-card:hover {
  transform: none;
  border-color: var(--okfn-cyan-dark);
  box-shadow: 0 10px 24px rgba(0, 92, 112, 0.08);
}

.plugin-card-title,
.tools-tool summary {
  color: var(--okfn-ink);
}

.plugin-card-section-label {
  color: #56656a;
}

.chip {
  background: var(--okfn-soft);
  border-color: #d8e8ec;
  color: var(--okfn-ink);
  border-radius: 4px;
}

.chip:hover {
  background: #e4f8fc;
  border-color: var(--okfn-cyan-dark);
}

.plugin-card-chips {
  scrollbar-color: var(--okfn-cyan-dark) transparent;
}

.plugin-card-chips::-webkit-scrollbar-thumb {
  background: var(--okfn-cyan-dark);
}

.plugin-card-limitations {
  background: #f6f6f6;
  border-color: #dedede;
}

.site-footer {
  width: 100%;
  min-height: 112px;
  margin-top: auto;
  padding: 18px 28px 14px;
  background: var(--okfn-charcoal);
  border-top: 1px solid var(--okfn-footer-border);
  color: var(--okfn-footer-text);
}

.site-footer-inner {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
}

.site-footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--okfn-footer-border);
}

.site-footer-brand {
  display: inline-flex;
  flex-shrink: 0;
}

.site-footer-brand img {
  display: block;
  width: 142px;
  height: 34px;
  object-fit: contain;
  filter: grayscale(1) brightness(0) invert(1);
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 16px;
  margin-left: auto;
}

.site-footer-links a {
  color: var(--okfn-footer-text);
  font-size: 10px;
  text-decoration: none;
}

.site-footer-links a:hover {
  text-decoration: underline;
}

.site-footer-social {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-footer-social a {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  text-decoration: none;
}

.site-footer-social img {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
  transition: transform 0.15s ease;
}

.site-footer-social a:hover img {
  transform: scale(1.12);
}

.site-footer-legal {
  margin-top: 11px;
  color: var(--okfn-footer-muted);
  font-size: 10px;
  line-height: 1.35;
}

.landing-footer {
  max-width: none;
  text-align: initial;
  margin-top: 0;
}

body.chat > .landing-footer {
  display: none;
}

.about-section {
  max-width: 880px;
}

.about-section h1 {
  color: var(--okfn-ink);
}

.about-section a {
  color: #007f9b;
}

.about-hero-logo {
  display: block;
  width: min(100%, 360px);
  height: auto;
  margin: 20px 0 28px;
}

.about-link-list,
.how-to-steps {
  display: grid;
  gap: 16px;
}

.how-to-steps {
  margin: 24px 0 0 24px;
  color: #444;
}

.how-to-steps > li {
  padding-left: 8px;
}

.how-to-steps h2 {
  margin-top: 0;
}

@media (max-width: 760px) {
  body > header {
    padding: 9px 16px;
  }

  .nav,
  .nav-links,
  .site-footer-top {
    flex-wrap: wrap;
  }

  .nav {
    gap: 10px 18px;
  }

  .nav-links {
    gap: 12px;
  }

  #landing {
    padding: 44px 16px 36px;
  }

  .site-footer-top {
    justify-content: center;
  }

  .site-footer-links {
    justify-content: center;
    margin-left: 0;
  }

  .site-footer-legal {
    text-align: center;
  }
}

@media (max-width: 520px) {
  .nav-links {
    width: 100%;
  }

  .nav-link,
  .nav-button {
    font-size: 13px;
  }

  .lang-switcher {
    margin-left: 0;
  }
}

.site-footer a { color: var(--okfn-footer-text); }
.site-footer a:hover { color: var(--okfn-paper); }


/* Navigation layout matching the OKFN IATI sandbox mockup. */
.okfn-institutional-menu {
  width: 100%;
  height: 0;
  transition: height 0.25s ease;
}

.okfn-institutional-menu:has(#ok-panel.open) {
  height: 123px;
}

#ok-panel-wrapper {
  float: right;
}

#ok-panel-wrapper:not([data-breakpoint*="px"]) > .ok-ribbon {
  margin-top: 0;
  margin-bottom: 1.5em;
  background-color: transparent;
}

body > header .nav-link,
body > header .nav-button {
  color: #fff;
}

.nav-links {
  gap: 34px;
  margin-left: auto;
}

@media (min-width: 701px) {
  body > header .nav {
    padding-right: 170px;
  }
}

.lang-switcher {
  gap: 0;
  margin-left: 4px;
  padding: 3px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.lang-btn {
  color: #222;
  padding: 4px 9px;
}

.lang-btn:hover {
  color: #005d72;
  background: #e7faff;
}

.lang-btn.is-active {
  color: #fff;
  background: #007d99;
}

@media (max-width: 900px) {
  .nav-links {
    gap: 16px;
  }

}

@media (max-width: 700px) {
  .nav-links {
    width: 100%;
    justify-content: center;
  }
}
