:root {
  color-scheme: light;
  --ink: #182126;
  --muted: #5d6971;
  --line: #d8e0e4;
  --soft: #f5f7f2;
  --panel: #ffffff;
  --teal: #117a73;
  --red: #b83d32;
  --gold: #c88a13;
  --green: #4f7f28;
  --blue: #2367a5;
  --shadow: 0 18px 50px rgba(24, 33, 38, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: #eef3f0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 312px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  background: #ffffff;
  border-right: 1px solid var(--line);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  margin-bottom: 32px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  margin-top: 2px;
}

.sidebar-section {
  margin-top: 24px;
}

label,
.nav-label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr 52px;
  gap: 8px;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 42px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(17, 122, 115, 0.25);
  outline-offset: 2px;
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.suggestions {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.suggestions button {
  text-align: left;
  padding: 10px;
  background: #edf7f5;
  color: var(--ink);
  border: 1px solid #c7e3df;
}

.suggestions strong,
.suggestions span {
  display: block;
}

.suggestions span {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 3px;
}

.language-nav {
  display: grid;
  gap: 6px;
}

.language-nav a {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 0 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
}

.language-nav a:hover,
.language-nav a.active {
  background: #edf7f5;
}

.language-nav small {
  color: var(--muted);
  font-weight: 800;
}

.source-note {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.main {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 0.78rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  font-size: 1.35rem;
}

.docs-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-decoration: none;
  font-weight: 800;
}

.tool-band {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 16px;
  align-items: end;
  padding: 16px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.filters {
  display: flex;
  align-items: end;
  gap: 10px;
}

.filters label {
  min-width: 150px;
}

.check-filter {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-transform: none;
  background: #fff;
}

.check-filter input {
  width: auto;
  min-height: auto;
}

.language-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
  gap: 18px;
  align-items: stretch;
  padding: 26px;
  margin-bottom: 22px;
  min-height: 190px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(24, 33, 38, 0.9), rgba(17, 122, 115, 0.84)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='400' viewBox='0 0 1200 400'%3E%3Crect width='1200' height='400' fill='%232367a5'/%3E%3Cpath d='M0 300 C 250 220 330 360 560 280 S 900 180 1200 260 L1200 400 L0 400 Z' fill='%23c88a13' opacity='.75'/%3E%3Cpath d='M0 170 C 180 120 300 190 480 145 S 780 70 1200 130' stroke='%23ffffff' stroke-width='24' opacity='.2' fill='none'/%3E%3C/svg%3E");
  background-size: cover;
  border-radius: 8px;
  overflow: hidden;
}

.language-hero h2 {
  font-size: clamp(2.2rem, 5vw, 5.4rem);
  line-height: 0.95;
  letter-spacing: 0;
  margin-bottom: 14px;
}

.language-hero p {
  max-width: 760px;
  line-height: 1.55;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.86);
}

.language-hero .eyebrow {
  color: #ffd783;
}

.hero-stats {
  display: grid;
  gap: 10px;
  align-content: end;
}

.hero-stats span {
  display: block;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.hero-stats strong {
  display: block;
  font-size: 1.25rem;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 22px;
  align-items: start;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.section-heading h2,
.detail-panel h2 {
  margin-bottom: 0;
}

#resultCount {
  color: var(--muted);
  font-weight: 800;
}

.resource-list {
  display: grid;
  gap: 12px;
}

.resource-item {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.resource-item:hover,
.resource-item:focus-visible {
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  outline: none;
}

.resource-item:active {
  transform: translateY(1px);
}

.media-token {
  min-height: 88px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  text-transform: uppercase;
  font-size: 0.76rem;
}

.resource-thumb {
  width: 88px;
  min-height: 88px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  background: var(--soft);
}

.media-token.video {
  background: var(--red);
}

.media-token.audio {
  background: var(--blue);
}

.media-token.app {
  background: var(--teal);
}

.media-token.text {
  background: var(--green);
}

.resource-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.resource-title-row h3 {
  margin-bottom: 6px;
}

.resource-title-row span {
  align-self: flex-start;
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 8px;
  background: #fff3d7;
  color: #684305;
  font-size: 0.78rem;
  font-weight: 900;
}

.resource-body p {
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 12px;
}

.meta-row,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 10px;
}

.meta-row span,
.tag-row span {
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.resource-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-weight: 900;
  text-decoration: none;
}

.resource-open:hover {
  background: #0f766e;
}

.detail-panel {
  position: sticky;
  top: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.detail-panel > h2 {
  margin-bottom: 14px;
}

.language-facts {
  display: grid;
  grid-template-columns: 98px minmax(0, 1fr);
  gap: 10px 12px;
  margin: 0;
}

.language-facts dt {
  color: var(--muted);
  font-weight: 800;
}

.language-facts dd {
  margin: 0;
}

.source-list {
  display: grid;
  gap: 10px;
}

.source-list div {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.source-list strong,
.source-list span {
  display: block;
}

.source-list span {
  color: var(--muted);
  margin-top: 2px;
}

.empty,
.empty-state {
  color: var(--muted);
}

.empty-state {
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.catalog-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.catalog-metrics div {
  min-height: 96px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.catalog-metrics strong,
.catalog-metrics span {
  display: block;
}

.catalog-metrics strong {
  font-size: 2rem;
  line-height: 1;
}

.catalog-metrics span {
  margin-top: 8px;
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 980px) {
  .app-shell,
  .content-grid,
  .language-hero,
  .tool-band,
  .catalog-metrics {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .detail-panel {
    position: static;
    height: auto;
  }

  .main {
    padding: 20px;
  }
}

@media (max-width: 680px) {
  .filters,
  .topbar,
  .resource-title-row {
    flex-direction: column;
    align-items: stretch;
  }

  .filters label {
    min-width: 0;
  }

  .resource-item {
    grid-template-columns: 1fr;
  }

  .media-token {
    min-height: 48px;
  }

  .resource-thumb {
    width: 100%;
    min-height: 140px;
    aspect-ratio: 16 / 9;
  }
}
