/* Journal vial supply and compact linked-entry history. */
:where(body.journal-page) .vial-description{min-width:0;flex:1}
:where(body.journal-page) .vial-supply{display:flex;align-items:center;gap:20px;margin:16px 0}
:where(body.journal-page) .inventory-vial-art{position:relative;width:120px;height:180px;flex:none;filter:drop-shadow(0 10px 12px #0004)}
:where(body.journal-page) .vial-liquid{position:absolute;inset:auto 0 0;height:calc(var(--vial-fill,0)*100%);opacity:clamp(0,calc(var(--vial-fill,0)*100),1);transition:height .65s ease,opacity .65s ease;background:linear-gradient(90deg,#0891b24d,#67e8f98c 45%,#0891b266);border-top:2px solid #a5f3fc99;border-radius:0 0 18% 18%}
:where(body.journal-page) .vial-supply-label{display:block;font-size:12px;color:#94a3b8;margin-bottom:5px}
:where(body.journal-page) .vial-supply-copy strong{display:block;font-size:24px;color:#e2e8f0;line-height:1.3}
:where(body.journal-page) .vial-supply-copy p{margin:5px 0;color:#cbd5e1;font-size:14px}
:where(body.journal-page) .vial-supply-note{font-size:12px;color:#94a3b8}
:where(body.journal-page) .vial-entry-summary{margin-top:20px;padding-top:0;border-top:0}
:where(body.journal-page) .vial-entry-heading{display:flex;flex-wrap:wrap;gap:6px 16px;align-items:baseline}
:where(body.journal-page) .vial-entry-heading strong{font-size:14px;color:#e2e8f0}
:where(body.journal-page) .vial-entry-heading>span{font-size:12px;color:#94a3b8}
:where(body.journal-page) .vial-entry-highlights{display:flex;flex-wrap:wrap;gap:12px 28px;margin:14px 0}
:where(body.journal-page) .vial-entry-highlights dt{font-size:12px;color:#94a3b8;margin-bottom:4px}
:where(body.journal-page) .vial-entry-highlights dd{font-size:14px;color:#e2e8f0;margin:0}
:where(body.journal-page) .vial-linked-history>summary{cursor:pointer;color:#67d6f7;font-size:13px;padding:4px 0;list-style:revert;display:list-item}
:where(body.journal-page) .vial-history-groups{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));gap:20px;margin-top:16px}
:where(body.journal-page) .vial-history-groups h4{font-size:13px;color:#e2e8f0;margin:0 0 8px}
:where(body.journal-page) .vial-history-groups ul{list-style:none;padding:0 6px 0 0;margin:0;max-height:180px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#64748b transparent}
:where(body.journal-page) .vial-history-groups li{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:6px 0;border-bottom:0;color:#cbd5e1;font-size:13px}
:where(body.journal-page) .vial-entry-status{font-size:11px;white-space:nowrap;border-radius:999px;padding:3px 7px;color:#94a3b8;background:#94a3b812}
:where(body.journal-page) .vial-entry-status[data-status="logged"]{color:#86efac;background:#22c55e12}
:where(body.journal-page) .vial-entry-status[data-status="planned"]{color:#7dd3fc;background:#38bdf812}
@media(prefers-reduced-motion:reduce){:where(body.journal-page) .vial-liquid{transition:none}}
:where(body.journal-page) .inventory-compound .inventory-vial{flex-direction:column;align-items:stretch}
:where(body.journal-page) .inventory-compound .inventory-vial-actions{justify-content:flex-end}

:where(body.journal-page) .inventory-status-filters{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0 20px}
:where(body.journal-page) .inventory-status-filters [aria-pressed="true"]{color:#a5e7ff;border-color:#38bdf8;background:#38bdf81a}
:where(body.journal-page) .inventory-status-section{margin-top:24px}
:where(body.journal-page) .inventory-status-section>h4,:where(body.journal-page) .inventory-finished>summary{font-size:15px;font-weight:700;color:#e2e8f0;margin:0 0 12px}
:where(body.journal-page) .inventory-status-section>h4>span,:where(body.journal-page) .inventory-finished>summary>span{font-size:12px;font-weight:400;color:#94a3b8;margin-left:8px}
:where(body.journal-page) .inventory-finished>summary{cursor:pointer}
:where(body.journal-page) .inventory-compound>summary{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px}
:where(body.journal-page) .inventory-compound>summary>strong{flex:1 1 130px}
:where(body.journal-page) .inventory-compound>summary .vial-summary-amount{font-size:14px;color:#e2e8f0}
:where(body.journal-page) .inventory-compound>summary .inventory-status{margin:0;font-size:12px}
:where(body.journal-page) .inventory-compound .vial-record-heading{display:none}

@media(min-width:1024px){
body.journal-page .inventory-status-filters{grid-column:1;grid-row:3;margin-top:0}
body.journal-page #inventory-groups{grid-row:4}
body.journal-page .inventory-bottles-section{grid-row:1/5}
}

:where(body.journal-page) .inventory-vial-art img{position:relative;display:block;width:100%;height:100%;object-fit:contain;pointer-events:none}
:where(body.journal-page) .vial-liquid-window{position:absolute;left:24%;right:24%;top:34%;bottom:17%;overflow:hidden;border-radius:15% 15% 18% 18%}
/* Weekly actions share the daily completion control, without nesting buttons. */
body.journal-page .journal-calendar-entry{position:relative;display:block;margin:6px 0;min-width:0}
body.journal-page .journal-calendar-entry>.event{display:block;width:100%;min-width:0;margin:0}
body.journal-page .journal-main .journal-completion-control{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;min-width:24px;min-height:24px;padding:0;border:0;border-radius:50%;background:transparent;color:#94a3b8;font-size:13px;box-shadow:none}
body.journal-page .journal-main .journal-completion-control[aria-pressed="true"]{color:#7dd3fc}
body.journal-page .journal-calendar-entry>.journal-calendar-completion{position:absolute;top:7px;right:6px;z-index:1}
body.journal-page .journal-calendar-entry>.event .event-heading{padding-right:24px}
body.journal-page .journal-main .journal-completion-control:hover{transform:none;background:#ffffff0a;color:#7dd3fc}


body.journal-page .inventory-compound .bottle-facts{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 24px;align-items:start}
body.journal-page .inventory-compound .vial-batch-fact{grid-column:2}
body.journal-page .inventory-body .diluent-row{grid-template-columns:minmax(0,2fr) minmax(0,1fr) auto}
@media(max-width:600px){body.journal-page .inventory-body .diluent-row{grid-template-columns:minmax(0,1fr)}}

:where(body.journal-page) .inventory-vial-art[data-capacity="5"]{width:132px;height:198px}
:where(body.journal-page) .vial-capacity{position:absolute;left:0;right:0;bottom:-8px;text-align:center;font-size:11px;color:#94a3b8}

:where(body.journal-page) .inventory-vial-art[data-capacity="6"]{width:136px;height:204px}
:where(body.journal-page) .inventory-vial-art[data-capacity="10"]{width:144px;height:216px}

/* Keep actions with the vial overview, independent of expanded history height. */
body.journal-page .inventory-compound .inventory-vial{display:block;height:auto;min-height:0;border-top:0;margin-top:10px;padding-top:0}
body.journal-page .inventory-compound .vial-description{flex:none}
body.journal-page .inventory-compound .inventory-vial-actions{justify-content:flex-start;gap:8px;margin:12px 0 0;width:auto}
body.journal-page .inventory-compound .inventory-vial-actions .site-button{flex:none;min-height:34px;height:auto;padding:7px 12px;font-size:12px}
body.journal-page .inventory-compound .vial-supply{gap:16px;margin:12px 0 20px}
body.journal-page .inventory-compound .vial-supply-copy{min-width:0}
body.journal-page .vial-history-groups ul:focus-visible{outline:2px solid #7dd3fc;outline-offset:3px;border-radius:4px}

/* Leave enough room for readout actions beside even the largest vial on narrow phones. */
@media(max-width:380px){
body.journal-page .inventory-compound .inventory-vial-art{width:96px;height:144px}
body.journal-page .inventory-compound .vial-supply{gap:12px}
}
