:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --panel: #ffffff;
  --panel-2: #f0f3f6;
  --text: #18212f;
  --muted: #657287;
  --line: #dbe1e8;
  --accent: #157f72;
  --accent-2: #d0693b;
  --danger: #b42318;
  --warn: #986f0b;
  --quiet: #596579;
  --shadow: 0 12px 30px rgba(24, 33, 47, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(21, 127, 114, 0.08), transparent 290px),
    var(--bg);
  color: var(--text);
}

a {
  color: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(16px);
  padding: 24px 18px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: #153b45;
  color: #fff;
}

.brand-mark svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

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

.brand h1 {
  font-size: 18px;
  line-height: 1.2;
}

.brand p,
.eyebrow,
.group,
.search span,
.filter-block h2,
.sort-control span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.search {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}

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

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(21, 127, 114, 0.2);
  outline-offset: 2px;
}

.filter-block {
  margin: 22px 0;
}

.filter-block h2 {
  margin-bottom: 10px;
}

.filter-list {
  display: grid;
  gap: 8px;
}

.filter-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  padding: 8px 10px;
}

.filter-button[aria-pressed="true"] {
  border-color: rgba(21, 127, 114, 0.6);
  background: rgba(21, 127, 114, 0.1);
}

.filter-button .count {
  display: inline-flex;
  min-width: 28px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

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

.topbar h2 {
  margin-top: 5px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.02;
  letter-spacing: 0;
}

.source-link {
  flex: 0 0 auto;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 0 12px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric {
  min-height: 94px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
  box-shadow: var(--shadow);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 32px;
  line-height: 1;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0;
}

.result-count {
  color: var(--muted);
  font-weight: 700;
}

.sort-control {
  display: flex;
  min-width: 260px;
  align-items: center;
  gap: 10px;
}

.sort-control select {
  min-width: 160px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 14px;
}

.project-card {
  display: grid;
  gap: 12px;
  min-height: 330px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
  box-shadow: var(--shadow);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.project-card h3 {
  font-size: 20px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.status-active {
  background: rgba(21, 127, 114, 0.12);
  color: #0f6b60;
}

.status-problem {
  background: rgba(180, 35, 24, 0.1);
  color: var(--danger);
}

.status-unused {
  background: rgba(89, 101, 121, 0.12);
  color: var(--quiet);
}

.status-unknown {
  background: rgba(152, 111, 11, 0.12);
  color: var(--warn);
}

.type-icons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  min-width: 72px;
}

.type-icon {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}

.type-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.summary {
  font-size: 15px;
  font-weight: 750;
  line-height: 1.4;
}

.details {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.meta {
  display: grid;
  gap: 8px;
  margin: 0;
}

.meta div {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

dd {
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.services {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-self: end;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(21, 127, 114, 0.42);
  color: #0f6b60;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.65);
  padding: 32px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

@media (max-width: 960px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .filter-list {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .content {
    padding: 18px;
  }

  .topbar,
  .toolbar {
    display: grid;
  }

  .source-link,
  .sort-control {
    width: 100%;
  }

  .metrics,
  .project-grid {
    grid-template-columns: 1fr;
  }
}
