/* ── horaris (/admin/program, admin/schedule.js) ──────────────────────
   The page around the time grid: the head with its four numbers, the
   toolbar over the grid, the inspector (docked on a wide desk, a sheet
   otherwise), and the Llista, Sales, Propostes and Historial tabs.

   Loaded after admin.css, kit.css and timegrid.css, and built from their
   pieces — .btn, .segmented, .stat, .cal-tab, .stepper, the .hue-* room
   colours. The admin keeps its own colours: gold appears only where the
   page talks about time (the night read-out, the quick-create's slot),
   graphite only for the midnight line in the list. Every class is hz-. */

/* hidden means hidden, whatever display a class gives (a .btn is inline-flex) */
[id^="hz"] [hidden],.hz-pop [hidden],.hz-sheet [hidden]{ display:none !important }

/* ── the head ─────────────────────────────────────────────────────── */

.hz-head{ margin-bottom:.9rem }
.hz-head-top{
  display:flex; align-items:center; justify-content:space-between;
  gap:.6rem 1rem; flex-wrap:wrap; margin-bottom:.75rem;
}
.hz-head-title{ display:flex; align-items:center; gap:.6rem; min-width:0 }
.hz-head-title h1{ margin:0 }
.hz-head-acts{ display:flex; align-items:center; gap:.4rem; flex-wrap:wrap }
.hz-head-acts .btn .hz-ico{ color:var(--faint) }
.hz-leadnote{ margin:-.35rem 0 .75rem }
.hz-leadnote[hidden]{ display:none }
.hz-tiles{ margin-bottom:0 }
.hz-tiles .stat{ padding:.7rem .9rem .65rem }
.hz-tiles .stat b{ font-size:1.45rem }
/* the first load failed: why, and "Torna-ho a provar" */
.hz-fail{ color:var(--muted); padding:0 }

/* the count beside "Propostes" in the tabs */
.hz-tabcount{ font-weight:700; color:var(--accent) }
.hz-tabcount[hidden]{ display:none }

/* icons in buttons */
.hz-ico{ display:inline-flex; flex:none; width:18px; height:18px }
.hz-ico svg{ width:100%; height:100% }
.hz-ico-faint{ color:var(--faint) }
.hz-kind{ display:inline-flex; flex:none; color:var(--muted) }
.hz-kind svg{ width:16px; height:16px }
.hz-dot{ width:.6rem; height:.6rem }

/* ── the toolbar over the grid ────────────────────────────────────── */

.hz-bar{
  display:flex; align-items:center; flex-wrap:wrap; gap:.5rem .6rem;
  margin-bottom:.6rem;
}
.hz-days{ min-width:0; max-width:100% }
.hz-days .cal-toolbar{ margin:0; flex-wrap:nowrap; overflow-x:auto }
.hz-nowbtn .hz-ico{ width:16px; height:16px; color:var(--gold) }
.hz-nowbtn:disabled .hz-ico{ color:inherit }
.hz-tools{
  display:inline-flex; align-items:center; gap:2px; padding:2px;
  border:1px solid var(--line); border-radius:10px; background:var(--card);
}
.hz-ib{
  display:inline-flex; align-items:center; justify-content:center;
  width:2.15rem; height:2.15rem; border:0; border-radius:8px;
  color:var(--muted); background:none; cursor:pointer;
  transition:background .12s, color .12s;
}
.hz-ib:hover:not(:disabled){ background:var(--bg); color:var(--ink) }
.hz-ib:disabled{ opacity:.4; cursor:default }
.hz-find{ position:relative; display:flex; align-items:center; flex:1 1 13rem; min-width:10rem; max-width:22rem }
.hz-find > .hz-ico{ position:absolute; left:.65rem; width:16px; height:16px; color:var(--faint); pointer-events:none }
.hz-find input{ padding-left:2.1rem; min-height:2.3rem }
.hz-status{ margin-left:auto }

