/* ============================================================
   Handshake Design System v2 — components

   Every component reads SEMANTIC roles only. There are no raw hex values
   and no --hs-aqua-400 style references below this line. That is what makes
   the whole system rethemeable from tokens/semantic.json.

   Sizing convention, shared by button / input / select / badge:
     --hs-control-h     height
     --hs-control-px    horizontal padding
     --hs-control-fs    font size
     --hs-control-r     radius
   Set those four and controls line up on a shared baseline automatically.
   ============================================================ */

/* ============================================================
   Button
   ============================================================ */
.hs-btn {
  --hs-control-h: var(--hs-size-control-md);
  --hs-control-px: var(--hs-space-4);
  --hs-control-fs: var(--hs-text-sm);
  --hs-control-r: var(--hs-radius-sm);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--hs-space-2);
  height: var(--hs-control-h);
  padding-inline: var(--hs-control-px);
  border: var(--hs-size-hairline) solid transparent;
  border-radius: var(--hs-radius-pill);
  font-family: var(--hs-font-ui);
  font-size: var(--hs-control-fs);
  font-weight: var(--hs-weight-semibold);
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  background: transparent;
  /* `scale` is listed because declaring `transition` at all REPLACES the floor
     in hs-base.css — it is one property, not a list that layers. Without it the
     press scale still applies, it just snaps back instead of easing. */
  transition:
    background-color var(--hs-duration-fast) var(--hs-ease-standard),
    border-color var(--hs-duration-fast) var(--hs-ease-standard),
    color var(--hs-duration-fast) var(--hs-ease-standard),
    box-shadow var(--hs-duration-fast) var(--hs-ease-standard),
    transform var(--hs-duration-instant) var(--hs-ease-standard),
    scale var(--hs-duration-instant) var(--hs-ease-standard);
}

/* The half-pixel sink used to be the whole press response. The base layer now
   scales every button on press, so this is the sink ON TOP of that — they are
   separate properties and both apply. Kept because a button is a physical
   metaphor: it goes down as well as in. */
.hs-btn:active:not(:disabled) {
  transform: translateY(0.5px);
}

.hs-btn:disabled,
.hs-btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.5;
}

/* THE LADDER — three styles, and one reserved.

     primary    ink fill, white text     the thing to do. One per screen.
     secondary  white fill, ink text     the alternative. Always available.
     quiet      text only                inline and dismissive actions.
     danger     red fill                 RESERVED for destructive only.

   Primary uses a dark fill in both themes. Its semantic colors keep the label
   legible without a white fill dominating dark surfaces. Aquamarine marks
   selection and status, not button fills.

   Anything that needs a fourth button style is a screen with too many
   competing actions. Fix the screen. */
.hs-btn--primary {
  background: var(--hs-button-primary-bg);
  color: var(--hs-button-primary-fg);
  border-color: transparent;
  box-shadow: var(--hs-elevation-raised);
}

.hs-btn--primary:hover:not(:disabled) {
  background: var(--hs-button-primary-hover);
  /* Stated, never inherited: the fill changes here, and a hover that leaves
     its text to another rule is how this went white-on-white in dark mode. */
  color: var(--hs-button-primary-fg);
}

.hs-btn--primary:active:not(:disabled) {
  background: var(--hs-button-primary-active);
  color: var(--hs-button-primary-fg);
}

/* Secondary and ghost stay glass, so they need colour behind them —
   see the glass note at the top of this file. */
.hs-btn--secondary,
.hs-btn--ghost,
.hs-btn--quiet {
  backdrop-filter: var(--hs-glass-blur);
  -webkit-backdrop-filter: var(--hs-glass-blur);
  color: var(--hs-fg-primary);
}

.hs-btn--secondary {
  background: var(--hs-glass-control);
  border-color: var(--hs-glass-rim);
  box-shadow: var(--hs-glass-lift);
}

.hs-btn--secondary:hover:not(:disabled) {
  background: var(--hs-glass-control);
  filter: brightness(1.04);
}

/* Ghost is an ALIAS of secondary, not a fourth style.

   It used to be outlined-transparent, which put three near-identical neutral
   treatments in the system (filled 0.88, outlined, text-only) and left authors
   guessing which to reach for. With three styles total the answer has to be
   obvious: is this the action (primary), an alternative (secondary), or an
   aside (quiet)? Existing `--ghost` markup keeps working and lands on
   secondary. */
.hs-btn--ghost {
  background: var(--hs-glass-control);
  border-color: var(--hs-glass-rim);
  box-shadow: var(--hs-glass-lift);
}

.hs-btn--ghost:hover:not(:disabled) {
  filter: brightness(1.04);
}

/* No fill, no border. For actions inside a row that already has structure. */
.hs-btn--quiet {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--hs-fg-secondary);
}

.hs-btn--quiet:hover:not(:disabled) {
  background: var(--hs-glass-control-ghost);
  color: var(--hs-fg-primary);
}

.hs-btn--danger {
  background: var(--hs-danger-solid);
  color: var(--hs-fg-on-solid);
  box-shadow: var(--hs-elevation-raised);
}

.hs-btn--danger:hover:not(:disabled) {
  filter: brightness(0.94);
}

/* Purple. Reserved for AI-authored or automated actions on console surfaces. */
.hs-btn--agent {
  background: var(--hs-accent2-solid);
  color: var(--hs-fg-on-solid);
  box-shadow: var(--hs-elevation-raised);
}

.hs-btn--agent:hover:not(:disabled) {
  background: var(--hs-accent2-solid-hover);
}

/* Text-only. `height: auto` collapsed this to a 16px target — under WCAG
   2.5.8's 24px minimum. The rule keeps the visual as a bare label while giving
   the hit area room to breathe. A standalone text action is deep green with no
   underline (link colour decision, 2026-10-20); the underline is the hover. */
.hs-btn--link {
  height: auto;
  min-height: var(--hs-size-target-min);
  padding: 0;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--hs-fg-link);
  text-decoration: none;
  text-underline-offset: 0.18em;
}
.hs-btn--link:hover {
  color: var(--hs-fg-link-hover);
  text-decoration: underline;
}

/* --- Sizes --- */
.hs-btn--sm {
  --hs-control-h: var(--hs-size-control-sm);
  --hs-control-px: var(--hs-space-3);
  --hs-control-fs: var(--hs-text-xs);
  --hs-control-r: var(--hs-radius-xs);
}

.hs-btn--lg {
  --hs-control-h: var(--hs-size-control-lg);
  --hs-control-px: var(--hs-space-6);
  --hs-control-fs: var(--hs-text-base);
  --hs-control-r: var(--hs-radius-md);
}

/* --- Shape modifiers --- */
.hs-btn--pill {
  --hs-control-r: var(--hs-radius-pill);
}

.hs-btn--block {
  display: flex;
  width: 100%;
}

/* Square icon-only button. aria-label is required. */
.hs-btn--icon {
  --hs-control-px: 0;
  width: var(--hs-control-h);
}

/* Busy state: caller sets aria-busy="true" and leaves the label in place. */
.hs-btn[aria-busy="true"] {
  color: transparent;
  pointer-events: none;
  position: relative;
}

.hs-btn[aria-busy="true"]::after {
  content: "";
  position: absolute;
  width: var(--hs-size-icon-md);
  height: var(--hs-size-icon-md);
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: var(--hs-radius-circle);
  color: var(--hs-fg-on-accent);
  animation: hs-spin 600ms linear infinite;
}

