/* Notebook roster and alternate-life cards. Scoped so the racing notebook,
   venue, breeding office and normal game buttons retain their own styles. */
.hnr-roster,.hnr-detail{
 --hnr-ink:#2f221a;--hnr-muted:#5c4939;--hnr-paper:#f5ebd7;--hnr-card:#fff9ec;
 --hnr-edge:#bb9e75;--hnr-wood:#604434;--hnr-gold:#e9c488;
 color:var(--hnr-ink);background:var(--hnr-paper);padding:12px;min-width:0;
}
.hnr-roster h3{margin:3px 0 8px;font-size:14px;color:var(--hnr-ink);line-height:1.4}
.hnr-roster h3>span{font-size:12px;margin-inline-start:5px;color:var(--hnr-muted);font-weight:650}
.hnr-filters{display:grid;gap:6px;padding-bottom:10px;margin-bottom:8px;border-bottom:1px solid #d8c3a1}
.hnr-groups{grid-template-columns:repeat(2,minmax(0,1fr))}
.hnr-ownership{grid-template-columns:repeat(3,minmax(0,1fr))}
.hnr-roster button.hnr-filter,.hnr-roster button.hnr-row,.hnr-detail button.hnr-action{
 box-sizing:border-box;min-height:44px;min-width:0;padding:8px;
 border:1px solid var(--hnr-edge);border-radius:9px;background:var(--hnr-card);
 color:var(--hnr-ink);box-shadow:none;line-height:1.35;font-size:13px;
 white-space:normal;overflow-wrap:anywhere;
}
.hnr-roster button.hnr-filter.is-current{background:var(--hnr-wood);color:#fff9e9;border-color:var(--hnr-wood)}
.hnr-list{list-style:none;padding:0;margin:0;display:grid;gap:6px}
.hnr-roster button.hnr-row{display:grid;width:100%;text-align:left;align-items:center;grid-template-columns:38px minmax(0,1fr) auto;gap:8px;min-height:58px}
.hnr-roster button.hnr-row.is-current{border-color:#775137;box-shadow:inset 0 0 0 1px #ae8757}
.hnr-row-glyph>svg,.hnr-row-glyph>.notebook-list-portrait{display:block;width:29px;height:33px;max-width:100%;max-height:100%}.hnr-row-glyph{display:grid;place-items:center;background:#ead8b8;color:#69462e;border-radius:7px;width:38px;height:38px}
.hnr-row-main{display:grid;gap:3px;min-width:0}
.hnr-row-main>strong{font-size:14px}
.hnr-row-main>small,.hnr-row-tag{font-size:11px;color:var(--hnr-muted);line-height:1.35}
.hnr-row-tag{display:flex;align-items:center;gap:5px;white-space:nowrap}
.hnr-row-tag i{font-style:normal;font-size:19px}
.hnr-empty{margin:0;padding:13px;border:1px dashed var(--hnr-edge);border-radius:8px;font-size:13px;background:var(--hnr-card)}
.hnr-roster :is(button:focus-visible),.hnr-detail button:focus-visible{outline:3px solid #8b5124;outline-offset:2px}
.hnr-detail{display:grid;gap:10px;border:1px solid var(--hnr-edge);border-radius:11px}
.hnr-life-header{display:grid;grid-template-columns:58px minmax(0,1fr) 44px;min-height:70px;align-items:center;gap:9px;position:relative}
.hnr-detail :is(.hnr-portrait,.notebook-life-portrait){width:58px;height:70px;display:block;border:1px solid var(--hnr-edge);border-radius:8px;background:#efdfbe}
.hnr-life-toolbar{display:flex;justify-content:flex-end}
.hnr-detail button.hnr-back-to-list{min-height:44px;padding:6px 13px;border-radius:8px;border-color:var(--hnr-edge);background:var(--hnr-card);color:var(--hnr-ink);box-shadow:none;font-size:13px}
.hnr-nameplate{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;gap:6px;align-items:stretch}
.hnr-nameplate>div{display:grid;align-content:center;min-width:0;text-align:center;padding:4px 6px;border:1px solid #a58155;border-radius:8px;background:#604434;color:#fff9ec}
.hnr-nameplate h2{font-size:clamp(16px,5vw,22px);color:#fff9ec;line-height:1.22;overflow-wrap:anywhere}
.hnr-nameplate small{color:#f2d9b1;font-size:11px;line-height:1.3}
.hnr-detail button.hnr-arrow{width:44px;min-width:44px;min-height:44px;padding:0;border-color:#af8c5f;border-radius:8px;background:#684a37;color:#fff6df;font-size:24px}
.hnr-detail button.hnr-arrow:disabled{background:#e6d9c2;color:#66513e;opacity:1;box-shadow:none}
.hnr-detail dl{margin:0;border:1px solid #d3bc95;border-radius:8px;background:var(--hnr-card);padding:2px 9px}
.hnr-detail dl>div{display:grid;grid-template-columns:minmax(80px,0.8fr) minmax(0,1.4fr);align-items:start;gap:6px;padding:8px 0}
.hnr-detail dl>div+div{border-top:1px solid #e5d6bb}
.hnr-detail dt,.hnr-detail dd{margin:0;font-size:13px;line-height:1.5;overflow-wrap:anywhere}
.hnr-detail dt{color:var(--hnr-muted)}
.hnr-detail dd{font-weight:700;color:var(--hnr-ink)}
.hnr-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.hnr-detail button.hnr-primary{grid-column:1/-1;background:#efcf98;border-color:#9b7048;font-weight:800}
.hnr-honors{display:flex;flex-wrap:wrap;gap:5px;list-style:none;margin:6px 0 0;padding:0}
.hnr-honors>li{border:1px solid #a57645;padding:2px 6px;border-radius:5px;background:#f3dfb8;font-size:11px}
.hnr-detail button.notebook-life-comment{
 display:grid;place-items:center;width:44px;min-width:44px;min-height:44px;padding:0;
 border:0;box-shadow:none;background:transparent;color:#503723;
}
.notebook-life-comment>span{position:relative;display:grid;place-items:center;width:33px;height:27px;line-height:19px;border:1px solid #98724c;border-radius:10px;background:#ffeed2;font-size:22px;font-weight:800;padding-bottom:4px}
.notebook-life-comment>span::after{content:'';position:absolute;left:7px;bottom:-4px;width:6px;height:6px;background:#ffeed2;border-bottom:1px solid #98724c;border-right:1px solid #98724c;transform:rotate(45deg)}
@media(max-width:350px){.hnr-roster,.hnr-detail{padding:8px}.hnr-roster button.hnr-row{gap:5px;grid-template-columns:32px minmax(0,1fr) auto}.hnr-row-glyph{width:32px;height:32px}.hnr-detail dl>div{grid-template-columns:minmax(75px,.85fr) minmax(0,1.3fr)}}

/* Full-size life scene and mobile fact cards follow the notebook artwork. */
.hnr-life-toolbar{justify-content:space-between;align-items:center;gap:6px}
.hnr-life-toolbar>strong{font-size:16px;line-height:1.3;color:var(--hnr-wood)}
.hnr-life-scene{isolation:isolate;position:relative;overflow:hidden;min-width:0;display:flex;flex-flow:column;justify-content:flex-end;min-height:clamp(200px,64vw,270px);border:1px solid #a48458;border-radius:10px;background:#95724f url('../assets/ui/horse-notebook/stable-interior-v1.png') center 60%/cover}
.hnr-life-retired .hnr-life-scene{background-image:url('../assets/farm/home-landscape.webp')}
.hnr-life-hall .hnr-life-scene{background-image:url('../assets/bg/paddock.webp')}
.hnr-life-horse{position:absolute;inset:0 35px 43px;display:grid;place-items:end center;pointer-events:none}
.hnr-detail .hnr-life-horse :is(.hnr-portrait,.notebook-life-portrait){width:min(100%,200px);height:clamp(135px,46vw,180px);background-color:transparent;border:none;filter:drop-shadow(0 5px 6px #311d1a8c)}
.hnr-life-scene>.notebook-life-comment{position:absolute;right:8px;top:7px;z-index:1}
.hnr-life-care{display:flex;position:relative;z-index:1;gap:6px;padding:5px;background:#3f2b1ecc}
.hnr-life-care button.hnr-action{font-weight:750;background:#f1dfbd;color:#423226}
.hnr-life-feedback{position:absolute;inset:auto 5px 58px;max-width:max-content;margin:0;padding:6px 8px;border:1px solid #b9996a;border-radius:6px;background:#3d2c22f0;color:#fff6e1;font-size:13px;z-index:1}
.hnr-life-card{min-width:0;padding:9px;border:1px solid #d4bc95;border-radius:9px;background:var(--hnr-card)}
.hnr-life-card h3{margin:0 0 6px;font-size:16px;color:var(--hnr-wood);line-height:1.4}
.hnr-life-card dl{padding:0 2px;background:transparent;border:0}
.hnr-life-card .hnr-actions{display:flex;justify-content:flex-end;padding-top:6px}
.hnr-life-note{color:var(--hnr-muted);font-size:12px;line-height:1.45;margin:5px 0 0}
.hnr-roles,.hnr-history,.hnr-progeny-list{display:grid;gap:5px;padding:0;margin:5px 0 0;list-style:none}
.hnr-detail button.hnr-role{width:100%;min-height:44px;display:flex;align-items:center;text-align:left;justify-content:space-between;gap:7px;padding:6px 9px;border:1px solid #bea17c;border-radius:7px;box-shadow:none;background:#fff9ea;color:var(--hnr-ink);white-space:normal;line-height:1.4}
.hnr-role>span,.hnr-history li>div,.hnr-progeny summary span{display:grid;gap:2px;min-width:0;overflow-wrap:anywhere}
.hnr-role small,.hnr-progeny summary small,.hnr-history small{color:var(--hnr-muted);font-size:12px}
.hnr-detail button.hnr-role.is-chosen{border-color:#785135;background:#eedbbc;box-shadow:inset 3px 0 #785135}
.hnr-detail button.hnr-role:disabled,.hnr-detail button.hnr-action:disabled{color:#67564a;background:#e9dfcd;opacity:1;cursor:not-allowed}
.hnr-role em{font-style:normal;white-space:nowrap;font-size:12px}
.hnr-history li{display:flex;justify-content:space-between;gap:7px;align-items:center;min-height:42px;padding:5px 7px;border-bottom:1px solid #dfcfae;color:var(--hnr-ink);font-size:13px}
.hnr-history li>b{white-space:nowrap;font-size:13px}
.hnr-progeny details{border:1px solid #d6bc92;border-radius:7px;background:#fffbef}
.hnr-progeny summary{min-height:44px;padding:5px 7px;color:var(--hnr-ink);cursor:pointer;font-size:14px;box-sizing:border-box}
.hnr-progeny summary>span{display:inline-grid;vertical-align:middle}
.hnr-progeny summary:focus-visible{outline:3px solid #8b5124}
.hnr-progeny-body{padding:3px 7px 8px}
.hnr-life-illustration{display:block;width:clamp(132px,42vw,184px);aspect-ratio:1;background:url('../assets/ui/horse-notebook/horse-illustration-coats-v1.png') var(--hnr-coat-x) var(--hnr-coat-y)/200% 200% no-repeat;filter:brightness(var(--hnr-coat-tone,1)) saturate(var(--hnr-coat-chroma,1)) drop-shadow(0 6px 3px #2d1d158c)}
.hnr-detail .hnr-life-feedback[hidden]{display:none}
.hnr-history-result{text-align:right;white-space:nowrap;flex-shrink:0}
