/* home-view.css — what every look of the Home Screen shares (js/home-view.js, js/home-widgets.js). A look's own
   colours and layout are in its own file (js/home-looks/<id>.js). Sizes are rem so the global text size scales them;
   breakpoints are container queries on the view (hv), so a small live preview lays out like the screen it stands for. */

/* ---- the frame: the view lies under the top bar and runs to every edge ---------------------------------------- */
body.hv-on #desktop { visibility: hidden; }
body.hv-on .drop-hint { display: none !important; }
body.hv-on .menubar { background: transparent; border-bottom-color: transparent; backdrop-filter: none; }
body.hv-on .menubar .crumbs, body.hv-on #history-btn, body.hv-on #add-btn { display: none; }
body.hv-on .menubar .brand-btn .caret { color: var(--h-ink); opacity: .7; }
body.hv-on .menubar .view-btn, body.hv-on .menubar .fs-btn { background: var(--h-card, #fff); background: color-mix(in srgb, var(--h-card, #fff) 70%, transparent); border-color: var(--h-line, transparent); color: var(--h-ink, inherit); }
body[data-hv] .menubar { color: var(--h-ink); }
.menubar .view-btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; padding: .3rem .45rem; line-height: 1; color: var(--muted); }
.menubar .view-btn:hover { color: var(--text); }
.hv-i { width: 1.15em; height: 1.15em; flex: 0 0 auto; }
.menubar .view-btn .hv-i { width: 1rem; height: 1rem; }
/* until a look is chosen the button says what it is for (the first-run invitation: it covers nothing) */
.menubar .view-btn.fresh { color: var(--accent); border-color: var(--accent); }
.hv-nudge { position: fixed; z-index: 60; left: 50%; top: 2.9rem; transform: translateX(-50%); display: flex; align-items: center; max-width: calc(100% - 1.6rem);
  background: #fff; color: #16182b; border: 1px solid rgba(91,91,240,.35); border-radius: 2rem; box-shadow: 0 .5rem 1.6rem rgba(40,40,100,.22); font-size: .85rem; font-weight: 600; }
body.hv-nudging[data-hv="glass"] .hv-scroll { padding-top: 6.1rem; }
@container hv (max-width: 420px) { .hv-join.big input { padding: 0 .55rem; font-size: .95rem; } .hv .hv-join.big .hv-go, .hv-pop .hv-join.big .hv-go { padding: 0 1rem; } }
.hv-nudge button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.hv-nudge-go { white-space: nowrap; padding: .55rem .5rem .55rem 1rem; min-height: 2.5rem; text-align: left; color: #4a4ad8; }
.hv-nudge-x { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; color: #5d6282; }
.hv-nudge-x .hv-i { width: 1rem; height: 1rem; }
@media (prefers-color-scheme: dark) { .hv-nudge { background: #1a1d38; color: #f1f2ff; border-color: rgba(138,138,255,.5); } .hv-nudge-go { color: #b4b4ff; } .hv-nudge-x { color: #a3a8cf; } }
.hv-fresh-t { font-size: .74rem; font-weight: 600; white-space: nowrap; }
@media (max-width: 520px) { .hv-fresh-t { display: none; } .menubar .view-btn.fresh { box-shadow: 0 0 0 .18rem transparent; box-shadow: 0 0 0 .18rem color-mix(in srgb, var(--accent) 30%, transparent); } }
/* the Desktop view's clock: day, date, time, in the bar */
.menubar .hv-bar-clock { display: inline-flex; align-items: baseline; gap: .45rem; padding: .2rem .5rem; border: 0; background: none; box-shadow: none; color: var(--text); font-size: .82rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hv-bar-clock b { font-weight: 700; font-size: .95rem; }
.hv-bar-day { color: var(--muted); }
/* a narrow bar keeps the time and drops the date; a phone's bar is full already (Invites, Add), so there the day, date
   and time stand as one quiet line at the foot of the Desktop, which takes no taps and covers no icon's hit area */
@media (max-width: 760px) { .hv-bar-day { display: none; } .menubar .hv-bar-clock { padding: .2rem .1rem; } .hv-bar-clock b { font-size: .82rem; } }
@media (max-width: 560px) { .menubar .hv-bar-clock { display: none; } }
.hv-foot-clock { display: none; position: fixed; right: .7rem; bottom: .45rem; z-index: 2; pointer-events: none; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; text-shadow: 0 0 .3rem var(--bg); }
.hv-foot-clock b { color: var(--text); font-weight: 700; margin-left: .35rem; }
@media (max-width: 560px) { .hv-foot-clock { display: block; } }
.menubar:has(#pin-head) .hv-bar-day { display: none; }
.menubar .hv-me-btn { padding: 0; border: 0; background: none; border-radius: 50%; line-height: 0; box-shadow: none; }
.hv-me-btn .hv-av { width: 1.9rem; height: 1.9rem; font-size: .68rem; }
body.hv-on .menubar .brand-btn { background: none; border: 0; box-shadow: none; }

#home-view { position: absolute; top: var(--updh, 0px); right: 0; bottom: 0; left: 0; z-index: 1; }
.hv { overflow: hidden; color: var(--h-ink); background: var(--h-bg); container: hv / size;
  font-family: ui-rounded, 'SF Pro Rounded', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
:where(.hv) button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; border-radius: 0; box-shadow: none; }
.hv-pop button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; border-radius: 0; box-shadow: none; }
:where(.hv, .hv-pop) h1, :where(.hv, .hv-pop) h2 { margin: 0; font-weight: 700; }
/* An engine without :where() (Safari before 14, the same engines that lack `inset`) drops the two rules above whole: it gets the
   same resets at the same element-only weight, so every class rule of a look still wins over them as it does everywhere else. */
@supports not (inset: 0) {
  button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; border-radius: 0; box-shadow: none; }
  h1, h2 { margin: 0; font-weight: 700; }
}
.hv-scroll { position: absolute; top: 0; right: 0; bottom: 0; left: 0; overflow-y: auto; overscroll-behavior: contain; padding: 3.2rem 0 7.5rem; scrollbar-width: none; }
.hv-scroll::-webkit-scrollbar { display: none; }

/* ---- shared pieces (in a look, and in its popups) ----------------------------------------------------------------- */
.hv .hv-quiet, .hv-pop .hv-quiet { color: var(--h-dim); font-size: .8rem; line-height: 1.45; margin: 0; text-align: left; }
.hv-sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; margin: 0 0 .6rem; }
.hv .hv-sec-h h2, .hv-pop .hv-sec-h h2 { font-size: 1rem; letter-spacing: -.01em; }
.hv .hv-link, .hv-pop .hv-link { color: var(--h-acc); font-size: .85rem; font-weight: 600; padding: .3rem .2rem; }
.hv .hv-pill, .hv-pop .hv-pill { display: inline-flex; align-items: center; gap: .4rem; min-height: 2.5rem; padding: 0 .95rem; border-radius: 99rem; font-size: .88rem; font-weight: 600;
  background: var(--h-card); border: 1px solid var(--h-line); white-space: nowrap; transition: transform .15s ease, background .15s ease; }
.hv .hv-pill:active, .hv-pop .hv-pill:active { transform: scale(.95); }
.hv .hv-pill.hot, .hv-pop .hv-pill.hot { background: var(--h-acc); border-color: transparent; color: var(--h-on); }

.hv-av { display: inline-grid; place-items: center; width: 3.4rem; height: 3.4rem; border-radius: 50%; flex: 0 0 auto; font-weight: 700; font-size: 1.15rem; color: #fff; overflow: hidden;
  background: linear-gradient(135deg, hsl(var(--h, 250) 80% 62%), hsl(calc(var(--h, 250) + 50) 85% 52%)); }
.hv-av.pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hv-av.ghost { background: none; color: var(--h-dim); border: 2px dashed var(--h-line); }
.hv-av.big { width: 6.5rem; height: 6.5rem; font-size: 2.2rem; }

.hv-join { display: flex; align-items: center; gap: .4rem; padding: .35rem; border-radius: 99rem; background: var(--h-solid); border: 1px solid var(--h-line); box-shadow: var(--h-shadow);
  transition: box-shadow .2s ease, border-color .2s ease; }
.hv-join:focus-within { border-color: var(--h-acc); box-shadow: 0 0 0 .25rem transparent, var(--h-shadow); box-shadow: 0 0 0 .25rem color-mix(in srgb, var(--h-acc) 25%, transparent), var(--h-shadow); }
.hv-join input { flex: 1 1 auto; min-width: 0; height: 2.6rem; padding: 0 .9rem; border: 0; outline: 0; background: none; color: var(--h-ink); font: inherit; font-size: 1rem; font-weight: 500; user-select: text; }
.hv-join input::placeholder { color: var(--h-dim); font-weight: 400; }
.hv .hv-go, .hv-pop .hv-go { display: inline-flex; align-items: center; gap: .45rem; height: 2.6rem; padding: 0 1.15rem; border-radius: 99rem; font-weight: 700; color: var(--h-on);
  background: linear-gradient(135deg, var(--h-acc), var(--h-acc2)); transition: transform .15s ease; }
.hv .hv-go:active, .hv-pop .hv-go:active { transform: scale(.94); }
.hv-join.big input { height: 3.1rem; font-size: 1.1rem; }
.hv .hv-join.big .hv-go, .hv-pop .hv-join.big .hv-go { height: 3.1rem; padding: 0 1.4rem; font-size: 1.02rem; }

.hv-strip { display: flex; gap: .35rem; overflow-x: auto; padding: .2rem .1rem .4rem; scrollbar-width: none; scroll-snap-type: x proximity; }
.hv-strip::-webkit-scrollbar { display: none; }
.hv .hv-person { display: flex; flex-direction: column; align-items: center; gap: .35rem; width: 4.6rem; flex: 0 0 auto; scroll-snap-align: start; }
.hv-ring { position: relative; display: grid; place-items: center; padding: .2rem; border-radius: 50%; transition: transform .2s cubic-bezier(.3,1.6,.5,1); }
.hv-person:hover .hv-ring { transform: scale(1.08); }
.hv-person:active .hv-ring { transform: scale(.92); }
.hv-callbadge { position: absolute; right: -.1rem; bottom: -.1rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; display: grid; place-items: center; background: #22c55e; color: #fff;
  border: 2px solid var(--h-bg); font-size: .68rem; }
.hv-person.add .hv-callbadge { display: none; }
.hv-person-n { max-width: 100%; font-size: .74rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hv-person.add .hv-person-n { color: var(--h-dim); }
.hv-person.missed .hv-ring::after { content: ''; position: absolute; top: -.1rem; right: -.1rem; bottom: -.1rem; left: -.1rem; border-radius: 50%; border: .16rem solid #ff4d5e; animation: hv-beat 1.6s ease-in-out infinite; }
.hv-dot { width: .6rem; height: .6rem; border-radius: 50%; background: #ff4d5e; flex: 0 0 auto; animation: hv-beat 1.6s ease-in-out infinite; }
.hv-missed { display: flex; align-items: center; gap: .6rem; padding: .5rem .5rem .5rem .9rem; border-radius: 99rem; background: var(--h-card); border: 1px solid #ff4d5e; border: 1px solid color-mix(in srgb, #ff4d5e 55%, var(--h-line));
  backdrop-filter: blur(1rem); font-size: .85rem; max-width: 34rem; animation: hv-rise .5s both; }
.hv-missed-t { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--h-dim); text-align: left; }
.hv-missed-t b { color: var(--h-ink); }
.hv .hv-x { width: 2.2rem; height: 2.2rem; border-radius: 50%; color: var(--h-dim); flex: 0 0 auto; }

.hv-rows { display: flex; flex-direction: column; gap: .15rem; }
.hv .hv-row, .hv-pop .hv-row { display: flex; align-items: center; gap: .75rem; width: 100%; padding: .55rem .5rem; border-radius: 1rem; text-align: left; transition: background .15s ease; box-sizing: border-box; }
.hv button.hv-row:hover, .hv-pop button.hv-row:hover { background: transparent; background: color-mix(in srgb, var(--h-ink) 7%, transparent); }
.hv-row-ic { width: 2.6rem; height: 2.6rem; border-radius: .85rem; display: grid; place-items: center; flex: 0 0 auto; color: #fff;
  background: linear-gradient(135deg, hsl(var(--h, 240) 75% 60%), hsl(calc(var(--h, 240) + 45) 80% 50%)); }
.hv-row-ic.live { background: linear-gradient(135deg, #ff4d5e, #ff9d2e); }
.hv-row .hv-av { width: 2.6rem; height: 2.6rem; font-size: .95rem; }
.hv-row-t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.hv-row-t b { font-size: .95rem; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hv-row-t > span { font-size: .76rem; color: var(--h-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hv-row-go { color: var(--h-dim); flex: 0 0 auto; }
.hv-ok { color: #22c55e; font-style: normal; }

.hv .hv-app, .hv-pop .hv-app, .hv-prev .hv-app { display: flex; flex-direction: column; align-items: center; gap: .3rem; width: 4.6rem; flex: 0 0 auto; }
.hv-app-pic { width: 3.3rem; height: 3.3rem; display: grid; place-items: center; border-radius: 1rem; font-size: 2rem; background: transparent; background: color-mix(in srgb, var(--h-ink) 6%, transparent);
  transition: transform .2s cubic-bezier(.3,1.6,.5,1); }
.hv-app-pic img { width: 2.5rem; height: 2.5rem; object-fit: contain; display: block; }
.hv-app:hover .hv-app-pic { transform: translateY(-.2rem) scale(1.08); }
.hv-app:active .hv-app-pic { transform: scale(.92); }
.hv-app-n { max-width: 100%; font-size: .7rem; font-weight: 600; line-height: 1.2; text-align: center; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hv-appgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(4.8rem, 1fr)); gap: 1rem .3rem; justify-items: center; }
.hv-approw { display: flex; gap: .3rem; overflow-x: auto; scrollbar-width: none; }
.hv-approw::-webkit-scrollbar { display: none; }
.hv .hv-invite { display: flex; align-items: center; gap: .8rem; width: 100%; padding: .3rem .2rem; text-align: left; }
.hv-invite .hv-av { width: 3rem; height: 3rem; }

/* ---- slots and widgets: a slot is a column (or a grid) of widgets; the look draws the card around each ----------------- */
.hv-slot { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.hv-slot:empty { display: none; }
.hv-slot.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); align-items: start; }
.hv-slot.grid > .hv-w-wide, .hv-slot.grid > .hv-w-large, .hv-slot.grid > .hv-w-edit, .hv-slot.grid > .hv-w-add { grid-column: 1 / -1; }
.hv-w { position: relative; min-width: 0; box-sizing: border-box; }
.hv-w[hidden] { display: none; }
.hv, .hv-w-frame { color-scheme: light dark; }
.hv-go { white-space: nowrap; }
.hv-w-frame { display: block; width: 100%; border: 0; background: transparent; color-scheme: inherit; }
/* A widget whose content is on the way: its place at once, with its name and "Loading…" (HOMEFAST). The frame loads unseen under it. */
.hv-w-load { display: flex; flex-direction: column; justify-content: center; gap: .3rem; box-sizing: border-box; padding: .9rem 1rem; border-radius: 1.1rem;
  background: var(--h-card, rgba(128,128,128,.08)); color: var(--h-dim, inherit); font-size: .85rem; }
.hv-w-stand .hv-stand-n { font-size: 2.6rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; color: var(--h-ink, inherit); font-variant-numeric: tabular-nums; }
.hv-w-stand .hv-stand-d { font-size: .95rem; color: var(--h-ink, inherit); }
.hv-w-load b { color: var(--h-ink, inherit); font-weight: 600; font-size: .95rem; }
.hv-w.loading > .hv-w-frame { position: absolute; top: 0; right: 0; bottom: 0; left: 0; opacity: 0; pointer-events: none; }
.w-join { display: flex; flex-direction: column; gap: .8rem; }
.w-chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.hv .hv-w-edit { align-self: center; justify-self: center; display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .9rem; border-radius: 99rem; font-size: .78rem; font-weight: 600; color: var(--h-dim);
  border: 1px dashed var(--h-line); opacity: .85; }
.hv .hv-w-edit:hover { color: var(--h-ink); opacity: 1; }

/* ---- popups: cards of the shared popup library (js/dialog.js), in the look's colours ------------------------------------ */
.hv-skin-classic { --h-bg: var(--bg); --h-ink: var(--text); --h-dim: var(--muted); --h-card: var(--surface); --h-solid: var(--surface); --h-line: var(--border); --h-acc: var(--accent); --h-acc2: var(--accent2); --h-on: var(--onaccent, #fff); --h-shadow: none; }
.hv-pop-bg { z-index: 25; align-items: flex-end; color: var(--h-ink); animation: hv-fade .2s both;
  font-family: ui-rounded, 'SF Pro Rounded', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; }
.modal.hv-pop { width: min(34rem, 100%); max-height: min(88vh, 48rem); max-height: min(88dvh, 48rem); padding: 0; text-align: left; border-radius: 1.6rem 1.6rem 0 0; background: var(--h-solid); border: 1px solid var(--h-line); color: var(--h-ink);
  box-shadow: 0 -1rem 3rem rgba(0,0,0,.3); animation: hv-up .32s cubic-bezier(.2,1.1,.3,1) both; }
.modal.hv-pop.apps { width: min(46rem, 100%); }
.modal.hv-pop.pick { width: min(60rem, 100%); }
.hv-pop-head { display: flex; align-items: center; gap: .5rem; padding: 1rem 1.2rem .5rem; }
.hv-pop .hv-pop-head h2 { flex: 1 1 auto; font-size: 1.15rem; }
.hv-pop .hv-pop-back { width: 2.4rem; height: 2.4rem; display: grid; place-items: center; margin-left: -.5rem; }
.hv-pop .hv-pop-back[hidden] { display: none; }
.hv-pop-body { padding: .4rem 1.2rem 1rem; display: flex; flex-direction: column; gap: .9rem; }
.hv-pop > .hv-pop-actions { display: flex; justify-content: flex-end; padding: .6rem 1.2rem .9rem; border-top: 1px solid var(--h-line); }
.hv-pop .hv-pill:not(.hot) { background: transparent; background: color-mix(in srgb, var(--h-ink) 8%, transparent); border-color: transparent; }
.hv-sheet-foot { display: flex; flex-wrap: wrap; gap: .5rem; }
@media (min-width: 720px) { .hv-pop-bg { align-items: center; } .modal.hv-pop { border-radius: 1.6rem; } }

/* the picker: each look drawn live at a real screen size, scaled down */
.hv-picks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.hv-pop .hv-pick { display: flex; flex-direction: column; gap: .5rem; padding: .45rem; border-radius: 1.1rem; text-align: left; border: 2px solid var(--h-line); transition: transform .15s ease; min-width: 0; }
.hv-pop .hv-pick.on { border-color: var(--h-acc); }
.hv-pop .hv-pick:active { transform: scale(.98); }
.hv-pick-t { display: flex; flex-direction: column; gap: .15rem; padding: 0 .3rem .25rem; }
.hv-pick-t span { font-size: .74rem; color: var(--h-dim); line-height: 1.35; }
.hv-prev-box { position: relative; display: block; width: 100%; overflow: hidden; border-radius: .8rem; container-type: size; background: #e8ecf1; }
.hv-prev-scale { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; container-type: size; }
.hv-prev { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
.hv-prev *, .hv-prev::before, .hv-prev::after { animation: none !important; }
.hv-prev-classic { background: var(--bg, #e8ecf1); color: var(--text, #111); --h-ink: var(--text, #111); }
.hv-prev-icons { display: grid; grid-template-columns: repeat(auto-fill, 5.4rem); gap: 1.2rem .6rem; padding: 3.4rem 1.2rem; }
.hv-prev .hv-scroll { overflow: hidden; }
/* Settings → Look */
.hv-set-row { display: flex; align-items: flex-start; gap: .6rem; padding: .45rem 0; text-align: left; cursor: pointer; }
.hv-set-row input { margin-top: .2rem; }
.hv-set-sub { color: var(--muted); font-size: .8rem; }
.hv-set #hv-set-pick { margin-top: .5rem; }

/* ---- motion ---------------------------------------------------------------------------------------------------------- */
@keyframes hv-rise { from { opacity: 0; transform: translateY(1rem); } to { opacity: 1; transform: none; } }
@keyframes hv-up { from { opacity: 0; translate: 0 2rem; } to { opacity: 1; translate: 0 0; } }
@keyframes hv-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes hv-beat { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes hv-drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(12vmax, 9vmax) scale(1.15); } }
@keyframes hv-spin { to { rotate: 360deg; } }
@keyframes hv-twinkle { from { opacity: .35; } to { opacity: .95; } }
@keyframes hv-halo { from { opacity: .9; scale: 1; } to { opacity: 0; scale: 1.9; } }
@keyframes hv-sheen { from { background-position: 0% 30%; } to { background-position: 100% 70%; } }
@media (prefers-reduced-motion: reduce) {
  .hv *, .hv::before, .hv::after, .hv-pop-bg, .hv-pop { animation: none !important; transition: none !important; }
}

.hv-row-ic .hv-tvthumb { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }

/* a short screen (a phone on its side): the chip would eat a fifth of it; the bar button still invites */
@media (max-height: 480px) { .hv-nudge { display: none; } body.hv-nudging[data-hv="glass"] .hv-scroll { padding-top: 3.2rem; } }

/* ---- edit mode (HOMEEDIT): the real Home, each widget with a handle, its name, a size button and ✕; "+" ends each place --- */
.hv-editing .hv-edit-slot { display: flex; gap: 2.2rem; padding-top: 1.3rem; outline: 2px dashed transparent; outline: 2px dashed color-mix(in srgb, var(--h-ink) 16%, transparent); outline-offset: .5rem; border-radius: 1.3rem; }
.hv-editing .hv-slot.grid.hv-edit-slot { display: grid; }
.hv-editing .hv-w-ed { margin-top: .2rem; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; min-height: 3.6rem; }
.hv-w-ctl { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 4; border-radius: inherit; }
.hv-w-shield { position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: inherit; touch-action: pan-y; cursor: grab; background: transparent; background: color-mix(in srgb, var(--h-bg) 14%, transparent); }
.hv-w-bar { position: absolute; left: .45rem; right: .45rem; top: -1.25rem; display: flex; align-items: center; gap: .35rem; pointer-events: none; }
.hv-w-bar > button { pointer-events: auto; }
.hv .hv-w-grip, .hv .hv-w-x { flex: 0 0 auto; width: 2.5rem; height: 2.5rem; display: grid; place-items: center; border-radius: 50%; background: var(--h-solid, #fff); color: var(--h-ink); box-shadow: 0 .15rem .7rem rgba(0,0,0,.28); }
.hv .hv-w-grip { touch-action: none; cursor: grab; }
.hv .hv-w-grip .hv-i { stroke-width: 3; }
.hv .hv-w-x { background: #e5484d; color: #fff; }
.hv-w-n { flex: 0 1 auto; margin-right: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: .35rem .7rem; border-radius: 99rem; font-size: .8rem; font-weight: 700;
  background: var(--h-solid, #fff); color: var(--h-ink); box-shadow: 0 .15rem .7rem rgba(0,0,0,.18); }
.hv .hv-w-size { flex: 0 0 auto; min-height: 2.5rem; padding: 0 .85rem; border-radius: 99rem; font-size: .78rem; font-weight: 700; background: var(--h-solid, #fff); color: var(--h-ink); box-shadow: 0 .15rem .7rem rgba(0,0,0,.28); }
.hv-w-grip:focus-visible, .hv-w-x:focus-visible, .hv-w-size:focus-visible, .hv-w-add:focus-visible { outline: 3px solid var(--h-acc); outline-offset: 2px; }
.hv.hv-editing .hv-w.hv-w-ghost { padding: 1.8rem 1rem 1rem; border: 1px dashed var(--h-line); border-radius: 1.3rem; }
.hv-w-when { text-align: center; }
.hv .hv-w-add { display: flex; align-items: center; justify-content: center; gap: .45rem; width: 100%; min-height: 3rem; box-sizing: border-box; border-radius: 1.2rem; font-size: .9rem; font-weight: 700;
  border: 2px dashed transparent; border: 2px dashed color-mix(in srgb, var(--h-ink) 28%, transparent); color: var(--h-ink); background: var(--h-card, transparent); background: color-mix(in srgb, var(--h-card, transparent) 60%, transparent); }
.hv .hv-w-add:hover { border-color: var(--h-acc); color: var(--h-acc); }
/* the drag: the widget under the finger, a dashed place where it lands, the places that cannot take it dimmed */
.hv-w-ph { box-sizing: border-box; border: 2px dashed var(--h-acc); border-radius: 1.4rem; background: transparent; background: color-mix(in srgb, var(--h-acc) 12%, transparent); }
.hv .hv-w.hv-w-lift { position: fixed; z-index: 40; margin: 0; pointer-events: none; scale: 1.03; opacity: .95; box-shadow: 0 1.2rem 3rem rgba(0,0,0,.35); }
.hv-dragging .hv-edit-slot.hv-drop-ok { outline-color: var(--h-acc); }
.hv-dragging .hv-edit-slot.hv-drop-no { opacity: .4; }
.hv-dragging, .hv-dragging * { cursor: grabbing !important; }
.hv-w-new { animation: hv-new 1.2s ease-out both; }
@keyframes hv-new { from { box-shadow: 0 0 0 .3rem var(--h-acc); } to { box-shadow: 0 0 0 0 transparent; } }
/* the bar while editing: Done, a quiet Reset to defaults, the Undo notice */
.hv-edit-bar { position: fixed; z-index: 20; left: 50%; bottom: max(.8rem, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(34rem, calc(100% - 1.6rem)); box-sizing: border-box;
  display: flex; flex-direction: column; gap: .5rem; padding: .55rem .6rem .55rem .9rem; border-radius: 1.5rem; background: var(--h-solid, #fff); color: var(--h-ink, #111); border: 1px solid var(--h-line, rgba(0,0,0,.1));
  box-shadow: 0 .8rem 2.4rem rgba(0,0,0,.3); font-family: ui-rounded, 'SF Pro Rounded', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; animation: hv-fade .2s both; }
.hv-edit-main { display: flex; flex-direction: column; gap: .5rem; }
.hv-edit-bar button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; box-shadow: none; }
.hv-edit-row { display: flex; align-items: center; gap: .6rem; }
.hv-edit-hint { flex: 1 1 auto; text-align: center; font-size: .8rem; color: var(--h-dim, #666); }
.hv-edit-bar .hv-reset-b { color: var(--h-dim, #666); font-size: .8rem; text-decoration: underline; padding: .6rem .1rem; }
.hv-edit-bar .hv-edit-btn { min-height: 2.6rem; padding: 0 1.1rem; border-radius: 99rem; font-weight: 700; font-size: .9rem; background: transparent; background: color-mix(in srgb, var(--h-ink, #111) 9%, transparent); }
.hv-edit-bar .hv-edit-btn.hot { background: var(--h-acc, #5b5bf0); color: var(--h-on, #fff); }
.hv-edit-bar .hv-reset-ask { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.hv-edit-bar .hv-reset-ask p { flex: 1 1 12rem; margin: 0; font-size: .9rem; }
.hv-undo { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .45rem .5rem .45rem .9rem; border-radius: 99rem; background: var(--h-ink, #111); color: var(--h-bg, #fff); font-size: .85rem; }
.hv-edit-bar .hv-undo .hv-link { color: inherit; text-decoration: underline; font-weight: 700; padding: .4rem .5rem; }
.hv-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 400px) { .hv-edit-hint { visibility: hidden; } }
/* the "+" sheet: each widget drawn small, live */
.hv-add-list { display: flex; flex-direction: column; gap: .5rem; }
.hv-pop .hv-add-w { display: flex; align-items: center; gap: .8rem; width: 100%; padding: .5rem; border-radius: 1.1rem; text-align: left; background: transparent; background: color-mix(in srgb, var(--h-ink) 5%, transparent); }
.hv-pop .hv-add-w:hover { background: transparent; background: color-mix(in srgb, var(--h-ink) 10%, transparent); }
.hv-add-prev { position: relative; flex: 0 0 auto; width: 8rem; height: 5rem; overflow: hidden; border-radius: .8rem; background: var(--h-bg); border: 1px solid var(--h-line); }
.hv-add-prev > .hv-w { position: absolute; left: 0; top: 0; width: 16rem; transform: scale(.5); transform-origin: 0 0; padding: .6rem; box-sizing: border-box; pointer-events: none; }
.hv-add-w .hv-row-t { flex: 1 1 auto; }
.hv-add-plus { flex: 0 0 auto; width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border-radius: 50%; background: var(--h-acc); color: var(--h-on); }