@keyframes hs-spin {
  to {
    transform: rotate(1turn);
  }
}

/* Grouped buttons share a single outline. */
.hs-btn-group {
  display: inline-flex;
}

.hs-btn-group > .hs-btn:not(:first-child) {
  border-start-start-radius: 0;
  border-end-start-radius: 0;
  margin-inline-start: calc(var(--hs-size-hairline) * -1);
}

.hs-btn-group > .hs-btn:not(:last-child) {
  border-start-end-radius: 0;
  border-end-end-radius: 0;
}

/* ============================================================
   Badge  (v1 called this .hs-chip — renamed so both systems can
   coexist on the same page during migration)
   ============================================================ */
.hs-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--hs-space-1);
  height: var(--hs-space-6);
  padding-inline: var(--hs-space-3);
  border: var(--hs-size-hairline) solid transparent;
  border-radius: var(--hs-radius-pill);
  font-family: var(--hs-font-ui);
  font-size: var(--hs-text-xs);
  font-weight: var(--hs-weight-semibold);
  line-height: 1;
  white-space: nowrap;
}

.hs-badge--neutral {
  background: var(--hs-bg-sunken);
  border-color: var(--hs-border-subtle);
  color: var(--hs-fg-secondary);
}

.hs-badge--accent {
  background: var(--hs-accent-muted);
  color: var(--hs-accent-ink);
}

.hs-badge--agent {
  background: var(--hs-accent2-muted);
  color: var(--hs-accent2-ink);
}

.hs-badge--success {
  background: var(--hs-success-bg);
  border-color: var(--hs-success-border);
  color: var(--hs-success-fg);
}

.hs-badge--warning {
  background: var(--hs-warning-bg);
  border-color: var(--hs-warning-border);
  color: var(--hs-warning-fg);
}

.hs-badge--danger {
  background: var(--hs-danger-bg);
  border-color: var(--hs-danger-border);
  color: var(--hs-danger-fg);
}

.hs-badge--info {
  background: var(--hs-info-bg);
  border-color: var(--hs-info-border);
  color: var(--hs-info-fg);
}

/* No status dots. A dot inside a pill reads as a live indicator even when the
   pill is static, which made every tag look like it was reporting something.
   Tone carries the state; the label says what it is. */

/* Count bubble for nav items. */
.hs-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--hs-space-5);
  height: var(--hs-space-5);
  padding-inline: var(--hs-space-1);
  border-radius: var(--hs-radius-pill);
  background: var(--hs-accent-solid);
  color: var(--hs-fg-on-accent);
  font-size: var(--hs-text-2xs);
  font-weight: var(--hs-weight-bold);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* ============================================================
   Card
   ============================================================ */
.hs-card {
  display: flex;
  flex-direction: column;
  background: var(--hs-glass-card);
  backdrop-filter: var(--hs-glass-blur-card);
  -webkit-backdrop-filter: var(--hs-glass-blur-card);
  border: var(--hs-size-hairline) solid var(--hs-glass-card-border);
  border-radius: var(--hs-radius-xl);
  box-shadow: var(--hs-glass-lift);
  overflow: hidden;
}

.hs-card__header,
.hs-card__body,
.hs-card__footer {
  padding: var(--hs-space-5);
}

.hs-card__header {
  display: flex;
  align-items: center;
  gap: var(--hs-space-3);
  border-bottom: var(--hs-size-hairline) solid var(--hs-glass-rim);
}

.hs-card__title {
  font-family: var(--hs-font-ui);
  font-size: var(--hs-text-base);
  font-weight: var(--hs-weight-semibold);
  line-height: var(--hs-leading-snug);
}

.hs-card__subtitle {
  font-size: var(--hs-text-sm);
  color: var(--hs-fg-tertiary);
}

.hs-card__body {
  flex: 1;
}

.hs-card__footer {
  display: flex;
  align-items: center;
  gap: var(--hs-space-2);
  border-top: var(--hs-size-hairline) solid var(--hs-glass-rim);
  background: var(--hs-glass-sunken);
}

/* Flush variant for cards whose body is a table or list. */
.hs-card--flush > .hs-card__body {
  padding: 0;
}

/* Whole-card link/button target. */
.hs-card--interactive {
  cursor: pointer;
  transition:
    border-color var(--hs-duration-base) var(--hs-ease-standard),
    box-shadow var(--hs-duration-base) var(--hs-ease-standard),
    transform var(--hs-duration-base) var(--hs-ease-spring);
}

.hs-card--interactive:hover {
  border-color: var(--hs-border-strong);
  box-shadow: var(--hs-elevation-overlay);
  transform: translateY(-2px);
}

.hs-card--selected {
  border-color: var(--hs-border-accent);
  box-shadow: 0 0 0 var(--hs-size-focus-ring) var(--hs-accent-ring);
}

/* Numeric readout tile. */
.hs-stat {
  display: flex;
  flex-direction: column;
  gap: var(--hs-space-1);
  padding: var(--hs-space-5);
  background: var(--hs-glass-card);
  backdrop-filter: var(--hs-glass-blur-card);
  -webkit-backdrop-filter: var(--hs-glass-blur-card);
  border: var(--hs-size-hairline) solid var(--hs-glass-card-border);
  border-radius: var(--hs-radius-xl);
  box-shadow: var(--hs-glass-lift);
}

.hs-stat__label {
  font-family: var(--hs-font-ui);
  font-size: var(--hs-text-xs);
  font-weight: var(--hs-weight-semibold);
  letter-spacing: var(--hs-tracking-caps);
  text-transform: uppercase;
  color: var(--hs-fg-tertiary);
}

.hs-stat__value {
  font-family: var(--hs-font-ui);
  font-size: var(--hs-text-3xl);
  font-weight: var(--hs-weight-bold);
  line-height: var(--hs-leading-none);
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--hs-tracking-tight);
}

.hs-stat__delta {
  font-size: var(--hs-text-sm);
  font-variant-numeric: tabular-nums;
  color: var(--hs-fg-tertiary);
}

.hs-stat__delta--up {
  color: var(--hs-success-fg);
}

.hs-stat__delta--down {
  color: var(--hs-danger-fg);
}

/* ============================================================
   Form fields
   ============================================================ */
.hs-field {
  display: flex;
  flex-direction: column;
  gap: var(--hs-space-2);
}

.hs-label {
  font-family: var(--hs-font-ui);
  font-size: var(--hs-text-sm);
  font-weight: var(--hs-weight-semibold);
  line-height: var(--hs-leading-snug);
  color: var(--hs-fg-primary);
}

.hs-label__optional {
  font-weight: var(--hs-weight-regular);
  color: var(--hs-fg-tertiary);
}

.hs-help {
  font-size: var(--hs-text-sm);
  line-height: var(--hs-leading-normal);
  color: var(--hs-fg-tertiary);
}

.hs-error {
  display: flex;
  align-items: center;
  gap: var(--hs-space-1);
  font-size: var(--hs-text-sm);
  color: var(--hs-danger-fg);
}

.hs-input,
.hs-select,
.hs-textarea {
  --hs-control-h: var(--hs-size-control-md);
  --hs-control-px: var(--hs-space-3);

  width: 100%;
  min-height: var(--hs-control-h);
  padding: 0 var(--hs-control-px);
  background: var(--hs-glass-raised);
  backdrop-filter: var(--hs-glass-blur);
  -webkit-backdrop-filter: var(--hs-glass-blur);
  border: var(--hs-size-hairline) solid var(--hs-glass-rim);
  border-radius: var(--hs-radius-md);
  font-size: var(--hs-text-sm);
  line-height: var(--hs-leading-normal);
  color: var(--hs-fg-primary);
  transition:
    border-color var(--hs-duration-fast) var(--hs-ease-standard),
    box-shadow var(--hs-duration-fast) var(--hs-ease-standard);
}

