/* CPQ messages: how the app tells people things. Tokens only. The rule for which one to use is in DESIGN-NOTES.md
   ("Which message when") and live in lab.html. The base toast is in shell.css. */

/* ---------- Toast extras: the queue shows one at a time; an action or a close button is optional ---------- */
.toast .close { text-decoration: none; padding: 0; }
.toast .close svg { width: var(--hba-icon-medium); height: var(--hba-icon-medium); }
.toast > span { padding: var(--hba-space-2) 0; }

/* ---------- Notice: something true of the whole screen or a section. Stays until it stops being true.
   Icon, words and colour together. Errors go here, never in a toast ---------- */
.notice {
  display: flex; align-items: center; gap: var(--hba-space-3); margin: 0 0 var(--hba-space-2); padding: var(--hba-space-3);
  border-radius: var(--hba-radius-card); border: var(--hba-border-thin) solid var(--hba-line-decorative); background: var(--hba-surface-page);
}
.notice > div { flex: 1; min-width: 0; display: grid; }
.notice b { font-weight: var(--hba-font-weight-bold); line-height: 1.3; }
.notice span { font-size: var(--hba-type-size-small); line-height: 1.35; }
.notice > svg { flex: none; }
.notice.warn { background: var(--hba-status-warning-soft); border-color: var(--hba-status-warning); }
.notice.warn > svg { color: var(--hba-status-warning); }
.notice.error { background: var(--hba-status-danger-soft); border-color: var(--hba-status-danger); }
.notice.error > svg { color: var(--hba-status-danger); }
.notice.good { background: var(--hba-status-success-soft); border-color: var(--hba-status-success); }
.notice.good > svg { color: var(--hba-status-success); }
.notice.info { background: var(--hba-surface-selected); border-color: var(--hba-action-primary); }
.notice.info > svg { color: var(--hba-action-primary); }
.notice .add, .notice .btn { flex: none; min-width: 0; }

/* ---------- Saved line: a quiet word beside the thing that saved. Says so only when it is true ---------- */
.saved { display: inline-flex; align-items: center; gap: var(--hba-space-1); font-size: var(--hba-type-size-small); color: var(--hba-text-muted); }
.saved.ok { color: var(--hba-status-success); }
.saved.bad { color: var(--hba-status-danger); font-weight: var(--hba-font-weight-bold); }

/* ---------- Empty state: a line drawing, what is true, what to do ---------- */
.empty { display: grid; justify-items: center; gap: var(--hba-space-2); padding: var(--hba-space-5) 0 var(--hba-space-4); text-align: center; }
.empty .art { width: 120px; height: 72px; color: var(--hba-action-primary); }
.empty h2 { margin: var(--hba-space-2) 0 0; font-size: var(--hba-type-size-h3); line-height: var(--hba-type-leading-heading); font-weight: var(--hba-font-weight-bold); }
.empty p { margin: 0 0 var(--hba-space-2); font-size: var(--hba-type-size-small); color: var(--hba-text-muted); }
.add.wide { width: 100%; height: 48px; }

/* ---------- First load: grey rows where content will be. Never a spinner over a blank screen ---------- */
.skel { display: grid; gap: var(--hba-space-4); padding-top: var(--hba-space-4); }
.skel i { display: block; height: 60px; border-radius: var(--hba-radius-card); background: var(--hba-surface-alt); border: var(--hba-border-thin) solid var(--hba-line-decorative); }

/* ---------- Dialog: stops everything for one decision that cannot be undone ----------
   Native <dialog>, opened with showModal(), so focus is held inside and Escape or the phone's Back closes it. */
dialog.dialog, dialog.sheet { border: 0; padding: 0; color: var(--hba-text-primary); background: var(--hba-surface-raised); box-shadow: var(--hba-elevation-dialog); }
dialog::backdrop { background: var(--hba-overlay-scrim); }
dialog.dialog { width: min(calc(100% - 32px), 400px); border-radius: var(--hba-radius-sheet); }
.dialog .in { display: grid; gap: var(--hba-space-3); padding: var(--hba-space-5); }
.dialog h2 { margin: 0; font-size: var(--hba-type-size-h3); line-height: var(--hba-type-leading-heading); font-weight: var(--hba-font-weight-bold); }
.dialog p { margin: 0; }
/* The safe choice is first and wide; the dangerous one says exactly what it does */
.dialog .acts { display: grid; gap: var(--hba-space-2); margin-top: var(--hba-space-2); }

