/* #83 Anesthesia record */
.anrec{ background:var(--ax-background-default); border:1px solid var(--ax-border-default); border-radius:var(--ax-radius-lg); overflow:hidden;}
.anrec__head{ display:flex; justify-content:space-between; align-items:flex-start; padding:12px 16px; gap:12px; flex-wrap:wrap; border-bottom:1px solid var(--ax-border-default);}
.anrec__brand{ display:flex; gap:10px; align-items:center;}
.anrec__logo{ width:36px; height:36px; border-radius:7px; background:var(--ax-success-emphasis); color:#fff; display:grid; place-items:center; font-family:var(--ax-font-mono); font-size:11px; font-weight:700;}
.anrec__title{ font-size:13px; font-weight:600; color:var(--ax-text-heading);}
.anrec__sub{ font-size:11px; color:var(--ax-text-subtle); font-family:var(--ax-font-mono); margin-top:2px;}
.anrec__meta{ font-family:var(--ax-font-mono); font-size:10px; color:var(--ax-text-subtle); text-align:right; line-height:1.55;}
.anrec__meta strong{ color:var(--ax-text-heading);}

/* Asa strip */
.anrec__strip{ display:grid; grid-template-columns: 2fr 1fr 1fr 1fr 1.4fr; padding:10px 16px; background:var(--ax-background-subtle); border-bottom:1px solid var(--ax-border-default); gap:0;}
.anrec__sc{ display:flex; flex-direction:column; gap:1px; padding-right:14px; border-right:1px solid var(--ax-border-subtle);}
.anrec__sc:last-child{ border-right:none;}
.anrec__sc-cap{ font-family:var(--ax-font-mono); font-size:9px; text-transform:uppercase; letter-spacing:0.06em; color:var(--ax-text-subtle); font-weight:600;}
.anrec__sc-val{ font-size:12px; font-weight:600; color:var(--ax-text-heading);}
.anrec__sc-mono{ font-family:var(--ax-font-mono); font-size:11px; color:var(--ax-text-default);}

/* Chart wrapper */
.anrec__chart{ padding:0; position:relative;}
.anrec__chart-h{ display:flex; justify-content:space-between; align-items:center; padding:8px 16px; background:var(--ax-background-subtle); border-bottom:1px solid var(--ax-border-default);}
.anrec__chart-title{ font-size:11px; font-weight:700; color:var(--ax-text-heading); text-transform:uppercase; letter-spacing:0.04em;}
.anrec__chart-legend{ display:flex; gap:10px;}
.anrec__lg{ display:inline-flex; align-items:center; gap:4px; font-family:var(--ax-font-mono); font-size:10px; color:var(--ax-text-subtle);}
.anrec__lg::before{ content:''; width:10px; height:10px; border-radius:2px;}
.anrec__lg--bp::before{ background:var(--ax-error-emphasis);}
.anrec__lg--hr::before{ background:var(--ax-info-emphasis);}
.anrec__lg--sat::before{ background:var(--ax-success-emphasis);}
.anrec__lg--et::before{ background:var(--ax-warning-emphasis);}

/* Time grid */
.anrec__grid{ display:grid; grid-template-columns: 70px 1fr; padding:0; background:var(--ax-background-default);}
.anrec__row-lbl{
  display:flex; align-items:center; padding:0 8px; font-family:var(--ax-font-mono); font-size:10px; font-weight:600;
  color:var(--ax-text-subtle); text-transform:uppercase; letter-spacing:0.04em;
  border-right:1px solid var(--ax-border-default); border-bottom:1px solid var(--ax-border-subtle); height:38px;
}
.anrec__row-svg{ height:38px; border-bottom:1px solid var(--ax-border-subtle); display:block; width:100%;}
.anrec__times-row{ display:grid; grid-template-columns: 70px 1fr; background:var(--ax-background-subtle); border-bottom:1px solid var(--ax-border-default);}
.anrec__times-pad{ height:22px;}
.anrec__times-strip{ display:grid; grid-template-columns: repeat(12, 1fr); height:22px;}
.anrec__times-cell{ display:grid; place-items:center; font-family:var(--ax-font-mono); font-size:9px; color:var(--ax-text-subtle); border-left:1px solid var(--ax-border-subtle);}
.anrec__times-cell:first-child{ border-left:none;}

/* Drug rows */
.anrec__drugs{ border-top:1px solid var(--ax-border-default); padding:0;}
.anrec__drugs-h{ display:flex; justify-content:space-between; padding:8px 16px; background:var(--ax-background-subtle); border-bottom:1px solid var(--ax-border-subtle);}
.anrec__drugs-title{ font-size:11px; font-weight:700; color:var(--ax-text-heading); text-transform:uppercase; letter-spacing:0.04em;}
.anrec__drug{ display:grid; grid-template-columns: 160px 1fr 80px; gap:0; border-bottom:1px solid var(--ax-border-subtle); align-items:stretch;}
.anrec__drug:last-child{ border-bottom:none;}
.anrec__drug-name{ padding:8px 12px; border-right:1px solid var(--ax-border-subtle); display:flex; flex-direction:column; gap:1px;}
.anrec__drug-n{ font-size:11px; font-weight:600; color:var(--ax-text-heading);}
.anrec__drug-d{ font-family:var(--ax-font-mono); font-size:10px; color:var(--ax-text-subtle);}
.anrec__drug-track{ position:relative; height:36px;}
.anrec__drug-bg{ position:absolute; inset:0; background:repeating-linear-gradient(to right, transparent 0 calc(100%/12 - 1px), var(--ax-border-subtle) calc(100%/12 - 1px) calc(100%/12));}
.anrec__drug-mark{ position:absolute; top:50%; transform:translate(-50%, -50%); display:flex; flex-direction:column; align-items:center;}
.anrec__drug-mark span{ background:var(--ax-text-heading); color:var(--ax-background-default); font-family:var(--ax-font-mono); font-size:9px; font-weight:700; padding:2px 5px; border-radius:3px; white-space:nowrap;}
.anrec__drug-mark::after{ content:''; width:1px; height:36px; background:var(--ax-text-heading); position:absolute; top:18px; opacity:0.4;}
.anrec__drug-mark--bolus span{ background:var(--ax-error-emphasis);}
.anrec__drug-mark--bolus::after{ background:var(--ax-error-emphasis);}
.anrec__drug-infu{ position:absolute; top:10px; bottom:10px; background:var(--ax-info-subtle); border:1px solid var(--ax-info-emphasis); border-radius:3px; display:flex; align-items:center; padding:0 6px; font-family:var(--ax-font-mono); font-size:9px; color:var(--ax-info-emphasis); font-weight:600;}
.anrec__drug-total{ padding:8px 12px; border-left:1px solid var(--ax-border-subtle); display:flex; flex-direction:column; gap:1px; text-align:right; align-items:flex-end;}
.anrec__drug-total strong{ font-size:12px; color:var(--ax-text-heading); font-family:var(--ax-font-mono);}
.anrec__drug-total span{ font-family:var(--ax-font-mono); font-size:9px; color:var(--ax-text-subtle); text-transform:uppercase; letter-spacing:0.04em;}

/* events bar */
.anrec__events{ display:flex; flex-wrap:wrap; gap:6px; padding:10px 16px; border-top:1px solid var(--ax-border-default);}
.anrec__ev{ display:inline-flex; gap:5px; padding:3px 8px; background:var(--ax-background-subtle); border-radius:4px; font-family:var(--ax-font-mono); font-size:10px; align-items:baseline; border:1px solid var(--ax-border-subtle);}
.anrec__ev strong{ color:var(--ax-text-heading); font-weight:600;}
.anrec__ev--imp{ background:var(--ax-warning-subtle); color:var(--ax-warning-emphasis); border-color:transparent;}

/* totals foot */
.anrec__totals{ display:grid; grid-template-columns: repeat(5, 1fr); padding:10px 16px; background:var(--ax-background-subtle); border-top:1px solid var(--ax-border-default); gap:0;}
.anrec__tot{ display:flex; flex-direction:column; gap:1px; padding-right:10px; border-right:1px solid var(--ax-border-subtle);}
.anrec__tot:last-child{ border-right:none;}
.anrec__tot-cap{ font-family:var(--ax-font-mono); font-size:9px; text-transform:uppercase; letter-spacing:0.06em; color:var(--ax-text-subtle); font-weight:600;}
.anrec__tot-val{ font-family:var(--ax-font-mono); font-size:14px; font-weight:600; color:var(--ax-text-heading);}
.anrec__tot-meta{ font-family:var(--ax-font-mono); font-size:10px; color:var(--ax-text-subtle);}

.anrec__foot{ display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; padding:10px 16px; border-top:1px solid var(--ax-border-default);}
.anrec__foot-meta{ font-family:var(--ax-font-mono); font-size:10px; color:var(--ax-text-subtle);}
.anrec__btn{ padding:5px 10px; font-size:11px; font-family:var(--ax-font-mono); font-weight:600; border-radius:5px; border:1px solid var(--ax-border-default); background:var(--ax-background-default); color:var(--ax-text-default); cursor:default;}
.anrec__btn--primary{ background:var(--ax-text-heading); color:var(--ax-background-default); border-color:var(--ax-text-heading);}

@media (max-width:780px){
  .anrec__strip{ grid-template-columns: 1fr 1fr;} .anrec__sc{ border-right:none;}
  .anrec__totals{ grid-template-columns: 1fr 1fr;} .anrec__tot{ border-right:none;}
}