.hs-textarea {
  min-height: calc(var(--hs-size-control-md) * 2.5);
  padding-block: var(--hs-space-2);
}

.hs-input::placeholder,
.hs-textarea::placeholder {
  color: var(--hs-fg-placeholder);
  -webkit-text-fill-color: var(--hs-fg-placeholder);
  opacity: 1;
  font-weight: var(--hs-weight-regular);
}

.hs-input:hover:not(:disabled),
.hs-select:hover:not(:disabled),
.hs-textarea:hover:not(:disabled) {
  border-color: var(--hs-border-strong);
}

/* Text fields show focus on click and keyboard entry. The one-pixel neutral
   border changes colour without changing the field's size or shape. */
.hs-input:focus,
.hs-select:focus,
.hs-textarea:focus {
  outline: none;
  border-color: var(--hs-border-field-focus);
  box-shadow: none;
}

.hs-input:disabled,
.hs-select:disabled,
.hs-textarea:disabled {
  background: var(--hs-bg-sunken);
  color: var(--hs-fg-disabled);
  cursor: not-allowed;
}

.hs-input[aria-invalid="true"],
.hs-select[aria-invalid="true"],
.hs-textarea[aria-invalid="true"] {
  border-color: var(--hs-danger-solid);
}

.hs-input[aria-invalid="true"]:focus,
.hs-textarea[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 var(--hs-size-focus-ring) var(--hs-danger-bg);
}

.hs-select {
  appearance: none;
  padding-inline-end: var(--hs-space-8);
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% + 1px),
    calc(100% - 13px) calc(50% + 1px);
  background-size: 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

/* Input with leading/trailing adornments. */
.hs-input-group {
  display: flex;
  align-items: center;
  gap: var(--hs-space-2);
  padding-inline: var(--hs-space-3);
  background: var(--hs-glass-raised);
  backdrop-filter: var(--hs-glass-blur);
  -webkit-backdrop-filter: var(--hs-glass-blur);
  border: var(--hs-size-hairline) solid var(--hs-glass-rim);
  border-radius: var(--hs-radius-md);
  color: var(--hs-fg-tertiary);
}

/* The group is the field's boundary once an input sits inside it, so it takes
   the field treatment rather than the chrome one. */
.hs-input-group:focus-within {
  border-color: var(--hs-border-field-focus);
  box-shadow: none;
}

.hs-input-group > .hs-input {
  border: 0;
  padding-inline: 0;
  background: transparent;
}

.hs-input-group > .hs-input:focus {
  box-shadow: none;
}

/* --- Checkbox / radio --- */
.hs-check {
  display: inline-flex;
  align-items: flex-start;
  gap: var(--hs-space-2);
  cursor: pointer;
  font-size: var(--hs-text-sm);
  line-height: var(--hs-leading-normal);
}

.hs-check input[type="checkbox"],
.hs-check input[type="radio"] {
  flex: none;
  width: var(--hs-size-icon-lg);
  height: var(--hs-size-icon-lg);
  margin: 0;
  /* optical centre against a 1.5 line-height label */
  margin-block-start: 1px;
  cursor: pointer;
}

.hs-check:has(input:disabled) {
  cursor: not-allowed;
  color: var(--hs-fg-disabled);
}

/* --- Switch --- */
.hs-switch {
  display: inline-flex;
  align-items: center;
  gap: var(--hs-space-3);
  cursor: pointer;
}

.hs-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.hs-switch__track {
  position: relative;
  flex: none;
  width: 40px;
  height: 24px;
  border-radius: var(--hs-radius-pill);
  background: var(--hs-border-control);
  transition: background-color var(--hs-duration-base) var(--hs-ease-standard);
}

.hs-switch__track::after {
  content: "";
  position: absolute;
  inset-block-start: 3px;
  inset-inline-start: 3px;
  width: 18px;
  height: 18px;
  border-radius: var(--hs-radius-circle);
  background: var(--hs-switch-thumb);
  box-shadow: var(--hs-elevation-raised);
  transition: transform var(--hs-duration-base) var(--hs-ease-spring);
}

.hs-switch input:checked + .hs-switch__track {
  background: var(--hs-switch-on);
}

.hs-switch input:checked + .hs-switch__track::after {
  transform: translateX(16px);
}

.hs-switch input:focus-visible + .hs-switch__track {
  outline: var(--hs-size-focus-ring) solid var(--hs-border-focus);
  outline-offset: var(--hs-size-focus-offset);
}

.hs-switch input:disabled + .hs-switch__track {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================================
   Table
   ============================================================ */
.hs-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.hs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--hs-text-sm);
}

.hs-table thead th {
  position: sticky;
  top: 0;
  z-index: var(--hs-layer-raised);
  padding: var(--hs-space-3) var(--hs-space-4);
  background: var(--hs-bg-inset);
  border-bottom: var(--hs-size-hairline) solid var(--hs-border-default);
  font-family: var(--hs-font-ui);
  font-size: var(--hs-text-xs);
  font-weight: var(--hs-weight-semibold);
  letter-spacing: var(--hs-tracking-caps);
  text-transform: uppercase;
  text-align: start;
  color: var(--hs-fg-tertiary);
  white-space: nowrap;
}

.hs-table tbody td {
  padding: var(--hs-space-3) var(--hs-space-4);
  border-bottom: var(--hs-size-hairline) solid var(--hs-border-subtle);
  vertical-align: middle;
}

.hs-table tbody tr:last-child td {
  border-bottom: 0;
}

.hs-table tbody tr:hover td {
  background: var(--hs-bg-sunken);
}

/* Numeric columns: right-aligned and tabular, always. */
.hs-table :is(th, td).hs-num {
  text-align: end;
  font-variant-numeric: tabular-nums;
}

.hs-table--compact :is(thead th, tbody td) {
  padding-block: var(--hs-space-2);
}

/* ============================================================
   Tabs
   ============================================================ */
.hs-tabs {
  display: flex;
  align-items: center;
  gap: var(--hs-space-1);
  border-bottom: var(--hs-size-hairline) solid var(--hs-border-default);
  overflow-x: auto;
  scrollbar-width: none;
}

.hs-tabs::-webkit-scrollbar {
  display: none;
}

.hs-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--hs-space-2);
  height: var(--hs-size-control-lg);
  padding-inline: var(--hs-space-3);
  border: 0;
  background: transparent;
  font-family: var(--hs-font-ui);
  font-size: var(--hs-text-sm);
  font-weight: var(--hs-weight-semibold);
  white-space: nowrap;
  color: var(--hs-fg-tertiary);
  cursor: pointer;
  transition: color var(--hs-duration-fast) var(--hs-ease-standard);
}

.hs-tab:hover {
  color: var(--hs-fg-primary);
}

.hs-tab[aria-selected="true"] {
  color: var(--hs-fg-primary);
}

.hs-tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  inset-inline: var(--hs-space-2);
  inset-block-end: -1px;
  height: 2px;
  border-radius: var(--hs-radius-pill);
  background: var(--hs-accent-solid);
}