/* ---------- Bottom sheet: a short list of things to do with what you tapped. Rises from the bottom, in thumb reach ---------- */
dialog.sheet {
  width: 100%; max-width: 480px; margin: auto auto 0; border-radius: var(--hba-radius-sheet) var(--hba-radius-sheet) 0 0;
  padding-bottom: env(safe-area-inset-bottom, 0px); max-height: 84dvh;
  overflow: hidden;
}
dialog.sheet[open] { display: flex; flex-direction: column; }
.sheet .grab {
  width: 40px; height: 4px; margin: var(--hba-space-2) auto; border-radius: 2px;
  background: var(--hba-line-control); flex: none; touch-action: none;
  transition: width var(--hba-duration-fast), background-color var(--hba-duration-fast);
}
.sheet.dragging .grab { width: 52px; background: var(--hba-action-primary); }
.sheet h2 { margin: 0; padding: var(--hba-space-1) var(--hba-space-4) var(--hba-space-2); font-size: var(--hba-type-size-body); font-weight: var(--hba-font-weight-bold); flex: none; }
.sheet .sheet-body { overflow-y: auto; overscroll-behavior: contain; flex: 1 1 auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--hba-text-primary) 20%, transparent) transparent; }
.sheet .sheet-foot {
  flex: none; display: grid; gap: var(--hba-space-2); padding: var(--hba-space-3) var(--hba-space-4) var(--hba-space-2);
  background: color-mix(in srgb, var(--hba-surface-page) 94%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: var(--hba-border-thin) solid color-mix(in srgb, var(--hba-text-primary) 10%, transparent);
}
.sheet .act {
  width: 100%; min-height: 56px; padding: 0 var(--hba-space-4); display: flex; align-items: center; gap: var(--hba-space-3);
  background: none; border: 0; border-top: var(--hba-border-thin) solid var(--hba-line-decorative); text-align: start;
}
.sheet .act:active { background: var(--hba-surface-alt); }
.sheet .act.danger { color: var(--hba-status-danger); }
.sheet .act.cancel { justify-content: center; font-weight: var(--hba-font-weight-bold); color: var(--hba-action-link); }
@media (prefers-reduced-motion: no-preference) {
  body { transition: background-color 220ms ease-out; }
  body.sheet-open { background: #14111c !important; }
  .app {
    transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease-out, border-radius 240ms cubic-bezier(0.22, 1, 0.36, 1);
    transform-origin: center top;
    will-change: transform, opacity;
  }
  body.sheet-open .app {
    background: var(--hba-surface-page) !important;
    transform: scale(0.95) translateY(8px);
    opacity: 0.88;
    border-radius: 18px;
  }
  dialog.sheet[open] { animation: hba-rise 260ms cubic-bezier(0.22, 1, 0.36, 1) both; }
  dialog.sheet[open]::backdrop { animation: hba-fade 220ms cubic-bezier(0.22, 1, 0.36, 1) both; }
  dialog.dialog[open] { animation: hba-fade var(--hba-duration-base) ease-out; }
  /* Closing: the same move backwards, a little quicker. js adds .closing, then really closes it. */
  dialog.sheet.closing { animation: hba-sink 160ms cubic-bezier(0.4, 0, 1, 1) forwards; }
  dialog.sheet.closing::backdrop { animation: hba-fade-out 150ms ease-in forwards; }
  dialog.dialog.closing { animation: hba-fade-out var(--hba-duration-fast) ease-in forwards; }
}
@media (prefers-reduced-motion: reduce) {
  body.sheet-open .app { filter: brightness(0.92); }
  dialog.sheet[open], dialog.sheet[open]::backdrop { animation: hba-fade 120ms linear both; }
  dialog.sheet.closing, dialog.sheet.closing::backdrop { animation: hba-fade-out 100ms linear forwards; }
}
@keyframes hba-rise { from { transform: translateY(32px) scale(0.96); opacity: 0; } }
@keyframes hba-fade { from { opacity: 0; } }
@keyframes hba-sink { to { transform: translateY(24px) scale(0.97); opacity: 0; } }
@keyframes hba-fade-out { to { opacity: 0; } }

/* ---------- Round Rotary Dial (Circular SVG + Key Detents) ---------- */
.cdial-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 4px 0 6px; }
.cdial-ring { position: relative; width: 220px; height: 220px; }
.cdial-svg { width: 220px; height: 220px; touch-action: none; user-select: none; cursor: grab; overflow: visible; }
.cdial-svg:active { cursor: grabbing; }
.cdial-track { fill: none; stroke: color-mix(in srgb, var(--hba-text-primary) 13%, transparent); stroke-width: 12; stroke-linecap: round; }
.cdial-fill { fill: none; stroke: var(--hba-action-primary); stroke-width: 12; stroke-linecap: round; }
.cdial-tick { stroke: color-mix(in srgb, var(--hba-text-primary) 42%, transparent); stroke-width: 2; stroke-linecap: round; }
.cdial-klabel { font-size: 11px; font-weight: 700; fill: var(--hba-text-muted); cursor: pointer; }
.cdial-knob { fill: #fff; stroke: var(--hba-action-primary); stroke-width: 3.5; transition: r .12s ease; }
.cdial-knob.is-key { r: 13; stroke-width: 4.5; }
.cdial-center {
  position: absolute; inset: 46px; border-radius: 50%; border: 0; background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer;
}
.cdial-val { font-size: 34px; font-weight: 800; line-height: 1; color: var(--hba-text-primary); font-variant-numeric: tabular-nums; }
.cdial-center small { font-size: 12px; color: var(--hba-text-muted); font-weight: 600; }
.cdial-key-badge {
  padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .04em;
  background: color-mix(in srgb, var(--hba-action-primary) 16%, transparent); color: var(--hba-action-primary);
}

/* ---------- Add Building Sheet (Liquid Glass Cards + Progressive Commitment) ---------- */
.add-gen-hero {
  width: 100%; display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; text-align: left;
  padding: 12px 14px; margin-bottom: 10px; border-radius: var(--hba-radius-md); cursor: pointer; font: inherit; color: inherit;
  background: color-mix(in srgb, var(--hba-action-primary) 8%, var(--hba-surface-page));
  border: var(--hba-border-thin) solid color-mix(in srgb, var(--hba-action-primary) 34%, transparent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45);
}
.add-gen-hero .alt-tag { white-space: nowrap; }
.add-gen-hero .plan { width: 48px; height: 30px; }
.add-gen-hero b, .add-tile b { display: block; font-size: var(--hba-font-size-sm); font-weight: 700; line-height: 1.25; }
.add-gen-hero span, .add-tile span { font-size: var(--hba-font-size-xs); color: var(--hba-text-muted); }
.add-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.add-tile {
  display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 8px; text-align: left;
  min-height: 56px; padding: 9px 10px; border-radius: var(--hba-radius-md); cursor: pointer; font: inherit; color: inherit;
  background: color-mix(in srgb, var(--hba-surface-page) 84%, transparent);
  border: var(--hba-border-thin) solid color-mix(in srgb, var(--hba-text-primary) 12%, transparent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
}
.add-tile.plan-tile { grid-template-columns: 44px minmax(0, 1fr); gap: 9px; }
.add-tile-plan { width: 44px; height: 28px; display: grid; place-items: center; }
.add-tile-plan .plan { width: 42px; height: 24px; }
.add-tile-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--hba-action-primary) 10%, transparent); color: var(--hba-action-primary); }
.add-tile-ic svg { width: 17px; height: 17px; }
.add-tile.on, .add-gen-hero.on { border-color: var(--hba-action-primary); background: color-mix(in srgb, var(--hba-surface-selected) 62%, transparent); }
.add-tile:active, .add-gen-hero:active { transform: scale(0.97); }

