/* deck-declutter (docs/specs/deck-declutter.md): on the phone the draft is the hero.
   One compact header row, one row of small filter chips, a thin progress bar, a compact family chip,
   a flat draft card without stacked cards behind it, and the secondary actions as a compact icon row. */
html:not(.desk) .top{height:48px;padding:0 4px 0 12px;gap:8px}
html:not(.desk) .top .mark img{width:22px;height:27px}
html:not(.desk) .top h1 .vt b{font-size:22px;line-height:28px}
html:not(.desk) #updWrap{display:none}
html:not(.desk) #setBtn,html:not(.desk) #dayBtn,html:not(.desk) #undoBtn,html:not(.desk) #doneBtn,html:not(.desk) #wPill{display:none!important}
/* status pill -> small dot (tap opens the health panel); the text stays as its accessible name */
html:not(.desk) .qchip[hidden]{display:none!important}
html:not(.desk) .qchip{width:28px;height:28px;min-width:0;padding:0;border:0;background:none;display:grid;place-items:center}
html:not(.desk) .qchip:not([hidden]){display:grid}
html:not(.desk) .qchip span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
html:not(.desk) .qchip i{width:10px;height:10px;border-radius:5px;background:var(--text-3);box-shadow:0 0 0 3px var(--bg)}
html:not(.desk) .qchip.err i{background:var(--danger)} html:not(.desk) .qchip.warn i{background:var(--warn)} html:not(.desk) .qchip.busy i{background:var(--accent)}
/* filters: one scrollable row of small chips. #311: repeated here (not only in chips.css) so a stale or
   missing chips.css never brings back the profile segmented bar or wraps the chips over the card. */