/* Pill tab set, for filter rows rather than page navigation. */
.hs-tabs--pills {
  border-bottom: 0;
  gap: var(--hs-space-2);
}

.hs-tabs--pills .hs-tab {
  height: var(--hs-size-control-sm);
  border-radius: var(--hs-radius-pill);
  background: var(--hs-bg-sunken);
  font-size: var(--hs-text-xs);
}

.hs-tabs--pills .hs-tab[aria-selected="true"] {
  background: var(--hs-accent-muted);
  color: var(--hs-accent-ink);
}

.hs-tabs--pills .hs-tab[aria-selected="true"]::after {
  display: none;
}

/* ============================================================
   Nav item  (sidebar / dock rows)
   ============================================================ */
.hs-nav-item {
  display: flex;
  align-items: center;
  gap: var(--hs-space-3);
  height: var(--hs-size-control-md);
  padding-inline: var(--hs-space-3);
  border-radius: var(--hs-radius-sm);
  font-family: var(--hs-font-ui);
  font-size: var(--hs-text-sm);
  font-weight: var(--hs-weight-medium);
  color: var(--hs-fg-secondary);
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--hs-duration-fast) var(--hs-ease-standard),
    color var(--hs-duration-fast) var(--hs-ease-standard);
}

.hs-nav-item:hover {
  background: var(--hs-bg-sunken);
  color: var(--hs-fg-primary);
}

/* Selected row = full-strength ink + bold label + filled icon, and no background of
   its own; the pill belongs to hover, on any row. Idle rows sit at medium so the bold
   selected label reads as a step up. Both shipping navs follow this — the admin
   sidebar in admin-dashboard.css and the owner sidebar in handshake-pages.css. */
.hs-nav-item[aria-current] {
  background: none;
  color: var(--hs-fg-primary);
  font-weight: var(--hs-weight-bold);
}

.hs-nav-item[aria-current]:hover {
  background: var(--hs-bg-sunken);
}

/* ============================================================
   Avatar
   ============================================================ */
.hs-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: var(--hs-size-avatar-md);
  height: var(--hs-size-avatar-md);
  border-radius: var(--hs-radius-circle);
  background: var(--hs-accent-muted);
  color: var(--hs-accent-ink);
  font-family: var(--hs-font-ui);
  font-size: var(--hs-text-xs);
  font-weight: var(--hs-weight-bold);
  line-height: 1;
  overflow: hidden;
  user-select: none;
}

.hs-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hs-avatar--sm {
  width: var(--hs-size-avatar-sm);
  height: var(--hs-size-avatar-sm);
  font-size: var(--hs-text-2xs);
}

.hs-avatar--lg {
  width: var(--hs-size-avatar-lg);
  height: var(--hs-size-avatar-lg);
  font-size: var(--hs-text-sm);
}

/* Julia / agent avatars read purple so an AI actor is never mistaken for a human one. */
.hs-avatar--agent {
  background: var(--hs-accent2-muted);
  color: var(--hs-accent2-ink);
}

.hs-avatar-stack {
  display: inline-flex;
}

.hs-avatar-stack > .hs-avatar + .hs-avatar {
  margin-inline-start: calc(var(--hs-space-2) * -1);
  box-shadow: 0 0 0 2px var(--hs-bg-raised);
}

/* ============================================================
   Progress / meter
   ============================================================ */
.hs-progress {
  width: 100%;
  height: var(--hs-space-2);
  border-radius: var(--hs-radius-pill);
  background: var(--hs-bg-sunken);
  overflow: hidden;
}

/* Filled by sliding a full-width bar out from under the track's left edge, not
   by growing its width. Two reasons, and the second is the one that decides it:
   width is a layout property and animates on the main thread, and scaleX — the
   usual replacement — squashes the pill radius on the leading end as it grows.
   Translating a bar that is always 100% wide keeps both ends round.

   Set --hs-progress to a 0-1 fraction:  style="--hs-progress:.64" */
.hs-progress__bar {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--hs-accent-solid);
  transform: translateX(calc(-100% + var(--hs-progress, 0) * 100%));
  transition: transform var(--hs-duration-slow) var(--hs-ease-out);
}

.hs-progress__bar--warning {
  background: var(--hs-warning-solid);
}

.hs-progress__bar--danger {
  background: var(--hs-danger-solid);
}

/* Indeterminate. The keyframes drive translateX themselves, so the fraction
   above is irrelevant here — but the transition is not, and left in place it
   fights the animation on the first frame. */
.hs-progress--indeterminate .hs-progress__bar {
  width: 35%;
  transition: none;
  animation: hs-indeterminate 1.4s var(--hs-ease-standard) infinite;
}

@keyframes hs-indeterminate {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(340%);
  }
}

/* ============================================================
   Skeleton
   ============================================================ */
.hs-skeleton {
  border-radius: var(--hs-radius-xs);
  background: linear-gradient(
    90deg,
    var(--hs-bg-sunken) 0%,
    var(--hs-bg-inset) 50%,
    var(--hs-bg-sunken) 100%
  );
  background-size: 200% 100%;
  animation: hs-shimmer 1.4s var(--hs-ease-standard) infinite;
}

.hs-skeleton--text {
  height: 1em;
}

@keyframes hs-shimmer {
  to {
    background-position: -200% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hs-skeleton,
  .hs-progress--indeterminate .hs-progress__bar {
    animation: none;
  }
}

/* ============================================================
   Tooltip
   Pure CSS, no JS. For anything interactive inside the bubble use a popover.
   ============================================================ */
.hs-tip {
  position: relative;
}

.hs-tip::after {
  content: attr(data-hs-tip);
  position: absolute;
  inset-block-end: calc(100% + var(--hs-space-2));
  inset-inline-start: 50%;
  translate: -50% 0;
  z-index: var(--hs-layer-tooltip);
  padding: var(--hs-space-2) var(--hs-space-3);
  border-radius: var(--hs-radius-xs);
  background: var(--hs-bg-inverse);
  color: var(--hs-fg-inverse);
  font-size: var(--hs-text-xs);
  line-height: var(--hs-leading-snug);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--hs-duration-fast) var(--hs-ease-standard);
}

.hs-tip:hover::after,
.hs-tip:focus-visible::after {
  opacity: 1;
}

/* ============================================================
   Toolbar
   ============================================================ */
.hs-toolbar {
  display: flex;
  align-items: center;
  gap: var(--hs-space-3);
  min-height: var(--hs-size-control-lg);
  padding: var(--hs-space-2) var(--hs-space-4);
  background: var(--hs-glass-raised);
  backdrop-filter: var(--hs-glass-blur);
  -webkit-backdrop-filter: var(--hs-glass-blur);
  border-bottom: var(--hs-size-hairline) solid var(--hs-glass-rim);
}

.hs-toolbar--sticky {
  position: sticky;
  top: 0;
  z-index: var(--hs-layer-sticky);
}

/* ============================================================
   GLASS NOTE
   Cards, buttons, inputs and toolbars are all translucent. That only works
   while the page carries a wash - a glass component over a flat white page
   collapses and loses its hierarchy. If a surface ever needs an opaque
   background, --hs-bg-raised is still available and unchanged.
   ============================================================ */

/* ============================================================
   Icon
   Inline SVG only — no icon font, no sprite fetch, so icons survive the
   CSP sandbox and inherit currentColor for free.
   ============================================================ */
