:root {
  color-scheme: light;
  --page: #e9eef3;
  --surface: #ffffff;
  --surface-blue: #edf6ff;
  --ink: #14202b;
  --muted: #667585;
  --quiet: #8c99a6;
  --line: #dfe9f2;
  --line-strong: #c9d8e6;
  --accent: #086dcf;
  --accent-strong: #0055a6;
  --accent-soft: #e7f3ff;
  --success: #21835b;
  --warning: #a86716;
  --danger: #c13e43;
  --radius: 8px;
  --topbar: 66px;
  --sidebar: 216px;
  --tap: 44px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--page);
}

body {
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--page);
  letter-spacing: 0;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

button,
input,
select,
textarea { color: inherit; font: inherit; letter-spacing: 0; }

button,
a { -webkit-tap-highlight-color: transparent; }

button { cursor: pointer; }

button:active:not(:disabled) { transform: translateY(1px) scale(0.985); }
button:disabled { cursor: not-allowed; opacity: 0.42; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(8, 109, 207, 0.24);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

.glass {
  border: 1px solid rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 12px 36px rgba(24, 81, 125, 0.08);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  backdrop-filter: blur(24px) saturate(150%);
}

.system-shell { min-height: 100dvh; }

.topbar {
  position: fixed;
  z-index: 30;
  top: 0;
  right: 0;
  left: 0;
  height: calc(var(--topbar) + env(safe-area-inset-top));
  display: grid;
  grid-template-columns: var(--sidebar) minmax(180px, 1fr) auto;
  align-items: end;
  padding: env(safe-area-inset-top) 18px 0;
  border-width: 0 0 1px;
  border-color: rgba(208, 225, 239, 0.8);
  box-shadow: 0 5px 24px rgba(24, 81, 125, 0.06);
}

.brand-button,
.loft-switcher,
.assistant-trigger,
.avatar-button {
  border: 0;
  background: transparent;
}

.brand-button {
  height: var(--topbar);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  text-align: left;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  border-radius: var(--radius);
  background: var(--accent);
  box-shadow: 0 8px 20px rgba(8, 109, 207, 0.2);
}

.brand-mark svg { width: 20px; height: 20px; stroke-width: 1.8; }

.brand-copy { min-width: 0; display: grid; gap: 2px; }
.brand-copy strong { font-size: 15px; }
.brand-copy small { color: var(--muted); font-size: 10px; }

.loft-switcher {
  height: var(--topbar);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
}

.loft-switcher > span { display: grid; justify-items: center; gap: 2px; }
.loft-switcher small { color: var(--muted); font-size: 9px; }
.loft-switcher strong { font-size: 13px; }
.loft-switcher svg { width: 15px; height: 15px; color: var(--quiet); }

.top-actions {
  height: var(--topbar);
  display: flex;
  align-items: center;
  gap: 7px;
}

.icon-button {
  width: var(--tap);
  height: var(--tap);
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  transition: transform 140ms ease, border-color 160ms ease, background-color 160ms ease;
}

.icon-button:hover { border-color: var(--line-strong); background: #fff; }
.icon-button svg { width: 19px; height: 19px; stroke-width: 1.8; }
.icon-button.small { width: 38px; height: 38px; }
.icon-button.small svg { width: 17px; height: 17px; }

.has-badge { position: relative; }
.has-badge > span {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  border: 1px solid #fff;
  border-radius: 50%;
  background: var(--danger);
}

.assistant-trigger {
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  color: #fff;
  border-radius: var(--radius);
  background: var(--accent);
  font-size: 12px;
  font-weight: 680;
  box-shadow: 0 7px 17px rgba(8, 109, 207, 0.18);
}

.assistant-trigger svg { width: 17px; height: 17px; }

.agent-voice-trigger {
  position: relative;
  overflow: visible;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.assistant-trigger.agent-voice-trigger::after {
  position: absolute;
  right: 8px;
  bottom: 4px;
  left: 8px;
  height: 2px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.88);
  content: "";
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left;
}

.assistant-trigger.agent-voice-trigger.is-holding::after {
  opacity: 1;
  animation: hold-progress 560ms linear forwards;
}

.assistant-trigger.agent-voice-trigger.is-recording {
  background: #b43f45;
  box-shadow: 0 7px 20px rgba(180, 63, 69, 0.22);
}

.avatar-button {
  width: var(--tap);
  height: var(--tap);
  color: var(--accent-strong);
  border: 1px solid #cce2f6;
  border-radius: 50%;
  background: var(--accent-soft);
  font-size: 13px;
  font-weight: 760;
}

.side-nav {
  position: fixed;
  z-index: 20;
  top: calc(var(--topbar) + env(safe-area-inset-top));
  bottom: 0;
  left: 0;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 18px 12px 16px;
  border-width: 0 1px 0 0;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: none;
}

.side-nav nav { display: grid; gap: 4px; }
.nav-footer { margin-top: auto; display: grid; gap: 8px; }

.nav-item {
  width: 100%;
  min-height: 47px;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 0 11px;
  color: #526170;
  text-align: left;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  font-size: 13px;
  font-weight: 620;
}

.nav-item:hover { color: var(--ink); background: #f1f7fd; }
.nav-item.is-active { color: var(--accent-strong); background: var(--accent-soft); }
.nav-item svg { width: 20px; height: 20px; stroke-width: 1.7; }
.nav-item b { min-width: 20px; color: var(--quiet); font-size: 10px; text-align: center; }

.status-line {
  min-height: var(--tap);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  color: var(--muted);
  border: 0;
  background: transparent;
  font-size: 10px;
}

.status-line > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

#app-main, #main-content {
  min-height: 100dvh;
  min-width: 0;
  margin-left: var(--sidebar);
  padding: calc(var(--topbar) + env(safe-area-inset-top) + 30px) clamp(26px, 4vw, 58px) 48px;
  overflow-x: hidden;
}

.page { width: min(1280px, 100%); margin: 0 auto; animation: page-enter 250ms cubic-bezier(0.22, 0.78, 0.2, 1) both; }

.page-header {
  min-height: 58px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.page-header h1 { margin: 0; font-size: clamp(27px, 3vw, 38px); line-height: 1.14; }
.page-header p { max-width: 620px; margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.page-actions { display: flex; align-items: center; gap: 8px; }

.primary-button,
.secondary-button,
.text-button {
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 680;
  white-space: nowrap;
}

.primary-button { color: #fff; border: 1px solid var(--accent); background: var(--accent); box-shadow: 0 8px 18px rgba(8, 109, 207, 0.16); }
.primary-button:hover { background: var(--accent-strong); }
.secondary-button { color: var(--ink); border: 1px solid var(--line-strong); background: #fff; }
.text-button { color: var(--accent-strong); border: 0; background: transparent; }
.primary-button svg, .secondary-button svg, .text-button svg { width: 17px; height: 17px; }

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
}

.section-heading h2 { margin: 0; font-size: 18px; }
.section-heading small { color: var(--muted); font-size: 11px; }

.today-band {
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(420px, 1.18fr);
  overflow: hidden;
  border: 1px solid #d7e6f3;
  border-radius: var(--radius);
  background: #fff;
}

.spotlight {
  min-height: 318px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: #fff;
}

.spotlight img { min-width: 0; max-width: 100%; width: 100%; height: 238px; display: block; object-fit: cover; object-position: center 42%; }

.spotlight-copy {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  color: var(--ink);
  background: #fff;
}

.spotlight-copy small, .spotlight-copy strong, .spotlight-copy span { display: block; }
.spotlight-copy > span { min-width: 0; }
.spotlight-copy small { margin-bottom: 4px; color: var(--muted); font-size: 9px; }
.spotlight-copy strong { overflow: hidden; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
.spotlight-copy span { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.spotlight-copy button { flex: 0 0 auto; }

.today-agenda { min-width: 0; display: flex; flex-direction: column; padding: 22px 24px; }
.today-agenda > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.today-agenda h2 { margin: 0; font-size: 21px; }
.today-agenda > header span { color: var(--accent-strong); font-size: 11px; font-weight: 700; }

.agenda-list { margin-top: 16px; border-top: 1px solid var(--line); }
.agenda-row {
  width: 100%;
  min-height: 67px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 8px 0;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.agenda-icon { width: 34px; height: 34px; display: grid; place-items: center; color: var(--accent-strong); border-radius: 7px; background: var(--accent-soft); }
.agenda-icon svg { width: 17px; height: 17px; }
.agenda-row strong, .agenda-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-row strong { font-size: 12px; }
.agenda-row small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.agenda-row > span:last-child { color: var(--muted); font-size: 10px; }

.metrics-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 18px 0 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.metric { min-width: 0; padding: 18px 22px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric small, .metric strong, .metric span { display: block; }
.metric small { color: var(--muted); font-size: 10px; }
.metric strong { margin: 5px 0 4px; font-size: 25px; }
.metric span { overflow: hidden; color: var(--quiet); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.dashboard-columns { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(310px, 0.85fr); gap: 24px; }

.pigeon-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pigeon-card { min-width: 0; overflow: hidden; padding: 0; text-align: left; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.pigeon-card img { width: 100%; aspect-ratio: 4 / 3; display: block; object-fit: cover; }
.pigeon-card-copy { display: block; padding: 12px; }
.pigeon-card-copy strong, .pigeon-card-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pigeon-card-copy strong { font-size: 13px; }
.pigeon-card-copy small { margin-top: 4px; color: var(--muted); font-size: 10px; }

.timeline { border-top: 1px solid var(--line); }
.timeline-row { min-height: 66px; display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 11px; border-bottom: 1px solid var(--line); }
.timeline-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.timeline-row strong, .timeline-row small { display: block; }
.timeline-row strong { font-size: 12px; }
.timeline-row small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.timeline-row time { color: var(--quiet); font-size: 9px; }

.filter-toolbar { display: grid; grid-template-columns: minmax(260px, 1fr) auto auto; gap: 10px; margin-bottom: 20px; }
.search-field { min-height: var(--tap); display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; }
.search-field svg { width: 18px; height: 18px; color: var(--quiet); }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 12px; }

.segmented { min-height: var(--tap); display: flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius); background: #eef6fd; }
.segmented button { min-height: 44px; padding: 0 12px; color: var(--muted); border: 0; border-radius: 5px; background: transparent; font-size: 11px; font-weight: 650; }
.segmented button.is-active { color: var(--accent-strong); background: #fff; box-shadow: 0 2px 8px rgba(24, 81, 125, 0.08); }

.pigeon-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.archive-card { min-width: 0; overflow: hidden; text-align: left; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; transition: transform 180ms ease, box-shadow 180ms ease; }
.archive-card:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(24, 81, 125, 0.1); }
.archive-photo { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #e5f3ff; }
.archive-photo img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform 300ms ease; }
.archive-card:hover img { transform: scale(1.025); }
.photo-badge { position: absolute; top: 9px; left: 9px; min-height: 24px; display: inline-flex; align-items: center; padding: 0 7px; color: #fff; border-radius: 5px; background: rgba(13, 31, 47, 0.62); backdrop-filter: blur(8px); font-size: 9px; }
.archive-copy { display: block; padding: 13px; }
.archive-copy > span:first-child { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.archive-copy strong { min-width: 0; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.sex-badge { flex: 0 0 auto; color: var(--accent-strong); font-size: 10px; }
.archive-copy small { display: block; margin-top: 5px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.archive-meta { display: flex; gap: 6px; margin-top: 10px; }
.archive-meta em { padding: 4px 6px; color: var(--muted); border-radius: 4px; background: #f1f7fd; font-size: 9px; font-style: normal; }

.detail-header { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.detail-header > div { min-width: 0; }
.detail-header h1 { margin: 0; font-size: 27px; }
.detail-header p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.detail-header .page-actions { margin-left: auto; }

.photo-exhibition { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.exhibition { position: relative; min-height: 0; overflow: hidden; background: #10202d; }
.exhibition img { width: 100%; height: clamp(360px, 48vw, 540px); min-height: 0; display: block; object-fit: cover; transition: height 250ms ease, opacity 200ms ease, transform 250ms ease; }
.exhibition.is-collapsed img { height: 94px; opacity: .62; }
.gallery-dock { min-height: 66px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 9px 10px 9px 14px; border-top: 1px solid var(--line); background: #fff; }
.gallery-dock-copy { min-width: 0; }
.gallery-dock-copy strong, .gallery-dock-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gallery-dock-copy strong { font-size: 13px; }
.gallery-dock-copy small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.gallery-tools { display: flex; align-items: center; gap: 5px; }
.gallery-tools .icon-button { background: #f8fbfe; }
.gallery-top { position: absolute; z-index: 3; top: 12px; right: 12px; left: 12px; display: flex; justify-content: space-between; gap: 8px; }
.gallery-top .secondary-button, .gallery-nav button { color: #fff; border-color: rgba(255,255,255,.4); background: rgba(13,31,47,.38); backdrop-filter: blur(12px); }
.gallery-caption { position: absolute; z-index: 2; right: 22px; bottom: 18px; left: 22px; display: flex; align-items: end; justify-content: space-between; gap: 20px; color: #fff; }
.gallery-caption strong { display: block; font-size: 22px; }
.gallery-caption small { display: block; margin-top: 4px; opacity: .76; font-size: 10px; }
.gallery-nav { display: flex; align-items: center; gap: 7px; }
.gallery-nav button { width: 42px; height: 42px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(255,255,255,.4); border-radius: var(--radius); }
.gallery-nav svg { width: 18px; height: 18px; }

.detail-tabs { display: flex; gap: 20px; margin-top: 19px; border-bottom: 1px solid var(--line); }
.detail-tabs button { min-height: 44px; padding: 0 2px; color: var(--muted); border: 0; border-bottom: 2px solid transparent; background: transparent; font-size: 12px; font-weight: 650; }
.detail-tabs button.is-active { color: var(--accent-strong); border-bottom-color: var(--accent); }
.detail-body { padding-top: 20px; }
.detail-columns { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); gap: 30px; }
.attribute-list { border-top: 1px solid var(--line); }
.attribute-row { min-height: 54px; display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; gap: 18px; border-bottom: 1px solid var(--line); }
.attribute-row span { color: var(--muted); font-size: 10px; }
.attribute-row strong { font-size: 12px; }
.detail-action-list { display: grid; gap: 8px; }
.detail-action { min-height: 60px; display: grid; grid-template-columns: 38px minmax(0, 1fr) 18px; align-items: center; gap: 10px; padding: 8px 10px; text-align: left; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.detail-action > i { width: 36px; height: 36px; display: grid; place-items: center; color: var(--accent-strong); border-radius: 7px; background: var(--accent-soft); }
.detail-action svg { width: 18px; height: 18px; }
.detail-action strong, .detail-action small { display: block; }
.detail-action strong { font-size: 12px; }
.detail-action small { margin-top: 3px; color: var(--muted); font-size: 9px; }

.eye-workspace { min-height: calc(100dvh - var(--topbar) - 90px); display: grid; grid-template-columns: minmax(0, 1.16fr) minmax(360px, .84fr); overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.eye-stage { position: relative; min-height: 650px; overflow: hidden; background: #0d1b26; }
.eye-stage img { width: 100%; height: 100%; display: block; object-fit: cover; }
.eye-stage::after { position: absolute; inset: 0; content: ""; background: linear-gradient(180deg, rgba(0,0,0,.04), rgba(0,0,0,.26)); pointer-events: none; }
.eye-toolbar { position: absolute; z-index: 3; top: 12px; right: 12px; left: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.eye-toolbar button { color: #fff; border-color: rgba(255,255,255,.42); background: rgba(10,27,40,.32); backdrop-filter: blur(12px); }
.eye-target { position: absolute; z-index: 2; top: 46%; left: 53%; width: clamp(170px, 30vw, 300px); aspect-ratio: 1; border: 1px solid rgba(255,255,255,.86); border-radius: 50%; box-shadow: 0 0 0 999px rgba(6, 19, 28, .16), inset 0 0 0 10px rgba(255,255,255,.05); transform: translate(-50%,-50%); }
.eye-stage-copy { position: absolute; z-index: 3; right: 18px; bottom: 18px; left: 18px; color: #fff; }
.eye-stage-copy strong, .eye-stage-copy span { display: block; }
.eye-stage-copy strong { font-size: 18px; }
.eye-stage-copy span { margin-top: 5px; opacity: .78; font-size: 11px; }
.eye-controls { display: flex; flex-direction: column; padding: 30px; }
.eye-controls h1 { margin: 0; font-size: 28px; }
.eye-controls > p { margin: 9px 0 22px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.source-list { border-top: 1px solid var(--line); }
.source-option { width: 100%; min-height: 67px; display: grid; grid-template-columns: 38px minmax(0,1fr) 18px; align-items: center; gap: 10px; padding: 8px 2px; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; }
.source-option > i { width: 36px; height: 36px; display: grid; place-items: center; color: var(--accent-strong); border-radius: 7px; background: var(--accent-soft); }
.source-option svg { width: 18px; height: 18px; }
.source-option strong, .source-option small { display: block; }
.source-option strong { font-size: 12px; }
.source-option small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.eye-controls .primary-button { width: 100%; margin-top: auto; }

.processing-view { flex: 1; display: grid; place-items: center; align-content: center; text-align: center; }
.processing-ring { width: 92px; height: 92px; display: grid; place-items: center; border: 2px solid #cce5fb; border-top-color: var(--accent); border-radius: 50%; animation: spin 900ms linear infinite; }
.processing-ring svg { width: 33px; height: 33px; color: var(--accent); }
.processing-view h2 { margin: 20px 0 6px; font-size: 20px; }
.processing-view p { margin: 0; color: var(--muted); font-size: 11px; }

.eye-report { padding: 26px; overflow: auto; }
.report-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.report-top small { color: var(--accent-strong); font-size: 10px; font-weight: 700; }
.report-top h1 { margin: 5px 0 0; font-size: 27px; }
.score-lockup { min-width: 76px; text-align: right; }
.score-lockup strong { display: block; color: var(--accent-strong); font-size: 42px; line-height: 1; }
.score-lockup span { color: var(--muted); font-size: 9px; }
.report-copy { margin: 18px 0; padding: 15px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.report-copy strong { font-size: 13px; }
.report-copy p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.dimension-list { display: grid; gap: 10px; }
.dimension-row { display: grid; grid-template-columns: 84px minmax(0,1fr) 30px; align-items: center; gap: 9px; }
.dimension-row span { font-size: 10px; }
.meter { height: 6px; overflow: hidden; border-radius: 3px; background: #e5f0f9; }
.meter i { height: 100%; display: block; border-radius: inherit; background: var(--accent); }
.dimension-row b { color: var(--accent-strong); font-size: 10px; text-align: right; }
.report-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0; }
.report-tags span { padding: 6px 8px; color: var(--accent-strong); border-radius: 5px; background: var(--accent-soft); font-size: 9px; }
.report-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: auto; }

.pedigree-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.focus-select { min-width: 260px; min-height: var(--tap); display: grid; grid-template-columns: 32px minmax(0,1fr) 18px; align-items: center; gap: 9px; padding: 5px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; }
.focus-select img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.focus-select span { display: grid; text-align: left; }
.focus-select strong { font-size: 11px; }
.focus-select small { color: var(--muted); font-size: 9px; }
.pedigree-canvas { position: relative; min-height: 620px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background-color: #fff; background-image: linear-gradient(#edf5fb 1px, transparent 1px), linear-gradient(90deg,#edf5fb 1px,transparent 1px); background-size: 28px 28px; }
.family-map { position: relative; min-width: 1040px; min-height: 620px; }
.family-line { position: absolute; z-index: 0; height: 1px; background: #a9c7e1; transform-origin: left center; }
.family-node { position: absolute; z-index: 2; width: 154px; min-height: 72px; display: grid; grid-template-columns: 50px minmax(0,1fr); align-items: center; gap: 8px; padding: 7px; text-align: left; border: 1px solid #cfe1f0; border-radius: var(--radius); background: rgba(255,255,255,.95); box-shadow: 0 9px 20px rgba(24,81,125,.08); }
.family-node.is-focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 11px 26px rgba(24,81,125,.12); }
.family-node img { width: 50px; height: 56px; border-radius: 6px; object-fit: cover; }
.family-node span { min-width: 0; }
.family-node small, .family-node strong, .family-node em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.family-node small { color: var(--accent-strong); font-size: 8px; }
.family-node strong { margin: 4px 0; font-size: 11px; }
.family-node em { color: var(--muted); font-size: 8px; font-style: normal; }
.pedigree-floating { position: sticky; z-index: 5; right: 12px; bottom: 12px; left: calc(100% - 154px); width: max-content; display: flex; gap: 4px; padding: 4px; border: 1px solid rgba(255,255,255,.9); border-radius: var(--radius); background: rgba(255,255,255,.82); backdrop-filter: blur(14px); }

.breeding-layout { display: grid; grid-template-columns: minmax(0,1fr) 360px; gap: 26px; }
.pair-list { border-top: 1px solid var(--line); }
.pair-row { width: 100%; min-height: 88px; display: grid; grid-template-columns: 76px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 9px 0; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; }
.pair-portraits { display: flex; }
.pair-portraits img { width: 48px; height: 58px; border: 2px solid #fff; border-radius: 6px; object-fit: cover; }
.pair-portraits img + img { margin-left: -20px; }
.pair-row strong, .pair-row small { display: block; }
.pair-row strong { font-size: 13px; }
.pair-row small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.status-pill { min-height: 26px; display: inline-flex; align-items: center; padding: 0 8px; color: var(--accent-strong); border-radius: 5px; background: var(--accent-soft); font-size: 9px; }
.breeding-board { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.breeding-board > header { padding: 18px; border-bottom: 1px solid var(--line); }
.breeding-board h2 { margin: 0; font-size: 17px; }
.breeding-board header p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.round-block { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.round-block > span { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.round-block strong { font-size: 12px; }
.round-block small { color: var(--muted); font-size: 9px; }
.egg-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin-top: 12px; }
.egg { min-height: 70px; display: grid; place-items: center; align-content: center; gap: 5px; border: 1px solid var(--line); border-radius: 7px; background: #fbfdff; }
.egg svg { width: 22px; height: 22px; color: var(--accent-strong); }
.egg span { font-size: 9px; }
.breeding-events { padding: 0 18px 18px; }
.breeding-event { min-height: 48px; display: grid; grid-template-columns: 8px minmax(0,1fr) auto; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); }
.breeding-event span:first-child { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.breeding-event strong { font-size: 10px; }
.breeding-event time { color: var(--quiet); font-size: 8px; }

.compact-metrics { margin-top: 0; }

.operations-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 32px;
}

.operations-main,
.operations-aside { min-width: 0; }

.operations-aside {
  padding-left: 28px;
  border-left: 1px solid var(--line);
}

.section-heading > div h2 { margin: 4px 0 0; }

.race-route {
  min-height: 122px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.race-route > span { min-width: 0; display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 0 11px; }
.race-route > span > i { width: 40px; height: 40px; grid-row: 1 / 3; display: grid; place-items: center; color: var(--accent-strong); border-radius: var(--radius); background: var(--accent-soft); }
.race-route > span svg { width: 19px; height: 19px; }
.race-route strong, .race-route small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.race-route strong { font-size: 13px; }
.race-route small { margin-top: 4px; color: var(--muted); font-size: 9px; }

.route-line { position: relative; height: 1px; display: block; background: var(--line-strong); }
.route-line::before, .route-line::after { position: absolute; top: 50%; width: 7px; height: 7px; border: 2px solid var(--accent); border-radius: 50%; background: #fff; content: ""; transform: translateY(-50%); }
.route-line::before { left: 0; }
.route-line::after { right: 0; }
.route-line b { position: absolute; top: -3px; left: 20%; width: 18px; height: 7px; border-radius: 4px; background: var(--accent); }

.event-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.event-step { min-width: 0; min-height: 76px; display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: center; gap: 7px; padding: 10px 12px; border-right: 1px solid var(--line); }
.event-step:last-child { border-right: 0; }
.event-step > i { width: 24px; height: 24px; display: grid; place-items: center; color: var(--quiet); }
.event-step.is-complete > i { color: #fff; border-radius: 50%; background: var(--success); }
.event-step svg { width: 14px; height: 14px; }
.event-step strong, .event-step small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-step strong { font-size: 11px; }
.event-step small { margin-top: 4px; color: var(--muted); font-size: 9px; }

.work-actions { display: flex; gap: 8px; margin-top: 16px; }
.records-heading { margin-top: 30px; }

.record-table { width: 100%; overflow-x: auto; border-top: 1px solid var(--line); }
.record-table-head,
.record-table-row { min-width: 630px; display: grid; grid-template-columns: minmax(190px, 1.5fr) .65fr .8fr 1fr .8fr; align-items: center; gap: 12px; }
.record-table-head { min-height: 38px; color: var(--quiet); border-bottom: 1px solid var(--line); font-size: 9px; font-weight: 700; }
.record-table-row { width: 100%; min-height: 64px; padding: 8px 0; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; font-size: 10px; }
.record-table-row strong, .record-table-row small { display: block; }
.record-table-row strong { font-size: 11px; }
.record-table-row small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.record-table-row time { color: var(--muted); font-size: 9px; }

.utility-list { border-top: 1px solid var(--line); }
.utility-row { width: 100%; min-height: 66px; display: grid; grid-template-columns: 36px minmax(0, 1fr) 18px; align-items: center; gap: 10px; padding: 8px 0; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; }
.utility-row > i { width: 35px; height: 35px; display: grid; place-items: center; color: var(--accent-strong); border-radius: 7px; background: var(--accent-soft); }
.utility-row svg { width: 17px; height: 17px; }
.utility-row strong, .utility-row small { display: block; }
.utility-row strong { font-size: 11px; }
.utility-row small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.aside-heading { margin-top: 28px; }

.care-list { border-top: 1px solid var(--line); }
.care-row { width: 100%; min-height: 82px; display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 9px 0; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; }
.care-row img { width: 50px; height: 60px; border-radius: 6px; object-fit: cover; }
.care-row strong, .care-row small { display: block; }
.care-row strong { font-size: 12px; }
.care-row small { margin-top: 5px; color: var(--muted); font-size: 9px; }
.care-tail { min-width: 48px; padding: 6px 7px; border-radius: 5px; font-size: 9px; font-style: normal; text-align: center; }
.care-tail.attention { color: var(--warning); background: #fff5e8; }
.care-tail.normal { color: var(--success); background: #e9f7f1; }
.care-tail.overdue { color: var(--danger); background: #fff0f1; }

.formula-panel { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.formula-row { min-height: 38px; display: grid; grid-template-columns: 62px minmax(0, 1fr) 34px; align-items: center; gap: 8px; }
.formula-row span, .formula-row strong { font-size: 9px; }
.formula-row strong { color: var(--accent-strong); text-align: right; }
.formula-panel > .secondary-button { width: 100%; margin-top: 13px; }

.reference-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.reference-tool { min-width: 0; min-height: 78px; display: grid; grid-template-columns: 34px minmax(0, 1fr) 16px; align-items: center; gap: 9px; padding: 10px 14px; text-align: left; border: 0; border-right: 1px solid var(--line); background: transparent; }
.reference-tool:last-child { border-right: 0; }
.reference-tool > i { width: 32px; height: 32px; display: grid; place-items: center; color: var(--accent-strong); border-radius: 7px; background: var(--accent-soft); }
.reference-tool svg { width: 16px; height: 16px; }
.reference-tool strong, .reference-tool small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reference-tool strong { font-size: 11px; }
.reference-tool small { margin-top: 4px; color: var(--muted); font-size: 9px; }

.account-inline-actions { display: flex; gap: 8px; padding-top: 16px; }
.dialog-search { margin-bottom: 12px; }
.code-list { border-top: 1px solid var(--line); }
.code-row { min-height: 52px; display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.code-row strong { color: var(--accent-strong); font-size: 11px; }
.code-row span { font-size: 11px; }
.code-row em { color: var(--success); font-size: 9px; font-style: normal; }

.migration-summary { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.migration-summary .metric { padding: 14px 12px; }
.migration-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.knowledge-layout { display: grid; grid-template-columns: minmax(320px,.8fr) minmax(420px,1.2fr); gap: 30px; }
.knowledge-compose { min-height: 520px; display: flex; flex-direction: column; }
.knowledge-compose h2 { margin: 0; font-size: 23px; }
.knowledge-compose > p { margin: 9px 0 20px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.knowledge-form textarea { width: 100%; min-height: 150px; resize: vertical; padding: 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; font-size: 13px; line-height: 1.6; }
.knowledge-form .primary-button { width: 100%; margin-top: 10px; }
.topic-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.topic-chips button { min-height: 34px; padding: 0 9px; color: var(--accent-strong); border: 1px solid #d0e4f6; border-radius: 6px; background: var(--accent-soft); font-size: 10px; }
.knowledge-answer { min-height: 520px; padding-left: 30px; border-left: 1px solid var(--line); }
.answer-empty { min-height: 440px; display: grid; place-items: center; align-content: center; color: var(--muted); text-align: center; }
.answer-empty svg { width: 34px; height: 34px; margin-bottom: 12px; color: var(--accent); }
.answer-empty strong { font-size: 13px; }
.answer-empty p { max-width: 290px; margin: 7px 0 0; font-size: 10px; line-height: 1.6; }
.answer-content > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.answer-content h2 { margin: 0; font-size: 22px; }
.answer-copy { margin-top: 18px; color: #324354; font-size: 13px; line-height: 1.85; }
.citations { margin-top: 22px; border-top: 1px solid var(--line); }
.citation { padding: 12px 0; border-bottom: 1px solid var(--line); }
.citation strong, .citation small { display: block; }
.citation strong { font-size: 10px; }
.citation small { margin-top: 4px; color: var(--muted); font-size: 9px; }

.bottom-nav { display: none; }

.assistant-panel {
  position: fixed;
  z-index: 50;
  top: calc(var(--topbar) + env(safe-area-inset-top) + 12px);
  right: 14px;
  bottom: 14px;
  width: min(410px, calc(100% - 28px));
  display: grid;
  grid-template-rows: auto minmax(0,1fr) auto;
  overflow: hidden;
  border-color: rgba(255,255,255,.96);
  border-radius: var(--radius);
  background: rgba(255,255,255,.91);
  transform: translateX(calc(100% + 30px));
  opacity: 0;
  pointer-events: none;
  transition: transform 300ms cubic-bezier(.22,.78,.2,1), opacity 220ms ease;
}

.assistant-panel.is-open { transform: translateX(0); opacity: 1; pointer-events: auto; }
.assistant-head { min-height: 65px; display: grid; grid-template-columns: 38px minmax(0,1fr) 38px 38px 38px; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.assistant-mark { width: 36px; height: 36px; display: grid; place-items: center; color: #fff; border-radius: var(--radius); background: var(--accent); }
.assistant-mark svg { width: 18px; height: 18px; }
.assistant-head > span:nth-child(2) { min-width: 0; }
.assistant-head strong, .assistant-head small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assistant-head strong { font-size: 13px; }
.assistant-head small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.assistant-messages { overflow: auto; padding: 18px 14px; }
.assistant-bubble { max-width: 88%; margin: 0 0 12px; padding: 11px 12px; border-radius: var(--radius); background: #eef6fd; }
.assistant-bubble.is-user { margin-left: auto; color: #fff; background: var(--accent); }
.assistant-bubble p { margin: 0; font-size: 12px; line-height: 1.65; }
.assistant-suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
.assistant-suggestions button { min-height: 34px; padding: 0 9px; color: var(--accent-strong); border: 1px solid #d3e6f6; border-radius: 6px; background: #fff; font-size: 10px; }
.assistant-card { overflow: hidden; margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.assistant-card-media { height: 148px; overflow: hidden; }
.assistant-card-media img { width: 100%; height: 100%; object-fit: cover; }
.assistant-card-body { padding: 12px; }
.assistant-card-body strong, .assistant-card-body small { display: block; }
.assistant-card-body strong { font-size: 14px; }
.assistant-card-body small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.assistant-card-actions { display: flex; gap: 6px; margin-top: 11px; }
.assistant-card-actions button { flex: 1; min-width: 0; }
.assistant-compose { display: grid; grid-template-columns: 44px minmax(0,1fr) 42px; align-items: end; gap: 7px; padding: 10px; border-top: 1px solid var(--line); background: rgba(255,255,255,.86); }
.assistant-compose textarea { min-height: 44px; max-height: 110px; resize: none; padding: 12px 4px; border: 0; outline: 0; background: transparent; font-size: 12px; line-height: 1.5; }
.send-button { width: 42px; height: 42px; display: grid; place-items: center; padding: 0; color: #fff; border: 0; border-radius: var(--radius); background: var(--accent); }
.send-button svg { width: 18px; height: 18px; }

.voice-capture-hud {
  position: fixed;
  z-index: 90;
  right: 50%;
  bottom: calc(94px + env(safe-area-inset-bottom));
  min-width: min(360px, calc(100% - 28px));
  min-height: 68px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  transform: translateX(50%);
  animation: voice-hud-enter 180ms ease both;
}

.voice-hud-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  background: #b43f45;
}

.voice-hud-icon svg { width: 19px; height: 19px; }
.voice-hud-copy strong, .voice-hud-copy small { display: block; }
.voice-hud-copy strong { font-size: 12px; }
.voice-hud-copy small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.voice-wave { height: 32px; display: flex; align-items: center; gap: 3px; }
.voice-wave i { width: 3px; height: 9px; border-radius: 2px; background: #b43f45; animation: voice-wave 520ms ease-in-out infinite alternate; }
.voice-wave i:nth-child(2) { animation-delay: -320ms; }
.voice-wave i:nth-child(3) { animation-delay: -180ms; }
.voice-wave i:nth-child(4) { animation-delay: -420ms; }
.voice-wave i:nth-child(5) { animation-delay: -90ms; }

dialog { width: 100%; max-width: none; max-height: none; padding: 0; border: 0; background: transparent; }
dialog::backdrop { background: rgba(24,47,67,.24); backdrop-filter: blur(5px); }
.action-dialog, .account-dialog { width: min(620px, calc(100% - 24px)); margin: auto; }
.dialog-surface, .account-surface { max-height: min(86dvh,780px); overflow: auto; padding: 20px; border-radius: var(--radius); background: rgba(255,255,255,.94); }
.dialog-surface > header, .account-surface > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.dialog-surface header small, .account-surface header small { color: var(--accent-strong); font-size: 10px; font-weight: 700; }
.dialog-surface h2, .account-surface h2 { margin: 4px 0 0; font-size: 21px; }
.dialog-body { margin-top: 20px; }
.dialog-copy { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.75; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.form-field { min-width: 0; display: grid; gap: 6px; }
.form-field.span-all { grid-column: 1 / -1; }
.form-field label { font-size: 10px; font-weight: 650; }
.form-field input, .form-field select, .form-field textarea { width: 100%; min-height: 45px; padding: 9px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; font-size: 12px; }
.form-field textarea { min-height: 90px; resize: vertical; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.safety-note { display: flex; align-items: flex-start; gap: 8px; margin: 15px 0 0; padding: 11px; color: var(--muted); border: 1px solid #cfe4f6; border-radius: var(--radius); background: var(--accent-soft); font-size: 10px; line-height: 1.6; }
.safety-note input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--accent); }
.voice-audit { display: grid; justify-items: center; text-align: center; }
.voice-audit > .assistant-mark { width: 54px; height: 54px; border-radius: 50%; }
.voice-audit > p { max-width: 440px; margin: 16px 0 18px; font-size: 16px; line-height: 1.75; }
.voice-audit > .timeline { width: 100%; margin-bottom: 18px; text-align: left; }

.search-dialog { width: min(680px, calc(100% - 24px)); margin: 10dvh auto auto; }
.search-surface { overflow: hidden; border-radius: var(--radius); background: rgba(255,255,255,.96); }
.search-input { min-height: 62px; display: grid; grid-template-columns: 24px minmax(0,1fr) 38px; align-items: center; gap: 9px; padding: 7px 10px 7px 16px; border-bottom: 1px solid var(--line); }
.search-input > svg { width: 19px; height: 19px; color: var(--muted); }
.search-input input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 15px; }
.search-results { max-height: 54dvh; overflow: auto; padding: 8px; }
.search-result { width: 100%; min-height: 58px; display: grid; grid-template-columns: 36px minmax(0,1fr) 18px; align-items: center; gap: 9px; padding: 7px 8px; text-align: left; border: 0; border-radius: 7px; background: transparent; }
.search-result:hover { background: var(--accent-soft); }
.search-result > i { width: 34px; height: 34px; display: grid; place-items: center; color: var(--accent-strong); border-radius: 7px; background: var(--accent-soft); }
.search-result strong, .search-result small { display: block; }
.search-result strong { font-size: 11px; }
.search-result small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.search-result svg { width: 17px; height: 17px; }

.account-identity { display: grid; grid-template-columns: 52px minmax(0,1fr); align-items: center; gap: 11px; margin-top: 18px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.large-avatar { width: 50px; height: 50px; display: grid; place-items: center; color: var(--accent-strong); border-radius: 50%; background: var(--accent-soft); font-weight: 760; }
.account-identity strong, .account-identity small { display: block; }
.account-identity strong { font-size: 12px; }
.account-identity small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.account-tabs { display: flex; gap: 18px; margin-top: 12px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.account-tabs::-webkit-scrollbar { display: none; }
.account-tabs button { min-height: 42px; padding: 0 1px; color: var(--muted); border: 0; border-bottom: 2px solid transparent; background: transparent; font-size: 11px; font-weight: 650; }
.account-tabs button.is-active { color: var(--accent-strong); border-bottom-color: var(--accent); }
.account-content { min-height: 260px; padding-top: 12px; }
.account-row { min-height: 62px; display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.account-row > i { width: 35px; height: 35px; display: grid; place-items: center; color: var(--accent-strong); border-radius: 7px; background: var(--accent-soft); }
.account-row svg { width: 17px; height: 17px; }
.account-row strong, .account-row small { display: block; }
.account-row strong { font-size: 11px; }
.account-row small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.account-row > span:last-child { color: var(--muted); font-size: 9px; }

.more-dialog { width: calc(100% - 16px); margin: auto 8px calc(82px + env(safe-area-inset-bottom)); }
.more-surface { padding: 14px; border-radius: var(--radius); background: rgba(255,255,255,.96); }
.more-surface > header { display: flex; align-items: center; justify-content: space-between; }
.more-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 12px; }
.more-grid button { min-height: 82px; display: grid; place-items: center; align-content: center; gap: 7px; color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.more-grid svg { width: 22px; height: 22px; color: var(--accent); }
.more-grid span { font-size: 11px; }

.toast-region { position: fixed; z-index: 80; right: 18px; bottom: 18px; display: grid; gap: 8px; }
.toast { max-width: 340px; padding: 11px 13px; color: #fff; border-radius: var(--radius); background: rgba(20,32,43,.94); box-shadow: 0 12px 26px rgba(20,32,43,.18); font-size: 11px; animation: toast-enter 220ms ease both; }

.empty-state { min-height: 240px; display: grid; place-items: center; align-content: center; color: var(--muted); text-align: center; }
.empty-state svg { width: 33px; height: 33px; margin-bottom: 12px; color: var(--accent); }
.empty-state strong { font-size: 13px; }
.empty-state p { max-width: 280px; margin: 7px 0 0; font-size: 10px; line-height: 1.6; }

@keyframes page-enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes hold-progress { to { transform: scaleX(1); } }
@keyframes agent-ring { to { transform: rotate(360deg); border-color: var(--accent); } }
@keyframes voice-hud-enter { from { opacity: 0; transform: translate(50%, 8px) scale(.98); } to { opacity: 1; transform: translate(50%, 0) scale(1); } }
@keyframes voice-wave { from { transform: scaleY(.55); } to { transform: scaleY(2.4); } }

@media (max-width: 1120px) {
  :root { --sidebar: 82px; }
  .brand-copy, .nav-item span, .nav-item b, .nav-footer .status-line strong { display: none; }
  .brand-button { justify-content: center; }
  .side-nav { padding-inline: 10px; }
  .nav-item { grid-template-columns: 1fr; justify-items: center; padding: 0; }
  .status-line { justify-content: center; padding: 0; }
  .pigeon-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (max-width: 820px) {
  :root { --topbar: 60px; }
  .topbar { grid-template-columns: minmax(0,1fr) auto; padding-inline: 10px; }
  .brand-button { justify-content: flex-start; }
  .brand-copy { display: grid; }
  .loft-switcher, #global-search, #notification-button, #assistant-trigger, .side-nav { display: none; }
  #app-main, #main-content { margin-left: 0; padding: calc(var(--topbar) + env(safe-area-inset-top) + 20px) 14px calc(92px + env(safe-area-inset-bottom)); }
  .bottom-nav { position: fixed; z-index: 35; right: 8px; bottom: max(8px, env(safe-area-inset-bottom)); left: 8px; height: 68px; display: grid; grid-template-columns: repeat(5,1fr); align-items: center; padding: 5px 7px; border-radius: var(--radius); background: rgba(255,255,255,.9); }
  .mobile-nav-item { min-width: 0; min-height: 54px; display: grid; place-items: center; align-content: center; gap: 4px; color: var(--muted); border: 0; border-radius: 6px; background: transparent; }
  .mobile-nav-item.is-active { color: var(--accent-strong); background: var(--accent-soft); }
  .mobile-nav-item svg { width: 20px; height: 20px; }
  .mobile-nav-item span, .mobile-nav-item small { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-nav-item.agent-action { position: relative; overflow: visible; background: transparent; }
  .mobile-nav-item.agent-action > span { position: relative; width: 46px; height: 46px; display: grid; place-items: center; margin-top: -25px; color: #fff; border: 3px solid #fff; border-radius: 50%; background: var(--accent); box-shadow: 0 8px 20px rgba(8,109,207,.24); transition: transform 160ms ease, background-color 160ms ease; }
  .mobile-nav-item.agent-action small { margin-top: 1px; color: var(--accent-strong); }
  .mobile-nav-item.agent-action.is-holding > span { transform: scale(1.08); }
  .mobile-nav-item.agent-action.is-holding > span::after { position: absolute; inset: -7px; border: 2px solid transparent; border-top-color: var(--accent); border-radius: 50%; content: ""; animation: agent-ring 560ms linear forwards; }
  .mobile-nav-item.agent-action.is-recording > span { background: #b43f45; transform: scale(1.08); box-shadow: 0 8px 22px rgba(180,63,69,.24); }
  .today-band, .dashboard-columns, .detail-columns, .eye-workspace, .breeding-layout, .operations-layout, .knowledge-layout { grid-template-columns: minmax(0,1fr); }
  .spotlight { min-height: 0; grid-template-columns: 220px minmax(0, 1fr); grid-template-rows: 176px; border-right: 0; border-bottom: 1px solid var(--line); }
  .spotlight img { height: 176px; }
  .today-agenda { min-height: 330px; }
  .metrics-band { grid-template-columns: repeat(2,1fr); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .pigeon-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .eye-workspace { min-height: 0; }
  .eye-stage { min-height: 56dvh; }
  .eye-controls { min-height: 520px; }
  .breeding-board { order: -1; }
  .operations-aside { padding: 26px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .reference-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reference-tool:nth-child(2) { border-right: 0; }
  .reference-tool:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .migration-summary, .migration-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .migration-summary .metric:nth-child(2), .migration-steps .event-step:nth-child(2) { border-right: 0; }
  .migration-summary .metric:nth-child(-n+2), .migration-steps .event-step:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .knowledge-answer { min-height: 420px; padding: 24px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .pedigree-canvas { min-height: 66dvh; margin-right: -14px; margin-left: -14px; border-right: 0; border-left: 0; border-radius: 0; }
  .assistant-panel { top: calc(var(--topbar) + env(safe-area-inset-top) + 8px); right: 8px; bottom: calc(84px + env(safe-area-inset-bottom)); width: calc(100% - 16px); }
}

@media (max-width: 560px) {
  .brand-copy small { display: none; }
  .top-actions { gap: 4px; }
  .page-header { align-items: flex-start; }
  .page-header h1 { font-size: 28px; }
  .page-header p { display: none; }
  .page-actions .secondary-button span { display: none; }
  .page-actions .secondary-button { width: 44px; padding: 0; }
  .today-band { margin-right: -14px; margin-left: -14px; border-right: 0; border-left: 0; border-radius: 0; }
  .spotlight { min-height: 0; grid-template-columns: 42% minmax(0, 1fr); grid-template-rows: 158px; }
  .spotlight img { height: 158px; }
  .spotlight-copy { padding: 10px 11px; }
  .spotlight-copy strong { font-size: 17px; }
  .spotlight-copy button span { display: none; }
  .spotlight-copy button { width: 44px; padding: 0; }
  .today-agenda { padding: 22px 16px; }
  .metric { padding: 16px 12px; }
  .metric strong { font-size: 22px; }
  .dashboard-columns { gap: 26px; }
  .pigeon-strip { grid-template-columns: repeat(2,minmax(0,1fr)); overflow: auto; }
  .pigeon-strip .pigeon-card { min-width: 160px; }
  .pigeon-strip .pigeon-card:nth-child(3) { display: none; }
  .filter-toolbar { grid-template-columns: minmax(0,1fr) auto; }
  .filter-toolbar .segmented { grid-column: 1 / -1; order: 3; overflow: auto; }
  .filter-toolbar .segmented button { flex: 1; }
  .pigeon-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .archive-copy { padding: 10px; }
  .archive-meta em:nth-child(2) { display: none; }
  .detail-header .page-actions .secondary-button { display: none; }
  .photo-exhibition { margin-right: -14px; margin-left: -14px; border-right: 0; border-left: 0; border-radius: 0; }
  .exhibition img { height: min(46dvh, 390px); }
  .exhibition.is-collapsed img { height: 82px; }
  .gallery-dock { grid-template-columns: minmax(0, 1fr) auto; padding-left: 14px; }
  .gallery-tools { gap: 3px; }
  .detail-tabs { overflow-x: auto; scrollbar-width: none; }
  .detail-tabs::-webkit-scrollbar { display: none; }
  .detail-tabs button { flex: 0 0 auto; }
  .attribute-row { grid-template-columns: 92px minmax(0,1fr); }
  .eye-workspace { margin-right: -14px; margin-left: -14px; border-right: 0; border-left: 0; border-radius: 0; }
  .eye-stage { min-height: 60dvh; }
  .eye-controls, .eye-report { padding: 24px 16px; }
  .pedigree-toolbar { align-items: stretch; flex-direction: column; }
  .focus-select { min-width: 0; width: 100%; }
  .breeding-layout { gap: 20px; }
  .pair-row { grid-template-columns: 68px minmax(0,1fr) auto; }
  .race-route { grid-template-columns: minmax(0, 1fr) 50px minmax(0, 1fr); gap: 8px; }
  .race-route > span { grid-template-columns: 34px minmax(0, 1fr); gap: 0 7px; }
  .race-route > span > i { width: 34px; height: 34px; }
  .race-route small { white-space: normal; }
  .event-progress { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .event-step:nth-child(2) { border-right: 0; }
  .event-step:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .work-actions { align-items: stretch; flex-direction: column; }
  .care-row { grid-template-columns: 46px minmax(0, 1fr) auto; }
  .care-row img { width: 44px; height: 54px; }
  .reference-strip { margin-right: -14px; margin-left: -14px; }
  .reference-tool { padding-inline: 12px; }
  .migration-summary { grid-template-columns: minmax(0, 1fr); }
  .migration-summary .metric { border-right: 0; border-bottom: 1px solid var(--line); }
  .account-inline-actions { align-items: stretch; flex-direction: column; }
  .code-row { grid-template-columns: 94px minmax(0, 1fr) auto; }
  .knowledge-layout { gap: 18px; }
  .form-grid { grid-template-columns: minmax(0,1fr); }
  .form-field.span-all { grid-column: auto; }
  .action-dialog, .account-dialog { width: 100%; margin: auto 0 0; }
  .dialog-surface, .account-surface { max-height: 92dvh; padding: 18px 15px calc(18px + env(safe-area-inset-bottom)); border-radius: var(--radius) var(--radius) 0 0; }
  .search-dialog { width: 100%; margin: 0; }
  .search-surface { min-height: 100dvh; border-radius: 0; }
  .toast-region { right: 12px; bottom: calc(88px + env(safe-area-inset-bottom)); left: 12px; }
  .toast { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (prefers-reduced-transparency: reduce) {
  .glass, .topbar, .side-nav, .bottom-nav, .assistant-panel { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
}


/* Live-data extras */

/* Production aliases and live-data extras. Prototype remains the visual source. */
:root {
  --page: #e9eef3;
  --surface: #f7f9fb;
  --app-viewport-height: 100dvh;
  --assistant-dock-width: 380px;
  --assistant-float-bottom: 72px;
}

html, body { background: var(--page); }

.app-shell { min-height: 100dvh; }
#main-content, #app-main {
  min-height: 100dvh;
  min-width: 0;
  margin-left: var(--sidebar);
  padding: calc(var(--topbar) + env(safe-area-inset-top) + 30px) clamp(26px, 4vw, 58px) 48px;
  overflow-x: hidden;
}

.nav-button { cursor: pointer; }
.system-status-line.is-degraded > span { background: var(--warning); }

.segmented button {
  min-height: 44px;
}

.eyebrow {
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 700;
}

.danger-button {
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  color: #fff;
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  background: var(--danger);
  font-size: 12px;
  font-weight: 680;
}

.field, .form-field { min-width: 0; display: grid; gap: 6px; }
.field.span-all, .form-field.span-all { grid-column: 1 / -1; }
.field label, .form-field label { font-size: 10px; font-weight: 650; }
.field input, .field select, .field textarea,
.form-field input, .form-field select, .form-field textarea {
  width: 100%;
  min-height: 45px;
  padding: 9px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  font-size: 12px;
}
.field textarea, .form-field textarea { min-height: 90px; resize: vertical; }

.select-control {
  position: relative;
  min-width: 0;
  display: grid;
  align-items: center;
  border-radius: var(--radius);
}
.select-control select {
  width: 100%;
  min-width: 0;
  padding-right: 38px !important;
  color: var(--ink);
  background-color: rgba(255, 255, 255, 0.94) !important;
  -webkit-appearance: none;
  appearance: none;
}
.select-control > svg {
  position: absolute;
  right: 12px;
  width: 15px;
  height: 15px;
  color: var(--muted);
  pointer-events: none;
  stroke-width: 1.8;
}
.select-control:focus-within {
  box-shadow: 0 0 0 3px rgba(8, 109, 207, 0.16);
}
.select-control select:focus-visible { outline: 0; }
.select-control.is-compact select {
  min-height: 36px;
  padding: 6px 34px 6px 10px !important;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-size: 11px;
}
.select-control.is-compact > svg { right: 10px; width: 13px; height: 13px; }
.account-switcher .select-control { min-width: 0; }

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.file-picker {
  min-height: 74px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(247, 250, 252, 0.94);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, transform 140ms ease;
}
.file-picker:hover { border-color: var(--accent); background: var(--accent-soft); }
.file-picker:active { transform: scale(0.99); }
.file-picker-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--accent-strong);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 5px 14px rgba(24, 81, 125, 0.08);
}
.file-picker-icon svg { width: 19px; height: 19px; }
.file-picker-copy { min-width: 0; }
.file-picker-copy strong,
.file-picker-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-picker-copy strong { font-size: 12px; }
.file-picker-copy small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.file-picker > svg { width: 17px; height: 17px; color: var(--muted); }
.visually-hidden:focus-visible + .file-picker {
  outline: 3px solid rgba(8, 109, 207, 0.24);
  outline-offset: 2px;
}

.toggle-control {
  position: relative;
  min-height: 46px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.toggle-control > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.toggle-track {
  position: relative;
  width: 44px;
  height: 26px;
  display: grid;
  place-items: center;
  color: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: #dce4eb;
  transition: border-color 160ms ease, background-color 160ms ease;
}
.toggle-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 7px rgba(20, 32, 43, 0.18);
  content: "";
  transition: transform 180ms cubic-bezier(.22, .78, .2, 1);
}
.toggle-track svg { width: 12px; height: 12px; opacity: 0; }
.toggle-control > input:checked + .toggle-track {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}
.toggle-control > input:checked + .toggle-track::after { transform: translateX(18px); }
.toggle-control > input:checked + .toggle-track svg { margin-right: 17px; opacity: 1; }
.toggle-control > input:focus-visible + .toggle-track {
  outline: 3px solid rgba(8, 109, 207, 0.24);
  outline-offset: 2px;
}
.toggle-copy strong,
.toggle-copy small { display: block; }
.toggle-copy strong { font-size: 11px; }
.toggle-copy small { margin-top: 3px; color: var(--muted); font-size: 9px; }

.confirmation-note {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.status-badge {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  color: var(--accent-strong);
  border-radius: 5px;
  background: var(--accent-soft);
  font-size: 9px;
}
.status-badge.is-warning { color: var(--warning); background: #fff5e8; }

.module-tabs {
  min-height: 46px;
  display: flex;
  align-items: stretch;
  gap: 3px;
  margin: -5px 0 22px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.module-tabs::-webkit-scrollbar { display: none; }
.module-tabs button {
  position: relative;
  min-height: 44px;
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  color: var(--muted);
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 650;
}
.module-tabs button.is-active { color: var(--accent-strong); }
.module-tabs button.is-active::after {
  position: absolute;
  right: 10px;
  bottom: -1px;
  left: 10px;
  height: 2px;
  background: var(--accent);
  content: "";
}
.module-tabs b { color: var(--quiet); font-size: 10px; }

.loading-layout { padding-top: 16px; }
.skeleton {
  min-height: 86px;
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(255,255,255,.72), rgba(218,226,235,.4));
  animation: loading-breathe 1.4s ease-in-out infinite;
}
.skeleton-title { width: 46%; min-height: 34px; margin-bottom: 28px; }
.skeleton-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }

.detail-layout { display: grid; gap: 18px; }
.detail-layout.has-selection { grid-template-columns: minmax(0, 1fr); }
.pigeon-detail-active .pigeon-grid { display: none; }

.assessment-list { display: grid; gap: 8px; border-top: 1px solid var(--line); }
.assessment-row {
  width: 100%;
  min-height: 72px;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}
.assessment-thumbnail, .assessment-thumbnail img {
  width: 52px;
  height: 62px;
  border-radius: 6px;
  object-fit: cover;
  background: #e5eef6;
}
.assessment-copy strong, .assessment-copy small { display: block; }
.assessment-copy small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.assessment-score { text-align: right; }
.assessment-score strong { display: block; color: var(--accent-strong); font-size: 18px; }
.assessment-score small { color: var(--quiet); font-size: 8px; }

.knowledge-runtime {
  min-height: 58px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.knowledge-runtime strong, .knowledge-runtime small { display: block; }
.knowledge-runtime small { margin-top: 3px; color: var(--muted); font-size: 9px; }

.care-safety-strip {
  min-height: 62px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid #d9e4ed;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
}
.care-safety-strip > svg { width: 21px; height: 21px; margin-top: 1px; color: var(--accent-strong); }
.care-safety-strip strong,
.care-safety-strip small { display: block; }
.care-safety-strip strong { font-size: 12px; line-height: 1.45; }
.care-safety-strip small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.55; }

.reference-achievements { display: grid; gap: 8px; }
.reference-achievements > div {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.reference-achievements svg { width: 16px; height: 16px; color: var(--accent); }

.auth-gate[hidden] { display: none; }
.auth-gate {
  position: fixed;
  z-index: 100;
  inset: 0;
  min-height: var(--app-viewport-height);
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
  overflow: auto;
}
.auth-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(225, 231, 238, 0.66);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  backdrop-filter: blur(18px) saturate(130%);
}
.auth-panel {
  position: relative;
  width: min(100%, 450px);
  padding: 22px;
  border-radius: var(--radius);
}
.auth-brand { display: flex; align-items: center; gap: 11px; }
.auth-heading { margin: 28px 0 18px; }
.auth-heading h1 { margin: 4px 0 0; font-size: 27px; }
.auth-form, .auth-modes { width: 100%; display: grid; gap: 12px; margin-bottom: 16px; }
.auth-scan-link {
  min-height: 58px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding-top: 14px;
  color: inherit;
  text-decoration: none;
  border-top: 1px solid var(--line);
}
.auth-scan-link strong, .auth-scan-link small { display: block; }
.auth-scan-link small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.auth-code-field > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }

.voice-dialog { margin: auto 0 0; }
.voice-sheet {
  width: 100%;
  max-height: 92dvh;
  overflow: auto;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  border-radius: var(--radius) var(--radius) 0 0;
}
.voice-transcript {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.voice-input-heading, .voice-language-label, .voice-actions, .voice-sheet footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.voice-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.voice-tts-toggle { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 11px; }
.voice-capability, .status-copy { color: var(--muted); font-size: 11px; }

.gallery-viewport {
  position: relative;
  min-height: 0;
  overflow: hidden;
}
.gallery-image-transform {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transform-origin: center;
  transition: transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.gallery-image-transform > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.gallery-placeholder {
  width: 100%;
  height: 100%;
  min-height: 240px;
  display: grid;
  place-items: center;
  color: rgba(237, 241, 244, 0.72);
  background: #171b1f;
}
.exhibition .gallery-viewport { min-height: clamp(360px, 48vw, 540px); }
.exhibition.is-collapsed .gallery-viewport { min-height: 94px; }
.exhibition.is-collapsed .gallery-image-transform > img { height: 94px; opacity: .62; }

.native-eye-workspace { background: #fff; }
.native-eye-scroll { min-height: 0; }
.native-eye-workspace .eye-stage > .archive-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #6a9bc5;
  background: linear-gradient(180deg, #d7e2eb 0%, #aebdca 54%, #0d1b26 54%);
}
.native-eye-workspace .eye-stage > .archive-photo svg { width: 32px; height: 32px; }
.native-report-actions {
  position: static;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  padding: 8px;
  border-radius: var(--radius);
}
.native-report-actions > small {
  min-width: 0;
  margin-left: auto;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9px;
}
.native-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.native-feature-grid article {
  min-height: 64px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.native-feature-grid span, .native-feature-grid small { display: block; color: var(--muted); font-size: 9px; }
.native-feature-grid strong { display: block; margin: 4px 0; font-size: 12px; }
.native-feature-details {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.native-feature-details summary {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 2px;
  list-style: none;
  cursor: pointer;
}
.native-feature-details summary::-webkit-details-marker { display: none; }
.native-feature-details summary span { min-width: 0; }
.native-feature-details summary strong,
.native-feature-details summary small { display: block; }
.native-feature-details summary strong { font-size: 13px; }
.native-feature-details summary small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.native-feature-details summary > svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
  transition: transform 180ms ease;
}
.native-feature-details[open] summary > svg { transform: rotate(180deg); }
.native-feature-details .native-feature-grid { padding: 4px 0 14px; }

.media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.media-tile { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.media-tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.media-tile > span { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px; }
.media-tile-copy strong, .media-tile-copy small { display: block; }
.media-tile-copy small { margin-top: 3px; color: var(--muted); font-size: 9px; }

.coverage-matrix, .legacy-media-grid, .contact-ledger, .reference-code-ledger, .box-ledger, .data-list {
  border-top: 1px solid var(--line);
}

.section-kicker {
  display: block;
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 740;
  line-height: 1.25;
}
.toolbar-count {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  text-align: right;
}
.inline-actions {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.breeding-workspace,
.module-table-section { min-width: 0; }
.breeding-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 26px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.breeding-overview > div {
  min-width: 0;
  padding: 16px 18px;
  border-right: 1px solid var(--line);
}
.breeding-overview > div:last-child { border-right: 0; }
.breeding-overview small,
.breeding-overview strong { display: block; }
.breeding-overview small { color: var(--muted); font-size: 10px; }
.breeding-overview strong {
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 1.3;
}
.pair-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.pair-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.pair-card.is-selected { border-color: #91bde2; box-shadow: 0 0 0 3px var(--accent-soft); }
.pair-card > header {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.pair-card h3 {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.4;
}
.pair-members {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}
.pair-members .member {
  min-width: 0;
  padding: 10px;
  border-left: 3px solid #5594ca;
  border-radius: 5px;
  background: #f4f8fb;
}
.pair-members .member.is-hen { border-left-color: #b77c89; }
.pair-members small,
.pair-members strong { display: block; }
.pair-members small { color: var(--muted); font-size: 10px; }
.pair-members strong {
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.45;
}
.pair-card > .inline-actions { width: 100%; }
.row-title { min-width: 0; }
.row-title strong,
.row-title small { display: block; min-width: 0; }
.row-title strong { overflow-wrap: anywhere; font-size: 13px; line-height: 1.45; }
.row-title small {
  margin-top: 4px;
  color: var(--muted);
  overflow-wrap: anywhere;
  font-size: 10px;
  line-height: 1.5;
}
.box-row { grid-template-columns: 38px minmax(0, 1fr) auto; }
.box-row > span:first-child {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--accent-strong);
  border-radius: 7px;
  background: var(--accent-soft);
}
.box-row > span:first-child svg { width: 18px; height: 18px; }
.box-row strong,
.box-row small { display: block; }
.box-row strong { font-size: 12px; }
.box-row small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.coverage-row, .data-row, .contact-row, .reference-code-row, .box-row, .workflow-row, .audit-row {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}
.coverage-row { grid-template-columns: minmax(0, 1fr) auto 18px; }
.import-banner {
  min-height: 70px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  margin-bottom: 18px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.legacy-media-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding-top: 12px; }
.legacy-media { overflow: hidden; padding: 0; text-align: left; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.legacy-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.legacy-media span { display: block; padding: 8px; }
.speed-calculator, .calculator-form { display: grid; gap: 12px; }
.calculator-form { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; }
.speed-result { display: grid; gap: 4px; }
.speed-result strong { font-size: 28px; color: var(--accent-strong); }

.assistant-shell {
  z-index: 50;
}
.assistant-shell.is-collapsed {
  display: none;
}
.assistant-shell.is-expanded,
.assistant-panel.is-open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
  display: grid;
}
.assistant-msg {
  max-width: 88%;
  margin: 0 0 12px;
  padding: 11px 12px;
  border-radius: var(--radius);
  background: #eef6fd;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
}
.assistant-msg.user { margin-left: auto; color: #fff; background: var(--accent); }
.assistant-cards { padding: 0 14px 8px; display: flex; flex-direction: column; gap: 8px; }
.assistant-header-actions { display: contents; }

@keyframes nav-select { from { transform: scale(.92); } to { transform: scale(1); } }
@keyframes segment-select { from { opacity: .4; } to { opacity: 1; } }
@keyframes dialog-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes view-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes loading-breathe { 0%, 100% { opacity: .7; } 50% { opacity: 1; } }

@media (max-width: 1120px) {
  #main-content, #app-main { margin-left: var(--sidebar); }
}
@media (min-width: 821px) and (max-width: 1180px) {
  .pigeon-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .media-grid, .legacy-media-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .today-band, .dashboard-columns, .detail-columns, .eye-workspace,
  .breeding-layout, .operations-layout, .knowledge-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .knowledge-answer { padding-left: 0; border-left: 0; padding-top: 18px; border-top: 1px solid var(--line); }
  .page, #main-content, #app-main { min-width: 0; }
}
@media (min-width: 821px) and (max-width: 1120px) {
  .metrics-band { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 600px) and (max-width: 820px) {
  .pigeon-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .media-grid, .legacy-media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .archive-card {
    min-height: 122px;
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
  }
  .archive-card .archive-photo { width: 120px; height: 120px; aspect-ratio: auto; }
  .archive-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 12px;
  }
  .archive-copy strong { font-size: 15px; }
  .archive-copy small {
    overflow-wrap: anywhere;
    font-size: 12px;
    line-height: 1.45;
    text-overflow: clip;
    white-space: normal;
  }
  .sex-badge { font-size: 12px; }
  .archive-meta { flex-wrap: wrap; margin-top: 8px; }
  .archive-meta em { font-size: 11px; }
  .pair-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pair-card h3 { font-size: 14px; }
  .pair-members small { font-size: 11px; }
  .pair-members strong { font-size: 12px; }
}
@media (max-width: 820px) {
  #main-content, #app-main {
    margin-left: 0;
    padding: calc(var(--topbar) + env(safe-area-inset-top) + 20px) 14px calc(92px + env(safe-area-inset-bottom));
  }
  .assistant-shell.is-expanded {
    top: calc(var(--topbar) + env(safe-area-inset-top) + 8px);
    right: 8px;
    bottom: calc(84px + env(safe-area-inset-bottom));
    width: calc(100% - 16px);
  }
}
@media (max-width: 599px) {
  .page-header p { display: none; }
  .media-grid, .legacy-media-grid, .native-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calculator-form { grid-template-columns: minmax(0, 1fr); }
  .voice-fields { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width: 1024px) {
  .assistant-shell.is-expanded {
    top: calc(var(--topbar) + env(safe-area-inset-top) + 12px);
    right: 12px;
    bottom: 12px;
    width: var(--assistant-dock-width);
    max-height: none;
    transform: none;
    opacity: 1;
  }
  body.assistant-desktop-docked .topbar {
    right: calc(12px + var(--assistant-dock-width) + 16px) !important;
  }
  body.assistant-desktop-docked #main-content {
    padding-right: calc(22px + var(--assistant-dock-width) + 12px) !important;
  }
}

@media (min-width: 600px) and (max-width: 1023px) {
  .assistant-panel,
  .assistant-shell {
    right: 16px;
    bottom: max(88px, calc(76px + env(safe-area-inset-bottom)));
    width: min(460px, calc(100vw - 32px));
    height: min(720px, calc(100dvh - 116px));
  }
}

@media (max-width: 1023px) {
  .assistant-shell.is-expanded {
    left: 12px;
    right: 12px;
    width: auto;
    bottom: max(82px, calc(env(safe-area-inset-bottom, 0px) + 76px));
  }
}

button.disabled { opacity: .42; pointer-events: none; }


/* Native eye internals */
.native-eye-photo-stage {
  position: relative;
  min-height: 390px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #0d1b26;
}
.native-eye-photo-stage img { width: 100%; height: 100%; object-fit: cover; display: block; }
.native-eye-empty { color: #fff; text-align: center; }
.native-eye-empty strong, .native-eye-empty small { display: block; }
.native-eye-source-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.native-report-hero { display: grid; gap: 16px; }
.native-report-photo img { width: 100%; max-height: 280px; object-fit: cover; display: block; }
.native-personality-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.native-dimension-band { display: grid; gap: 10px; margin-top: 16px; }
.native-dimension { display: grid; grid-template-columns: minmax(0, 1fr) 40px; gap: 8px; align-items: center; }
.native-dimension i { display: block; height: 6px; background: #e5f0f9; border-radius: 3px; grid-column: 1 / -1; }
.native-dimension i em { display: block; height: 100%; background: var(--accent); }
.eye-workspace-toolbar {
  position: absolute;
  z-index: 3;
  top: 12px;
  right: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.eye-back-button { color: #fff; border-color: rgba(255,255,255,.42); background: rgba(10,27,40,.32); }

/* Pedigree explorer */
.pedigree-explorer {
  position: relative;
  height: calc(var(--app-viewport-height, 100dvh) - 44px);
  min-height: 800px;
  display: grid;
  grid-template-rows: 66px auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.pedigree-explorer.is-fullscreen, .pedigree-explorer:fullscreen {
  position: fixed; z-index: 90; inset: 0; width: 100%; height: 100dvh; min-height: 0; border: 0; border-radius: 0;
}
.pedigree-explorer-toolbar {
  z-index: 6; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px; border-width: 0 0 1px; border-radius: 0;
}
.pedigree-title { min-width: 0; display: grid; }
.pedigree-title span, .pedigree-title small { color: var(--muted); font-size: 9px; }
.pedigree-title strong { margin: 2px 0; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pedigree-history-actions { display: flex; gap: 2px; }
.pedigree-subtoolbar {
  z-index: 5; min-height: 58px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 7px 10px; border-bottom: 1px solid var(--line); background: #f8fbfe;
}
.pedigree-breadcrumb { min-width: 0; display: flex; align-items: center; overflow: hidden; }
.pedigree-breadcrumb button {
  min-width: 0; max-width: 150px; height: 36px; padding: 0 7px; color: var(--muted); border: 0; background: transparent; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px;
}
.pedigree-breadcrumb button:last-of-type { color: var(--ink); font-weight: 720; }
.kinship-counts { display: flex; gap: 4px; }
.kinship-counts span { min-height: 28px; display: inline-flex; align-items: center; gap: 4px; padding: 5px 7px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; font-size: 9px; white-space: nowrap; }
.kinship-counts span.is-complete { color: var(--success); border-color: rgba(33, 131, 91, .28); background: rgba(33, 131, 91, .07); }
.kinship-counts svg { width: 13px; height: 13px; }
.pedigree-explorer-body { min-height: 0; position: relative; display: grid; grid-template-rows: minmax(0, 1fr); }
.pedigree-explorer-body.has-integrity-warning { grid-template-rows: auto minmax(0, 1fr); }
.pedigree-integrity-warning {
  z-index: 8; display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: center; gap: 8px; padding: 8px 12px; color: #642f2b; border-bottom: 1px solid rgba(151, 66, 55, 0.26); background: rgba(255, 246, 242, 0.88);
}
.pedigree-loading { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 14px; color: var(--muted); }
.pedigree-loading span { width: 110px; height: 72px; border: 1px solid rgba(8, 109, 207, 0.18); background: rgba(255,255,255,.48); animation: loading-breathe 1.4s ease-in-out infinite; }
.kinship-canvas {
  position: relative; width: 100%; height: 100%; min-width: 0; min-height: 0; overflow: hidden;
  background-color: #fff; background-image: linear-gradient(#edf5fb 1px, transparent 1px), linear-gradient(90deg,#edf5fb 1px,transparent 1px); background-size: 28px 28px;
  cursor: grab; touch-action: none; user-select: none;
}
.kinship-canvas.is-panning { cursor: grabbing; }
.kinship-stage { position: absolute; top: 0; left: 0; transform-origin: 0 0; will-change: transform; }
.kinship-edges { position: absolute; inset: 0; overflow: visible; }
.kinship-edge path { fill: none; stroke: #a9c7e1; stroke-width: 1.25; }
.kinship-edge text { fill: #5f6872; paint-order: stroke; stroke: #fff; stroke-width: 5px; font-size: 9px; font-weight: 720; text-anchor: middle; }
.kinship-edge.is-mate path { stroke: rgba(8, 109, 207, 0.68); stroke-width: 1.8; }
.kinship-edge.is-historical path { stroke: rgba(85, 94, 104, 0.34); stroke-dasharray: 6 5; }
.kinship-node {
  position: absolute; z-index: 2; display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 8px; overflow: hidden; padding: 7px;
  color: var(--ink); border: 1px solid #cfe1f0; border-radius: var(--radius); background: rgba(255,255,255,.95); box-shadow: 0 9px 20px rgba(24,81,125,.08);
  text-align: left; cursor: pointer;
}
.kinship-node.is-focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 11px 26px rgba(24,81,125,.12); }
.kinship-node.is-selected, .kinship-node:hover { z-index: 4; border-color: var(--accent); }
.kinship-node.is-missing { color: var(--muted); border: 1px dashed var(--line-strong); background: #f4f7fa; box-shadow: none; cursor: default; }
.kinship-node.is-cycle { border-color: rgba(151, 66, 55, 0.72); background: rgba(255, 248, 245, 0.94); }
.kinship-node-media, .kinship-selection-photo { width: 48px; height: 58px; display: grid; place-items: center; overflow: hidden; border-radius: 5px; background: #dde3e8; }
.kinship-node-media img, .kinship-selection-photo img { width: 100%; height: 100%; display: block; object-fit: cover; }
.pedigree-node-placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: #53616e; background: #dde3e8; }
.kinship-node-copy { min-width: 0; display: grid; }
.kinship-node-copy small, .kinship-node-copy strong, .kinship-node-copy em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kinship-node-copy small { color: var(--accent-strong); font-size: 8px; }
.kinship-node-copy strong { margin: 4px 0 3px; font-size: 12px; }
.kinship-node-copy em { color: var(--muted); font-size: 8px; font-style: normal; }
.repeat-mark { position: absolute; top: 5px; right: 5px; width: 12px; height: 12px; color: var(--accent); }
.cycle-mark { position: absolute; top: 4px; right: 4px; height: 18px; display: inline-flex; align-items: center; gap: 2px; padding: 0 4px; color: #8a332b; border-radius: 4px; background: rgba(255,246,242,.92); font-size: 8px; }
.kinship-map-controls { position: absolute; z-index: 6; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 1px; padding: 4px; border-radius: 7px; }
.map-scale { width: 52px; height: 40px; border: 0; background: transparent; font-size: 10px; }
.pedigree-expand-depth { position: absolute; z-index: 7; left: 12px; bottom: 12px; }
.kinship-selection { position: absolute; z-index: 8; right: 12px; top: 12px; min-width: 280px; display: grid; grid-template-columns: 48px minmax(0,1fr) auto auto 38px; align-items: center; gap: 8px; padding: 8px; }
.kinship-selection span, .kinship-selection small { display: block; color: var(--muted); font-size: 9px; }
.kinship-selection strong { display: block; font-size: 12px; }

.mic-button {
  color: var(--accent-strong);
  background: rgba(229, 240, 252, 0.56);
}

.page-header {
  min-height: 58px;
}

.archive-photo { display: grid; place-items: center; }
.archive-photo svg { width: 28px; height: 28px; color: var(--accent); }
label.source-option { cursor: pointer; }
.account-content { overflow: auto; max-height: min(68vh, 640px); display: grid; gap: 16px; }
.native-progress-track { width: min(240px, 100%); height: 6px; margin: 16px auto 0; overflow: hidden; border-radius: 99px; background: #e5f0f9; }
.native-progress-track > i { display: block; height: 100%; background: var(--accent); }
.processing-ring { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto; color: var(--accent-strong); border-radius: 50%; background: var(--accent-soft); }
.voice-hud {
  position: fixed;
  z-index: 80;
  right: 18px;
  bottom: calc(96px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 999px;
}
.eye-controls .native-eye-error { margin: auto; text-align: center; }
.spotlight .archive-photo { min-height: 220px; width: 100%; }
.pigeon-card svg { width: 28px; height: 28px; margin: 24px auto; color: var(--accent); display: block; }

/* Photo exhibition: controls stay outside the image except the compact fold control. */
.photo-exhibition {
  position: relative;
}
.gallery-collapsed-bar {
  display: none;
  min-height: 60px;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border: 0;
  border-radius: 0;
}
.photo-exhibition.is-collapsed .gallery-collapsed-bar {
  display: flex;
}
.photo-exhibition.is-collapsed .gallery-stage {
  display: none;
}
.gallery-collapsed-current {
  min-width: 0;
  min-height: var(--tap);
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 10px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbfe;
  font-size: 12px;
  font-weight: 680;
}
.gallery-collapsed-current small {
  color: var(--muted);
  font-size: 10px;
}
.gallery-stage {
  position: relative;
  min-width: 0;
}
.gallery-stage-head {
  position: absolute;
  z-index: 5;
  top: 12px;
  right: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}
.gallery-collapse-button {
  min-width: var(--tap);
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--radius);
  background: rgba(18, 32, 44, 0.58);
  box-shadow: 0 5px 18px rgba(8, 20, 31, 0.14);
  backdrop-filter: blur(18px) saturate(130%);
  font-size: 11px;
  font-weight: 680;
  pointer-events: auto;
}
.gallery-collapse-button svg {
  width: 17px;
  height: 17px;
}
.gallery-caption {
  position: static;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: var(--radius);
  background: rgba(18, 32, 44, 0.5);
  backdrop-filter: blur(18px) saturate(130%);
  font-size: 10px;
}
.gallery-caption small {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 9px;
}
.gallery-viewport {
  height: clamp(360px, 42vw, 520px);
  min-height: 360px;
  background: #171b1f;
  touch-action: pan-y;
}
.gallery-placeholder {
  min-height: 100%;
  align-content: center;
  gap: 10px;
}
.gallery-placeholder strong,
.gallery-placeholder small {
  display: block;
}
.gallery-placeholder small {
  font-size: 9px;
  letter-spacing: 0;
}
.gallery-outline {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
}
.gallery-outline svg {
  width: 30px;
  height: 30px;
}
.gallery-eye-inset {
  position: absolute;
  z-index: 4;
  right: 14px;
  bottom: 14px;
  width: 104px;
  height: 78px;
  overflow: hidden;
  padding: 0;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius);
  background: rgba(18, 32, 44, 0.62);
  box-shadow: 0 8px 24px rgba(5, 16, 25, 0.2);
}
.gallery-eye-inset > img,
.gallery-eye-inset > .gallery-placeholder {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
}
.gallery-eye-inset .gallery-placeholder strong,
.gallery-eye-inset .gallery-placeholder small {
  display: none;
}
.gallery-eye-inset .gallery-outline {
  width: 100%;
  height: 100%;
}
.gallery-eye-inset .gallery-outline svg {
  width: 24px;
  height: 24px;
}
.gallery-eye-inset > span:last-child {
  position: absolute;
  right: 5px;
  bottom: 5px;
  padding: 2px 4px;
  border-radius: 3px;
  background: rgba(18, 32, 44, 0.68);
  font-size: 8px;
}
.gallery-index {
  position: absolute;
  z-index: 3;
  bottom: 15px;
  left: 50%;
  display: flex;
  gap: 5px;
  transform: translateX(-50%);
}
.gallery-index i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.46);
}
.gallery-index i.is-active {
  width: 16px;
  border-radius: 3px;
  background: #fff;
}
.gallery-controls {
  min-height: 68px;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-width: 1px 0 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.86);
}
.gallery-navigation,
.gallery-zoom-controls,
.gallery-primary-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}
.gallery-navigation > span {
  min-width: 42px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}
.gallery-zoom-value {
  min-width: 58px;
  min-height: var(--tap);
  padding: 0 8px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbfe;
  font-size: 11px;
}
.gallery-primary-actions {
  justify-content: flex-end;
}
.detail-tabs button {
  min-width: var(--tap);
}

@media (max-width: 599px) {
  .gallery-stage-head {
    top: 8px;
    right: 8px;
    left: 8px;
  }
  .gallery-collapse-button span,
  .gallery-caption small {
    display: none;
  }
  .gallery-collapse-button {
    width: var(--tap);
    padding: 0;
    justify-content: center;
  }
  .gallery-caption {
    min-height: var(--tap);
    padding: 0 10px;
  }
  .gallery-viewport {
    height: min(38dvh, 310px);
    min-height: 250px;
  }
  .gallery-eye-inset {
    right: 10px;
    bottom: 10px;
    width: 84px;
    height: 64px;
  }
  .gallery-controls {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 8px;
  }
  .gallery-navigation {
    justify-self: start;
  }
  .gallery-zoom-controls {
    justify-self: end;
  }
  .gallery-primary-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

/* Phone layout is a compact native work surface, not a scaled-down desktop. */
@media (max-width: 599px) {
  body { font-size: 14px; }
  #main-content, #app-main {
    padding: calc(var(--topbar) + env(safe-area-inset-top) + 14px) 12px
      calc(90px + env(safe-area-inset-bottom));
  }
  .page-header {
    min-height: 48px;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
  }
  .page-header h1 { font-size: 25px; line-height: 1.18; }
  .page-actions { flex: 0 0 auto; gap: 6px; }
  .primary-button,
  .secondary-button,
  .text-button { font-size: 13px; }
  .brand-copy strong { font-size: 16px; }
  .mobile-nav-item span,
  .mobile-nav-item small { font-size: 11px; }

  .today-band { margin-inline: -12px; }
  .spotlight {
    grid-template-columns: 38% minmax(0, 1fr);
    grid-template-rows: 132px;
  }
  .spotlight img { height: 132px; }
  .spotlight-copy small { font-size: 11px; }
  .spotlight-copy strong { font-size: 18px; }
  .spotlight-copy span { font-size: 12px; line-height: 1.4; white-space: normal; }
  .today-agenda { min-height: 0; padding: 16px 14px; }
  .today-agenda h2 { font-size: 20px; }
  .today-agenda > header span { font-size: 12px; }
  .agenda-list { margin-top: 10px; }
  .agenda-row { min-height: 60px; }
  .agenda-row strong { font-size: 13px; }
  .agenda-row small,
  .agenda-row > span:last-child { font-size: 11px; }
  .metrics-band { margin: 14px 0 20px; }
  .metric { min-height: 84px; padding: 13px 12px; }
  .metric small,
  .metric span { font-size: 11px; }
  .metric strong { margin-block: 4px; font-size: 22px; }

  .filter-toolbar { gap: 8px; margin-bottom: 12px; }
  .search-field input { font-size: 14px; }
  .segmented button { padding-inline: 11px; font-size: 12px; }
  .toolbar-count { font-size: 12px; }
  .pigeon-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .archive-card {
    min-height: 106px;
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    align-items: stretch;
  }
  .archive-card .archive-photo { width: 104px; height: 104px; aspect-ratio: auto; }
  .archive-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 12px 13px;
  }
  .archive-copy strong { font-size: 16px; line-height: 1.3; }
  .sex-badge { font-size: 12px; }
  .archive-copy small {
    margin-top: 6px;
    overflow-wrap: anywhere;
    font-size: 12px;
    line-height: 1.4;
    text-overflow: clip;
    white-space: normal;
  }
  .archive-meta { flex-wrap: wrap; margin-top: 8px; }
  .archive-meta em { padding: 3px 6px; font-size: 11px; }
  .archive-meta em:nth-child(2) { display: inline-flex; }
  .photo-badge { top: 6px; left: 6px; font-size: 10px; }

  .detail-header { gap: 9px; margin-bottom: 12px; }
  .detail-header h1 { font-size: 24px; line-height: 1.2; }
  .detail-header p { font-size: 12px; overflow-wrap: anywhere; }
  .photo-exhibition { margin-inline: -12px; }
  .gallery-controls { min-height: 60px; }
  .gallery-primary-actions { flex-wrap: wrap; }
  .detail-tabs { gap: 16px; margin-top: 14px; }
  .detail-tabs button { font-size: 13px; }
  .detail-body { padding-top: 16px; }
  .attribute-row { min-height: 56px; grid-template-columns: 88px minmax(0, 1fr); gap: 12px; }
  .attribute-row span { font-size: 12px; }
  .attribute-row strong { overflow-wrap: anywhere; font-size: 14px; line-height: 1.45; }
  .detail-action strong { font-size: 13px; }
  .detail-action small { font-size: 11px; line-height: 1.45; }

  .module-tabs { margin: 0 0 16px; }
  .module-tabs button { padding-inline: 11px; font-size: 13px; }
  .module-tabs b { font-size: 11px; }
  .section-heading { align-items: flex-start; margin-bottom: 11px; }
  .section-heading h2 { font-size: 19px; }
  .section-kicker { font-size: 11px; }
  .section-heading .toolbar-count { max-width: 48%; }
  .breeding-workspace > .section-heading,
  .module-table-section > .section-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 4px;
  }
  .breeding-workspace > .section-heading .toolbar-count,
  .module-table-section > .section-heading .toolbar-count {
    max-width: none;
    text-align: left;
  }
  .module-table-section > .section-heading > .primary-button { align-self: flex-start; margin-top: 5px; }
  .breeding-overview { margin-bottom: 20px; }
  .breeding-overview > div { padding: 12px 8px; }
  .breeding-overview small { min-height: 34px; font-size: 11px; line-height: 1.45; }
  .breeding-overview strong { margin-top: 3px; font-size: 17px; }
  .pair-strip { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .pair-card { padding: 13px; }
  .pair-card h3 { font-size: 15px; }
  .pair-members { margin: 12px 0; }
  .pair-members small { font-size: 11px; }
  .pair-members strong { font-size: 13px; }
  .data-list { border-top: 0; }
  .data-row {
    min-height: 76px;
    align-items: center;
    gap: 8px;
    padding: 11px 0;
  }
  .row-title strong { font-size: 14px; }
  .row-title small { font-size: 12px; }
  .data-row .inline-actions { flex-wrap: wrap; }
  .status-badge { font-size: 11px; }
  .box-row { min-height: 68px; }
  .box-row strong { font-size: 14px; }
  .box-row small { font-size: 12px; }

  .record-table { overflow: visible; border-top: 0; }
  .record-table-head { display: none; }
  .record-table-row {
    min-width: 0;
    min-height: 82px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 12px;
    padding: 12px 0;
    font-size: 12px;
    line-height: 1.45;
  }
  .record-table-row > span { min-width: 0; overflow-wrap: anywhere; }
  .record-table-row > span:first-child { grid-column: 1 / -1; }
  .record-table-row strong { font-size: 14px; }
  .record-table-row small,
  .record-table-row time { font-size: 11px; }
  .record-table-row > span:not(:first-child)::before {
    display: block;
    margin-bottom: 2px;
    color: var(--quiet);
    font-size: 10px;
    font-weight: 650;
  }
  .compact-table .record-table-row > span:nth-child(2)::before { content: "放飞地"; }
  .compact-table .record-table-row > span:nth-child(3)::before { content: "距离"; }
  .compact-table .record-table-row > span:nth-child(4)::before { content: "成绩"; }
  .results-ledger .record-table-row > span:nth-child(2)::before { content: "赛事"; }
  .results-ledger .record-table-row > span:nth-child(3)::before { content: "名次"; }
  .results-ledger .record-table-row > span:nth-child(4)::before { content: "分速"; }
  .reminders-table .record-table-row > span:nth-child(2)::before { content: "时间"; }
  .reminders-table .record-table-row > span:nth-child(3)::before { content: "状态"; }
  .reminders-table .record-table-row > span:nth-child(4)::before { content: "备注"; }
  .release-table .record-table-row > span:nth-child(2)::before { content: "省份"; }
  .release-table .record-table-row > span:nth-child(3)::before { content: "代码"; }
  .release-table .record-table-row > span:nth-child(4)::before { content: "坐标"; }
  .health-ledger .record-table-row > span:nth-child(2)::before { content: "时间"; }
  .health-ledger .record-table-row > span:nth-child(3)::before { content: "症状"; }
  .health-ledger .record-table-row > span:nth-child(4)::before { content: "处理"; }
  .care-safety-strip { margin-bottom: 14px; }
  .care-safety-strip strong { font-size: 13px; }
  .care-safety-strip small { font-size: 11px; }

  .eye-controls,
  .eye-report { padding: 20px 14px; }
  .eye-stage-copy span,
  .processing-view p,
  .report-copy p { font-size: 12px; }
  .source-option small,
  .native-feature-grid span,
  .native-feature-grid small,
  .native-report-actions > small { font-size: 11px; }
  .dimension-row span,
  .dimension-row b,
  .report-tags span { font-size: 11px; }

  .knowledge-layout { gap: 22px; }
  .knowledge-compose { min-height: 0; }
  .knowledge-runtime small { font-size: 11px; line-height: 1.45; }
  .knowledge-form {
    display: grid;
    gap: 8px;
    margin-top: 14px;
  }
  .knowledge-form label { font-size: 13px; font-weight: 680; }
  .knowledge-form textarea { min-height: 132px; font-size: 16px; }
  .knowledge-form .primary-button { margin-top: 2px; }
  #knowledge-answer .empty-state { min-height: 210px; }

  .kinship-node-copy strong { font-size: 11px; }
  .kinship-node-copy small,
  .kinship-node-copy em { font-size: 10px; }
  .kinship-counts span { font-size: 10px; }

  .more-grid span { font-size: 12px; }
  .more-surface > header strong { font-size: 18px; }
  .assistant-head strong { font-size: 14px; }
  .assistant-head small { font-size: 11px; }
  .assistant-msg,
  .assistant-bubble p { overflow-wrap: anywhere; font-size: 14px; line-height: 1.55; }
}

:root { --assistant-dock-width: 380px; }

/* 2026-08-15 production UX audit: one responsive system for all work surfaces. */
:root {
  --page: #e8ecef;
  --surface: #fbfcfd;
  --surface-soft: #f2f5f7;
  --ink: #17212a;
  --muted: #64717d;
  --quiet: #87939e;
  --line: #d8e0e6;
  --line-strong: #bcc8d1;
  --accent: #096fce;
  --accent-strong: #075ba8;
  --accent-soft: #e7f1fa;
  --assistant-dock-width: 460px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { letter-spacing: 0 !important; }

body {
  background:
    linear-gradient(180deg, #eef1f3 0, #e7ebee 240px, #e8ecef 100%);
  font-family: inherit;
}

button,
input,
select,
textarea { font-family: inherit; }

.glass {
  border-color: rgba(255, 255, 255, 0.78);
  background: rgba(250, 252, 253, 0.76);
  box-shadow: 0 14px 36px rgba(43, 57, 68, 0.09);
  -webkit-backdrop-filter: blur(26px) saturate(125%);
  backdrop-filter: blur(26px) saturate(125%);
}

.section-heading h2,
.section-heading h3 { letter-spacing: 0; }

.section-heading > div > small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.section-kicker { display: none; }

/* Breeding cards expose a real archive and keep commands distinct. */
.pair-card {
  position: relative;
  display: flex;
  min-height: 218px;
  flex-direction: column;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.pair-card:hover,
.pair-card:focus-visible {
  border-color: #9eb7ca;
  box-shadow: 0 8px 22px rgba(56, 76, 91, 0.08);
}

.pair-card > .inline-actions {
  margin-top: auto;
  justify-content: flex-start;
}

.pair-card > .inline-actions .pair-open-button {
  margin-left: auto;
  color: var(--accent-strong);
}

.pair-open-button svg { width: 16px; height: 16px; }

.pair-archive-sheet { display: grid; gap: 18px; }
.pair-archive-sheet > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.pair-archive-sheet h3 { margin: 5px 0 0; font-size: 20px; line-height: 1.35; }
.pair-archive-sheet header small { color: var(--muted); font-size: 12px; }
.pair-archive-members { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pair-archive-members button {
  min-width: 0;
  min-height: 78px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  gap: 5px 8px;
  padding: 12px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}
.pair-archive-members small,
.pair-archive-members strong { display: block; grid-column: 1; }
.pair-archive-members small { color: var(--muted); font-size: 11px; }
.pair-archive-members strong { overflow-wrap: anywhere; font-size: 14px; line-height: 1.4; }
.pair-archive-members svg { grid-column: 2; grid-row: 1 / 3; width: 16px; height: 16px; color: var(--muted); }
.pair-archive-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-block: 1px solid var(--line);
}
.pair-archive-stats span { padding: 14px 10px; text-align: center; border-right: 1px solid var(--line); }
.pair-archive-stats span:last-child { border-right: 0; }
.pair-archive-stats strong,
.pair-archive-stats small { display: block; }
.pair-archive-stats strong { font-size: 21px; }
.pair-archive-stats small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.pair-archive-timeline { border-top: 1px solid var(--line); }
.pair-archive-timeline > button {
  width: 100%;
  min-height: 62px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}
.pair-archive-timeline strong,
.pair-archive-timeline small { display: block; }
.pair-archive-timeline small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.pair-archive-timeline em { color: var(--accent-strong); font-size: 11px; font-style: normal; }
.pair-archive-timeline svg { width: 16px; height: 16px; color: var(--quiet); }

/* Daily ledger: dense, readable and purpose-built for touch. */
.operations-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(300px, .94fr);
  gap: 28px 36px;
}

.operations-agenda,
.operations-directory,
.operations-recent { min-width: 0; }

.operations-recent { grid-column: 1 / -1; }

.operations-command-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.operations-command {
  min-width: 0;
  min-height: 82px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 11px;
  padding: 12px 10px 12px 0;
  text-align: left;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
}
.operations-command:nth-child(even) { padding-left: 12px; border-right: 0; }
.command-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--accent-strong);
  border-radius: 7px;
  background: #e8f0f6;
}
.command-icon svg { width: 18px; height: 18px; }
.operations-command div { min-width: 0; }
.operations-command strong,
.operations-command small { display: block; }
.operations-command strong { font-size: 14px; line-height: 1.35; }
.operations-command small { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.command-chevron { width: 16px; height: 16px; color: var(--quiet); }

.diary-ledger { border-top: 1px solid var(--line); }
.diary-row {
  min-width: 0;
  min-height: 76px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.diary-date {
  min-width: 0;
  display: grid;
  align-content: center;
  align-self: stretch;
  padding-right: 12px;
  border-right: 1px solid var(--line);
}
.diary-date strong,
.diary-date small { display: block; }
.diary-date strong { font-size: 22px; font-weight: 720; line-height: 1; }
.diary-date small { margin-top: 6px; color: var(--muted); font-size: 10px; }
.diary-copy { min-width: 0; }
.diary-copy > strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.5;
}
.diary-copy > span {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}
.diary-copy svg { width: 13px; height: 13px; }
.diary-full-date { color: var(--muted); font-size: 11px; white-space: nowrap; }

.contact-ledger { border-top: 1px solid var(--line); }
.contact-row {
  min-height: 86px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px 0;
}
.contact-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--accent-strong);
  border: 1px solid #d3e2ee;
  border-radius: 50%;
  background: #e8f1f8;
  font-size: 15px;
  font-weight: 720;
}
.contact-identity { min-width: 0; }
.contact-identity strong,
.contact-identity small,
.contact-identity span { display: block; }
.contact-identity strong { font-size: 15px; line-height: 1.35; }
.contact-identity small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.contact-identity span { margin-top: 6px; color: var(--muted); font-size: 11px; }
.contact-identity span svg { width: 12px; height: 12px; margin-right: 4px; vertical-align: -2px; }
.contact-actions { display: flex; gap: 6px; }
.contact-actions .icon-button { width: 38px; height: 38px; }
.contact-phone { grid-column: 2; color: var(--muted); font-size: 11px; }

/* Migration and coverage use compact facts instead of giant dashboard tiles. */
.coverage-section { min-width: 0; }
.resource-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 4px 0 30px;
  border-block: 1px solid var(--line);
}
.resource-summary {
  min-width: 0;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  padding: 17px 14px;
  border-right: 1px solid var(--line);
}
.resource-summary:last-child { border-right: 0; }
.resource-summary > span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--accent-strong);
  border-radius: 7px;
  background: #e7eff5;
}
.resource-summary.is-warning > span { color: #8b5f16; background: #f5eddc; }
.resource-summary svg { width: 16px; height: 16px; }
.resource-summary div { min-width: 0; }
.resource-summary strong,
.resource-summary b,
.resource-summary small { display: block; }
.resource-summary strong { font-size: 22px; line-height: 1; }
.resource-summary b { margin-top: 6px; font-size: 13px; }
.resource-summary small { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.coverage-heading { margin-top: 0; }
.coverage-row {
  min-height: 68px;
  grid-template-columns: minmax(0, 1fr) auto 18px;
  gap: 12px;
  padding: 10px 0;
}
.coverage-row strong,
.coverage-row small { display: block; }
.coverage-row strong { font-size: 14px; }
.coverage-row small { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.coverage-row em {
  padding: 4px 7px;
  color: var(--accent-strong);
  border-radius: 5px;
  background: var(--accent-soft);
  font-size: 10px;
  font-style: normal;
  white-space: nowrap;
}
.coverage-row > svg { width: 16px; height: 16px; color: var(--quiet); }

/* Account center: one scroll surface, explicit sections and native controls. */
.account-dialog { width: min(720px, calc(100% - 28px)); }
.account-surface {
  max-height: min(88dvh, 820px);
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(255,255,255,.88);
  background: rgba(249, 251, 252, .94);
}
.account-surface > header { padding: 20px 22px 8px; }
.account-identity {
  grid-template-columns: 46px minmax(0, 1fr);
  margin: 0;
  padding: 8px 22px 16px;
}
.account-identity .large-avatar { width: 46px; height: 46px; font-size: 16px; }
.account-identity strong { font-size: 14px; overflow-wrap: anywhere; }
.account-identity small { font-size: 11px; }
.account-tabs {
  gap: 24px;
  margin: 0;
  padding: 0 22px;
  background: rgba(249,251,252,.86);
}
.account-tabs button { min-height: 48px; font-size: 12px; }
.account-content {
  min-height: 0;
  max-height: none;
  display: block;
  overflow: auto;
  padding: 18px 22px calc(22px + env(safe-area-inset-bottom));
  overscroll-behavior: contain;
}
.account-section {
  min-width: 0;
  padding: 0 0 24px;
  border-bottom: 1px solid var(--line);
}
.account-section + .account-section { padding-top: 24px; }
.account-section .section-heading { margin-bottom: 14px; }
.account-section .section-heading h3 { margin: 0; font-size: 17px; }
.account-switcher {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}
.select-control {
  min-width: 0;
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0,1fr) 18px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
}
.select-control select {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 0 12px;
  border: 0;
  outline: 0;
  appearance: none;
  background: transparent;
  font-size: 14px;
}
.select-control > svg { width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.member-strip { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.member-strip span { padding: 5px 7px; color: var(--muted); border-radius: 5px; background: var(--surface-soft); font-size: 10px; }
.account-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}
.compact-form,
.form-grid { min-width: 0; }
.compact-form { display: grid; align-content: start; gap: 12px; }
.compact-form .section-heading { margin-bottom: 2px; }
.compact-form .field { display: grid; gap: 7px; }
.compact-form .secondary-button { justify-self: start; }
.field label { font-size: 12px; font-weight: 680; }
.field input,
.field textarea {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 11px 12px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  font-size: 16px;
}
.field input::placeholder,
.field textarea::placeholder { color: #7f8992; }
.account-footer {
  position: static;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.workflow-list,
.audit-list { border-top: 1px solid var(--line); }
.workflow-row {
  min-height: 76px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 11px 0;
}
.workflow-copy { min-width: 0; }
.workflow-copy strong,
.workflow-copy small { display: block; }
.workflow-copy strong { overflow-wrap: anywhere; font-size: 13px; }
.workflow-copy small { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.workflow-state {
  padding: 4px 7px;
  color: var(--accent-strong);
  border-radius: 5px;
  background: var(--accent-soft);
  font-size: 10px;
  white-space: nowrap;
}
.row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.audit-row {
  min-height: 72px;
  grid-template-columns: 34px minmax(0, 1fr) auto 38px;
  padding: 10px 0;
}
.audit-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--accent-strong);
  border-radius: 7px;
  background: var(--accent-soft);
}
.audit-icon svg { width: 15px; height: 15px; }
.audit-copy { min-width: 0; }
.audit-copy strong,
.audit-copy small { display: block; }
.audit-copy strong { overflow-wrap: anywhere; font-size: 13px; line-height: 1.4; }
.audit-copy small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.audit-row > time { color: var(--muted); font-size: 10px; white-space: nowrap; }
.audit-row > .icon-button { width: 36px; height: 36px; }

/* System status is a list of independent health facts, never glued text. */
.system-status-panel { display: grid; gap: 0; border-top: 1px solid var(--line); }
.system-fact {
  min-height: 72px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.system-fact > span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--surface-soft);
}
.system-fact > span.is-ok { color: var(--success); background: #e8f3ee; }
.system-fact > span.is-warning { color: var(--warning); background: #f6efe3; }
.system-fact svg { width: 18px; height: 18px; }
.system-fact small,
.system-fact strong { display: block; }
.system-fact small { color: var(--muted); font-size: 11px; }
.system-fact strong { margin-top: 4px; overflow-wrap: anywhere; font-size: 14px; line-height: 1.4; }

/* Assistant: one thread scroll area, safe full-screen phone surface. */
.assistant-panel,
.assistant-shell {
  position: fixed;
  z-index: 70;
  right: 12px;
  bottom: 12px;
  width: var(--assistant-dock-width);
  height: min(760px, calc(100dvh - 24px));
  max-height: none;
  display: none;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.88);
  border-radius: var(--radius);
  background: rgba(249,251,252,.94);
  box-shadow: 0 20px 52px rgba(31,45,56,.18);
  -webkit-backdrop-filter: blur(28px) saturate(125%);
  backdrop-filter: blur(28px) saturate(125%);
}
.assistant-shell.is-expanded,
.assistant-panel.is-open { display: grid; }
.assistant-head {
  min-height: 70px;
  grid-template-columns: 44px minmax(0, 1fr) 44px 44px 44px;
  padding: 10px 12px;
  background: rgba(250,252,253,.84);
}
.assistant-head button,
.assistant-header button {
  min-width: 44px;
  min-height: 44px;
}
.assistant-body {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}
.assistant-thread {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.assistant-messages {
  max-height: none;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 14px 8px;
}
.assistant-cards {
  max-height: none;
  overflow: visible;
  padding: 0 14px 18px;
}
.assistant-msg,
.assistant-bubble {
  max-width: 88%;
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #edf2f5;
  font-size: 14px;
  line-height: 1.6;
  white-space: normal;
  overflow-wrap: anywhere;
}
.assistant-msg.user,
.assistant-bubble.is-user { align-self: flex-end; margin-left: auto; color: #fff; background: var(--accent); }
.assistant-msg p { margin: 0 0 8px; }
.assistant-msg p:last-child { margin-bottom: 0; }
.assistant-msg h1,
.assistant-msg h2,
.assistant-msg h3,
.assistant-msg h4 { margin: 3px 0 9px; font-size: 16px; line-height: 1.4; }
.assistant-msg ul,
.assistant-msg ol { margin: 7px 0; padding-left: 22px; }
.assistant-msg li + li { margin-top: 4px; }
.assistant-msg code {
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(23,33,42,.08);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: .9em;
}
.assistant-msg pre {
  max-width: 100%;
  overflow: auto;
  margin: 8px 0;
  padding: 10px;
  border-radius: 6px;
  background: #17212a;
  color: #f4f7f9;
}
.assistant-msg pre code { padding: 0; background: transparent; color: inherit; }
.assistant-msg blockquote { margin: 8px 0; padding-left: 10px; color: var(--muted); border-left: 3px solid #a8bdcc; }
.assistant-msg a { color: var(--accent-strong); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.assistant-msg.user a { color: #fff; }
.assistant-activity {
  max-width: 92%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.76);
}
.assistant-activity > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}
.assistant-activity-pulse {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border: 2px solid #8eb6d5;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: assistant-spin 800ms linear infinite;
}
.assistant-activity-copy strong,
.assistant-activity-copy small { display: block; }
.assistant-activity-copy strong { font-size: 12px; }
.assistant-activity-copy small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.assistant-activity-steps { display: grid; gap: 7px; margin-top: 9px; }
.assistant-activity-steps:empty { display: none; }
.assistant-activity-steps > span {
  display: grid;
  grid-template-columns: 18px minmax(0,1fr);
  align-items: start;
  gap: 7px;
}
.assistant-activity-steps > span > svg { width: 16px; height: 16px; color: var(--success); }
.assistant-activity-steps strong,
.assistant-activity-steps small { display: block; }
.assistant-activity-steps strong { font-size: 11px; }
.assistant-activity-steps small { margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.assistant-execution-receipt {
  max-width: 92%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.7);
}
.assistant-execution-receipt > summary {
  min-height: 42px;
  display: grid;
  grid-template-columns: 18px minmax(0,1fr) 16px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  cursor: pointer;
  list-style: none;
}
.assistant-execution-receipt > summary::-webkit-details-marker { display: none; }
.assistant-execution-receipt > summary > svg:first-child { width: 16px; height: 16px; color: var(--success); }
.assistant-execution-receipt > summary > svg:last-child { width: 15px; height: 15px; color: var(--muted); transition: transform 160ms ease; }
.assistant-execution-receipt[open] > summary > svg:last-child { transform: rotate(180deg); }
.assistant-execution-receipt > summary strong { font-size: 11px; }
.assistant-execution-receipt > .assistant-activity-steps { margin: 0; padding: 0 10px 10px 36px; }
.assistant-execution-receipt.is-failed > summary > svg:first-child { color: var(--danger); }
@keyframes assistant-spin { to { transform: rotate(360deg); } }

.assistant-thread.is-history .assistant-messages { display: none; }
.assistant-history-list { padding-top: 0; }
.assistant-history-heading {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 0 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(249,251,252,.96);
}
.assistant-history-heading strong { font-size: 17px; }
.assistant-history-heading small { color: var(--muted); font-size: 11px; }
.assistant-history-row {
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto 16px;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}
.assistant-history-row > span:first-child { min-width: 0; }
.assistant-history-row strong,
.assistant-history-row small { display: block; }
.assistant-history-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.assistant-history-row span > small { margin-top: 5px; overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.assistant-history-time { color: var(--muted); font-size: 9px; white-space: nowrap; }
.assistant-history-row > svg { width: 15px; height: 15px; color: var(--quiet); }
.assistant-history-state { padding: 18px 0; color: var(--muted); }
.assistant-history-state strong,
.assistant-history-state small { display: block; }
.assistant-history-state small { margin-top: 5px; }
.assistant-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.82);
}
.assistant-card + .assistant-card { margin-top: 8px; }
.assistant-result-list { margin-top: 10px; border-top: 1px solid var(--line); }
.assistant-result-row {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}
.assistant-result-row strong,
.assistant-result-row small,
.assistant-result-row b { display: block; }
.assistant-result-row strong { font-size: 13px; }
.assistant-result-row small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.assistant-result-row b { color: var(--accent-strong); font-size: 11px; text-align: right; }
.assistant-open-view {
  width: 100%;
  min-height: 46px;
  margin-top: 10px;
  color: var(--accent-strong);
  border: 1px solid #c9dce9;
  border-radius: var(--radius);
  background: #eff6fb;
  font-weight: 680;
}

/* Keep command targets above 44 CSS pixels even after browser subpixel rounding. */
.primary-button,
.secondary-button,
.text-button {
  min-height: 46px;
}
.assistant-compose {
  min-height: 68px;
  grid-template-columns: 44px minmax(0,1fr) 44px;
  padding: 10px 12px max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(249,251,252,.96);
}
.assistant-compose textarea {
  min-height: 44px;
  max-height: 112px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  font-size: 16px;
}

@media (min-width: 1024px) {
  body.assistant-desktop-docked { --assistant-dock-width: 460px; }
  body.assistant-desktop-docked .topbar { right: 488px !important; }
  body.assistant-desktop-docked #main-content { padding-right: 486px !important; }
}

@media (max-width: 900px) {
  .operations-overview { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .operations-recent { grid-column: auto; }
  .resource-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .resource-summary:nth-child(2) { border-right: 0; }
  .resource-summary:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 599px) {
  body { font-size: 15px; }
  .page-header h1 { font-size: 27px; }
  .page-header p { display: none; }
  .section-heading h2 { font-size: 20px; }

  .breeding-header-actions .icon-button { width: 42px; height: 42px; }
  .pair-card { min-height: 0; padding: 14px; }
  .pair-card > .inline-actions { display: grid; grid-template-columns: minmax(0, 1fr) 42px; }
  .pair-card > .inline-actions .secondary-button { width: 100%; }
  .pair-card > .inline-actions .pair-open-button { grid-column: 1 / -1; width: 100%; justify-content: space-between; margin: 2px 0 0; padding-inline: 4px; }
  .pair-archive-members { grid-template-columns: minmax(0, 1fr); }
  .pair-archive-stats span { padding: 12px 5px; }
  .pair-archive-stats strong { font-size: 19px; }

  .operations-command-grid { grid-template-columns: minmax(0, 1fr); }
  .operations-command,
  .operations-command:nth-child(even) { min-height: 70px; padding: 10px 0; border-right: 0; }
  .operations-command strong { font-size: 15px; }
  .operations-command small { font-size: 12px; }
  .diary-row { grid-template-columns: 52px minmax(0, 1fr); gap: 11px; min-height: 82px; }
  .diary-date { padding-right: 9px; }
  .diary-date strong { font-size: 21px; }
  .diary-copy > strong { font-size: 14px; }
  .diary-full-date { display: none; }

  .contact-row { grid-template-columns: 42px minmax(0, 1fr) auto; }
  .contact-phone { grid-column: 2; }

  .import-banner {
    min-height: 0;
    grid-template-columns: 36px minmax(0,1fr);
    gap: 10px;
    padding: 12px;
  }
  .import-banner > .status-badge { grid-column: 2; justify-self: start; }
  .import-banner strong { font-size: 13px; line-height: 1.45; }
  .import-banner small { display: block; margin-top: 4px; font-size: 10px; line-height: 1.45; }
  .resource-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 24px; }
  .resource-summary { grid-template-columns: 28px minmax(0,1fr); gap: 8px; padding: 13px 8px; }
  .resource-summary:nth-child(2) { border-right: 0; }
  .resource-summary:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .resource-summary > span { width: 28px; height: 28px; }
  .resource-summary strong { font-size: 20px; }
  .resource-summary b { font-size: 12px; }
  .resource-summary small { font-size: 10px; }
  .coverage-row { min-height: 78px; grid-template-columns: minmax(0,1fr) 18px; }
  .coverage-row em { grid-column: 1; justify-self: start; }
  .coverage-row > svg { grid-column: 2; grid-row: 1 / 3; }
  .coverage-row strong { font-size: 14px; }
  .coverage-row small { font-size: 11px; }

  .account-dialog { width: 100%; margin: 0; }
  .account-surface {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }
  .account-surface > header { padding: calc(12px + env(safe-area-inset-top)) 16px 6px; }
  .account-surface h2 { font-size: 23px; }
  .account-identity { padding: 6px 16px 14px; }
  .account-tabs { gap: 22px; padding: 0 16px; }
  .account-tabs button { font-size: 13px; }
  .account-content { padding: 16px 16px calc(22px + env(safe-area-inset-bottom)); }
  .account-columns { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .account-columns > form + form { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
  .account-switcher { grid-template-columns: minmax(0,1fr); }
  .account-switcher .secondary-button { width: 100%; }
  .compact-form .secondary-button { min-width: 120px; }
  .workflow-row { grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
  .workflow-row .row-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .audit-row { grid-template-columns: 32px minmax(0,1fr) 36px; gap: 9px; }
  .audit-row > time { grid-column: 2; grid-row: 2; }
  .audit-row > .icon-button { grid-column: 3; grid-row: 1 / 3; }
  .account-footer { flex-direction: row; }
  .account-footer button { flex: 1; }

  .assistant-panel,
  .assistant-shell,
  .assistant-shell.is-expanded,
  .assistant-panel.is-open {
    inset: 0;
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    border: 0;
    border-radius: 0;
  }
  .assistant-head { padding-top: calc(8px + env(safe-area-inset-top)); }
  .assistant-msg,
  .assistant-bubble { max-width: 92%; font-size: 15px; }
  .assistant-cards { padding-bottom: 16px; }
  body.assistant-mobile-open .bottom-nav { display: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .glass,
  .account-surface,
  .assistant-panel,
  .assistant-shell { background: #f9fbfc; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
