:root {
  color-scheme: light;
  --ink: #17201e;
  --muted: #66716e;
  --line: #d9e0dc;
  --surface: #ffffff;
  --soft: #edf3ef;
  --accent: #247361;
  --accent-dark: #174e42;
  --warm: #d49358;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: #f4f6f3;
}

button, input { font: inherit; }

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 86px;
  padding: 16px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
}

h1, h2, p { margin: 0; }
h1 { font-size: clamp(24px, 3vw, 34px); line-height: 1.05; }
h2 { font-size: 24px; }

.eyebrow {
  margin-bottom: 5px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.lab-link {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 14px;
  color: var(--ink);
  background: var(--surface);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px clamp(18px, 4vw, 56px) 56px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.summary div {
  display: grid;
  gap: 2px;
  padding: 18px 22px;
  border-right: 1px solid var(--line);
}

.summary div:last-child { border-right: 0; }
.summary strong { font-size: 25px; }
.summary span { color: var(--muted); font-size: 12px; font-weight: 700; }

.library-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 0 18px;
}

.tabs {
  display: inline-grid;
  grid-template-columns: repeat(3, auto);
  gap: 4px;
  border-radius: 7px;
  padding: 4px;
  background: #e4eae6;
}

.tab {
  min-width: 104px;
  min-height: 40px;
  border: 0;
  border-radius: 5px;
  padding: 8px 13px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 780;
}

.tab span { margin-left: 4px; font-size: 11px; }
.tab.active { color: white; background: var(--accent); }

.search-field {
  display: grid;
  gap: 5px;
  width: min(310px, 100%);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.search-field input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  outline: none;
  background: var(--surface);
}

.search-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(36, 115, 97, 0.12); }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 0 16px;
}

.section-heading > p {
  max-width: 480px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: right;
}

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

.breed-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.breed-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #e6ebe7;
}

.breed-info { padding: 13px 14px 14px; }
.breed-rank { color: var(--accent); font-size: 11px; font-weight: 850; text-transform: uppercase; }
.breed-info h3 { min-height: 44px; margin: 5px 0 8px; font-size: 16px; line-height: 1.25; }

.breed-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.breed-meta a { color: var(--accent-dark); font-weight: 780; }

.action-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.action-row {
  display: grid;
  grid-template-columns: 58px minmax(150px, 0.8fr) 110px 110px minmax(260px, 2fr);
  align-items: center;
  min-height: 72px;
  border-bottom: 1px solid var(--line);
}

.action-row:last-child { border-bottom: 0; }
.action-row > * { padding: 12px 16px; }
.action-number { color: var(--accent); font-size: 13px; font-weight: 850; }
.action-name { font-weight: 820; }
.action-kind, .action-duration { color: var(--muted); font-size: 12px; font-weight: 700; }
.action-note { color: #46514e; font-size: 13px; line-height: 1.45; }
.hidden { display: none; }

footer {
  border-top: 1px solid var(--line);
  padding: 20px clamp(18px, 4vw, 56px) 34px;
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 980px) {
  .breed-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .action-row { grid-template-columns: 46px 1fr 90px 90px; }
  .action-note { grid-column: 2 / -1; padding-top: 0; }
}

@media (max-width: 700px) {
  .topbar { position: static; align-items: flex-start; gap: 12px; }
  .topbar h1 { max-width: 12ch; }
  main { padding-top: 16px; }
  .summary { grid-template-columns: repeat(2, 1fr); }
  .summary div:nth-child(2) { border-right: 0; }
  .summary div:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .library-toolbar, .section-heading { align-items: stretch; flex-direction: column; }
  .tabs { width: 100%; grid-template-columns: repeat(3, 1fr); }
  .tab { min-width: 0; }
  .search-field { width: 100%; }
  .section-heading > p { text-align: left; }
  .breed-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 430px) {
  .topbar { padding: 14px 16px; }
  .lab-link { padding-inline: 10px; }
  .breed-grid { grid-template-columns: 1fr; }
  .action-row { grid-template-columns: 38px 1fr; }
  .action-kind, .action-duration { padding-top: 0; }
  .action-kind { grid-column: 2; }
  .action-duration { grid-column: 2; }
  .action-note { grid-column: 2; }
}