.hs-icon {
  width: var(--hs-icon-size, var(--hs-size-icon-md));
  height: var(--hs-icon-size, var(--hs-size-icon-md));
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hs-icon--sm { --hs-icon-size: var(--hs-size-icon-sm); }
.hs-icon--lg { --hs-icon-size: var(--hs-size-icon-lg); }

/* Brand marks are solid, not stroked. Separate class so .hs-icon's
   `fill: none` cannot erase them. */
.hs-mark {
  width: var(--hs-icon-size, var(--hs-size-icon-lg));
  height: var(--hs-icon-size, var(--hs-size-icon-lg));
  flex: none;
  fill: currentColor;
  stroke: none;
}

.hs-mark--sm { --hs-icon-size: var(--hs-size-icon-md); }
.hs-mark--lg { --hs-icon-size: var(--hs-size-avatar-md); }

/* ============================================================
   Dock — the floating mobile drawer, ported from v1's
   .hs-portal-footer-nav. Frosted pill + Julia disc, centred and lifted
   off the bottom edge rather than pinned flat to it.
   ============================================================ */
.hs-dock {
  --hs-dock-h: 52px;
  --hs-dock-max: 400px;
  --hs-dock-gutter: max(12px, env(safe-area-inset-left, 0px));

  position: var(--hs-dock-position, fixed);
  left: 0;
  right: 0;
  bottom: calc(max(12px, env(safe-area-inset-bottom, 0px)));
  z-index: var(--hs-layer-dock);
  width: min(85%, var(--hs-dock-max), calc(100% - 2 * var(--hs-dock-gutter)));
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.hs-dock > * {
  pointer-events: auto;
}

/* The frosted pill. Glass over page content — the blur is the point, so it
   needs scrollable content behind it to read correctly. */
.hs-dock__pill {
  flex: 1 1 auto;
  min-width: 0;
  height: var(--hs-dock-h);
  display: flex;
  align-items: stretch;
  justify-content: space-evenly;
  border-radius: var(--hs-radius-pill);
  background: var(--hs-dock-bg);
  border: 1px solid var(--hs-dock-border);
  backdrop-filter: var(--hs-glass-blur-strong);
  -webkit-backdrop-filter: var(--hs-glass-blur-strong);
  box-shadow: var(--hs-dock-lift);
  overflow: hidden;
}

.hs-dock__item {
  flex: 1 1 0;
  min-width: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--hs-dock-fg);
  text-decoration: none;
  cursor: pointer;
  position: relative;
  transition: color var(--hs-duration-fast) var(--hs-ease-standard);
}

/* Icon-only. The label stays in the DOM for screen readers and voice control —
   an icon-only control with no accessible name is unusable without sight. */
.hs-dock__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.hs-dock__item:hover {
  color: var(--hs-dock-fg-active);
}

/* Without labels, the active item needs a shape to carry the state. */
.hs-dock__item[aria-current] {
  color: var(--hs-dock-fg-active);
}

.hs-dock__item[aria-current]::before {
  content: "";
  position: absolute;
  width: 38px;
  height: 34px;
  border-radius: var(--hs-radius-pill);
  background: var(--hs-accent-muted);
}

.hs-dock__item .hs-icon {
  position: relative;
}

/* Julia. Sits outside the pill as its own disc — she is not a nav
   destination, so she does not live in the nav. */
.hs-dock__disc {
  flex: none;
  width: var(--hs-dock-h);
  height: var(--hs-dock-h);
  display: grid;
  place-items: center;
  border-radius: var(--hs-radius-circle);
  border: 1px solid var(--hs-dock-border);
  background: var(--hs-accent-solid);
  color: var(--hs-fg-on-accent);
  box-shadow: var(--hs-dock-lift);
  font-family: var(--hs-font-ui);
  font-weight: var(--hs-weight-bold);
  font-size: var(--hs-text-xs);
  cursor: pointer;
}

/* Expandable "More" sheet — grows upward from the pill. */
.hs-dock__sheet {
  position: absolute;
  inset-inline: 0;
  bottom: calc(var(--hs-dock-h) + 10px);
  padding: var(--hs-space-2);
  border-radius: var(--hs-radius-2xl);
  background: var(--hs-bg-raised);
  border: 1px solid var(--hs-border-subtle);
  box-shadow: var(--hs-elevation-popover);
  display: none;
}

.hs-dock[data-expanded] .hs-dock__sheet {
  display: block;
}

/* ============================================================
   Dock expansion — More / Agents sheets
   Ported from v1's .hs-portal-footer-nav. Two mechanics worth keeping:

   1. Height animates via grid-template-rows 0fr -> 1fr. There is no
      transition to height:auto, and a fixed max-height would either clip
      short content or over-animate tall content.
   2. The pill DROPS its glass while expanded. The sheet becomes the glass
      container, so you never stack blur on blur — which reads as fog.

   The sheet grows upward; the dock row never changes height.
   ============================================================ */
.hs-dock__sheet {
  display: grid;
  grid-template-rows: 0fr;
  width: 100%;
  min-height: 0;
  transition: grid-template-rows var(--hs-duration-expand) var(--hs-ease-spring);
}

.hs-dock[data-expanded] .hs-dock__sheet {
  grid-template-rows: 1fr;
}

.hs-dock__sheet-inner {
  overflow: hidden;
  min-height: 0;
  border-radius: var(--hs-radius-2xl);
  background: var(--hs-glass-card);
  backdrop-filter: var(--hs-glass-blur);
  -webkit-backdrop-filter: var(--hs-glass-blur);
  border: var(--hs-size-hairline) solid var(--hs-glass-card-border);
  box-shadow: var(--hs-glass-lift-strong);
  margin-bottom: var(--hs-space-2);
}

.hs-dock[data-expanded] .hs-dock__sheet-inner {
  overflow-y: auto;
  overscroll-behavior: contain;
  /* Never taller than the space above the dock. */
  max-height: calc(100dvh - var(--hs-dock-h) - var(--hs-space-16));
}

/* While the sheet is open the pill is just a row of controls on top of it. */
.hs-dock[data-expanded] .hs-dock__pill {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.hs-dock__sheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: var(--hs-space-1);
  padding: var(--hs-space-3);
}

.hs-dock__sheet-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--hs-space-2);
  padding: var(--hs-space-3) var(--hs-space-2);
  border: 0;
  border-radius: var(--hs-radius-lg);
  background: transparent;
  font-family: var(--hs-font-ui);
  font-size: var(--hs-text-xs);
  font-weight: var(--hs-weight-semibold);
  color: var(--hs-fg-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--hs-duration-fast) var(--hs-ease-standard);
}

.hs-dock__sheet-item:hover {
  background: var(--hs-glass-sunken);
  color: var(--hs-fg-primary);
}

.hs-dock__sheet-head {
  display: flex;
  align-items: center;
  gap: var(--hs-space-2);
  padding: var(--hs-space-3) var(--hs-space-4) 0;
  font-family: var(--hs-font-ui);
  font-size: var(--hs-text-xs);
  font-weight: var(--hs-weight-bold);
  letter-spacing: var(--hs-tracking-caps);
  text-transform: uppercase;
  color: var(--hs-fg-tertiary);
}

/* ============================================================
   Filters — trigger, popover (desktop), sheet (mobile), applied chips

   NOTE: the popover and sheet are deliberately NOT glass. They sit above a
   scrim and must read as a separate, decidable layer. v1 made the same call
   explicitly. This is the standing exception to glass-everywhere: anything
   over a scrim is solid.
   ============================================================ */
