.ear-tag-compact{display:flex;align-items:center;gap:16px;margin:14px 0 18px;padding:12px 14px;border:1px solid var(--line);border-radius:15px;background:var(--cream);min-width:0}.ear-tag-preview{display:block;flex:0 0 78px;width:78px;min-height:0;padding:0;border:0;background:transparent;box-shadow:none}.ear-tag-preview:hover{background:transparent}.ear-tag-preview .animal-ear-tag{width:78px;margin:0}.ear-tag-compact-info{display:grid;gap:5px;min-width:0}.ear-tag-compact-info>span{font-size:12px;color:var(--muted)}.ear-tag-compact-info strong{font-size:15px;overflow-wrap:anywhere}.ear-tag-expand{justify-self:start;min-height:40px;padding:6px 0;font-size:13px;text-decoration:underline;text-underline-offset:3px}.ear-tag-expand:hover{background:transparent}.parent-choice{width:100%;justify-content:space-between;min-width:0;text-align:left}.parent-choice>span:first-child{min-width:0;overflow-wrap:anywhere}.animal-ui-dialog{width:min(480px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:22px;margin:auto;border:1px solid var(--line);border-radius:20px;background:var(--cream);color:var(--ink);overflow:auto;overscroll-behavior:contain}.animal-ui-dialog::backdrop{background:#10121499;backdrop-filter:blur(5px)}.animal-ui-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:16px}.animal-ui-head h2{margin:0;font-size:21px}.parent-search-help,.parent-status{margin:10px 0;color:var(--muted);font-size:13px}.parent-results{max-height:min(44dvh,360px);overflow-y:auto;overscroll-behavior:contain;margin:14px 0}.parent-result{display:grid;position:relative;gap:3px;width:100%;min-height:58px;padding:10px 12px;border:1px solid var(--line);border-radius:11px;background:var(--surface,#fff);color:var(--ink);text-align:left;justify-content:stretch;margin-bottom:7px}.parent-result:hover{background:var(--mint)}.parent-result strong{font-size:14px;overflow-wrap:anywhere}.parent-result small{font-size:12px;color:var(--muted)}.parent-selected{font-size:11px;color:var(--green);font-weight:700}.parent-dialog-actions{display:flex;flex-wrap:wrap;gap:8px}.parent-dialog-actions>*{flex:1}.animal-ui-dialog>.animal-ear-tag{width:min(240px,100%);margin:8px auto 14px}.tag-modal-caption{text-align:center;font-weight:700;margin:0 0 15px}.animal-ui-done{width:100%}[data-theme=dark] .animal-ui-dialog{background:#1d1f21}[data-theme=dark] .parent-result{background:#292b2e}[data-theme=dark] .ear-tag-compact{background:#1a1b1d}@media(max-width:360px){.ear-tag-compact{gap:12px;padding:10px}.ear-tag-preview,.ear-tag-preview .animal-ear-tag{width:70px}.ear-tag-preview{flex-basis:70px}.animal-ui-dialog{padding:16px}.parent-dialog-actions>*{flex-basis:100%}}

.animal-photo-panel{border:1px solid var(--line);border-radius:14px;overflow:hidden;background:var(--cream)}.animal-photo-panel>summary{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:52px;padding:12px 14px;cursor:pointer;font-size:14px;font-weight:700;list-style:none}.animal-photo-panel>summary::-webkit-details-marker{display:none}.animal-photo-panel .photo-panel-hint{color:var(--muted);font-size:12px;font-weight:500}.animal-photo-panel .photo-panel-hint::after{content:"Anzeigen"}.animal-photo-panel[open] .photo-panel-hint::after{content:"Schließen"}.animal-photo-panel .detail-photo{border-radius:0 0 13px 13px}
[data-theme=dark] .animal-photo-panel{background:#1a1b1d}

/* Keep the collapsed photo and clickable tag together without adding a second action. */
.animal-media-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch;gap:12px;margin:0 0 18px}.animal-media-row>:only-child{grid-column:1/-1}.animal-media-row .ear-tag-compact{display:flex;flex-direction:column;justify-content:center;gap:8px;width:100%;min-height:150px;margin:0;padding:10px;border:1px solid var(--line);border-radius:14px;background:var(--cream);color:var(--ink);font-size:13px;font-weight:700;line-height:1.3}.animal-media-row .ear-tag-compact:hover{background:var(--mint)}.animal-media-row .ear-tag-compact .animal-ear-tag{width:70px;margin:0}.animal-media-row .animal-photo-panel>summary{min-height:150px;height:100%;display:flex;flex-direction:column;justify-content:center;gap:10px;text-align:center}.animal-photo-label{display:flex;flex-direction:column;align-items:center;gap:8px}.animal-photo-label .app-icon{width:25px;height:25px}.animal-media-row .animal-photo-panel[open]>summary{min-height:46px;height:auto;padding:9px 10px;flex-direction:row;gap:6px}.animal-photo-panel[open] .animal-photo-label{flex-direction:row;gap:6px}.animal-photo-panel[open] .animal-photo-label .app-icon{width:17px;height:17px;min-width:17px}.animal-media-row .animal-photo-panel .detail-photo{width:100%;height:auto;aspect-ratio:4/3;object-fit:cover}[data-theme=dark] .animal-media-row .ear-tag-compact{background:#1a1b1d}[data-theme=dark] .animal-media-row .ear-tag-compact:hover{background:var(--raised)}

.animal-media-row .animal-photo-panel[open] .animal-photo-label{white-space:nowrap}.animal-media-row .animal-photo-panel[open] .animal-photo-label .app-icon{display:none}.animal-media-row .animal-photo-panel[open] .photo-panel-hint{font-size:0}.animal-media-row .animal-photo-panel[open] .photo-panel-hint::after{content:"−";font-size:18px;line-height:1}

/* Show the photo and ear tag side by side as equal, immediately visible tiles. */
.animal-media-row .animal-photo-panel{min-width:0;min-height:150px;overflow:hidden}.animal-media-row .animal-photo-panel .detail-photo{display:grid;width:100%;height:100%;min-height:150px;aspect-ratio:auto;border-radius:13px;object-fit:cover}.animal-media-row .animal-photo-panel img.detail-photo{display:block}.animal-media-row .ear-tag-compact{gap:0}.animal-media-row .ear-tag-compact .animal-ear-tag{width:min(82px,90%)}

/* Compact identity and four equally sized touch targets on phones. */
.animal-detail-heading{min-width:0;margin-bottom:20px}.animal-detail-identity{display:flex;align-items:baseline;gap:9px;min-width:0;margin-bottom:14px;white-space:nowrap}.animal-detail-identity h1{font-size:clamp(20px,3vw,32px);line-height:1.2;letter-spacing:-.7px;margin:0;min-width:0;overflow:hidden;text-overflow:ellipsis}.animal-detail-separator{color:var(--muted);flex:none}.animal-detail-name{font-size:15px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;min-width:0}.animal-detail-heading .animal-special-notice{margin:0 0 14px}.detail-heading-actions{display:flex;flex-wrap:wrap;gap:8px}.detail-mobile-label{display:none}.animal-photo-open{display:block;width:100%;height:100%;min-height:150px;padding:0;border:0;border-radius:13px;background:transparent;overflow:hidden}.animal-photo-open:hover{background:transparent}.animal-photo-dialog{width:min(840px,calc(100vw - 24px))}.animal-photo-large{display:flex;align-items:center;justify-content:center;min-height:80px;margin:0 0 16px}.animal-photo-large img{display:block;max-width:100%;max-height:min(68dvh,720px);width:auto;height:auto;object-fit:contain;border-radius:12px}
@media(max-width:800px){.animal-detail-identity{gap:6px;margin-bottom:12px}.animal-detail-identity h1{font-size:clamp(17px,5vw,25px);letter-spacing:-.5px}.animal-detail-name{font-size:13px}.detail-heading-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}.detail-heading-actions.two-actions{grid-template-columns:repeat(2,minmax(0,1fr))}.detail-heading-actions .button{min-width:0;min-height:52px;padding:5px 2px;display:flex;flex-direction:column;gap:3px;font-size:10px;line-height:1.1;white-space:nowrap}.detail-heading-actions .app-icon{width:17px;height:17px;min-width:17px}.detail-desktop-label{display:none}.detail-mobile-label{display:inline}.animal-detail-heading .animal-special-notice{margin-bottom:12px}}

.parent-result strong{font-size:16px}.parent-result small{font-size:12px}

/* Compact identity and visible notes in the herd overview. */
.animal-card-identity{display:flex;align-items:baseline;gap:7px;min-width:0;white-space:nowrap;margin-bottom:14px}.animal-card-identity h3{flex:none;font-size:16px;line-height:1.3;letter-spacing:-.3px}.animal-card-name{min-width:0;overflow:hidden;text-overflow:ellipsis;color:var(--muted);font-size:12px}.animal-card-special{display:flex;align-items:flex-start;gap:7px;margin:0 0 14px;padding:9px 10px;border-radius:9px;background:var(--mint);color:var(--ink);font-size:12px;line-height:1.4;overflow-wrap:anywhere;white-space:pre-wrap}.animal-card-special .app-icon{flex:none;width:16px;height:16px}
@media(max-width:380px){.animal-card-identity h3{font-size:14px}.animal-card-identity{gap:5px}}

@media(max-width:600px){.animal-grid{grid-template-columns:minmax(0,1fr)}.animal-card{display:flex;align-items:stretch}.animal-card>.animal-thumb{width:84px;min-height:110px;height:auto;flex:none;object-fit:cover}.animal-card .animal-placeholder img{width:48px}.animal-card-body{min-width:0;flex:1;padding:12px}.animal-card-identity{margin-bottom:10px}.animal-card-special{margin-bottom:10px}}

/* Fixed thumbnail dimensions prevent the shared photo aspect ratio from widening mobile cards. */
@media(max-width:600px){.animal-card{display:grid;grid-template-columns:84px minmax(0,1fr);align-items:start}.animal-card>img.animal-thumb,.animal-card>.animal-placeholder{width:72px;height:72px;min-height:0;aspect-ratio:1;align-self:start;margin:12px 0 12px 12px;border-radius:10px}.animal-card-body{width:100%;min-width:0}.animal-card-bottom{flex-wrap:wrap;justify-content:flex-start}.animal-card-identity{gap:5px}.animal-card-identity h3{font-size:14px}}
.animal-row .row-main{min-width:0}.animal-row-identity{display:flex;align-items:baseline;gap:7px;min-width:0;white-space:nowrap}.animal-row .animal-row-identity strong{display:block;flex:none;font-size:16px;line-height:1.4;overflow-wrap:normal}.animal-row .animal-row-identity small{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;font-size:12px;color:var(--muted)}.animal-row-info{display:flex;flex-wrap:wrap;align-items:center;gap:5px 8px;margin-top:5px;font-size:12px;color:var(--muted)}
@media(max-width:600px){.animal-row{display:grid;grid-template-columns:40px minmax(0,1fr);gap:9px}.animal-row>.animal-thumb{grid-row:auto;width:40px;height:40px}.animal-row .animal-row-identity strong{font-size:14px;letter-spacing:-.25px}.animal-row-identity{gap:5px}}

.auth-admin-entry{margin-top:22px;padding-top:18px;border-top:1px solid var(--line);text-align:center}.auth-admin-entry .button{width:100%}.auth-admin-entry small{display:block;margin-top:8px;font-size:12px;color:var(--muted)}

@media(min-width:801px){.animal-detail-heading>.detail-heading-actions{justify-content:flex-start;width:100%}.animal-detail-heading>.detail-heading-actions:not(.two-actions)>.button:nth-child(3){margin-inline-start:auto}}
.movement-fields summary{min-height:40px;cursor:pointer;font-weight:600}.movement-fields .form-grid{margin-top:4px}
.movement-filter{grid-template-columns:minmax(0,220px)}
.movement-list{display:grid}.movement-row{display:grid;grid-template-columns:96px minmax(0,1.2fr) minmax(0,1fr) auto;gap:12px;align-items:center;padding:12px 0;border-bottom:1px solid var(--line);color:var(--ink)}.movement-row:last-child{border-bottom:0}.movement-row:hover{text-decoration:none}
.movement-row small{display:block;font-size:12px;color:var(--muted);overflow-wrap:anywhere}.movement-date{font-size:13px;color:var(--muted)}.movement-price{font-weight:600;white-space:nowrap}.movement-total{font-size:14px;white-space:nowrap}.movement-undated{margin:-8px 0 18px}
@media(max-width:560px){.movement-row{grid-template-columns:minmax(0,1fr) auto;gap:4px 12px}.movement-date{grid-column:1/-1}.movement-party{grid-column:1}.movement-price{grid-column:2;grid-row:2}}
/* Touch feedback: the tapped animal row or card lights up briefly instead of underlining the ear tag. */
.animal-row,.movement-row{margin-inline:-10px;padding-inline:10px;border-radius:12px;-webkit-tap-highlight-color:transparent;transition:background-color .15s ease}
.animal-card{-webkit-tap-highlight-color:transparent;transition:background-color .15s ease,border-color .15s ease}
.animal-row:active,.movement-row:active{background:var(--mint)}.animal-card:active{background:var(--mint);border-color:var(--green)}
[data-theme=dark] .animal-row:active,[data-theme=dark] .movement-row:active,[data-theme=dark] .animal-card:active{background:#2c2e31}
@media(hover:hover){.animal-row:hover,.movement-row:hover{background:var(--mint)}.animal-card:hover{background:var(--mint);border-color:var(--green)}[data-theme=dark] .animal-row:hover,[data-theme=dark] .movement-row:hover,[data-theme=dark] .animal-card:hover{background:#2c2e31}}
.detail-heading-actions.three-actions{grid-template-columns:repeat(3,minmax(0,1fr))}@media(min-width:801px){.detail-heading-actions.three-actions{display:flex}}
