/* LoopMune — structural layout only (grids, stacking, wrapping, tap
   targets). The visual skin (Patient Monitor direction) is layered on top
   of these primitives in the design phase; keep theme choices out of here. */

* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; line-height: 1.45; }
img { max-width: 100%; }

.lm-header { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; justify-content: space-between; padding: 0.75rem 1rem; }
.lm-brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; }
.lm-vitals { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; padding: 0.5rem 1rem; }

.lm-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.5rem; padding: 1rem; max-width: 1200px; margin: 0 auto; align-items: start; }
.lm-main-log { display: block; }
@media (max-width: 820px) {
  .lm-main { grid-template-columns: minmax(0, 1fr); }
}

.lm-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.lm-product { border: 1px solid #ccc; border-radius: 8px; padding: 0.75rem; display: flex; flex-direction: column; gap: 0.35rem; }
.lm-product .lm-button { margin-top: auto; }

.lm-panel { display: flex; flex-direction: column; gap: 1.25rem; }
.lm-field { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 0.6rem; font-size: 0.9rem; }
.lm-input { padding: 0.5rem; min-height: 2.5rem; width: 100%; }
.lm-button { padding: 0.55rem 0.9rem; min-height: 2.5rem; cursor: pointer; }
.lm-button[disabled] { opacity: 0.55; cursor: wait; }

.lm-filter { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1rem; }
.lm-filter .lm-field { flex: 1 1 180px; margin-bottom: 0; }

.lm-cart-lines, .lm-orders-list, .lm-incidents { list-style: none; margin: 0; padding: 0; }
.lm-cart-line { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; justify-content: space-between; padding: 0.35rem 0; }
.lm-qty { display: inline-flex; gap: 0.25rem; align-items: center; }
.lm-qty button { min-width: 2.25rem; min-height: 2.25rem; cursor: pointer; }

.lm-actors { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin: 1rem 0; }
.lm-actors-heading { grid-column: 1 / -1; margin: 0; }
.lm-actor { border: 1px solid #ccc; border-radius: 8px; padding: 0.75rem; }
.lm-actor-name { margin-top: 0; }
.lm-now { border: 1px solid #ccc; border-radius: 8px; padding: 0.9rem; margin: 1rem 0; }
.lm-now-heading { margin-top: 0; }
.lm-incident-sentence { margin: 0.4rem 0 0.2rem; }

.lm-summary { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0; }
.lm-chip { border: 1px solid #ccc; border-radius: 999px; padding: 0.3rem 0.8rem; }
.lm-chip-filter { cursor: pointer; background: none; font: inherit; }
.lm-chip-filter[aria-pressed="true"] { outline: 2px solid currentColor; }

.lm-incident { border: 1px solid #ccc; border-radius: 8px; padding: 0.9rem; margin-bottom: 1rem; }
.lm-incident-head { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: baseline; cursor: pointer; }
.lm-incident-title { margin: 0; font-size: 1.05rem; }
.lm-incident-body[hidden] { display: none; }
.lm-trace { margin: 0.5rem 0; padding-left: 1.2rem; overflow-wrap: anywhere; }
.lm-kane-run, .lm-heal-attempt { overflow-wrap: anywhere; }
.lm-banner { border: 1px solid #c00; border-radius: 8px; padding: 0.6rem 0.9rem; margin: 1rem 0; }
[role="alert"]:empty { display: none; }