.hs-filter-bar {
  display: flex;
  align-items: center;
  gap: var(--hs-space-2);
  flex-wrap: wrap;
}

.hs-filter {
  position: relative;
}

.hs-filter__trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--hs-space-2);
  height: var(--hs-size-control-sm);
  padding-inline: var(--hs-space-3);
  border: var(--hs-size-hairline) solid var(--hs-glass-rim);
  border-radius: var(--hs-radius-pill);
  background: var(--hs-glass-raised);
  backdrop-filter: var(--hs-glass-blur);
  -webkit-backdrop-filter: var(--hs-glass-blur);
  font-family: var(--hs-font-ui);
  font-size: var(--hs-text-xs);
  font-weight: var(--hs-weight-semibold);
  color: var(--hs-fg-primary);
  cursor: pointer;
}

.hs-filter__trigger[aria-expanded="true"] {
  background: var(--hs-accent-muted);
  color: var(--hs-accent-ink);
}

.hs-filter__chev {
  transition: rotate var(--hs-duration-base) var(--hs-ease-standard);
}

.hs-filter__trigger[aria-expanded="true"] .hs-filter__chev {
  rotate: 180deg;
}

.hs-filter__count {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding-inline: 4px;
  border-radius: var(--hs-radius-pill);
  background: var(--hs-accent-solid);
  color: var(--hs-fg-on-accent);
  font-size: var(--hs-text-2xs);
  font-variant-numeric: tabular-nums;
}

/* Desktop: anchored popover. Solid, not glass. */
.hs-filter__pop {
  position: absolute;
  top: calc(100% + var(--hs-space-2));
  inset-inline-start: 0;
  z-index: var(--hs-layer-overlay);
  min-width: 244px;
  padding: var(--hs-space-2);
  border: var(--hs-size-hairline) solid var(--hs-border-default);
  border-radius: var(--hs-radius-lg);
  background: var(--hs-bg-raised);
  box-shadow: var(--hs-elevation-popover);
  opacity: 0;
  translate: 0 -4px;
  visibility: hidden;
  /* opacity is on its own duration on purpose. Under prefers-reduced-motion the
     translate collapses to 1ms — correct, the slide is the vestibular part — but
     --hs-duration-fade survives, so the popover still cross-fades in rather than
     appearing out of nothing. visibility waits on the fade, the longer of the
     two, or the pop would be gone before it finished fading out. */
  transition:
    opacity var(--hs-duration-fade) var(--hs-ease-out),
    translate var(--hs-duration-fast) var(--hs-ease-out),
    visibility 0s linear var(--hs-duration-fade);
}

.hs-filter__trigger[aria-expanded="true"] + .hs-filter__pop {
  opacity: 1;
  translate: 0 0;
  visibility: visible;
  transition-delay: 0s;
}

.hs-filter__option {
  display: flex;
  align-items: center;
  gap: var(--hs-space-2);
  width: 100%;
  padding: var(--hs-space-2) var(--hs-space-3);
  border: 0;
  border-radius: var(--hs-radius-sm);
  background: transparent;
  font-size: var(--hs-text-sm);
  color: var(--hs-fg-primary);
  text-align: start;
  cursor: pointer;
}

.hs-filter__option:hover {
  background: var(--hs-bg-sunken);
}

.hs-filter__option[aria-selected="true"] {
  background: var(--hs-accent-muted);
  color: var(--hs-accent-ink);
}

/* Applied filter chip — badge geometry plus a remove affordance. */
.hs-fchip {
  display: inline-flex;
  align-items: center;
  gap: var(--hs-space-2);
  height: var(--hs-size-control-sm);
  padding: 0 var(--hs-space-1) 0 var(--hs-space-3);
  border: var(--hs-size-hairline) solid var(--hs-accent-muted);
  border-radius: var(--hs-radius-pill);
  background: var(--hs-accent-subtle);
  font-family: var(--hs-font-ui);
  font-size: var(--hs-text-xs);
  font-weight: var(--hs-weight-semibold);
  color: var(--hs-accent-ink);
}

.hs-fchip__key {
  opacity: 0.65;
  font-weight: var(--hs-weight-medium);
}

.hs-fchip__x {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: var(--hs-radius-circle);
  background: transparent;
  color: inherit;
  cursor: pointer;
  line-height: 1;
}

.hs-fchip__x:hover {
  background: var(--hs-accent-muted);
}

/* Mobile: the same filters as a positioned sheet rather than a popover. */
.hs-filter-sheet {
  position: absolute;
  inset-block-start: var(--hs-space-16);
  inset-inline-end: var(--hs-space-4);
  z-index: var(--hs-layer-modal);
  display: flex;
  flex-direction: column;
  gap: var(--hs-space-3);
  width: min(360px, calc(100% - var(--hs-space-8)));
  max-height: min(70%, 560px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--hs-space-4);
  border: var(--hs-size-hairline) solid var(--hs-border-strong);
  border-radius: var(--hs-radius-xl);
  background: var(--hs-bg-raised);
  box-shadow: var(--hs-elevation-popover);
  opacity: 0;
  translate: 0 -8px;
  visibility: hidden;
  /* See .hs-filter__pop — the fade outlives the slide under reduced motion. */
  transition:
    opacity var(--hs-duration-fade) var(--hs-ease-spring),
    translate var(--hs-duration-base) var(--hs-ease-spring),
    visibility 0s linear var(--hs-duration-base);
}

.hs-filter-sheet[data-open] {
  opacity: 1;
  translate: 0 0;
  visibility: visible;
  transition-delay: 0s;
}

.hs-filter-sheet__foot {
  display: flex;
  gap: var(--hs-space-2);
  padding-top: var(--hs-space-3);
  border-top: var(--hs-size-hairline) solid var(--hs-border-subtle);
}

.hs-scrim {
  position: absolute;
  inset: 0;
  z-index: var(--hs-layer-overlay);
  background: var(--hs-bg-scrim);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--hs-duration-base) var(--hs-ease-standard),
    visibility 0s linear var(--hs-duration-base);
}

