/* DESIGN (Rennmausakte.html): gerbil detail page — hero photo + card sections.
   Navigation is handled by the app shell (sidebar/bottom bar), so the design's own
   sidebar/drawer is intentionally dropped. Palette uses the app's design tokens. */

.ak {
  --ak-panel: #efe6d4;
  --ak-tan: #ece0c8;
  --ak-warn: #c2702a;
  --ak-danger: #a6433a;
  --ak-kv-pad: 14px;
  /* Cancel app-main's horizontal padding so the hero spans full width. app-main has
     no top padding (see index.css), so the hero already sits flush at the top. */
  margin: 0 -1rem;
}
@media (min-width: 768px) {
  .ak {
    margin: 0 -2rem;
  }
}

/* ---------- Hero ---------- */
.ak-hero {
  position: relative;
}
.ak-herophoto {
  width: 100%;
  height: 250px;
  display: block;
  object-fit: cover;
  background: var(--ak-panel);
}
.ak-herophoto--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-faint);
  font-size: 2.5rem;
}
.ak-herobar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: flex-start;
  padding: 14px 16px;
}
.ak-back {
  color: #fff;
  background: rgba(20, 12, 6, 0.42);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  border: none;
  text-decoration: none;
}
.ak-heroover {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 40px 18px 16px;
  background: linear-gradient(to top, rgba(20, 12, 6, 0.82), rgba(20, 12, 6, 0.1) 72%, transparent);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ak-name {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}
.ak-statusbadge {
  font-size: 13px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  white-space: nowrap;
}
.ak-badge-extern {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #6b5d4b;
  border: 1px dashed rgba(107, 93, 75, 0.5);
}

.ak-content {
  max-width: 940px;
  margin: 0 auto;
  padding: 16px 16px 40px;
}
@media (min-width: 768px) {
  .ak-herophoto {
    height: 320px;
  }
  .ak-heroover {
    padding: 56px 36px 22px;
  }
  .ak-name {
    font-size: 40px;
  }
  .ak-content {
    padding: 24px 36px 40px;
  }
  /* On desktop the app sidebar provides navigation; the hero back arrow is redundant
     (the action row has "Zurück zur Liste"). */
  .ak-herobar {
    display: none;
  }
}

/* ---------- Quick facts ---------- */
.ak-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ak-fact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 8px 13px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}
/* Geschwisterverpaarung: hervorgehoben, da zuchtrelevant (Inzucht). */
.ak-fact--sibling {
  background: color-mix(in srgb, var(--color-accent) 12%, var(--color-surface));
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ---------- Actions ---------- */
.ak-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 4px;
}
.ak-btn {
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  padding: 11px 18px;
  border-radius: 14px;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(61, 46, 35, 0.05);
  transition: transform 0.1s, filter 0.15s, background 0.15s;
}
.ak-btn:active {
  transform: scale(0.97);
}
.ak-btn:hover {
  background: var(--color-accent-soft);
}
.ak-btn.primary {
  background: var(--color-accent);
  color: #fff;
  border-color: transparent;
}
.ak-btn.primary:hover {
  filter: brightness(1.06);
  background: var(--color-accent);
}
.ak-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ---------- Cards ---------- */
.ak-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  padding: 18px;
  margin-top: 14px;
  box-shadow: 0 1px 3px rgba(61, 46, 35, 0.06);
}
.ak-h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  color: var(--color-text);
}

/* Collapsible card header (e.g. Charakter) — full-width toggle button. */
.ak-card-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
}
.ak-card-toggle .ak-h2 {
  margin: 0;
}
.ak-card-chev {
  font-size: 14px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

/* ---------- Key/Value list (semantic dl/dt/dd, styled as a grid) ---------- */
.ak-kvlist {
  display: flex;
  flex-direction: column;
  margin: 0;
}
.ak-kvlist dt,
.ak-kvlist dd {
  margin: 0;
}
.ak-kv {
  display: grid;
  grid-template-columns: minmax(96px, 32%) 1fr;
  gap: 14px;
  align-items: center;
  padding: var(--ak-kv-pad) 2px;
  border-bottom: 1px solid var(--color-border);
}
.ak-kv:last-child {
  border-bottom: none;
}
.ak-kv-label {
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: 15px;
}
.ak-kv-value {
  color: var(--color-text);
  font-weight: 600;
  font-size: 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.ak-kv-value a {
  color: var(--color-accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ak-genotype {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  background: var(--ak-tan);
  color: var(--color-text);
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 15px;
  letter-spacing: 0.02em;
}
.ak-mismatch {
  color: var(--ak-warn);
  font-weight: 600;
}
/* GEN-5: parent-inferred genotype hint (Ee[-] → Ee aus den Eltern ergänzt). */
.ak-inferred {
  white-space: nowrap;
}
.ak-inferred-chip {
  display: inline-block;
  background: var(--ak-tan);
  color: var(--color-text);
  border-radius: 999px;
  padding: 1px 9px;
  font-weight: 600;
  font-size: 12px;
  vertical-align: middle;
}

/* ---------- Character chips ---------- */
.ak-cgroup {
  margin-bottom: 16px;
}
.ak-cgroup:last-of-type {
  margin-bottom: 0;
}
.ak-glabel {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 10px;
}
.ak-gcount {
  background: var(--color-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
}
.ak-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.ak-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
  transition: background 0.14s, border-color 0.14s, color 0.14s, transform 0.14s
    cubic-bezier(0.22, 1, 0.36, 1);
}
.ak-chip:active {
  transform: scale(0.95);
}
.ak-chip.on {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}
.ak-chip.warn {
  border-color: color-mix(in srgb, var(--ak-warn) 45%, var(--color-border));
  color: var(--ak-warn);
}
.ak-chip.warn.on {
  background: var(--ak-warn);
  border-color: var(--ak-warn);
  color: #fff;
}
.ak-notes {
  width: 100%;
  min-height: 78px;
  resize: vertical;
  font: inherit;
  font-size: 15px;
  color: var(--color-text);
  margin-top: 14px;
  background: #fbf7ef;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
}
.ak-notes:focus {
  border-color: var(--color-accent);
}
.ak-empty {
  color: var(--color-text-muted);
  font-size: 16px;
  margin: 2px 0 0;
}

/* ---------- Tabs ---------- */
.ak-tabs {
  display: flex;
  gap: 26px;
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
  scrollbar-width: none;
}
.ak-tabs::-webkit-scrollbar {
  display: none;
}
.ak-tab {
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  padding: 6px 2px 12px;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.ak-tab.active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}
.ak-tabpanel {
  padding-top: 18px;
}

/* Character save row */
.ak-saverow {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 14px;
}
