:root {
  --ink: #172023;
  --muted: #657174;
  --line: #d9e0df;
  --bg: #f5f7f7;
  --panel: #ffffff;
  --soft: #eef3f1;
  --accent: #a7372d;
  --accent-dark: #74251f;
  --green: #1f6b4b;
  --amber: #9a5a16;
  --shadow: 0 22px 70px rgba(23, 32, 35, 0.12);
}

* {
  box-sizing: border-box;
}

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

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.top {
  display: flex;
  gap: 24px;
  align-items: end;
  justify-content: space-between;
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 22px;
}

.top h1 {
  margin: 0 0 8px;
  font-size: 36px;
  line-height: 1.1;
  letter-spacing: 0;
}

.top p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.lang {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.lang button,
.segments button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.lang button {
  min-width: 58px;
}

.lang button.active,
.segments button.active {
  color: #fff;
  background: var(--ink);
}

main {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto 48px;
}

.controls {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto 150px 150px;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  background: rgba(245, 247, 247, 0.92);
  backdrop-filter: blur(12px);
}

.search {
  position: relative;
}

.search input,
.controls select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel);
}

.search input {
  padding: 0 112px 0 14px;
}

.search span {
  position: absolute;
  top: 50%;
  right: 12px;
  color: var(--muted);
  font-size: 13px;
  transform: translateY(-50%);
}

.controls select {
  padding: 0 12px;
}

.select-field {
  display: grid;
  gap: 4px;
}

.select-field > span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}

.segments {
  display: inline-flex;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.segments button {
  padding: 0 12px;
  white-space: nowrap;
}

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 138px);
  overflow: auto;
  padding-right: 4px;
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  width: 100%;
  min-height: 84px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-align: left;
  background: var(--panel);
  cursor: pointer;
}

.row:hover,
.row.selected {
  border-color: rgba(167, 55, 45, 0.55);
  box-shadow: 0 12px 34px rgba(23, 32, 35, 0.08);
}

.row-main,
.row-side {
  display: grid;
  gap: 4px;
}

.row strong {
  font-size: 15px;
}

.row small,
.row-side {
  color: var(--muted);
  font-size: 13px;
}

.row-side {
  justify-items: end;
  min-width: 96px;
}

.row-side span {
  color: var(--accent-dark);
  font-weight: 750;
}

.empty {
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel);
}

.detail {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.photo {
  min-height: 230px;
  background:
    linear-gradient(90deg, rgba(15, 22, 24, 0.52), rgba(15, 22, 24, 0.08)),
    center / cover no-repeat;
}

.detail-main {
  padding: 24px;
}

.kicker {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 4px;
  color: #fff;
  background: var(--accent);
  font-size: 13px;
  font-weight: 750;
}

.detail h2 {
  margin: 14px 0 8px;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: 0;
}

.meta {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.decision-panel {
  display: grid;
  gap: 12px;
  margin: 20px 0 22px;
  padding: 14px;
  border: 1px solid rgba(31, 107, 75, 0.24);
  border-radius: 8px;
  background: #f3faf6;
}

.decision-panel h3 {
  margin: 0;
  font-size: 15px;
}

.decision-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.decision-grid div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.decision-grid div:first-child {
  grid-column: span 2;
}

.decision-grid span {
  color: var(--muted);
  font-size: 12px;
}

.decision-grid strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.decision-panel p {
  margin: 0;
  color: var(--amber);
  font-size: 13px;
}

.family-checks {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(31, 107, 75, 0.18);
}

.family-checks > strong {
  font-size: 13px;
}

.family-checks > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.family-checks span {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}

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

.action-block h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.actions a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--soft);
  font-weight: 700;
}

.actions a.primary {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.section {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.section + .section {
  margin-top: 18px;
}

.section h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.clean-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.clean-list li {
  position: relative;
  padding-left: 18px;
}

.clean-list li::before {
  position: absolute;
  top: 0.62em;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--green);
  content: "";
}

.review-summary {
  display: grid;
  gap: 14px;
}

.verdict {
  margin: 0;
  padding: 12px 14px;
  border-left: 4px solid var(--accent);
  color: var(--ink);
  background: #fff7f4;
  font-weight: 720;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.review-card {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.review-card h4 {
  margin: 0;
  font-size: 14px;
}

.review-point {
  display: grid;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(28, 41, 34, 0.1);
}

.review-point:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.review-point strong {
  font-size: 14px;
}

.review-point p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

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

.source-pills a {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: #fff;
  font-size: 12px;
  font-weight: 750;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--soft);
  font-size: 13px;
  font-weight: 700;
}

.note {
  color: var(--amber);
}

.note p {
  margin: 0;
}

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

.source-head span {
  color: var(--muted);
  font-size: 13px;
}

.sources {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.source-card {
  display: grid;
  gap: 4px;
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.source-card strong {
  font-size: 14px;
}

.source-card span {
  color: var(--muted);
  font-size: 13px;
}

.empty-detail .detail-main {
  display: grid;
  gap: 12px;
}

.empty-detail p {
  margin: 0;
  color: var(--muted);
}

.empty-detail button {
  justify-self: start;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font-weight: 750;
  cursor: pointer;
}

@media (max-width: 980px) {
  .top,
  .controls,
  .layout {
    grid-template-columns: 1fr;
  }

  .top {
    align-items: start;
  }

  .controls {
    position: static;
  }

  .segments {
    overflow-x: auto;
  }

  .list {
    max-height: none;
    padding-right: 0;
    order: 2;
  }

  .detail {
    order: 1;
  }

  .sources {
    grid-template-columns: 1fr;
  }

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

  .review-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .top,
  main {
    width: min(100% - 24px, 1240px);
  }

  .top h1,
  .detail h2 {
    font-size: 28px;
  }

  .row {
    grid-template-columns: 1fr;
  }

  .row-side {
    justify-items: start;
  }

  .search input {
    padding-right: 14px;
  }

  .search span {
    position: static;
    display: block;
    margin-top: 6px;
    transform: none;
  }

  .detail-main {
    padding: 18px;
  }

  .decision-grid {
    grid-template-columns: 1fr;
  }

  .decision-grid div:first-child {
    grid-column: auto;
  }
}
