:root {
  --bg: #f7f8fa;
  --card-bg: #ffffff;
  --text: #1a1d23;
  --muted: #5f6570;
  --border: #e3e5e9;
  --accent: #1f3f66;
  --accent-dark: #14304f;
  --brand-green: #8fcaa8;
  --brand-green-dark: #3f8f68;
  --brand-gray: #8b8f96;
  --active: #167c3d;
  --inactive: #b3261e;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 16px 20px 10px;
  text-align: center;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.logo-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
}
.logo-text { color: var(--accent); }
.logo-green { color: var(--brand-green-dark); }
.logo-gray { color: var(--brand-gray); font-weight: 600; }
.logo-tagline {
  margin: 6px 0 0;
  color: var(--brand-gray);
  font-size: 0.85rem;
}

.hero {
  text-align: center;
  padding: 40px 0 28px;
}

.hero h1 {
  font-size: 2rem;
  margin: 0 0 12px;
}

.lead {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0 auto 28px;
  max-width: 560px;
}

.search-form {
  position: relative;
  width: 100%;
}

.search-top { margin: 24px 0; }

.search-box {
  display: flex;
  gap: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.search-form--hero .search-box { padding: 10px; }

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  padding: 12px 14px;
  background: transparent;
  color: var(--text);
}

.search-form--hero .search-box input { font-size: 1.1rem; }

.search-box button {
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  padding: 0 22px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
}
.search-box button:hover { background: var(--accent-dark); }

.suggestions {
  list-style: none;
  margin: 6px 0 0;
  padding: 6px;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  z-index: 20;
  max-height: 340px;
  overflow-y: auto;
}

.suggestions li a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
}
.suggestions li a:hover,
.suggestions li a.active { background: var(--bg); }

.suggestions .s-name { font-weight: 600; }
.suggestions .s-meta { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }

.company-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-top: 8px;
}

.company-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.company-card__header h1 { font-size: 1.5rem; margin: 0; }

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge--active { background: #e5f6ea; color: var(--active); }
.badge--inactive { background: #fbe9e8; color: var(--inactive); }

.company-facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 24px 0 0;
  padding: 0;
}
.company-facts > div {
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.company-facts dt {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 4px;
}
.company-facts dd { margin: 0; font-weight: 500; }

.company-verksamhet { color: var(--text); }
.company-names { color: var(--muted); }

.results h1 { font-size: 1.3rem; }
.result-list { list-style: none; padding: 0; }
.result-list li {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
}
.result-list a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text);
  flex-wrap: wrap;
}
.result-name { font-weight: 600; }
.result-meta { color: var(--muted); font-size: 0.9rem; }

.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  padding: 20px;
}
.site-footer a { color: var(--muted); }

@media (max-width: 640px) {
  .company-facts { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.5rem; }
  .company-card { padding: 18px; }

  /* Startsidans sökruta är huvudsyftet med sidan, så den får stanna
     centrerad på skärmen istället för att flyttas ner som en sticky-rad. */
  .hero {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .logo-tagline { display: none; }

  /* Search box hoppar ner till en sticky rad längst ner på skärmen på
     underliggande sidor, så nästa sökning är ett tumtryck bort. */
  main:has(.search-top) { padding-bottom: 92px; }

  .search-form--compact {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    margin: 0;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.08);
  }

  .search-box input,
  .search-box button {
    font-size: 1rem;
    min-height: 48px;
  }

  .search-form--compact .suggestions {
    top: auto;
    bottom: 100%;
    margin: 0 0 8px;
  }
}