/* ---------- Estimator Catalogue Reorganiser Cards ---------- */
.est-cat-h { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--hba-text-muted); margin: 10px 0 6px; }
.est-cat-card {
  padding: 9px 10px; margin-bottom: 7px; border-radius: var(--hba-radius-md);
  background: color-mix(in srgb, var(--hba-surface-page) 78%, transparent);
  border: var(--hba-border-thin) solid color-mix(in srgb, var(--hba-text-primary) 12%, transparent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
}
.est-cat-card.off { opacity: 0.56; }
.est-cat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.est-cat-top b { font-size: var(--hba-font-size-sm); font-weight: 700; }
.est-cat-acts { display: flex; align-items: center; gap: 5px; }
.est-mv {
  width: 30px; height: 30px; border-radius: 50%; border: var(--hba-border-thin) solid color-mix(in srgb, var(--hba-text-primary) 16%, transparent);
  background: transparent; color: var(--hba-text-primary); font: inherit; font-weight: 700; cursor: pointer;
}
.est-mv:disabled { opacity: 0.28; cursor: default; }
.est-cat-pills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.est-cpill {
  min-height: 28px; border-radius: 999px; font: inherit; font-size: 11px; font-weight: 600; cursor: pointer;
  border: var(--hba-border-thin) solid color-mix(in srgb, var(--hba-text-primary) 14%, transparent);
  background: transparent; color: var(--hba-text-muted);
}
.est-cpill.on { background: var(--hba-action-primary); border-color: var(--hba-action-primary); color: #fff; }

/* ---------- Step 2 Type & Config Grouping Bar ---------- */
.sc-vbar { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0 0 10px; }
.sc-vtab {
  min-height: 36px; border-radius: var(--hba-radius-sm); font: inherit; font-size: var(--hba-font-size-xs); font-weight: 700;
  border: var(--hba-border-thin) solid color-mix(in srgb, var(--hba-text-primary) 14%, transparent);
  background: color-mix(in srgb, var(--hba-surface-page) 75%, transparent); color: var(--hba-text-muted); cursor: pointer;
}
.sc-vtab.on { background: var(--hba-action-primary); border-color: var(--hba-action-primary); color: #fff; }
.sc-subg {
  display: flex; align-items: center; justify-content: space-between; padding: 8px 14px 2px;
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--hba-text-muted);
}
.sc-sub-chg { border: 0; background: transparent; font: inherit; font-size: 11px; font-weight: 700; color: var(--hba-action-primary); cursor: pointer; padding: 2px 0; }
.sc-utag {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px; font-size: 10px; font-weight: 700;
  background: color-mix(in srgb, var(--hba-text-primary) 8%, transparent); color: var(--hba-text-muted);
}

/* ---------- Condensed Scope Halo & Integrated Liquid Glass Morph ---------- */
.sc-halo {
  --halo-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --halo-overshoot: cubic-bezier(0.32, 1.25, 0.5, 1);
  --halo-bar-h: 48px;
  --halo-drawer-r: 26px;
  flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0;
  width: 100%; max-width: 100%; height: auto !important; box-sizing: border-box; overflow: visible;
  min-height: calc(var(--halo-bar-h) + env(safe-area-inset-top, 0px) + var(--hba-border-thin));
  padding: env(safe-area-inset-top, 0px) 12px 0;
  z-index: 5;
  transition: border-radius 300ms var(--halo-spring),
    box-shadow 260ms ease-out,
    background-color 240ms ease-out;
}
.app:has(.sc-halo.expanded) .scroll {
  transform: scale(0.988);
  filter: blur(4px) saturate(0.82);
  transition: transform 320ms var(--halo-spring), filter 260ms ease-out;
}
.scroll { transition: transform 280ms var(--halo-spring), filter 240ms ease-out; }
.sc-halo.expanded {
  overflow-x: hidden;
  overflow-y: auto;
  max-height: calc(var(--vv-h, 100dvh) - 18px);
  scroll-padding-bottom: 120px;
  border-bottom-left-radius: var(--halo-drawer-r); border-bottom-right-radius: var(--halo-drawer-r);
  background: color-mix(in srgb, var(--hba-surface-raised, #ffffff) 86%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(185%);
  backdrop-filter: blur(22px) saturate(185%);
  border-bottom: var(--hba-border-thin) solid color-mix(in srgb, var(--hba-text-primary, #161616) 14%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--hba-overlay-on-scrim, #ffffff) 40%, transparent), 0 22px 48px rgba(0, 0, 0, 0.22);
}
.sc-halo.expanded::before { opacity: 0; pointer-events: none; }
.sc-halo.expanded .halo-proj-txt b { color: var(--hba-text-primary, #161616); }
.sc-halo.expanded .halo-sub { color: var(--hba-text-muted, #5f6470); }
.sc-halo.expanded .halo-sub-ico { opacity: 0.94; }
.halo-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  height: calc(56px - 12px * var(--p, 0)); width: 100%; min-width: 0; flex: none;
}
.sc-halo.expanded .halo-bar { height: var(--halo-bar-h); }
.halo-proj-wrap {
  display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 0%; overflow: hidden;
  min-height: 44px; padding: 2px 4px 2px 0; text-align: left; justify-content: flex-start;
  transition: transform 120ms var(--halo-spring);
}
.halo-proj-wrap:active { transform: scale(0.97); }
.halo-client-av {
  width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; overflow: hidden;
  background: #fff;
  border: var(--hba-border-thin) solid color-mix(in srgb, var(--hba-action-primary) 28%, transparent);
  color: var(--hba-action-primary); font-size: 13px; font-weight: 800;
}
.halo-client-av img { width: 22px; height: 22px; object-fit: contain; display: block; }
.halo-proj-txt { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.halo-proj-txt b { font-size: 13.5px; font-weight: 800; line-height: 1.2; color: var(--hba-text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.halo-sub {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; line-height: 1.2; color: var(--hba-text-muted);
  white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 0; overflow: hidden;
  max-height: 16px; opacity: 1; transform: translateY(0);
  transition: opacity 240ms var(--halo-spring), transform 240ms var(--halo-spring), max-height 240ms var(--halo-spring);
}
.sc-halo.labels-hidden:not(.expanded) .halo-sub {
  max-height: 0; opacity: 0; transform: translateY(-4px);
  transition: opacity 150ms ease-in, transform 170ms ease-in, max-height 200ms var(--halo-spring);
}
.sc-halo.expanded .halo-sub { max-height: 16px; opacity: 1; transform: none; }
.halo-sub-item { display: inline-flex; align-items: center; gap: 3px; min-width: 0; overflow: hidden; }
.halo-sub-item > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.halo-sub-item.is-metric { flex: 0 0 auto; overflow: visible; }
.halo-sub-item.is-metric > span { overflow: visible; text-overflow: clip; white-space: nowrap; }
.halo-sub-ico { width: 11px; height: 11px; flex: none; opacity: 0.78; display: block; }
.halo-sub-sep { opacity: 0.55; }
.halo-dots { display: flex; align-items: center; gap: 4px; flex: none; }
.hdot {
  width: 6px; height: 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--hba-text-primary) 20%, transparent);
  transition: width 240ms cubic-bezier(0.22, 1, 0.36, 1), background-color 200ms ease-out;
}
.hdot.done { background: color-mix(in srgb, var(--hba-action-primary) 55%, transparent); }
.hdot.now { width: 18px; background: var(--hba-action-primary); }
.halo-proj-row { display: inline-flex; align-items: center; gap: 3px; max-width: 100%; }
.halo-proj-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.halo-chev { width: 12px; height: 12px; flex: none; color: var(--hba-text-muted); transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1); }
.halo-proj-wrap[aria-expanded="true"] .halo-chev { transform: rotate(180deg); color: var(--hba-action-primary); }
.halo-send {
  position: relative;
  flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; padding: 0;
  background: color-mix(in srgb, var(--hba-text-primary) 7%, transparent);
  border: var(--hba-border-thin) solid color-mix(in srgb, var(--hba-text-primary) 12%, transparent);
  color: var(--hba-text-muted); opacity: 0.42; cursor: default;
  transition: transform 180ms var(--halo-spring), opacity 200ms, background-color 200ms, color 200ms;
}
.halo-send::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; }
.halo-send svg { width: 16px; height: 16px; }
.halo-send.ready {
  opacity: 1; cursor: pointer; background: var(--hba-action-primary);
  border-color: var(--hba-action-primary); color: var(--hba-action-on-primary);
}
.halo-send.ready:active { transform: scale(0.92); }
.halo-drawer-bg {
  position: absolute; inset: 0; z-index: 4;
  background: color-mix(in srgb, var(--hba-surface-page, #ffffff) 42%, transparent);
  -webkit-backdrop-filter: blur(10px) saturate(0.85); backdrop-filter: blur(10px) saturate(0.85);
  opacity: 0; transition: opacity 280ms ease-out;
}
.halo-drawer-bg.open { opacity: 1; }
.halo-drawer-slot {
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 0fr; opacity: 0; pointer-events: none;
  width: 100%; min-width: 0; overflow: hidden;
  transition: grid-template-rows 320ms var(--halo-spring), opacity 220ms ease-out;
}
.sc-halo.expanded .halo-drawer-slot {
  order: 1;
  grid-template-rows: 1fr; opacity: 1; pointer-events: auto;
}
.sc-halo.expanded .halo-bar,
.sc-halo.expanded .halo-clients {
  order: 2;
  padding-top: 6px;
  border-top: var(--hba-border-thin) solid var(--hba-line-decorative);
}
.sc-halo.expanded .halo-grabber { order: 3; }
.halo-drawer-inner {
  overflow: hidden; min-height: 0; min-width: 0;
  transform-origin: top center; transform: translateY(-8px) scale(0.985);
  transition: transform 300ms var(--halo-spring), padding 300ms var(--halo-spring);
}
.sc-halo.expanded .halo-drawer-inner {
  transform: translateY(0) scale(1);
  padding-top: 4px; padding-bottom: 10px;
}
/* Universal staggered entrance for drawer cards/sections in BOTH HaloLauncherDrawer & HaloScopeDrawer */
.halo-drawer-inner > * > * {
  opacity: 0; transform: translateY(-6px);
  transition: opacity 220ms ease-out, transform 260ms var(--halo-spring);
}
.sc-halo.expanded .halo-drawer-inner > * > * { opacity: 1; transform: translateY(0); }
.sc-halo.expanded .halo-drawer-inner > * > *:nth-child(1) { transition-delay: 30ms; }
.sc-halo.expanded .halo-drawer-inner > * > *:nth-child(2) { transition-delay: 65ms; }
.sc-halo.expanded .halo-drawer-inner > * > *:nth-child(3) { transition-delay: 100ms; }
.sc-halo.expanded .halo-drawer-inner > * > *:nth-child(4) { transition-delay: 135ms; }
.hd-sec {
  padding: 9px 0; border-bottom: var(--hba-border-thin) solid rgba(22, 19, 31, 0.08);
  opacity: 0; transform: translateY(-5px);
  transition: opacity 220ms ease-out, transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}
.sc-halo.expanded .hd-sec { opacity: 1; transform: translateY(0); }
.sc-halo.expanded .hd-sec:nth-child(1) { transition-delay: 35ms; }
.sc-halo.expanded .hd-sec:nth-child(2) { transition-delay: 75ms; }
.sc-halo.expanded .hd-sec:nth-child(3) { transition-delay: 115ms; }
.hd-sec:first-child { padding-top: 0; }
.hd-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hd-row small { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--hba-text-muted, #5f6470); }
.hd-row b { font-size: 13px; font-weight: 800; color: var(--hba-text-primary, #161616); }
.halo-drawer-inner .est-pill {
  background: var(--hba-surface-alt, #f4f6f8);
  border-color: var(--hba-line-control, #717986);
  color: var(--hba-text-primary, #161616);
  transition: transform 160ms cubic-bezier(0.22, 1, 0.36, 1), background-color 180ms ease-out, color 180ms ease-out, border-color 180ms ease-out, box-shadow 180ms ease-out;
}
.halo-drawer-inner .est-pill.on {
  background: color-mix(in srgb, var(--hba-action-primary) 88%, rgba(255, 255, 255, 0.2));
  border-color: transparent; color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 4px 14px color-mix(in srgb, var(--hba-action-primary) 34%, transparent);
}
.halo-drawer-inner .est-pill:active, .halo-drawer-inner .est-mv:active, .hd-foot .btn:active { transform: scale(0.95); }
.hd-pax-acts { display: flex; align-items: center; gap: 6px; }
.hd-pax-acts .est-mv {
  width: auto; min-width: 36px; padding: 0 9px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: rgba(255, 255, 255, 0.46); border-color: rgba(255, 255, 255, 0.66); color: #120f1d;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 1px 2px rgba(16, 12, 28, 0.06);
  transition: transform 160ms cubic-bezier(0.22, 1, 0.36, 1), background-color 160ms ease-out;
}
.hd-foot {
  display: grid; grid-template-columns: 1fr auto; gap: 8px; padding-top: 10px;
  opacity: 0; transform: translateY(-5px);
  transition: opacity 220ms ease-out 145ms, transform 260ms cubic-bezier(0.22, 1, 0.36, 1) 145ms;
}
.sc-halo.expanded .hd-foot { opacity: 1; transform: translateY(0); }
.hd-foot .btn {
  min-height: 36px; font-size: 12px; font-weight: 700; padding: 0 12px;
  background: rgba(255, 255, 255, 0.48); border: var(--hba-border-thin) solid rgba(255, 255, 255, 0.68);
  color: #120f1d; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 1px 3px rgba(16, 12, 28, 0.06);
  transition: transform 160ms cubic-bezier(0.22, 1, 0.36, 1), background-color 180ms ease-out;
}
.halo-proj {
  display: flex; flex-direction: column; align-items: flex-start; min-width: 0; flex: 1;
  border: 0; background: transparent; padding: 2px 4px; text-align: left; cursor: pointer;
}
.halo-proj b { font-size: 13px; font-weight: 800; line-height: 1.15; color: var(--hba-text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.halo-proj span { font-size: 11px; line-height: 1.15; color: var(--hba-text-muted); white-space: nowrap; }
.halo-proj i { font-style: normal; font-weight: 700; color: var(--hba-action-primary); font-variant-numeric: tabular-nums; }
.sc-head-tight { padding-top: 6px !important; padding-bottom: 6px !important; }
.sc-head-tight h1 { font-size: 22px; line-height: 1.18; margin: 0; }
.sc-ctx-bar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; width: 100%; max-width: 100%; box-sizing: border-box; }
.sc-ctx-pill {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; width: 100%; overflow: hidden; box-sizing: border-box;
  padding: 6px 8px; border-radius: var(--hba-radius-sm); font: inherit; text-align: left; cursor: pointer;
  background: color-mix(in srgb, var(--hba-surface-page) 82%, transparent);
  border: var(--hba-border-thin) solid color-mix(in srgb, var(--hba-text-primary) 13%, transparent);
}
.sc-ctx-pill.stat { cursor: default; }
.sc-ctx-pill.accent { border-color: color-mix(in srgb, var(--hba-action-primary) 40%, transparent); background: color-mix(in srgb, var(--hba-action-primary) 8%, var(--hba-surface-page)); }
.sc-ctx-pill small { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--hba-text-muted); }
.sc-ctx-pill b { font-size: 12px; font-weight: 800; color: var(--hba-text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.sc-ctx-pill.accent b { color: var(--hba-action-primary); }
.sc-ctx-pill:active { transform: scale(0.96); }

/* ---------- Continuous Edge-to-Edge Canvas & Seam-Free Frost ---------- */
:root:not([data-glass$="off"]) body {
  background:
    radial-gradient(120% 24% at 0% 0%, color-mix(in srgb, var(--hba-brand-surface) var(--ambient-a, 28%), transparent), transparent 64%),
    radial-gradient(120% 26% at 100% 100%, color-mix(in srgb, var(--hba-brand-surface) var(--ambient-a, 28%), transparent), transparent 66%),
    radial-gradient(65% 20% at 0% 96%, color-mix(in srgb, var(--hba-brand-accent) var(--ambient-b, 14%), transparent), transparent 64%),
    radial-gradient(65% 18% at 100% 4%, color-mix(in srgb, var(--hba-status-info) var(--ambient-b, 14%), transparent), transparent 64%),
    var(--hba-surface-page);
}
:root:not([data-glass$="off"]) .app { background: transparent; }
.scroll { background: transparent; scrollbar-width: none; -ms-overflow-style: none; }
.scroll::-webkit-scrollbar { display: none; }
:root:not([data-glass$="off"]) .sc-halo::before { display: none; }
.halo-prog-blur { position: absolute; inset: 0 0 -34px 0; z-index: -1; pointer-events: none; transition: opacity 220ms ease-out; }
.sc-halo.expanded .halo-prog-blur { opacity: 0; }
:root[data-glass$="off"] .halo-prog-blur { display: none; }
.halo-prog-blur i { position: absolute; inset: 0; display: block; font-style: normal; }
.halo-prog-blur i:nth-child(1) {
  background: linear-gradient(to bottom, color-mix(in srgb, var(--hba-surface-page) 86%, transparent) 0%, color-mix(in srgb, var(--hba-surface-page) 48%, transparent) 52%, transparent 86%);
  -webkit-backdrop-filter: blur(20px) saturate(175%); backdrop-filter: blur(20px) saturate(175%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 44%, transparent 72%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 44%, transparent 72%);
}
.halo-prog-blur i:nth-child(2) {
  -webkit-backdrop-filter: blur(10px) saturate(150%); backdrop-filter: blur(10px) saturate(150%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.88) 50%, transparent 86%);
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.88) 50%, transparent 86%);
}
.halo-prog-blur i:nth-child(3) {
  -webkit-backdrop-filter: blur(3px) saturate(125%); backdrop-filter: blur(3px) saturate(125%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.58) 64%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.58) 64%, transparent 100%);
}
:root:not([data-glass$="off"]) .foot::before {
  inset: -24px 0 0 0; height: auto;
  background: linear-gradient(to top, color-mix(in srgb, var(--hba-surface-page) 96%, transparent) 0%, color-mix(in srgb, var(--hba-surface-page) 82%, transparent) 58%, transparent 100%);
  -webkit-backdrop-filter: blur(18px) saturate(165%); backdrop-filter: blur(18px) saturate(165%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 42%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 42%);
}

/* ---------- Omnibar + Morph & Push-Out Choreography ---------- */
@media (prefers-reduced-motion: no-preference) {
  .omni-back, .omnibar, .omni-side {
    transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1), opacity 180ms ease-out,
                background-color 180ms ease-out, color 180ms ease-out, border-color 180ms ease-out;
    will-change: transform, opacity;
  }
  .omni-side svg { transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1); }
  body.sheet-open.add-morph .omni-back { transform: translateX(-40px) scale(0.76); opacity: 0; pointer-events: none; }
  body.sheet-open.add-morph .omnibar { transform: translateX(-32px) scale(0.86); opacity: 0; pointer-events: none; }
  body.sheet-open.add-morph .omni-side {
    transform: translateX(calc(-50vw + 42px)) scale(1.16);
    background: var(--hba-action-primary); border-color: var(--hba-action-primary); color: var(--hba-action-on-primary);
  }
  body.sheet-open.add-morph .omni-side svg { transform: rotate(135deg); }
  @keyframes hba-morph-rise {
    from { opacity: 0.4; transform: translateY(48px) scale(0.86); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
  }
  dialog.sheet.from-add[open] {
    transform-origin: 86% 96%;
    animation: hba-morph-rise 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }
}

/* ---------- Unified In-Place Halo Sub-Views, Iconography & Grabber ---------- */
.hd-ico, .hd-ico-s { width: 12px; height: 12px; flex: none; vertical-align: -1.5px; display: inline-block; }
.hd-row > div { min-width: 0; }
.hd-row small { display: flex; align-items: center; gap: 4px; }
.hd-act-pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; color: var(--hba-action-primary); cursor: pointer;
  background: rgba(255, 255, 255, 0.56); border: var(--hba-border-thin) solid rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 1px 2px rgba(16, 12, 28, 0.05);
  transition: transform 150ms cubic-bezier(0.22, 1, 0.36, 1), background-color 160ms ease-out;
}
.hd-act-pill:active { transform: scale(0.94); }
.hd-foot .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.hd-foot-3 { grid-template-columns: auto 1fr auto; }
.hd-icon-btn { width: 36px; padding: 0 !important; }
.hd-foot .btn.primary {
  background: color-mix(in srgb, var(--hba-action-primary) 90%, rgba(255, 255, 255, 0.15));
  border-color: transparent; color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 4px 14px color-mix(in srgb, var(--hba-action-primary) 32%, transparent);
}
.hd-sub-hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 8px; border-bottom: var(--hba-border-thin) solid rgba(22, 19, 31, 0.08); }
.hd-back {
  display: inline-flex; align-items: center; gap: 3px; padding: 4px 9px 4px 6px; border-radius: 999px;
  font-size: 11px; font-weight: 700; color: #120f1d; cursor: pointer;
  background: rgba(255, 255, 255, 0.52); border: var(--hba-border-thin) solid rgba(255, 255, 255, 0.72);
}
.hd-sub-t { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 800; color: #120f1d; }
.hd-form, .hd-form-2 { display: grid; gap: 8px; }
.hd-form-2 { grid-template-columns: 1fr 1fr; }
.hd-fld { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hd-fld span { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #3d3750; }
.hd-fld input {
  width: 100%; min-width: 0; box-sizing: border-box; height: 34px; padding: 0 10px; border-radius: 10px;
  font: inherit; font-size: 13px; font-weight: 700; color: #120f1d;
  background: rgba(255, 255, 255, 0.65); border: var(--hba-border-thin) solid rgba(22, 19, 31, 0.14);
}
.hd-big-pax { font-size: 18px !important; }
.hd-scroll { max-height: 210px; overflow-y: auto; padding: 4px 0; }
.halo-grabber { display: flex; justify-content: center; padding-top: 8px; margin-bottom: -6px; cursor: grab; }
.halo-grabber span { width: 36px; height: 4px; border-radius: 999px; background: rgba(22, 19, 31, 0.22); }
@keyframes hd-fwd { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: translateX(0); } }
@keyframes hd-back { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: translateX(0); } }
.hd-anim-fwd { animation: hd-fwd 220ms var(--halo-spring, cubic-bezier(0.22, 1, 0.36, 1)); }
.hd-anim-back, .hd-anim-left-in { animation: hd-back 220ms var(--halo-spring, cubic-bezier(0.22, 1, 0.36, 1)); }

@media (prefers-reduced-motion: reduce) {
  .sc-halo, .sc-halo *, .halo-drawer-bg {
    transition-duration: 120ms !important;
    transition-delay: 0ms !important;
    animation: none !important;
  }
}
