:root {
  --primary: #0e6fa5;
  --bright: #1a9bd8;
  --dark: #094e75;
  --darker: #063a5c;
  --bg: #f0f4f8;
  --white: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-s: #334155;
  --text-m: #64748b;
  --font: "Source Sans 3", "Segoe UI", sans-serif;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

a {
  color: inherit;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.logo-link {
  display: flex;
  align-items: center;
}

.logo-img {
  height: 46px;
  width: auto;
  object-fit: contain;
  display: block;
}

.btn-switch {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 2px solid var(--border);
  color: var(--dark);
}

.btn-switch:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.hero {
  background: linear-gradient(135deg, var(--darker), var(--primary), var(--bright));
  padding: 36px 20px 42px;
  text-align: center;
}

.hero-inner {
  max-width: 720px;
  margin: 0 auto;
}

.hero h1 {
  margin: 0;
  color: white;
  font-size: clamp(24px, 4vw, 28px);
  font-weight: 900;
  line-height: 1.25;
}

.hero p {
  color: #bae6fd;
  font-size: 15px;
  font-weight: 500;
  margin: 12px auto 0;
  max-width: 580px;
  line-height: 1.6;
}

.search-wrap {
  max-width: 480px;
  margin: 24px auto 0;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
  pointer-events: none;
}

#search-input {
  width: 100%;
  padding: 14px 16px 14px 44px;
  border-radius: 12px;
  border: none;
  font-size: 15px;
  outline: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  font-family: inherit;
}

.main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 20px 40px;
}

.loading,
.empty {
  text-align: center;
  color: var(--text-m);
  font-weight: 600;
  padding: 40px 16px;
}

.cats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.cat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
}

.cat-top {
  padding: 16px 16px 12px;
  color: white;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.cat-emoji {
  font-size: 28px;
  line-height: 1;
}

.cat-top h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.3;
}

.cat-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.cat-body > p {
  margin: 0;
  color: var(--text-m);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  flex: 1;
}

.cat-meta {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-s);
}

.btn-docs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  background: #eff6ff;
  color: var(--primary);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}

.btn-docs:hover {
  background: #dbeafe;
}

.note {
  margin-top: 28px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  color: var(--text-s);
  font-size: 14px;
  line-height: 1.55;
  font-weight: 500;
}

.docs-view {
  background: var(--white);
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.docs-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.docs-head h2 {
  margin: 0;
  flex: 1;
  font-size: 20px;
  font-weight: 900;
  color: var(--dark);
}

.btn-back {
  border: 2px solid var(--border);
  background: white;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-s);
}

.btn-back:hover {
  border-color: var(--primary);
  color: var(--primary);
}

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

.doc-list li {
  border-bottom: 1px solid var(--border);
}

.doc-list li:last-child {
  border-bottom: none;
}

.doc-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  text-decoration: none;
  color: inherit;
}

.doc-list a:hover {
  background: #f8fafc;
}

.doc-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #eff6ff;
  font-size: 18px;
  flex-shrink: 0;
}

.doc-info strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
}

.doc-info span {
  font-size: 13px;
  color: var(--text-m);
  font-weight: 600;
}

.search-hits {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-hit {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
}

.search-hit:hover {
  border-color: var(--primary);
}

.search-hit strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
}

.search-hit span {
  font-size: 13px;
  color: var(--text-m);
  font-weight: 600;
}

.footer {
  background: var(--darker);
  margin-top: 24px;
  padding: 36px 24px 0;
  color: #bae6fd;
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  padding-bottom: 24px;
}

.footer-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
  margin-bottom: 12px;
  background: white;
  border-radius: 6px;
  padding: 4px 8px;
}

.footer h4 {
  margin: 0 0 10px;
  color: white;
  font-size: 15px;
  font-weight: 800;
}

.footer p,
.footer a {
  margin: 0 0 7px;
  color: #bae6fd;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  line-height: 1.7;
}

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

.footer-bar {
  border-top: 1px solid rgba(186, 230, 253, 0.2);
  text-align: center;
  padding: 14px 8px 18px;
}

.footer-bar p {
  margin: 0;
  font-weight: 600;
}

@media (max-width: 720px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}