.hs-scrim[data-open] {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

/* ============================================================
   Wallet — stacked integration cards

   Apple Wallet's actual model, which the first pass got wrong:
     - cards overlap permanently so every title peeks through
     - opening does NOT unstack the pile; the opened card lifts OUT of it and
       fills the frame, while the rest stay stacked behind
     - examples are separate cards you move between, not a hidden second face

   Layout is container-driven, not viewport-driven: the same card shows its
   examples as a swipe track when narrow and as a column beside the detail
   when there is room. The device frame is not the viewport, so @container is
   the only thing that reads the real available width.
   ============================================================ */
.hs-wallet {
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  --hs-wallet-peek: 62px;
  --hs-wallet-card-h: 108px;
}

.hs-wallet__card {
  position: relative;
  height: var(--hs-wallet-card-h);
  border-radius: var(--hs-radius-xl);
  background: var(--hs-glass-card);
  backdrop-filter: var(--hs-glass-blur-card);
  -webkit-backdrop-filter: var(--hs-glass-blur-card);
  border: var(--hs-size-hairline) solid var(--hs-glass-card-border);
  box-shadow: var(--hs-glass-lift-strong);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  /* motion-a11y-allow: the deck's whole point is that it is normal flow — the
     card below moves because the card above got taller, with nothing to keep in
     sync. Moving height/margin onto transform means absolute positioning and
     z-index choreography, which is the design this one deliberately replaced.
     The cost is real and accepted: this transition runs on the main thread. */
  transition:
    height var(--hs-duration-wallet) var(--hs-ease-spring),
    margin-top var(--hs-duration-wallet) var(--hs-ease-spring),
    transform var(--hs-duration-base) var(--hs-ease-spring);
}

/* Stacked in normal flow: each card rides up under the one before it, leaving
   exactly the peek visible. A fixed px offset, NOT a percentage — percentage
   margins resolve against width, which is what broke the first attempt. */
.hs-wallet__card + .hs-wallet__card {
  margin-top: calc(var(--hs-wallet-peek) - var(--hs-wallet-card-h));
  z-index: 1;
}

.hs-wallet__card:not([data-open]):hover {
  transform: translateY(-4px);
}

/* Opening just makes the card tall. Everything after it is in normal flow, so
   the cards below simply slide down — no absolute positioning, no z-index
   choreography, nothing to keep in sync. */
.hs-wallet__card[data-open] {
  height: var(--hs-wallet-open-h, 520px);
  cursor: default;
  box-shadow: var(--hs-elevation-popover);
  z-index: 2;
}

/* The card directly below stops overlapping, so the open card keeps its edge. */
.hs-wallet__card[data-open] + .hs-wallet__card {
  margin-top: var(--hs-space-3);
}

.hs-wallet__head {
  display: flex;
  align-items: center;
  gap: var(--hs-space-3);
  min-height: var(--hs-wallet-peek);
  flex: none;
  padding: var(--hs-space-4) var(--hs-space-5);
}

.hs-wallet__card[data-open] .hs-wallet__head {
  border-bottom: var(--hs-size-hairline) solid var(--hs-glass-rim);
}

.hs-wallet__logo {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: var(--hs-radius-sm);
  background: var(--hs-glass-raised);
  border: var(--hs-size-hairline) solid var(--hs-glass-rim);
  overflow: hidden;
}

.hs-wallet__logo img { width: 22px; height: 22px; object-fit: contain; }

.hs-wallet__name {
  font-family: var(--hs-font-ui);
  font-size: var(--hs-text-sm);
  font-weight: var(--hs-weight-semibold);
  line-height: 1.2;
}

.hs-wallet__meta { font-size: var(--hs-text-xs); color: var(--hs-fg-tertiary); }

.hs-wallet__close {
  display: none;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border: 0;
  border-radius: var(--hs-radius-circle);
  background: var(--hs-glass-sunken);
  color: var(--hs-fg-secondary);
  cursor: pointer;
}

.hs-wallet__card[data-open] .hs-wallet__close { display: grid; }

.hs-wallet__body {
  display: none;
  flex: 1;
  min-height: 0;
}

.hs-wallet__card[data-open] .hs-wallet__body { display: block; }

/* Detail and examples ride one horizontal track. On a narrow card the first
   example PEEKS in from the right, which is the whole affordance — you can
   see there is more without being told to swipe. */
.hs-wallet__layout {
  display: flex;
  gap: var(--hs-space-3);
  height: 100%;
  padding: var(--hs-space-5);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.hs-wallet__layout::-webkit-scrollbar { display: none; }

.hs-wallet__detail {
  flex: 0 0 86%;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hs-wallet__detail-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

/* Actions live in the same spot on every connector, connected or not, so the
   primary control never moves as you page through the stack. */
.hs-wallet__actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--hs-space-2);
  padding-top: var(--hs-space-4);
  margin-top: var(--hs-space-4);
  border-top: var(--hs-size-hairline) solid var(--hs-glass-rim);
}

.hs-wallet__actions .hs-btn--primary {
  flex: 1;
}

.hs-wallet__examples {
  display: flex;
  gap: var(--hs-space-3);
  min-width: 0;
}

.hs-example {
  position: relative;
  flex: 0 0 260px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: var(--hs-space-2);
  padding: var(--hs-space-5);
  padding-inline-start: calc(var(--hs-space-5) + 3px);
  border-radius: var(--hs-radius-lg);
  background:
    linear-gradient(152deg, var(--hs-accent2-subtle), transparent 46%),
    linear-gradient(0deg, var(--hs-accent-subtle), var(--hs-accent-subtle));
  border: var(--hs-size-hairline) solid var(--hs-glass-recessed-border);
  overflow: hidden;
}

/* An accent rule down the leading edge — the same signal the agent badge uses. */
.hs-example::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--hs-accent2-solid), var(--hs-accent-solid));
}

/* Wide enough: examples become a fixed right-hand rail — fully exposed,
   mirroring the nav rail on the left. Scrolls on its own if there are many. */
@container (min-width: 680px) {
  .hs-wallet__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--hs-wallet-rail, 300px);
    overflow: hidden;
  }

  .hs-wallet__detail { flex: none; }

  .hs-wallet__examples {
    flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-inline-start: var(--hs-space-5);
    border-inline-start: var(--hs-size-hairline) solid var(--hs-glass-rim);
  }

  .hs-example { flex: 0 0 auto; }
}

.hs-example__ask,
.hs-example__got {
  display: flex;
  gap: var(--hs-space-2);
  font-size: var(--hs-text-sm);
  line-height: var(--hs-leading-normal);
}

.hs-example__ask { color: var(--hs-accent2-ink); }
.hs-example__got { color: var(--hs-fg-secondary); }

.hs-example__tag {
  flex: none;
  font-family: var(--hs-font-mono);
  font-size: var(--hs-text-2xs);
  text-transform: uppercase;
  letter-spacing: var(--hs-tracking-caps);
  padding-top: 3px;
  opacity: 0.65;
}

/* ============================================================
   Code block — MMI / dial codes for call forwarding
   ============================================================ */
.hs-code {
  display: inline-flex;
  align-items: center;
  gap: var(--hs-space-3);
  padding: var(--hs-space-2) var(--hs-space-3);
  border-radius: var(--hs-radius-md);
  background: var(--hs-glass-recessed);
  border: var(--hs-size-hairline) solid var(--hs-glass-recessed-border);
  font-family: var(--hs-font-mono);
  font-size: var(--hs-text-lg);
  font-weight: var(--hs-weight-medium);
  letter-spacing: 0.04em;
  color: var(--hs-fg-primary);
}

.hs-code__copy {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: var(--hs-radius-xs);
  background: transparent;
  color: var(--hs-fg-tertiary);
  cursor: pointer;
}

.hs-code__copy:hover { background: var(--hs-glass-raised); color: var(--hs-fg-primary); }

/* ============================================================
   Step list — numbered setup flows
   ============================================================ */
.hs-steps { counter-reset: hs-step; display: flex; flex-direction: column; gap: var(--hs-space-4); }

.hs-step {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: var(--hs-space-3);
  align-items: start;
}

.hs-step::before {
  counter-increment: hs-step;
  content: counter(hs-step);
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: var(--hs-radius-circle);
  background: var(--hs-accent-muted);
  color: var(--hs-accent-ink);
  font-family: var(--hs-font-ui);
  font-size: var(--hs-text-xs);
  font-weight: var(--hs-weight-bold);
}

.hs-step[data-done]::before {
  content: "✓";
  background: var(--hs-success-solid);
  color: var(--hs-fg-on-accent);
}

.hs-step__title {
  font-family: var(--hs-font-ui);
  font-size: var(--hs-text-sm);
  font-weight: var(--hs-weight-semibold);
  margin-bottom: var(--hs-space-1);
}