html:not(.desk) #profSeg,html:not(.desk) #viewTitle .vt-chev{display:none!important}
html:not(.desk) .fchips:not([hidden]){display:flex;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;margin:0 -16px;padding-left:16px;padding-right:16px;-webkit-overflow-scrolling:touch}
html:not(.desk) .fc{flex:none;white-space:nowrap;display:inline-flex;align-items:center;height:32px;border:1px solid var(--border-2);background:transparent;color:var(--text);font-family:inherit;font-weight:600;line-height:1;cursor:pointer;-webkit-appearance:none;appearance:none}
html:not(.desk) .fc.on{background:var(--accent);border-color:var(--accent);color:#04140B}
html:not(.desk) .fc .fn{display:inline-grid;place-items:center;border-radius:9px;background:var(--surface-2);color:var(--text-2)}
html:not(.desk) .fchips{gap:6px;padding-top:2px;padding-bottom:2px}
html:not(.desk) .fc{min-height:32px;padding:0 10px;border-radius:16px;font-size:13px;gap:4px}
html:not(.desk) .fc .fn{min-width:18px;height:18px;font-size:11px;padding:0 5px}
/* progress + session -> one thin bar (tap the bar for the session / day) */
html:not(.desk) .prog{gap:0;margin:2px 16px 0;padding:0;min-height:0}
html:not(.desk) .prog .pg-main{display:block;width:100%;min-height:12px;padding:4px 0;background:none;border:0}
html:not(.desk) .prog .pg-txt{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
html:not(.desk) .prog .pg-bar{display:block;width:100%;height:3px;border-radius:2px}
html:not(.desk) .prog .pg-sess{display:none}
/* family banner -> compact chip */
html:not(.desk) .famstrip{align-self:flex-start;width:auto;max-width:calc(100% - 32px);min-height:28px;margin:4px 16px 0;padding:0 10px;border-radius:14px;font-size:12.5px;gap:6px}
html:not(.desk) .famstrip > :not(:first-child):not(b){display:none}
/* no stacked cards behind the top one */
html:not(.desk) .stage .card.back1,html:not(.desk) .stage .card.back2{visibility:hidden}
/* draft card: recipient line + full text */
.c-to{display:flex;align-items:center;gap:8px;min-width:0;margin-top:2px}
.c-ch{flex:none;width:28px;height:28px;border-radius:14px;display:grid;place-items:center;background:color-mix(in srgb,var(--a) 18%,transparent);color:var(--a)}
.c-ch svg{width:16px;height:16px}
.c-to .c-to-n{margin:0;flex:0 1 auto;min-width:0;font-size:18px;line-height:24px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.c-to-via{flex:none;font-size:13px;color:var(--text-3)}
.c-to .prof{margin-left:auto}
.dr.flat{margin-top:10px;padding:0;border:0!important;background:none!important;box-shadow:none!important}
.dr.flat > .dr-h,.dr.flat > .dr-to{display:none}
.dr.flat .dr-msg{padding:0;font-size:16px;line-height:23px;max-height:none}
html:not(.desk) .card:has(.dr.flat) .c-body{min-height:0;display:flex;flex-direction:column}
html:not(.desk) .card:has(.dr.flat) .dr.flat{flex:1 1 auto;min-height:0;display:flex;flex-direction:column}
html:not(.desk) .card:has(.dr.flat) .dr-msg{flex:1 1 auto;min-height:0;overflow:auto}
/* actions: big send stays; the rest is a compact icon row */
html:not(.desk) .actions{padding:6px 8px 4px;row-gap:4px}
html:not(.desk) .actions .act:not(.big) .o,html:not(.desk) .actions .act.big:not(.send) .o{width:40px;height:34px;border-radius:17px}
html:not(.desk) .actions .act:not(.send) .l{font-size:10.5px;line-height:13px}
html:not(.desk) .actions .act{gap:2px;padding:0}
html:not(.desk) .actions #okBtn.send{height:48px}
/* sheets (all of them): the drag hit-area is invisible (theme.css painted it like the grab pill, leaving a gray
   rectangle that stopped before the X); headers are opaque, full width, sticky, with a hairline divider. */
.sheet .sh-drag{background:transparent!important}
.sheet .chat-h{position:relative;z-index:5;background:inherit;border-bottom:.5px solid var(--border-2);margin:0;padding-right:4px}
.chat-av.mate{background:var(--surface-2);padding:0}
.chat-av.mate img{width:20px;height:24px}
.av.mate{background:var(--surface-2)!important;color:inherit} .av.mate .mate-av-img{width:62%;height:auto;display:block}
@media (prefers-color-scheme:light){.av.mate .mate-av-img,.chat-av.mate img{content:url(/mate-typing-green.svg)}}
.c-to-via{display:none}
.c-to .prof{flex:none;transform:scale(.92);transform-origin:right center}
/* deck-card-actions (docs/specs/deck-card-actions.md) */
html:not(.desk) #stage > .card .c-who{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:1.3rem;line-height:1.25}
html:not(.desk) #stage > .card .c-eyebrow .c-person{white-space:normal;text-align:left}
html:not(.desk) #stage > .card .c-eyebrow .c-person b{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
html:not(.desk) #stage > .card .c-body{overflow:auto;overscroll-behavior:contain;-webkit-mask-image:none!important;mask-image:none!important;min-height:0;flex:1 1 auto}
html:not(.desk) #stage > .card .c-what,html:not(.desk) #stage > .card .c-why,html:not(.desk) #stage > .card .c-ctxprev{-webkit-line-clamp:unset;display:block;overflow:visible}
.c-full[hidden]{display:none!important}
.c-foot.one{flex-direction:row;align-items:center;gap:8px}
.c-foot.one .c-pri{flex:1 1 auto;width:auto;min-height:48px}
.c-more{flex:none;display:inline-flex;align-items:center;gap:4px;min-height:48px;padding:0 14px;border-radius:24px;border:1px solid var(--border-2);background:var(--surface-2);color:var(--text);font:inherit;font-size:.9rem;font-weight:600}
.c-foot.one:not(:has(.c-pri)) .c-more{margin-left:auto}
.c-more svg{width:18px;height:18px}
.cm-list{display:flex;flex-direction:column;margin:4px 0 8px}
.cm-row{display:flex;align-items:center;gap:12px;min-height:52px;padding:0 4px;border:0;border-bottom:.5px solid var(--border-2);background:none;color:var(--text);font:inherit;font-size:1rem;text-align:left}
.cm-row:last-child{border-bottom:0}
.cm-row svg{width:20px;height:20px;color:var(--accent-text);flex:none}
/* bottom bar: at most 3 actions. Charlar and Nota/Editar live in the card's "Más" (swipe down still writes a note) */
html:not(.desk) .actions [data-act="chat"],html:not(.desk) .actions [data-dir="down"]{display:none!important}
html:not(.desk) .actions{grid-template-columns:repeat(3,minmax(0,1fr))!important}
html:not(.desk) .actions:has(#okBtn.send){grid-template-columns:repeat(2,minmax(0,1fr))!important}
html:not(.desk) #stage > .card .c-eyebrow{display:flex;flex-wrap:wrap;align-items:flex-start;gap:4px 8px}
html:not(.desk) #stage > .card .c-eyebrow .c-person{flex:1 1 60%;min-width:0;max-width:100%;overflow:visible;white-space:normal}
html:not(.desk) #stage > .card .c-eyebrow .c-person > *{white-space:normal}

/* sheet-head (#issue): ONE shared header for every sheet. openSheet() tags the first header
   (.sh-h/.pv-h/.srch-f/.ss-h/.chat-h) with .sheet-head. Opaque (--sheet-bg is the sheet's own
   computed background), full width, sticky, hairline only on the bottom edge, clears the X. */
.sheet{--sheet-bg:var(--surface)}
.sheet .sheet-head{position:sticky;top:-8px;z-index:7;background:var(--sheet-bg)!important;margin:-8px -16px 12px!important;
  padding:12px 60px 12px 16px!important;border:0!important;border-bottom:.5px solid var(--border-2)!important;box-shadow:none!important;border-radius:0!important;isolation:isolate}
.sheet .sheet-head::before,.sheet .sheet-head::after{display:none!important}
.sheet.chat .sheet-head{position:relative;top:auto;margin:0 -16px!important}
html.desk .sheet .sheet-head{top:-8px}
/* blocked/"Frenado" chip: mix the warn hue toward the text colour so it reads on cream (dark amber) and on dark (light amber) */
.xst.warn{color:color-mix(in srgb,var(--warn) 45%,var(--text))!important;background:color-mix(in srgb,var(--warn) 16%,transparent)!important;font-weight:600}
.sheet .sh-bar{z-index:8}   /* the close X sits above the shared header */
