:root {
    color-scheme: light;
    --ink: #083b5a;
    --muted: #527d94;
    --brand: #086197;
    --brand-light: #e7f2f8;
    --accent: #347ba5;
    --gold: #b9d7e6;
    --paper: #ffffff;
    --line: #d4e4ed;
    --danger: #a53f36;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #f5f9fc; }
body { min-height: 100vh; margin: 0; color: var(--ink); background: radial-gradient(circle at 0 0, #dbeaf3, transparent 36rem), #f5f9fc; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
h1:focus { outline: none; }

.app-shell { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; }
.site-header { height: 76px; display: flex; align-items: center; padding: 0 max(24px, calc((100vw - 1280px) / 2)); background: rgba(255, 253, 248, .92); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.landing-shell { grid-template-rows: 1fr; }
.landing-shell .site-header, .landing-shell footer { display: none; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-logo { display: block; width: 58px; height: 42px; object-fit: contain; }
.brand strong, .brand small { display: block; }
.brand strong { letter-spacing: .08em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: .72rem; }
main { width: min(1280px, calc(100% - 40px)); margin: 0 auto; }
footer { padding: 28px 20px; color: var(--muted); text-align: center; font-size: .82rem; }

.eyebrow { color: var(--accent); font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.feature-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.feature-list span, .animal-badges span { padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(255,255,255,.52); font-size: .78rem; }
.landing-page { display: grid; min-height: 100vh; place-items: center; padding: clamp(24px, 6vh, 72px) 0; }
.landing-card { display: grid; width: min(100%, 960px); grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); overflow: hidden; border-radius: 30px; background: white; box-shadow: 0 28px 80px rgba(8, 61, 90, .14); }
.landing-logo { display: grid; grid-column: 1 / -1; place-items: center; padding: 34px 24px 10px; }
.landing-logo img { display: block; width: min(260px, 58vw); height: 210px; object-fit: contain; }
.landing-intro { display: flex; min-height: 390px; flex-direction: column; justify-content: center; padding: clamp(36px, 6vw, 72px); background: radial-gradient(circle at 0 0, rgba(185,215,230,.8), transparent 24rem), linear-gradient(145deg, #f7fbfd, #e6f2f8); }
.landing-intro h1 { margin: 12px 0 18px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(3.2rem, 7vw, 5.6rem); font-weight: 500; letter-spacing: -.055em; line-height: .94; }
.landing-intro > p { max-width: 540px; margin: 0; color: var(--muted); font-size: 1.05rem; line-height: 1.65; }
.landing-page .access-card { align-self: center; margin: clamp(24px, 4vw, 48px); padding: 30px; border-radius: 20px; box-shadow: none; }
.landing-page .access-card h2 { margin-top: 8px; font-size: 1.35rem; }
.landing-page .access-card > p { font-size: .84rem; }
.landing-page #turnstile-widget { min-height: 65px; margin-top: 16px; }
.landing-page .access-card .button.wide { min-height: 38px; margin-top: 14px; font-size: .72rem; }

.access-card, .search-panel, .content-card, .animal-card { border: 1px solid rgba(8, 97, 151, .12); background: rgba(255, 255, 255, .96); box-shadow: 0 22px 65px rgba(8, 61, 90, .1); }
.access-card { padding: clamp(25px, 4vw, 42px); border-radius: 28px; }
.access-card h2 { margin: 0 0 8px; font-size: 1.5rem; }
.access-card > p { color: var(--muted); line-height: 1.5; }
.access-card label, .search-form label { display: block; margin: 20px 0 7px; color: var(--muted); font-size: .78rem; font-weight: 700; }
input, select { width: 100%; min-height: 48px; padding: 0 14px; color: var(--ink); border: 1px solid #b7cfde; border-radius: 10px; background: white; outline: none; }
input:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(8, 97, 151, .12); }
.captcha-unavailable { margin-top: 24px; padding: 20px; color: var(--danger); border: 1px dashed #c99590; border-radius: 12px; background: #fff0ed; text-align: center; font-size: .86rem; }
#turnstile-widget { min-height: 65px; margin-top: 24px; }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 0 18px; border: 0; border-radius: 10px; cursor: pointer; font-weight: 750; text-decoration: none; transition: transform .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .65; transform: none; }
.button.primary { color: white; background: var(--brand); }
.button.secondary { color: var(--brand); border: 1px solid #b3ccd9; background: white; }
.button.wide { width: 100%; margin-top: 22px; }
.text-button, .inline-link { padding: 0; color: var(--brand); border: 0; background: none; cursor: pointer; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.access-card .text-button { display: block; margin: 10px auto 0; font-size: .78rem; }
.validation-message { color: var(--danger); font-size: .88rem; font-weight: 650; }

.workspace { padding: 42px 0 70px; }
.search-panel { display: grid; grid-template-columns: 1fr auto; gap: 24px; padding: 28px; border-radius: 20px; }
.search-panel h1 { margin: 4px 0 0; font-family: Georgia, serif; font-size: 2.3rem; font-weight: 500; }
.search-form { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(180px, .7fr) minmax(260px, 2fr) auto; gap: 12px; align-items: end; }
.search-form label { margin-top: 0; }
.search-form .button { min-height: 48px; }
.search-panel > .validation-message { grid-column: 1 / -1; margin: 0; }
.notice { margin: 20px 0; padding: 14px 18px; border-left: 4px solid var(--accent); border-radius: 8px; background: #edf6fb; }
.notice.danger { border-color: var(--danger); background: #fff0ed; }
.content-card, .animal-card { margin-top: 22px; border-radius: 20px; overflow: hidden; }
.content-card { padding: 28px; }
.content-card h2 { margin-top: 0; }
.result-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.result-list button { padding: 15px; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; background: white; cursor: pointer; text-align: left; }
.result-list button:hover { border-color: var(--brand); }
.result-list strong, .result-list span { display: block; }
.result-list span { margin-top: 3px; color: var(--muted); font-size: .86rem; }

.animal-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px 24px; padding: 26px 30px; background: linear-gradient(125deg, var(--paper), #edf5fa); }
.animal-number { display: inline-flex; align-items: center; gap: 9px; padding: 7px 11px; color: white; border-radius: 8px; background: var(--brand); box-shadow: 0 5px 13px rgba(8, 97, 151, .2); }
.animal-number small { font-size: .62rem; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
.animal-number strong { font-size: 1rem; letter-spacing: .035em; }
.animal-name { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.animal-name h2 { flex: 0 1 auto; }
.animal-name-flag { font-family: Georgia, serif; font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 700; }
.animal-name-flag.et { color: #c52f28; }
.animal-name-flag.red { padding: 3px 8px; color: white; border-radius: 6px; background: #c52f28; font-family: inherit; font-size: .85rem; letter-spacing: .06em; }
.animal-header h2 { margin: 5px 0 12px; font-family: Georgia, serif; font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 500; }
.animal-badges { display: flex; flex-wrap: wrap; gap: 7px; }
.animal-badges .cib-badge { color: white; border-color: var(--brand); background: var(--brand); box-shadow: 0 4px 10px rgba(8, 97, 151, .2); font-size: .88rem; font-weight: 800; }
.header-actions { display: flex; flex-direction: column; gap: 12px; align-items: flex-end; }
.animal-overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); grid-column: 1 / -1; gap: 1px; margin: 0; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: var(--line); }
.animal-overview > div { padding: 12px 14px; background: rgba(255,255,255,.75); }
.animal-parents { grid-column: 1 / -1; }
.parent-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.parent-link { display: grid; grid-template-columns: auto 1fr; gap: 2px 9px; width: 100%; min-width: 0; padding: 12px 14px; color: var(--ink); border: 1px solid #c5d9e4; border-radius: 10px; background: rgba(255,255,255,.82); cursor: pointer; text-align: left; }
.parent-link:hover { border-color: var(--accent); background: white; }
.parent-link span { grid-row: 1 / 3; align-self: center; padding: 5px 7px; color: white; border-radius: 6px; background: var(--brand); font-size: .64rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.parent-link strong, .parent-link small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.parent-link strong { font-size: .82rem; }
.parent-link small { color: var(--muted); font-size: .75rem; }
.parent-link.unavailable { cursor: default; opacity: .68; }
.tabs { display: flex; overflow-x: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: white; scrollbar-width: thin; }
.tabs button { flex: 0 0 auto; padding: 15px 17px; color: var(--muted); border: 0; border-bottom: 3px solid transparent; background: transparent; cursor: pointer; font-size: .82rem; font-weight: 700; }
.tabs button:hover, .tabs button.active { color: var(--brand); background: var(--brand-light); }
.tabs button.active { border-bottom-color: var(--accent); }
.tab-content { min-height: 230px; padding: 28px; background: white; }
.summary-grid, .index-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 0; }
.summary-grid > div, .index-grid > div { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: #fafcff; }
.detail-report { display: grid; gap: 24px; }
.score-sheet { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 7px 20px rgba(8, 61, 90, .05); }
.score-sheet-header { display: flex; justify-content: space-between; gap: 20px; padding: 22px; color: #f8fcff; background: linear-gradient(115deg, var(--brand), #347ba5); }
.score-sheet-header .eyebrow { color: var(--gold); }
.score-sheet-header h3 { margin: 5px 0; font-family: Georgia, serif; font-size: 1.8rem; font-weight: 500; }
.score-sheet-header p { margin: 0; color: #dceef7; font-size: .88rem; }
.score-pill { display: grid; min-width: 100px; height: fit-content; place-items: center; align-content: center; gap: 3px; padding: 10px 14px; border: 1px solid rgba(255,255,255,.25); border-radius: 12px; background: rgba(255,255,255,.12); text-align: center; }
.score-pill span { color: #dceef7; font-size: .66rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.score-pill strong { font-size: 1.55rem; }
.genomic-icon { align-self: center; width: 68px; height: 68px; object-fit: contain; }
.score-pair { display: flex; gap: 9px; }
.score-pill.accent { color: var(--ink); border-color: #b9d7e6; background: var(--gold); }
.score-pill.accent span { color: #24546e; }
.score-header-actions { display: flex; align-items: center; gap: 10px; }
.score-toggle { padding: 9px 12px; color: white; border: 1px solid rgba(255,255,255,.4); border-radius: 8px; background: rgba(255,255,255,.1); cursor: pointer; font-weight: 700; }
.score-toggle:hover { background: rgba(255,255,255,.2); }
.record-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 1px; margin: 0; border-bottom: 1px solid var(--line); background: var(--line); }
.record-meta > div { padding: 13px 15px; background: #f3f8fb; }
.metric-section { padding: 19px 21px; border-bottom: 1px solid var(--line); }
.metric-section:last-child { border-bottom: 0; }
.metric-section-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 13px; }
.metric-section-heading .eyebrow { color: var(--brand); }
.metric-section-title { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.metric-catalog { padding: 3px 7px; border-radius: 5px; color: white; background: var(--accent); font-size: .76rem; letter-spacing: .03em; }
.metric-globals { display: flex; flex-wrap: wrap; gap: 6px; }
.metric-globals span { display: inline-flex; align-items: center; gap: 7px; padding: 4px 8px; border: 1px solid #b9d7e6; border-radius: 7px; background: #edf6fb; }
.metric-globals small { color: #24546e; font-size: .62rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.metric-globals strong { display: grid; min-width: 22px; min-height: 22px; place-items: center; padding: 2px 5px; border-radius: 5px; color: white; background: var(--accent); font-size: .82rem; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 8px; margin: 0; }
.metric-grid > div { min-width: 0; padding: 11px; border: 1px solid #dce9f0; border-radius: 9px; background: #fff; }
.metric-grid dd { font-size: 1.06rem; }
.trait-bars { display: grid; gap: 9px; }
.trait-bar { display: grid; grid-template-columns: minmax(150px, .8fr) 30px minmax(150px, 240px); gap: 12px; align-items: center; min-height: 32px; }
.trait-label { color: var(--ink); font-size: .8rem; font-weight: 700; }
.trait-scale { position: relative; height: 27px; }
.trait-track { position: absolute; top: 10px; right: 0; left: 0; height: 8px; border-radius: 999px; background: linear-gradient(90deg, #d6e7f0 0 49.5%, #5d93b9 49.5% 50.5%, #d6e7f0 50.5%); }
.trait-origin { position: absolute; z-index: 3; top: 3px; left: 50%; width: 16px; height: 16px; transform: translateX(-50%); border: 3px solid #f8fcff; border-radius: 50%; background: var(--brand); }
.trait-tick { position: absolute; z-index: 2; top: 8px; left: var(--tick); width: 1px; height: 12px; background: #8bb3cc; transform: translateX(-50%); }
.trait-tick.center { visibility: hidden; }
.trait-fill { position: absolute; z-index: 1; top: 10px; height: 8px; background: var(--accent); }
.trait-fill.left { right: 50%; width: var(--bar-size); border-radius: 999px 0 0 999px; }
.trait-fill.right { left: 50%; width: var(--bar-size); border-radius: 0 999px 999px 0; }
.trait-value { display: grid; min-width: 30px; min-height: 28px; place-items: center; color: var(--brand); border: 1px solid #b9d3e1; border-radius: 7px; background: #f5faff; font-size: .86rem; }
.metric-section-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.metric-section-pair .metric-section { border-bottom: 0; }
.metric-section-pair .metric-section + .metric-section { border-left: 1px solid var(--line); }
dt { color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; }
dd { margin: 6px 0 0; overflow-wrap: anywhere; font-weight: 720; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; white-space: nowrap; font-size: .82rem; }
.data-table th { padding: 11px 12px; color: #315f78; border-bottom: 2px solid var(--brand); background: #eaf4f9; text-align: left; }
.data-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); }
.data-table tbody tr:hover { background: #fffaf0; }
.lactation-link { padding: 0; color: var(--brand); border: 0; background: none; cursor: pointer; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.lactation-detail { display: grid; gap: 18px; margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); }
.lactation-detail-header { display: flex; justify-content: space-between; gap: 20px; }
.lactation-detail-header h3, .control-chart-heading h4 { margin: 5px 0 0; font-family: Georgia, serif; font-size: 1.45rem; font-weight: 500; }
.lactation-detail-header p { margin: 6px 0 0; color: var(--muted); font-size: .86rem; }
.lactation-content { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.control-chart-card { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fafcff; }
.control-table-card { display: flex; min-width: 0; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: white; }
.control-chart-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; border-bottom: 1px solid var(--line); background: #eef7fb; }
.control-table-heading { padding: 14px 15px; border-bottom: 1px solid var(--line); background: #eef7fb; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 11px; font-size: .76rem; font-weight: 750; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend span::before { width: 10px; height: 3px; border-radius: 5px; background: currentColor; content: ""; }
.chart-legend .milk { color: #086197; }.chart-legend .fat { color: #347ba5; }.chart-legend .protein { color: #79aeca; }
.control-chart-scroll { overflow: hidden; padding: 9px 10px 3px; }
.control-chart { display: block; min-width: 0; width: 100%; height: auto; }
.control-table-card .table-scroll { max-height: 341px; overflow: auto; }
.control-table-card .data-table { font-size: .73rem; }
.control-table-card .data-table th, .control-table-card .data-table td { padding: 7px 8px; }
.chart-axis { stroke: #7da8c2; stroke-width: 1.25; }.chart-guide { stroke: #d7e7f0; stroke-width: 1; stroke-dasharray: 3 4; }.chart-line { fill: none; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }.chart-line.milk { stroke: #086197; }.chart-line.fat { stroke: #347ba5; }.chart-line.protein { stroke: #79aeca; }
.chart-tick, .chart-axis-title { fill: #527d94; font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 11px; }.chart-axis-title { font-size: 12px; font-weight: 700; }.milk-tick, .milk-axis-title { fill: #086197; }.secondary-tick, .secondary-axis-title { fill: #347ba5; }
.empty-inline, .loading { display: grid; min-height: 150px; place-items: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; }
.empty-state { max-width: 650px; margin: 90px auto; padding: 44px; border-radius: 20px; background: white; text-align: center; }

.pedigree-card { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #f8fcff; }
.pedigree-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; padding: 21px 23px; border-bottom: 1px solid var(--line); background: linear-gradient(115deg, #f8fcff, #edf6fb); }
.pedigree-heading h3 { margin: 4px 0 0; font-family: Georgia, serif; font-size: 1.55rem; font-weight: 500; }
.pedigree-heading p { margin: 0; color: var(--muted); font-size: .82rem; }
.pedigree-scroll { overflow-x: auto; padding: 22px; }
.pedigree-chart { width: 100%; }
.pedigree-generations, .pedigree-tree { display: grid; grid-template-columns: repeat(var(--generations), minmax(0, 1fr)); column-gap: 46px; }
.pedigree-generations { margin-bottom: 13px; }
.pedigree-generations span { padding-bottom: 8px; color: var(--muted); border-bottom: 2px solid var(--gold); font-size: .7rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.pedigree-tree { grid-template-rows: repeat(var(--slots), minmax(62px, 1fr)); min-height: var(--tree-height); row-gap: 8px; align-items: stretch; }
.pedigree-node { position: relative; display: flex; min-width: 0; align-items: center; }
.pedigree-node:not(.current)::before { position: absolute; left: -46px; width: 46px; border-top: 2px solid #b6d1df; content: ""; }
.pedigree-node:not(.current)::after { position: absolute; left: -7px; width: 11px; height: 11px; border: 2px solid #5d93b9; border-radius: 50%; background: #f8fcff; content: ""; }
.pedigree-node.current::after { position: absolute; top: 50%; right: -46px; width: 46px; border-top: 2px solid #b6d1df; content: ""; }
.pedigree-role { position: absolute; top: 50%; left: -43px; z-index: 1; transform: translateY(-50%); color: #347ba5; background: #f8fcff; font-size: .58rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.pedigree-node.current .pedigree-role { top: calc(50% - 23px); left: 14px; color: #dceef7; background: transparent; }
.pedigree-animal { position: relative; z-index: 2; display: flex; flex-direction: column; width: 100%; min-height: 64px; justify-content: center; padding: 13px 15px; color: var(--ink); border: 1px solid #c5d9e4; border-radius: 11px; background: white; box-shadow: 0 4px 12px rgba(8, 61, 90, .06); cursor: pointer; text-align: left; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.pedigree-animal:hover { border-color: var(--accent); box-shadow: 0 7px 18px rgba(8, 61, 90, .13); transform: translateY(-1px); }
.pedigree-node.current .pedigree-animal { color: white; border-color: var(--brand); background: linear-gradient(125deg, var(--brand), #347ba5); }
.pedigree-animal strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .83rem; letter-spacing: .02em; }
.pedigree-animal span { display: -webkit-box; overflow: hidden; margin-top: 4px; color: var(--muted); font-size: .75rem; line-height: 1.2; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.pedigree-node.current .pedigree-animal span { color: #dceef7; }
.pedigree-animal .pedigree-unknown { font-style: italic; }

#blazor-error-ui { position: fixed; right: 20px; bottom: 20px; display: none; padding: 14px 18px; color: white; border-radius: 9px; background: #8d3029; box-shadow: 0 8px 30px #0003; z-index: 1000; }
#blazor-error-ui .dismiss { margin-left: 12px; color: white; border: 0; background: none; cursor: pointer; }
#blazor-error-ui .reload { color: white; }

@media (max-width: 820px) {
    main { width: min(100% - 24px, 1280px); }
    .landing-page { padding: 24px 0; }
    .landing-card { grid-template-columns: 1fr; border-radius: 22px; }
    .landing-logo { grid-column: 1; padding-top: 26px; }
    .landing-logo img { width: min(230px, 62vw); height: 180px; }
    .landing-intro { min-height: auto; padding: 38px 30px; }
    .landing-intro h1 { font-size: clamp(3.2rem, 15vw, 5rem); }
    .landing-page .access-card { margin: 20px; }
    .search-form { grid-template-columns: 1fr; }
    .animal-header { grid-template-columns: 1fr; padding: 22px; }
    .header-actions { align-items: stretch; }
    .parent-links { grid-template-columns: 1fr; }
    .pedigree-heading { align-items: flex-start; flex-direction: column; }
    .pedigree-scroll { padding: 16px; }
    .score-sheet-header { align-items: flex-start; flex-direction: column; }
    .metric-section-pair { grid-template-columns: 1fr; }
    .metric-section-pair .metric-section + .metric-section { border-top: 1px solid var(--line); border-left: 0; }
    .trait-bar { grid-template-columns: 1fr 30px; gap: 7px 11px; }
    .trait-scale { grid-column: 1 / -1; grid-row: 2; max-width: 240px; }
    .lactation-content { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .brand small { display: none; }
    .search-panel { grid-template-columns: 1fr; padding: 20px; }
    .tab-content { padding: 18px; }
}