/* ============================================================
   Card section — keeps related settings inside ONE block

   Splitting every group into its own card fragments the page and breaks
   reading flow. A section is a labelled band inside a card, separated by a
   hairline rather than by a gap and a new border.
   ============================================================ */
.hs-card__section {
  padding: var(--hs-space-5);
}

.hs-card__section + .hs-card__section {
  border-top: var(--hs-size-hairline) solid var(--hs-glass-rim);
}

.hs-card__section-title {
  font-family: var(--hs-font-ui);
  font-size: var(--hs-text-xs);
  font-weight: var(--hs-weight-bold);
  letter-spacing: var(--hs-tracking-caps);
  text-transform: uppercase;
  color: var(--hs-fg-tertiary);
  margin-bottom: var(--hs-space-3);
}

/* A section whose content is a list of rows needs no side padding. */
.hs-card__section--flush {
  padding-inline: 0;
  padding-block: var(--hs-space-3) 0;
}

.hs-card__section--flush > .hs-card__section-title {
  padding-inline: var(--hs-space-5);
}

/* ============================================================
   Sidebar footer — mode switch + profile
   Ported from v1's .hs-portal-sidefoot. Pinned to the bottom with
   margin-top:auto so it holds position however long the nav gets, and the
   profile menu opens UPWARD because there is nothing below it.
   ============================================================ */
.hs-shell__foot {
  margin-top: auto;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: var(--hs-space-2);
  padding: var(--hs-space-3) var(--hs-space-2) var(--hs-space-1);
  border-top: var(--hs-size-hairline) solid var(--hs-border-subtle);
}

/* Mode switch. Deliberately bordered and filled rather than a plain nav row —
   it changes which application you are in, which is not a navigation act. */
.hs-mode-switch {
  display: flex;
  align-items: center;
  gap: var(--hs-space-3);
  width: 100%;
  padding: var(--hs-space-2) var(--hs-space-3);
  border: var(--hs-size-hairline) solid var(--hs-border-default);
  border-radius: var(--hs-radius-md);
  background: var(--hs-bg-sunken);
  font-family: var(--hs-font-ui);
  font-size: var(--hs-text-sm);
  font-weight: var(--hs-weight-semibold);
  color: var(--hs-fg-secondary);
  text-align: start;
  cursor: pointer;
  transition:
    background-color var(--hs-duration-fast) var(--hs-ease-standard),
    border-color var(--hs-duration-fast) var(--hs-ease-standard),
    color var(--hs-duration-fast) var(--hs-ease-standard);
}

.hs-mode-switch:hover {
  background: var(--hs-bg-raised);
  border-color: var(--hs-border-strong);
  color: var(--hs-fg-primary);
}

/* Heading into the console — purple, matching the agent/admin signal. */
.hs-mode-switch--to-admin:hover {
  border-color: var(--hs-accent2-solid);
  color: var(--hs-accent2-ink);
}

.hs-profile {
  position: relative;
}

.hs-profile__trigger {
  display: flex;
  align-items: center;
  gap: var(--hs-space-3);
  width: 100%;
  padding: var(--hs-space-1) var(--hs-space-2);
  border: 0;
  border-radius: var(--hs-radius-md);
  background: transparent;
  font-family: var(--hs-font-ui);
  font-size: var(--hs-text-sm);
  color: var(--hs-fg-primary);
  text-align: start;
  cursor: pointer;
}

.hs-profile__trigger:hover {
  background: var(--hs-bg-sunken);
}

.hs-profile__name {
  font-weight: var(--hs-weight-semibold);
  line-height: 1.2;
}

.hs-profile__org {
  font-size: var(--hs-text-xs);
  color: var(--hs-fg-tertiary);
}

.hs-profile__chev {
  transition: rotate var(--hs-duration-base) var(--hs-ease-standard);
}

.hs-profile__trigger[aria-expanded="true"] .hs-profile__chev {
  rotate: 180deg;
}

/* Opens upward — solid, because it is an overlay. Same rule as the filter
   sheet: floating is glass, overlay is solid. */
.hs-profile__menu {
  position: absolute;
  inset-inline: 0;
  inset-block-end: calc(100% + var(--hs-space-2));
  z-index: var(--hs-layer-overlay);
  padding: var(--hs-space-1);
  border: var(--hs-size-hairline) solid var(--hs-border-default);
  border-radius: var(--hs-radius-md);
  background: var(--hs-bg-raised);
  box-shadow: var(--hs-elevation-popover);
  opacity: 0;
  translate: 0 4px;
  visibility: hidden;
  /* See .hs-filter__pop — the fade outlives the slide under reduced motion. */
  transition:
    opacity var(--hs-duration-fade) var(--hs-ease-out),
    translate var(--hs-duration-fast) var(--hs-ease-out),
    visibility 0s linear var(--hs-duration-fade);
}

.hs-profile__trigger[aria-expanded="true"] + .hs-profile__menu {
  opacity: 1;
  translate: 0 0;
  visibility: visible;
  transition-delay: 0s;
}

.hs-profile__item {
  display: flex;
  align-items: center;
  gap: var(--hs-space-2);
  width: 100%;
  padding: var(--hs-space-2) var(--hs-space-3);
  border: 0;
  border-radius: var(--hs-radius-sm);
  background: transparent;
  font-size: var(--hs-text-sm);
  color: var(--hs-fg-primary);
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}

.hs-profile__item:hover {
  background: var(--hs-bg-sunken);
}

.hs-profile__item--danger {
  color: var(--hs-danger-fg);
}

.hs-profile__sep {
  height: var(--hs-size-hairline);
  margin: var(--hs-space-1) var(--hs-space-2);
  background: var(--hs-border-subtle);
}

/* ============================================================
   Heading roles  (2026-08 audit, UI-001/UI-011)

   The workspace grew five heading treatments per page with levels that
   invert visually (an H5 at 15.2px over an H3 at 12.48px). These four
   classes are the sanctioned roles; the ELEMENT stays whatever the
   document outline needs, the CLASS carries the look. Sizes are token
   stops only — the fractional em-math sizes (14.72/15.2/12.48) map to
   text-base/text-sm.

     hs-h-page     one per tab; the H1
     hs-h-eyebrow  section group label; pairs with .hs-h-eyebrow-sub
     hs-h-card     card/row title
     hs-h-sub      title inside a card's fold
   ============================================================ */
.hs-h-page {
  margin: 0;
  font-family: var(--hs-font-display);
  font-size: var(--hs-text-3xl);
  font-weight: var(--hs-weight-semibold);
  line-height: var(--hs-leading-tight);
  color: var(--hs-fg-primary);
}

.hs-h-eyebrow {
  margin: 0;
  font-family: var(--hs-font-ui);
  font-size: var(--hs-text-xs);
  font-weight: var(--hs-weight-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hs-fg-tertiary);
}

.hs-h-eyebrow-sub {
  margin: 0;
  font-size: var(--hs-text-sm);
  color: var(--hs-fg-tertiary);
}

.hs-h-card {
  margin: 0;
  font-family: var(--hs-font-ui);
  font-size: var(--hs-text-base);
  font-weight: var(--hs-weight-semibold);
  line-height: var(--hs-leading-snug);
  color: var(--hs-fg-primary);
}

.hs-h-sub {
  margin: 0;
  font-family: var(--hs-font-ui);
  font-size: var(--hs-text-sm);
  font-weight: var(--hs-weight-semibold);
  line-height: var(--hs-leading-snug);
  color: var(--hs-fg-primary);
}
