/* Screenshot-led refinement, 0.15.2. Shared records retain their selected presentation.
   Loaded after the legacy sheet; overrides are grouped by surface, not scattered. */
:root { --ui-paper:#faf8f3; --ui-card:#fffefa; --ui-ink:#183e31; --ui-muted:#586b62; --ui-rule:#e5e1d8; --ui-gold:#936e2d; --ui-green:#164b37; --ui-nav-height:76px; }
html { scroll-padding-bottom:var(--ui-nav-height); }
body { background:var(--ui-paper); }
button, a, input, textarea { -webkit-tap-highlight-color:transparent; }
button { cursor:pointer; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline:3px solid #aa853f; outline-offset:3px; }
input, textarea { caret-color:var(--ui-green); }
::selection { background:#deeadf; color:#183e31; }
[hidden] { display:none !important; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
#app { padding:0; }
#app .header { min-height:70px; padding:10px 18px; gap:10px; background:var(--ui-paper); color:var(--ui-ink); border:0; border-block-end:1px solid var(--ui-rule); box-shadow:none; }
#app .brand-lockup { gap:10px; min-width:0; flex:1; }
#app .brand-mark { width:32px; height:36px; border:0; padding:0; color:var(--ui-gold); background:none; }
#app .brand-copy { min-width:0; display:grid; grid-template-columns:auto minmax(0,1fr); column-gap:12px; align-items:center; }
#app .brand-copy h1 { font-family:Georgia,'Times New Roman',serif; font-size:21px; letter-spacing:-.02em; font-weight:500; }
#app .view-context { grid-column:1/-1; justify-self:start; display:block; font-family:var(--ff-body); font-size:11px; font-weight:500; line-height:1.5; letter-spacing:0; text-transform:none; color:var(--ui-muted); border:0; border-block-end:1px dotted #b7b4a8; background:none; padding:0; min-height:24px; text-align:start; opacity:1; }
#app .stable-switch { grid-column:2; grid-row:1; max-width:155px; min-height:32px; padding:4px 8px; margin:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; color:var(--ui-muted); border:1px solid var(--ui-rule); background:transparent; border-radius:7px; }
#app .header-icon-btn { width:44px; height:44px; min-width:44px; border:0; border-radius:50%; background:#efede5; color:var(--ui-ink); }
#app .header-user { display:none; }
#app #mainContent .section { max-width:1180px; padding:18px 16px calc(var(--ui-nav-height) + 24px); margin:0 auto; }
#app > .nav { inset-inline:0; bottom:0; top:auto; width:100%; height:var(--ui-nav-height); min-height:var(--ui-nav-height); display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:0; align-items:center; padding:6px 10px max(6px,env(safe-area-inset-bottom)); background:#fffefa; color:var(--ui-ink); border:0; border-block-start:1px solid var(--ui-rule); box-shadow:0 -4px 18px rgba(22,48,35,.035); }
#app > .nav .nav-btn { min-width:0; min-height:48px; padding:4px 1px; gap:5px; border:0; border-radius:0; color:#59675e; background:none; font-size:10px; font-weight:500; }
#app > .nav .nav-btn svg { width:22px; height:22px; }
#app > .nav .nav-btn.active { color:#154c36; font-weight:700; background:transparent; }
#app > .nav .nav-btn.active::after { display:none; }
#app > .nav .nav-action-ring { width:53px; height:53px; margin-top:-12px; border:3px solid #fffefa; border-radius:50%; background:var(--ui-green); color:white; box-shadow:0 3px 8px rgba(10,47,30,.12); }
#app > .nav .nav-action > [data-nav-label] { display:none; }
.desktop-nav-brand, .desktop-nav-footer { display:none; }

/* Reference 4 + Qatar: photographs lead, controls fit the morning glance. */
.home-experience { color:var(--ui-ink); }
.modern-greeting { margin:0 0 14px; }
.modern-greeting p { color:var(--ui-muted); font-size:11px; font-weight:500; margin:0 0 4px; }
.modern-greeting h2 { max-width:none; font-size:18px; font-weight:650; letter-spacing:-.02em; line-height:1.3; text-wrap:initial; }
.modern-greeting > span { margin-top:4px; font-size:12px; color:var(--ui-muted); line-height:1.5; }
.home-section-heading { min-height:32px; margin-bottom:6px; gap:8px; }
.home-section-heading h3 { font-size:15px; font-weight:650; letter-spacing:0; line-height:1.4; }
.home-section-heading > button { min-height:44px; font-size:11px; font-weight:500; color:var(--ui-muted); white-space:nowrap; }
.home-block + .home-block { margin-block-start:16px; }
.home-horse-rail { grid-auto-columns:min(65vw,255px); gap:12px; padding:0 0 3px; }
.home-horse-card { position:relative; display:block; height:244px; border:0; border-radius:12px; box-shadow:none; background:#e9e6dc; }
.home-horse-photo { height:100%; width:100%; }
.home-horse-card:has(img)::after { content:''; position:absolute; z-index:3; inset:40% 0 0; background:linear-gradient(transparent,rgba(13,29,21,.85)); pointer-events:none; }
.home-horse-copy { position:absolute; z-index:4; inset-inline:14px; inset-block-end:14px; padding:0 !important; }
.home-horse-copy strong { color:white; font-size:19px; font-weight:600; line-height:1.25; text-shadow:0 1px 2px rgba(0,0,0,.2); }
.home-horse-copy small { color:#fcf7ed; font-size:11px; line-height:1.45; }
.home-horse-arrow { display:none; }
.home-horse-card:not(:has(img)) .home-horse-copy strong { color:var(--ui-ink); text-shadow:none; }
.home-horse-card:not(:has(img)) .home-horse-copy small { color:var(--ui-muted); }
.horse-photo-empty { color:#4f5d50; background:#ebe9df; }
.horse-photo-empty svg { opacity:1; fill:none; stroke:currentColor; stroke-width:1.5; }
.horse-photo-empty span { font-size:12px; font-weight:500; line-height:1.5; max-width:18ch; }
.horse-photo-frame > .horse-photo-empty { position:absolute; inset:0; width:100%; height:100%; padding-bottom:54px; }
.home-quick-actions { border:0; gap:8px; }
.home-quick-actions button { min-height:69px; border:1px solid #ebe7de !important; background:var(--ui-card); border-radius:10px; padding:9px 5px; gap:7px; }
.home-quick-actions button:hover { background:#f0f4ed; border-color:#b5c7b6 !important; }
.home-quick-actions svg { width:24px; height:24px; stroke-width:1.5; }
.home-quick-actions span { font-size:11px; font-weight:500; line-height:1.35; }
.schedule-list { background:var(--ui-card); border:1px solid #ebe7de; border-radius:12px; padding:0 12px; }
.schedule-row { min-height:67px; grid-template-columns:56px minmax(0,1fr) 20px; }
.schedule-row time { color:var(--ui-ink); font-size:12px; font-weight:500; }
.schedule-row strong { font-size:13px; font-weight:600; }
.schedule-row small { color:var(--ui-muted); font-size:11px; }
.schedule-empty { padding:14px; border:1px solid var(--ui-rule); border-radius:12px; color:#5d6d66; }
.qatar-greeting { margin:0 0 12px; padding:0; border:0; background:none; }
.qatar-greeting h2 { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 12px; margin:0; font-size:17px; line-height:1.6; }
.qatar-greeting h2 span { font-size:17px; letter-spacing:normal; font-weight:600; }
.qatar-greeting >p { font-size:11px; color:#675742; margin-bottom:4px; }
.qatar-greeting >div { display:flex; flex-wrap:wrap; gap:3px 12px; font-size:12px; color:#65573f; }
.home-qatar .home-section-heading h3 { font-size:13px; font-family:var(--ff-body); line-height:1.6; }
html[data-view="qatar"]:not([data-inner-core]) body { background:#f6efe2; }
html[data-view="qatar"]:not([data-inner-core]) #app .header,html[data-view="qatar"]:not([data-inner-core]) #app>.nav { background:#f9f3e8; }
html[data-view="qatar"]:not([data-inner-core]) #app>.nav .nav-action-ring { background:#4a3525; border-color:#f9f3e8; }
.home-qatar .home-quick-actions button { color:#4d4731; background:#fff9ee; }

/* References 1 + 3: photograph and identity, not oversized titles. */
.luxury-mast { margin:0 0 12px; }
.luxury-mast span { font-size:10px; letter-spacing:.03em; }
.luxury-mast h2 { font-size:25px; line-height:1.15; margin:6px 0 8px; }
.luxury-feature, .luxury-feature-photo { height:300px; min-height:300px; border-radius:12px 12px 0 0; }
.luxury-feature-copy { border:0; }
.luxury-feature-copy strong { font-family:Georgia,serif; font-size:32px; }
.luxury-feature-copy small { font-size:10px; letter-spacing:.06em; }
.luxury-ledger { grid-template-columns:1fr; border:1px solid #e1d5be; border-radius:0 0 12px 12px; padding:0 14px; }
.luxury-ledger article { padding:13px 0; }
.luxury-ledger article+article { border-inline-start:0; border-block-start:1px solid #e1d5be; }
.luxury-ledger h3 { font-size:12px; letter-spacing:0; color:#745a2f; }
.luxury-ledger article>button { min-height:48px; }
.luxury-ledger article>button span,.luxury-ledger article>div strong { font-size:13px; }
.luxury-ledger article>button strong,.luxury-ledger article>button time,.luxury-ledger article>div span { font-size:11px; color:#6c5f49; }
html[data-view="luxury"]:not([data-inner-core]) #app>.nav { background:#32261e; border-block-start:1px solid #a28446; }
html[data-view="luxury"]:not([data-inner-core]) #app>.nav .nav-btn { color:#d9c9aa; }
html[data-view="luxury"]:not([data-inner-core]) #app>.nav .nav-btn.active { color:#edca77; }
html[data-view="luxury"]:not([data-inner-core]) #app>.nav .nav-action-ring { background:#c7a667; color:#31291e; border-color:#32261e; }
.passport-identity, .passport-identity-photo { height:304px; min-height:304px; }
.passport-identity { border-radius:12px 12px 0 0; }
.passport-identity-copy strong { font-family:Georgia,serif; font-size:31px; }
.passport-facts { border-radius:0 0 12px 12px; padding:16px; background:#fffdf7; }
.passport-facts span { font-size:11px; color:#596356; }
.passport-facts strong { font-size:12px; }
.passport-index { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:0; margin-top:14px; border:1px solid #e0dccf; border-radius:12px; background:#fffdf7; }
.passport-index button { display:flex; flex-direction:column; justify-content:center; gap:8px; min-height:78px; padding:8px 3px; border:0; border-inline-end:1px solid #ebe7dc; }
.passport-index button:last-child { border:0; }
.passport-index button span { font-size:11px; text-align:center; }
.passport-index button>svg:last-child { display:none; }
.passport-timeline { margin-top:18px; padding:16px; background:#fffdf7; border-radius:12px; }
.passport-timeline section h4 { font-size:11px; letter-spacing:.02em; }
.passport-timeline section button { min-height:50px; }
.passport-timeline section button span,.passport-timeline section button time,.passport-timeline section p { font-size:12px; }
html[data-view="passport"]:not([data-inner-core]) #app>.nav { background:#173f32; }
html[data-view="passport"]:not([data-inner-core]) #app>.nav .nav-btn { color:#e8e7d8; }
html[data-view="passport"]:not([data-inner-core]) #app>.nav .nav-btn.active { color:#f2cd85; }
html[data-view="passport"]:not([data-inner-core]) #app>.nav .nav-action-ring { background:#173f32; color:#f2cd85; border-color:#b59a61; }

/* Reference 2: operational density, sufficient contrast, no fake healthy state. */
html[data-view="command"]:not([data-inner-core]) body { background:#111b17; }
html[data-view="command"]:not([data-inner-core]) #app .header { background:#17241d; color:#f2f2e8; border-color:#344038; }
html[data-view="command"]:not([data-inner-core]) #app .view-context,html[data-view="command"]:not([data-inner-core]) #app .stable-switch { color:#bec9bb; border-color:#485345; }
html[data-view="command"]:not([data-inner-core]) #app .header-icon-btn { background:#2c382e; color:#ecf0e8; }
html[data-view="command"]:not([data-inner-core]) #app>.nav { background:#1b2820; border-color:#334838; }
html[data-view="command"]:not([data-inner-core]) #app>.nav .nav-btn { color:#c0cbbc; }
html[data-view="command"]:not([data-inner-core]) #app>.nav .nav-btn.active { color:#c4e7a5; }
html[data-view="command"]:not([data-inner-core]) #app>.nav .nav-action-ring { background:#597746; border-color:#1b2820; }
.home-command { color:#edf1e8; }
.command-heading { margin:0 0 16px; min-height:0; }
.command-heading h2 { font-size:23px; font-weight:600; line-height:1.2; }
.command-heading p { color:#c0c9be; font-size:12px; }
.command-heading>span { color:#bad29f; font-size:10px; text-transform:none; letter-spacing:0; border:0; }
.command-metrics { gap:7px; border:0; margin-bottom:18px; }
.command-metrics button { background:#243028; border:1px solid #384538; border-radius:9px; padding:12px 8px; min-height:96px; }
.command-metrics button:last-child { border:1px solid #384538; }
.command-metrics strong { font-size:27px; font-weight:500; }
.command-metrics span { color:#d4dbce; font-size:10px; line-height:1.5; text-transform:none; }
.home-command .home-section-heading h3 { color:#cbd5c6; font-size:12px; letter-spacing:.035em; font-weight:500; }
.command-queue { display:grid; gap:6px; margin-top:9px; }
.command-queue button { min-height:61px; padding:10px; background:#222d27; border:1px solid #364039; border-radius:8px; grid-template-columns:0 23px minmax(0,1fr) auto 14px; gap:9px; }
.command-queue button>i { display:none; }
.command-queue button>span { font-size:12px; font-weight:500; }
.command-queue button>strong { font-size:18px; color:#e6d7a7; }
.home-command .schedule-list { background:#222d27; border-color:#364039; }
.home-command .schedule-row time,.home-command .schedule-row strong { color:#f0f0e4; }
.home-command .schedule-row small { color:#becbbe; }
.home-command .schedule-empty { border-color:#364039; color:#becbbe; }
.home-command .schedule-empty strong { color:#eef1e6; }

/* Shared record mechanics; authored presentation overrides follow below. */
body.modal-open { overflow:hidden; }
.modal-overlay { backdrop-filter:none; background:rgba(15,28,20,.55); }
.modal-overlay .modal { --ink:var(--ui-ink); --ink-2:var(--ui-muted); --muted:var(--ui-muted); --surface:var(--ui-card); --surface-2:#f2f0e8; --line:var(--ui-rule); --line-2:#d7d5c8; --espresso:var(--ui-green); --gray-500:var(--ui-muted); }
.modal-overlay.profile-open { padding:0; align-items:flex-start; background:var(--ui-paper); }
.modal-overlay.profile-open #modal-content { position:relative; margin:0; width:100%; max-width:100%; height:100dvh; max-height:100dvh; padding:0 !important; border:0 !important; border-radius:0; overflow-y:auto; background:var(--ui-paper); box-shadow:none; }
.profile-core { color:var(--ui-ink); padding:0 0 calc(var(--ui-nav-height) + 16px); }
.profile-core .profile-cover { position:relative; min-height:0; height:304px; aspect-ratio:auto; margin:0; border-radius:0; overflow:hidden; }
.profile-core .profile-portrait { height:100%; width:100%; }
.profile-core .profile-cover img { width:100%; height:100%; object-fit:cover; object-position:50% 42%; }
.profile-core .profile-cover::after { z-index:3; inset:45% 0 0; background:linear-gradient(transparent,rgba(10,26,18,.82)); }
.profile-core .cover-name { inset-inline:22px; inset-block-end:28px; z-index:4; }
.profile-core .cover-name h2 { font:500 32px/1.15 Georgia,serif; letter-spacing:-.02em; color:#fff; }
.profile-core .cover-name .meta { margin:6px 0 0; color:#f5f4e6; opacity:1; font-size:12px; line-height:1.5; }
.profile-record-id { display:block; margin-top:5px; color:#e8e8db; font-size:10px; }
.profile-core .without-photo,.profile-core .profile-cover:not(:has(img)) { height:198px; background:#e5e8df; }
.profile-core .profile-cover:not(:has(img))::after { display:none; }
.profile-core .profile-cover:not(:has(img)) .cover-name h2 { color:var(--ui-ink); }
.profile-core .profile-cover:not(:has(img)) .cover-name .meta,.profile-core .profile-cover:not(:has(img)) .profile-record-id { color:var(--ui-muted); }
.profile-cover:not(:has(img)) .horse-photo-empty { padding-bottom:66px; }
.profile-back,.profile-more { position:absolute; top:max(16px,env(safe-area-inset-top)); z-index:5; display:grid; place-items:center; width:44px; height:44px; border:0; border-radius:50%; background:#fffdf6; color:#183e31; }
.profile-back { inset-inline-start:16px; }
.profile-more { inset-inline-end:16px; }
.profile-sheet { position:relative; z-index:4; margin-top:-12px; border-radius:15px 15px 0 0; background:var(--ui-paper); }
.profile-core .profile-tabs { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:0; position:sticky; top:0; z-index:6; margin:0; padding:0 10px; border:0; border-block-end:1px solid var(--ui-rule); border-radius:15px 15px 0 0; background:var(--ui-paper); scrollbar-width:none; }
.profile-tabs [role="tab"] { min-width:0; min-height:73px; padding:12px 1px 9px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; font-size:10px; font-weight:500; line-height:1.5; color:var(--ui-muted); background:none; border:0; border-bottom:2px solid transparent; }
.profile-tabs [role="tab"] svg { width:22px; height:22px; stroke-width:1.5; }
.profile-tabs [role="tab"][aria-selected="true"] { color:#856026; border-bottom-color:#b38b44; }
.profile-panel { padding:18px 17px 24px; min-height:220px; outline-offset:-3px; }
.record-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:0 0 13px; }
.record-heading:not(:first-child) { margin-top:24px; }
.record-heading h3 { font-family:var(--ff-body); font-size:17px; line-height:1.4; letter-spacing:-.015em; font-weight:600; margin:0; }
.record-add { display:inline-flex; align-items:center; gap:4px; min-height:44px; padding:8px 12px; flex:none; border:0; border-radius:24px; background:#99732f; color:#fff; font:500 11px/1.4 var(--ff-body); }
.record-add svg { width:15px; height:15px; }
.record-facts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px 18px; background:var(--ui-card); border:1px solid var(--ui-rule); border-radius:12px; padding:16px; margin:0; }
.record-facts div { min-width:0; }
.record-facts dt { font-size:11px; line-height:1.5; color:var(--ui-muted); }
.record-facts dd { margin:5px 0 0; font-size:13px; font-weight:500; line-height:1.45; overflow-wrap:anywhere; }
.record-links,.record-summary { display:grid; margin:16px 0; background:var(--ui-card); border:1px solid var(--ui-rule); border-radius:12px; overflow:hidden; }
.record-links button,.record-summary button { min-height:54px; padding:12px 14px; display:grid; grid-template-columns:23px minmax(0,1fr) 17px; gap:12px; align-items:center; width:100%; border:0; border-bottom:1px solid var(--ui-rule); background:none; color:var(--ui-ink); font-size:13px; text-align:start; }
.record-links button:last-child,.record-summary button:last-child { border:0; }
.record-summary small { display:block; margin-top:4px; font-size:11px; line-height:1.5; color:var(--ui-muted); }
.record-list { display:grid; gap:10px; }
.record-row { display:grid; grid-template-columns:27px minmax(0,1fr) auto; gap:12px; align-items:start; background:var(--ui-card); border:1px solid var(--ui-rule); border-radius:12px; padding:15px 13px; margin-bottom:8px; }
.record-row>svg { width:26px; height:26px; color:var(--ui-green); }
.record-row h4 { font:600 14px/1.45 var(--ff-body); margin:0 0 4px; color:var(--ui-ink); }
.record-row p { margin:3px 0 0; color:var(--ui-muted); font-size:12px; line-height:1.6; overflow-wrap:anywhere; }
.record-row .chip { display:inline-block; font-size:10px; font-weight:600; line-height:1.5; border:0; margin-top:8px; padding:3px 7px; border-radius:5px; }
.record-row .chip.ok { background:#e6efdf; color:#37582b; }
.record-row .chip.soon { background:#f3e9d6; color:#79571c; }
.record-row .chip.overdue { background:#f6e6df; color:#883d2e; }
.record-row-action,.record-delete { min-width:44px; min-height:44px; display:grid; place-content:center; padding:0; border:0; background:none; color:var(--ui-gold); }
.record-delete { color:#883d2e; font-size:11px; text-decoration:underline; }
.record-notice { display:flex; gap:12px; align-items:center; margin-top:16px; padding:14px; border:1px solid #e9c6b7; border-radius:10px; background:#fff7f1; color:#853f2d; font-size:13px; }
.record-notice>svg { flex:none; }
.record-notice button { background:none; border:0; min-height:44px; margin-inline-start:auto; color:inherit; text-decoration:underline; }
.record-prose { padding:18px; background:var(--ui-card); border:1px solid var(--ui-rule); border-radius:12px; }
.record-prose h4 { font:600 13px/1.5 var(--ff-body); margin:0 0 8px; }
.record-prose h4:not(:first-child) { margin-top:24px; }
.record-prose p { white-space:pre-wrap; overflow-wrap:anywhere; font-size:14px; line-height:1.7; color:var(--ui-muted); }
.record-disclaimer { margin-top:18px; font-size:11px; line-height:1.7; color:var(--ui-muted); }
.tracker-link { width:100%; display:grid; grid-template-columns:24px minmax(0,1fr) 18px; align-items:center; gap:12px; text-align:start; border:0; border-radius:12px; background:#eaf0e5; color:#264b35; padding:14px; margin-bottom:16px; font-size:13px; }
.tracker-link small { display:block; margin-top:4px; font-size:11px; line-height:1.5; }
.profile-photo-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.profile-photo-grid figure { margin:0; min-width:0; overflow:hidden; background:var(--ui-card); border:1px solid var(--ui-rule); border-radius:12px; }
.profile-photo-grid img { width:100%; aspect-ratio:4/5; object-fit:cover; display:block; }
.profile-photo-grid figcaption { display:flex; flex-wrap:wrap; gap:4px 8px; padding:6px 10px; align-items:center; font-size:11px; min-height:48px; }
.profile-photo-grid button { border:0; background:none; color:var(--ui-green); min-height:44px; font-size:11px; text-decoration:underline; }
.profile-bottom-nav { position:fixed; z-index:10; inset-inline:0; bottom:0; min-height:var(--ui-nav-height); display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); align-items:center; padding:6px 12px max(6px,env(safe-area-inset-bottom)); background:#fffefa; border-top:1px solid var(--ui-rule); }
.profile-bottom-nav button { min-width:0; display:grid; place-content:center; justify-items:center; gap:5px; min-height:48px; border:0; background:none; font-size:10px; color:#5b6c60; }
.profile-bottom-nav button.active { color:#174b35; font-weight:650; }
.profile-bottom-nav .profile-nav-add { width:53px; height:53px; margin-top:-14px; justify-self:center; border-radius:50%; background:#164b37; color:white; border:3px solid #fffefa; }
.profile-edit { width:100%; margin-top:16px; }
.record-return { display:flex; align-items:center; gap:8px; min-height:44px; margin:0 0 14px; border:0; background:none; color:var(--ui-green); font-size:13px; }
.record-return svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.7; }
.record-form-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:16px; }
.profile-action-menu button { width:100%; display:flex; align-items:center; justify-content:space-between; min-height:56px; border:0; border-bottom:1px solid var(--ui-rule); background:none; font-size:14px; color:var(--ui-ink); padding:12px 0; }
.profile-action-menu svg { width:18px; height:18px; }

/* Roster: full photographs, identifiers for duplicate names, local fast search. */
.roster-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:20px; }
.roster-heading h2 { font:500 30px/1.2 Georgia,serif; color:var(--ui-ink); }
.roster-heading p { font-size:12px; color:var(--ui-muted); line-height:1.5; margin-top:5px; }
html[data-view="command"] #app .roster-heading h2 { color:#eef1e9; }
html[data-view="command"] #app .roster-heading p { color:#bdc8c0; }
.roster-heading .btn,.roster-tools .btn { display:inline-flex; align-items:center; gap:6px; min-height:44px; font-size:12px; }
.roster-heading svg,.roster-tools svg { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.7; }
.roster-tools { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.roster-search { position:relative; display:flex; align-items:center; gap:10px; flex:1 0 100%; min-height:48px; border:1px solid #cbcfc3; border-radius:10px; background:#fffefa; padding:0 12px; }
.roster-search:focus-within { outline:3px solid #b49b64; outline-offset:2px; }
.roster-search input { border:0; outline:0; background:none; width:100%; min-width:0; height:46px; font:14px var(--ff-body); color:var(--ui-ink); }
.roster-search input::placeholder { color:#5e6e61; }
.roster-count { margin:16px 0 10px; color:var(--ui-muted); font-size:12px; }
#rosterGrid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
#rosterGrid .roster-horse { padding:0; border:1px solid var(--ui-rule); border-radius:12px; background:#fffefa; color:var(--ui-ink); overflow:hidden; box-shadow:none; text-align:start; cursor:pointer; }
.roster-photo { display:block; position:relative; height:204px; }
.roster-portrait { width:100%; height:100%; }
.roster-photo:has(img)::after { content:''; position:absolute; z-index:3; inset:45% 0 0; background:linear-gradient(transparent,rgba(11,28,17,.85)); }
.roster-identity { position:absolute; z-index:4; bottom:13px; inset-inline:12px; color:white; }
.roster-identity strong { display:block; font:500 19px/1.2 Georgia,serif; overflow-wrap:anywhere; }
.roster-identity small { display:block; margin-top:5px; font-size:10px; line-height:1.45; }
.roster-photo:not(:has(img)) .roster-identity { color:var(--ui-ink); }
.roster-photo .horse-photo-empty { padding-bottom:85px; }
.roster-photo .horse-photo-empty svg { width:34px; height:34px; }
.roster-photo .horse-photo-empty span { font-size:10px; }
.roster-card-foot { display:flex; flex-wrap:wrap; gap:8px; padding:10px; align-items:center; }
.roster-card-foot .chip { margin:0; padding:3px 5px; font-size:9px; }
#app .roster-card-foot .chip.muted { color:#4f6159; background:#efe7d7; }
html[data-view="command"] #app .roster-card-foot .chip.muted { color:#c0d0c6; background:#20312a; }
.roster-card-foot svg { width:15px; height:15px; fill:none; stroke:currentColor; stroke-width:1.7; margin-inline-start:auto; }
.roster-id { font-size:10px; color:var(--ui-muted); }
.ui-empty,.ui-error { display:grid; justify-items:center; align-content:center; gap:10px; padding:32px 20px; min-height:160px; text-align:center; color:var(--ui-muted); grid-column:1/-1; }
.ui-empty>svg,.ui-error>svg { width:32px; height:32px; fill:none; stroke:currentColor; stroke-width:1.6; }
.ui-empty p,.ui-error p { max-width:40ch; font-size:14px; line-height:1.6; margin:0; }
.ui-error h3 { font:600 18px/1.4 var(--ff-body); }
.ui-loading { padding:24px 8px; display:grid; gap:14px; min-height:220px; align-content:start; }
.ui-skeleton { height:64px; background:#e8e8df; border-radius:12px; }
.ui-skeleton:first-child { height:130px; }
html[data-view="command"]:not([data-inner-core]) .ui-error { color:#e9eadf; }
html[data-view="command"]:not([data-inner-core]) #dashboard-content .ui-skeleton { background:#26352c; }
.modal .ui-error { color:var(--ui-muted) !important; }

/* Arabic is a full interface, not a caption. */
html[dir="rtl"] body { font-family:'Noto Sans Arabic',Tahoma,Arial,sans-serif; }
html[dir="rtl"] .profile-core,html[dir="rtl"] .home-experience { font-family:'Noto Sans Arabic',Tahoma,Arial,sans-serif; line-height:1.65; }
html[dir="rtl"] .profile-core h2,html[dir="rtl"] .home-experience h2,html[dir="rtl"] .home-experience h3,html[dir="rtl"] .roster-heading h2 { font-family:inherit; letter-spacing:normal; line-height:1.6; }
html[dir="rtl"] .profile-tabs button,html[dir="rtl"] .home-quick-actions span,html[dir="rtl"] .record-heading h3 { line-height:1.65; letter-spacing:normal; }
html[dir="rtl"] .profile-back svg,html[dir="rtl"] .record-return svg,html[dir="rtl"] .record-row-action svg { transform:scaleX(-1); }
html[dir="rtl"] .home-horse-copy strong,html[dir="rtl"] .roster-identity strong { font-family:inherit; letter-spacing:normal; line-height:1.5; }

@media(min-width:760px) {
  #app #mainContent .section { padding:24px 28px calc(var(--ui-nav-height) + 24px); }
  .home-modern,.home-qatar { display:grid; grid-template-columns:1fr 1fr; gap:24px; }
  .home-modern>.modern-greeting,.home-qatar>.qatar-greeting,.home-modern>.home-block:first-of-type,.home-qatar>.home-block:first-of-type { grid-column:1/-1; }
  .home-modern .home-block,.home-qatar .home-block { margin:0; min-width:0; }
  .home-horse-rail { grid-auto-flow:column; grid-auto-columns:calc((100% - 24px)/3); grid-template-columns:none; overflow-x:auto; }
  .home-horse-card { height:290px; }
  .home-horse-photo { height:100%; }
  .home-quick-actions button { min-height:86px; }
  .home-quick-actions span { font-size:12px; }
  .home-luxury { display:grid; grid-template-columns:1.3fr 1fr; gap:0; }
  .luxury-mast { grid-column:1/-1; text-align:start; }
  .luxury-feature,.luxury-feature-photo { height:440px; min-height:440px; border-radius:12px 0 0 12px; }
  .luxury-ledger { border-radius:0 12px 12px 0; padding:8px 20px; }
  .luxury-open-record { grid-column:1/-1; }
  .home-passport { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
  .passport-identity { grid-row:1/4; }
  .passport-identity,.passport-identity-photo { height:470px; min-height:470px; border-radius:12px; }
  .passport-facts,.passport-index,.passport-timeline { margin:0; }
  .passport-timeline { grid-column:1/-1; }
  .home-command { display:grid; grid-template-columns:1.15fr 1fr; gap:0 24px; }
  .command-heading,.command-metrics { grid-column:1/-1; }
  .command-metrics button { min-height:106px; }
  #rosterGrid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
  .roster-photo { height:265px; }
  .roster-search { flex:1; }
  .modal-overlay.profile-open { align-items:center; padding:24px; background:rgba(15,28,20,.55); }
  .modal-overlay.profile-open #modal-content { max-width:1020px; width:100%; height:min(810px,calc(100dvh - 48px)); max-height:calc(100dvh - 48px); border-radius:18px; overflow:hidden; }
  .profile-core { display:grid !important; grid-template-columns:36% minmax(0,1fr); grid-template-rows:minmax(0,1fr) 76px; height:100%; padding:0; }
  .profile-core .profile-cover,.profile-core .profile-cover:not(:has(img)) { grid-column:1; grid-row:1; height:100%; min-height:0; border-radius:0; }
  .profile-core .cover-name { inset-inline:20px; bottom:28px; }
  .profile-core .profile-sheet { grid-column:2; grid-row:1; margin:0; border-radius:0; overflow-y:auto; }
  .profile-core .profile-tabs { border-radius:0; }
  .profile-panel { padding:22px; }
  .profile-bottom-nav { grid-column:1/-1; grid-row:2; position:static; padding:8px 20%; }
  .profile-core .profile-back { top:18px; }
}
@media(min-width:1024px) {
  #app>.nav { inset:0 auto 0 0; height:100dvh; width:204px; display:flex; flex-direction:column; justify-content:flex-start; padding:28px 16px; border:0; border-inline-end:1px solid var(--ui-rule); box-shadow:none; }
  html[dir="rtl"] #app>.nav { inset:0 0 0 auto; }
  #app>.nav .nav-btn { width:100%; min-height:52px; display:flex; flex-direction:row; justify-content:flex-start; align-items:center; gap:14px; padding:10px 14px; border-radius:9px; font-size:13px; }
  #app>.nav .nav-btn.active { background:#eaf0e5; }
  #app>.nav .nav-action { order:5; margin-top:14px; }
  #app>.nav .nav-action-ring { width:34px; height:34px; margin:0; border:0; box-shadow:none; }
  #app>.nav .nav-action>[data-nav-label] { display:block; }
  .desktop-nav-brand { display:block; width:100%; margin-bottom:38px; color:inherit; font:500 25px/1.4 Georgia,serif; padding:4px 10px; }
  .desktop-nav-footer { display:block; order:10; margin-top:auto; padding:18px 8px 0; }
  .desktop-nav-footer a { color:inherit; font-size:12px; text-underline-offset:4px; }
  #app .header { margin-inline-start:204px; padding:14px 32px; min-height:80px; }
  #app #mainContent { margin-inline-start:204px; }
  #app #mainContent .section { padding:30px 32px 40px; }
  #app .brand-lockup { max-width:none; }
  #app .brand-copy { gap:0 20px; }
  #app .header .logout-btn { display:flex; width:auto; min-width:90px; border-radius:8px; padding:8px 12px; gap:6px; font-size:12px; }
  #app .header .logout-btn svg { width:18px; }
  .modern-greeting h2 { font-size:24px; }
  .modern-greeting>span { font-size:14px; }
  .home-horse-card { height:315px; }
  html[data-view="command"]:not([data-inner-core]) #app>.nav .nav-btn.active { background:#33432f; }
}
@media(max-width:370px) {
  #app .brand-mark { display:none; }
  #app .brand-copy { column-gap:8px; }
  #app .stable-switch { max-width:135px; }
  .profile-tabs [role="tab"] { font-size:9px; }
  .roster-photo { height:184px; }
  .roster-heading { flex-wrap:wrap; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto !important; animation:none !important; transition:none !important; } }

/* Restore the authored materials and density without replacing the home DOM. */
html[data-view="luxury"]:not([data-inner-core]) body { background:#fffaf0; }
.home-luxury { --ui-ink:#3a281f; }
.home-luxury .luxury-mast { padding-block:12px 20px; text-align:center; }
.home-luxury .luxury-mast h2 { font-family:var(--ff-display); font-size:clamp(2rem,8vw,3.4rem); font-weight:500; }
.home-luxury :is(.luxury-feature,.luxury-feature-photo,.luxury-ledger) { border-radius:0; }
.home-luxury .luxury-ledger { border-inline:0; }
.home-luxury .luxury-ledger h3 { font-family:var(--ff-display); font-size:17px; font-weight:500; text-transform:none; }
.home-luxury .luxury-feature-copy { border-block-start:1px solid #c7b184; padding-block-start:12px; }
.home-passport :is(.passport-identity,.passport-facts,.passport-index,.passport-timeline) { border-radius:0; }
.home-passport .passport-index { grid-template-columns:repeat(2,minmax(0,1fr)); border-color:#c7b98f; }
.home-passport .passport-index button { flex-direction:row; justify-content:flex-start; padding:12px; min-height:56px; border-block-end:1px solid #e0dccf; }
.home-passport .passport-index button span { text-align:start; }
.home-passport .passport-timeline { border-block-start:1px solid #bcae8e; }
.home-command .command-metrics button { border-radius:3px; }
.home-command .command-queue { gap:0; }
.home-command .command-queue button { min-height:48px; border:0; border-block-end:1px solid #364039; border-radius:0; grid-template-columns:5px 23px minmax(0,1fr) auto 14px; }
.home-command .command-queue button>i { display:block; width:5px; height:16px; }
.home-command .command-heading h2 { font-weight:760; }
.home-qatar .qatar-greeting { padding:20px; background:#4a3729; border-block-end:2px solid #bd9851; }
.home-qatar .qatar-greeting h2 { display:block; color:#fff7e7; }
.home-qatar .qatar-greeting h2 span { display:block; font-size:22px; }
.home-qatar .qatar-greeting>p { color:#e0c792; }
.home-qatar .qatar-greeting>div { color:#efe1ca; }
.home-qatar .home-horse-rail { grid-auto-flow:row; grid-auto-columns:auto; grid-template-columns:repeat(2,minmax(0,1fr)); overflow:visible; }
.home-qatar .home-horse-card { height:220px; border-radius:7px; }
.home-qatar .home-horse-card:first-child { grid-column:1/-1; height:320px; }
.home-qatar .home-horse-copy strong { color:#fffaf0; }
.home-qatar .home-horse-card:not(:has(img)) .home-horse-copy strong { color:#4a3729; }
html[data-view="qatar"]:not([data-inner-core]) #app>.nav { background:#4a3729; border-color:#bd9851; }
html[data-view="qatar"]:not([data-inner-core]) #app>.nav .nav-btn { color:#eadfc9; }
html[data-view="qatar"]:not([data-inner-core]) #app>.nav .nav-btn.active { color:#f2cd85; }
html[data-view="qatar"]:not([data-inner-core]) #app>.nav .nav-action-ring { background:#bd9851; color:#30241b; border-color:#4a3729; }
html:is([data-view="luxury"],[data-view="passport"],[data-view="qatar"]):not([data-inner-core]) #app>.nav .nav-btn.active { background:rgba(255,255,255,.08); }

/* One profile tree, five reading layouts. Local tokens override Core behind
   the modal; all tabs, factual status chips and permission checks stay shared. */
.profile-core.profile-view {
  --profile-radius:12px; --profile-nav:#fffefa; --profile-nav-ink:#375a49;
  --profile-accent:#856026; --profile-display:var(--ff-display);
  --ink:var(--ui-ink); --ink-2:var(--ui-muted); --muted:var(--ui-muted);
  --surface:var(--ui-card); --surface-2:var(--ui-paper); --line:var(--ui-rule);
  --line-2:var(--ui-rule); --espresso:var(--ui-green); --gold-2:var(--profile-accent);
  display:block; background:var(--ui-paper); min-width:0;
}
.profile-core .profile-sheet { min-width:0; }
.profile-core .cover-name h2 { overflow-wrap:anywhere; font-family:var(--profile-display); }
.profile-core .profile-identity-band { padding:18px 17px 0; }
.profile-core .profile-identity-band .record-facts { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.profile-core .profile-identity-band .record-facts>div:first-child { grid-column:1/-1; }
.profile-core :is(.record-facts,.record-links,.record-summary,.record-row,.record-prose,.profile-photo-grid figure,.tracker-link) { border-radius:var(--profile-radius); }
.profile-core .profile-tabs { border-radius:0; }
.profile-core .profile-tabs [aria-selected="true"] { color:var(--profile-accent); border-bottom-color:var(--profile-accent); }
.profile-core .profile-bottom-nav { background:var(--profile-nav); border-color:var(--ui-rule); }
.profile-core .profile-bottom-nav button { color:var(--profile-nav-ink); }
.profile-core .profile-bottom-nav button.active { color:var(--profile-nav-ink); text-decoration:underline; text-underline-offset:5px; }
.profile-core .profile-bottom-nav .profile-nav-add { background:var(--profile-nav-ink); color:var(--profile-nav); border-color:var(--profile-nav); }
.profile-core .record-heading { flex-wrap:wrap; }
.profile-core .record-add { flex-shrink:1; text-align:start; }
.profile-core .record-heading h3 { overflow-wrap:anywhere; }
.profile-core .horse-photo-empty { color:var(--ui-muted); background:var(--ui-paper); }

/* Luxury: an ivory journal, tall plate, centred identity and fine ledger rules. */
.profile-core.profile-luxury {
  --ui-paper:#fffaf0; --ui-card:#fffaf0; --ui-ink:#3a281f; --ui-muted:#6b5748;
  --ui-rule:#d6c4a4; --ui-green:#3a281f; --profile-radius:0;
  --profile-nav:#3a281f; --profile-nav-ink:#edca77;
}
.profile-core.profile-luxury .profile-cover { height:410px; border:0; }
.profile-core.profile-luxury .cover-name { text-align:center; }
.profile-core.profile-luxury .profile-sheet { margin:0; border-radius:0; }
.profile-core.profile-luxury .record-facts { border-inline:0; padding-inline:0; }
.profile-core.profile-luxury .record-heading h3 { font-family:var(--profile-display); font-size:22px; font-weight:500; }
.profile-core.profile-luxury .record-links { border-inline:0; }

/* Command: compact identity row and a dense, dark working board. */
.profile-core.profile-command {
  --ui-paper:#0d1714; --ui-card:#172620; --ui-ink:#edf1e8; --ui-muted:#bac9bd;
  --ui-rule:#41554a; --ui-green:#b6d1b3; --profile-radius:3px;
  --profile-nav:#172620; --profile-nav-ink:#d3e8bd; --profile-accent:#edca77;
  --profile-display:var(--ff-body);
}
.profile-core.profile-command .profile-cover { display:grid; grid-template-columns:96px minmax(0,1fr); gap:16px; height:auto; min-height:184px; padding:68px 16px 16px; background:var(--ui-card); }
.profile-core.profile-command .profile-cover::after { display:none; }
.profile-core.profile-command .profile-portrait { height:112px; border-radius:3px; }
.profile-core.profile-command .cover-name { position:static; align-self:center; padding:0; min-width:0; }
.profile-core.profile-command .cover-name h2 { font-family:var(--ff-body); font-size:26px; }
.profile-core.profile-command .profile-sheet { margin:0; border-radius:0; }
.profile-core.profile-command .profile-identity-band { padding:12px 16px; }
.profile-core.profile-command .profile-identity-band .record-facts { grid-template-columns:repeat(3,minmax(0,1fr)); padding:10px; gap:10px; }
.profile-core.profile-command .profile-identity-band .record-facts>div:first-child { grid-column:auto; }
.profile-core.profile-command .profile-tabs [role="tab"] { min-height:58px; padding-block:8px; }
.profile-core.profile-command .profile-panel { padding:16px; }
.profile-core.profile-command .record-list { gap:0; }
.profile-core.profile-command .record-row { padding:12px; margin:0; border-inline:0; border-block-start:0; }
.profile-core.profile-command .record-add { background:#edca77; color:#172620; border-radius:3px; }
.profile-core.profile-command .btn-primary { background:#edca77; color:#172620; box-shadow:none; }
.profile-core.profile-command .record-delete { color:#ffb8a7; }
.profile-core.profile-command .record-row-action { color:#edca77; }
.profile-core.profile-command .profile-cover:not(:has(img)) .horse-photo-empty { padding:8px; }
.profile-core.profile-command .profile-cover:not(:has(img)) .cover-name h2 { color:var(--ui-ink); }

/* Passport: green photographic cover followed by the official identity folio. */
.profile-core.profile-passport {
  --ui-paper:#e9e2d2; --ui-card:#fffdf7; --ui-ink:#173f32; --ui-muted:#526454;
  --ui-rule:#c8b88e; --ui-green:#173f32; --profile-radius:0;
  --profile-nav:#173f32; --profile-nav-ink:#f0ddb1;
}
.profile-core.profile-passport .profile-cover { height:350px; border:0; border-block-end:4px solid #bd9851; }
.profile-core.profile-passport .profile-sheet { margin:0; border-radius:0; }
.profile-core.profile-passport .profile-identity-band { padding:18px; }
.profile-core.profile-passport .profile-identity-band .record-facts { display:block; border:1px solid #bd9851; padding:4px 16px; }
.profile-core.profile-passport .profile-identity-band .record-facts>div { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.2fr); gap:12px; padding-block:12px; border-block-end:1px solid var(--ui-rule); }
.profile-core.profile-passport .profile-identity-band .record-facts>div:last-child { border:0; }
.profile-core.profile-passport .profile-identity-band dd { margin:0; }
.profile-core.profile-passport .profile-identity-band>dl>div:first-child dd { font-family:var(--profile-display); font-size:20px; }
.profile-core.profile-passport .record-heading h3 { font-family:var(--profile-display); font-size:22px; }

/* Modern keeps the established photographic owner sheet and spacious cards. */
.profile-core.profile-modern { --ui-paper:#faf8f3; --ui-card:#fffefa; --ui-ink:#183e31; --ui-muted:#586b62; --ui-rule:#e5e1d8; --ui-green:#164b37; }
.profile-core.profile-modern .profile-identity-band .record-facts { border:0; background:transparent; padding:0 0 18px; }

/* Qatar: framed photography, sand record paper and brown/gold navigation. */
.profile-core.profile-qatar {
  --ui-paper:#eadfc9; --ui-card:#fff9ee; --ui-ink:#4a3729; --ui-muted:#67543f;
  --ui-rule:#cdbb93; --ui-green:#4a3729; --profile-radius:7px;
  --profile-nav:#4a3729; --profile-nav-ink:#f0ddb1;
}
.profile-core.profile-qatar .profile-cover { height:360px; margin:12px; border:1px solid #bd9851; border-radius:7px; }
.profile-core.profile-qatar .profile-sheet { margin:0; border-radius:0; }
.profile-core.profile-qatar .profile-identity-band { padding-block-start:6px; }
.profile-core.profile-qatar .profile-identity-band .record-facts { border:0; border-block:1px solid #ad8a50; background:transparent; border-radius:0; }
.profile-core.profile-qatar .profile-tabs { padding-inline:8px; }
.profile-core.profile-qatar .profile-tabs [role="tab"] { min-height:80px; font-size:11px; }

/* A missing or failed image is compact and honest, across all five layouts. */
.profile-core:not(.profile-command) .profile-cover:not(:has(img)) { height:auto; min-height:220px; padding:68px 18px 20px; }
.profile-core:not(.profile-command) .profile-cover:not(:has(img)) .profile-portrait { height:auto; min-height:66px; }
.profile-core:not(.profile-command) .profile-cover:not(:has(img)) .horse-photo-empty { padding:0; min-height:66px; }
.profile-core:not(.profile-command) .profile-cover:not(:has(img)) .cover-name { position:relative; inset:auto; margin-block-start:16px; }
.home-experience :is(.luxury-feature,.passport-identity):not(:has(img)) { height:auto; min-height:220px; }
.home-experience :is(.luxury-feature,.passport-identity):not(:has(img)) :is(.luxury-feature-photo,.passport-identity-photo) { height:120px; min-height:120px; }
.home-experience :is(.luxury-feature,.passport-identity):not(:has(img)) :is(.luxury-feature-copy,.passport-identity-copy) { position:relative; inset:auto; display:block; margin:16px 20px; color:var(--ui-ink); }
.home-experience :is(.luxury-feature,.passport-identity):not(:has(img)) { background:#fffaf0; }
.home-experience :is(.luxury-feature,.passport-identity):not(:has(img)) small { color:#735b30; }
.home-experience .passport-identity:not(:has(img)) .passport-seal { color:#173f32; }
.home-qatar .home-horse-card:not(:has(img)) { height:200px; }

/* Preserve Arabic shaping and logical alignment; never change root direction. */
html[dir="rtl"] .profile-core { --profile-display:'Noto Sans Arabic',Tahoma,Arial,sans-serif; }
html[dir="rtl"] .profile-core .cover-name h2,
html[dir="rtl"] .profile-core .record-heading h3,
html[dir="rtl"] .home-luxury .luxury-mast h2 { font-family:inherit; letter-spacing:normal; line-height:1.6; }
.profile-core .profile-tabs button span,.profile-core .profile-bottom-nav button span { overflow-wrap:anywhere; }
.profile-core .profile-identity-band dd { unicode-bidi:plaintext; }

@media(min-width:760px) {
  .home-qatar .home-horse-rail { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .home-qatar .home-horse-card:first-child { grid-column:span 2; height:350px; }
  .home-qatar .home-horse-card { height:350px; }
  .profile-core.profile-luxury { grid-template-columns:48% minmax(0,1fr); }
  .profile-core.profile-passport { grid-template-columns:42% minmax(0,1fr); }
  .profile-core.profile-qatar { grid-template-columns:44% minmax(0,1fr); }
  .profile-core:is(.profile-luxury,.profile-passport,.profile-qatar) .profile-cover { height:100%; min-height:0; }
  .profile-core.profile-qatar .profile-cover { height:calc(100% - 24px); }
  .profile-core.profile-command { grid-template-columns:1fr; grid-template-rows:auto minmax(0,1fr) 76px; }
  .profile-core.profile-command .profile-cover { grid-column:1; grid-row:1; grid-template-columns:112px minmax(0,1fr); min-height:0; padding:18px 76px; }
  .profile-core.profile-command .profile-sheet { grid-column:1; grid-row:2; }
  .profile-core.profile-command .profile-bottom-nav { grid-row:3; }
  .profile-core.profile-command .profile-panel .record-summary { grid-template-columns:1fr 1fr; }
  .profile-core.profile-command .profile-cover:not(:has(img)) { height:auto; }
}

/* Native gallery pages keep decoded image memory bounded and opening in-app. */
.profile-photo-grid .profile-photo-open { display:block; padding:0; width:100%; text-decoration:none; }
.profile-photo-pages { display:flex; flex-wrap:wrap; gap:8px; margin-block:16px; }
.profile-photo-pages button,.profile-photo-viewer button { min-width:44px; min-height:44px; padding:8px 12px; border:1px solid var(--ui-rule); border-radius:8px; background:var(--ui-card); color:var(--ui-green); font:inherit; }
.profile-photo-pages [aria-current="page"] { font-weight:700; outline:2px solid currentColor; }
.profile-photo-viewer img { display:block; max-width:100%; max-height:70vh; object-fit:contain; margin:12px auto; }

/* Command keeps its dark palette inside YardMate Core pages: #app stays on the
   view's dark paper, so the light Core ink tokens would be unreadable there. */
html[data-view="command"][data-inner-core="true"] {
  --sand:#0d1714; --sand-2:#101d19; --surface:#172620; --surface-2:#12211c;
  --ink:#eef5ef; --ink-2:#c0d0c6; --muted:#a3b5ab; --line:#294238; --line-2:#365347;
  --gold:#d8a94e; --gold-2:#e2b85c; --gold-soft:#352d18;
  --green:#69b583; --green-bg:#173a28; --green-ink:#9cdfb1;
  --gray-100:#20312a; --gray-500:#a3b5ab;
}
html[data-view="command"][data-inner-core="true"] #mainContent :is(.btn-outline,.care-info-link,.care-refresh:hover,.invite-code,.ops-panel-head h3,.ops-stat strong,.tone-horse) { color:var(--ink); }
html[data-view="command"][data-inner-core="true"] #mainContent :is(.btn-green,.btn-red) { color:#0d1714; }
.removal-receipt-code { display:block; overflow-wrap:anywhere; word-break:break-all; user-select:all; font-size:13px; }
html[data-view="luxury"][data-inner-core="true"] #mainContent .card-title { color:#7f6128; }
/* Command's horizontal roster card has no overlaid name, so the Modern
   bottom padding pushed the placeholder icon out of view on a beige tile. */
html[data-view="command"] #app .roster-photo .horse-photo-empty { padding:8px; background:#1b2820; color:#bdc8c0; }
/* Stable choices are real buttons (keyboard + screen reader); Manage stays a sibling. */
.stable-row .stable-pick { display:flex; flex:1; min-width:0; align-items:center; gap:12px; min-height:44px; padding:0; border:0; background:none; color:inherit; font:inherit; text-align:start; cursor:pointer; }
.form-hint { margin:8px 0 0; font-size:13px; line-height:1.5; color:var(--ui-muted); display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
/* style.css removes the native select arrow (-webkit-appearance:none) without a
   replacement, so dropdowns looked like text fields; add a chevron. */
.form-group select { background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2360746c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 14px center; padding-inline-end:40px; }
html[dir="rtl"] .form-group select { background-position:left 14px center; }
.feed-lines-title { margin:16px 0 6px; font-size:13px; font-weight:600; color:var(--ui-muted); }
/* 44px close target (was 34px); keyboard-focusable rows show focus. */
.modal-close { min-width:44px; min-height:44px; }
[role="button"][data-act]:focus-visible { outline:2px solid var(--ui-green, #164b37); outline-offset:2px; }
/* Muted chips on light surfaces (modals are light in every view) were 4.05:1. */
html:not([data-view="command"]) .chip.muted, #modal-content .chip.muted { color:#4f6159; background:#efe7d7; }
.ymv-proof { margin-top:10px; display:inline-flex; min-height:44px; align-items:center; }
.ymv-more { margin-top:10px; min-height:44px; }
.vax-delete, .ymv-profile .vax-delete { margin-top:10px; width:100%; color:#9d2b20; border-color:#c99a93; min-height:44px; }
.conflict-panel { margin:0 0 14px; padding:12px 14px; border:1px solid #c99a93; border-radius:12px; background:#fff4f1; color:#5c1d15; }
.conflict-panel ul { margin:8px 0; padding:0; list-style:none; display:grid; gap:6px; }
.conflict-panel li { display:grid; gap:2px; font-size:13px; }
.conflict-actions { display:flex; flex-wrap:wrap; gap:8px; }
.conflict-actions .btn { min-height:44px; }
/* Feeding toggles are native, labelled checkboxes (keyboard + screen reader). */
fieldset.toggle-grid { border:0; padding:0; margin:0; min-width:0; }
.toggle-btn { position:relative; cursor:pointer; }
.toggle-btn input[type="checkbox"] { position:absolute; opacity:0; width:1px; height:1px; margin:0; }
.toggle-btn:has(input:checked) { background:var(--green-bg); border-color:var(--green); color:var(--green-ink); }
.toggle-btn:has(input:checked) .check::after { content:"✓"; }
.toggle-btn:not(:has(input:checked)) .check::after { content:"○"; color:var(--line-2); }
.toggle-btn:has(input:focus-visible) { outline:2px solid var(--green); outline-offset:2px; }
.ymv-remove, .ymv-profile .ymv-remove { margin-top:6px; min-height:44px; padding:0 12px; border:1px solid #c99a93; border-radius:10px; background:none; color:#9d2b20; font-size:13px; }
html[data-view="command"] .ymv-profile .ymv-remove { color:#ff9b8e; border-color:#a5564c; } /* AA on the dark profile (was 2.41:1) */
/* Variant-less .btn (Yard Board '+ Yard item', 'Manage'...) kept the browser's
   pale default background under Command's light text (1.01:1). */
html[data-view="command"][data-inner-core="true"] #mainContent .btn:not(.btn-primary):not(.btn-green):not(.btn-red):not(.btn-amber):not(.btn-outline) { background:transparent; border:1px solid var(--line-2); color:var(--ink); }
html[data-inner-core="true"]:not([data-view="command"]) #mainContent .ops-panel .btn:not(.btn-primary):not(.btn-green):not(.btn-red):not(.btn-amber):not(.btn-outline) { background:var(--surface); border:1px solid var(--line-2); color:var(--ink); }
/* Sign-in guest entry (was inline styles + hard-coded English). */
.guest-cta { display:block; text-align:center; background:#244b3b; color:#fff; padding:16px; border-radius:10px; font-weight:700; text-decoration:none; margin:0 0 12px; }
.guest-cta-note { font-size:.82rem; color:#5f685c; margin:0 0 20px; }
html[dir="rtl"] .guest-cta-arrow { display:inline-block; transform:scaleX(-1); }
.attention-group { margin:14px 0 6px; font-size:14px; }
.attention-list { list-style:none; margin:0; padding:0; display:grid; gap:8px; }
.attention-row { display:grid; gap:8px; padding:10px 0; border-bottom:1px solid var(--line); }
.attention-reasons { display:flex; flex-wrap:wrap; gap:8px; }
.attention-row .btn { min-height:44px; white-space:normal; text-align:start; }
.attention-more { width:100%; min-height:44px; margin-top:14px; }
/* Yard Board forms (.form-grid) had no styles: labels ran into 23px selects.
   Match the shared .form-group look: stacked labels, full-width 44px controls. */
.form-grid { display:grid; gap:14px; }
.form-grid > label { display:grid; gap:6px; font-size:.82rem; font-weight:700; color:var(--ink-2); }
.form-grid > label:has(> input[type="checkbox"]) { display:flex; align-items:center; gap:10px; min-height:44px; }
.form-grid :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea) { width:100%; min-height:44px; box-sizing:border-box; padding:11px 13px; border:1.5px solid var(--line-2); border-radius:var(--radius-sm); font-size:1rem; font-weight:400; background:var(--surface); color:var(--ink); -webkit-appearance:none; font-family:var(--ff-body); }
.form-grid input[type="file"] { min-height:44px; font-size:.9rem; font-weight:400; color:var(--ink); }
.form-grid textarea { min-height:88px; resize:vertical; }
.form-grid :is(input, select, textarea):focus { outline:none; border-color:var(--gold-2); box-shadow:0 0 0 3px rgba(195,154,76,0.18); }
.form-grid select { background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2360746c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 14px center; padding-inline-end:40px; }
html[dir="rtl"] .form-grid select { background-position:left 14px center; }
.form-grid .form-actions .btn { width:100%; min-height:44px; }
/* Daily reports: a missed medication must be impossible to overlook. */
/* .ops-row span (0,1,1) set the ordinary colour; this must outrank it. */
.ops-row .ops-med-alert { color:#9a2a1f; font-weight:700; }
.ops-row .ops-med-alert::before { content:"⚠ "; }
.ride-route-outline { display:block; width:100%; max-width:360px; margin:8px auto 12px; aspect-ratio:1; border:1px solid var(--line); border-radius:12px; background:#f4f1e8; }
.form-conflict { margin:0 0 12px; padding:10px 12px; border-inline-start:4px solid #b4542c; border-radius:8px; background:#fff3ea; color:#6b2c12; font-weight:600; }
.form-conflict p { margin:0; }
.form-conflict ul { list-style:none; margin:8px 0 0; padding:0; display:grid; gap:8px; font-weight:500; }
.form-conflict li { display:grid; gap:4px; padding-top:8px; border-top:1px solid #f0d2bf; }
.form-conflict li .btn { justify-self:start; min-height:40px; }
.just-saved { outline:2px solid var(--gold-2, #c39a4c); outline-offset:2px; border-radius:10px; }
/* A disabled Save (e.g. Feeding before a horse is chosen) must look disabled. */
#modal-content .btn:disabled, #modal-content .btn[disabled] { opacity:.5; cursor:not-allowed; filter:saturate(.6); }
