:root {
  --c-bg: #f7f8fb;
  --c-surface: #ffffff;
  --c-border: #e3e6ee;
  --c-text: #1a1f2e;
  --c-muted: #5b6478;
  --c-brand: #0b3d91;
  --c-brand-soft: #e6ecf7;
  --c-accent: #c8102e;
  --c-success: #1f7a3a;
  --c-warn: #b46a00;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

.site-header {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  padding: 24px 0 0;
}
.brand { display: flex; gap: 16px; align-items: center; }
.brand-mark {
  width: 64px; height: 64px;
  border-radius: 14px;
  display: block;
  object-fit: cover;
  /* Subtle drop shadow so the icon lifts off the header */
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.06);
}
.brand h1 { font-size: 30px; margin: 0; letter-spacing: -0.015em; }
.tagline { margin: 4px 0 0; color: var(--c-muted); font-size: 15px; }
.updated { margin: 12px 0 0; font-size: 13px; color: var(--c-muted); }

.tabs {
  display: flex;
  gap: 4px;
  margin-top: 22px;
  border-bottom: 2px solid var(--c-border);
  /* Allow horizontal scrolling on narrow screens, but never reserve space for
     a vertical scrollbar — the active-tab underline trick (margin-bottom:-2px)
     was just enough to trigger one in some browsers. */
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;          /* Firefox: hide the horizontal scrollbar too */
}
.tabs::-webkit-scrollbar { display: none; }   /* Chrome/Safari/Edge */
.tab {
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--c-muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;            /* sit on top of the thicker tab bar underline */
  white-space: nowrap;
}
.tab:hover { color: var(--c-text); text-decoration: none; }
.tab.is-active { color: var(--c-brand); border-bottom-color: var(--c-brand); }

main.container { padding-top: 44px; padding-bottom: 60px; }

.search-bar {
  position: relative;
  margin-bottom: 22px;
}
#search {
  width: 100%;
  padding: 12px 40px 12px 14px;   /* extra right padding for the clear button */
  font-size: 15px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-surface);
  box-shadow: var(--shadow-sm);
}
#search:focus { outline: 2px solid var(--c-brand); outline-offset: 1px; }
/* Hide the native WebKit/Edge “×” so it doesn't clash with our custom button. */
#search::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

.search-clear {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--c-muted);
  cursor: pointer;
  padding: 0;
  line-height: 0;
}
.search-clear:hover { background: var(--c-brand-soft); color: var(--c-brand); }
.search-clear:focus-visible { outline: 2px solid var(--c-brand); outline-offset: 1px; }
.search-clear[hidden] { display: none; }

.panel { display: none; }
.panel.is-active { display: block; }
.panel h2 { font-size: 20px; margin: 0 0 4px; letter-spacing: -0.01em; }
.muted { color: var(--c-muted); font-size: 14px; margin: 0 0 18px; }

.card-grid {
  list-style: none;
  padding: 0; margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.card-grid li a {
  display: block;
  padding: 14px 16px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  font-weight: 500;
  color: var(--c-text);
  transition: transform .08s ease, box-shadow .08s ease, border-color .08s ease;
}
.card-grid li a:hover {
  text-decoration: none;
  border-color: var(--c-brand);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.grouped-list { display: grid; gap: 20px; }
.group {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.group h3 {
  margin: 0 0 10px;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.group-count {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--c-brand-soft);
  color: var(--c-brand);
  letter-spacing: 0;
}

/* ---- Documents view toggle (specialty / licence class) ----------------- */
.view-toggle {
  display: inline-flex;
  padding: 3px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  margin-bottom: 16px;
}
.view-toggle__btn {
  border: 0;
  background: transparent;
  color: var(--c-muted);
  font: inherit;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.view-toggle__btn.is-active {
  background: var(--c-surface);
  color: var(--c-brand);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}
.view-toggle__btn:focus-visible {
  outline: 2px solid var(--c-brand);
  outline-offset: 1px;
}
.group ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.group li { padding: 6px 0; border-bottom: 1px dashed var(--c-border); }
.group li:last-child { border-bottom: 0; }
.file-tag {
  display: inline-block;
  font-size: 11px;
  padding: 1px 6px;
  margin-left: 6px;
  border-radius: 4px;
  background: var(--c-brand-soft);
  color: var(--c-brand);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.change-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.change {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-left: 3px solid var(--c-brand);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 12px;
  align-items: start;
}
.change[data-kind="added"] { border-left-color: var(--c-success); }
.change[data-kind="removed"] { border-left-color: var(--c-accent); }
.change[data-kind="renamed"] { border-left-color: var(--c-warn); }
.change time { font-size: 12px; color: var(--c-muted); font-variant-numeric: tabular-nums; }
.change .kind {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 4px;
}
.change[data-kind="added"] .kind { background: #e3f3e9; color: var(--c-success); }
.change[data-kind="removed"] .kind { background: #fbe6ea; color: var(--c-accent); }
.change[data-kind="renamed"] .kind { background: #fcefdc; color: var(--c-warn); }
.change h4 { margin: 0 0 2px; font-size: 14px; }
.change p { margin: 0; font-size: 13px; color: var(--c-muted); }

.empty {
  padding: 30px;
  text-align: center;
  color: var(--c-muted);
  background: var(--c-surface);
  border: 1px dashed var(--c-border);
  border-radius: var(--radius);
}

/* ---- Cross-tab search results ---------------------------------------- */

.results { display: grid; gap: 20px; }
.result-group {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
}
.result-group h3 {
  margin: 0 0 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.result-count {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--c-brand-soft);
  color: var(--c-brand);
  letter-spacing: 0;
}
.result-group ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.result {
  padding: 8px 0;
  border-bottom: 1px dashed var(--c-border);
}
.result:last-child { border-bottom: 0; }
.result-main { font-size: 14px; }
.result-main a { font-weight: 500; }
.result-meta {
  font-size: 12px;
  color: var(--c-muted);
  margin-top: 2px;
}
.result-kind {
  display: inline-block;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.05em;
}
.result-kind--added   { background: #e3f3e9; color: var(--c-success); }
.result-kind--removed { background: #fbe6ea; color: var(--c-accent); }
.result-kind--renamed { background: #fcefdc; color: var(--c-warn); }

mark {
  background: #fff3a8;
  color: inherit;
  padding: 0 1px;
  border-radius: 2px;
}

#results-summary { margin-bottom: 14px; }

.site-footer {
  border-top: 1px solid var(--c-border);
  background: var(--c-surface);
  padding: 24px 0;
  font-size: 13px;
  color: var(--c-muted);
}
.site-footer p { margin: 4px 0; }

@media (max-width: 600px) {
  .change { grid-template-columns: 1fr; }
  .brand h1 { font-size: 19px; }
}
