:root {
  --bg: #0b0d10;
  --panel: #12161b;
  --panel-2: #181d23;
  --muted: #8ea0b2;
  --text: #e7eef7;
  --accent: #8cc8ff;
  --accent-2: #9effc2;
  --card: #121820;
  --chip: #223043;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --radius: 18px;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: auto;
}
body {
  margin: 0 0 10px 0;
  background: linear-gradient(180deg, var(--bg), #0e1116) fixed;
  color: var(--text);
  font: 16px/1.5 system-ui, Segoe UI, Roboto, Helvetica, Arial,
    Apple Color Emoji, Noto Color Emoji;
  overflow-x: hidden;
  overflow-y: scroll;
}

header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(120%) blur(10px);
  background: rgba(11, 13, 16, 0.7);
  border-bottom: 1px solid #1d2530;
}
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px;
}
.bar {
  display: flex;
  gap: 12px;
  align-items: center;
}
.logo {
  display: flex;
  gap: 10px;
  align-items: center;
}
.logo img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #253140;
}
.logo b {
  font-size: 18px;
}

.search {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1;
}
.search input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #223043;
  background: #0f141b;
  color: var(--text);
}
.pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #223043;
  background: var(--panel-2);
  border-radius: 12px;
  color: var(--muted);
}

button.pill {
  cursor: pointer;
}
.pill select,
.pill input {
  background: transparent;
  color: var(--text);
  border: 0;
  outline: 0;
}

main {
  max-width: 1180px;
  margin: 18px auto;
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 18px;
  padding: 0 16px;
}

aside {
  background: var(--panel);
  border: 1px solid #1c2430;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
aside h3 {
  margin: 4px 0 12px 0;
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.tabs {
  display: grid;
  gap: 8px;
}
.tab-btn {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #223043;
  background: #0f141b;
  color: var(--text);
  cursor: pointer;
}
.tab-btn.active {
  border-color: #2f8fff;
  background: linear-gradient(180deg, #0f141b, #111923);
}

.panel {
  background: var(--panel);
  border: 1px solid #1c2430;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.card {
  background: var(--card);
  border: 1px solid #1f2834;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card .img {
  aspect-ratio: 16/10;
  background: #0f141b;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card .body {
  padding: 12px 14px;
  display: grid;
  gap: 8px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  background: var(--chip);
  border: 1px solid #2a3950;
  color: #a7c2de;
  padding: 6px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  background: #0f141b;
  border: 1px solid #1f2936;
}

.stat.breeds .stat-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 10px;
}

.stat:not(.breeds) div:first-child,
.stat.breeds .stat-block div:first-child {
  font-weight: bold;
  border-bottom: 1px solid #2a3950;
}

.stat.breeds {
  flex-direction: row;
  padding: 0;
  overflow: hidden;
}

.stat .breed-image {
  width: 200px;
  min-width: 200px;
  aspect-ratio: 9 / 15;
  align-items: center;
  display: flex;
  overflow: hidden;
  position: relative;
}

.stat .breed-image img {
  min-width: 100%;
  min-height: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  border-right: 1px solid #2a3848;
}

.stat .breed-image:not([data-model=false])::after {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  content: attr(data-model);
  text-align: center;
  background-color: rgba(0, 0, 0, 0.35);
}

.hidden {
  display: none !important;
}

.detail {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  z-index: 20;
}
.detail.open {
  display: flex;
}
.sheet {
  width: min(900px, 92vw);
  max-height: 88vh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid #1c2430;
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.sheet header {
  position: sticky;
  top: 0;
  background: #0f141b;
  border-bottom: 1px solid #1c2430;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 20px 20px 0 0;
}
.sheet header h2 {
  margin: 0;
  font-size: 20px;
}
.sheet section {
  padding: 16px;
  display: grid;
  gap: 14px;
}
.cols {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
}
.bio-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: #1a2330;
  border: 1px solid #263448;
  color: var(--text);
  border-radius: 999px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow);
  cursor: pointer;
  z-index: 15;
}

/* Dr. Cassandra popover */
.dr-pop {
  position: fixed;
  right: 18px;
  bottom: 80px;
  width: 320px;
  background: var(--panel-2);
  border: 1px solid #243244;
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: none;
  z-index: 25;
}
.dr-pop.open {
  display: grid;
}
.dr-head {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid #233040;
}
.dr-head img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid #2a3848;
}
.dr-body {
  padding: 12px;
  display: grid;
  gap: 10px;
}
.dr-body textarea {
  min-height: 84px;
  width: 100%;
  background: #0f141b;
  color: var(--text);
  border: 1px solid #1f2c3c;
  border-radius: 12px;
  padding: 10px;
}
.dr-msg {
  background: #0f141b;
  border: 1px solid #1f2c3c;
  border-radius: 12px;
  padding: 10px;
}

/* typography niceties */
h1 {
  font-size: 28px;
  margin: 6px 0 12px;
}
p {
  margin: 0;
}
a {
  color: var(--accent);
}
small,
.muted {
  color: var(--muted);
}

@media (max-width: 900px) {
  main {
    grid-template-columns: 1fr;
  }
  .cols {
    grid-template-columns: 1fr;
  }
  .dr-pop {
    right: 8px;
    left: 8px;
    width: auto;
  }
}