/* a selected block, when there is no dock to show it in */
.hz-selbar{
  display:flex; align-items:center; justify-content:space-between; gap:.75rem;
  margin:-.1rem 0 .6rem; padding:.4rem .45rem .4rem .8rem;
  background:var(--card); border:1px solid var(--line); border-radius:var(--r);
  box-shadow:var(--shadow); animation:rise .2s cubic-bezier(.2,.8,.3,1) both;
}
.hz-selbar[hidden]{ display:none }
.hz-selbar-text{ display:flex; align-items:center; gap:.45rem; min-width:0; font-size:.86rem; color:var(--muted) }
.hz-selbar-text b{ color:var(--ink); font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.hz-selbar-text > span:last-child{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.hz-selbar .kit-kbd{ margin-left:.15rem }

/* ── the desk: grid, and the inspector docked beside it ───────────── */

.hz-desk{ display:grid; grid-template-columns:minmax(0, 1fr); gap:.75rem; align-items:start }
.hz-desk.has-dock{ grid-template-columns:minmax(0, 1fr) 23rem }
.hz-gridwrap{ position:relative; min-width:0 }
.hz-dock{ display:none }
/* the panel scrolls on its own, as tall as the grid beside it; its foot
   (Duplica… / Esborra) is sticky at the bottom, bleeding to the edges */
.hz-desk.has-dock .hz-dock{
  display:block; position:relative;
  height:calc(100vh - var(--tg-top, 13rem));
  height:calc(100dvh - var(--tg-top, 13rem));
  min-height:24rem; overflow-y:auto; overscroll-behavior:contain;
  padding:.9rem 1rem 0;
  background:var(--card); border:1px solid var(--line); border-radius:var(--r);
  box-shadow:var(--shadow);
}
.hz-dock > :last-child:not(.hz-insp-foot){ margin-bottom:1rem }

/* the grid's shape while the first answer is on its way */
.hz-sklanes{ display:grid; grid-template-columns:3.5rem repeat(3, 1fr); gap:.5rem; height:26rem }
.hz-sklanes .sk{ height:100% }
.hz-sklanes .sk:first-child{ opacity:.5 }

/* blocks: what the search leaves out fades, what did not save says so */
.tg-item.hz-dim{ opacity:.28 }
.tg-item.hz-dim.is-selected{ opacity:.7 }
.tg-item.hz-unsaved{ outline:2px dashed var(--bad); outline-offset:1px }
.tg-meta.hz-who{ color:var(--faint) }
.hz-coltitle{ display:inline-flex; align-items:center; gap:.3rem; min-width:0 }
.hz-coltitle > span:first-child{ overflow:hidden; text-overflow:ellipsis }
.hz-coltitle .hz-ico{ width:14px; height:14px }
/* "+ Sala": the last head cell is a box you type a room's name into. At
   rest it reads as the action; focused, it is a plain field. */
.tg-headx input.hz-addroom{
  min-height:2.1rem; padding:.3rem .55rem; font-size:.8rem; font-weight:600;
  color:var(--ink); background:none; border:1px dashed var(--line-strong); border-radius:8px;
}
.tg-headx input.hz-addroom::placeholder{ color:var(--accent); opacity:1 }
.tg-headx input.hz-addroom:hover{ border-color:var(--accent-line); background:var(--accent-soft) }
.tg-headx input.hz-addroom:focus{ border-style:solid; background:var(--card) }
.tg-headx input.hz-addroom:focus::placeholder{ color:#9aa1ad }

/* ── popovers: quick-create, "+ Sala", the guest preview ──────────── */

.hz-pop{
  position:fixed; z-index:40; left:0; top:0;
  width:min(19rem, calc(100vw - 16px));
  padding:.75rem .8rem .7rem;
  background:var(--card); border:1px solid var(--line-strong); border-radius:var(--r);
  box-shadow:var(--shadow-pop);
  animation:menu-in .14s cubic-bezier(.2,.8,.3,1);
}
.hz-pop h3{ margin:0 0 .55rem }
.hz-pop .hint{ margin:-.2rem 0 .6rem; font-size:.8rem }
.hz-qc-when{
  font-size:.76rem; font-weight:600; color:var(--gold-ink, #7a5a14);
  margin-bottom:.45rem; font-variant-numeric:tabular-nums;
}
.hz-qc-input{ font-size:.95rem }
.hz-qc-row{ display:flex; align-items:center; gap:.4rem; margin-top:.5rem }
.hz-qc-row input{ flex:1 1 auto; min-width:0 }
.hz-qc-row .btn{ flex:none }
.hz-qc-hint{ margin-top:.45rem; font-size:.72rem; color:var(--faint) }
.hz-err{ font-size:.78rem; color:var(--bad); margin-top:.35rem }
.hz-err:empty{ display:none }
.hz-shake{ animation:hz-shake .32s }
@keyframes hz-shake{ 20%,60%{ transform:translateX(-4px) } 40%,80%{ transform:translateX(4px) } }

.hz-preview{ width:min(21rem, calc(100vw - 16px)) }
.hz-preview-time{ margin:.65rem 0 .75rem }
.hz-preview-time input{ width:9rem }
.hz-preview > .btn{ width:100% }

/* chips you press: preview days, room names, offer kinds */
.hz-chips{ display:flex; flex-wrap:wrap; gap:.35rem }
.hz-chip{
  font:inherit; font-size:.8rem; font-weight:550; color:var(--muted);
  min-height:2rem; padding:.25rem .8rem; border-radius:2rem; cursor:pointer;
  background:var(--card); border:1px solid var(--line-strong);
  transition:background .12s, color .12s, border-color .12s;
}
.hz-chip:hover{ color:var(--ink); background:var(--bg) }
.hz-chip[aria-pressed="true"]{ color:var(--accent); border-color:var(--accent-line); background:var(--accent-soft); font-weight:650 }

/* ── the inspector (docked, or in a sheet) ────────────────────────── */

.hz-insp-head{
  display:flex; align-items:center; justify-content:space-between; gap:.5rem;
  margin-bottom:.75rem;
}
.hz-insp-head h2{ margin:0 }
.hz-insp-when{ display:flex; align-items:center; gap:.45rem; min-width:0; font-size:.82rem; font-weight:600; color:var(--muted) }
.hz-insp-when > span:last-child{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.hz-field{ margin-bottom:.85rem }
.hz-label{ display:block; font-size:.78rem; font-weight:550; color:var(--muted); margin-bottom:.3rem }
.hz-faint{ font-size:.76rem; color:var(--faint); margin-top:.3rem }
.hz-sum{ font-size:.86rem; color:var(--muted); margin:-.35rem 0 .2rem }
.hz-insp h3{ margin:1.1rem 0 .5rem }
.hz-insp .segmented{ display:flex; width:100% }
.hz-insp .segmented button{ flex:1 1 0 }
.hz-insp textarea{ resize:vertical; min-height:4.5rem }

.hz-timing{ display:block }
.hz-dur{ display:flex; flex-wrap:wrap; align-items:center; gap:.45rem }
.hz-durstep .hz-durval{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:4.6rem; width:auto; padding:0 .4rem; font-size:.86rem; font-weight:650;
}
/* the night, said out loud: "dj 31 23:30 → dv 1 01:00 · és la nit del 31" */
.hz-readout{
  display:inline-block; margin:-.35rem 0 .75rem; padding:.25rem .6rem;
  font-size:.78rem; font-weight:600; font-variant-numeric:tabular-nums;
  color:var(--gold-ink, #7a5a14); background:var(--gold-soft, #f8f0dc);
  border-radius:2rem;
}
.hz-check{ display:inline-flex; align-items:center; gap:.55rem; font-size:.88rem; cursor:pointer; min-height:2rem }
.hz-roomsel{ display:flex; align-items:center; gap:.55rem }
.hz-roomsel select{ flex:1 1 auto; min-width:0 }

.hz-kinds{ display:flex; flex-wrap:wrap; gap:.35rem }
.hz-kindchip{
  display:inline-flex; align-items:center; gap:.35rem;
  min-height:2.1rem; padding:.25rem .7rem .25rem .55rem;
  font:inherit; font-size:.8rem; font-weight:550; color:var(--muted);
  background:var(--card); border:1px solid var(--line-strong); border-radius:2rem; cursor:pointer;
  transition:background .12s, color .12s, border-color .12s;
}
.hz-kindchip:hover{ color:var(--ink); background:var(--bg) }
.hz-kindchip[aria-pressed="true"]{ color:var(--accent); border-color:var(--accent-line); background:var(--accent-soft); font-weight:650 }
.hz-kindchip[aria-pressed="true"] .hz-kind{ color:inherit }
.hz-kindchip[aria-pressed="true"] .kind-moment{ color:var(--gold) }

/* out of your areas: a lock, then everything to read */
.hz-lock{
  display:flex; align-items:center; gap:.5rem; margin-bottom:.85rem;
  padding:.55rem .7rem; font-size:.84rem; color:var(--muted);
  background:var(--well); border:1px solid var(--line); border-radius:var(--r-sm);
}
.hz-lock .hz-ico{ color:var(--faint); width:16px; height:16px }
.hz-facts{ display:grid; grid-template-columns:minmax(6rem, auto) 1fr; gap:.45rem .9rem; margin:0 0 .6rem }
.hz-facts dt{ font-size:.76rem; font-weight:600; color:var(--faint) }
.hz-facts dd{ margin:0; font-size:.88rem; white-space:pre-line; overflow-wrap:anywhere }

/* somebody else saved while you typed */
.hz-stale{
  margin-bottom:.85rem; padding:.6rem .7rem;
  background:var(--warn-bg); border:1px solid var(--warn-line); border-radius:var(--r-sm);
  font-size:.86rem; color:var(--warn);
}
.hz-stale p{ font-weight:600; margin-bottom:.45rem }
.hz-stale-acts{ display:flex; gap:.4rem; flex-wrap:wrap }

.hz-insp-status{ margin:.2rem 0 .6rem }
.hz-insp-foot{
  position:sticky; bottom:0; z-index:1;
  display:flex; align-items:center; gap:.5rem; flex-wrap:wrap;
  margin:0 -1rem; padding:.7rem 1rem calc(.7rem + env(safe-area-inset-bottom));
  background:var(--card); border-top:1px solid var(--line);
}
.hz-insp-foot .push{ margin-left:auto }
.btn.hz-danger{ color:var(--bad) }
.btn.hz-danger:hover:not(:disabled){ color:var(--bad); background:var(--bad-bg); border-color:var(--bad-line) }
.btn.hz-danger .hz-ico,.btn .hz-ico{ width:16px; height:16px }

/* the day, when nothing is selected */
.hz-hints{ display:grid; gap:.35rem; margin:1.2rem 0 1rem; padding-top:.9rem; border-top:1px solid var(--line) }
.hz-hint{ display:flex; align-items:center; gap:.6rem; font-size:.8rem; color:var(--muted) }
.hz-hint .kit-kbd{ min-width:1.6rem; text-align:center }
.hz-mini-offers{ list-style:none; margin:0; padding:0; display:grid; gap:.35rem }
.hz-mini-offer{
  display:grid; grid-template-columns:auto minmax(0, 1fr) auto; align-items:center; gap:.15rem .5rem;
  padding:.45rem .5rem .45rem .6rem;
  background:var(--well); border:1px solid var(--line); border-radius:var(--r-sm);
}
.hz-mini-offer[draggable="true"]{ cursor:grab }
.hz-mini-offer[draggable="true"]:active{ cursor:grabbing }
.hz-mini-offer b{ font-size:.84rem; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.hz-mini-offer .hz-faint{ grid-column:2; margin:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.hz-mini-offer .btn{ grid-column:3; grid-row:1 / span 2 }

.hz-dupdays{ margin:.2rem 0 .4rem }

/* ── Llista ───────────────────────────────────────────────────────── */

.hz-ltools{ display:flex; align-items:center; flex-wrap:wrap; gap:.5rem .6rem; margin-bottom:.8rem }
.hz-ltools .segmented{ max-width:100% }
.hz-lsel{ width:auto; min-width:9rem; max-width:14rem }
.hz-lcopy{ margin-left:auto }

.hz-tablewrap{
  background:var(--card); border:1px solid var(--line); border-radius:var(--r);
  box-shadow:var(--shadow); overflow:auto;
}
.hz-table{ width:100%; border-collapse:collapse; font-size:.86rem }
.hz-table th{
  text-align:left; font-size:.68rem; font-weight:650; letter-spacing:.07em; text-transform:uppercase;
  color:var(--faint); background:var(--well); padding:.55rem .75rem;
  border-bottom:1px solid var(--line-strong); white-space:nowrap;
}
.hz-table td{ padding:.55rem .75rem; border-bottom:1px solid var(--line); vertical-align:middle }
.hz-table tbody tr:last-child td{ border-bottom:0 }
.hz-dayrow th{
  position:sticky; top:0; z-index:1;
  font-size:.74rem; letter-spacing:.06em; color:var(--ink); background:var(--card);
  border-bottom:1px solid var(--line-strong); padding-top:.9rem;
}
.hz-dayrow th small{
  margin-left:.5rem; font-size:.7rem; font-weight:600; color:var(--faint);
  letter-spacing:0; text-transform:none;
}
.hz-nightrow td{
  padding:.3rem .75rem; font-size:.7rem; font-weight:700; letter-spacing:.06em; text-transform:uppercase;
  color:var(--graphite, #1f2229); background:var(--well);
  border-top:2px solid var(--graphite, #1f2229);
}
.hz-row{ cursor:pointer; transition:background .12s }
.hz-row:hover td,.hz-row:focus-visible td{ background:color-mix(in srgb, var(--accent) 4%, var(--card)) }
.hz-row:focus-visible{ outline:2px solid var(--accent); outline-offset:-2px }
.hz-row.is-cancelled td{ color:var(--faint) }
.hz-row.is-cancelled .hz-tact-name b{ text-decoration:line-through }
.hz-t{ white-space:nowrap; font-variant-numeric:tabular-nums; font-weight:600; color:var(--ink) }
.hz-tact-name{ display:flex; align-items:center; gap:.45rem; min-width:0 }
.hz-tact-name b{ font-weight:600 }
/* who sees it: the crew's lock, a surprise's ✦ (as the grid marks them) */
.hz-vis{ flex:none; color:var(--faint) }
.hz-ico.hz-vis{ width:14px; height:14px }
.hz-teaser{ font-size:.8rem; line-height:1; color:var(--gold-ink, #7a5a14) }
.hz-troom{ white-space:nowrap }
.hz-troom .hz-dot{ margin-right:.4rem }
.hz-twho{ color:var(--muted); min-width:8rem }
.hz-wtag{
  display:inline-block; max-width:16rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  vertical-align:middle; font-size:.72rem; font-weight:600; line-height:1.2;
  padding:.25rem .55rem; border-radius:2rem; border:1px solid;
}
.hz-wtag.warn{ color:var(--warn); border-color:var(--warn-line); background:var(--warn-bg) }
.hz-wtag.bad{ color:var(--bad); border-color:var(--bad-line); background:var(--bad-bg) }

/* the same rows as cards, on a phone */
.hz-cards{ display:grid; gap:.45rem }
.hz-cardday{
  display:flex; align-items:baseline; gap:.5rem;
  margin:.9rem 0 .2rem; color:var(--ink); font-size:.74rem;
}
.hz-cardday:first-child{ margin-top:0 }
.hz-cardday small{ font-weight:600; color:var(--faint); letter-spacing:0; text-transform:none }
.hz-nightline{
  display:flex; align-items:center; gap:.5rem; margin:.3rem 0 .1rem;
  font-size:.68rem; font-weight:700; letter-spacing:.06em; text-transform:uppercase;
  color:var(--graphite, #1f2229);
}
.hz-nightline::after{ content:''; flex:1; height:2px; background:var(--graphite, #1f2229); opacity:.85 }
.hz-lcard{
  display:grid; grid-template-columns:3.4rem minmax(0, 1fr); gap:.7rem; align-items:start;
  width:100%; min-height:44px; padding:.65rem .8rem;
  font:inherit; text-align:left; color:var(--ink);
  background:var(--card); border:1px solid var(--line); border-radius:var(--r);
  box-shadow:var(--shadow); cursor:pointer;
}
.hz-lcard:active{ background:var(--well) }
.hz-lcard.is-cancelled{ opacity:.6 }
.hz-lcard.is-cancelled .hz-lcard-title b{ text-decoration:line-through }
.hz-lcard-time{ display:flex; flex-direction:column; font-variant-numeric:tabular-nums; line-height:1.25 }
.hz-lcard-time b{ font-size:.95rem; font-weight:700 }
.hz-lcard-time small{ font-size:.76rem; color:var(--faint) }
.hz-lcard-main{ display:flex; flex-direction:column; gap:.2rem; min-width:0 }
.hz-lcard-title{ display:flex; align-items:center; gap:.4rem; min-width:0 }
.hz-lcard-title b{ font-size:.95rem; font-weight:600; overflow-wrap:anywhere }
.hz-lcard-meta{ display:flex; align-items:center; gap:.4rem; font-size:.8rem; color:var(--muted); min-width:0 }
.hz-lcard-meta > span{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.hz-lcard-tags{ display:flex; flex-wrap:wrap; gap:.3rem; margin-top:.15rem }
.hz-lcard-tags .hz-wtag{ max-width:100% }

/* ── Sales ────────────────────────────────────────────────────────── */

.hz-rooms-note{ margin:0 0 .75rem }
.hz-rooms{ display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); gap:.75rem; align-items:start }
.hz-room{
  min-width:0; padding:.9rem .95rem 0;
  background:var(--card); border:1px solid var(--line); border-radius:var(--r-lg);
  box-shadow:var(--shadow);
}
.hz-room.hz-flash{ animation:hz-flash 1.4s ease-out }
@keyframes hz-flash{ 0%,30%{ box-shadow:0 0 0 3px var(--accent-line), var(--shadow) } }
.hz-room-top{ display:flex; align-items:center; gap:.6rem; flex-wrap:wrap; margin-bottom:.7rem }
.hz-room-top > b{ font-size:1rem }
.hz-room-top .hz-dot{ width:.8rem; height:.8rem }
/* an organiser's card: the room's dot and its name, typed in place */
.hz-room-head{ display:flex; align-items:center; gap:.45rem; margin:-.25rem 0 .55rem }
.hz-room-head > .hz-dot{ width:.8rem; height:.8rem }
.hz-room-head > .hz-ico{ width:16px; height:16px }
.hz-field.hz-room-name{ flex:1 1 auto; min-width:0; margin:0 }
.hz-room-name .hz-label{
  position:absolute; width:1px; height:1px; overflow:hidden; white-space:nowrap;
  clip:rect(0 0 0 0); clip-path:inset(50%);
}
.hz-room-name input{
  min-height:2.3rem; padding:.3rem .45rem; font-size:1.02rem; font-weight:650;
  border-color:transparent; background:none;
}
.hz-room-name input:hover{ border-color:var(--line-strong) }
.hz-room-name input:focus{ background:var(--card) }
.hz-room-err{ margin:-.35rem 0 .6rem }
.hz-room-pair{ display:grid; grid-template-columns:minmax(0, 1fr) 6.5rem; gap:.6rem }
.hz-room .kit-swatches{ gap:.32rem }
@media (pointer:fine){ .hz-room .kit-swatch{ width:1.65rem; height:1.65rem } }
.hz-room-new{ padding-bottom:.95rem; border-style:dashed; box-shadow:none; background:var(--well) }
.hz-room-new h3{ margin:0 0 .6rem }
.hz-room-new .field{ margin-bottom:.5rem }
.hz-usage{ list-style:none; margin:-.2rem 0 .7rem; padding:0; display:flex; flex-wrap:wrap; gap:.3rem }
.hz-usage li{
  font-size:.74rem; color:var(--muted); background:var(--well);
  border:1px solid var(--line); border-radius:2rem; padding:.15rem .55rem;
}
.hz-room-foot{
  display:flex; align-items:center; flex-wrap:wrap; gap:.3rem;
  margin:0 -.95rem; padding:.45rem .6rem; border-top:1px solid var(--line);
}
.hz-room-foot .push{ margin-left:auto }
.hz-room .hz-insp-status{ margin:-.2rem 0 .55rem }

/* a switch is a checkbox that looks like one */
.hz-switch{ display:inline-flex; align-items:center; gap:.6rem; font-size:.88rem; cursor:pointer; min-height:2rem }
.hz-switch input{
  -webkit-appearance:none; appearance:none; position:relative; flex:none;
  width:2.4rem; height:1.4rem; min-height:0; margin:0; padding:0;
  border:0; border-radius:1rem; background:var(--line-strong); cursor:pointer;
  transition:background .15s;
}
.hz-switch input::after{
  content:''; position:absolute; top:3px; left:3px;
  width:calc(1.4rem - 6px); height:calc(1.4rem - 6px); border-radius:50%;
  background:#fff; box-shadow:0 1px 2px rgba(17,24,39,.25);
  transition:transform .15s cubic-bezier(.2,.8,.3,1);
}
.hz-switch input:checked{ background:var(--good) }
.hz-switch input:checked::after{ transform:translateX(1rem) }
.hz-switch input:focus-visible{ outline:2px solid var(--accent); outline-offset:2px }

.hz-rooms-empty .hz-qc-row{ width:min(26rem, 100%) }
.hz-rooms-empty .hz-chips{ justify-content:center; margin-top:.3rem }

/* ── Propostes ────────────────────────────────────────────────────── */

.hz-offers{ display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); gap:.75rem; align-items:start }
.hz-offer{
  display:flex; flex-direction:column; align-items:flex-start; gap:.5rem; min-width:0;
  padding:.85rem .95rem .9rem;
  background:var(--card); border:1px solid var(--line); border-radius:var(--r-lg);
  box-shadow:var(--shadow);
}
.hz-offer[draggable="true"]{ cursor:grab }
.hz-offer-head{ display:flex; align-items:center; gap:.5rem; width:100%; min-width:0 }
.hz-offer-head b{ font-size:.95rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.hz-offer-head .tag{ margin-left:auto }
.hz-offer-text{
  font-size:.88rem; color:var(--ink); white-space:pre-line; overflow-wrap:anywhere;
  display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:7; overflow:hidden;
}
.hz-offer-style{ font-size:.84rem; font-weight:550; color:var(--muted) }
.hz-offer-style a{ color:var(--accent); font-weight:600 }
.hz-offer > .hz-faint{ margin:0 }
.hz-offer-state{ display:flex; flex-wrap:wrap; gap:.3rem }
button.hz-offer-placed{ font:inherit; font-size:.72rem; font-weight:600; cursor:pointer }

/* ── Historial ────────────────────────────────────────────────────── */

.hz-log{ max-width:52rem }
.hz-logday{ margin:1.2rem 0 .4rem }
.hz-logday:first-child{ margin-top:.2rem }
.hz-loglist{
  list-style:none; margin:0; padding:0;
  background:var(--card); border:1px solid var(--line); border-radius:var(--r);
  box-shadow:var(--shadow); overflow:hidden;
}
.hz-logline + .hz-logline{ border-top:1px solid var(--line) }
.hz-logbtn{
  display:block; width:100%; padding:.6rem .85rem;
  font:inherit; font-size:.86rem; line-height:1.45; text-align:left; color:var(--muted);
  background:none; border:0;
}
button.hz-logbtn{ cursor:pointer; transition:background .12s }
button.hz-logbtn:hover{ background:var(--well) }
.hz-logbtn time{ font-variant-numeric:tabular-nums; font-weight:600; color:var(--ink) }
.hz-logbtn b{ color:var(--ink); font-weight:600 }
.hz-logmore{ margin-top:.75rem }

/* ── touch ────────────────────────────────────────────────────────── */

@media (pointer:coarse){
  .hz-keysbtn{ display:none }
  .hz-ib{ width:44px; height:44px }
  .hz-chip,.hz-kindchip{ min-height:44px; padding-inline:.95rem }
  .hz-switch{ min-height:44px }
  .hz-switch input{ width:2.75rem; height:1.6rem }
  .hz-switch input::after{ width:calc(1.6rem - 6px); height:calc(1.6rem - 6px) }
  .hz-switch input:checked::after{ transform:translateX(1.15rem) }
  .hz-check{ min-height:44px }
  .hz-check input{ width:22px; height:22px }
  .hz-find input,.hz-qc-input{ font-size:16px }
  .hz-logbtn{ min-height:44px }
}

/* ── laptop and phone ─────────────────────────────────────────────── */

@media (max-width:959px){
  /* the top bar already says "Horaris" */
  .hz-head-title h1{ display:none }
  .hz-head-top{ margin-bottom:.6rem }
}
@media (max-width:699px){
  /* the badge and the three buttons on one line: the icons go square */
  .hz-head-top{ gap:.4rem; flex-wrap:nowrap }
  .hz-head-acts{ flex:1 1 auto; justify-content:flex-end; flex-wrap:nowrap; gap:.25rem }
  .hz-head-acts .hz-btntext{ display:none }
  .hz-head-acts .btn.ghost{ width:2.6rem; padding:0 }
  .hz-add{ display:none }
  /* four numbers in one row: the head stays one glance tall */
  .hz-tiles{ grid-template-columns:repeat(4, minmax(0, 1fr)); gap:.35rem }
  .hz-tiles .stat{ padding:.5rem .45rem .45rem }
  .hz-tiles .stat b{ font-size:1.15rem }
  .hz-tiles .stat small{ font-size:.66rem; line-height:1.2; margin-top:.15rem }

  .hz-bar{ gap:.4rem }
  .hz-days{ flex:1 1 100%; order:-1 }
  .hz-find{ flex:1 1 100%; max-width:none; order:-1 }
  .hz-status{ flex-basis:100%; margin-left:0 }
  .hz-ltools > *{ flex:1 1 auto }
  .hz-ltools .hz-find{ flex-basis:100% }
  .hz-lsel{ max-width:none }
  .hz-pop{ width:calc(100vw - 16px) }
}

/* ── proposals: ghosts on the grid ─────────────────────────────────────
   Somebody other than Eric proposed it: see-through, dashed all round,
   floating a little above the real thing until he settles it. */
.tg-item.hz-ghost{
  z-index:2;
  border:1.5px dashed var(--edge, #9aa1ad);
  border-left-width:1.5px;
  background:transparent;
  background-image:none;
  box-shadow:none;
  opacity:.62;
  backdrop-filter:blur(1px);
}
@supports (color:color-mix(in srgb, red 50%, blue)){
  .tg-item.hz-ghost{
    border-color:color-mix(in srgb, var(--edge, #6b7280) 85%, transparent);
    background:color-mix(in srgb, var(--fill, #f8f9fb) 45%, transparent);
  }
}
/* striped, so it never passes for an activity "per confirmar" (also dashed) */
.tg-item.hz-ghost{
  background-image:repeating-linear-gradient(-45deg, transparent 0 7px, rgba(17,24,39,.06) 7px 9px);
}
.tg-item.hz-ghost .tg-title{ font-style:italic }
.hz-ghost-tag{
  align-self:flex-start; max-width:100%;
  margin:0 0 .2rem; padding:.05rem .4rem; border-radius:999px;
  background:var(--edge, #6b7280); color:#fff;
  font-size:.66rem; font-weight:700; letter-spacing:.02em; line-height:1.4;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.tg-item.hz-ghost .hz-ghost-was{ font-style:italic }
.tg-item.hz-ghost.is-mine{ opacity:.8 }
@media (hover:hover){
  .tg-item.hz-ghost:hover{ opacity:.95; box-shadow:0 4px 12px -6px rgba(17,24,39,.3) }
}
.tg-item.hz-ghost.is-selected{ opacity:1 }
/* the real block somebody wants to move or change: a dashed ring */
.tg-item.has-prop{ outline:1.5px dashed var(--edge, #9aa1ad); outline-offset:2px }
.hz-asked{
  align-self:flex-start; margin-top:.2rem; padding:.05rem .4rem; border-radius:999px;
  border:1px dashed var(--edge, #6b7280); color:var(--edge, #4b5563);
  font-size:.66rem; font-weight:700; line-height:1.4; font-style:normal;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%;
}
/* a proposal and the block it would change, lit together under the pointer */
.tg-item.hz-pair{ opacity:1; outline:2px solid var(--edge, #6b7280); outline-offset:2px; z-index:3 }
/* …or to delete */
.tg-item.hz-doomed{ outline:1.5px dashed var(--bad, #b42318); outline-offset:2px; opacity:.6 }
.tg-item.hz-doomed .tg-title{ text-decoration:line-through }

.hz-props{ margin-bottom:1.25rem }
.hz-props-h{ font-size:1rem; margin:0 0 .4rem }
.hz-propcard{ border-style:dashed }
.hz-propcard.is-done{ opacity:.6 }
.hz-prop-acts{ display:flex; flex-wrap:wrap; gap:.5rem; align-items:center; margin-top:.5rem }
.hz-prop-acts .push{ margin-left:auto }
.hz-prop-by{ margin:0 0 .5rem; color:var(--muted, #4b5563) }
.hz-prop-note{ margin:.25rem 0 .75rem; padding:.5rem .75rem; border-left:3px solid var(--line-strong, #d2d6de); color:var(--ink, #111827); white-space:pre-wrap }
.hz-prop-del{ color:var(--bad, #b42318); font-weight:600 }
.hz-prop-intro{ margin:0 0 .75rem; color:var(--muted, #4b5563) }
.hz-pdiff-was{ color:var(--faint, #6b7280) }
.hz-pdiff-arrow{ color:var(--faint, #6b7280) }
.hz-proplist{ margin:0 0 1rem; padding:.6rem .75rem; border:1.5px dashed var(--line-strong, #d2d6de); border-radius:10px }
.hz-proplist h3{ margin:0 0 .35rem; font-size:.85rem }
.hz-propline{ display:block; width:100%; text-align:left; padding:.3rem 0; background:none; border:0; color:inherit; font:inherit; cursor:pointer }
.hz-propline:hover b{ text-decoration:underline }

/* ── the days around, in grey ─────────────────────────────────────────── */
.tg-item.hz-other{
  border:1px solid var(--line-strong, #d2d6de);
  border-left:3px solid var(--line-strong, #d2d6de);
  background:var(--well, #f3f4f6); background-image:none; box-shadow:none;
  color:var(--faint, #6b7280);
  filter:grayscale(1); opacity:.7; cursor:pointer;
}
.tg-item.hz-other .tg-title{ color:var(--muted, #4b5563) }
@media (hover:hover){ .tg-item.hz-other:hover{ opacity:1 } }

/* Eric's own "per confirmar": a ghost like a proposal, not a hatched block */
.tg-item.is-tentative{
  border:1.5px dashed var(--edge, #9aa1ad);
  border-left-width:1.5px;
  background:transparent; background-image:none; box-shadow:none;
  opacity:.62;
}
@supports (color:color-mix(in srgb, red 50%, blue)){
  .tg-item.is-tentative{
    background:color-mix(in srgb, var(--fill, #f8f9fb) 45%, transparent);
    background-image:none;
  }
}
.tg-item.is-tentative .tg-title{ font-style:italic }
@media (hover:hover){ .tg-item.is-tentative:hover{ opacity:.95 } }
.tg-item.is-tentative.is-selected{ opacity:1 }
